@arsedizioni/ars-utils 22.5.32 → 22.5.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/arsedizioni-ars-utils-core.mjs +81 -1
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/package.json +1 -1
- package/types/arsedizioni-ars-utils-core.d.ts +74 -2
- package/fesm2022/arsedizioni-ars-utils-ui.application.mjs +0 -323
- package/fesm2022/arsedizioni-ars-utils-ui.application.mjs.map +0 -1
- package/types/arsedizioni-ars-utils-ui.application.d.ts +0 -126
- package/ui.application/package.json +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arsedizioni-ars-utils-core.mjs","sources":["../../../projects/ars-utils/core/definitions.ts","../../../projects/ars-utils/core/messages.ts","../../../projects/ars-utils/core/system.ts","../../../projects/ars-utils/core/selectable.ts","../../../projects/ars-utils/core/directives/autoFocusDirective.ts","../../../projects/ars-utils/core/directives/changeDateIntervalDirective.ts","../../../projects/ars-utils/core/directives/copyClipboardDirective.ts","../../../projects/ars-utils/core/directives/removeFocusDirective.ts","../../../projects/ars-utils/core/pipes/format-html.pipe.ts","../../../projects/ars-utils/core/pipes/format.pipe.ts","../../../projects/ars-utils/core/pipes/replace.pipe.ts","../../../projects/ars-utils/core/pipes/safe-html.pipe.ts","../../../projects/ars-utils/core/pipes/safe-url.pipe.ts","../../../projects/ars-utils/core/pipes/search-callback.pipe.ts","../../../projects/ars-utils/core/pipes/search-filter.pipe.ts","../../../projects/ars-utils/core/services/broadcastChannelManager.ts","../../../projects/ars-utils/core/services/broadcast.service.ts","../../../projects/ars-utils/core/services/environment.service.ts","../../../projects/ars-utils/core/services/screen.service.ts","../../../projects/ars-utils/core/services/splash.service.ts","../../../projects/ars-utils/core/services/theme.service.ts","../../../projects/ars-utils/core/public_api.ts","../../../projects/ars-utils/core/arsedizioni-ars-utils-core.ts"],"sourcesContent":["\nexport interface INode {\n id: string;\n name: string;\n count?: number;\n children?: INode[];\n subFolders?: INode[];\n parent?: INode;\n level?: number;\n bag?: unknown;\n}\n\nexport interface DoneResult<T> {\n isNew?: boolean;\n data?: T;\n}\n\nexport interface ApiResponse {\n success: boolean;\n message: string;\n}\n\nexport interface ApiResult<T> extends ApiResponse {\n value: T;\n}\n\nexport interface Folder extends INode {\n teamId?: string;\n parentId?: string;\n position?: number;\n isPrivate?: boolean;\n itemsCount?: number;\n subItemsCount?: number;\n\n}\n\nexport interface FolderTree extends Folder {\n children?: Folder[];\n path?: string;\n}\n\nexport interface File<T> {\n ownerId?: T;\n id?: number;\n fileName: string;\n fileData: unknown;\n}\n\nexport interface Validated {\n isValid(): boolean;\n}\n\nexport class FileInfo implements Validated {\n file: any;\n valid!: boolean;\n\n isValid(): boolean {\n return this.valid;\n }\n}\n\nexport interface ErrorInfo {\n invalidateSession?: boolean;\n title?: string;\n message?: string;\n errorStatus?: number;\n service?: string;\n}\n\nexport interface NameValueItem<T> {\n name: string;\n value: T;\n shortName?: string;\n parentName?: string;\n parentValue?: T;\n header?: string;\n bag?: any;\n bagInfo?: string;\n disabled?: boolean;\n selected?: boolean;\n}\n\nexport interface Checkable {\n checked?: boolean;\n bag: unknown;\n getId(): unknown;\n}\n\n\nexport class ValueModel<T> {\n value!: T;\n}\nexport class IDModel<T = number> {\n id!: T;\n}\nexport class GroupModel<T = number> {\n ids!: T[];\n}\n\nexport class DeleteModel<T = number> extends GroupModel<T> {\n mode?: number;\n parentId?: T;\n}\n\nexport interface DeleteResultModel<T> {\n items?: T[],\n deleted: number;\n total: number;\n log?: string;\n}\n\nexport class RelationModel<T = number> {\n id!: T;\n parentId!: T;\n}\n\nexport class UpdateRelationsModel<T = number> {\n id!: T;\n relatedIds!: T[];\n}\n\n/** Identifies the external identity provider used for an OAuth login. */\nexport enum LoginOAuthType {\n None = 0,\n Microsoft = 1,\n Google = 2\n}\n\n/** Payload emitted by the OAuth login components once the provider returned a token. */\nexport interface LoginOAuthResult {\n type: LoginOAuthType,\n token: string\n}\n\nexport class QueryModel {\n any?: string;\n sortBy?: string;\n sortDescending?: boolean;\n first?: number;\n count?: number;\n}\n\nexport interface QueryResultModel<T> {\n interval?: string;\n items: T[];\n total: number;\n}\n\nexport interface UpdateModel<T = number> {\n parentId?: T;\n ids: T[];\n}\n\nexport interface UpdateResultModel<T> {\n items?: T[];\n updated: number;\n total: number;\n log?: string;\n}\n\nexport interface AddModel<T> extends UpdateModel<T> {\n\n}\n\nexport interface AddResultModel<T> {\n items?: T[];\n added: number;\n total: number;\n log?: string;\n}\n\nexport class ImportModel {\n origin!: string;\n dataFile!: FileInfo;\n jumpFirstLine?: boolean;\n map?: unknown;\n}\n\nexport interface EnableDisableModel {\n value: boolean;\n}\n\nexport interface SendToModel {\n sendToRecipients?: string;\n sendToSubject?: string;\n sendToText?: string;\n}\n\nexport interface SearchBag {\n name: string;\n}\n\nexport interface Searchable {\n searchBag: SearchBag;\n}\n\nexport interface SearchFilterMetadata {\n total: number; // totale elementi\n count: number; // conteggio filtrati\n}\n\nexport class DateInterval {\n from?: Date;\n to?: Date;\n get fromAsDate(): Date | undefined {\n if (this.from) {\n if (!(this.from instanceof Date)) {\n this.from = new Date(this.from);\n }\n if (this.from) {\n return new Date(\n this.from.getFullYear(),\n this.from.getMonth(),\n this.from.getDate(),\n 2,\n 0,\n 0\n )\n }\n }\n return undefined;\n }\n get toAsDate(): Date | undefined {\n if (this.to) {\n if (!(this.to instanceof Date)) {\n this.to = new Date(this.to);\n }\n if (this.to) {\n return new Date(\n this.to.getFullYear(),\n this.to.getMonth(),\n this.to.getDate(),\n 2,\n 0,\n 0\n )\n }\n }\n return undefined;\n }\n\n constructor(from?: Date, to?: Date) {\n this.from = from;\n this.to = to;\n }\n\n clear(): void {\n this.from = undefined;\n this.to = undefined;\n }\n}\n\nexport interface LoginResult<T> extends ApiResult<boolean> {\n context: T;\n oauth?: number;\n requiresMfa?: boolean;\n}\n","export const UtilsMessages = {\r\n /**\r\n * Messages\r\n */\r\n\r\n\r\n // Select dialog\r\n UTILS_DIALOGS_SELECT_OPTIONS_CHANGED: '§utils-dialogs-select-options-changed'\r\n};\r\n","import { DateInterval, INode } from './definitions';\nimport { format, Locale, parse, parseISO } from 'date-fns';\nimport { it } from 'date-fns/locale';\nimport { TZDate } from '@date-fns/tz';\n\n\nexport enum DateFormat {\n Short = 1, // dd/mm/yyyy\n Long = 2, // d mmmm yyyy\n LongWithShortMonth = 3, // d mmm yyyy\n LongWithWeekDay = 4, // wwww, d mmmm yyyy\n LongWithShortWeekDay = 5, // www, d mmmm yyyy\n MonthAndYear = 6, // mmm yyyy\n LongMonthAndYear = 7, // mmmm yyyy\n WeekDay = 8, // www d\n LongWeekDay = 9, // wwww d\n DayAndMonth = 10, // d mmmm\n ShortUS = 11, // mm/dd/yyyy\n ShortISO8601 = 12 // yyyy-mm-dd\n}\n\n/**\n * Key selector with IDE autocomplete and compile-time checking.\n *\n * Suggests the string keys of `T` in the editor and flags obvious typos when\n * `T` is known, while STILL accepting any plain string (the `string & {}`\n * branch), so existing callers that pass dynamic or untyped keys keep\n * compiling unchanged.\n */\nexport type KeyOf<T> = Extract<keyof T, string> | (string & {});\n\nexport interface PasswordStrength {\n score: number;\n label?: string;\n color?: string;\n suggestions?: string[];\n isValid: boolean;\n}\n\n\nexport class SystemUtils {\n /** Shared collator for locale-aware, case-insensitive string comparison. */\n private static readonly collator = new Intl.Collator('it', { sensitivity: 'base', numeric: true });\n\n\n /**\n * Array find by key\n * @param array : the array to scan\n * @param key : key name\n * @param value : the value to search for\n * @returns : the property value or null\n */\n static arrayFindByKey<T>(array: T[] | undefined, key: KeyOf<T>, value: unknown): T | undefined {\n if (!array) return undefined;\n for (const item of array) {\n if ((item as Record<string, unknown>)[key as string] === value) {\n return item;\n }\n }\n return undefined;\n }\n\n /**\n * Array find index by key\n * @param array : the array to scan\n * @param key : the key name\n * @param value : the value to search for\n * @returns : the array index or -1 if not found\n */\n static arrayFindIndexByKey<T>(array: T[] | undefined, key: KeyOf<T>, value: unknown): number {\n if (!array) return -1;\n for (let i = 0; i < array.length; i++) {\n if ((array[i] as Record<string, unknown>)[key as string] === value) {\n return i;\n }\n }\n return -1;\n }\n\n /**\n * Get a value from and array made of name|value items\n * @param array : the array to scan\n * @param value : the value to search for\n * @returns : the property value or null if not found\n */\n static arrayGetValue<T>(array: T[] | undefined, value: unknown): unknown {\n if (!array) return undefined;\n for (const item of array) {\n const i = item as Record<string, unknown>;\n if (i['value'] === value) {\n return i['name'] ?? i['id'];\n }\n }\n return undefined;\n }\n\n /**\n * Convert items to nodes into a tree structure\n * @param items : list of nodes\n * @param parent : parent node\n * @returns : an array of INode objects\n */\n static arrayToNodes(items: INode[], parent?: INode): INode[] {\n const nodes: INode[] = [];\n items.forEach(n => {\n const node: INode = {\n id: n.id.toString(),\n name: n.name,\n count: n.count ? n.count : 0,\n children: undefined,\n parent,\n bag: n,\n };\n nodes.push(node);\n node.children =\n n.children && n.children.length > 0\n ? this.arrayToNodes(n.children, node)\n : [];\n });\n return nodes;\n }\n\n /**\n * Comparator factory for sorting arrays of objects by a given property key.\n * Pass the element type for compile-time key checking:\n * `items.sort(SystemUtils.arraySortCompare<Employee>('lastName'))`.\n * @param key - Name of the property to sort by (autocompleted from `T` when provided).\n * @param order - Sort direction: `'asc'` (default) or `'desc'`.\n * @returns A comparator function that returns a negative, zero, or positive number.\n */\n static arraySortCompare<T extends object = Record<string, unknown>>(\n key: KeyOf<T>,\n order: 'asc' | 'desc' | (string & {}) = 'asc'\n ): (a: T, b: T) => number {\n const dir = order === 'desc' ? -1 : 1;\n return (a, b): number => {\n const varA = (a as Record<string, unknown>)[key as string];\n const varB = (b as Record<string, unknown>)[key as string];\n if (varA === varB) return 0;\n if (varA === undefined || varA === null) return -1 * dir;\n if (varB === undefined || varB === null) return 1 * dir;\n if (typeof varA === 'string' && typeof varB === 'string') {\n return SystemUtils.collator.compare(varA, varB) * dir;\n }\n return (varA > varB ? 1 : varA < varB ? -1 : 0) * dir;\n };\n }\n\n /**\n * Format weight\n * @param gr : grams\n * @returns : the formatted string\n */\n static formatWeight(gr: number): string {\n if (gr > 1000000) return `${(gr / 1000000).toFixed(2)} t`;\n else if (gr > 100000) return `${(gr / 100000).toFixed(2)} q`;\n else if (gr > 1000) return `${(gr / 1000).toFixed(2)} kg`;\n else return `${gr} gr`;\n }\n\n /**\n * Format file size\n * @param bytes : number of bytes\n * @returns : the formatted string\n */\n static formatFileSize(bytes: number): string {\n const MB = 1024 * 1024;\n if (bytes >= MB) return `${(bytes / MB).toFixed(1)} MB`;\n if (bytes >= 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${bytes} byte`;\n }\n\n /**\n * Compare two strings (case-insensitive, locale-aware, accent-insensitive).\n * @param a : string a\n * @param b : string b\n * @returns : 0 if equals, 1 if bigger, -1 if lower\n */\n static compareString(a?: string, b?: string): number {\n return this.collator.compare(a ?? '', b ?? '');\n }\n\n /**\n * Capitalize a string\n * @param s : the string to capitalize\n * @returns : the capitalized string \n */\n static capitalize(s?: string): string | undefined {\n if (!s) return undefined;\n let b = \"\";\n let cap = true;\n for (const char of s) {\n if (char === \" \") {\n b += char;\n cap = true;\n } else if (cap) {\n b += char.toUpperCase();\n cap = false;\n } else {\n b += char.toLowerCase();\n }\n }\n return b;\n }\n\n /**\n * Truncate a string at the last word boundary before `max`.\n * @param s : the string to truncate\n * @param max : the max number of chars\n * @returns : the truncated string\n */\n static truncate(s?: string, max: number = 500): string | undefined {\n if (!s) return undefined;\n if (s.length <= max) return s;\n const i = s.lastIndexOf(' ', max - 1);\n return i > 0 ? s.slice(0, i) : s;\n }\n\n /**\n * Join a list of strings\n * @param items : the list of strings\n * @param sep : the separator string\n * @param max : the maximum resulting string\n * @returns : the joined string\n */\n static join(items?: string[], sep: string = \" \", max: number = 350): string | undefined {\n if (!items || items.length === 0) return undefined;\n if (items.length > 1) {\n let l = 0;\n let s = \"\"\n while (s.length < max && items.length > l) {\n if (l > 0) {\n s += sep;\n }\n s += items[l++];\n }\n if (items.length > l) {\n s += \"...\";\n }\n return s;\n }\n return items[0];\n }\n\n /**\n * Normalize a string by converting it to lowercase and removing extra spaces, with special handling for acronyms and camelCase.\n * @param s : the string to normalize \n * @returns : The normalized string, or `undefined` if the input is falsy.\n */\n static normalizeDisplay(s?: string): string | undefined {\n if (!s) return s;\n return s\n .split(' ')\n .map((word, wordIndex) => {\n if (!word) return word;\n\n // If the word is all uppercase and contains at least one letter, we assume it's an acronym and leave it as is\n if (word === word.toUpperCase() && /[A-Z]/.test(word)) {\n return word;\n }\n\n // Otherwise, convert to lowercase letter by letter\n const chars = word.split('');\n return chars\n .map((char, charIndex) => {\n if (charIndex === 0 && wordIndex === 0) {\n // First letter of the first word:\n // remains uppercase only if the first 2 letters are both uppercase\n const secondChar = chars[1] ?? '';\n const keepUppercase =\n char === char.toUpperCase() &&\n secondChar === secondChar.toUpperCase() &&\n /[A-Z]/.test(char) &&\n /[A-Z]/.test(secondChar);\n return keepUppercase ? char : char.toLowerCase();\n }\n return char.toLowerCase();\n })\n .join('');\n })\n .join(' ');\n }\n\n /**\n * Wraps bare URLs in the given string with `<a>` anchor tags.\n * @param s - The plain-text or HTML string to process.\n * @returns The string with URLs replaced by clickable links, or `''` when `s` is falsy.\n */\n static replaceAsHtml(s?: string): string {\n if (!s) return '';\n return s.replace(/https?:\\/\\/[^\\s<]+/gi,\n v => `<a href=\"${v}\" target=\"_blank\" rel=\"noopener\">${v}</a>`);\n }\n\n\n /**\n * Compare two names\n * @param a : name a\n * @param b : name b\n * @returns : true if a equals b\n */\n static compareNames(a?: string, b?: string): boolean {\n if (a) a = a.trim();\n if (b) b = b.trim();\n if (a && b && a.length !== b.length) return false;\n if (this.compareString(a, b) === 0) return true;\n const p1 = (a ?? '').split(' ');\n const p2 = (b ?? '').split(' ');\n if (p1.length !== p2.length) return false;\n let matches = p1.length;\n const used = new Array<boolean>(p2.length).fill(false);\n for (const s1 of p1) {\n for (let j = 0; j < p2.length; j++) {\n if (!used[j] && this.compareString(s1, p2[j]) === 0) {\n used[j] = true;\n matches--;\n break;\n }\n }\n }\n\n return matches === 0;\n }\n\n /**\n * Obfuscate a text with a key-driven code point rotation.\n *\n * @deprecated This is OBFUSCATION, not cryptography: it hides values from\n * casual inspection but offers no real security. Use {@link encrypt} /\n * {@link decrypt} (AES-GCM via Web Crypto) for anything sensitive.\n *\n * The rotation operates on Unicode code points and skips the surrogate\n * range, so the output is always a well-formed string: emoji and other\n * astral characters round-trip correctly (the previous code-unit based\n * version could emit lone surrogates and corrupt them).\n *\n * BREAKING CHANGE: values encoded with the previous code-unit algorithm\n * cannot be decoded by this implementation.\n *\n * @param text : the text to encode or decode\n * @param key : the key\n * @param reverse : true to decode, false to encode\n * @returns : the obfuscated (or restored) text, or undefined when text/key are empty\n */\n static cipher(text: string, key: string, reverse: boolean = false): string | undefined {\n if (!text || !key) return undefined;\n // Valid Unicode scalar values: [0, 0xD7FF] + [0xE000, 0x10FFFF].\n // We rotate inside this contiguous \"logical\" space (surrogates excluded)\n // so the result is always a valid code point.\n const SURROGATE_START = 0xd800;\n const SURROGATE_SIZE = 0x800;\n const SPACE = 0x110000 - SURROGATE_SIZE; // number of valid scalar values\n const toIndex = (cp: number): number => (cp < SURROGATE_START ? cp : cp - SURROGATE_SIZE);\n const toCodePoint = (i: number): number => (i < SURROGATE_START ? i : i + SURROGATE_SIZE);\n\n const keyLen = key.length;\n let result = '';\n let i = 0;\n for (const ch of text) { // iterates by code point, not code unit\n let rotation = key.charCodeAt(i % keyLen);\n if (reverse) rotation = -rotation;\n const index = toIndex(ch.codePointAt(0)!);\n const rotated = ((index + rotation) % SPACE + SPACE) % SPACE;\n result += String.fromCodePoint(toCodePoint(rotated));\n i++;\n }\n return result;\n }\n\n // #region Real encryption (Web Crypto, AES-GCM)\n\n /** Payload format version, first byte of the binary envelope. */\n private static readonly CIPHER_VERSION = 1;\n /** PBKDF2 salt length in bytes. */\n private static readonly CIPHER_SALT_LENGTH = 16;\n /** AES-GCM IV length in bytes (96 bit, the recommended size for GCM). */\n private static readonly CIPHER_IV_LENGTH = 12;\n /** PBKDF2-HMAC-SHA-256 iterations (OWASP recommendation). */\n private static readonly CIPHER_ITERATIONS = 600000;\n\n /**\n * Derives an AES-GCM 256-bit key from a password using PBKDF2-HMAC-SHA-256.\n * @param password : the user password / passphrase\n * @param salt : the random salt bound to this payload\n * @returns : a non-extractable AES-GCM CryptoKey\n */\n private static async deriveKey(password: string, salt: Uint8Array): Promise<CryptoKey> {\n const material = await crypto.subtle.importKey(\n 'raw',\n new TextEncoder().encode(password),\n 'PBKDF2',\n false,\n ['deriveKey']\n );\n return crypto.subtle.deriveKey(\n { name: 'PBKDF2', salt: salt as BufferSource, iterations: this.CIPHER_ITERATIONS, hash: 'SHA-256' },\n material,\n { name: 'AES-GCM', length: 256 },\n false,\n ['encrypt', 'decrypt']\n );\n }\n\n /**\n * Encodes bytes as URL-safe Base64 (no '+', '/' or trailing '=').\n * @param bytes : the bytes to encode\n * @returns : the base64url string\n */\n private static toBase64Url(bytes: Uint8Array): string {\n let binary = '';\n const CHUNK = 0x8000;\n for (let i = 0; i < bytes.length; i += CHUNK) {\n binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK));\n }\n return btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n }\n\n /**\n * Decodes a URL-safe Base64 string back to bytes.\n * @param value : the base64url string\n * @returns : the decoded bytes\n */\n private static fromBase64Url(value: string): Uint8Array {\n const b64 = value.replace(/-/g, '+').replace(/_/g, '/');\n const padded = b64 + '='.repeat((4 - (b64.length % 4)) % 4);\n const binary = atob(padded);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);\n return bytes;\n }\n\n /**\n * Encrypts a text with a password using AES-GCM (256 bit) and a key derived\n * via PBKDF2-HMAC-SHA-256 with a random per-message salt.\n *\n * The result is a self-contained, URL-safe Base64 payload:\n * `version (1 byte) | salt (16 bytes) | iv (12 bytes) | ciphertext+tag`.\n * GCM is authenticated: any tampering makes {@link decrypt} fail.\n *\n * Requires a secure context (HTTPS or localhost) for `crypto.subtle`.\n *\n * @param text : the plain text to encrypt\n * @param password : the password / passphrase\n * @returns : the base64url payload, or undefined when text/password are\n * empty or the Web Crypto API is unavailable\n */\n static async encrypt(text: string, password: string): Promise<string | undefined> {\n if (!text || !password) return undefined;\n if (typeof crypto === 'undefined' || !crypto.subtle) return undefined;\n try {\n const salt = crypto.getRandomValues(new Uint8Array(this.CIPHER_SALT_LENGTH));\n const iv = crypto.getRandomValues(new Uint8Array(this.CIPHER_IV_LENGTH));\n const key = await this.deriveKey(password, salt);\n const cipherText = new Uint8Array(\n await crypto.subtle.encrypt({ name: 'AES-GCM', iv: iv as BufferSource }, key, new TextEncoder().encode(text))\n );\n const payload = new Uint8Array(1 + salt.length + iv.length + cipherText.length);\n payload[0] = this.CIPHER_VERSION;\n payload.set(salt, 1);\n payload.set(iv, 1 + salt.length);\n payload.set(cipherText, 1 + salt.length + iv.length);\n return this.toBase64Url(payload);\n } catch {\n return undefined;\n }\n }\n\n /**\n * Decrypts a payload produced by {@link encrypt}.\n * Returns undefined when the password is wrong, the payload was tampered\n * with, the format is unknown, or the Web Crypto API is unavailable.\n *\n * @param payload : the base64url payload returned by {@link encrypt}\n * @param password : the password / passphrase used to encrypt\n * @returns : the original plain text, or undefined on any failure\n */\n static async decrypt(payload: string, password: string): Promise<string | undefined> {\n if (!payload || !password) return undefined;\n if (typeof crypto === 'undefined' || !crypto.subtle) return undefined;\n try {\n const bytes = this.fromBase64Url(payload);\n const headerLength = 1 + this.CIPHER_SALT_LENGTH + this.CIPHER_IV_LENGTH;\n if (bytes.length <= headerLength || bytes[0] !== this.CIPHER_VERSION) return undefined;\n const salt = bytes.subarray(1, 1 + this.CIPHER_SALT_LENGTH);\n const iv = bytes.subarray(1 + this.CIPHER_SALT_LENGTH, headerLength);\n const cipherText = bytes.subarray(headerLength);\n const key = await this.deriveKey(password, salt);\n const plain = await crypto.subtle.decrypt(\n { name: 'AES-GCM', iv: iv as BufferSource },\n key,\n cipherText as BufferSource\n );\n return new TextDecoder().decode(plain);\n } catch {\n // Wrong password or tampered payload: GCM authentication failed\n return undefined;\n }\n }\n\n // #endregion\n\n /**\n * Clone an object (deep copy).\n * Uses native structuredClone: handles Date, Map, Set, typed arrays and circular references.\n * @param obj : the object to clone\n * @returns : a new object\n */\n static clone<T>(obj: T): T {\n if (obj === null || obj === undefined) return obj;\n return structuredClone(obj);\n }\n\n /**\n * Creates a deep clone of an object.\n * @param obj - The source object to clone.\n * @param dest - Optional pre-allocated destination object to merge the clone into.\n * @returns A deep copy of `obj`.\n */\n static deepClone<T extends object>(obj: T, dest?: T): T {\n const cloned = structuredClone(obj);\n if (dest) {\n Object.assign(dest, cloned);\n return dest;\n }\n return cloned;\n }\n\n\n /**\n * Returns `true` when `value` is a syntactically valid UUID string.\n * @param value - The string to validate.\n */\n static parseUUID(value?: string): boolean {\n if (!value) return false;\n let s = value.trim();\n // Strip a matching wrapper pair, if present\n if ((s.startsWith('{') && s.endsWith('}')) || (s.startsWith('(') && s.endsWith(')'))) {\n s = s.slice(1, -1);\n }\n return /^[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/.test(s);\n }\n\n /**\n * Returns `true` when `value` is a valid, non-empty (non-zero) UUID.\n * @param value - The string to validate.\n */\n static parseUUIDNotEmpty(value?: string): boolean {\n return this.parseUUID(value) && !/^[{(]?0{8}-(?:0{4}-){3}0{12}[)}]?$/.test((value ?? '').trim());\n }\n\n /**\n * Return an empty UUID\n * @returns : the empty UUID\n */\n static emptyUUID(): string { return \"00000000-0000-0000-0000-000000000000\" };\n\n /**\n * Create a new UUID\n * @returns : the string UUID\n */\n static generateUUID(): string {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n // Fallback (non-secure contexts)\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }\n\n /**\n * Reconstruct a standard UUID (with dashes) from a 32-char hex string without dashes.\n * @param value : 32-character hex string\n * @returns : the formatted UUID or the original string if it doesn't match the expected format\n */\n static inflateUUID(value: string): string {\n const s = value.trim();\n if (s.length !== 32) return s;\n return `${s.slice(0, 8)}-${s.slice(8, 12)}-${s.slice(12, 16)}-${s.slice(16, 20)}-${s.slice(20)}`;\n }\n\n /** Precompiled validation patterns. */\n private static readonly emailRegex = /^(?:[a-z0-9+!#$%&'*+\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\n private static readonly urlRegex = /^(https?:\\/\\/)?([\\da-z.-]+)\\.([a-z.]{2,12})(:\\d{1,5})?([/\\w .%-]*)?(\\?[^\\s#]*)?(#\\S*)?$/i;\n\n\n /**\n * Parse a text and return true if it is a valid email (or empty)\n * @param value : email\n * @returns : true if the email is valid or empty\n */\n static parseEmail(value?: string): boolean {\n if (!value) return true;\n return this.emailRegex.test(value.trim().toLowerCase());\n }\n\n /**\n * Parse a text containing one or more email addresses separated by `;` or `,`\n * and return true if all of them are valid (or the text is empty).\n * Empty items caused by double or trailing separators are ignored.\n * @param value : the email list to parse (e.g. \"a@b.it; c@d.it\")\n * @returns : true if all emails are valid or the value is empty\n */\n static parseEmails(value?: string): boolean {\n if (!value || value.trim().length === 0) return true;\n const items = value\n .split(/[;,]/)\n .map(e => e.trim().toLowerCase())\n .filter(e => e.length > 0);\n if (items.length === 0) return false; // only separators, no addresses\n return items.every(e => this.emailRegex.test(e));\n }\n\n /**\n * Parse a text and return true if it is a valid url (or empty)\n * @param value : the url to parse\n * @returns : true if the url is valid or empty\n */\n static parseUrl(value?: string): boolean {\n if (!value) return true;\n return this.urlRegex.test(value.trim().toLowerCase());\n }\n\n /**\n * Get date parts from a string value\n * @param value : the string to parse\n * @returns : an array of numbers with year, month, day\n */\n static getDateParts(value?: string): number[] | undefined {\n if (!value) return undefined;\n let parts: number[] = [];\n if (value.indexOf(\"-\") !== -1) {\n const p = value.split(\"-\");\n if (p.length !== 3) return undefined;\n parts = [parseInt(p[0]), parseInt(p[1]) - 1, parseInt(p[2])];\n } else if (value.indexOf(\"/\") !== -1) {\n const p = value.split(\"/\");\n if (p.length !== 3) return undefined;\n parts = [parseInt(p[2]), parseInt(p[1]) - 1, parseInt(p[0])];\n } else {\n return undefined;\n }\n return parts;\n }\n\n /**\n * Checks whether a value is a valid Date instance.\n * Note: do not use `date.getTime()` as a truthiness test, it is 0 (falsy)\n * for the Unix epoch (1970-01-01T00:00:00Z) even though the date is valid.\n * @param d : the value to check\n * @returns : true when `d` is a Date representing a valid point in time\n */\n static isValidDate(d: unknown): d is Date {\n return d instanceof Date && !isNaN(d.getTime());\n }\n\n /**\n * Parse a date\n * @param value : the value to check\n * @param locale : the locale to use\n * @returns : a valid Date object or undefined\n */\n static parseDate(value?: string | Date, locale: Locale = it): Date | undefined {\n // No value at all\n if (!value) return undefined;\n // A Date value\n if (value instanceof Date) return this.isValidDate(value) ? value : undefined;\n // Parse known formats using date-fns\n let d = parseISO(value as string);\n if (this.isValidDate(d) && d.getFullYear() > 1750) return d;\n d = parse(value as string, 'dd/MM/yyyy', new Date(), { locale: locale });\n if (this.isValidDate(d) && d.getFullYear() > 1750) return d;\n d = parse(value as string, 'yyyy-MM-dd', new Date(), { locale: locale });\n if (this.isValidDate(d) && d.getFullYear() > 1750) return d;\n // Parse values manually\n const parts = this.getDateParts(value as string);\n if (!parts) return undefined;\n if (parts[0] < 100) parts[0] += 2000;\n if (isNaN(parts[0]) || parts[0] < 0 || parts[0] < 1750) return undefined;\n if (isNaN(parts[1]) || parts[1] < 0) return undefined;\n if (isNaN(parts[2]) || parts[2] < 0) return undefined;\n if (parts[1] > 11) return undefined;\n if (parts[1] === 1 && parts[2] > 29) return undefined;\n else if (parts[1] !== 1 && parts[2] > 31) return undefined;\n return new TZDate(parts[0], parts[1], parts[2], 12);\n }\n\n /**\n * Converts a Date, timestamp or ISO string into a Europe/Rome Date whose JSON serialisation\n * emits a naive local datetime string (\"yyyy-MM-dd'T'HH:mm:ss\"), with no timezone designator,\n * so the wall-clock value round-trips to the server unchanged. Use this instead of `new Date(...)`\n * when reviving dates received from the API, to stay consistent with the DateFnsAdapter (values\n * entered through the datepicker already behave this way).\n * @param value : the source Date, Unix timestamp (ms) or ISO string\n * @returns : a Europe/Rome Date serialising as naive local time, or undefined for empty/invalid input\n */\n static toLocalDate(value?: Date | number | string): Date | undefined {\n if (value == null || value === '') return undefined;\n const ms = value instanceof Date ? value.getTime()\n : typeof value === 'number' ? value\n : new Date(value).getTime();\n if (isNaN(ms)) return undefined;\n const t = new TZDate(ms, 'Europe/Rome') as Date;\n Object.defineProperty(t, 'toJSON', {\n value: () => format(t, \"yyyy-MM-dd'T'HH:mm:ss\"),\n enumerable: false,\n configurable: true,\n writable: true,\n });\n return t;\n }\n\n /**\n * Format a date\n * @param value : the date or string to format\n * @param fmt : the DateFormat to use or the string pattern\n * @param locale : the locale to use (default is IT)\n * @returns : the formatted string\n */\n static formatDate(\n value?: Date | string,\n fmt: DateFormat | string = DateFormat.Short,\n locale: Locale = it): string {\n // No value at all\n if (!value) return '';\n // A string\n if (typeof value === 'string' || value instanceof String)\n value = this.parseDate(value as string);\n // Not a date\n if (!this.isValidDate(value))\n return '';\n // Format\n switch (fmt) {\n case DateFormat.Short: return format(value, \"dd/MM/yyyy\", { locale: locale });\n case DateFormat.Long: return format(value, \"d MMMM yyyy\", { locale: locale });\n case DateFormat.LongWithShortMonth: return format(value, \"d MMM yyyy\", { locale: locale });\n case DateFormat.LongWithWeekDay: return format(value, \"EEEE, d MMMM yyyy\", { locale: locale });\n case DateFormat.LongWithShortWeekDay: return format(value, \"EEE, d MMMM yyyy\", { locale: locale });\n case DateFormat.MonthAndYear: return format(value, \"MMM yyyy\", { locale: locale });\n case DateFormat.LongMonthAndYear: return format(value, \"MMMM yyyy\", { locale: locale });\n case DateFormat.WeekDay: return format(value, \"EEE, d\", { locale: locale });\n case DateFormat.LongWeekDay: return format(value, \"EEEE, d\", { locale: locale });\n case DateFormat.DayAndMonth: return format(value, \"d MMMM\", { locale: locale });\n case DateFormat.ShortUS: return format(value, \"MM/dd/yyyy\", { locale: locale });\n case DateFormat.ShortISO8601: return format(value, \"yyyy-MM-dd\", { locale: locale });\n default:\n return format(value, fmt, { locale: locale });\n }\n }\n\n /**\n * Update a DateInterval object according to a string\n * @param value : string value\n * @param interval : DateInterval value to update\n * @param end : true if must be updated the first or the end value \n * @param copy : copy the same value (works only if not end element)\n */\n static changeDateInterval(value: string, interval: DateInterval, end: boolean = false, copy: boolean = false): void {\n if (value) {\n let year = -1;\n if (value.length === 4 && (year = parseInt(value)) > 1750) {\n if (!end) {\n interval.from = new TZDate(new Date(year, 0, 1), 'Europe/Rome');\n interval.to = new TZDate(new Date(year, 11, 31), 'Europe/Rome');\n } else\n interval.to = new Date(year, 11, 31);\n } else {\n const parts = this.getDateParts(value);\n if (!parts || parts.length !== 3) return;\n if (isNaN(parts[0]) || parts[0] < 1750) return;\n if (isNaN(parts[1]) || parts[1] < 0 || parts[1] > 11) return;\n if (isNaN(parts[2]) || parts[2] < 1 || parts[2] > 31) return;\n const d = new TZDate(new Date(parts[0], parts[1], parts[2]), 'Europe/Rome');\n if (end)\n interval.to = d;\n else if (copy) {\n interval.from = d;\n interval.to = d;\n } else\n interval.from = d;\n }\n }\n }\n\n /** Cache of `Intl.NumberFormat` instances (their construction is expensive). */\n private static readonly numberFormatCache = new Map<string, Intl.NumberFormat>();\n\n /**\n * Returns a cached `Intl.NumberFormat` for the given options, creating it on first use.\n * @param locale - BCP 47 locale tag.\n * @param options - The `Intl.NumberFormat` options.\n * @returns A shared formatter instance.\n */\n private static getNumberFormat(locale: string, options: Intl.NumberFormatOptions): Intl.NumberFormat {\n const key = `${locale}|${options.style}|${options.currency ?? ''}|${options.minimumFractionDigits}|${options.maximumFractionDigits}`;\n let fmt = this.numberFormatCache.get(key);\n if (!fmt) {\n fmt = new Intl.NumberFormat(locale, options);\n this.numberFormatCache.set(key, fmt);\n }\n return fmt;\n }\n\n /**\n * Formats a number using a cached `Intl.NumberFormat`.\n * @param value - The number to format.\n * @param decimals - Maximum decimal places (default: `2`).\n * @param locale - BCP 47 locale tag (default: `'it-IT'`).\n * @returns The formatted number string.\n */\n static formatNumber(value: number, decimals: number = 2, locale: string = 'it-IT'): string {\n return this.getNumberFormat(locale, { style: 'decimal', minimumFractionDigits: 0, maximumFractionDigits: decimals }).format(value);\n }\n\n /**\n * Formats a number as a currency string using a cached `Intl.NumberFormat`.\n * @param value - The number to format.\n * @param currency - ISO 4217 currency code (default: `'EUR'`).\n * @param decimals - Maximum decimal places (default: `2`).\n * @param locale - BCP 47 locale tag (default: `'it-IT'`).\n * @returns The formatted currency string.\n */\n static formatCurrency(value: number, currency: string = 'EUR', decimals: number = 2, locale: string = 'it-IT'): string {\n return this.getNumberFormat(locale, { style: 'currency', currency, minimumFractionDigits: 0, maximumFractionDigits: decimals }).format(value);\n }\n\n /**\n * Percent-encodes a string for safe inclusion in a URL.\n * @param value - The string to encode.\n * @returns The encoded string, or `undefined` when `value` is empty.\n */\n static urlEncode(value: string): string | undefined {\n return value.length > 0\n ? encodeURIComponent(value)\n : undefined;\n }\n\n /**\n * Decodes a percent-encoded URL string, treating `+` as a space.\n * @param value - The encoded string to decode.\n * @returns The decoded string, or `undefined` when `value` is empty or absent.\n */\n static urlDecode(value?: string): string | undefined {\n return value && value.length > 0\n ? decodeURIComponent(value.replace(/\\+/g, '%20'))\n : undefined;\n }\n\n /**\n * Reads a query string parameter value from the current page URL.\n * @param name - The parameter name to look up.\n * @returns The decoded parameter value, or `undefined` when absent or running server-side.\n */\n static getQueryStringValueByName(name: string): string | undefined {\n if (!this.isBrowser()) return undefined;\n const v = new URLSearchParams(window.location.search).get(name);\n return v && v !== 'null' ? v : undefined;\n }\n\n /**\n * Generate a password\n * @returns : the password string\n */\n static generatePassword(length: number = 12): string {\n const lower = 'abcdefghijkmnopqrstuvwxyz'; // no 'l' (ambiguous)\n const upper = 'ABCDEFGHJKLMNPQRSTUVWXYZ'; // no 'I'/'O' (ambiguous)\n const digits = '23456789'; // no '0'/'1' (ambiguous)\n const symbols = '$!#%&*+-';\n const all = lower + upper + digits + symbols;\n\n // Secure random indices (crypto is available in browsers and Node)\n const rnd = (max: number): number => {\n if (typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function') {\n const buf = new Uint32Array(1);\n crypto.getRandomValues(buf);\n return buf[0] % max;\n }\n return Math.floor(Math.random() * max);\n };\n\n // Guarantee at least one char per class, fill the rest, then shuffle\n const chars: string[] = [\n lower[rnd(lower.length)],\n upper[rnd(upper.length)],\n digits[rnd(digits.length)],\n symbols[rnd(symbols.length)],\n ];\n while (chars.length < Math.max(length, 8)) {\n chars.push(all[rnd(all.length)]);\n }\n for (let i = chars.length - 1; i > 0; i--) {\n const j = rnd(i + 1);\n [chars[i], chars[j]] = [chars[j], chars[i]];\n }\n return chars.join('');\n }\n\n /**\n * Calculate password strength\n * @param password: the password to evaluate\n * @returns the password strength info\n */\n static calculatePasswordStrength(password?: string): PasswordStrength {\n if (password && password.length > 0) {\n let score = 0;\n const suggestions: string[] = [];\n\n // Length\n if (password.length >= 10) score++;\n else suggestions.push('Usa almeno 10 caratteri.');\n if (password.length >= 12) score++;\n else if (password.length >= 10) suggestions.push('Considera di usare più di 12 caratteri.');\n\n // Lowercase letters\n if (/[a-z]/.test(password)) score++;\n else suggestions.push('Aggiungi lettere minuscole.');\n\n // Uppercase letters\n if (/[A-Z]/.test(password)) score++;\n else suggestions.push('Aggiungi lettere maiuscole.');\n\n // Numbers\n if (/\\d/.test(password)) score++;\n else suggestions.push('Aggiungi numeri.');\n\n // Special characters\n if (/[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]/.test(password)) score++;\n else suggestions.push('Aggiungi caratteri speciali (!@#$%^&*).');\n\n // Common patterns\n if (/(.)\\1{2,}/.test(password)) {\n score = Math.max(0, score - 1);\n suggestions.push('Evita di ripetere lo stesso carattere.');\n }\n if (/123|abc|qwe/i.test(password)) {\n score = Math.max(0, score - 1);\n suggestions.push('Evita sequenze comuni (123, abc, qwe).');\n }\n\n // Label and color\n let label: string;\n let color: string;\n let isValid: boolean;\n if (score <= 2) {\n label = 'Molto debole';\n color = '#f44336';\n isValid = false;\n } else if (score <= 3) {\n label = 'Debole';\n color = '#ff9800';\n isValid = false;\n } else if (score <= 4) {\n label = 'Media';\n color = '#ffc107';\n isValid = true;\n } else if (score <= 5) {\n label = 'Forte';\n color = '#8bc34a';\n isValid = true;\n } else {\n label = 'Molto forte';\n color = '#4caf50';\n isValid = true;\n }\n\n return { score, label, color, suggestions, isValid };\n } else\n return {\n score: 0,\n isValid: false,\n suggestions: []\n };\n\n }\n\n\n /**\n * Check if current browser supports touch\n * @returns : true if the display is touchable\n */\n static isTouchable(): boolean {\n return (\n this.isBrowser() && (\n \"ontouchstart\" in window ||\n navigator.maxTouchPoints > 0)\n );\n }\n\n /**\n * This check will prevent 'window' logic to be executed\n * while executing the server rendering\n * @returns : true if using the browser\n */\n static isBrowser(): boolean {\n return typeof (window) !== 'undefined';\n }\n\n /**\n * Convert folders in a tree of Node object.\n * @param folders : the subfolders group or null to root\n * @returns : a node list\n */\n static toNodes(folders: INode[]): INode[] {\n return this._toNodes(folders, undefined);\n }\n\n /**\n * Convert folders in a tree of Node object.\n * @param folders : the children group or null to root\n * @param parent : the parent node\n * @returns : a node list \n */\n private static _toNodes(folders: INode[], parent?: INode): INode[] {\n const nodes: INode[] = [];\n folders.forEach((n: INode) => {\n const node: INode = {\n id: n.id,\n name: n.name,\n count: n.count,\n parent: parent,\n children: undefined,\n bag: n,\n };\n const children = n.children ?? n.subFolders ?? [];\n if (children.length > 0) {\n node.children = this._toNodes(children, node);\n }\n nodes.push(node);\n });\n return nodes;\n }\n\n /**\n * Returns an array of individual power-of-2 flag values that are set in `value`.\n * @param value - The bitmask to decompose.\n * @param max - Upper-bound exponent: checks flags from `1` up to `1 << max` (default: `30`).\n * @returns Array of set flag values, or an empty array when `value` is `0`.\n */\n static getFlags(value: number, max: number = 30): number[] {\n if (value !== 0) {\n const items: number[] = [];\n const top = Math.min(max, 30); // beyond 30 the shift overflows into the sign bit\n for (let exp = 0; exp <= top; exp++) {\n const v = 1 << exp;\n if ((value & v) === v) items.push(v);\n }\n return items;\n } else return [];\n }\n\n /** Cache for resolved color luminance results. */\n private static readonly colorLightCache = new Map<string, boolean>();\n\n /**\n * Check if a color is light or dark\n * @param color : the color\n * @param minimumLuminance : the lumimance to consider\n * @returns true if the color is light\n */\n static isColorLight(color: string, minimumLuminance: number = 186): boolean {\n if (!this.isBrowser()) return true; // SSR fallback\n const cacheKey = `${color}|${minimumLuminance}`;\n const cached = this.colorLightCache.get(cacheKey);\n if (cached !== undefined) return cached;\n\n const tempDiv = document.createElement('div');\n tempDiv.style.color = color;\n document.body.appendChild(tempDiv);\n const rgb = getComputedStyle(tempDiv).color;\n document.body.removeChild(tempDiv);\n\n const result = rgb.match(/\\d+/g);\n let light = true; // fallback\n if (result && result.length >= 3) {\n const r = parseInt(result[0], 10);\n const g = parseInt(result[1], 10);\n const b = parseInt(result[2], 10);\n light = (0.299 * r + 0.587 * g + 0.114 * b) > minimumLuminance;\n }\n this.colorLightCache.set(cacheKey, light);\n return light;\n }\n\n}\n","import { computed, EventEmitter, signal } from '@angular/core';\nimport { SelectionModel } from \"@angular/cdk/collections\";\nimport { KeyOf, SystemUtils } from \"./system\";\n\n/**\n * Generic selection model that tracks a set of selected items identified by a lookup field.\n * Wraps Angular CDK's `SelectionModel` and adds lookup-based add/remove logic.\n *\n * @typeParam T - The item type held in the selection.\n * @typeParam V - The type of the lookup key used to identify items.\n */\nexport class SelectableModel<T, V> {\n\n /**\n * Emits whenever the selection changes.\n * Carries the affected item, or `undefined` when the whole selection is cleared.\n *\n * Note: kept as `EventEmitter` (instead of a plain RxJS `Subject`) for\n * backward compatibility with existing consumers; `EventEmitter` extends\n * `Subject`, so `.subscribe()`, `pipe(...)` and `takeUntilDestroyed` all\n * work as expected.\n */\n readonly changed = new EventEmitter<T | undefined>();\n\n private readonly _all = signal<T[]>([]);\n\n /**\n * Snapshot of all items currently tracked by this model (selected or previously toggled).\n * Backed by a signal — reads are always up to date.\n */\n get all(): T[] {\n return this._all();\n }\n\n private readonly _current: SelectionModel<T>;\n\n /** The underlying CDK `SelectionModel` (provides `.selected`, `.isSelected`, etc.). */\n get current(): SelectionModel<T> {\n return this._current;\n }\n\n private readonly _lookupFieldName: KeyOf<T>;\n\n /** Signal that is `true` when at least one item is tracked in the internal list. */\n readonly hasValue = computed(() => this._all().length > 0);\n\n /** Signal with the number of items currently tracked in the internal list. */\n readonly count = computed(() => this._all().length);\n\n /** Signal that is `true` when exactly one item is currently selected. */\n readonly selectedOne = computed(() => this._all().length === 1);\n\n /** Signal that is `true` when two or more items are currently selected. */\n readonly selectedMany = computed(() => this._all().length > 1);\n\n /** Signal that is `true` when at least one element is selected. */\n readonly selectedAny = computed(() => this._all().length > 0);\n\n /** Signal that is `true` when no item is currently selected. */\n readonly selectedNone = computed(() => this._all().length === 0);\n\n /** Signal with the first currently selected item, or `undefined` when none is selected. */\n readonly first = computed(() => this._all()[0]);\n\n /**\n * @param allowMultiSelect - When `true` (default), multiple items can be selected simultaneously.\n * @param lookupFieldName - Name of the field used as the unique key when searching the internal list\n * (default: `'id'`). Keys of `T` are autocompleted; plain strings remain accepted.\n */\n constructor(\n allowMultiSelect: boolean = true,\n lookupFieldName: KeyOf<T> = 'id'\n ) {\n this._current = new SelectionModel<T>(\n allowMultiSelect,\n [],\n true,\n // Compare by lookup key so different instances of the same logical item\n // (e.g. after a data reload) are treated as the same selection entry.\n (a, b) => (a as Record<string, unknown>)[lookupFieldName] === (b as Record<string, unknown>)[lookupFieldName]\n );\n this._lookupFieldName = lookupFieldName;\n }\n\n /**\n * Toggles the CDK selection state of an item that already exists in the tracked list.\n * Has no effect when `lookupValue` does not match any tracked item.\n * @param item - The item whose selection state should be toggled.\n * @param lookupValue - The key value used to locate the item in the internal list.\n */\n updateCurrent(item: T, lookupValue: V): void {\n const p = SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, lookupValue);\n if (p !== -1) {\n this._current.toggle(item);\n this.changed.emit(item);\n }\n }\n\n /**\n * Toggles an item in both the internal list and the CDK selection.\n * Adds the item when it is not yet tracked; removes it when it is.\n * @param item - The item to toggle.\n * @param lookupValue - The key value used to locate or register the item.\n */\n toggle(item: T, lookupValue?: V): void {\n if (lookupValue === undefined) return;\n const p = SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, lookupValue);\n if (p === -1) {\n this._all.update(arr => [...arr, item]);\n } else {\n this._all.update(arr => arr.filter((_, i) => i !== p));\n }\n this._current.toggle(item);\n this.changed.emit(item);\n }\n\n /**\n * Adds an item to the internal list (when not already present) and marks it as selected.\n * @param item - The item to select.\n * @param lookupValue - The key value used to locate or register the item.\n */\n select(item: T, lookupValue?: V): void {\n if (lookupValue === undefined) return;\n const p = SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, lookupValue);\n if (p === -1) {\n this._all.update(arr => [...arr, item]);\n }\n this._current.select(item);\n this.changed.emit(item);\n }\n\n /**\n * Removes an item from the internal list and deselects it in the CDK model.\n * Has no effect when the item is not currently tracked.\n * @param item - The item to deselect.\n * @param lookupValue - The key value used to locate the item in the internal list.\n */\n deselect(item: T, lookupValue?: V): void {\n if (lookupValue === undefined) return;\n const p = SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, lookupValue);\n if (p !== -1) {\n this._all.update(arr => arr.filter((_, i) => i !== p));\n this._current.deselect(item);\n this.changed.emit(item);\n }\n }\n\n /**\n * Deselects all items whose lookup key is contained in `lookupValues`.\n * @param lookupValues - Array of key values identifying the items to deselect.\n */\n deselectByValues(lookupValues: V[]): void {\n if (lookupValues.length === 0) return;\n for (const key of lookupValues) {\n const p = SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, key);\n if (p !== -1) {\n const item = this._all()[p];\n this._all.update(arr => arr.filter((_, i) => i !== p));\n this._current.deselect(item);\n this.changed.emit(item);\n }\n }\n }\n\n /**\n * Runs `clearFunc` against every currently selected item, then clears the CDK selection.\n * The internal tracked list is **not** affected; only the CDK selection is cleared.\n * @param clearFunc - Callback invoked for each currently selected item before clearing.\n */\n clearCurrent(clearFunc: (item: T) => void): void {\n for (const item of this._current.selected) {\n clearFunc(item);\n }\n this._current.clear();\n this.changed.emit(undefined);\n }\n\n /**\n * Clears both the internal tracked list and the CDK selection.\n */\n clear(): void {\n this._all.set([]);\n this._current.clear();\n this.changed.emit(undefined);\n }\n\n /**\n * Returns `true` when the item identified by `lookupValue` is present in the tracked list.\n * @param lookupValue - The key value to look up.\n */\n isSelected(lookupValue?: V): boolean {\n return (\n lookupValue !== undefined &&\n SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, lookupValue) !== -1\n );\n }\n}\n","import { afterNextRender, Directive, ElementRef, inject } from '@angular/core';\r\n\r\n/**\r\n * Directive that moves browser focus to the host element after the first render cycle.\r\n * Apply `autoFocus` to any focusable element to set focus automatically on initialisation.\r\n */\r\n@Directive({\r\n selector: '[autoFocus]',\r\n standalone: true\r\n})\r\nexport class AutoFocusDirective {\r\n\r\n private readonly elementRef = inject(ElementRef);\r\n\r\n constructor() {\r\n afterNextRender(() => {\r\n this.elementRef.nativeElement?.focus();\r\n });\r\n }\r\n}\r\n","import { DestroyRef, Directive, HostListener, inject, input } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Subject } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { DateInterval } from '../definitions';\nimport { SystemUtils } from '../system';\n\n/**\n * Directive that listens to `keyup` events on a date input and debounces changes\n * into a {@link DateInterval} model, converting shorthand strings (e.g. \"d/m\") to dates.\n * Apply `[dateIntervalChange]=\"interval\"` to the host `<input>` element.\n */\n@Directive({\n selector: '[dateIntervalChange]',\n standalone: true,\n})\nexport class DateIntervalChangeDirective {\n\n /** The date interval model to update when the input value changes. */\n readonly dateIntervalChange = input<DateInterval>(new DateInterval());\n\n /** When `true`, the directive updates the interval's end date; otherwise the start date. */\n readonly end = input<boolean>(false);\n\n private readonly subject = new Subject<KeyboardEvent>();\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.subject\n .pipe(debounceTime(100), takeUntilDestroyed(this.destroyRef))\n .subscribe((e: KeyboardEvent) => {\n const value = (e.target as HTMLInputElement)?.value;\n if (value !== undefined) {\n SystemUtils.changeDateInterval(value, this.dateIntervalChange(), this.end(), e.key === ' ');\n }\n });\n }\n\n /**\n * Handles `keydown` events on the host element.\n * The space key must be blocked HERE: by the time `keyup` fires the character\n * has already been inserted into the input, so `preventDefault` on `keyup`\n * cannot stop it.\n * @param e - The keyboard event emitted by the host input.\n */\n @HostListener('keydown', ['$event'])\n public onKeydown(e: KeyboardEvent): void {\n if (e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n\n /**\n * Handles `keyup` events on the host element and forwards them to the debounce pipeline.\n * @param e - The keyboard event emitted by the host input.\n */\n @HostListener('keyup', ['$event'])\n public onKeyup(e: KeyboardEvent): void {\n this.subject.next(e);\n }\n}\n","import {\n Directive,\n HostListener,\n input,\n output\n} from '@angular/core';\nimport { SystemUtils } from '../system';\n\n/**\n * Directive that copies a string payload to the clipboard when the host element is clicked.\n * Bind `[copyClipboard]=\"text\"` to provide the content to copy and listen to `(copied)` for confirmation.\n */\n@Directive({\n selector: '[copyClipboard]',\n standalone: true\n})\nexport class CopyClipboardDirective {\n\n /** The text to copy to the clipboard. Bound via the `copyClipboard` attribute. */\n readonly payload = input<string | undefined>(undefined, { alias: 'copyClipboard' });\n\n /** Emits the copied text after a successful copy operation. */\n readonly copied = output<string>({ alias: 'copied' });\n\n /**\n * Handles click events on the host element and copies the payload to the clipboard.\n * Emits `copied` with the copied text on success.\n * @param e - The mouse click event.\n */\n @HostListener('click', ['$event'])\n public onClick(e: MouseEvent): void {\n e.preventDefault();\n const payload = this.payload();\n if (!payload) return;\n\n if (SystemUtils.isBrowser()) {\n const listener = (clipEvent: ClipboardEvent) => {\n clipEvent.clipboardData?.setData('text/html', payload);\n clipEvent.clipboardData?.setData('text/plain', payload);\n clipEvent.preventDefault();\n this.copied.emit(payload);\n };\n\n document.addEventListener('copy', listener, false);\n document.execCommand('copy');\n document.removeEventListener('copy', listener, false);\n }\n }\n}\n","import { Directive, ElementRef, HostListener, inject } from '@angular/core';\r\n\r\n/**\r\n * Directive that removes focus from the host element after it is clicked,\r\n * preventing the browser from keeping a visible focus ring post-interaction.\r\n * Apply `removeFocus` to any focusable element (e.g. a button).\r\n */\r\n@Directive({\r\n selector: '[removeFocus]',\r\n standalone: true\r\n})\r\nexport class RemoveFocusDirective {\r\n\r\n private readonly elementRef = inject(ElementRef);\r\n\r\n /**\r\n * Handles click events on the host element and blurs it on the next event-loop tick\r\n * so that the click action completes before focus is removed.\r\n */\r\n @HostListener('click')\r\n onClick(): void {\r\n const el = this.elementRef.nativeElement;\r\n if (el && typeof el.blur === 'function') {\r\n setTimeout(() => el.blur(), 0);\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n/**\n * Pipe that converts plain-text newlines (`\\r\\n`, `\\r`, `\\n`) to HTML `<br>` tags\n * and marks the result as trusted HTML so Angular does not escape it.\n *\n * Usage: `{{ text | formatHtml }}`\n */\n@Pipe({\n name: 'formatHtml',\n standalone: true\n})\nexport class FormatHtmlPipe implements PipeTransform {\n private readonly sanitizer = inject(DomSanitizer);\n\n /**\n * Transforms a plain-text string into sanitized HTML by replacing newline characters\n * with `<br>` tags.\n * @param value - The input string to transform. Treated as an empty string when `undefined`.\n * @returns A `SafeHtml` value that can be rendered with `[innerHTML]`.\n */\n transform(value?: string): SafeHtml {\n const escaped = (value ?? '')\n .replaceAll('&', '&')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replaceAll('\"', '"');\n return this.sanitizer.bypassSecurityTrustHtml(escaped.replaceAll(/(?:\\r\\n|\\r|\\n)/g, '<br>'));\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { format } from 'date-fns';\nimport { it } from 'date-fns/locale';\nimport { SystemUtils } from '../system';\n\n/**\n * General-purpose formatting pipe that converts a raw value to a locale-aware string\n * based on the specified format type.\n *\n * Supported types: `'date'` / `'D'`, `'currency'` / `'C'`, `'number'` / `'N'`,\n * `'number0'` / `'N0'`, `'percentage'` / `'P'`.\n *\n * Usage: `{{ value | format:'currency' }}`\n */\n@Pipe({\n name: 'format',\n standalone: true\n})\nexport class FormatPipe implements PipeTransform {\n\n /** Shared formatters: building an `Intl.NumberFormat` per call is expensive. */\n private static readonly currencyFormat = new Intl.NumberFormat('it-IT', { style: 'currency', currency: 'EUR' });\n private static readonly numberFormat = new Intl.NumberFormat('it-IT', { style: 'decimal', minimumFractionDigits: 0, maximumFractionDigits: 2 });\n private static readonly number0Format = new Intl.NumberFormat('it-IT', { style: 'decimal', minimumFractionDigits: 0, maximumFractionDigits: 0 });\n private static readonly percentFormat = new Intl.NumberFormat('it-IT', { style: 'percent', minimumFractionDigits: 0, maximumFractionDigits: 0 });\n\n /**\n * Formats a value according to the specified type and optional pattern.\n * Returns `undefined` when the value is `null` or `undefined`, or when the type is unrecognised.\n * @param value - The raw value to format.\n * @param type - The format type identifier (default: `'date'`).\n * @param pattern - The date pattern used when `type` is `'date'` (default: `'dd/MM/yyyy'`).\n * @returns A formatted string, or `undefined` when the value cannot be formatted.\n */\n transform(\n value?: unknown,\n type: string = 'date',\n pattern: string = 'dd/MM/yyyy'): string | undefined {\n\n if (value === undefined || value === null) return undefined;\n\n switch (type) {\n case 'D':\n case 'date': {\n const d = SystemUtils.parseDate(value as string | Date, it);\n if (d) return format(d, pattern, { locale: it });\n break;\n }\n case 'C':\n case 'currency':\n return FormatPipe.currencyFormat.format(value as number);\n case 'N':\n case 'number':\n return FormatPipe.numberFormat.format(value as number);\n case 'N0':\n case 'number0':\n return FormatPipe.number0Format.format(value as number);\n case 'P':\n case 'percentage':\n return FormatPipe.percentFormat.format(value as number);\n }\n\n return undefined;\n }\n}\n\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n/**\n * Pipe that applies a global regex replacement on a string and returns the result\n * as sanitized HTML. When `regexValue` is `'\\n'` and no `replaceValue` is given,\n * newlines are replaced with `<br>` tags.\n *\n * Usage: `{{ text | replace:'\\n':'' }}`\n */\n@Pipe({\n name: 'replace',\n standalone: true\n})\nexport class ReplacePipe implements PipeTransform {\n\n private readonly sanitizer = inject(DomSanitizer);\n\n /**\n * Replaces all occurrences of `regexValue` in `value` with `replaceValue`.\n * Returns `undefined` when `value` is empty or `undefined`.\n * @param value - The source string to process.\n * @param regexValue - The regex pattern string to match (applied with the global flag).\n * @param replaceValue - The replacement string. Defaults to `'<br>'` when `regexValue` is `'\\n'` and this is falsy.\n * @returns A `SafeHtml` value with all matches replaced, or `undefined` when the input is empty.\n */\n transform(value: string | undefined, regexValue: string, replaceValue?: string): SafeHtml | undefined {\n if (!value) return undefined;\n const replacement = (regexValue === '\\n' && !replaceValue) ? '<br>' : (replaceValue ?? '');\n return this.sanitizer.bypassSecurityTrustHtml(value.replace(new RegExp(regexValue, 'g'), replacement));\n }\n}\n\n","import { Pipe, PipeTransform, inject } from '@angular/core';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\n\r\n/**\r\n * Pipe that marks an HTML string as trusted so Angular does not escape it when\r\n * bound via `[innerHTML]`.\r\n *\r\n * Usage: `<div [innerHTML]=\"html | safeHtml\"></div>`\r\n */\r\n@Pipe({\r\n name: 'safeHtml',\r\n standalone: true\r\n})\r\nexport class SafeHtmlPipe implements PipeTransform {\r\n private readonly sanitizer = inject(DomSanitizer);\r\n\r\n /**\r\n * Bypasses Angular's HTML sanitization and returns a `SafeHtml` instance.\r\n * @param value - The raw HTML string to trust. Treated as an empty string when `undefined`.\r\n * @returns A `SafeHtml` value that can be bound to `[innerHTML]` without escaping.\r\n */\r\n transform(value?: string): SafeHtml {\r\n return this.sanitizer.bypassSecurityTrustHtml(value ?? '');\r\n }\r\n}\r\n\r\n","import { Pipe, PipeTransform, inject } from '@angular/core';\r\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\r\n\r\n/**\r\n * Pipe that marks a URL string as a trusted resource URL so Angular does not block it\r\n * when bound to attributes such as `[src]` or `[href]` on iframes, objects, or embeds.\r\n *\r\n * Usage: `<iframe [src]=\"url | safeUrl\"></iframe>`\r\n */\r\n@Pipe({\r\n name: 'safeUrl',\r\n standalone: true\r\n})\r\nexport class SafeUrlPipe implements PipeTransform {\r\n private readonly sanitizer = inject(DomSanitizer);\r\n\r\n /**\r\n * Bypasses Angular's resource-URL sanitization and returns a `SafeResourceUrl` instance.\r\n * @param value - The URL string to trust. Treated as an empty string when `undefined`.\r\n * @returns A `SafeResourceUrl` that can be bound to resource URL attributes without blocking.\r\n */\r\n transform(value?: string): SafeResourceUrl {\r\n return this.sanitizer.bypassSecurityTrustResourceUrl(value ?? '');\r\n }\r\n}\r\n\r\n","import { PipeTransform, Pipe } from '@angular/core';\r\n\r\n/**\r\n * Impure pipe that filters an array using a caller-provided predicate function.\r\n * Because the pipe is impure it re-evaluates on every change-detection cycle,\r\n * which is necessary when the predicate's captured state changes.\r\n *\r\n * Usage: `*ngFor=\"let item of items | callback:myFilter\"`\r\n */\r\n@Pipe({\r\n name: 'callback',\r\n pure: false,\r\n standalone: true\r\n})\r\nexport class SearchCallbackPipe implements PipeTransform {\r\n\r\n /**\r\n * Filters `items` by applying `callback` to each element.\r\n * Returns the original array unchanged when either argument is falsy.\r\n * @param items - The source array to filter. May be `undefined`.\r\n * @param callback - A predicate function that returns `true` for items to keep.\r\n * @returns A new filtered array, the original array when no callback is provided,\r\n * or `undefined` when `items` is `undefined`.\r\n */\r\n transform<T>(items: T[] | undefined, callback: ((item: T) => boolean) | undefined): T[] | undefined {\r\n if (!items || !callback) return items;\r\n return items.filter(item => callback(item));\r\n }\r\n}\r\n\r\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { SearchFilterMetadata } from '../definitions';\n\n/**\n * Pure pipe that filters an array of searchable items against a text query.\n * Note: being pure, it re-runs only when the array REFERENCE or the query\n * changes; mutate-in-place updates of the array are not detected.\n *\n * Each item is matched either via its `searchBag.name` property (when present)\n * or by converting the item itself to a lowercase string. The optional `metadata`\n * argument is updated in-place with the total item count and the filtered count,\n * making it usable in the template alongside `*ngFor`.\n *\n * Usage:\n * ```html\n * <div *ngFor=\"let item of items | search:filterText:meta\">...</div>\n * <div>Showing {{ meta.count }} of {{ meta.total }}</div>\n * ```\n */\n@Pipe({\n name: 'search',\n standalone: true\n})\nexport class SearchFilterPipe implements PipeTransform {\n\n /**\n * Filters `items` by performing a case-insensitive substring match against `value`.\n * When `items` or `value` is falsy the original array is returned unfiltered.\n * @param items - The source array to filter. May be `undefined`.\n * @param value - The search text to match against each item. May be `undefined`.\n * @param metadata - Optional object that is updated with `total` and `count` after filtering.\n * @returns The filtered array, the original array when no filter text is given,\n * or `undefined` when `items` is `undefined`.\n */\n transform(items?: any[], value?: string, metadata?: SearchFilterMetadata): any[] | undefined {\n metadata ??= { total: 0, count: 0 };\n\n if (!items || !value) {\n metadata.total = items?.length ?? 0;\n metadata.count = metadata.total;\n return items;\n }\n\n const query = value.toLowerCase();\n const result = items.filter(item => {\n if (!item) return false;\n const text: string | undefined = item.searchBag?.name ?? (typeof item === 'string' ? item : undefined);\n return text?.toLowerCase().includes(query) ?? false;\n });\n\n metadata.total = items.length;\n metadata.count = result.length;\n\n return result;\n }\n}\n\n","/**\n * Standard Broadcast Messages Manager\n * https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel\n */\n\nimport { Observable, Subject } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\n/** The typed message payload exchanged over the broadcast channel. */\nexport interface BroadcastChannelMessageBag<T> {\n /** Unique identifier for the message type. */\n messageId: string;\n /** Identifier of the sender. */\n sender?: string;\n /** Optional typed data attached to the message. */\n data?: T;\n}\n\n/** Subscription descriptor that pairs a message type identifier with its handler. */\nexport interface BroadcastChannelSubscriberInfo<T> {\n /** The message type identifier to listen for. */\n messageId: string;\n /** Callback invoked with the full message bag when a matching message is received. */\n action: (bag: BroadcastChannelMessageBag<T>) => void;\n}\n\n/**\n * Wrapper around the native Web `BroadcastChannel` API that adds typed messaging,\n * multiple named subscriptions, and a graceful disposal mechanism.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel\n */\nexport class BroadcastChannelManager {\n private channel?: BroadcastChannel;\n private readonly subject = new Subject<BroadcastChannelMessageBag<unknown>>();\n private subscriptions: BroadcastChannelSubscriberInfo<unknown>[] = [];\n\n /**\n * The name of the underlying `BroadcastChannel`, or `undefined` when the API\n * is not supported by the current browser.\n */\n public get currentBus(): string | undefined {\n return this.channel?.name;\n }\n\n /**\n * Observable that emits EVERY message bag received on the channel,\n * regardless of `messageId`. Completed by {@link dispose}.\n * Prefer {@link observe} to listen for a single message type.\n */\n public get messages(): Observable<BroadcastChannelMessageBag<unknown>> {\n return this.subject.asObservable();\n }\n\n /**\n * Returns a typed Observable that emits only the messages with the given `messageId`.\n *\n * Unlike {@link subscribe} (one callback per id, replaced on re-registration),\n * this supports any number of concurrent subscribers and integrates with the\n * RxJS lifecycle (`takeUntilDestroyed`, `async` pipe, ...). Completed by {@link dispose}.\n *\n * @param messageId - The message type identifier to listen for.\n * @returns An Observable of the matching typed message bags.\n */\n public observe<T>(messageId: string): Observable<BroadcastChannelMessageBag<T>> {\n return this.subject.pipe(\n filter(bag => bag.messageId === messageId),\n map(bag => bag as BroadcastChannelMessageBag<T>)\n );\n }\n\n /**\n * Opens a `BroadcastChannel` with the given name (when the API is available).\n * @param bus - The channel name to open (default: `'ARS-CHANNEL'`).\n */\n constructor(bus: string = 'ARS-CHANNEL') {\n if (typeof window !== 'undefined' && 'BroadcastChannel' in window) {\n this.channel = new BroadcastChannel(bus);\n\n this.channel.onmessageerror = (e: Event) => {\n console.error('[BroadcastChannelManager] Message receive error', e);\n };\n\n this.channel.onmessage = (e: MessageEvent) => {\n const bag = e.data as BroadcastChannelMessageBag<unknown> | undefined;\n if (!bag) return;\n this.subject.next(bag);\n const info = this.subscriptions.find(m => m.messageId === bag.messageId);\n info?.action(bag);\n };\n } else {\n console.error('[BroadcastChannelManager] BroadcastChannel API is not supported in this browser');\n }\n }\n\n /**\n * Closes the underlying channel and completes the internal subject after a short delay\n * to allow any in-flight messages to be delivered.\n */\n dispose(): void {\n setTimeout(() => {\n this.subscriptions = [];\n this.channel?.close();\n this.channel = undefined;\n this.subject.complete();\n }, 1000);\n }\n\n /**\n * Sends a typed message bag immediately.\n * @param bag - The message bag to send.\n * @example\n * channel.sendMessage({ messageId: 'my-message', sender: 'me', data: value });\n */\n sendMessage<T>(bag: BroadcastChannelMessageBag<T>): void;\n /**\n * Sends a typed message bag after an optional delay.\n * @param bag - The message bag to send.\n * @param delay - Milliseconds to wait before posting the message.\n * @example\n * channel.sendMessage({ messageId: 'my-message', sender: 'me', data: value }, 250);\n */\n sendMessage<T>(bag: BroadcastChannelMessageBag<T>, delay?: number): void;\n /**\n * Sends a message identified by a string ID with optional data.\n * @param messageId - The message type identifier.\n * @param data - Optional typed payload.\n * @example\n * channel.sendMessage('my-message', value);\n */\n sendMessage<T>(messageId: string, data?: T): void;\n /**\n * Sends a message identified by a string ID with optional data after an optional delay.\n * @param messageId - The message type identifier.\n * @param data - Optional typed payload.\n * @param delay - Milliseconds to wait before posting the message.\n * @example\n * channel.sendMessage('my-message', value, 250);\n */\n sendMessage<T>(messageId: string, data?: T, delay?: number): void;\n\n /** @internal Implementation that handles all overloads. */\n sendMessage<T>(messageIdOrBag: string | BroadcastChannelMessageBag<T>, dataOrDelay?: T | number, delay?: number): void {\n // Disambiguate overloads based on the first argument:\n // - string => (messageId, data?, delay?)\n // - object => (bag, delay?)\n let bag: BroadcastChannelMessageBag<T>;\n let effectiveDelay: number;\n if (typeof messageIdOrBag === 'string') {\n bag = { messageId: messageIdOrBag, data: dataOrDelay as T | undefined };\n effectiveDelay = delay ?? 0;\n } else {\n bag = messageIdOrBag;\n effectiveDelay = (typeof dataOrDelay === 'number' ? dataOrDelay : 0);\n }\n const post = () => this.channel?.postMessage(bag);\n if (effectiveDelay > 0) {\n setTimeout(post, effectiveDelay);\n } else {\n post();\n }\n }\n\n /**\n * Registers a handler for messages with the given `messageId`.\n * If a handler for the same `messageId` is already registered it is replaced.\n * @param args - The subscription descriptor containing the message ID and handler.\n */\n subscribe<T>(args: BroadcastChannelSubscriberInfo<T>): void {\n const i = this.subscriptions.findIndex(m => m.messageId === args.messageId);\n if (i === -1) {\n this.subscriptions.push(args as BroadcastChannelSubscriberInfo<unknown>);\n } else {\n this.subscriptions[i].action = args.action as (bag: BroadcastChannelMessageBag<unknown>) => void;\n }\n }\n\n /**\n * Removes the subscription for the given message ID, if one exists.\n * @param messageId - The message type identifier whose subscription should be removed.\n */\n unsubscribe(messageId: string): void {\n const i = this.subscriptions.findIndex(m => m.messageId === messageId);\n if (i !== -1) {\n this.subscriptions.splice(i, 1);\n }\n }\n\n /**\n * Removes all registered subscriptions.\n */\n unsubscribeAll(): void {\n this.subscriptions = [];\n }\n}\n\n","import { OnDestroy, Service } from '@angular/core';\nimport { filter, map, Observable, Subject } from 'rxjs';\nimport { BroadcastChannelManager, BroadcastChannelMessageBag } from './broadcastChannelManager';\n\nexport const CHANNEL_NAME = 'D2693418-B18F-41BB-BAE9-41BB5407957A-CHANNEL';\n\n/** Payload carried by every in-process broadcast message. */\nexport interface BroadcastMessageInfo {\n /** Unique identifier for the message type. */\n id: string;\n /** Optional data attached to the message. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data?: any;\n}\n\nexport interface BroadcastMessageToastData {\n message: string;\n icon?: string;\n duration?: number;\n}\n\n/**\n * Application-level messaging service that combines two transports:\n * - An in-process RxJS `Subject` for same-tab communication (`sendMessage` / `getMessage`).\n * - A native `BroadcastChannel` for cross-tab communication (`sendChannelMessage` / `subscribeChannelMessage`).\n */\n@Service()\nexport class BroadcastService implements OnDestroy {\n private readonly subject = new Subject<BroadcastMessageInfo>();\n private readonly channel = new BroadcastChannelManager(CHANNEL_NAME);\n\n /**\n * Creates a new standalone `BroadcastChannelManager` instance bound to the shared ARS channel.\n * Useful when a caller needs direct channel access outside the service.\n * @returns A new `BroadcastChannelManager` connected to the shared channel.\n */\n static createChannel(): BroadcastChannelManager {\n return new BroadcastChannelManager(CHANNEL_NAME);\n }\n\n ngOnDestroy(): void {\n this.channel?.dispose();\n this.subject.complete();\n }\n\n /**\n * Publishes a message to the in-process subject, optionally after a delay.\n * @param id - The message type identifier.\n * @param data - Optional payload to attach to the message.\n * @param delay - Milliseconds to wait before publishing (default: `0`).\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n sendMessage(id: string, data?: any, delay: number = 0): void {\n if (delay > 0) {\n setTimeout(() => this.subject.next({ id, data }), delay);\n } else {\n this.subject.next({ id, data });\n }\n }\n\n \n /**\n * Publishes a typed message over the native `BroadcastChannel` (cross-tab), optionally after a delay.\n * @param id - The message type identifier.\n * @param data - Optional typed payload to send.\n * @param delay - Milliseconds to wait before sending (forwarded to the channel manager).\n */\n sendChannelMessage<T>(id: string, data?: T, delay?: number): void {\n this.channel.sendMessage(id, data, delay);\n }\n\n /**\n * Registers a handler that is invoked whenever a channel message with the given `id` is received.\n * @param id - The message type identifier to listen for.\n * @param action - Callback invoked with the full `BroadcastChannelMessageBag` when a matching message arrives.\n */\n subscribeChannelMessage<T>(id: string, action: (bag: BroadcastChannelMessageBag<T>) => void): void {\n this.channel.subscribe({ messageId: id, action });\n }\n\n /**\n * Removes the channel subscription previously registered for the given `id`, if any.\n * @param id - The message type identifier whose subscription should be removed.\n */\n unsubscribeChannelMessage(id: string): void {\n this.channel.unsubscribe(id);\n }\n\n /**\n * Returns a typed Observable of the cross-tab channel messages with the given `id`.\n * Supports multiple concurrent subscribers and the RxJS lifecycle operators,\n * unlike `subscribeChannelMessage` (single callback per id).\n * @param id - The message type identifier to listen for.\n * @returns An Observable of the matching typed message bags.\n */\n observeChannelMessage<T>(id: string): Observable<BroadcastChannelMessageBag<T>> {\n return this.channel.observe<T>(id);\n }\n\n /**\n * Returns an `Observable` that emits every in-process message published via `sendMessage`.\n * @returns An observable stream of `BroadcastMessageInfo` objects.\n */\n getMessage(): Observable<BroadcastMessageInfo> {\n return this.subject.asObservable();\n }\n\n /**\n * Returns a typed `Observable` of the in-process messages with the given `id`.\n * @param id - The message type identifier to listen for.\n * @returns An Observable emitting the typed `data` payload of each matching message.\n */\n observeMessage<T>(id: string): Observable<T | undefined> {\n return this.subject.pipe(\n filter(info => info.id === id),\n map(info => info.data as T | undefined)\n );\n }\n}\n\n","import { Service, computed, signal } from '@angular/core';\r\n\r\n/**\r\n * Application-wide environment configuration service.\r\n * Exposes writable signals for the base URIs used throughout the application.\r\n * Values should be set once during application bootstrap (e.g. in `APP_INITIALIZER`).\r\n */\r\n@Service()\r\nexport class EnvironmentService {\r\n\r\n /** Writable signal holding the base URI of the frontend application (e.g. `https://app.example.com`). */\r\n readonly appUriSignal = signal<string>('');\r\n\r\n /** Writable signal holding the base URI of the backend API service (e.g. `https://api.example.com`). */\r\n readonly appServiceUriSignal = signal<string>('');\r\n\r\n /**\r\n * Writable signal holding the redirect URI used after login.\r\n * When empty, `appLoginRedirectUri` falls back to `appUri`.\r\n */\r\n readonly appLoginRedirectUriSignal = signal<string>('');\r\n\r\n /**\r\n * Writable signal holding the login endpoint URI of the backend service.\r\n * When empty, `appServiceLoginUri` falls back to `appServiceUri`.\r\n */\r\n readonly appServiceLoginUriSignal = signal<string>('');\r\n\r\n // ── Computed: fallback logic ──────────────────────────────────────────────\r\n\r\n private readonly _effectiveLoginRedirectUri = computed(() =>\r\n this.appLoginRedirectUriSignal() || this.appUriSignal()\r\n );\r\n\r\n private readonly _effectiveServiceLoginUri = computed(() =>\r\n this.appServiceLoginUriSignal() || this.appServiceUriSignal()\r\n );\r\n\r\n // ── Getter / setter API (kept for backward compatibility) ─────────────────\r\n\r\n /** Base URI of the frontend application. */\r\n get appUri(): string { return this.appUriSignal(); }\r\n /** @param value - The base URI of the frontend application. */\r\n set appUri(value: string) { this.appUriSignal.set(value); }\r\n\r\n /** Base URI of the backend API service. */\r\n get appServiceUri(): string { return this.appServiceUriSignal(); }\r\n /** @param value - The base URI of the backend API service. */\r\n set appServiceUri(value: string) { this.appServiceUriSignal.set(value); }\r\n\r\n /**\r\n * Effective login redirect URI.\r\n * Returns the explicitly set value, or falls back to `appUri` when empty.\r\n */\r\n get appLoginRedirectUri(): string { return this._effectiveLoginRedirectUri(); }\r\n /** @param value - The redirect URI to use after login. */\r\n set appLoginRedirectUri(value: string) { this.appLoginRedirectUriSignal.set(value); }\r\n\r\n /**\r\n * Effective service login URI.\r\n * Returns the explicitly set value, or falls back to `appServiceUri` when empty.\r\n */\r\n get appServiceLoginUri(): string { return this._effectiveServiceLoginUri(); }\r\n /** @param value - The login endpoint URI of the backend service. */\r\n set appServiceLoginUri(value: string) { this.appServiceLoginUriSignal.set(value); }\r\n}\r\n\r\n\r\n","import { Service, signal } from '@angular/core';\nimport { SystemUtils } from '../system';\n\n/**\n * Service that exposes reactive screen and device-capability information.\n */\n@Service()\nexport class ScreenService {\n\n /**\n * Writable signal that holds the current Material breakpoint alias\n * (e.g. `'xs'`, `'sm'`, `'md'`, `'lg'`, `'xl'`).\n * Updated externally by the breakpoint observer in the consuming component or module.\n */\n readonly mq = signal<string>('');\n\n /**\n * Returns `true` when the primary input mechanism can hover over elements\n * with coarse pointer precision (i.e. a touch screen).\n */\n get isTouchable(): boolean {\n return SystemUtils.isTouchable();\n }\n\n /**\n * Returns `true` when the current browser is Internet Explorer or the legacy Edge (EdgeHTML).\n * Modern Chromium-based Edge reports a different user-agent and will return `false`.\n */\n get isIEOrEdge(): boolean {\n return SystemUtils.isBrowser() && /msie\\s|trident\\/|edge\\//i.test(window.navigator.userAgent);\n }\n}\n\n","import { PLATFORM_ID, Service, inject } from '@angular/core';\r\nimport { isPlatformBrowser } from '@angular/common';\r\n\r\n/**\r\n * The splash API published by `index.html` on `window.splash`.\r\n *\r\n * `fail` is optional on purpose: it arrived after the others, and an application whose\r\n * `index.html` predates it must keep working rather than throw. {@link SplashService.fail} falls\r\n * back to a plain message when it is missing.\r\n */\r\ninterface SplashApiSurface {\r\n setMessage(text: string): void;\r\n hide(): void;\r\n disarm(): void;\r\n fail?(text: string): void;\r\n}\r\n\r\n@Service()\r\nexport class SplashService {\r\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\r\n\r\n\r\n /**\r\n * Resolve the global splash API exposed by index.html.\r\n * @returns The API object, or `undefined` when the splash has already\r\n * been removed or when running in SSR.\r\n */\r\n private get api(): SplashApiSurface | undefined {\r\n return this.isBrowser ? (window as unknown as { splash?: SplashApiSurface }).splash : undefined;\r\n }\r\n\r\n /**\r\n * Update the splash message (e.g. \"Accesso in corso...\").\r\n * No-op when the splash is gone or in SSR.\r\n * @param text - The new message to display.\r\n */\r\n setMessage(text: string): void { this.api?.setMessage(text); }\r\n\r\n /**\r\n * Defuse the watchdog: Angular bootstrap succeeded,\r\n * no automatic reload will ever fire.\r\n */\r\n bootstrapped(): void { this.api?.disarm(); }\r\n\r\n /** Fade out and remove the splash overlay from the DOM. */\r\n hide(): void { this.api?.hide(); }\r\n\r\n /**\r\n * Give up on loading, without taking the splash away.\r\n *\r\n * The splash stays where it is but stops pretending something is still happening: the progress\r\n * bar goes and a reload button appears, so a user who would otherwise sit in front of an endless\r\n * animation has something to do. Uncovering the page instead would be worse — whatever is\r\n * underneath is, by definition, not ready.\r\n *\r\n * Falls back to {@link setMessage} where `index.html` does not publish `fail`: the user still\r\n * reads what happened, only without the button.\r\n * @param text - What to tell the user.\r\n */\r\n fail(text: string): void {\r\n const api = this.api;\r\n if (!api) return;\r\n if (api.fail) {\r\n api.fail(text);\r\n } else {\r\n api.setMessage(text);\r\n }\r\n }\r\n}\r\n","import { computed, inject, OnDestroy, RendererFactory2, Service, Signal, signal } from \"@angular/core\";\nimport { BroadcastChannelManager, BroadcastChannelMessageBag } from './broadcastChannelManager';\nimport { BehaviorSubject, Observable } from \"rxjs\";\n\n/** The three available theme modes: follow system preference, force light, or force dark. */\nexport type ThemeType = 'auto' | 'light' | 'dark';\n\n/** Internal schema that maps each `ThemeType` to its UI representation and the next value in the toggle cycle. */\ninterface ThemeInfoRecord {\n /** Material icon code for the current theme. */\n icon: string;\n /** Human-readable label for the current theme. */\n name: string;\n /** The `ThemeType` that `toggleTheme()` will switch to next. */\n next: ThemeType;\n /** Tooltip text shown on the toggle button. */\n tooltip: string;\n}\n\n/**\n * Application-level theme management service.\n *\n * Responsibilities:\n * - Persists the user's preferred theme in `localStorage`.\n * - Applies `'light'` or `'dark'` CSS class to `<body>`.\n * - Reacts to OS-level colour-scheme changes when the theme is set to `'auto'`.\n * - Synchronises theme changes across browser tabs via `BroadcastChannel`.\n * - Exposes reactive signals (`themeIcon`, `themeName`, `toggleTooltip`) for the UI.\n */\n@Service()\nexport class ThemeService implements OnDestroy {\n\n private readonly broadcastChannel = new BroadcastChannelManager('THEME-SERVICE');\n private readonly broadcastMessage = '$theme-changed';\n\n private readonly prefersColorSchemeMediaQueryList: MediaQueryList | undefined =\n typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia('(prefers-color-scheme: dark)')\n : undefined;\n\n /**\n * Observable that emits the resolved (`'light'` or `'dark'`) theme whenever it changes.\n * Useful for components that cannot consume signals directly (e.g. class-based guards).\n * @example\n * this.themeService.changed\n * .pipe(takeUntilDestroyed(this.destroyRef))\n * .subscribe(theme => { ... });\n */\n public readonly changed: Observable<ThemeType>;\n private readonly themeChanged = new BehaviorSubject<ThemeType>('auto');\n\n private readonly renderFactory2 = inject(RendererFactory2);\n private readonly renderer = this.renderFactory2.createRenderer(null, null);\n\n /** The currently selected `ThemeType` (may be `'auto'`). */\n private readonly theme = signal<ThemeType>('light');\n\n /** `true` when the theme is set to follow the system preference. */\n private readonly auto: Signal<boolean> = computed(() => this.theme() === 'auto');\n\n private readonly themeInfo: Record<ThemeType, ThemeInfoRecord> = {\n auto: { icon: 'routine', name: 'Tema di sistema', next: 'light', tooltip: 'Passa a tema chiaro' },\n light: { icon: 'light_mode', name: 'Tema chiaro', next: 'dark', tooltip: 'Passa a tema scuro' },\n dark: { icon: 'dark_mode', name: 'Tema scuro', next: 'auto', tooltip: 'Passa a tema di sistema' },\n };\n\n /** Reactive Material icon code for the current theme (use with `<mat-icon>`). */\n public readonly themeIcon: Signal<string> = computed(() => this.themeInfo[this.theme()].icon);\n\n /** Reactive human-readable name of the current theme. */\n public readonly themeName: Signal<string> = computed(() => this.themeInfo[this.theme()].name);\n\n /** Reactive tooltip text for the theme toggle button. */\n public readonly toggleTooltip: Signal<string> = computed(() => this.themeInfo[this.theme()].tooltip);\n\n constructor() {\n this.changed = this.themeChanged.asObservable();\n }\n\n /**\n * Initialises the service: loads the preferred theme, registers OS-change listener,\n * and subscribes to cross-tab broadcast messages.\n * Call this once during application bootstrap (e.g. in `APP_INITIALIZER`).\n * @param theme - The initial theme to apply (defaults to the value stored in `localStorage`).\n */\n initialize(theme: ThemeType = this.getPreferredTheme()): void {\n if (this.prefersColorSchemeMediaQueryList) {\n this.prefersColorSchemeMediaQueryList.onchange = () => {\n if (this.auto()) this.setTheme(this.theme());\n };\n }\n\n this.broadcastChannel.subscribe<ThemeType>({\n messageId: this.broadcastMessage,\n action: (bag: BroadcastChannelMessageBag<ThemeType>) => {\n if (bag.data && this.theme() !== bag.data) {\n this.setTheme(bag.data);\n }\n }\n });\n\n this.setTheme(theme);\n }\n\n ngOnDestroy(): void {\n this.broadcastChannel.dispose();\n }\n\n /**\n * Advances the theme through the cycle: `auto` → `light` → `dark` → `auto`.\n */\n public toggleTheme(): void {\n this.setTheme(this.themeInfo[this.theme()].next);\n }\n\n /**\n * Returns the resolved effective theme (`'light'` or `'dark'`), taking the OS preference\n * into account when the current mode is `'auto'`.\n * @returns `'light'` or `'dark'` — never `'auto'`.\n */\n public getTheme(): ThemeType {\n const current = this.theme();\n if (current === 'auto') {\n return this.prefersColorSchemeMediaQueryList?.matches ? 'dark' : 'light';\n }\n return current;\n }\n\n /**\n * Reads the theme stored in `localStorage` and validates it.\n * Falls back to `'auto'` when the stored value is missing or invalid.\n * @returns The persisted `ThemeType`, or `'auto'` as default.\n */\n private getPreferredTheme(): ThemeType {\n if (typeof localStorage === 'undefined') return 'auto';\n const stored = localStorage.getItem('preferred-theme');\n return stored && this.isTheme(stored) ? stored : 'auto';\n }\n\n /**\n * Returns `true` when `value` is a valid `ThemeType` string.\n * Acts as a TypeScript type guard.\n * @param value - The string to check.\n */\n private isTheme(value: string): value is ThemeType {\n return value === 'auto' || value === 'light' || value === 'dark';\n }\n\n /**\n * Applies the given theme to `<body>` (CSS class), persists it to `localStorage`,\n * notifies the `changed` observable, and broadcasts the change to other tabs.\n * @param theme - The `ThemeType` to apply (defaults to `'auto'`).\n */\n private setTheme(theme: ThemeType = 'auto'): void {\n this.renderer.removeClass(document.body, 'light');\n this.renderer.removeClass(document.body, 'dark');\n this.theme.set(theme);\n if (typeof localStorage !== 'undefined') {\n localStorage.setItem('preferred-theme', theme);\n }\n const effectiveClass = this.auto()\n ? (this.prefersColorSchemeMediaQueryList?.matches ? 'dark' : 'light')\n : theme;\n this.renderer.addClass(document.body, effectiveClass);\n this.themeChanged.next(this.getTheme());\n this.broadcastChannel.sendMessage(this.broadcastMessage, theme);\n }\n}\n","/*\n * Public API Surface of @arsedizioni/ars-utils/core\n */\nexport * from './definitions';\nexport * from './messages';\nexport * from './selectable';\nexport * from './system';\nexport * from './directives/index';\nexport * from './pipes/index';\nexport * from './services/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["filter","map"],"mappings":";;;;;;;;;;;;MAoDa,QAAQ,CAAA;IAInB,OAAO,GAAA;QACL,OAAO,IAAI,CAAC,KAAK;IACnB;AACD;MA8BY,UAAU,CAAA;AAEtB;MACY,OAAO,CAAA;AAEnB;MACY,UAAU,CAAA;AAEtB;AAEK,MAAO,WAAwB,SAAQ,UAAa,CAAA;AAGzD;MASY,aAAa,CAAA;AAGzB;MAEY,oBAAoB,CAAA;AAGhC;AAED;IACY;AAAZ,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,cAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACR,IAAA,cAAA,CAAA,cAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAa;AACb,IAAA,cAAA,CAAA,cAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAU;AACZ,CAAC,EAJW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;MAYb,UAAU,CAAA;AAMtB;MA+BY,WAAW,CAAA;AAKvB;MAyBY,YAAY,CAAA;AAGvB,IAAA,IAAI,UAAU,GAAA;A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AI,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;QACrD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACvC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC;IACjE;8GAxIW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,OAAA,EAAA,CAAA,CAAA;+GAAZ,YAAY,EAAA,CAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB;;;AC7BD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"arsedizioni-ars-utils-core.mjs","sources":["../../../projects/ars-utils/core/definitions.ts","../../../projects/ars-utils/core/dto.ts","../../../projects/ars-utils/core/messages.ts","../../../projects/ars-utils/core/system.ts","../../../projects/ars-utils/core/selectable.ts","../../../projects/ars-utils/core/directives/autoFocusDirective.ts","../../../projects/ars-utils/core/directives/changeDateIntervalDirective.ts","../../../projects/ars-utils/core/directives/copyClipboardDirective.ts","../../../projects/ars-utils/core/directives/removeFocusDirective.ts","../../../projects/ars-utils/core/pipes/format-html.pipe.ts","../../../projects/ars-utils/core/pipes/format.pipe.ts","../../../projects/ars-utils/core/pipes/replace.pipe.ts","../../../projects/ars-utils/core/pipes/safe-html.pipe.ts","../../../projects/ars-utils/core/pipes/safe-url.pipe.ts","../../../projects/ars-utils/core/pipes/search-callback.pipe.ts","../../../projects/ars-utils/core/pipes/search-filter.pipe.ts","../../../projects/ars-utils/core/services/broadcastChannelManager.ts","../../../projects/ars-utils/core/services/broadcast.service.ts","../../../projects/ars-utils/core/services/environment.service.ts","../../../projects/ars-utils/core/services/screen.service.ts","../../../projects/ars-utils/core/services/splash.service.ts","../../../projects/ars-utils/core/services/theme.service.ts","../../../projects/ars-utils/core/public_api.ts","../../../projects/ars-utils/core/arsedizioni-ars-utils-core.ts"],"sourcesContent":["\nexport interface INode {\n id: string;\n name: string;\n count?: number;\n children?: INode[];\n subFolders?: INode[];\n parent?: INode;\n level?: number;\n bag?: unknown;\n}\n\nexport interface DoneResult<T> {\n isNew?: boolean;\n data?: T;\n}\n\nexport interface ApiResponse {\n success: boolean;\n message: string;\n}\n\nexport interface ApiResult<T> extends ApiResponse {\n value: T;\n}\n\nexport interface Folder extends INode {\n teamId?: string;\n parentId?: string;\n position?: number;\n isPrivate?: boolean;\n itemsCount?: number;\n subItemsCount?: number;\n\n}\n\nexport interface FolderTree extends Folder {\n children?: Folder[];\n path?: string;\n}\n\nexport interface File<T> {\n ownerId?: T;\n id?: number;\n fileName: string;\n fileData: unknown;\n}\n\nexport interface Validated {\n isValid(): boolean;\n}\n\nexport class FileInfo implements Validated {\n file: any;\n valid!: boolean;\n\n isValid(): boolean {\n return this.valid;\n }\n}\n\nexport interface ErrorInfo {\n invalidateSession?: boolean;\n title?: string;\n message?: string;\n errorStatus?: number;\n service?: string;\n}\n\nexport interface NameValueItem<T> {\n name: string;\n value: T;\n shortName?: string;\n parentName?: string;\n parentValue?: T;\n header?: string;\n bag?: any;\n bagInfo?: string;\n disabled?: boolean;\n selected?: boolean;\n}\n\nexport interface Checkable {\n checked?: boolean;\n bag: unknown;\n getId(): unknown;\n}\n\n\nexport class ValueModel<T> {\n value!: T;\n}\nexport class IDModel<T = number> {\n id!: T;\n}\nexport class GroupModel<T = number> {\n ids!: T[];\n}\n\nexport class DeleteModel<T = number> extends GroupModel<T> {\n mode?: number;\n parentId?: T;\n}\n\nexport interface DeleteResultModel<T> {\n items?: T[],\n deleted: number;\n total: number;\n log?: string;\n}\n\nexport class RelationModel<T = number> {\n id!: T;\n parentId!: T;\n}\n\nexport class UpdateRelationsModel<T = number> {\n id!: T;\n relatedIds!: T[];\n}\n\n/** Identifies the external identity provider used for an OAuth login. */\nexport enum LoginOAuthType {\n None = 0,\n Microsoft = 1,\n Google = 2\n}\n\n/** Payload emitted by the OAuth login components once the provider returned a token. */\nexport interface LoginOAuthResult {\n type: LoginOAuthType,\n token: string\n}\n\nexport class QueryModel {\n any?: string;\n sortBy?: string;\n sortDescending?: boolean;\n first?: number;\n count?: number;\n}\n\nexport interface QueryResultModel<T> {\n interval?: string;\n items: T[];\n total: number;\n}\n\nexport interface UpdateModel<T = number> {\n parentId?: T;\n ids: T[];\n}\n\nexport interface UpdateResultModel<T> {\n items?: T[];\n updated: number;\n total: number;\n log?: string;\n}\n\nexport interface AddModel<T> extends UpdateModel<T> {\n\n}\n\nexport interface AddResultModel<T> {\n items?: T[];\n added: number;\n total: number;\n log?: string;\n}\n\nexport class ImportModel {\n origin!: string;\n dataFile!: FileInfo;\n jumpFirstLine?: boolean;\n map?: unknown;\n}\n\nexport interface EnableDisableModel {\n value: boolean;\n}\n\nexport interface SendToModel {\n sendToRecipients?: string;\n sendToSubject?: string;\n sendToText?: string;\n}\n\nexport interface SearchBag {\n name: string;\n}\n\nexport interface Searchable {\n searchBag: SearchBag;\n}\n\nexport interface SearchFilterMetadata {\n total: number; // totale elementi\n count: number; // conteggio filtrati\n}\n\nexport class DateInterval {\n from?: Date;\n to?: Date;\n get fromAsDate(): Date | undefined {\n if (this.from) {\n if (!(this.from instanceof Date)) {\n this.from = new Date(this.from);\n }\n if (this.from) {\n return new Date(\n this.from.getFullYear(),\n this.from.getMonth(),\n this.from.getDate(),\n 2,\n 0,\n 0\n )\n }\n }\n return undefined;\n }\n get toAsDate(): Date | undefined {\n if (this.to) {\n if (!(this.to instanceof Date)) {\n this.to = new Date(this.to);\n }\n if (this.to) {\n return new Date(\n this.to.getFullYear(),\n this.to.getMonth(),\n this.to.getDate(),\n 2,\n 0,\n 0\n )\n }\n }\n return undefined;\n }\n\n constructor(from?: Date, to?: Date) {\n this.from = from;\n this.to = to;\n }\n\n clear(): void {\n this.from = undefined;\n this.to = undefined;\n }\n}\n\nexport interface LoginResult<T> extends ApiResult<boolean> {\n context: T;\n oauth?: number;\n requiresMfa?: boolean;\n}\n","/**\n * Conversions between the objects the API speaks (DTOs) and the models a signal form works with.\n *\n * The two shapes differ in one systematic way. A DTO leaves out what it does not have: a place\n * with no phone number simply has no `phone`. A form model cannot afford that — signal forms only\n * build a child field for a key whose value is defined, and the string validators need a `string`\n * rather than `string | undefined` — so every editable field is present, holding its empty value\n * (`''` for text and for the boxes of a datepicker, `false` for a checkbox, `0` for a counter).\n *\n * Doing that conversion by hand means a `?? ''` per field on the way in and a `|| undefined` per\n * field on the way out, twice per form, kept in sync forever. {@link DtoUtils.fromModel} and\n * {@link DtoUtils.toModel} do it once, driven by a single \"empty model\" constant that also serves as\n * the initial value of the form and as what a \"clear\" button restores.\n */\n\n/**\n * The DTO shape of a form model: the same fields, without the values that stand for \"empty\".\n *\n * It mirrors what {@link DtoUtils.toModel} does at runtime, so the payload type says the truth. It\n * only works when the empty value is a literal type — `Date | '' | null` narrows to `Date`, while\n * a field typed `Date | string` cannot be narrowed, because `string` is not assignable to `''`.\n * That is the reason the convention is `| ''` and not `| string`.\n */\nexport type Dto<TModel> = { [K in keyof TModel]: Exclude<TModel[K], '' | null> };\n\n/** The two conversions between an API DTO and the model a signal form works with. */\nexport class DtoUtils {\n\n /**\n * Builds a form model from the object returned by the API.\n *\n * The shape of the result is decided by `empty`, never by the DTO: every key of `empty` is in\n * the result, taken from the DTO when it carries a usable value and left at its empty value\n * otherwise. A DTO field that is absent and one that is explicitly `null` are treated the same,\n * because both mean \"the record has no value here\" and the form wants its empty value for both.\n *\n * Keys that exist only in the model (a multi-select decomposed from a bitmask, a checkbox\n * extracted from a flags value) simply keep their empty value: fill them in around the call.\n *\n * @param empty - The neutral model: it declares every field the form owns, and the value each\n * one takes when the DTO does not carry it.\n * @param dto - The object coming from the API, or `undefined` when creating a new record.\n * @returns A new model, never the same reference as `empty` nor as `dto`.\n * @example\n * const EMPTY_PLACE: PlaceForm = { name: '', city: '', phone: '', disabled: false };\n * this.form().reset(DtoUtils.fromModel(EMPTY_PLACE, r.value));\n */\n public static fromModel<TModel extends object>(empty: TModel, dto?: Partial<TModel> | null): TModel {\n const model = { ...empty };\n if (!dto) return model;\n\n for (const key of Object.keys(empty) as (keyof TModel)[]) {\n const value = dto[key];\n if (value !== undefined && value !== null) {\n model[key] = value as TModel[keyof TModel];\n }\n }\n return model;\n }\n\n /**\n * Builds the payload for the API from the current form model.\n *\n * Every empty value — `''`, `null` or `undefined` — is dropped, so a field the user never filled\n * in travels as absent instead of reaching the backend as an empty string that would blank the\n * record. `0` and `false` are NOT empty: an amount of zero and a switch left off are data, and a\n * filter that wants an unticked box to mean \"no filter\" has to say so where it builds its query.\n *\n * The conversion is shallow: nested objects and arrays are passed through as they are, so a\n * composite field (a bitmask to rebuild, a nested block to normalize) is handled around the call\n * — usually by destructuring it out of the model first.\n *\n * The return type is {@link Dto}, the model without its empty values, so what the compiler sees\n * matches what travels: a `coachLevel: CoachLevel | null` field arrives as `CoachLevel` and fits\n * the optional `coachLevel?: CoachLevel` of the API model. At runtime the empty keys are simply\n * not there, which is what `HttpClient` serializes anyway.\n *\n * @param model - The current form model.\n * @returns A shallow copy without the empty fields.\n * @example\n * this.scmService.places.savePlace(DtoUtils.toModel(this.model()));\n */\n public static toModel<TModel extends object>(model: TModel): Dto<TModel> {\n const dto: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(model)) {\n if (value === '' || value === null || value === undefined) continue;\n dto[key] = value;\n }\n return dto as Dto<TModel>;\n }\n}\n","export const UtilsMessages = {\r\n /**\r\n * Messages\r\n */\r\n\r\n\r\n // Select dialog\r\n UTILS_DIALOGS_SELECT_OPTIONS_CHANGED: '§utils-dialogs-select-options-changed'\r\n};\r\n","import { DateInterval, INode } from './definitions';\nimport { format, Locale, parse, parseISO } from 'date-fns';\nimport { it } from 'date-fns/locale';\nimport { TZDate } from '@date-fns/tz';\n\n\nexport enum DateFormat {\n Short = 1, // dd/mm/yyyy\n Long = 2, // d mmmm yyyy\n LongWithShortMonth = 3, // d mmm yyyy\n LongWithWeekDay = 4, // wwww, d mmmm yyyy\n LongWithShortWeekDay = 5, // www, d mmmm yyyy\n MonthAndYear = 6, // mmm yyyy\n LongMonthAndYear = 7, // mmmm yyyy\n WeekDay = 8, // www d\n LongWeekDay = 9, // wwww d\n DayAndMonth = 10, // d mmmm\n ShortUS = 11, // mm/dd/yyyy\n ShortISO8601 = 12 // yyyy-mm-dd\n}\n\n/**\n * Key selector with IDE autocomplete and compile-time checking.\n *\n * Suggests the string keys of `T` in the editor and flags obvious typos when\n * `T` is known, while STILL accepting any plain string (the `string & {}`\n * branch), so existing callers that pass dynamic or untyped keys keep\n * compiling unchanged.\n */\nexport type KeyOf<T> = Extract<keyof T, string> | (string & {});\n\nexport interface PasswordStrength {\n score: number;\n label?: string;\n color?: string;\n suggestions?: string[];\n isValid: boolean;\n}\n\n\nexport class SystemUtils {\n /** Shared collator for locale-aware, case-insensitive string comparison. */\n private static readonly collator = new Intl.Collator('it', { sensitivity: 'base', numeric: true });\n\n\n /**\n * Array find by key\n * @param array : the array to scan\n * @param key : key name\n * @param value : the value to search for\n * @returns : the property value or null\n */\n static arrayFindByKey<T>(array: T[] | undefined, key: KeyOf<T>, value: unknown): T | undefined {\n if (!array) return undefined;\n for (const item of array) {\n if ((item as Record<string, unknown>)[key as string] === value) {\n return item;\n }\n }\n return undefined;\n }\n\n /**\n * Array find index by key\n * @param array : the array to scan\n * @param key : the key name\n * @param value : the value to search for\n * @returns : the array index or -1 if not found\n */\n static arrayFindIndexByKey<T>(array: T[] | undefined, key: KeyOf<T>, value: unknown): number {\n if (!array) return -1;\n for (let i = 0; i < array.length; i++) {\n if ((array[i] as Record<string, unknown>)[key as string] === value) {\n return i;\n }\n }\n return -1;\n }\n\n /**\n * Get a value from and array made of name|value items\n * @param array : the array to scan\n * @param value : the value to search for\n * @returns : the property value or null if not found\n */\n static arrayGetValue<T>(array: T[] | undefined, value: unknown): unknown {\n if (!array) return undefined;\n for (const item of array) {\n const i = item as Record<string, unknown>;\n if (i['value'] === value) {\n return i['name'] ?? i['id'];\n }\n }\n return undefined;\n }\n\n /**\n * Convert items to nodes into a tree structure\n * @param items : list of nodes\n * @param parent : parent node\n * @returns : an array of INode objects\n */\n static arrayToNodes(items: INode[], parent?: INode): INode[] {\n const nodes: INode[] = [];\n items.forEach(n => {\n const node: INode = {\n id: n.id.toString(),\n name: n.name,\n count: n.count ? n.count : 0,\n children: undefined,\n parent,\n bag: n,\n };\n nodes.push(node);\n node.children =\n n.children && n.children.length > 0\n ? this.arrayToNodes(n.children, node)\n : [];\n });\n return nodes;\n }\n\n /**\n * Comparator factory for sorting arrays of objects by a given property key.\n * Pass the element type for compile-time key checking:\n * `items.sort(SystemUtils.arraySortCompare<Employee>('lastName'))`.\n * @param key - Name of the property to sort by (autocompleted from `T` when provided).\n * @param order - Sort direction: `'asc'` (default) or `'desc'`.\n * @returns A comparator function that returns a negative, zero, or positive number.\n */\n static arraySortCompare<T extends object = Record<string, unknown>>(\n key: KeyOf<T>,\n order: 'asc' | 'desc' | (string & {}) = 'asc'\n ): (a: T, b: T) => number {\n const dir = order === 'desc' ? -1 : 1;\n return (a, b): number => {\n const varA = (a as Record<string, unknown>)[key as string];\n const varB = (b as Record<string, unknown>)[key as string];\n if (varA === varB) return 0;\n if (varA === undefined || varA === null) return -1 * dir;\n if (varB === undefined || varB === null) return 1 * dir;\n if (typeof varA === 'string' && typeof varB === 'string') {\n return SystemUtils.collator.compare(varA, varB) * dir;\n }\n return (varA > varB ? 1 : varA < varB ? -1 : 0) * dir;\n };\n }\n\n /**\n * Format weight\n * @param gr : grams\n * @returns : the formatted string\n */\n static formatWeight(gr: number): string {\n if (gr > 1000000) return `${(gr / 1000000).toFixed(2)} t`;\n else if (gr > 100000) return `${(gr / 100000).toFixed(2)} q`;\n else if (gr > 1000) return `${(gr / 1000).toFixed(2)} kg`;\n else return `${gr} gr`;\n }\n\n /**\n * Format file size\n * @param bytes : number of bytes\n * @returns : the formatted string\n */\n static formatFileSize(bytes: number): string {\n const MB = 1024 * 1024;\n if (bytes >= MB) return `${(bytes / MB).toFixed(1)} MB`;\n if (bytes >= 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${bytes} byte`;\n }\n\n /**\n * Compare two strings (case-insensitive, locale-aware, accent-insensitive).\n * @param a : string a\n * @param b : string b\n * @returns : 0 if equals, 1 if bigger, -1 if lower\n */\n static compareString(a?: string, b?: string): number {\n return this.collator.compare(a ?? '', b ?? '');\n }\n\n /**\n * Capitalize a string\n * @param s : the string to capitalize\n * @returns : the capitalized string \n */\n static capitalize(s?: string): string | undefined {\n if (!s) return undefined;\n let b = \"\";\n let cap = true;\n for (const char of s) {\n if (char === \" \") {\n b += char;\n cap = true;\n } else if (cap) {\n b += char.toUpperCase();\n cap = false;\n } else {\n b += char.toLowerCase();\n }\n }\n return b;\n }\n\n /**\n * Truncate a string at the last word boundary before `max`.\n * @param s : the string to truncate\n * @param max : the max number of chars\n * @returns : the truncated string\n */\n static truncate(s?: string, max: number = 500): string | undefined {\n if (!s) return undefined;\n if (s.length <= max) return s;\n const i = s.lastIndexOf(' ', max - 1);\n return i > 0 ? s.slice(0, i) : s;\n }\n\n /**\n * Join a list of strings\n * @param items : the list of strings\n * @param sep : the separator string\n * @param max : the maximum resulting string\n * @returns : the joined string\n */\n static join(items?: string[], sep: string = \" \", max: number = 350): string | undefined {\n if (!items || items.length === 0) return undefined;\n if (items.length > 1) {\n let l = 0;\n let s = \"\"\n while (s.length < max && items.length > l) {\n if (l > 0) {\n s += sep;\n }\n s += items[l++];\n }\n if (items.length > l) {\n s += \"...\";\n }\n return s;\n }\n return items[0];\n }\n\n /**\n * Normalize a string by converting it to lowercase and removing extra spaces, with special handling for acronyms and camelCase.\n * @param s : the string to normalize \n * @returns : The normalized string, or `undefined` if the input is falsy.\n */\n static normalizeDisplay(s?: string): string | undefined {\n if (!s) return s;\n return s\n .split(' ')\n .map((word, wordIndex) => {\n if (!word) return word;\n\n // If the word is all uppercase and contains at least one letter, we assume it's an acronym and leave it as is\n if (word === word.toUpperCase() && /[A-Z]/.test(word)) {\n return word;\n }\n\n // Otherwise, convert to lowercase letter by letter\n const chars = word.split('');\n return chars\n .map((char, charIndex) => {\n if (charIndex === 0 && wordIndex === 0) {\n // First letter of the first word:\n // remains uppercase only if the first 2 letters are both uppercase\n const secondChar = chars[1] ?? '';\n const keepUppercase =\n char === char.toUpperCase() &&\n secondChar === secondChar.toUpperCase() &&\n /[A-Z]/.test(char) &&\n /[A-Z]/.test(secondChar);\n return keepUppercase ? char : char.toLowerCase();\n }\n return char.toLowerCase();\n })\n .join('');\n })\n .join(' ');\n }\n\n /**\n * Wraps bare URLs in the given string with `<a>` anchor tags.\n * @param s - The plain-text or HTML string to process.\n * @returns The string with URLs replaced by clickable links, or `''` when `s` is falsy.\n */\n static replaceAsHtml(s?: string): string {\n if (!s) return '';\n return s.replace(/https?:\\/\\/[^\\s<]+/gi,\n v => `<a href=\"${v}\" target=\"_blank\" rel=\"noopener\">${v}</a>`);\n }\n\n\n /**\n * Compare two names\n * @param a : name a\n * @param b : name b\n * @returns : true if a equals b\n */\n static compareNames(a?: string, b?: string): boolean {\n if (a) a = a.trim();\n if (b) b = b.trim();\n if (a && b && a.length !== b.length) return false;\n if (this.compareString(a, b) === 0) return true;\n const p1 = (a ?? '').split(' ');\n const p2 = (b ?? '').split(' ');\n if (p1.length !== p2.length) return false;\n let matches = p1.length;\n const used = new Array<boolean>(p2.length).fill(false);\n for (const s1 of p1) {\n for (let j = 0; j < p2.length; j++) {\n if (!used[j] && this.compareString(s1, p2[j]) === 0) {\n used[j] = true;\n matches--;\n break;\n }\n }\n }\n\n return matches === 0;\n }\n\n /**\n * Obfuscate a text with a key-driven code point rotation.\n *\n * @deprecated This is OBFUSCATION, not cryptography: it hides values from\n * casual inspection but offers no real security. Use {@link encrypt} /\n * {@link decrypt} (AES-GCM via Web Crypto) for anything sensitive.\n *\n * The rotation operates on Unicode code points and skips the surrogate\n * range, so the output is always a well-formed string: emoji and other\n * astral characters round-trip correctly (the previous code-unit based\n * version could emit lone surrogates and corrupt them).\n *\n * BREAKING CHANGE: values encoded with the previous code-unit algorithm\n * cannot be decoded by this implementation.\n *\n * @param text : the text to encode or decode\n * @param key : the key\n * @param reverse : true to decode, false to encode\n * @returns : the obfuscated (or restored) text, or undefined when text/key are empty\n */\n static cipher(text: string, key: string, reverse: boolean = false): string | undefined {\n if (!text || !key) return undefined;\n // Valid Unicode scalar values: [0, 0xD7FF] + [0xE000, 0x10FFFF].\n // We rotate inside this contiguous \"logical\" space (surrogates excluded)\n // so the result is always a valid code point.\n const SURROGATE_START = 0xd800;\n const SURROGATE_SIZE = 0x800;\n const SPACE = 0x110000 - SURROGATE_SIZE; // number of valid scalar values\n const toIndex = (cp: number): number => (cp < SURROGATE_START ? cp : cp - SURROGATE_SIZE);\n const toCodePoint = (i: number): number => (i < SURROGATE_START ? i : i + SURROGATE_SIZE);\n\n const keyLen = key.length;\n let result = '';\n let i = 0;\n for (const ch of text) { // iterates by code point, not code unit\n let rotation = key.charCodeAt(i % keyLen);\n if (reverse) rotation = -rotation;\n const index = toIndex(ch.codePointAt(0)!);\n const rotated = ((index + rotation) % SPACE + SPACE) % SPACE;\n result += String.fromCodePoint(toCodePoint(rotated));\n i++;\n }\n return result;\n }\n\n // #region Real encryption (Web Crypto, AES-GCM)\n\n /** Payload format version, first byte of the binary envelope. */\n private static readonly CIPHER_VERSION = 1;\n /** PBKDF2 salt length in bytes. */\n private static readonly CIPHER_SALT_LENGTH = 16;\n /** AES-GCM IV length in bytes (96 bit, the recommended size for GCM). */\n private static readonly CIPHER_IV_LENGTH = 12;\n /** PBKDF2-HMAC-SHA-256 iterations (OWASP recommendation). */\n private static readonly CIPHER_ITERATIONS = 600000;\n\n /**\n * Derives an AES-GCM 256-bit key from a password using PBKDF2-HMAC-SHA-256.\n * @param password : the user password / passphrase\n * @param salt : the random salt bound to this payload\n * @returns : a non-extractable AES-GCM CryptoKey\n */\n private static async deriveKey(password: string, salt: Uint8Array): Promise<CryptoKey> {\n const material = await crypto.subtle.importKey(\n 'raw',\n new TextEncoder().encode(password),\n 'PBKDF2',\n false,\n ['deriveKey']\n );\n return crypto.subtle.deriveKey(\n { name: 'PBKDF2', salt: salt as BufferSource, iterations: this.CIPHER_ITERATIONS, hash: 'SHA-256' },\n material,\n { name: 'AES-GCM', length: 256 },\n false,\n ['encrypt', 'decrypt']\n );\n }\n\n /**\n * Encodes bytes as URL-safe Base64 (no '+', '/' or trailing '=').\n * @param bytes : the bytes to encode\n * @returns : the base64url string\n */\n private static toBase64Url(bytes: Uint8Array): string {\n let binary = '';\n const CHUNK = 0x8000;\n for (let i = 0; i < bytes.length; i += CHUNK) {\n binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK));\n }\n return btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n }\n\n /**\n * Decodes a URL-safe Base64 string back to bytes.\n * @param value : the base64url string\n * @returns : the decoded bytes\n */\n private static fromBase64Url(value: string): Uint8Array {\n const b64 = value.replace(/-/g, '+').replace(/_/g, '/');\n const padded = b64 + '='.repeat((4 - (b64.length % 4)) % 4);\n const binary = atob(padded);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);\n return bytes;\n }\n\n /**\n * Encrypts a text with a password using AES-GCM (256 bit) and a key derived\n * via PBKDF2-HMAC-SHA-256 with a random per-message salt.\n *\n * The result is a self-contained, URL-safe Base64 payload:\n * `version (1 byte) | salt (16 bytes) | iv (12 bytes) | ciphertext+tag`.\n * GCM is authenticated: any tampering makes {@link decrypt} fail.\n *\n * Requires a secure context (HTTPS or localhost) for `crypto.subtle`.\n *\n * @param text : the plain text to encrypt\n * @param password : the password / passphrase\n * @returns : the base64url payload, or undefined when text/password are\n * empty or the Web Crypto API is unavailable\n */\n static async encrypt(text: string, password: string): Promise<string | undefined> {\n if (!text || !password) return undefined;\n if (typeof crypto === 'undefined' || !crypto.subtle) return undefined;\n try {\n const salt = crypto.getRandomValues(new Uint8Array(this.CIPHER_SALT_LENGTH));\n const iv = crypto.getRandomValues(new Uint8Array(this.CIPHER_IV_LENGTH));\n const key = await this.deriveKey(password, salt);\n const cipherText = new Uint8Array(\n await crypto.subtle.encrypt({ name: 'AES-GCM', iv: iv as BufferSource }, key, new TextEncoder().encode(text))\n );\n const payload = new Uint8Array(1 + salt.length + iv.length + cipherText.length);\n payload[0] = this.CIPHER_VERSION;\n payload.set(salt, 1);\n payload.set(iv, 1 + salt.length);\n payload.set(cipherText, 1 + salt.length + iv.length);\n return this.toBase64Url(payload);\n } catch {\n return undefined;\n }\n }\n\n /**\n * Decrypts a payload produced by {@link encrypt}.\n * Returns undefined when the password is wrong, the payload was tampered\n * with, the format is unknown, or the Web Crypto API is unavailable.\n *\n * @param payload : the base64url payload returned by {@link encrypt}\n * @param password : the password / passphrase used to encrypt\n * @returns : the original plain text, or undefined on any failure\n */\n static async decrypt(payload: string, password: string): Promise<string | undefined> {\n if (!payload || !password) return undefined;\n if (typeof crypto === 'undefined' || !crypto.subtle) return undefined;\n try {\n const bytes = this.fromBase64Url(payload);\n const headerLength = 1 + this.CIPHER_SALT_LENGTH + this.CIPHER_IV_LENGTH;\n if (bytes.length <= headerLength || bytes[0] !== this.CIPHER_VERSION) return undefined;\n const salt = bytes.subarray(1, 1 + this.CIPHER_SALT_LENGTH);\n const iv = bytes.subarray(1 + this.CIPHER_SALT_LENGTH, headerLength);\n const cipherText = bytes.subarray(headerLength);\n const key = await this.deriveKey(password, salt);\n const plain = await crypto.subtle.decrypt(\n { name: 'AES-GCM', iv: iv as BufferSource },\n key,\n cipherText as BufferSource\n );\n return new TextDecoder().decode(plain);\n } catch {\n // Wrong password or tampered payload: GCM authentication failed\n return undefined;\n }\n }\n\n // #endregion\n\n /**\n * Clone an object (deep copy).\n * Uses native structuredClone: handles Date, Map, Set, typed arrays and circular references.\n * @param obj : the object to clone\n * @returns : a new object\n */\n static clone<T>(obj: T): T {\n if (obj === null || obj === undefined) return obj;\n return structuredClone(obj);\n }\n\n /**\n * Creates a deep clone of an object.\n * @param obj - The source object to clone.\n * @param dest - Optional pre-allocated destination object to merge the clone into.\n * @returns A deep copy of `obj`.\n */\n static deepClone<T extends object>(obj: T, dest?: T): T {\n const cloned = structuredClone(obj);\n if (dest) {\n Object.assign(dest, cloned);\n return dest;\n }\n return cloned;\n }\n\n\n /**\n * Returns `true` when `value` is a syntactically valid UUID string.\n * @param value - The string to validate.\n */\n static parseUUID(value?: string): boolean {\n if (!value) return false;\n let s = value.trim();\n // Strip a matching wrapper pair, if present\n if ((s.startsWith('{') && s.endsWith('}')) || (s.startsWith('(') && s.endsWith(')'))) {\n s = s.slice(1, -1);\n }\n return /^[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/.test(s);\n }\n\n /**\n * Returns `true` when `value` is a valid, non-empty (non-zero) UUID.\n * @param value - The string to validate.\n */\n static parseUUIDNotEmpty(value?: string): boolean {\n return this.parseUUID(value) && !/^[{(]?0{8}-(?:0{4}-){3}0{12}[)}]?$/.test((value ?? '').trim());\n }\n\n /**\n * Return an empty UUID\n * @returns : the empty UUID\n */\n static emptyUUID(): string { return \"00000000-0000-0000-0000-000000000000\" };\n\n /**\n * Create a new UUID\n * @returns : the string UUID\n */\n static generateUUID(): string {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n // Fallback (non-secure contexts)\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }\n\n /**\n * Reconstruct a standard UUID (with dashes) from a 32-char hex string without dashes.\n * @param value : 32-character hex string\n * @returns : the formatted UUID or the original string if it doesn't match the expected format\n */\n static inflateUUID(value: string): string {\n const s = value.trim();\n if (s.length !== 32) return s;\n return `${s.slice(0, 8)}-${s.slice(8, 12)}-${s.slice(12, 16)}-${s.slice(16, 20)}-${s.slice(20)}`;\n }\n\n /** Precompiled validation patterns. */\n private static readonly emailRegex = /^(?:[a-z0-9+!#$%&'*+\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\n private static readonly urlRegex = /^(https?:\\/\\/)?([\\da-z.-]+)\\.([a-z.]{2,12})(:\\d{1,5})?([/\\w .%-]*)?(\\?[^\\s#]*)?(#\\S*)?$/i;\n\n\n /**\n * Parse a text and return true if it is a valid email (or empty)\n * @param value : email\n * @returns : true if the email is valid or empty\n */\n static parseEmail(value?: string): boolean {\n if (!value) return true;\n return this.emailRegex.test(value.trim().toLowerCase());\n }\n\n /**\n * Parse a text containing one or more email addresses separated by `;` or `,`\n * and return true if all of them are valid (or the text is empty).\n * Empty items caused by double or trailing separators are ignored.\n * @param value : the email list to parse (e.g. \"a@b.it; c@d.it\")\n * @returns : true if all emails are valid or the value is empty\n */\n static parseEmails(value?: string): boolean {\n if (!value || value.trim().length === 0) return true;\n const items = value\n .split(/[;,]/)\n .map(e => e.trim().toLowerCase())\n .filter(e => e.length > 0);\n if (items.length === 0) return false; // only separators, no addresses\n return items.every(e => this.emailRegex.test(e));\n }\n\n /**\n * Parse a text and return true if it is a valid url (or empty)\n * @param value : the url to parse\n * @returns : true if the url is valid or empty\n */\n static parseUrl(value?: string): boolean {\n if (!value) return true;\n return this.urlRegex.test(value.trim().toLowerCase());\n }\n\n /**\n * Get date parts from a string value\n * @param value : the string to parse\n * @returns : an array of numbers with year, month, day\n */\n static getDateParts(value?: string): number[] | undefined {\n if (!value) return undefined;\n let parts: number[] = [];\n if (value.indexOf(\"-\") !== -1) {\n const p = value.split(\"-\");\n if (p.length !== 3) return undefined;\n parts = [parseInt(p[0]), parseInt(p[1]) - 1, parseInt(p[2])];\n } else if (value.indexOf(\"/\") !== -1) {\n const p = value.split(\"/\");\n if (p.length !== 3) return undefined;\n parts = [parseInt(p[2]), parseInt(p[1]) - 1, parseInt(p[0])];\n } else {\n return undefined;\n }\n return parts;\n }\n\n /**\n * Checks whether a value is a valid Date instance.\n * Note: do not use `date.getTime()` as a truthiness test, it is 0 (falsy)\n * for the Unix epoch (1970-01-01T00:00:00Z) even though the date is valid.\n * @param d : the value to check\n * @returns : true when `d` is a Date representing a valid point in time\n */\n static isValidDate(d: unknown): d is Date {\n return d instanceof Date && !isNaN(d.getTime());\n }\n\n /**\n * Parse a date\n * @param value : the value to check\n * @param locale : the locale to use\n * @returns : a valid Date object or undefined\n */\n static parseDate(value?: string | Date, locale: Locale = it): Date | undefined {\n // No value at all\n if (!value) return undefined;\n // A Date value\n if (value instanceof Date) return this.isValidDate(value) ? value : undefined;\n // Parse known formats using date-fns\n let d = parseISO(value as string);\n if (this.isValidDate(d) && d.getFullYear() > 1750) return d;\n d = parse(value as string, 'dd/MM/yyyy', new Date(), { locale: locale });\n if (this.isValidDate(d) && d.getFullYear() > 1750) return d;\n d = parse(value as string, 'yyyy-MM-dd', new Date(), { locale: locale });\n if (this.isValidDate(d) && d.getFullYear() > 1750) return d;\n // Parse values manually\n const parts = this.getDateParts(value as string);\n if (!parts) return undefined;\n if (parts[0] < 100) parts[0] += 2000;\n if (isNaN(parts[0]) || parts[0] < 0 || parts[0] < 1750) return undefined;\n if (isNaN(parts[1]) || parts[1] < 0) return undefined;\n if (isNaN(parts[2]) || parts[2] < 0) return undefined;\n if (parts[1] > 11) return undefined;\n if (parts[1] === 1 && parts[2] > 29) return undefined;\n else if (parts[1] !== 1 && parts[2] > 31) return undefined;\n return new TZDate(parts[0], parts[1], parts[2], 12);\n }\n\n /**\n * Converts a Date, timestamp or ISO string into a Europe/Rome Date whose JSON serialisation\n * emits a naive local datetime string (\"yyyy-MM-dd'T'HH:mm:ss\"), with no timezone designator,\n * so the wall-clock value round-trips to the server unchanged. Use this instead of `new Date(...)`\n * when reviving dates received from the API, to stay consistent with the DateFnsAdapter (values\n * entered through the datepicker already behave this way).\n * @param value : the source Date, Unix timestamp (ms) or ISO string\n * @returns : a Europe/Rome Date serialising as naive local time, or undefined for empty/invalid input\n */\n static toLocalDate(value?: Date | number | string): Date | undefined {\n if (value == null || value === '') return undefined;\n const ms = value instanceof Date ? value.getTime()\n : typeof value === 'number' ? value\n : new Date(value).getTime();\n if (isNaN(ms)) return undefined;\n const t = new TZDate(ms, 'Europe/Rome') as Date;\n Object.defineProperty(t, 'toJSON', {\n value: () => format(t, \"yyyy-MM-dd'T'HH:mm:ss\"),\n enumerable: false,\n configurable: true,\n writable: true,\n });\n return t;\n }\n\n /**\n * Format a date\n * @param value : the date or string to format\n * @param fmt : the DateFormat to use or the string pattern\n * @param locale : the locale to use (default is IT)\n * @returns : the formatted string\n */\n static formatDate(\n value?: Date | string,\n fmt: DateFormat | string = DateFormat.Short,\n locale: Locale = it): string {\n // No value at all\n if (!value) return '';\n // A string\n if (typeof value === 'string' || value instanceof String)\n value = this.parseDate(value as string);\n // Not a date\n if (!this.isValidDate(value))\n return '';\n // Format\n switch (fmt) {\n case DateFormat.Short: return format(value, \"dd/MM/yyyy\", { locale: locale });\n case DateFormat.Long: return format(value, \"d MMMM yyyy\", { locale: locale });\n case DateFormat.LongWithShortMonth: return format(value, \"d MMM yyyy\", { locale: locale });\n case DateFormat.LongWithWeekDay: return format(value, \"EEEE, d MMMM yyyy\", { locale: locale });\n case DateFormat.LongWithShortWeekDay: return format(value, \"EEE, d MMMM yyyy\", { locale: locale });\n case DateFormat.MonthAndYear: return format(value, \"MMM yyyy\", { locale: locale });\n case DateFormat.LongMonthAndYear: return format(value, \"MMMM yyyy\", { locale: locale });\n case DateFormat.WeekDay: return format(value, \"EEE, d\", { locale: locale });\n case DateFormat.LongWeekDay: return format(value, \"EEEE, d\", { locale: locale });\n case DateFormat.DayAndMonth: return format(value, \"d MMMM\", { locale: locale });\n case DateFormat.ShortUS: return format(value, \"MM/dd/yyyy\", { locale: locale });\n case DateFormat.ShortISO8601: return format(value, \"yyyy-MM-dd\", { locale: locale });\n default:\n return format(value, fmt, { locale: locale });\n }\n }\n\n /**\n * Update a DateInterval object according to a string\n * @param value : string value\n * @param interval : DateInterval value to update\n * @param end : true if must be updated the first or the end value \n * @param copy : copy the same value (works only if not end element)\n */\n static changeDateInterval(value: string, interval: DateInterval, end: boolean = false, copy: boolean = false): void {\n if (value) {\n let year = -1;\n if (value.length === 4 && (year = parseInt(value)) > 1750) {\n if (!end) {\n interval.from = new TZDate(new Date(year, 0, 1), 'Europe/Rome');\n interval.to = new TZDate(new Date(year, 11, 31), 'Europe/Rome');\n } else\n interval.to = new Date(year, 11, 31);\n } else {\n const parts = this.getDateParts(value);\n if (!parts || parts.length !== 3) return;\n if (isNaN(parts[0]) || parts[0] < 1750) return;\n if (isNaN(parts[1]) || parts[1] < 0 || parts[1] > 11) return;\n if (isNaN(parts[2]) || parts[2] < 1 || parts[2] > 31) return;\n const d = new TZDate(new Date(parts[0], parts[1], parts[2]), 'Europe/Rome');\n if (end)\n interval.to = d;\n else if (copy) {\n interval.from = d;\n interval.to = d;\n } else\n interval.from = d;\n }\n }\n }\n\n /** Cache of `Intl.NumberFormat` instances (their construction is expensive). */\n private static readonly numberFormatCache = new Map<string, Intl.NumberFormat>();\n\n /**\n * Returns a cached `Intl.NumberFormat` for the given options, creating it on first use.\n * @param locale - BCP 47 locale tag.\n * @param options - The `Intl.NumberFormat` options.\n * @returns A shared formatter instance.\n */\n private static getNumberFormat(locale: string, options: Intl.NumberFormatOptions): Intl.NumberFormat {\n const key = `${locale}|${options.style}|${options.currency ?? ''}|${options.minimumFractionDigits}|${options.maximumFractionDigits}`;\n let fmt = this.numberFormatCache.get(key);\n if (!fmt) {\n fmt = new Intl.NumberFormat(locale, options);\n this.numberFormatCache.set(key, fmt);\n }\n return fmt;\n }\n\n /**\n * Formats a number using a cached `Intl.NumberFormat`.\n * @param value - The number to format.\n * @param decimals - Maximum decimal places (default: `2`).\n * @param locale - BCP 47 locale tag (default: `'it-IT'`).\n * @returns The formatted number string.\n */\n static formatNumber(value: number, decimals: number = 2, locale: string = 'it-IT'): string {\n return this.getNumberFormat(locale, { style: 'decimal', minimumFractionDigits: 0, maximumFractionDigits: decimals }).format(value);\n }\n\n /**\n * Formats a number as a currency string using a cached `Intl.NumberFormat`.\n * @param value - The number to format.\n * @param currency - ISO 4217 currency code (default: `'EUR'`).\n * @param decimals - Maximum decimal places (default: `2`).\n * @param locale - BCP 47 locale tag (default: `'it-IT'`).\n * @returns The formatted currency string.\n */\n static formatCurrency(value: number, currency: string = 'EUR', decimals: number = 2, locale: string = 'it-IT'): string {\n return this.getNumberFormat(locale, { style: 'currency', currency, minimumFractionDigits: 0, maximumFractionDigits: decimals }).format(value);\n }\n\n /**\n * Percent-encodes a string for safe inclusion in a URL.\n * @param value - The string to encode.\n * @returns The encoded string, or `undefined` when `value` is empty.\n */\n static urlEncode(value: string): string | undefined {\n return value.length > 0\n ? encodeURIComponent(value)\n : undefined;\n }\n\n /**\n * Decodes a percent-encoded URL string, treating `+` as a space.\n * @param value - The encoded string to decode.\n * @returns The decoded string, or `undefined` when `value` is empty or absent.\n */\n static urlDecode(value?: string): string | undefined {\n return value && value.length > 0\n ? decodeURIComponent(value.replace(/\\+/g, '%20'))\n : undefined;\n }\n\n /**\n * Reads a query string parameter value from the current page URL.\n * @param name - The parameter name to look up.\n * @returns The decoded parameter value, or `undefined` when absent or running server-side.\n */\n static getQueryStringValueByName(name: string): string | undefined {\n if (!this.isBrowser()) return undefined;\n const v = new URLSearchParams(window.location.search).get(name);\n return v && v !== 'null' ? v : undefined;\n }\n\n /**\n * Generate a password\n * @returns : the password string\n */\n static generatePassword(length: number = 12): string {\n const lower = 'abcdefghijkmnopqrstuvwxyz'; // no 'l' (ambiguous)\n const upper = 'ABCDEFGHJKLMNPQRSTUVWXYZ'; // no 'I'/'O' (ambiguous)\n const digits = '23456789'; // no '0'/'1' (ambiguous)\n const symbols = '$!#%&*+-';\n const all = lower + upper + digits + symbols;\n\n // Secure random indices (crypto is available in browsers and Node)\n const rnd = (max: number): number => {\n if (typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function') {\n const buf = new Uint32Array(1);\n crypto.getRandomValues(buf);\n return buf[0] % max;\n }\n return Math.floor(Math.random() * max);\n };\n\n // Guarantee at least one char per class, fill the rest, then shuffle\n const chars: string[] = [\n lower[rnd(lower.length)],\n upper[rnd(upper.length)],\n digits[rnd(digits.length)],\n symbols[rnd(symbols.length)],\n ];\n while (chars.length < Math.max(length, 8)) {\n chars.push(all[rnd(all.length)]);\n }\n for (let i = chars.length - 1; i > 0; i--) {\n const j = rnd(i + 1);\n [chars[i], chars[j]] = [chars[j], chars[i]];\n }\n return chars.join('');\n }\n\n /**\n * Calculate password strength\n * @param password: the password to evaluate\n * @returns the password strength info\n */\n static calculatePasswordStrength(password?: string): PasswordStrength {\n if (password && password.length > 0) {\n let score = 0;\n const suggestions: string[] = [];\n\n // Length\n if (password.length >= 10) score++;\n else suggestions.push('Usa almeno 10 caratteri.');\n if (password.length >= 12) score++;\n else if (password.length >= 10) suggestions.push('Considera di usare più di 12 caratteri.');\n\n // Lowercase letters\n if (/[a-z]/.test(password)) score++;\n else suggestions.push('Aggiungi lettere minuscole.');\n\n // Uppercase letters\n if (/[A-Z]/.test(password)) score++;\n else suggestions.push('Aggiungi lettere maiuscole.');\n\n // Numbers\n if (/\\d/.test(password)) score++;\n else suggestions.push('Aggiungi numeri.');\n\n // Special characters\n if (/[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]/.test(password)) score++;\n else suggestions.push('Aggiungi caratteri speciali (!@#$%^&*).');\n\n // Common patterns\n if (/(.)\\1{2,}/.test(password)) {\n score = Math.max(0, score - 1);\n suggestions.push('Evita di ripetere lo stesso carattere.');\n }\n if (/123|abc|qwe/i.test(password)) {\n score = Math.max(0, score - 1);\n suggestions.push('Evita sequenze comuni (123, abc, qwe).');\n }\n\n // Label and color\n let label: string;\n let color: string;\n let isValid: boolean;\n if (score <= 2) {\n label = 'Molto debole';\n color = '#f44336';\n isValid = false;\n } else if (score <= 3) {\n label = 'Debole';\n color = '#ff9800';\n isValid = false;\n } else if (score <= 4) {\n label = 'Media';\n color = '#ffc107';\n isValid = true;\n } else if (score <= 5) {\n label = 'Forte';\n color = '#8bc34a';\n isValid = true;\n } else {\n label = 'Molto forte';\n color = '#4caf50';\n isValid = true;\n }\n\n return { score, label, color, suggestions, isValid };\n } else\n return {\n score: 0,\n isValid: false,\n suggestions: []\n };\n\n }\n\n\n /**\n * Check if current browser supports touch\n * @returns : true if the display is touchable\n */\n static isTouchable(): boolean {\n return (\n this.isBrowser() && (\n \"ontouchstart\" in window ||\n navigator.maxTouchPoints > 0)\n );\n }\n\n /**\n * This check will prevent 'window' logic to be executed\n * while executing the server rendering\n * @returns : true if using the browser\n */\n static isBrowser(): boolean {\n return typeof (window) !== 'undefined';\n }\n\n /**\n * Convert folders in a tree of Node object.\n * @param folders : the subfolders group or null to root\n * @returns : a node list\n */\n static toNodes(folders: INode[]): INode[] {\n return this._toNodes(folders, undefined);\n }\n\n /**\n * Convert folders in a tree of Node object.\n * @param folders : the children group or null to root\n * @param parent : the parent node\n * @returns : a node list \n */\n private static _toNodes(folders: INode[], parent?: INode): INode[] {\n const nodes: INode[] = [];\n folders.forEach((n: INode) => {\n const node: INode = {\n id: n.id,\n name: n.name,\n count: n.count,\n parent: parent,\n children: undefined,\n bag: n,\n };\n const children = n.children ?? n.subFolders ?? [];\n if (children.length > 0) {\n node.children = this._toNodes(children, node);\n }\n nodes.push(node);\n });\n return nodes;\n }\n\n /**\n * Returns an array of individual power-of-2 flag values that are set in `value`.\n * @param value - The bitmask to decompose.\n * @param max - Upper-bound exponent: checks flags from `1` up to `1 << max` (default: `30`).\n * @returns Array of set flag values, or an empty array when `value` is `0`.\n */\n static getFlags(value: number, max: number = 30): number[] {\n if (value !== 0) {\n const items: number[] = [];\n const top = Math.min(max, 30); // beyond 30 the shift overflows into the sign bit\n for (let exp = 0; exp <= top; exp++) {\n const v = 1 << exp;\n if ((value & v) === v) items.push(v);\n }\n return items;\n } else return [];\n }\n\n /** Cache for resolved color luminance results. */\n private static readonly colorLightCache = new Map<string, boolean>();\n\n /**\n * Check if a color is light or dark\n * @param color : the color\n * @param minimumLuminance : the lumimance to consider\n * @returns true if the color is light\n */\n static isColorLight(color: string, minimumLuminance: number = 186): boolean {\n if (!this.isBrowser()) return true; // SSR fallback\n const cacheKey = `${color}|${minimumLuminance}`;\n const cached = this.colorLightCache.get(cacheKey);\n if (cached !== undefined) return cached;\n\n const tempDiv = document.createElement('div');\n tempDiv.style.color = color;\n document.body.appendChild(tempDiv);\n const rgb = getComputedStyle(tempDiv).color;\n document.body.removeChild(tempDiv);\n\n const result = rgb.match(/\\d+/g);\n let light = true; // fallback\n if (result && result.length >= 3) {\n const r = parseInt(result[0], 10);\n const g = parseInt(result[1], 10);\n const b = parseInt(result[2], 10);\n light = (0.299 * r + 0.587 * g + 0.114 * b) > minimumLuminance;\n }\n this.colorLightCache.set(cacheKey, light);\n return light;\n }\n\n}\n","import { computed, EventEmitter, signal } from '@angular/core';\nimport { SelectionModel } from \"@angular/cdk/collections\";\nimport { KeyOf, SystemUtils } from \"./system\";\n\n/**\n * Generic selection model that tracks a set of selected items identified by a lookup field.\n * Wraps Angular CDK's `SelectionModel` and adds lookup-based add/remove logic.\n *\n * @typeParam T - The item type held in the selection.\n * @typeParam V - The type of the lookup key used to identify items.\n */\nexport class SelectableModel<T, V> {\n\n /**\n * Emits whenever the selection changes.\n * Carries the affected item, or `undefined` when the whole selection is cleared.\n *\n * Note: kept as `EventEmitter` (instead of a plain RxJS `Subject`) for\n * backward compatibility with existing consumers; `EventEmitter` extends\n * `Subject`, so `.subscribe()`, `pipe(...)` and `takeUntilDestroyed` all\n * work as expected.\n */\n readonly changed = new EventEmitter<T | undefined>();\n\n private readonly _all = signal<T[]>([]);\n\n /**\n * Snapshot of all items currently tracked by this model (selected or previously toggled).\n * Backed by a signal — reads are always up to date.\n */\n get all(): T[] {\n return this._all();\n }\n\n private readonly _current: SelectionModel<T>;\n\n /** The underlying CDK `SelectionModel` (provides `.selected`, `.isSelected`, etc.). */\n get current(): SelectionModel<T> {\n return this._current;\n }\n\n private readonly _lookupFieldName: KeyOf<T>;\n\n /** Signal that is `true` when at least one item is tracked in the internal list. */\n readonly hasValue = computed(() => this._all().length > 0);\n\n /** Signal with the number of items currently tracked in the internal list. */\n readonly count = computed(() => this._all().length);\n\n /** Signal that is `true` when exactly one item is currently selected. */\n readonly selectedOne = computed(() => this._all().length === 1);\n\n /** Signal that is `true` when two or more items are currently selected. */\n readonly selectedMany = computed(() => this._all().length > 1);\n\n /** Signal that is `true` when at least one element is selected. */\n readonly selectedAny = computed(() => this._all().length > 0);\n\n /** Signal that is `true` when no item is currently selected. */\n readonly selectedNone = computed(() => this._all().length === 0);\n\n /** Signal with the first currently selected item, or `undefined` when none is selected. */\n readonly first = computed(() => this._all()[0]);\n\n /**\n * @param allowMultiSelect - When `true` (default), multiple items can be selected simultaneously.\n * @param lookupFieldName - Name of the field used as the unique key when searching the internal list\n * (default: `'id'`). Keys of `T` are autocompleted; plain strings remain accepted.\n */\n constructor(\n allowMultiSelect: boolean = true,\n lookupFieldName: KeyOf<T> = 'id'\n ) {\n this._current = new SelectionModel<T>(\n allowMultiSelect,\n [],\n true,\n // Compare by lookup key so different instances of the same logical item\n // (e.g. after a data reload) are treated as the same selection entry.\n (a, b) => (a as Record<string, unknown>)[lookupFieldName] === (b as Record<string, unknown>)[lookupFieldName]\n );\n this._lookupFieldName = lookupFieldName;\n }\n\n /**\n * Toggles the CDK selection state of an item that already exists in the tracked list.\n * Has no effect when `lookupValue` does not match any tracked item.\n * @param item - The item whose selection state should be toggled.\n * @param lookupValue - The key value used to locate the item in the internal list.\n */\n updateCurrent(item: T, lookupValue: V): void {\n const p = SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, lookupValue);\n if (p !== -1) {\n this._current.toggle(item);\n this.changed.emit(item);\n }\n }\n\n /**\n * Toggles an item in both the internal list and the CDK selection.\n * Adds the item when it is not yet tracked; removes it when it is.\n * @param item - The item to toggle.\n * @param lookupValue - The key value used to locate or register the item.\n */\n toggle(item: T, lookupValue?: V): void {\n if (lookupValue === undefined) return;\n const p = SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, lookupValue);\n if (p === -1) {\n this._all.update(arr => [...arr, item]);\n } else {\n this._all.update(arr => arr.filter((_, i) => i !== p));\n }\n this._current.toggle(item);\n this.changed.emit(item);\n }\n\n /**\n * Adds an item to the internal list (when not already present) and marks it as selected.\n * @param item - The item to select.\n * @param lookupValue - The key value used to locate or register the item.\n */\n select(item: T, lookupValue?: V): void {\n if (lookupValue === undefined) return;\n const p = SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, lookupValue);\n if (p === -1) {\n this._all.update(arr => [...arr, item]);\n }\n this._current.select(item);\n this.changed.emit(item);\n }\n\n /**\n * Removes an item from the internal list and deselects it in the CDK model.\n * Has no effect when the item is not currently tracked.\n * @param item - The item to deselect.\n * @param lookupValue - The key value used to locate the item in the internal list.\n */\n deselect(item: T, lookupValue?: V): void {\n if (lookupValue === undefined) return;\n const p = SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, lookupValue);\n if (p !== -1) {\n this._all.update(arr => arr.filter((_, i) => i !== p));\n this._current.deselect(item);\n this.changed.emit(item);\n }\n }\n\n /**\n * Deselects all items whose lookup key is contained in `lookupValues`.\n * @param lookupValues - Array of key values identifying the items to deselect.\n */\n deselectByValues(lookupValues: V[]): void {\n if (lookupValues.length === 0) return;\n for (const key of lookupValues) {\n const p = SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, key);\n if (p !== -1) {\n const item = this._all()[p];\n this._all.update(arr => arr.filter((_, i) => i !== p));\n this._current.deselect(item);\n this.changed.emit(item);\n }\n }\n }\n\n /**\n * Runs `clearFunc` against every currently selected item, then clears the CDK selection.\n * The internal tracked list is **not** affected; only the CDK selection is cleared.\n * @param clearFunc - Callback invoked for each currently selected item before clearing.\n */\n clearCurrent(clearFunc: (item: T) => void): void {\n for (const item of this._current.selected) {\n clearFunc(item);\n }\n this._current.clear();\n this.changed.emit(undefined);\n }\n\n /**\n * Clears both the internal tracked list and the CDK selection.\n */\n clear(): void {\n this._all.set([]);\n this._current.clear();\n this.changed.emit(undefined);\n }\n\n /**\n * Returns `true` when the item identified by `lookupValue` is present in the tracked list.\n * @param lookupValue - The key value to look up.\n */\n isSelected(lookupValue?: V): boolean {\n return (\n lookupValue !== undefined &&\n SystemUtils.arrayFindIndexByKey(this._all(), this._lookupFieldName, lookupValue) !== -1\n );\n }\n}\n","import { afterNextRender, Directive, ElementRef, inject } from '@angular/core';\r\n\r\n/**\r\n * Directive that moves browser focus to the host element after the first render cycle.\r\n * Apply `autoFocus` to any focusable element to set focus automatically on initialisation.\r\n */\r\n@Directive({\r\n selector: '[autoFocus]',\r\n standalone: true\r\n})\r\nexport class AutoFocusDirective {\r\n\r\n private readonly elementRef = inject(ElementRef);\r\n\r\n constructor() {\r\n afterNextRender(() => {\r\n this.elementRef.nativeElement?.focus();\r\n });\r\n }\r\n}\r\n","import { DestroyRef, Directive, HostListener, inject, input } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Subject } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { DateInterval } from '../definitions';\nimport { SystemUtils } from '../system';\n\n/**\n * Directive that listens to `keyup` events on a date input and debounces changes\n * into a {@link DateInterval} model, converting shorthand strings (e.g. \"d/m\") to dates.\n * Apply `[dateIntervalChange]=\"interval\"` to the host `<input>` element.\n */\n@Directive({\n selector: '[dateIntervalChange]',\n standalone: true,\n})\nexport class DateIntervalChangeDirective {\n\n /** The date interval model to update when the input value changes. */\n readonly dateIntervalChange = input<DateInterval>(new DateInterval());\n\n /** When `true`, the directive updates the interval's end date; otherwise the start date. */\n readonly end = input<boolean>(false);\n\n private readonly subject = new Subject<KeyboardEvent>();\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.subject\n .pipe(debounceTime(100), takeUntilDestroyed(this.destroyRef))\n .subscribe((e: KeyboardEvent) => {\n const value = (e.target as HTMLInputElement)?.value;\n if (value !== undefined) {\n SystemUtils.changeDateInterval(value, this.dateIntervalChange(), this.end(), e.key === ' ');\n }\n });\n }\n\n /**\n * Handles `keydown` events on the host element.\n * The space key must be blocked HERE: by the time `keyup` fires the character\n * has already been inserted into the input, so `preventDefault` on `keyup`\n * cannot stop it.\n * @param e - The keyboard event emitted by the host input.\n */\n @HostListener('keydown', ['$event'])\n public onKeydown(e: KeyboardEvent): void {\n if (e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n\n /**\n * Handles `keyup` events on the host element and forwards them to the debounce pipeline.\n * @param e - The keyboard event emitted by the host input.\n */\n @HostListener('keyup', ['$event'])\n public onKeyup(e: KeyboardEvent): void {\n this.subject.next(e);\n }\n}\n","import {\n Directive,\n HostListener,\n input,\n output\n} from '@angular/core';\nimport { SystemUtils } from '../system';\n\n/**\n * Directive that copies a string payload to the clipboard when the host element is clicked.\n * Bind `[copyClipboard]=\"text\"` to provide the content to copy and listen to `(copied)` for confirmation.\n */\n@Directive({\n selector: '[copyClipboard]',\n standalone: true\n})\nexport class CopyClipboardDirective {\n\n /** The text to copy to the clipboard. Bound via the `copyClipboard` attribute. */\n readonly payload = input<string | undefined>(undefined, { alias: 'copyClipboard' });\n\n /** Emits the copied text after a successful copy operation. */\n readonly copied = output<string>({ alias: 'copied' });\n\n /**\n * Handles click events on the host element and copies the payload to the clipboard.\n * Emits `copied` with the copied text on success.\n * @param e - The mouse click event.\n */\n @HostListener('click', ['$event'])\n public onClick(e: MouseEvent): void {\n e.preventDefault();\n const payload = this.payload();\n if (!payload) return;\n\n if (SystemUtils.isBrowser()) {\n const listener = (clipEvent: ClipboardEvent) => {\n clipEvent.clipboardData?.setData('text/html', payload);\n clipEvent.clipboardData?.setData('text/plain', payload);\n clipEvent.preventDefault();\n this.copied.emit(payload);\n };\n\n document.addEventListener('copy', listener, false);\n document.execCommand('copy');\n document.removeEventListener('copy', listener, false);\n }\n }\n}\n","import { Directive, ElementRef, HostListener, inject } from '@angular/core';\r\n\r\n/**\r\n * Directive that removes focus from the host element after it is clicked,\r\n * preventing the browser from keeping a visible focus ring post-interaction.\r\n * Apply `removeFocus` to any focusable element (e.g. a button).\r\n */\r\n@Directive({\r\n selector: '[removeFocus]',\r\n standalone: true\r\n})\r\nexport class RemoveFocusDirective {\r\n\r\n private readonly elementRef = inject(ElementRef);\r\n\r\n /**\r\n * Handles click events on the host element and blurs it on the next event-loop tick\r\n * so that the click action completes before focus is removed.\r\n */\r\n @HostListener('click')\r\n onClick(): void {\r\n const el = this.elementRef.nativeElement;\r\n if (el && typeof el.blur === 'function') {\r\n setTimeout(() => el.blur(), 0);\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n/**\n * Pipe that converts plain-text newlines (`\\r\\n`, `\\r`, `\\n`) to HTML `<br>` tags\n * and marks the result as trusted HTML so Angular does not escape it.\n *\n * Usage: `{{ text | formatHtml }}`\n */\n@Pipe({\n name: 'formatHtml',\n standalone: true\n})\nexport class FormatHtmlPipe implements PipeTransform {\n private readonly sanitizer = inject(DomSanitizer);\n\n /**\n * Transforms a plain-text string into sanitized HTML by replacing newline characters\n * with `<br>` tags.\n * @param value - The input string to transform. Treated as an empty string when `undefined`.\n * @returns A `SafeHtml` value that can be rendered with `[innerHTML]`.\n */\n transform(value?: string): SafeHtml {\n const escaped = (value ?? '')\n .replaceAll('&', '&')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replaceAll('\"', '"');\n return this.sanitizer.bypassSecurityTrustHtml(escaped.replaceAll(/(?:\\r\\n|\\r|\\n)/g, '<br>'));\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { format } from 'date-fns';\nimport { it } from 'date-fns/locale';\nimport { SystemUtils } from '../system';\n\n/**\n * General-purpose formatting pipe that converts a raw value to a locale-aware string\n * based on the specified format type.\n *\n * Supported types: `'date'` / `'D'`, `'currency'` / `'C'`, `'number'` / `'N'`,\n * `'number0'` / `'N0'`, `'percentage'` / `'P'`.\n *\n * Usage: `{{ value | format:'currency' }}`\n */\n@Pipe({\n name: 'format',\n standalone: true\n})\nexport class FormatPipe implements PipeTransform {\n\n /** Shared formatters: building an `Intl.NumberFormat` per call is expensive. */\n private static readonly currencyFormat = new Intl.NumberFormat('it-IT', { style: 'currency', currency: 'EUR' });\n private static readonly numberFormat = new Intl.NumberFormat('it-IT', { style: 'decimal', minimumFractionDigits: 0, maximumFractionDigits: 2 });\n private static readonly number0Format = new Intl.NumberFormat('it-IT', { style: 'decimal', minimumFractionDigits: 0, maximumFractionDigits: 0 });\n private static readonly percentFormat = new Intl.NumberFormat('it-IT', { style: 'percent', minimumFractionDigits: 0, maximumFractionDigits: 0 });\n\n /**\n * Formats a value according to the specified type and optional pattern.\n * Returns `undefined` when the value is `null` or `undefined`, or when the type is unrecognised.\n * @param value - The raw value to format.\n * @param type - The format type identifier (default: `'date'`).\n * @param pattern - The date pattern used when `type` is `'date'` (default: `'dd/MM/yyyy'`).\n * @returns A formatted string, or `undefined` when the value cannot be formatted.\n */\n transform(\n value?: unknown,\n type: string = 'date',\n pattern: string = 'dd/MM/yyyy'): string | undefined {\n\n if (value === undefined || value === null) return undefined;\n\n switch (type) {\n case 'D':\n case 'date': {\n const d = SystemUtils.parseDate(value as string | Date, it);\n if (d) return format(d, pattern, { locale: it });\n break;\n }\n case 'C':\n case 'currency':\n return FormatPipe.currencyFormat.format(value as number);\n case 'N':\n case 'number':\n return FormatPipe.numberFormat.format(value as number);\n case 'N0':\n case 'number0':\n return FormatPipe.number0Format.format(value as number);\n case 'P':\n case 'percentage':\n return FormatPipe.percentFormat.format(value as number);\n }\n\n return undefined;\n }\n}\n\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n/**\n * Pipe that applies a global regex replacement on a string and returns the result\n * as sanitized HTML. When `regexValue` is `'\\n'` and no `replaceValue` is given,\n * newlines are replaced with `<br>` tags.\n *\n * Usage: `{{ text | replace:'\\n':'' }}`\n */\n@Pipe({\n name: 'replace',\n standalone: true\n})\nexport class ReplacePipe implements PipeTransform {\n\n private readonly sanitizer = inject(DomSanitizer);\n\n /**\n * Replaces all occurrences of `regexValue` in `value` with `replaceValue`.\n * Returns `undefined` when `value` is empty or `undefined`.\n * @param value - The source string to process.\n * @param regexValue - The regex pattern string to match (applied with the global flag).\n * @param replaceValue - The replacement string. Defaults to `'<br>'` when `regexValue` is `'\\n'` and this is falsy.\n * @returns A `SafeHtml` value with all matches replaced, or `undefined` when the input is empty.\n */\n transform(value: string | undefined, regexValue: string, replaceValue?: string): SafeHtml | undefined {\n if (!value) return undefined;\n const replacement = (regexValue === '\\n' && !replaceValue) ? '<br>' : (replaceValue ?? '');\n return this.sanitizer.bypassSecurityTrustHtml(value.replace(new RegExp(regexValue, 'g'), replacement));\n }\n}\n\n","import { Pipe, PipeTransform, inject } from '@angular/core';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\n\r\n/**\r\n * Pipe that marks an HTML string as trusted so Angular does not escape it when\r\n * bound via `[innerHTML]`.\r\n *\r\n * Usage: `<div [innerHTML]=\"html | safeHtml\"></div>`\r\n */\r\n@Pipe({\r\n name: 'safeHtml',\r\n standalone: true\r\n})\r\nexport class SafeHtmlPipe implements PipeTransform {\r\n private readonly sanitizer = inject(DomSanitizer);\r\n\r\n /**\r\n * Bypasses Angular's HTML sanitization and returns a `SafeHtml` instance.\r\n * @param value - The raw HTML string to trust. Treated as an empty string when `undefined`.\r\n * @returns A `SafeHtml` value that can be bound to `[innerHTML]` without escaping.\r\n */\r\n transform(value?: string): SafeHtml {\r\n return this.sanitizer.bypassSecurityTrustHtml(value ?? '');\r\n }\r\n}\r\n\r\n","import { Pipe, PipeTransform, inject } from '@angular/core';\r\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\r\n\r\n/**\r\n * Pipe that marks a URL string as a trusted resource URL so Angular does not block it\r\n * when bound to attributes such as `[src]` or `[href]` on iframes, objects, or embeds.\r\n *\r\n * Usage: `<iframe [src]=\"url | safeUrl\"></iframe>`\r\n */\r\n@Pipe({\r\n name: 'safeUrl',\r\n standalone: true\r\n})\r\nexport class SafeUrlPipe implements PipeTransform {\r\n private readonly sanitizer = inject(DomSanitizer);\r\n\r\n /**\r\n * Bypasses Angular's resource-URL sanitization and returns a `SafeResourceUrl` instance.\r\n * @param value - The URL string to trust. Treated as an empty string when `undefined`.\r\n * @returns A `SafeResourceUrl` that can be bound to resource URL attributes without blocking.\r\n */\r\n transform(value?: string): SafeResourceUrl {\r\n return this.sanitizer.bypassSecurityTrustResourceUrl(value ?? '');\r\n }\r\n}\r\n\r\n","import { PipeTransform, Pipe } from '@angular/core';\r\n\r\n/**\r\n * Impure pipe that filters an array using a caller-provided predicate function.\r\n * Because the pipe is impure it re-evaluates on every change-detection cycle,\r\n * which is necessary when the predicate's captured state changes.\r\n *\r\n * Usage: `*ngFor=\"let item of items | callback:myFilter\"`\r\n */\r\n@Pipe({\r\n name: 'callback',\r\n pure: false,\r\n standalone: true\r\n})\r\nexport class SearchCallbackPipe implements PipeTransform {\r\n\r\n /**\r\n * Filters `items` by applying `callback` to each element.\r\n * Returns the original array unchanged when either argument is falsy.\r\n * @param items - The source array to filter. May be `undefined`.\r\n * @param callback - A predicate function that returns `true` for items to keep.\r\n * @returns A new filtered array, the original array when no callback is provided,\r\n * or `undefined` when `items` is `undefined`.\r\n */\r\n transform<T>(items: T[] | undefined, callback: ((item: T) => boolean) | undefined): T[] | undefined {\r\n if (!items || !callback) return items;\r\n return items.filter(item => callback(item));\r\n }\r\n}\r\n\r\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { SearchFilterMetadata } from '../definitions';\n\n/**\n * Pure pipe that filters an array of searchable items against a text query.\n * Note: being pure, it re-runs only when the array REFERENCE or the query\n * changes; mutate-in-place updates of the array are not detected.\n *\n * Each item is matched either via its `searchBag.name` property (when present)\n * or by converting the item itself to a lowercase string. The optional `metadata`\n * argument is updated in-place with the total item count and the filtered count,\n * making it usable in the template alongside `*ngFor`.\n *\n * Usage:\n * ```html\n * <div *ngFor=\"let item of items | search:filterText:meta\">...</div>\n * <div>Showing {{ meta.count }} of {{ meta.total }}</div>\n * ```\n */\n@Pipe({\n name: 'search',\n standalone: true\n})\nexport class SearchFilterPipe implements PipeTransform {\n\n /**\n * Filters `items` by performing a case-insensitive substring match against `value`.\n * When `items` or `value` is falsy the original array is returned unfiltered.\n * @param items - The source array to filter. May be `undefined`.\n * @param value - The search text to match against each item. May be `undefined`.\n * @param metadata - Optional object that is updated with `total` and `count` after filtering.\n * @returns The filtered array, the original array when no filter text is given,\n * or `undefined` when `items` is `undefined`.\n */\n transform(items?: any[], value?: string, metadata?: SearchFilterMetadata): any[] | undefined {\n metadata ??= { total: 0, count: 0 };\n\n if (!items || !value) {\n metadata.total = items?.length ?? 0;\n metadata.count = metadata.total;\n return items;\n }\n\n const query = value.toLowerCase();\n const result = items.filter(item => {\n if (!item) return false;\n const text: string | undefined = item.searchBag?.name ?? (typeof item === 'string' ? item : undefined);\n return text?.toLowerCase().includes(query) ?? false;\n });\n\n metadata.total = items.length;\n metadata.count = result.length;\n\n return result;\n }\n}\n\n","/**\n * Standard Broadcast Messages Manager\n * https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel\n */\n\nimport { Observable, Subject } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\n/** The typed message payload exchanged over the broadcast channel. */\nexport interface BroadcastChannelMessageBag<T> {\n /** Unique identifier for the message type. */\n messageId: string;\n /** Identifier of the sender. */\n sender?: string;\n /** Optional typed data attached to the message. */\n data?: T;\n}\n\n/** Subscription descriptor that pairs a message type identifier with its handler. */\nexport interface BroadcastChannelSubscriberInfo<T> {\n /** The message type identifier to listen for. */\n messageId: string;\n /** Callback invoked with the full message bag when a matching message is received. */\n action: (bag: BroadcastChannelMessageBag<T>) => void;\n}\n\n/**\n * Wrapper around the native Web `BroadcastChannel` API that adds typed messaging,\n * multiple named subscriptions, and a graceful disposal mechanism.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel\n */\nexport class BroadcastChannelManager {\n private channel?: BroadcastChannel;\n private readonly subject = new Subject<BroadcastChannelMessageBag<unknown>>();\n private subscriptions: BroadcastChannelSubscriberInfo<unknown>[] = [];\n\n /**\n * The name of the underlying `BroadcastChannel`, or `undefined` when the API\n * is not supported by the current browser.\n */\n public get currentBus(): string | undefined {\n return this.channel?.name;\n }\n\n /**\n * Observable that emits EVERY message bag received on the channel,\n * regardless of `messageId`. Completed by {@link dispose}.\n * Prefer {@link observe} to listen for a single message type.\n */\n public get messages(): Observable<BroadcastChannelMessageBag<unknown>> {\n return this.subject.asObservable();\n }\n\n /**\n * Returns a typed Observable that emits only the messages with the given `messageId`.\n *\n * Unlike {@link subscribe} (one callback per id, replaced on re-registration),\n * this supports any number of concurrent subscribers and integrates with the\n * RxJS lifecycle (`takeUntilDestroyed`, `async` pipe, ...). Completed by {@link dispose}.\n *\n * @param messageId - The message type identifier to listen for.\n * @returns An Observable of the matching typed message bags.\n */\n public observe<T>(messageId: string): Observable<BroadcastChannelMessageBag<T>> {\n return this.subject.pipe(\n filter(bag => bag.messageId === messageId),\n map(bag => bag as BroadcastChannelMessageBag<T>)\n );\n }\n\n /**\n * Opens a `BroadcastChannel` with the given name (when the API is available).\n * @param bus - The channel name to open (default: `'ARS-CHANNEL'`).\n */\n constructor(bus: string = 'ARS-CHANNEL') {\n if (typeof window !== 'undefined' && 'BroadcastChannel' in window) {\n this.channel = new BroadcastChannel(bus);\n\n this.channel.onmessageerror = (e: Event) => {\n console.error('[BroadcastChannelManager] Message receive error', e);\n };\n\n this.channel.onmessage = (e: MessageEvent) => {\n const bag = e.data as BroadcastChannelMessageBag<unknown> | undefined;\n if (!bag) return;\n this.subject.next(bag);\n const info = this.subscriptions.find(m => m.messageId === bag.messageId);\n info?.action(bag);\n };\n } else {\n console.error('[BroadcastChannelManager] BroadcastChannel API is not supported in this browser');\n }\n }\n\n /**\n * Closes the underlying channel and completes the internal subject after a short delay\n * to allow any in-flight messages to be delivered.\n */\n dispose(): void {\n setTimeout(() => {\n this.subscriptions = [];\n this.channel?.close();\n this.channel = undefined;\n this.subject.complete();\n }, 1000);\n }\n\n /**\n * Sends a typed message bag immediately.\n * @param bag - The message bag to send.\n * @example\n * channel.sendMessage({ messageId: 'my-message', sender: 'me', data: value });\n */\n sendMessage<T>(bag: BroadcastChannelMessageBag<T>): void;\n /**\n * Sends a typed message bag after an optional delay.\n * @param bag - The message bag to send.\n * @param delay - Milliseconds to wait before posting the message.\n * @example\n * channel.sendMessage({ messageId: 'my-message', sender: 'me', data: value }, 250);\n */\n sendMessage<T>(bag: BroadcastChannelMessageBag<T>, delay?: number): void;\n /**\n * Sends a message identified by a string ID with optional data.\n * @param messageId - The message type identifier.\n * @param data - Optional typed payload.\n * @example\n * channel.sendMessage('my-message', value);\n */\n sendMessage<T>(messageId: string, data?: T): void;\n /**\n * Sends a message identified by a string ID with optional data after an optional delay.\n * @param messageId - The message type identifier.\n * @param data - Optional typed payload.\n * @param delay - Milliseconds to wait before posting the message.\n * @example\n * channel.sendMessage('my-message', value, 250);\n */\n sendMessage<T>(messageId: string, data?: T, delay?: number): void;\n\n /** @internal Implementation that handles all overloads. */\n sendMessage<T>(messageIdOrBag: string | BroadcastChannelMessageBag<T>, dataOrDelay?: T | number, delay?: number): void {\n // Disambiguate overloads based on the first argument:\n // - string => (messageId, data?, delay?)\n // - object => (bag, delay?)\n let bag: BroadcastChannelMessageBag<T>;\n let effectiveDelay: number;\n if (typeof messageIdOrBag === 'string') {\n bag = { messageId: messageIdOrBag, data: dataOrDelay as T | undefined };\n effectiveDelay = delay ?? 0;\n } else {\n bag = messageIdOrBag;\n effectiveDelay = (typeof dataOrDelay === 'number' ? dataOrDelay : 0);\n }\n const post = () => this.channel?.postMessage(bag);\n if (effectiveDelay > 0) {\n setTimeout(post, effectiveDelay);\n } else {\n post();\n }\n }\n\n /**\n * Registers a handler for messages with the given `messageId`.\n * If a handler for the same `messageId` is already registered it is replaced.\n * @param args - The subscription descriptor containing the message ID and handler.\n */\n subscribe<T>(args: BroadcastChannelSubscriberInfo<T>): void {\n const i = this.subscriptions.findIndex(m => m.messageId === args.messageId);\n if (i === -1) {\n this.subscriptions.push(args as BroadcastChannelSubscriberInfo<unknown>);\n } else {\n this.subscriptions[i].action = args.action as (bag: BroadcastChannelMessageBag<unknown>) => void;\n }\n }\n\n /**\n * Removes the subscription for the given message ID, if one exists.\n * @param messageId - The message type identifier whose subscription should be removed.\n */\n unsubscribe(messageId: string): void {\n const i = this.subscriptions.findIndex(m => m.messageId === messageId);\n if (i !== -1) {\n this.subscriptions.splice(i, 1);\n }\n }\n\n /**\n * Removes all registered subscriptions.\n */\n unsubscribeAll(): void {\n this.subscriptions = [];\n }\n}\n\n","import { OnDestroy, Service } from '@angular/core';\nimport { filter, map, Observable, Subject } from 'rxjs';\nimport { BroadcastChannelManager, BroadcastChannelMessageBag } from './broadcastChannelManager';\n\nexport const CHANNEL_NAME = 'D2693418-B18F-41BB-BAE9-41BB5407957A-CHANNEL';\n\n/** Payload carried by every in-process broadcast message. */\nexport interface BroadcastMessageInfo {\n /** Unique identifier for the message type. */\n id: string;\n /** Optional data attached to the message. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data?: any;\n}\n\nexport interface BroadcastMessageToastData {\n message: string;\n icon?: string;\n duration?: number;\n}\n\n/**\n * Application-level messaging service that combines two transports:\n * - An in-process RxJS `Subject` for same-tab communication (`sendMessage` / `getMessage`).\n * - A native `BroadcastChannel` for cross-tab communication (`sendChannelMessage` / `subscribeChannelMessage`).\n */\n@Service()\nexport class BroadcastService implements OnDestroy {\n private readonly subject = new Subject<BroadcastMessageInfo>();\n private readonly channel = new BroadcastChannelManager(CHANNEL_NAME);\n\n /**\n * Creates a new standalone `BroadcastChannelManager` instance bound to the shared ARS channel.\n * Useful when a caller needs direct channel access outside the service.\n * @returns A new `BroadcastChannelManager` connected to the shared channel.\n */\n static createChannel(): BroadcastChannelManager {\n return new BroadcastChannelManager(CHANNEL_NAME);\n }\n\n ngOnDestroy(): void {\n this.channel?.dispose();\n this.subject.complete();\n }\n\n /**\n * Publishes a message to the in-process subject, optionally after a delay.\n * @param id - The message type identifier.\n * @param data - Optional payload to attach to the message.\n * @param delay - Milliseconds to wait before publishing (default: `0`).\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n sendMessage(id: string, data?: any, delay: number = 0): void {\n if (delay > 0) {\n setTimeout(() => this.subject.next({ id, data }), delay);\n } else {\n this.subject.next({ id, data });\n }\n }\n\n \n /**\n * Publishes a typed message over the native `BroadcastChannel` (cross-tab), optionally after a delay.\n * @param id - The message type identifier.\n * @param data - Optional typed payload to send.\n * @param delay - Milliseconds to wait before sending (forwarded to the channel manager).\n */\n sendChannelMessage<T>(id: string, data?: T, delay?: number): void {\n this.channel.sendMessage(id, data, delay);\n }\n\n /**\n * Registers a handler that is invoked whenever a channel message with the given `id` is received.\n * @param id - The message type identifier to listen for.\n * @param action - Callback invoked with the full `BroadcastChannelMessageBag` when a matching message arrives.\n */\n subscribeChannelMessage<T>(id: string, action: (bag: BroadcastChannelMessageBag<T>) => void): void {\n this.channel.subscribe({ messageId: id, action });\n }\n\n /**\n * Removes the channel subscription previously registered for the given `id`, if any.\n * @param id - The message type identifier whose subscription should be removed.\n */\n unsubscribeChannelMessage(id: string): void {\n this.channel.unsubscribe(id);\n }\n\n /**\n * Returns a typed Observable of the cross-tab channel messages with the given `id`.\n * Supports multiple concurrent subscribers and the RxJS lifecycle operators,\n * unlike `subscribeChannelMessage` (single callback per id).\n * @param id - The message type identifier to listen for.\n * @returns An Observable of the matching typed message bags.\n */\n observeChannelMessage<T>(id: string): Observable<BroadcastChannelMessageBag<T>> {\n return this.channel.observe<T>(id);\n }\n\n /**\n * Returns an `Observable` that emits every in-process message published via `sendMessage`.\n * @returns An observable stream of `BroadcastMessageInfo` objects.\n */\n getMessage(): Observable<BroadcastMessageInfo> {\n return this.subject.asObservable();\n }\n\n /**\n * Returns a typed `Observable` of the in-process messages with the given `id`.\n * @param id - The message type identifier to listen for.\n * @returns An Observable emitting the typed `data` payload of each matching message.\n */\n observeMessage<T>(id: string): Observable<T | undefined> {\n return this.subject.pipe(\n filter(info => info.id === id),\n map(info => info.data as T | undefined)\n );\n }\n}\n\n","import { Service, computed, signal } from '@angular/core';\r\n\r\n/**\r\n * Application-wide environment configuration service.\r\n * Exposes writable signals for the base URIs used throughout the application.\r\n * Values should be set once during application bootstrap (e.g. in `APP_INITIALIZER`).\r\n */\r\n@Service()\r\nexport class EnvironmentService {\r\n\r\n /** Writable signal holding the base URI of the frontend application (e.g. `https://app.example.com`). */\r\n readonly appUriSignal = signal<string>('');\r\n\r\n /** Writable signal holding the base URI of the backend API service (e.g. `https://api.example.com`). */\r\n readonly appServiceUriSignal = signal<string>('');\r\n\r\n /**\r\n * Writable signal holding the redirect URI used after login.\r\n * When empty, `appLoginRedirectUri` falls back to `appUri`.\r\n */\r\n readonly appLoginRedirectUriSignal = signal<string>('');\r\n\r\n /**\r\n * Writable signal holding the login endpoint URI of the backend service.\r\n * When empty, `appServiceLoginUri` falls back to `appServiceUri`.\r\n */\r\n readonly appServiceLoginUriSignal = signal<string>('');\r\n\r\n // ── Computed: fallback logic ──────────────────────────────────────────────\r\n\r\n private readonly _effectiveLoginRedirectUri = computed(() =>\r\n this.appLoginRedirectUriSignal() || this.appUriSignal()\r\n );\r\n\r\n private readonly _effectiveServiceLoginUri = computed(() =>\r\n this.appServiceLoginUriSignal() || this.appServiceUriSignal()\r\n );\r\n\r\n // ── Getter / setter API (kept for backward compatibility) ─────────────────\r\n\r\n /** Base URI of the frontend application. */\r\n get appUri(): string { return this.appUriSignal(); }\r\n /** @param value - The base URI of the frontend application. */\r\n set appUri(value: string) { this.appUriSignal.set(value); }\r\n\r\n /** Base URI of the backend API service. */\r\n get appServiceUri(): string { return this.appServiceUriSignal(); }\r\n /** @param value - The base URI of the backend API service. */\r\n set appServiceUri(value: string) { this.appServiceUriSignal.set(value); }\r\n\r\n /**\r\n * Effective login redirect URI.\r\n * Returns the explicitly set value, or falls back to `appUri` when empty.\r\n */\r\n get appLoginRedirectUri(): string { return this._effectiveLoginRedirectUri(); }\r\n /** @param value - The redirect URI to use after login. */\r\n set appLoginRedirectUri(value: string) { this.appLoginRedirectUriSignal.set(value); }\r\n\r\n /**\r\n * Effective service login URI.\r\n * Returns the explicitly set value, or falls back to `appServiceUri` when empty.\r\n */\r\n get appServiceLoginUri(): string { return this._effectiveServiceLoginUri(); }\r\n /** @param value - The login endpoint URI of the backend service. */\r\n set appServiceLoginUri(value: string) { this.appServiceLoginUriSignal.set(value); }\r\n}\r\n\r\n\r\n","import { Service, signal } from '@angular/core';\nimport { SystemUtils } from '../system';\n\n/**\n * Service that exposes reactive screen and device-capability information.\n */\n@Service()\nexport class ScreenService {\n\n /**\n * Writable signal that holds the current Material breakpoint alias\n * (e.g. `'xs'`, `'sm'`, `'md'`, `'lg'`, `'xl'`).\n * Updated externally by the breakpoint observer in the consuming component or module.\n */\n readonly mq = signal<string>('');\n\n /**\n * Returns `true` when the primary input mechanism can hover over elements\n * with coarse pointer precision (i.e. a touch screen).\n */\n get isTouchable(): boolean {\n return SystemUtils.isTouchable();\n }\n\n /**\n * Returns `true` when the current browser is Internet Explorer or the legacy Edge (EdgeHTML).\n * Modern Chromium-based Edge reports a different user-agent and will return `false`.\n */\n get isIEOrEdge(): boolean {\n return SystemUtils.isBrowser() && /msie\\s|trident\\/|edge\\//i.test(window.navigator.userAgent);\n }\n}\n\n","import { PLATFORM_ID, Service, inject } from '@angular/core';\r\nimport { isPlatformBrowser } from '@angular/common';\r\n\r\n/**\r\n * The splash API published by `index.html` on `window.splash`.\r\n *\r\n * `fail` is optional on purpose: it arrived after the others, and an application whose\r\n * `index.html` predates it must keep working rather than throw. {@link SplashService.fail} falls\r\n * back to a plain message when it is missing.\r\n */\r\ninterface SplashApiSurface {\r\n setMessage(text: string): void;\r\n hide(): void;\r\n disarm(): void;\r\n fail?(text: string): void;\r\n}\r\n\r\n@Service()\r\nexport class SplashService {\r\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\r\n\r\n\r\n /**\r\n * Resolve the global splash API exposed by index.html.\r\n * @returns The API object, or `undefined` when the splash has already\r\n * been removed or when running in SSR.\r\n */\r\n private get api(): SplashApiSurface | undefined {\r\n return this.isBrowser ? (window as unknown as { splash?: SplashApiSurface }).splash : undefined;\r\n }\r\n\r\n /**\r\n * Update the splash message (e.g. \"Accesso in corso...\").\r\n * No-op when the splash is gone or in SSR.\r\n * @param text - The new message to display.\r\n */\r\n setMessage(text: string): void { this.api?.setMessage(text); }\r\n\r\n /**\r\n * Defuse the watchdog: Angular bootstrap succeeded,\r\n * no automatic reload will ever fire.\r\n */\r\n bootstrapped(): void { this.api?.disarm(); }\r\n\r\n /** Fade out and remove the splash overlay from the DOM. */\r\n hide(): void { this.api?.hide(); }\r\n\r\n /**\r\n * Give up on loading, without taking the splash away.\r\n *\r\n * The splash stays where it is but stops pretending something is still happening: the progress\r\n * bar goes and a reload button appears, so a user who would otherwise sit in front of an endless\r\n * animation has something to do. Uncovering the page instead would be worse — whatever is\r\n * underneath is, by definition, not ready.\r\n *\r\n * Falls back to {@link setMessage} where `index.html` does not publish `fail`: the user still\r\n * reads what happened, only without the button.\r\n * @param text - What to tell the user.\r\n */\r\n fail(text: string): void {\r\n const api = this.api;\r\n if (!api) return;\r\n if (api.fail) {\r\n api.fail(text);\r\n } else {\r\n api.setMessage(text);\r\n }\r\n }\r\n}\r\n","import { computed, inject, OnDestroy, RendererFactory2, Service, Signal, signal } from \"@angular/core\";\nimport { BroadcastChannelManager, BroadcastChannelMessageBag } from './broadcastChannelManager';\nimport { BehaviorSubject, Observable } from \"rxjs\";\n\n/** The three available theme modes: follow system preference, force light, or force dark. */\nexport type ThemeType = 'auto' | 'light' | 'dark';\n\n/** Internal schema that maps each `ThemeType` to its UI representation and the next value in the toggle cycle. */\ninterface ThemeInfoRecord {\n /** Material icon code for the current theme. */\n icon: string;\n /** Human-readable label for the current theme. */\n name: string;\n /** The `ThemeType` that `toggleTheme()` will switch to next. */\n next: ThemeType;\n /** Tooltip text shown on the toggle button. */\n tooltip: string;\n}\n\n/**\n * Application-level theme management service.\n *\n * Responsibilities:\n * - Persists the user's preferred theme in `localStorage`.\n * - Applies `'light'` or `'dark'` CSS class to `<body>`.\n * - Reacts to OS-level colour-scheme changes when the theme is set to `'auto'`.\n * - Synchronises theme changes across browser tabs via `BroadcastChannel`.\n * - Exposes reactive signals (`themeIcon`, `themeName`, `toggleTooltip`) for the UI.\n */\n@Service()\nexport class ThemeService implements OnDestroy {\n\n private readonly broadcastChannel = new BroadcastChannelManager('THEME-SERVICE');\n private readonly broadcastMessage = '$theme-changed';\n\n private readonly prefersColorSchemeMediaQueryList: MediaQueryList | undefined =\n typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia('(prefers-color-scheme: dark)')\n : undefined;\n\n /**\n * Observable that emits the resolved (`'light'` or `'dark'`) theme whenever it changes.\n * Useful for components that cannot consume signals directly (e.g. class-based guards).\n * @example\n * this.themeService.changed\n * .pipe(takeUntilDestroyed(this.destroyRef))\n * .subscribe(theme => { ... });\n */\n public readonly changed: Observable<ThemeType>;\n private readonly themeChanged = new BehaviorSubject<ThemeType>('auto');\n\n private readonly renderFactory2 = inject(RendererFactory2);\n private readonly renderer = this.renderFactory2.createRenderer(null, null);\n\n /** The currently selected `ThemeType` (may be `'auto'`). */\n private readonly theme = signal<ThemeType>('light');\n\n /** `true` when the theme is set to follow the system preference. */\n private readonly auto: Signal<boolean> = computed(() => this.theme() === 'auto');\n\n private readonly themeInfo: Record<ThemeType, ThemeInfoRecord> = {\n auto: { icon: 'routine', name: 'Tema di sistema', next: 'light', tooltip: 'Passa a tema chiaro' },\n light: { icon: 'light_mode', name: 'Tema chiaro', next: 'dark', tooltip: 'Passa a tema scuro' },\n dark: { icon: 'dark_mode', name: 'Tema scuro', next: 'auto', tooltip: 'Passa a tema di sistema' },\n };\n\n /** Reactive Material icon code for the current theme (use with `<mat-icon>`). */\n public readonly themeIcon: Signal<string> = computed(() => this.themeInfo[this.theme()].icon);\n\n /** Reactive human-readable name of the current theme. */\n public readonly themeName: Signal<string> = computed(() => this.themeInfo[this.theme()].name);\n\n /** Reactive tooltip text for the theme toggle button. */\n public readonly toggleTooltip: Signal<string> = computed(() => this.themeInfo[this.theme()].tooltip);\n\n constructor() {\n this.changed = this.themeChanged.asObservable();\n }\n\n /**\n * Initialises the service: loads the preferred theme, registers OS-change listener,\n * and subscribes to cross-tab broadcast messages.\n * Call this once during application bootstrap (e.g. in `APP_INITIALIZER`).\n * @param theme - The initial theme to apply (defaults to the value stored in `localStorage`).\n */\n initialize(theme: ThemeType = this.getPreferredTheme()): void {\n if (this.prefersColorSchemeMediaQueryList) {\n this.prefersColorSchemeMediaQueryList.onchange = () => {\n if (this.auto()) this.setTheme(this.theme());\n };\n }\n\n this.broadcastChannel.subscribe<ThemeType>({\n messageId: this.broadcastMessage,\n action: (bag: BroadcastChannelMessageBag<ThemeType>) => {\n if (bag.data && this.theme() !== bag.data) {\n this.setTheme(bag.data);\n }\n }\n });\n\n this.setTheme(theme);\n }\n\n ngOnDestroy(): void {\n this.broadcastChannel.dispose();\n }\n\n /**\n * Advances the theme through the cycle: `auto` → `light` → `dark` → `auto`.\n */\n public toggleTheme(): void {\n this.setTheme(this.themeInfo[this.theme()].next);\n }\n\n /**\n * Returns the resolved effective theme (`'light'` or `'dark'`), taking the OS preference\n * into account when the current mode is `'auto'`.\n * @returns `'light'` or `'dark'` — never `'auto'`.\n */\n public getTheme(): ThemeType {\n const current = this.theme();\n if (current === 'auto') {\n return this.prefersColorSchemeMediaQueryList?.matches ? 'dark' : 'light';\n }\n return current;\n }\n\n /**\n * Reads the theme stored in `localStorage` and validates it.\n * Falls back to `'auto'` when the stored value is missing or invalid.\n * @returns The persisted `ThemeType`, or `'auto'` as default.\n */\n private getPreferredTheme(): ThemeType {\n if (typeof localStorage === 'undefined') return 'auto';\n const stored = localStorage.getItem('preferred-theme');\n return stored && this.isTheme(stored) ? stored : 'auto';\n }\n\n /**\n * Returns `true` when `value` is a valid `ThemeType` string.\n * Acts as a TypeScript type guard.\n * @param value - The string to check.\n */\n private isTheme(value: string): value is ThemeType {\n return value === 'auto' || value === 'light' || value === 'dark';\n }\n\n /**\n * Applies the given theme to `<body>` (CSS class), persists it to `localStorage`,\n * notifies the `changed` observable, and broadcasts the change to other tabs.\n * @param theme - The `ThemeType` to apply (defaults to `'auto'`).\n */\n private setTheme(theme: ThemeType = 'auto'): void {\n this.renderer.removeClass(document.body, 'light');\n this.renderer.removeClass(document.body, 'dark');\n this.theme.set(theme);\n if (typeof localStorage !== 'undefined') {\n localStorage.setItem('preferred-theme', theme);\n }\n const effectiveClass = this.auto()\n ? (this.prefersColorSchemeMediaQueryList?.matches ? 'dark' : 'light')\n : theme;\n this.renderer.addClass(document.body, effectiveClass);\n this.themeChanged.next(this.getTheme());\n this.broadcastChannel.sendMessage(this.broadcastMessage, theme);\n }\n}\n","/*\n * Public API Surface of @arsedizioni/ars-utils/core\n */\nexport * from './definitions';\nexport * from './dto';\nexport * from './messages';\nexport * from './selectable';\nexport * from './system';\nexport * from './directives/index';\nexport * from './pipes/index';\nexport * from './services/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["filter","map"],"mappings":";;;;;;;;;;;;MAoDa,QAAQ,CAAA;IAInB,OAAO,GAAA;QACL,OAAO,IAAI,CAAC,KAAK;IACnB;AACD;MA8BY,UAAU,CAAA;AAEtB;MACY,OAAO,CAAA;AAEnB;MACY,UAAU,CAAA;AAEtB;AAEK,MAAO,WAAwB,SAAQ,UAAa,CAAA;AAGzD;MASY,aAAa,CAAA;AAGzB;MAEY,oBAAoB,CAAA;AAGhC;AAED;IACY;AAAZ,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,cAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACR,IAAA,cAAA,CAAA,cAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAa;AACb,IAAA,cAAA,CAAA,cAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAU;AACZ,CAAC,EAJW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;MAYb,UAAU,CAAA;AAMtB;MA+BY,WAAW,CAAA;AAKvB;MAyBY,YAAY,CAAA;AAGvB,IAAA,IAAI,UAAU,GAAA;AACZ,QAAA,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,IAAI,EAAE,IAAI,CAAC,IAAI,YAAY,IAAI,CAAC,EAAE;gBAChC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACjC;AACA,YAAA,IAAI,IAAI,CAAC,IAAI,EAAE;AACb,gBAAA,OAAO,IAAI,IAAI,CACb,IAAI,CAAC,IAA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