@ardium-pl/devkit 8.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/fesm2022/ardium-pl-devkit.mjs +3874 -0
- package/fesm2022/ardium-pl-devkit.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/click-outside/click-outside.directive.d.ts +14 -0
- package/lib/click-outside/click-outside.module.d.ts +8 -0
- package/lib/click-outside/index.d.ts +2 -0
- package/lib/coercion/array.d.ts +21 -0
- package/lib/coercion/boolean.d.ts +6 -0
- package/lib/coercion/date.d.ts +5 -0
- package/lib/coercion/index.d.ts +4 -0
- package/lib/coercion/number.d.ts +20 -0
- package/lib/dom-boxes/dom-boxes.d.ts +7 -0
- package/lib/dom-boxes/index.d.ts +1 -0
- package/lib/escape-html/escape-html.d.ts +1 -0
- package/lib/escape-html/escape-html.module.d.ts +8 -0
- package/lib/escape-html/escape-html.pipe.d.ts +7 -0
- package/lib/escape-html/index.d.ts +3 -0
- package/lib/file-pipes/file-pipes.defaults.d.ts +8 -0
- package/lib/file-pipes/file-pipes.module.d.ts +10 -0
- package/lib/file-pipes/fileext.pipe.d.ts +39 -0
- package/lib/file-pipes/filename.pipe.d.ts +38 -0
- package/lib/file-pipes/filesize.pipe.d.ts +50 -0
- package/lib/file-pipes/index.d.ts +5 -0
- package/lib/file-system/file-system.service.d.ts +69 -0
- package/lib/file-system/file-system.types.d.ts +186 -0
- package/lib/file-system/index.d.ts +2 -0
- package/lib/find-functions/find-suggestion.d.ts +3 -0
- package/lib/find-functions/index.d.ts +1 -0
- package/lib/forms/index.d.ts +1 -0
- package/lib/forms/track-form-control/index.d.ts +1 -0
- package/lib/forms/track-form-control/track-form-control.d.ts +83 -0
- package/lib/hold/hold.defaults.d.ts +9 -0
- package/lib/hold/hold.directive.d.ts +24 -0
- package/lib/hold/hold.module.d.ts +8 -0
- package/lib/hold/index.d.ts +3 -0
- package/lib/http-service/_types.d.ts +20 -0
- package/lib/http-service/_utils.d.ts +1 -0
- package/lib/http-service/http.service.d.ts +2574 -0
- package/lib/http-service/index.d.ts +1 -0
- package/lib/infinite-scroll/index.d.ts +3 -0
- package/lib/infinite-scroll/infinite-scroll.defaults.d.ts +8 -0
- package/lib/infinite-scroll/infinite-scroll.directive.d.ts +24 -0
- package/lib/infinite-scroll/infinite-scroll.module.d.ts +8 -0
- package/lib/keyboard/index.d.ts +2 -0
- package/lib/keyboard/keyboard.service.d.ts +60 -0
- package/lib/keyboard/keyboard.types.d.ts +13 -0
- package/lib/keyboard/types-internal.d.ts +20 -0
- package/lib/keyboard/utils.d.ts +3 -0
- package/lib/relative-pos/index.d.ts +1 -0
- package/lib/relative-pos/relative-pos.d.ts +24 -0
- package/lib/signals/array/array-signal.d.ts +123 -0
- package/lib/signals/array/index.d.ts +1 -0
- package/lib/signals/counter/counter-signal.d.ts +67 -0
- package/lib/signals/counter/index.d.ts +1 -0
- package/lib/signals/debounced/debounced-signal.d.ts +15 -0
- package/lib/signals/debounced/index.d.ts +1 -0
- package/lib/signals/map/index.d.ts +1 -0
- package/lib/signals/map/map-signal.d.ts +97 -0
- package/lib/signals/persistent/index.d.ts +1 -0
- package/lib/signals/persistent/persistent-signal.d.ts +106 -0
- package/lib/signals/query-param/index.d.ts +1 -0
- package/lib/signals/query-param/query-param-signal.d.ts +35 -0
- package/lib/signals/queue/index.d.ts +1 -0
- package/lib/signals/queue/queue-signal.d.ts +77 -0
- package/lib/signals/set/index.d.ts +1 -0
- package/lib/signals/set/set-signal.d.ts +76 -0
- package/lib/signals/stack/index.d.ts +1 -0
- package/lib/signals/stack/stack-signal.d.ts +77 -0
- package/lib/signals/throttled/index.d.ts +1 -0
- package/lib/signals/throttled/throttled-signal.d.ts +15 -0
- package/lib/signals/tuple/index.d.ts +1 -0
- package/lib/signals/tuple/tuple-signal.d.ts +60 -0
- package/lib/validators/index.d.ts +1 -0
- package/lib/validators/validators.d.ts +612 -0
- package/lib/viewport-observer/index.d.ts +3 -0
- package/lib/viewport-observer/utils.d.ts +15 -0
- package/lib/viewport-observer/viewport-observer-ref.d.ts +47 -0
- package/lib/viewport-observer/viewport-observer.defaults.d.ts +7 -0
- package/lib/viewport-observer/viewport-observer.service.d.ts +23 -0
- package/package.json +30 -0
- package/public-api.d.ts +26 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ardium-pl-devkit.mjs","sources":["../../../projects/devkit/src/lib/file-system/file-system.types.ts","../../../projects/devkit/src/lib/file-system/file-system.service.ts","../../../projects/devkit/src/lib/http-service/_utils.ts","../../../projects/devkit/src/lib/http-service/http.service.ts","../../../projects/devkit/src/lib/keyboard/types-internal.ts","../../../projects/devkit/src/lib/keyboard/utils.ts","../../../projects/devkit/src/lib/keyboard/keyboard.service.ts","../../../projects/devkit/src/lib/viewport-observer/utils.ts","../../../projects/devkit/src/lib/viewport-observer/viewport-observer-ref.ts","../../../projects/devkit/src/lib/viewport-observer/viewport-observer.defaults.ts","../../../projects/devkit/src/lib/viewport-observer/viewport-observer.service.ts","../../../projects/devkit/src/lib/click-outside/click-outside.directive.ts","../../../projects/devkit/src/lib/click-outside/click-outside.module.ts","../../../projects/devkit/src/lib/escape-html/escape-html.ts","../../../projects/devkit/src/lib/escape-html/escape-html.pipe.ts","../../../projects/devkit/src/lib/escape-html/escape-html.module.ts","../../../projects/devkit/src/lib/hold/hold.defaults.ts","../../../projects/devkit/src/lib/coercion/boolean.ts","../../../projects/devkit/src/lib/coercion/number.ts","../../../projects/devkit/src/lib/hold/hold.directive.ts","../../../projects/devkit/src/lib/hold/hold.module.ts","../../../projects/devkit/src/lib/infinite-scroll/infinite-scroll.directive.ts","../../../projects/devkit/src/lib/infinite-scroll/infinite-scroll.defaults.ts","../../../projects/devkit/src/lib/infinite-scroll/infinite-scroll.module.ts","../../../projects/devkit/src/lib/file-pipes/file-pipes.defaults.ts","../../../projects/devkit/src/lib/file-pipes/fileext.pipe.ts","../../../projects/devkit/src/lib/file-pipes/filename.pipe.ts","../../../projects/devkit/src/lib/file-pipes/filesize.pipe.ts","../../../projects/devkit/src/lib/file-pipes/file-pipes.module.ts","../../../projects/devkit/src/lib/signals/array/array-signal.ts","../../../projects/devkit/src/lib/signals/counter/counter-signal.ts","../../../projects/devkit/src/lib/signals/debounced/debounced-signal.ts","../../../projects/devkit/src/lib/signals/map/map-signal.ts","../../../projects/devkit/src/lib/signals/persistent/persistent-signal.ts","../../../projects/devkit/src/lib/signals/query-param/query-param-signal.ts","../../../projects/devkit/src/lib/signals/queue/queue-signal.ts","../../../projects/devkit/src/lib/signals/set/set-signal.ts","../../../projects/devkit/src/lib/signals/stack/stack-signal.ts","../../../projects/devkit/src/lib/signals/throttled/throttled-signal.ts","../../../projects/devkit/src/lib/signals/tuple/tuple-signal.ts","../../../projects/devkit/src/lib/forms/track-form-control/track-form-control.ts","../../../projects/devkit/src/lib/coercion/array.ts","../../../projects/devkit/src/lib/coercion/date.ts","../../../projects/devkit/src/lib/dom-boxes/dom-boxes.ts","../../../projects/devkit/src/lib/find-functions/find-suggestion.ts","../../../projects/devkit/src/lib/relative-pos/relative-pos.ts","../../../projects/devkit/src/lib/validators/validators.ts","../../../projects/devkit/src/public-api.ts","../../../projects/devkit/src/ardium-pl-devkit.ts"],"sourcesContent":["/**\r\n * Enumeration of file system methods.\r\n */\r\nexport const FileSystemMethod = {\r\n /**\r\n * Prefer using the File System Access API, or if not supported, use a cross-browser compatible method.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API File System Access API}\r\n */\r\n PreferFileSystem: 'preferFileSystem',\r\n /**\r\n * Always use a cross-browser compatible method.\r\n */\r\n CrossBrowser: 'crossBrowser',\r\n} as const;\r\n\r\n/**\r\n * Type representing file system methods.\r\n */\r\nexport type FileSystemMethod =\r\n (typeof FileSystemMethod)[keyof typeof FileSystemMethod];\r\n\r\n/**\r\n * Enumeration of file system start directories.\r\n */\r\nexport const FileSystemStartDirectory = {\r\n /**\r\n * Always start in the Desktop directory.\r\n */\r\n Desktop: 'desktop',\r\n /**\r\n * Always start in the Documents directory.\r\n */\r\n Documents: 'documents',\r\n /**\r\n * Always start in the Downloads directory.\r\n */\r\n Downloads: 'downloads',\r\n /**\r\n * Always start in the Music directory.\r\n */\r\n Music: 'music',\r\n /**\r\n * Always start in the Pictures directory.\r\n */\r\n Pictures: 'pictures',\r\n /**\r\n * Always start in the Videos directory.\r\n */\r\n Videos: 'videos',\r\n} as const;\r\n\r\n/**\r\n * Type representing file system start directories.\r\n */\r\nexport type FileSystemStartDirectory =\r\n (typeof FileSystemStartDirectory)[keyof typeof FileSystemStartDirectory];\r\n\r\n/**\r\n * Base type for file system save options.\r\n *\r\n * @property {string} [fileName] - The name of the file to be saved.\r\n */\r\ntype _FileSystemSaveOptionsBase = {\r\n fileName?: string;\r\n};\r\n\r\n/**\r\n * Type representing file system save options\r\n */\r\nexport type FileSystemSaveOptions = _FileSystemSaveOptionsBase &\r\n (\r\n | {\r\n /**\r\n * Prefer using the File System Access API, or if not supported, use a cross-browser compatible method.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API File System Access API}\r\n */\r\n method: 'preferFileSystem';\r\n /**\r\n * By specifying an ID, the browser can remember different directories for different IDs. If the same ID is used for another picker, the picker opens in the same directory.\r\n */\r\n directoryId?: string;\r\n /**\r\n * The directory to open the dialog in. Leaving this undefined results in the dialog being opened in the last known directory.\r\n */\r\n startDirectory?: FileSystemStartDirectory;\r\n /**\r\n * An array of allowed file types to save. Each item is an object with the following options:\r\n * - `description?` - An optional desciption of the category of file types allowed. Default to be an empty string.\r\n * - `accept` - An object with the keys set to the MIME type and the values an array of file extensions (see below for an example).\r\n * ```ts\r\n * const opts = {\r\n * types: [\r\n * {\r\n * description: \"Text file\",\r\n * accept: { \"text/plain\": [\".txt\"] },\r\n * },\r\n * ],\r\n * };\r\n * ```\r\n */\r\n types?: {\r\n /**\r\n * An optional desciption of the category of file types allowed. Default to be an empty string.\r\n */\r\n description?: string;\r\n /**\r\n * An object with the keys set to the MIME type and the values an array of file extensions (see below for an example).\r\n * ```ts\r\n * const opts = {\r\n * types: [\r\n * {\r\n * description: \"Text file\",\r\n * accept: { \"text/plain\": [\".txt\"] },\r\n * },\r\n * ],\r\n * };\r\n * ```\r\n */\r\n accept: Record<string, string[]>;\r\n }[];\r\n }\r\n | {\r\n /**\r\n * Always use a cross-browser compatible method.\r\n */\r\n method?: 'crossBrowser';\r\n }\r\n );\r\n\r\n/**\r\n * Base type for file system request options.\r\n */\r\ntype _FileSystemRequestOptionsBase = {\r\n accept?: string | string[];\r\n multiple?: boolean;\r\n};\r\n\r\n/**\r\n * Type representing file system request options.\r\n */\r\nexport type FileSystemRequestOptions = _FileSystemRequestOptionsBase &\r\n (\r\n | {\r\n /**\r\n * Prefer using the File System Access API, or if not supported, use a cross-browser compatible method.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API File System Access API}\r\n */\r\n method: 'preferFileSystem';\r\n /**\r\n * By specifying an ID, the browser can remember different directories for different IDs. If the same ID is used for another picker, the picker opens in the same directory.\r\n */\r\n directoryId?: string;\r\n /**\r\n * The directory to open the dialog in. Leaving this undefined results in the dialog being opened in the last known directory.\r\n */\r\n startDirectory?: FileSystemStartDirectory;\r\n /**\r\n * An array of allowed file types to request. Each item is an object with the following options:\r\n * - `description?` - An optional desciption of the category of file types allowed. Default to be an empty string.\r\n * - `accept` - An object with the keys set to the MIME type and the values an array of file extensions (see below for an example).\r\n * ```ts\r\n * const opts = {\r\n * types: [\r\n * {\r\n * description: \"Text file\",\r\n * accept: { \"text/plain\": [\".txt\"] },\r\n * },\r\n * ],\r\n * };\r\n * ```\r\n */\r\n types?: {\r\n /**\r\n * An optional desciption of the category of file types allowed. Default to be an empty string.\r\n */\r\n description?: string;\r\n /**\r\n * An object with the keys set to the MIME type and the values an array of file extensions (see below for an example).\r\n * ```ts\r\n * const opts = {\r\n * types: [\r\n * {\r\n * description: \"Text file\",\r\n * accept: { \"text/plain\": [\".txt\"] },\r\n * },\r\n * ],\r\n * };\r\n * ```\r\n */\r\n accept: Record<string, string[]>;\r\n }[];\r\n }\r\n | {\r\n /**\r\n * Always use a cross-browser compatible method.\r\n */\r\n method?: 'crossBrowser';\r\n }\r\n );\r\n","import { Injectable } from '@angular/core';\r\nimport { isArray } from 'simple-bool';\r\nimport {\r\n FileSystemMethod,\r\n FileSystemRequestOptions,\r\n FileSystemSaveOptions,\r\n} from './file-system.types';\r\n\r\nconst DEFAULT_SAVE_OPTIONS: FileSystemSaveOptions = {\r\n fileName: 'download',\r\n method: FileSystemMethod.PreferFileSystem,\r\n};\r\nconst DEFAULT_REQUEST_OPTIONS: FileSystemRequestOptions = {\r\n method: FileSystemMethod.PreferFileSystem,\r\n multiple: false,\r\n};\r\n\r\n/**\r\n * Service for handling file system operations, including saving, uploading, and reading files.\r\n *\r\n * This service leverages the File System Access API when available and falls back to traditional\r\n * methods when necessary. It provides methods to check for API support, save files, request file uploads,\r\n * and read file contents.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API File System Access API}\r\n */\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class FileSystemService {\r\n /**\r\n * Checks if the File System Access API is supported for the specified method.\r\n *\r\n * @param method - The file system method to check ('showSaveFilePicker' or 'showOpenFilePicker').\r\n * @returns True if the specified method is supported, otherwise false.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API File System Access API}\r\n */\r\n isFileSystemAPISupported(\r\n method: 'showSaveFilePicker' | 'showOpenFilePicker',\r\n ): boolean {\r\n try {\r\n // isn't in an iframe && browser version is high enough\r\n return window.self === window.top && method in window;\r\n } catch (err) {\r\n return false;\r\n }\r\n }\r\n\r\n //! saving files\r\n /**\r\n * Saves data as a file using the File System Access API or a fallback method.\r\n *\r\n * @param data - The data to be saved, either as a string or a Blob.\r\n * @param options - Options for saving the file, such as file name and save method.\r\n * @returns A promise that resolves to true if the file was saved successfully, otherwise false.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API File System Access API}\r\n */\r\n async saveAs(\r\n data: string | Blob,\r\n options: FileSystemSaveOptions = {},\r\n ): Promise<boolean> {\r\n options = {\r\n ...DEFAULT_SAVE_OPTIONS,\r\n ...options,\r\n };\r\n // coerce string to blob if needed\r\n if (typeof data == 'string') {\r\n data = new Blob([data], {\r\n type: 'text/plain',\r\n });\r\n }\r\n // use the File System Access API if supported & preferred\r\n if (\r\n options.method == FileSystemMethod.PreferFileSystem &&\r\n this.isFileSystemAPISupported('showSaveFilePicker')\r\n ) {\r\n if (!options.types) options.types = [];\r\n\r\n // use the File System Access API\r\n try {\r\n const handle = await (window as any).showSaveFilePicker({\r\n id: options.directoryId,\r\n startIn: options.startDirectory,\r\n suggestedName: options.fileName,\r\n types: options.types,\r\n });\r\n\r\n const writable = await handle.createWritable();\r\n await writable.write(data);\r\n await writable.close();\r\n return true;\r\n } catch (err) {\r\n // fail silently if the user has simply canceled the dialog.\r\n const error = err as any;\r\n if (error.name !== 'AbortError') {\r\n console.error(error.name, error.message);\r\n }\r\n return false;\r\n }\r\n }\r\n // fallback if the File System Access API is not supported\r\n // or the user doesn't want to use it\r\n const blobURL = URL.createObjectURL(data);\r\n\r\n const a = document.createElement('a');\r\n a.href = blobURL;\r\n a.download = options.fileName!;\r\n a.style.display = 'none';\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n //remove the element from the DOM\r\n return await new Promise<boolean>((resolve) =>\r\n setTimeout(() => {\r\n URL.revokeObjectURL(blobURL);\r\n document.body.removeChild(a);\r\n resolve(true);\r\n }, 1000),\r\n );\r\n }\r\n\r\n //! opening files\r\n /**\r\n * Requests a file upload using the File System Access API or a fallback method.\r\n *\r\n * @param options - Options for requesting the file upload, such as accepted file types and method.\r\n * @returns A promise that resolves to the selected file or files, or null if the operation was canceled.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API File System Access API}\r\n */\r\n async requestFileUpload(\r\n options: FileSystemRequestOptions = {},\r\n ): Promise<File | File[] | null> {\r\n options = {\r\n ...DEFAULT_REQUEST_OPTIONS,\r\n ...options,\r\n };\r\n // use the File System Access API if supported & preferred\r\n if (\r\n options.method == 'preferFileSystem' &&\r\n this.isFileSystemAPISupported('showOpenFilePicker')\r\n ) {\r\n try {\r\n // coerce the options.accept into a valid options.types object\r\n if (options.accept) {\r\n if (typeof options.accept == 'string') {\r\n options.accept = options.accept.split(',');\r\n }\r\n for (const accept of options.accept) {\r\n if (!accept.match(/^\\.[a-z0-9]+$/)) {\r\n throw new Error(\r\n `DKT-FT0010: \"accept\" property in FileSystemService must be a list of valid file extensions. Value \"${accept}\" is not a valid extension.`,\r\n );\r\n }\r\n }\r\n\r\n if (!options.types) options.types = [];\r\n\r\n const accept = {\r\n 'application/octet-stream': options.accept,\r\n };\r\n options.types.push({ accept: accept });\r\n }\r\n\r\n // open the dialog box\r\n const handles = await (window as any).showOpenFilePicker({\r\n id: options.directoryId,\r\n startIn: options.startDirectory,\r\n types: options.types,\r\n multiple: options.multiple,\r\n });\r\n const fileArray = (await Promise.all(\r\n handles.map(async (handle: any) => {\r\n const file = await handle.getFile();\r\n file.handle = handle;\r\n return file as File;\r\n }),\r\n )) as File[];\r\n if (!options.multiple) {\r\n return fileArray[0];\r\n }\r\n return fileArray;\r\n } catch (err) {\r\n // fail silently if the user has simply canceled the dialog.\r\n const error = err as any;\r\n if (error.name !== 'AbortError') {\r\n console.error(error.name, error.message);\r\n }\r\n return null;\r\n }\r\n }\r\n // fallback if the File System Access API is not supported\r\n // or the user doesn't want to use it\r\n\r\n // coerce options.accept into a string\r\n if (isArray(options.accept)) {\r\n options.accept = options.accept.join(',');\r\n } else {\r\n options.accept = options.accept ?? '*';\r\n }\r\n\r\n const input = document.createElement('input');\r\n input.type = 'file';\r\n input.accept = options.accept;\r\n input.multiple = options.multiple ?? false;\r\n input.style.display = 'none';\r\n document.body.appendChild(input);\r\n input.click();\r\n\r\n const fileArray = await new Promise<File[] | null>((resolve) => {\r\n input.onchange = () => {\r\n resolve(\r\n input.files && input.files.length > 0\r\n ? Array.from(input.files)\r\n : null,\r\n );\r\n document.body.removeChild(input);\r\n };\r\n });\r\n if (options.multiple || !fileArray) {\r\n return fileArray;\r\n }\r\n return fileArray[0];\r\n }\r\n\r\n //! reading file content\r\n /**\r\n * Reads the content of a file as a string with optional encoding.\r\n *\r\n * @param file - The file to read.\r\n * @param readAs - The method to read the file (in this case - \"text\").\r\n * @param encoding - The encoding to use when reading the file as text. Defaults to UTF-8.\r\n * @returns A promise that resolves to the file content as a string or null.\r\n */\r\n async readFile(\r\n file: File,\r\n readAs?: 'text',\r\n encoding?: string,\r\n ): Promise<string | null>;\r\n\r\n /**\r\n * Reads the content of a file as an ArrayBuffer.\r\n *\r\n * @param file - The file to read.\r\n * @param readAs - The method to read the file (in this case - \"binary\").\r\n * @returns A promise that resolves to the file content as an ArrayBuffer or null.\r\n */\r\n async readFile(file: File, readAs?: 'binary'): Promise<ArrayBuffer | null>;\r\n\r\n /**\r\n * Reads the content of a file.\r\n *\r\n * @param file - The file to read.\r\n * @param readAs - The method to read the file (\"text\" or \"binary\").\r\n * @param encoding - The encoding to use when reading the file as text (default is 'UTF-8').\r\n * @returns A promise that resolves to the file content as a string, ArrayBuffer, or null.\r\n */\r\n async readFile(\r\n file: File,\r\n readAs?: 'text' | 'binary',\r\n encoding?: string,\r\n ): Promise<string | ArrayBuffer | null>;\r\n\r\n async readFile(\r\n file: File,\r\n readAs: 'text' | 'binary' = 'text',\r\n encoding: string = 'UTF-8',\r\n ): Promise<string | ArrayBuffer | null> {\r\n if (readAs == 'text') {\r\n return new Promise<string | null>((resolve) => {\r\n const reader = new FileReader();\r\n reader.readAsText(file, encoding);\r\n reader.onload = function (e) {\r\n resolve(e.target!.result as string | null);\r\n };\r\n });\r\n }\r\n return new Promise<ArrayBuffer | null>((resolve) => {\r\n const reader = new FileReader();\r\n reader.readAsArrayBuffer(file);\r\n reader.onload = function (e) {\r\n resolve(e.target!.result as ArrayBuffer | null);\r\n };\r\n });\r\n }\r\n}\r\n","export function normalizePath(input: string | string[]): string {\r\n if (!Array.isArray(input)) {\r\n input = input.trim();\r\n return input.replace(/\\/\\/+$/g, \"/\");\r\n }\r\n return input\r\n .filter(Boolean)\r\n .map((part, index) => {\r\n if (index === 0) {\r\n return part.replace(/\\/+$/g, \"\");\r\n }\r\n return part.replace(/^\\/+|\\/+$/g, \"\");\r\n })\r\n .join(\"/\")\r\n .replace(/\\/\\/+/g, \"/\");\r\n}\r\n","import {\r\n HttpClient,\r\n HttpContext,\r\n HttpEvent,\r\n HttpHeaders,\r\n HttpParams,\r\n HttpRequest,\r\n HttpResponse,\r\n} from '@angular/common/http';\r\nimport { inject } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport {\r\n DefaultRequestOptions,\r\n ObjectHttpParams,\r\n RequestOptions,\r\n} from './_types';\r\nimport { normalizePath } from './_utils';\r\n\r\nconst FAULTY_URL_REGEX = /https?:\\/\\//;\r\n\r\nfunction getUrl(apiUrl: string, url: string | string[]): string {\r\n url = normalizePath(url);\r\n const finalUrl = apiUrl + url.replace(/^\\//, '');\r\n if (FAULTY_URL_REGEX.test(url)) {\r\n console.warn(\r\n `DKT-WA0020: The url \"${url}\" passed into custom HTTP Service seems to be faulty, as it would produce a request to \"${finalUrl}\". Custom HTTP Service instances prepend an API url, and thus only accept relative url paths.`,\r\n );\r\n }\r\n return finalUrl;\r\n}\r\n\r\nfunction getOpts(\r\n defaultOptions: DefaultRequestOptions,\r\n options?: RequestOptions,\r\n): any {\r\n return { ...defaultOptions, ...(options ?? {}) };\r\n}\r\n\r\nfunction convertToHttpParams(\r\n params: HttpParams | ObjectHttpParams | undefined,\r\n): HttpParams {\r\n if (params instanceof HttpParams || !params) {\r\n return params as HttpParams;\r\n }\r\n let httpParams = new HttpParams();\r\n for (const key of Object.keys(params)) {\r\n const value = params[key];\r\n if (value == null) {\r\n continue;\r\n }\r\n if (Array.isArray(value)) {\r\n value.forEach((item) => {\r\n httpParams = httpParams.append(key, item.toString());\r\n });\r\n } else {\r\n httpParams = httpParams.append(key, value.toString());\r\n }\r\n }\r\n return httpParams;\r\n}\r\n\r\nexport function createHttpService(\r\n apiUrl: string,\r\n defaultOptions: DefaultRequestOptions = {},\r\n) {\r\n let http!: HttpClient;\r\n return class {\r\n constructor() {\r\n http = inject(HttpClient);\r\n }\r\n\r\n public readonly apiUrl = apiUrl;\r\n\r\n //! =============================================\r\n //! REQUEST\r\n //! =============================================\r\n\r\n /**\r\n * Sends an `HttpRequest` and returns a stream of `HttpEvent`s.\r\n *\r\n * @param req The `HttpRequest` object to send.\r\n * @return An `Observable` of the response, with the response body as a stream of `HttpEvent`s.\r\n */\r\n request<R>(req: HttpRequest<any>): Observable<HttpEvent<R>>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as an `ArrayBuffer` and returns the response in an `ArrayBuffer`.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with responseType set to 'arraybuffer'.\r\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\r\n */\r\n request<TParams extends ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<ArrayBuffer>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as a `Blob` and returns the response as a `Blob`.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with responseType set to 'blob'.\r\n * @return An `Observable` of the response, with the response body as a `Blob`.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<Blob>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as text and returns the response as a string.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with responseType set to 'text'.\r\n * @return An `Observable` of the response, with the response body as a string.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<string>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as an `ArrayBuffer` and returns the full event stream.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with observe set to 'events' and responseType set to 'arraybuffer'.\r\n * @return An `Observable` of `HttpEvent<ArrayBuffer>`.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as a `Blob` and returns the full event stream.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with observe set to 'events' and responseType set to 'blob'.\r\n * @return An `Observable` of `HttpEvent<Blob>`.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<Blob>>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as text and returns the full event stream.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with observe set to 'events' and responseType set to 'text'.\r\n * @return An `Observable` of `HttpEvent<string>`.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<string>>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as a JavaScript object and returns the full event stream.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with observe set to 'events' and responseType set to 'json'.\r\n * @return An `Observable` of `HttpEvent<any>`.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n reportProgress?: boolean;\r\n observe: 'events';\r\n params?: HttpParams | TParams;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<any>>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as a JavaScript object and returns the full event stream with a specified response type.\r\n *\r\n * @param R The expected response type.\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with observe set to 'events' and responseType set to 'json'.\r\n * @return An `Observable` of `HttpEvent<R>`.\r\n */\r\n request<R, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n reportProgress?: boolean;\r\n observe: 'events';\r\n params?: HttpParams | TParams;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<R>>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as an `ArrayBuffer` and returns the full HTTP response.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with observe set to 'response' and responseType set to 'arraybuffer'.\r\n * @return An `Observable` of `HttpResponse<ArrayBuffer>`.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as a `Blob` and returns the full HTTP response.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with observe set to 'response' and responseType set to 'blob'.\r\n * @return An `Observable` of `HttpResponse<Blob>`.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<Blob>>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as text and returns the full HTTP response.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with observe set to 'response' and responseType set to 'text'.\r\n * @return An `Observable` of `HttpResponse<string>`.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<string>>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as a JavaScript object and returns the full HTTP response.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with observe set to 'response' and responseType set to 'json'.\r\n * @return An `Observable` of `HttpResponse<Object>`.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n reportProgress?: boolean;\r\n observe: 'response';\r\n params?: HttpParams | TParams;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<Object>>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as a JavaScript object and returns the full HTTP response with a specified response type.\r\n *\r\n * @param R The expected response type.\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with observe set to 'response' and responseType set to 'json'.\r\n * @return An `Observable` of `HttpResponse<R>`.\r\n */\r\n request<R, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n reportProgress?: boolean;\r\n observe: 'response';\r\n params?: HttpParams | TParams;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<R>>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as a JavaScript object and returns the response body.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with default observe and responseType settings.\r\n * @return An `Observable` of the response body as an object.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options?: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n responseType?: 'json';\r\n reportProgress?: boolean;\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<Object>;\r\n\r\n /**\r\n * Constructs a request that interprets the body as a JavaScript object and returns the response body with a specified type.\r\n *\r\n * @param R The expected response type.\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with default observe and responseType settings.\r\n * @return An `Observable` of the response body of type `R`.\r\n */\r\n request<R, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options?: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n responseType?: 'json';\r\n reportProgress?: boolean;\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<R>;\r\n\r\n /**\r\n * Constructs a request where response type and requested observable are not known statically.\r\n *\r\n * @param method The HTTP method.\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options with flexible observe and responseType settings.\r\n * @return An `Observable` of the requested response.\r\n */\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n method: string,\r\n url: string | string[],\r\n options?: {\r\n body?: any;\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n observe?: 'body' | 'events' | 'response';\r\n reportProgress?: boolean;\r\n responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<any>;\r\n\r\n request<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n methodOrReq: string | HttpRequest<any>,\r\n url?: string | string[],\r\n options?: RequestOptions<TParams>,\r\n ) {\r\n if (typeof methodOrReq === 'string') {\r\n const finalUrl = getUrl(apiUrl, url!);\r\n const finalOptions = getOpts(defaultOptions, options);\r\n if (finalOptions.params) {\r\n finalOptions.params = convertToHttpParams(finalOptions.params);\r\n }\r\n return http.request(methodOrReq, finalUrl, finalOptions) as any;\r\n }\r\n return http.request(methodOrReq) as any;\r\n }\r\n\r\n //! =============================================\r\n //! DELETE\r\n //! =============================================\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer`\r\n * and returns the response as an `ArrayBuffer`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response body as an `ArrayBuffer`.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<ArrayBuffer>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as a `Blob` and returns\r\n * the response as a `Blob`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response body as a `Blob`.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<Blob>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as a text string and returns\r\n * a string.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response, with the response body of type string.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<string>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer`\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with response body as an `ArrayBuffer`.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<HttpEvent<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as a `Blob`\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all the `HttpEvent`s for the request, with the response body as a `Blob`.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<HttpEvent<Blob>>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as a text string\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all `HttpEvent`s for the request, with the response body of type string.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<HttpEvent<string>>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as JSON\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all `HttpEvent`s for the request, with response body of type `Object`.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<HttpEvent<Object>>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as JSON\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all `HttpEvent`s for the request, with a response body in the requested type.\r\n */\r\n delete<TRes, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?:\r\n | HttpParams\r\n | {\r\n [param: string]:\r\n | string\r\n | number\r\n | boolean\r\n | (string | number | boolean)[];\r\n };\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<HttpEvent<TRes>>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer` and returns\r\n * the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the full `HttpResponse`, with the response body as an `ArrayBuffer`.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<HttpResponse<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as a `Blob` and returns the full\r\n * `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the `HttpResponse`, with the response body of type `Blob`.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<HttpResponse<Blob>>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as a text stream and\r\n * returns the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the full `HttpResponse`, with the response body of type string.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<HttpResponse<string>>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as a JavaScript object and returns\r\n * the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the `HttpResponse`, with the response body of type `Object`.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<HttpResponse<Object>>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as JSON\r\n * and returns the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the `HttpResponse`, with the response body of the requested type.\r\n */\r\n delete<TRes, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<HttpResponse<TRes>>;\r\n\r\n /**\r\n * Constructs a `DELETE` request that interprets the body as JSON\r\n * and returns the response body as an object parsed from JSON.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response, with the response body of type `Object`.\r\n */\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<Object>;\r\n\r\n /**\r\n * Constructs a DELETE request that interprets the body as JSON and returns\r\n * the response in a given type.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response body in the requested type.\r\n */\r\n delete<TRes, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n body?: any | null;\r\n },\r\n ): Observable<TRes>;\r\n\r\n delete<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options?: RequestOptions<TParams>,\r\n ) {\r\n const finalUrl = getUrl(apiUrl, url);\r\n const finalOptions = getOpts(defaultOptions, options);\r\n if (finalOptions.params) {\r\n finalOptions.params = convertToHttpParams(finalOptions.params);\r\n }\r\n return http.delete(finalUrl, finalOptions) as any;\r\n }\r\n\r\n //! =============================================\r\n //! GET\r\n //! =============================================\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and returns the\r\n * response in an `ArrayBuffer`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<ArrayBuffer>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as a `Blob`\r\n * and returns the response as a `Blob`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response, with the response body as a `Blob`.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<Blob>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as a text string\r\n * and returns the response as a string value.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response, with the response body of type string.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<string>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and returns\r\n * the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with the response body as an `ArrayBuffer`.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as a `Blob` and\r\n * returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with the response body as a `Blob`.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<Blob>>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as a text string and returns\r\n * the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with the response body of type string.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<string>>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as JSON\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response, with the response body of type `Object`.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<Object>>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as JSON\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response, with a response body in the requested type.\r\n */\r\n get<TRes, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<TRes>>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and\r\n * returns the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body as an `ArrayBuffer`.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as a `Blob` and\r\n * returns the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body as a `Blob`.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<Blob>>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as a text stream and\r\n * returns the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body of type string.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<string>>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as JSON\r\n * and returns the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the full `HttpResponse`,\r\n * with the response body of type `Object`.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<Object>>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as JSON\r\n * and returns the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the full `HttpResponse` for the request,\r\n * with a response body in the requested type.\r\n */\r\n get<TRes, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<TRes>>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as JSON\r\n * and returns the response body as a JavaScript object.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response body as a JavaScript object.\r\n */\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<Object>;\r\n\r\n /**\r\n * Constructs a `GET` request that interprets the body as JSON\r\n * and returns the response body in a given type.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response body in the requested type.\r\n */\r\n get<TRes, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<TRes>;\r\n\r\n get<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options?: RequestOptions<TParams>,\r\n ) {\r\n const finalUrl = getUrl(apiUrl, url);\r\n const finalOptions = getOpts(defaultOptions, options);\r\n if (finalOptions.params) {\r\n finalOptions.params = convertToHttpParams(finalOptions.params);\r\n }\r\n return http.get(finalUrl, finalOptions) as any;\r\n }\r\n\r\n //! =============================================\r\n //! HEAD\r\n //! =============================================\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer` and\r\n * returns the response as an `ArrayBuffer`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\r\n */\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<ArrayBuffer>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as a `Blob` and returns\r\n * the response as a `Blob`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response, with the response body as a `Blob`.\r\n */\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<Blob>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as a text string and returns the response\r\n * as a string value.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the response, with the response body of type string.\r\n */\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<string>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer`\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with the response body as an `ArrayBuffer`.\r\n */\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as a `Blob` and\r\n * returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with the response body as a `Blob`.\r\n */\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<Blob>>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as a text string\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with the response body of type string.\r\n */\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<string>>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as JSON\r\n * and returns the full HTTP event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with a response body of type `Object`.\r\n */\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<Object>>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as JSON\r\n * and returns the full HTTP event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of all the `HttpEvent`s for the request,\r\n * with a response body in the requested type.\r\n */\r\n head<TRes, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<TRes>>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer`\r\n * and returns the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body as an `ArrayBuffer`.\r\n */\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as a `Blob` and returns\r\n * the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body as a blob.\r\n */\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<Blob>>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as text stream\r\n * and returns the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body of type string.\r\n */\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<string>>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as JSON\r\n * and returns the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body of type `Object`.\r\n */\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<Object>>;\r\n\r\n /**\r\n * Constructs a `HEAD` request that interprets the body as JSON\r\n * and returns the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options The HTTP options to send with the request.\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with a response body of the requested type.\r\n */\r\n head<TRes, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe?: 'body';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<TRes>;\r\n\r\n head<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options?: RequestOptions<TParams>,\r\n ) {\r\n const finalUrl = getUrl(apiUrl, url);\r\n const finalOptions = getOpts(defaultOptions, options);\r\n if (finalOptions.params) {\r\n finalOptions.params = convertToHttpParams(finalOptions.params);\r\n }\r\n return http.head(finalUrl, finalOptions) as any;\r\n }\r\n\r\n //! =============================================\r\n //! JSONP\r\n //! =============================================\r\n\r\n /**\r\n * Constructs a `JSONP` request for the given URL and name of the callback parameter.\r\n *\r\n * @param url The resource URL.\r\n * @param callbackParam The callback function name.\r\n *\r\n * @return An `Observable` of the response object, with response body as an object.\r\n */\r\n jsonp(url: string | string[], callbackParam: string): Observable<Object>;\r\n\r\n /**\r\n * Constructs a `JSONP` request for the given URL and name of the callback parameter.\r\n *\r\n * @param url The resource URL.\r\n * @param callbackParam The callback function name.\r\n *\r\n * You must install a suitable interceptor, such as one provided by `HttpClientJsonpModule`.\r\n * If no such interceptor is reached, then the `JSONP` request can be rejected by the configured backend.\r\n *\r\n * @return An `Observable` of the response object, with response body in the requested type.\r\n */\r\n jsonp<TRes>(\r\n url: string | string[],\r\n callbackParam: string,\r\n ): Observable<TRes>;\r\n\r\n jsonp(url: string | string[], callbackParam: string) {\r\n url = getUrl(apiUrl, url);\r\n return http.jsonp(url, callbackParam) as any;\r\n }\r\n\r\n //! =============================================\r\n //! OPTIONS\r\n //! =============================================\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as an\r\n * `ArrayBuffer` and returns the response as an `ArrayBuffer`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<ArrayBuffer>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as a `Blob` and returns\r\n * the response as a `Blob`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body as a `Blob`.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<Blob>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as a text string and\r\n * returns a string value.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body of type string.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<string>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as an `ArrayBuffer`\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with the response body as an `ArrayBuffer`.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as a `Blob` and\r\n * returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with the response body as a `Blob`.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<Blob>>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as a text string\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all the `HttpEvent`s for the request,\r\n * with the response body of type string.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<string>>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as JSON\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all the `HttpEvent`s for the request with the response\r\n * body of type `Object`.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<Object>>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as JSON and\r\n * returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all the `HttpEvent`s for the request,\r\n * with a response body in the requested type.\r\n */\r\n options<TRes, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<TRes>>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as an `ArrayBuffer`\r\n * and returns the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body as an `ArrayBuffer`.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as a `Blob`\r\n * and returns the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body as a `Blob`.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<Blob>>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as a text stream\r\n * and returns the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body of type string.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<string>>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as JSON\r\n * and returns the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body of type `Object`.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<Object>>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as JSON and\r\n * returns the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with a response body in the requested type.\r\n */\r\n options<TRes, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<TRes>>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as JSON and returns the\r\n * response body as an object parsed from JSON.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body as an object parsed from JSON.\r\n */\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<Object>;\r\n\r\n /**\r\n * Constructs an `OPTIONS` request that interprets the body as JSON and returns the\r\n * response in a given type.\r\n *\r\n * @param url The endpoint URL.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse`, with a response body of the given type.\r\n */\r\n options<TRes, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<TRes>;\r\n\r\n options<TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n options?: RequestOptions<TParams>,\r\n ) {\r\n const finalUrl = getUrl(apiUrl, url);\r\n const finalOptions = getOpts(defaultOptions, options);\r\n if (finalOptions.params) {\r\n finalOptions.params = convertToHttpParams(finalOptions.params);\r\n }\r\n return http.options(finalUrl, finalOptions) as any;\r\n }\r\n\r\n //! =============================================\r\n //! PATCH\r\n //! =============================================\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` and returns\r\n * the response as an `ArrayBuffer`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<ArrayBuffer>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as a `Blob` and returns the response\r\n * as a `Blob`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body as a `Blob`.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<Blob>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as a text string and\r\n * returns the response as a string value.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with a response body of type string.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<string>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` and\r\n * returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all the `HttpEvent`s for the request,\r\n * with the response body as an `ArrayBuffer`.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as a `Blob`\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all the `HttpEvent`s for the request, with the response body as `Blob`.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<Blob>>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as a text string and\r\n * returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all the `HttpEvent`s for the request, with a\r\n * response body of type string.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<string>>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as JSON\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all the `HttpEvent`s for the request,\r\n * with a response body of type `Object`.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<Object>>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as JSON\r\n * and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all the `HttpEvent`s for the request,\r\n * with a response body in the requested type.\r\n */\r\n patch<\r\n TRes,\r\n TBody = any,\r\n TParams extends ObjectHttpParams = ObjectHttpParams,\r\n >(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<TRes>>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer`\r\n * and returns the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body as an `ArrayBuffer`.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as a `Blob` and returns the full\r\n * `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with the response body as a `Blob`.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<Blob>>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as a text stream and returns the\r\n * full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with a response body of type string.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<string>>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as JSON\r\n * and returns the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with a response body in the requested type.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<Object>>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as JSON\r\n * and returns the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with a response body in the given type.\r\n */\r\n patch<\r\n TRes,\r\n TBody = any,\r\n TParams extends ObjectHttpParams = ObjectHttpParams,\r\n >(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<TRes>>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as JSON and\r\n * returns the response body as an object parsed from JSON.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body as an object parsed from JSON.\r\n */\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<Object>;\r\n\r\n /**\r\n * Constructs a `PATCH` request that interprets the body as JSON and returns\r\n * the response in a given type.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to edit.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request,\r\n * with a response body in the given type.\r\n */\r\n patch<\r\n TRes,\r\n TBody = any,\r\n TParams extends ObjectHttpParams = ObjectHttpParams,\r\n >(\r\n url: string | string[],\r\n body: TBody | null,\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<TRes>;\r\n\r\n patch<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options?: RequestOptions<TParams>,\r\n ) {\r\n const finalUrl = getUrl(apiUrl, url);\r\n const finalOptions = getOpts(defaultOptions, options);\r\n if (finalOptions.params) {\r\n finalOptions.params = convertToHttpParams(finalOptions.params);\r\n }\r\n return http.patch(finalUrl, body, finalOptions) as any;\r\n }\r\n\r\n //! =============================================\r\n //! POST\r\n //! =============================================\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as an `ArrayBuffer` and returns\r\n * an `ArrayBuffer`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<ArrayBuffer>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as a `Blob` and returns the\r\n * response as a `Blob`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body as a `Blob`.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<Blob>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as a text string and\r\n * returns the response as a string value.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with a response body of type string.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<string>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as an `ArrayBuffer` and\r\n * returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request, with the response body as an `ArrayBuffer`.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as a `Blob`\r\n * and returns the response in an observable of the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request, with the response body as `Blob`.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<Blob>>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as a text string and returns the full\r\n * event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request, with a response body of type string.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<string>>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as JSON and returns the full\r\n * event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request, with a response body of type `Object`.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<Object>>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as JSON and returns the full\r\n * event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request, with a response body in the requested type.\r\n */\r\n post<\r\n TRes,\r\n TBody = any,\r\n TParams extends ObjectHttpParams = ObjectHttpParams,\r\n >(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpEvent<TRes>>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as an `ArrayBuffer`\r\n * and returns the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request, with the response body as an `ArrayBuffer`.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as a `Blob` and returns the full\r\n * `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request, with the response body as a `Blob`.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<Blob>>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as a text stream and returns\r\n * the full `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request, with a response body of type string.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<string>>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as JSON and returns the full\r\n * `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request, with a response body of type `Object`.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<Object>>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as JSON and returns the full\r\n * `HttpResponse`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request, with a response body in the requested type.\r\n */\r\n post<\r\n TRes,\r\n TBody = any,\r\n TParams extends ObjectHttpParams = ObjectHttpParams,\r\n >(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<HttpResponse<TRes>>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as JSON and returns the response body\r\n * as an object parsed from JSON.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body as an object parsed from JSON.\r\n */\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<Object>;\r\n\r\n /**\r\n * Constructs a `POST` request that interprets the body as JSON and returns an observable of the response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The content to replace with.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request, with a response body in the requested type.\r\n */\r\n post<\r\n TRes,\r\n TBody = any,\r\n TParams extends ObjectHttpParams = ObjectHttpParams,\r\n >(\r\n url: string | string[],\r\n body: TBody | null,\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n transferCache?: { includeHeaders?: string[] } | boolean;\r\n },\r\n ): Observable<TRes>;\r\n\r\n post<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options?: RequestOptions<TParams>,\r\n ) {\r\n const finalUrl = getUrl(apiUrl, url);\r\n const finalOptions = getOpts(defaultOptions, options);\r\n if (finalOptions.params) {\r\n finalOptions.params = convertToHttpParams(finalOptions.params);\r\n }\r\n return http.post(finalUrl, body, finalOptions) as any;\r\n }\r\n\r\n //! =============================================\r\n //! PUT\r\n //! =============================================\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as an `ArrayBuffer` and returns the\r\n * response as an `ArrayBuffer`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<ArrayBuffer>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as a `Blob` and returns\r\n * the response as a `Blob`.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with the response body as a `Blob`.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<Blob>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as a text string and\r\n * returns the response as a string value.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response, with a response body of type string.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<string>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as an `ArrayBuffer` and\r\n * returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with the response body as an `ArrayBuffer`.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as a `Blob` and returns the full event\r\n * stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with the response body as a `Blob`.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<Blob>>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as a text string and returns the full event\r\n * stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with a response body of type string.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<string>>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as JSON and returns the full\r\n * event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with a response body of type `Object`.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<Object>>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as JSON and returns the full event stream.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of all `HttpEvent`s for the request,\r\n * with a response body in the requested type.\r\n */\r\n put<TRes, TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'events';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpEvent<TRes>>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as an `ArrayBuffer`\r\n * and returns an observable of the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request, with the response body as an `ArrayBuffer`.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'arraybuffer';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<ArrayBuffer>>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as a `Blob` and returns the\r\n * full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request, with the response body as a `Blob`.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'blob';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<Blob>>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as a text stream and returns the\r\n * full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request, with a response body of type string.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType: 'text';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<string>>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as JSON and returns the full\r\n * HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request, with a response body of type `Object`.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<Object>>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as an instance of the requested type and\r\n * returns the full HTTP response.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the `HttpResponse` for the request, with a response body in the requested type.\r\n */\r\n put<TRes, TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n observe: 'response';\r\n context?: HttpContext;\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<HttpResponse<TRes>>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as JSON and returns an observable of the\r\n * JavaScript object.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the response as a JavaScript object.\r\n */\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<Object>;\r\n\r\n /**\r\n * Constructs a `PUT` request that interprets the body as an instance of the requested type\r\n * and returns an observable of the requested type.\r\n *\r\n * @param url The endpoint URL.\r\n * @param body The resources to add/update.\r\n * @param options HTTP options.\r\n *\r\n * @return An `Observable` of the requested type.\r\n */\r\n put<TRes, TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options?: {\r\n headers?: HttpHeaders | { [header: string]: string | string[] };\r\n context?: HttpContext;\r\n observe?: 'body';\r\n params?: HttpParams | TParams;\r\n reportProgress?: boolean;\r\n responseType?: 'json';\r\n withCredentials?: boolean;\r\n },\r\n ): Observable<TRes>;\r\n\r\n put<TBody = any, TParams extends ObjectHttpParams = ObjectHttpParams>(\r\n url: string | string[],\r\n body: TBody | null,\r\n options?: RequestOptions<TParams>,\r\n ) {\r\n const finalUrl = getUrl(apiUrl, url);\r\n const finalOptions = getOpts(defaultOptions, options);\r\n if (finalOptions.params) {\r\n finalOptions.params = convertToHttpParams(finalOptions.params);\r\n }\r\n return http.put(finalUrl, body, finalOptions) as any;\r\n }\r\n };\r\n}\r\n","import { KeyboardShortcut } from \"./keyboard.types\";\r\n\r\nexport type _LeftRight = { left: boolean; right: boolean; };\r\n\r\nexport type _KeyboardShortcutInternal = {\r\n ctrl: _LeftRight;\r\n alt: _LeftRight;\r\n shift: _LeftRight;\r\n meta: _LeftRight;\r\n key: string;\r\n publicData: KeyboardShortcut;\r\n};\r\n\r\nexport const _ExpectedModifierKeySide = {\r\n None: 'none',\r\n Left: 'left',\r\n Right: 'right',\r\n Any: 'any',\r\n} as const;\r\nexport type _ExpectedModifierKeySide = typeof _ExpectedModifierKeySide[keyof typeof _ExpectedModifierKeySide];","import {\r\n _ExpectedModifierKeySide,\r\n _LeftRight\r\n} from './types-internal';\r\n\r\nexport function trySettingModifierKey(\r\n modifierKeyName: string,\r\n keyCode: string,\r\n rawKeyCode: string,\r\n previouslyFoundKeyCode: string | null,\r\n currentKeyState: _ExpectedModifierKeySide,\r\n): [_ExpectedModifierKeySide, string | null, boolean] {\r\n if (keyCode === modifierKeyName) {\r\n if (previouslyFoundKeyCode) {\r\n console.error(\r\n new Error(\r\n `DKT-NF0030: A keyboard shortcut definition cannot contain two modifier keys of the same type. Got \"${previouslyFoundKeyCode}\" and \"${rawKeyCode}\"; only the first one will be included.`,\r\n ),\r\n );\r\n return [currentKeyState, previouslyFoundKeyCode, true];\r\n }\r\n return [_ExpectedModifierKeySide.Any, keyCode, true];\r\n }\r\n if (keyCode === modifierKeyName + 'left') {\r\n if (previouslyFoundKeyCode) {\r\n console.error(\r\n new Error(\r\n `DKT-NF0030: A keyboard shortcut definition cannot contain two modifier keys of the same type. Got \"${previouslyFoundKeyCode}\" and \"${rawKeyCode}\"; only the first one will be included.`,\r\n ),\r\n );\r\n return [currentKeyState, previouslyFoundKeyCode, true];\r\n }\r\n return [_ExpectedModifierKeySide.Left, keyCode, true];\r\n }\r\n if (keyCode === modifierKeyName + 'right') {\r\n if (previouslyFoundKeyCode) {\r\n console.error(\r\n new Error(\r\n `DKT-NF0030: A keyboard shortcut definition cannot contain two modifier keys of the same type. Got \"${previouslyFoundKeyCode}\" and \"${rawKeyCode}\"; only the first one will be included.`,\r\n ),\r\n );\r\n return [currentKeyState, previouslyFoundKeyCode, true];\r\n }\r\n return [_ExpectedModifierKeySide.Right, keyCode, true];\r\n }\r\n return [currentKeyState, previouslyFoundKeyCode, false];\r\n}\r\n\r\nexport function isModifierKeyInWrongState(\r\n state: _LeftRight,\r\n expectedState: _ExpectedModifierKeySide,\r\n): boolean {\r\n if (expectedState === _ExpectedModifierKeySide.Any)\r\n return !state.left && !state.right;\r\n let expectedLeft = false,\r\n expectedRight = false;\r\n switch (expectedState) {\r\n case _ExpectedModifierKeySide.None:\r\n break;\r\n case _ExpectedModifierKeySide.Left:\r\n expectedLeft = true;\r\n break;\r\n case _ExpectedModifierKeySide.Right:\r\n expectedRight = true;\r\n break;\r\n }\r\n return expectedLeft !== state.left || expectedRight !== state.right;\r\n}\r\n","import {\r\n computed,\r\n Injectable,\r\n OnDestroy,\r\n Renderer2,\r\n signal,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { ɵDomRendererFactory2 } from '@angular/platform-browser';\r\nimport { filter, map, Observable, Subject } from 'rxjs';\r\nimport {\r\n KeyboardKey,\r\n KeyboardKeyState,\r\n KeyboardShortcut,\r\n} from './keyboard.types';\r\nimport {\r\n _ExpectedModifierKeySide,\r\n _KeyboardShortcutInternal,\r\n} from './types-internal';\r\nimport {\r\n isModifierKeyInWrongState,\r\n trySettingModifierKey,\r\n} from './utils';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class KeyboardService implements OnDestroy {\r\n private renderer!: Renderer2;\r\n private removeListenFuncKeydown!: Function;\r\n private removeListenFuncKeyup!: Function;\r\n private removeListenFuncWindowblur!: Function;\r\n constructor(rendererFactory: ɵDomRendererFactory2) {\r\n this.renderer = rendererFactory.createRenderer(null, null);\r\n //listen to events\r\n this.removeListenFuncKeydown = this.renderer.listen(\r\n 'document',\r\n 'keydown',\r\n (e) => this._onKeydown(e),\r\n );\r\n this.removeListenFuncKeyup = this.renderer.listen(\r\n 'document',\r\n 'keyup',\r\n (e) => this._onKeyup(e),\r\n );\r\n this.removeListenFuncWindowblur = this.renderer.listen(\r\n 'window',\r\n 'blur',\r\n () => this._resetAllKeys(),\r\n );\r\n }\r\n\r\n ngOnDestroy(): void {\r\n //destroy event listeners\r\n this.removeListenFuncKeydown();\r\n this.removeListenFuncKeyup();\r\n this.removeListenFuncWindowblur();\r\n }\r\n\r\n private _resetAllKeys(): void {\r\n this._isLeftCtrlHeld.set(false);\r\n this._isRightCtrlHeld.set(false);\r\n this._isLeftAltHeld.set(false);\r\n this._isRightAltHeld.set(false);\r\n this._isLeftShiftHeld.set(false);\r\n this._isRightShiftHeld.set(false);\r\n this._isLeftMetaHeld.set(false);\r\n this._isRightMetaHeld.set(false);\r\n }\r\n\r\n private readonly _isLeftCtrlHeld = signal<boolean>(false);\r\n private readonly _isRightCtrlHeld = signal<boolean>(false);\r\n public readonly isLeftCtrlHeld = this._isLeftCtrlHeld.asReadonly();\r\n public readonly isRightCtrlHeld = this._isRightCtrlHeld.asReadonly();\r\n public readonly isCtrlHeld = computed(\r\n () => this._isLeftCtrlHeld() || this._isRightCtrlHeld(),\r\n );\r\n\r\n private readonly _isLeftAltHeld = signal<boolean>(false);\r\n private readonly _isRightAltHeld = signal<boolean>(false);\r\n public readonly isAltHeld = this._isLeftAltHeld.asReadonly();\r\n public readonly isAltGraphHeld = this._isRightAltHeld.asReadonly();\r\n\r\n private readonly _isLeftShiftHeld = signal<boolean>(false);\r\n private readonly _isRightShiftHeld = signal<boolean>(false);\r\n public readonly isLeftShiftHeld = this._isLeftShiftHeld.asReadonly();\r\n public readonly isRightShiftHeld = this._isRightShiftHeld.asReadonly();\r\n public readonly isShiftHeld = computed(\r\n () => this._isLeftShiftHeld() || this._isRightShiftHeld(),\r\n );\r\n\r\n // \"⊞ Win\" on Windows, \"⌘ Command\" on Mac\r\n private readonly _isLeftMetaHeld = signal<boolean>(false);\r\n private readonly _isRightMetaHeld = signal<boolean>(false);\r\n public readonly isLeftMetaHeld = this._isLeftMetaHeld.asReadonly();\r\n public readonly isRightMetaHeld = this._isRightMetaHeld.asReadonly();\r\n public readonly isMetaHeld = computed(\r\n () => this._isLeftMetaHeld() || this._isRightMetaHeld(),\r\n );\r\n\r\n private readonly isAnyModifierKeyHeld = computed(\r\n () =>\r\n this.isCtrlHeld() ||\r\n this.isAltHeld() ||\r\n this.isAltGraphHeld() ||\r\n this.isShiftHeld() ||\r\n this.isMetaHeld(),\r\n );\r\n\r\n private readonly _capsLockState = signal<boolean | undefined>(undefined);\r\n public readonly capsLockState = this._capsLockState.asReadonly();\r\n\r\n private readonly _numLockState = signal<boolean | undefined>(undefined);\r\n public readonly numLockState = this._numLockState.asReadonly();\r\n\r\n private readonly _scrollLockState = signal<boolean | undefined>(undefined);\r\n public readonly scrollLockState = this._scrollLockState.asReadonly();\r\n\r\n //! key subjects\r\n private readonly _shortcutSubject$ = new Subject<_KeyboardShortcutInternal>();\r\n public readonly anyShortcut$ = this._shortcutSubject$.pipe(\r\n map((v) => v.publicData),\r\n );\r\n\r\n private readonly _keySubject$ = new Subject<KeyboardKey>();\r\n public readonly anyKeyPress$ = this._keySubject$.asObservable();\r\n\r\n private readonly _keyStateSubject$ = new Subject<KeyboardKeyState>();\r\n public readonly anyKeyState$ = this._keyStateSubject$.asObservable();\r\n\r\n private _demapKeyCode(code: string): string {\r\n code = code.replace(/[^a-z0-9]/gi, '').toLowerCase();\r\n if (code.match(/^(left|right|up|down)$/))\r\n return `Arrow${code.charAt(0).toUpperCase()}${code.substring(1)}`;\r\n if (code.match(/^[a-z]$/)) return `Key${code.toUpperCase()}`;\r\n if (code.match(/^\\d$/)) return `Digit${code}`;\r\n if (code === 'ctrl') return 'control';\r\n if (code === 'ctrlleft') return 'controlleft';\r\n if (code === 'alt') return 'altleft';\r\n if (code.match(/^altgr(aph)?$/)) return 'altright';\r\n if (code.match(/^win(dows)?$/)) return 'meta';\r\n if (code === 'cmd') return 'meta';\r\n return code;\r\n }\r\n private _emitShortcut(event: KeyboardEvent): void {\r\n const keys = [];\r\n if (this._isLeftCtrlHeld()) keys.push('ControlLeft');\r\n if (this._isRightCtrlHeld()) keys.push('ControlRight');\r\n if (this._isLeftAltHeld()) keys.push('AltLeft');\r\n if (this._isRightAltHeld()) keys.push('AltRight');\r\n if (this._isLeftShiftHeld()) keys.push('ShiftLeft');\r\n if (this._isRightShiftHeld()) keys.push('ShiftRight');\r\n if (this._isLeftMetaHeld()) keys.push('MetaLeft');\r\n if (this._isRightMetaHeld()) keys.push('MetaRight');\r\n keys.push(event.code);\r\n\r\n this._shortcutSubject$.next({\r\n ctrl: {\r\n left: this._isLeftCtrlHeld(),\r\n right: this._isRightCtrlHeld(),\r\n },\r\n alt: {\r\n left: this._isLeftAltHeld(),\r\n right: this._isRightAltHeld(),\r\n },\r\n shift: {\r\n left: this._isLeftShiftHeld(),\r\n right: this._isRightShiftHeld(),\r\n },\r\n meta: {\r\n left: this._isLeftMetaHeld(),\r\n right: this._isRightMetaHeld(),\r\n },\r\n key: event.code.toLowerCase(),\r\n publicData: {\r\n keys,\r\n event,\r\n },\r\n });\r\n }\r\n private _emitKeydown(event: KeyboardEvent): void {\r\n const key = event.code;\r\n this._keySubject$.next({ key, event });\r\n }\r\n private _emitKeyStateDown(event: KeyboardEvent): void {\r\n const key = event.code;\r\n this._keyStateSubject$.next({ key, event, isHeld: true });\r\n }\r\n private _emitKeyStateUp(event: KeyboardEvent): void {\r\n const key = event.code;\r\n this._keyStateSubject$.next({ key, event, isHeld: false });\r\n }\r\n\r\n listenToShortcut(\r\n toMatch: string[],\r\n treatAltGraphAsAltPlusCtrl: boolean = true,\r\n ): Observable<KeyboardShortcut> {\r\n const expectedStates = {\r\n ctrl: _ExpectedModifierKeySide.None,\r\n alt: _ExpectedModifierKeySide.None,\r\n shift: _ExpectedModifierKeySide.None,\r\n meta: _ExpectedModifierKeySide.None,\r\n } as {\r\n [key in 'ctrl' | 'alt' | 'shift' | 'meta']: _ExpectedModifierKeySide;\r\n };\r\n let ctrlKey: string | null = null;\r\n let altKey: string | null = null;\r\n let isAltGraphExpected: boolean = false;\r\n let shiftKey: string | null = null;\r\n let metaKey: string | null = null;\r\n let expectedKey: string | null = null;\r\n let success = false;\r\n for (const rawKey of toMatch) {\r\n const key = this._demapKeyCode(rawKey).toLowerCase();\r\n success = false;\r\n\r\n [expectedStates.ctrl, ctrlKey, success] = trySettingModifierKey(\r\n 'control',\r\n key,\r\n rawKey,\r\n ctrlKey,\r\n expectedStates.ctrl,\r\n );\r\n if (success) continue;\r\n [expectedStates.alt, altKey, success] = trySettingModifierKey(\r\n 'alt',\r\n key,\r\n rawKey,\r\n altKey,\r\n expectedStates.alt,\r\n );\r\n if (key === 'altright') {\r\n isAltGraphExpected = true;\r\n }\r\n if (success) continue;\r\n [expectedStates.shift, shiftKey, success] = trySettingModifierKey(\r\n 'shift',\r\n key,\r\n rawKey,\r\n shiftKey,\r\n expectedStates.shift,\r\n );\r\n if (success) continue;\r\n [expectedStates.meta, metaKey, success] = trySettingModifierKey(\r\n 'meta',\r\n key,\r\n rawKey,\r\n metaKey,\r\n expectedStates.meta,\r\n );\r\n if (success) continue;\r\n\r\n if (expectedKey) {\r\n console.error(\r\n new Error(\r\n `DKT-NF0031: A keyboard shortcut definition cannot contain two final keys. Got \"${expectedKey}\" and \"${rawKey}\"; only the first one will be included.`,\r\n ),\r\n );\r\n break;\r\n }\r\n expectedKey = key;\r\n }\r\n\r\n if (treatAltGraphAsAltPlusCtrl && isAltGraphExpected) {\r\n if (expectedStates.ctrl === _ExpectedModifierKeySide.Right) {\r\n console.error(\r\n new Error(\r\n `DKT-NF0032: A keyboard shortcut definition that treats AltGraph as Alt+Ctrl cannot expect the user to press AltGraph and ControlRight keys (while not pressing ControlLeft), as pressing AltGraph automatically presses ControlLeft.`,\r\n ),\r\n );\r\n }\r\n expectedStates.ctrl = _ExpectedModifierKeySide.Left;\r\n }\r\n\r\n return this._shortcutSubject$.pipe(\r\n filter((shortcut) => {\r\n if (isModifierKeyInWrongState(shortcut.ctrl, expectedStates.ctrl))\r\n return false;\r\n if (isModifierKeyInWrongState(shortcut.alt, expectedStates.alt))\r\n return false;\r\n if (isModifierKeyInWrongState(shortcut.shift, expectedStates.shift))\r\n return false;\r\n if (isModifierKeyInWrongState(shortcut.meta, expectedStates.meta))\r\n return false;\r\n if (shortcut.key !== expectedKey) return false;\r\n return true;\r\n }),\r\n map((v) => v.publicData),\r\n );\r\n }\r\n listenToKey(code: string): Observable<KeyboardKey> {\r\n const keyStr = this._demapKeyCode(code);\r\n return this.anyKeyPress$.pipe(filter((key) => key.key == keyStr));\r\n }\r\n listenToKeyState(code: string): Observable<KeyboardKeyState> {\r\n const keyStr = this._demapKeyCode(code);\r\n return this.anyKeyState$.pipe(filter((key) => key.key == keyStr));\r\n }\r\n\r\n private readonly _KEY_CODE_SIGNALS_MAP = new Map<\r\n string,\r\n WritableSignal<boolean>\r\n >([\r\n ['ControlLeft', this._isLeftCtrlHeld],\r\n ['ControlRight', this._isRightCtrlHeld],\r\n ['AltLeft', this._isLeftAltHeld],\r\n ['AltRight', this._isRightAltHeld],\r\n ['ShiftLeft', this._isLeftShiftHeld],\r\n ['ShiftRight', this._isRightShiftHeld],\r\n ['MetaLeft', this._isLeftMetaHeld],\r\n ['MetaRight', this._isRightMetaHeld],\r\n ]);\r\n\r\n private _onKeydown(event: KeyboardEvent): void {\r\n let wasModifierKey = false;\r\n const modifierSignal = this._KEY_CODE_SIGNALS_MAP.get(event.code);\r\n if (modifierSignal) {\r\n wasModifierKey = true;\r\n modifierSignal.set(true);\r\n }\r\n\r\n this._updateLockKeyStates(event);\r\n\r\n this._emitKeyStateDown(event);\r\n if (!wasModifierKey && this.isAnyModifierKeyHeld()) {\r\n this._emitShortcut(event);\r\n } else this._emitKeydown(event);\r\n }\r\n private _updateLockKeyStates(event: KeyboardEvent): void {\r\n this._capsLockState.set(event.getModifierState?.('CapsLock'));\r\n this._numLockState.set(event.getModifierState?.('NumLock'));\r\n this._scrollLockState.set(event.getModifierState?.('ScrollLock'));\r\n }\r\n\r\n private _onKeyup(event: KeyboardEvent): void {\r\n const modifierSignal = this._KEY_CODE_SIGNALS_MAP.get(event.code);\r\n modifierSignal?.set(false);\r\n\r\n this._emitKeyStateUp(event);\r\n }\r\n}\r\n","import {\r\n MonoTypeOperatorFunction,\r\n Observable,\r\n debounceTime,\r\n merge,\r\n throttleTime,\r\n} from 'rxjs';\r\n\r\n/**\r\n * Custom RxJS operator that throttles incoming values but saves the last one when (emitted when the throttle duration ends). A combination of throttleTime and debounceTime.\r\n * @param duration the throttle duration\r\n * @returns an RxJS operator function\r\n */\r\nexport function throttleSaveLast<T>(\r\n duration: number,\r\n): MonoTypeOperatorFunction<T> {\r\n return (source: Observable<T>) =>\r\n merge(\r\n source.pipe(throttleTime(duration)),\r\n source.pipe(debounceTime(duration)),\r\n ).pipe(throttleTime(0, undefined, { leading: true, trailing: false }));\r\n}\r\n\r\n/**\r\n * Requires that at least one property from the given object is defined.\r\n *\r\n * @copyright Copied from [Microsoft Learn](https://learn.microsoft.com/en-us/javascript/api/@azure/keyvault-certificates/requireatleastone).\r\n */\r\nexport type RequireAtLeastOne<T> = {\r\n [K in keyof T]-?: Required<Pick<T, K>> &\r\n Partial<Pick<T, Exclude<keyof T, K>>>;\r\n}[keyof T];","import {\r\n computed,\r\n ElementRef,\r\n Signal,\r\n signal,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { Observable, Subscription } from 'rxjs';\r\nimport { isNumber } from 'simple-bool';\r\nimport { RequireAtLeastOne, throttleSaveLast } from './utils';\r\n\r\nenum ViewportRelation {\r\n Above = 'above',\r\n PartiallyAbove = 'partially-above',\r\n Inside = 'inside',\r\n PartiallyBelow = 'partially-below',\r\n Below = 'below',\r\n InsideButTooLarge = 'inside-too-large',\r\n Undefined = 'undefined',\r\n}\r\n\r\ninterface TopBottom<T> {\r\n top: T;\r\n bottom: T;\r\n}\r\n\r\nclass ViewportMargins implements TopBottom<WritableSignal<number>> {\r\n readonly top = signal<number>(0);\r\n readonly bottom = signal<number>(0);\r\n\r\n constructor(margin: ArdViewportObserverConfig['margin']) {\r\n if (isNumber(margin)) {\r\n this.top.set(margin);\r\n this.bottom.set(margin);\r\n return;\r\n }\r\n this.top.set(margin?.top ?? 0);\r\n this.bottom.set(margin?.bottom ?? 0);\r\n }\r\n}\r\n\r\nexport interface ArdViewportObserverConfig {\r\n margin: number | RequireAtLeastOne<{ top: number; bottom: number }>;\r\n throttleTime: number;\r\n}\r\n\r\nexport class ArdViewportObserverRef {\r\n public readonly element!: HTMLElement;\r\n constructor(\r\n element: HTMLElement | ElementRef<HTMLElement>,\r\n private readonly update$: Observable<void>,\r\n config: ArdViewportObserverConfig,\r\n ) {\r\n this.element =\r\n element instanceof ElementRef ? element.nativeElement : element;\r\n\r\n setTimeout(() => {\r\n this._updateViewportRelation();\r\n }, 0);\r\n\r\n this._throttleTime = config.throttleTime;\r\n this._margins = new ViewportMargins(config.margin);\r\n this.margins = {\r\n top: this._margins.top.asReadonly(),\r\n bottom: this._margins.bottom.asReadonly(),\r\n };\r\n\r\n this._scrollSubscription = this.update$\r\n .pipe(throttleSaveLast(this._throttleTime))\r\n .subscribe(() => this._updateViewportRelation());\r\n }\r\n private readonly _throttleTime!: number;\r\n private readonly _margins!: TopBottom<WritableSignal<number>>;\r\n public readonly margins!: {\r\n readonly top: Signal<number>;\r\n readonly bottom: Signal<number>;\r\n };\r\n private readonly _scrollSubscription!: Subscription;\r\n\r\n private readonly _rawPosition = signal<\r\n Readonly<TopBottom<number>> | undefined\r\n >(undefined);\r\n public readonly position = computed(() => {\r\n const pos = this._rawPosition();\r\n if (!pos) return undefined;\r\n return {\r\n top: pos.top - this._margins.top(),\r\n bottom: window.innerHeight - pos.bottom - this._margins.bottom(),\r\n };\r\n });\r\n public readonly viewportRelation = computed<ViewportRelation | undefined>(\r\n () => this._getNewRelation(this._rawPosition()),\r\n );\r\n public readonly isInViewport = computed(() =>\r\n this.viewportRelation() === ViewportRelation.Undefined\r\n ? undefined\r\n : this.viewportRelation() === ViewportRelation.Inside ||\r\n this.viewportRelation() === ViewportRelation.PartiallyAbove ||\r\n this.viewportRelation() === ViewportRelation.PartiallyBelow,\r\n );\r\n\r\n private _updateViewportRelation() {\r\n const rect = this.element.getBoundingClientRect();\r\n this._rawPosition.set({\r\n top: rect.top,\r\n bottom: rect.bottom,\r\n });\r\n }\r\n private _getNewRelation(rect: TopBottom<number> | undefined) {\r\n if (!rect) return undefined;\r\n const topThreshold = this._margins.top();\r\n if (rect.bottom <= topThreshold) {\r\n return ViewportRelation.Above;\r\n }\r\n if (rect.bottom > topThreshold && rect.top < topThreshold) {\r\n return ViewportRelation.PartiallyAbove;\r\n }\r\n const bottomThreshold = window.innerHeight - this._margins.bottom();\r\n if (rect.top > topThreshold && rect.bottom > bottomThreshold) {\r\n return ViewportRelation.InsideButTooLarge;\r\n }\r\n if (rect.top < bottomThreshold && rect.bottom > bottomThreshold) {\r\n return ViewportRelation.PartiallyBelow;\r\n }\r\n if (rect.top >= bottomThreshold) {\r\n return ViewportRelation.Below;\r\n }\r\n return ViewportRelation.Inside;\r\n }\r\n\r\n private readonly _isDestroyed = signal(false);\r\n public readonly isDestroyed = this._isDestroyed.asReadonly();\r\n\r\n public recheck(): void {\r\n this._updateViewportRelation();\r\n }\r\n\r\n public destroy(): void {\r\n if (this.isDestroyed()) return;\r\n this._isDestroyed.set(true);\r\n this._scrollSubscription.unsubscribe();\r\n }\r\n\r\n public setMargin(topAndBottom: number): ArdViewportObserverRef;\r\n public setMargin(top: number, bottom: number): ArdViewportObserverRef;\r\n public setMargin(top: number, bottom: number = top): ArdViewportObserverRef {\r\n this._margins.top.set(top);\r\n this._margins.bottom.set(bottom);\r\n this._updateViewportRelation();\r\n return this;\r\n }\r\n}\r\n","import { InjectionToken, Provider } from '@angular/core';\r\nimport { ArdViewportObserverConfig } from './viewport-observer-ref';\r\n\r\nexport interface ArdViewportObserverDefaults\r\n extends Required<ArdViewportObserverConfig> {\r\n margin: Required<Exclude<ArdViewportObserverConfig['margin'], undefined>>;\r\n}\r\n\r\nconst _viewportObserverDefaults: ArdViewportObserverDefaults = {\r\n margin: 0,\r\n throttleTime: 100,\r\n};\r\n\r\nexport const ARD_VIEWPORT_OBSERVER_DEFAULTS =\r\n new InjectionToken<ArdViewportObserverDefaults>(\r\n 'ard-viewport-observer-defaults',\r\n {\r\n factory: () => ({\r\n ..._viewportObserverDefaults,\r\n }),\r\n },\r\n );\r\n\r\nexport function provideViewportObserverDefaults(\r\n config: Partial<ArdViewportObserverDefaults>,\r\n): Provider {\r\n return {\r\n provide: ARD_VIEWPORT_OBSERVER_DEFAULTS,\r\n useValue: { ..._viewportObserverDefaults, ...config },\r\n };\r\n}\r\n","import {\r\n ElementRef,\r\n Injectable,\r\n OnDestroy,\r\n Renderer2,\r\n RendererFactory2,\r\n inject,\r\n} from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\nimport {\r\n ArdViewportObserverConfig,\r\n ArdViewportObserverRef,\r\n} from './viewport-observer-ref';\r\nimport { ARD_VIEWPORT_OBSERVER_DEFAULTS } from './viewport-observer.defaults';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class ArdiumViewportObserverService implements OnDestroy {\r\n private _lastWindowHeight = window.innerHeight;\r\n constructor(rendererFactory: RendererFactory2) {\r\n this.renderer = rendererFactory.createRenderer(null, null);\r\n\r\n this.setScrollHost(document);\r\n\r\n this._resizeCleanupFn = this.renderer.listen(window, 'resize', () => {\r\n window.innerHeight !== this._lastWindowHeight &&\r\n this._scrollOrResizeSubject.next();\r\n });\r\n }\r\n\r\n protected readonly _DEFAULTS = inject(ARD_VIEWPORT_OBSERVER_DEFAULTS);\r\n\r\n private readonly renderer!: Renderer2;\r\n\r\n private readonly _scrollOrResizeSubject = new Subject<void>();\r\n private readonly scrollOrResize$ = this._scrollOrResizeSubject.asObservable();\r\n\r\n private readonly _registeredObservers: ArdViewportObserverRef[] = [];\r\n\r\n private _scrollCleanupFn!: () => void;\r\n private _resizeCleanupFn!: () => void;\r\n\r\n public setScrollHost(element: HTMLElement | Document): void {\r\n this._cleanupObservers();\r\n this._scrollCleanupFn = this.renderer.listen(element, 'scroll', () =>\r\n this._scrollOrResizeSubject.next(),\r\n );\r\n }\r\n\r\n public observeElement(\r\n element: HTMLElement | ElementRef<HTMLElement>,\r\n config?: Partial<ArdViewportObserverConfig>,\r\n ): ArdViewportObserverRef {\r\n const finalConfig = { ...this._DEFAULTS, ...(config ?? {}) };\r\n\r\n const vo = new ArdViewportObserverRef(\r\n element,\r\n this.scrollOrResize$,\r\n finalConfig,\r\n );\r\n this._registeredObservers.push(vo);\r\n return vo;\r\n }\r\n\r\n public observeById(\r\n id: string,\r\n config?: Partial<ArdViewportObserverConfig>,\r\n ): ArdViewportObserverRef {\r\n const element = document.getElementById(id);\r\n\r\n if (!element) {\r\n throw new Error(\r\n `DKT-NF0001: Trying to observe an element by id, but the element with id \"${id}\" does not exist.`,\r\n );\r\n }\r\n return this.observeElement(element, config);\r\n }\r\n\r\n public observeByQuery(\r\n query: string,\r\n config?: Partial<ArdViewportObserverConfig>,\r\n ): ArdViewportObserverRef {\r\n const element = document.querySelector<HTMLElement>(query);\r\n\r\n if (!element) {\r\n throw new Error(\r\n `DKT-NF0002: Trying to observe an element by query, but no element matching \"${query}\" exists.`,\r\n );\r\n }\r\n return this.observeElement(element, config);\r\n }\r\n\r\n public recheckAll(): void {\r\n this._scrollOrResizeSubject.next();\r\n }\r\n\r\n private _cleanupObservers(): void {\r\n this._scrollCleanupFn?.();\r\n this._registeredObservers.forEach((obs) => obs.destroy());\r\n }\r\n ngOnDestroy(): void {\r\n this._cleanupObservers();\r\n this._resizeCleanupFn?.();\r\n }\r\n}\r\n","import {\r\n Directive,\r\n ElementRef,\r\n HostListener,\r\n inject,\r\n output,\r\n} from '@angular/core';\r\n\r\n/**\r\n Detects when the user clicks outside a given element.\r\n\r\n @license\r\n Shamelessly stolen from [Christian Liebel](https://github.com/chliebel/angular2-click-outside)\r\n*/\r\n@Directive({ selector: '[ardClickOutside]', standalone: false })\r\nexport class ArdiumClickOutsideDirective {\r\n private readonly _elementRef: ElementRef<HTMLElement> = inject(ElementRef);\r\n\r\n public readonly ardClickOutside = output<MouseEvent>();\r\n\r\n @HostListener('document:mousedown', ['$event', '$event.target'])\r\n @HostListener('document:touchstart', ['$event', '$event.target'])\r\n public onClick(event: MouseEvent, target: HTMLElement): void {\r\n if (!target) return;\r\n\r\n const hostContainsTarget = this._elementRef.nativeElement.contains(target);\r\n if (!hostContainsTarget) {\r\n this.ardClickOutside.emit(event);\r\n }\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { ArdiumClickOutsideDirective } from './click-outside.directive';\r\n\r\n@NgModule({\r\n declarations: [ArdiumClickOutsideDirective],\r\n imports: [CommonModule],\r\n exports: [ArdiumClickOutsideDirective],\r\n})\r\nexport class ArdiumClickOutsideModule {}\r\n","const UNESCAPED_HTML_REGEX = /[&<>\"']/g;\r\nconst HTML_ESCAPES = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n \"'\": ''',\r\n} as const;\r\n\r\nexport function escapeHTML(value: string) {\r\n if (!value || !UNESCAPED_HTML_REGEX.test(value)) return value;\r\n\r\n return value.replace(\r\n UNESCAPED_HTML_REGEX,\r\n (chr) => HTML_ESCAPES[chr as keyof typeof HTML_ESCAPES],\r\n );\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\nimport { escapeHTML } from './escape-html';\r\n\r\n@Pipe({\r\n name: 'escapeHTML',\r\n standalone: false,\r\n})\r\nexport class ArdiumEscapeHTMLPipe implements PipeTransform {\r\n transform(value: string): string {\r\n return escapeHTML(value);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ArdiumEscapeHTMLPipe } from './escape-html.pipe';\r\n\r\n@NgModule({\r\n declarations: [ArdiumEscapeHTMLPipe],\r\n imports: [CommonModule],\r\n exports: [ArdiumEscapeHTMLPipe],\r\n})\r\nexport class ArdiumEscapeHTMLModule {}\r\n","import { InjectionToken, Provider } from \"@angular/core\";\r\n\r\nexport interface ArdHoldDefaults {\r\n delay: number;\r\n repeat: number;\r\n allowSpaceKey: boolean;\r\n allowEnterKey: boolean;\r\n}\r\n\r\nconst _holdDefaults: ArdHoldDefaults = {\r\n delay: 500,\r\n repeat: 1000 / 15,\r\n allowSpaceKey: false,\r\n allowEnterKey: false,\r\n};\r\n\r\nexport const ARD_HOLD_DEFAULTS = new InjectionToken<ArdHoldDefaults>(\r\n 'ard-hold-defaults',\r\n {\r\n factory: () => ({\r\n ..._holdDefaults,\r\n }),\r\n },\r\n);\r\n\r\nexport function provideHoldDefaults(\r\n config: Partial<ArdHoldDefaults>,\r\n): Provider {\r\n return {\r\n provide: ARD_HOLD_DEFAULTS,\r\n useValue: { ..._holdDefaults, ...config },\r\n };\r\n}\r\n","/**\r\n * Type describing the allowed values for a boolean input.\r\n */\r\nexport type BooleanLike = string | boolean | null | undefined;\r\n\r\n/** Coerces a data-bound value (typically a string) to a boolean. */\r\nexport function coerceBooleanProperty(value: any): boolean {\r\n return value != null && `${value}` !== 'false';\r\n}\r\n","/**\r\n * Type describing the allowed values for a number input\r\n */\r\nexport type NumberLike = string | number | null | undefined;\r\n\r\n/**\r\nCoerces a data-bound value (typically a string) to a number.\r\n*/\r\n/**\r\n * Coerces a data-bound value (typically a string) to a number.\r\n * @param value the value to be coerced.\r\n * @returns the value coerced into a number, or undefined if cannot coerce.\r\n */\r\nexport function coerceNumberProperty(value: any): number | undefined;\r\n/**\r\n * Coerces a data-bound value (typically a string) to a number.\r\n * @param value the value to be coerced.\r\n * @param fallback a value to be used if `value` cannot be coerced into a number.\r\n * @returns the value coerced into a number, or `fallback` if cannot coerce.\r\n */\r\nexport function coerceNumberProperty<D>(value: any, fallback: D): number | D;\r\nexport function coerceNumberProperty(value: any, fallbackValue = undefined) {\r\n return _isNumberValue(value) ? Number(value) : fallbackValue;\r\n}\r\n\r\n/**\r\n * Whether the provided value is considered a number.\r\n */\r\nfunction _isNumberValue(value: any): boolean {\r\n return !isNaN(parseFloat(value as any)) && !isNaN(Number(value));\r\n}\r\n","import {\r\n Directive,\r\n effect,\r\n HostListener,\r\n inject,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { coerceBooleanProperty } from '../coercion/boolean';\r\nimport { coerceNumberProperty } from '../coercion/number';\r\nimport { ARD_HOLD_DEFAULTS } from './hold.defaults';\r\n\r\n/**\r\n * Detects when the user clicks-and-holds a given element.\r\n */\r\n@Directive({ selector: '[ardHold]', standalone: false })\r\nexport class ArdiumHoldDirective {\r\n protected readonly _DEFAULTS = inject(ARD_HOLD_DEFAULTS);\r\n\r\n public readonly ardHold = output<void>();\r\n\r\n readonly ardHoldDisabled = input<boolean, any>(false, {\r\n transform: (v) => coerceBooleanProperty(v),\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n if (this.ardHoldDisabled()) {\r\n this._clear();\r\n }\r\n });\r\n }\r\n\r\n readonly ardHoldDelay = input<number, any>(this._DEFAULTS.delay, {\r\n transform: (v) => coerceNumberProperty(v, this._DEFAULTS.delay),\r\n });\r\n readonly ardHoldRepeat = input<number, any>(this._DEFAULTS.repeat, {\r\n transform: (v) => coerceNumberProperty(v, this._DEFAULTS.repeat),\r\n });\r\n\r\n readonly ardAllowSpaceKey = input<boolean, any>(\r\n this._DEFAULTS.allowSpaceKey,\r\n {\r\n transform: (v) => coerceBooleanProperty(v),\r\n },\r\n );\r\n readonly ardAllowEnterKey = input<boolean, any>(\r\n this._DEFAULTS.allowEnterKey,\r\n {\r\n transform: (v) => coerceBooleanProperty(v),\r\n },\r\n );\r\n\r\n private interval: any = null;\r\n private timeout: any = null;\r\n\r\n @HostListener('mousedown')\r\n @HostListener('touchstart')\r\n public onMouseDown(): void {\r\n if (this.ardHoldDisabled()) return;\r\n\r\n this.timeout = setTimeout(() => {\r\n this.timeout = null;\r\n\r\n this.interval = setInterval(() => {\r\n this.ardHold.emit();\r\n }, this.ardHoldRepeat());\r\n }, this.ardHoldDelay());\r\n }\r\n\r\n @HostListener('document:mouseup')\r\n @HostListener('document:touchend')\r\n public onMouseUp(): void {\r\n this._clear();\r\n }\r\n private _clear(): void {\r\n if (this.timeout) {\r\n clearTimeout(this.timeout);\r\n this.timeout = null;\r\n return;\r\n }\r\n if (!this.interval) return;\r\n\r\n clearInterval(this.interval);\r\n this.interval = null;\r\n }\r\n\r\n isKeyDown: boolean = false;\r\n\r\n @HostListener('keydown', ['$event'])\r\n public onKeyDown(event: KeyboardEvent): void {\r\n if (this.ardAllowEnterKey() && event.code == 'Enter') {\r\n event.preventDefault();\r\n }\r\n if (this.isKeyDown) return;\r\n if (\r\n (this.ardAllowSpaceKey() && event.code == 'Space') ||\r\n (this.ardAllowEnterKey() && event.code == 'Enter')\r\n ) {\r\n this.onMouseDown();\r\n this.isKeyDown = true;\r\n }\r\n }\r\n @HostListener('keyup', ['$event'])\r\n public onKeyUp(event: KeyboardEvent): void {\r\n if (\r\n (this.ardAllowSpaceKey() && event.code == 'Space') ||\r\n (this.ardAllowEnterKey() && event.code == 'Enter')\r\n ) {\r\n this.onMouseUp();\r\n this.isKeyDown = false;\r\n }\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { ArdiumHoldDirective } from './hold.directive';\r\n\r\n@NgModule({\r\n declarations: [ArdiumHoldDirective],\r\n imports: [CommonModule],\r\n exports: [ArdiumHoldDirective],\r\n})\r\nexport class ArdiumHoldModule {}\r\n","import {\r\n Directive,\r\n effect,\r\n ElementRef,\r\n HostListener,\r\n inject,\r\n input,\r\n model,\r\n output,\r\n untracked,\r\n} from '@angular/core';\r\nimport { coerceNumberProperty } from './../coercion/number';\r\nimport { ARD_INFINITE_SCROLL_DEFAULTS } from './infinite-scroll.defaults';\r\n\r\nexport const ArdInfScrollTarget = {\r\n Host: 'host',\r\n HTML: 'html',\r\n} as const;\r\nexport type ArdInfScrollTarget =\r\n (typeof ArdInfScrollTarget)[keyof typeof ArdInfScrollTarget];\r\n\r\n@Directive({\r\n selector: '[ardInfScroll]',\r\n standalone: false,\r\n})\r\nexport class ArdiumInfiniteScrollDirective {\r\n private readonly elementRef: ElementRef<HTMLElement> = inject(ElementRef);\r\n protected readonly _DEFAULTS = inject(ARD_INFINITE_SCROLL_DEFAULTS);\r\n\r\n readonly ardInfScrollReachThreshold = output<void>();\r\n\r\n private _getElementRect(): DOMRect {\r\n return this.elementRef.nativeElement.getBoundingClientRect();\r\n }\r\n private _getElementScrollTop(): number {\r\n return this.elementRef.nativeElement.scrollTop;\r\n }\r\n private _getElementScrollHeight(): number {\r\n return this.elementRef.nativeElement.scrollHeight;\r\n }\r\n\r\n constructor() {\r\n // re-check if threshold is reached immediately when directive becomes active again\r\n // needed when the content is not enough to fill the container and thus the scroll is already at the end when the directive becomes active\r\n effect(() => {\r\n const active = this.ardInfScrollActive();\r\n if (!active) return;\r\n\r\n const target = untracked(() => this.ardInfScrollTarget());\r\n if (target === ArdInfScrollTarget.Host) {\r\n this._detectHostReachThreshold();\r\n return;\r\n }\r\n this._detectWindowReachThreshold();\r\n });\r\n }\r\n\r\n //! options\r\n readonly ardInfScrollThreshold = input<number, any>(\r\n this._DEFAULTS.threshold,\r\n {\r\n transform: (v) => coerceNumberProperty(v, this._DEFAULTS.threshold),\r\n },\r\n );\r\n readonly ardInfScrollActive = model<boolean>(true);\r\n\r\n readonly ardInfScrollTarget = input<ArdInfScrollTarget>(\r\n this._DEFAULTS.target,\r\n );\r\n\r\n //! event handlers\r\n @HostListener('scroll')\r\n onHostScroll() {\r\n if (!this.ardInfScrollActive()) return;\r\n\r\n if (this.ardInfScrollTarget() !== ArdInfScrollTarget.Host) {\r\n console.error(\r\n `DKT-NF1000: ardInfScroll directive has target set to \"html\", but the host element has just been scrolled. To ensure the directive functions properly, make the host element unscrollable.`,\r\n );\r\n return;\r\n }\r\n this._detectHostReachThreshold();\r\n }\r\n @HostListener('window:scroll')\r\n onWindowScroll() {\r\n if (!this.ardInfScrollActive()) return;\r\n if (this.ardInfScrollTarget() !== ArdInfScrollTarget.HTML) return;\r\n\r\n this._detectWindowReachThreshold();\r\n }\r\n\r\n private _detectHostReachThreshold() {\r\n const { height } = this._getElementRect();\r\n const scrollTop = this._getElementScrollTop();\r\n const scrollHeight = this._getElementScrollHeight();\r\n const thresholdOffset = this.ardInfScrollThreshold();\r\n\r\n if (scrollTop + height >= scrollHeight - thresholdOffset) {\r\n this.ardInfScrollActive.set(false);\r\n this.ardInfScrollReachThreshold.emit();\r\n }\r\n }\r\n private _detectWindowReachThreshold() {\r\n const { top, height } = this._getElementRect();\r\n const viewportHeight = window.innerHeight;\r\n const thresholdOffset = this.ardInfScrollThreshold();\r\n\r\n if (-1 * top + viewportHeight >= height - thresholdOffset) {\r\n this.ardInfScrollActive.set(false);\r\n this.ardInfScrollReachThreshold.emit();\r\n }\r\n }\r\n}\r\n","import { InjectionToken, Provider } from '@angular/core';\r\nimport { ArdInfScrollTarget } from './infinite-scroll.directive';\r\n\r\nexport interface ArdInfiniteScrollDefaults {\r\n threshold: number;\r\n target: ArdInfScrollTarget;\r\n}\r\n\r\nconst _infiniteScrollDefaults: ArdInfiniteScrollDefaults = {\r\n threshold: 200,\r\n target: ArdInfScrollTarget.HTML,\r\n};\r\n\r\nexport const ARD_INFINITE_SCROLL_DEFAULTS =\r\n new InjectionToken<ArdInfiniteScrollDefaults>(\r\n 'ard-infinite-scroll-defaults',\r\n {\r\n factory: () => ({ ..._infiniteScrollDefaults }),\r\n },\r\n );\r\n\r\nexport function provideInfiniteScrollDefaults(config: Partial<ArdInfiniteScrollDefaults>): Provider {\r\n return {\r\n provide: ARD_INFINITE_SCROLL_DEFAULTS,\r\n useValue: { ..._infiniteScrollDefaults, ...config },\r\n };\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { ArdiumInfiniteScrollDirective } from './infinite-scroll.directive';\r\n\r\n@NgModule({\r\n declarations: [ArdiumInfiniteScrollDirective],\r\n imports: [CommonModule],\r\n exports: [ArdiumInfiniteScrollDirective],\r\n})\r\nexport class ArdiumInfiniteScrollModule {}\r\n","import { InjectionToken, Provider } from '@angular/core';\r\n\r\nexport interface ArdFilePipesDefaults {\r\n extensionWithDot: boolean;\r\n sizePrecision: number;\r\n sizeUseSpace: boolean;\r\n}\r\n\r\nconst _filePipesDefaults: ArdFilePipesDefaults = {\r\n extensionWithDot: true,\r\n sizePrecision: 2,\r\n sizeUseSpace: true,\r\n};\r\n\r\nexport const ARD_FILE_PIPES_DEFAULTS = new InjectionToken<ArdFilePipesDefaults>(\r\n 'ard-file-pipes-defaults',\r\n {\r\n factory: () => ({\r\n ..._filePipesDefaults,\r\n }),\r\n },\r\n);\r\n\r\nexport function provideFilePipesDefaults(\r\n config: Partial<ArdFilePipesDefaults>,\r\n): Provider {\r\n return {\r\n provide: ARD_FILE_PIPES_DEFAULTS,\r\n useValue: { ..._filePipesDefaults, ...config },\r\n };\r\n}\r\n","import { inject, Pipe, PipeTransform } from '@angular/core';\r\nimport { ARD_FILE_PIPES_DEFAULTS } from './file-pipes.defaults';\r\n\r\n/**\r\n * Formats a file extension from a string or File object.\r\n *\r\n * @param {string | File | null | undefined} value - The file name or File object whose extension is to be extracted.\r\n * @param {boolean} [withDot=false] - Whether to include a dot ('.') before the file extension.\r\n * @returns {string | null} - The file extension, or null if no extension is found or if the input is invalid.\r\n * \r\n * @example\r\n * formatFileExtension('image.png'); // -> 'png'\r\n * formatFileExtension('image.png', true); // -> '.png'\r\n */\r\nexport function formatFileExtension(\r\n value: string | File | null | undefined,\r\n withDot: boolean = false,\r\n): string | null {\r\n if (!value) return null;\r\n if (typeof value !== 'string') {\r\n value = value.name;\r\n }\r\n const ext = value.match(/^.+\\.([^.]+)$/)?.[1] ?? null;\r\n const dot = withDot ? '.' : '';\r\n return ext ? dot + ext : null;\r\n}\r\n\r\n/**\r\n * Pipe that transforms a file or file name into its extension.\r\n *\r\n * @example\r\n * {{ 'image.png' | fileext }} // -> 'png'\r\n * {{ 'image.png' | fileext: true }} // -> '.png'\r\n */\r\n@Pipe({\r\n name: 'fileext',\r\n standalone: false,\r\n})\r\nexport class ArdiumFileExtensionPipe implements PipeTransform {\r\n protected readonly _DEFAULTS = inject(ARD_FILE_PIPES_DEFAULTS);\r\n\r\n /**\r\n * Transforms the given value to its file extension.\r\n *\r\n * @param {string | File | null | undefined} value - The file name or File object to extract the extension from.\r\n * @param {boolean} withDot - Whether to include a dot before the extension (defaults to config value).\r\n * @returns {string | null} - The file extension or null if no extension is found.\r\n *\r\n *\r\n * @example\r\n * {{ 'image.png' | fileext }} // -> 'png'\r\n * {{ 'image.png' | fileext: true }} // -> '.png'\r\n */\r\n transform(\r\n value: string | File | null | undefined,\r\n withDot: boolean = this._DEFAULTS.extensionWithDot,\r\n ): string | null {\r\n return formatFileExtension(value, withDot);\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from \"@angular/core\";\r\n\r\n/**\r\n * Formats a file name by removing its extension.\r\n *\r\n * @param {string | File | null | undefined} value - The file name or File object to extract the name without extension from.\r\n * @returns {string} - The file name without the extension, or the original input if no extension is found.\r\n * \r\n * @example\r\n * formatFileName('image.png'); // -> 'image'\r\n * formatFileName('document.pdf'); // -> 'document'\r\n * formatFileName('my-component.component.ts'); // -> 'my-component.component'\r\n */\r\nexport function formatFileName(\r\n value: string | File | null | undefined\r\n): string {\r\n if (!value) return \"\";\r\n if (typeof value != \"string\") {\r\n value = value.name;\r\n }\r\n return value.match(/^(.+)\\.[^.]+$/)?.[1] ?? value;\r\n}\r\n\r\n/**\r\n * Pipe that transforms a file or file name into its name without the extension.\r\n *\r\n * @example\r\n * {{ 'image.png' | filename }} // -> 'image'\r\n * {{ 'document.pdf' | filename }} // -> 'document'\r\n * {{ 'my-component.component.ts' | filename }} // -> 'my-component.component'\r\n */\r\n@Pipe({\r\n name: \"filename\",\r\n standalone: false,\r\n})\r\nexport class ArdiumFileNamePipe implements PipeTransform {\r\n /**\r\n * Transforms the given value to its file name without the extension.\r\n *\r\n * @param {string | File | null | undefined} value - The file name or File object to extract the name without extension from.\r\n * @returns {string} - The file name without the extension.\r\n * \r\n * @example\r\n * {{ 'image.png' | filename }} // -> 'image'\r\n * {{ 'document.pdf' | filename }} // -> 'document'\r\n * {{ 'my-component.component.ts' | filename }} // -> 'my-component.component'\r\n */\r\n transform(value: string | File | null | undefined): string {\r\n return formatFileName(value);\r\n }\r\n}\r\n","import { inject, Pipe, PipeTransform } from '@angular/core';\r\nimport { ARD_FILE_PIPES_DEFAULTS } from './file-pipes.defaults';\r\n\r\nconst FILE_SIZE_UNITS = [\r\n { unit: 'B', size: 1 }, // bytes\r\n { unit: 'kB', size: 1e3 }, // kilobytes\r\n { unit: 'MB', size: 1e6 }, // megabytes\r\n { unit: 'GB', size: 1e9 }, // gigabytes\r\n { unit: 'TB', size: 1e12 }, // terabytes\r\n { unit: 'PB', size: 1e15 }, // petabytes\r\n { unit: 'EB', size: 1e18 }, // exabytes\r\n { unit: 'ZB', size: 1e21 }, // zettabytes\r\n { unit: 'YB', size: 1e24 }, // yottabytes\r\n];\r\n\r\n/**\r\n * Formats a file size into a human-readable string with the appropriate unit.\r\n *\r\n * @param {number | File | null | undefined} value - The file size as a number or a File object whose size is to be extracted.\r\n * @param {number} [precision=2] - The number of decimal places to round to. Default is 2.\r\n * @param {boolean} [useSpace=true] - Whether to include a space between the number and the unit. Default is true.\r\n * @returns {string} - The formatted file size with the unit (e.g., '1.5 MB', '10 kB').\r\n *\r\n * @example\r\n * formatFileSize(1024); // -> '1.00 kB'\r\n * formatFileSize(1048576); // -> '1.00 MB'\r\n * formatFileSize(1048576, 3); // -> '1.000 MB'\r\n * formatFileSize(1048576, 3, false); // -> '1.000MB'\r\n * formatFileSize(967680, 0); // -> '945 kB'\r\n */\r\nexport function formatFileSize(\r\n value: number | File | null | undefined,\r\n precision: number = 2,\r\n useSpace: boolean = true,\r\n): string {\r\n const space = useSpace ? ' ' : '';\r\n if (!value) return `0${space}B`;\r\n if (typeof value != 'number') {\r\n value = value.size;\r\n }\r\n if (value === 0) return `0${space}B`;\r\n\r\n const index = FILE_SIZE_UNITS.findIndex((unit) => value < unit.size);\r\n\r\n const fileSizeUnit =\r\n index === -1\r\n ? FILE_SIZE_UNITS[FILE_SIZE_UNITS.length - 1]\r\n : FILE_SIZE_UNITS[index - 1];\r\n\r\n const convertedValue =\r\n fileSizeUnit.unit === 'B'\r\n ? value\r\n : (value / fileSizeUnit.size).toFixed(precision);\r\n\r\n return `${convertedValue}${space}${fileSizeUnit.unit}`;\r\n}\r\n\r\n/**\r\n * Pipe that transforms a file or file size into a human-readable file size string.\r\n *\r\n * @example\r\n * {{ 1024 | filesize }} // -> '1.00 kB'\r\n * {{ 1048576 | filesize }} // -> '1.00 MB'\r\n * {{ 1048576 | filesize:3 }} // -> '1.000 MB'\r\n * {{ 1048576 | filesize:3:false }} // -> '1.000MB'\r\n * {{ 967680 | filesize:0 }} // -> '945 kB'\r\n */\r\n@Pipe({\r\n name: 'filesize',\r\n standalone: false,\r\n})\r\nexport class ArdiumFileSizePipe implements PipeTransform {\r\n /** Default configuration for the pipe */\r\n protected readonly _DEFAULTS = inject(ARD_FILE_PIPES_DEFAULTS);\r\n\r\n /**\r\n * Transforms the given value to a human-readable file size string.\r\n *\r\n * @param {number | File | null | undefined} value - The file size as a number or File object whose size is to be extracted.\r\n * @param {number} precision - The number of decimal places to round to (defaults to config value).\r\n * @param {boolean} useSpace - Whether to include a space between the number and the unit (defaults to config value).\r\n * @returns {string} - The formatted file size string (e.g., '1.5 MB', '10 kB').\r\n *\r\n * @example\r\n * {{ 1024 | filesize }} // -> '1.00 kB'\r\n * {{ 1048576 | filesize }} // -> '1.00 MB'\r\n * {{ 1048576 | filesize:3 }} // -> '1.000 MB'\r\n * {{ 1048576 | filesize:3:false }} // -> '1.000MB'\r\n * {{ 967680 | filesize:0 }} // -> '945 kB'\r\n */\r\n transform(\r\n value: number | File | null | undefined,\r\n precision: number = this._DEFAULTS.sizePrecision,\r\n useSpace: boolean = this._DEFAULTS.sizeUseSpace,\r\n ): string {\r\n return formatFileSize(value, precision, useSpace);\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { ArdiumFileExtensionPipe } from './fileext.pipe';\r\nimport { ArdiumFileNamePipe } from './filename.pipe';\r\nimport { ArdiumFileSizePipe } from './filesize.pipe';\r\n\r\n@NgModule({\r\n declarations: [\r\n ArdiumFileExtensionPipe,\r\n ArdiumFileNamePipe,\r\n ArdiumFileSizePipe,\r\n ],\r\n imports: [CommonModule],\r\n exports: [ArdiumFileExtensionPipe, ArdiumFileNamePipe, ArdiumFileSizePipe],\r\n})\r\nexport class ArdiumFilePipesModule {}\r\n","import { computed, Signal, signal, WritableSignal } from '@angular/core';\r\n\r\n/**\r\n * A read-only array signal with non-mutating methods.\r\n */\r\nexport interface ArraySignal<T> extends Signal<T[]> {\r\n /**\r\n * A computed signal that returns `true` if the array is empty.\r\n */\r\n readonly isEmpty: Signal<boolean>;\r\n}\r\n\r\n/**\r\n * A writable array signal with mutating and non-mutating methods.\r\n */\r\nexport interface WritableArraySignal<T> extends WritableSignal<T[]>, ArraySignal<T> {\r\n /**\r\n * Returns a read-only version of the array signal.\r\n */\r\n asReadonly(): ArraySignal<T>;\r\n\r\n /**\r\n * Fills all the elements of the array signal from a start index to an end index with a static value.\r\n * @param value - The value to fill the array with.\r\n * @param start - The start index (inclusive). Defaults to 0.\r\n * @param end - The end index (exclusive). Defaults to array length.\r\n */\r\n fill(value: T, start?: number, end?: number): void;\r\n\r\n /**\r\n * Filters the array based on a predicate function and updates the signal with the filtered result.\r\n * @param predicate - Function to test each element of the array.\r\n */\r\n filter(predicate: (value: T, index: number, array: T[]) => boolean): void;\r\n\r\n /**\r\n * Applies a mapping function to each element in the array and updates the signal with the result.\r\n * @param mapFn - Function that produces an element of the new array.\r\n */\r\n map(mapFn: (value: T, index: number, array: T[]) => T): void;\r\n\r\n /**\r\n * Removes the last element from the array and returns it.\r\n * Updates the signal.\r\n * @returns The removed element, or undefined if the array was empty.\r\n */\r\n pop(): T | undefined;\r\n\r\n /**\r\n * Appends new elements to the end of the array and returns the new length.\r\n * Updates the signal.\r\n * @param items - The elements to add.\r\n * @returns The new length of the array.\r\n */\r\n push(...items: T[]): number;\r\n\r\n /**\r\n * Reverses the order of the elements in the array and updates the signal.\r\n */\r\n reverse(): void;\r\n\r\n /**\r\n * Replaces the entire array with a new array value.\r\n * @param value - The new array value.\r\n */\r\n set(value: T[]): void;\r\n\r\n /**\r\n * Replaces the item at the given index with the new item.\r\n * @param index - The index where the item should be replaced.\r\n * @param newItem - The new item to be set at the given index.\r\n */\r\n setAt(index: number, newItem: T): void;\r\n\r\n /**\r\n * Removes the first element from the array and returns it.\r\n * Updates the signal.\r\n * @returns The removed element, or undefined if the array was empty.\r\n */\r\n shift(): T | undefined;\r\n\r\n /**\r\n * Sorts the elements of the array in place and updates the signal.\r\n * @param compareFn - Specifies a function that defines the sort order.\r\n */\r\n sort(compareFn?: (a: T, b: T) => number): void;\r\n\r\n /**\r\n * Changes the contents of the array by removing or replacing existing elements and/or adding new elements.\r\n * Updates the signal.\r\n * @param start - The index at which to start changing the array.\r\n * @param deleteCount - The number of elements to remove.\r\n * @param items - Elements to add to the array.\r\n * @returns An array containing the deleted elements.\r\n */\r\n splice(start: number, deleteCount?: number, ...items: T[]): T[];\r\n\r\n /**\r\n * Adds one or more elements to the beginning of the array and returns the new length.\r\n * Updates the signal.\r\n * @param items - The elements to add.\r\n * @returns The new length of the array.\r\n */\r\n unshift(...items: T[]): number;\r\n\r\n /**\r\n * Updates the array signal based on a provided update function.\r\n * @param updateFn - A function that receives the current array and returns the updated array.\r\n */\r\n update(updateFn: (value: T[]) => T[]): void;\r\n\r\n /**\r\n * Updates the item at the given index by applying the update function.\r\n * @param index - The index where the item should be updated.\r\n * @param updateFn - The function that will update the current item at the given index.\r\n */\r\n updateAt(index: number, updateFn: (current: T) => T): void;\r\n}\r\n\r\n/**\r\n * Creates a writable, reactive array signal with convenient, immutable array manipulation methods.\r\n *\r\n * This helper returns a signal that wraps an array and exposes a full suite of mutating and non-mutating array methods,\r\n * all of which will automatically trigger Angular reactivity.\r\n *\r\n * All mutator methods (such as `push`, `pop`, `splice`, `setAt`, `updateAt`, etc) return a new array value, preserving\r\n * immutability for optimal signal reactivity. Do not depend on reference equality between updates.\r\n *\r\n * @template T The type of items stored in the array.\r\n * @param {T[]} [initialValue=[]] Optional initial value for the array.\r\n * @returns {WritableArraySignal<T>} A writable array signal with both native and array-specific helpers.\r\n *\r\n * @example\r\n * const numbers = arraySignal([1, 2, 3]);\r\n * numbers.push(4); // [1, 2, 3, 4]\r\n * numbers.pop(); // returns 4, numbers() === [1, 2, 3]\r\n * numbers.setAt(1, 99); // [1, 99, 3]\r\n * numbers.filter(x => x>1); // [99, 3]\r\n */\r\nexport function arraySignal<T>(initialValue: T[] = []): WritableArraySignal<T> {\r\n const internalSignal = signal<T[]>([\r\n ...initialValue,\r\n ]) as WritableArraySignal<T>;\r\n\r\n const _set = internalSignal.set;\r\n const _update = internalSignal.update;\r\n const _asReadonly = internalSignal.asReadonly;\r\n\r\n // Native signal methods\r\n internalSignal.set = (value: T[]) => _set([...value]);\r\n\r\n internalSignal.update = (updateFn: (value: T[]) => T[]) => {\r\n _update((current) => [...updateFn(current)]);\r\n };\r\n\r\n // isEmpty\r\n (internalSignal as any).isEmpty = computed(\r\n () => internalSignal().length === 0,\r\n );\r\n\r\n // setAt & updateAt\r\n internalSignal.setAt = (index: number, newItem: T) => {\r\n internalSignal.update((arr) => {\r\n const newArr = [...arr];\r\n newArr[index] = newItem;\r\n return newArr;\r\n });\r\n };\r\n\r\n internalSignal.updateAt = (index: number, updateFn: (current: T) => T) => {\r\n internalSignal.update((arr) => {\r\n const newArr = [...arr];\r\n newArr[index] = updateFn(newArr[index]);\r\n return newArr;\r\n });\r\n };\r\n\r\n // Array methods\r\n internalSignal.fill = (value, start?, end?) => {\r\n internalSignal.update((arr) => {\r\n const newArr = [...arr];\r\n newArr.fill(value, start, end);\r\n return newArr;\r\n });\r\n };\r\n\r\n internalSignal.filter = (predicate) => {\r\n internalSignal.update((arr) => arr.filter(predicate));\r\n };\r\n\r\n internalSignal.map = (mapFn) => {\r\n internalSignal.update((arr) => arr.map(mapFn));\r\n };\r\n\r\n internalSignal.pop = (): T | undefined => {\r\n let value: T | undefined;\r\n internalSignal.update((arr) => {\r\n const newArr = [...arr];\r\n value = newArr.pop();\r\n return newArr;\r\n });\r\n return value;\r\n };\r\n\r\n internalSignal.push = (...items: T[]): number => {\r\n let length: number;\r\n internalSignal.update((arr) => {\r\n const newArr = [...arr, ...items];\r\n length = newArr.length;\r\n return newArr;\r\n });\r\n return length!;\r\n };\r\n\r\n internalSignal.reverse = () => {\r\n internalSignal.update((arr) => {\r\n const newArr = [...arr];\r\n newArr.reverse();\r\n return newArr;\r\n });\r\n };\r\n\r\n internalSignal.shift = (): T | undefined => {\r\n let value: T | undefined;\r\n internalSignal.update((arr) => {\r\n const newArr = [...arr];\r\n value = newArr.shift();\r\n return newArr;\r\n });\r\n return value;\r\n };\r\n\r\n internalSignal.sort = (compareFn?) => {\r\n internalSignal.update((arr) => {\r\n const newArr = [...arr];\r\n newArr.sort(compareFn);\r\n return newArr;\r\n });\r\n };\r\n\r\n internalSignal.splice = (start, deleteCount?, ...items) => {\r\n let removed: T[] = [];\r\n internalSignal.update((arr) => {\r\n const newArr = [...arr];\r\n removed = newArr.splice(start, deleteCount ?? arr.length, ...items);\r\n return newArr;\r\n });\r\n return removed!;\r\n };\r\n\r\n internalSignal.unshift = (...items: T[]): number => {\r\n let length: number;\r\n internalSignal.update((arr) => {\r\n const newArr = [...items, ...arr];\r\n length = newArr.length;\r\n return newArr;\r\n });\r\n return length!;\r\n };\r\n\r\n // create a wrapper with only \r\n internalSignal.asReadonly = () => {\r\n const readonlySignal = _asReadonly() as ArraySignal<T>;\r\n \r\n (readonlySignal as any).isEmpty = internalSignal.isEmpty;\r\n\r\n return readonlySignal;\r\n };\r\n\r\n return internalSignal;\r\n}\r\n","import { signal, Signal, WritableSignal } from '@angular/core';\r\n\r\n/**\r\n * A read-only counter signal with computed helpers.\r\n */\r\nexport interface CounterSignal extends Signal<number> {\r\n /**\r\n * Returns true if the counter's value was not changed after resetting.\r\n */\r\n readonly isReset: Signal<boolean>;\r\n /**\r\n * Returns the current counter value (alias for signal()).\r\n */\r\n value(): number;\r\n}\r\n\r\n/**\r\n * A writable counter signal with mutation helpers and computed queries.\r\n */\r\nexport interface WritableCounterSignal\r\n extends WritableSignal<number>,\r\n CounterSignal {\r\n /**\r\n * Returns a read-only version of the counter signal.\r\n */\r\n asReadonly(): CounterSignal;\r\n /**\r\n * Increments the counter by a specified value (default: 1).\r\n * @param amount The value to increment by. Default is 1.\r\n */\r\n increment(amount?: number): void;\r\n /**\r\n * Decrements the counter by a specified value (default: 1).\r\n * @param amount The value to decrement by. Default is 1.\r\n */\r\n decrement(amount?: number): void;\r\n /**\r\n * Sets the counter to a specific value.\r\n * @param value The value to set the counter to.\r\n */\r\n set(value: number): void;\r\n /**\r\n * Updates the counter using an updater function.\r\n * @param updater A function that receives the current value and returns the new value.\r\n */\r\n update(updater: (current: number) => number): void;\r\n /**\r\n * Resets the counter to its base (initial) value.\r\n *\r\n * Base value is the initial value by default, and can be changed using {@link setBaseValue}.\r\n */\r\n reset(): void;\r\n /**\r\n * Sets the base value to be used when resetting the counter.\r\n */\r\n setBaseValue(value: number): void;\r\n}\r\n\r\n/**\r\n * Creates a writable, reactive counter signal with convenient helpers and computed queries.\r\n *\r\n * @param {number} [initial=0] The initial value of the counter.\r\n * @returns {WritableCounterSignal} A writable counter signal instance.\r\n *\r\n * @example\r\n * const count = counterSignal(10);\r\n * count.inc(); // 11\r\n * count.dec(2); // 9\r\n * count.reset(); // 10\r\n * count.isReset(); // true\r\n */\r\nexport function counterSignal(initial = 0): WritableCounterSignal {\r\n const internalSignal = signal<number>(initial) as WritableCounterSignal;\r\n\r\n const isResetSignal = signal<boolean>(true);\r\n\r\n const _set = (internalSignal as unknown as WritableSignal<number>).set;\r\n const _update = internalSignal.update;\r\n const _asReadonly = internalSignal.asReadonly;\r\n\r\n let _initial = initial;\r\n\r\n // Native methods\r\n internalSignal.set = (value: number) => {\r\n _set(value);\r\n isResetSignal.set(false);\r\n };\r\n internalSignal.update = (updater: (current: number) => number) => {\r\n _update((current) => updater(current));\r\n isResetSignal.set(false);\r\n };\r\n\r\n // Counter methods\r\n internalSignal.increment = (amount: number = 1) => {\r\n internalSignal.update((val) => val + amount);\r\n };\r\n\r\n internalSignal.decrement = (amount: number = 1) => {\r\n internalSignal.update((val) => val - amount);\r\n };\r\n\r\n internalSignal.reset = () => {\r\n _set(_initial);\r\n isResetSignal.set(true);\r\n };\r\n\r\n internalSignal.setBaseValue = (value: number) => {\r\n _initial = value;\r\n };\r\n\r\n internalSignal.asReadonly = () => {\r\n const readonly = _asReadonly() as CounterSignal;\r\n (readonly.isReset as any) = internalSignal.isReset;\r\n readonly.value = internalSignal.value;\r\n return readonly;\r\n };\r\n\r\n internalSignal.value = internalSignal.asReadonly();\r\n\r\n (internalSignal.isReset as any) = isResetSignal.asReadonly();\r\n\r\n return internalSignal;\r\n}\r\n","import { signal, WritableSignal } from '@angular/core';\r\n\r\n/**\r\n * A DebouncedSignal interface that extends WritableSignal<T> and includes debouncing behavior.\r\n */\r\nexport interface DebouncedSignal<T> extends WritableSignal<T> {\r\n readonly debounceTime: number;\r\n}\r\n\r\n/**\r\n * Creates a `WritableSignal` that delays updates to its value until there's a pause in updates, based on the debounce time specified.\r\n *\r\n * @param initialValue - The initial value of the signal.\r\n * @param debounceTime - The delay in milliseconds after the last update before applying the signal update.\r\n * @returns A `WritableSignal<T>` that debounces value updates based on the specified debounce time.\r\n */\r\nexport function debouncedSignal<T>(\r\n initialValue: T,\r\n debounceTime: number,\r\n): DebouncedSignal<T> {\r\n const internalSignal = signal<T>(initialValue) as DebouncedSignal<T>;\r\n Object.assign(internalSignal, { debounceTime });\r\n\r\n let timeoutId: any = null;\r\n\r\n const originalSet = internalSignal.set;\r\n\r\n const setDebouncedValue = (value: T) => {\r\n // Clear the previous timeout if a new value is set before the debounce period ends\r\n if (timeoutId) {\r\n clearTimeout(timeoutId);\r\n }\r\n\r\n // Set a new timeout to update the signal after the debounce period\r\n timeoutId = setTimeout(() => {\r\n originalSet(value);\r\n timeoutId = null;\r\n }, debounceTime);\r\n };\r\n\r\n // Override the `set` method to include debouncing\r\n internalSignal.set = (value: T) => {\r\n setDebouncedValue(value);\r\n };\r\n internalSignal.update = (fn: (v: T) => T) => {\r\n setDebouncedValue(fn(internalSignal()));\r\n };\r\n\r\n return internalSignal;\r\n}\r\n","import { computed, Signal, signal, WritableSignal } from '@angular/core';\r\n\r\n/**\r\n * A read-only map signal with non-mutating methods.\r\n */\r\nexport interface MapSignal<K, V> extends Signal<Map<K, V>> {\r\n /**\r\n * Computed signal that returns `true` if the map is empty.\r\n */\r\n readonly isEmpty: Signal<boolean>;\r\n /**\r\n * Computed signal for map size.\r\n */\r\n readonly size: Signal<number>;\r\n\r\n /**\r\n * Gets the value for a key, or undefined.\r\n */\r\n get(key: K): V | undefined;\r\n\r\n /**\r\n * Checks if a key exists in the map.\r\n */\r\n has(key: K): boolean;\r\n\r\n /**\r\n * Computed signal that returns an array of [key, value] entries.\r\n */\r\n readonly entriesArray: Signal<[K, V][]>;\r\n\r\n /**\r\n * Computed signal that returns an array of keys.\r\n */\r\n readonly keysArray: Signal<K[]>;\r\n\r\n /**\r\n * Computed signal that returns an array of values.\r\n */\r\n readonly valuesArray: Signal<V[]>;\r\n}\r\n\r\n/**\r\n * A writable map signal with mutating and non-mutating methods.\r\n */\r\nexport interface WritableMapSignal<K, V>\r\n extends WritableSignal<Map<K, V>>,\r\n MapSignal<K, V> {\r\n /**\r\n * Returns a read-only version of the map signal.\r\n */\r\n asReadonly(): MapSignal<K, V>;\r\n\r\n /**\r\n * Sets a value for the key.\r\n */\r\n setKey(key: K, value: V): void;\r\n\r\n /**\r\n * Deletes a key from the map.\r\n * Returns true if a value was removed.\r\n */\r\n delete(key: K): boolean;\r\n\r\n /**\r\n * Clears the map.\r\n */\r\n clear(): void;\r\n\r\n /**\r\n * Replaces the map with a new map.\r\n */\r\n setMap(value: Map<K, V>): void;\r\n /**\r\n * Replaces the map with a new map. Alias of the method `setMap()`.\r\n */\r\n set(value: Map<K, V>): void;\r\n\r\n /**\r\n * Updates the map using an update function.\r\n */\r\n update(updateFn: (current: Map<K, V>) => Map<K, V>): void;\r\n\r\n /**\r\n * Updates the value for a key using the provided update function if the key exists.\r\n */\r\n updateAt(key: K, updateFn: (current: V) => V): void;\r\n}\r\n\r\n/**\r\n * Creates a writable, reactive Map signal with full Map-like API and helpers.\r\n *\r\n * This factory returns a signal wrapping a JavaScript `Map`, exposing both non-mutating and mutating methods\r\n * for convenient and fully reactive manipulation of key-value pairs.\r\n *\r\n * All mutator methods (`setKey`, `delete`, `clear`, `setMap`, etc.) always replace the Map with a cloned version,\r\n * ensuring immutability for predictable reactivity.\r\n *\r\n * The signal also provides computed signals for common queries (such as `isEmpty`, `size`, `entriesArray`, `keysArray`, `valuesArray`),\r\n * and offers a type-safe, readonly view via `.asReadonly()`.\r\n *\r\n * @template K The type of keys.\r\n * @template V The type of values.\r\n * @param {Iterable<[K, V]>} [initialValue=[]] Optional initial map contents, as entries or another Map.\r\n * @returns {WritableMapSignal<K, V>} A writable Map signal instance with both native and Map-specific helpers.\r\n *\r\n * @example\r\n * const map = mapSignal<string, number>([['a', 1], ['b', 2]]);\r\n * map.setKey('c', 3); // Adds key 'c'\r\n * map.delete('a'); // Removes key 'a'\r\n * map.update(m => { m.set('d', 4); return m; });\r\n * map.entriesArray(); // [['b', 2], ['c', 3], ['d', 4]]\r\n */\r\nexport function mapSignal<K, V>(\r\n initialValue: Iterable<[K, V]> = [],\r\n): WritableMapSignal<K, V> {\r\n const internalSignal = signal<Map<K, V>>(\r\n new Map(initialValue),\r\n ) as unknown as WritableMapSignal<K, V>;\r\n\r\n const _set = (internalSignal as unknown as WritableSignal<Map<K, V>>).set;\r\n const _update = internalSignal.update;\r\n const _asReadonly = internalSignal.asReadonly;\r\n\r\n internalSignal.setMap = (value: Map<K, V>) => _set(new Map(value));\r\n internalSignal.set = (value: Map<K, V>) => _set(new Map(value));\r\n\r\n internalSignal.setKey = (key: K, value: V) => {\r\n internalSignal.update((map) => {\r\n const copy = new Map(map);\r\n copy.set(key, value);\r\n return copy;\r\n });\r\n };\r\n\r\n internalSignal.delete = (key: K): boolean => {\r\n let deleted = false;\r\n internalSignal.update((map) => {\r\n if (!map.has(key)) return map;\r\n const copy = new Map(map);\r\n deleted = copy.delete(key);\r\n return copy;\r\n });\r\n return deleted;\r\n };\r\n\r\n internalSignal.clear = () => {\r\n internalSignal.setMap(new Map<K, V>());\r\n };\r\n\r\n internalSignal.get = (key: K): V | undefined => internalSignal().get(key);\r\n\r\n internalSignal.has = (key: K): boolean => internalSignal().has(key);\r\n\r\n internalSignal.update = (updateFn: (current: Map<K, V>) => Map<K, V>) => {\r\n _update((current) => new Map(updateFn(current)));\r\n };\r\n\r\n internalSignal.updateAt = (key: K, updateFn: (current: V) => V) => {\r\n internalSignal.update((map) => {\r\n if (!map.has(key)) return map;\r\n const copy = new Map(map);\r\n copy.set(key, updateFn(copy.get(key)!));\r\n return copy;\r\n });\r\n };\r\n\r\n (internalSignal.entriesArray as any) = computed(() =>\r\n Array.from(internalSignal().entries()),\r\n );\r\n (internalSignal.keysArray as any) = computed(() =>\r\n Array.from(internalSignal().keys()),\r\n );\r\n (internalSignal.valuesArray as any) = computed(() =>\r\n Array.from(internalSignal().values()),\r\n );\r\n\r\n (internalSignal.isEmpty as any) = computed(() => internalSignal().size === 0);\r\n (internalSignal.size as any) = computed(() => internalSignal().size);\r\n\r\n internalSignal.asReadonly = () => {\r\n const readonlySignal = _asReadonly() as MapSignal<K, V>;\r\n (readonlySignal.isEmpty as any) = internalSignal.isEmpty;\r\n (readonlySignal.size as any) = internalSignal.size;\r\n readonlySignal.get = internalSignal.get;\r\n readonlySignal.has = internalSignal.has;\r\n (readonlySignal.entriesArray as any) = internalSignal.entriesArray;\r\n (readonlySignal.keysArray as any) = internalSignal.keysArray;\r\n (readonlySignal.valuesArray as any) = internalSignal.valuesArray;\r\n return readonlySignal;\r\n };\r\n\r\n return internalSignal;\r\n}\r\n","import {\r\n computed,\r\n effect,\r\n inject,\r\n Injector,\r\n runInInjectionContext,\r\n Signal,\r\n signal,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { isAnyString, isNull } from 'simple-bool';\r\n\r\nexport interface PersistentSignalNonNullable<T> extends Signal<T> {\r\n readonly method: PersistentStorageMethod;\r\n readonly key: string;\r\n readonly serialized: Signal<string | null>;\r\n}\r\n\r\nexport interface PersistentSignal<T>\r\n extends PersistentSignalNonNullable<T | null> {}\r\n\r\n/**\r\n * A `PersistentSignal` is a specialized type of `WritableSignal` that automatically persists its value using a specified storage method (localStorage, sessionStorage, or cookies). It extends the standard `WritableSignal` interface by including additional properties to define the persistence mechanism and key used for storage. The `PersistentSignal` ensures that any changes to its value are saved to the chosen storage method, and it initializes its value from storage if available when created.\r\n */\r\nexport interface WritablePersistentSignalNonNullable<T>\r\n extends WritableSignal<T>,\r\n PersistentSignalNonNullable<T> {\r\n asReadonly(): PersistentSignalNonNullable<T>;\r\n}\r\n\r\nexport interface WritablePersistentSignal<T>\r\n extends WritablePersistentSignalNonNullable<T | null> {\r\n clear(): void;\r\n asReadonly(): PersistentSignal<T>;\r\n}\r\n\r\n/**\r\n * Defines the available persistent storage methods for the `persistentSignal`. Each method corresponds to a different browser storage mechanism:\r\n * - `PersistentStorageMethod.LocalStorage`: Uses the browser's localStorage to persist the value across sessions.\r\n * - `PersistentStorageMethod.SessionStorage`: Uses the browser's sessionStorage to persist the value for the duration of the page session.\r\n * - `PersistentStorageMethod.Cookies`: Uses browser cookies to persist the value, allowing for additional options like expiration and path.\r\n */\r\nexport const PersistentStorageMethod = {\r\n Cookies: 'cookies',\r\n LocalStorage: 'local-storage',\r\n SessionStorage: 'session-storage',\r\n} as const;\r\n/**\r\n * Defines the available persistent storage methods for the `persistentSignal`. Each method corresponds to a different browser storage mechanism:\r\n * - `PersistentStorageMethod.LocalStorage`: Uses the browser's localStorage to persist the value across sessions.\r\n * - `PersistentStorageMethod.SessionStorage`: Uses the browser's sessionStorage to persist the value for the duration of the page session.\r\n * - `PersistentStorageMethod.Cookies`: Uses browser cookies to persist the value, allowing for additional options like expiration and path.\r\n */\r\nexport type PersistentStorageMethod =\r\n (typeof PersistentStorageMethod)[keyof typeof PersistentStorageMethod];\r\n\r\ninterface _PersistentSignalOptionsBase<T> {\r\n /**\r\n * The persistent storage method to use for storing the signal value. Options include:\r\n * - `PersistentStorageMethod.LocalStorage`: Uses the browser's localStorage to persist the value across sessions.\r\n * - `PersistentStorageMethod.SessionStorage`: Uses the browser's sessionStorage to persist the value for the duration of the page session.\r\n * - `PersistentStorageMethod.Cookies`: Uses browser cookies to persist the value, allowing for additional options like expiration and path.\r\n */\r\n method: PersistentStorageMethod;\r\n /**\r\n * Cookie-specific option: Defines the expiration date of the cookie. Can be a `Date` object or a string in UTC format. If not specified, the cookie will be a session cookie and will expire when the browser is closed.\r\n */\r\n expires?: Date | string;\r\n /**\r\n * Cookie-specific option: Defines the maximum age of the cookie in seconds. If both `expires` and `maxAge` are specified, `maxAge` takes precedence. If not specified, the cookie will be a session cookie and will expire when the browser is closed.\r\n */\r\n maxAge?: number;\r\n /**\r\n * Cookie-specific option: Defines the path for which the cookie is valid. Defaults to `'/'`, making the cookie accessible across the entire site. If set to a specific path, the cookie will only be sent to the server for requests matching that path.\r\n */\r\n path?: string;\r\n\r\n /**\r\n * Optional serialization function to convert the signal value into a string for storage. This is required if the signal value is not a string or if you want to customize the serialization format. The function should return a string representation of the value, or `null` if the value is `null`.\r\n * @param value The value to serialize, which can be of type `T` or `null`.\r\n * @returns A string representation of the value for storage, or `null` if the value is `null`.\r\n */\r\n serialize?: (value: T | null) => string | null;\r\n /**\r\n * Optional deserialization function to convert the stored string value back into the original type `T`. This is required if a custom `serialize` function is provided, or if the initial value is not a string and serialization options are not defined. The function should return the deserialized value of type `T`, or `null` if the input value is `null`.\r\n * @param value The string value retrieved from storage that needs to be deserialized back into the original type `T`. This function is required if a custom `serialize` function is provided, or if the initial value is not a string and serialization options are not defined. The function should return the deserialized value of type `T`, or `null` if the input value is `null`.\r\n * @returns The deserialized value of type `T`, or `null` if the input value is `null`.\r\n */\r\n deserialize?: (value: string) => T | null;\r\n\r\n /**\r\n * If true, creates a non-nullable persistent signal interface.\r\n */\r\n nonNullable?: boolean;\r\n}\r\ninterface _PersistentSignalOptionsDeprecated<T>\r\n extends _PersistentSignalOptionsBase<T> {\r\n /**\r\n * @deprecated Use `key` instead. The name/key used to store the signal value in the chosen storage method.\r\n */\r\n name: string;\r\n}\r\ninterface _PersistentSignalOptions<T> extends _PersistentSignalOptionsBase<T> {\r\n /**\r\n * The name/key used to store the signal value in the chosen storage method.\r\n */\r\n key: string;\r\n}\r\n\r\n/**\r\n * Options for persisting the signal value.\r\n */\r\nexport type PersistentSignalOptions<T> =\r\n | _PersistentSignalOptionsDeprecated<T>\r\n | _PersistentSignalOptions<T>;\r\n\r\nfunction isSerializableSignal<T>(\r\n options: PersistentSignalOptions<T>,\r\n): options is PersistentSignalOptions<T> &\r\n Required<Pick<_PersistentSignalOptionsBase<T>, 'serialize' | 'deserialize'>> {\r\n return !!options.serialize && !!options.deserialize;\r\n}\r\n\r\n/**\r\n * Creates a `WritableSignal` that persists its value using the specified storage method,\r\n * with custom serialization and deserialization.\r\n *\r\n * @param initialValue - The initial value of the signal if no stored value is found.\r\n * @param options - An object containing the storage method and custom serialization/deserialization functions.\r\n * @param options.name - The key used to store the signal value.\r\n * @param options.method - The persistent storage method (localStorage, sessionStorage, or cookies).\r\n * @param options.serialize - A function to serialize the value into a string for storage.\r\n * @param options.deserialize - A function to deserialize the stored string value back into the original type.\r\n * @returns A `WritableSignal<T>` that persists its value using the specified storage method.\r\n */\r\nexport function persistentSignal<T>(\r\n initialValue: T,\r\n options: PersistentSignalOptions<T> & { nonNullable: true },\r\n): WritablePersistentSignalNonNullable<T>;\r\nexport function persistentSignal<T>(\r\n initialValue: T | null,\r\n options: PersistentSignalOptions<T>,\r\n): WritablePersistentSignal<T>;\r\nexport function persistentSignal<T>(\r\n initialValue: T | null,\r\n options: PersistentSignalOptions<T>,\r\n): WritablePersistentSignal<T> | WritablePersistentSignalNonNullable<T> {\r\n if (!!options.serialize !== !!options.deserialize) {\r\n throw new Error(\r\n 'DKT-FT3000: Both serialize and deserialize must either be both defined or both undefined.',\r\n );\r\n }\r\n\r\n const isNonNullable = options.nonNullable === true;\r\n if (isNonNullable && isNull(initialValue)) {\r\n throw new Error(\r\n 'DKT-FT3002: Non-nullable persistent signals require a non-null initial value.',\r\n );\r\n }\r\n\r\n if (\r\n !isSerializableSignal(options) &&\r\n !isAnyString(initialValue) &&\r\n !isNull(initialValue)\r\n ) {\r\n throw new Error(\r\n 'DKT-FT3001: Non-string initial values are only allowed for serializable signals. Define serialization options.',\r\n );\r\n }\r\n\r\n const internalSignal = signal<T | null>(initialValue);\r\n\r\n const _asReadonly = internalSignal.asReadonly;\r\n\r\n if (isNonNullable) {\r\n const nonNullableSignal =\r\n internalSignal as WritablePersistentSignalNonNullable<T>;\r\n Object.assign(nonNullableSignal, {\r\n method: options.method,\r\n key: getKey(options),\r\n serialized: computed(() => serializeValue(nonNullableSignal(), options)),\r\n });\r\n\r\n _assignPersistentSignalListeners(nonNullableSignal, options);\r\n\r\n nonNullableSignal.asReadonly = () => {\r\n const readonlySignal = _asReadonly() as PersistentSignalNonNullable<T>;\r\n\r\n (readonlySignal as any).method = nonNullableSignal.method;\r\n (readonlySignal as any).key = nonNullableSignal.key;\r\n (readonlySignal as any).serialized = nonNullableSignal.serialized;\r\n\r\n return readonlySignal;\r\n };\r\n\r\n return nonNullableSignal;\r\n }\r\n\r\n const nullableSignal = internalSignal as WritablePersistentSignal<T>;\r\n Object.assign(nullableSignal, {\r\n method: options.method,\r\n key: getKey(options),\r\n serialized: computed(() => serializeValue(nullableSignal(), options)),\r\n clear: () => nullableSignal.set(null),\r\n });\r\n\r\n _assignPersistentSignalListeners(nullableSignal, options);\r\n\r\n nullableSignal.asReadonly = () => {\r\n const readonlySignal = _asReadonly() as PersistentSignal<T>;\r\n\r\n (readonlySignal as any).method = nullableSignal.method;\r\n (readonlySignal as any).key = nullableSignal.key;\r\n (readonlySignal as any).serialized = nullableSignal.serialized;\r\n\r\n return readonlySignal;\r\n };\r\n\r\n return nullableSignal;\r\n}\r\n\r\nfunction _assignPersistentSignalListeners<\r\n T,\r\n S extends\r\n | WritablePersistentSignal<T>\r\n | WritablePersistentSignalNonNullable<T>,\r\n>(signal: S, options: PersistentSignalOptions<T>): void {\r\n const storedValue = loadFromStorage<T>(options);\r\n\r\n if (storedValue !== null) {\r\n signal.set(storedValue);\r\n } else {\r\n updateStorage(options, signal());\r\n }\r\n\r\n const injector = inject(Injector);\r\n\r\n runInInjectionContext(injector, () => {\r\n effect(() => {\r\n const value = signal();\r\n updateStorage(options, value);\r\n });\r\n });\r\n}\r\n\r\nfunction loadFromStorage<T>(options: PersistentSignalOptions<T>): T | null {\r\n let storedValue: string | null = null;\r\n\r\n if (options.method === PersistentStorageMethod.LocalStorage) {\r\n storedValue = localStorage.getItem(getKey(options));\r\n } else if (options.method === PersistentStorageMethod.SessionStorage) {\r\n storedValue = sessionStorage.getItem(getKey(options));\r\n } else if (options.method === PersistentStorageMethod.Cookies) {\r\n const match = document.cookie.match(\r\n '(^|;)\\\\s*' + getKey(options) + '\\\\s*=\\\\s*([^;]+)',\r\n );\r\n storedValue = match ? decodeURIComponent(match[2]) : null;\r\n }\r\n return deserializeValue(storedValue, options);\r\n}\r\n\r\nfunction updateStorage<T>(\r\n options: PersistentSignalOptions<T>,\r\n value: T | null,\r\n): void {\r\n const serializedValue = serializeValue(value, options);\r\n\r\n if (options.method === PersistentStorageMethod.LocalStorage) {\r\n if (serializedValue === null) localStorage.removeItem(getKey(options));\r\n else localStorage.setItem(getKey(options), serializedValue);\r\n } else if (options.method === PersistentStorageMethod.SessionStorage) {\r\n if (serializedValue === null) sessionStorage.removeItem(getKey(options));\r\n else sessionStorage.setItem(getKey(options), serializedValue);\r\n } else if (options.method === PersistentStorageMethod.Cookies) {\r\n let cookieString = `${getKey(options)}=${serializedValue !== null ? encodeURIComponent(serializedValue) : ''}`;\r\n\r\n if (serializedValue !== null) {\r\n cookieString += `; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\r\n } else if (options.expires) {\r\n const expires =\r\n options.expires instanceof Date\r\n ? options.expires.toUTCString()\r\n : options.expires;\r\n cookieString += `; expires=${expires}`;\r\n }\r\n\r\n if (options.maxAge) {\r\n cookieString += `; max-age=${options.maxAge}`;\r\n }\r\n\r\n cookieString += `; path=${options.path ?? '/'}`;\r\n\r\n document.cookie = cookieString;\r\n }\r\n}\r\n\r\nfunction getKey<T>(options: PersistentSignalOptions<T>): string {\r\n return 'key' in options ? options.key : options.name;\r\n}\r\n\r\nfunction serializeValue<T>(\r\n value: T | null,\r\n options: PersistentSignalOptions<T>,\r\n): string | null {\r\n if (isSerializableSignal(options)) {\r\n return options.serialize(value);\r\n }\r\n return value === null ? null : (value as unknown as string);\r\n}\r\n\r\nfunction deserializeValue<T>(\r\n value: string | null,\r\n options: PersistentSignalOptions<T>,\r\n): T | null {\r\n if (value !== null && isSerializableSignal(options)) {\r\n return options.deserialize(value);\r\n }\r\n return value as unknown as T | null;\r\n}\r\n","import {\r\n computed,\r\n DestroyRef,\r\n effect,\r\n inject,\r\n Injector,\r\n runInInjectionContext,\r\n Signal,\r\n signal,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\nimport { filter } from 'rxjs';\r\nimport { isAnyString, isNull } from 'simple-bool';\r\n\r\nexport interface QueryParamSignalNonNullable<T> extends Signal<T> {\r\n readonly paramName: string;\r\n readonly serialized: Signal<string | null>;\r\n}\r\n\r\nexport interface QueryParamSignal<T>\r\n extends QueryParamSignalNonNullable<T | null> {}\r\n\r\nexport interface WritableQueryParamSignalNonNullable<T>\r\n extends WritableSignal<T>,\r\n QueryParamSignalNonNullable<T> {\r\n asReadonly(): QueryParamSignalNonNullable<T>;\r\n}\r\n\r\nexport interface WritableQueryParamSignal<T>\r\n extends WritableQueryParamSignalNonNullable<T | null>,\r\n QueryParamSignal<T> {\r\n clear(): void;\r\n asReadonly(): QueryParamSignal<T>;\r\n}\r\n\r\nexport interface QueryParamSignalOptions<T> {\r\n paramName: string;\r\n serialize?: (value: T | null) => string | null;\r\n deserialize?: (value: string) => T | null;\r\n nonNullable?: boolean;\r\n}\r\n\r\nfunction isSerializableSignal<T>(\r\n options: QueryParamSignalOptions<T>,\r\n): options is QueryParamSignalOptions<T> &\r\n Required<Pick<QueryParamSignalOptions<T>, 'serialize' | 'deserialize'>> {\r\n return !!options.serialize && !!options.deserialize;\r\n}\r\n\r\n/**\r\n * Creates a `WritableSignal` that persists its value in a URL query parameter with both serialization and deserialization.\r\n *\r\n * @param initialValue - The initial value of the signal if no value is found in the query param.\r\n * @param options - An object containing the query parameter name, and custom serialization/deserialization functions.\r\n * @param options.paramName - The name of the query parameter used to store the signal value.\r\n * @param options.serialize - A function to serialize the value into a string for the query parameter.\r\n * @param options.deserialize - A function to deserialize the value from a string back to the original type.\r\n * @param options.nonNullable - If true, returns a non-nullable signal interface.\r\n * @returns A `WritableSignal<T | null>` that persists its value using the specified query parameter.\r\n */\r\nexport function queryParamSignal<T>(\r\n initialValue: T,\r\n options: QueryParamSignalOptions<T> & { nonNullable: true },\r\n): WritableQueryParamSignalNonNullable<T>;\r\nexport function queryParamSignal<T>(\r\n initialValue: T | null,\r\n optionsOrParam: string | QueryParamSignalOptions<T>,\r\n): WritableQueryParamSignal<T>;\r\nexport function queryParamSignal<T>(\r\n initialValue: T | null,\r\n optionsOrParam: string | QueryParamSignalOptions<T>,\r\n): WritableQueryParamSignal<T> | WritableQueryParamSignalNonNullable<T> {\r\n let options: QueryParamSignalOptions<T>;\r\n\r\n if (typeof optionsOrParam === 'string') {\r\n options = { paramName: optionsOrParam };\r\n } else {\r\n options = optionsOrParam;\r\n }\r\n\r\n if (!!options.serialize !== !!options.deserialize) {\r\n throw new Error(\r\n 'DKT-FT3010: Both serialize and deserialize must either be both defined or both undefined.',\r\n );\r\n }\r\n\r\n const isNonNullable = options.nonNullable === true;\r\n if (isNonNullable && isNull(initialValue)) {\r\n throw new Error(\r\n 'DKT-FT3012: Non-nullable query param signals require a non-null initial value.',\r\n );\r\n }\r\n\r\n if (\r\n !isSerializableSignal(options) &&\r\n !isAnyString(initialValue) &&\r\n !isNull(initialValue)\r\n ) {\r\n throw new Error(\r\n 'DKT-FT3011: Non-string initial values are only allowed for serializable signals. Define serialization options.',\r\n );\r\n }\r\n\r\n const internalSignal = signal<T | null>(initialValue);\r\n\r\n const _asReadonly = internalSignal.asReadonly;\r\n\r\n if (isNonNullable) {\r\n const nonNullableSignal =\r\n internalSignal as WritableQueryParamSignalNonNullable<T>;\r\n Object.assign(nonNullableSignal, {\r\n paramName: options.paramName,\r\n serialized: computed(() => serializeValue(nonNullableSignal(), options)),\r\n });\r\n\r\n _assignQueryParamListeners(nonNullableSignal, initialValue, options);\r\n\r\n nonNullableSignal.asReadonly = () => {\r\n const readonlySignal = _asReadonly() as QueryParamSignalNonNullable<T>;\r\n\r\n (readonlySignal as any).serialized = nonNullableSignal.serialized;\r\n\r\n return readonlySignal;\r\n };\r\n\r\n return nonNullableSignal;\r\n }\r\n\r\n const nullableSignal = internalSignal as WritableQueryParamSignal<T>;\r\n Object.assign(nullableSignal, {\r\n paramName: options.paramName,\r\n serialized: computed(() => serializeValue(nullableSignal(), options)),\r\n clear: () => nullableSignal.set(null),\r\n });\r\n\r\n _assignQueryParamListeners(nullableSignal, initialValue, options);\r\n\r\n nullableSignal.asReadonly = () => {\r\n const readonlySignal = _asReadonly() as QueryParamSignal<T>;\r\n\r\n (readonlySignal as any).serialized = nullableSignal.serialized;\r\n\r\n return readonlySignal;\r\n };\r\n\r\n return nullableSignal;\r\n}\r\n\r\nfunction _assignQueryParamListeners<\r\n T,\r\n S extends\r\n | WritableQueryParamSignal<T>\r\n | WritableQueryParamSignalNonNullable<T>,\r\n>(\r\n signal: S,\r\n initialValue: T | null,\r\n options: QueryParamSignalOptions<T>,\r\n): void {\r\n const router = inject(Router);\r\n const storedValue = loadFromQueryParam(router, options);\r\n const destroyRef = inject(DestroyRef);\r\n const injector = inject(Injector);\r\n let isApplyingRouterValue = false;\r\n\r\n if (storedValue !== null) {\r\n signal.set(storedValue);\r\n } else {\r\n updateQueryParam(router, options, signal());\r\n }\r\n\r\n setTimeout(() => {\r\n updateQueryParam(router, options, signal());\r\n }, 0);\r\n\r\n router.events\r\n .pipe(\r\n filter((event): event is NavigationEnd => event instanceof NavigationEnd),\r\n takeUntilDestroyed(destroyRef),\r\n )\r\n .subscribe(() => {\r\n const nextValue = loadFromQueryParam(router, options);\r\n const writableSignal = signal as WritableSignal<T | null>;\r\n if (options.nonNullable === true && nextValue === null) {\r\n writableSignal.set(initialValue);\r\n return;\r\n }\r\n\r\n const currentSerialized = serializeValue(writableSignal(), options);\r\n const nextSerialized = serializeValue(nextValue, options);\r\n if (currentSerialized === nextSerialized) {\r\n return;\r\n }\r\n\r\n isApplyingRouterValue = true;\r\n writableSignal.set(nextValue);\r\n isApplyingRouterValue = false;\r\n });\r\n\r\n runInInjectionContext(injector, () => {\r\n effect(() => {\r\n if (isApplyingRouterValue) {\r\n return;\r\n }\r\n updateQueryParam(router, options, signal());\r\n });\r\n });\r\n}\r\n\r\nfunction loadFromQueryParam<T>(\r\n router: Router,\r\n options: QueryParamSignalOptions<T>,\r\n): T | null {\r\n const urlTree = router.parseUrl(router.url);\r\n const queryParamValue = urlTree.queryParams[options.paramName];\r\n const storedValue =\r\n queryParamValue === undefined || queryParamValue === null\r\n ? null\r\n : String(queryParamValue);\r\n\r\n return deserializeValue(storedValue, options);\r\n}\r\n\r\nfunction updateQueryParam<T>(\r\n router: Router,\r\n options: QueryParamSignalOptions<T>,\r\n value: T | null,\r\n): void {\r\n const serializedValue = serializeValue(value, options);\r\n const urlTree = router.parseUrl(router.url);\r\n const currentParam =\r\n urlTree.queryParams[options.paramName] == null\r\n ? null\r\n : String(urlTree.queryParams[options.paramName]);\r\n\r\n if (currentParam === serializedValue) {\r\n return;\r\n }\r\n\r\n const queryParams = {\r\n ...urlTree.queryParams,\r\n [options.paramName]: serializedValue,\r\n };\r\n\r\n router.navigate([], {\r\n queryParams,\r\n queryParamsHandling: 'merge',\r\n replaceUrl: true,\r\n });\r\n}\r\n\r\nfunction serializeValue<T>(\r\n value: T | null,\r\n options: QueryParamSignalOptions<T>,\r\n): string | null {\r\n if (isSerializableSignal(options)) {\r\n return options.serialize(value);\r\n }\r\n return value === null ? null : (value as unknown as string);\r\n}\r\n\r\nfunction deserializeValue<T>(\r\n value: string | null,\r\n options: QueryParamSignalOptions<T>,\r\n): T | null {\r\n if (value !== null && isSerializableSignal(options)) {\r\n return options.deserialize(value);\r\n }\r\n return value as unknown as T | null;\r\n}\r\n","import { computed, Signal, signal, WritableSignal } from '@angular/core';\r\n\r\n/**\r\n * A read-only queue signal, providing non-mutating helpers and computed properties.\r\n * @template T The type of elements held in the queue.\r\n */\r\nexport interface QueueSignal<T> extends Signal<T[]> {\r\n /**\r\n * A signal that returns `true` if the queue is empty.\r\n */\r\n readonly isEmpty: Signal<boolean>;\r\n /**\r\n * A signal that returns the current number of items in the queue.\r\n */\r\n readonly size: Signal<number>;\r\n /**\r\n * A signal that returns the front (first) item of the queue, or `undefined` if the queue is empty. Does not remove it.\r\n */\r\n readonly front: Signal<T | undefined>;\r\n /**\r\n * A signal that returns a shallow copy of the queue as an array.\r\n */\r\n readonly asArray: Signal<T[]>;\r\n /**\r\n * Returns the front item in the queue, or `undefined` if the queue is empty. Does not remove it.\r\n * @returns The front item or `undefined`.\r\n */\r\n peek(): T | undefined;\r\n}\r\n\r\n/**\r\n * A writable queue signal, providing mutating and non-mutating helpers.\r\n * @template T The type of elements held in the queue.\r\n */\r\nexport interface WritableQueueSignal<T>\r\n extends WritableSignal<T[]>,\r\n QueueSignal<T> {\r\n /**\r\n * Returns a read-only version of the queue signal.\r\n * @returns A read-only {@link QueueSignal} instance.\r\n */\r\n asReadonly(): QueueSignal<T>;\r\n /**\r\n * Adds one or more items to the end of the queue.\r\n * @param items - The elements to enqueue.\r\n */\r\n enqueue(...items: T[]): void;\r\n /**\r\n * Removes and returns the front item of the queue. If the queue is empty, returns `undefined`.\r\n * @returns The dequeued item, or `undefined` if the queue was empty.\r\n */\r\n dequeue(): T | undefined;\r\n /**\r\n * Clears all items from the queue.\r\n */\r\n clear(): void;\r\n /**\r\n * Replaces the queue with a new array of items.\r\n * @param value - The new array to set as the queue.\r\n */\r\n set(value: T[]): void;\r\n /**\r\n * Updates the queue using the provided update function.\r\n * @param updateFn - Function that receives the current queue and returns a new queue.\r\n */\r\n update(updateFn: (current: T[]) => T[]): void;\r\n}\r\n\r\n/**\r\n * Creates a writable queue signal, which is a reactive queue data structure.\r\n *\r\n * @template T The type of elements held in the queue.\r\n * @param {T[]} [initialValue=[]] Optional initial items in the queue.\r\n * @returns {WritableQueueSignal<T>} The writable queue signal instance.\r\n *\r\n * @example\r\n * const queue = queueSignal<number>([1, 2, 3]);\r\n * queue.enqueue(4); // new value: [1, 2, 3, 4]\r\n * const value = queue.dequeue(); // 1 new value: [2, 3, 4]\r\n * queue.clear(); // new value: []\r\n */\r\nexport function queueSignal<T>(initialValue: T[] = []): WritableQueueSignal<T> {\r\n const internalSignal = signal<T[]>([\r\n ...initialValue,\r\n ]) as unknown as WritableQueueSignal<T>;\r\n\r\n const _set = (internalSignal as unknown as WritableSignal<T[]>).set;\r\n const _update = internalSignal.update;\r\n const _asReadonly = internalSignal.asReadonly;\r\n\r\n // Native methods\r\n internalSignal.set = (arr: T[]) => _set([...arr]);\r\n internalSignal.update = (updateFn: (current: T[]) => T[]) => {\r\n _update((current) => [...updateFn(current)]);\r\n };\r\n\r\n // Queue methods\r\n internalSignal.enqueue = (...items: T[]) => {\r\n internalSignal.update((queue) => [...queue, ...items]);\r\n };\r\n\r\n internalSignal.dequeue = (): T | undefined => {\r\n let dequeued: T | undefined = undefined;\r\n internalSignal.update((queue) => {\r\n if (queue.length === 0) return queue;\r\n const copy = [...queue];\r\n dequeued = copy.shift();\r\n return copy;\r\n });\r\n return dequeued;\r\n };\r\n\r\n internalSignal.clear = () => {\r\n internalSignal.set([]);\r\n };\r\n\r\n (internalSignal.isEmpty as any) = computed(\r\n () => internalSignal().length === 0,\r\n );\r\n\r\n (internalSignal.size as any) = computed(() => internalSignal().length);\r\n\r\n (internalSignal.front as any) = computed(() => {\r\n const queue = internalSignal();\r\n return queue.length ? queue[0] : undefined;\r\n });\r\n\r\n (internalSignal.asArray as any) = computed(() => [...internalSignal()]);\r\n\r\n internalSignal.peek = () => {\r\n const queue = internalSignal();\r\n return queue.length ? queue[0] : undefined;\r\n };\r\n\r\n internalSignal.asReadonly = () => {\r\n const readonlySignal = _asReadonly() as QueueSignal<T>;\r\n (readonlySignal.isEmpty as any) = internalSignal.isEmpty;\r\n (readonlySignal.size as any) = internalSignal.size;\r\n (readonlySignal.front as any) = internalSignal.front;\r\n (readonlySignal.asArray as any) = internalSignal.asArray;\r\n readonlySignal.peek = internalSignal.peek;\r\n return readonlySignal;\r\n };\r\n\r\n return internalSignal;\r\n}\r\n","import { computed, signal, Signal, WritableSignal } from '@angular/core';\r\n\r\n/**\r\n * A read-only set signal with non-mutating methods.\r\n */\r\nexport interface SetSignal<T> extends Signal<Set<T>> {\r\n /**\r\n * Computed signal that returns `true` if the set is empty.\r\n */\r\n readonly isEmpty: Signal<boolean>;\r\n /**\r\n * Computed signal for set size.\r\n */\r\n readonly size: Signal<number>;\r\n\r\n /**\r\n * Checks if a value exists in the set.\r\n */\r\n has(value: T): boolean;\r\n\r\n /**\r\n * Computed signal that returns a new array from the set.\r\n */\r\n readonly asArray: Signal<T[]>;\r\n}\r\n\r\n/**\r\n * A writable set signal with mutating and non-mutating methods.\r\n */\r\nexport interface WritableSetSignal<T> extends WritableSignal<Set<T>>, SetSignal<T> {\r\n /**\r\n * Returns a read-only version of the set signal.\r\n */\r\n asReadonly(): SetSignal<T>;\r\n\r\n /**\r\n * Adds a value to the set.\r\n */\r\n add(value: T): void;\r\n\r\n /**\r\n * Deletes a value from the set.\r\n * Returns true if a value was removed.\r\n */\r\n delete(value: T): boolean;\r\n\r\n /**\r\n * Clears the set.\r\n */\r\n clear(): void;\r\n\r\n /**\r\n * Replaces the set with a new set.\r\n */\r\n set(value: Set<T>): void;\r\n\r\n /**\r\n * Updates the set using an update function.\r\n */\r\n update(updateFn: (current: Set<T>) => Set<T>): void;\r\n}\r\n\r\n/**\r\n * Creates a writable, reactive Set signal with convenient, immutable Set manipulation methods.\r\n *\r\n * This function returns a signal that wraps a JavaScript `Set` and exposes both non-mutating and mutating helpers,\r\n * ensuring that all operations are fully reactive and immutably safe. All mutator methods (`add`, `delete`, `clear`, etc.)\r\n * return a new Set value for robust signal reactivity.\r\n *\r\n * Also provides computed signals for queries such as `isEmpty`, `size`, and `asArray`, and offers a type-safe, read-only\r\n * view via `.asReadonly()`.\r\n *\r\n * @template T The type of items stored in the set.\r\n * @param {Iterable<T>} [initialValue=[]] Optional initial values for the set (can be another Set or any iterable).\r\n * @returns {WritableSetSignal<T>} A writable Set signal instance with both native and Set-specific helpers.\r\n *\r\n * @example\r\n * const ids = setSignal<number>([1, 2, 3]);\r\n * ids.add(4); // [1, 2, 3, 4]\r\n * ids.delete(2); // removes 2\r\n * ids.has(3); // true\r\n * ids.asArray(); // [1, 3, 4]\r\n * ids.clear(); // empty set\r\n * ids.isEmpty(); // true\r\n */\r\nexport function setSignal<T>(\r\n initialValue: Iterable<T> = [],\r\n): WritableSetSignal<T> {\r\n const internalSignal = signal<Set<T>>(\r\n new Set(initialValue),\r\n ) as WritableSetSignal<T>;\r\n\r\n const _set = internalSignal.set;\r\n const _update = internalSignal.update;\r\n const _asReadonly = internalSignal.asReadonly;\r\n\r\n // Native signal methods\r\n internalSignal.set = (value: Set<T>) => _set(new Set(value));\r\n internalSignal.update = (updateFn: (value: Set<T>) => Set<T>) => {\r\n _update((current) => new Set(updateFn(current)));\r\n };\r\n\r\n // Computed helpers\r\n (internalSignal.isEmpty as any) = computed(() => internalSignal().size === 0);\r\n (internalSignal.size as any) = computed(() => internalSignal().size);\r\n\r\n // Set methods\r\n internalSignal.add = (value: T) => {\r\n internalSignal.update((set) => {\r\n if (set.has(value)) return set;\r\n const copy = new Set(set);\r\n copy.add(value);\r\n return copy;\r\n });\r\n };\r\n\r\n internalSignal.delete = (value: T): boolean => {\r\n let deleted = false;\r\n internalSignal.update((set) => {\r\n if (!set.has(value)) return set;\r\n const copy = new Set(set);\r\n deleted = copy.delete(value);\r\n return copy;\r\n });\r\n return deleted;\r\n };\r\n\r\n internalSignal.clear = () => {\r\n internalSignal.set(new Set<T>());\r\n };\r\n\r\n internalSignal.has = (value: T): boolean => {\r\n return internalSignal().has(value);\r\n };\r\n\r\n (internalSignal.asArray as any) = computed(() =>\r\n Array.from(internalSignal()),\r\n );\r\n\r\n internalSignal.asReadonly = () => {\r\n const readonlySignal = _asReadonly() as SetSignal<T>;\r\n (readonlySignal.isEmpty as any) = internalSignal.isEmpty;\r\n (readonlySignal.size as any) = internalSignal.size;\r\n (readonlySignal.asArray as any) = internalSignal.asArray;\r\n return readonlySignal;\r\n };\r\n\r\n return internalSignal;\r\n}\r\n","import { computed, Signal, signal, WritableSignal } from '@angular/core';\r\n\r\n/**\r\n * A read-only stack signal, providing non-mutating helpers and computed properties.\r\n * @template T The type of elements held in the stack.\r\n */\r\nexport interface StackSignal<T> extends Signal<T[]> {\r\n /**\r\n * A signal that returns `true` if the stack is empty.\r\n */\r\n readonly isEmpty: Signal<boolean>;\r\n /**\r\n * A signal that returns the current number of items in the stack.\r\n */\r\n readonly size: Signal<number>;\r\n /**\r\n * A signal that returns the top (last) item of the stack, or `undefined` if the stack is empty. Does not remove it.\r\n */\r\n readonly top: Signal<T | undefined>;\r\n /**\r\n * A signal that returns a shallow copy of the stack as an array.\r\n */\r\n readonly asArray: Signal<T[]>;\r\n /**\r\n * Returns the top item in the stack, or `undefined` if the stack is empty. Does not remove it.\r\n * @returns The top item or `undefined`.\r\n */\r\n peek(): T | undefined;\r\n}\r\n\r\n/**\r\n * A writable stack signal, providing mutating and non-mutating helpers.\r\n * @template T The type of elements held in the stack.\r\n */\r\nexport interface WritableStackSignal<T>\r\n extends WritableSignal<T[]>,\r\n StackSignal<T> {\r\n /**\r\n * Returns a read-only version of the stack signal.\r\n * @returns A read-only {@link StackSignal} instance.\r\n */\r\n asReadonly(): StackSignal<T>;\r\n /**\r\n * Pushes one or more items onto the top of the stack.\r\n * @param items - The elements to push onto the stack.\r\n */\r\n push(...items: T[]): void;\r\n /**\r\n * Removes and returns the top item of the stack. If the stack is empty, returns `undefined`.\r\n * @returns The popped item, or `undefined` if the stack was empty.\r\n */\r\n pop(): T | undefined;\r\n /**\r\n * Clears all items from the stack.\r\n */\r\n clear(): void;\r\n /**\r\n * Replaces the stack with a new array of items.\r\n * @param value - The new array to set as the stack.\r\n */\r\n set(value: T[]): void;\r\n /**\r\n * Updates the stack using the provided update function.\r\n * @param updateFn - Function that receives the current stack and returns a new stack.\r\n */\r\n update(updateFn: (current: T[]) => T[]): void;\r\n}\r\n\r\n/**\r\n * Creates a writable stack signal, which is a reactive stack data structure.\r\n *\r\n * @template T The type of elements held in the stack.\r\n * @param {T[]} [initialValue=[]] Optional initial items in the stack.\r\n * @returns {WritableStackSignal<T>} The writable stack signal instance.\r\n *\r\n * @example\r\n * const stack = stackSignal<number>([1, 2, 3]);\r\n * stack.push(4); // [1, 2, 3, 4]\r\n * const value = stack.pop(); // 4 [1, 2, 3]\r\n * stack.clear(); // []\r\n */\r\nexport function stackSignal<T>(initialValue: T[] = []): WritableStackSignal<T> {\r\n const internalSignal = signal<T[]>([\r\n ...initialValue,\r\n ]) as unknown as WritableStackSignal<T>;\r\n\r\n const _set = (internalSignal as unknown as WritableSignal<T[]>).set;\r\n const _update = internalSignal.update;\r\n const _asReadonly = internalSignal.asReadonly;\r\n\r\n // Native methods\r\n internalSignal.set = (arr: T[]) => _set([...arr]);\r\n internalSignal.update = (updateFn: (current: T[]) => T[]) => {\r\n _update((current) => [...updateFn(current)]);\r\n };\r\n\r\n // Stack methods\r\n internalSignal.push = (...items: T[]) => {\r\n internalSignal.update((stack) => [...stack, ...items]);\r\n };\r\n\r\n internalSignal.pop = (): T | undefined => {\r\n let popped: T | undefined = undefined;\r\n internalSignal.update((stack) => {\r\n if (stack.length === 0) return stack;\r\n const copy = [...stack];\r\n popped = copy.pop();\r\n return copy;\r\n });\r\n return popped;\r\n };\r\n\r\n internalSignal.clear = () => {\r\n internalSignal.set([]);\r\n };\r\n\r\n (internalSignal.isEmpty as any) = computed(\r\n () => internalSignal().length === 0,\r\n );\r\n\r\n (internalSignal.size as any) = computed(() => internalSignal().length);\r\n\r\n (internalSignal.top as any) = computed(() => {\r\n const stack = internalSignal();\r\n return stack.length ? stack[stack.length - 1] : undefined;\r\n });\r\n\r\n (internalSignal.asArray as any) = computed(() => [...internalSignal()]);\r\n\r\n internalSignal.peek = () => {\r\n const stack = internalSignal();\r\n return stack.length ? stack[stack.length - 1] : undefined;\r\n };\r\n\r\n internalSignal.asReadonly = () => {\r\n const readonlySignal = _asReadonly() as StackSignal<T>;\r\n (readonlySignal.isEmpty as any) = internalSignal.isEmpty;\r\n (readonlySignal.size as any) = internalSignal.size;\r\n (readonlySignal.top as any) = internalSignal.top;\r\n (readonlySignal.asArray as any) = internalSignal.asArray;\r\n readonlySignal.peek = internalSignal.peek;\r\n return readonlySignal;\r\n };\r\n\r\n return internalSignal;\r\n}\r\n","import { signal, WritableSignal } from '@angular/core';\r\n\r\n/**\r\n * A ThrottledSignal interface that extends WritableSignal<T> and includes throttling behavior.\r\n */\r\nexport interface ThrottledSignal<T> extends WritableSignal<T> {\r\n readonly throttleTime: number;\r\n}\r\n\r\n/**\r\n * Creates a `WritableSignal` that limits how often its value can be updated, using the throttle time specified.\r\n *\r\n * @param initialValue - The initial value of the signal.\r\n * @param throttleTime - The minimum delay in milliseconds between signal updates.\r\n * @returns A `WritableSignal<T>` that throttles value updates based on the specified throttle time.\r\n */\r\nexport function throttledSignal<T>(\r\n initialValue: T,\r\n throttleTime: number,\r\n): ThrottledSignal<T> {\r\n const internalSignal = signal<T>(initialValue) as ThrottledSignal<T>;\r\n Object.assign(internalSignal, { throttleTime });\r\n\r\n let lastUpdate = 0;\r\n let queuedValue: T | undefined = undefined;\r\n let timeoutId: any = null;\r\n\r\n const originalSet = internalSignal.set;\r\n\r\n const setThrottledValue = (value: T) => {\r\n const now = Date.now();\r\n const timeSinceLastUpdate = now - lastUpdate;\r\n\r\n // If the new value is different and enough time has passed, set it immediately\r\n if (timeSinceLastUpdate >= throttleTime && internalSignal() !== value) {\r\n lastUpdate = now;\r\n originalSet(value);\r\n\r\n queuedValue = undefined;\r\n if (timeoutId) {\r\n clearTimeout(timeoutId);\r\n timeoutId = null;\r\n }\r\n } else {\r\n if (queuedValue === undefined) {\r\n queuedValue = value;\r\n timeoutId = setTimeout(() => {\r\n if (queuedValue !== null) {\r\n originalSet(queuedValue as T);\r\n lastUpdate = Date.now();\r\n queuedValue = undefined;\r\n timeoutId = null;\r\n }\r\n }, throttleTime - timeSinceLastUpdate);\r\n } else {\r\n queuedValue = value;\r\n }\r\n }\r\n };\r\n\r\n internalSignal.set = (value: T) => {\r\n setThrottledValue(value);\r\n };\r\n internalSignal.update = (fn: (v: T) => T) => {\r\n setThrottledValue(fn(internalSignal()));\r\n };\r\n\r\n return internalSignal;\r\n}\r\n","import { computed, Signal, signal, WritableSignal } from '@angular/core';\r\n\r\n/**\r\n * A read-only tuple signal.\r\n */\r\nexport interface TupleSignal<T extends readonly unknown[]> extends Signal<T> {\r\n /**\r\n * Computed signal that returns an array of tuple entries [index, value].\r\n */\r\n readonly entriesArray: Signal<{ [K in keyof T]: [K, T[K]] }[number][]>;\r\n /**\r\n * Returns the value at a given index.\r\n */\r\n getAt<I extends keyof T>(index: I): T[I];\r\n}\r\n\r\n/**\r\n * A writable tuple signal.\r\n */\r\nexport interface WritableTupleSignal<T extends readonly unknown[]>\r\n extends WritableSignal<T>,\r\n TupleSignal<T> {\r\n /**\r\n * Returns a read-only version of the tuple signal.\r\n */\r\n asReadonly(): TupleSignal<T>;\r\n /**\r\n * Sets the value at a given index.\r\n */\r\n setAt<I extends keyof T>(index: I, value: T[I]): void;\r\n /**\r\n * Updates the entire tuple with a function.\r\n */\r\n update(updateFn: (current: T) => T): void;\r\n /**\r\n * Updates the value at a given index with a function.\r\n */\r\n updateAt<I extends keyof T>(index: I, updateFn: (value: T[I]) => T[I]): void;\r\n}\r\n\r\n/**\r\n * Creates a writable, reactive tuple signal of **fixed length**, with tuple-specific and array-like helpers.\r\n *\r\n * This function returns a signal wrapping a tuple (fixed-length array), exposing safe, type-aware mutation and update helpers\r\n * as well as computed signals for common tuple queries.\r\n *\r\n * All mutating methods (`set`, `setAt`, `updateAt`, `update`) return a new tuple value,\r\n * preserving immutability and optimal signal reactivity.\r\n *\r\n * Also provides `.asReadonly()` for read-only consumption and computed signals for empty/entries.\r\n *\r\n * @template T The tuple type (e.g. `[number, string, boolean]`).\r\n * @param {T} initialValue The initial tuple value.\r\n * @returns {WritableTupleSignal<T>} A writable tuple signal with all mutation, query, and computed helpers.\r\n *\r\n * @example\r\n * const point = tupleSignal<[number, number]>([0, 1]);\r\n * point.setAt(1, 99); // [0, 99]\r\n * point.updateAt(0, x => x+10);// [10, 99]\r\n * point(); // [10, 99]\r\n * point.entriesArray(); // [[0, 10], [1, 99]]\r\n */\r\nexport function tupleSignal<T extends readonly unknown[]>(\r\n initialValue: T,\r\n): WritableTupleSignal<T> {\r\n // Clone initialValue for safety.\r\n const internalSignal = signal<T>([\r\n ...initialValue,\r\n ] as unknown as T) as WritableTupleSignal<T>;\r\n\r\n const _set = (internalSignal as unknown as WritableSignal<T>).set;\r\n const _update = internalSignal.update;\r\n const _asReadonly = internalSignal.asReadonly;\r\n\r\n internalSignal.set = (tuple: T) => _set([...tuple] as unknown as T);\r\n\r\n internalSignal.update = (updateFn: (current: T) => T) => {\r\n _update((current) => [...updateFn(current)] as unknown as T);\r\n };\r\n\r\n // Set by index (returns a new tuple).\r\n internalSignal.setAt = (index, value) => {\r\n internalSignal.update((current) => {\r\n const next = [...current] as unknown as T;\r\n (next[index as number] as any) = value;\r\n return next;\r\n });\r\n };\r\n\r\n // Update by index.\r\n internalSignal.updateAt = (index, updateFn) => {\r\n internalSignal.update((current) => {\r\n const next = [...current] as unknown as T;\r\n (next[index as number] as any) = updateFn(next[index as number] as any);\r\n return next;\r\n });\r\n };\r\n\r\n // Read-only API.\r\n internalSignal.asReadonly = () => {\r\n const readonlySignal = _asReadonly() as TupleSignal<T>;\r\n (readonlySignal as any).entriesArray = internalSignal.entriesArray;\r\n readonlySignal.getAt = internalSignal.getAt;\r\n return readonlySignal;\r\n };\r\n\r\n // Computed helpers.\r\n (internalSignal as any).entriesArray = computed(() => {\r\n const tuple = internalSignal();\r\n return tuple.map((value, index) => [index, value]) as {\r\n [K in keyof T]: [K, T[K]];\r\n }[number][];\r\n });\r\n\r\n internalSignal.getAt = <I extends keyof T>(index: I) =>\r\n internalSignal()[index as number] as T[I];\r\n\r\n return internalSignal;\r\n}\r\n","import { computed, inject, Injector, Signal } from '@angular/core';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport {\r\n AbstractControl,\r\n AsyncValidatorFn,\r\n ControlValueAccessor,\r\n FormControlStatus,\r\n isFormArray,\r\n isFormControl,\r\n isFormGroup,\r\n isFormRecord,\r\n NgControl,\r\n PristineChangeEvent,\r\n StatusChangeEvent,\r\n TouchedChangeEvent,\r\n ValidationErrors,\r\n ValidatorFn,\r\n ValueChangeEvent,\r\n} from '@angular/forms';\r\nimport {\r\n BehaviorSubject,\r\n isObservable,\r\n map,\r\n Observable,\r\n Subscription,\r\n} from 'rxjs';\r\nimport { isFunction } from 'simple-bool';\r\n\r\nexport interface FormControlTrackerOptions {\r\n injector?: Injector;\r\n}\r\nexport interface BoundControlTrackerOptions extends FormControlTrackerOptions {\r\n attachValueAccessor?: boolean;\r\n}\r\n\r\nexport interface TrackedFormControl<T> {\r\n readonly instance: AbstractControl<T>;\r\n readonly value$: Observable<T>;\r\n readonly value: Signal<T>;\r\n readonly errors$: Observable<ValidationErrors | null>;\r\n readonly errors: Signal<ValidationErrors | null>;\r\n readonly touched$: Observable<boolean>;\r\n readonly touched: Signal<boolean>;\r\n readonly untouched$: Observable<boolean>;\r\n readonly untouched: Signal<boolean>;\r\n readonly pristine$: Observable<boolean>;\r\n readonly pristine: Signal<boolean>;\r\n readonly dirty$: Observable<boolean>;\r\n readonly dirty: Signal<boolean>;\r\n readonly status$: Observable<FormControlStatus>;\r\n readonly status: Signal<FormControlStatus>;\r\n readonly valid$: Observable<boolean>;\r\n readonly valid: Signal<boolean>;\r\n readonly invalid$: Observable<boolean>;\r\n readonly invalid: Signal<boolean>;\r\n readonly pending$: Observable<boolean>;\r\n readonly pending: Signal<boolean>;\r\n readonly disabled$: Observable<boolean>;\r\n readonly disabled: Signal<boolean>;\r\n readonly enabled$: Observable<boolean>;\r\n readonly enabled: Signal<boolean>;\r\n readonly touchedHasErrors: Signal<boolean>;\r\n readonly validators$: Observable<ValidatorFn[] | null>;\r\n readonly validators: Signal<ValidatorFn[] | null>;\r\n readonly asyncValidators$: Observable<AsyncValidatorFn[] | null>;\r\n readonly asyncValidators: Signal<AsyncValidatorFn[] | null>;\r\n\r\n init(): void;\r\n destroy(): void;\r\n}\r\n\r\nclass FormControlTracker<T> {\r\n constructor(\r\n private readonly thisObjOrAbstractControl: any | AbstractControl,\r\n private readonly options: BoundControlTrackerOptions = {},\r\n ) {\r\n if (this._isAbstractControl(this.thisObjOrAbstractControl)) {\r\n this.init();\r\n }\r\n }\r\n\r\n private readonly _injector = this.options.injector ?? inject(Injector);\r\n\r\n /** The AbstractControl instance attached to the component instance. */\r\n public readonly instance!: AbstractControl<T>;\r\n\r\n private readonly _value$ = new BehaviorSubject<T>(undefined as T);\r\n public readonly value$ = this._value$.asObservable();\r\n public readonly value = toSignal(this._value$, {\r\n injector: this._injector,\r\n initialValue: undefined as T,\r\n });\r\n\r\n private readonly _errors$ = new BehaviorSubject<ValidationErrors | null>(\r\n null,\r\n );\r\n public readonly errors$ = this._errors$.asObservable();\r\n public readonly errors = toSignal(this._errors$, {\r\n injector: this._injector,\r\n initialValue: null,\r\n });\r\n\r\n private readonly _touched$ = new BehaviorSubject<boolean>(false);\r\n public readonly touched$ = this._touched$.asObservable();\r\n public readonly touched = toSignal(this._touched$, {\r\n injector: this._injector,\r\n initialValue: false,\r\n });\r\n public readonly untouched$ = this.touched$.pipe(map((v) => !v));\r\n public readonly untouched = toSignal(this.untouched$, {\r\n injector: this._injector,\r\n initialValue: true,\r\n });\r\n\r\n private readonly _pristine$ = new BehaviorSubject<boolean>(true);\r\n public readonly pristine$ = this._pristine$.asObservable();\r\n public readonly pristine = toSignal(this._pristine$, {\r\n injector: this._injector,\r\n initialValue: true,\r\n });\r\n public readonly dirty$ = this.pristine$.pipe(map((v) => !v));\r\n public readonly dirty = toSignal(this.dirty$, {\r\n injector: this._injector,\r\n initialValue: false,\r\n });\r\n\r\n private readonly _status$ = new BehaviorSubject<FormControlStatus>('VALID');\r\n public readonly status$ = this._status$.asObservable();\r\n public readonly status = toSignal(this._status$, {\r\n injector: this._injector,\r\n initialValue: 'VALID',\r\n });\r\n public readonly valid$ = this.status$.pipe(map((v) => v === 'VALID'));\r\n public readonly valid = toSignal(this.valid$, {\r\n injector: this._injector,\r\n initialValue: true,\r\n });\r\n public readonly invalid$ = this.status$.pipe(map((v) => v === 'INVALID'));\r\n public readonly invalid = toSignal(this.invalid$, {\r\n injector: this._injector,\r\n initialValue: false,\r\n });\r\n public readonly pending$ = this.status$.pipe(map((v) => v === 'PENDING'));\r\n public readonly pending = toSignal(this.pending$, {\r\n injector: this._injector,\r\n initialValue: false,\r\n });\r\n public readonly disabled$ = this.status$.pipe(map((v) => v === 'DISABLED'));\r\n public readonly disabled = toSignal(this.disabled$, {\r\n injector: this._injector,\r\n initialValue: false,\r\n });\r\n public readonly enabled$ = this.status$.pipe(map((v) => v !== 'DISABLED'));\r\n public readonly enabled = toSignal(this.enabled$, {\r\n injector: this._injector,\r\n initialValue: true,\r\n });\r\n\r\n public readonly touchedHasErrors = computed(\r\n () => !!this.errors() && this.touched(),\r\n );\r\n\r\n private readonly _validators$ = new BehaviorSubject<ValidatorFn[] | null>(\r\n null,\r\n );\r\n public readonly validators$ = this._validators$.asObservable();\r\n public readonly validators = toSignal(this._validators$, {\r\n injector: this._injector,\r\n initialValue: null,\r\n });\r\n\r\n private readonly _asyncValidators$ = new BehaviorSubject<\r\n AsyncValidatorFn[] | null\r\n >(null);\r\n public readonly asyncValidators$ = this._asyncValidators$.asObservable();\r\n public readonly asyncValidators = toSignal(this._asyncValidators$, {\r\n injector: this._injector,\r\n initialValue: null,\r\n });\r\n\r\n private _eventsSub?: Subscription;\r\n\r\n private _isAbstractControl(v: unknown): v is AbstractControl {\r\n return (\r\n isFormControl(v) ||\r\n isFormArray(v) ||\r\n isFormGroup(v) ||\r\n isFormRecord(v) ||\r\n (!!v && typeof v === 'object' && 'events' in v && isObservable(v.events))\r\n );\r\n }\r\n\r\n init() {\r\n if (this._isAbstractControl(this.thisObjOrAbstractControl)) {\r\n (this as any).instance = this.thisObjOrAbstractControl;\r\n } else {\r\n const ngControl = this._injector.get(NgControl, null);\r\n\r\n if (ngControl) {\r\n // if the valueAccessor was not yet set by Angular, we have to do it manually here\r\n if (this.options.attachValueAccessor ?? true) {\r\n if (\r\n !ngControl.valueAccessor ||\r\n (this.thisObjOrAbstractControl &&\r\n this.thisObjOrAbstractControl instanceof\r\n (ngControl.valueAccessor as any).constructor)\r\n ) {\r\n ngControl.valueAccessor = this\r\n .thisObjOrAbstractControl as unknown as ControlValueAccessor;\r\n }\r\n }\r\n // grab the AbstractControl instance\r\n const instance = ngControl.control;\r\n if (!instance) return;\r\n (this as any).instance = instance;\r\n }\r\n }\r\n\r\n if (this.instance) {\r\n const instance = this.instance;\r\n // listen to all data available in the events emitter\r\n this._eventsSub = instance.events.subscribe((event) => {\r\n if (event instanceof ValueChangeEvent) {\r\n this._value$.next(event.value);\r\n return;\r\n }\r\n if (event instanceof TouchedChangeEvent) {\r\n this._touched$.next(event.touched);\r\n return;\r\n }\r\n if (event instanceof PristineChangeEvent) {\r\n this._pristine$.next(event.pristine);\r\n return;\r\n }\r\n if (event instanceof StatusChangeEvent) {\r\n this._status$.next(event.status);\r\n this._errors$.next(event.source.errors);\r\n return;\r\n }\r\n });\r\n\r\n this._value$.next(instance.value);\r\n this._touched$.next(instance.touched);\r\n this._pristine$.next(instance.pristine);\r\n this._status$.next(instance.status);\r\n this._errors$.next(instance.errors);\r\n\r\n // do not read the next lines of code if you are easily frightened\r\n // I'm not proud of this part, but it had to be done. God please forgive me\r\n // I didn't find any other feasible way to detect when the control changes its validators\r\n // so it had to be hacked like this\r\n\r\n // override the \"setValidators\" function to capture the validators\r\n const oldSetValidators = instance.setValidators.bind(instance);\r\n instance.setValidators = (\r\n ...args: Parameters<typeof instance.setValidators>\r\n ) => {\r\n oldSetValidators(...args);\r\n\r\n const validators = (instance as any)._rawValidators as\r\n | ValidatorFn\r\n | ValidatorFn[]\r\n | null;\r\n this._validators$.next(\r\n isFunction(validators) ? [validators] : validators,\r\n );\r\n };\r\n // override the \"validator\" setter to capture the validators\r\n wrapSetter<AbstractControl<T>>(instance, 'validator', () => {\r\n const raw = (instance as any)._rawValidators as\r\n | ValidatorFn\r\n | ValidatorFn[]\r\n | null;\r\n this._validators$.next(isFunction(raw) ? [raw] : raw);\r\n });\r\n\r\n // override the \"setAsyncValidators\" function to capture the async validators\r\n const oldSetAsyncValidators = instance.setAsyncValidators.bind(instance);\r\n instance.setAsyncValidators = (\r\n ...args: Parameters<typeof instance.setAsyncValidators>\r\n ) => {\r\n oldSetAsyncValidators(...args);\r\n\r\n const validators = (instance as any)._rawAsyncValidators as\r\n | AsyncValidatorFn\r\n | AsyncValidatorFn[]\r\n | null;\r\n this._asyncValidators$.next(\r\n isFunction(validators) ? [validators] : validators,\r\n );\r\n };\r\n // override the \"asyncValidator\" setter to capture the async validators\r\n wrapSetter<AbstractControl<T>>(instance, 'asyncValidator', () => {\r\n const raw = (instance as any)._rawAsyncValidators as\r\n | AsyncValidatorFn\r\n | AsyncValidatorFn[]\r\n | null;\r\n this._asyncValidators$.next(isFunction(raw) ? [raw] : raw);\r\n });\r\n\r\n // assign the validators at init time\r\n const validators = (instance as any)._rawValidators as\r\n | ValidatorFn\r\n | ValidatorFn[]\r\n | null;\r\n this._validators$.next(\r\n isFunction(validators) ? [validators] : validators,\r\n );\r\n const asyncValidators = (instance as any)._rawAsyncValidators as\r\n | AsyncValidatorFn\r\n | AsyncValidatorFn[]\r\n | null;\r\n this._asyncValidators$.next(\r\n isFunction(asyncValidators) ? [asyncValidators] : asyncValidators,\r\n );\r\n }\r\n }\r\n\r\n destroy() {\r\n this._eventsSub?.unsubscribe();\r\n }\r\n}\r\n\r\n/**\r\n * Gives reactive access to the properties of the given form control.\r\n *\r\n * Call `destroy()` to dispose of form control tracker.\r\n *\r\n * @param formControl the form control to be tracked.\r\n * @param options optional configuration for the form control tracker.\r\n * @returns an object containing all standard form control getters as signals.\r\n * @example\r\n * ```\r\n * readonly ageControl = new FormControl('John');\r\n *\r\n * readonly ageControlTracker = trackFormControl(this.ageControl);\r\n * ```\r\n */\r\nexport function trackFormControl<T = any>(\r\n formControl: AbstractControl<T>,\r\n options?: FormControlTrackerOptions,\r\n): TrackedFormControl<T> {\r\n return new FormControlTracker<T>(formControl, {\r\n ...options,\r\n attachValueAccessor: false,\r\n });\r\n}\r\n\r\n/**\r\n * Gives reactive access to the properties of the Form Control assigned to the component instance.\r\n *\r\n * Call the `init()` method inside `ngOnInit()` to start listening to the Form Control, call `destroy()` to dispose of the listener.\r\n *\r\n * @param thisObj the component instance.\r\n * @param options optional configuration for the form control tracker.\r\n * @returns an object containing all standard form control getters as signals.\r\n * @example\r\n * ```\r\n * export class MyComponent implements ControlValueAccessor, OnInit, OnDestroy {\r\n * readonly control = trackFormControl(this);\r\n *\r\n * ngOnInit(): void {\r\n * this.control.init();\r\n * }\r\n * ngOnDestroy(): void {\r\n * this.control.destroy();\r\n * }\r\n * // control value accessor implementation ...\r\n * }\r\n * ```\r\n */\r\nexport function trackBoundControl<T = any>(\r\n thisObj: any,\r\n options?: BoundControlTrackerOptions,\r\n): TrackedFormControl<T> {\r\n return new FormControlTracker<T>(thisObj, options);\r\n}\r\n\r\n// --- helper: wraps an accessor setter on a single instance ---\r\nfunction wrapSetter<TObj extends object>(\r\n obj: TObj,\r\n propName: keyof TObj,\r\n after: () => void,\r\n) {\r\n // find the accessor descriptor up the prototype chain\r\n let proto: any = obj;\r\n let desc: PropertyDescriptor | undefined;\r\n\r\n while (proto && !(desc = Object.getOwnPropertyDescriptor(proto, propName))) {\r\n proto = Object.getPrototypeOf(proto);\r\n }\r\n\r\n if (!desc || typeof desc.set !== 'function') {\r\n throw new Error(`No setter found for ${String(propName)}`);\r\n }\r\n\r\n const originalSet = desc.set!;\r\n const originalGet = desc.get; // may exist\r\n\r\n Object.defineProperty(obj, propName, {\r\n configurable: true,\r\n enumerable: desc.enumerable ?? true,\r\n\r\n get: originalGet\r\n ? function (this: TObj) {\r\n return originalGet.call(this);\r\n }\r\n : undefined,\r\n\r\n set: function (this: TObj, value: unknown) {\r\n originalSet.call(this, value);\r\n after();\r\n },\r\n });\r\n}\r\n","/**\r\n * Type describing the allowed values for a number input\r\n */\r\nexport type ArrayLike = string | any[] | null | undefined;\r\n\r\n/**\r\n * Coerces a value to an array of trimmed non-empty strings.\r\n * Any input that is not an array, `null` or `undefined` will be turned into a string\r\n * using `String()` and split into an array with the given separator.\r\n * `null`, `undefined`, and `\"\"` will result in an empty array.\r\n * This results in the following outcomes:\r\n * - `null` -> `[]`\r\n * - `[null]` -> `[\"null\"]`\r\n * - `[\"a\", \"b \", \" \"]` -> `[\"a\", \"b\"]`\r\n * - `[1, [2, 3]]` -> `[\"1\", \"2,3\"]`\r\n * - `\"a,b , c\"` -> `[\"a\", \"b\", \"c\"]`\r\n *\r\n * Useful for defining CSS classes or table columns.\r\n * @param value the value to coerce into an array of strings\r\n * @param separator split-separator if value isn't an array. Defaults to the string `\",\"`.\r\n */\r\nexport function coerceArrayProperty(\r\n value: any,\r\n separator: string | RegExp = ',',\r\n): string[] {\r\n if (Array.isArray(value))\r\n return value.map((v) => String(v).trim()).filter((v) => v.length);\r\n\r\n if (value == null || value === '') return [];\r\n\r\n return String(value)\r\n .split(separator)\r\n .map((v) => v.trim())\r\n .filter((v) => v.length);\r\n}\r\n","import { isDefined } from 'simple-bool';\r\n\r\nexport function getUTCDate(): Date;\r\nexport function getUTCDate(year: number, monthIndex: number, day: number): Date;\r\nexport function getUTCDate(\r\n year: number,\r\n monthIndex: number,\r\n day: number,\r\n hour: number,\r\n minute: number,\r\n second: number,\r\n millisecond: number,\r\n): Date;\r\nexport function getUTCDate(\r\n year?: number,\r\n monthIndex?: number,\r\n day?: number,\r\n hour: number = 0,\r\n minute: number = 0,\r\n second: number = 0,\r\n millisecond: number = 0,\r\n): Date {\r\n if (!isDefined(year) && !isDefined(monthIndex) && !isDefined(day)) {\r\n const now = new Date();\r\n now.setMinutes(now.getMinutes() + now.getTimezoneOffset());\r\n return now;\r\n }\r\n return new Date(\r\n Date.UTC(year!, monthIndex, day, hour, minute, second, millisecond),\r\n );\r\n}\r\n\r\nexport function coerceDateProperty<T>(v: any, fallback: T): Date | T {\r\n if (typeof v == 'string') {\r\n if (v.toLowerCase() === 'now') {\r\n return new Date();\r\n }\r\n }\r\n v = new Date(v);\r\n if (isNaN(v.valueOf())) {\r\n return fallback;\r\n }\r\n return v;\r\n}\r\n\r\nexport function coerceDateOnlyProperty<T>(\r\n v: any,\r\n fallback: T,\r\n asUTC: boolean = false,\r\n): Date | T {\r\n if (typeof v == 'string') {\r\n if (v.toLowerCase() === 'now' || v.toLowerCase() === 'today') {\r\n const now = new Date();\r\n now.setMinutes(now.getMinutes() + now.getTimezoneOffset());\r\n return asUTC\r\n ? getUTCDate(\r\n now.getFullYear(),\r\n now.getMonth(),\r\n now.getDate(),\r\n now.getHours(),\r\n now.getMinutes(),\r\n now.getSeconds(),\r\n now.getMilliseconds(),\r\n )\r\n : now;\r\n }\r\n }\r\n const dateV = new Date(v);\r\n if (isNaN(dateV.valueOf())) {\r\n return fallback;\r\n }\r\n if (dateV.toISOString().substring(10) === 'T00:00:00.000Z') {\r\n if (asUTC) {\r\n return dateV;\r\n }\r\n return new Date(\r\n dateV.getUTCFullYear(),\r\n dateV.getUTCMonth(),\r\n dateV.getUTCDate(),\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n );\r\n }\r\n if (asUTC) {\r\n return getUTCDate(dateV.getFullYear(), dateV.getMonth(), dateV.getDate());\r\n }\r\n return new Date(\r\n dateV.getFullYear(),\r\n dateV.getMonth(),\r\n dateV.getDate(),\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n );\r\n}\r\n","import { ElementRef } from '@angular/core';\r\n\r\nexport function getDomContentRect(el: HTMLElement): DOMRect;\r\nexport function getDomContentRect(el: ElementRef<HTMLElement>): DOMRect;\r\nexport function getDomContentRect(\r\n el: HTMLElement | ElementRef<HTMLElement>,\r\n): DOMRect;\r\nexport function getDomContentRect(\r\n el: HTMLElement | ElementRef<HTMLElement>,\r\n): DOMRect {\r\n if (el instanceof ElementRef) el = el.nativeElement;\r\n\r\n const elRect = el.getBoundingClientRect();\r\n const [topPadd, rightPadd, bottomPadd, leftPadd] = getFourWayValue(\r\n el,\r\n 'padding',\r\n );\r\n const [topBorder, rightBorder, bottomBorder, leftBorder] = getFourWayValue(\r\n el,\r\n 'border-width',\r\n );\r\n\r\n return new DOMRect(\r\n elRect.x + leftPadd + leftBorder,\r\n elRect.y + topPadd + topBorder,\r\n elRect.width - leftPadd - rightPadd - leftBorder - rightBorder,\r\n elRect.height - topPadd - bottomPadd - topBorder - bottomBorder,\r\n );\r\n}\r\n\r\nexport function getDomPaddingRect(el: HTMLElement): DOMRect;\r\nexport function getDomPaddingRect(el: ElementRef<HTMLElement>): DOMRect;\r\nexport function getDomPaddingRect(\r\n el: HTMLElement | ElementRef<HTMLElement>,\r\n): DOMRect;\r\nexport function getDomPaddingRect(\r\n el: HTMLElement | ElementRef<HTMLElement>,\r\n): DOMRect {\r\n if (el instanceof ElementRef) el = el.nativeElement;\r\n\r\n const elRect = el.getBoundingClientRect();\r\n const [topBorder, rightBorder, bottomBorder, leftBorder] = getFourWayValue(\r\n el,\r\n 'border-width',\r\n );\r\n\r\n return new DOMRect(\r\n elRect.x + leftBorder,\r\n elRect.y + topBorder,\r\n elRect.width - leftBorder - rightBorder,\r\n elRect.height - topBorder - bottomBorder,\r\n );\r\n}\r\n\r\nfunction getFourWayValue(\r\n el: HTMLElement,\r\n v: string,\r\n): [number, number, number, number] {\r\n const elValues = window.getComputedStyle(el).getPropertyValue(v);\r\n const values = elValues.split(' ').map((v) => (v ? parseFloat(v) : null));\r\n const topValue = values[0] ?? 0;\r\n const rightValue = values[1] ?? topValue;\r\n const bottomValue = values[2] ?? topValue;\r\n const leftValue = values[3] ?? rightValue ?? topValue;\r\n\r\n return [topValue, rightValue, bottomValue, leftValue];\r\n}\r\n","import { diceCoefficient } from 'dice-coefficient';\r\n\r\nexport function findBestSuggestions<T extends string>(\r\n toMatch: string,\r\n suggestions: Readonly<T[]>,\r\n): T[];\r\nexport function findBestSuggestions<T extends Exclude<any, string>>(\r\n toMatch: string,\r\n suggestions: Readonly<T[]>,\r\n mapFn: (v: T) => string,\r\n): T[];\r\nexport function findBestSuggestions<T>(\r\n toMatch: string,\r\n suggestions: Readonly<T[]>,\r\n mapFn?: (v: T) => string,\r\n): T[] {\r\n //map non-string values to strings, if needed\r\n const suggestionStrings = suggestions.map((v) =>\r\n typeof v == 'string' ? v : mapFn!(v),\r\n );\r\n\r\n //* alternative method for single-char strings\r\n //the similarity algorithm always returns zero in this case\r\n if (toMatch.length == 1) {\r\n return (\r\n suggestionStrings\r\n //remember the original indexes\r\n .map((v, index) => ({ str: v, index }))\r\n //pick only the ones starting with the character to match\r\n .filter((v) => v.str.startsWith(toMatch))\r\n //map to string length and index\r\n .map((v) => ({ rating: v.str.length, index: v.index }))\r\n //sort by length, ascending\r\n .sort((a, b) => a.rating - b.rating)\r\n //map to original values\r\n .map((v) => suggestions[v.index])\r\n );\r\n }\r\n\r\n //* standard method\r\n return (\r\n suggestionStrings\r\n //map to ratings of similarity between the string and toMatch\r\n .map((v, index) => {\r\n //always include if starts with the value to match\r\n if (new RegExp(`^${toMatch}`, 'i').test(v))\r\n return { rating: 1_000 - v.length, index };\r\n\r\n //calculate conditional similarity\r\n const similarity = diceCoefficient(toMatch, v);\r\n const foundTerm = v.match(new RegExp(toMatch, 'ig'))?.[0];\r\n const foundIndex = foundTerm ? v.indexOf(foundTerm) : -1;\r\n const canBeFound = foundIndex != -1;\r\n const foundIndexModifier = canBeFound\r\n ? (Math.cos((foundIndex / 90) * Math.PI) + 1) ** 2 / 1.5\r\n : 1;\r\n const rating = similarity * foundIndexModifier;\r\n return {\r\n rating,\r\n index,\r\n };\r\n })\r\n //keep only ratings above or equal to 0.45\r\n .filter((v) => v.rating >= 0.45)\r\n //sort descending\r\n .sort((a, b) => b.rating - a.rating)\r\n //map to original values\r\n .map((v) => suggestions[v.index])\r\n );\r\n}\r\n\r\nexport function findBestAutocomplate(\r\n toMatch: string,\r\n autocompletes: string[],\r\n): string {\r\n const targetArray = autocompletes.filter((v) =>\r\n new RegExp(`^${toMatch}`, 'i').test(v),\r\n );\r\n\r\n let bestMatch: string = targetArray.shift()!;\r\n let bestScore: number = 0;\r\n for (const str of targetArray) {\r\n const score = diceCoefficient(toMatch, str);\r\n if (score > bestScore) {\r\n bestMatch = str;\r\n bestScore = score;\r\n }\r\n }\r\n return bestMatch;\r\n}\r\n","import { ElementRef } from '@angular/core';\r\n\r\nexport class EventRelativePos<T extends HTMLElement> {\r\n readonly overflowsTop!: boolean;\r\n readonly overflowsRight!: boolean;\r\n readonly overflowsBottom!: boolean;\r\n readonly overflowsLeft!: boolean;\r\n readonly overflows!: boolean;\r\n\r\n constructor(\r\n public readonly target: T,\r\n public readonly top: number,\r\n public readonly right: number,\r\n public readonly bottom: number,\r\n public readonly left: number,\r\n ) {\r\n this.overflowsTop = top < 0;\r\n this.overflowsRight = right < 0;\r\n this.overflowsBottom = bottom < 0;\r\n this.overflowsLeft = left < 0;\r\n this.overflows =\r\n this.overflowsTop ||\r\n this.overflowsRight ||\r\n this.overflowsBottom ||\r\n this.overflowsLeft;\r\n }\r\n\r\n valueOf() {\r\n return {\r\n top: this.top,\r\n right: this.right,\r\n bottom: this.bottom,\r\n left: this.left,\r\n };\r\n }\r\n toJSON(): string {\r\n return JSON.stringify(this.valueOf());\r\n }\r\n toString(): string {\r\n return this.toJSON();\r\n }\r\n\r\n static fromEvent<T extends HTMLElement>(\r\n event: MouseEvent | TouchEvent | Touch,\r\n el: T | ElementRef<T>,\r\n ): EventRelativePos<T> {\r\n return getEventRelativePos(event, el);\r\n }\r\n}\r\n\r\nfunction _isTouchEvent(v: any): v is TouchEvent {\r\n return typeof v === 'object' && 'touches' in v;\r\n}\r\n\r\nexport function getEventRelativePos<T extends HTMLElement>(\r\n event: MouseEvent | TouchEvent | Touch,\r\n el: T | ElementRef<T>,\r\n): EventRelativePos<T> {\r\n //convert ElementRef\r\n if (el instanceof ElementRef) el = el.nativeElement;\r\n\r\n //convert TouchEvent\r\n if (_isTouchEvent(event)) {\r\n const firstTouch = event.touches.item(0);\r\n if (!firstTouch)\r\n throw new Error(\r\n 'DKT-FT9000: Cannot read event position. The TouchEvent has no Touch instances.',\r\n );\r\n event = firstTouch;\r\n }\r\n\r\n //calculate\r\n const elRect = el.getBoundingClientRect();\r\n\r\n const eventX = event.clientX;\r\n const eventY = event.clientY;\r\n\r\n return new EventRelativePos<T>(\r\n el,\r\n eventY - elRect.top, //top\r\n elRect.right - eventX, //right\r\n elRect.bottom - eventY, //bottom\r\n eventX - elRect.left, //left\r\n );\r\n}\r\n","import {\r\n AbstractControl,\r\n ValidationErrors,\r\n ValidatorFn,\r\n Validators,\r\n} from '@angular/forms';\r\n\r\nconst ASCII_REGEX = /^[\\x00-\\x7F]*$/;\r\nconst BASE64_REGEX =\r\n /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/;\r\nconst HEX_REGEX = /^[0-9a-fA-F]+$/;\r\nconst OCTAL_REGEX = /^[0-7]+$/;\r\nconst BINARY_REGEX = /^[0-1]+$/;\r\nconst IPV4_REGEX =\r\n /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\r\nconst IPV6_REGEX =\r\n /^(([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4}|:))|(([0-9a-fA-F]{1,4}:){1,7}:)|(([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4})|(([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2})|(([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3})|(([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4})|(([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5})|([0-9a-fA-F]{1,4}:)((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])\\.){3}(25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])\\.){3}(25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])$/;\r\nconst UUID_REGEX =\r\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;\r\nconst HEX_COLOR_REGEX = /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;\r\nconst RGB_COLOR_REGEX =\r\n /^rgb\\(\\s*(0|255|25[0-4]|2[0-4][0-9]|1?[0-9]{1,2})\\s*,\\s*(0|255|25[0-4]|2[0-4][0-9]|1?[0-9]{1,2})\\s*,\\s*(0|255|25[0-4]|2[0-4][0-9]|1?[0-9]{1,2})\\s*\\)$/;\r\nconst HSL_COLOR_REGEX =\r\n /^hsl\\(\\s*(360|3[0-5][0-9]|[12]?[0-9]{1,2})\\s*,\\s*(100|[1-9]?[0-9])%\\s*,\\s*(100|[1-9]?[0-9])%\\s*\\)$/;\r\n\r\nexport class ExtValidators {\r\n /**\r\n * Validator that requires the control's value to contain a certain substring.\r\n *\r\n * @param seed The substring that the control's value should contain.\r\n * @returns A validator function that returns an error map with the `contains` property if the validation check fails, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('ng', ExtValidators.contains('angular'));\r\n * console.log(control.errors);\r\n * // { contains: { actualValue: 'ng', shouldContain: 'angular' } }\r\n *\r\n * const control = new FormControl('I love angular', ExtValidators.contains('angular'));\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static contains(seed: string): ValidatorFn {\r\n return (control) => {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n if (value.includes(seed)) {\r\n return null;\r\n }\r\n return { contains: { actualValue: value, shouldContain: seed } };\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to not contain a certain substring.\r\n *\r\n * @param seed The substring that the control's value should not contain.\r\n * @returns A validator function that returns an error map with the `notContains` property if the validation check fails, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('angular', ExtValidators.notContains('ng'));\r\n * console.log(control.errors);\r\n * // { notContains: { actualValue: 'angular', shouldNotContain: 'ng' } }\r\n *\r\n * const control = new FormControl('angular', ExtValidators.notContains('react'));\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static notContains(seed: string): ValidatorFn {\r\n return (control) => {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n if (!value.includes(seed)) {\r\n return null;\r\n }\r\n return { notContains: { actualValue: value, shouldNotContain: seed } };\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to be in lowercase.\r\n *\r\n * @returns An error map with the `lowercase` property if the validation check fails, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('Angular', ExtValidators.lowercase);\r\n * console.log(control.errors);\r\n * // { lowercase: { actualValue: 'Angular' } }\r\n *\r\n * const control = new FormControl('angular', ExtValidators.lowercase);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static lowercase(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n if (value === value.toLowerCase()) {\r\n return null;\r\n }\r\n return { lowercase: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to be in uppercase.\r\n *\r\n * @returns An error map with the `uppercase` property if the validation check fails, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('Angular', ExtValidators.uppercase);\r\n * console.log(control.errors);\r\n * // { uppercase: { actualValue: 'Angular' } }\r\n *\r\n * const control = new FormControl('ANGULAR', ExtValidators.uppercase);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static uppercase(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n if (value === value.toUpperCase()) {\r\n return null;\r\n }\r\n return { uppercase: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator that wraps the built-in `Validators.pattern` but allows specifying a custom error name instead of the default `pattern` key.\r\n *\r\n * @param name The error name to use when the validation fails.\r\n * @param pattern A string or RegExp to test the control's value against.\r\n * @returns A `ValidatorFn` that returns an error map with the given `name` when the value does not match the pattern.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('abc-123', ExtValidators.namedPattern('sku', /^[A-Z]{3}-\\d{3}$/));\r\n * console.log(control.errors);\r\n * // { sku: { actualValue: 'abc-123' } }\r\n *\r\n * const control = new FormControl('ABC-123', ExtValidators.namedPattern('sku', /^[A-Z]{3}-\\d{3}$/));\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static namedPattern(name: string, pattern: string | RegExp): ValidatorFn {\r\n const validator = Validators.pattern(pattern);\r\n return (control) => {\r\n const validationResult: ValidationErrors | null = validator(control);\r\n if (validationResult === null) {\r\n return null;\r\n }\r\n return {\r\n [name]: { actualValue: validationResult['pattern'].actualValue },\r\n };\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's numeric value to be divisible by the given divisor.\r\n *\r\n * - Accepts numbers or numeric strings (uses `parseFloat`).\r\n * - Does not validate `null`/`undefined` values to allow optional controls.\r\n * - If `divisor` is `null`/`undefined`/`0`, validation is skipped and `null` is returned.\r\n *\r\n * @param divisor The number the control's value must be divisible by.\r\n * @returns A validator function that returns `{ divisibleBy: { divisor, actual } }` when invalid, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('12', ExtValidators.divisibleBy(5));\r\n * console.log(control.errors);\r\n * // { divisibleBy: { divisor: 5, actual: '12' } }\r\n *\r\n * const control = new FormControl('15', ExtValidators.divisibleBy(5));\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static divisibleBy(divisor: number): ValidatorFn {\r\n return (control) => {\r\n if (control.value == null || divisor == null || divisor === 0) {\r\n return null; // don't validate empty values to allow optional controls\r\n }\r\n const value = parseFloat(control.value);\r\n // Controls with NaN values after parsing should be treated as not having a\r\n // divisor, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\r\n return !isNaN(value) && value % divisor !== 0\r\n ? { divisibleBy: { divisor: divisor, actual: control.value } }\r\n : null;\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to contain only ASCII characters.\r\n *\r\n * @param control The form control to validate.\r\n * @returns `null` when valid (or when value is not a string), otherwise `{ ascii: { actualValue } }`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('Zażółć', ExtValidators.ascii);\r\n * console.log(control.errors);\r\n * // { ascii: { actualValue: 'Zażółć' } }\r\n *\r\n * const control = new FormControl('Hello!', ExtValidators.ascii);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static ascii(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n return ASCII_REGEX.test(value) ? null : { ascii: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to be valid Base64 (RFC 4648-style alphabet).\r\n *\r\n * Notes:\r\n * - This checks *format* (characters + padding), not whether the decoded bytes are meaningful.\r\n * - Non-string / empty values are not validated to allow optional controls.\r\n *\r\n * @param control The form control to validate.\r\n * @returns `null` when valid (or when value is not a string), otherwise `{ base64: { actualValue } }`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('hello world', ExtValidators.base64);\r\n * console.log(control.errors);\r\n * // { base64: { actualValue: 'hello world' } }\r\n *\r\n * const control = new FormControl('aGVsbG8=', ExtValidators.base64);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static base64(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n return BASE64_REGEX.test(value) ? null : { base64: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to be a hexadecimal string.\r\n *\r\n * - Accepts upper and lower case characters.\r\n * - Does not allow `0x` prefix (pure hex digits only).\r\n *\r\n * @param control The form control to validate.\r\n * @returns `null` when valid (or when value is not a string), otherwise `{ hex: { actualValue } }`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('0xdeadbeef', ExtValidators.hex);\r\n * console.log(control.errors);\r\n * // { hex: { actualValue: '0xdeadbeef' } }\r\n *\r\n * const control = new FormControl('deadBEEF', ExtValidators.hex);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static hex(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n return HEX_REGEX.test(value) ? null : { hex: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to be an octal string (digits 0-7 only).\r\n *\r\n * @param control The form control to validate.\r\n * @returns `null` when valid (or when value is not a string), otherwise `{ octal: { actualValue } }`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('128', ExtValidators.octal);\r\n * console.log(control.errors);\r\n * // { octal: { actualValue: '128' } }\r\n *\r\n * const control = new FormControl('755', ExtValidators.octal);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static octal(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n return OCTAL_REGEX.test(value) ? null : { octal: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to be a binary string (digits 0-1 only).\r\n *\r\n * @param control The form control to validate.\r\n * @returns `null` when valid (or when value is not a string), otherwise `{ binary: { actualValue } }`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('10201', ExtValidators.binary);\r\n * console.log(control.errors);\r\n * // { binary: { actualValue: '10201' } }\r\n *\r\n * const control = new FormControl('101010', ExtValidators.binary);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static binary(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n return BINARY_REGEX.test(value) ? null : { binary: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to be a valid IP address.\r\n *\r\n * @param ipType The required IP version (`4` for IPv4, `6` for IPv6).\r\n * @returns A validator function that returns `{ ipAddress: { requiredType, actualValue } }` when invalid, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('999.1.2.3', ExtValidators.ipAddress(4));\r\n * console.log(control.errors);\r\n * // { ipAddress: { requiredType: 'IPv4', actualValue: '999.1.2.3' } }\r\n *\r\n * const control = new FormControl('127.0.0.1', ExtValidators.ipAddress(4));\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n *\r\n * ```ts\r\n * const control = new FormControl('not-an-ip', ExtValidators.ipAddress(6));\r\n * console.log(control.errors);\r\n * // { ipAddress: { requiredType: 'IPv6', actualValue: 'not-an-ip' } }\r\n *\r\n * const control = new FormControl('::1', ExtValidators.ipAddress(6));\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static ipAddress(ipType: 4 | 6 | 'any'): ValidatorFn {\r\n return (control) => {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n\r\n if (ipType === 6) {\r\n return IPV6_REGEX.test(value)\r\n ? null\r\n : {\r\n ipAddress: {\r\n requiredType: 6,\r\n actualValue: value,\r\n },\r\n };\r\n }\r\n if (ipType === 4) {\r\n return IPV4_REGEX.test(value)\r\n ? null\r\n : { ipAddress: { requiredType: 4, actualValue: value } };\r\n }\r\n return IPV4_REGEX.test(value) || IPV6_REGEX.test(value)\r\n ? null\r\n : {\r\n ipAddress: { requiredType: 'any', actualValue: value },\r\n };\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to be a UUID string.\r\n *\r\n * Notes:\r\n * - This validates the canonical 8-4-4-4-12 hex format.\r\n * - It does not enforce UUID version/variant bits (it accepts any hex in those positions).\r\n *\r\n * @param control The form control to validate.\r\n * @returns `null` when valid (or when value is not a string), otherwise `{ uuid: { actualValue } }`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('550e8400-e29b-41d4-a716-44665544ZZZZ', ExtValidators.uuid);\r\n * console.log(control.errors);\r\n * // { uuid: { actualValue: '550e8400-e29b-41d4-a716-44665544ZZZZ' } }\r\n *\r\n * const control = new FormControl('550e8400-e29b-41d4-a716-446655440000', ExtValidators.uuid);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static uuid(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n return UUID_REGEX.test(value) ? null : { uuid: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to be a hex color.\r\n *\r\n * Accepts:\r\n * - `#RGB` / `RGB`\r\n * - `#RRGGBB` / `RRGGBB`\r\n *\r\n * @param control The form control to validate.\r\n * @returns `null` when valid (or when value is not a string), otherwise `{ hexColor: { actualValue } }`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('#12FG00', ExtValidators.hexColor);\r\n * console.log(control.errors);\r\n * // { hexColor: { actualValue: '#12FG00' } }\r\n *\r\n * const control = new FormControl('#ff00aa', ExtValidators.hexColor);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static hexColor(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n return HEX_COLOR_REGEX.test(value)\r\n ? null\r\n : { hexColor: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to be an `rgb(r, g, b)` CSS color string.\r\n *\r\n * Constraints:\r\n * - `r`, `g`, `b` must be integers in the range 0..255\r\n * - Whitespace is allowed\r\n *\r\n * @param control The form control to validate.\r\n * @returns `null` when valid (or when value is not a string), otherwise `{ rgbColor: { actualValue } }`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('rgb(256, 0, 0)', ExtValidators.rgbColor);\r\n * console.log(control.errors);\r\n * // { rgbColor: { actualValue: 'rgb(256, 0, 0)' } }\r\n *\r\n * const control = new FormControl('rgb(255, 0, 128)', ExtValidators.rgbColor);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static rgbColor(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n return RGB_COLOR_REGEX.test(value)\r\n ? null\r\n : { rgbColor: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value to be an `hsl(h, s%, l%)` CSS color string.\r\n *\r\n * Constraints:\r\n * - `h` (hue) must be an integer in the range 0..360\r\n * - `s` and `l` must be percentages in the range 0..100\r\n * - Whitespace is allowed\r\n *\r\n * @param control The form control to validate.\r\n * @returns `null` when valid (or when value is not a string), otherwise `{ hslColor: { actualValue } }`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl('hsl(361, 50%, 40%)', ExtValidators.hslColor);\r\n * console.log(control.errors);\r\n * // { hslColor: { actualValue: 'hsl(361, 50%, 40%)' } }\r\n *\r\n * const control = new FormControl('hsl(210, 50%, 40%)', ExtValidators.hslColor);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static hslColor(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n return HSL_COLOR_REGEX.test(value)\r\n ? null\r\n : { hslColor: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator factory for password-like rules.\r\n *\r\n * You can combine any subset of rules. Only rules that are enabled will be validated.\r\n *\r\n * Returned error shape:\r\n * - `null` when valid\r\n * - `{ password: { ...details } }` when invalid, where `details` may include:\r\n * - `minLength` / `maxLength` objects with required/actual lengths\r\n * - boolean flags: `requireNumbers`, `requireUppercase`, `requireLowercase`, `requireSpecialCharacters`\r\n *\r\n * Notes:\r\n * - Special character set is: `[!@#$%^&*(),.?\":{}|<>]`\r\n * - Non-string / empty values are not validated to allow optional controls.\r\n *\r\n * @param rules Password rules configuration.\r\n * @returns A validator function that returns a `password` error map when validation fails, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * Negative example (produces an error and shows the nested details):\r\n *\r\n * ```ts\r\n * const control = new FormControl('password', ExtValidators.password({\r\n * minLength: 8,\r\n * requireNumbers: true,\r\n * requireUppercase: true,\r\n * requireSpecialCharacters: true,\r\n * }));\r\n *\r\n * console.log(control.errors);\r\n * // {\r\n * // password: {\r\n * // requireNumbers: true,\r\n * // requireUppercase: true,\r\n * // requireSpecialCharacters: true\r\n * // }\r\n * // }\r\n *\r\n * const control = new FormControl('P@ssw0rd!', ExtValidators.password({\r\n * minLength: 8,\r\n * requireNumbers: true,\r\n * requireUppercase: true,\r\n * requireSpecialCharacters: true,\r\n * }));\r\n *\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static password(rules: {\r\n minLength?: number;\r\n maxLength?: number;\r\n requireNumbers?: boolean;\r\n requireUppercase?: boolean;\r\n requireLowercase?: boolean;\r\n requireSpecialCharacters?: boolean;\r\n }): ValidatorFn {\r\n return (control) => {\r\n const value = control.value;\r\n if (typeof value !== 'string') {\r\n // don't validate empty values to allow optional controls\r\n // don't validate non-string values to avoid false positives\r\n return null;\r\n }\r\n const errors: any = {};\r\n if (rules.minLength != null && value.length < rules.minLength) {\r\n errors.minLength = {\r\n requiredLength: rules.minLength,\r\n actualLength: value.length,\r\n };\r\n }\r\n if (rules.maxLength != null && value.length > rules.maxLength) {\r\n errors.maxLength = {\r\n requiredLength: rules.maxLength,\r\n actualLength: value.length,\r\n };\r\n }\r\n if (rules.requireNumbers && !/\\d/.test(value)) {\r\n errors.requireNumbers = true;\r\n }\r\n if (rules.requireUppercase && !/[A-Z]/.test(value)) {\r\n errors.requireUppercase = true;\r\n }\r\n if (rules.requireLowercase && !/[a-z]/.test(value)) {\r\n errors.requireLowercase = true;\r\n }\r\n if (\r\n rules.requireSpecialCharacters &&\r\n !/[!@#$%^&*(),.?\":{}|<>]/.test(value)\r\n ) {\r\n errors.requireSpecialCharacters = true;\r\n }\r\n return Object.keys(errors).length > 0 ? { password: errors } : null;\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value (an array) to contain a specific element.\r\n *\r\n * Non-array values are ignored to avoid false positives.\r\n *\r\n * @param seed The element that must exist in the array (uses `Array.prototype.includes`).\r\n * @returns A validator function that returns `{ arrayContains: { actualValue, shouldContain } }` when invalid, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl(['a', 'b'], ExtValidators.arrayContains('c'));\r\n * console.log(control.errors);\r\n * // { arrayContains: { actualValue: ['a', 'b'], shouldContain: 'c' } }\r\n *\r\n * const control = new FormControl(['a', 'b', 'c'], ExtValidators.arrayContains('c'));\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static arrayContains(seed: any): ValidatorFn {\r\n return (control) => {\r\n const value = control.value;\r\n if (!Array.isArray(value)) {\r\n // don't validate non-array values to avoid false positives\r\n return null;\r\n }\r\n if (value.includes(seed)) {\r\n return null;\r\n }\r\n return { arrayContains: { actualValue: value, shouldContain: seed } };\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value (an array) to *not* contain a specific element.\r\n *\r\n * Non-array values are ignored to avoid false positives.\r\n *\r\n * @param seed The element that must not exist in the array (uses `Array.prototype.includes`).\r\n * @returns A validator function that returns `{ arrayNotContains: { actualValue, shouldNotContain } }` when invalid, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl(['a', 'b'], ExtValidators.arrayNotContains('b'));\r\n * console.log(control.errors);\r\n * // { arrayNotContains: { actualValue: ['a', 'b'], shouldNotContain: 'b' } }\r\n *\r\n * const control = new FormControl(['a', 'b'], ExtValidators.arrayNotContains('c'));\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static arrayNotContains(seed: any): ValidatorFn {\r\n return (control) => {\r\n const value = control.value;\r\n if (!Array.isArray(value)) {\r\n // don't validate non-array values to avoid false positives\r\n return null;\r\n }\r\n if (!value.includes(seed)) {\r\n return null;\r\n }\r\n return {\r\n arrayNotContains: { actualValue: value, shouldNotContain: seed },\r\n };\r\n };\r\n }\r\n\r\n /**\r\n * Validator that requires the control's value (an array) to contain only unique items.\r\n *\r\n * Uses a `Set` to compare uniqueness (`Set.size === array.length`).\r\n *\r\n * @param control The form control to validate.\r\n * @returns `null` when valid (or when value is not an array), otherwise `{ arrayUnique: { actualValue } }`.\r\n *\r\n * @example\r\n *\r\n * ```ts\r\n * const control = new FormControl([1, 1, 2], ExtValidators.arrayUnique);\r\n * console.log(control.errors);\r\n * // { arrayUnique: { actualValue: [1, 1, 2] } }\r\n *\r\n * const control = new FormControl([1, 2, 3], ExtValidators.arrayUnique);\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static arrayUnique(control: AbstractControl): ValidationErrors | null {\r\n const value = control.value;\r\n if (!Array.isArray(value)) {\r\n // don't validate non-array values to avoid false positives\r\n return null;\r\n }\r\n const uniqueValues = new Set(value);\r\n if (uniqueValues.size === value.length) {\r\n return null;\r\n }\r\n return { arrayUnique: { actualValue: value } };\r\n }\r\n\r\n /**\r\n * Validator factory that requires uploaded file(s) to be at most the given size.\r\n *\r\n * Supported control value shapes:\r\n * - a single `File`\r\n * - an array of files (typically `File[]`)\r\n *\r\n * Non-file values (or arrays with no `File` instances) are ignored to avoid false positives.\r\n *\r\n * Error shape:\r\n * - If a single `File` was provided: `{ fileMaxSize: { requiredMaxSize, actualSize } }`\r\n * - If an array was provided: `{ fileMaxSize: { requiredMaxSize, actualSizes } }` where `actualSizes` are the sizes of invalid files\r\n *\r\n * @param maxSizeInBytes Maximum allowed size in bytes.\r\n * @returns A validator function that returns a `fileMaxSize` error map when invalid, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * Negative example (single file; produces an error):\r\n *\r\n * ```ts\r\n * const big = new File([new Uint8Array(10)], 'big.txt'); // example only\r\n * Object.defineProperty(big, 'size', { value: 10_000_000 }); // force size for demo\r\n *\r\n * const control = new FormControl<File | null>(big, ExtValidators.fileMaxSize(1_000));\r\n * console.log(control.errors);\r\n * // { fileMaxSize: { requiredMaxSize: 1000, actualSize: 10000000 } }\r\n * ```\r\n *\r\n * Negative example (array; produces an error with `actualSizes`):\r\n *\r\n * ```ts\r\n * const f1 = new File([new Uint8Array(1)], 'a.txt');\r\n * const f2 = new File([new Uint8Array(1)], 'b.txt');\r\n * Object.defineProperty(f1, 'size', { value: 500 });\r\n * Object.defineProperty(f2, 'size', { value: 1500 });\r\n *\r\n * const control = new FormControl<File[]>([f1, f2], ExtValidators.fileMaxSize(1000));\r\n * console.log(control.errors);\r\n * // { fileMaxSize: { requiredMaxSize: 1000, actualSizes: [1500] } }\r\n *\r\n * const f = new File([new Uint8Array(1)], 'ok.txt');\r\n * Object.defineProperty(f, 'size', { value: 500 });\r\n *\r\n * const control = new FormControl<File | null>(f, ExtValidators.fileMaxSize(1000));\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static fileMaxSize(maxSizeInBytes: number): ValidatorFn {\r\n return (control) => {\r\n const value = control.value;\r\n if (value == null) {\r\n return null;\r\n }\r\n\r\n let isSingleFile = false;\r\n let files: any[] | null = null;\r\n if (value instanceof File) {\r\n files = [value];\r\n isSingleFile = true;\r\n } else if (Array.isArray(value)) {\r\n files = value;\r\n } else {\r\n // don't validate non-file/non-array values to avoid false positives\r\n return null;\r\n }\r\n\r\n const fileInstances = files.filter((f) => f instanceof File) as File[];\r\n if (fileInstances.length === 0) {\r\n return null;\r\n }\r\n\r\n const invalid = fileInstances.filter((f) => f.size > maxSizeInBytes);\r\n if (invalid.length === 0) {\r\n return null;\r\n }\r\n\r\n // preserve single-file shape when only one file was provided\r\n if (isSingleFile) {\r\n return {\r\n fileMaxSize: {\r\n requiredMaxSize: maxSizeInBytes,\r\n actualSize: fileInstances[0].size,\r\n },\r\n };\r\n }\r\n\r\n return {\r\n fileMaxSize: {\r\n requiredMaxSize: maxSizeInBytes,\r\n actualSizes: invalid.map((f) => f.size),\r\n },\r\n };\r\n };\r\n }\r\n\r\n /**\r\n * Validator factory that requires uploaded file(s) to be at least the given size.\r\n *\r\n * Supported control value shapes:\r\n * - a single `File`\r\n * - an array of files (typically `File[]`)\r\n *\r\n * Non-file values (or arrays with no `File` instances) are ignored to avoid false positives.\r\n *\r\n * Error shape:\r\n * - If a single `File` was provided: `{ fileMinSize: { requiredMinSize, actualSize } }`\r\n * - If an array was provided: `{ fileMinSize: { requiredMinSize, actualSizes } }` where `actualSizes` are the sizes of invalid files\r\n *\r\n * @param minSizeInBytes Minimum allowed size in bytes.\r\n * @returns A validator function that returns a `fileMinSize` error map when invalid, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * Negative example (single file; produces an error):\r\n *\r\n * ```ts\r\n * const tiny = new File([new Uint8Array(1)], 'tiny.txt');\r\n * Object.defineProperty(tiny, 'size', { value: 50 });\r\n *\r\n * const control = new FormControl<File | null>(tiny, ExtValidators.fileMinSize(100));\r\n * console.log(control.errors);\r\n * // { fileMinSize: { requiredMinSize: 100, actualSize: 50 } }\r\n * ```\r\n *\r\n * Negative example (array; produces an error with `actualSizes`):\r\n *\r\n * ```ts\r\n * const f1 = new File([new Uint8Array(1)], 'a.txt');\r\n * const f2 = new File([new Uint8Array(1)], 'b.txt');\r\n * Object.defineProperty(f1, 'size', { value: 50 });\r\n * Object.defineProperty(f2, 'size', { value: 200 });\r\n *\r\n * const control = new FormControl<File[]>([f1, f2], ExtValidators.fileMinSize(100));\r\n * console.log(control.errors);\r\n * // { fileMinSize: { requiredMinSize: 100, actualSizes: [50] } }\r\n *\r\n * const ok = new File([new Uint8Array(1)], 'ok.txt');\r\n * Object.defineProperty(ok, 'size', { value: 150 });\r\n *\r\n * const control = new FormControl<File | null>(ok, ExtValidators.fileMinSize(100));\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static fileMinSize(minSizeInBytes: number): ValidatorFn {\r\n return (control) => {\r\n const value = control.value;\r\n if (value == null) {\r\n return null;\r\n }\r\n\r\n let isSingleFile = false;\r\n let files: any[] | null = null;\r\n if (value instanceof File) {\r\n files = [value];\r\n isSingleFile = true;\r\n } else if (Array.isArray(value)) {\r\n files = value;\r\n } else {\r\n // don't validate non-file/non-array values to avoid false positives\r\n return null;\r\n }\r\n\r\n const fileInstances = files.filter((f) => f instanceof File) as File[];\r\n if (fileInstances.length === 0) {\r\n return null;\r\n }\r\n\r\n const invalid = fileInstances.filter((f) => f.size < minSizeInBytes);\r\n if (invalid.length === 0) {\r\n return null;\r\n }\r\n\r\n if (isSingleFile) {\r\n return {\r\n fileMinSize: {\r\n requiredMinSize: minSizeInBytes,\r\n actualSize: fileInstances[0].size,\r\n },\r\n };\r\n }\r\n\r\n return {\r\n fileMinSize: {\r\n requiredMinSize: minSizeInBytes,\r\n actualSizes: invalid.map((f) => f.size),\r\n },\r\n };\r\n };\r\n }\r\n\r\n /**\r\n * Validator factory that requires uploaded file(s) to have an allowed extension.\r\n *\r\n * Supported control value shapes:\r\n * - a single `File`\r\n * - an array of files (typically `File[]`)\r\n *\r\n * Notes:\r\n * - Extension is derived from the last `.` in the filename: `file.name.split('.').pop()`\r\n * - The extracted extension is lowercased before checking.\r\n * - `allowedExtensions` should be provided in lowercase to match the comparison.\r\n *\r\n * Error shape:\r\n * - If a single `File` was provided: `{ fileExtension: { allowedExtensions, actualExtension } }`\r\n * - If an array was provided: `{ fileExtension: { allowedExtensions, invalidFiles } }`\r\n *\r\n * @param allowedExtensions A list of allowed extensions (without dots), e.g. `['png', 'jpg', 'pdf']`.\r\n * @returns A validator function that returns a `fileExtension` error map when invalid, otherwise `null`.\r\n *\r\n * @example\r\n *\r\n * Negative example (single file; produces an error):\r\n *\r\n * ```ts\r\n * const file = new File([new Uint8Array(1)], 'report.exe');\r\n * const control = new FormControl<File | null>(file, ExtValidators.fileExtension(['pdf', 'docx']));\r\n * console.log(control.errors);\r\n * // { fileExtension: { allowedExtensions: ['pdf', 'docx'], actualExtension: 'exe' } }\r\n * ```\r\n *\r\n * Negative example (array; produces an error with invalid file names):\r\n *\r\n * ```ts\r\n * const a = new File([new Uint8Array(1)], 'a.png');\r\n * const b = new File([new Uint8Array(1)], 'b.exe');\r\n *\r\n * const control = new FormControl<File[]>([a, b], ExtValidators.fileExtension(['png', 'jpg']));\r\n * console.log(control.errors);\r\n * // { fileExtension: { allowedExtensions: ['png', 'jpg'], invalidFiles: ['b.exe'] } }\r\n *\r\n * const file = new File([new Uint8Array(1)], 'photo.jpg');\r\n * const control = new FormControl<File | null>(file, ExtValidators.fileExtension(['png', 'jpg']));\r\n * console.log(control.errors);\r\n * // null\r\n * ```\r\n */\r\n static fileExtension(allowedExtensions: string[]): ValidatorFn {\r\n return (control) => {\r\n const value = control.value;\r\n if (value == null) {\r\n return null;\r\n }\r\n\r\n let isSingleFile = false;\r\n let files: any[] | null = null;\r\n if (value instanceof File) {\r\n files = [value];\r\n isSingleFile = true;\r\n } else if (Array.isArray(value)) {\r\n files = value;\r\n } else {\r\n // don't validate non-file/non-array values to avoid false positives\r\n return null;\r\n }\r\n\r\n const fileInstances = files.filter((f) => f instanceof File) as File[];\r\n if (fileInstances.length === 0) {\r\n return null;\r\n }\r\n\r\n const invalidFiles = fileInstances.filter((f) => {\r\n const ext = f.name.split('.').pop()?.toLowerCase() || '';\r\n return !allowedExtensions.includes(ext);\r\n });\r\n\r\n if (invalidFiles.length === 0) {\r\n return null;\r\n }\r\n\r\n if (isSingleFile) {\r\n const fileExtension = fileInstances[0].name\r\n .split('.')\r\n .pop()\r\n ?.toLowerCase();\r\n return {\r\n fileExtension: {\r\n allowedExtensions: allowedExtensions,\r\n actualExtension: fileExtension,\r\n },\r\n };\r\n }\r\n\r\n return {\r\n fileExtension: {\r\n allowedExtensions: allowedExtensions,\r\n invalidFiles: invalidFiles.map((f) => f.name),\r\n },\r\n };\r\n };\r\n }\r\n}\r\n","/*\r\n * Public API Surface of devkit\r\n */\r\n\r\n//! feature group 0 - services\r\nexport * from './lib/file-system'; // 001\r\nexport * from './lib/http-service'; // 002\r\nexport * from './lib/keyboard'; // 003\r\nexport * from './lib/viewport-observer'; // 000\r\n\r\n//! feature group 1 - directives\r\nexport * from './lib/click-outside';\r\nexport * from './lib/escape-html';\r\nexport * from './lib/hold';\r\nexport * from './lib/infinite-scroll'; // 100\r\n\r\n//! feature group 2 - pipes\r\nexport * from './lib/file-pipes';\r\n\r\n//! feature group 3 - signals\r\nexport * from './lib/signals/array';\r\nexport * from './lib/signals/counter';\r\nexport * from './lib/signals/debounced';\r\nexport * from './lib/signals/map';\r\nexport * from './lib/signals/persistent'; // 300\r\nexport * from './lib/signals/query-param'; // 301\r\nexport * from './lib/signals/queue';\r\nexport * from './lib/signals/set';\r\nexport * from './lib/signals/stack';\r\nexport * from './lib/signals/throttled';\r\nexport * from './lib/signals/tuple';\r\n\r\n//! feature group 4 - forms\r\nexport * from './lib/forms';\r\n\r\n//! feature group 9 - other\r\nexport * from './lib/coercion';\r\nexport * from './lib/dom-boxes';\r\nexport * from './lib/find-functions';\r\nexport * from './lib/relative-pos'; // 900\r\nexport * from './lib/validators';\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["isSerializableSignal","serializeValue","deserializeValue"],"mappings":";;;;;;;;;;;;AAAA;;AAEG;AACU,MAAA,gBAAgB,GAAG;AAC9B;;;;AAIG;AACH,IAAA,gBAAgB,EAAE,kBAAkB;AACpC;;AAEG;AACH,IAAA,YAAY,EAAE,cAAc;;AAS9B;;AAEG;AACU,MAAA,wBAAwB,GAAG;AACtC;;AAEG;AACH,IAAA,OAAO,EAAE,SAAS;AAClB;;AAEG;AACH,IAAA,SAAS,EAAE,WAAW;AACtB;;AAEG;AACH,IAAA,SAAS,EAAE,WAAW;AACtB;;AAEG;AACH,IAAA,KAAK,EAAE,OAAO;AACd;;AAEG;AACH,IAAA,QAAQ,EAAE,UAAU;AACpB;;AAEG;AACH,IAAA,MAAM,EAAE,QAAQ;;;ACzClB,MAAM,oBAAoB,GAA0B;AAClD,IAAA,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,gBAAgB,CAAC,gBAAgB;C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