nhb-toolbox 4.10.83 → 4.10.85

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/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/string/basics.ts","../src/string/anagram.ts","../src/string/constants.ts","../src/string/convert.ts","../src/string/guards.ts","../src/string/utilities.ts","../src/guards/primitives.ts","../src/number/constants.ts","../src/number/helpers.ts","../src/number/basics.ts","../src/number/utilities.ts","../src/number/Currency.ts","../src/number/Unit.ts","../src/number/guards.ts","../src/number/percent.ts","../src/number/fibonacci.ts","../src/number/convert.ts","../src/number/prime.ts","../src/array/basics.ts","../src/guards/non-primitives.ts","../src/array/utils.ts","../src/array/sort.ts","../src/guards/specials.ts","../src/utils/index.ts","../src/number/range.ts","../src/colors/constants.ts","../src/colors/helpers.ts","../src/colors/initials.ts","../src/colors/utils.ts","../src/colors/convert.ts","../src/colors/random.ts","../src/colors/css-colors.ts","../src/colors/Color.ts","../src/date/guards.ts","../src/date/utils.ts","../src/date/greet.ts","../src/date/constants.ts","../src/date/Chronos.ts","../src/date/chronos-fn.ts","../src/array/Finder.ts","../src/array/transform.ts","../src/form/guards.ts","../src/form/convert.ts","../src/object/sanitize.ts","../src/object/objectify.ts","../src/dom/query.ts","../src/form/transform.ts","../src/object/basics.ts","../src/object/convert.ts","../src/dom/utils.ts","../src/dom/storage.ts","../src/utils/Paginator.ts"],"sourcesContent":["/**\n * Copyright 2025 Nazmul Hassan\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// ! String Utilities\nexport {\n\tcapitalizeString,\n\tgenerateRandomID,\n\ttrimString,\n\ttruncateString,\n} from './string/basics';\n\nexport { generateAnagrams } from './string/anagram';\n\nexport {\n\tisCamelCase,\n\tisEmojiOnly,\n\tisKebabCase,\n\tisPalindrome,\n\tisPascalCase,\n\tisSnakeCase,\n} from './string/guards';\n\nexport {\n\tconvertStringCase,\n\textractEmails,\n\textractURLs,\n\tformatUnitWithPlural as formatNumberWithPluralUnit,\n\tformatUnitWithPlural,\n\tformatUnitWithPlural as formatWithPlural,\n\tmaskString,\n\tnormalizeString,\n\treplaceAllInString,\n\treverseString,\n\tslugifyString,\n} from './string/convert';\n\nexport {\n\tcountWords,\n\tcountWords as countWordsInString,\n\textractNumbersFromString as extractNumbers,\n\textractNumbersFromString,\n\tgetLevenshteinDistance,\n\tgetLevenshteinDistance as levenshteinDistance,\n\textractNumbersFromString as parseNumbersFromText,\n\tcountWords as wordCount,\n} from './string/utilities';\n\n// ! Number Utilities\nexport {\n\tgetAverage as calculateAverage,\n\tcalculateHCF as calculateGCD,\n\tcalculateHCF,\n\tcalculateLCM as calculateLCD,\n\tcalculateLCM,\n\tconvertToDecimal,\n\tconvertToDecimal as convertToFixed,\n\tgetAverage,\n\tgetAverage as getAverageOfNumbers,\n\tgetRandomNumber as getRandomInt,\n\tgetRandomNumber,\n\tsumNumbers as getSumOfNumbers,\n\treverseNumber,\n\troundNumber,\n\troundNumber as roundToDecimal,\n\tsumDigits,\n\tsumNumbers,\n\tsumNumbers as sumOfNumbers,\n} from './number/basics';\n\nexport { Currency } from './number/Currency';\n\nexport { Unit, Unit as UnitConverter } from './number/Unit';\n\nexport { calculatePercentage } from './number/percent';\n\nexport {\n\tfibonacciGenerator,\n\tfibonacciGenerator as generateFibonacci,\n\tgetFibonacciSeries as getFibonacci,\n\tgetFibonacciSeries as getFibonacciNumbers,\n\tgetFibonacciSeries,\n\tgetFibonacciSeriesMemo,\n\tgetFibonacciSeriesMemo as getMemoizedFibonacci,\n\tgetFibonacciSeriesMemo as getMemoizedFibonacciSeries,\n\tgetNthFibonacci,\n} from './number/fibonacci';\n\nexport {\n\tareInvalidNumbers,\n\tareInvalidNumbers as areNumbersInvalid,\n\tisEven,\n\tisEven as isEvenNumber,\n\tisFibonacci,\n\tareInvalidNumbers as isInvalidNumber,\n\tisMultiple,\n\tareInvalidNumbers as isNumberInvalid,\n\tisOdd,\n\tisOdd as isOddNumber,\n\tisFibonacci as isParOfFibonacci,\n\tisFibonacci as isParOfFibonacciSeries,\n\tisPerfectSquare,\n} from './number/guards';\n\nexport {\n\tnumberToWords as convertNumberToWords,\n\tconvertToRomanNumerals,\n\tconvertToRomanNumerals as integerToRoman,\n\tconvertToRomanNumerals as numberToRoman,\n\tnumberToWords,\n\tconvertToRomanNumerals as numericToRoman,\n\tconvertToRomanNumerals as toRoman,\n\tconvertToRomanNumerals as toRomanNumeral,\n} from './number/convert';\n\nexport {\n\tfindPrimeNumbers,\n\tfindPrimeNumbers as getPrimeNumbers,\n\tisPrime,\n\tisPrime as isPrimeNumber,\n} from './number/prime';\n\nexport {\n\tgetOrdinal as cardinalToOrdinal,\n\tclampNumber,\n\tformatCurrency as convertNumberToCurrency,\n\tgetOrdinal as convertNumberToOrdinal,\n\tgetOrdinal as convertToOrdinal,\n\tformatCurrency,\n\tgetOrdinal,\n\tgetOrdinal as getOrdinalNumber,\n\tgetRandomFloat as getRandomDecimal,\n\tgetRandomFloat,\n\tgetOrdinal as numberToOrdinal,\n\troundToNearest as roundNumberToNearestInterval,\n\troundToNearest,\n\troundToNearest as roundToNearestInterval,\n} from './number/utilities';\n\nexport { getNumbersInRange } from './number/range';\n\n// ! Color Utilities\nexport { getColorForInitial } from './colors/initials';\n\nexport {\n\tgenerateRandomColorInHexRGB,\n\tgenerateRandomHSLColor,\n} from './colors/random';\n\nexport {\n\tconvertColorCode,\n\tconvertHex8ToHsla,\n\tconvertHex8ToRgba,\n\tconvertHexToHsl,\n\tconvertHexToRgb,\n\tconvertHslaToHex8,\n\tconvertHslaToRgba,\n\tconvertHslToHex,\n\tconvertHslToRgb,\n\tconvertRgbaToHex8,\n\tconvertRgbaToHsla,\n\tconvertRgbToHex,\n\tconvertRgbToHsl,\n\tconvertRgbToRgba,\n} from './colors/convert';\n\nexport { Color, Color as Colour } from './colors/Color';\n\nexport {\n\textractAlphaColorValues,\n\textractSolidColorValues,\n} from './colors/utils';\n\n// ! Date & Time Utilities\nexport {\n\tgetGreeting as generateGreeting,\n\tgetGreeting,\n\tgetGreeting as greet,\n} from './date/greet';\n\nexport {\n\tisDateLike,\n\tisLeapYear,\n\tisValidTime,\n\tisValidTime as isValidTimeString,\n\tisValidUTCOffSet as isValidUTC,\n\tisValidUTCOffSet,\n} from './date/guards';\n\nexport { Chronos, Chronos as Chronus } from './date/Chronos';\n\nexport {\n\tchronos,\n\tchronos as chronosjs,\n\tchronos as chronosts,\n\tchronos as chronus,\n\tchronos as chronusjs,\n\tchronos as chronusts,\n} from './date/chronos-fn';\n\nexport {\n\tformatUTCOffset as convertMinutesToUTCOffset,\n\textractHourMinute,\n\textractMinutesFromUTC,\n\textractTimeFromUTC,\n\textractTimeFromUTC as extractTimeStringFromUTC,\n\tgetTotalMinutes as extractTotalMinutesFromTime,\n\tformatUTCOffset,\n\tgetCurrentDateTime,\n\tgetCurrentDateTime as getCurrentTime,\n\textractMinutesFromUTC as getMinutesFromUTC,\n\textractTimeFromUTC as getTimeStringFromUTC,\n\tgetTotalMinutes,\n\tgetTotalMinutes as getTotalMinutesFromTime,\n\textractMinutesFromUTC as getTotalMinutesFromUTC,\n\tformatUTCOffset as minutesToUTCOffset,\n} from './date/utils';\n\n// ! Array Utilities\nexport {\n\tfilterArrayOfObjects,\n\tflattenArray,\n\tgetLastArrayElement,\n\tisInvalidOrEmptyArray,\n\tisInvalidOrEmptyArray as isValidEmptyArray,\n\tshuffleArray,\n} from './array/basics';\n\nexport { Finder } from './array/Finder';\n\nexport { sortAnArray } from './array/sort';\n\nexport {\n\tcreateOptionsArray,\n\tgetDuplicates as extractDuplicates,\n\tgetDuplicates as extractDuplicatesFromArray,\n\tfindMissingElements as extractMissingElements,\n\tfindMissingElements,\n\tgetDuplicates,\n\tgetDuplicates as getDuplicatesFromArray,\n\tfindMissingElements as getMissingElements,\n\tmoveArrayElement,\n\tremoveDuplicatesFromArray as removeDuplicates,\n\tremoveDuplicatesFromArray,\n\trotateArray,\n\tsplitArray,\n} from './array/transform';\n\nexport {\n\tnaturalSort as compareNaturally,\n\tnaturalSort as compareSorter,\n\tnaturalSort,\n\tnaturalSort as naturalSortForString,\n} from './array/utils';\n\n// ! Form Utilities\nexport {\n\tcreateControlledFormData as convertIntoFormData,\n\tcreateControlledFormData,\n\tcreateControlledFormData as createFormData,\n} from './form/convert';\n\nexport { parseFormData, serializeForm } from './form/transform';\n\nexport {\n\tisCustomFile,\n\tisCustomFileArray,\n\tisFileArray,\n\tisFileList,\n\tisFileOrBlob,\n\tisFileUpload,\n\tisOriginFileObj,\n\tisValidFormData,\n} from './form/guards';\n\n// ! Object Utilities\nexport { cloneObject, countObjectFields } from './object/basics';\n\nexport {\n\textractNewFields,\n\textractUpdatedAndNewFields,\n\textractUpdatedFields,\n\tflattenObjectDotNotation,\n\tflattenObjectKeyValue,\n\tmergeAndFlattenObjects,\n\tmergeObjects,\n\tparseJsonToObject,\n} from './object/objectify';\n\nexport {\n\tparseObjectValues,\n\tparseObjectValues as parseStringifiedObjectValues,\n\tsanitizeData,\n} from './object/sanitize';\n\nexport {\n\tconvertObjectValues,\n\tpickFields,\n\tpickObjectFieldsByCondition as pickFieldsByCondition,\n\tpickFields as pickObjectFields,\n\tpickObjectFieldsByCondition,\n\tremapFields,\n\tremapFields as remapObjectFields,\n} from './object/convert';\n\n// ! DOM Utilities\nexport {\n\tgenerateQueryParams as createQueryParams,\n\tgenerateQueryParams as formatQueryParams,\n\tgenerateQueryParams,\n\tgetQueryParams,\n\tparseQueryString as getQueryStringAsObject,\n\tparseQueryString,\n\tparseQueryString as queryStringToObject,\n\tupdateQueryParam,\n} from './dom/query';\n\nexport { copyToClipboard, smoothScrollTo, toggleFullScreen } from './dom/utils';\n\nexport {\n\tgetFromLocalStorage,\n\tgetFromSessionStorage,\n\tremoveFromLocalStorage,\n\tremoveFromSessionStorage,\n\tsaveToLocalStorage,\n\tsaveToSessionStorage,\n} from './dom/storage';\n\n// ! Other Utilities\nexport {\n\tconvertArrayToString,\n\tcountInstanceMethods,\n\tcountStaticMethods,\n\tdebounceAction,\n\tdeepParsePrimitives,\n\tgetClassDetails,\n\tgetInstanceMethodNames,\n\tcountInstanceMethods as getInstanceMethodsCount,\n\tgetStaticMethodNames,\n\tcountStaticMethods as getStaticMethodsCount,\n\tisDeepEqual,\n\tparseJSON,\n\tparseJSON as parseJsonDeep,\n\tdeepParsePrimitives as parsePrimitivesDeep,\n\tthrottleAction,\n} from './utils';\n\nexport { Paginator } from './utils/Paginator';\n\n// ! Primitive Type Guards\nexport {\n\tisBigInt,\n\tisBoolean,\n\tisFalsy,\n\tisInteger,\n\tisNonEmptyString,\n\tisNormalPrimitive,\n\tisNull,\n\tisNumber,\n\tisPositiveInteger,\n\tisPrimitive,\n\tisString,\n\tisSymbol,\n\tisTruthy,\n\tisUndefined,\n} from './guards/primitives';\n\n// ! Non-Primitive Type Guards\nexport {\n\tisReturningPromise as doesReturnPromise,\n\tisArray,\n\tisArrayOfType,\n\tisValidArray as isArrayWithLength,\n\tisDate,\n\tisEmptyObject,\n\tisEmptyObject as isEmptyObjectGuard,\n\tisError,\n\tisFunction,\n\tisJSON,\n\tisJSON as isJSONObject,\n\tisMap,\n\tisMethodDescriptor as isMethod,\n\tisMethodDescriptor,\n\tisNotEmptyObject,\n\tisObject,\n\tisEmptyObject as isObjectEmpty,\n\tisObjectWithKeys,\n\tisPromise,\n\tisRegExp,\n\tisRegExp as isRegularExpression,\n\tisReturningPromise,\n\tisSet,\n\tisValidArray,\n\tisJSON as isValidJSON,\n\tisMap as isValidMap,\n\tisNotEmptyObject as isValidObject,\n\tisSet as isValidSet,\n} from './guards/non-primitives';\n\n// ! Special Type Guards\nexport {\n\tisBase64,\n\tisBrowser,\n\tisDateString,\n\tisEmail,\n\tisEmailArray,\n\tisEnvironment,\n\tisEnvironment as isExpectedNodeENV,\n\tisIPAddress,\n\tisNode,\n\tisEnvironment as isNodeENV,\n\tisEnvironment as isNodeEnvironment,\n\tisNumericString,\n\tisPhoneNumber,\n\tisURL,\n\tisUUID,\n\tisEmail as isValidEmail,\n\tisURL as isValidURL,\n} from './guards/specials';\n\n// ! Export All types\nexport * from './array/types';\nexport * from './colors/types';\nexport * from './date/types';\nexport * from './form/types';\nexport * from './number/types';\nexport * from './object/types';\nexport * from './string/types';\nexport * from './types';\nexport * from './utils/types';\n","import type { CapitalizeOptions, RandomIdOptions } from './types';\n\n/**\n * * Utility to convert the first letter of any string to uppercase and the rest lowercase (unless specified).\n * * Handles surrounding symbols like quotes or parentheses.\n *\n * @param string String to be capitalized.\n * @param options Options to customize the capitalization.\n * @returns Capitalized string or fully uppercased string depending on `capitalizeAll` option.\n */\nexport function capitalizeString(\n\tstring: string,\n\toptions?: CapitalizeOptions,\n): string {\n\tif (typeof string !== 'string' || !string) return '';\n\n\tconst trimmedString = string.trim();\n\tif (!trimmedString) return '';\n\n\tconst {\n\t\tcapitalizeAll = false,\n\t\tcapitalizeEachFirst = false,\n\t\tlowerCaseRest = true,\n\t} = options || {};\n\n\tif (capitalizeAll) {\n\t\treturn trimmedString.toUpperCase();\n\t}\n\n\tif (capitalizeEachFirst) {\n\t\treturn trimmedString\n\t\t\t?.split(/\\s+/)\n\t\t\t?.map((word) => capitalizeString(word, { lowerCaseRest }))\n\t\t\t?.join(' ');\n\t}\n\n\tconst matchArray = trimmedString.match(/^(\\W*)(\\w)(.*)$/);\n\n\tif (matchArray && matchArray?.length === 4) {\n\t\tconst [_, leadingSymbols, firstLetter, rest] = matchArray;\n\t\treturn leadingSymbols\n\t\t\t.concat(firstLetter.toUpperCase())\n\t\t\t.concat(lowerCaseRest ? rest.toLowerCase() : rest);\n\t}\n\n\treturn trimmedString\n\t\t.charAt(0)\n\t\t.toUpperCase()\n\t\t.concat(\n\t\t\tlowerCaseRest ?\n\t\t\t\ttrimmedString.slice(1).toLowerCase()\n\t\t\t:\ttrimmedString.slice(1),\n\t\t);\n}\n\n/**\n * * Utility to truncate a string to a specified length.\n *\n * @param string The string to truncate.\n * @param maxLength The maximum length of the truncated string.\n * @returns Truncated string with ellipsis (`...`) (only if it has more length than `maxLength`).\n */\nexport const truncateString = (string: string, maxLength: number): string => {\n\tif (typeof string !== 'string' || !string) return '';\n\n\tconst trimmedString = string?.trim();\n\n\tif (!trimmedString) return '';\n\n\tif (trimmedString?.length <= maxLength) return trimmedString;\n\n\treturn trimmedString?.slice(0, maxLength)?.concat('...');\n};\n\n/**\n * * Generates a random alphanumeric (16 characters long, this length is customizable in the options) ID string composed of an optional `prefix`, `suffix`, a `timestamp`, `caseOption` and a customizable `separator`.\n *\n * @param options Configuration options for random ID generation.\n * @returns The generated ID string composed of the random alphanumeric string of specified length with optional `timeStamp`, `prefix`, and `suffix`, `caseOption` and `separator`.\n */\nexport const generateRandomID = (options?: RandomIdOptions): string => {\n\tconst {\n\t\tprefix = '',\n\t\tsuffix = '',\n\t\ttimeStamp = false,\n\t\tlength = 16,\n\t\tseparator = '',\n\t\tcaseOption = null,\n\t} = options || {};\n\n\t// generate timestamp\n\tconst date: number | string = timeStamp ? Date.now() : '';\n\n\t// Generate a random string of alphanumeric characters\n\tconst randomString: string = Array.from({ length }, () =>\n\t\tMath.random().toString(36).slice(2, 3),\n\t).join('');\n\n\tconst ID: string = [\n\t\tprefix && prefix.trim(),\n\t\tdate,\n\t\trandomString,\n\t\tsuffix && suffix.trim(),\n\t]\n\t\t?.filter(Boolean)\n\t\t?.join(separator);\n\n\tswitch (caseOption) {\n\t\tcase 'upper':\n\t\t\treturn ID.toUpperCase();\n\t\tcase 'lower':\n\t\t\treturn ID.toLowerCase();\n\t\tdefault:\n\t\t\treturn ID;\n\t}\n};\n\n/**\n * * Trims all the words in a string.\n *\n * @param input The string to trim.\n * @returns Trimmed string.\n */\nexport function trimString(input: string): string;\n\n/**\n * * Trims all the words in an array of strings.\n *\n * @param input The array of strings to trim.\n * @returns Trimmed array of strings.\n */\nexport function trimString(input: string[]): string[];\n\n/**\n * * Trims all the words in a string or an array of strings.\n *\n * @param input String or array of strings.\n * @returns Trimmed string or array of strings.\n */\nexport function trimString(input: string | string[]): string | string[] {\n\tif (!input) return '';\n\n\t// If the input is a string, trim each word\n\tif (typeof input === 'string' && !Array.isArray(input)) {\n\t\treturn input?.trim()?.replace(/\\s+/g, ' ');\n\t}\n\n\t// If the input is an array of strings, trim each string in the array\n\tif (Array.isArray(input)) {\n\t\treturn input?.map((str) =>\n\t\t\ttypeof str === 'string' ? str?.trim()?.replace(/\\s+/g, ' ') : str,\n\t\t);\n\t}\n\n\tthrow new Error('Invalid input type. Expected string or array of strings!');\n}\n","/**\n * * Utility to generate unique anagrams of a word.\n * @param word The word for generating anagrams.\n * @param limit The maximum number of anagrams to return ('all' for unlimited). Default is `100`.\n * @returns An array of generated anagrams. The first element is always the given word. Generated anagrams are always in lowercase.\n */\nexport function generateAnagrams(\n\tword: string,\n\tlimit: number | 'all' = 100,\n): Lowercase<string>[] {\n\tif (word?.length <= 1) {\n\t\treturn [word?.toLowerCase() as Lowercase<string>];\n\t}\n\n\tconst uniqueAnagrams = new Set<string>();\n\n\t/**\n\t * * Helper function to generate permutations.\n\t * @param str Current permutation being formed.\n\t * @param remaining Remaining characters to process.\n\t */\n\tconst _permute = (str: string, remaining: string) => {\n\t\tif (!remaining?.length) {\n\t\t\tuniqueAnagrams.add(str);\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let i = 0; i < remaining?.length; i++) {\n\t\t\tif (limit !== 'all' && uniqueAnagrams.size >= limit) return;\n\n\t\t\t_permute(\n\t\t\t\tstr + remaining[i],\n\t\t\t\tremaining?.slice(0, i) + remaining?.slice(i + 1),\n\t\t\t);\n\t\t}\n\t};\n\n\t_permute('', word.toLowerCase());\n\n\treturn Array.from(uniqueAnagrams) as Lowercase<string>[];\n}\n","export const LOWERCASE: string[] = [\n\t// Conjunctions\n\t'and',\n\t'but',\n\t'or',\n\t'nor',\n\t'for',\n\t'so',\n\t'yet',\n\t'after',\n\t'although',\n\t'as',\n\t'because',\n\t'before',\n\t'even',\n\t'if',\n\t'once',\n\t'since',\n\t'than',\n\t'that',\n\t'though',\n\t'unless',\n\t'until',\n\t'when',\n\t'whenever',\n\t'where',\n\t'whereas',\n\t'wherever',\n\t'whether',\n\t'while',\n\n\t// Prepositions\n\t'about',\n\t'above',\n\t'across',\n\t'after',\n\t'against',\n\t'along',\n\t'among',\n\t'around',\n\t'as',\n\t'at',\n\t'before',\n\t'behind',\n\t'below',\n\t'beneath',\n\t'beside',\n\t'between',\n\t'beyond',\n\t'but',\n\t'by',\n\t'concerning',\n\t'considering',\n\t'despite',\n\t'down',\n\t'during',\n\t'except',\n\t'following',\n\t'for',\n\t'from',\n\t'in',\n\t'inside',\n\t'into',\n\t'like',\n\t'minus',\n\t'near',\n\t'of',\n\t'off',\n\t'on',\n\t'onto',\n\t'opposite',\n\t'out',\n\t'outside',\n\t'over',\n\t'past',\n\t'per',\n\t'plus',\n\t'regarding',\n\t'round',\n\t'save',\n\t'since',\n\t'than',\n\t'through',\n\t'throughout',\n\t'till',\n\t'to',\n\t'toward',\n\t'towards',\n\t'under',\n\t'underneath',\n\t'unlike',\n\t'until',\n\t'up',\n\t'upon',\n\t'versus',\n\t'via',\n\t'with',\n\t'within',\n\t'without',\n\n\t// Articles\n\t'a',\n\t'an',\n\t'the',\n\n\t// Auxiliary Verbs\n\t'am',\n\t'are',\n\t'be',\n\t'been',\n\t'being',\n\t'can',\n\t'could',\n\t'do',\n\t'does',\n\t'did',\n\t'had',\n\t'has',\n\t'have',\n\t'is',\n\t'may',\n\t'might',\n\t'must',\n\t'shall',\n\t'should',\n\t'was',\n\t'were',\n\t'will',\n\t'would',\n] as const;\n","import { trimString } from './basics';\nimport { LOWERCASE } from './constants';\nimport type { CaseFormat, MaskOptions } from './types';\n\n/**\n * * Converts a string to a specified case format such as `camelCase`, `snake_case`, `kebab-case`, `PascalCase`, `Title Case`, `lowercase`, or `UPPERCASE`.\n *\n * - This function handles non-alphanumeric characters (e.g., spaces, hyphens, underscores, dots, slashes) as word delimiters. For `Title Case`, prepositions, articles, conjunctions, and auxiliary verbs are not capitalized unless they appear at the start of the title.\n * - You can also convert the string to `lowercase` or `UPPERCASE`, but it's recommended to use default string methods like `string.toLowerCase()` and `string.toUpperCase()` for these cases.\n *\n * @param string The input string to be converted. The string should have words separated by non-alphanumeric characters (e.g., spaces, hyphens, underscores, etc.).\n * @param format The format to convert the string to. The available formats are:\n * - `'camelCase'`: Converts to camelCase (e.g., `myVariableName`).\n * - `'snake_case'`: Converts to snake_case (e.g., `my_variable_name`).\n * - `'kebab-case'`: Converts to kebab-case (e.g., `my-variable-name`).\n * - `'PascalCase'`: Converts to PascalCase (e.g., `MyVariableName`).\n * - `'Title Case'`: Converts to Title Case (e.g., `My Variable Name`), where certain words like `prepositions, articles, conjunctions and auxiliary verbs` are not capitalized unless at the start.\n * - `'lowercase'`: Converts the string to all lowercase characters.\n * - `'UPPERCASE'`: Converts the string to all uppercase characters.\n * @returns The formatted string in the specified case format.\n * @example\n * convertStringCase('my-example_string', 'camelCase'); // returns 'myExampleString'\n * convertStringCase('my-example_string', 'snake_case'); // returns 'my_example_string'\n * convertStringCase('my-example_string', 'kebab-case'); // returns 'my-example-string'\n * convertStringCase('my example string', 'Title Case'); // returns 'My Example String'\n * convertStringCase('my example string', 'lowercase'); // returns 'my example string'\n * convertStringCase('my example string', 'UPPERCASE'); // returns 'MY EXAMPLE STRING'\n */\nexport function convertStringCase(string: string, format: CaseFormat): string {\n\tif (!string || typeof string !== 'string') return '';\n\n\tconst start = string?.match(/^[^\\d\\w\\s]+/)?.[0] || '';\n\tconst end = string?.match(/[^\\d\\w\\s]+$/)?.[0] || '';\n\tconst core = string?.replace(/^[^\\d\\w\\s]+|[^\\w\\s]+$/g, '').trim();\n\n\tconst titleCase = core\n\t\t?.split(/\\s+/g)\n\t\t?.map((part) => {\n\t\t\tconst startSymbol = part.match(/^[^\\d\\w\\s]+/)?.[0] || ''; // Capture leading symbols\n\t\t\tconst endSymbol = part.match(/[^\\d\\w\\s]+$/)?.[0] || ''; // Capture trailing symbols\n\t\t\tconst coreWord = part.replace(/^[^\\d\\w\\s]+|[^\\d\\w\\s]+$/g, ''); // Remove them for processing\n\n\t\t\tif (LOWERCASE.includes(coreWord?.toLowerCase())) {\n\t\t\t\treturn startSymbol + coreWord?.toLowerCase() + endSymbol;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\tstartSymbol +\n\t\t\t\tcoreWord?.charAt(0)?.toUpperCase() +\n\t\t\t\tcoreWord?.slice(1)?.toLowerCase() +\n\t\t\t\tendSymbol\n\t\t\t);\n\t\t})\n\t\t.join(' ');\n\n\tconst formattedString = string?.replace(\n\t\t/[^a-zA-Z0-9]+(.)?/g,\n\t\t(_, chr: string) => (chr ? chr?.toUpperCase() : ''),\n\t);\n\n\tif (!formattedString) return '';\n\n\tswitch (format) {\n\t\tcase 'camelCase':\n\t\t\t// return formattedString.replace(/[A-Z]/g, (letter, index) =>\n\t\t\t// \tindex === 0 ? letter.toUpperCase() : letter.toLowerCase(),\n\t\t\t// );\n\t\t\treturn (\n\t\t\t\tformattedString.charAt(0).toLowerCase() +\n\t\t\t\tformattedString.slice(1)\n\t\t\t);\n\n\t\tcase 'snake_case':\n\t\t\treturn /[^a-zA-Z0-9]/.test(string) ?\n\t\t\t\t\tstring.split(/\\W+/g).join('_').toLowerCase()\n\t\t\t\t:\tformattedString.replace(/[A-Z]/g, (letter, index) =>\n\t\t\t\t\t\tindex === 0 ?\n\t\t\t\t\t\t\tletter.toLowerCase()\n\t\t\t\t\t\t:\t`_${letter.toLowerCase()}`,\n\t\t\t\t\t);\n\n\t\tcase 'kebab-case':\n\t\t\treturn /[^a-zA-Z0-9]/.test(string) ?\n\t\t\t\t\tstring.split(/\\W+/g).join('-').toLowerCase()\n\t\t\t\t:\tformattedString.replace(/[A-Z]/g, (letter, index) =>\n\t\t\t\t\t\tindex === 0 ?\n\t\t\t\t\t\t\tletter.toLowerCase()\n\t\t\t\t\t\t:\t`-${letter.toLowerCase()}`,\n\t\t\t\t\t);\n\n\t\tcase 'PascalCase':\n\t\t\treturn (\n\t\t\t\tformattedString.charAt(0).toUpperCase() +\n\t\t\t\tformattedString.slice(1)\n\t\t\t);\n\n\t\tcase 'Title Case':\n\t\t\treturn (\n\t\t\t\tstart +\n\t\t\t\ttitleCase.charAt(0).toUpperCase() +\n\t\t\t\ttitleCase.slice(1) +\n\t\t\t\tend\n\t\t\t);\n\n\t\tcase 'lowercase':\n\t\t\treturn start + core.toLowerCase() + end;\n\n\t\tcase 'UPPERCASE':\n\t\t\treturn start + core.toUpperCase() + end;\n\n\t\tdefault:\n\t\t\treturn formattedString;\n\t}\n}\n\n/**\n * * Replaces all occurrences of a string or pattern in the given input string.\n *\n * - If `find` is a string, it is converted into a global regular expression (`/find/g`).\n * - If `find` is a `RegExp`, the global (`g`) flag is ensured.\n * - Trims the input before performing replacements.\n *\n * @param input - The string in which replacements should be performed.\n * @param find - The substring or regex pattern to search for.\n * @param replace - The string to replace matches with.\n * @returns The modified/refined string with replacements applied.\n */\nexport const replaceAllInString = (\n\tinput: string,\n\tfind: string | RegExp,\n\treplace: string,\n): string => {\n\tconst trimmedString = trimString(input);\n\n\tconst regex =\n\t\ttypeof find === 'string' ?\n\t\t\tnew RegExp(find, 'g')\n\t\t:\tnew RegExp(\n\t\t\t\tfind,\n\t\t\t\tfind?.flags.includes('g') ? find?.flags : find?.flags + 'g',\n\t\t\t);\n\n\treturn trimmedString?.replace(regex, replace);\n};\n\n/**\n * * Converts a string into a URL-friendly slug.\n * @param input - The string to be converted.\n * @returns The slugified string.\n */\nexport const slugifyString = (input: string): Lowercase<string> => {\n\treturn trimString(input)\n\t\t?.toLowerCase()\n\t\t?.replace(/[^a-z0-9]+/g, '-')\n\t\t?.replace(/^-+|-+$/g, '') as Lowercase<string>;\n};\n\n/**\n * * Masks part of a string for privacy.\n * @param input - The string to mask.\n * @param options - Options for masking a string.\n * @returns The masked string.\n */\nexport const maskString = (input: string, options?: MaskOptions): string => {\n\tconst { start = 1, end = 1, maskCharacter: maskChar = '*' } = options || {};\n\n\tconst trimmedString = trimString(input);\n\n\tif (trimmedString?.length <= start + end) {\n\t\treturn maskChar?.repeat(trimmedString?.length);\n\t}\n\n\treturn (\n\t\ttrimmedString.slice(0, start) +\n\t\tmaskChar?.repeat(trimmedString?.length - start - end) +\n\t\t(end > 0 ? trimmedString.slice(-end) : '')\n\t);\n};\n\n/**\n * * Reverses a given string.\n * @param input - The string to reverse.\n * @returns The reversed string.\n */\nexport const reverseString = (input: string): string => {\n\tconst trimmedString = trimString(input);\n\n\treturn trimmedString?.split('')?.reverse()?.join('');\n};\n\n/**\n * * Normalizes a string by removing diacritics (accents).\n * @param str The input string.\n * @returns The normalized string.\n */\nexport function normalizeString(str: string): string {\n\treturn str.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n}\n\n/**\n * * Extracts all email addresses from a string.\n * @param str The input string.\n * @returns An array of extracted email addresses.\n */\nexport function extractEmails(str: string): string[] {\n\treturn str.match(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}/g) || [];\n}\n\n/**\n * * Extracts all URLs from a string.\n * @param str The input string.\n * @returns An array of extracted URLs.\n */\nexport function extractURLs(str: string): string[] {\n\treturn str?.match(/https?:\\/\\/[^\\s/$.?#].[^\\s]*/g) || [];\n}\n\n/**\n * * Returns a grammatically correct unit string, optionally prefixed with the number.\n *\n * @param count The numeric value to determine singular or plural.\n * @param unit The unit name (e.g., \"day\", \"hour\").\n * @param withNumber Whether to prefix the count before the unit. Defaults to `true`.\n * @returns Formatted unit string like `\"1 day\"`, `\"2 months\"`, or `\"hour\"`.\n */\nexport function formatUnitWithPlural(\n\tcount: number,\n\tunit: string,\n\twithNumber = true,\n): string {\n\tconst abs = Math.abs(count);\n\tconst pluralized = abs === 1 ? unit : `${unit}s`;\n\n\treturn withNumber ? `${count} ${pluralized}` : pluralized;\n}\n","import { reverseString } from './convert';\n\n/**\n * * Checks if a string is a palindrome.\n * @param input - The string to check.\n * @returns True if the string is a palindrome, otherwise false.\n */\nexport const isPalindrome = (input: string): boolean => {\n\tconst normalized = input.toLowerCase().replace(/[^a-z0-9]/g, '');\n\treturn normalized === reverseString(normalized);\n};\n\n/**\n * * Checks if a string is in camelCase format.\n * @param str The string to check.\n * @returns `true` if the string is in camelCase, otherwise `false`.\n */\nexport function isCamelCase(str: string): boolean {\n\treturn /^[a-z]+([A-Z][a-z]*)*$/.test(str);\n}\n\n/**\n * * Checks if a string is in PascalCase format.\n * @param str The string to check.\n * @returns `true` if the string is in PascalCase, otherwise `false`.\n */\nexport function isPascalCase(str: string): boolean {\n\treturn /^[A-Z][a-zA-Z]*$/.test(str);\n}\n\n/**\n * * Checks if a string is in snake_case format.\n * @param str The string to check.\n * @returns `true` if the string is in snake_case, otherwise `false`.\n */\nexport function isSnakeCase(str: string): boolean {\n\treturn /^[a-z]+(_[a-z]+)*$/.test(str);\n}\n\n/**\n * * Checks if a string is in kebab-case format.\n * @param str The string to check.\n * @returns `true` if the string is in kebab-case, otherwise `false`.\n */\nexport function isKebabCase(str: string): boolean {\n\treturn /^[a-z]+(-[a-z]+)*$/.test(str);\n}\n\n/**\n * * Checks if a string contains only emojis.\n * @param str The string to check.\n * @returns `true` if the string contains only emojis, otherwise `false`.\n */\nexport function isEmojiOnly(str: string): boolean {\n\treturn /^[\\p{Emoji}]+$/u.test(str);\n}\n","/**\n * * Extracts all numbers from a string as array of numbers.\n * @param input - The string to extract numbers from.\n * @returns An array of numbers found in the string.\n */\nexport const extractNumbersFromString = (input: string): number[] => {\n\treturn (input.match(/\\d+/g) || [])?.map(Number);\n};\n\n/**\n * * Computes the Levenshtein distance between two strings.\n * @param a - First string.\n * @param b - Second string.\n * @returns The Levenshtein distance between the two strings.\n */\nexport const getLevenshteinDistance = (a: string, b: string): number => {\n\tconst lenA = a?.length;\n\tconst lenB = b?.length;\n\tconst dp: number[][] = Array.from({ length: lenA + 1 }, (_, i) =>\n\t\tArray.from({ length: lenB + 1 }, (_, j) =>\n\t\t\ti === 0 ? j\n\t\t\t: j === 0 ? i\n\t\t\t: 0,\n\t\t),\n\t);\n\n\tfor (let i = 1; i <= lenA; i++) {\n\t\tfor (let j = 1; j <= lenB; j++) {\n\t\t\tdp[i][j] =\n\t\t\t\ta[i - 1] === b[j - 1] ?\n\t\t\t\t\tdp[i - 1][j - 1]\n\t\t\t\t:\t1 + Math.min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]);\n\t\t}\n\t}\n\n\treturn dp[lenA][lenB];\n};\n\n/**\n * * Counts the number of words in a string, supporting multiple languages and scripts.\n *\n * @param text - The input string to count words from.\n * @returns Number of words (Unicode-aware).\n */\nexport function countWords(text: string): number {\n\treturn (text?.match(/\\p{L}[\\p{L}\\p{M}\\p{Pd}'’]*|\\p{N}+/gu) || [])?.length;\n}\n","import type { FalsyPrimitive, NormalPrimitive, Primitive } from '../types';\n\n/**\n * * Type guard to check if a value is a number.\n * @param value - The value to check.\n * @returns `true` if the value is a number, otherwise `false`.\n */\nexport function isNumber(value: unknown): value is number {\n\treturn typeof value === 'number' && !isNaN(value);\n}\n\n/**\n * * Type guard to check if a value is a string.\n * @param value - The value to check.\n * @returns `true` if the value is a string, otherwise `false`.\n */\nexport function isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\n/**\n * * Type guard to check if a value is an integer.\n * @param value - The value to check.\n * @returns `true` if the value is an integer, otherwise `false`.\n */\nexport function isInteger(value: unknown): value is number {\n\treturn isNumber(value) && Number.isInteger(value);\n}\n\n/**\n * * Type guard to check if a value is a positive integer.\n * @param value - The value to check.\n * @returns `true` if the value is a positive integer, otherwise `false`.\n */\nexport function isPositiveInteger(value: unknown): value is number {\n\treturn isInteger(value) && value > 0;\n}\n\n/**\n * * Type guard to check if a value is a boolean.\n * @param value - The value to check.\n * @returns `true` if the value is a boolean, otherwise `false`.\n */\nexport function isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\n/**\n * * Type guard to check if a value is null.\n * @param value - The value to check.\n * @returns `true` if the value is null, otherwise `false`.\n */\nexport function isNull(value: unknown): value is null {\n\treturn value === null;\n}\n\n/**\n * * Type guard to check if a value is undefined.\n * @param value - The value to check.\n * @returns `true` if the value is undefined, otherwise `false`.\n */\nexport function isUndefined(value: unknown): value is undefined {\n\treturn value === undefined;\n}\n\n/**\n * * Type guard to check if a value is a symbol.\n * @param value - The value to check.\n * @returns `true` if the value is a symbol, otherwise `false`.\n */\nexport function isSymbol(value: unknown): value is symbol {\n\treturn typeof value === 'symbol';\n}\n\n/**\n * * Type guard to check if a value is a BigInt.\n * @param value - The value to check.\n * @returns `true` if the value is a BigInt, otherwise `false`.\n */\nexport function isBigInt(value: unknown): value is bigint {\n\treturn typeof value === 'bigint';\n}\n\n/**\n * * Type guard to check if a value is a primitive (i.e. `string | number | boolean | symbol | bigint | null | undefined`).\n * @param value - The value to check.\n * @returns `true` if the value is a primitive, otherwise `false`.\n */\nexport function isPrimitive(value: unknown): value is Primitive {\n\treturn (\n\t\tvalue === null ||\n\t\t[\n\t\t\t'string',\n\t\t\t'number',\n\t\t\t'boolean',\n\t\t\t'symbol',\n\t\t\t'bigint',\n\t\t\t'undefined',\n\t\t].includes(typeof value)\n\t);\n}\n\n/**\n * * Type guard to check if a value is a normal primitive (i.e. `string | number | boolean | null | undefined`).\n * @param value - The value to check.\n * @returns `true` if the value is a primitive, otherwise `false`.\n */\nexport function isNormalPrimitive(value: unknown): value is NormalPrimitive {\n\treturn (\n\t\tvalue === null ||\n\t\t['string', 'number', 'boolean', 'undefined'].includes(typeof value)\n\t);\n}\n\n/**\n * * Type guard to check if a value is a non-empty string.\n * @param value - The value to check.\n * @returns `true` if the value is a non-empty string, otherwise `false`.\n */\nexport function isNonEmptyString(value: unknown): value is string {\n\treturn isString(value) && value?.length > 0;\n}\n\n/**\n * * Type guard to check if a value is falsy.\n * @param value - The value to check.\n * @returns `true` if the value is falsy, otherwise `false`.\n */\nexport function isFalsy(value: unknown): value is FalsyPrimitive {\n\treturn !value;\n}\n\n/**\n * * Type guard to check if a value is truthy.\n * @param value - The value to check.\n * @returns `true` if the value is truthy (not null or undefined), otherwise `false`.\n */\nexport function isTruthy<T>(value: T): value is Exclude<T, FalsyPrimitive> {\n\treturn Boolean(value);\n}\n","export const ONES = [\n\t'',\n\t'one',\n\t'two',\n\t'three',\n\t'four',\n\t'five',\n\t'six',\n\t'seven',\n\t'eight',\n\t'nine',\n] as const;\n\nexport const TEENS = [\n\t'ten',\n\t'eleven',\n\t'twelve',\n\t'thirteen',\n\t'fourteen',\n\t'fifteen',\n\t'sixteen',\n\t'seventeen',\n\t'eighteen',\n\t'nineteen',\n] as const;\n\nexport const TENS = [\n\t'',\n\t'ten',\n\t'twenty',\n\t'thirty',\n\t'forty',\n\t'fifty',\n\t'sixty',\n\t'seventy',\n\t'eighty',\n\t'ninety',\n] as const;\n\nexport const THOUSANDS = [\n\t'',\n\t'thousand',\n\t'million',\n\t'billion',\n\t'trillion',\n\t'quadrillion',\n\t'quintillion',\n\t// ! Needs to modify later, below supports up to 10 sextillion! It's a bug!\n\t// 'sextillion',\n] as const;\n\n/** List of ISO 4217 currency codes */\nexport const CURRENCY_CODES = [\n\t'AED',\n\t'AFN',\n\t'ALL',\n\t'AMD',\n\t'ANG',\n\t'AOA',\n\t'ARS',\n\t'AUD',\n\t'AWG',\n\t'AZN',\n\t'BAM',\n\t'BBD',\n\t'BDT',\n\t'BGN',\n\t'BHD',\n\t'BIF',\n\t'BMD',\n\t'BND',\n\t'BOB',\n\t'BRL',\n\t'BSD',\n\t'BTN',\n\t'BWP',\n\t'BYN',\n\t'BZD',\n\t'CAD',\n\t'CDF',\n\t'CHF',\n\t'CLP',\n\t'CNY',\n\t'COP',\n\t'CRC',\n\t'CUP',\n\t'CVE',\n\t'CZK',\n\t'DJF',\n\t'DKK',\n\t'DOP',\n\t'DZD',\n\t'EGP',\n\t'ERN',\n\t'ETB',\n\t'EUR',\n\t'FJD',\n\t'FKP',\n\t'FOK',\n\t'GBP',\n\t'GEL',\n\t'GGP',\n\t'GHS',\n\t'GIP',\n\t'GMD',\n\t'GNF',\n\t'GTQ',\n\t'GYD',\n\t'HKD',\n\t'HNL',\n\t'HRK',\n\t'HTG',\n\t'HUF',\n\t'IDR',\n\t'ILS',\n\t'IMP',\n\t'INR',\n\t'IQD',\n\t'IRR',\n\t'ISK',\n\t'JEP',\n\t'JMD',\n\t'JOD',\n\t'JPY',\n\t'KES',\n\t'KGS',\n\t'KHR',\n\t'KID',\n\t'KMF',\n\t'KRW',\n\t'KWD',\n\t'KYD',\n\t'KZT',\n\t'LAK',\n\t'LBP',\n\t'LKR',\n\t'LRD',\n\t'LSL',\n\t'LYD',\n\t'MAD',\n\t'MDL',\n\t'MGA',\n\t'MKD',\n\t'MMK',\n\t'MNT',\n\t'MOP',\n\t'MRU',\n\t'MUR',\n\t'MVR',\n\t'MWK',\n\t'MXN',\n\t'MYR',\n\t'MZN',\n\t'NAD',\n\t'NGN',\n\t'NIO',\n\t'NOK',\n\t'NPR',\n\t'NZD',\n\t'OMR',\n\t'PAB',\n\t'PEN',\n\t'PGK',\n\t'PHP',\n\t'PKR',\n\t'PLN',\n\t'PYG',\n\t'QAR',\n\t'RON',\n\t'RSD',\n\t'RUB',\n\t'RWF',\n\t'SAR',\n\t'SBD',\n\t'SCR',\n\t'SDG',\n\t'SEK',\n\t'SGD',\n\t'SHP',\n\t'SLE',\n\t'SOS',\n\t'SRD',\n\t'SSP',\n\t'STN',\n\t'SYP',\n\t'SZL',\n\t'THB',\n\t'TJS',\n\t'TMT',\n\t'TND',\n\t'TOP',\n\t'TRY',\n\t'TTD',\n\t'TVD',\n\t'TWD',\n\t'TZS',\n\t'UAH',\n\t'UGX',\n\t'USD',\n\t'UYU',\n\t'UZS',\n\t'VES',\n\t'VND',\n\t'VUV',\n\t'WST',\n\t'XAF',\n\t'XCD',\n\t'XOF',\n\t'XPF',\n\t'YER',\n\t'ZAR',\n\t'ZMW',\n\t'ZWL',\n] as const;\n\n/** List of all supported BCP 47 locales */\nexport const LOCALE_CODES = [\n\t'af-ZA',\n\t'am-ET',\n\t'ar-AE',\n\t'ar-BH',\n\t'ar-DZ',\n\t'ar-EG',\n\t'ar-IQ',\n\t'ar-JO',\n\t'ar-KW',\n\t'ar-LB',\n\t'ar-LY',\n\t'ar-MA',\n\t'ar-OM',\n\t'ar-QA',\n\t'ar-SA',\n\t'ar-SD',\n\t'ar-SY',\n\t'ar-TN',\n\t'ar-YE',\n\t'az-AZ',\n\t'be-BY',\n\t'bg-BG',\n\t'bn-BD',\n\t'bn-IN',\n\t'bs-BA',\n\t'ca-ES',\n\t'cs-CZ',\n\t'cy-GB',\n\t'da-DK',\n\t'de-AT',\n\t'de-CH',\n\t'de-DE',\n\t'el-GR',\n\t'en-AU',\n\t'en-CA',\n\t'en-GB',\n\t'en-IE',\n\t'en-IN',\n\t'en-NZ',\n\t'en-PH',\n\t'en-SG',\n\t'en-US',\n\t'en-ZA',\n\t'es-AR',\n\t'es-BO',\n\t'es-CL',\n\t'es-CO',\n\t'es-CR',\n\t'es-DO',\n\t'es-EC',\n\t'es-ES',\n\t'es-GT',\n\t'es-HN',\n\t'es-MX',\n\t'es-NI',\n\t'es-PA',\n\t'es-PE',\n\t'es-PR',\n\t'es-PY',\n\t'es-SV',\n\t'es-US',\n\t'es-UY',\n\t'es-VE',\n\t'et-EE',\n\t'eu-ES',\n\t'fa-IR',\n\t'fi-FI',\n\t'fil-PH',\n\t'fr-BE',\n\t'fr-CA',\n\t'fr-CH',\n\t'fr-FR',\n\t'ga-IE',\n\t'gl-ES',\n\t'gu-IN',\n\t'he-IL',\n\t'hi-IN',\n\t'hr-HR',\n\t'hu-HU',\n\t'hy-AM',\n\t'id-ID',\n\t'is-IS',\n\t'it-CH',\n\t'it-IT',\n\t'ja-JP',\n\t'ka-GE',\n\t'kk-KZ',\n\t'km-KH',\n\t'kn-IN',\n\t'ko-KR',\n\t'ky-KG',\n\t'lt-LT',\n\t'lv-LV',\n\t'mk-MK',\n\t'ml-IN',\n\t'mn-MN',\n\t'mr-IN',\n\t'ms-MY',\n\t'mt-MT',\n\t'nb-NO',\n\t'ne-NP',\n\t'nl-BE',\n\t'nl-NL',\n\t'pl-PL',\n\t'pt-BR',\n\t'pt-PT',\n\t'ro-RO',\n\t'ru-RU',\n\t'sk-SK',\n\t'sl-SI',\n\t'sq-AL',\n\t'sr-Latn',\n\t'sv-SE',\n\t'sw-KE',\n\t'ta-IN',\n\t'te-IN',\n\t'th-TH',\n\t'tr-TR',\n\t'uk-UA',\n\t'ur-PK',\n\t'uz-UZ',\n\t'vi-VN',\n\t'zh-CN',\n\t'zh-HK',\n\t'zh-TW',\n] as const;\n\n/** Mapping of CurrencyCodes to LocaleCodes */\nexport const CURRENCY_LOCALES = {\n\tAED: 'ar-AE', // United Arab Emirates Dirham\n\tAFN: 'fa-IR', // Afghan Afghani\n\tALL: 'sq-AL', // Albanian Lek\n\tAMD: 'hy-AM', // Armenian Dram\n\tANG: 'nl-NL', // Netherlands Antillean Guilder\n\tAOA: 'pt-AO', // Angolan Kwanza\n\tARS: 'es-AR', // Argentine Peso\n\tAUD: 'en-AU', // Australian Dollar\n\tAWG: 'nl-AW', // Aruban Florin\n\tAZN: 'az-AZ', // Azerbaijani Manat\n\tBAM: 'bs-BA', // Bosnia and Herzegovina Convertible Mark\n\tBBD: 'en-BB', // Barbadian Dollar\n\tBDT: 'bn-BD', // Bangladeshi Taka\n\tBGN: 'bg-BG', // Bulgarian Lev\n\tBHD: 'ar-BH', // Bahraini Dinar\n\tBIF: 'fr-BI', // Burundian Franc\n\tBMD: 'en-BM', // Bermudian Dollar\n\tBND: 'ms-BN', // Brunei Dollar\n\tBOB: 'es-BO', // Bolivian Boliviano\n\tBRL: 'pt-BR', // Brazilian Real\n\tBSD: 'en-BS', // Bahamian Dollar\n\tBTN: 'dz-BT', // Bhutanese Ngultrum\n\tBWP: 'en-BW', // Botswanan Pula\n\tBYN: 'be-BY', // Belarusian Ruble\n\tBZD: 'es-BZ', // Belize Dollar\n\tCAD: 'fr-CA', // Canadian Dollar\n\tCDF: 'fr-CD', // Congolese Franc\n\tCHF: 'fr-CH', // Swiss Franc\n\tCLP: 'es-CL', // Chilean Peso\n\tCNY: 'zh-CN', // Chinese Yuan\n\tCOP: 'es-CO', // Colombian Peso\n\tCRC: 'es-CR', // Costa Rican Colón\n\tCUP: 'es-CU', // Cuban Peso\n\tCVE: 'pt-CV', // Cape Verdean Escudo\n\tCZK: 'cs-CZ', // Czech Koruna\n\tDJF: 'fr-DJ', // Djiboutian Franc\n\tDKK: 'da-DK', // Danish Krone\n\tDOP: 'es-DO', // Dominican Peso\n\tDZD: 'ar-DZ', // Algerian Dinar\n\tEGP: 'ar-EG', // Egyptian Pound\n\tERN: 'ti-ER', // Eritrean Nakfa\n\tETB: 'am-ET', // Ethiopian Birr\n\tEUR: 'de-DE', // Euro\n\tFJD: 'en-FJ', // Fijian Dollar\n\tFKP: 'en-FK', // Falkland Islands Pound\n\tFOK: 'fo-FO', // Faroese Króna\n\tGBP: 'en-GB', // British Pound Sterling\n\tGEL: 'ka-GE', // Georgian Lari\n\tGGP: 'en-GG', // Guernsey Pound\n\tGHS: 'ak-GH', // Ghanaian Cedi\n\tGIP: 'en-GI', // Gibraltar Pound\n\tGMD: 'en-GM', // Gambian Dalasi\n\tGNF: 'fr-GN', // Guinean Franc\n\tGTQ: 'es-GT', // Guatemalan Quetzal\n\tGYD: 'en-GY', // Guyanaese Dollar\n\tHKD: 'zh-HK', // Hong Kong Dollar\n\tHNL: 'es-HN', // Honduran Lempira\n\tHRK: 'hr-HR', // Croatian Kuna\n\tHTG: 'ht-HT', // Haitian Gourde\n\tHUF: 'hu-HU', // Hungarian Forint\n\tIDR: 'id-ID', // Indonesian Rupiah\n\tILS: 'he-IL', // Israeli New Shekel\n\tIMP: 'en-IM', // Isle of Man Pound\n\tINR: 'hi-IN', // Indian Rupee\n\tIQD: 'ar-IQ', // Iraqi Dinar\n\tIRR: 'fa-IR', // Iranian Rial\n\tISK: 'is-IS', // Icelandic Króna\n\tJEP: 'en-JE', // Jersey Pound\n\tJMD: 'en-JM', // Jamaican Dollar\n\tJOD: 'ar-JO', // Jordanian Dinar\n\tJPY: 'ja-JP', // Japanese Yen\n\tKES: 'sw-KE', // Kenyan Shilling\n\tKGS: 'ky-KG', // Kyrgyzstani Som\n\tKHR: 'km-KH', // Cambodian Riel\n\tKID: 'en-KI', // Kiribati Dollar\n\tKMF: 'fr-KM', // Comorian Franc\n\tKRW: 'ko-KR', // South Korean Won\n\tKWD: 'ar-KW', // Kuwaiti Dinar\n\tKYD: 'en-KY', // Cayman Islands Dollar\n\tKZT: 'kk-KZ', // Kazakhstani Tenge\n\tLAK: 'lo-LA', // Laotian Kip\n\tLBP: 'ar-LB', // Lebanese Pound\n\tLKR: 'si-LK', // Sri Lankan Rupee\n\tLRD: 'en-LR', // Liberian Dollar\n\tLSL: 'st-LS', // Lesotho Loti\n\tLYD: 'ar-LY', // Libyan Dinar\n\tMAD: 'ar-MA', // Moroccan Dirham\n\tMDL: 'ro-RO', // Moldovan Leu\n\tMGA: 'mg-MG', // Malagasy Ariary\n\tMKD: 'mk-MK', // Macedonian Denar\n\tMMK: 'my-MM', // Burmese Kyat\n\tMNT: 'mn-MN', // Mongolian Tugrik\n\tMOP: 'pt-MO', // Macanese Pataca\n\tMRU: 'ar-MA', // Mauritanian Ouguiya\n\tMUR: 'en-MU', // Mauritian Rupee\n\tMVR: 'dv-MV', // Maldivian Rufiyaa\n\tMWK: 'ny-MW', // Malawian Kwacha\n\tMXN: 'es-MX', // Mexican Peso\n\tMYR: 'ms-MY', // Malaysian Ringgit\n\tMZN: 'pt-MZ', // Mozambican Metical\n\tNAD: 'en-NA', // Namibian Dollar\n\tNGN: 'en-NG', // Nigerian Naira\n\tNIO: 'es-NI', // Nicaraguan Córdoba\n\tNOK: 'no-NO', // Norwegian Krone\n\tNPR: 'ne-NP', // Nepalese Rupee\n\tNZD: 'en-NZ', // New Zealand Dollar\n\tOMR: 'ar-OM', // Omani Rial\n\tPAB: 'es-PA', // Panamanian Balboa\n\tPEN: 'es-PE', // Peruvian Nuevo Sol\n\tPGK: 'en-PG', // Papua New Guinean Kina\n\tPHP: 'fil-PH', // Philippine Peso\n\tPKR: 'ur-PK', // Pakistani Rupee\n\tPLN: 'pl-PL', // Polish Zloty\n\tPYG: 'es-PY', // Paraguayan Guarani\n\tQAR: 'ar-QA', // Qatari Rial\n\tRON: 'ro-RO', // Romanian Leu\n\tRSD: 'sr-RS', // Serbian Dinar\n\tRUB: 'ru-RU', // Russian Ruble\n\tRWF: 'rw-RW', // Rwandan Franc\n\tSAR: 'ar-SA', // Saudi Riyal\n\tSBD: 'en-SB', // Solomon Islands Dollar\n\tSCR: 'en-SC', // Seychellois Rupee\n\tSDG: 'ar-SD', // Sudanese Pound\n\tSEK: 'sv-SE', // Swedish Krona\n\tSGD: 'en-SG', // Singapore Dollar\n\tSHP: 'en-SH', // Saint Helena Pound\n\tSLE: 'en-SL', // Sierra Leonean Leone\n\tSOS: 'so-SO', // Somali Shilling\n\tSRD: 'nl-SR', // Surinamese Dollar\n\tSSP: 'en-SS', // South Sudanese Pound\n\tSTN: 'st-ST', // São Tomé and Príncipe Dobra\n\tSYP: 'ar-SY', // Syrian Pound\n\tSZL: 'en-SZ', // Swazi Lilangeni\n\tTHB: 'th-TH', // Thai Baht\n\tTJS: 'tg-TJ', // Tajikistani Somoni\n\tTMT: 'tk-TM', // Turkmenistan Manat\n\tTND: 'ar-TN', // Tunisian Dinar\n\tTOP: 'to-TO', // Tongan Paʻanga\n\tTRY: 'tr-TR', // Turkish Lira\n\tTTD: 'en-TT', // Trinidad and Tobago Dollar\n\tTVD: 'en-TV', // Tuvaluan Dollar\n\tTWD: 'zh-TW', // New Taiwan Dollar\n\tTZS: 'sw-TZ', // Tanzanian Shilling\n\tUAH: 'uk-UA', // Ukrainian Hryvnia\n\tUGX: 'sw-UG', // Ugandan Shilling\n\tUSD: 'en-US', // United States Dollar\n\tUYU: 'es-UY', // Uruguayan Peso\n\tUZS: 'uz-UZ', // Uzbekistani Som\n\tVES: 've-VE', // Venezuelan Bolívar\n\tVND: 'vi-VN', // Vietnamese Dong\n\tVUV: 'en-VU', // Vanuatu Vatu\n\tWST: 'en-WS', // Samoan Tala\n\tXAF: 'fr-XAF', // Central African CFA Franc\n\tXCD: 'en-XCD', // East Caribbean Dollar\n\tXOF: 'fr-XOF', // West African CFA Franc\n\tXPF: 'fr-XPF', // CFP Franc\n\tYER: 'ar-YE', // Yemeni Rial\n\tZAR: 'en-ZA', // South African Rand\n\tZMW: 'en-ZM', // Zambian Kwacha\n\tZWL: 'en-ZW', // Zimbabwean Dollar\n} as const;\n\n/** * Fiat currencies supported by Frankfurter API */\nexport const SUPPORTED_CURRENCIES = [\n\t'AUD',\n\t'BGN',\n\t'BRL',\n\t'CAD',\n\t'CHF',\n\t'CNY',\n\t'CZK',\n\t'DKK',\n\t'EUR',\n\t'GBP',\n\t'HKD',\n\t'HUF',\n\t'IDR',\n\t'ILS',\n\t'INR',\n\t'ISK',\n\t'JPY',\n\t'KRW',\n\t'MXN',\n\t'MYR',\n\t'NOK',\n\t'NZD',\n\t'PHP',\n\t'PLN',\n\t'RON',\n\t'SEK',\n\t'SGD',\n\t'THB',\n\t'TRY',\n\t'USD',\n\t'ZAR',\n] as const;\n\n/** * Unit names and their full readable labels. */\nexport const UNITS = {\n\t// Length\n\tm: 'Meter',\n\tkm: 'Kilometer',\n\tmi: 'Mile',\n\tft: 'Foot',\n\n\t// Mass / Weight\n\tkg: 'Kilogram',\n\tlbs: 'Pound',\n\tg: 'Gram',\n\toz: 'Ounce',\n\n\t// Temperature\n\tC: 'Celsius',\n\tF: 'Fahrenheit',\n\tK: 'Kelvin',\n\n\t// Volume\n\tl: 'Liter',\n\tgal: 'Gallon',\n\n\t// Area\n\tsqm: 'Square Meter',\n\tsqft: 'Square Foot',\n\n\t// Speed\n\tkmph: 'Kilometer per Hour',\n\tmph: 'Miles per Hour',\n\n\t// Time\n\th: 'Hour',\n\tmin: 'Minute',\n\tsec: 'Second',\n\td: 'Day',\n\n\t// Digital Storage\n\tkb: 'Kilobyte',\n\tmb: 'Megabyte',\n\tgb: 'Gigabyte',\n\n\t// Energy\n\tj: 'Joule',\n\tcal: 'Calorie',\n\n\t// Pressure\n\tatm: 'Atmosphere',\n\tpa: 'Pascal',\n\n\t// Frequency\n\thz: 'Hertz',\n\tkhz: 'Kilohertz',\n} as const;\n\n/** * Scientific SI Unit prefix multipliers. */\nexport const PREFIX_MULTIPLIERS = {\n\ty: 1e-24,\n\tz: 1e-21,\n\ta: 1e-18,\n\tf: 1e-15,\n\tp: 1e-12,\n\tn: 1e-9,\n\tμ: 1e-6,\n\tu: 1e-6,\n\tm: 1e-3,\n\tc: 1e-2,\n\td: 1e-1,\n\tda: 1e1,\n\th: 1e2,\n\tk: 1e3,\n\tM: 1e6,\n\tG: 1e9,\n\tT: 1e12,\n\tP: 1e15,\n\tE: 1e18,\n\tZ: 1e21,\n\tY: 1e24,\n\t'': 1, // base unit, like meter, gram, byte etc.\n} as const;\n","import { ONES, TEENS, TENS } from './constants';\n\n/**\n * Apply multiples of a number if there is any.\n * @param array Array of numbers to apply the condition on.\n * @param multiples The multiples of which number.\n * @returns Array of multiples of the desired number\n */\nexport const _applyMultiples = (\n\tarray: number[],\n\tmultiples?: number,\n): number[] => {\n\tif (!multiples) return array;\n\treturn array?.filter((n) => n % multiples === 0);\n};\n\n/**\n * - Converts a number less than 1000 to words.\n * @param num - The number to convert (less than 1000).\n * @param isLast - Whether this is the last group (thousands, millions, etc.).\n * @returns Numbers less than 1000 in words.\n */\nexport function _convertLessThanThousand(num: number, isLast: boolean): string {\n\tif (num < 10) return ONES[num];\n\n\tif (num < 20) return TEENS[num - 10];\n\n\tlet result = TENS[Math.floor(num / 10)];\n\n\tconst remainder = num % 10;\n\n\tif (remainder > 0) result += `-${ONES[remainder]}`;\n\n\tif (num >= 100) {\n\t\tconst hundredsPart = `${ONES[Math.floor(num / 100)]} hundred`;\n\n\t\treturn num % 100 === 0 ?\n\t\t\t\thundredsPart\n\t\t\t:\t`${hundredsPart} ${isLast ? 'and' : ''} ${_convertLessThanThousand(num % 100, false)}`;\n\t}\n\n\treturn result;\n}\n\n/**\n * * Calculate the HCF (Highest Common Factor) of two numbers using the Euclidean algorithm.\n *\n * @param a - First number.\n * @param b - Second number.\n * @returns The HCF of the two numbers.\n */\nexport const _find2NumbersHCF = (a: number, b: number): number => {\n\tlet x = Math.abs(a);\n\tlet y = Math.abs(b);\n\n\twhile (y !== 0) {\n\t\tconst temp = y;\n\n\t\ty = x % y;\n\t\tx = temp;\n\t}\n\n\treturn x;\n};\n\n/**\n * * Calculate the LCM (Least Common Multiple) of two numbers using the Euclidean algorithm.\n *\n * @param a - First number.\n * @param b - Second number.\n * @returns The LCM of the two numbers.\n */\nexport const _find2NumbersLCM = (a: number, b: number): number => {\n\tconst x = Math.abs(a);\n\tconst y = Math.abs(b);\n\n\treturn (x * y) / _find2NumbersHCF(x, y);\n};\n","import { isNumber } from '../guards/primitives';\nimport type { Numeric } from '../types';\nimport { _find2NumbersHCF, _find2NumbersLCM } from './helpers';\nimport type {\n\tConvertedDecimal,\n\tDecimalOptions,\n\tRandomNumberOptions,\n} from './types';\n\n/**\n * * Utility to generate a random number between a given range.\n * * If no options are provided, it will generate a random number between `0` and `100` (inclusive).\n * * If `min` is greater than `max`, it will swap the values and generate a random number.\n *\n * @param options - Options for configuring random number generator.\n * @returns Random number.\n */\nexport const getRandomNumber = (options?: RandomNumberOptions): number => {\n\tconst {\n\t\tmin = 0,\n\t\tmax = 100,\n\t\tincludeMin = true,\n\t\tincludeMax = true,\n\t} = options || {};\n\n\tlet minimum = min,\n\t\tmaximum = max;\n\n\tif (min > max) {\n\t\t[minimum, maximum] = [max, min];\n\n\t\treturn getRandomNumber({\n\t\t\tmin: minimum,\n\t\t\tmax: maximum,\n\t\t\tincludeMin,\n\t\t\tincludeMax,\n\t\t});\n\t}\n\n\tif (min === max) {\n\t\treturn min;\n\t}\n\n\tif (includeMin && includeMax) {\n\t\t// Generate random number between min and max, inclusive\n\t\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t}\n\n\tif (!includeMin && !includeMax) {\n\t\t// Generate random number between min and max, exclusive\n\t\treturn Math.floor(Math.random() * (max - min - 1)) + min + 1;\n\t}\n\n\tif (includeMin && !includeMax) {\n\t\t// Generate random number between min and max, inclusive of min but exclusive of max\n\t\treturn Math.floor(Math.random() * (max - min)) + min;\n\t}\n\n\tif (!includeMin && includeMax) {\n\t\t// Generate random number between min and max, exclusive of min but inclusive of max\n\t\treturn Math.floor(Math.random() * (max - min)) + min + 1;\n\t}\n\n\treturn 0;\n};\n\n/**\n * * Utility to round a number to given decimal places.\n *\n * @param input - Number or `stringified` number to round.\n * @param options - Options for rounding behavior, including decimal places and return type.\n * @returns Converted number as `number` (default) or `string` (if `isString` is `true`).\n */\nexport const convertToDecimal = <T extends boolean | undefined = false>(\n\tinput: Numeric,\n\toptions?: DecimalOptions<T>,\n): ConvertedDecimal<T> => {\n\tconst { decimalPlaces = 2, isString = false } = options || {};\n\n\tconst number = typeof input === 'number' ? input : Number(input);\n\n\treturn isString ?\n\t\t\t(number.toFixed(decimalPlaces) as ConvertedDecimal<T>)\n\t\t:\t(Number(number.toFixed(decimalPlaces)) as ConvertedDecimal<T>);\n};\n\n/**\n * * Calculates the HCF/GCD of multiple numbers.\n *\n * @param numbers - List of numbers to find the HCF/GCD for.\n * @returns The HCF/GCD of all the provided numbers.\n */\nexport const calculateHCF = (...numbers: Numeric[]): number => {\n\tconst converted = numbers?.map(Number);\n\n\tif (converted?.length === 0) return 0;\n\n\tlet hcf = converted[0];\n\n\tfor (let i = 1; i < converted?.length; i++) {\n\t\thcf = _find2NumbersHCF(hcf, converted[i]);\n\t}\n\n\treturn hcf;\n};\n\n/**\n * * Calculates the LCM/LCD of multiple numbers.\n *\n * @param numbers - List of numbers to find the LCM/LCD for.\n * @returns The LCM/LCD of all the provided numbers.\n */\nexport const calculateLCM = (...numbers: Numeric[]): number => {\n\tconst converted = numbers?.map(Number);\n\n\tif (converted?.length === 0) return 0;\n\n\tlet lcm = converted[0];\n\n\tfor (let i = 1; i < converted?.length; i++) {\n\t\tlcm = _find2NumbersLCM(lcm, converted[i]);\n\t}\n\n\treturn lcm;\n};\n\n/**\n * * Sums up all digits of a number.\n *\n * @param num The input number.\n * @returns The sum of its digits.\n */\nexport function sumDigits(num: Numeric): number {\n\treturn Math.abs(Number(num))\n\t\t.toString()\n\t\t.split('')\n\t\t.reduce((sum, digit) => sum + Number(digit), 0);\n}\n\n/**\n * * Sums up numbers.\n *\n * @param numbers The input numbers.\n * @returns The sum of the numbers.\n */\nexport function sumNumbers(...numbers: Numeric[]): number {\n\treturn numbers\n\t\t?.map((num) => Number(num))\n\t\t?.reduce((sum, number) => sum + number, 0);\n}\n\n/**\n * * Reverses a number (e.g., `123` → `321`).\n *\n * @param num The number to reverse.\n * @returns The reversed number.\n */\nexport function reverseNumber(num: Numeric): number {\n\tconst reversed = parseInt(\n\t\tMath.abs(Number(num)).toString().split('').reverse().join(''),\n\t\t10,\n\t);\n\n\treturn Number(num) < 0 ? -reversed : reversed;\n}\n\n/**\n * * Calculates the average of a set of numbers.\n *\n * @param numbers - A list of numbers for which to calculate the average.\n * @returns The average of the provided numbers. Returns `NaN` if no numbers are valid.\n */\nexport function getAverage(...numbers: Numeric[]): number {\n\tlet sum = 0;\n\tlet count = 0;\n\n\tfor (const n of numbers) {\n\t\tconst num = Number(n);\n\t\tif (typeof num === 'number' && !isNaN(num)) {\n\t\t\tsum += num;\n\t\t\tcount++;\n\t\t}\n\t}\n\n\treturn count === 0 ? NaN : Math.round((sum / count) * 1000) / 1000;\n}\n\n/**\n * * Rounds a number to a specified number of decimal places.\n *\n * @param number - The number to round.\n * @param roundTo - The number of decimal places to round to (default is `2`).\n * - If `roundTo` is negative, the number is rounded to the left of the decimal point (e.g., `-1` rounds to the nearest 10, `-2` to nearest 100 etc.).\n * @returns The rounded number, either in float or integer (if a whole number).\n *\n * @example\n * roundNumber(1234.56, -2); // 1200\n * roundNumber(1234.56, 1); // 1234.6\n */\nexport function roundNumber(number: Numeric, roundTo = 2): number {\n\tconst factor = Math.pow(10, roundTo);\n\n\tconst num = isNumber(number) ? number : Number(number);\n\n\treturn Math.round(num * factor) / factor;\n}\n","import type { Numeric } from '../types';\nimport { CURRENCY_LOCALES } from './constants';\nimport type { CurrencyCode, LocaleCode } from './types';\n\n/**\n * * Rounds a number to the nearest specified interval.\n * @param value - The number to round.\n * @param interval - The interval to round to. Defaults to `5`.\n * @returns The number rounded to the nearest interval.\n * @example roundToNearest(27, 5) → 25\n */\nexport const roundToNearest = (value: Numeric, interval = 5): number => {\n\treturn Math.round(Number(value) / interval) * interval;\n};\n\n/**\n * * Formats a number as a currency string.\n * @param value - The number to format.\n * @param currency - The currency code (default: `USD`).\n * @param locale - The locale for formatting (default: matching currency locale).\n * @returns A formatted currency string.\n * @example formatCurrency(1234.56) → \"$1,234.56\"\n * @example formatCurrency(1234.56, \"USD\") → \"$1,234.56\"\n * @example formatCurrency(1234.56, \"USD\", \"en-US\") → \"$1,234.56\"\n */\nexport const formatCurrency = (\n\tvalue: Numeric,\n\tcurrency: CurrencyCode = 'USD',\n\tlocale?: LocaleCode,\n): string => {\n\tconst selectedLocale: LocaleCode =\n\t\tlocale ? locale : CURRENCY_LOCALES[currency];\n\n\treturn new Intl.NumberFormat(selectedLocale, {\n\t\tstyle: 'currency',\n\t\tcurrency,\n\t}).format(value);\n};\n\n/**\n * * Clamps a number within a specified range.\n * @param value - The number to clamp.\n * @param min - The minimum allowed value.\n * @param max - The maximum allowed value.\n * @returns The clamped number.\n * @example clampNumber(15, 10, 20) → 15\n * @example clampNumber(5, 10, 20) → 10\n * @example clampNumber(25, 10, 20) → 20\n */\nexport const clampNumber = (\n\tvalue: number,\n\tmin: number,\n\tmax: number,\n): number => {\n\treturn Math.max(min, Math.min(value, max));\n};\n\n/**\n * * Generates a random floating-point number within a range.\n * @param min - The minimum value.\n * @param max - The maximum value.\n * @returns A random floating-point number between min and max.\n * @example randomFloat(1.5, 3.5) → 2.84623\n */\nexport const getRandomFloat = (min: Numeric, max: Numeric): number => {\n\treturn Math.random() * (Number(max) - Number(min)) + Number(min);\n};\n\n/**\n * * Returns the ordinal suffix for a given number (e.g., 1 -> 'st', 2 -> 'nd', 3 -> 'rd', 4 -> 'th' etc.).\n * @description The function handles special cases for 11, 12, and 13, which all use 'th' despite the last digit.\n * If the `withNumber` parameter is `true`, the function returns the number along with its ordinal suffix (e.g., \"1st\").\n * Otherwise, it returns only the ordinal suffix (e.g., \"st\").\n *\n * @param num - The number or number string to get the ordinal suffix for.\n * @param withNumber - Whether to include the number along with its ordinal suffix (defaults to `true`).\n * @returns The appropriate ordinal suffix, optionally with the number (e.g., '1st' or 'st`, '2nd' or 'nd' and so on.).\n */\nexport const getOrdinal = (num: Numeric, withNumber = true): string => {\n\tconst remainder10 = Number(num) % 10;\n\tconst remainder100 = Number(num) % 100;\n\n\tlet suffix: string;\n\n\tif (remainder10 === 1 && remainder100 !== 11) {\n\t\tsuffix = 'st';\n\t} else if (remainder10 === 2 && remainder100 !== 12) {\n\t\tsuffix = 'nd';\n\t} else if (remainder10 === 3 && remainder100 !== 13) {\n\t\tsuffix = 'rd';\n\t} else {\n\t\tsuffix = 'th';\n\t}\n\n\treturn withNumber ? String(num).concat(suffix) : suffix;\n};\n","import type { Numeric } from '../types';\nimport type {\n\tConvertOptions,\n\tCurrencyCode,\n\tFrankFurter,\n\tLocaleCode,\n\tSupportedCurrency,\n} from './types';\nimport { formatCurrency } from './utilities';\n\n// const rateCache: Map<string, number> = new Map();\n\n/**\n * * A utility class for handling currency operations like formatting and conversion.\n *\n * - Supports formatting based on locale.\n * - Converts between **fiat currencies supported by `api.frankfurter.app`**.\n * - Automatically caches conversion rates to reduce redundant API calls.\n * - Intended for use with numeric inputs (number or numeric string).\n */\nexport class Currency {\n\treadonly #amount: number;\n\treadonly #code: CurrencyCode;\n\t/**\n\t * * The formatted currency string (e.g., `$1,000.00`).\n\t *\n\t * - Generated using the `en-US` locale during construction.\n\t * - This is a display-friendly version of the currency value.\n\t * - For formatting with other locales, use the `format(locale)` method.\n\t */\n\treadonly currency: string;\n\n\t/**\n\t * Creates an instance of the Currency class.\n\t *\n\t * @param amount - The numeric amount of currency (e.g., `100`, `'99.99'`).\n\t * @param code - The ISO 4217 currency code representing the currency (e.g., `'USD'`, `'EUR'`).\n\t */\n\tconstructor(amount: Numeric, code: CurrencyCode) {\n\t\tthis.#amount = Number(amount);\n\t\tthis.#code = code;\n\t\tthis.currency = this.format('en-US');\n\t}\n\n\tstatic readonly #rateCache: Map<string, number> = new Map();\n\n\t/** * Clears cached rates that were fetched previously. */\n\tstatic clearRateCache(): void {\n\t\tCurrency.#rateCache.clear();\n\t}\n\n\t/**\n\t * @instance Formats the currency for a given locale.\n\t * @param locale - The target locale (e.g., 'de-DE')\n\t * @returns The formatted currency string\n\t */\n\tformat(locale?: LocaleCode): string {\n\t\treturn formatCurrency(this.#amount, this.#code, locale);\n\t}\n\n\t/**\n\t * @instance Converts the current currency amount to a target currency using real-time exchange rates.\n\t *\n\t * - Uses `api.frankfurter.app` to fetch live exchange rates.\n\t * - Supports **only the following fiat currencies**:\n\t * `AUD`, `BGN`, `BRL`, `CAD`, `CHF`, `CNY`, `CZK`, `DKK`, `EUR`, `GBP`, `HKD`, `HUF`, `IDR`, `ILS`, `INR`, `ISK`, `JPY`,\n\t * `KRW`, `MXN`, `MYR`, `NOK`, `NZD`, `PHP`, `PLN`, `RON`, `SEK`, `SGD`, `THB`, `TRY`, `USD`, `ZAR`.\n\t * - Uses cached rates unless `forceRefresh` is set to `true`.\n\t * - If API fails or currency not supported, falls back to `fallbackRate` if provided.\n\t *\n\t * @param to - The target currency code (must be one of the supported ones, e.g., `'EUR'`, `'USD'`).\n\t * @param options - Optional settings:\n\t * - `fallbackRate`: A manual exchange rate to use if the API call fails or currency is not supported.\n\t * - `forceRefresh`: If true, ignores cached rates and fetches fresh data.\n\t * @returns The converted amount as a number.\n\t * @throws Will throw if the API call fails and no `fallbackRate` is provided.\n\t */\n\tasync convert(\n\t\tto: SupportedCurrency | CurrencyCode,\n\t\toptions?: ConvertOptions,\n\t): Promise<number> {\n\t\tconst key = `${this.#code}->${to}`;\n\n\t\tif (!options?.forceRefresh && Currency.#rateCache.has(key)) {\n\t\t\tconst cachedRate = Currency.#rateCache.get(key)!;\n\n\t\t\treturn this.#amount * cachedRate;\n\t\t}\n\n\t\ttry {\n\t\t\tconst rate = await this.#fetchFromFrankfurter(to);\n\t\t\tCurrency.#rateCache.set(key, rate);\n\n\t\t\treturn this.#amount * rate;\n\t\t} catch (error) {\n\t\t\tif (options?.fallbackRate != null) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Currency conversion failed (${this.#code} → ${to}): ${(error as Error).message}. Using fallback rate...`,\n\t\t\t\t);\n\n\t\t\t\treturn this.#amount * options.fallbackRate;\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t`Currency conversion failed (${this.#code} → ${to}): ${(error as Error).message}`,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * @private Attempts to fetch rate from frankfurter.app\n\t * @param to - Target currency code\n\t * @returns Exchange rate (multiplier)\n\t */\n\tasync #fetchFromFrankfurter(to: CurrencyCode): Promise<number> {\n\t\tconst url = `https://api.frankfurter.app/latest?amount=${this.#amount}&from=${this.#code}`;\n\n\t\ttry {\n\t\t\tconst res = await fetch(url, { redirect: 'error' });\n\n\t\t\tif (!res.ok)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`FrankFurter Error: ${res.status}. \"${res.statusText}\"`,\n\t\t\t\t);\n\n\t\t\tconst data: FrankFurter = await res.json();\n\n\t\t\tif (!data.rates?.[to]) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Currency \"${to}\" not found in FrankFurter Database!`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn data.rates[to] / this.#amount;\n\t\t} catch (error) {\n\t\t\tthrow new Error(\n\t\t\t\t(error as Error).message ||\n\t\t\t\t\t`Failed to fetch data from FrankFurter API`,\n\t\t\t);\n\t\t}\n\t}\n}\n","import { PREFIX_MULTIPLIERS } from './constants';\nimport type { SIPrefix, UnitKey, UnitNumberMethods } from './types';\n\n/**\n * @class Represents a measurable unit and supports conversions between various types of units.\n *\n * Includes static methods for:\n * - Length: meters, feet, kilometers, miles\n * - Mass: kilograms, pounds, grams, ounces\n * - Temperature: Celsius, Fahrenheit, Kelvin\n * - Volume: liters, gallons\n * - Area: square meters, square feet\n * - Speed: km/h, mph\n * - Time: hours, minutes, seconds, days\n * - Digital Storage: kilobytes, megabytes, gigabytes\n * - Energy: joules, calories\n * - Pressure: atm, pascals\n * - Frequency: Hz, kHz\n */\nexport class Unit {\n\treadonly #value: number;\n\treadonly #unit?: UnitKey;\n\n\t/**\n\t * * Creates an instance of the Unit class.\n\t * @param value The numeric value to work with.\n\t * @param unit The unit type of the value (e.g., 'kg', 'm', 'kb').\n\t */\n\tconstructor(value: number, unit?: UnitKey) {\n\t\tthis.#value = value;\n\t\tthis.#unit = unit;\n\t}\n\n\t/**\n\t * @instance Returns the original value with unit (if passed in the constructor).\n\t * @returns A string in the format \"value unit\".\n\t */\n\ttoString(): string {\n\t\treturn `${this.#value} ${this.#unit ?? ''}`.trim();\n\t}\n\n\t/**\n\t * @instance Converts using scientific prefixes (e.g., kB to MB, mg to g).\n\t *\n\t * @param fromPrefix The SI prefix of the source unit.\n\t * @param toPrefix The SI prefix of the target unit.\n\t * @returns The converted numeric value.\n\t */\n\tconvertByPrefix(fromPrefix: SIPrefix, toPrefix: SIPrefix): number {\n\t\treturn Unit.convertByPrefix(this.#value, fromPrefix, toPrefix);\n\t}\n\n\t/**\n\t * @instance Converts from prefixed unit string to another (e.g., kB to MB, mg to g).\n\t *\n\t * @param from Prefixed unit string (e.g., 'kB', 'mg').\n\t * @param to Target prefixed unit string (e.g., 'MB', 'g').\n\t * @returns The converted numeric value.\n\t */\n\tconvertFromTo(from: string, to: string): number {\n\t\treturn Unit.convertFromTo(this.#value, from, to);\n\t}\n\n\t/**\n\t * @instance Converts the value using a static method name from the `Unit` class.\n\t *\n\t * - **N.B.** *Provides IntelliSense and type safety for method selection.*\n\t *\n\t * @param methodName - A static `Unit` method that accepts a number and returns a number.\n\t * @returns The converted numeric value.\n\t */\n\tconvert(methodName: UnitNumberMethods): number {\n\t\tconst method = Unit[methodName];\n\n\t\tif (typeof method !== 'function') {\n\t\t\tthrow new Error(`Method ${methodName} is not a valid method!`);\n\t\t}\n\n\t\treturn method(this.#value);\n\t}\n\n\t// ! ----- Static Conversion Methods ----- ! //\n\n\t/**\n\t * @static Converts a value using scientific prefixes (e.g., kB to MB, mg to g).\n\t *\n\t * @param value The value to convert.\n\t * @param fromPrefix The SI prefix of the source unit.\n\t * @param toPrefix The SI prefix of the target unit.\n\t * @returns The converted numeric value.\n\t */\n\tstatic convertByPrefix(\n\t\tvalue: number,\n\t\tfromPrefix: SIPrefix,\n\t\ttoPrefix: SIPrefix,\n\t): number {\n\t\tconst fromMultiplier = PREFIX_MULTIPLIERS[fromPrefix];\n\t\tconst toMultiplier = PREFIX_MULTIPLIERS[toPrefix];\n\n\t\treturn (value * fromMultiplier) / toMultiplier;\n\t}\n\n\t/**\n\t * @static Converts from prefixed unit string to another (e.g., kB to MB, mg to g).\n\t *\n\t * @param value The numeric value.\n\t * @param from Prefixed unit string (e.g., 'kB', 'mg').\n\t * @param to Target prefixed unit string (e.g., 'MB', 'g').\n\t * @returns The converted numeric value.\n\t */\n\tstatic convertFromTo(value: number, from: string, to: string): number {\n\t\tconst extractPrefix = (str: string): [SIPrefix, string] => {\n\t\t\tconst match = str.match(/^(da|[yzafpnμumcdhkMGTPEZY]?)(.+)$/);\n\t\t\tif (!match) throw new Error(`Invalid unit format: ${str}`);\n\n\t\t\treturn [match[1] as SIPrefix, match[2]];\n\t\t};\n\n\t\tconst [fromPrefix, fromUnit] = extractPrefix(from);\n\t\tconst [toPrefix, toUnit] = extractPrefix(to);\n\n\t\tif (fromUnit !== toUnit) {\n\t\t\tthrow new Error(`Mismatched units: ${fromUnit} vs ${toUnit}`);\n\t\t}\n\n\t\treturn Unit.convertByPrefix(value, fromPrefix, toPrefix);\n\t}\n\n\t/** Converts meters to feet. */\n\tstatic metersToFeet(m: number): number {\n\t\treturn m * 3.28084;\n\t}\n\n\t/** Converts feet to meters. */\n\tstatic feetToMeters(ft: number): number {\n\t\treturn ft / 3.28084;\n\t}\n\n\t/** Converts kilometers to miles. */\n\tstatic kmToMiles(km: number): number {\n\t\treturn km * 0.621371;\n\t}\n\n\t/** Converts miles to kilometers. */\n\tstatic milesToKm(mi: number): number {\n\t\treturn mi / 0.621371;\n\t}\n\n\t/** Converts kilograms to pounds. */\n\tstatic kgToLbs(kg: number): number {\n\t\treturn kg * 2.20462;\n\t}\n\n\t/** Converts pounds to kilograms. */\n\tstatic lbsToKg(lbs: number): number {\n\t\treturn lbs / 2.20462;\n\t}\n\n\t/** Converts grams to ounces. */\n\tstatic gramsToOunces(g: number): number {\n\t\treturn g * 0.035274;\n\t}\n\n\t/** Converts ounces to grams. */\n\tstatic ouncesToGrams(oz: number): number {\n\t\treturn oz / 0.035274;\n\t}\n\n\t/** Converts Celsius to Fahrenheit. */\n\tstatic celsiusToFahrenheit(c: number): number {\n\t\treturn (c * 9) / 5 + 32;\n\t}\n\n\t/** Converts Fahrenheit to Celsius. */\n\tstatic fahrenheitToCelsius(f: number): number {\n\t\treturn ((f - 32) * 5) / 9;\n\t}\n\n\t/** Converts Celsius to Kelvin. */\n\tstatic celsiusToKelvin(c: number): number {\n\t\treturn c + 273.15;\n\t}\n\n\t/** Converts Kelvin to Celsius. */\n\tstatic kelvinToCelsius(k: number): number {\n\t\treturn k - 273.15;\n\t}\n\n\t/** Converts Fahrenheit to Kelvin. */\n\tstatic fahrenheitToKelvin(f: number): number {\n\t\treturn ((f - 32) * 5) / 9 + 273.15;\n\t}\n\n\t/** Converts Kelvin to Fahrenheit. */\n\tstatic kelvinToFahrenheit(k: number): number {\n\t\treturn ((k - 273.15) * 9) / 5 + 32;\n\t}\n\n\t/** Converts milliliters to liters. */\n\tstatic mlToLiters(ml: number): number {\n\t\treturn ml / 1000;\n\t}\n\n\t/** Converts liters to milliliters. */\n\tstatic litersToMl(l: number): number {\n\t\treturn l * 1000;\n\t}\n\n\t/** Converts gallons to milliliters. */\n\tstatic gallonsToMl(gal: number): number {\n\t\treturn gal * 3785.41;\n\t}\n\n\t/** Converts milliliters to gallons. */\n\tstatic mlToGallons(ml: number): number {\n\t\treturn ml / 3785.41;\n\t}\n\n\t/** Converts liters to gallons. */\n\tstatic litersToGallons(l: number): number {\n\t\treturn l * 0.264172;\n\t}\n\n\t/** Converts gallons to liters. */\n\tstatic gallonsToLiters(gal: number): number {\n\t\treturn gal / 0.264172;\n\t}\n\n\t/** Converts square meters to square feet. */\n\tstatic sqmToSqft(sqm: number): number {\n\t\treturn sqm * 10.7639;\n\t}\n\n\t/** Converts square feet to square meters. */\n\tstatic sqftToSqm(sqft: number): number {\n\t\treturn sqft / 10.7639;\n\t}\n\n\t/** Converts kilometers per hour to miles per hour. */\n\tstatic kmphToMph(kmph: number): number {\n\t\treturn kmph * 0.621371;\n\t}\n\n\t/** Converts miles per hour to kilometers per hour. */\n\tstatic mphToKmph(mph: number): number {\n\t\treturn mph / 0.621371;\n\t}\n\n\t/** Converts minutes to hours. */\n\tstatic minutesToHours(min: number): number {\n\t\treturn min / 60;\n\t}\n\n\t/** Converts seconds to minutes. */\n\tstatic secondsToMinutes(sec: number): number {\n\t\treturn sec / 60;\n\t}\n\n\t/** Converts hours to days. */\n\tstatic hoursToDays(hr: number): number {\n\t\treturn hr / 24;\n\t}\n\n\t/** Converts hours to minutes. */\n\tstatic hoursToMinutes(h: number): number {\n\t\treturn h * 60;\n\t}\n\n\t/** Converts minutes to seconds. */\n\tstatic minutesToSeconds(m: number): number {\n\t\treturn m * 60;\n\t}\n\n\t/** Converts days to hours. */\n\tstatic daysToHours(d: number): number {\n\t\treturn d * 24;\n\t}\n\n\t/** Converts megabytes to gigabytes. */\n\tstatic mbToGb(mb: number): number {\n\t\treturn mb / 1024;\n\t}\n\n\t/** Converts gigabytes to megabytes. */\n\tstatic gbToMb(gb: number): number {\n\t\treturn gb * 1024;\n\t}\n\n\t/** Converts kilobytes to megabytes. */\n\tstatic kbToMb(kb: number): number {\n\t\treturn kb / 1024;\n\t}\n\n\t/** Converts kilobytes to gigabytes. */\n\tstatic kbToGb(kb: number): number {\n\t\treturn kb / (1024 * 1024);\n\t}\n\n\t/** Converts gigabytes to kilobytes. */\n\tstatic gbToKb(gb: number): number {\n\t\treturn gb * 1024 * 1024;\n\t}\n\n\t/** Converts bytes to kilobytes. */\n\tstatic bytesToKb(bytes: number): number {\n\t\treturn bytes / 1024;\n\t}\n\n\t/** Converts kilobytes to bytes. */\n\tstatic kbToBytes(kb: number): number {\n\t\treturn kb * 1024;\n\t}\n\n\t/** Converts megabytes to kilobytes. */\n\tstatic mbToKb(mb: number): number {\n\t\treturn mb * 1024;\n\t}\n\n\t/** Converts gigabytes to terabytes. */\n\tstatic gbToTb(gb: number): number {\n\t\treturn gb / 1024;\n\t}\n\n\t/** Converts terabytes to gigabytes. */\n\tstatic tbToGb(tb: number): number {\n\t\treturn tb * 1024;\n\t}\n\n\t/** Converts joules to calories. */\n\tstatic joulesToCalories(j: number): number {\n\t\treturn j * 0.239006;\n\t}\n\n\t/** Converts calories to joules. */\n\tstatic caloriesToJoules(cal: number): number {\n\t\treturn cal / 0.239006;\n\t}\n\n\t/** Converts calories to kilojoules. */\n\tstatic caloriesToKJoules(cal: number): number {\n\t\treturn cal / 0.239006 / 1000;\n\t}\n\n\t/** Converts kilojoules to calories. */\n\tstatic kJoulesToCalories(kj: number): number {\n\t\treturn kj * 1000 * 0.239006;\n\t}\n\n\t/** Converts atmospheres to pascals. */\n\tstatic atmToPascal(atm: number): number {\n\t\treturn atm * 101325;\n\t}\n\n\t/** Converts pascals to atmospheres. */\n\tstatic pascalToAtm(pa: number): number {\n\t\treturn pa / 101325;\n\t}\n\n\t/** Converts bar to pascals. */\n\tstatic barToPascal(bar: number): number {\n\t\treturn bar * 100000;\n\t}\n\n\t/** Converts pascals to bar. */\n\tstatic pascalToBar(pa: number): number {\n\t\treturn pa / 100000;\n\t}\n\n\t/** Converts hertz to kilohertz. */\n\tstatic hzToKHz(hz: number): number {\n\t\treturn hz / 1000;\n\t}\n\n\t/** Converts kilohertz to hertz. */\n\tstatic kHzToHz(khz: number): number {\n\t\treturn khz * 1000;\n\t}\n\n\t/** Converts hertz to megahertz. */\n\tstatic hzToMHz(hz: number): number {\n\t\treturn hz / 1_000_000;\n\t}\n\n\t/** Converts megahertz to hertz. */\n\tstatic mHzToHz(mhz: number): number {\n\t\treturn mhz * 1_000_000;\n\t}\n\n\t/** Converts kilohertz to megahertz. */\n\tstatic kHzToMHz(khz: number): number {\n\t\treturn khz / 1000;\n\t}\n\n\t/** Converts megahertz to kilohertz. */\n\tstatic mHzToKHz(mhz: number): number {\n\t\treturn mhz * 1000;\n\t}\n\n\t/** Converts centimeters to meters. */\n\tstatic cmToMeters(cm: number): number {\n\t\treturn cm / 100;\n\t}\n\n\t/** Converts meters to centimeters. */\n\tstatic metersToCm(m: number): number {\n\t\treturn m * 100;\n\t}\n\n\t/** Converts millimeters to meters. */\n\tstatic mmToMeters(mm: number): number {\n\t\treturn mm / 1000;\n\t}\n\n\t/** Converts meters to millimeters. */\n\tstatic metersToMm(m: number): number {\n\t\treturn m * 1000;\n\t}\n\n\t/** Converts square kilometers to square meters. */\n\tstatic sqkmToSqm(sqkm: number): number {\n\t\treturn sqkm * 1_000_000;\n\t}\n\n\t/** Converts square meters to square kilometers. */\n\tstatic sqmToSqkm(sqm: number): number {\n\t\treturn sqm / 1_000_000;\n\t}\n\n\t/** Converts square feet to square inches. */\n\tstatic sqftToSqin(sqft: number): number {\n\t\treturn sqft * 144;\n\t}\n\n\t/** Converts square inches to square feet. */\n\tstatic sqinToSqft(sqin: number): number {\n\t\treturn sqin / 144;\n\t}\n\n\t/** Converts watts to kilowatts. */\n\tstatic wattsToKw(w: number): number {\n\t\treturn w / 1000;\n\t}\n\n\t/** Converts kilowatts to watts. */\n\tstatic kwToWatts(kw: number): number {\n\t\treturn kw * 1000;\n\t}\n}\n","/**\n * * Check if a number is even or not.\n *\n * @param input The number to check.\n * @returns Boolean: `true` if even and `false` if not even.\n */\nexport const isEven = (input: number): boolean => {\n\treturn input % 2 === 0;\n};\n\n/**\n * * Checks if a number is odd or not.\n *\n * @param input The number to check.\n * @returns Boolean: `true` if odd and `false` if not odd.\n */\nexport const isOdd = (input: number): boolean => {\n\treturn input % 2 !== 0;\n};\n\n/**\n * * Checks if a number is a multiple of another number.\n *\n * @param input - The number to check.\n * @param multipleOf - The number to check against.\n * @returns `true` if `input` is a multiple of `multipleOf`, otherwise `false`.\n */\nexport const isMultiple = (input: number, multipleOf: number): boolean => {\n\treturn input % multipleOf === 0;\n};\n\n/**\n * * Checks if a number is a perfect square.\n *\n * @param num The number to check.\n * @returns `true` if the number is a perfect square, otherwise `false`.\n */\nexport function isPerfectSquare(num: number): boolean {\n\treturn Number.isInteger(Math.sqrt(num));\n}\n\n/**\n * * Checks if a number is part of the Fibonacci sequence.\n *\n * @param num The number to check.\n * @returns `true` if the number is a Fibonacci number, otherwise `false`.\n */\nexport function isFibonacci(num: number): boolean {\n\treturn (\n\t\tisPerfectSquare(5 * num * num + 4) || isPerfectSquare(5 * num * num - 4)\n\t);\n}\n\n/**\n * * Checks whether any input is not a finite number.\n *\n * @param numbers - The list of numbers to validate.\n * @returns `true` if any input is not finite.\n */\nexport function areInvalidNumbers(...numbers: number[]): boolean {\n\treturn numbers?.some((n) => !Number.isFinite(n));\n}\n","import { getAverage } from './basics';\nimport { areInvalidNumbers } from './guards';\nimport type { PercentageOptions } from './types';\n\n/**\n * * Performs a percentage-related calculation based on the given mode and inputs.\n *\n * - `get-percent`: Calculates what percentage the `part` is of the `total`.\n * - `get-value`: Calculates the value from a given `percentage` of a `total`.\n * - `get-original`: Calculates the original value from a known `value` and `percentage`.\n * - `get-change-percent`: Percent increase/decrease from `oldValue` to `newValue`.\n * - `apply-percent-change`: Applies increase/decrease by `percentage` to `baseValue`.\n * - `get-percent-difference`: Absolute percent difference between two values.\n * - `inverse-percent`: What percent `total` is of `part`.\n *\n * @param options - The calculation mode and inputs required for the operation.\n * @returns The calculated number rounded to three decimal places, or `NaN` if input is invalid.\n */\nexport function calculatePercentage(options: PercentageOptions): number {\n\tconst { roundTo = 3 } = options;\n\n\t/**\n\t * - Rounds a number to the specified number of decimal places.\n\t *\n\t * @param num - The number to round.\n\t * @returns The rounded number.\n\t */\n\tconst _roundNumber = (num: number) => {\n\t\tconst factor = Math.pow(10, roundTo);\n\n\t\treturn Math.round(num * factor) / factor;\n\t};\n\n\tswitch (options?.mode) {\n\t\tcase 'get-percent': {\n\t\t\tconst { part, total } = options;\n\n\t\t\tif (areInvalidNumbers(part, total) || total === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\treturn _roundNumber((part / total) * 100);\n\t\t}\n\n\t\tcase 'get-value': {\n\t\t\tconst { percentage, total } = options;\n\n\t\t\tif (areInvalidNumbers(percentage, total) || total === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\treturn _roundNumber((percentage / 100) * total);\n\t\t}\n\n\t\tcase 'get-original': {\n\t\t\tconst { percentage, value } = options;\n\n\t\t\tif (areInvalidNumbers(percentage, value) || percentage === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\treturn _roundNumber((value / percentage) * 100);\n\t\t}\n\n\t\tcase 'get-change-percent': {\n\t\t\tconst { oldValue, newValue } = options;\n\n\t\t\tif (areInvalidNumbers(oldValue, newValue) || oldValue === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\tconst change = ((newValue - oldValue) / oldValue) * 100;\n\n\t\t\treturn _roundNumber(change);\n\t\t}\n\n\t\tcase 'apply-percent-change': {\n\t\t\tconst { baseValue, percentage } = options;\n\n\t\t\tif (areInvalidNumbers(baseValue, percentage)) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\tconst value = baseValue * (1 + percentage / 100);\n\n\t\t\treturn _roundNumber(value);\n\t\t}\n\n\t\tcase 'get-percent-difference': {\n\t\t\tconst { value1, value2 } = options;\n\n\t\t\tif (areInvalidNumbers(value1, value2)) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\tconst avg = getAverage(value1, value2);\n\n\t\t\tif (avg === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\tconst diff = (Math.abs(value1 - value2) / avg) * 100;\n\n\t\t\treturn _roundNumber(diff);\n\t\t}\n\n\t\tcase 'inverse-percent': {\n\t\t\tconst { part, total } = options;\n\n\t\t\tif (areInvalidNumbers(part, total) || part === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\treturn _roundNumber((total / part) * 100);\n\t\t}\n\n\t\tdefault:\n\t\t\treturn NaN;\n\t}\n}\n","import type { Numeric } from '../types';\n\n/**\n * * Generates the first `limit` Fibonacci numbers.\n *\n * @param limit The number of Fibonacci numbers to generate.\n * @returns An array containing the first `limit` Fibonacci numbers.\n */\nexport function getFibonacciSeries(limit: Numeric): number[] {\n\tconst cLimit = Number(limit);\n\n\tif (!Number.isFinite(cLimit) || cLimit <= 0) {\n\t\treturn [];\n\t}\n\n\tif (cLimit === 1) return [0];\n\n\tconst series: number[] = [0, 1];\n\n\tfor (let i = 2; i < cLimit; i++) {\n\t\tseries.push(series[i - 1] + series[i - 2]);\n\t}\n\n\treturn series;\n}\n\n/**\n * * Generates the first `limit` Fibonacci numbers using recursion with memoization.\n *\n * @param limit - The number of Fibonacci numbers to generate.\n * @returns An array containing the first `limit` Fibonacci numbers.\n */\nexport function getFibonacciSeriesMemo(limit: Numeric): number[] {\n\tconst cLimit = Number(limit);\n\n\tif (!Number.isFinite(cLimit) || cLimit <= 0) return [];\n\n\tif (cLimit === 1) return [0];\n\n\tconst memo = new Map<number, number>([\n\t\t[0, 0],\n\t\t[1, 1],\n\t]);\n\n\tconst fib = (n: number): number => {\n\t\tif (memo.has(n)) return memo.get(n)!;\n\t\tconst val = fib(n - 1) + fib(n - 2);\n\t\tmemo.set(n, val);\n\t\treturn val;\n\t};\n\n\treturn Array.from({ length: cLimit }, (_, i) => fib(i));\n}\n\n/**\n * * Generator function for Fibonacci sequence up to a given limit.\n *\n * @param limit - Number of Fibonacci numbers to generate.\n * @param onYield - Optional callback triggered on each yield with the current value and index.\n * @returns A generator yielding Fibonacci numbers one by one.\n */\nexport function* fibonacciGenerator(\n\tlimit: Numeric,\n\tonYield?: (value: number, index: number) => void,\n): Generator<number, void, void> {\n\tconst cLimit = Number(limit);\n\n\tif (!Number.isFinite(cLimit) || cLimit < 0) return;\n\n\tlet a = 0;\n\tlet b = 1;\n\n\tfor (let i = 0; i < cLimit; i++) {\n\t\tonYield?.(a, i);\n\t\tyield a;\n\t\t[a, b] = [b, a + b];\n\t}\n}\n\n/**\n * * Calculates the `n`-th Fibonacci number using optimized space.\n *\n * @param index - The index (0-based) of the Fibonacci number.\n * @returns The index=`n`-th Fibonacci number.\n */\nexport function getNthFibonacci(index: Numeric): number {\n\tconst n = Number(index);\n\n\tif (!Number.isFinite(n) || n < 0) return NaN;\n\tif (n === 0) return 0;\n\tif (n === 1) return 1;\n\n\tlet a = 0,\n\t\tb = 1;\n\n\tfor (let i = 2; i <= n; i++) {\n\t\t[a, b] = [b, a + b];\n\t}\n\n\treturn b;\n}\n","import type { Numeric } from '../types';\nimport { THOUSANDS } from './constants';\nimport { _convertLessThanThousand } from './helpers';\n\n/**\n * * Converts a numeric value into its corresponding English word representation.\n * @warning ***Supports numeric values up to `10e19` or `10^20` (one hundred quintillion).***\n * @warning ***Decimal values are ignored; only the integer part is converted.***\n * @param number - The number to convert into words.\n * @returns The number converted in words.\n */\nexport function numberToWords(num: Numeric): string {\n\tlet number = Math.trunc(Number(num));\n\n\tif (!Number.isFinite(number) || isNaN(number)) {\n\t\treturn 'Invalid Number!';\n\t}\n\n\tconst isNegative = number < 0;\n\n\tif (number === 0) return 'zero';\n\n\tnumber = Math.abs(number);\n\n\tlet i = 0;\n\tlet result = '';\n\n\twhile (number > 0) {\n\t\tif (i >= THOUSANDS.length) {\n\t\t\treturn `Number exceeds supported range (max is 10e19 aka 10^20)`;\n\t\t}\n\n\t\tif (number % 1000 !== 0) {\n\t\t\tconst isLastGroup = i === 0 && number % 100 < 100;\n\t\t\tconst prefix = _convertLessThanThousand(number % 1000, isLastGroup);\n\n\t\t\tresult = `${prefix} ${THOUSANDS[i]} ${result}`;\n\t\t}\n\n\t\tnumber = Math.floor(number / 1000);\n\n\t\ti++;\n\t}\n\n\tconst finalResult = result.trim().replace(/\\s+/g, ' ');\n\n\treturn isNegative ? `minus ${finalResult}` : finalResult;\n}\n\n/**\n * * Converts a number to a Roman numeral.\n * @param num - The number to convert. Number must be `between 1 and 3999`.\n * @returns The Roman numeral representation.\n *\n * @example convertToRomanNumerals(29) → \"XXIX\"\n */\nexport const convertToRomanNumerals = (num: Numeric): string => {\n\tlet number = Number(num);\n\n\tif (number <= 0 || number >= 4000)\n\t\tthrow new RangeError('Number must be between 1 and 3999');\n\n\tconst romanMap: [number, string][] = [\n\t\t[1000, 'M'],\n\t\t[900, 'CM'],\n\t\t[500, 'D'],\n\t\t[400, 'CD'],\n\t\t[100, 'C'],\n\t\t[90, 'XC'],\n\t\t[50, 'L'],\n\t\t[40, 'XL'],\n\t\t[10, 'X'],\n\t\t[9, 'IX'],\n\t\t[5, 'V'],\n\t\t[4, 'IV'],\n\t\t[1, 'I'],\n\t];\n\n\tlet result = '';\n\tfor (const [value, numeral] of romanMap) {\n\t\twhile (number >= value) {\n\t\t\tresult += numeral;\n\t\t\tnumber -= value;\n\t\t}\n\t}\n\treturn result;\n};\n","/**\n * * Checks if a number is prime.\n *\n * @param number The number to check.\n * @returns Boolean: `true` if the number is prime, otherwise `false`.\n */\nexport const isPrime = (number: number): boolean => {\n\tif (number < 2) return false;\n\tif (number === 2 || number === 3) return true;\n\tif (number % 2 === 0 || number % 3 === 0) return false;\n\n\tfor (let i = 5; i * i <= number; i += 6) {\n\t\tif (number % i === 0 || number % (i + 2) === 0) return false;\n\t}\n\n\treturn true;\n};\n\n/**\n * * Find prime numbers in a given range.\n *\n * @param start The starting number of the range. Default is `1`.\n * @param end The ending number of the range. Default is `1000`.\n * @returns An array of prime numbers within the range (inclusive).\n */\nexport const findPrimeNumbers = (start = 1, end = 1000): number[] => {\n\tlet startNumber = start,\n\t\tendNumber = end;\n\n\tif (start > end) {\n\t\t[startNumber, endNumber] = [end, start];\n\t}\n\n\treturn Array.from(\n\t\t{ length: endNumber - startNumber + 1 },\n\t\t(_, i) => startNumber + i,\n\t).filter(isPrime);\n};\n","import type { GenericObject } from '../object/types';\nimport type { Flattened } from './types';\n\n/**\n * * Flattens a nested array recursively or wraps any non-array data type in an array.\n *\n * @param input - The input value, which can be a nested array or a non-array value.\n * @returns A fully flattened array of type `Flatten<T>`. If the input is not an array, it wraps it in a single-element array.\n */\nexport const flattenArray = <T>(input: T | T[]): Flattened<T>[] => {\n\tif (!Array.isArray(input)) return [input] as Flattened<T>[];\n\n\treturn input.reduce<Flattened<T>[]>((acc, item) => {\n\t\t// If item is an array, recursively flatten it; otherwise, add it directly.\n\t\treturn acc.concat(Array.isArray(item) ? flattenArray(item) : [item]);\n\t}, []);\n};\n\n/**\n * @deprecated _Please, use `findAll` instance method from `Finder` class for **more advanced filtering and searching.**_\n *\n * * Filters an array of objects based on multiple conditions for specified keys.\n * @param array - The array of objects to filter.\n * @param conditions - An object where keys represent the property names and values represent filter conditions.\n * The conditions can be a function `(value: T[K]) => boolean`.\n * @returns The filtered array of objects.\n * @throws `Error` If the input is not a valid array.\n */\nexport const filterArrayOfObjects = <T extends GenericObject>(\n\tarray: T[],\n\tconditions: { [K in keyof T]?: (value: T[K] | undefined) => boolean },\n): T[] => {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('The provided input is not a valid array!');\n\t}\n\n\treturn array?.filter((item) =>\n\t\tObject.entries(conditions)?.every(([key, conditionFn]) => {\n\t\t\tif (typeof conditionFn === 'function') {\n\t\t\t\treturn conditionFn(\n\t\t\t\t\titem[key as keyof T] as T[keyof T] | undefined,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn true;\n\t\t}),\n\t);\n};\n\n/**\n * * Checks if a value is an empty array or an array with only empty values.\n *\n * @param value - The value to check.\n * @returns `true` if the value is not an array, an empty array, or an array containing only `null`, `undefined`, empty objects, or empty arrays.\n */\nexport const isInvalidOrEmptyArray = <T>(value: T): boolean => {\n\tif (!Array.isArray(value)) return true;\n\n\tif (value?.length === 0) return true;\n\n\treturn value?.every(\n\t\t(item) =>\n\t\t\titem == null ||\n\t\t\t(Array.isArray(item) && item?.length === 0) ||\n\t\t\t(typeof item === 'object' && Object.keys(item || {})?.length === 0),\n\t);\n};\n\n/**\n * * Shuffle the elements of an array.\n *\n * @param array Array to shuffle.\n * @returns Shuffled array.\n */\nexport const shuffleArray = <T>(array: T[]): T[] => {\n\tif (isInvalidOrEmptyArray(array)) return array;\n\n\tconst shuffled = structuredClone(array);\n\n\tfor (let i = shuffled?.length - 1; i > 0; i--) {\n\t\tconst j = Math.floor(Math.random() * (i + 1));\n\t\t[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];\n\t}\n\n\treturn shuffled;\n};\n\n/**\n * * Get the last element of an array.\n *\n * @param array Array to get the last element from.\n * @returns The last element or `undefined` if the array is empty.\n */\nexport const getLastArrayElement = <T>(array: T[]): T | undefined => {\n\treturn array?.length > 0 ? array[array?.length - 1] : undefined;\n};\n","import type { GenericObject } from '../object/types';\nimport type { AsyncFunction, GenericFn } from '../types';\nimport { isString } from './primitives';\n\n/**\n * * Type guard to check if a value is an array.\n * @param value - The value to check.\n * @returns `true` if the value is an array, otherwise `false`.\n */\nexport function isArray<T>(value: unknown): value is Array<T> {\n\treturn Array.isArray(value);\n}\n\n/**\n * * Type guard to check if a value is an array with length.\n * @param value - The value to check.\n * @returns `true` if the value is an array with length, otherwise `false`.\n */\nexport function isValidArray<T>(value: unknown): value is Array<T> {\n\treturn Array.isArray(value) && value?.length > 0;\n}\n\n/**\n * * Type guard to check if a value is an object (excluding null).\n * @param value - The value to check.\n * @returns `true` if the value is an object, otherwise `false`.\n */\nexport function isObject(value: unknown): value is Record<string, unknown> {\n\treturn value !== null && typeof value === 'object' && !isArray(value);\n}\n\n/**\n * * Type guard to check if a value is an object (excluding null) and has keys in it.\n * @param value - The value to check.\n * @returns `true` if the value is an object with valid keys, otherwise `false`.\n */\nexport function isNotEmptyObject(\n\tvalue: unknown,\n): value is Record<string, unknown> {\n\treturn isObject(value) && Object.keys(value)?.length > 0;\n}\n\n/**\n * * Type guard to check if a value is an object with specific keys.\n * @param value - The value to check.\n * @param keys - The set of keys the object should contain.\n * @returns `true` if the value is an object with the specified keys, otherwise `false`.\n */\nexport function isObjectWithKeys<T extends Record<string, unknown>>(\n\tvalue: unknown,\n\tkeys: (keyof T)[],\n): value is T {\n\treturn isObject(value) && keys?.every((key) => key in value);\n}\n\n/**\n * * Type guard to check if a value is an empty object.\n * @param value - The value to check.\n * @returns `true` if the value is an empty object, otherwise `false`.\n */\nexport function isEmptyObject<T extends GenericObject>(value: T): boolean {\n\treturn isObject(value) && Object.keys(value)?.length === 0;\n}\n\n/**\n * * Type guard to check if a value is a function.\n * @param value - The value to check.\n * @returns `true` if the value is a function, otherwise `false`.\n */\nexport function isFunction(value: unknown): value is GenericFn {\n\treturn typeof value === 'function';\n}\n\n/**\n * * Determines whether the provided property descriptor represents a method.\n *\n * @param descriptor - The property descriptor to check.\n * @returns `true` if the descriptor is defined and its value is a function; otherwise, `false`.\n */\nexport const isMethodDescriptor = (\n\tdescriptor: PropertyDescriptor | undefined,\n): boolean => {\n\treturn !!descriptor && typeof descriptor?.value === 'function';\n};\n\n/**\n * * Type guard to check if a value is a Date object.\n * @param value - The value to check.\n * @returns `true` if the value is a Date object, otherwise `false`.\n */\nexport function isDate(value: unknown): value is Date {\n\treturn value instanceof Date;\n}\n\n/**\n * * Type guard to check if a value is an array of a specific type.\n * @param value - The value to check.\n * @param typeCheck - The type guard function to check each item of the array.\n * @returns `true` if the value is an array of the specified type, otherwise `false`.\n */\nexport function isArrayOfType<T>(\n\tvalue: unknown,\n\ttypeCheck: (item: unknown) => item is T,\n): value is T[] {\n\treturn isArray(value) && value?.every(typeCheck);\n}\n\n/**\n * * Type guard to check if a value is a Promise.\n * @param value - The value to check.\n * @returns `true` if the value is a Promise, otherwise `false`.\n */\nexport function isPromise(value: unknown): value is Promise<unknown> {\n\treturn isObject(value) && isFunction(value.then);\n}\n\n/**\n * * Type guard to check if a value is a Set.\n * @param value - The value to check.\n * @returns `true` if the value is a Set, otherwise `false`.\n */\nexport function isSet<T>(value: unknown): value is Set<T> {\n\treturn value instanceof Set;\n}\n\n/**\n * * Type guard to check if a value is a Map.\n * @param value - The value to check.\n * @returns `true` if the value is a Map, otherwise `false`.\n */\nexport function isMap<K, V>(value: unknown): value is Map<K, V> {\n\treturn value instanceof Map;\n}\n\n/**\n * * Type guard to check if a value is a RegExp.\n * @param value - The value to check.\n * @returns `true` if the value is a RegExp, otherwise `false`.\n */\nexport function isRegExp(value: unknown): value is RegExp {\n\treturn value instanceof RegExp;\n}\n\n/**\n * * Type guard to check if a value is an Error object.\n * @param value - The value to check.\n * @returns `true` if the value is an Error object, otherwise `false`.\n */\nexport function isError(value: unknown): value is Error {\n\treturn value instanceof Error;\n}\n\n/**\n * * Type guard to check if a string is valid JSON.\n * @param value - The value to check.\n * @returns `true` if the value is valid JSON, otherwise `false`.\n */\nexport function isJSON(value: unknown): value is string {\n\tif (!isString(value)) return false;\n\n\ttry {\n\t\tJSON.parse(value);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/**\n * * Type guard to check if a function returns a Promise.\n * @param fn - The function to check.\n * @returns `true` if the function returns a Promise, otherwise `false`.\n */\nexport function isReturningPromise<T>(fn: unknown): fn is AsyncFunction<T> {\n\treturn isFunction(fn) && fn.constructor?.name === 'AsyncFunction';\n}\n","import type { SortNature } from './types';\n\n/**\n * * Compare two strings using natural sorting (e.g., \"file2\" < \"file10\").\n * Optionally supports case-insensitive and locale-aware string chunk comparisons.\n *\n * @param a - The first string to compare.\n * @param b - The second string to compare.\n * @param options - Optional settings to configure comparison behavior.\n * @param options.caseInsensitive - If true, compares string chunks without case sensitivity. Defaults to `true`.\n * @param options.localeAware - If true, uses localeCompare for string chunk comparisons. Defaults to `false`.\n * @returns A negative number if `a` comes before `b`, a positive number if `a` comes after `b`, or 0 if equal.\n */\nexport function naturalSort(\n\ta: string,\n\tb: string,\n\toptions?: SortNature,\n): number {\n\tconst { caseInsensitive = true, localeAware = false } = options || {};\n\n\t/**\n\t * * Splits a string into an array of number and non-number chunks.\n\t * @param str - The string to split.\n\t * @returns An array of string and number parts.\n\t */\n\tconst _createChunks = (str: string): (string | number)[] => {\n\t\tconst chunks: (string | number)[] = [];\n\n\t\tlet current = '';\n\t\tlet isNumeric = false;\n\n\t\tfor (const char of str) {\n\t\t\tconst charIsNum = !Number.isNaN(Number(char));\n\n\t\t\tif (current?.length === 0) {\n\t\t\t\tcurrent = char;\n\t\t\t\tisNumeric = charIsNum;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (charIsNum === isNumeric) {\n\t\t\t\tcurrent += char;\n\t\t\t} else {\n\t\t\t\tchunks?.push(isNumeric ? Number(current) : current);\n\t\t\t\tcurrent = char;\n\t\t\t\tisNumeric = charIsNum;\n\t\t\t}\n\t\t}\n\n\t\tif (current?.length > 0) {\n\t\t\tchunks?.push(isNumeric ? Number(current) : current);\n\t\t}\n\n\t\treturn chunks;\n\t};\n\n\tconst aChunks = _createChunks(a);\n\tconst bChunks = _createChunks(b);\n\n\tfor (let i = 0; i < Math.min(aChunks?.length, bChunks?.length); i++) {\n\t\tlet aChunk = aChunks[i];\n\t\tlet bChunk = bChunks[i];\n\n\t\t// Normalize string chunks if case-insensitive\n\t\tif (\n\t\t\tcaseInsensitive &&\n\t\t\ttypeof aChunk === 'string' &&\n\t\t\ttypeof bChunk === 'string'\n\t\t) {\n\t\t\taChunk = aChunk?.toLowerCase();\n\t\t\tbChunk = bChunk?.toLowerCase();\n\t\t}\n\n\t\t// Compare types: number vs string\n\t\tif (typeof aChunk !== typeof bChunk) {\n\t\t\treturn typeof aChunk === 'string' ? 1 : -1;\n\t\t}\n\n\t\t// Compare same-type chunks\n\t\tif (aChunk !== bChunk) {\n\t\t\tif (typeof aChunk === 'number' && typeof bChunk === 'number') {\n\t\t\t\treturn aChunk - bChunk;\n\t\t\t}\n\n\t\t\tif (typeof aChunk === 'string' && typeof bChunk === 'string') {\n\t\t\t\tif (localeAware) {\n\t\t\t\t\tconst cmp = aChunk.localeCompare(bChunk, undefined, {\n\t\t\t\t\t\tsensitivity: caseInsensitive ? 'accent' : 'variant',\n\t\t\t\t\t});\n\t\t\t\t\tif (cmp !== 0) return cmp;\n\t\t\t\t}\n\t\t\t\treturn aChunk < bChunk ? -1 : 1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn aChunks?.length - bChunks?.length;\n}\n","import {\n\tisArrayOfType,\n\tisObject,\n\tisValidArray,\n} from '../guards/non-primitives';\nimport { isBoolean, isNumber, isString } from '../guards/primitives';\nimport type { GenericObject } from '../object/types';\nimport type { OrderOption, SortByOption, SortOptions } from './types';\nimport { naturalSort } from './utils';\n\n/**\n * * Sorts an array of objects.\n *\n * - Sorts array by the specified field.\n *\n * @param array - The array of objects to sort.\n * @param options - Sorting options.\n * @returns The sorted array.\n */\nexport function sortAnArray<T extends GenericObject>(\n\tarray: T[],\n\toptions: SortByOption<T>,\n): T[];\n\n/**\n * * Sorts an array of `strings`, `numbers` or `boolean`.\n *\n * @param array - The array of `strings`, `numbers` or `boolean` to sort.\n * @param options - Sorting options.\n * @returns The sorted array.\n */\nexport function sortAnArray<T extends string | number | boolean>(\n\tarray: T[],\n\toptions?: OrderOption,\n): T[];\n\n/**\n * * Sorts an array of strings, numbers, booleans, or objects based on the provided options.\n *\n * - If the array contains strings, it sorts them alphabetically.\n * - If the array contains numbers, it sorts them numerically.\n * - If the array contains booleans, it sorts them by their boolean value.\n * - If the array contains objects, it sorts them by the specified field in the options `sortByField`.\n *\n * @param array - The array to sort.\n * @param options - Sorting options for objects.\n * @returns The sorted array.\n */\nexport function sortAnArray<\n\tT extends number | string | boolean | GenericObject,\n>(array: T[], options?: SortOptions<T>): T[] {\n\tif (!isValidArray(array)) return array;\n\n\t// Check if the array contains strings\n\tif (isArrayOfType(array, isString)) {\n\t\treturn [...array].sort((a, b) =>\n\t\t\toptions?.sortOrder === 'desc' ?\n\t\t\t\tnaturalSort(b, a)\n\t\t\t:\tnaturalSort(a, b),\n\t\t);\n\t}\n\n\t// Check if the array contains numbers\n\tif (isArrayOfType(array, isNumber)) {\n\t\treturn [...array].sort((a, b) =>\n\t\t\toptions?.sortOrder === 'desc' ? b - a : a - b,\n\t\t);\n\t}\n\n\t// Check if the array contains booleans\n\tif (isArrayOfType(array, isBoolean)) {\n\t\treturn [...array].sort((a, b) =>\n\t\t\toptions?.sortOrder === 'desc' ?\n\t\t\t\tNumber(b) - Number(a)\n\t\t\t:\tNumber(a) - Number(b),\n\t\t);\n\t}\n\n\t// Handle array of objects\n\tif (isArrayOfType(array, isObject) && options && 'sortByField' in options) {\n\t\treturn [...array].sort((a, b) => {\n\t\t\tconst _getKeyValue = (obj: T, path: string): unknown => {\n\t\t\t\treturn path\n\t\t\t\t\t.split('.')\n\t\t\t\t\t.reduce<unknown>(\n\t\t\t\t\t\t(acc, key) => (acc as T)?.[key as keyof T],\n\t\t\t\t\t\tobj,\n\t\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst keyA = _getKeyValue(a, options?.sortByField);\n\t\t\tconst keyB = _getKeyValue(b, options?.sortByField);\n\n\t\t\tif (keyA == null || keyB == null) {\n\t\t\t\treturn keyA == null ? 1 : -1;\n\t\t\t}\n\n\t\t\tif (typeof keyA === 'string' && typeof keyB === 'string') {\n\t\t\t\treturn options?.sortOrder === 'desc' ?\n\t\t\t\t\t\tnaturalSort(keyB, keyA)\n\t\t\t\t\t:\tnaturalSort(keyA, keyB);\n\t\t\t}\n\n\t\t\tif (typeof keyA === 'number' && typeof keyB === 'number') {\n\t\t\t\treturn options?.sortOrder === 'desc' ?\n\t\t\t\t\t\tkeyB - keyA\n\t\t\t\t\t:\tkeyA - keyB;\n\t\t\t}\n\n\t\t\tif (typeof keyA === 'boolean' && typeof keyB === 'boolean') {\n\t\t\t\treturn options?.sortOrder === 'desc' ?\n\t\t\t\t\t\tNumber(keyB) - Number(keyA)\n\t\t\t\t\t:\tNumber(keyA) - Number(keyB);\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t});\n\t}\n\n\treturn array;\n}\n","import { isArray } from './non-primitives';\nimport { isString } from './primitives';\n\n/**\n * * Type guard to check if a value is a valid email string.\n * @param value - The value to check.\n * @returns `true` if the value is a valid email, otherwise `false`.\n */\nexport function isEmail(value: unknown): value is string {\n\treturn (\n\t\tisString(value) &&\n\t\t/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/.test(value)\n\t);\n}\n\n/**\n * * Type guard to check if a value is an array of valid email strings.\n * @param value - The value to check.\n * @returns `true` if the value is an array of valid email strings, otherwise `false`.\n */\nexport function isEmailArray(value: unknown): value is string[] {\n\treturn isArray(value) && value?.every(isEmail);\n}\n\n/**\n * * Type guard to check if a value is a valid date string.\n * @param value - The value to check.\n * @returns `true` if the value is a valid date string, otherwise `false`.\n */\nexport function isDateString(value: unknown): value is string {\n\treturn isString(value) && !isNaN(Date.parse(value));\n}\n\n/**\n * * Type guard to check if a value is a valid UUID (v4).\n * @param value - The value to check.\n * @returns `true` if the value is a valid UUID, otherwise `false`.\n */\nexport function isUUID(value: unknown): value is string {\n\treturn (\n\t\tisString(value) &&\n\t\t/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(\n\t\t\tvalue,\n\t\t)\n\t);\n}\n\n/**\n * * Type guard to check if the code is running in a browser environment.\n * @returns `true` if the code is running in a browser, otherwise `false`.\n */\nexport function isBrowser(): boolean {\n\treturn typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * * Type guard to check if the code is running in a Node.js environment.\n * @returns `true` if the code is running in Node.js, otherwise `false`.\n */\nexport function isNode(): boolean {\n\treturn (\n\t\ttypeof process !== 'undefined' &&\n\t\tprocess.versions != null &&\n\t\tprocess.versions.node != null\n\t);\n}\n\n/**\n * * Type guard to check if a value is a valid URL.\n * @param value - The value to check.\n * @returns `true` if the value is a valid URL, otherwise `false`.\n */\nexport function isURL(value: unknown): value is string {\n\ttry {\n\t\tnew URL(isString(value) ? value : '');\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/**\n * * Type guard to check if a value is a valid Base64 encoded string.\n * @param value - The value to check.\n * @returns `true` if the value is a valid Base64 string, otherwise `false`.\n */\nexport function isBase64(value: unknown): value is string {\n\treturn (\n\t\tisString(value) &&\n\t\t/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(\n\t\t\tvalue,\n\t\t)\n\t);\n}\n\n/**\n * * Type guard to check if a value is a valid phone number.\n * @param value - The value to check.\n * @returns `true` if the value is a valid phone number, otherwise `false`.\n */\nexport function isPhoneNumber(value: unknown): value is string {\n\treturn isString(value) && /^\\+?[1-9]\\d{1,14}$/.test(value);\n}\n\n/**\n * * Type guard to check if a value is a valid IP address (IPv4 or IPv6).\n * @param value - The value to check.\n * @returns `true` if the value is a valid IP address, otherwise `false`.\n */\nexport function isIPAddress(value: unknown): value is string {\n\treturn (\n\t\tisString(value) &&\n\t\t/^(?:\\d{1,3}\\.){3}\\d{1,3}$|^([a-f0-9:]+:+)+[a-f0-9]+$/i.test(value)\n\t);\n}\n\n/**\n * * Type guard to check if the current environment matches a given string.\n * @param env - The expected environment (e.g., \"production\", \"development\").\n * @returns `true` if the current environment matches, otherwise `false`.\n */\nexport function isEnvironment(env: string): boolean {\n\treturn process.env.NODE_ENV === env;\n}\n\n/**\n * * Type guard to check if a value is a numeric string.\n * @param value - The value to check.\n * @returns `true` if the value is a numeric string, otherwise `false`.\n */\nexport function isNumericString(value: unknown): value is `${number}` {\n\treturn isString(value) && /^\\d+(\\.\\d+)?$/.test(value);\n}\n","import { isInvalidOrEmptyArray } from '../array/basics';\nimport { sortAnArray } from '../array/sort';\nimport { isMethodDescriptor, isObject } from '../guards/non-primitives';\nimport { isString } from '../guards/primitives';\nimport { isNumericString } from '../guards/specials';\nimport type { GenericObject } from '../object/types';\nimport type {\n\tClassDetails,\n\tConstructor,\n\tDelayedFn,\n\tThrottledFn,\n\tVoidFunction,\n} from '../types';\n\n/**\n * * Deeply compare two values (arrays, objects, or primitive values).\n *\n * @param a First value to compare.\n * @param b Second value to compare.\n * @returns Whether the values are deeply equal.\n */\nexport const isDeepEqual = <T>(a: T, b: T): boolean => {\n\t// If both values are strictly equal (handles primitive types and same references)\n\tif (a === b) return true;\n\n\t// If the types of the two values are different\n\tif (typeof a !== typeof b) return false;\n\n\t// If either is null or undefined, they must both be null or undefined\n\tif (a === null || b === null) return a === b;\n\n\t// Check for array equality\n\tif (Array.isArray(a) && Array.isArray(b)) {\n\t\tif (a?.length !== b?.length) return false;\n\t\treturn a?.every((element, index) => isDeepEqual(element, b[index]));\n\t}\n\n\t// Check for object equality\n\tif (typeof a === 'object' && typeof b === 'object') {\n\t\tconst aKeys = Object.keys(a);\n\t\tconst bKeys = Object.keys(b);\n\n\t\tif (aKeys?.length !== bKeys?.length) return false;\n\n\t\treturn aKeys?.every((key) =>\n\t\t\tisDeepEqual((a as GenericObject)[key], (b as GenericObject)[key]),\n\t\t);\n\t}\n\n\treturn false;\n};\n\n/**\n * * Utility to convert an array to string with custom separator.\n *\n * @param array Array to convert.\n * @param separator Separate each element of the array. Can be `,`, `-`, `|` etc. Default is `,`.\n * @returns Converted array in string format with the separator.\n */\nexport const convertArrayToString = <T>(\n\tarray: T[],\n\tseparator: string = ',',\n): string => {\n\tif (!isInvalidOrEmptyArray) {\n\t\tthrow new Error('Please, provide a valid array!');\n\t}\n\treturn array.join(separator);\n};\n\n/**\n * * A generic debounce function that delays the execution of a callback.\n *\n * @param callback - The function to debounce.\n * @param delay - The delay in milliseconds. Default is `300ms`.\n * @returns A debounced version of the callback function.\n *\n * @example\n * const debouncedSearch = debounceAction((query: string) => {\n * console.log(`Searching for: ${query}`);\n * }, 300);\n *\n * debouncedSearch('laptop'); // Executes after 300ms of inactivity.\n */\nexport function debounceAction<T extends VoidFunction>(\n\tcallback: T,\n\tdelay = 300,\n): DelayedFn<T> {\n\tlet timeoutId: ReturnType<typeof setTimeout> | undefined = undefined;\n\n\treturn (...args: Parameters<T>) => {\n\t\t// Clear the previous timeout\n\t\tclearTimeout(timeoutId);\n\n\t\t// Set a new timeout\n\t\ttimeoutId = setTimeout(() => {\n\t\t\tcallback(...args);\n\t\t}, delay);\n\t};\n}\n\n/**\n * * A generic throttle function that ensures a callback is executed at most once per specified interval.\n *\n * @param callback - The function to throttle.\n * @param delay - The delay in milliseconds. Default is `150ms`.\n * @returns A throttled version of the callback function.\n *\n * @example\n * const throttledResize = throttleAction(() => {\n * console.log('Resized');\n * }, 300);\n *\n * window.addEventListener('resize', throttledResize);\n */\nexport function throttleAction<T extends VoidFunction>(\n\tcallback: T,\n\tdelay = 150,\n): ThrottledFn<T> {\n\tlet lastCall = 0;\n\n\treturn (...args: Parameters<T>) => {\n\t\tconst now = Date.now();\n\n\t\tif (now - lastCall >= delay) {\n\t\t\tlastCall = now;\n\t\t\tcallback(...args);\n\t\t}\n\t};\n}\n\n/**\n * * Retrieves the names of all instance methods defined directly on a class prototype.\n *\n * @param cls - The class constructor (not an instance).\n * @returns A sorted array of instance method names.\n */\nexport function getInstanceMethodNames(cls: Constructor): string[] {\n\tconst prototype = cls.prototype;\n\n\tconst methods = Object.getOwnPropertyNames(prototype).filter((method) => {\n\t\tif (method === 'constructor') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(prototype, method);\n\n\t\treturn isMethodDescriptor(descriptor);\n\t});\n\n\treturn sortAnArray(methods);\n}\n\n/**\n * * Retrieves the names of all static methods defined directly on a class constructor.\n *\n * @param cls - The class constructor (not an instance).\n * @returns A sorted array of static method names.\n */\nexport function getStaticMethodNames(cls: Constructor): string[] {\n\tconst methods = Object.getOwnPropertyNames(cls).filter((method) => {\n\t\treturn (\n\t\t\tmethod !== 'prototype' && method !== 'name' && method !== 'length'\n\t\t);\n\t});\n\n\treturn sortAnArray(methods);\n}\n\n/**\n * * Counts the number of instance methods defined directly on a class prototype.\n *\n * @param cls - The class constructor (not an instance).\n * @returns The number of instance methods defined on the class prototype.\n */\nexport function countInstanceMethods(cls: Constructor): number {\n\treturn getInstanceMethodNames(cls)?.length;\n}\n\n/**\n * * Counts the number of static methods defined directly on a class constructor.\n *\n * @param cls - The class constructor (not an instance).\n * @returns The number of static methods defined on the class constructor.\n */\nexport function countStaticMethods(cls: Constructor): number {\n\treturn getStaticMethodNames(cls)?.length;\n}\n\n/**\n * * Gathers detailed information about the instance and static methods of a class.\n *\n * @param cls - The class constructor (not an instance).\n * @returns An object containing names and counts of instance and static methods.\n */\nexport function getClassDetails(cls: Constructor): ClassDetails {\n\tconst instanceNames = getInstanceMethodNames(cls);\n\tconst staticNames = getStaticMethodNames(cls);\n\n\treturn {\n\t\tinstanceNames,\n\t\tstaticNames,\n\t\tinstances: instanceNames?.length,\n\t\tstatics: staticNames?.length,\n\t\ttotal: instanceNames?.length + staticNames?.length,\n\t};\n}\n\n/**\n * * Parses any valid JSON string, optionally converting stringified primitives inside (nested) arrays or objects.\n *\n * @template T - Expected return type (default is unknown).\n * @param value - The JSON string to parse.\n * @param parsePrimitives - Whether to convert stringified primitives (default: `true`).\n * @returns The parsed JSON value typed as `T`, or the original parsed value with optional primitive conversion.\n * - Returns `{}` if parsing fails, such as when the input is malformed or invalid JSON or passing single quoted string.\n *\n * - *Unlike `parseJsonToObject`, which ensures the root value is an object,\n * this function returns any valid JSON structure such as arrays, strings, numbers, or objects.*\n *\n * This is useful when you're not sure of the root structure of the JSON, or when you expect something other than an object.\n *\n * @see `parseJsonToObject` for strict object-only parsing.\n */\nexport const parseJSON = <T = unknown>(\n\tvalue: string,\n\tparsePrimitives = true,\n): T => {\n\ttry {\n\t\tconst parsed = JSON.parse(value);\n\n\t\treturn (parsePrimitives ? deepParsePrimitives(parsed) : parsed) as T;\n\t} catch {\n\t\treturn {} as T;\n\t}\n};\n\n/**\n * * Recursively parses primitive values inside objects and arrays.\n *\n * @template T - Expected return type after parsing (default is unknown).\n * @param input - Any input value to parse recursively.\n * @returns Input with primitives (strings like \"true\", \"123\") converted, typed as `T`.\n */\nexport function deepParsePrimitives<T = unknown>(input: unknown): T {\n\tif (Array.isArray(input)) {\n\t\treturn input?.map(deepParsePrimitives) as T;\n\t}\n\n\tif (isObject(input)) {\n\t\tconst result: Record<string, unknown> = {};\n\n\t\tfor (const [key, value] of Object.entries(input)) {\n\t\t\tresult[key] = deepParsePrimitives(value);\n\t\t}\n\n\t\treturn result as T;\n\t}\n\n\tif (isString(input)) {\n\t\tif (/^(true|false)$/i.test(input)) {\n\t\t\treturn (input?.toLowerCase() === 'true') as T;\n\t\t}\n\n\t\tif (isNumericString(input)) {\n\t\t\treturn Number(input) as T;\n\t\t}\n\n\t\tif (input === 'null') {\n\t\t\treturn null as T;\n\t\t}\n\n\t\tif (input === 'undefined') {\n\t\t\treturn undefined as T;\n\t\t}\n\n\t\treturn input as T;\n\t}\n\n\treturn input as T;\n}\n","import { shuffleArray } from '../array/basics';\nimport { convertArrayToString } from '../utils';\nimport { getRandomNumber } from './basics';\nimport { isEven, isOdd } from './guards';\nimport { _applyMultiples } from './helpers';\nimport { isPrime } from './prime';\nimport type { NumberType, RangedNumbers, RangeOptions } from './types';\n\n/**\n * * Function to get numbers within a range based on the provided `NumberType` and options.\n * * Returns either a string or an array of numbers based on the `getAs` property in options.\n *\n * @param type - The type of numbers to generate ('random', 'prime', etc.).\n * @param options - Options to configure number generation, including range and formatting.\n * @returns Either a string or an array of numbers.\n */\nexport function getNumbersInRange<T extends boolean = false>(\n\ttype: NumberType = 'any',\n\toptions?: RangeOptions<T>,\n): RangedNumbers<T> {\n\tconst {\n\t\tgetAsString = false,\n\t\tmin = 0,\n\t\tmax = 100,\n\t\tincludeMin = true,\n\t\tincludeMax = true,\n\t\tseparator = ', ',\n\t\tmultiplesOf,\n\t} = options || {};\n\n\tlet output: number[] = [];\n\n\t/**\n\t * Helper function to apply range and get array of numbers in that range.\n\t *\n\t * @param start The start of the range.\n\t * @param end The end of the range.\n\t * @returns The array of numbers in the range.\n\t */\n\tconst _applyRangeOptions = (start: number, end: number): number[] => {\n\t\tlet startNumber = start;\n\t\tlet endNumber = end;\n\n\t\tif (start > end) {\n\t\t\t[startNumber, endNumber] = [end, start];\n\t\t}\n\n\t\tconst numbers: number[] = [];\n\n\t\tfor (let i = startNumber; i <= endNumber; i++) {\n\t\t\tif (\n\t\t\t\ti >= startNumber &&\n\t\t\t\ti <= endNumber &&\n\t\t\t\t(includeMin || i > startNumber) &&\n\t\t\t\t(includeMax || i < endNumber)\n\t\t\t) {\n\t\t\t\tnumbers.push(i);\n\t\t\t}\n\t\t}\n\t\treturn numbers;\n\t};\n\n\tif (type === 'prime' && multiplesOf !== undefined) {\n\t\tconsole.warn(\n\t\t\t'Warning: The \"multiplesOf\" option is ignored when the type is \"prime\"!',\n\t\t);\n\t}\n\n\tswitch (type) {\n\t\tcase 'random':\n\t\t\toutput = shuffleArray(\n\t\t\t\t_applyRangeOptions(min, max).map((n) =>\n\t\t\t\t\tgetRandomNumber({\n\t\t\t\t\t\tmin: n,\n\t\t\t\t\t\tmax: n,\n\t\t\t\t\t\tincludeMin,\n\t\t\t\t\t\tincludeMax,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t);\n\t\t\tbreak;\n\n\t\tcase 'prime':\n\t\t\toutput = _applyRangeOptions(min, max).filter(isPrime);\n\t\t\tbreak;\n\n\t\tcase 'odd':\n\t\t\toutput = _applyRangeOptions(min, max).filter(isOdd);\n\t\t\tbreak;\n\n\t\tcase 'even':\n\t\t\toutput = _applyRangeOptions(min, max).filter(isEven);\n\t\t\tbreak;\n\n\t\tcase 'natural':\n\t\t\toutput = _applyRangeOptions(Math.max(min, 1), max);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\toutput = _applyRangeOptions(min, max);\n\t\t\tbreak;\n\t}\n\n\tif (type !== 'prime') {\n\t\toutput = _applyMultiples(output, multiplesOf);\n\t}\n\n\treturn getAsString ?\n\t\t\t(convertArrayToString(output, separator) as RangedNumbers<T>)\n\t\t:\t(output as RangedNumbers<T>);\n}\n","/** Colors based on the ASCII value of the letter. */\nexport const alphabetColorPalette = [\n\t'#00094C',\n\t'#00376E',\n\t'#005600',\n\t'#024647',\n\t'#423067',\n\t'#55188E',\n\t'#00453E',\n\t'#00516C',\n\t'#263E0D',\n\t'#0F6F3F',\n\t'#730073',\n\t'#053636',\n\t'#253654',\n\t'#4682B4',\n\t'#3253B6',\n\t'#43616C',\n\t'#036C44',\n\t'#30784F',\n\t'#601C1C',\n\t'#690000',\n\t'#005B00',\n\t'#BF0E6C',\n\t'#008080',\n\t'#475F47',\n\t'#546F1C',\n\t'#824809',\n];\n\n/** Colors based on the index of numbers. */\nexport const numberColorPalette = [\n\t'#893213',\n\t'#A44C15',\n\t'#8B4513',\n\t'#8A1D33',\n\t'#3B543B',\n\t'#342656',\n\t'#A43522',\n\t'#04605F',\n\t'#B5680A',\n\t'#6437B3',\n];\n\nexport const PERCENT_VALUES = [\n\t0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n\t21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\n\t40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,\n\t59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,\n\t78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,\n\t97, 98, 99, 100,\n] as const;\n","import type {\n\tAlphaValue,\n\tHex6,\n\tHex8,\n\tHSL,\n\tHSLA,\n\tPercent,\n\tRGB,\n\tRGBA,\n} from './types';\n\n/**\n * * Converts opacity percentage (0-100) to a 2-digit hex string.\n *\n * @param opacity - The opacity value as a percentage (0-100).\n * @returns A 2-digit hex string representing the alpha value.\n */\nexport const _convertOpacityToHex = (opacity: Percent): string => {\n\t// Ensure opacity is between 0 and 100\n\tconst validOpacity = Math.min(100, Math.max(0, opacity));\n\t// Convert to a value between 0 and 255, then to a hex string\n\tconst alpha = Math.round((validOpacity / 100) * 255);\n\t// Ensure it's 2 digits (e.g., 0x0A instead of 0xA)\n\treturn alpha.toString(16).padStart(2, '0').toUpperCase();\n};\n\n/**\n * * Applies an opacity value to a color string.\n * @param color The color string to apply opacity to.\n * @param opacity The opacity value as a percentage (0-100).\n * @returns The color string with the opacity value applied.\n */\nexport const _applyOpacity = (color: string, opacity: string): string => {\n\treturn color.concat(opacity);\n};\n\n/**\n * * Helper function to generate a random HSL color.\n *\n * @returns A random HSL color string.\n */\nexport const _generateRandomHSL = (): HSL => {\n\tconst hue = Math.floor(Math.random() * 360);\n\tconst saturation = 75 + Math.floor(Math.random() * 25);\n\tconst lightness = 50 + Math.floor(Math.random() * 15);\n\treturn `hsl(${hue}, ${saturation}%, ${lightness}%)`;\n};\n\n/**\n * * Helper function to check if the new color is visually too similar to the previous one.\n * * It compares the hue, saturation, and lightness difference between the new color and the last one generated.\n *\n * @param recentColors - Array of recently generated colors.\n * @param newColor - The new color to compare.\n * @returns `Boolean` : `true` if the new color is similar to the previous one.\n */\nexport const _isSimilarToLast = (\n\trecentColors: string[],\n\tnewColor: string,\n): boolean => {\n\tif (recentColors?.length === 0) return false;\n\n\tconst newHSL = newColor.match(/hsl\\((\\d+), (\\d+)%, (\\d+)%\\)/);\n\tconst lastHSL = recentColors[recentColors?.length - 1].match(\n\t\t/hsl\\((\\d+), (\\d+)%, (\\d+)%\\)/,\n\t);\n\n\tif (!newHSL || !lastHSL) return false;\n\n\tconst newHue = parseInt(newHSL[1], 10);\n\tconst newSaturation = parseInt(newHSL[2], 10);\n\tconst newLightness = parseInt(newHSL[3], 10);\n\n\tconst lastHue = parseInt(lastHSL[1], 10);\n\tconst lastSaturation = parseInt(lastHSL[2], 10);\n\tconst lastLightness = parseInt(lastHSL[3], 10);\n\n\tconst hueDifference = Math.abs(newHue - lastHue);\n\tconst saturationDifference = Math.abs(newSaturation - lastSaturation);\n\tconst lightnessDifference = Math.abs(newLightness - lastLightness);\n\n\treturn (\n\t\thueDifference < 48 &&\n\t\tsaturationDifference < 24 &&\n\t\tlightnessDifference < 16\n\t);\n};\n\n/**\n * @private Checks if a color is in `Hex` format.\n *\n * @param color Color to check.\n * @returns Boolean: `true` if it's a `Hex` color, `false` if not.\n */\nexport function _isHex6(color: string): color is Hex6 {\n\treturn /^#[0-9A-Fa-f]{6}$/.test(color);\n}\n\n/**\n * @private Checks if a color is in `Hex8` format.\n *\n * @param color Color to check.\n * @returns Boolean: `true` if it's a `Hex8` color, `false` if not.\n */\nexport function _isHex8(color: string): color is Hex8 {\n\treturn /^#[0-9A-Fa-f]{8}$/.test(color);\n}\n\n/**\n * @private Checks if a color is in `RGB` format and within valid ranges.\n *\n * @param color Color to check.\n * @returns `true` if it's a `RGB` color, `false` if not.\n */\nexport function _isRGB(color: string): color is RGB {\n\tconst match = color.match(\n\t\t/^rgb\\(\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?)\\s*\\)$/,\n\t);\n\tif (!match) return false;\n\tconst [r, g, b] = match.slice(1).map(Number);\n\treturn (\n\t\t_isValidRGBComponent(r) &&\n\t\t_isValidRGBComponent(g) &&\n\t\t_isValidRGBComponent(b)\n\t);\n}\n\n/**\n * @private Checks if a color is in `RGBA` format and within valid ranges.\n *\n * @param color Color to check.\n * @returns `true` if it's a `RGBA` color, `false` if not.\n */\nexport function _isRGBA(color: string): color is RGBA {\n\tconst match = color.match(\n\t\t/^rgba\\(\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(0|1|0?\\.\\d+)\\s*\\)$/,\n\t);\n\tif (!match) return false;\n\tconst [r, g, b, a] = match.slice(1).map(Number);\n\treturn (\n\t\t_isValidRGBComponent(r) &&\n\t\t_isValidRGBComponent(g) &&\n\t\t_isValidRGBComponent(b) &&\n\t\t_isValidAlpha(a)\n\t);\n}\n\n/**\n * @private Checks if a color is in `HSL` format and within valid ranges.\n *\n * @param color Color to check.\n * @returns `true` if it's a `HSL` color, `false` if not.\n */\nexport function _isHSL(color: string): color is HSL {\n\tconst match = color.match(\n\t\t/^hsl\\(\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?)%,\\s*(\\d{1,3}(?:\\.\\d+)?)%\\s*\\)$/,\n\t);\n\tif (!match) return false;\n\tconst [h, s, l] = match.slice(1).map(Number);\n\treturn _isValidHue(h) && _isValidPercentage(s) && _isValidPercentage(l);\n}\n\n/**\n * @private Checks if a color is in `HSLA` format and within valid ranges.\n *\n * @param color Color to check.\n * @returns `true` if it's a `HSLA` color, `false` if not.\n */\nexport function _isHSLA(color: string): color is HSLA {\n\tconst match = color.match(\n\t\t/^hsla\\(\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?)%,\\s*(\\d{1,3}(?:\\.\\d+)?)%,\\s*(0|1|0?\\.\\d+)\\s*\\)$/,\n\t);\n\tif (!match) return false;\n\tconst [h, s, l, a] = match.slice(1).map(Number);\n\treturn (\n\t\t_isValidHue(h) &&\n\t\t_isValidPercentage(s) &&\n\t\t_isValidPercentage(l) &&\n\t\t_isValidAlpha(a)\n\t);\n}\n\n/**\n * @private Checks if a number is valid alpha value.\n *\n * @param value Alpha value to check.\n * @returns `true` if it's a valid alpha value, `false` if not.\n */\nexport function _isValidAlpha(value: number): value is AlphaValue {\n\treturn value >= 0 && value <= 1 && !isNaN(value);\n}\n\n/** * @private Validates RGB component (0–255). */\nexport function _isValidRGBComponent(value: number): boolean {\n\treturn value >= 0 && value <= 255;\n}\n\n/** * @private Validates HSL hue (0–360). */\nexport function _isValidHue(value: number): boolean {\n\treturn value >= 0 && value <= 360;\n}\n\n/** * @private Validates HSL percentage components (0–100). */\nexport function _isValidPercentage(value: number): boolean {\n\treturn value >= 0 && value <= 100;\n}\n","import { alphabetColorPalette, numberColorPalette } from './constants';\nimport { _applyOpacity, _convertOpacityToHex } from './helpers';\nimport type { ColorInput, ColorInputArray, Percent } from './types';\n\n/**\n * * Generates a hex color based on the first character (initial) of a string or number.\n *\n * - For numbers, it uses 10 predefined colors (0-9).\n * - For letters, it uses 26 predefined colors (A-Z).\n * - Invalid characters handled with a fallback color.\n * @param input - A string or number.\n * @param opacity - A value from 0 to 100 representing the opacity percentage.\n * @returns A hex color for the first character of the provided string/number.\n */\nexport function getColorForInitial(\n\tinput: string | number,\n\topacity?: Percent,\n): string;\n\n/**\n * * Generates an array of hex colors based on the first character (initial) of an array of strings/numbers or even nested arrays of strings/numbers.\n *\n * - For numbers, it uses 10 predefined colors (0-9).\n * - For letters, it uses 26 predefined colors (A-Z).\n * - For empty array it returns all 36 colors.\n * - Invalid characters and inputs are handled with a fallback color.\n * @param input - A string, number, or an array of strings/numbers or even nested arrays of strings/numbers.\n * @param opacity - A value from 0 to 100 representing the opacity percentage.\n * @returns A hex color for a string/number, or an array of hex colors for each element of the provided array.\n */\nexport function getColorForInitial(\n\tinput: ColorInputArray,\n\topacity?: Percent,\n): string[];\n\n/**\n * * Generates a hex color based on the first character (initial) of a string or number; or an array of hex colors based on the first character (initial) of an array of strings/numbers or even nested arrays of strings/numbers.\n *\n * - For numbers, it uses 10 predefined colors (0-9).\n * - For letters, it uses 26 predefined colors (A-Z).\n * - For empty array it returns all 36 colors.\n * - Invalid characters and inputs are handled with a fallback color.\n * @param input - A string, number, or an array of strings/numbers or even nested arrays of strings/numbers.\n * @param opacity - A value from 0 to 100 representing the opacity percentage.\n * @returns A hex color for a string/number, or an array of hex colors for each element of the provided array.\n */\nexport function getColorForInitial(\n\tinput: ColorInput | ColorInputArray = '',\n\topacity: Percent = 100,\n): string | string[] {\n\tlet initial: string;\n\n\tconst hexOpacity = _convertOpacityToHex(opacity);\n\n\tconst numbers = '0123456789';\n\n\t// Handle empty string case\n\tif (!input) return _applyOpacity('#010514', hexOpacity);\n\n\t// Handle string input\n\tif (typeof input === 'string') {\n\t\tinitial = input[0];\n\n\t\t// Handle number as string\n\t\tif (numbers.includes(initial)) {\n\t\t\treturn _applyOpacity(\n\t\t\t\tnumberColorPalette[parseInt(initial, 10)],\n\t\t\t\thexOpacity,\n\t\t\t);\n\t\t}\n\n\t\tconst upperInitial = initial.toUpperCase();\n\t\tconst index = upperInitial.charCodeAt(0) - 'A'.charCodeAt(0);\n\n\t\t// Validate alphabet\n\t\tif (index >= 0 && index < alphabetColorPalette?.length) {\n\t\t\treturn _applyOpacity(alphabetColorPalette[index], hexOpacity);\n\t\t}\n\n\t\treturn _applyOpacity('#010514', hexOpacity);\n\t\t// Handle number input\n\t} else if (typeof input === 'number' && !isNaN(input)) {\n\t\tinitial = input.toString()[0];\n\n\t\tif (numbers.includes(initial)) {\n\t\t\treturn _applyOpacity(\n\t\t\t\tnumberColorPalette[parseInt(initial, 10)],\n\t\t\t\thexOpacity,\n\t\t\t);\n\t\t}\n\n\t\treturn _applyOpacity('#010514', hexOpacity);\n\t\t// Handle array of strings/numbers\n\t} else if (Array.isArray(input)) {\n\t\tif (input?.length < 1)\n\t\t\treturn [...alphabetColorPalette, ...numberColorPalette].map(\n\t\t\t\t(color) => _applyOpacity(color, hexOpacity),\n\t\t\t);\n\n\t\treturn input\n\t\t\t.map((el) => {\n\t\t\t\tif (Array.isArray(el)) {\n\t\t\t\t\treturn getColorForInitial(el, opacity);\n\t\t\t\t}\n\t\t\t\treturn getColorForInitial(el, opacity);\n\t\t\t})\n\t\t\t.flat();\n\t}\n\n\treturn _applyOpacity('#010514', hexOpacity);\n}\n","import { _isHSL, _isHSLA, _isRGB, _isRGBA } from './helpers';\nimport type { AlphaValues, HSL, HSLA, RGB, RGBA, SolidValues } from './types';\n\n/**\n * * Extracts numbers from a color string like `rgb(66, 103, 69)` or `hsl(120, 42.86%, 41.18%)`.\n * * Converts percentage values to decimal (e.g., `42.86%` → `42.86`).\n *\n * @param color The color string in RGB or HSL format.\n * @returns A tuple of 3 extracted numbers. `[number, number, number]`\n *\n * @remarks If the input color is not in `HSL` or `RGB` format, it will return `[0, 0, 0]`\n */\nexport const extractSolidColorValues = (color: HSL | RGB): SolidValues => {\n\tif (_isHSL(color) || _isRGB(color)) {\n\t\treturn (color.match(/[\\d.]+%?/g) || [])?.map((value) =>\n\t\t\tparseFloat(value),\n\t\t) as SolidValues;\n\t}\n\n\treturn [0, 0, 0];\n};\n\n/**\n * * Extracts numbers from a color string like `rgba(66, 103, 69, 0.6)` or `hsla(120, 42.86%, 41.18%, 0.9)`.\n * * Converts percentage values to decimal (e.g., `42.86%` → `42.86`).\n *\n * @param color The color string in RGBA or HSLA format.\n * @returns A tuple of 4 extracted numbers. `[number, number, number, number]`\n *\n * @remarks If the input color is not in `HSLA` or `RGBA` format, it will return `[0, 0, 0, 0]`\n */\nexport const extractAlphaColorValues = (color: HSLA | RGBA): AlphaValues => {\n\tif (_isHSLA(color) || _isRGBA(color)) {\n\t\treturn (color.match(/[\\d.]+%?/g) || [])?.map((value) =>\n\t\t\tparseFloat(value),\n\t\t) as AlphaValues;\n\t}\n\n\treturn [0, 0, 0, 0];\n};\n","import {\n\t_convertOpacityToHex,\n\t_isHex6,\n\t_isHex8,\n\t_isHSL,\n\t_isHSLA,\n\t_isRGB,\n\t_isRGBA,\n\t_isValidAlpha,\n} from './helpers';\nimport type {\n\tColorType,\n\tConvertedColors,\n\tHex,\n\tHex6,\n\tHex8,\n\tHSL,\n\tHSLA,\n\tPercent,\n\tRGB,\n\tRGBA,\n} from './types';\nimport { extractAlphaColorValues, extractSolidColorValues } from './utils';\n\n/**\n * * Converts HSL to RGB color format.\n *\n * @param h - The hue component of the HSL color, in degrees (0 to 360).\n * @param s - The saturation component of the HSL color, as a percentage (0 to 100).\n * @param l - The lightness component of the HSL color, as a percentage (0 to 100).\n * @returns A string representing the color in RGB format (e.g., `rgb(255, 0, 0)`).\n */\nexport const convertHslToRgb = (h: number, s: number, l: number): RGB => {\n\t// Normalize the HSL values\n\ts /= 100;\n\tl /= 100;\n\n\tconst c = (1 - Math.abs(2 * l - 1)) * s;\n\tconst x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n\tconst m = l - c / 2;\n\n\tlet r = 0,\n\t\tg = 0,\n\t\tb = 0;\n\n\tif (h >= 0 && h < 60) [r, g] = [c, x];\n\telse if (h >= 60 && h < 120) [r, g] = [x, c];\n\telse if (h >= 120 && h < 180) [g, b] = [c, x];\n\telse if (h >= 180 && h < 240) [g, b] = [x, c];\n\telse if (h >= 240 && h < 300) [r, b] = [x, c];\n\telse if (h >= 300 && h < 360) [r, b] = [c, x];\n\n\tr = Math.round((r + m) * 255);\n\tg = Math.round((g + m) * 255);\n\tb = Math.round((b + m) * 255);\n\n\treturn `rgb(${r}, ${g}, ${b})`;\n};\n\n/**\n * * Converts RGB to HSL color format.\n *\n * @param r - The red component of the RGB color, in the range 0 to 255.\n * @param g - The green component of the RGB color, in the range 0 to 255.\n * @param b - The blue component of the RGB color, in the range 0 to 255.\n * @returns A string representing the color in HSL format (e.g., `hsl(0, 100%, 50%)`).\n */\nexport const convertRgbToHsl = (r: number, g: number, b: number): HSL => {\n\tr /= 255;\n\tg /= 255;\n\tb /= 255;\n\n\tconst max = Math.max(r, g, b);\n\tconst min = Math.min(r, g, b);\n\n\tlet h = 0,\n\t\ts = 0;\n\n\tconst l = (max + min) / 2;\n\n\tif (max !== min) {\n\t\tconst diff = max - min;\n\n\t\ts = l > 0.5 ? diff / (2 - max - min) : diff / (max + min);\n\n\t\tswitch (max) {\n\t\t\tcase r:\n\t\t\t\th = (g - b) / diff + (g < b ? 6 : 0);\n\t\t\t\tbreak;\n\t\t\tcase g:\n\t\t\t\th = (b - r) / diff + 2;\n\t\t\t\tbreak;\n\t\t\tcase b:\n\t\t\t\th = (r - g) / diff + 4;\n\t\t\t\tbreak;\n\t\t}\n\n\t\th *= 60;\n\t}\n\n\treturn `hsl(${Math.round(h)}, ${Number((s * 100).toFixed(2))}%, ${Number((l * 100).toFixed(2))}%)`;\n};\n\n/**\n * * Converts HSL to Hex color format.\n *\n * @param h - The hue component of the HSL color, in degrees (0 to 360).\n * @param s - The saturation component of the HSL color, as a percentage (0 to 100).\n * @param l - The lightness component of the HSL color, as a percentage (0 to 100).\n * @returns A string representing the color in Hex format (e.g., `#FF0000`).\n */\nexport const convertHslToHex = (h: number, s: number, l: number): Hex6 => {\n\tconst rgb = convertHslToRgb(h, s, l).match(/\\d+/g)!.map(Number);\n\n\treturn convertRgbToHex(rgb[0], rgb[1], rgb[2]);\n};\n\n/**\n * * Converts Hex to HSL color format.\n *\n * @param hex - A string representing the color in Hex format (e.g., `#FF0000`).\n * @returns A string representing the color in HSL format (e.g., `hsl(0, 100%, 50%)`).\n */\nexport const convertHexToHsl = (hex: Hex6 | Hex): HSL => {\n\tlet newHex = hex.replace('#', '');\n\n\tif (newHex?.length === 3) {\n\t\tnewHex = newHex\n\t\t\t?.split('')\n\t\t\t?.map((char) => char + char)\n\t\t\t?.join('');\n\t}\n\n\tconst r = parseInt(newHex.slice(0, 2), 16);\n\tconst g = parseInt(newHex.slice(2, 4), 16);\n\tconst b = parseInt(newHex.slice(4, 6), 16);\n\n\treturn convertRgbToHsl(r, g, b);\n};\n\n/**\n * * Converts RGB to Hex color format.\n *\n * @param r - The red component of the RGB color, in the range 0 to 255.\n * @param g - The green component of the RGB color, in the range 0 to 255.\n * @param b - The blue component of the RGB color, in the range 0 to 255.\n * @returns A string representing the color in Hex format (e.g., `#FF0000`).\n */\nexport const convertRgbToHex = (r: number, g: number, b: number): Hex6 => {\n\tconst hex = [r, g, b]\n\t\t?.map((v) => v.toString(16).padStart(2, '0'))\n\t\t?.join('')\n\t\t?.toUpperCase();\n\n\treturn `#${hex}` as Hex6;\n};\n\n/**\n * * Converts Hex to RGB color format.\n *\n * @param hex - A string representing the color in Hex format (e.g., `#FF0000`).\n * @returns A string representing the color in RGB format (e.g., `rgb(255, 0, 0)`).\n */\nexport const convertHexToRgb = (hex: Hex6 | Hex | string): RGB => {\n\t// Remove the # if present\n\tlet newHex = hex.replace('#', '');\n\n\tif (newHex?.length === 3) {\n\t\tnewHex = newHex\n\t\t\t?.split('')\n\t\t\t?.map((char) => char + char)\n\t\t\t?.join('');\n\t}\n\n\tconst r = parseInt(newHex.slice(0, 2), 16);\n\tconst g = parseInt(newHex.slice(2, 4), 16);\n\tconst b = parseInt(newHex.slice(4, 6), 16);\n\n\treturn `rgb(${r}, ${g}, ${b})`;\n};\n\n/**\n * * Converts RGB to RGBA format, adding alpha (opacity).\n *\n * @param r - The red component of the RGB color, in the range 0 to 255.\n * @param g - The green component of the RGB color, in the range 0 to 255.\n * @param b - The blue component of the RGB color, in the range 0 to 255.\n * @param a - The alpha (opacity) value, in the range 0 to 1.\n * @returns A string representing the color in RGBA format (e.g., `rgba(255, 0, 0, 0.5)`).\n */\nexport const convertRgbToRgba = (\n\tr: number,\n\tg: number,\n\tb: number,\n\ta: number = 1,\n): RGBA => {\n\tlet newAlpha = a;\n\n\tif (!_isValidAlpha(a)) {\n\t\tnewAlpha = 1;\n\n\t\tconsole.warn(`Alpha value must be between 0-1, ${a} converted to 1!`);\n\t}\n\n\treturn `rgba(${r}, ${g}, ${b}, ${parseFloat(newAlpha.toFixed(1))})`;\n};\n\n/**\n * * Converts RGBA to Hex format, including alpha channel as part of Hex8.\n *\n * @param r - The red component of the RGB color, in the range 0 to 255.\n * @param g - The green component of the RGB color, in the range 0 to 255.\n * @param b - The blue component of the RGB color, in the range 0 to 255.\n * @param a - The alpha (opacity) value, in the range 0 to 1.\n * @returns A string representing the color in Hex8 format (e.g., `#FF000080`).\n */\nexport const convertRgbaToHex8 = (\n\tr: number,\n\tg: number,\n\tb: number,\n\ta: number = 1,\n): Hex8 => {\n\tlet newAlpha = a;\n\n\tif (!_isValidAlpha(a)) {\n\t\tnewAlpha = 1;\n\n\t\tconsole.warn(`Alpha value must be between 0-1, ${a} converted to 1!`);\n\t}\n\n\tconst hex = convertRgbToHex(r, g, b);\n\n\tconst alphaHex = _convertOpacityToHex(\n\t\tMath.round(newAlpha * 100) as Percent,\n\t);\n\n\treturn `${hex}${alphaHex}` as Hex8;\n};\n\n/**\n * * Converts HSLA to RGBA color format, including alpha channel.\n *\n * @param h - The hue component of the HSL color, in degrees (0 to 360).\n * @param s - The saturation component of the HSL color, as a percentage (0 to 100).\n * @param l - The lightness component of the HSL color, as a percentage (0 to 100).\n * @param a - The alpha (opacity) value, in the range 0 to 1.\n * @returns A string representing the color in RGBA format (e.g., `rgba(255, 0, 0, 0.5)`).\n */\nexport const convertHslaToRgba = (\n\th: number,\n\ts: number,\n\tl: number,\n\ta: number = 1,\n): RGBA => {\n\tlet newAlpha = a;\n\n\tif (!_isValidAlpha(a)) {\n\t\tnewAlpha = 1;\n\n\t\tconsole.warn(`Alpha value must be between 0-1, ${a} converted to 1!`);\n\t}\n\n\tconst rgb = convertHslToRgb(h, s, l);\n\tconst rgbNumbers = extractSolidColorValues(rgb);\n\n\treturn convertRgbToRgba(\n\t\trgbNumbers[0],\n\t\trgbNumbers[1],\n\t\trgbNumbers[2],\n\t\tparseFloat(newAlpha.toFixed(1)),\n\t);\n};\n\n/**\n * * Converts RGBA to HSLA color format, including alpha channel.\n *\n * @param r - The red component of the RGB color, in the range 0 to 255.\n * @param g - The green component of the RGB color, in the range 0 to 255.\n * @param b - The blue component of the RGB color, in the range 0 to 255.\n * @param a - The alpha (opacity) value, in the range 0 to 1.\n * @returns A string representing the color in HSLA format (e.g., `hsla(0, 100%, 50%, 0.5)`).\n */\nexport const convertRgbaToHsla = (\n\tr: number,\n\tg: number,\n\tb: number,\n\ta: number = 1,\n): HSLA => {\n\tlet newAlpha = a;\n\n\tif (!_isValidAlpha(a)) {\n\t\tnewAlpha = 1;\n\n\t\tconsole.warn(`Alpha value must be between 0-1, ${a} converted to 1!`);\n\t}\n\n\tconst hsl = convertRgbToHsl(r, g, b);\n\tconst hslNumbers = extractSolidColorValues(hsl);\n\n\treturn `hsla(${hslNumbers[0]}, ${hslNumbers[1]}%, ${hslNumbers[2]}%, ${parseFloat(newAlpha.toFixed(1))})`;\n};\n\n/**\n * * Converts Hex8 to RGBA color format, including alpha channel.\n * - `Special Note:` Cast the parameter to `Hex8` before converting to `RGBA`.\n * @example convertHex8ToRgba('#FFF122DE' as Hex8)\n *\n * @param hex8 - A string representing the color in Hex8 format (e.g., `#FF000080`).\n * @returns A string representing the color in RGBA format (e.g., `rgba(255, 0, 0, 0.5)`).\n */\nexport const convertHex8ToRgba = (hex8: Hex8): RGBA => {\n\tconst hex = hex8.replace('#', '');\n\tconst r = parseInt(hex.slice(0, 2), 16);\n\tconst g = parseInt(hex.slice(2, 4), 16);\n\tconst b = parseInt(hex.slice(4, 6), 16);\n\tconst a = parseInt(hex.slice(6, 8), 16) / 255;\n\n\treturn `rgba(${r}, ${g}, ${b}, ${parseFloat(a.toFixed(1))})`;\n};\n\n/**\n * * Converts HSLA to Hex8 color format, including alpha channel.\n *\n * @param h - The hue component of the HSL color, in degrees (0 to 360).\n * @param s - The saturation component of the HSL color, as a percentage (0 to 100).\n * @param l - The lightness component of the HSL color, as a percentage (0 to 100).\n * @param a - The alpha (opacity) value, in the range 0 to 1.\n * @returns A string representing the color in Hex8 format (e.g., `#658789DF`).\n */\nexport const convertHslaToHex8 = (\n\th: number,\n\ts: number,\n\tl: number,\n\ta: number = 1,\n): Hex8 => {\n\tlet newAlpha = a;\n\n\tif (!_isValidAlpha(a)) {\n\t\tnewAlpha = 1;\n\n\t\tconsole.warn(`Alpha value must be between 0-1, ${a} converted to 1!`);\n\t}\n\n\tconst hex = convertHslToHex(h, s, l);\n\n\tconst alphaHex = _convertOpacityToHex(\n\t\tMath.round(newAlpha * 100) as Percent,\n\t);\n\n\treturn `${hex}${alphaHex}` as Hex8;\n};\n\n/**\n * * Converts Hex8 to HSLA color format.\n * - `Special Note:` Cast the parameter to `Hex8` before converting to `HSLA`.\n * @example convertHex8ToHsla('#FFF122DE' as Hex8)\n *\n * @param hex - A string representing the color in Hex format (e.g., `#FF0000DE`).\n * @returns A string representing the color in HSLA format..\n */\nexport const convertHex8ToHsla = (hex8: Hex8): HSLA => {\n\tconst rgba = convertHex8ToRgba(hex8);\n\n\treturn convertRgbaToHsla(...extractAlphaColorValues(rgba as RGBA));\n};\n\n/**\n * * Converts a `Hex` color code to `RGB` and `HSL` formats.\n * - `Special Note:` Cast the parameter to `Hex6` before converting to `RGB` and `HSL`.\n * @example convertColorCode('#FFF122' as Hex6)\n *\n * @param color The `Hex` color code (e.g., `#3c6945`).\n * @returns An object containing the `RGB` and `HSL` formats of the given `Hex` color.\n */\nexport function convertColorCode(color: Hex6): {\n\trgb: RGB;\n\thsl: HSL;\n};\n\n/**\n * * Converts an `RGB` color to `Hex` and `HSL` formats.\n *\n * @param color The `RGB` color string (e.g., `rgb(60, 105, 69)`).\n * @returns An object containing the `Hex` and `HSL` formats of the given `RGB` color.\n */\nexport function convertColorCode(color: RGB): {\n\thex: Hex6;\n\thsl: HSL;\n};\n\n/**\n * * Converts an `HSL` color to `Hex` and `RGB` formats.\n *\n * @param color The `HSL` color string (e.g., `hsl(132, 27.27%, 32.35%)`).\n * @returns An object containing the `Hex` and `RGB` formats of the given `HSL` color.\n */\nexport function convertColorCode(color: HSL): {\n\thex: Hex6;\n\trgb: RGB;\n};\n\n/**\n * * Converts a `Hex8` color code to `RGB` and `HSL` formats.\n * - `Special Note:` Cast the parameter to `Hex8` before converting to `RGBA` and `HSLA`.\n * @example convertColorCode('#FFF122DE' as Hex8)\n *\n * @param color The `Hex8` color code (e.g., `#3c6945`).\n * @returns An object containing the `RGB` and `HSL` formats of the given `Hex8` color.\n */\nexport function convertColorCode(color: Hex8): {\n\trgba: RGBA;\n\thsla: HSLA;\n};\n\n/**\n * * Converts an `RGBA` color to `Hex8` and `HSLA` formats.\n *\n * @param color The `RGBA` color string (e.g., `rgb(60, 105, 69)`).\n * @returns An object containing the `Hex8` and `HSLA` formats of the given `RGBA` color.\n */\nexport function convertColorCode(color: RGBA): {\n\thex8: Hex8;\n\thsla: HSLA;\n};\n\n/**\n * * Converts an `HSLA` color to `Hex8` and `RGBA` formats.\n *\n * @param color The `HSLA` color string (e.g., `hsl(132, 27.27%, 32.35%)`).\n * @returns An object containing the `Hex8` and `RGBA` formats of the given `HSLA` color.\n */\nexport function convertColorCode(color: HSLA): {\n\thex8: Hex8;\n\trgba: RGBA;\n};\n\n/**\n * * Converts a color from `Hex`, `RGB`, or `HSL` format to its equivalent representations.\n *\n * @param color The color string in `Hex`, `RGB`, or `HSL` format.\n * @returns The converted color representations excluding the input format.\n * @throws If the color format is unrecognized throws `Error`.\n */\nexport function convertColorCode(color: ColorType): ConvertedColors<ColorType> {\n\tif (_isHex6(color)) {\n\t\treturn {\n\t\t\trgb: convertHexToRgb(color),\n\t\t\thsl: convertHexToHsl(color),\n\t\t} as ConvertedColors<Hex6>;\n\t}\n\n\tif (_isRGB(color)) {\n\t\tconst rgbValues = extractSolidColorValues(color as RGB);\n\n\t\treturn {\n\t\t\thex: convertRgbToHex(...rgbValues),\n\t\t\thsl: convertRgbToHsl(...rgbValues),\n\t\t} as ConvertedColors<RGB>;\n\t}\n\n\tif (_isHSL(color)) {\n\t\tconst hslValues = extractSolidColorValues(color as HSL);\n\n\t\treturn {\n\t\t\thex: convertHslToHex(...hslValues),\n\t\t\trgb: convertHslToRgb(...hslValues),\n\t\t} as ConvertedColors<HSL>;\n\t}\n\n\tif (_isHex8(color)) {\n\t\treturn {\n\t\t\trgba: convertHex8ToRgba(color),\n\t\t\thsla: convertHex8ToHsla(color),\n\t\t} as ConvertedColors<Hex8>;\n\t}\n\n\tif (_isRGBA(color)) {\n\t\tconst rgbaValues = extractAlphaColorValues(color as RGBA);\n\n\t\treturn {\n\t\t\thex8: convertRgbaToHex8(...rgbaValues),\n\t\t\thsla: convertRgbaToHsla(...rgbaValues),\n\t\t} as ConvertedColors<RGBA>;\n\t}\n\n\tif (_isHSLA(color)) {\n\t\tconst hslaValues = extractAlphaColorValues(color as HSLA);\n\n\t\treturn {\n\t\t\thex8: convertHslaToHex8(...hslaValues),\n\t\t\trgba: convertHslaToRgba(...hslaValues),\n\t\t} as ConvertedColors<HSLA>;\n\t}\n\n\tthrow new Error(`Unrecognized Color Format! ${color}`);\n}\n","import { convertColorCode } from './convert';\nimport { _generateRandomHSL, _isSimilarToLast } from './helpers';\nimport type { Hex6, HSL, RGB } from './types';\n\n/** Track previously generated colors. */\nconst generatedColors = new Set<string>();\n\n/** Array of recently generated colors */\nconst recentColors: string[] = [];\n\n/**\n * * Utility to generate a unique random HSL color.\n *\n * @param maxColors - The maximum number of recent colors to store in memory. Default is `16`.\n * @returns Generated unique random color in `HSL` format.\n */\nexport const generateRandomHSLColor = (maxColors: number = 16): HSL => {\n\tlet color: HSL;\n\n\t// Keep generating until a unique color is found that is also different from the last one\n\tdo {\n\t\tcolor = _generateRandomHSL();\n\t} while (\n\t\tgeneratedColors.has(color) ||\n\t\t_isSimilarToLast(recentColors, color)\n\t);\n\n\t// Add the newly generated color to the set and recent colors\n\tgeneratedColors.add(color);\n\trecentColors.push(color);\n\n\t// Limit the recent colors to the last `maxColors` to avoid excessive memory usage\n\tif (recentColors?.length > maxColors) {\n\t\trecentColors?.shift();\n\t}\n\n\treturn color;\n};\n\n/**\n * * Utility to generate a unique random color in Hex and RGB format.\n *\n * @param maxColors - The maximum number of recent colors to store in memory. Default is `16`.\n * @returns An object of generated unique random color in both `Hex` and `RGB` formats.\n */\nexport const generateRandomColorInHexRGB = (\n\tmaxColors: number = 16,\n): {\n\thex: Hex6;\n\trgb: RGB;\n} => {\n\treturn convertColorCode(generateRandomHSLColor(maxColors));\n};\n","export const CSS_COLORS = {\n\tblack: '#000000',\n\tsilver: '#C0C0C0',\n\tgray: '#808080',\n\twhite: '#FFFFFF',\n\tmaroon: '#800000',\n\tred: '#FF0000',\n\tpurple: '#800080',\n\tfuchsia: '#FF00FF',\n\tgreen: '#008000',\n\tlime: '#00FF00',\n\tolive: '#808000',\n\tyellow: '#FFFF00',\n\tnavy: '#000080',\n\tblue: '#0000FF',\n\tteal: '#008080',\n\taqua: '#00FFFF',\n\taliceblue: '#F0F8FF',\n\tantiquewhite: '#FAEBD7',\n\taquamarine: '#7FFFD4',\n\tazure: '#F0FFFF',\n\tbeige: '#F5F5DC',\n\tbisque: '#FFE4C4',\n\tblanchedalmond: '#FFEBCD',\n\tblueviolet: '#8A2BE2',\n\tbrown: '#A52A2A',\n\tburlywood: '#DEB887',\n\tcadetblue: '#5F9EA0',\n\tchartreuse: '#7FFF00',\n\tchocolate: '#D2691E',\n\tcoral: '#FF7F50',\n\tcornflowerblue: '#6495ED',\n\tcornsilk: '#FFF8DC',\n\tcrimson: '#DC143C',\n\tcyan: '#00FFFF',\n\tdarkblue: '#00008B',\n\tdarkcyan: '#008B8B',\n\tdarkgoldenrod: '#B8860B',\n\tdarkgray: '#A9A9A9',\n\tdarkgreen: '#006400',\n\tdarkgrey: '#A9A9A9',\n\tdarkkhaki: '#BDB76B',\n\tdarkmagenta: '#8B008B',\n\tdarkolivegreen: '#556B2F',\n\tdarkorange: '#FF8C00',\n\tdarkorchid: '#9932CC',\n\tdarkred: '#8B0000',\n\tdarksalmon: '#E9967A',\n\tdarkseagreen: '#8FBC8F',\n\tdarkslateblue: '#483D8B',\n\tdarkslategray: '#2F4F4F',\n\tdarkslategrey: '#2F4F4F',\n\tdarkturquoise: '#00CED1',\n\tdarkviolet: '#9400D3',\n\tdeeppink: '#FF1493',\n\tdeepskyblue: '#00BFFF',\n\tdimgray: '#696969',\n\tdimgrey: '#696969',\n\tdodgerblue: '#1E90FF',\n\tfirebrick: '#B22222',\n\tfloralwhite: '#FFFAF0',\n\tforestgreen: '#228B22',\n\tgainsboro: '#DCDCDC',\n\tghostwhite: '#F8F8FF',\n\tgold: '#FFD700',\n\tgoldenrod: '#DAA520',\n\tgreenyellow: '#ADFF2F',\n\tgrey: '#808080',\n\thoneydew: '#F0FFF0',\n\thotpink: '#FF69B4',\n\tindianred: '#CD5C5C',\n\tindigo: '#4B0082',\n\tivory: '#FFFFF0',\n\tkhaki: '#F0E68C',\n\tlavender: '#E6E6FA',\n\tlavenderblush: '#FFF0F5',\n\tlawngreen: '#7CFC00',\n\tlemonchiffon: '#FFFACD',\n\tlightblue: '#ADD8E6',\n\tlightcoral: '#F08080',\n\tlightcyan: '#E0FFFF',\n\tlightgoldenrodyellow: '#FAFAD2',\n\tlightgray: '#D3D3D3',\n\tlightgreen: '#90EE90',\n\tlightgrey: '#D3D3D3',\n\tlightpink: '#FFB6C1',\n\tlightsalmon: '#FFA07A',\n\tlightseagreen: '#20B2AA',\n\tlightskyblue: '#87CEFA',\n\tlightslategray: '#778899',\n\tlightslategrey: '#778899',\n\tlightsteelblue: '#B0C4DE',\n\tlightyellow: '#FFFFE0',\n\tlimegreen: '#32CD32',\n\tlinen: '#FAF0E6',\n\tmagenta: '#FF00FF',\n\tmediumaquamarine: '#66CDAA',\n\tmediumblue: '#0000CD',\n\tmediumorchid: '#BA55D3',\n\tmediumpurple: '#9370DB',\n\tmediumseagreen: '#3CB371',\n\tmediumslateblue: '#7B68EE',\n\tmediumspringgreen: '#00FA9A',\n\tmediumturquoise: '#48D1CC',\n\tmediumvioletred: '#C71585',\n\tmidnightblue: '#191970',\n\tmintcream: '#F5FFFA',\n\tmistyrose: '#FFE4E1',\n\tmoccasin: '#FFE4B5',\n\tnavajowhite: '#FFDEAD',\n\toldlace: '#FDF5E6',\n\tolivedrab: '#6B8E23',\n\torange: '#FFA500',\n\torangered: '#FF4500',\n\torchid: '#DA70D6',\n\tpalegoldenrod: '#EEE8AA',\n\tpalegreen: '#98FB98',\n\tpaleturquoise: '#AFEEEE',\n\tpalevioletred: '#DB7093',\n\tpapayawhip: '#FFEFD5',\n\tpeachpuff: '#FFDAB9',\n\tperu: '#CD853F',\n\tpink: '#FFC0CB',\n\tplum: '#DDA0DD',\n\tpowderblue: '#B0E0E6',\n\trebeccapurple: '#663399',\n\trosybrown: '#BC8F8F',\n\troyalblue: '#4169E1',\n\tsaddlebrown: '#8B4513',\n\tsalmon: '#FA8072',\n\tsandybrown: '#F4A460',\n\tseagreen: '#2E8B57',\n\tseashell: '#FFF5EE',\n\tsienna: '#A0522D',\n\tskyblue: '#87CEEB',\n\tslateblue: '#6A5ACD',\n\tslategray: '#708090',\n\tslategrey: '#708090',\n\tsnow: '#FFFAFA',\n\tspringgreen: '#00FF7F',\n\tsteelblue: '#4682B4',\n\ttan: '#D2B48C',\n\tthistle: '#D8BFD8',\n\ttomato: '#FF6347',\n\ttransparent: '#00000000',\n\tturquoise: '#40E0D0',\n\tviolet: '#EE82EE',\n\twheat: '#F5DEB3',\n\twhitesmoke: '#F5F5F5',\n\tyellowgreen: '#9ACD32',\n\tgrape: '#CC5DE8',\n\tdark: '#3B3B3B',\n\tvolcano: '#FA541C',\n\tgeekblue: '#2F54EB',\n\tsuccess: '#4CAF50',\n\tinfo: '#2196F3',\n\twarning: '#FF9800',\n\terror: '#F44336',\n} as const;\n","import { convertColorCode } from './convert';\nimport { CSS_COLORS } from './css-colors';\nimport {\n\t_convertOpacityToHex,\n\t_isHSL,\n\t_isHSLA,\n\t_isRGB,\n\t_isRGBA,\n} from './helpers';\nimport { generateRandomHSLColor } from './random';\nimport type {\n\tAlphaColors,\n\tAnalogous,\n\tColors,\n\tColorType,\n\tCSSColor,\n\tHex6,\n\tHex8,\n\tHSL,\n\tHSLA,\n\tPercent,\n\tRGB,\n\tRGBA,\n\tSolidColors,\n\tTetrad,\n\tTriad,\n} from './types';\nimport { extractAlphaColorValues, extractSolidColorValues } from './utils';\n\nconst hsl = generateRandomHSLColor();\nconst { hex, rgb } = convertColorCode(hsl);\n\n/**\n * * Class representing a color and its conversions among `Hex`, `Hex8` `RGB`, `RGBA`, `HSL` and `HSLA` formats.\n * * It has 13 instance methods to manipulate and play with the color values.\n * * It has 7 static methods that can be used to check if a color is in `Hex`, `Hex8` `RGB`, `RGBA`, `HSL` or `HSLA` format.\n *\n * @property hex - The color in `Hex` format.\n * @property hex8 - The color in `Hex8` format.\n * @property rgb - The color in `RGB` format.\n * @property rgba - The color in `RGBA` format.\n * @property hsl - The color in `HSL` format.\n * @property hsla - The color in `HSLA` format.\n */\nexport class Color {\n\tpublic hex: Hex6;\n\tpublic hex8: Hex8;\n\tpublic rgb: RGB;\n\tpublic rgba: RGBA;\n\tpublic hsl: HSL;\n\tpublic hsla: HSLA;\n\n\t/**\n\t * * Creates a new `Color` instance with a random color and automatically converts the generated color to all other supported formats: `Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, and `HSLA`.\n\t *\n\t * @description\n\t * The `Color` class generates a random color in six common color representations:\n\t * - `Hex` (e.g., `#ff5733`)\n\t * - `Hex8` (Hex with opacity, e.g., `#ff573380`)\n\t * - `RGB` (e.g., `rgb(255, 87, 51)`)\n\t * - `RGBA` (e.g., `rgba(255, 87, 51, 1)`)\n\t * - `HSL` (e.g., `hsl(14, 100%, 60%)`)\n\t * - `HSLA` (e.g., `hsla(14, 100%, 60%, 1)`)\n\t *\n\t * Additionally:\n\t * - It has 13 instance methods to manipulate and play with the color values.\n\t * - Use static methods like `Color.isHex6(color)` to validate color strings.\n\t *\n\t * @example\n\t * // Generate a random color\n\t * const randomColor = new Color();\n\t * console.log(randomColor.hex, randomColor.rgb, randomColor.hsl);\n\t *\n\t * @returns Instance of `Color`.\n\t */\n\tconstructor();\n\n\t/**\n\t * * Creates a new `Color` instance with the input color and automatically converts it to all other supported formats: `Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, and `HSLA`.\n\t *\n\t * @description\n\t * The `Color` class allows seamless transformation between six common color representations:\n\t * - `Hex` (e.g., `#ff5733`)\n\t * - `Hex8` (Hex with opacity, e.g., `#ff573380`)\n\t * - `RGB` (e.g., `rgb(255, 87, 51)`)\n\t * - `RGBA` (e.g., `rgba(255, 87, 51, 1)`)\n\t * - `HSL` (e.g., `hsl(14, 100%, 60%)`)\n\t * - `HSLA` (e.g., `hsla(14, 100%, 60%, 1)`)\n\t *\n\t * You can create a color from any of these formats, and the class will populate the rest.\n\t *\n\t * Additionally:\n\t * - It has 13 instance methods to manipulate and play with the color values.\n\t * - Use available 7 static methods like `Color.isHex6(color)` to validate color strings.\n\t *\n\t * @param color - A color string in any supported format (`Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, or `HSLA`) to convert in all other formats (includes the current format).\n\t *\n\t * @example\n\t * // Convert an existing Hex color to all other formats\n\t * const color = new Color(\"#ff5733\");\n\t * console.log(color.rgb); // 'rgb(255, 87, 51)'\n\t * console.log(color.hsl); // 'hsl(14, 100%, 60%)'\n\t * console.log(color.rgba); // 'rgba(255, 87, 51, 1)'\n\t * console.log(color.hsla); // 'hsla(14, 100%, 60%, 1)'\n\t * console.log(color.hex8); // '#FF5733FF'\n\t *\n\t * @example\n\t * // Handle a color with alpha\n\t * const alphaColor = new Color(\"rgba(255, 0, 0, 0.5)\");\n\t * console.log(alphaColor.hex8); // '#FF000080'\n\t * console.log(alphaColor.hsla); // 'hsla(0, 100%, 50%, 0.5)'\n\t *\n\t * @returns Instance of `Color`.\n\t */\n\tconstructor(color: ColorType);\n\n\t/**\n\t * * Creates a new `Color` instance using a standard (CSS) named color and automatically converts it to all other supported formats: `Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, and `HSLA`.\n\t *\n\t * @description\n\t * This allows you to use any valid named color from standard `150+ `CSS color names (e.g., `\"red\"`, `\"blue\"`, `\"rebeccapurple\"`)\n\t *\n\t * @param color - A named color string from standard `150+ `CSS color names.\n\t *\n\t * @example\n\t * // Using a CSS named color\n\t * const sky = new Color(\"skyblue\");\n\t * console.log(sky.hex); // '#87CEEB'\n\t * console.log(sky.rgba); // 'rgba(135, 206, 235, 1)'\n\t *\n\t * @returns Instance of `Color`.\n\t */\n\tconstructor(color: CSSColor);\n\n\t/**\n\t * * Creates a new `Color` instance and automatically converts the input color to all other supported formats: `Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, and `HSLA`.\n\t *\n\t * @description\n\t * The `Color` class allows seamless transformation between six common color representations:\n\t * - `Hex` (e.g., `#ff5733`)\n\t * - `Hex8` (Hex with opacity, e.g., `#ff573380`)\n\t * - `RGB` (e.g., `rgb(255, 87, 51)`)\n\t * - `RGBA` (e.g., `rgba(255, 87, 51, 1)`)\n\t * - `HSL` (e.g., `hsl(14, 100%, 60%)`)\n\t * - `HSLA` (e.g., `hsla(14, 100%, 60%, 1)`)\n\t *\n\t * You can create a color from any of these formats, and the class will populate the rest.\n\t * If no color is passed, a random color will be generated.\n\t *\n\t * Additionally:\n\t * - It has 13 instance methods to manipulate and play with the color values.\n\t * - Use static methods like `Color.isHex6(color)` to validate color strings.\n\t *\n\t * @param color - An optional input color string in any supported format (`Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, or `HSLA`) to convert in all other (includes the current format) formats.\n\t *\n\t * @example\n\t * // Convert an existing Hex color to all other formats\n\t * const color = new Color(\"#ff5733\");\n\t * console.log(color.rgb); // 'rgb(255, 87, 51)'\n\t * console.log(color.hsl); // 'hsl(14, 100%, 60%)'\n\t * console.log(color.rgba); // 'rgba(255, 87, 51, 1)'\n\t * console.log(color.hsla); // 'hsla(14, 100%, 60%, 1)'\n\t * console.log(color.hex8); // '#FF5733FF'\n\t *\n\t * @example\n\t * // Handle a color with alpha\n\t * const alphaColor = new Color(\"rgba(255, 0, 0, 0.5)\");\n\t * console.log(alphaColor.hex8); // '#FF000080'\n\t * console.log(alphaColor.hsla); // 'hsla(0, 100%, 50%, 0.5)'\n\t *\n\t * @example\n\t * // Generate a random color\n\t * const randomColor = new Color();\n\t * console.log(randomColor.hex, randomColor.rgb, randomColor.hsl);\n\t *\n\t * @returns Instance of `Color`.\n\t */\n\tconstructor(color?: ColorType | CSSColor) {\n\t\tif (color) {\n\t\t\tif (Color.isCSSColor(color)) {\n\t\t\t\tconst newColor = new Color(CSS_COLORS[color]);\n\n\t\t\t\tthis.hex = newColor.hex;\n\t\t\t\tthis.hex8 = newColor.hex8;\n\t\t\t\tthis.rgb = newColor.rgb;\n\t\t\t\tthis.rgba = newColor.rgba;\n\t\t\t\tthis.hsl = newColor.hsl;\n\t\t\t\tthis.hsla = newColor.hsla;\n\t\t\t} else {\n\t\t\t\tconst colors = this.#convertColorToOthers(color);\n\n\t\t\t\tif ('hex8' in colors) {\n\t\t\t\t\t// Extract alpha color values (Hex8, RGBA, HSLA)\n\t\t\t\t\tconst rgbaValues = extractAlphaColorValues(colors.rgba);\n\t\t\t\t\tconst hslaValues = extractAlphaColorValues(colors.hsla);\n\n\t\t\t\t\tthis.hex = colors.hex8.toUpperCase().slice(0, 7) as Hex6;\n\t\t\t\t\tthis.hex8 = colors.hex8.toUpperCase() as Hex8;\n\t\t\t\t\tthis.rgb = `rgb(${rgbaValues[0]}, ${rgbaValues[1]}, ${rgbaValues[2]})`;\n\t\t\t\t\tthis.rgba = colors.rgba;\n\t\t\t\t\tthis.hsl = `hsl(${hslaValues[0]}, ${hslaValues[1]}%, ${hslaValues[2]}%)`;\n\t\t\t\t\tthis.hsla = colors.hsla;\n\t\t\t\t} else {\n\t\t\t\t\t// Extract solid color values (Hex, RGB, HSL)\n\t\t\t\t\tconst rgbValues = extractSolidColorValues(colors.rgb);\n\t\t\t\t\tconst hslValues = extractSolidColorValues(colors.hsl);\n\n\t\t\t\t\tthis.hex = colors.hex.toUpperCase() as Hex6;\n\t\t\t\t\tthis.hex8 =\n\t\t\t\t\t\t`${colors.hex.toUpperCase()}${_convertOpacityToHex(100)}` as Hex8;\n\t\t\t\t\tthis.rgb = colors.rgb;\n\t\t\t\t\tthis.rgba = `rgba(${rgbValues[0]}, ${rgbValues[1]}, ${rgbValues[2]}, 1)`;\n\t\t\t\t\tthis.hsl = colors.hsl;\n\t\t\t\t\tthis.hsla = `hsla(${hslValues[0]}, ${hslValues[1]}%, ${hslValues[2]}%, 1)`;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst rgbValues = extractSolidColorValues(rgb);\n\t\t\tconst hslValues = extractSolidColorValues(hsl);\n\n\t\t\t// Generate random colors\n\t\t\tthis.hex = hex.toUpperCase() as Hex6;\n\t\t\tthis.hex8 =\n\t\t\t\t`${hex.toUpperCase()}${_convertOpacityToHex(100)}` as Hex8;\n\t\t\tthis.rgb = rgb;\n\t\t\tthis.rgba = `rgba(${rgbValues[0]}, ${rgbValues[1]}, ${rgbValues[2]}, 1)`;\n\t\t\tthis.hsl = hsl;\n\t\t\tthis.hsla = `hsla(${hslValues[0]}, ${hslValues[1]}%, ${hslValues[2]}%, 1)`;\n\t\t}\n\t}\n\n\t/** - Iterates over the color representations (Hex, RGB, HSL). */\n\t*[Symbol.iterator]() {\n\t\tyield this.hex;\n\t\tyield this.hex8;\n\t\tyield this.rgb;\n\t\tyield this.rgba;\n\t\tyield this.hsl;\n\t\tyield this.hsla;\n\t}\n\n\t/**\n\t * @instance Applies or modifies the opacity of a color. Mutate the original instance.\n\t * - For solid colors (Hex6/RGB/HSL): Adds an alpha channel with the specified opacity.\n\t * - For alpha colors (Hex8/RGBA/HSLA): Updates the existing alpha channel.\n\t *\n\t * @param opacity - A number between 0-100 representing the opacity percentage.\n\t * @returns A new instance of `Color` containing all color formats with the applied opacity.\n\t *\n\t * @example\n\t * const color = new Color(\"#ff0000\");\n\t * const alpha50 = color.applyOpacity(50); // 50% opacity\n\t * console.log(alpha50.rgba); // rgba(255, 0, 0, 0.5)\n\t *\n\t * @example\n\t * const alphaColor = new Color(\"#ff000080\"); // Color with 50% opacity\n\t * const alpha75 = alphaColor.applyOpacity(75); // Change to 75% opacity\n\t * console.log(alpha75.hex8); // #FF0000BF\n\t */\n\tapplyOpacity(opacity: Percent): Color {\n\t\tconst validOpacity = Math.min(100, Math.max(0, opacity));\n\t\tconst alphaHex = _convertOpacityToHex(opacity);\n\t\tconst alphaDecimal = validOpacity / 100;\n\n\t\tconst rgbValues = extractSolidColorValues(this.rgb);\n\t\tconst hslValues = extractSolidColorValues(this.hsl);\n\n\t\treturn Color.#fromParts({\n\t\t\thex: this.hex.slice(0, 7).toUpperCase() as Hex6,\n\t\t\thex8: `${this.hex.slice(0, 7)}${alphaHex}`.toUpperCase() as Hex8,\n\t\t\trgb: `rgb(${rgbValues[0]}, ${rgbValues[1]}, ${rgbValues[2]})`,\n\t\t\trgba: `rgba(${rgbValues[0]}, ${rgbValues[1]}, ${rgbValues[2]}, ${alphaDecimal})`,\n\t\t\thsl: `hsl(${hslValues[0]}, ${hslValues[1]}%, ${hslValues[2]}%)`,\n\t\t\thsla: `hsla(${hslValues[0]}, ${hslValues[1]}%, ${hslValues[2]}%, ${alphaDecimal})`,\n\t\t});\n\t}\n\n\t/**\n\t * @instance Darkens the color by reducing the lightness by the given percentage.\n\t * @param percent - The percentage to darken (0–100).\n\t * @returns A new `Color` instance with the modified darkness.\n\t */\n\tapplyDarkness(percent: Percent): Color {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst newL = Math.max(0, l - percent);\n\n\t\tconst newHSL = `hsl(${h}, ${s}%, ${newL}%)` as HSL;\n\n\t\treturn new Color(newHSL).applyOpacity((a * 100) as Percent);\n\t}\n\n\t/**\n\t * @instance Lightens the color by increasing the lightness by the given percentage.\n\t * @param percent - The percentage to brighten (0–100).\n\t * @returns A new `Color` instance with the modified lightness.\n\t */\n\tapplyBrightness(percent: Percent): Color {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst newL = Math.min(100, l + percent);\n\n\t\tconst newHSL = `hsl(${h}, ${s}%, ${newL}%)` as HSL;\n\n\t\treturn new Color(newHSL).applyOpacity((a * 100) as Percent);\n\t}\n\n\t/**\n\t * @instance Reduces the saturation of the color to make it appear duller.\n\t * @param percent - The percentage to reduce saturation (0–100).\n\t * @returns A new `Color` instance with the modified saturation.\n\t */\n\tapplyDullness(percent: Percent): Color {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst newS = Math.max(0, s - percent);\n\n\t\tconst newHSL = `hsl(${h}, ${newS}%, ${l}%)` as HSL;\n\n\t\treturn new Color(newHSL).applyOpacity((a * 100) as Percent);\n\t}\n\n\t/**\n\t * @instance Softens the color toward white by reducing saturation and increasing lightness based on a percentage.\n\t * - *This creates a soft UI-like white shade effect (similar to some UI libraries' light color scale).*\n\t * @param percent - Value from 0 to 100 representing how far to push the color toward white.\n\t * @returns A new `Color` instance shifted toward white.\n\t */\n\tapplyWhiteShade(percent: Percent): Color {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\t// Cap values to avoid overshooting\n\t\tconst newS = Math.max(0, s - (s * percent) / 100);\n\t\tconst newL = Math.min(100, l + ((100 - l) * percent) / 100);\n\n\t\tconst newHSL = `hsl(${h}, ${newS}%, ${newL}%)` as HSL;\n\n\t\treturn new Color(newHSL).applyOpacity((a * 100) as Percent);\n\t}\n\n\t/**\n\t * @instance Blends the current color with another color based on the given weight.\n\t *\n\t * - **NOTE:** *If any of the input colors has opacity (alpha channel), it might be lost or distorted from the generated alpha variants of the respective color formats.*\n\t *\n\t * @param other - The color in any 6 `(Hex, Hex8 RGB, RGBA, HSL or HSLA)` format to blend with.\n\t * @param weight - A number from 0 to 1 indicating the weight of the other color. Defaults to `0.5`.\n\t * - `weight = 0` → only the original color.\n\t * - `weight = 1` → only the other color.\n\t * - `weight = 0.5` → equal blend between the two.\n\t * @returns A new `Color` instance representing the blended result, with proper alpha blending.\n\t */\n\tblendWith(other: ColorType | CSSColor, weight = 0.5): Color {\n\t\tconst w = Math.max(0, Math.min(1, weight));\n\n\t\tconst converted =\n\t\t\tColor.isCSSColor(other) ? new Color(other) : new Color(other);\n\n\t\tconst [r1, b1, g1, a1] = extractAlphaColorValues(this.rgba);\n\t\tconst [r2, b2, g2, a2] = extractAlphaColorValues(converted.rgba);\n\n\t\tconst alpha = Math.round((a1 * (1 - w) + a2 * w) * 100) / 100;\n\n\t\tconst blendChannel = (c1: number, c2: number): number => {\n\t\t\treturn Math.round((c1 * a1 * (1 - w) + c2 * a2 * w) / alpha);\n\t\t};\n\n\t\tconst r = blendChannel(r1, r2);\n\t\tconst g = blendChannel(g1, g2);\n\t\tconst b = blendChannel(b1, b2);\n\n\t\tconst blended = `rgba(${r}, ${g}, ${b}, ${alpha})`;\n\n\t\treturn new Color(blended as RGBA);\n\t}\n\n\t/**\n\t * @instance Calculates the contrast ratio between this color and another color (WCAG).\n\t * @param other - The other color to compare against.\n\t * @returns A number representing the contrast ratio (rounded to 2 decimal places).\n\t */\n\tcontrastRatio(other: ColorType | CSSColor): number {\n\t\tconst newColor =\n\t\t\tColor.isCSSColor(other) ? new Color(other) : new Color(other);\n\n\t\tconst luminance = (rgb: RGB): number => {\n\t\t\tconst [r, g, b] = extractSolidColorValues(rgb).map((v) => {\n\t\t\t\tconst c = v / 255;\n\t\t\t\treturn c <= 0.03928 ?\n\t\t\t\t\t\tc / 12.92\n\t\t\t\t\t:\tMath.pow((c + 0.055) / 1.055, 2.4);\n\t\t\t});\n\n\t\t\treturn 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\t\t};\n\n\t\tconst lum1 = luminance(this.rgb);\n\t\tconst lum2 = luminance(newColor.rgb);\n\n\t\tconst brighter = Math.max(lum1, lum2);\n\t\tconst darker = Math.min(lum1, lum2);\n\n\t\tconst ratio = (brighter + 0.05) / (darker + 0.05);\n\n\t\treturn Math.round(ratio * 100) / 100;\n\t}\n\n\t/**\n\t * @instance Returns the complementary color by rotating the hue 180 degrees.\n\t * @returns A new Color that is the complement of the current color.\n\t */\n\tgetComplementaryColor(): Color {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst newHue = (h + 180) % 360;\n\n\t\tconst newHSL = `hsl(${newHue}, ${s}%, ${l}%)` as HSL;\n\n\t\treturn new Color(newHSL).applyOpacity((a * 100) as Percent);\n\t}\n\n\t/**\n\t * @instance Generates a color scheme of analogous colors, including the base color.\n\t * Analogous colors are next to each other on the color wheel (±30°).\n\t * @returns An array of three Color instances: [base, left, right].\n\t */\n\tgetAnalogousColors(): Analogous {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst left = `hsl(${(h + 330) % 360}, ${s}%, ${l}%)` as HSL;\n\t\tconst right = `hsl(${(h + 30) % 360}, ${s}%, ${l}%)` as HSL;\n\n\t\tconst analogous = [this, new Color(left), new Color(right)];\n\n\t\treturn analogous.map((c) =>\n\t\t\tc.applyOpacity((a * 100) as Percent),\n\t\t) as Analogous;\n\t}\n\n\t/**\n\t * @instance Generates a color triad scheme including the base color.\n\t * Triadic colors are evenly spaced (120° apart) on the color wheel.\n\t * @returns An array of three Color instances: [base, triad1, triad2].\n\t */\n\tgetTriadColors(): Triad {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst c1 = `hsl(${(h + 120) % 360}, ${s}%, ${l}%)` as HSL;\n\t\tconst c2 = `hsl(${(h + 240) % 360}, ${s}%, ${l}%)` as HSL;\n\n\t\tconst triad = [this, new Color(c1), new Color(c2)];\n\n\t\treturn triad.map((c) => c.applyOpacity((a * 100) as Percent)) as Triad;\n\t}\n\n\t/**\n\t * @instance Generates a tetradic color scheme including the base color.\n\t * Tetradic colors form a rectangle on the color wheel (90° apart).\n\t * @returns An array of four Color instances: [base, tetrad1, tetrad2, tetrad3].\n\t */\n\tgetTetradColors(): Tetrad {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst c1 = `hsl(${(h + 90) % 360}, ${s}%, ${l}%)` as HSL;\n\t\tconst c2 = `hsl(${(h + 180) % 360}, ${s}%, ${l}%)` as HSL;\n\t\tconst c3 = `hsl(${(h + 270) % 360}, ${s}%, ${l}%)` as HSL;\n\n\t\tconst tetrad = [this, new Color(c1), new Color(c2), new Color(c3)];\n\n\t\treturn tetrad.map((c) =>\n\t\t\tc.applyOpacity((a * 100) as Percent),\n\t\t) as Tetrad;\n\t}\n\n\t/**\n\t * @instance Gets the `WCAG` accessibility rating between this and another color.\n\t * @param other - The other color to test contrast against.\n\t * @returns 'Fail', 'AA', or 'AAA' based on `WCAG 2.1` contrast standards.\n\t */\n\tgetWCAGRating(other: ColorType | CSSColor): 'Fail' | 'AA' | 'AAA' {\n\t\tconst ratio = this.contrastRatio(other);\n\n\t\tif (ratio >= 7) return 'AAA';\n\t\tif (ratio >= 4.5) return 'AA';\n\t\treturn 'Fail';\n\t}\n\n\t/**\n\t * @instance Determines if the color is light based on its perceived brightness.\n\t * @returns `true` if light, `false` if dark.\n\t */\n\tisLightColor(): boolean {\n\t\tconst [r, g, b] = extractSolidColorValues(this.rgb);\n\n\t\tconst brightness = (r * 299 + g * 587 + b * 114) / 1000;\n\n\t\treturn brightness > 127.5;\n\t}\n\n\t/**\n\t * @static Checks if a color is in `Hex6` format.\n\t *\n\t * @param color Color to check.\n\t * @returns Boolean: `true` if it's a `Hex6` color, `false` if not.\n\t */\n\tstatic isHex6(color: string): color is Hex6 {\n\t\treturn /^#[0-9A-Fa-f]{6}$/.test(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is in `Hex8` format.\n\t *\n\t * @param color Color to check.\n\t * @returns Boolean: `true` if it's a `Hex8` color, `false` if not.\n\t */\n\tstatic isHex8(color: string): color is Hex8 {\n\t\treturn /^#[0-9A-Fa-f]{8}$/.test(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is in `RGB` format and within valid ranges.\n\t *\n\t * @param color Color to check.\n\t * @returns `true` if it's a `RGB` color, `false` if not.\n\t */\n\tstatic isRGB(color: string): color is RGB {\n\t\treturn _isRGB(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is in `RGBA` format and within valid ranges.\n\t *\n\t * @param color Color to check.\n\t * @returns `true` if it's a `RGBA` color, `false` if not.\n\t */\n\tstatic isRGBA(color: string): color is RGBA {\n\t\treturn _isRGBA(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is in `HSL` format and within valid ranges.\n\t *\n\t * @param color Color to check.\n\t * @returns `true` if it's a `HSL` color, `false` if not.\n\t */\n\tstatic isHSL(color: string): color is HSL {\n\t\treturn _isHSL(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is in `HSLA` format and within valid ranges.\n\t *\n\t * @param color Color to check.\n\t * @returns `true` if it's a `HSLA` color, `false` if not.\n\t */\n\tstatic isHSLA(color: string): color is HSLA {\n\t\treturn _isHSLA(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is a valid CSS color name.\n\t * - This method checks against a predefined list of CSS color names.\n\t * - It does not validate format types like Hex, RGB, or HSL or their alpha channels.\n\t *\n\t * @param color - The color to check.\n\t * @returns `true` if the color is a valid CSS color name, `false` otherwise.\n\t */\n\tstatic isCSSColor(color: string): color is CSSColor {\n\t\treturn (\n\t\t\t!Color.isHex6(color) &&\n\t\t\t!Color.isHex8(color) &&\n\t\t\t!_isRGB(color) &&\n\t\t\t!_isRGBA(color) &&\n\t\t\t!_isHSL(color) &&\n\t\t\t!_isHSLA(color) &&\n\t\t\tcolor in CSS_COLORS\n\t\t);\n\t}\n\n\t/**\n\t * @private Converts the given color to all other formats while preserving the original.\n\t *\n\t * @param color - The color to convert.\n\t * @returns An object containing Hex, RGB, and HSL representations.\n\t */\n\t#convertColorToOthers(color: ColorType): SolidColors | AlphaColors {\n\t\tif (Color.isHex6(color)) {\n\t\t\tconst { rgb, hsl } = convertColorCode(color);\n\t\t\treturn { hex: color, rgb, hsl };\n\t\t} else if (Color.isRGB(color)) {\n\t\t\tconst { hex, hsl } = convertColorCode(color);\n\t\t\treturn { hex, rgb: color, hsl };\n\t\t} else if (Color.isHSL(color)) {\n\t\t\tconst { hex, rgb } = convertColorCode(color);\n\t\t\treturn { hex, rgb, hsl: color };\n\t\t} else if (Color.isHex8(color)) {\n\t\t\tconst { rgba, hsla } = convertColorCode(color);\n\t\t\treturn { hex8: color, rgba, hsla };\n\t\t} else if (Color.isRGBA(color)) {\n\t\t\tconst { hex8, hsla } = convertColorCode(color);\n\t\t\treturn { hex8, rgba: color, hsla };\n\t\t} else if (Color.isHSLA(color)) {\n\t\t\tconst { hex8, rgba } = convertColorCode(color);\n\t\t\treturn { hex8, rgba, hsla: color };\n\t\t}\n\n\t\tthrow new Error(`Unrecognized color format: ${color}`);\n\t}\n\n\t/**\n\t * @private @static Internal factory to create a Color instance from parsed parts.\n\t * @param parts All the color parts as object.\n\t * @returns An instance of `Color`.\n\t */\n\tstatic #fromParts(parts: Colors): Color {\n\t\tconst color = Object.create(Color.prototype) as Color;\n\t\tcolor.hex = parts.hex;\n\t\tcolor.hex8 = parts.hex8;\n\t\tcolor.rgb = parts.rgb;\n\t\tcolor.rgba = parts.rgba;\n\t\tcolor.hsl = parts.hsl;\n\t\tcolor.hsla = parts.hsla;\n\n\t\treturn color;\n\t}\n}\n","import { isString } from '../guards/primitives';\nimport { isNumericString } from '../guards/specials';\nimport type { Numeric } from '../types';\nimport type { Time, UTCOffSet } from './types';\n\n/**\n * * Checks if the provided value is a valid time string in \"HH:MM\" format.\n *\n * @param value - The value to check.\n * @returns `true` if the value is a valid time string, `false` otherwise.\n */\nexport function isValidTime(value: unknown): value is Time {\n\tif (!isString(value)) return false;\n\n\tconst [hourStr, minuteStr] = value.split(':');\n\n\tif (!isNumericString(hourStr) || !isNumericString(minuteStr)) return false;\n\n\tconst hour = Number(hourStr);\n\tconst minute = Number(minuteStr);\n\n\treturn hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59;\n}\n\n/**\n * * Checks if the provided value is a valid UTCOffSet (e.g. `UTC-01:30`).\n *\n * @param value - The value to check.\n * @returns `true` if the value is a valid utc offset, `false` otherwise.\n */\nexport function isValidUTCOffSet(value: unknown): value is UTCOffSet {\n\tif (!isString(value)) return false;\n\n\treturn /^UTC[+-]?\\d{1,2}:\\d{2}$/.test(value);\n}\n\n/**\n * * Checks if the year is a leap year.\n *\n * - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.\n * - For example, 2000 and 2400 are leap years, but 1900 and 2100 are not.\n * @param year The year to check.\n * @returns `true` if the year is a leap year, `false` otherwise.\n */\nexport function isLeapYear(year: Numeric): boolean {\n\treturn (\n\t\t(Number(year) % 4 === 0 && Number(year) % 100 !== 0) ||\n\t\tNumber(year) % 400 === 0\n\t);\n}\n\n/**\n * * Checks if a value is a date-like object from `Date`, `Chronos`, `Moment.js`, `Day.js`, `Luxon`, `JS-Joda`, or `Temporal`\n * @param value Value to check if it is date-like object.\n * @returns `true` if the value is date-like object, otherwise `false`.\n */\nexport function isDateLike(value: unknown): boolean {\n\tif (value instanceof Date) return true;\n\n\tif (value && typeof value === 'object') {\n\t\tconst v = value as Record<string, unknown>;\n\n\t\t// Chronos, Moment or Day.js\n\t\tif (\n\t\t\ttypeof v.format === 'function' &&\n\t\t\ttypeof v.toJSON === 'function' &&\n\t\t\ttypeof v.toISOString === 'function'\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Luxon\n\t\tif (\n\t\t\ttypeof v.toISO === 'function' &&\n\t\t\ttypeof v.toFormat === 'function' &&\n\t\t\ttypeof v.isValid === 'boolean'\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// JS-Joda\n\t\tif (\n\t\t\ttypeof v.plus === 'function' &&\n\t\t\ttypeof v.minus === 'function' &&\n\t\t\ttypeof v.equals === 'function' &&\n\t\t\ttypeof v.getClass === 'function'\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Temporal\n\t\tif (\n\t\t\ttypeof v.toJSON === 'function' &&\n\t\t\ttypeof v.toString === 'function' &&\n\t\t\t['PlainDate', 'ZonedDateTime', 'Instant'].includes(\n\t\t\t\tv.constructor?.name ?? '',\n\t\t\t)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","import type { Numeric } from '../types';\nimport type { Time, UTCOffSet } from './types';\n\n/**\n * * Extracts the hour and minute from a time string in `HH:MM` or `-HH:MM` format.\n *\n * @param time - The time string to extract from.\n * @return The extracted hour and minute as number tuple.\n */\nexport function extractHourMinute(time: `-${Time}` | Time): [number, number] {\n\tconst [hour, minute] = time.split(':').map(Number);\n\n\treturn [hour, minute];\n}\n\n/**\n * * Converts a time string `HH:MM` or `-HH:MM` into total minutes from `00:00`.\n *\n * @param time - The time in `HH:MM` or `-HH:MM` format.\n * @returns The total minutes elapsed since `00:00`.\n */\nexport function getTotalMinutes(time: `-${Time}` | Time): number {\n\tconst isNegative = time.startsWith('-');\n\n\tconst [h, m] = extractHourMinute(\n\t\tisNegative ? (time.slice(1) as Time) : time,\n\t);\n\n\tconst total = h * 60 + m;\n\n\treturn isNegative ? -total : total;\n}\n\n/**\n * * Returns the current date and time as `Date` object.\n * - All the methods and properties of `new Date()` are accessible.\n *\n * @returns The current date and time as a `Date` object.\n */\nexport function getCurrentDateTime(): Date {\n\treturn new Date();\n}\n\n/**\n * * Extract Time in `HH:MM` format from given UTC value.\n *\n * @param utc UTC value in `UTC-01:30` or `UTC+01:30` format.\n * @returns The UTC value in `HH:MM` format.\n */\nexport function extractTimeFromUTC(utc: UTCOffSet): `-${Time}` | Time {\n\treturn utc.replace(/^UTC[+]?/g, '') as `-${Time}` | Time;\n}\n\n/**\n * * Converts a UTC value in `UTC-01:30` or `UTC+01:30` format into total minutes in number.\n *\n * @param time - UTC value in `UTC-01:30` or `UTC+01:30` format.\n * @returns The total minutes elapsed since `00:00`.\n */\nexport function extractMinutesFromUTC(utc: UTCOffSet): number {\n\treturn getTotalMinutes(extractTimeFromUTC(utc));\n}\n\n/**\n * * Converts a minute-based offset to a UTC offset string in the format `UTC±HH:MM`.\n *\n * @param minutes - The offset in minutes (positive or negative).\n * @returns A formatted UTC offset string like `UTC+05:30` or `UTC-04:00`.\n */\nexport function formatUTCOffset(minutes: Numeric): UTCOffSet {\n\tconst numMIn = typeof minutes === 'number' ? minutes : Number(minutes);\n\n\tconst sign = numMIn < 0 ? '-' : '+';\n\tconst abs = Math.abs(numMIn);\n\tconst hours = String(Math.floor(abs / 60)).padStart(2, '0');\n\tconst mins = String(abs % 60).padStart(2, '0');\n\n\treturn `UTC${sign}${hours}:${mins}` as UTCOffSet;\n}\n","import { isValidTime } from './guards';\nimport type { GreetingConfigs } from './types';\nimport {\n\textractHourMinute,\n\tgetCurrentDateTime,\n\tgetTotalMinutes,\n} from './utils';\n\n/**\n * * Returns a greeting message based on the provided time or current time.\n *\n * @param configs - Configuration options for greeting times and messages.\n * @returns The appropriate greeting message.\n */\nexport function getGreeting(configs?: GreetingConfigs): string {\n\tconst {\n\t\tmorningEnds = '11:59',\n\t\tnoonEnds = '12:59',\n\t\tafternoonEnds = '17:59',\n\t\teveningEnds = '23:59',\n\t\tmidnightEnds = '02:59',\n\t\tcurrentTime,\n\t\tappendToMsg = '',\n\t\tprependToMsg = '',\n\t\tmorningMessage = 'Good Morning!',\n\t\tnoonMessage = 'Good Noon!',\n\t\tafternoonMessage = 'Good Afternoon!',\n\t\teveningMessage = 'Good Evening!',\n\t\tmidnightMessage = 'Hello, Night Owl!',\n\t\tdefaultMessage = 'Greetings!',\n\t} = configs || {};\n\n\tlet hour: number;\n\tlet minute: number;\n\n\tif (currentTime && isValidTime(currentTime)) {\n\t\t[hour, minute] = extractHourMinute(currentTime);\n\t} else {\n\t\thour = getCurrentDateTime().getHours();\n\t\tminute = getCurrentDateTime().getMinutes();\n\t}\n\n\tconst currentTotalMinutes = hour * 60 + minute;\n\n\tconst morningEndMinutes = getTotalMinutes(morningEnds);\n\tconst noonEndMinutes = getTotalMinutes(noonEnds);\n\tconst afternoonEndMinutes = getTotalMinutes(afternoonEnds);\n\tconst eveningEndMinutes = getTotalMinutes(eveningEnds);\n\tconst midnightEndMinutes = getTotalMinutes(midnightEnds);\n\n\tif (currentTotalMinutes <= midnightEndMinutes) {\n\t\treturn prependToMsg.concat(midnightMessage.concat(appendToMsg));\n\t} else if (currentTotalMinutes <= morningEndMinutes) {\n\t\treturn prependToMsg.concat(morningMessage.concat(appendToMsg));\n\t} else if (currentTotalMinutes <= noonEndMinutes) {\n\t\treturn prependToMsg.concat(noonMessage.concat(appendToMsg));\n\t} else if (currentTotalMinutes <= afternoonEndMinutes) {\n\t\treturn prependToMsg.concat(afternoonMessage.concat(appendToMsg));\n\t} else if (currentTotalMinutes <= eveningEndMinutes) {\n\t\treturn prependToMsg.concat(eveningMessage.concat(appendToMsg));\n\t} else {\n\t\treturn prependToMsg.concat(defaultMessage.concat(appendToMsg));\n\t}\n}\n","import type { DayPart, Hours, UTCOffSet } from './types';\n\nexport const ORIGIN = Symbol('origin');\n\nexport const DAYS = [\n\t'Sunday',\n\t'Monday',\n\t'Tuesday',\n\t'Wednesday',\n\t'Thursday',\n\t'Friday',\n\t'Saturday',\n] as const;\n\nexport const MONTHS = [\n\t'January',\n\t'February',\n\t'March',\n\t'April',\n\t'May',\n\t'June',\n\t'July',\n\t'August',\n\t'September',\n\t'October',\n\t'November',\n\t'December',\n] as const;\n\nexport const YEAR_FORMATS = ['YYYY', 'YY', 'yyyy', 'yy'] as const;\nexport const MONTH_FORMATS = ['M', 'MM', 'mmm', 'mmmm'] as const;\nexport const DATE_FORMATS = ['DD', 'D', 'Do'] as const;\nexport const DAY_FORMATS = ['d', 'dd', 'ddd'] as const;\nexport const HOUR_FORMATS = ['H', 'HH', 'hh', 'h'] as const;\nexport const MINUTE_FORMATS = ['mm', 'm'] as const;\nexport const SECOND_FORMATS = ['ss', 's'] as const;\nexport const MILLISECOND_FORMATS = ['ms', 'mss'] as const;\nexport const TIME_FORMATS = ['a', 'A'] as const;\n\nexport const sortedFormats = [\n\t...YEAR_FORMATS,\n\t...MONTH_FORMATS,\n\t...DAY_FORMATS,\n\t...DATE_FORMATS,\n\t...HOUR_FORMATS,\n\t...MINUTE_FORMATS,\n\t...SECOND_FORMATS,\n\t...MILLISECOND_FORMATS,\n\t...TIME_FORMATS,\n].sort((a, b) => b.length - a.length);\n\nexport const TIME_ZONES = {\n\t// UTC -12:00 to -01:00 (Mostly Pacific Islands, Americas)\n\t/** International Date Line West (Baker Island, Howland Island) */\n\tIDLW: -12 * 60,\n\t/** Baker Island Time (Uninhabited) */\n\tBIT: -12 * 60,\n\t/** Samoa Standard Time (American Samoa, Midway) */\n\tSST: -11 * 60,\n\t/** Niue Time */\n\tNUT: -11 * 60,\n\t/** Hawaii-Aleutian Standard Time (USA-Hawaii) */\n\tHST: -10 * 60,\n\t/** Cook Island Time */\n\tCKT: -10 * 60,\n\t/** Tahiti Time (French Polynesia) */\n\tTAHT: -10 * 60,\n\t/** Alaska Standard Time (USA-Alaska) */\n\tAKST: -9 * 60,\n\t/** Gambier Time (French Polynesia) */\n\tGAMT: -9 * 60,\n\t/** Paraguay Time (Summer UTC-3) */\n\tPYT: -9 * 60,\n\t/** Marquesas Islands Time (UTC−09:30) */\n\tMART: -9.5 * 60,\n\t/** Hawaii-Aleutian Daylight Time (USA-Hawaii, DST) */\n\tHDT: -9 * 60,\n\t/** Pacific Standard Time (USA-West Coast, Canada) */\n\tPST: -8 * 60,\n\t/** Alaska Daylight Time (USA-Alaska, DST) */\n\tAKDT: -8 * 60,\n\t/** Mountain Standard Time (USA/Canada Rockies) */\n\tMST: -7 * 60,\n\t/** Mountain Daylight Time (USA/Canada Rockies, DST) */\n\tMDT: -6 * 60,\n\t/** Pacific Daylight Time (USA-West Coast, Canada, DST) */\n\tPDT: -7 * 60,\n\t/** Central Standard Time (USA/Canada Central) */\n\tCST: -6 * 60,\n\t/** Central Daylight Time (USA/Canada Central, DST) */\n\tCDT: -5 * 60,\n\t/** Easter Island Time (Chile) */\n\tEAST: -6 * 60,\n\t/** Eastern Standard Time (USA/Canada East Coast) */\n\tEST: -5 * 60,\n\t/** Eastern Daylight Time (USA/Canada East Coast, DST) */\n\tEDT: -4 * 60,\n\t/** Peru Time */\n\tPET: -5 * 60,\n\t/** Colombia Time */\n\tCOT: -5 * 60,\n\t/** Acre Time (Brazil-West) */\n\tACT: -5 * 60,\n\t/** Atlantic Standard Time (Canada-Maritime, Caribbean) */\n\tAST: -4 * 60,\n\t/** Bolivia Time */\n\tBOT: -4 * 60,\n\t/** Venezuelan Standard Time */\n\tVET: -4 * 60,\n\t/** Guyana Time */\n\tGYT: -4 * 60,\n\t/** Chile Standard Time */\n\tCLT: -4 * 60,\n\t/** Atlantic Daylight Time (Canada-Maritime, DST) */\n\tADT: -3 * 60,\n\t/** Brasília Time (Brazil-East) */\n\tBRT: -3 * 60,\n\t/** Argentina Time */\n\tART: -3 * 60,\n\t/** Uruguay Time */\n\tUYT: -3 * 60,\n\t/** Falkland Islands Summer Time */\n\tFKST: -3 * 60,\n\t/** Saint Pierre and Miquelon Standard Time */\n\tPMST: -3 * 60,\n\t/** Chile Summer Time (DST) */\n\tCLST: -3 * 60,\n\t/** French Guiana Time */\n\tGFT: -3 * 60,\n\t/** Newfoundland Standard Time */\n\tNST: -3.5 * 60,\n\t/** Newfoundland Daylight Time (DST) */\n\tNDT: -2.5 * 60,\n\t/** Fernando de Noronha Time (Brazil) */\n\tFNT: -2 * 60,\n\t/** South Georgia Time */\n\t'GST-South Georgia': -2 * 60,\n\t/** Brazil Summer Time (DST) */\n\tBRST: -2 * 60,\n\t/** Azores Time (Portugal) */\n\tAZOT: -1 * 60,\n\t/** Cape Verde Time */\n\tCVT: -1 * 60,\n\n\t// UTC ±00:00 (Europe, Africa, Greenland)\n\t/** Greenwich Mean Time (UK, Iceland, West Africa) */\n\tGMT: 0,\n\t/** Coordinated Universal Time */\n\tUTC: 0,\n\t/** Western European Time (Portugal, Morocco) */\n\tWET: 0,\n\t/** Eastern Greenland Summer Time */\n\tEGST: 0,\n\t/** Central European Time (France, Germany, Italy) */\n\tCET: 1 * 60,\n\t/** West Africa Time (Nigeria, Algeria) */\n\tWAT: 1 * 60,\n\t/** Middle European Time (Historical) */\n\tMET: 1 * 60,\n\t/** Western European Summer Time (Summer UTC+1) */\n\tWEST: 1 * 60,\n\t/** British Summer Time (UK DST) */\n\t'BST-UK': 1 * 60,\n\t/** Central European Summer Time (DST) */\n\tCEST: 2 * 60,\n\t/** Middle European Summer Time (DST) */\n\tMEST: 2 * 60,\n\n\t// UTC +02:00 to +05:00 (Europe, Africa, Middle East, Russia)\n\t/** Eastern European Time (Greece, Finland, Egypt) */\n\tEET: 2 * 60,\n\t/** Central Africa Time (Sudan, South Africa) */\n\tCAT: 2 * 60,\n\t/** South Africa Standard Time */\n\tSAST: 2 * 60,\n\t/** Israel Standard Time */\n\t'IST-ISRAEL': 2 * 60,\n\t/** Israel Daylight Time (DST) */\n\t'IST-IL': 2 * 60,\n\t/** Eastern European Summer Time */\n\tEEST: 3 * 60,\n\t/** Moscow Time (Russia-West) */\n\tMSK: 3 * 60,\n\t/** Syowa Time (Antarctica) */\n\tSYOT: 3 * 60,\n\t/** Arabia Standard Time (Iraq, Saudi Arabia) */\n\t'AST-ARAB': 3 * 60,\n\t/** East Africa Time (Kenya, Ethiopia) */\n\tEAT: 3 * 60,\n\t/** Iran Standard Time */\n\tIRST: 3.5 * 60,\n\t/** Iran Daylight Time (DST) */\n\tIRDT: 4.5 * 60,\n\t/** Armenia Time */\n\tAMT: 4 * 60,\n\t/** Georgia Time */\n\tGET: 4 * 60,\n\t/** Azerbaijan Time */\n\tAZT: 4 * 60,\n\t/** Mauritius Time */\n\tMUT: 4 * 60,\n\t/** Seychelles Time */\n\tSCT: 4 * 60,\n\t/** Gulf Standard Time (UAE, Oman) */\n\t'GST-GULF': 4 * 60,\n\t/** Samara Time (Russia) */\n\tSAMT: 4 * 60,\n\t/** Pakistan Standard Time */\n\tPKT: 5 * 60,\n\t/** Tajikistan Time */\n\tTJT: 5 * 60,\n\t/** Turkmenistan Time */\n\tTMT: 5 * 60,\n\t/** Uzbekistan Time */\n\tUZT: 5 * 60,\n\t/** Aqtobe Time (Kazakhstan) */\n\tAQTT: 5 * 60,\n\t/** Yekaterinburg Time (Russia) */\n\tYEKT: 5 * 60,\n\t/** Yekaterinburg Summer Time (Russia, DST) */\n\tYEKST: 5 * 60,\n\t/** India Standard Time */\n\t'IST-IN': 5.5 * 60,\n\n\t// UTC +05:30 to +09:00 (South Asia, Russia, Southeast Asia)\n\t/** Nepal Time (UTC+05:45) */\n\tNPT: 5.75 * 60,\n\t/** Nepal Time (alternative) */\n\t'NPT-NEPAL': 5.75 * 60,\n\t/** Bangladesh Time */\n\tBDT: 6 * 60,\n\t/** Bangladesh Standard Time */\n\t'BST-BD': 6 * 60,\n\t/** Bhutan Time */\n\tBTT: 6 * 60,\n\t/** Almaty Time (Kazakhstan) */\n\tALMT: 6 * 60,\n\t/** Omsk Time (Russia) */\n\tOMST: 6 * 60,\n\t/** Myanmar Time */\n\tMMT: 6.5 * 60,\n\t/** Cocos Islands Time */\n\tCCT: 6.5 * 60,\n\t/** Indochina Time (Thailand, Vietnam) */\n\tICT: 7 * 60,\n\t/** Thailand Standard Time */\n\tTHA: 7 * 60,\n\t/** Krasnoyarsk Time (Russia) */\n\tKRAT: 7 * 60,\n\t/** Western Indonesia Time (Jakarta) */\n\tWIB: 7 * 60,\n\t/** Hong Kong Time */\n\tHKT: 8 * 60,\n\t/** China Standard Time */\n\t'CST-CHINA': 8 * 60,\n\t/** Singapore Time */\n\tSGT: 8 * 60,\n\t/** Malaysia Time */\n\tMYT: 8 * 60,\n\t/** Philippines Time */\n\tPHT: 8 * 60,\n\t/** Irkutsk Time (Russia) */\n\tIRKT: 8 * 60,\n\t/** Irkutsk Daylight Time (Russia, DST) */\n\t'IRKT-DST': 9 * 60,\n\t/** Irkutsk Time (Russia, alternative) */\n\t'IRKT-RU': 8 * 60,\n\t/** Australian Western Standard Time */\n\tAWST: 8 * 60,\n\t/** Australian Central Western Standard Time (Eucla, UTC+08:45) */\n\tACWST: 8.75 * 60,\n\t/** Western Indonesia Time (Bali) */\n\tWITA: 8 * 60,\n\t/** Japan Standard Time */\n\tJST: 9 * 60,\n\t/** Korea Standard Time */\n\tKST: 9 * 60,\n\t/** Palau Time */\n\tPWT: 9 * 60,\n\t/** Yakutsk Time (Russia) */\n\tYAKT: 9 * 60,\n\t/** Eastern Indonesia Time (Jayapura) */\n\tWIT: 9 * 60,\n\n\t// UTC +09:30 to +14:00 (Australia, Pacific Islands, Russia)\n\t/** Australian Central Standard Time */\n\tACST: 9.5 * 60,\n\t/** Australian Central Daylight Time (DST) */\n\tACDT: 10.5 * 60,\n\t/** Australian Eastern Standard Time */\n\tAEST: 10 * 60,\n\t/** Australian Eastern Daylight Time (DST) */\n\tAEDT: 11 * 60,\n\t/** Vladivostok Time (Russia) */\n\tVLAT: 10 * 60,\n\t/** Lord Howe Standard Time (UTC+10:30) */\n\tLHST: 10.5 * 60,\n\t/** Lord Howe Daylight Time (DST +30min) */\n\tLHDT: 11 * 60,\n\t/** Sakhalin Time (Russia) */\n\tSAKT: 11 * 60,\n\t/** Magadan Time (Russia) */\n\tMAGT: 11 * 60,\n\t/** Norfolk Time (Australia) */\n\tNFT: 11 * 60,\n\t/** Chamorro Standard Time (Guam, Northern Mariana Islands) */\n\tCHST: 10 * 60,\n\t/** New Zealand Standard Time */\n\tNZST: 12 * 60,\n\t/** New Zealand Daylight Time (DST) */\n\tNZDT: 13 * 60,\n\t/** Fiji Time */\n\tFJT: 12 * 60,\n\t/** Tuvalu Time */\n\tTVT: 12 * 60,\n\t/** Chatham Standard Time (New Zealand) */\n\tCHAST: 12.75 * 60,\n\t/** Chatham Daylight Time (New Zealand, DST) */\n\tCHADT: 13.75 * 60,\n\t/** Chatham Standard Time (alternative) */\n\t'CHAST-NZ': 12.75 * 60,\n\t/** Phoenix Island Time (Kiribati) */\n\tPHOT: 13 * 60,\n\t/** Tokelau Time */\n\tTKT: 13 * 60,\n\t/** Tonga Time */\n\tTOT: 13 * 60,\n\t/** New Zealand Antarctica Time */\n\tNZAT: 13 * 60,\n\t/** Line Islands Time (Kiribati) */\n\tLINT: 14 * 60,\n\n\t// Antarctica (used in research stations)\n\t/** Rothera Time (Antarctica) */\n\tROTT: -3 * 60,\n\t/** Mawson Time (Antarctica) */\n\tMAWT: 5 * 60,\n\t/** Petropavlovsk-Kamchatsky Time (Russia) */\n\tPETT: 12 * 60,\n} as const;\n\nexport const TIME_ZONE_LABELS: Record<UTCOffSet, string> = {\n\t'UTC-12:00': 'Baker Island Time', // and Howland Island\n\t// 'UTC-11:30': 'Niue Time',\n\t// 'UTC-11:00': 'Niue Time',\n\t'UTC-11:00': 'Samoa Standard Time',\n\t// 'UTC-10:30': 'Marquesas Time',\n\t'UTC-10:00': 'Hawaii-Aleutian Standard Time',\n\t'UTC-09:30': 'Marquesas Islands Time',\n\t'UTC-09:00': 'Alaskan Standard Time',\n\t// 'UTC-08:30': 'Pitcairn Standard Time',\n\t'UTC-08:00': 'Pacific Standard Time',\n\t'UTC-07:30': 'Mountain Standard Time (Unofficial)',\n\t'UTC-07:00': 'Mountain Standard Time',\n\t'UTC-06:30': 'Central America Time (Unofficial)',\n\t'UTC-06:00': 'Central Standard Time',\n\t// 'UTC-05:30': 'Venezuelan Standard Time (Historical)',\n\t'UTC-05:00': 'Eastern Standard Time',\n\t// 'UTC-04:30': 'Venezuelan Standard Time',\n\t'UTC-04:00': 'Atlantic Standard Time',\n\t'UTC-03:30': 'Newfoundland Standard Time',\n\t'UTC-03:00': 'SA Eastern Standard Time',\n\t'UTC-02:30': 'Mid-Atlantic Time (Unofficial)',\n\t'UTC-02:00': 'Mid-Atlantic Standard Time',\n\t'UTC-01:30': 'Azores Time (Unofficial)',\n\t'UTC-01:00': 'Cape Verde Time',\n\t'UTC+00:00': 'Greenwich Mean Time',\n\t'UTC+00:30': 'British Summer Time (Historical)',\n\t'UTC+01:00': 'Central European Standard Time',\n\t'UTC+01:30': 'Central Africa Time (Unofficial)',\n\t'UTC+02:00': 'Eastern European Standard Time',\n\t'UTC+02:30': 'Israel Standard Time (Historical)',\n\t'UTC+03:00': 'Arab Standard Time',\n\t'UTC+03:30': 'Iran Standard Time',\n\t'UTC+04:00': 'Gulf Standard Time',\n\t'UTC+04:30': 'Afghanistan Time',\n\t'UTC+05:00': 'Pakistan Standard Time',\n\t'UTC+05:30': 'India Standard Time',\n\t'UTC+05:45': 'Nepal Standard Time',\n\t'UTC+06:00': 'Bangladesh Standard Time',\n\t'UTC+06:30': 'Myanmar Standard Time',\n\t'UTC+07:00': 'Indochina Standard Time',\n\t'UTC+07:30': 'Western Indonesia Time (Unofficial)',\n\t'UTC+08:00': 'China Standard Time',\n\t'UTC+08:30': 'North Korea Standard Time',\n\t'UTC+08:45': 'South-Western Australia Standard Time',\n\t'UTC+09:00': 'Japan Standard Time',\n\t'UTC+09:30': 'Central Australia Standard Time',\n\t'UTC+10:00': 'Eastern Australia Standard Time',\n\t'UTC+10:30': 'Lord Howe Standard Time',\n\t'UTC+11:00': 'Central Pacific Standard Time',\n\t// 'UTC+11:30': 'Norfolk Island Time',\n\t'UTC+12:00': 'New Zealand Standard Time',\n\t'UTC+12:45': 'Chatham Islands Time',\n\t'UTC+13:00': 'Phoenix Island Time',\n\t'UTC+13:45': 'Tokelau Time (Unofficial)',\n\t'UTC+14:00': 'Line Islands Time',\n} as Record<UTCOffSet, string>;\n\n/** Ranges for day parts. */\nexport const DEFAULT_RANGES: Record<DayPart, [Hours, Hours]> = {\n\tnight: ['21', '23'],\n\tmidnight: ['00', '01'],\n\tlateNight: ['02', '04'],\n\tmorning: ['05', '11'],\n\tafternoon: ['12', '16'],\n\tevening: ['17', '20'],\n} as const;\n\nexport const ZODIAC_SIGNS = [\n\t['Capricorn', [1, 19]],\n\t['Aquarius', [2, 18]],\n\t['Pisces', [3, 20]],\n\t['Aries', [4, 19]],\n\t['Taurus', [5, 20]],\n\t['Gemini', [6, 20]],\n\t['Cancer', [7, 22]],\n\t['Leo', [8, 22]],\n\t['Virgo', [9, 22]],\n\t['Libra', [10, 22]],\n\t['Scorpio', [11, 21]],\n\t['Sagittarius', [12, 21]],\n\t['Capricorn', [12, 31]],\n] as const;\n","import { isString } from '../guards/primitives';\nimport type { LocaleCode } from '../number/types';\nimport { getOrdinal, roundToNearest } from '../number/utilities';\nimport { formatUnitWithPlural } from '../string/convert';\nimport { isPalindrome } from '../string/guards';\nimport {\n\tDAYS,\n\tDEFAULT_RANGES,\n\tMONTHS,\n\tORIGIN,\n\tsortedFormats,\n\tTIME_ZONE_LABELS,\n\tTIME_ZONES,\n\tZODIAC_SIGNS,\n} from './constants';\nimport { isLeapYear, isValidUTCOffSet } from './guards';\nimport type {\n\tChronosFormat,\n\tChronosInput,\n\tChronosMethods,\n\tChronosObject,\n\tDayPart,\n\tDayPartConfig,\n\tFormatOptions,\n\tQuarter,\n\tStrictFormat,\n\tTimeDuration,\n\tTimeParts,\n\tTimeUnit,\n\tTimeZone,\n\tUTCOffSet,\n\tZodiacSign,\n} from './types';\nimport { extractMinutesFromUTC, formatUTCOffset } from './utils';\n\n/**\n * * Creates a new immutable `Chronos` instance.\n *\n * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n *\n * @param value - A date value (`number`, `string`, `Date`, or `Chronos` object).\n * - If a string is provided, it should be in a format that can be parsed by the Date constructor.\n * - If a number is provided, it should be a timestamp (milliseconds since the Unix epoch).\n * - If a Date object is provided, it will be used as is.\n * - If a Chronos object is provided, it will be converted to a Date object.\n *\n * **It also accepts number values as following:**\n * - **`year, month, date, hours, minutes, seconds, milliseconds`**: Individual components of a date-time to construct a `Chronos` instance.\n * - **`year`**: A number representing the year. If the year is between 0 and 99, it will be assumed to be the year 1900 + the provided year.\n * - **`month`**: A number between 1 and 12 representing the month (1 for January, 12 for December). It is adjusted internally to a 0-based index (0 for January, 11 for December).\n * - **`date`**: A number between 1 and 31 representing the day of the month.\n * - **`hours`**: A number between 0 and 23 representing the hour of the day.\n * - **`minutes`**: A number between 0 and 59 representing the minutes past the hour.\n * - **`seconds`**: A number between 0 and 59 representing the seconds past the minute.\n * - **`milliseconds`**: A number between 0 and 999 representing the milliseconds past the second.\n *\n * @returns Instance of `Chronos` with all methods and properties.\n */\nexport class Chronos {\n\treadonly #date: Date;\n\t#offset: UTCOffSet;\n\t[ORIGIN]?: ChronosMethods | 'root';\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * Accepts no arguments (defaults to now).\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor();\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * @param value - A date value in `number`, it should be a timestamp (milliseconds since the Unix epoch).\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(value: number);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param value - A date value in `string`, it should be in a format that can be parsed by the `Date` constructor.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(value: string);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param value - A date value as `Date` object, it will be used as is.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(value: Date);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param value - A date value as `Chronos` object.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(value: Chronos);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n\t * @param month The month as a number between 1 and 12 (January to December).\n\t * @param date The date as a number between 1 and 31.\n\t * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.\n\t * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.\n\t * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.\n\t * @param ms A number from 0 to 999 that specifies the milliseconds.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(\n\t\tyear: number,\n\t\tmonth: number,\n\t\tdate?: number,\n\t\thours?: number,\n\t\tminutes?: number,\n\t\tseconds?: number,\n\t\tms?: number,\n\t);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param value - A date value (`number`, `string`, `Date`, or `Chronos` object).\n\t * - If a string is provided, it should be in a format that can be parsed by the `Date` constructor.\n\t * - If a number is provided, it should be a timestamp (milliseconds since the Unix epoch).\n\t * - If a Date object is provided, it will be used as is.\n\t * - If a Chronos object is provided, it will be used directly.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(value?: ChronosInput);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param valueOrYear The value in number, string, Date or Chronos format or the full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n\t * @param month The month as a number between 1 and 12 (January to December).\n\t * @param date The date as a number between 1 and 31.\n\t * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.\n\t * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.\n\t * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.\n\t * @param ms A number from 0 to 999 that specifies the milliseconds.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(\n\t\tvalueOrYear?: ChronosInput,\n\t\tmonth?: number,\n\t\tdate?: number,\n\t\thours?: number,\n\t\tminutes?: number,\n\t\tseconds?: number,\n\t\tms?: number,\n\t) {\n\t\tif (typeof valueOrYear === 'number' && typeof month === 'number') {\n\t\t\tthis.#date = new Date(\n\t\t\t\tvalueOrYear,\n\t\t\t\tmonth - 1,\n\t\t\t\tdate ?? 1,\n\t\t\t\thours ?? 0,\n\t\t\t\tminutes ?? 0,\n\t\t\t\tseconds ?? 0,\n\t\t\t\tms ?? 0,\n\t\t\t);\n\t\t} else {\n\t\t\tthis.#date = this.#toNewDate(valueOrYear);\n\t\t}\n\n\t\tthis[ORIGIN] = 'root';\n\t\tthis.#offset = `UTC${this.getUTCOffset()}` as UTCOffSet;\n\t}\n\n\t*[Symbol.iterator](): IterableIterator<[string, number]> {\n\t\tyield ['year', this.year];\n\t\tyield ['month', this.month];\n\t\tyield ['isoMonth', this.month + 1];\n\t\tyield ['date', this.date];\n\t\tyield ['weekDay', this.weekDay];\n\t\tyield ['isoWeekDay', this.weekDay + 1];\n\t\tyield ['hour', this.hour];\n\t\tyield ['minute', this.minute];\n\t\tyield ['second', this.second];\n\t\tyield ['millisecond', this.millisecond];\n\t\tyield ['timestamp', this.timestamp];\n\t\tyield ['unix', this.unix];\n\t}\n\n\t/**\n\t * * Enables primitive coercion like `console.log`, `${chronos}`, etc.\n\t * @param hint - The type hint provided by the JS engine.\n\t * @returns The primitive value based on the hint.\n\t */\n\t[Symbol.toPrimitive](hint: string): string | number {\n\t\tif (hint === 'number') return this.valueOf();\n\t\treturn this.toLocalISOString();\n\t}\n\n\t[Symbol.replace](string: string, replacement: string): string {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc':\n\t\t\t\treturn string.replace(\n\t\t\t\t\tthis.toISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t\treplacement,\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn string.replace(\n\t\t\t\t\tthis.toLocalISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t\treplacement,\n\t\t\t\t);\n\t\t}\n\t}\n\n\t[Symbol.search](string: string): number {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc':\n\t\t\t\treturn string.indexOf(\n\t\t\t\t\tthis.toISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn string.indexOf(\n\t\t\t\t\tthis.toLocalISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t}\n\t}\n\n\t[Symbol.split](string: string): string[] {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc':\n\t\t\t\treturn string.split(\n\t\t\t\t\tthis.toISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn string.split(\n\t\t\t\t\tthis.toLocalISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t}\n\t}\n\n\tget [Symbol.toStringTag](): string {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\t\treturn this.toISOString().replace('Z', this.#offset.slice(3));\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc':\n\t\t\t\treturn this.#toLocalISOString().replace(\n\t\t\t\t\tthis.getUTCOffset(),\n\t\t\t\t\t'Z',\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn this.#toLocalISOString();\n\t\t}\n\t}\n\n\t/**\n\t * @private Method to create native `Date` instance from date-like data types.\n\t * @param value The value to convert into `Date`.\n\t * @returns Instance of native Date object.\n\t */\n\t#toNewDate(value?: ChronosInput): Date {\n\t\tconst date =\n\t\t\tvalue instanceof Chronos ?\n\t\t\t\tvalue.toDate()\n\t\t\t:\tnew Date(value ?? Date.now());\n\n\t\t// Check if the date is invalid\n\t\tif (isNaN(date.getTime())) {\n\t\t\tthrow new Error('Provided date is invalid!');\n\t\t}\n\n\t\treturn date;\n\t}\n\n\t/**\n\t * @private Method to tag origin of the `Chronos` instance.\n\t *\n\t * @param origin Origin of the instance, the method name from where it was created.\n\t * @param offset Optional UTC offset in `UTC+12:00` format.\n\t * @returns The `Chronos` instance with the specified origin.\n\t */\n\t#withOrigin(origin: ChronosMethods, offset?: UTCOffSet): Chronos {\n\t\tconst instance = new Chronos(this.#date);\n\t\tinstance[ORIGIN] = origin;\n\t\tif (offset) instance.#offset = offset;\n\t\treturn instance;\n\t}\n\n\t/**\n\t * @private Formats the current `Chronos` date using the specified template.\n\t *\n\t * @param format - The desired date format.\n\t * @param useUTC - Whether to use UTC or local time.\n\t * @returns Formatted date string.\n\t */\n\t#format(format: string, useUTC = false): string {\n\t\tconst year =\n\t\t\tuseUTC ? this.#date.getUTCFullYear() : this.#date.getFullYear();\n\t\tconst month = useUTC ? this.#date.getUTCMonth() : this.#date.getMonth();\n\t\tconst day = useUTC ? this.#date.getUTCDay() : this.#date.getDay();\n\t\tconst date = useUTC ? this.#date.getUTCDate() : this.#date.getDate();\n\t\tconst hours = useUTC ? this.#date.getUTCHours() : this.#date.getHours();\n\t\tconst minutes =\n\t\t\tuseUTC ? this.#date.getUTCMinutes() : this.#date.getMinutes();\n\t\tconst seconds =\n\t\t\tuseUTC ? this.#date.getUTCSeconds() : this.#date.getSeconds();\n\t\tconst milliseconds =\n\t\t\tuseUTC ?\n\t\t\t\tthis.#date.getUTCMilliseconds()\n\t\t\t:\tthis.#date.getMilliseconds();\n\n\t\tconst dateComponents: Record<ChronosFormat, string> = {\n\t\t\tYYYY: String(year),\n\t\t\tYY: String(year).slice(-2),\n\t\t\tyyyy: String(year),\n\t\t\tyy: String(year).slice(-2),\n\t\t\tM: String(month + 1),\n\t\t\tMM: String(month + 1).padStart(2, '0'),\n\t\t\tmmm: MONTHS[month].slice(0, 3),\n\t\t\tmmmm: MONTHS[month],\n\t\t\td: DAYS[day].slice(0, 2),\n\t\t\tdd: DAYS[day].slice(0, 3),\n\t\t\tddd: DAYS[day],\n\t\t\tD: String(date),\n\t\t\tDD: String(date).padStart(2, '0'),\n\t\t\tDo: getOrdinal(date),\n\t\t\tH: String(hours),\n\t\t\tHH: String(hours).padStart(2, '0'),\n\t\t\th: String(hours % 12 || 12),\n\t\t\thh: String(hours % 12 || 12).padStart(2, '0'),\n\t\t\tm: String(minutes),\n\t\t\tmm: String(minutes).padStart(2, '0'),\n\t\t\ts: String(seconds),\n\t\t\tss: String(seconds).padStart(2, '0'),\n\t\t\tms: String(milliseconds),\n\t\t\tmss: String(milliseconds).padStart(3, '0'),\n\t\t\ta: hours < 12 ? 'am' : 'pm',\n\t\t\tA: hours < 12 ? 'AM' : 'PM',\n\t\t};\n\n\t\tlet result = '';\n\t\tlet i = 0;\n\n\t\twhile (i < format?.length) {\n\t\t\tlet matched = false;\n\n\t\t\tfor (const token of sortedFormats) {\n\t\t\t\tconst ahead = format?.slice(i, i + token?.length);\n\t\t\t\tconst prev = i === 0 ? '' : format[i - 1];\n\t\t\t\tconst next = format[i + token?.length] ?? '';\n\n\t\t\t\t// Check non-alphanumeric boundaries\n\t\t\t\tconst prevOk = i === 0 || /[^a-zA-Z0-9]/.test(prev);\n\t\t\t\tconst nextOk =\n\t\t\t\t\ti + token?.length >= format?.length ||\n\t\t\t\t\t/[^a-zA-Z0-9]/.test(next);\n\n\t\t\t\tif (ahead === token && prevOk && nextOk) {\n\t\t\t\t\tresult += dateComponents[token];\n\t\t\t\t\ti += token?.length;\n\t\t\t\t\tmatched = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!matched) {\n\t\t\t\tresult += format[i];\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/** @private Returns ISO string with local time zone offset */\n\t#toLocalISOString(): string {\n\t\tconst pad = (n: number, p = 2) => String(n).padStart(p, '0');\n\n\t\treturn `${this.year}-${pad(this.month + 1)}-${pad(this.date)}T${pad(this.hour)}:${pad(this.minute)}:${pad(this.second)}.${pad(this.millisecond, 3)}${this.getUTCOffset()}`;\n\t}\n\n\t/**\n\t * @private Normalizes duration values based on sign and `absolute` flag.\n\t * @param result The raw time breakdown to normalize.\n\t * @param absolute If true, ensures all values are positive.\n\t * @param isFuture Whether the duration was forward (true) or backward (false).\n\t * @returns The normalized duration object.\n\t */\n\t#normalizeDuration(\n\t\tresult: TimeDuration,\n\t\tabsolute: boolean,\n\t\tisFuture: boolean,\n\t): TimeDuration {\n\t\tconst entries = Object.entries(result) as [\n\t\t\tkeyof TimeDuration,\n\t\t\tnumber,\n\t\t][];\n\n\t\tif (!absolute && !isFuture) {\n\t\t\tfor (const [key, value] of entries) {\n\t\t\t\tif (value !== 0) {\n\t\t\t\t\tresult[key] = value * -1;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (absolute) {\n\t\t\tfor (const [key, value] of entries) {\n\t\t\t\tresult[key] = Math.abs(value);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/** Gets the full year of the date. */\n\tget year(): number {\n\t\treturn this.#date.getFullYear();\n\t}\n\n\t/** Gets the month (0-11) of the date. */\n\tget month(): number {\n\t\treturn this.#date.getMonth();\n\t}\n\n\t/** Gets the day of the month (1-31). */\n\tget date(): number {\n\t\treturn this.#date.getDate();\n\t}\n\n\t/** Gets the day of the week (0-6, where 0 is Sunday). */\n\tget weekDay(): number {\n\t\treturn this.#date.getDay();\n\t}\n\n\t/** Gets the hour (0-23) of the date. */\n\tget hour(): number {\n\t\treturn this.#date.getHours();\n\t}\n\n\t/** Gets the minute (0-59) of the date. */\n\tget minute(): number {\n\t\treturn this.#date.getMinutes();\n\t}\n\n\t/** Gets the second (0-59) of the date. */\n\tget second(): number {\n\t\treturn this.#date.getSeconds();\n\t}\n\n\t/** Gets the millisecond (0-999) of the date. */\n\tget millisecond(): number {\n\t\treturn this.#date.getMilliseconds();\n\t}\n\n\t/** Gets ISO weekday: 1 = Monday, 7 = Sunday */\n\tget isoWeekday(): number {\n\t\tconst day = this.weekDay;\n\n\t\treturn day === 0 ? 7 : day;\n\t}\n\n\t/** Gets ISO month (1–12 instead of 0–11) */\n\tget isoMonth(): number {\n\t\treturn this.month + 1;\n\t}\n\n\t/** Returns the Unix timestamp (seconds since the Unix epoch: January 1, 1970, UTC). */\n\tget unix(): number {\n\t\treturn Math.floor(this.#date.getTime() / 1000);\n\t}\n\n\t/** Gets the time value in milliseconds since midnight, January 1, 1970 UTC. */\n\tget timestamp(): number {\n\t\treturn this.#date.getTime();\n\t}\n\n\t/** * Gets the last date (number) of the current month `(28, 29, 30 or 31)`. */\n\tget lastDateOfMonth(): 28 | 29 | 30 | 31 {\n\t\treturn this.lastDayOfMonth().#date.getDate() as 28 | 29 | 30 | 31;\n\t}\n\n\t/** @instance Returns a debug-friendly string for `console.log` or `util.inspect`. */\n\tinspect(): string {\n\t\treturn `[Chronos ${this.toLocalISOString()}]`;\n\t}\n\n\t/** @instance Enables JSON.stringify and logging in the console (in Browser environment) to show readable output. */\n\ttoJSON(): string {\n\t\treturn this.toLocalISOString();\n\t}\n\n\t/** @instance Enables arithmetic and comparison operations (e.g., +new Chronos()). */\n\tvalueOf(): number {\n\t\treturn this.getTimeStamp();\n\t}\n\n\t/** @instance Clones and returns a new Chronos instance with the same date. */\n\tclone(): Chronos {\n\t\treturn new Chronos(this.#date).#withOrigin(\n\t\t\tthis[ORIGIN] as ChronosMethods,\n\t\t);\n\t}\n\n\t/** @instance Gets the native `Date` instance (read-only). */\n\ttoDate(): Date {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc': {\n\t\t\t\tconst mins = this.getUTCOffsetMinutes();\n\n\t\t\t\tconst date = this.addMinutes(mins);\n\n\t\t\t\treturn date.toDate();\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn new Date(this.#date);\n\t\t}\n\t}\n\n\t/** @instance Returns a string representation of a date. The format of the string depends on the locale. */\n\ttoString(): string {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone': {\n\t\t\t\tconst gmt = this.#offset.replace('UTC', 'GMT').replace(':', '');\n\t\t\t\tconst label = TIME_ZONE_LABELS[this.#offset] ?? this.#offset;\n\n\t\t\t\treturn this.#date\n\t\t\t\t\t.toString()\n\t\t\t\t\t.replace(/GMT[+-]\\d{4} \\([^)]+\\)/, `${gmt} (${label})`);\n\t\t\t}\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc': {\n\t\t\t\tconst mins = this.getUTCOffsetMinutes();\n\n\t\t\t\tconst date = this.addMinutes(mins);\n\n\t\t\t\treturn date.toString();\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn this.#date.toString();\n\t\t}\n\t}\n\n\t/** @instance Returns ISO string with local time zone offset */\n\ttoLocalISOString(): string {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc': {\n\t\t\t\tconst previousOffset = this.getTimeZoneOffsetMinutes();\n\t\t\t\tconst currentOffset = this.getUTCOffsetMinutes();\n\n\t\t\t\tconst date = this.addMinutes(-previousOffset - currentOffset);\n\n\t\t\t\treturn date.#toLocalISOString();\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn this.#toLocalISOString();\n\t\t}\n\t}\n\n\t/** @instance Returns a date as a string value in ISO format. */\n\ttoISOString(): string {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\t\treturn this.#toLocalISOString().replace(\n\t\t\t\t\tthis.getUTCOffset(),\n\t\t\t\t\tthis.#offset.slice(3),\n\t\t\t\t);\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc':\n\t\t\t\treturn this.#toLocalISOString().replace(\n\t\t\t\t\tthis.getUTCOffset(),\n\t\t\t\t\t'Z',\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn this.#date.toISOString();\n\t\t}\n\t}\n\n\t/**\n\t * @instance Wrapper over native `toLocaleString`\n\t * @description Converts a date and time to a string by using the current or specified locale.\n\t *\n\t * @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n\t * @param options An object that contains one or more properties that specify comparison options.\n\t */\n\ttoLocaleString(\n\t\tlocale?: LocaleCode | Intl.Locale | (LocaleCode | Intl.Locale)[],\n\t\toptions?: Intl.DateTimeFormatOptions,\n\t): string {\n\t\treturn this.#date.toLocaleString(locale, options);\n\t}\n\n\t/** @instance Returns the time value in milliseconds since midnight, January 1, 1970 UTC. */\n\tgetTimeStamp(): number {\n\t\treturn this.#date.getTime();\n\t}\n\n\t/**\n\t * @instance Formats the date into a custom string format (local time).\n\t *\n\t * @param format - The desired format (Default format is `dd, mmm DD, YYYY HH:mm:ss` = `Sun, Apr 06, 2025 16:11:55`).\n\t * @param useUTC - Optional `useUTC` to get the formatted time using UTC Offset, defaults to `false`. Equivalent to `formatUTC()` method if set to `true`.\n\t * @returns Formatted date string in desired format (in local time unless `useUTC` passed as `true`).\n\t */\n\tformat(format?: string, useUTC = false): string {\n\t\treturn this.#format(format ?? 'dd, mmm DD, YYYY HH:mm:ss', useUTC);\n\t}\n\n\t/**\n\t * @instance Formats the date into a predefined strict string format using local time or UTC.\n\t *\n\t * @remarks Offers over 21,000 predefined formats with full IntelliSense support.\n\t *\n\t * @param format - The desired format string. Defaults to `'dd, mmm DD, YYYY HH:mm:ss'`\n\t * (e.g., `'Sun, Apr 06, 2025 16:11:55'`).\n\t * @param useUTC - If `true`, formats the date in UTC (equivalent to `formatUTC()`);\n\t * defaults to `false` (local time).\n\t * @returns A formatted date string in the specified format\n\t */\n\tformatStrict(format?: StrictFormat, useUTC = false): string {\n\t\treturn this.#format(format ?? 'dd, mmm DD, YYYY HH:mm:ss', useUTC);\n\t}\n\n\t/**\n\t * @instance Formats the date into a custom string format (UTC time).\n\t *\n\t * @param format - The desired format (Default format is `dd, mmm DD, YYYY HH:mm:ss:mss` = `Sun, Apr 06, 2025 16:11:55:379`).\n\t * @returns Formatted date string in desired format (UTC time).\n\t */\n\tformatUTC(format: string = 'dd, mmm DD, YYYY HH:mm:ss:mss'): string {\n\t\tswitch (this.#offset) {\n\t\t\tcase 'UTC+00:00':\n\t\t\t\treturn this.#format(format, false);\n\t\t\tdefault:\n\t\t\t\treturn this.#format(format, true);\n\t\t}\n\t}\n\n\t/**\n\t * @instance Adds seconds and returns a new immutable instance.\n\t * @param seconds - Number of seconds to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddSeconds(seconds: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setSeconds(newDate.getSeconds() + seconds);\n\t\treturn new Chronos(newDate).#withOrigin('addSeconds');\n\t}\n\n\t/**\n\t * @instance Adds minutes and returns a new immutable instance.\n\t * @param minutes - Number of minutes to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddMinutes(minutes: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setMinutes(newDate.getMinutes() + minutes);\n\t\treturn new Chronos(newDate).#withOrigin('addMinutes');\n\t}\n\n\t/**\n\t * @instance Adds hours and returns a new immutable instance.\n\t * @param hours - Number of hours to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddHours(hours: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setHours(newDate.getHours() + hours);\n\t\treturn new Chronos(newDate).#withOrigin('addHours');\n\t}\n\n\t/**\n\t * @instance Adds days and returns a new immutable instance.\n\t * @param days - Number of days to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddDays(days: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setDate(newDate.getDate() + days);\n\t\treturn new Chronos(newDate).#withOrigin('addDays');\n\t}\n\n\t/**\n\t * @instance Adds weeks and returns a new immutable instance.\n\t * @param weeks - Number of weeks to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddWeeks(weeks: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setDate(newDate.getDate() + weeks * 7);\n\t\treturn new Chronos(newDate).#withOrigin('addWeeks');\n\t}\n\n\t/**\n\t * @instance Adds months and returns a new immutable instance.\n\t * @param months - Number of months to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddMonths(months: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setMonth(newDate.getMonth() + months);\n\t\treturn new Chronos(newDate).#withOrigin('addMonths');\n\t}\n\n\t/**\n\t * @instance Adds years and returns a new immutable instance.\n\t * @param years - Number of years to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddYears(years: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setFullYear(newDate.getFullYear() + years);\n\t\treturn new Chronos(newDate).#withOrigin('addYears');\n\t}\n\n\t/**\n\t * @instance Create a new instance of `Chronos` in the specified timezone.\n\t *\n\t * @param zone - Standard timezone abbreviation (e.g., 'IST', 'UTC', 'EST') or UTC Offset in `UTC-01:30` format.\n\t * @returns A new instance of `Chronos` with time in the given timezone. Invalid input sets time-zone to `UTC`.\n\t */\n\ttimeZone(zone: TimeZone | UTCOffSet): Chronos {\n\t\tlet targetOffset: number;\n\t\tlet stringOffset: UTCOffSet;\n\n\t\tif (isValidUTCOffSet(zone)) {\n\t\t\ttargetOffset = extractMinutesFromUTC(zone);\n\t\t\tstringOffset = zone;\n\t\t} else {\n\t\t\ttargetOffset = TIME_ZONES[zone] ?? TIME_ZONES['UTC'];\n\t\t\tstringOffset = formatUTCOffset(targetOffset);\n\t\t}\n\n\t\tconst previousOffset = this.getTimeZoneOffsetMinutes();\n\t\tconst relativeOffset = targetOffset - previousOffset;\n\n\t\tconst adjustedTime = new Date(\n\t\t\tthis.#date.getTime() + relativeOffset * 60 * 1000,\n\t\t);\n\n\t\treturn new Chronos(adjustedTime).#withOrigin('timeZone', stringOffset);\n\t}\n\n\t/**\n\t * @instance Checks if the year is a leap year.\n\t * - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.\n\t * - For example, 2000 and 2400 are leap years, but 1900 and 2100 are not.\n\t * @returns `true` if the year is a leap year, `false` otherwise.\n\t */\n\tisLeapYear(): boolean {\n\t\tconst year = this.#date.getFullYear();\n\n\t\treturn isLeapYear(year);\n\t}\n\n\t/** @instance Checks if the current date is today. */\n\tisToday(): boolean {\n\t\treturn this.getRelativeDay() === 0;\n\t}\n\n\t/** @instance Checks if the current date is tomorrow. */\n\tisTomorrow(): boolean {\n\t\treturn this.getRelativeDay() === 1;\n\t}\n\n\t/** @instance Checks if the current date is yesterday. */\n\tisYesterday(): boolean {\n\t\treturn this.getRelativeDay() === -1;\n\t}\n\n\t/** @instance Checks if another date is exactly equal to this one */\n\tisEqual(other: ChronosInput): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn this.timestamp === time.timestamp;\n\t}\n\n\t/** @instance Checks if another date is exactly equal to or before this one */\n\tisEqualOrBefore(other: ChronosInput): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn this.timestamp <= time.timestamp;\n\t}\n\n\t/** @instance Checks if another date is exactly equal to or after this one */\n\tisEqualOrAfter(other: ChronosInput): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn this.timestamp >= time.timestamp;\n\t}\n\n\t/**\n\t * @instance Checks if another date is the same as this one in a specific unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit to compare.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tisSame(\n\t\tother: ChronosInput,\n\t\tunit: TimeUnit,\n\t\tweekStartsOn: number = 0,\n\t): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn (\n\t\t\tthis.startOf(unit, weekStartsOn).toDate().getTime() ===\n\t\t\ttime.startOf(unit, weekStartsOn).toDate().getTime()\n\t\t);\n\t}\n\n\t/**\n\t * @instance Checks if this date is before another date in a specific unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit to compare.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tisBefore(\n\t\tother: ChronosInput,\n\t\tunit: TimeUnit,\n\t\tweekStartsOn: number = 0,\n\t): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn (\n\t\t\tthis.startOf(unit, weekStartsOn).toDate().getTime() <\n\t\t\ttime.startOf(unit, weekStartsOn).toDate().getTime()\n\t\t);\n\t}\n\n\t/**\n\t * @instance Checks if this date is after another date in a specific unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit to compare.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tisAfter(\n\t\tother: ChronosInput,\n\t\tunit: TimeUnit,\n\t\tweekStartsOn: number = 0,\n\t): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn (\n\t\t\tthis.startOf(unit, weekStartsOn).toDate().getTime() >\n\t\t\ttime.startOf(unit, weekStartsOn).toDate().getTime()\n\t\t);\n\t}\n\n\t/**\n\t * @instance Checks if this date is the same or before another date in a specific unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit to compare.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tisSameOrBefore(\n\t\tother: ChronosInput,\n\t\tunit: TimeUnit,\n\t\tweekStartsOn: number = 0,\n\t): boolean {\n\t\treturn (\n\t\t\tthis.isSame(other, unit, weekStartsOn) ||\n\t\t\tthis.isBefore(other, unit, weekStartsOn)\n\t\t);\n\t}\n\n\t/**\n\t * @instance Checks if this date is the same or after another date in a specific unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit to compare.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tisSameOrAfter(\n\t\tother: ChronosInput,\n\t\tunit: TimeUnit,\n\t\tweekStartsOn: number = 0,\n\t): boolean {\n\t\treturn (\n\t\t\tthis.isSame(other, unit, weekStartsOn) ||\n\t\t\tthis.isAfter(other, unit, weekStartsOn)\n\t\t);\n\t}\n\n\t/**\n\t * @instance Checks if the current date is between the given start and end dates.\n\t *\n\t * @param start - The start of the range.\n\t * @param end - The end of the range.\n\t * @param inclusive - Specifies whether the comparison is inclusive or exclusive:\n\t * - `'[]'`: inclusive of both start and end (≥ start and ≤ end)\n\t * - `'[)'`: inclusive of start, exclusive of end (≥ start and < end)\n\t * - `'(]'`: exclusive of start, inclusive of end (> start and ≤ end)\n\t * - `'()'`: exclusive of both start and end (> start and < end)\n\t *\n\t * @returns `true` if the current date is within the specified range based on the `inclusive` mode.\n\t */\n\tisBetween(\n\t\tstart: ChronosInput,\n\t\tend: ChronosInput,\n\t\tinclusive: '[]' | '[)' | '(]' | '()' = '()',\n\t): boolean {\n\t\tconst s = new Chronos(start).valueOf();\n\t\tconst e = new Chronos(end).valueOf();\n\t\tconst t = this.valueOf();\n\n\t\tswitch (inclusive) {\n\t\t\tcase '[]':\n\t\t\t\treturn t >= s && t <= e;\n\t\t\tcase '[)':\n\t\t\t\treturn t >= s && t < e;\n\t\t\tcase '(]':\n\t\t\t\treturn t > s && t <= e;\n\t\t\tcase '()':\n\t\t\t\treturn t > s && t < e;\n\t\t}\n\t}\n\n\t/**\n\t * @instance Checks if the current date falls on a weekend.\n\t *\n\t * @param weekStartsOn Optional day the week starts on (0–6). Default is `0` (Sunday).\n\t * @param weekendLength Optional length of the weekend (1 or 2). Default is `2`.\n\t * @returns Whether the date is a weekend.\n\t *\n\t * @description\n\t * Weekend is determined based on `weekStartsOn` and `weekendLength`.\n\t *\n\t * - `weekStartsOn` is a 0-based index (0 = Sunday, 1 = Monday, ..., 6 = Saturday).\n\t * - `weekendLength` defines how many days are considered weekend (1 or 2). Default is 2.\n\t * If 1, only the last day of the week is treated as weekend.\n\t * If 2, the last two days are treated as weekend.\n\t */\n\tisWeekend(weekStartsOn: number = 0, weekendLength: 1 | 2 = 2): boolean {\n\t\tconst day = this.#date.getDay();\n\t\tconst lastDayOfWeek = (weekStartsOn + 6) % 7;\n\t\tconst secondLastDay = (weekStartsOn + 5) % 7;\n\n\t\tif (weekendLength === 1) {\n\t\t\treturn day === lastDayOfWeek;\n\t\t}\n\n\t\treturn day === lastDayOfWeek || day === secondLastDay;\n\t}\n\n\t/**\n\t * @instance Checks if the current date is a workday (non-weekend day).\n\t *\n\t * @param weekStartsOn Optional day the week starts on (0–6). Default is `0` (Sunday).\n\t * @param weekendLength Optional length of the weekend (1 or 2). Default is `2`.\n\t * @returns Whether the date is a workday.\n\t *\n\t * @description\n\t * Weekends are determined by `weekStartsOn` and `weekendLength`.\n\t *\n\t * - `weekStartsOn` is a 0-based index (0 = Sunday, 1 = Monday, ..., 6 = Saturday).\n\t * - `weekendLength` defines how many days are considered weekend (1 or 2). Default is 2.\n\t */\n\tisWorkday(weekStartsOn: number = 0, weekendLength: 1 | 2 = 2): boolean {\n\t\treturn !this.isWeekend(weekStartsOn, weekendLength);\n\t}\n\n\t/**\n\t * @instance Checks if the current date and time fall within business hours.\n\t *\n\t * @param businessStartHour Optional starting hour of business time (0–23). Defaults to `9` (9 AM).\n\t * @param businessEndHour Optional ending hour of business time (0–23). Defaults to `17` (5 PM).\n\t * @param weekStartsOn Optional day the week starts on (0–6). Default is `0` (Sunday).\n\t * @param weekendLength Optional weekend length (1 or 2). Default is `2`.\n\t *\n\t * @returns Whether the current time is within business hours.\n\t *\n\t * @remarks\n\t * * Business hours are typically 9 AM to 5 PM on weekdays.\n\t * * Supports standard and overnight business hours. Overnight means `end < start`.\n\t * * Example: `businessStartHour = 22`, `businessEndHour = 6` will cover 10 PM to 6 AM next day.\n\t *\n\t * * *Weekends are determined by `weekStartsOn` and `weekendLength` using the `isWeekend()` method.*\n\t *\n\t * - Business hours are `[businessStartHour, businessEndHour)`.\n\t * - If `weekendLength` is `1`, only the last day of the week is treated as weekend.\n\t * - If `weekendLength` is `2`, the last two days are treated as weekend.\n\t */\n\tisBusinessHour(\n\t\tbusinessStartHour: number = 9,\n\t\tbusinessEndHour: number = 17,\n\t\tweekStartsOn: number = 0,\n\t\tweekendLength: 1 | 2 = 2,\n\t): boolean {\n\t\tif (this.isWeekend(weekStartsOn, weekendLength)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst hour = this.#date.getHours();\n\n\t\tif (businessStartHour === businessEndHour) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (businessStartHour < businessEndHour) {\n\t\t\t// Normal range, e.g. 9 → 17\n\t\t\treturn hour >= businessStartHour && hour < businessEndHour;\n\t\t} else {\n\t\t\t// Overnight shift, e.g. 22 → 6\n\t\t\treturn hour >= businessStartHour || hour < businessEndHour;\n\t\t}\n\t}\n\n\t/**\n\t * @instance Checks if the current date is a palindrome in either padded or non-padded format.\n\t *\n\t * @remarks\n\t * A palindrome date reads the same forward and backward, excluding delimiters.\n\t * This method checks both zero-padded (`MM-DD`) and non-padded (`M-D`) formats for flexibility.\n\t *\n\t * Examples of palindromes:\n\t * - `'2020-02-02'` → `'20200202'` ✅\n\t * - `'2112-11-12'` → `'21121112'` ❌\n\t * - `'2011-01-11'` (from `'YY-M-D'`) → `'11111'` ✅\n\t * - `'2011-01-11'` (from `'YYYY-M-D'`) → `'11111'` ❌\n\t *\n\t * @param shortYear - If `true`, uses `'YY-MM-DD'` and `'YY-M-D'` formats.\n\t * If `false`, uses `'YYYY-MM-DD'` and `'YYYY-M-D'` formats.\n\t * Defaults to `false`.\n\t *\n\t * @returns `true` if either padded or non-padded formatted date is a palindrome, otherwise `false`.\n\t *\n\t * @example\n\t * new Chronos('2020-02-02').isPalindromeDate(); // true\n\t * new Chronos('2112-11-12').isPalindromeDate(); // false\n\t * new Chronos('2011-1-11').isPalindromeDate(); // false (from '2011111')\n\t * new Chronos('2011-1-11').isPalindromeDate(true); // true (from '11111')\n\t * new Chronos('2024-04-11').isPalindromeDate(); // false\n\t */\n\tisPalindromeDate(shortYear = false): boolean {\n\t\tconst padded = this.formatStrict(shortYear ? 'YY-MM-DD' : 'YYYY-MM-DD');\n\t\tconst normal = this.formatStrict(shortYear ? 'YY-M-D' : 'YYYY-M-D');\n\t\treturn isPalindrome(padded) || isPalindrome(normal);\n\t}\n\n\t/**\n\t * @instance Checks if the date is within daylight saving time (DST).\n\t * @returns Whether the date is in DST.\n\t */\n\tisDST(): boolean {\n\t\tconst year = this.#date.getFullYear();\n\n\t\tconst jan = new Date(year, 0, 1).getTimezoneOffset();\n\n\t\tconst jul = new Date(year, 6, 1).getTimezoneOffset();\n\n\t\treturn this.#date.getTimezoneOffset() < Math.max(jan, jul);\n\t}\n\n\t/** @instance Checks if current day is the first day of the current month. */\n\tisFirstDayOfMonth(): boolean {\n\t\treturn this.isSame(this.firstDayOfMonth(), 'day');\n\t}\n\n\t/** @instance Checks if current day is the last day of the current month. */\n\tisLastDayOfMonth(): boolean {\n\t\treturn this.isSame(this.lastDayOfMonth(), 'day');\n\t}\n\n\t/**\n\t * @instance Returns full time difference from now (or a specified time) down to a given level.\n\t *\n\t * @param level Determines the smallest unit to include in the output (e.g., 'minute' will show up to minutes, ignoring seconds). Defaults to `minute`.\n\t * @param withSuffixPrefix If `true`, adds `\"in\"` or `\"ago\"` depending on whether the time is in the future or past. Defaults to `true`.\n\t * @param time An optional time value to compare with (`string`, `number`, `Date`, or `Chronos` instance). Defaults to `now`.\n\t * @returns The difference as a human-readable string, e.g., `2 years 1 month 9 days 18 hours 56 minutes ago`.\n\t */\n\tfromNow(\n\t\tlevel: Exclude<TimeUnit, 'millisecond'> = 'minute',\n\t\twithSuffixPrefix: boolean = true,\n\t\ttime?: ChronosInput,\n\t): string {\n\t\tconst now = this.#toNewDate(time);\n\n\t\tconst target = this.#date;\n\n\t\tconst isFuture = target > now;\n\n\t\tconst from = isFuture ? now : target;\n\t\tconst to = isFuture ? target : now;\n\n\t\tlet years = to.getFullYear() - from.getFullYear();\n\t\tlet months = to.getMonth() - from.getMonth();\n\t\tlet days = to.getDate() - from.getDate();\n\t\tlet weeks = 0;\n\t\tlet hours = to.getHours() - from.getHours();\n\t\tlet minutes = to.getMinutes() - from.getMinutes();\n\t\tlet seconds = to.getSeconds() - from.getSeconds();\n\n\t\t// Adjust negative values\n\t\tif (seconds < 0) {\n\t\t\tseconds += 60;\n\t\t\tminutes--;\n\t\t}\n\n\t\tif (minutes < 0) {\n\t\t\tminutes += 60;\n\t\t\thours--;\n\t\t}\n\n\t\tif (hours < 0) {\n\t\t\thours += 24;\n\t\t\tdays--;\n\t\t}\n\n\t\tif (level === 'week' || level === 'day') {\n\t\t\tweeks = Math.floor(days / 7);\n\t\t\tdays = days % 7;\n\t\t}\n\n\t\tif (days < 0) {\n\t\t\tconst prevMonth = new Date(to.getFullYear(), to.getMonth(), 0);\n\n\t\t\tdays += prevMonth.getDate();\n\t\t\tmonths--;\n\t\t}\n\n\t\tif (months < 0) {\n\t\t\tmonths += 12;\n\t\t\tyears--;\n\t\t}\n\n\t\tconst unitOrder = [\n\t\t\t'year',\n\t\t\t'month',\n\t\t\t'week',\n\t\t\t'day',\n\t\t\t'hour',\n\t\t\t'minute',\n\t\t\t'second',\n\t\t] as const;\n\n\t\tconst lvlIdx = unitOrder.indexOf(level);\n\n\t\tconst parts: string[] = [];\n\n\t\tif (lvlIdx >= 0 && years > 0 && lvlIdx >= unitOrder.indexOf('year')) {\n\t\t\tparts?.push(formatUnitWithPlural(years, 'year'));\n\t\t}\n\t\tif (lvlIdx >= unitOrder.indexOf('month') && months > 0) {\n\t\t\tparts?.push(formatUnitWithPlural(months, 'month'));\n\t\t}\n\t\tif (lvlIdx >= unitOrder.indexOf('week') && weeks > 0) {\n\t\t\tparts?.push(formatUnitWithPlural(weeks, 'week'));\n\t\t}\n\t\tif (lvlIdx >= unitOrder.indexOf('day') && days > 0) {\n\t\t\tparts?.push(formatUnitWithPlural(days, 'day'));\n\t\t}\n\t\tif (lvlIdx >= unitOrder.indexOf('hour') && hours > 0) {\n\t\t\tparts?.push(formatUnitWithPlural(hours, 'hour'));\n\t\t}\n\t\tif (lvlIdx >= unitOrder.indexOf('minute') && minutes > 0) {\n\t\t\tparts?.push(formatUnitWithPlural(minutes, 'minute'));\n\t\t}\n\t\tif (\n\t\t\tlvlIdx >= unitOrder.indexOf('second') &&\n\t\t\t(seconds > 0 || parts?.length === 0)\n\t\t) {\n\t\t\tparts?.push(formatUnitWithPlural(seconds, 'second'));\n\t\t}\n\n\t\tlet prefix = '';\n\t\tlet suffix = '';\n\n\t\tif (withSuffixPrefix) {\n\t\t\tif (isFuture) {\n\t\t\t\tprefix = 'in ';\n\t\t\t} else {\n\t\t\t\tsuffix = ' ago';\n\t\t\t}\n\t\t}\n\n\t\treturn `${prefix}${parts?.join(' ')}${suffix}`;\n\t}\n\n\t/**\n\t * * Returns the part of day (`'midnight', 'lateNight', 'night', 'morning', 'afternoon', 'evening'`) based on the current hour.\n\t *\n\t * *Supports both normal and wraparound (overnight) ranges.*\n\t *\n\t * @param config - Optional custom hour ranges for each part of day.\n\t * Each range must be a tuple of strings as `[startHour, endHour]` in 24-hour format (e.g., `['06', '11']`).\n\t * Supports wraparound ranges like `['22', '04']` that cross midnight.\n\t *\n\t * **Default Ranges:**\n\t * - night: ['21', '23']\n\t * - midnight: ['00', '01']\n\t * - lateNight: ['02', '04']\n\t * - morning: ['05', '11']\n\t * - afternoon: ['12', '16']\n\t * - evening: ['17', '20']\n\t *\n\t * @returns The current part of the day as a string.\n\t *\n\t * @example\n\t * chronosInstance.getPartOfDay(); // e.g., 'morning'\n\t *\n\t * @example\n\t * // Example with custom ranges\n\t * chronosInstance.getPartOfDay({\n\t * night: ['22', '04'],\n\t * morning: ['05', '11'],\n\t * afternoon: ['12', '16'],\n\t * evening: ['17', '21'],\n\t * lateNight: ['01', '03'],\n\t * midnight: ['00', '00'],\n\t * });\n\t */\n\tgetPartOfDay(config?: Partial<DayPartConfig>): DayPart {\n\t\tconst hour = this.#date.getHours();\n\n\t\tconst ranges: DayPartConfig = {\n\t\t\t...DEFAULT_RANGES,\n\t\t\t...config,\n\t\t};\n\n\t\tfor (const [part, [start, end]] of Object.entries(ranges)) {\n\t\t\tconst from = Number(start);\n\t\t\tconst to = Number(end);\n\n\t\t\tif (from <= to) {\n\t\t\t\tif (hour >= from && hour <= to) {\n\t\t\t\t\treturn part as DayPart;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Wraparound logic (e.g., 20 to 04 means 20–23 OR 00–04)\n\t\t\t\tif (hour >= from || hour <= to) {\n\t\t\t\t\treturn part as DayPart;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn 'night';\n\t}\n\n\t/**\n\t * @instance Returns the number of full years between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeYear(time?: ChronosInput): number {\n\t\tconst now = this.#toNewDate(time);\n\n\t\tlet years = this.#date.getFullYear() - now.getFullYear();\n\n\t\tconst noYearMonthDay =\n\t\t\tnow.getMonth() < this.#date.getMonth() ||\n\t\t\t(now.getMonth() === this.#date.getMonth() &&\n\t\t\t\tnow.getDate() < this.#date.getDate());\n\n\t\tif (noYearMonthDay) {\n\t\t\tyears--;\n\t\t}\n\n\t\treturn years;\n\t}\n\n\t/**\n\t * @instance Returns the number of full months between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeMonth(time?: ChronosInput): number {\n\t\tconst now = this.#toNewDate(time);\n\n\t\tlet months =\n\t\t\t(this.#date.getFullYear() - now.getFullYear()) * 12 +\n\t\t\t(this.#date.getMonth() - now.getMonth());\n\n\t\tconst hasNotHadMonthDay = now.getDate() < this.#date.getDate();\n\n\t\tif (hasNotHadMonthDay) {\n\t\t\tmonths--;\n\t\t}\n\n\t\treturn months;\n\t}\n\n\t/**\n\t * @instance Determines if the given date is today, tomorrow, yesterday or any relative day.\n\t * @param date - The date to compare (Date object).\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns\n\t * - `-1` if the date is yesterday.\n\t * - `0` if the date is today.\n\t * - `1` if the date is tomorrow.\n\t * - Other positive or negative numbers for other relative days (e.g., `-2` for two days ago, `2` for two days ahead).\n\t */\n\tgetRelativeDay(time?: ChronosInput): number {\n\t\tconst today = this.#toNewDate(time);\n\t\t// Set the time of today to 00:00:00 for comparison purposes\n\t\ttoday.setHours(0, 0, 0, 0);\n\n\t\t// Normalize the input date to 00:00:00\n\t\tconst inputDate = this.#date;\n\t\tinputDate.setHours(0, 0, 0, 0);\n\n\t\tconst diffTime = inputDate.getTime() - today.getTime();\n\t\tconst diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));\n\n\t\treturn diffDays;\n\t}\n\n\t/**\n\t * @instance Determines how many full weeks apart the input date is from the `Chronos` instance.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns Difference in weeks; negative if past, positive if future.\n\t */\n\tgetRelativeWeek(time?: ChronosInput): number {\n\t\tconst relativeDays = this.getRelativeDay(time);\n\t\treturn Math.floor(relativeDays / 7);\n\t}\n\n\t/**\n\t * @instance Returns the number of full hours between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeHour(time?: ChronosInput): number {\n\t\tconst diff = this.#date.getTime() - this.#toNewDate(time).getTime();\n\t\treturn Math.floor(diff / (1000 * 60 * 60));\n\t}\n\n\t/**\n\t * @instance Returns the number of full minutes between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeMinute(time?: ChronosInput): number {\n\t\tconst diff = this.#date.getTime() - this.#toNewDate(time).getTime();\n\t\treturn Math.floor(diff / (1000 * 60));\n\t}\n\n\t/**\n\t * @instance Returns the number of full seconds between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeSecond(time?: ChronosInput): number {\n\t\tconst diff = this.#date.getTime() - this.#toNewDate(time).getTime();\n\t\treturn Math.floor(diff / 1000);\n\t}\n\n\t/**\n\t * @instance Returns the number of milliseconds between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeMilliSecond(time?: ChronosInput): number {\n\t\treturn this.#date.getTime() - this.#toNewDate(time).getTime();\n\t}\n\n\t/** @instance Returns a new Chronos instance set to the first day of the current month. */\n\tfirstDayOfMonth(): Chronos {\n\t\tconst year = this.#date.getFullYear();\n\t\tconst month = this.#date.getMonth();\n\t\tconst lastDate = new Date(year, month, 1);\n\t\treturn new Chronos(lastDate).#withOrigin('firstDayOfMonth');\n\t}\n\n\t/** @instance Returns a new Chronos instance set to the last day of the current month. */\n\tlastDayOfMonth(): Chronos {\n\t\tconst year = this.#date.getFullYear();\n\t\tconst month = this.#date.getMonth() + 1;\n\t\tconst lastDate = new Date(year, month, 0);\n\t\treturn new Chronos(lastDate).#withOrigin('lastDayOfMonth');\n\t}\n\n\t/**\n\t * @instance Compares the stored date with now, returning the difference in the specified unit.\n\t *\n\t * @param unit The time unit to compare by. Defaults to 'minute'.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tcompare(unit: TimeUnit = 'minute', time?: ChronosInput): number {\n\t\tswitch (unit) {\n\t\t\tcase 'year':\n\t\t\t\treturn this.getRelativeYear(time);\n\t\t\tcase 'month':\n\t\t\t\treturn this.getRelativeMonth(time);\n\t\t\tcase 'day':\n\t\t\t\treturn this.getRelativeDay(time);\n\t\t\tcase 'week':\n\t\t\t\treturn this.getRelativeWeek(time);\n\t\t\tcase 'hour':\n\t\t\t\treturn this.getRelativeHour(time);\n\t\t\tcase 'minute':\n\t\t\t\treturn this.getRelativeMinute(time);\n\t\t\tcase 'second':\n\t\t\t\treturn this.getRelativeSecond(time);\n\t\t\tcase 'millisecond':\n\t\t\t\treturn this.getRelativeMilliSecond(time);\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported time unit: ${unit}`);\n\t\t}\n\t}\n\n\t/**\n\t * @instance Returns a new Chronos instance at the start of a given unit.\n\t * @param unit The unit to reset (e.g., year, month, day).\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tstartOf(unit: TimeUnit, weekStartsOn: number = 0): Chronos {\n\t\tconst d = new Date(this.#date);\n\n\t\tswitch (unit) {\n\t\t\tcase 'year':\n\t\t\t\td.setMonth(0, 1);\n\t\t\t\td.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'month':\n\t\t\t\td.setDate(1);\n\t\t\t\td.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'week': {\n\t\t\t\tconst day = d.getDay();\n\t\t\t\tconst diff = (day - weekStartsOn + 7) % 7;\n\t\t\t\td.setDate(d.getDate() - diff);\n\t\t\t\td.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'day':\n\t\t\t\td.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'hour':\n\t\t\t\td.setMinutes(0, 0, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'minute':\n\t\t\t\td.setSeconds(0, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'second':\n\t\t\t\td.setMilliseconds(0);\n\t\t\t\tbreak;\n\t\t\tcase 'millisecond':\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn new Chronos(d).#withOrigin('startOf');\n\t}\n\n\t/**\n\t * @instance Returns a new Chronos instance at the end of a given unit.\n\t * @param unit The unit to adjust (e.g., year, month, day).\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tendOf(unit: TimeUnit, weekStartsOn: number = 0): Chronos {\n\t\treturn this.startOf(unit, weekStartsOn)\n\t\t\t.add(1, unit)\n\t\t\t.add(-1, 'millisecond')\n\t\t\t.#withOrigin('endOf');\n\t}\n\n\t/**\n\t * @instance Returns a new Chronos instance with the specified unit added.\n\t * @param amount The amount to add (can be negative).\n\t * @param unit The time unit to add.\n\t */\n\tadd(amount: number, unit: TimeUnit): Chronos {\n\t\tconst d = new Date(this.#date);\n\n\t\tswitch (unit) {\n\t\t\tcase 'millisecond':\n\t\t\t\td.setMilliseconds(d.getMilliseconds() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'second':\n\t\t\t\td.setSeconds(d.getSeconds() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'minute':\n\t\t\t\td.setMinutes(d.getMinutes() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'hour':\n\t\t\t\td.setHours(d.getHours() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'day':\n\t\t\t\td.setDate(d.getDate() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'week':\n\t\t\t\td.setDate(d.getDate() + amount * 7);\n\t\t\t\tbreak;\n\t\t\tcase 'month':\n\t\t\t\td.setMonth(d.getMonth() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'year':\n\t\t\t\td.setFullYear(d.getFullYear() + amount);\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn new Chronos(d).#withOrigin('add');\n\t}\n\n\t/**\n\t * @instance Returns a new Chronos instance with the specified unit subtracted.\n\t * @param amount The amount to subtract (can be negative).\n\t * @param unit The time unit to add.\n\t */\n\tsubtract(amount: number, unit: TimeUnit): Chronos {\n\t\treturn this.add(-amount, unit).#withOrigin('subtract');\n\t}\n\n\t/**\n\t * @instance Gets the value of a specific time unit from the date.\n\t * @param unit The unit to retrieve.\n\t */\n\tget(unit: TimeUnit): number {\n\t\tswitch (unit) {\n\t\t\tcase 'year':\n\t\t\t\treturn this.#date.getFullYear();\n\t\t\tcase 'month':\n\t\t\t\treturn this.#date.getMonth();\n\t\t\tcase 'day':\n\t\t\t\treturn this.#date.getDate();\n\t\t\tcase 'week':\n\t\t\t\treturn this.getWeek();\n\t\t\tcase 'hour':\n\t\t\t\treturn this.#date.getHours();\n\t\t\tcase 'minute':\n\t\t\t\treturn this.#date.getMinutes();\n\t\t\tcase 'second':\n\t\t\t\treturn this.#date.getSeconds();\n\t\t\tcase 'millisecond':\n\t\t\t\treturn this.#date.getMilliseconds();\n\t\t}\n\t}\n\n\t/**\n\t * @instance Returns a new Chronos instance with the specified unit set to the given value.\n\t * @param unit The unit to modify.\n\t * @param value The value to set for the unit.\n\t */\n\tset(unit: TimeUnit, value: number): Chronos {\n\t\tconst d = new Date(this.#date);\n\n\t\tswitch (unit) {\n\t\t\tcase 'year':\n\t\t\t\td.setFullYear(value);\n\t\t\t\tbreak;\n\t\t\tcase 'month':\n\t\t\t\td.setMonth(value);\n\t\t\t\tbreak;\n\t\t\tcase 'day':\n\t\t\t\td.setDate(value);\n\t\t\t\tbreak;\n\t\t\tcase 'week':\n\t\t\t\treturn this.setWeek(value);\n\t\t\tcase 'hour':\n\t\t\t\td.setHours(value);\n\t\t\t\tbreak;\n\t\t\tcase 'minute':\n\t\t\t\td.setMinutes(value);\n\t\t\t\tbreak;\n\t\t\tcase 'second':\n\t\t\t\td.setSeconds(value);\n\t\t\t\tbreak;\n\t\t\tcase 'millisecond':\n\t\t\t\td.setMilliseconds(value);\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn new Chronos(d).#withOrigin('set');\n\t}\n\n\t/**\n\t * @instance Returns the difference between this and another date in the given unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit in which to return the difference.\n\t */\n\tdiff(other: ChronosInput, unit: TimeUnit): number {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\tconst msDiff = this.#date.getTime() - time.toDate().getTime();\n\n\t\tswitch (unit) {\n\t\t\tcase 'millisecond':\n\t\t\t\treturn msDiff;\n\t\t\tcase 'second':\n\t\t\t\treturn msDiff / 1e3;\n\t\t\tcase 'minute':\n\t\t\t\treturn msDiff / 6e4;\n\t\t\tcase 'hour':\n\t\t\t\treturn msDiff / 3.6e6;\n\t\t\tcase 'day':\n\t\t\t\treturn msDiff / 8.64e7;\n\t\t\tcase 'week':\n\t\t\t\treturn msDiff / 6.048e8;\n\t\t\tcase 'month':\n\t\t\t\treturn (\n\t\t\t\t\t(this.get('year') - time.get('year')) * 12 +\n\t\t\t\t\t(this.get('month') - time.get('month'))\n\t\t\t\t);\n\t\t\tcase 'year':\n\t\t\t\treturn this.get('year') - time.get('year');\n\t\t}\n\t}\n\n\t/**\n\t * @instance Returns a human-readable relative calendar time like \"Today at 3:00 PM\"\n\t * @param baseDate Optional base date to compare with.\n\t */\n\tcalendar(baseDate?: ChronosInput): string {\n\t\tconst base = baseDate ? new Chronos(baseDate) : new Chronos();\n\t\tconst input = this.startOf('day');\n\n\t\tconst comparison = base.startOf('day');\n\t\tconst diff = input.diff(comparison, 'day');\n\n\t\tconst timeStr = this.toDate().toLocaleString(undefined, {\n\t\t\thour: 'numeric',\n\t\t\tminute: '2-digit',\n\t\t});\n\n\t\tif (diff === 0) return `Today at ${timeStr}`;\n\t\tif (diff === 1) return `Tomorrow at ${timeStr}`;\n\t\tif (diff === -1) return `Yesterday at ${timeStr}`;\n\n\t\treturn this.toDate().toLocaleString(undefined, {\n\t\t\tmonth: 'long',\n\t\t\tday: '2-digit',\n\t\t\tyear: 'numeric',\n\t\t\tweekday: 'long',\n\t\t\thour: 'numeric',\n\t\t\tminute: '2-digit',\n\t\t});\n\t}\n\n\t/** @instance Returns a short human-readable string like \"2h ago\", \"in 5m\" */\n\tfromNowShort(): string {\n\t\tconst now = new Chronos();\n\t\tconst diffInSeconds = this.diff(now, 'second');\n\n\t\tconst abs = Math.abs(diffInSeconds);\n\n\t\tconst suffix = diffInSeconds >= 0 ? 'in ' : '';\n\t\tconst postfix = diffInSeconds < 0 ? ' ago' : '';\n\n\t\tif (abs < 60) {\n\t\t\treturn `${suffix}${Math.floor(abs)}s${postfix}`;\n\t\t} else if (abs < 3600) {\n\t\t\treturn `${suffix}${Math.floor(abs / 60)}m${postfix}`;\n\t\t} else if (abs < 86400) {\n\t\t\treturn `${suffix}${Math.floor(abs / 3600)}h${postfix}`;\n\t\t} else if (abs < 2592000) {\n\t\t\treturn `${suffix}${Math.floor(abs / 86400)}d${postfix}`;\n\t\t} else if (abs < 31536000) {\n\t\t\treturn `${suffix}${Math.floor(abs / 2592000)}mo${postfix}`;\n\t\t} else {\n\t\t\treturn `${suffix}${Math.floor(abs / 31536000)}y${postfix}`;\n\t\t}\n\t}\n\n\t/**\n\t * @instance Sets the date to the Monday of the specified ISO week number within the current year.\n\t * This method assumes ISO week logic, where week 1 is the week containing January 4th.\n\t *\n\t * @param week The ISO week number (1–53) to set the date to.\n\t * @returns A new Chronos instance set to the start (Monday) of the specified week.\n\t */\n\tsetWeek(week: number): Chronos {\n\t\tconst d = new Date(this.#date);\n\n\t\tconst year = d.getFullYear();\n\t\tconst jan4 = new Date(year, 0, 4);\n\t\tconst dayOfWeek = jan4.getDay() || 7; // Make Sunday (0) into 7\n\t\tconst weekStart = new Date(jan4);\n\t\tweekStart.setDate(jan4.getDate() - (dayOfWeek - 1)); // Move to Monday\n\n\t\tweekStart.setDate(weekStart.getDate() + (week - 1) * 7); // Move to target week\n\t\td.setFullYear(weekStart.getFullYear());\n\t\td.setMonth(weekStart.getMonth());\n\t\td.setDate(weekStart.getDate());\n\n\t\treturn new Chronos(d).#withOrigin('setWeek');\n\t}\n\n\t/**\n\t * @instance Calculates the ISO 8601 week number of the year.\n\t *\n\t * ISO weeks start on Monday, and the first week of the year is the one containing January 4th.\n\t *\n\t * @returns Week number (1–53).\n\t */\n\tgetWeek(): number {\n\t\tconst target = this.startOf('week', 1).add(3, 'day'); // Thursday of current ISO week\n\n\t\tconst firstThursday = new Chronos(target.year, 1, 4) // January 4\n\t\t\t.startOf('week', 1)\n\t\t\t.add(3, 'day'); // Thursday of first ISO week\n\n\t\treturn target.diff(firstThursday, 'week') + 1;\n\t}\n\n\t/**\n\t * @instance Calculates the week number of the year based on custom week start.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t * @returns Week number (1-53).\n\t */\n\tgetWeekOfYear(weekStartsOn: number = 0): number {\n\t\tconst startOfYear = new Chronos(this.year, 1, 1);\n\t\tconst startOfFirstWeek = startOfYear.startOf('week', weekStartsOn);\n\n\t\tconst week = this.startOf('week', weekStartsOn).diff(\n\t\t\tstartOfFirstWeek,\n\t\t\t'week',\n\t\t);\n\n\t\treturn week + 1;\n\t}\n\n\t/**\n\t * @instance Returns the ISO week-numbering year for the current date.\n\t *\n\t * The ISO week-numbering year may differ from the calendar year.\n\t * For example, January 1st may fall in the last ISO week of the previous year.\n\t *\n\t * @param weekStartsOn Optional: Defines the start day of the week (0 = Sunday, 1 = Monday).\n\t * Defaults to 0 (Sunday). Use 1 for strict ISO 8601.\n\t * @returns The ISO week-numbering year.\n\t */\n\tgetWeekYear(weekStartsOn: number = 0): number {\n\t\tconst d = this.startOf('week', weekStartsOn).add(3, 'day'); // Thursday of current ISO week\n\t\treturn d.year;\n\t}\n\n\t/** @instance Returns day of year (1 - 366) */\n\tgetDayOfYear(): number {\n\t\tconst start = new Date(this.year, 0, 1);\n\t\tconst diff = this.#date.getTime() - start.getTime();\n\t\treturn Math.floor(diff / 86400000) + 1;\n\t}\n\n\t/**\n\t * @instance Returns the zodiac sign for the current date.\n\t * @returns The Western zodiac sign.\n\t */\n\tgetZodiacSign(): ZodiacSign {\n\t\tconst day = this.#date.getDate();\n\t\tconst month = this.#date.getMonth() + 1;\n\n\t\tfor (const [sign, [m, d]] of ZODIAC_SIGNS) {\n\t\t\tif (month === m && day <= d) {\n\t\t\t\treturn sign;\n\t\t\t}\n\t\t}\n\n\t\treturn 'Capricorn';\n\t}\n\n\t/** @instance Returns number of days in current month */\n\tdaysInMonth(): number {\n\t\treturn new Date(this.year, this.month + 1, 0).getDate();\n\t}\n\n\t/** @instance Converts to object with all date unit parts */\n\ttoObject(): ChronosObject {\n\t\treturn Object.fromEntries([...this]) as unknown as ChronosObject;\n\t}\n\n\t/** @instance Converts to array with all date unit parts */\n\ttoArray() {\n\t\treturn Object.values(this.toObject());\n\t}\n\n\t/**\n\t * @instance Returns the academic year based on a typical start in July and end in June.\n\t * @returns The academic year in format `YYYY-YYYY`.\n\t */\n\ttoAcademicYear(): `${number}-${number}` {\n\t\tconst year = this.#date.getFullYear();\n\t\tconst month = this.#date.getMonth();\n\t\tif (month >= 6) {\n\t\t\treturn `${year}-${year + 1}`;\n\t\t}\n\t\treturn `${year - 1}-${year}`;\n\t}\n\n\t/**\n\t * @instance Returns the **calendar quarter** (1 to 4) of the current date.\n\t *\n\t * @remarks\n\t * A calendar year is divided into four quarters:\n\t *\n\t * - `Q1`: January to March\n\t * - `Q2`: April to June\n\t * - `Q3`: July to September\n\t * - `Q4`: October to December\n\t *\n\t * This method strictly uses the **calendar year**. For fiscal quarters, use `toFiscalQuarter()` instead.\n\t *\n\t * @example\n\t * new Chronos('2025-02-14').toQuarter(); // 1\n\t * new Chronos('2025-08-09').toQuarter(); // 3\n\t *\n\t * @returns The calendar quarter number (1–4).\n\t */\n\ttoQuarter(): Quarter {\n\t\tconst month = this.#date.getMonth();\n\t\treturn (Math.floor(month / 3) + 1) as Quarter;\n\t}\n\n\t/**\n\t * @instance Returns the fiscal quarter based on custom fiscal year start (defaults to July).\n\t * @param startMonth - The fiscal year start month (1-12), default is July (7).\n\t * @returns The fiscal quarter (1-4).\n\t */\n\ttoFiscalQuarter(startMonth: number = 7): Quarter {\n\t\tconst month = this.#date.getMonth() + 1;\n\t\tconst adjusted = (month - startMonth + 12) % 12;\n\t\treturn (Math.floor(adjusted / 3) + 1) as Quarter;\n\t}\n\n\t/**\n\t * @instance Returns the system's current UTC offset formatted as `+06:00` or `-07:00`.\n\t *\n\t * - *Unlike `Date.prototype.getTimezoneOffset()`, which returns the offset in minutes **behind** UTC (positive for locations west of UTC and negative for east), this method returns the more intuitive sign format used in time zone representations (e.g., `UTC+06:00` means 6 hours **ahead** of UTC).*\n\t *\n\t * @returns The (local) system's UTC offset in `±HH:mm` format.\n\t */\n\tgetUTCOffset(): string {\n\t\tconst offset = -this.#date.getTimezoneOffset();\n\t\tconst sign = offset >= 0 ? '+' : '-';\n\n\t\tconst pad = (n: number) =>\n\t\t\tString(Math.floor(Math.abs(n))).padStart(2, '0');\n\n\t\treturn `${sign}${pad(offset / 60)}:${pad(offset % 60)}`;\n\t}\n\n\t/**\n\t * @instance Returns the timezone offset of this `Chronos` instance in `+06:00` or `-07:00` format maintaining current timezone.\n\t *\n\t * - *Unlike `Date.prototype.getTimezoneOffset()`, which returns the offset in minutes **behind** UTC (positive for locations west of UTC and negative for east), this method returns the more intuitive sign format used in time zone representations (e.g., `UTC+06:00` means 6 hours **ahead** of UTC).*\n\t *\n\t * @returns The timezone offset string in `±HH:mm` format maintaining the current timezone regardless of system having different one.\n\t */\n\tgetTimeZoneOffset(): string {\n\t\treturn this.#offset.replace('UTC', '');\n\t}\n\n\t/**\n\t * @instance Returns the system's UTC offset in minutes.\n\t *\n\t * - *Unlike JavaScript's `Date.prototype.getTimezoneOffset()`, this method returns a positive value if the local time is ahead of UTC, and negative if behind UTC.*\n\t *\n\t * For example, for `UTC+06:00`, this returns `360`; for `UTC-05:30`, this returns `-330`.\n\t *\n\t * @returns The system's UTC offset in minutes, matching the sign convention used in `±HH:mm`.\n\t */\n\tgetUTCOffsetMinutes(): number {\n\t\treturn -this.#date.getTimezoneOffset();\n\t}\n\n\t/**\n\t * @instance Returns the current `Chronos` instance's UTC offset in minutes.\n\t *\n\t * This reflects the parsed or stored offset used internally by Chronos and follows the same\n\t * sign convention: positive for timezones ahead of UTC, negative for behind.\n\t *\n\t * @returns The UTC offset in minutes maintaining the current timezone regardless of system having different one.\n\t */\n\tgetTimeZoneOffsetMinutes(): number {\n\t\treturn extractMinutesFromUTC(this.#offset);\n\t}\n\n\t/** @instance Returns new Chronos instance in UTC */\n\ttoUTC(): Chronos {\n\t\tif (this.#offset === 'UTC+00:00') {\n\t\t\treturn this.#withOrigin('toUTC');\n\t\t}\n\n\t\tconst date = this.#date;\n\n\t\tconst previousOffset = this.getTimeZoneOffsetMinutes();\n\n\t\tconst utc = new Date(date.getTime() - previousOffset * 60 * 1000);\n\n\t\treturn new Chronos(utc).#withOrigin('toUTC');\n\t}\n\n\t/** @instance Returns new Chronos instance in local time */\n\ttoLocal(): Chronos {\n\t\tconst previousOffset = this.getTimeZoneOffsetMinutes();\n\n\t\tconst localOffset = -this.#date.getTimezoneOffset();\n\n\t\tconst relativeOffset = previousOffset - localOffset;\n\n\t\tconst localTime = new Date(\n\t\t\tthis.#date.getTime() - relativeOffset * 60 * 1000,\n\t\t);\n\n\t\treturn new Chronos(localTime).#withOrigin('toLocal');\n\t}\n\n\t/**\n\t * @static Parses a date string with a given format (limited support only).\n\t *\n\t * * **Supported format tokens**:\n\t * - `YYYY`: Full year (e.g., 2023)\n\t * - `YY`: Two-digit year (e.g., 23 for 2023, 99 for 1999)\n\t * - `MM`: Month (01-12)\n\t * - `M`: Month (1-9)\n\t * - `DD`: Day of the month (01-31)\n\t * - `D`: Day of the month (1-9)\n\t * - `HH`: Hour (00-23)\n\t * - `H`: Hour (0-9)\n\t * - `mm`: Minute (00-59)\n\t * - `m`: Minute (0-9)\n\t * - `ss`: Second (00-59)\n\t * - `s`: Second (0-9)\n\t *\n\t * **Example**:\n\t * ```ts\n\t * Chronos.parse('23-12-31 15:30:45', 'YY-MM-DD HH:mm:ss');\n\t * // returns Chronos instance with the parsed date 2023-12-31T15:30:45\n\t * ```\n\t *\n\t * @param dateStr - The date string to be parsed\n\t * @param format - The format of the date string. Tokens like `YYYY`, `MM`, `DD`, `HH`, `mm`, `ss` are used to specify the structure.\n\t * @returns A new `Chronos` instance representing the parsed date.\n\t * @throws `Error` If the date string does not match the format.\n\t */\n\tstatic parse(dateStr: string, format: string): Chronos {\n\t\tconst tokenPatterns: Record<string, string> = {\n\t\t\tYYYY: '(?<YYYY>\\\\d{4})',\n\t\t\tYY: '(?<YY>\\\\d{2})',\n\t\t\tMM: '(?<MM>\\\\d{2})',\n\t\t\tM: '(?<M>\\\\d{1,2})',\n\t\t\tDD: '(?<DD>\\\\d{2})',\n\t\t\tD: '(?<D>\\\\d{1,2})',\n\t\t\tHH: '(?<HH>\\\\d{2})',\n\t\t\tH: '(?<H>\\\\d{1,2})',\n\t\t\tmm: '(?<mm>\\\\d{2})',\n\t\t\tm: '(?<m>\\\\d{1,2})',\n\t\t\tss: '(?<ss>\\\\d{2})',\n\t\t\ts: '(?<s>\\\\d{1,2})',\n\t\t};\n\n\t\tconst tokenToComponent: Record<string, keyof ChronosDateParts> = {\n\t\t\tYYYY: 'year',\n\t\t\tYY: 'year',\n\t\t\tMM: 'month',\n\t\t\tM: 'month',\n\t\t\tDD: 'date',\n\t\t\tD: 'date',\n\t\t\tHH: 'hour',\n\t\t\tH: 'hour',\n\t\t\tmm: 'minute',\n\t\t\tm: 'minute',\n\t\t\tss: 'second',\n\t\t\ts: 'second',\n\t\t};\n\n\t\ttype ChronosDateParts = {\n\t\t\tyear: number;\n\t\t\tmonth: number;\n\t\t\tdate: number;\n\t\t\thour: number;\n\t\t\tminute: number;\n\t\t\tsecond: number;\n\t\t};\n\n\t\tconst tokenRegex = new RegExp(\n\t\t\tObject.keys(tokenPatterns).join('|'),\n\t\t\t'g',\n\t\t);\n\n\t\tconst trimmedInput = dateStr.trim();\n\n\t\tconst regexStr = format\n\t\t\t.trim()\n\t\t\t.replace(tokenRegex, (token) => tokenPatterns[token] ?? token)\n\t\t\t.replace(/\\s+/g, '\\\\s*');\n\n\t\tconst match = new RegExp(`^${regexStr}\\\\s*$`).exec(trimmedInput);\n\n\t\tif (!match?.groups) {\n\t\t\tthrow new Error('Invalid date format');\n\t\t}\n\n\t\tconst parts: Partial<ChronosDateParts> = {};\n\n\t\tfor (const [token, value] of Object.entries(match.groups)) {\n\t\t\tconst key = tokenToComponent[token];\n\t\t\tif (key) {\n\t\t\t\tlet num = Number(value);\n\t\t\t\tif (token === 'YY') num += num < 100 ? 2000 : 0;\n\t\t\t\tparts[key] = num;\n\t\t\t}\n\t\t}\n\n\t\treturn new Chronos(\n\t\t\tnew Date(\n\t\t\t\tparts?.year ?? 1970,\n\t\t\t\t(parts?.month ?? 1) - 1,\n\t\t\t\tparts?.date ?? 1,\n\t\t\t\tparts?.hour ?? 0,\n\t\t\t\tparts?.minute ?? 0,\n\t\t\t\tparts?.second ?? 0,\n\t\t\t),\n\t\t).#withOrigin('parse');\n\t}\n\n\t/**\n\t * @instance Rounds the current date-time to the nearest specified unit and interval.\n\t *\n\t * - *Rounding is based on proximity to the start or end of the specified unit.*\n\t * - *For example, rounding `2025-05-23` by 'day' returns either midnight of May 23 or May 24, depending on the time of day.*\n\t *\n\t * @param unit - The time unit to round to (`year`, `month`, `week`, `day`, `hour`, `minute`, `second`, `millisecond`).\n\t * @param nearest - Optional granularity of rounding. (Defaults to `1`).\n\t *\n\t * @returns A new `Chronos` instance at the nearest rounded point in time. For wrong unit returns current instance.\n\t *\n\t * @remarks\n\t * - Rounding for `'month'` is based on how far into the month the date is. If past the midpoint, it rounds to the next month.\n\t * - Month indices are 0-based internally (January = 0), but the resulting date reflects the correct calendar month.\n\t * - For `'week'` unit, rounding is performed by comparing proximity to the start and end of the ISO week (Monday to Sunday).\n\t * - If the date is closer to the next Monday, it rounds forward; otherwise, it rounds back to the previous Monday.\n\t */\n\tround(unit: TimeUnit, nearest = 1): Chronos {\n\t\tconst date = new Date(this.#date);\n\n\t\tswitch (unit) {\n\t\t\tcase 'millisecond': {\n\t\t\t\tconst rounded = roundToNearest(date.getMilliseconds(), nearest);\n\n\t\t\t\tdate.setMilliseconds(rounded);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'second': {\n\t\t\t\tconst fullSecond =\n\t\t\t\t\tdate.getSeconds() + date.getMilliseconds() / 1000;\n\n\t\t\t\tconst rounded = roundToNearest(fullSecond, nearest);\n\t\t\t\tdate.setSeconds(rounded, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'minute': {\n\t\t\t\tconst fullMinute =\n\t\t\t\t\tdate.getMinutes() +\n\t\t\t\t\tdate.getSeconds() / 60 +\n\t\t\t\t\tdate.getMilliseconds() / 60000;\n\n\t\t\t\tconst rounded = roundToNearest(fullMinute, nearest);\n\t\t\t\tdate.setMinutes(rounded, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'hour': {\n\t\t\t\tconst fullHour =\n\t\t\t\t\tdate.getHours() +\n\t\t\t\t\tdate.getMinutes() / 60 +\n\t\t\t\t\tdate.getSeconds() / 3600 +\n\t\t\t\t\tdate.getMilliseconds() / 3600000;\n\n\t\t\t\tconst rounded = roundToNearest(fullHour, nearest);\n\t\t\t\tdate.setHours(rounded, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'day': {\n\t\t\t\tconst fullDay =\n\t\t\t\t\tdate.getDate() +\n\t\t\t\t\t(date.getHours() / 24 +\n\t\t\t\t\t\tdate.getMinutes() / 1440 +\n\t\t\t\t\t\tdate.getSeconds() / 86400 +\n\t\t\t\t\t\tdate.getMilliseconds() / 86400000);\n\n\t\t\t\tconst rounded = roundToNearest(fullDay, nearest);\n\t\t\t\tdate.setDate(rounded);\n\t\t\t\tdate.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'week': {\n\t\t\t\tconst weekday = this.#date.getDay(); // 0 (Sun) to 6 (Sat)\n\t\t\t\tconst offsetToMonday = (weekday + 6) % 7; // 0 for Mon, 1 for Tue, ..., 6 for Sun\n\n\t\t\t\tconst startOfWeek = new Date(this.#date);\n\t\t\t\tstartOfWeek.setDate(startOfWeek.getDate() - offsetToMonday);\n\t\t\t\tstartOfWeek.setHours(0, 0, 0, 0);\n\n\t\t\t\tconst endOfWeek = new Date(startOfWeek);\n\t\t\t\tendOfWeek.setDate(endOfWeek.getDate() + 7);\n\n\t\t\t\tconst diffToStart = Math.abs(\n\t\t\t\t\tthis.#date.getTime() - startOfWeek.getTime(),\n\t\t\t\t);\n\n\t\t\t\tconst diffToEnd = Math.abs(\n\t\t\t\t\tendOfWeek.getTime() - this.#date.getTime(),\n\t\t\t\t);\n\n\t\t\t\tconst rounded =\n\t\t\t\t\tdiffToEnd < diffToStart ? endOfWeek : startOfWeek;\n\n\t\t\t\treturn new Chronos(rounded).#withOrigin('round');\n\t\t\t}\n\n\t\t\tcase 'month': {\n\t\t\t\tconst fullMonth =\n\t\t\t\t\tdate.getMonth() + date.getDate() / this.lastDateOfMonth;\n\n\t\t\t\tconst roundedMonth = roundToNearest(fullMonth, nearest);\n\t\t\t\tdate.setMonth(roundedMonth, 1);\n\t\t\t\tdate.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'year': {\n\t\t\t\tconst dayOfYear = Math.floor(\n\t\t\t\t\t(date.getTime() -\n\t\t\t\t\t\tnew Date(date.getFullYear(), 0, 1).getTime()) /\n\t\t\t\t\t\t86400000,\n\t\t\t\t);\n\n\t\t\t\tconst isLeap =\n\t\t\t\t\tnew Date(date.getFullYear(), 1, 29).getDate() === 29;\n\n\t\t\t\tconst totalDays = isLeap ? 366 : 365;\n\t\t\t\tconst fullYear = date.getFullYear() + dayOfYear / totalDays;\n\t\t\t\tconst roundedYear = roundToNearest(fullYear, nearest);\n\t\t\t\tdate.setFullYear(roundedYear, 0, 1);\n\t\t\t\tdate.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn this;\n\t\t}\n\n\t\treturn new Chronos(date).#withOrigin('round');\n\t}\n\n\t/**\n\t * @instance Returns the full time duration breakdown between current input (start) and another time (to).\n\t * @param toTime The time to compare with. Defaults to now.\n\t * @param absolute If true, returns all values as positive numbers. Defaults to `true`.\n\t * @returns An object of time units: years, months, days, hours, minutes, seconds, milliseconds.\n\t */\n\tduration(toTime?: ChronosInput, absolute = true): TimeDuration {\n\t\tconst now = this.#date;\n\t\tconst target = this.#toNewDate(toTime);\n\n\t\tconst isFuture = target > now;\n\t\tconst from = isFuture ? now : target;\n\t\tconst to = isFuture ? target : now;\n\n\t\tlet years = to.getFullYear() - from.getFullYear();\n\t\tlet months = to.getMonth() - from.getMonth();\n\t\tlet days = to.getDate() - from.getDate();\n\t\tlet hours = to.getHours() - from.getHours();\n\t\tlet minutes = to.getMinutes() - from.getMinutes();\n\t\tlet seconds = to.getSeconds() - from.getSeconds();\n\t\tlet milliseconds = to.getMilliseconds() - from.getMilliseconds();\n\n\t\tif (milliseconds < 0) {\n\t\t\tmilliseconds += 1000;\n\t\t\tseconds--;\n\t\t}\n\n\t\tif (seconds < 0) {\n\t\t\tseconds += 60;\n\t\t\tminutes--;\n\t\t}\n\n\t\tif (minutes < 0) {\n\t\t\tminutes += 60;\n\t\t\thours--;\n\t\t}\n\n\t\tif (hours < 0) {\n\t\t\thours += 24;\n\t\t\tdays--;\n\t\t}\n\n\t\tif (days < 0) {\n\t\t\tconst prevMonth = new Date(to.getFullYear(), to.getMonth(), 0);\n\t\t\tdays += prevMonth.getDate();\n\t\t\tmonths--;\n\t\t}\n\n\t\tif (months < 0) {\n\t\t\tmonths += 12;\n\t\t\tyears--;\n\t\t}\n\n\t\tconst result: TimeDuration = {\n\t\t\tyears,\n\t\t\tmonths,\n\t\t\tdays,\n\t\t\thours,\n\t\t\tminutes,\n\t\t\tseconds,\n\t\t\tmilliseconds,\n\t\t};\n\n\t\treturn this.#normalizeDuration(result, absolute, isFuture);\n\t}\n\n\t/**\n\t * @static Returns the current date and time in a specified format in local time.\n\t * * Default format is dd, `mmm DD, YYYY HH:mm:ss` = `Sun, Apr 06, 2025 16:11:55`\n\t * @param options - Configure format string and whether to format using utc offset.\n\t * @returns Formatted date string in desired format.\n\t */\n\tstatic today(options?: FormatOptions): string {\n\t\tconst { format = 'dd, mmm DD, YYYY HH:mm:ss', useUTC = false } =\n\t\t\toptions || {};\n\t\tconst today = new Date();\n\t\treturn new Chronos(today).#format(format, useUTC);\n\t}\n\n\t/**\n\t * @static Returns a new `Chronos` instance representing yesterday's date.\n\t *\n\t * @returns A `Chronos` instance for the previous calendar day.\n\t */\n\tstatic yesterday(): Chronos {\n\t\tconst today = new Date();\n\n\t\tconst yesterday = today.setDate(today.getDate() - 1);\n\n\t\treturn new Chronos(yesterday).#withOrigin('yesterday');\n\t}\n\n\t/**\n\t * @static Returns a new `Chronos` instance representing tomorrow's date.\n\t *\n\t * @returns A `Chronos` instance for the next calendar day.\n\t */\n\tstatic tomorrow(): Chronos {\n\t\tconst today = new Date();\n\n\t\tconst yesterday = today.setDate(today.getDate() + 1);\n\n\t\treturn new Chronos(yesterday).#withOrigin('tomorrow');\n\t}\n\n\t/**\n\t * @static Returns the number of milliseconds elapsed since midnight, January 1, 1970 Universal Coordinated Time (UTC).\n\t * * It basically calls `Date.now()`.\n\t * @returns The number of milliseconds elapsed since the Unix epoch.\n\t */\n\tstatic now(): number {\n\t\treturn Date.now();\n\t}\n\n\t/**\n\t * @static Creates a UTC-based Chronos instance.\n\t * If no date is provided, it uses the current date and time.\n\t *\n\t * **This is the base time, meaning conversion in other timezone will consider UTC time as the base time.**\n\t *\n\t * @param dateLike Optional input date to base the UTC time on.\n\t * If omitted, the current system date/time is used.\n\t * @returns A new Chronos instance representing the UTC equivalent of the input.\n\t */\n\tstatic utc(dateLike?: ChronosInput): Chronos {\n\t\tconst chronos = new Chronos(dateLike);\n\n\t\tif (chronos.#offset === 'UTC+00:00') {\n\t\t\treturn chronos.#withOrigin('utc');\n\t\t}\n\n\t\tconst previousOffset = chronos.getTimeZoneOffsetMinutes();\n\n\t\tconst date = chronos.#date;\n\n\t\tconst utc = new Date(date.getTime() - previousOffset * 60 * 1000);\n\n\t\treturn new Chronos(utc).#withOrigin('utc');\n\t}\n\n\t/**\n\t * @static Formats a time-only string into a formatted time string.\n\t *\n\t * @param time - Time string to be formatted. Supported formats include:\n\t * - `HH:mm` → e.g., `'14:50'`\n\t * - `HH:mm:ss` → e.g., `'14:50:00'`\n\t * - `HH:mm:ss.mss` → e.g., `'14:50:00.800'`\n\t * - `HH:mm+TimeZoneOffset(HH)` → e.g., `'14:50+06'`\n\t * - `HH:mm+TimeZoneOffset(HH:mm)` → e.g., `'14:50+06:00'`\n\t * - `HH:mm:ss+TimeZoneOffset(HH)` → e.g., `'14:50:00+06'`\n\t * - `HH:mm:ss+TimeZoneOffset(HH:mm)` → e.g., `'14:50:00+05:30'`\n\t * - `HH:mm:ss.mss+TimeZoneOffset(HH)` → e.g., `'14:50:00.800+06'`\n\t * - `HH:mm:ss.mss+TimeZoneOffset(HH:mm)` → e.g., `'14:50:00.800+06:30'`\n\t *\n\t * * *Input will default to today's date and assume local timezone if no offset is provided.*\n\t *\n\t * @param format - Format string accepted by `formatStrict()` method (`TimeParts`). Default: `hh:mm:ss a` → 02:33:36 pm.\n\t * @returns Formatted time string in local (System) time.\n\t */\n\tstatic formatTimePart(time: string, format?: TimeParts) {\n\t\tfunction normalizeOffset(timeStr: string): string {\n\t\t\treturn timeStr.replace(/([+-]\\d{2})(?!:)/, '$1:00');\n\t\t}\n\n\t\tconst timeWithDate = `${new Chronos().#format('YYYY-MM-DD')}T${normalizeOffset(\n\t\t\ttime,\n\t\t)}`;\n\n\t\treturn new Chronos(timeWithDate).formatStrict(format ?? 'hh:mm:ss a');\n\t}\n\n\t/**\n\t * @static Returns earliest Chronos\n\t * @param dates Date inputs.\n\t */\n\tstatic min(...dates: ChronosInput[]): Chronos {\n\t\treturn new Chronos(\n\t\t\tMath.min(...dates.map((d) => new Chronos(d).valueOf())),\n\t\t).#withOrigin('min');\n\t}\n\n\t/**\n\t * @static Returns latest Chronos\n\t * @param dates Date inputs.\n\t */\n\tstatic max(...dates: ChronosInput[]): Chronos {\n\t\treturn new Chronos(\n\t\t\tMath.max(...dates.map((d) => new Chronos(d).valueOf())),\n\t\t).#withOrigin('max');\n\t}\n\n\t/**\n\t * @static Checks if the year in the date string or year (from 0 - 9999) is a leap year.\n\t * - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.\n\t * - For example, 2000 and 2400 are leap years, but 1900 and 2100 are not.\n\t *\n\t * @description\n\t * This method accepts different types of date inputs and extracts the year to check if it's a leap year.\n\t * If the provided date is a `number`, it will be treated as a year (must be a valid year from 0 to 9999).\n\t * If the year is out of this range (negative or larger than 9999), it will be treated as a Unix timestamp.\n\t * If the provided date is a string or a `Date` object, it will be parsed and the year will be extracted.\n\t * If a `Chronos` instance is passed, the year will be directly accessed from the instance.\n\t *\n\t * @param date - A `number` (year or Unix timestamp), `string`, `Date`, or `Chronos` instance representing a date.\n\t * @returns `true` if the year is a leap year, `false` otherwise.\n\t */\n\tstatic isLeapYear(date: ChronosInput): boolean {\n\t\tlet year: number;\n\n\t\tif (typeof date === 'number') {\n\t\t\tif (date > 0 && date <= 9999) {\n\t\t\t\tyear = date;\n\t\t\t} else {\n\t\t\t\tyear = new Chronos(date).year;\n\t\t\t}\n\t\t} else {\n\t\t\tyear = date instanceof Chronos ? date.year : new Chronos(date).year;\n\t\t}\n\n\t\treturn isLeapYear(year);\n\t}\n\n\t/**\n\t * @static Checks if the given value is a valid `Date` object.\n\t * - A value is considered valid if it is an instance of the built-in `Date` class.\n\t * - This does not check whether the date itself is valid (e.g., `new Date('invalid')`).\n\t * @param value - The value to test.\n\t * @returns `true` if the value is a valid Date object, otherwise `false`.\n\t */\n\tstatic isValidDate(value: unknown): value is Date {\n\t\treturn value instanceof Date;\n\t}\n\n\t/**\n\t * @static Checks if the given value is a valid date string.\n\t * - A value is considered a valid date string if it is a string and can be parsed by `Date.parse()`.\n\t * - This uses the native JavaScript date parser internally.\n\t * @param value - The value to test.\n\t * @returns `true` if the value is a valid date string, otherwise `false`.\n\t */\n\tstatic isDateString(value: unknown): value is string {\n\t\treturn isString(value) && !isNaN(Date.parse(value));\n\t}\n\n\t/**\n\t * @static Checks if the given value is an instance of `Chronos`.\n\t * - Useful for verifying Chronos objects in type guards or validations.\n\t * @param value - The value to test.\n\t * @returns `true` if the value is an instance of `Chronos`, otherwise `false`.\n\t */\n\tstatic isValidChronos(value: unknown): value is Chronos {\n\t\treturn value instanceof Chronos;\n\t}\n}\n","import { Chronos } from '..';\nimport type { Any } from '../types';\nimport type { ChronosInput, ChronosStatics } from './types';\n\n/**\n * * Converts a date into a Chronos object and access to all `Chronos` methods and properties.\n *\n * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n *\n * @description\n * This function serves as a wrapper around the `Chronos` class constructor and allows you to create a new `Chronos` instance from various types of date representations.\n * The following types of input are supported:\n *\n * - **`string`**: A string representing a date, which can be parsed by the JavaScript `Date` constructor.\n * Example: `\"2023-12-31\"`.\n * - **`number`**: A timestamp representing the number of milliseconds since the Unix epoch.\n * Example: `1672531199000`.\n * - **`Date`**: A JavaScript `Date` object.\n * - **`Chronos`**: A `Chronos` instance created by the same constructor.\n * - **`year, month, date, hours, minutes, seconds, milliseconds`**: Individual components of a date-time to construct a `Chronos` instance.\n * - **`year`**: A number representing the year. If the year is between 0 and 99, it will be assumed to be the year 1900 + the provided year.\n * - **`month`**: A number between 1 and 12 representing the month (1 for January, 12 for December). It is adjusted internally to a 0-based index (0 for January, 11 for December).\n * - **`date`**: A number between 1 and 31 representing the day of the month.\n * - **`hours`**: A number between 0 and 23 representing the hour of the day.\n * - **`minutes`**: A number between 0 and 59 representing the minutes past the hour.\n * - **`seconds`**: A number between 0 and 59 representing the seconds past the minute.\n * - **`milliseconds`**: A number between 0 and 999 representing the milliseconds past the second.\n *\n * This function also allows you to access static methods from the `Chronos` class, as it copies all static methods from `Chronos` to the `chronos` function itself.\n * Therefore, static methods can be called either through the `Chronos` class directly or through the `chronos` function.\n *\n * @example\n * Example usage:\n *\n * ```ts\n * const chronosInstanceFn = chronos(\"2023-12-31\");\n * const chronosInstanceClass = new Chronos(\"2023-12-31\");\n * const sameInstanceFn = chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * const sameInstanceClass = Chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * ```\n *\n * @param valueOrYear The value in number, string, Date or Chronos format or the full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n * @param month The month as a number between 1 and 12 (January to December).\n * @param date The date as a number between 1 and 31.\n * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.\n * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.\n * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.\n * @param ms A number from 0 to 999 that specifies the milliseconds.\n *\n * @returns new `Chronos` instance representing the provided date with all methods and properties.\n *\n * @static\n * @remarks\n * Static methods can be accessed from both the `Chronos` class and the `chronos` function.\n * Static methods from the `Chronos` class are copied over to the `chronos` function, so you can call them like:\n * ```ts\n * chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * // Or\n * Chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * ```\n */\nconst chronos = ((\n\tvalueOrYear?: ChronosInput,\n\tmonth?: number,\n\tdate?: number,\n\thours?: number,\n\tminutes?: number,\n\tseconds?: number,\n\tms?: number,\n) => {\n\tlet newChronos: Chronos;\n\n\tif (typeof valueOrYear === 'number' && typeof month === 'number') {\n\t\tnewChronos = new Chronos(\n\t\t\tvalueOrYear,\n\t\t\tmonth,\n\t\t\tdate ?? 1,\n\t\t\thours ?? 0,\n\t\t\tminutes ?? 0,\n\t\t\tseconds ?? 0,\n\t\t\tms ?? 0,\n\t\t);\n\t} else {\n\t\tnewChronos = new Chronos(valueOrYear);\n\t}\n\n\treturn newChronos;\n}) as ChronosStatics;\n\n/**\n * @remarks\n * Static methods from the `Chronos` class are copied over to the `chronos` function.\n * Therefore, you can access static methods from `Chronos` both through the `Chronos` class and the `chronos` function.\n *\n * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n *\n * Example usage:\n * ```ts\n * chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * // Or\n * Chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * ```\n *\n * *No need to call `chronos` for accessing the static methods. Simply call the static methods.*\n *\n * **Available Static Methods:**\n *\n * ```ts\n * today(options?: FormatOptions): string\n * yesterday(): Chronos;\n * tomorrow(): Chronos\n * now(): number\n * parse(dateStr: string, format: string): Chronos\n * utc(dateLike: ChronosInput): Chronos\n * min(...dates: ChronosInput[]): Chronos\n * max(...dates: ChronosInput[]): Chronos\n * isLeapYear(date: ChronosInput): boolean\n * isValidDate(value: unknown): boolean\n * isDateString(value: unknown): boolean\n * isValidChronos(value: unknown): boolean\n * ```\n */\nconst typedChronos = chronos as ChronosStatics;\n\n// ? Add static methods from Chronos class to the chronos function\nObject.getOwnPropertyNames(Chronos).forEach((method) => {\n\t// Exclude non-method properties like `length`, `name`, `prototype`\n\tif (method !== 'prototype' && method !== 'name' && method !== 'length') {\n\t\t(chronos as Any)[method] = (Chronos as Any)[method];\n\t}\n});\n\nexport { typedChronos as chronos };\n","import type { OwnKeys } from '../types';\nimport type { FindOptions } from './types';\n\ntype KeySelector<T> =\n\t| Extract<OwnKeys<T>, string | number>\n\t| ((item: T) => string | number);\n\ntype CacheEntry<T> = { result: T[]; timestamp: number };\n\n/**\n * The `Finder` class performs optimized searching on arrays.\n * It supports binary search, fuzzy search, and smart caching with TTL.\n */\nexport class Finder<T> {\n\tstatic readonly #DEFAULT_TTL = 1000 * 60 * 5;\n\n\treadonly #cachedResult: Map<string, CacheEntry<T>> = new Map();\n\treadonly #sortedCache: Map<string, CacheEntry<T>> = new Map();\n\treadonly #ttl: number;\n\treadonly #items: T[];\n\n\t/**\n\t * * Creates a new `Finder` instance with a static array of items.\n\t *\n\t * @param data An array of items to initialize the search dataset.\n\t * @param ttl Optional time-to-live (in milliseconds) for cached search results. Defaults to {@link Finder.#DEFAULT_TTL 5 Minutes}.\n\t */\n\tconstructor(data: T[], ttl?: number);\n\n\t/**\n\t * * Creates a new `Finder` instance with a lazy-evaluated item provider.\n\t *\n\t * @param cb A function returning an array of items to initialize the search dataset.\n\t * @param ttl Time-to-live (in milliseconds) for cached search results. Defaults to {@link Finder.#DEFAULT_TTL 5 Minutes}.\n\t */\n\tconstructor(cb: () => T[], ttl?: number);\n\n\t/**\n\t * * Creates a new `Finder` instance.\n\t *\n\t * @param data The initial array of items or a callback returning them.\n\t * @param ttl Time-to-live (in milliseconds) for cached search results. Defaults to {@link Finder.#DEFAULT_TTL 5 Minutes}.\n\t */\n\tconstructor(data: T[] | (() => T[]), ttl: number = Finder.#DEFAULT_TTL) {\n\t\tthis.#ttl = ttl;\n\t\tthis.#items = typeof data === 'function' ? data() : data;\n\t}\n\n\t/**\n\t * @instance Clears cache globally or for a specific key.\n\t * @param key Optional key to clear only a specific cache entry.\n\t */\n\tclearCache(key?: string): void {\n\t\tif (key) {\n\t\t\tthis.#cachedResult.delete(key);\n\t\t} else {\n\t\t\tthis.#cachedResult.clear();\n\t\t}\n\t}\n\n\t/**\n\t * @instance Finds all items that match the provided matcher using optional caching or fuzzy logic.\n\t * @param matcher The value to match against.\n\t * @param keySelector Property key or selector function.\n\t * @param options Optional settings for search behavior and source list.\n\t */\n\tfindAll(\n\t\tmatcher: string | number,\n\t\tkeySelector: KeySelector<T>,\n\t\toptions?: FindOptions<T>,\n\t): T[] {\n\t\tconst {\n\t\t\tfuzzy = false,\n\t\t\tneedSorting = true,\n\t\t\tcacheKey = 'finder-cache',\n\t\t\tforceBinary = false,\n\t\t\tcaseInsensitive = true,\n\t\t\tdata,\n\t\t} = options ?? {};\n\n\t\tconst source =\n\t\t\ttypeof data === 'function' ? data() : (data ?? this.#items);\n\n\t\tif (!source?.length) return [];\n\n\t\tconst rawGetKey =\n\t\t\ttypeof keySelector === 'function' ? keySelector : (\n\t\t\t\t(item: T) => item[keySelector] as string | number\n\t\t\t);\n\n\t\tconst getKey = Finder.#createMemoizedKeyGetter(rawGetKey);\n\n\t\tconst normalizedMatcher =\n\t\t\tcaseInsensitive && typeof matcher === 'string' ?\n\t\t\t\tmatcher.toLowerCase()\n\t\t\t:\tmatcher;\n\n\t\tif (cacheKey) {\n\t\t\tconst entry = this.#cachedResult.get(cacheKey);\n\n\t\t\tif (entry && Date.now() - entry.timestamp < this.#ttl) {\n\t\t\t\treturn entry.result;\n\t\t\t} else {\n\t\t\t\tthis.#cachedResult.delete(cacheKey);\n\t\t\t}\n\t\t}\n\n\t\tlet results: T[] = [];\n\n\t\tif (source.length < 100 && !forceBinary) {\n\t\t\tresults = source.filter((item) => {\n\t\t\t\tconst key = getKey(item);\n\t\t\t\tconst value =\n\t\t\t\t\tcaseInsensitive && typeof key === 'string' ?\n\t\t\t\t\t\tkey.toLowerCase()\n\t\t\t\t\t:\tkey;\n\t\t\t\treturn value === normalizedMatcher;\n\t\t\t});\n\t\t} else {\n\t\t\tconst sorted =\n\t\t\t\tneedSorting ?\n\t\t\t\t\tthis.#sortAndCache(source, getKey, cacheKey)\n\t\t\t\t:\tsource;\n\n\t\t\tconst firstMatch = this.binarySearch(\n\t\t\t\tsorted,\n\t\t\t\tnormalizedMatcher,\n\t\t\t\tgetKey,\n\t\t\t\tcaseInsensitive,\n\t\t\t);\n\n\t\t\tif (firstMatch) {\n\t\t\t\tconst baseKey = getKey(firstMatch);\n\n\t\t\t\tconst base =\n\t\t\t\t\tcaseInsensitive && typeof baseKey === 'string' ?\n\t\t\t\t\t\tbaseKey.toLowerCase()\n\t\t\t\t\t:\tbaseKey;\n\n\t\t\t\tresults = sorted.filter((item) => {\n\t\t\t\t\tconst key = getKey(item);\n\n\t\t\t\t\tconst value =\n\t\t\t\t\t\tcaseInsensitive && typeof key === 'string' ?\n\t\t\t\t\t\t\tkey.toLowerCase()\n\t\t\t\t\t\t:\tkey;\n\n\t\t\t\t\treturn value === base;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (!results.length && fuzzy && typeof normalizedMatcher === 'string') {\n\t\t\tresults = source.filter((item) => {\n\t\t\t\tconst rawKey = getKey(item);\n\n\t\t\t\tconst key =\n\t\t\t\t\tcaseInsensitive && typeof rawKey === 'string' ?\n\t\t\t\t\t\trawKey.toLowerCase()\n\t\t\t\t\t:\tString(rawKey);\n\n\t\t\t\treturn this.#match(key, normalizedMatcher);\n\t\t\t});\n\t\t}\n\n\t\tif (cacheKey) {\n\t\t\tthis.#cachedResult.set(cacheKey, {\n\t\t\t\tresult: results,\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t});\n\t\t}\n\n\t\treturn results;\n\t}\n\n\t/**\n\t * @instance Finds first matching item that matches the provided matcher using optional caching or fuzzy logic.\n\t * @param matcher The value to match.\n\t * @param keySelector Property key or selector function.\n\t * @param options Optional behavior flags and item source.\n\t */\n\tfindOne(\n\t\tmatcher: string | number,\n\t\tkeySelector: KeySelector<T>,\n\t\toptions?: FindOptions<T>,\n\t): T | undefined {\n\t\tconst {\n\t\t\tfuzzy = false,\n\t\t\tneedSorting = true,\n\t\t\tcacheKey = 'finder-cache',\n\t\t\tforceBinary = false,\n\t\t\tcaseInsensitive = true,\n\t\t\tdata,\n\t\t} = options ?? {};\n\n\t\tconst source =\n\t\t\ttypeof data === 'function' ? data() : (data ?? this.#items);\n\n\t\tif (!source?.length) return undefined;\n\n\t\tconst rawGetKey =\n\t\t\ttypeof keySelector === 'function' ? keySelector : (\n\t\t\t\t(item: T) => item[keySelector] as string | number\n\t\t\t);\n\n\t\tconst getKey = Finder.#createMemoizedKeyGetter(rawGetKey);\n\n\t\tconst normalizedMatcher =\n\t\t\tcaseInsensitive && typeof matcher === 'string' ?\n\t\t\t\tmatcher.toLowerCase()\n\t\t\t:\tmatcher;\n\n\t\tif (cacheKey) {\n\t\t\tconst entry = this.#cachedResult.get(cacheKey);\n\n\t\t\tif (entry && Date.now() - entry.timestamp < this.#ttl) {\n\t\t\t\treturn entry.result[0];\n\t\t\t} else {\n\t\t\t\tthis.#cachedResult.delete(cacheKey);\n\t\t\t}\n\t\t}\n\n\t\tlet result: T | undefined;\n\n\t\tif (source?.length < 100 && !forceBinary) {\n\t\t\tresult = source?.find((item) => {\n\t\t\t\tconst key = getKey(item);\n\t\t\t\tconst value =\n\t\t\t\t\tcaseInsensitive && typeof key === 'string' ?\n\t\t\t\t\t\tkey.toLowerCase()\n\t\t\t\t\t:\tkey;\n\t\t\t\treturn value === normalizedMatcher;\n\t\t\t});\n\t\t} else {\n\t\t\tresult = this.binarySearch(\n\t\t\t\tneedSorting ?\n\t\t\t\t\tthis.#sortAndCache(source, getKey, cacheKey)\n\t\t\t\t:\tsource,\n\t\t\t\tnormalizedMatcher,\n\t\t\t\tgetKey,\n\t\t\t\tcaseInsensitive,\n\t\t\t);\n\t\t}\n\n\t\tif (!result && fuzzy && typeof normalizedMatcher === 'string') {\n\t\t\treturn this.fuzzySearch(\n\t\t\t\tsource,\n\t\t\t\tnormalizedMatcher,\n\t\t\t\tgetKey,\n\t\t\t\tcaseInsensitive,\n\t\t\t);\n\t\t}\n\n\t\tif (cacheKey && result) {\n\t\t\tthis.#cachedResult.set(cacheKey, {\n\t\t\t\tresult: [result],\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t});\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * @instance Asynchronous variant of `findAll` that accepts a promise-based data supplier.\n\t * @param supplier Async function resolving the items list.\n\t * @param matcher The value to match.\n\t * @param keySelector Property key or selector function.\n\t * @param options Optional settings for search behavior and cache.\n\t */\n\tasync findAllAsync(\n\t\tsupplier: () => Promise<T[]>,\n\t\tmatcher: string | number,\n\t\tkeySelector: KeySelector<T>,\n\t\toptions?: Omit<FindOptions<T>, 'items'>,\n\t): Promise<T[]> {\n\t\tconst items = await supplier();\n\n\t\treturn this.findAll(matcher, keySelector, { ...options, data: items });\n\t}\n\n\t/**\n\t * @instance Asynchronous variant of `findOne`.\n\t * @param supplier Async function resolving the items list.\n\t * @param matcher The value to match.\n\t * @param keySelector Property key or selector function.\n\t * @param options Optional settings for behavior and cache.\n\t */\n\tasync findOneAsync(\n\t\tsupplier: () => Promise<T[]>,\n\t\tmatcher: string | number,\n\t\tkeySelector: KeySelector<T>,\n\t\toptions?: Omit<FindOptions<T>, 'items'>,\n\t): Promise<T | undefined> {\n\t\tconst items = await supplier();\n\n\t\treturn this.findOne(matcher, keySelector, { ...options, data: items });\n\t}\n\n\t/**\n\t * @instance Performs a binary search on a sorted array using a custom key selector.\n\t *\n\t * @param sorted - The sorted array of items to search.\n\t * @param matcher - The value to search for.\n\t * @param keySelector - A function that extracts the comparable key from each item.\n\t * @param caseInsensitive - Whether to compare string keys ignoring case.\n\t * @returns The first matching item if found; otherwise, undefined.\n\t */\n\tbinarySearch(\n\t\tsorted: T[],\n\t\tmatcher: string | number,\n\t\tkeySelector: (item: T) => string | number,\n\t\tcaseInsensitive: boolean,\n\t): T | undefined {\n\t\tlet min = 0,\n\t\t\tmax = sorted?.length - 1;\n\n\t\twhile (min <= max) {\n\t\t\tconst mid = Math.floor((min + max) / 2);\n\t\t\tconst midKey = keySelector(sorted[mid]);\n\t\t\tconst key =\n\t\t\t\tcaseInsensitive && typeof midKey === 'string' ?\n\t\t\t\t\tmidKey.toLowerCase()\n\t\t\t\t:\tmidKey;\n\n\t\t\tif (key === matcher) return sorted[mid];\n\t\t\tif (key < matcher) min = mid + 1;\n\t\t\telse max = mid - 1;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * @instance Performs a fuzzy search on an array by matching characters in sequence.\n\t *\n\t * @param array - The array of items to search.\n\t * @param matcher - The fuzzy search string to match against.\n\t * @param keySelector - A function that extracts the key to search from each item.\n\t * @param caseInsensitive - Whether to compare ignoring case for string values.\n\t * @returns The first fuzzy-matching item if found; otherwise, undefined.\n\t */\n\tfuzzySearch(\n\t\tarray: T[],\n\t\tmatcher: string,\n\t\tkeySelector: (item: T) => string | number,\n\t\tcaseInsensitive: boolean,\n\t): T | undefined {\n\t\tfor (const item of array) {\n\t\t\tconst rawKey = keySelector(item);\n\t\t\tconst key =\n\t\t\t\tcaseInsensitive && typeof rawKey === 'string' ?\n\t\t\t\t\trawKey.toLowerCase()\n\t\t\t\t:\tString(rawKey);\n\t\t\tif (this.#match(key, matcher)) return item;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * @private Checks if the characters in the target string appear in order within the source string.\n\t * @param source Source string to search within.\n\t * @param target Target string to match against the source string.\n\t * @returns True if the target string is a fuzzy match within the source string; otherwise, false.\n\t */\n\t#match(source: string, target: string): boolean {\n\t\tlet i = 0;\n\n\t\tfor (const char of target) {\n\t\t\ti = source?.indexOf(char, i);\n\t\t\tif (i === -1) return false;\n\t\t\ti++;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @private Sorts an array and caches the result for a specified time-to-live (TTL).\n\t * @param data Data to sort and cache.\n\t * @param getKey Key extraction function.\n\t * @param cacheKey Optional cache key for storing the result.\n\t * @returns\n\t */\n\t#sortAndCache(\n\t\tdata: T[],\n\t\tgetKey: (item: T) => string | number,\n\t\tcacheKey?: string,\n\t) {\n\t\tif (cacheKey) {\n\t\t\tconst entry = this.#sortedCache.get(cacheKey);\n\n\t\t\tif (entry && Date.now() - entry.timestamp < this.#ttl) {\n\t\t\t\treturn entry.result;\n\t\t\t} else {\n\t\t\t\tthis.#sortedCache.delete(cacheKey);\n\t\t\t}\n\t\t}\n\n\t\tconst sorted = [...data].sort((a, b) => {\n\t\t\tconst keyA = getKey(a);\n\t\t\tconst keyB = getKey(b);\n\t\t\treturn (\n\t\t\t\tkeyA < keyB ? -1\n\t\t\t\t: keyA > keyB ? 1\n\t\t\t\t: 0\n\t\t\t);\n\t\t});\n\n\t\tif (cacheKey) {\n\t\t\tthis.#sortedCache.set(cacheKey, {\n\t\t\t\tresult: sorted,\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t});\n\t\t}\n\n\t\treturn sorted;\n\t}\n\n\t/**\n\t * @static @private Creates a memoized version of a key extractor.\n\t * @param getKey Original key extraction function\n\t */\n\tstatic #createMemoizedKeyGetter<T>(\n\t\tgetKey: (item: T) => string | number,\n\t): (item: T) => string | number {\n\t\tconst cache = new Map<T, string | number>();\n\n\t\treturn (item: T): string | number => {\n\t\t\tif (cache.has(item)) return cache.get(item)!;\n\t\t\tconst key = getKey(item);\n\t\t\tcache.set(item, key);\n\t\t\treturn key;\n\t\t};\n\t}\n}\n","import { isNumber } from '../guards/primitives';\nimport type { GenericObject } from '../object/types';\nimport { isDeepEqual } from '../utils';\nimport type { FieldValue, Option, OptionsConfig } from './types';\n\n/**\n * * Converts an array of objects into a formatted array of options.\n *\n * @param data - An array of objects to convert into options.\n * @param config - The configuration object to specify the keys for the `value` (firstFieldName) and `label` (secondFieldName) fields and rename as needed.\n * @returns An array of options, where each option has `value` and `label` fields as default or as specified by user in the config options.\n */\nexport function createOptionsArray<\n\tT extends GenericObject,\n\tK1 extends string = 'value',\n\tK2 extends string = 'label',\n\tV extends boolean = false,\n>(\n\tdata: T[],\n\tconfig: OptionsConfig<T, K1, K2, V>,\n): Array<{ [P in K1 | K2]: FieldValue<P, T, K1, K2, V> }> {\n\tconst {\n\t\tfirstFieldKey,\n\t\tsecondFieldKey,\n\t\tfirstFieldName = 'value' as K1,\n\t\tsecondFieldName = 'label' as K2,\n\t\tretainNumberValue = false,\n\t} = config || {};\n\n\tif (data && data?.length) {\n\t\treturn data?.map((datum) => {\n\t\t\tconst firstValue =\n\t\t\t\tretainNumberValue && isNumber(datum[firstFieldKey]) ?\n\t\t\t\t\tdatum[firstFieldKey]\n\t\t\t\t:\tString(datum[firstFieldKey] ?? '');\n\n\t\t\treturn {\n\t\t\t\t[firstFieldName]: firstValue,\n\t\t\t\t[secondFieldName]: String(datum[secondFieldKey] ?? ''),\n\t\t\t};\n\t\t}) as Array<Option<T, K1, K2, V>>;\n\t} else {\n\t\treturn [] as Array<Option<T, K1, K2, V>>;\n\t}\n}\n\n/**\n * * Removes duplicate values from an array, supporting deep comparison for objects and arrays.\n *\n * @param array - The array from which duplicates need to be removed.\n * @returns A new array with duplicates removed.\n */\nexport function removeDuplicatesFromArray<T>(array: T[]): T[] {\n\treturn array?.filter(\n\t\t(item, index, self) =>\n\t\t\tindex === self?.findIndex((el) => isDeepEqual(el, item)),\n\t);\n}\n\n/**\n * * Finds duplicate values in an array, runs deep comparison for objects and arrays.\n *\n * @param array - The array in which to find duplicates.\n * @returns An array containing all duplicate entries (each one only once).\n */\nexport function getDuplicates<T>(array: T[]): T[] {\n\tconst seen: T[] = [];\n\tconst duplicates: T[] = [];\n\n\tfor (const item of array) {\n\t\tconst hasSeen = seen?.find((el) => isDeepEqual(el, item));\n\t\tconst hasDuplicate = duplicates?.find((el) => isDeepEqual(el, item));\n\n\t\tif (hasSeen && !hasDuplicate) {\n\t\t\tduplicates?.push(item);\n\t\t} else if (!hasSeen) {\n\t\t\tseen?.push(item);\n\t\t}\n\t}\n\n\treturn duplicates;\n}\n\n/**\n * * Finds elements missing from one array compared to another using deep comparison.\n *\n * @param options - Configuration to specify which array to compare and direction of check.\n * @returns An array of missing elements based on the comparison direction.\n */\n\n/**\n * * Finds elements missing from one array compared to another using deep comparison.\n *\n * @param array1 The first array to compare.\n * @param array2 The second array to compare.\n * @param missingFrom Which direction to compare for missing values:.\n *\t\t\t\t\t - `'from-first'` → values in `array1` missing in `array2`.\n *\t\t\t\t\t - `'from-second'` → values in `array2` missing in `array1`.\n * @returns An array of missing elements based on the comparison direction.\n */\nexport function findMissingElements<T, U>(\n\tarray1: T[],\n\tarray2: U[],\n\tmissingFrom: 'from-first' | 'from-second',\n): (T | U)[] {\n\tconst source = (missingFrom === 'from-first' ? array1 : array2) ?? [];\n\tconst target = (missingFrom === 'from-first' ? array2 : array1) ?? [];\n\n\treturn source.filter((s) => !target?.some((t) => isDeepEqual(t, s)));\n}\n\n/**\n * * Splits an array into chunks of a given size.\n *\n * @param arr The array to split.\n * @param chunkSize The size of each chunk.\n * @returns An array of chunked arrays.\n */\nexport function splitArray<T>(arr: T[], chunkSize: number): T[][] {\n\tconst result: T[][] = [];\n\n\tfor (let i = 0; i < arr?.length; i += chunkSize) {\n\t\tresult.push(arr.slice(i, i + chunkSize));\n\t}\n\n\treturn result;\n}\n\n/**\n * * Rotates an array left or right by a given number of steps.\n *\n * @param arr The array to rotate.\n * @param steps The number of positions to rotate (positive: right, negative: left).\n * @returns The rotated array.\n */\nexport function rotateArray<T>(arr: T[], steps: number): T[] {\n\tconst length = arr?.length;\n\n\tif (length === 0) return arr;\n\n\tconst offset = ((steps % length) + length) % length;\n\n\treturn arr.slice(-offset).concat(arr.slice(0, -offset));\n}\n\n/**\n * * Moves an element within an array from one index to another.\n *\n * @param arr The array to modify.\n * @param fromIndex The index of the element to move.\n * @param toIndex The new index for the element.\n * @returns A new array with the element moved.\n */\nexport function moveArrayElement<T>(\n\tarr: T[],\n\tfromIndex: number,\n\ttoIndex: number,\n): T[] {\n\tconst newArr = [...arr];\n\n\tconst [item] = newArr.splice(fromIndex, 1);\n\n\tnewArr.splice(toIndex, 0, item);\n\n\treturn newArr;\n}\n","import type { CustomFile, FileUpload, OriginFileObj } from './types';\n\n/**\n * * Checks if a given value is a valid `FormData` & it's not empty.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `FormData` and not empty, otherwise `false`.\n */\nexport function isValidFormData(value: unknown): value is FormData {\n\tif (!(value instanceof FormData)) return false;\n\n\tif ('entries' in value) {\n\t\tif (typeof value.entries !== 'function') {\n\t\t\tconsole.warn('`FormData.entries()` is not supported!');\n\t\t\treturn false;\n\t\t}\n\n\t\treturn Array.from(value.entries())?.length > 0;\n\t}\n\n\treturn false;\n}\n\n/**\n * * Checks if a given value is an `OriginFileObj`.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `OriginFileObj`, otherwise `false`.\n */\nexport function isOriginFileObj(value: unknown): value is OriginFileObj {\n\tif (typeof value !== 'object' || value === null || Array.isArray(value)) {\n\t\treturn false;\n\t}\n\n\tconst obj = value as Record<string, unknown>;\n\n\treturn typeof obj.uid === 'string';\n}\n\n/**\n * * Checks if a given value is a `CustomFile`.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `CustomFile`, otherwise `false`.\n */\nexport function isCustomFile(value: unknown): value is CustomFile {\n\tif (typeof value !== 'object' || value === null || Array.isArray(value)) {\n\t\treturn false;\n\t}\n\n\tconst obj = value as Record<string, unknown>;\n\n\treturn 'originFileObj' in obj && isOriginFileObj(obj.originFileObj);\n}\n\n/**\n * * Checks if a given value is an array of `CustomFile` objects.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `CustomFile[]`, otherwise `false`.\n */\nexport function isCustomFileArray(value: unknown): value is CustomFile[] {\n\treturn (\n\t\tArray.isArray(value) && value?.length > 0 && value?.every(isCustomFile)\n\t);\n}\n\n/**\n * * Checks if a given value is an array of `File/Blob` objects.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `File[]` or `Blob[]`, otherwise `false`.\n */\nexport function isFileArray(value: unknown): value is File[] | Blob[] {\n\treturn (\n\t\tArray.isArray(value) && value?.length > 0 && value?.every(isFileOrBlob)\n\t);\n}\n\n/**\n * * Checks if a given value is an instance of `FileList`.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `FileList`, otherwise `false`.\n */\nexport function isFileList(value: unknown): value is FileList {\n\treturn typeof FileList !== 'undefined' && value instanceof FileList;\n}\n\n/**\n * * Checks if a given value is an instance of `File` or `Blob`.\n * @param value - The value to check.\n * @returns `true` if the value is an instance of `File` or `Blob`, otherwise `false`.\n */\nexport function isFileOrBlob(value: unknown): value is File | Blob {\n\treturn (\n\t\t(typeof File !== 'undefined' && value instanceof File) ||\n\t\t(typeof Blob !== 'undefined' && value instanceof Blob)\n\t);\n}\n\n/**\n * * Checks if a given value is a `FileUpload` object.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `FileUpload`, otherwise `false`.\n */\nexport function isFileUpload(value: unknown): value is FileUpload {\n\tif (typeof value !== 'object' || value === null || Array.isArray(value)) {\n\t\treturn false;\n\t}\n\n\tconst obj = value as Record<string, unknown>;\n\n\treturn (\n\t\t('file' in obj && isCustomFile(obj.file)) ||\n\t\t('fileList' in obj && isCustomFileArray(obj.fileList))\n\t);\n}\n","import { isDateLike } from '../date/guards';\nimport {\n\tisEmptyObject,\n\tisNotEmptyObject,\n\tisValidArray,\n} from '../guards/non-primitives';\nimport { isNonEmptyString } from '../guards/primitives';\nimport type {\n\tDotNotationKey,\n\tGenericObject,\n\tKeyForObject,\n} from '../object/types';\nimport {\n\tisCustomFile,\n\tisCustomFileArray,\n\tisFileArray,\n\tisFileList,\n\tisFileOrBlob,\n\tisFileUpload,\n} from './guards';\nimport type { FormDataConfigs } from './types';\n\n/**\n * * Utility to convert object into FormData in a controlled way.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n *\n * @param data - The source object to control and convert to FormData.\n * @param configs - Configuration options to control the formData.\n * @returns `FormData` instance containing the sanitized and transformed data.\n */\nexport const createControlledFormData = <T extends GenericObject>(\n\tdata: T,\n\tconfigs?: FormDataConfigs<T>,\n): FormData => {\n\tconst formData = new FormData();\n\n\tconst { stringifyNested = '*' } = configs || {};\n\n\t/** - Helper to check if a key should be lowercase */\n\tconst shouldLowercaseKeys = (key: string) => {\n\t\treturn Array.isArray(configs?.lowerCaseKeys) ?\n\t\t\t\tconfigs?.lowerCaseKeys?.some(\n\t\t\t\t\t(path) => key === path || key.startsWith(`${path}.`),\n\t\t\t\t)\n\t\t\t:\tconfigs?.lowerCaseKeys === '*';\n\t};\n\n\t/** - Helper to check if a key should be lowercase */\n\tconst shouldLowercaseValue = (key: string) => {\n\t\treturn Array.isArray(configs?.lowerCaseValues) ?\n\t\t\t\tconfigs.lowerCaseValues?.some(\n\t\t\t\t\t(path) => key === path || key?.startsWith(`${path}.`),\n\t\t\t\t)\n\t\t\t:\tconfigs?.lowerCaseValues === '*';\n\t};\n\n\t/** - Transforms key to lowercase if needed */\n\tconst _transformKey = (key: string) => {\n\t\treturn shouldLowercaseKeys(key) ? key.toLowerCase() : key;\n\t};\n\n\t/** - Helper function to check if a key matches a breakArray key. */\n\tconst isRequiredKey = (key: string) => {\n\t\tconst transformedKey = _transformKey(key);\n\n\t\treturn Array.isArray(configs?.requiredKeys) ?\n\t\t\t\tconfigs?.requiredKeys?.some(\n\t\t\t\t\t(path) =>\n\t\t\t\t\t\ttransformedKey === path ||\n\t\t\t\t\t\ttransformedKey?.startsWith(`${path}.`),\n\t\t\t\t)\n\t\t\t:\tconfigs?.requiredKeys === '*';\n\t};\n\n\t/** - Helper function to check if a key matches a dotNotation path to preserve. */\n\tconst shouldDotNotate = (key: string) => {\n\t\tconst transformedKey = _transformKey(key);\n\n\t\treturn Array.isArray(configs?.dotNotateNested) ?\n\t\t\t\tconfigs.dotNotateNested.includes(\n\t\t\t\t\ttransformedKey as KeyForObject<T>,\n\t\t\t\t)\n\t\t\t:\tconfigs?.dotNotateNested === '*';\n\t};\n\n\t/** - Helper function to check if a key matches a stringifyNested key. */\n\tconst shouldStringify = (key: string) => {\n\t\tconst transformedKey = _transformKey(key);\n\n\t\treturn Array.isArray(stringifyNested) ?\n\t\t\t\tstringifyNested.includes(transformedKey as KeyForObject<T>)\n\t\t\t:\tstringifyNested === '*';\n\t};\n\n\t/** - Helper function to check if a key matches a breakArray key. */\n\tconst shouldBreakArray = (key: string) => {\n\t\tconst transformedKey = _transformKey(key);\n\n\t\treturn Array.isArray(configs?.breakArray) ?\n\t\t\t\tconfigs.breakArray.includes(transformedKey as KeyForObject<T>)\n\t\t\t:\tconfigs?.breakArray === '*';\n\t};\n\n\t/** - Helper to clean object by removing null/undefined/empty values while respecting required keys */\n\tconst _cleanObject = (\n\t\tobj: GenericObject,\n\t\tparentKey = '',\n\t): GenericObject => {\n\t\treturn Object.entries(obj).reduce((acc, [key, value]) => {\n\t\t\tconst transformedKey = _transformKey(key);\n\n\t\t\tconst fullKey =\n\t\t\t\tparentKey ? `${parentKey}.${transformedKey}` : transformedKey;\n\n\t\t\t// * Skip ignored keys (don't include them in the cleaned object)\n\t\t\tif (configs?.ignoreKeys?.includes(fullKey as DotNotationKey<T>)) {\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\tconst isNotNullish = value != null && value !== '';\n\n\t\t\t// * Keep value if:\n\t\t\t// * 1. It's required OR\n\t\t\t// * 2. It's not null/undefined AND not empty string/object/array\n\t\t\tconst shouldKeep =\n\t\t\t\tisRequiredKey(fullKey) ||\n\t\t\t\tisNotNullish ||\n\t\t\t\tisNonEmptyString(value) ||\n\t\t\t\tisValidArray(value) ||\n\t\t\t\tisNotEmptyObject(value);\n\n\t\t\tif (shouldKeep) {\n\t\t\t\tif (isNotEmptyObject(value)) {\n\t\t\t\t\t// * Recursively clean nested objects\n\t\t\t\t\tconst cleaned = _cleanObject(value, fullKey);\n\n\t\t\t\t\tif (isRequiredKey(fullKey) || isNotEmptyObject(cleaned)) {\n\t\t\t\t\t\tacc[transformedKey] = cleaned;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (typeof value === 'string') {\n\t\t\t\t\t\tacc[transformedKey] = value?.toLowerCase();\n\t\t\t\t\t} else if (Array.isArray(value)) {\n\t\t\t\t\t\tif (isRequiredKey(fullKey) || isValidArray(value)) {\n\t\t\t\t\t\t\tacc[transformedKey] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (isEmptyObject(value)) {\n\t\t\t\t\t\tif (isRequiredKey(fullKey)) {\n\t\t\t\t\t\t\tacc[transformedKey] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tacc[transformedKey] = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, {} as GenericObject);\n\t};\n\n\t/** * Helper function to add values to formData */\n\tconst _addToFormData = (key: string, value: unknown) => {\n\t\tconst transformedKey = _transformKey(key);\n\n\t\tif (isCustomFileArray(value)) {\n\t\t\tvalue?.forEach((file) =>\n\t\t\t\tformData.append(transformedKey, file?.originFileObj),\n\t\t\t);\n\t\t} else if (isFileUpload(value)) {\n\t\t\tif (value?.fileList) {\n\t\t\t\tvalue?.fileList.forEach((file) =>\n\t\t\t\t\tformData.append(transformedKey, file?.originFileObj),\n\t\t\t\t);\n\t\t\t} else if (value?.file) {\n\t\t\t\tif (isCustomFile(value?.file)) {\n\t\t\t\t\tformData.append(transformedKey, value?.file?.originFileObj);\n\t\t\t\t} else {\n\t\t\t\t\tformData.append(transformedKey, value?.file);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isFileOrBlob(value)) {\n\t\t\tformData.append(transformedKey, value);\n\t\t} else if (isFileList(value)) {\n\t\t\tfor (let i = 0; i < value?.length; i++) {\n\t\t\t\tformData.append(transformedKey, value.item(i)!);\n\t\t\t}\n\t\t} else if (Array.isArray(value)) {\n\t\t\tif (isFileArray(value)) {\n\t\t\t\tif (shouldBreakArray(key)) {\n\t\t\t\t\tvalue?.forEach((item, index) => {\n\t\t\t\t\t\t_addToFormData(`${transformedKey}[${index}]`, item);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tvalue?.forEach((item) => {\n\t\t\t\t\t\tformData.append(transformedKey, item);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (isValidArray(value)) {\n\t\t\t\tif (shouldBreakArray(key)) {\n\t\t\t\t\tvalue?.forEach((item, index) => {\n\t\t\t\t\t\t_addToFormData(`${transformedKey}[${index}]`, item);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tformData.append(transformedKey, JSON.stringify(value));\n\t\t\t\t}\n\t\t\t} else if (isRequiredKey(key)) {\n\t\t\t\tformData.append(transformedKey, JSON.stringify(value));\n\t\t\t}\n\t\t} else if (isDateLike(value)) {\n\t\t\tformData.append(transformedKey, JSON.parse(JSON.stringify(value)));\n\t\t} else if (isNotEmptyObject(value)) {\n\t\t\tif (shouldStringify(key) && !shouldDotNotate(key)) {\n\t\t\t\t// * Clean object before stringifying, preserving required keys\n\t\t\t\tconst cleanedValue = _cleanObject(value, key);\n\n\t\t\t\tif (isNotEmptyObject(cleanedValue) || isRequiredKey(key)) {\n\t\t\t\t\tformData.append(\n\t\t\t\t\t\ttransformedKey,\n\t\t\t\t\t\tJSON.stringify(cleanedValue),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tObject.entries(value).forEach(([nestedKey, nestedValue]) => {\n\t\t\t\t\t_addToFormData(`${key}.${nestedKey}`, nestedValue);\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tconst isNotNullish = value != null && value !== '';\n\n\t\t\tif (isNotNullish || isRequiredKey(key)) {\n\t\t\t\tif (typeof value === 'string' && shouldLowercaseValue(key)) {\n\t\t\t\t\tformData.append(transformedKey, value?.toLowerCase());\n\t\t\t\t} else {\n\t\t\t\t\t// ! CONFUSED UNGA-BUNGA\n\t\t\t\t\tformData.append(transformedKey, value as Blob);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t/** - Helper to process object */\n\tconst _processObject = (obj: GenericObject, parentKey = '') => {\n\t\tObject.entries(obj).forEach(([key, value]) => {\n\t\t\tconst transformedKey = _transformKey(key);\n\n\t\t\tconst fullKey =\n\t\t\t\tparentKey ? `${parentKey}.${transformedKey}` : transformedKey;\n\n\t\t\t// * Skip keys that are in ignoreKeys\n\t\t\tif (configs?.ignoreKeys?.includes(fullKey as DotNotationKey<T>)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// * Trim string values if trimStrings is enabled\n\t\t\tif (configs?.trimStrings && typeof value === 'string') {\n\t\t\t\tvalue = value?.trim();\n\t\t\t}\n\n\t\t\t// * Check if this key is preserved as dot-notation\n\t\t\tif (shouldDotNotate(fullKey)) {\n\t\t\t\t_addToFormData(fullKey, value);\n\t\t\t} else if (isNotEmptyObject(value) && !shouldStringify(fullKey)) {\n\t\t\t\t// * Process nested objects\n\t\t\t\t_processObject(value, key);\n\t\t\t} else if (isFileOrBlob(value)) {\n\t\t\t\t_addToFormData(key, value);\n\t\t\t} else if (isDateLike(value)) {\n\t\t\t\t_addToFormData(key, JSON.parse(JSON.stringify(value)));\n\t\t\t} else if (isEmptyObject(value)) {\n\t\t\t\tif (isRequiredKey(fullKey)) {\n\t\t\t\t\t_addToFormData(key, JSON.stringify(value));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// * For other cases, just append as key-value\n\t\t\t\t_addToFormData(key, value);\n\t\t\t}\n\t\t});\n\t};\n\n\tif (isNotEmptyObject(data)) {\n\t\t_processObject(data);\n\t}\n\n\treturn formData;\n};\n","import {\n\tisArrayOfType,\n\tisNotEmptyObject,\n\tisObject,\n} from '../guards/non-primitives';\nimport { isString } from '../guards/primitives';\nimport { trimString } from '../string/basics';\nimport type { Any, FlattenPartial, PartialOrRequired } from '../types';\nimport type { DotNotationKey, GenericObject, SanitizeOptions } from './types';\n\n/**\n * * Trims all the words in a string.\n *\n * @param input String to sanitize.\n * @returns Sanitized string .\n */\nexport function sanitizeData(input: string): string;\n\n/**\n * * Trims all the words in an array of strings.\n *\n * @param input Array of strings to sanitize.\n * @returns Sanitized array of strings.\n */\nexport function sanitizeData(input: string[]): string[];\n\n/**\n * * Sanitizes an object by ignoring specified keys and trimming string values based on options provided.\n * * Also excludes nullish values (`null`, `undefined`), falsy (`nullish` + `0` & `\"\"`) or empty values (`object`, `array`) if specified.\n *\n * @param object - The object to sanitize.\n * @param options - Options that define which keys to ignore, whether to trim string values, and whether to exclude nullish, falsy or empty values.\n * @param _return - By default return type is as it is, passing this parameter `true` makes the return type `Partial<T>`.\n * @returns A new object with the specified modifications.\n */\nexport function sanitizeData<\n\tT extends GenericObject,\n\tB extends PartialOrRequired = 'required',\n>(\n\tobject: T,\n\toptions?: SanitizeOptions<T>,\n\t_return?: B,\n): B extends 'partial' ? FlattenPartial<T> : T;\n\n/**\n * * Sanitizes a deeply nested array that may contain arrays, objects or other (mixed) data types.\n * * Preserves structure while removing empty values and trimming strings and other operations.\n *\n * @param array - A mixed array that may contain arrays, objects or other data types.\n * @param options - Options to trim and filter values.\n * @param _return - By default return type is as it is, passing this parameter `partial` makes the return type `Partial<T>`.\n * @returns A new sanitized array with the specified modifications.\n */\nexport function sanitizeData<\n\tT extends GenericObject,\n\tB extends PartialOrRequired = 'required',\n>(\n\tarray: T[],\n\toptions?: SanitizeOptions<T>,\n\t_return?: B,\n): B extends 'partial' ? FlattenPartial<T>[] : T[];\n\n/**\n * * Sanitizes a string, array of strings, an object or array of objects by ignoring specified keys and trimming string values.\n * * Also excludes nullish values (null, undefined) if specified. Always ignores empty nested object(s).\n *\n * @param input - The string, object or array of strings or objects to sanitize.\n * @param options - Options for processing.\n * @param _return - By default return type is as it is, passing this parameter `partial` makes the return type `Partial<T>`.\n * @returns A new string, object or array of strings or objects with the specified modifications.\n */\nexport function sanitizeData<\n\tT extends GenericObject,\n\tB extends PartialOrRequired = 'required',\n>(\n\tinput: string | string[] | T | T[],\n\toptions?: SanitizeOptions<T>,\n\t_return?: B,\n):\n\t| string\n\t| string[]\n\t| (B extends 'partial' ? FlattenPartial<T> : T)\n\t| (B extends 'partial' ? FlattenPartial<T>[] : T[]) {\n\tconst {\n\t\tkeysToIgnore = [],\n\t\trequiredKeys = [],\n\t\ttrimStrings = true,\n\t\tignoreNullish = false,\n\t\tignoreFalsy = false,\n\t\tignoreEmpty = false,\n\t} = options || {};\n\n\t// Flatten the object keys and use the keys for comparison\n\tconst ignoreKeySet = new Set(keysToIgnore);\n\n\t/**\n\t * * Determines if a key is required\n\t * @param key The key to check.\n\t * @returns `true` if the key is required, otherwise `false`.\n\t */\n\tconst isRequiredKey = (key: string) => {\n\t\treturn Array.isArray(requiredKeys) ?\n\t\t\t\trequiredKeys?.some(\n\t\t\t\t\t(path) => key === path || key.startsWith(`${path}.`),\n\t\t\t\t)\n\t\t\t:\trequiredKeys === '*';\n\t};\n\n\t/**\n\t * * Check if a value is an object and determines whether it should skip based on `ignoreEmpty` flag.\n\t * @param obj Object value to check.\n\t * @returns `true` if the object is skippable, otherwise `false`.\n\t */\n\tconst _skipObject = (obj: unknown): boolean => {\n\t\treturn ignoreEmpty && isObject(obj) && !isNotEmptyObject(obj);\n\t};\n\n\t/**\n\t * * Recursively process an array and its nested content(s).\n\t * @param arr Array to process.\n\t * @param path Full path as dot notation if needed.\n\t * @returns Processed array.\n\t */\n\tconst _processArray = (arr: unknown[], path: string): unknown[] => {\n\t\treturn arr\n\t\t\t?.map((item) => {\n\t\t\t\tif (isString(item) && trimStrings) {\n\t\t\t\t\treturn trimString(item);\n\t\t\t\t}\n\n\t\t\t\tif (Array.isArray(item)) {\n\t\t\t\t\t// Recursive sanitize\n\t\t\t\t\treturn _processArray(item, path);\n\t\t\t\t}\n\n\t\t\t\tif (isObject(item)) {\n\t\t\t\t\treturn _processObject(item as T, path);\n\t\t\t\t}\n\n\t\t\t\treturn item;\n\t\t\t})\n\t\t\t?.filter((v) => {\n\t\t\t\tif (ignoreNullish && v == null) return false;\n\t\t\t\tif (ignoreFalsy && !v) return false;\n\t\t\t\tif (_skipObject(v) && !isRequiredKey(path)) return false;\n\t\t\t\treturn true;\n\t\t\t});\n\t};\n\n\t/**\n\t * * Helper function to process a single object.\n\t *\n\t * @param object The object to process.\n\t * @param parentPath The parent path of a key.\n\t * */\n\tconst _processObject = (object: T, parentPath = '') =>\n\t\tObject.entries(object).reduce((acc, [key, value]) => {\n\t\t\t// Compute the full key path\n\t\t\tconst fullKeyPath = parentPath ? `${parentPath}.${key}` : key;\n\n\t\t\t// Skip ignored keys\n\t\t\tif (ignoreKeySet.has(fullKeyPath as DotNotationKey<T>)) {\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\t// Exclude nullish values if specified\n\t\t\tif (ignoreNullish && !isRequiredKey(fullKeyPath) && value == null) {\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\t// Exclude falsy values `0`, `false`, `null` and `undefined`\n\t\t\tif (ignoreFalsy && !value && !isRequiredKey(fullKeyPath)) {\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\tif (isString(value) && trimStrings) {\n\t\t\t\t// Trim string values if enabled\n\t\t\t\tacc[key as keyof T] = trimString(value) as T[keyof T];\n\t\t\t} else if (value && isObject(value)) {\n\t\t\t\t// Recursively process nested objects\n\t\t\t\tconst processedValue = _processObject(value as T, fullKeyPath);\n\t\t\t\t// Add the property conditionally if it's not an empty object\n\t\t\t\tif (\n\t\t\t\t\t!ignoreEmpty ||\n\t\t\t\t\tisRequiredKey(fullKeyPath) ||\n\t\t\t\t\tisNotEmptyObject(processedValue)\n\t\t\t\t) {\n\t\t\t\t\tacc[key as keyof T] = processedValue as T[keyof T];\n\t\t\t\t}\n\t\t\t} else if (value && Array.isArray(value)) {\n\t\t\t\t// Keep file arrays untouched\n\t\t\t\t// if (isFileArray(value) || isCustomFileArray(value)) {\n\t\t\t\t// \tacc[key as keyof T] = value as T[keyof T];\n\t\t\t\t// }\n\t\t\t\tconst processedArray = _processArray(value, fullKeyPath);\n\n\t\t\t\tif (\n\t\t\t\t\t!ignoreEmpty ||\n\t\t\t\t\tisRequiredKey(fullKeyPath) ||\n\t\t\t\t\tprocessedArray?.length > 0\n\t\t\t\t) {\n\t\t\t\t\tacc[key as keyof T] = processedArray as T[keyof T];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Add other values untouched\n\t\t\t\tacc[key as keyof T] = value as T[keyof T];\n\t\t\t}\n\n\t\t\treturn acc;\n\t\t}, {} as T);\n\n\t// Process strings\n\tif (isString(input)) {\n\t\treturn trimString(input);\n\t}\n\n\t// Process array of strings and objects\n\tif (Array.isArray(input)) {\n\t\t// Process array of strings\n\t\tif (isArrayOfType(input, isString)) {\n\t\t\treturn trimString(input);\n\t\t}\n\n\t\t// * Handle arrays with nested strings/arrays/objects\n\t\treturn input\n\t\t\t?.map((item) => sanitizeData(item, options, _return))\n\t\t\t?.filter((val) => {\n\t\t\t\tif (ignoreNullish && val == null) return false;\n\t\t\t\tif (ignoreFalsy && !val) return false;\n\t\t\t\tif (_skipObject(val)) return false;\n\n\t\t\t\treturn true;\n\t\t\t}) as B extends 'partial' ? FlattenPartial<T>[] : T[];\n\t}\n\n\t// Process object\n\tif (isObject(input)) {\n\t\treturn _processObject(input) as B extends 'partial' ? FlattenPartial<T>\n\t\t:\tT;\n\t}\n\n\treturn input;\n}\n\n/**\n * * Parse an object of stringified values into their appropriate primitive types.\n *\n * @description\n * - Attempts to convert string values into `boolean`, `number`, or JSON-parsed objects/arrays.\n * - Non-string values except arrays/objects are left unchanged. Nested arrays/objects are parsed recursively.\n *\n * @param object - The object with potentially stringified primitive values.\n * @param parseNested - Whether to convert stringified primitives in nested arrays/objects. (default: `true`).\n * @returns A new object with parsed values converted to their original types.\n */\nexport function parseObjectValues<T extends GenericObject>(\n\tobject: T,\n\tparseNested = true,\n): { [K in keyof T]: Any } {\n\tfunction _deepParseValues(data: unknown): unknown {\n\t\tif (Array.isArray(data)) {\n\t\t\treturn data?.map(_deepParseValues);\n\t\t} else if (isNotEmptyObject(data)) {\n\t\t\tconst result: Record<string, unknown> = {};\n\n\t\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\t\tresult[key] = parseNested ? _deepParseValues(value) : value;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t} else if (isString(data)) {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(data);\n\n\t\t\t\treturn _deepParseValues(parsed);\n\t\t\t} catch {\n\t\t\t\tif (data === 'true') return true;\n\t\t\t\telse if (data === 'false') {\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (data === 'null') {\n\t\t\t\t\treturn null;\n\t\t\t\t} else if (data === 'undefined') {\n\t\t\t\t\treturn undefined;\n\t\t\t\t} else if (!isNaN(Number(data))) {\n\t\t\t\t\treturn Number(data);\n\t\t\t\t} else return data;\n\t\t\t}\n\t\t}\n\t\treturn data;\n\t}\n\n\tconst parsedBody: GenericObject = {};\n\n\tif (isNotEmptyObject(object)) {\n\t\tObject.entries(object)?.forEach(([key, value]) => {\n\t\t\tparsedBody[key] = _deepParseValues(value);\n\t\t});\n\t}\n\n\treturn parsedBody as { [K in keyof T]: Any };\n}\n","import {\n\tisEmptyObject,\n\tisNotEmptyObject,\n\tisObject,\n} from '../guards/non-primitives';\nimport type { Any, FlattenPartial } from '../types';\nimport { isDeepEqual } from '../utils';\nimport { parseObjectValues } from './sanitize';\nimport type { GenericObject } from './types';\n\n/**\n * * Deeply merge two or more objects using `Map`.\n *\n * @param objects Objects to merge.\n * @returns Merged object.\n */\nexport const mergeObjects = <T extends GenericObject>(...objects: T[]): T => {\n\tconst map = new Map<string, Any>();\n\n\tobjects?.forEach((obj) => {\n\t\tfor (const key in obj) {\n\t\t\tconst existingValue = map.get(key);\n\n\t\t\tif ((obj[key] as T) instanceof Object && !Array.isArray(obj[key])) {\n\t\t\t\t// If the key already exists in the map and both are objects, merge them\n\t\t\t\tif (\n\t\t\t\t\texistingValue &&\n\t\t\t\t\texistingValue instanceof Object &&\n\t\t\t\t\t!Array.isArray(existingValue)\n\t\t\t\t) {\n\t\t\t\t\tmap.set(\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tmergeObjects(\n\t\t\t\t\t\t\texistingValue as GenericObject,\n\t\t\t\t\t\t\tobj[key] as GenericObject,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise, just set the value\n\t\t\t\t\tmap.set(key, obj[key]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If it's not an object, just set the value\n\t\t\t\tmap.set(key, obj[key]);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst result = {} as T;\n\n\tmap?.forEach((value, key) => {\n\t\tresult[key as keyof T] = value as T[keyof T];\n\t});\n\n\treturn result;\n};\n\n/**\n * * Deeply merge objects and flatten nested objects.\n * * Useful for flattening a single object or merging multiple objects with duplicate key(s).\n * * If keys are duplicated, the last object's value will be used.\n *\n * @param objects Objects to merge.\n * @returns Merged object with flattened structure.\n */\nexport const mergeAndFlattenObjects = <T extends GenericObject>(\n\t...objects: T[]\n): GenericObject => {\n\tconst map = new Map<string, unknown>();\n\n\tconst _flattenObject = (obj: GenericObject, parentKey: keyof T = '') => {\n\t\tfor (const key in obj) {\n\t\t\tconst newKey = parentKey ? `${String(parentKey)}.${key}` : key;\n\t\t\tif (obj[key] instanceof Object && !Array.isArray(obj[key])) {\n\t\t\t\t// Recursively flatten nested objects\n\t\t\t\t_flattenObject(obj[key] as GenericObject, newKey);\n\t\t\t} else {\n\t\t\t\t// Set the flattened key\n\t\t\t\tmap.set(newKey, obj[key]);\n\t\t\t}\n\t\t}\n\t};\n\n\tobjects?.forEach((obj) => _flattenObject(obj));\n\n\tconst result = {} as T;\n\n\tmap?.forEach((value, key) => {\n\t\tresult[key as keyof T] = value as T[keyof T];\n\t});\n\n\treturn result;\n};\n\n/**\n * * Flattens a nested object into key-value format.\n *\n * @param object - The `object` to flatten.\n * @returns A `flattened object` in key-value format.\n */\nexport const flattenObjectKeyValue = <T extends GenericObject>(\n\tobject: T,\n): T => {\n\tconst flattened: GenericObject = {};\n\n\tfor (const [key, value] of Object.entries(object)) {\n\t\tif (\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t!Array.isArray(value)\n\t\t) {\n\t\t\t// Recursively flatten nested objects\n\t\t\tconst nestedFlattened = flattenObjectKeyValue(value);\n\t\t\tObject.assign(flattened, nestedFlattened);\n\t\t} else {\n\t\t\t// Directly assign non-object values\n\t\t\tflattened[key] = value;\n\t\t}\n\t}\n\n\treturn flattened as T;\n};\n\n/**\n * * Flattens a nested object into a dot notation format.\n *\n * @param object - The `object` to flatten.\n * @returns A `flattened object` with dot notation keys.\n */\nexport const flattenObjectDotNotation = <T extends GenericObject>(\n\tobject: T,\n): GenericObject => {\n\t/**\n\t * * Recursively flattens an object, transforming nested structures into dot-notation keys.\n\t *\n\t * @param source - The `object` to be flattened.\n\t * @param prefix - The prefix to prepend to each key. Used for nested objects.\n\t * @returns A flattened version of the input object.\n\t */\n\tconst _flattenObject = (source: T, prefix: keyof T = ''): GenericObject => {\n\t\tconst flattened: GenericObject = {};\n\n\t\tfor (const [key, value] of Object.entries(source)) {\n\t\t\t// Construct the dot-notation key\n\t\t\tconst newKey = prefix ? `${String(prefix)}.${key}` : key;\n\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\ttypeof value === 'object' &&\n\t\t\t\t!Array.isArray(value) &&\n\t\t\t\tvalue !== null\n\t\t\t) {\n\t\t\t\t// Recursively process nested objects\n\t\t\t\tObject.assign(flattened, _flattenObject(value as T, newKey));\n\t\t\t} else {\n\t\t\t\t// Directly assign non-object values\n\t\t\t\tflattened[newKey] = value;\n\t\t\t}\n\t\t}\n\n\t\treturn flattened;\n\t};\n\n\t// Call the recursive function with an empty prefix initially\n\treturn _flattenObject(object);\n};\n\n/**\n * * Extracts only the fields that have changed between the original and updated object.\n *\n * @param baseObject The original object to compare against.\n * @param updatedObject The modified object containing potential updates.\n * @returns A new object containing only the changed fields.\n */\nexport const extractUpdatedFields = <T extends GenericObject>(\n\tbaseObject: T,\n\tupdatedObject: FlattenPartial<T>,\n): FlattenPartial<T> => {\n\tconst updatedFields: FlattenPartial<T> = {};\n\n\tfor (const key in updatedObject) {\n\t\tif (\n\t\t\tkey in baseObject &&\n\t\t\t!isDeepEqual(updatedObject[key], baseObject[key])\n\t\t) {\n\t\t\tif (updatedObject[key] && isNotEmptyObject(updatedObject[key])) {\n\t\t\t\tupdatedFields[key] = extractUpdatedFields(\n\t\t\t\t\tbaseObject[key],\n\t\t\t\t\tupdatedObject[key] as FlattenPartial<T>,\n\t\t\t\t) as T[keyof T];\n\n\t\t\t\tif (updatedFields[key] && isEmptyObject(updatedFields[key])) {\n\t\t\t\t\tdelete updatedFields[key];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tupdatedFields[key] = updatedObject[key];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn updatedFields;\n};\n\n/**\n * * Extracts only new fields that exist in updatedObject but not in baseObject.\n *\n * @param baseObject The original object to compare against.\n * @param updatedObject The modified object containing potential new fields.\n * @returns A new object containing only the new fields.\n */\nexport const extractNewFields = <\n\tT extends GenericObject,\n\tU extends GenericObject,\n>(\n\tbaseObject: T,\n\tupdatedObject: FlattenPartial<T> & FlattenPartial<U>,\n): FlattenPartial<U> => {\n\tconst newFields: FlattenPartial<U> = {};\n\n\tfor (const key in updatedObject) {\n\t\tif (!(key in baseObject)) {\n\t\t\t// Directly assign new fields\n\t\t\tnewFields[key as keyof FlattenPartial<U>] = updatedObject[key];\n\t\t} else if (\n\t\t\tisNotEmptyObject(updatedObject[key]) &&\n\t\t\tisNotEmptyObject(baseObject[key])\n\t\t) {\n\t\t\t// Recursively extract new fields inside nested objects\n\t\t\tconst nestedNewFields = extractNewFields(\n\t\t\t\tbaseObject[key] as T,\n\t\t\t\tupdatedObject[key] as FlattenPartial<T> & FlattenPartial<U>,\n\t\t\t);\n\n\t\t\tif (isNotEmptyObject(nestedNewFields)) {\n\t\t\t\tnewFields[key as keyof FlattenPartial<U>] =\n\t\t\t\t\tnestedNewFields as T[keyof T];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newFields;\n};\n\n/**\n * * Extracts changed fields from the updated object while also identifying newly added keys.\n *\n * @param baseObject The original object to compare against.\n * @param updatedObject The modified object containing potential updates.\n * @returns An object containing modified fields and new fields separately.\n */\nexport const extractUpdatedAndNewFields = <\n\tT extends GenericObject,\n\tU extends GenericObject,\n>(\n\tbaseObject: T,\n\tupdatedObject: FlattenPartial<T> & FlattenPartial<U>,\n): FlattenPartial<T> & FlattenPartial<U> => {\n\tconst updatedFields: FlattenPartial<T> = {};\n\tconst newFields: FlattenPartial<U> = {};\n\n\tfor (const key in updatedObject) {\n\t\tif (!(key in baseObject)) {\n\t\t\tnewFields[key as keyof FlattenPartial<U>] = updatedObject[key];\n\t\t} else if (!isDeepEqual(updatedObject[key], baseObject[key])) {\n\t\t\tif (updatedObject[key] && isNotEmptyObject(updatedObject[key])) {\n\t\t\t\tupdatedFields[key as keyof T] = extractUpdatedAndNewFields(\n\t\t\t\t\tbaseObject[key] as T,\n\t\t\t\t\tupdatedObject[key],\n\t\t\t\t) as T[keyof T];\n\n\t\t\t\tif (updatedFields[key] && isEmptyObject(updatedFields[key])) {\n\t\t\t\t\tdelete updatedFields[key];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tupdatedFields[key as keyof T] = updatedObject[key];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { ...updatedFields, ...newFields };\n};\n\n/**\n * * Safely parses a JSON string into an object.\n * * Optionally converts stringified primitive values inside the object (e.g., `\"0\"` → `0`, `\"true\"` → `true`, `\"null\"` → `null`).\n *\n * @param value - The JSON string to parse.\n * @param parsePrimitives - Whether to convert stringified primitives into real values (default: `true`).\n * @returns A parsed object with primitive conversions, or an empty object on failure or if the root is not a valid object.\n * - Returns `{}` if parsing fails, such as when the input is malformed or invalid JSON or passing single quoted string.\n *\n * - **N.B.** This function will return an empty object if the JSON string is invalid or if the root element is not an object.\n *\n * - *Unlike `parseJSON`, which returns any valid JSON structure (including arrays, strings, numbers, etc.),\n * this function strictly ensures that the result is an object and optionally transforms stringified primitives.*\n *\n * @see parseJSON - For parsing generic JSON values (arrays, numbers, etc.) with optional primitive transformation.\n *\n */\nexport const parseJsonToObject = <T extends GenericObject = GenericObject>(\n\tvalue: string,\n\tparsePrimitives = true,\n): T => {\n\ttry {\n\t\tconst data = JSON.parse(value) as T;\n\n\t\tif (!isObject(data)) {\n\t\t\treturn {} as T;\n\t\t}\n\n\t\treturn parsePrimitives ? parseObjectValues<T>(data) : data;\n\t} catch {\n\t\treturn {} as T;\n\t}\n};\n","import { flattenObjectKeyValue } from '../object/objectify';\nimport { parseObjectValues } from '../object/sanitize';\nimport type { QueryObject, StrictObject } from '../object/types';\nimport type { QueryString } from '../string/types';\nimport { deepParsePrimitives } from '../utils';\n\n/**\n * * Utility to generate query parameters from an object.\n *\n * @param params - Object containing query parameters.\n * @returns A query string as a URL-encoded string, e.g., `?key1=value1&key2=value2`.\n *\n * @example\n * generateQueryParams({ key1: 'value1', key2: 42 }); // \"?key1=value1&key2=42\"\n * generateQueryParams({ key1: ['value1', 'value2'], key2: 42 }); // \"?key1=value1&key1=value2&key2=42\"\n * generateQueryParams({ key1: '', key2: null }); // \"\"\n * generateQueryParams({ key1: true, key2: false }); // \"?key1=true&key2=false\"\n * generateQueryParams({ filters: { category: 'laptop', price: 1000 } }); // \"?category=laptop&price=1000\"\n */\nexport const generateQueryParams = <T extends QueryObject>(\n\tparams: T = {} as T,\n): QueryString => {\n\t// Flatten the nested object into key-value pairs\n\tconst flattenedParams = flattenObjectKeyValue(params);\n\n\t// Generate the query string\n\tconst queryParams = Object.entries(flattenedParams)\n\t\t?.filter(\n\t\t\t([_, value]) =>\n\t\t\t\tvalue !== undefined &&\n\t\t\t\tvalue !== null &&\n\t\t\t\t!(typeof value === 'string' && value?.trim() === ''),\n\t\t)\n\t\t?.flatMap(([key, value]) =>\n\t\t\tArray.isArray(value) ?\n\t\t\t\tvalue\n\t\t\t\t\t?.filter(\n\t\t\t\t\t\t(v) =>\n\t\t\t\t\t\t\tv !== undefined &&\n\t\t\t\t\t\t\tv !== null &&\n\t\t\t\t\t\t\t!(typeof v === 'string' && v.trim() === ''),\n\t\t\t\t\t)\n\t\t\t\t\t?.map(\n\t\t\t\t\t\t(v) =>\n\t\t\t\t\t\t\t`${encodeURIComponent(key)}=${encodeURIComponent(\n\t\t\t\t\t\t\t\ttypeof v === 'boolean' ? String(v) : String(v),\n\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t)\n\t\t\t:\t`${encodeURIComponent(key)}=${encodeURIComponent(\n\t\t\t\t\ttypeof value === 'boolean' ? String(value) : String(value),\n\t\t\t\t)}`,\n\t\t)\n\t\t.join('&');\n\n\treturn queryParams ? `?${queryParams}` : '';\n};\n\n/**\n * * Get query params as standard `JavaScript` Object `Record<string, string>`.\n *\n * - **Note:** *Extracts query parameters from the current URL (window.location.search).*\n *\n * @returns Query string as key-value paired object. `Record<string, string>`.\n */\nexport function getQueryParams(): Record<string, string> {\n\treturn Object.fromEntries(new URLSearchParams(window?.location?.search));\n}\n\n/**\n * * Update query params in the browser URL with given key and value.\n * @param key Key for the query to update.\n * @param value Value to updated against the given key.\n */\nexport function updateQueryParam(key: string, value: string) {\n\tconst url = new URL(window.location.href);\n\turl.searchParams.set(key, value);\n\twindow.history.replaceState({}, '', url?.toString());\n}\n\n/**\n * Parses a query string (with optional `?` prefix) into an object.\n * Supports multiple values for the same key by returning arrays.\n * Optionally parses primitive string values into actual types (e.g., \"1\" → 1, \"true\" → true).\n *\n * - **Note:** *This function does **not** access or depend on `current URL` a.k.a `window.location.search`.*\n *\n * @param query - The query string to parse.\n * @param parsePrimitives - Whether to convert stringified primitives into real values (default: true).\n * @returns An object where keys are strings and values can be string, array, number, boolean, or null.\n */\nexport const parseQueryString = (\n\tquery: string,\n\tparsePrimitives = true,\n): StrictObject => {\n\tconst params = new URLSearchParams(\n\t\tquery.startsWith('?') ? query.slice(1) : query,\n\t);\n\n\tconst entries: StrictObject = {};\n\n\tfor (const [key, value] of params.entries()) {\n\t\tif (key in entries) {\n\t\t\tconst current = entries[key];\n\n\t\t\tconst array =\n\t\t\t\tArray.isArray(current) ? [...current, value] : [current, value];\n\n\t\t\tentries[key] = parsePrimitives ? deepParsePrimitives(array) : array;\n\t\t} else {\n\t\t\tentries[key] = value;\n\t\t}\n\t}\n\n\treturn parsePrimitives ? parseObjectValues(entries) : entries;\n};\n","import { generateQueryParams } from '../dom/query';\nimport { parseObjectValues } from '../object/sanitize';\nimport type { ParsedFormData, SerializedForm } from './types';\n\n/**\n * * Serialize form data into an object or a query string.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n *\n * @param form - The form element to serialize.\n * @param toQueryString - Whether to return the result as a query string. If false, returns an object.\n * @returns The serialized form data as an object or query string.\n */\nexport function serializeForm<T extends boolean = false>(\n\tform: HTMLFormElement,\n\ttoQueryString: T = false as T,\n): SerializedForm<T> {\n\tconst formData = new FormData(form);\n\tconst data: Record<string, string | string[]> = {};\n\n\tformData?.forEach((value, key) => {\n\t\t// If the key already exists, we make it an array to handle multiple selections\n\t\tif (data[key]) {\n\t\t\tdata[key] =\n\t\t\t\tArray.isArray(data[key]) ?\n\t\t\t\t\t[...data[key], value.toString()]\n\t\t\t\t:\t[data[key], value.toString()];\n\t\t} else {\n\t\t\tdata[key] = value.toString();\n\t\t}\n\t});\n\n\tif (toQueryString) {\n\t\tconst queryString = generateQueryParams(data);\n\t\treturn queryString as SerializedForm<T>;\n\t}\n\n\treturn data as SerializedForm<T>;\n}\n\n/**\n * * Parse form data from a `FormData` object or query string into a structured object format.\n *\n * @param data - The `FormData` object or query string to parse.\n * @param parsePrimitives - Whether to parse string values into primitive types (e.g., boolean, number, array, object). Defaults to `true`.\n * @returns The parsed form data as an object.\n */\nexport function parseFormData<T extends FormData | string>(\n\tdata: T,\n\tparsePrimitives = true,\n): ParsedFormData<T> {\n\tconst parsed: Record<string, unknown> = {};\n\n\tif (typeof data === 'string') {\n\t\tconst params = new URLSearchParams(data);\n\n\t\tparams?.forEach((value, key) => {\n\t\t\tconst existing = parsed[key];\n\n\t\t\tif (typeof existing === 'string') {\n\t\t\t\tparsed[key] = [existing, value];\n\t\t\t} else if (Array.isArray(existing)) {\n\t\t\t\tparsed[key] = [...existing, value];\n\t\t\t} else {\n\t\t\t\tparsed[key] = value;\n\t\t\t}\n\t\t});\n\t} else {\n\t\tdata?.forEach((value, key) => {\n\t\t\tconst existing = parsed[key];\n\n\t\t\tif (value instanceof File) {\n\t\t\t\tif (Array.isArray(existing)) {\n\t\t\t\t\tparsed[key] = [...existing, value];\n\t\t\t\t} else if (existing instanceof File) {\n\t\t\t\t\tparsed[key] = [existing, value];\n\t\t\t\t} else {\n\t\t\t\t\tparsed[key] = value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (typeof existing === 'string') {\n\t\t\t\t\tparsed[key] = [existing, value];\n\t\t\t\t} else if (Array.isArray(existing)) {\n\t\t\t\t\tparsed[key] = [...existing, value];\n\t\t\t\t} else {\n\t\t\t\t\tparsed[key] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tif (parsePrimitives) {\n\t\treturn parseObjectValues(parsed) as ParsedFormData<T>;\n\t} else {\n\t\treturn parsed as ParsedFormData<T>;\n\t}\n}\n","import type { GenericObject } from './types';\n\n/**\n * * Deep clone an object.\n *\n * @param obj Object to clone.\n * @returns Deep cloned object.\n */\nexport const cloneObject = <T extends GenericObject>(obj: T): T => {\n\treturn JSON.parse(JSON.stringify(obj));\n};\n\n/**\n * * Count the number of fields in an object.\n *\n * @param obj Object to check.\n * @returns Number of fields in the object.\n */\nexport const countObjectFields = <T extends GenericObject>(obj: T): number => {\n\tif (obj != null) return Object.keys(obj)?.length;\n\n\treturn 0;\n};\n","import type { Any } from '../types';\nimport type {\n\tDotNotationKey,\n\tGenericObject,\n\tNumberified,\n\tStringified,\n} from './types';\n\n/**\n * * Converts the values of specified keys in an object to numbers.\n * * Supports nested objects using dot-notation keys.\n *\n * @param data The object to convert.\n * @param options Options object specifying the conversion mapping.\n * - `keys`: The keys in the objects to be converted (dot-notation supported).\n * - `convertTo`: The target type, either `\"string\"` or `\"number\"`.\n * @returns The modified object with the converted values as `\"string\"` or `\"number\"`.\n */\nexport function convertObjectValues<\n\tT extends GenericObject,\n\tC extends 'string' | 'number',\n>(\n\tdata: T,\n\toptions: { keys: DotNotationKey<T>[]; convertTo: C },\n): C extends 'string' ? Stringified<T>\n: C extends 'number' ? Numberified<T>\n: never;\n\n/**\n * * Converts the values of specified keys in an array of objects to numbers or strings.\n * * Supports nested objects using dot-notation keys.\n *\n * @param data The array of objects to convert.\n * @param options Options object specifying the conversion mapping.\n * - `keys`: The keys in the objects to be converted (dot-notation supported).\n * - `convertTo`: The target type, either `\"string\"` or `\"number\"`.\n * @returns The modified array of objects with the converted values as `\"string\"` or `\"number\"`.\n */\nexport function convertObjectValues<\n\tT extends GenericObject,\n\tC extends 'string' | 'number',\n>(\n\tdata: T[],\n\toptions: { keys: DotNotationKey<T>[]; convertTo: C },\n): C extends 'string' ? Stringified<T>[]\n: C extends 'number' ? Numberified<T>[]\n: never;\n\n/**\n * * Converts the values of specified keys in an object or array of objects to either string or number.\n * * Supports nested objects using dot-notation keys.\n *\n * @param data The object or array of objects to convert.\n * @param options Options object specifying the conversion mapping.\n * - `keys`: The keys in the object to be converted (dot-notation supported).\n * - `convertTo`: The target type, either \"string\" or \"number\".\n * @returns The modified object or array of objects with the converted values, with updated types.\n */\nexport function convertObjectValues<\n\tT extends GenericObject,\n\tC extends 'string' | 'number',\n>(\n\tdata: T | T[],\n\toptions: { keys: DotNotationKey<T>[]; convertTo: C },\n): C extends 'string' ? Stringified<T> | Stringified<T>[]\n: C extends 'number' ? Numberified<T> | Numberified<T>[]\n: never {\n\tconst { keys, convertTo } = options;\n\n\t/** * Helper function to determine if value should be preserved. */\n\tconst _shouldPreserveValue = (value: unknown): boolean =>\n\t\tconvertTo === 'number' &&\n\t\t(typeof value !== 'string' || isNaN(Number(value)));\n\n\t/** * Helper function to resolve a dot-notation key path and modify the corresponding value in the object. */\n\tconst _setValueAtPath = (\n\t\tobj: T,\n\t\tpath: string,\n\t\tconvertTo: 'string' | 'number',\n\t): T => {\n\t\tconst segments = path.split('.');\n\n\t\tlet current: Any = obj;\n\n\t\tsegments?.forEach((key, index) => {\n\t\t\tif (index === segments?.length - 1) {\n\t\t\t\tconst value = current[key];\n\n\t\t\t\tif (_shouldPreserveValue(value)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (convertTo === 'string' && typeof value !== 'string') {\n\t\t\t\t\tcurrent[key] = String(value);\n\t\t\t\t} else if (\n\t\t\t\t\tconvertTo === 'number' &&\n\t\t\t\t\ttypeof value !== 'number' &&\n\t\t\t\t\t!isNaN(Number(value))\n\t\t\t\t) {\n\t\t\t\t\tcurrent[key] = Number(value);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (typeof current[key] === 'object' && current[key] !== null) {\n\t\t\t\t\tcurrent = current[key];\n\t\t\t\t} else {\n\t\t\t\t\tcurrent[key] = {};\n\t\t\t\t\tcurrent = current[key];\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn obj;\n\t};\n\n\t/** * Recursively process a single object. */\n\tconst _convertValue = (obj: T): T => {\n\t\tlet newObj = structuredClone(obj);\n\n\t\tkeys?.forEach((key) => {\n\t\t\tnewObj = _setValueAtPath(newObj, key, convertTo);\n\t\t});\n\n\t\treturn newObj;\n\t};\n\n\tif (Array.isArray(data)) {\n\t\treturn data?.map((d) => _convertValue(d)) as C extends 'string' ?\n\t\t\tStringified<T>[]\n\t\t: C extends 'number' ? Numberified<T>[]\n\t\t: never;\n\t}\n\n\treturn _convertValue(data) as C extends 'string' ?\n\t\tStringified<T> | Stringified<T>[]\n\t: C extends 'number' ? Numberified<T> | Numberified<T>[]\n\t: never;\n}\n\n/**\n * * Pick specific fields from an object and create a new object with specified fields.\n *\n * @description This function creates a new object containing only the specified fields from the source object.\n * It is useful for creating a new object with a subset of properties from an existing object.\n *\n * @param T The type of the source object.\n * @param U The type of the keys to pick from the source object.\n *\n * @param source The source object from which to pick fields.\n * @param keys\tThe keys of the fields to pick from the source object.\n *\n * @returns An object containing only the picked fields.\n */\nexport function pickFields<T extends GenericObject, U extends keyof T>(\n\tsource: T,\n\tkeys: U[],\n): { [K in U]: T[K] } {\n\tconst result = {} as { [K in U]: T[K] };\n\n\tkeys?.forEach((key) => {\n\t\tresult[key] = source[key];\n\t});\n\n\treturn result;\n}\n\n/**\n * * Pick specific fields from an object based on a given condition.\n *\n * @description This function creates a new object containing only the fields that satisfy the given condition.\n * The condition can be based on the field's value or type, depending on the implementation.\n *\n * @param T The type of the source object.\n *\n * @param source The source object from which to pick fields.\n * @param condition A function that takes the key and value of a property and returns a boolean indicating whether the property should be picked.\n *\n * @returns An object containing only the fields that satisfy the condition.\n */\nexport function pickObjectFieldsByCondition<T extends GenericObject>(\n\tsource: T,\n\tcondition: (key: keyof T, value: T[keyof T]) => boolean,\n): Partial<T> {\n\tconst result: Partial<T> = {};\n\n\tObject.entries(source)?.forEach(([key, value]) => {\n\t\tif (condition(key as keyof T, value)) {\n\t\t\tresult[key as keyof T] = value;\n\t\t}\n\t});\n\n\treturn result;\n}\n\n/**\n * * Remap fields from one object to another.\n * @description This function creates a new object with fields remapped from the source object to the target object based on the provided field map.\n *\n * @param source The source object from which to remap fields.\n * @param fieldMap An object that maps target keys to source keys.\n * @returns An object with fields remapped according to the field map.\n */\nexport function remapFields<\n\tSource extends GenericObject,\n\tTarget extends Record<string, keyof Source>,\n>(\n\tsource: Source,\n\tfieldMap: Target,\n): {\n\t[K in keyof Target]: Source[Target[K]];\n} {\n\tconst result = {} as {\n\t\t[K in keyof Target]: Source[Target[K]];\n\t};\n\n\tfor (const targetKey in fieldMap) {\n\t\tconst sourceKey = fieldMap[targetKey];\n\t\tresult[targetKey] = source[sourceKey];\n\t}\n\n\treturn result;\n}\n","/**\n * * Scrolls smoothly to the given element with an optional vertical offset.\n * @param element The target element to scroll to.\n * @param offset Additional vertical offset in pixels (positive moves down, negative moves up).\n */\nexport function smoothScrollTo(element: HTMLElement, offset = 0) {\n\telement.scrollIntoView({ behavior: 'smooth', block: 'start' });\n\n\tif (offset !== 0) {\n\t\tsetTimeout(() => {\n\t\t\twindow.scrollBy({ top: offset, behavior: 'smooth' });\n\t\t}, 300); // Delay to ensure smooth scrolling effect\n\t}\n}\n\n/**\n * * Toggles full-screen mode for a given element (or the `document` by default).\n * @param element The element to toggle fullscreen mode for (default: document root).\n */\nexport function toggleFullScreen(element = document.documentElement) {\n\tconst doc = document as Document & {\n\t\twebkitFullscreenElement?: Element | null;\n\t\twebkitExitFullscreen?: () => Promise<void>;\n\t};\n\n\tconst elem = element as HTMLElement & {\n\t\twebkitRequestFullscreen?: () => Promise<void>;\n\t};\n\n\tif (!doc.fullscreenElement && !doc.webkitFullscreenElement) {\n\t\tif (elem.requestFullscreen) {\n\t\t\telem.requestFullscreen();\n\t\t} else if (elem.webkitRequestFullscreen) {\n\t\t\telem.webkitRequestFullscreen();\n\t\t}\n\t} else {\n\t\tif (doc.exitFullscreen) {\n\t\t\tdoc.exitFullscreen();\n\t\t} else if (doc.webkitExitFullscreen) {\n\t\t\tdoc.webkitExitFullscreen();\n\t\t}\n\t}\n}\n\n/**\n * * Copies text to the clipboard, falling back to legacy methods if needed.\n * @param text - The text to copy.\n * @returns A promise that resolves when the text is copied.\n */\nexport async function copyToClipboard(text: string): Promise<void> {\n\ttry {\n\t\tif (navigator?.clipboard?.writeText) {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t} else {\n\t\t\tconst textArea = document.createElement('textarea');\n\n\t\t\ttextArea.value = text;\n\t\t\ttextArea.style.position = 'fixed';\n\t\t\ttextArea.style.opacity = '0';\n\t\t\tdocument.body.appendChild(textArea);\n\n\t\t\ttextArea.select();\n\t\t\ttextArea.setSelectionRange(0, textArea.value?.length);\n\n\t\t\tconst success = document.execCommand('copy');\n\n\t\t\tdocument.body.removeChild(textArea);\n\n\t\t\tif (!success) {\n\t\t\t\tthrow new Error('Cannot execute command in this environment!');\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\tconsole.error('Failed to copy text:', error);\n\t\tthrow error;\n\t} finally {\n\t\tconst textArea = document.querySelector('textarea[style*=\"fixed\"]');\n\n\t\tif (textArea) {\n\t\t\tdocument.body.removeChild(textArea);\n\t\t}\n\t}\n}\n","// * ****************** Local Storage ****************** * //\n\n/**\n * * Get item(s) from local storage.\n *\n * @param key - Key to get item(s) from local storage.\n * @returns Returns saved item(s) from local storage if it exists with that key.\n */\nexport const getFromLocalStorage = <T>(key: string): T | null => {\n\tconst item = localStorage.getItem(key);\n\n\tif (!item) return null;\n\n\treturn JSON.parse(item) as T;\n};\n\n/**\n * * Save item(s) in local storage.\n *\n * @param key - Key to save an item(s).\n * @param value - The item(s)/value to save.\n */\nexport const saveToLocalStorage = <T>(key: string, value: T): void => {\n\tlocalStorage.setItem(key, JSON.stringify(value));\n};\n\n/**\n * * Remove item(s) from local storage.\n *\n * @param key - Key to delete item(s) from local storage.\n */\nexport const removeFromLocalStorage = (key: string): void => {\n\tlocalStorage.removeItem(key);\n};\n\n// * ****************** Session Storage ****************** * //\n\n/**\n * * Get item(s) from session storage.\n *\n * @param key - Key to get item(s) from session storage.\n * @returns Returns saved item(s) from session storage if it exists with that key.\n */\nexport const getFromSessionStorage = <T>(key: string): T | null => {\n\tconst item = sessionStorage.getItem(key);\n\n\tif (!item) return null;\n\n\treturn JSON.parse(item) as T;\n};\n\n/**\n * * Save item(s) in session storage.\n *\n * @param key - Key to save an item(s).\n * @param value - The item(s)/value to save.\n */\nexport const saveToSessionStorage = <T>(key: string, value: T): void => {\n\tsessionStorage.setItem(key, JSON.stringify(value));\n};\n\n/**\n * * Remove item(s) from session storage.\n *\n * @param key - Key to delete item(s) from session storage.\n */\nexport const removeFromSessionStorage = (key: string): void => {\n\tsessionStorage.removeItem(key);\n};\n","import type {\n\tFromMetaOptions,\n\tPageListOptions,\n\tPaginatorMeta,\n\tPaginatorOptions,\n} from './types';\n\n/** * Generates pagination logic, offsets, metadata and other pagination logic(s) for APIs and UIs. */\nexport class Paginator {\n\treadonly #totalItems: number;\n\treadonly #perPage: number;\n\treadonly #currentPage: number;\n\n\t/**\n\t * * Creates an instance of the Paginator.\n\t * @param options - The options for pagination.\n\t */\n\tconstructor(options: PaginatorOptions) {\n\t\tconst {\n\t\t\ttotalItems,\n\t\t\titemsPerPage = 10,\n\t\t\tcurrentPage = 1,\n\t\t} = options ?? {};\n\n\t\tthis.#totalItems = Math.max(0, Number(totalItems));\n\t\tthis.#perPage = Math.max(1, Number(itemsPerPage));\n\t\tthis.#currentPage = Math.max(1, Number(currentPage));\n\t}\n\n\t/**\n\t * @instance Returns a new Paginator instance with the given page number.\n\t * * This method does not modify the current instance.\n\t * - **N.B.** *If the provided page is out of range, it will be clamped between 1 and the last page.*\n\t * @param page - The new current page to use.\n\t * @returns A new Paginator instance with the updated (clamped) page.\n\t */\n\twithPage(page: number): Paginator {\n\t\tconst safePage = Math.min(Math.max(1, page), this.totalPages());\n\n\t\treturn new Paginator({\n\t\t\ttotalItems: this.#totalItems,\n\t\t\titemsPerPage: this.#perPage,\n\t\t\tcurrentPage: safePage,\n\t\t});\n\t}\n\n\t/**\n\t * @instance Returns a new Paginator instance with the given items per page.\n\t * - **N.B.** *If the value is less than `1`, it will be clamped to 1.*\n\t * @param perPage - New items per page value.\n\t * @returns A new Paginator instance with updated items per page.\n\t */\n\twithPerPage(perPage: number): Paginator {\n\t\tconst safePerPage = Math.max(1, perPage);\n\t\treturn new Paginator({\n\t\t\ttotalItems: this.#totalItems,\n\t\t\titemsPerPage: safePerPage,\n\t\t\tcurrentPage: this.#currentPage,\n\t\t});\n\t}\n\n\t/**\n\t * @instance Returns a new Paginator instance with the given total items.\n\t * - **N.B.** *If the value is `negative`, it will be clamped to `0`.*\n\t * @param totalItems - New total items value.\n\t * @returns A new Paginator instance with updated total items.\n\t */\n\twithTotalItems(totalItems: number): Paginator {\n\t\tconst safeTotalItems = Math.max(0, totalItems);\n\t\treturn new Paginator({\n\t\t\ttotalItems: safeTotalItems,\n\t\t\titemsPerPage: this.#perPage,\n\t\t\tcurrentPage: this.#currentPage,\n\t\t});\n\t}\n\n\t/**\n\t * @instance Returns a new Paginator instance with updated pagination options.\n\t * - **N.B.** *Any value provided will override the existing one, with clamping applied for safety.*\n\t * @param options - Partial pagination options to override the current instance.\n\t * @returns A new Paginator instance with merged and clamped options.\n\t */\n\twithOptions(options: Partial<PaginatorOptions>): Paginator {\n\t\tconst newTotalItems = Math.max(\n\t\t\t0,\n\t\t\toptions.totalItems ? Number(options.totalItems) : this.#totalItems,\n\t\t);\n\t\tconst newItemsPerPage = Math.max(\n\t\t\t1,\n\t\t\toptions.itemsPerPage ? Number(options.itemsPerPage) : this.#perPage,\n\t\t);\n\t\tconst totalPages = Math.ceil(newTotalItems / newItemsPerPage);\n\t\tconst newCurrentPage = Math.min(\n\t\t\tMath.max(\n\t\t\t\t1,\n\t\t\t\toptions.currentPage ?\n\t\t\t\t\tNumber(options.currentPage)\n\t\t\t\t:\tthis.#currentPage,\n\t\t\t),\n\t\t\ttotalPages,\n\t\t);\n\n\t\treturn new Paginator({\n\t\t\ttotalItems: newTotalItems,\n\t\t\titemsPerPage: newItemsPerPage,\n\t\t\tcurrentPage: newCurrentPage,\n\t\t});\n\t}\n\n\t/**\n\t * @instance Calculates the offset (number of items to skip) based on the `current page` and `items per page`.\n\t * @returns The number of items to skip.\n\t */\n\toffset(): number {\n\t\treturn (this.#currentPage - 1) * this.#perPage;\n\t}\n\n\t/**\n\t * @instance Calculates the offset (number of items to skip) based on the `current page` and `items per page`.\n\t * @alias of {@link offset}\n\t * @returns The number of items to skip.\n\t */\n\tgetOffset(): number {\n\t\treturn this.offset();\n\t}\n\n\t/**\n\t * @instance Calculates the number of items to skip based on the `current page` and `items per page`.\n\t * @alias of {@link offset}\n\t * @returns The number of items to skip.\n\t */\n\tskipCount(): number {\n\t\treturn this.offset();\n\t}\n\n\t/**\n\t * @instance Calculates the total number of pages based on `total items` and `items per page`.\n\t * @returns The total number of pages.\n\t */\n\ttotalPages(): number {\n\t\treturn Math.ceil(this.#totalItems / this.#perPage);\n\t}\n\n\t/**\n\t * * Returns pagination metadata useful for API responses or UI rendering.\n\t * @returns An object with pagination metadata.\n\t */\n\tgetMeta(): PaginatorMeta {\n\t\tconst totalPages = this.totalPages();\n\t\treturn {\n\t\t\ttotalItems: this.#totalItems,\n\t\t\tcurrentPage: this.#currentPage,\n\t\t\titemsPerPage: this.#perPage,\n\t\t\ttotalPages,\n\t\t\thasPrev: this.hasPrevPage(),\n\t\t\thasNext: this.hasNextPage(),\n\t\t\tisFirst: this.isFirstPage(),\n\t\t\tisLast: this.isLastPage(),\n\t\t\toffset: this.offset(),\n\t\t};\n\t}\n\n\t/**\n\t * @instance Returns the next page number if it exists.\n\t * @returns The next page number or null if it's the last page.\n\t */\n\tnextPage(): number | null {\n\t\treturn this.#currentPage < this.totalPages() ?\n\t\t\t\tthis.#currentPage + 1\n\t\t\t:\tnull;\n\t}\n\n\t/**\n\t * @instance Returns the previous page number if it exists.\n\t * @returns The previous page number or null if it's the first page.\n\t */\n\tprevPage(): number | null {\n\t\treturn this.#currentPage > 1 ? this.#currentPage - 1 : null;\n\t}\n\n\t/**\n\t * @instance Checks if the current page is the first page.\n\t * @returns Whether the current page is the first page.\n\t */\n\tisFirstPage(): boolean {\n\t\treturn this.#currentPage === 1;\n\t}\n\n\t/**\n\t * @instance Checks if the current page is the last page.\n\t * @returns Whether the current page is the last page.\n\t */\n\tisLastPage(): boolean {\n\t\treturn this.#currentPage === this.totalPages();\n\t}\n\n\t/**\n\t * @instance Checks if a previous page exists.\n\t * @returns Whether a previous page exists.\n\t */\n\thasPrevPage(): boolean {\n\t\treturn this.#currentPage > 1;\n\t}\n\n\t/**\n\t * @instance Checks if a next page exists.\n\t * @returns Whether a next page exists.\n\t */\n\thasNextPage(): boolean {\n\t\treturn this.#currentPage < this.totalPages();\n\t}\n\n\t/**\n\t * @instance Creates an array of page numbers for UI pagination display.\n\t * @param options Options for customizing the page list.\n\t * @returns An array of visible page numbers.\n\t */\n\tpageList(options: PageListOptions = {}): number[] {\n\t\tconst total = this.totalPages();\n\t\tconst edgeCount = Math.max(0, options.edgeCount ?? 1);\n\t\tconst siblingCount = Math.max(0, options.siblingCount ?? 1);\n\t\tconst start = Math.max(this.#currentPage - siblingCount, edgeCount + 1);\n\t\tconst end = Math.min(\n\t\t\tthis.#currentPage + siblingCount,\n\t\t\ttotal - edgeCount,\n\t\t);\n\n\t\tconst _getRange = (from: number, to: number): number[] => {\n\t\t\treturn from > to ?\n\t\t\t\t\t[]\n\t\t\t\t:\tArray.from({ length: to - from + 1 }, (_, i) => from + i);\n\t\t};\n\n\t\tconst startPages = _getRange(1, edgeCount);\n\t\tconst middlePages = _getRange(start, end);\n\t\tconst endPages = _getRange(total - edgeCount + 1, total);\n\n\t\tconst pages = new Set<number>([\n\t\t\t...startPages,\n\t\t\t...middlePages,\n\t\t\t...endPages,\n\t\t]);\n\n\t\treturn Array.from(pages).sort((a, b) => a - b);\n\t}\n\n\t/**\n\t * @instance Returns the first page number.\n\t * @returns Always returns 1.\n\t */\n\tfirstPage(): number {\n\t\treturn 1;\n\t}\n\n\t/**\n\t * @instance Returns the last page number based on total items and per page count.\n\t * @returns The last page number.\n\t */\n\tlastPage(): number {\n\t\treturn this.totalPages();\n\t}\n\n\t/**\n\t * @instance Checks if a page number is valid within the pagination range.\n\t * @param page - The page number to validate.\n\t * @returns Whether the page number is within range.\n\t */\n\tisPageValid(page: number): boolean {\n\t\tconst p = Math.floor(page);\n\t\treturn p >= 1 && p <= this.totalPages();\n\t}\n\n\t/**\n\t * @static Creates a new Paginator instance from a meta object.\n\t * @param meta - A pagination metadata object.\n\t * @returns A new Paginator instance.\n\t */\n\tstatic fromMeta(meta: FromMetaOptions): Paginator {\n\t\treturn new Paginator({\n\t\t\ttotalItems: meta.totalItems,\n\t\t\titemsPerPage: meta.itemsPerPage,\n\t\t\tcurrentPage: meta.currentPage,\n\t\t});\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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;AAAA;AAAA,EAOA,OAAO,SAAS,MAAkC;AACjD,WAAO,IAAI,WAAU;AAAA,MACpB,YAAY,KAAK;AAAA,MACjB,cAAc,KAAK;AAAA,MACnB,aAAa,KAAK;AAAA,IACnB,CAAC;AAAA,EACF;AACD;","names":["_","isString","recentColors","rgb","hex","hsl","rgb","hsl","hex","chronos","convertTo"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/string/basics.ts","../src/string/anagram.ts","../src/string/constants.ts","../src/string/convert.ts","../src/string/guards.ts","../src/string/utilities.ts","../src/guards/primitives.ts","../src/number/constants.ts","../src/number/helpers.ts","../src/number/basics.ts","../src/number/utilities.ts","../src/number/Currency.ts","../src/number/Unit.ts","../src/number/guards.ts","../src/number/percent.ts","../src/number/fibonacci.ts","../src/number/convert.ts","../src/number/prime.ts","../src/array/basics.ts","../src/guards/non-primitives.ts","../src/array/utils.ts","../src/array/sort.ts","../src/guards/specials.ts","../src/utils/index.ts","../src/number/range.ts","../src/colors/constants.ts","../src/colors/helpers.ts","../src/colors/initials.ts","../src/colors/utils.ts","../src/colors/convert.ts","../src/colors/random.ts","../src/colors/css-colors.ts","../src/colors/Color.ts","../src/date/guards.ts","../src/date/utils.ts","../src/date/greet.ts","../src/date/constants.ts","../src/date/Chronos.ts","../src/date/chronos-fn.ts","../src/array/Finder.ts","../src/array/transform.ts","../src/form/guards.ts","../src/form/convert.ts","../src/object/sanitize.ts","../src/object/objectify.ts","../src/dom/query.ts","../src/form/transform.ts","../src/object/basics.ts","../src/object/convert.ts","../src/dom/utils.ts","../src/dom/storage.ts","../src/utils/Paginator.ts"],"sourcesContent":["/**\n * Copyright 2025 Nazmul Hassan\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// ! String Utilities\nexport {\n\tcapitalizeString,\n\tgenerateRandomID,\n\ttrimString,\n\ttruncateString,\n} from './string/basics';\n\nexport { generateAnagrams } from './string/anagram';\n\nexport {\n\tisCamelCase,\n\tisEmojiOnly,\n\tisKebabCase,\n\tisPalindrome,\n\tisPascalCase,\n\tisSnakeCase,\n} from './string/guards';\n\nexport {\n\tconvertStringCase,\n\textractEmails,\n\textractURLs,\n\tformatUnitWithPlural as formatNumberWithPluralUnit,\n\tformatUnitWithPlural,\n\tformatUnitWithPlural as formatWithPlural,\n\tmaskString,\n\tnormalizeString,\n\treplaceAllInString,\n\treverseString,\n\tslugifyString,\n} from './string/convert';\n\nexport {\n\tcountWords,\n\tcountWords as countWordsInString,\n\textractNumbersFromString as extractNumbers,\n\textractNumbersFromString,\n\tgetLevenshteinDistance,\n\tgetLevenshteinDistance as levenshteinDistance,\n\textractNumbersFromString as parseNumbersFromText,\n\tcountWords as wordCount,\n} from './string/utilities';\n\n// ! Number Utilities\nexport {\n\tgetAverage as calculateAverage,\n\tcalculateHCF as calculateGCD,\n\tcalculateHCF,\n\tcalculateLCM as calculateLCD,\n\tcalculateLCM,\n\tconvertToDecimal,\n\tconvertToDecimal as convertToFixed,\n\tgetAverage,\n\tgetAverage as getAverageOfNumbers,\n\tgetRandomNumber as getRandomInt,\n\tgetRandomNumber,\n\tsumNumbers as getSumOfNumbers,\n\treverseNumber,\n\troundNumber,\n\troundNumber as roundToDecimal,\n\tsumDigits,\n\tsumNumbers,\n\tsumNumbers as sumOfNumbers,\n} from './number/basics';\n\nexport { Currency } from './number/Currency';\n\nexport { Unit, Unit as UnitConverter } from './number/Unit';\n\nexport { calculatePercentage } from './number/percent';\n\nexport {\n\tfibonacciGenerator,\n\tfibonacciGenerator as generateFibonacci,\n\tgetFibonacciSeries as getFibonacci,\n\tgetFibonacciSeries as getFibonacciNumbers,\n\tgetFibonacciSeries,\n\tgetFibonacciSeriesMemo,\n\tgetFibonacciSeriesMemo as getMemoizedFibonacci,\n\tgetFibonacciSeriesMemo as getMemoizedFibonacciSeries,\n\tgetNthFibonacci,\n} from './number/fibonacci';\n\nexport {\n\tareInvalidNumbers,\n\tareInvalidNumbers as areNumbersInvalid,\n\tisEven,\n\tisEven as isEvenNumber,\n\tisFibonacci,\n\tareInvalidNumbers as isInvalidNumber,\n\tisMultiple,\n\tareInvalidNumbers as isNumberInvalid,\n\tisOdd,\n\tisOdd as isOddNumber,\n\tisFibonacci as isParOfFibonacci,\n\tisFibonacci as isParOfFibonacciSeries,\n\tisPerfectSquare,\n} from './number/guards';\n\nexport {\n\tnumberToWords as convertNumberToWords,\n\tconvertToRomanNumerals,\n\tconvertToRomanNumerals as integerToRoman,\n\tconvertToRomanNumerals as numberToRoman,\n\tnumberToWords,\n\tconvertToRomanNumerals as numericToRoman,\n\tconvertToRomanNumerals as toRoman,\n\tconvertToRomanNumerals as toRomanNumeral,\n} from './number/convert';\n\nexport {\n\tfindPrimeNumbers,\n\tfindPrimeNumbers as getPrimeNumbers,\n\tisPrime,\n\tisPrime as isPrimeNumber,\n} from './number/prime';\n\nexport {\n\tgetOrdinal as cardinalToOrdinal,\n\tclampNumber,\n\tformatCurrency as convertNumberToCurrency,\n\tgetOrdinal as convertNumberToOrdinal,\n\tgetOrdinal as convertToOrdinal,\n\tformatCurrency,\n\tgetOrdinal,\n\tgetOrdinal as getOrdinalNumber,\n\tgetRandomFloat as getRandomDecimal,\n\tgetRandomFloat,\n\tgetOrdinal as numberToOrdinal,\n\troundToNearest as roundNumberToNearestInterval,\n\troundToNearest,\n\troundToNearest as roundToNearestInterval,\n} from './number/utilities';\n\nexport { getNumbersInRange } from './number/range';\n\n// ! Color Utilities\nexport { getColorForInitial } from './colors/initials';\n\nexport {\n\tgenerateRandomColorInHexRGB,\n\tgenerateRandomHSLColor,\n} from './colors/random';\n\nexport {\n\tconvertColorCode,\n\tconvertHex8ToHsla,\n\tconvertHex8ToRgba,\n\tconvertHexToHsl,\n\tconvertHexToRgb,\n\tconvertHslaToHex8,\n\tconvertHslaToRgba,\n\tconvertHslToHex,\n\tconvertHslToRgb,\n\tconvertRgbaToHex8,\n\tconvertRgbaToHsla,\n\tconvertRgbToHex,\n\tconvertRgbToHsl,\n\tconvertRgbToRgba,\n} from './colors/convert';\n\nexport { Color, Color as Colour } from './colors/Color';\n\nexport {\n\textractAlphaColorValues,\n\textractSolidColorValues,\n} from './colors/utils';\n\n// ! Date & Time Utilities\nexport {\n\tgetGreeting as generateGreeting,\n\tgetGreeting,\n\tgetGreeting as greet,\n} from './date/greet';\n\nexport {\n\tisDateLike,\n\tisLeapYear,\n\tisValidTime,\n\tisValidTime as isValidTimeString,\n\tisValidUTCOffSet as isValidUTC,\n\tisValidUTCOffSet,\n} from './date/guards';\n\nexport { Chronos, Chronos as Chronus } from './date/Chronos';\n\nexport {\n\tchronos,\n\tchronos as chronosjs,\n\tchronos as chronosts,\n\tchronos as chronus,\n\tchronos as chronusjs,\n\tchronos as chronusts,\n} from './date/chronos-fn';\n\nexport {\n\tformatUTCOffset as convertMinutesToUTCOffset,\n\textractHourMinute,\n\textractMinutesFromUTC,\n\textractTimeFromUTC,\n\textractTimeFromUTC as extractTimeStringFromUTC,\n\tgetTotalMinutes as extractTotalMinutesFromTime,\n\tformatUTCOffset,\n\tgetCurrentDateTime,\n\tgetCurrentDateTime as getCurrentTime,\n\textractMinutesFromUTC as getMinutesFromUTC,\n\textractTimeFromUTC as getTimeStringFromUTC,\n\tgetTotalMinutes,\n\tgetTotalMinutes as getTotalMinutesFromTime,\n\textractMinutesFromUTC as getTotalMinutesFromUTC,\n\tformatUTCOffset as minutesToUTCOffset,\n} from './date/utils';\n\n// ! Array Utilities\nexport {\n\tfilterArrayOfObjects,\n\tflattenArray,\n\tgetLastArrayElement,\n\tisInvalidOrEmptyArray,\n\tisInvalidOrEmptyArray as isValidEmptyArray,\n\tshuffleArray,\n} from './array/basics';\n\nexport { Finder } from './array/Finder';\n\nexport { sortAnArray } from './array/sort';\n\nexport {\n\tcreateOptionsArray,\n\tgetDuplicates as extractDuplicates,\n\tgetDuplicates as extractDuplicatesFromArray,\n\tfindMissingElements as extractMissingElements,\n\tfindMissingElements,\n\tgetDuplicates,\n\tgetDuplicates as getDuplicatesFromArray,\n\tfindMissingElements as getMissingElements,\n\tmoveArrayElement,\n\tremoveDuplicatesFromArray as removeDuplicates,\n\tremoveDuplicatesFromArray,\n\trotateArray,\n\tsplitArray,\n} from './array/transform';\n\nexport {\n\tnaturalSort as compareNaturally,\n\tnaturalSort as compareSorter,\n\tnaturalSort,\n\tnaturalSort as naturalSortForString,\n} from './array/utils';\n\n// ! Form Utilities\nexport {\n\tcreateControlledFormData as convertIntoFormData,\n\tcreateControlledFormData,\n\tcreateControlledFormData as createFormData,\n} from './form/convert';\n\nexport { parseFormData, serializeForm } from './form/transform';\n\nexport {\n\tisCustomFile,\n\tisCustomFileArray,\n\tisFileArray,\n\tisFileList,\n\tisFileOrBlob,\n\tisFileUpload,\n\tisOriginFileObj,\n\tisValidFormData,\n} from './form/guards';\n\n// ! Object Utilities\nexport { cloneObject, countObjectFields } from './object/basics';\n\nexport {\n\textractNewFields,\n\textractUpdatedAndNewFields,\n\textractUpdatedFields,\n\tflattenObjectDotNotation,\n\tflattenObjectKeyValue,\n\tmergeAndFlattenObjects,\n\tmergeObjects,\n\tparseJsonToObject,\n} from './object/objectify';\n\nexport {\n\tparseObjectValues,\n\tparseObjectValues as parseStringifiedObjectValues,\n\tsanitizeData,\n} from './object/sanitize';\n\nexport {\n\tconvertObjectValues,\n\tpickFields,\n\tpickObjectFieldsByCondition as pickFieldsByCondition,\n\tpickFields as pickObjectFields,\n\tpickObjectFieldsByCondition,\n\tremapFields,\n\tremapFields as remapObjectFields,\n} from './object/convert';\n\n// ! DOM Utilities\nexport {\n\tgenerateQueryParams as createQueryParams,\n\tgenerateQueryParams as formatQueryParams,\n\tgenerateQueryParams,\n\tgetQueryParams,\n\tparseQueryString as getQueryStringAsObject,\n\tparseQueryString,\n\tparseQueryString as queryStringToObject,\n\tupdateQueryParam,\n} from './dom/query';\n\nexport { copyToClipboard, smoothScrollTo, toggleFullScreen } from './dom/utils';\n\nexport {\n\tgetFromLocalStorage,\n\tgetFromSessionStorage,\n\tremoveFromLocalStorage,\n\tremoveFromSessionStorage,\n\tsaveToLocalStorage,\n\tsaveToSessionStorage,\n} from './dom/storage';\n\n// ! Other Utilities\nexport {\n\tconvertArrayToString,\n\tcountInstanceMethods,\n\tcountStaticMethods,\n\tdebounceAction,\n\tdeepParsePrimitives,\n\tgetClassDetails,\n\tgetInstanceMethodNames,\n\tcountInstanceMethods as getInstanceMethodsCount,\n\tgetStaticMethodNames,\n\tcountStaticMethods as getStaticMethodsCount,\n\tisDeepEqual,\n\tparseJSON,\n\tparseJSON as parseJsonDeep,\n\tdeepParsePrimitives as parsePrimitivesDeep,\n\tthrottleAction,\n} from './utils';\n\nexport { Paginator } from './utils/Paginator';\n\n// ! Primitive Type Guards\nexport {\n\tisBigInt,\n\tisBoolean,\n\tisFalsy,\n\tisInteger,\n\tisNonEmptyString,\n\tisNormalPrimitive,\n\tisNull,\n\tisNumber,\n\tisPositiveInteger,\n\tisPrimitive,\n\tisString,\n\tisSymbol,\n\tisTruthy,\n\tisUndefined,\n} from './guards/primitives';\n\n// ! Non-Primitive Type Guards\nexport {\n\tisReturningPromise as doesReturnPromise,\n\tisArray,\n\tisArrayOfType,\n\tisValidArray as isArrayWithLength,\n\tisDate,\n\tisEmptyObject,\n\tisEmptyObject as isEmptyObjectGuard,\n\tisError,\n\tisFunction,\n\tisJSON,\n\tisJSON as isJSONObject,\n\tisMap,\n\tisMethodDescriptor as isMethod,\n\tisMethodDescriptor,\n\tisNotEmptyObject,\n\tisObject,\n\tisEmptyObject as isObjectEmpty,\n\tisObjectWithKeys,\n\tisPromise,\n\tisRegExp,\n\tisRegExp as isRegularExpression,\n\tisReturningPromise,\n\tisSet,\n\tisValidArray,\n\tisJSON as isValidJSON,\n\tisMap as isValidMap,\n\tisNotEmptyObject as isValidObject,\n\tisSet as isValidSet,\n} from './guards/non-primitives';\n\n// ! Special Type Guards\nexport {\n\tisBase64,\n\tisBrowser,\n\tisDateString,\n\tisEmail,\n\tisEmailArray,\n\tisEnvironment,\n\tisEnvironment as isExpectedNodeENV,\n\tisIPAddress,\n\tisNode,\n\tisEnvironment as isNodeENV,\n\tisEnvironment as isNodeEnvironment,\n\tisNumericString,\n\tisPhoneNumber,\n\tisURL,\n\tisUUID,\n\tisEmail as isValidEmail,\n\tisURL as isValidURL,\n} from './guards/specials';\n\n// ! Export All types\nexport type {\n\tFieldValue,\n\tFindOptions,\n\tFirstFieldKey,\n\tFirstFieldValue,\n\tFlattened,\n\tOption,\n\tOptionsConfig,\n\tOrderOption,\n\tSortByOption,\n\tSortNature,\n\tSortOptions,\n} from './array/types';\nexport type {\n\tAlphaColors,\n\tAlphaValue,\n\tAlphaValues,\n\tAnalogous,\n\tColorInput,\n\tColorInputArray,\n\tColors,\n\tColorType,\n\tColorTypeAlpha,\n\tColorTypeSolid,\n\tConvertedColors,\n\tCSSColor,\n\tHex,\n\tHex6,\n\tHex8,\n\tHSL,\n\tHSLA,\n\tPercent,\n\tRGB,\n\tRGBA,\n\tSolidColors,\n\tSolidValues,\n\tTetrad,\n\tTriad,\n} from './colors/types';\nexport type {\n\tChronosFormat,\n\tChronosInput,\n\tChronosMethods,\n\tChronosObject,\n\tChronosStatics,\n\tDateParts,\n\tDay,\n\tDayPart,\n\tDayPartConfig,\n\tFormatOptions,\n\tGreetingConfigs,\n\tHour,\n\tHours,\n\tMillisecond,\n\tMinute,\n\tMinutes,\n\tMonth,\n\tMonthDate,\n\tNegativeUTCHour,\n\tPositiveUTCHour,\n\tQuarter,\n\tSecond,\n\tSeconds,\n\tStrictFormat,\n\tTime,\n\tTimeDuration,\n\tTimeFormats,\n\tTimeParts,\n\tTimeUnit,\n\tTimeZone,\n\tUTCMinute,\n\tUTCOffSet,\n\tWithoutOrigin,\n\tYear,\n\tZodiacSign,\n} from './date/types';\nexport type {\n\tCustomFile,\n\tFileError,\n\tFileUpload,\n\tFormDataConfigs,\n\tOriginFileObj,\n\tParsedFormData,\n\tSerializedForm,\n} from './form/types';\nexport type {\n\tApplyChangeOptions,\n\tConvertedDecimal,\n\tConvertOptions,\n\tCurrencyCode,\n\tDecimalOptions,\n\tFrankFurter,\n\tGetChangeOptions,\n\tGetDifferenceOptions,\n\tGetOriginalOptions,\n\tGetPercentOptions,\n\tGetValueOptions,\n\tInversePercentageOptions,\n\tLocaleCode,\n\tNumberType,\n\tPercentageOptions,\n\tRandomNumberOptions,\n\tRangedNumbers,\n\tRangeOptions,\n\tSIPrefix,\n\tSupportedCurrency,\n\tUnitKey,\n\tUnitLabel,\n\tUnitNumberMethods,\n} from './number/types';\nexport type {\n\tDotNotationKey,\n\tDotNotationKeyStrict,\n\tGenericObject,\n\tGenericObjectPrimitive,\n\tKeyForArray,\n\tKeyForObject,\n\tNestedKeyString,\n\tNestedPrimitiveKey,\n\tNumberified,\n\tQueryObject,\n\tQueryObjectValue,\n\tSanitizeOptions,\n\tStrictObject,\n\tStringified,\n} from './object/types';\nexport type {\n\tAnagramOptions,\n\tCapitalizeOptions,\n\tCaseFormat,\n\tMaskOptions,\n\tQueryString,\n\tRandomIdOptions,\n} from './string/types';\nexport type {\n\tAdvancedTypes,\n\tAny,\n\tAsyncFunction,\n\tBranded,\n\tClassDetails,\n\tConstructor,\n\tDelayedFn,\n\tFalsyPrimitive,\n\tFlattenPartial,\n\tGenericFn,\n\tHasMethods,\n\tNonNullishPrimitiveKey,\n\tNormalPrimitive,\n\tNormalPrimitiveKey,\n\tNumeric,\n\tOwnKeys,\n\tPartialOrRequired,\n\tPrimitive,\n\tThrottledFn,\n\tVoidFunction,\n} from './types';\nexport type {\n\tFromMetaOptions,\n\tPageListOptions,\n\tPaginatorMeta,\n\tPaginatorOptions,\n} from './utils/types';\n","import type { CapitalizeOptions, RandomIdOptions } from './types';\n\n/**\n * * Utility to convert the first letter of any string to uppercase and the rest lowercase (unless specified).\n * * Handles surrounding symbols like quotes or parentheses.\n *\n * @param string String to be capitalized.\n * @param options Options to customize the capitalization.\n * @returns Capitalized string or fully uppercased string depending on `capitalizeAll` option.\n */\nexport function capitalizeString(\n\tstring: string,\n\toptions?: CapitalizeOptions,\n): string {\n\tif (typeof string !== 'string' || !string) return '';\n\n\tconst trimmedString = string.trim();\n\tif (!trimmedString) return '';\n\n\tconst {\n\t\tcapitalizeAll = false,\n\t\tcapitalizeEachFirst = false,\n\t\tlowerCaseRest = true,\n\t} = options || {};\n\n\tif (capitalizeAll) {\n\t\treturn trimmedString.toUpperCase();\n\t}\n\n\tif (capitalizeEachFirst) {\n\t\treturn trimmedString\n\t\t\t?.split(/\\s+/)\n\t\t\t?.map((word) => capitalizeString(word, { lowerCaseRest }))\n\t\t\t?.join(' ');\n\t}\n\n\tconst matchArray = trimmedString.match(/^(\\W*)(\\w)(.*)$/);\n\n\tif (matchArray && matchArray?.length === 4) {\n\t\tconst [_, leadingSymbols, firstLetter, rest] = matchArray;\n\t\treturn leadingSymbols\n\t\t\t.concat(firstLetter.toUpperCase())\n\t\t\t.concat(lowerCaseRest ? rest.toLowerCase() : rest);\n\t}\n\n\treturn trimmedString\n\t\t.charAt(0)\n\t\t.toUpperCase()\n\t\t.concat(\n\t\t\tlowerCaseRest ?\n\t\t\t\ttrimmedString.slice(1).toLowerCase()\n\t\t\t:\ttrimmedString.slice(1),\n\t\t);\n}\n\n/**\n * * Utility to truncate a string to a specified length.\n *\n * @param string The string to truncate.\n * @param maxLength The maximum length of the truncated string.\n * @returns Truncated string with ellipsis (`...`) (only if it has more length than `maxLength`).\n */\nexport const truncateString = (string: string, maxLength: number): string => {\n\tif (typeof string !== 'string' || !string) return '';\n\n\tconst trimmedString = string?.trim();\n\n\tif (!trimmedString) return '';\n\n\tif (trimmedString?.length <= maxLength) return trimmedString;\n\n\treturn trimmedString?.slice(0, maxLength)?.concat('...');\n};\n\n/**\n * * Generates a random alphanumeric (16 characters long, this length is customizable in the options) ID string composed of an optional `prefix`, `suffix`, a `timestamp`, `caseOption` and a customizable `separator`.\n *\n * @param options Configuration options for random ID generation.\n * @returns The generated ID string composed of the random alphanumeric string of specified length with optional `timeStamp`, `prefix`, and `suffix`, `caseOption` and `separator`.\n */\nexport const generateRandomID = (options?: RandomIdOptions): string => {\n\tconst {\n\t\tprefix = '',\n\t\tsuffix = '',\n\t\ttimeStamp = false,\n\t\tlength = 16,\n\t\tseparator = '',\n\t\tcaseOption = null,\n\t} = options || {};\n\n\t// generate timestamp\n\tconst date: number | string = timeStamp ? Date.now() : '';\n\n\t// Generate a random string of alphanumeric characters\n\tconst randomString: string = Array.from({ length }, () =>\n\t\tMath.random().toString(36).slice(2, 3),\n\t).join('');\n\n\tconst ID: string = [\n\t\tprefix && prefix.trim(),\n\t\tdate,\n\t\trandomString,\n\t\tsuffix && suffix.trim(),\n\t]\n\t\t?.filter(Boolean)\n\t\t?.join(separator);\n\n\tswitch (caseOption) {\n\t\tcase 'upper':\n\t\t\treturn ID.toUpperCase();\n\t\tcase 'lower':\n\t\t\treturn ID.toLowerCase();\n\t\tdefault:\n\t\t\treturn ID;\n\t}\n};\n\n/**\n * * Trims all the words in a string.\n *\n * @param input The string to trim.\n * @returns Trimmed string.\n */\nexport function trimString(input: string): string;\n\n/**\n * * Trims all the words in an array of strings.\n *\n * @param input The array of strings to trim.\n * @returns Trimmed array of strings.\n */\nexport function trimString(input: string[]): string[];\n\n/**\n * * Trims all the words in a string or an array of strings.\n *\n * @param input String or array of strings.\n * @returns Trimmed string or array of strings.\n */\nexport function trimString(input: string | string[]): string | string[] {\n\tif (!input) return '';\n\n\t// If the input is a string, trim each word\n\tif (typeof input === 'string' && !Array.isArray(input)) {\n\t\treturn input?.trim()?.replace(/\\s+/g, ' ');\n\t}\n\n\t// If the input is an array of strings, trim each string in the array\n\tif (Array.isArray(input)) {\n\t\treturn input?.map((str) =>\n\t\t\ttypeof str === 'string' ? str?.trim()?.replace(/\\s+/g, ' ') : str,\n\t\t);\n\t}\n\n\tthrow new Error('Invalid input type. Expected string or array of strings!');\n}\n","/**\n * * Utility to generate unique anagrams of a word.\n * @param word The word for generating anagrams.\n * @param limit The maximum number of anagrams to return ('all' for unlimited). Default is `100`.\n * @returns An array of generated anagrams. The first element is always the given word. Generated anagrams are always in lowercase.\n */\nexport function generateAnagrams(\n\tword: string,\n\tlimit: number | 'all' = 100,\n): Lowercase<string>[] {\n\tif (word?.length <= 1) {\n\t\treturn [word?.toLowerCase() as Lowercase<string>];\n\t}\n\n\tconst uniqueAnagrams = new Set<string>();\n\n\t/**\n\t * * Helper function to generate permutations.\n\t * @param str Current permutation being formed.\n\t * @param remaining Remaining characters to process.\n\t */\n\tconst _permute = (str: string, remaining: string) => {\n\t\tif (!remaining?.length) {\n\t\t\tuniqueAnagrams.add(str);\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let i = 0; i < remaining?.length; i++) {\n\t\t\tif (limit !== 'all' && uniqueAnagrams.size >= limit) return;\n\n\t\t\t_permute(\n\t\t\t\tstr + remaining[i],\n\t\t\t\tremaining?.slice(0, i) + remaining?.slice(i + 1),\n\t\t\t);\n\t\t}\n\t};\n\n\t_permute('', word.toLowerCase());\n\n\treturn Array.from(uniqueAnagrams) as Lowercase<string>[];\n}\n","export const LOWERCASE: string[] = [\n\t// Conjunctions\n\t'and',\n\t'but',\n\t'or',\n\t'nor',\n\t'for',\n\t'so',\n\t'yet',\n\t'after',\n\t'although',\n\t'as',\n\t'because',\n\t'before',\n\t'even',\n\t'if',\n\t'once',\n\t'since',\n\t'than',\n\t'that',\n\t'though',\n\t'unless',\n\t'until',\n\t'when',\n\t'whenever',\n\t'where',\n\t'whereas',\n\t'wherever',\n\t'whether',\n\t'while',\n\n\t// Prepositions\n\t'about',\n\t'above',\n\t'across',\n\t'after',\n\t'against',\n\t'along',\n\t'among',\n\t'around',\n\t'as',\n\t'at',\n\t'before',\n\t'behind',\n\t'below',\n\t'beneath',\n\t'beside',\n\t'between',\n\t'beyond',\n\t'but',\n\t'by',\n\t'concerning',\n\t'considering',\n\t'despite',\n\t'down',\n\t'during',\n\t'except',\n\t'following',\n\t'for',\n\t'from',\n\t'in',\n\t'inside',\n\t'into',\n\t'like',\n\t'minus',\n\t'near',\n\t'of',\n\t'off',\n\t'on',\n\t'onto',\n\t'opposite',\n\t'out',\n\t'outside',\n\t'over',\n\t'past',\n\t'per',\n\t'plus',\n\t'regarding',\n\t'round',\n\t'save',\n\t'since',\n\t'than',\n\t'through',\n\t'throughout',\n\t'till',\n\t'to',\n\t'toward',\n\t'towards',\n\t'under',\n\t'underneath',\n\t'unlike',\n\t'until',\n\t'up',\n\t'upon',\n\t'versus',\n\t'via',\n\t'with',\n\t'within',\n\t'without',\n\n\t// Articles\n\t'a',\n\t'an',\n\t'the',\n\n\t// Auxiliary Verbs\n\t'am',\n\t'are',\n\t'be',\n\t'been',\n\t'being',\n\t'can',\n\t'could',\n\t'do',\n\t'does',\n\t'did',\n\t'had',\n\t'has',\n\t'have',\n\t'is',\n\t'may',\n\t'might',\n\t'must',\n\t'shall',\n\t'should',\n\t'was',\n\t'were',\n\t'will',\n\t'would',\n] as const;\n","import { trimString } from './basics';\nimport { LOWERCASE } from './constants';\nimport type { CaseFormat, MaskOptions } from './types';\n\n/**\n * * Converts a string to a specified case format such as `camelCase`, `snake_case`, `kebab-case`, `PascalCase`, `Title Case`, `lowercase`, or `UPPERCASE`.\n *\n * - This function handles non-alphanumeric characters (e.g., spaces, hyphens, underscores, dots, slashes) as word delimiters. For `Title Case`, prepositions, articles, conjunctions, and auxiliary verbs are not capitalized unless they appear at the start of the title.\n * - You can also convert the string to `lowercase` or `UPPERCASE`, but it's recommended to use default string methods like `string.toLowerCase()` and `string.toUpperCase()` for these cases.\n *\n * @param string The input string to be converted. The string should have words separated by non-alphanumeric characters (e.g., spaces, hyphens, underscores, etc.).\n * @param format The format to convert the string to. The available formats are:\n * - `'camelCase'`: Converts to camelCase (e.g., `myVariableName`).\n * - `'snake_case'`: Converts to snake_case (e.g., `my_variable_name`).\n * - `'kebab-case'`: Converts to kebab-case (e.g., `my-variable-name`).\n * - `'PascalCase'`: Converts to PascalCase (e.g., `MyVariableName`).\n * - `'Title Case'`: Converts to Title Case (e.g., `My Variable Name`), where certain words like `prepositions, articles, conjunctions and auxiliary verbs` are not capitalized unless at the start.\n * - `'lowercase'`: Converts the string to all lowercase characters.\n * - `'UPPERCASE'`: Converts the string to all uppercase characters.\n * @returns The formatted string in the specified case format.\n * @example\n * convertStringCase('my-example_string', 'camelCase'); // returns 'myExampleString'\n * convertStringCase('my-example_string', 'snake_case'); // returns 'my_example_string'\n * convertStringCase('my-example_string', 'kebab-case'); // returns 'my-example-string'\n * convertStringCase('my example string', 'Title Case'); // returns 'My Example String'\n * convertStringCase('my example string', 'lowercase'); // returns 'my example string'\n * convertStringCase('my example string', 'UPPERCASE'); // returns 'MY EXAMPLE STRING'\n */\nexport function convertStringCase(string: string, format: CaseFormat): string {\n\tif (!string || typeof string !== 'string') return '';\n\n\tconst start = string?.match(/^[^\\d\\w\\s]+/)?.[0] || '';\n\tconst end = string?.match(/[^\\d\\w\\s]+$/)?.[0] || '';\n\tconst core = string?.replace(/^[^\\d\\w\\s]+|[^\\w\\s]+$/g, '').trim();\n\n\tconst titleCase = core\n\t\t?.split(/\\s+/g)\n\t\t?.map((part) => {\n\t\t\tconst startSymbol = part.match(/^[^\\d\\w\\s]+/)?.[0] || ''; // Capture leading symbols\n\t\t\tconst endSymbol = part.match(/[^\\d\\w\\s]+$/)?.[0] || ''; // Capture trailing symbols\n\t\t\tconst coreWord = part.replace(/^[^\\d\\w\\s]+|[^\\d\\w\\s]+$/g, ''); // Remove them for processing\n\n\t\t\tif (LOWERCASE.includes(coreWord?.toLowerCase())) {\n\t\t\t\treturn startSymbol + coreWord?.toLowerCase() + endSymbol;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\tstartSymbol +\n\t\t\t\tcoreWord?.charAt(0)?.toUpperCase() +\n\t\t\t\tcoreWord?.slice(1)?.toLowerCase() +\n\t\t\t\tendSymbol\n\t\t\t);\n\t\t})\n\t\t.join(' ');\n\n\tconst formattedString = string?.replace(\n\t\t/[^a-zA-Z0-9]+(.)?/g,\n\t\t(_, chr: string) => (chr ? chr?.toUpperCase() : ''),\n\t);\n\n\tif (!formattedString) return '';\n\n\tswitch (format) {\n\t\tcase 'camelCase':\n\t\t\t// return formattedString.replace(/[A-Z]/g, (letter, index) =>\n\t\t\t// \tindex === 0 ? letter.toUpperCase() : letter.toLowerCase(),\n\t\t\t// );\n\t\t\treturn (\n\t\t\t\tformattedString.charAt(0).toLowerCase() +\n\t\t\t\tformattedString.slice(1)\n\t\t\t);\n\n\t\tcase 'snake_case':\n\t\t\treturn /[^a-zA-Z0-9]/.test(string) ?\n\t\t\t\t\tstring.split(/\\W+/g).join('_').toLowerCase()\n\t\t\t\t:\tformattedString.replace(/[A-Z]/g, (letter, index) =>\n\t\t\t\t\t\tindex === 0 ?\n\t\t\t\t\t\t\tletter.toLowerCase()\n\t\t\t\t\t\t:\t`_${letter.toLowerCase()}`,\n\t\t\t\t\t);\n\n\t\tcase 'kebab-case':\n\t\t\treturn /[^a-zA-Z0-9]/.test(string) ?\n\t\t\t\t\tstring.split(/\\W+/g).join('-').toLowerCase()\n\t\t\t\t:\tformattedString.replace(/[A-Z]/g, (letter, index) =>\n\t\t\t\t\t\tindex === 0 ?\n\t\t\t\t\t\t\tletter.toLowerCase()\n\t\t\t\t\t\t:\t`-${letter.toLowerCase()}`,\n\t\t\t\t\t);\n\n\t\tcase 'PascalCase':\n\t\t\treturn (\n\t\t\t\tformattedString.charAt(0).toUpperCase() +\n\t\t\t\tformattedString.slice(1)\n\t\t\t);\n\n\t\tcase 'Title Case':\n\t\t\treturn (\n\t\t\t\tstart +\n\t\t\t\ttitleCase.charAt(0).toUpperCase() +\n\t\t\t\ttitleCase.slice(1) +\n\t\t\t\tend\n\t\t\t);\n\n\t\tcase 'lowercase':\n\t\t\treturn start + core.toLowerCase() + end;\n\n\t\tcase 'UPPERCASE':\n\t\t\treturn start + core.toUpperCase() + end;\n\n\t\tdefault:\n\t\t\treturn formattedString;\n\t}\n}\n\n/**\n * * Replaces all occurrences of a string or pattern in the given input string.\n *\n * - If `find` is a string, it is converted into a global regular expression (`/find/g`).\n * - If `find` is a `RegExp`, the global (`g`) flag is ensured.\n * - Trims the input before performing replacements.\n *\n * @param input - The string in which replacements should be performed.\n * @param find - The substring or regex pattern to search for.\n * @param replace - The string to replace matches with.\n * @returns The modified/refined string with replacements applied.\n */\nexport const replaceAllInString = (\n\tinput: string,\n\tfind: string | RegExp,\n\treplace: string,\n): string => {\n\tconst trimmedString = trimString(input);\n\n\tconst regex =\n\t\ttypeof find === 'string' ?\n\t\t\tnew RegExp(find, 'g')\n\t\t:\tnew RegExp(\n\t\t\t\tfind,\n\t\t\t\tfind?.flags.includes('g') ? find?.flags : find?.flags + 'g',\n\t\t\t);\n\n\treturn trimmedString?.replace(regex, replace);\n};\n\n/**\n * * Converts a string into a URL-friendly slug.\n * @param input - The string to be converted.\n * @returns The slugified string.\n */\nexport const slugifyString = (input: string): Lowercase<string> => {\n\treturn trimString(input)\n\t\t?.toLowerCase()\n\t\t?.replace(/[^a-z0-9]+/g, '-')\n\t\t?.replace(/^-+|-+$/g, '') as Lowercase<string>;\n};\n\n/**\n * * Masks part of a string for privacy.\n * @param input - The string to mask.\n * @param options - Options for masking a string.\n * @returns The masked string.\n */\nexport const maskString = (input: string, options?: MaskOptions): string => {\n\tconst { start = 1, end = 1, maskCharacter: maskChar = '*' } = options || {};\n\n\tconst trimmedString = trimString(input);\n\n\tif (trimmedString?.length <= start + end) {\n\t\treturn maskChar?.repeat(trimmedString?.length);\n\t}\n\n\treturn (\n\t\ttrimmedString.slice(0, start) +\n\t\tmaskChar?.repeat(trimmedString?.length - start - end) +\n\t\t(end > 0 ? trimmedString.slice(-end) : '')\n\t);\n};\n\n/**\n * * Reverses a given string.\n * @param input - The string to reverse.\n * @returns The reversed string.\n */\nexport const reverseString = (input: string): string => {\n\tconst trimmedString = trimString(input);\n\n\treturn trimmedString?.split('')?.reverse()?.join('');\n};\n\n/**\n * * Normalizes a string by removing diacritics (accents).\n * @param str The input string.\n * @returns The normalized string.\n */\nexport function normalizeString(str: string): string {\n\treturn str.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n}\n\n/**\n * * Extracts all email addresses from a string.\n * @param str The input string.\n * @returns An array of extracted email addresses.\n */\nexport function extractEmails(str: string): string[] {\n\treturn str.match(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}/g) || [];\n}\n\n/**\n * * Extracts all URLs from a string.\n * @param str The input string.\n * @returns An array of extracted URLs.\n */\nexport function extractURLs(str: string): string[] {\n\treturn str?.match(/https?:\\/\\/[^\\s/$.?#].[^\\s]*/g) || [];\n}\n\n/**\n * * Returns a grammatically correct unit string, optionally prefixed with the number.\n *\n * @param count The numeric value to determine singular or plural.\n * @param unit The unit name (e.g., \"day\", \"hour\").\n * @param withNumber Whether to prefix the count before the unit. Defaults to `true`.\n * @returns Formatted unit string like `\"1 day\"`, `\"2 months\"`, or `\"hour\"`.\n */\nexport function formatUnitWithPlural(\n\tcount: number,\n\tunit: string,\n\twithNumber = true,\n): string {\n\tconst abs = Math.abs(count);\n\tconst pluralized = abs === 1 ? unit : `${unit}s`;\n\n\treturn withNumber ? `${count} ${pluralized}` : pluralized;\n}\n","import { reverseString } from './convert';\n\n/**\n * * Checks if a string is a palindrome.\n * @param input - The string to check.\n * @returns True if the string is a palindrome, otherwise false.\n */\nexport const isPalindrome = (input: string): boolean => {\n\tconst normalized = input.toLowerCase().replace(/[^a-z0-9]/g, '');\n\treturn normalized === reverseString(normalized);\n};\n\n/**\n * * Checks if a string is in camelCase format.\n * @param str The string to check.\n * @returns `true` if the string is in camelCase, otherwise `false`.\n */\nexport function isCamelCase(str: string): boolean {\n\treturn /^[a-z]+([A-Z][a-z]*)*$/.test(str);\n}\n\n/**\n * * Checks if a string is in PascalCase format.\n * @param str The string to check.\n * @returns `true` if the string is in PascalCase, otherwise `false`.\n */\nexport function isPascalCase(str: string): boolean {\n\treturn /^[A-Z][a-zA-Z]*$/.test(str);\n}\n\n/**\n * * Checks if a string is in snake_case format.\n * @param str The string to check.\n * @returns `true` if the string is in snake_case, otherwise `false`.\n */\nexport function isSnakeCase(str: string): boolean {\n\treturn /^[a-z]+(_[a-z]+)*$/.test(str);\n}\n\n/**\n * * Checks if a string is in kebab-case format.\n * @param str The string to check.\n * @returns `true` if the string is in kebab-case, otherwise `false`.\n */\nexport function isKebabCase(str: string): boolean {\n\treturn /^[a-z]+(-[a-z]+)*$/.test(str);\n}\n\n/**\n * * Checks if a string contains only emojis.\n * @param str The string to check.\n * @returns `true` if the string contains only emojis, otherwise `false`.\n */\nexport function isEmojiOnly(str: string): boolean {\n\treturn /^[\\p{Emoji}]+$/u.test(str);\n}\n","/**\n * * Extracts all numbers from a string as array of numbers.\n * @param input - The string to extract numbers from.\n * @returns An array of numbers found in the string.\n */\nexport const extractNumbersFromString = (input: string): number[] => {\n\treturn (input.match(/\\d+/g) || [])?.map(Number);\n};\n\n/**\n * * Computes the Levenshtein distance between two strings.\n * @param a - First string.\n * @param b - Second string.\n * @returns The Levenshtein distance between the two strings.\n */\nexport const getLevenshteinDistance = (a: string, b: string): number => {\n\tconst lenA = a?.length;\n\tconst lenB = b?.length;\n\tconst dp: number[][] = Array.from({ length: lenA + 1 }, (_, i) =>\n\t\tArray.from({ length: lenB + 1 }, (_, j) =>\n\t\t\ti === 0 ? j\n\t\t\t: j === 0 ? i\n\t\t\t: 0,\n\t\t),\n\t);\n\n\tfor (let i = 1; i <= lenA; i++) {\n\t\tfor (let j = 1; j <= lenB; j++) {\n\t\t\tdp[i][j] =\n\t\t\t\ta[i - 1] === b[j - 1] ?\n\t\t\t\t\tdp[i - 1][j - 1]\n\t\t\t\t:\t1 + Math.min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]);\n\t\t}\n\t}\n\n\treturn dp[lenA][lenB];\n};\n\n/**\n * * Counts the number of words in a string, supporting multiple languages and scripts.\n *\n * @param text - The input string to count words from.\n * @returns Number of words (Unicode-aware).\n */\nexport function countWords(text: string): number {\n\treturn (text?.match(/\\p{L}[\\p{L}\\p{M}\\p{Pd}'’]*|\\p{N}+/gu) || [])?.length;\n}\n","import type { FalsyPrimitive, NormalPrimitive, Primitive } from '../types';\n\n/**\n * * Type guard to check if a value is a number.\n * @param value - The value to check.\n * @returns `true` if the value is a number, otherwise `false`.\n */\nexport function isNumber(value: unknown): value is number {\n\treturn typeof value === 'number' && !isNaN(value);\n}\n\n/**\n * * Type guard to check if a value is a string.\n * @param value - The value to check.\n * @returns `true` if the value is a string, otherwise `false`.\n */\nexport function isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\n/**\n * * Type guard to check if a value is an integer.\n * @param value - The value to check.\n * @returns `true` if the value is an integer, otherwise `false`.\n */\nexport function isInteger(value: unknown): value is number {\n\treturn isNumber(value) && Number.isInteger(value);\n}\n\n/**\n * * Type guard to check if a value is a positive integer.\n * @param value - The value to check.\n * @returns `true` if the value is a positive integer, otherwise `false`.\n */\nexport function isPositiveInteger(value: unknown): value is number {\n\treturn isInteger(value) && value > 0;\n}\n\n/**\n * * Type guard to check if a value is a boolean.\n * @param value - The value to check.\n * @returns `true` if the value is a boolean, otherwise `false`.\n */\nexport function isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\n/**\n * * Type guard to check if a value is null.\n * @param value - The value to check.\n * @returns `true` if the value is null, otherwise `false`.\n */\nexport function isNull(value: unknown): value is null {\n\treturn value === null;\n}\n\n/**\n * * Type guard to check if a value is undefined.\n * @param value - The value to check.\n * @returns `true` if the value is undefined, otherwise `false`.\n */\nexport function isUndefined(value: unknown): value is undefined {\n\treturn value === undefined;\n}\n\n/**\n * * Type guard to check if a value is a symbol.\n * @param value - The value to check.\n * @returns `true` if the value is a symbol, otherwise `false`.\n */\nexport function isSymbol(value: unknown): value is symbol {\n\treturn typeof value === 'symbol';\n}\n\n/**\n * * Type guard to check if a value is a BigInt.\n * @param value - The value to check.\n * @returns `true` if the value is a BigInt, otherwise `false`.\n */\nexport function isBigInt(value: unknown): value is bigint {\n\treturn typeof value === 'bigint';\n}\n\n/**\n * * Type guard to check if a value is a primitive (i.e. `string | number | boolean | symbol | bigint | null | undefined`).\n * @param value - The value to check.\n * @returns `true` if the value is a primitive, otherwise `false`.\n */\nexport function isPrimitive(value: unknown): value is Primitive {\n\treturn (\n\t\tvalue === null ||\n\t\t[\n\t\t\t'string',\n\t\t\t'number',\n\t\t\t'boolean',\n\t\t\t'symbol',\n\t\t\t'bigint',\n\t\t\t'undefined',\n\t\t].includes(typeof value)\n\t);\n}\n\n/**\n * * Type guard to check if a value is a normal primitive (i.e. `string | number | boolean | null | undefined`).\n * @param value - The value to check.\n * @returns `true` if the value is a primitive, otherwise `false`.\n */\nexport function isNormalPrimitive(value: unknown): value is NormalPrimitive {\n\treturn (\n\t\tvalue === null ||\n\t\t['string', 'number', 'boolean', 'undefined'].includes(typeof value)\n\t);\n}\n\n/**\n * * Type guard to check if a value is a non-empty string.\n * @param value - The value to check.\n * @returns `true` if the value is a non-empty string, otherwise `false`.\n */\nexport function isNonEmptyString(value: unknown): value is string {\n\treturn isString(value) && value?.length > 0;\n}\n\n/**\n * * Type guard to check if a value is falsy.\n * @param value - The value to check.\n * @returns `true` if the value is falsy, otherwise `false`.\n */\nexport function isFalsy(value: unknown): value is FalsyPrimitive {\n\treturn !value;\n}\n\n/**\n * * Type guard to check if a value is truthy.\n * @param value - The value to check.\n * @returns `true` if the value is truthy (not null or undefined), otherwise `false`.\n */\nexport function isTruthy<T>(value: T): value is Exclude<T, FalsyPrimitive> {\n\treturn Boolean(value);\n}\n","export const ONES = [\n\t'',\n\t'one',\n\t'two',\n\t'three',\n\t'four',\n\t'five',\n\t'six',\n\t'seven',\n\t'eight',\n\t'nine',\n] as const;\n\nexport const TEENS = [\n\t'ten',\n\t'eleven',\n\t'twelve',\n\t'thirteen',\n\t'fourteen',\n\t'fifteen',\n\t'sixteen',\n\t'seventeen',\n\t'eighteen',\n\t'nineteen',\n] as const;\n\nexport const TENS = [\n\t'',\n\t'ten',\n\t'twenty',\n\t'thirty',\n\t'forty',\n\t'fifty',\n\t'sixty',\n\t'seventy',\n\t'eighty',\n\t'ninety',\n] as const;\n\nexport const THOUSANDS = [\n\t'',\n\t'thousand',\n\t'million',\n\t'billion',\n\t'trillion',\n\t'quadrillion',\n\t'quintillion',\n\t// ! Needs to modify later, below supports up to 10 sextillion! It's a bug!\n\t// 'sextillion',\n] as const;\n\n/** List of ISO 4217 currency codes */\nexport const CURRENCY_CODES = [\n\t'AED',\n\t'AFN',\n\t'ALL',\n\t'AMD',\n\t'ANG',\n\t'AOA',\n\t'ARS',\n\t'AUD',\n\t'AWG',\n\t'AZN',\n\t'BAM',\n\t'BBD',\n\t'BDT',\n\t'BGN',\n\t'BHD',\n\t'BIF',\n\t'BMD',\n\t'BND',\n\t'BOB',\n\t'BRL',\n\t'BSD',\n\t'BTN',\n\t'BWP',\n\t'BYN',\n\t'BZD',\n\t'CAD',\n\t'CDF',\n\t'CHF',\n\t'CLP',\n\t'CNY',\n\t'COP',\n\t'CRC',\n\t'CUP',\n\t'CVE',\n\t'CZK',\n\t'DJF',\n\t'DKK',\n\t'DOP',\n\t'DZD',\n\t'EGP',\n\t'ERN',\n\t'ETB',\n\t'EUR',\n\t'FJD',\n\t'FKP',\n\t'FOK',\n\t'GBP',\n\t'GEL',\n\t'GGP',\n\t'GHS',\n\t'GIP',\n\t'GMD',\n\t'GNF',\n\t'GTQ',\n\t'GYD',\n\t'HKD',\n\t'HNL',\n\t'HRK',\n\t'HTG',\n\t'HUF',\n\t'IDR',\n\t'ILS',\n\t'IMP',\n\t'INR',\n\t'IQD',\n\t'IRR',\n\t'ISK',\n\t'JEP',\n\t'JMD',\n\t'JOD',\n\t'JPY',\n\t'KES',\n\t'KGS',\n\t'KHR',\n\t'KID',\n\t'KMF',\n\t'KRW',\n\t'KWD',\n\t'KYD',\n\t'KZT',\n\t'LAK',\n\t'LBP',\n\t'LKR',\n\t'LRD',\n\t'LSL',\n\t'LYD',\n\t'MAD',\n\t'MDL',\n\t'MGA',\n\t'MKD',\n\t'MMK',\n\t'MNT',\n\t'MOP',\n\t'MRU',\n\t'MUR',\n\t'MVR',\n\t'MWK',\n\t'MXN',\n\t'MYR',\n\t'MZN',\n\t'NAD',\n\t'NGN',\n\t'NIO',\n\t'NOK',\n\t'NPR',\n\t'NZD',\n\t'OMR',\n\t'PAB',\n\t'PEN',\n\t'PGK',\n\t'PHP',\n\t'PKR',\n\t'PLN',\n\t'PYG',\n\t'QAR',\n\t'RON',\n\t'RSD',\n\t'RUB',\n\t'RWF',\n\t'SAR',\n\t'SBD',\n\t'SCR',\n\t'SDG',\n\t'SEK',\n\t'SGD',\n\t'SHP',\n\t'SLE',\n\t'SOS',\n\t'SRD',\n\t'SSP',\n\t'STN',\n\t'SYP',\n\t'SZL',\n\t'THB',\n\t'TJS',\n\t'TMT',\n\t'TND',\n\t'TOP',\n\t'TRY',\n\t'TTD',\n\t'TVD',\n\t'TWD',\n\t'TZS',\n\t'UAH',\n\t'UGX',\n\t'USD',\n\t'UYU',\n\t'UZS',\n\t'VES',\n\t'VND',\n\t'VUV',\n\t'WST',\n\t'XAF',\n\t'XCD',\n\t'XOF',\n\t'XPF',\n\t'YER',\n\t'ZAR',\n\t'ZMW',\n\t'ZWL',\n] as const;\n\n/** List of all supported BCP 47 locales */\nexport const LOCALE_CODES = [\n\t'af-ZA',\n\t'am-ET',\n\t'ar-AE',\n\t'ar-BH',\n\t'ar-DZ',\n\t'ar-EG',\n\t'ar-IQ',\n\t'ar-JO',\n\t'ar-KW',\n\t'ar-LB',\n\t'ar-LY',\n\t'ar-MA',\n\t'ar-OM',\n\t'ar-QA',\n\t'ar-SA',\n\t'ar-SD',\n\t'ar-SY',\n\t'ar-TN',\n\t'ar-YE',\n\t'az-AZ',\n\t'be-BY',\n\t'bg-BG',\n\t'bn-BD',\n\t'bn-IN',\n\t'bs-BA',\n\t'ca-ES',\n\t'cs-CZ',\n\t'cy-GB',\n\t'da-DK',\n\t'de-AT',\n\t'de-CH',\n\t'de-DE',\n\t'el-GR',\n\t'en-AU',\n\t'en-CA',\n\t'en-GB',\n\t'en-IE',\n\t'en-IN',\n\t'en-NZ',\n\t'en-PH',\n\t'en-SG',\n\t'en-US',\n\t'en-ZA',\n\t'es-AR',\n\t'es-BO',\n\t'es-CL',\n\t'es-CO',\n\t'es-CR',\n\t'es-DO',\n\t'es-EC',\n\t'es-ES',\n\t'es-GT',\n\t'es-HN',\n\t'es-MX',\n\t'es-NI',\n\t'es-PA',\n\t'es-PE',\n\t'es-PR',\n\t'es-PY',\n\t'es-SV',\n\t'es-US',\n\t'es-UY',\n\t'es-VE',\n\t'et-EE',\n\t'eu-ES',\n\t'fa-IR',\n\t'fi-FI',\n\t'fil-PH',\n\t'fr-BE',\n\t'fr-CA',\n\t'fr-CH',\n\t'fr-FR',\n\t'ga-IE',\n\t'gl-ES',\n\t'gu-IN',\n\t'he-IL',\n\t'hi-IN',\n\t'hr-HR',\n\t'hu-HU',\n\t'hy-AM',\n\t'id-ID',\n\t'is-IS',\n\t'it-CH',\n\t'it-IT',\n\t'ja-JP',\n\t'ka-GE',\n\t'kk-KZ',\n\t'km-KH',\n\t'kn-IN',\n\t'ko-KR',\n\t'ky-KG',\n\t'lt-LT',\n\t'lv-LV',\n\t'mk-MK',\n\t'ml-IN',\n\t'mn-MN',\n\t'mr-IN',\n\t'ms-MY',\n\t'mt-MT',\n\t'nb-NO',\n\t'ne-NP',\n\t'nl-BE',\n\t'nl-NL',\n\t'pl-PL',\n\t'pt-BR',\n\t'pt-PT',\n\t'ro-RO',\n\t'ru-RU',\n\t'sk-SK',\n\t'sl-SI',\n\t'sq-AL',\n\t'sr-Latn',\n\t'sv-SE',\n\t'sw-KE',\n\t'ta-IN',\n\t'te-IN',\n\t'th-TH',\n\t'tr-TR',\n\t'uk-UA',\n\t'ur-PK',\n\t'uz-UZ',\n\t'vi-VN',\n\t'zh-CN',\n\t'zh-HK',\n\t'zh-TW',\n] as const;\n\n/** Mapping of CurrencyCodes to LocaleCodes */\nexport const CURRENCY_LOCALES = {\n\tAED: 'ar-AE', // United Arab Emirates Dirham\n\tAFN: 'fa-IR', // Afghan Afghani\n\tALL: 'sq-AL', // Albanian Lek\n\tAMD: 'hy-AM', // Armenian Dram\n\tANG: 'nl-NL', // Netherlands Antillean Guilder\n\tAOA: 'pt-AO', // Angolan Kwanza\n\tARS: 'es-AR', // Argentine Peso\n\tAUD: 'en-AU', // Australian Dollar\n\tAWG: 'nl-AW', // Aruban Florin\n\tAZN: 'az-AZ', // Azerbaijani Manat\n\tBAM: 'bs-BA', // Bosnia and Herzegovina Convertible Mark\n\tBBD: 'en-BB', // Barbadian Dollar\n\tBDT: 'bn-BD', // Bangladeshi Taka\n\tBGN: 'bg-BG', // Bulgarian Lev\n\tBHD: 'ar-BH', // Bahraini Dinar\n\tBIF: 'fr-BI', // Burundian Franc\n\tBMD: 'en-BM', // Bermudian Dollar\n\tBND: 'ms-BN', // Brunei Dollar\n\tBOB: 'es-BO', // Bolivian Boliviano\n\tBRL: 'pt-BR', // Brazilian Real\n\tBSD: 'en-BS', // Bahamian Dollar\n\tBTN: 'dz-BT', // Bhutanese Ngultrum\n\tBWP: 'en-BW', // Botswanan Pula\n\tBYN: 'be-BY', // Belarusian Ruble\n\tBZD: 'es-BZ', // Belize Dollar\n\tCAD: 'fr-CA', // Canadian Dollar\n\tCDF: 'fr-CD', // Congolese Franc\n\tCHF: 'fr-CH', // Swiss Franc\n\tCLP: 'es-CL', // Chilean Peso\n\tCNY: 'zh-CN', // Chinese Yuan\n\tCOP: 'es-CO', // Colombian Peso\n\tCRC: 'es-CR', // Costa Rican Colón\n\tCUP: 'es-CU', // Cuban Peso\n\tCVE: 'pt-CV', // Cape Verdean Escudo\n\tCZK: 'cs-CZ', // Czech Koruna\n\tDJF: 'fr-DJ', // Djiboutian Franc\n\tDKK: 'da-DK', // Danish Krone\n\tDOP: 'es-DO', // Dominican Peso\n\tDZD: 'ar-DZ', // Algerian Dinar\n\tEGP: 'ar-EG', // Egyptian Pound\n\tERN: 'ti-ER', // Eritrean Nakfa\n\tETB: 'am-ET', // Ethiopian Birr\n\tEUR: 'de-DE', // Euro\n\tFJD: 'en-FJ', // Fijian Dollar\n\tFKP: 'en-FK', // Falkland Islands Pound\n\tFOK: 'fo-FO', // Faroese Króna\n\tGBP: 'en-GB', // British Pound Sterling\n\tGEL: 'ka-GE', // Georgian Lari\n\tGGP: 'en-GG', // Guernsey Pound\n\tGHS: 'ak-GH', // Ghanaian Cedi\n\tGIP: 'en-GI', // Gibraltar Pound\n\tGMD: 'en-GM', // Gambian Dalasi\n\tGNF: 'fr-GN', // Guinean Franc\n\tGTQ: 'es-GT', // Guatemalan Quetzal\n\tGYD: 'en-GY', // Guyanaese Dollar\n\tHKD: 'zh-HK', // Hong Kong Dollar\n\tHNL: 'es-HN', // Honduran Lempira\n\tHRK: 'hr-HR', // Croatian Kuna\n\tHTG: 'ht-HT', // Haitian Gourde\n\tHUF: 'hu-HU', // Hungarian Forint\n\tIDR: 'id-ID', // Indonesian Rupiah\n\tILS: 'he-IL', // Israeli New Shekel\n\tIMP: 'en-IM', // Isle of Man Pound\n\tINR: 'hi-IN', // Indian Rupee\n\tIQD: 'ar-IQ', // Iraqi Dinar\n\tIRR: 'fa-IR', // Iranian Rial\n\tISK: 'is-IS', // Icelandic Króna\n\tJEP: 'en-JE', // Jersey Pound\n\tJMD: 'en-JM', // Jamaican Dollar\n\tJOD: 'ar-JO', // Jordanian Dinar\n\tJPY: 'ja-JP', // Japanese Yen\n\tKES: 'sw-KE', // Kenyan Shilling\n\tKGS: 'ky-KG', // Kyrgyzstani Som\n\tKHR: 'km-KH', // Cambodian Riel\n\tKID: 'en-KI', // Kiribati Dollar\n\tKMF: 'fr-KM', // Comorian Franc\n\tKRW: 'ko-KR', // South Korean Won\n\tKWD: 'ar-KW', // Kuwaiti Dinar\n\tKYD: 'en-KY', // Cayman Islands Dollar\n\tKZT: 'kk-KZ', // Kazakhstani Tenge\n\tLAK: 'lo-LA', // Laotian Kip\n\tLBP: 'ar-LB', // Lebanese Pound\n\tLKR: 'si-LK', // Sri Lankan Rupee\n\tLRD: 'en-LR', // Liberian Dollar\n\tLSL: 'st-LS', // Lesotho Loti\n\tLYD: 'ar-LY', // Libyan Dinar\n\tMAD: 'ar-MA', // Moroccan Dirham\n\tMDL: 'ro-RO', // Moldovan Leu\n\tMGA: 'mg-MG', // Malagasy Ariary\n\tMKD: 'mk-MK', // Macedonian Denar\n\tMMK: 'my-MM', // Burmese Kyat\n\tMNT: 'mn-MN', // Mongolian Tugrik\n\tMOP: 'pt-MO', // Macanese Pataca\n\tMRU: 'ar-MA', // Mauritanian Ouguiya\n\tMUR: 'en-MU', // Mauritian Rupee\n\tMVR: 'dv-MV', // Maldivian Rufiyaa\n\tMWK: 'ny-MW', // Malawian Kwacha\n\tMXN: 'es-MX', // Mexican Peso\n\tMYR: 'ms-MY', // Malaysian Ringgit\n\tMZN: 'pt-MZ', // Mozambican Metical\n\tNAD: 'en-NA', // Namibian Dollar\n\tNGN: 'en-NG', // Nigerian Naira\n\tNIO: 'es-NI', // Nicaraguan Córdoba\n\tNOK: 'no-NO', // Norwegian Krone\n\tNPR: 'ne-NP', // Nepalese Rupee\n\tNZD: 'en-NZ', // New Zealand Dollar\n\tOMR: 'ar-OM', // Omani Rial\n\tPAB: 'es-PA', // Panamanian Balboa\n\tPEN: 'es-PE', // Peruvian Nuevo Sol\n\tPGK: 'en-PG', // Papua New Guinean Kina\n\tPHP: 'fil-PH', // Philippine Peso\n\tPKR: 'ur-PK', // Pakistani Rupee\n\tPLN: 'pl-PL', // Polish Zloty\n\tPYG: 'es-PY', // Paraguayan Guarani\n\tQAR: 'ar-QA', // Qatari Rial\n\tRON: 'ro-RO', // Romanian Leu\n\tRSD: 'sr-RS', // Serbian Dinar\n\tRUB: 'ru-RU', // Russian Ruble\n\tRWF: 'rw-RW', // Rwandan Franc\n\tSAR: 'ar-SA', // Saudi Riyal\n\tSBD: 'en-SB', // Solomon Islands Dollar\n\tSCR: 'en-SC', // Seychellois Rupee\n\tSDG: 'ar-SD', // Sudanese Pound\n\tSEK: 'sv-SE', // Swedish Krona\n\tSGD: 'en-SG', // Singapore Dollar\n\tSHP: 'en-SH', // Saint Helena Pound\n\tSLE: 'en-SL', // Sierra Leonean Leone\n\tSOS: 'so-SO', // Somali Shilling\n\tSRD: 'nl-SR', // Surinamese Dollar\n\tSSP: 'en-SS', // South Sudanese Pound\n\tSTN: 'st-ST', // São Tomé and Príncipe Dobra\n\tSYP: 'ar-SY', // Syrian Pound\n\tSZL: 'en-SZ', // Swazi Lilangeni\n\tTHB: 'th-TH', // Thai Baht\n\tTJS: 'tg-TJ', // Tajikistani Somoni\n\tTMT: 'tk-TM', // Turkmenistan Manat\n\tTND: 'ar-TN', // Tunisian Dinar\n\tTOP: 'to-TO', // Tongan Paʻanga\n\tTRY: 'tr-TR', // Turkish Lira\n\tTTD: 'en-TT', // Trinidad and Tobago Dollar\n\tTVD: 'en-TV', // Tuvaluan Dollar\n\tTWD: 'zh-TW', // New Taiwan Dollar\n\tTZS: 'sw-TZ', // Tanzanian Shilling\n\tUAH: 'uk-UA', // Ukrainian Hryvnia\n\tUGX: 'sw-UG', // Ugandan Shilling\n\tUSD: 'en-US', // United States Dollar\n\tUYU: 'es-UY', // Uruguayan Peso\n\tUZS: 'uz-UZ', // Uzbekistani Som\n\tVES: 've-VE', // Venezuelan Bolívar\n\tVND: 'vi-VN', // Vietnamese Dong\n\tVUV: 'en-VU', // Vanuatu Vatu\n\tWST: 'en-WS', // Samoan Tala\n\tXAF: 'fr-XAF', // Central African CFA Franc\n\tXCD: 'en-XCD', // East Caribbean Dollar\n\tXOF: 'fr-XOF', // West African CFA Franc\n\tXPF: 'fr-XPF', // CFP Franc\n\tYER: 'ar-YE', // Yemeni Rial\n\tZAR: 'en-ZA', // South African Rand\n\tZMW: 'en-ZM', // Zambian Kwacha\n\tZWL: 'en-ZW', // Zimbabwean Dollar\n} as const;\n\n/** * Fiat currencies supported by Frankfurter API */\nexport const SUPPORTED_CURRENCIES = [\n\t'AUD',\n\t'BGN',\n\t'BRL',\n\t'CAD',\n\t'CHF',\n\t'CNY',\n\t'CZK',\n\t'DKK',\n\t'EUR',\n\t'GBP',\n\t'HKD',\n\t'HUF',\n\t'IDR',\n\t'ILS',\n\t'INR',\n\t'ISK',\n\t'JPY',\n\t'KRW',\n\t'MXN',\n\t'MYR',\n\t'NOK',\n\t'NZD',\n\t'PHP',\n\t'PLN',\n\t'RON',\n\t'SEK',\n\t'SGD',\n\t'THB',\n\t'TRY',\n\t'USD',\n\t'ZAR',\n] as const;\n\n/** * Unit names and their full readable labels. */\nexport const UNITS = {\n\t// Length\n\tm: 'Meter',\n\tkm: 'Kilometer',\n\tmi: 'Mile',\n\tft: 'Foot',\n\n\t// Mass / Weight\n\tkg: 'Kilogram',\n\tlbs: 'Pound',\n\tg: 'Gram',\n\toz: 'Ounce',\n\n\t// Temperature\n\tC: 'Celsius',\n\tF: 'Fahrenheit',\n\tK: 'Kelvin',\n\n\t// Volume\n\tl: 'Liter',\n\tgal: 'Gallon',\n\n\t// Area\n\tsqm: 'Square Meter',\n\tsqft: 'Square Foot',\n\n\t// Speed\n\tkmph: 'Kilometer per Hour',\n\tmph: 'Miles per Hour',\n\n\t// Time\n\th: 'Hour',\n\tmin: 'Minute',\n\tsec: 'Second',\n\td: 'Day',\n\n\t// Digital Storage\n\tkb: 'Kilobyte',\n\tmb: 'Megabyte',\n\tgb: 'Gigabyte',\n\n\t// Energy\n\tj: 'Joule',\n\tcal: 'Calorie',\n\n\t// Pressure\n\tatm: 'Atmosphere',\n\tpa: 'Pascal',\n\n\t// Frequency\n\thz: 'Hertz',\n\tkhz: 'Kilohertz',\n} as const;\n\n/** * Scientific SI Unit prefix multipliers. */\nexport const PREFIX_MULTIPLIERS = {\n\ty: 1e-24,\n\tz: 1e-21,\n\ta: 1e-18,\n\tf: 1e-15,\n\tp: 1e-12,\n\tn: 1e-9,\n\tμ: 1e-6,\n\tu: 1e-6,\n\tm: 1e-3,\n\tc: 1e-2,\n\td: 1e-1,\n\tda: 1e1,\n\th: 1e2,\n\tk: 1e3,\n\tM: 1e6,\n\tG: 1e9,\n\tT: 1e12,\n\tP: 1e15,\n\tE: 1e18,\n\tZ: 1e21,\n\tY: 1e24,\n\t'': 1, // base unit, like meter, gram, byte etc.\n} as const;\n","import { ONES, TEENS, TENS } from './constants';\n\n/**\n * Apply multiples of a number if there is any.\n * @param array Array of numbers to apply the condition on.\n * @param multiples The multiples of which number.\n * @returns Array of multiples of the desired number\n */\nexport const _applyMultiples = (\n\tarray: number[],\n\tmultiples?: number,\n): number[] => {\n\tif (!multiples) return array;\n\treturn array?.filter((n) => n % multiples === 0);\n};\n\n/**\n * - Converts a number less than 1000 to words.\n * @param num - The number to convert (less than 1000).\n * @param isLast - Whether this is the last group (thousands, millions, etc.).\n * @returns Numbers less than 1000 in words.\n */\nexport function _convertLessThanThousand(num: number, isLast: boolean): string {\n\tif (num < 10) return ONES[num];\n\n\tif (num < 20) return TEENS[num - 10];\n\n\tlet result = TENS[Math.floor(num / 10)];\n\n\tconst remainder = num % 10;\n\n\tif (remainder > 0) result += `-${ONES[remainder]}`;\n\n\tif (num >= 100) {\n\t\tconst hundredsPart = `${ONES[Math.floor(num / 100)]} hundred`;\n\n\t\treturn num % 100 === 0 ?\n\t\t\t\thundredsPart\n\t\t\t:\t`${hundredsPart} ${isLast ? 'and' : ''} ${_convertLessThanThousand(num % 100, false)}`;\n\t}\n\n\treturn result;\n}\n\n/**\n * * Calculate the HCF (Highest Common Factor) of two numbers using the Euclidean algorithm.\n *\n * @param a - First number.\n * @param b - Second number.\n * @returns The HCF of the two numbers.\n */\nexport const _find2NumbersHCF = (a: number, b: number): number => {\n\tlet x = Math.abs(a);\n\tlet y = Math.abs(b);\n\n\twhile (y !== 0) {\n\t\tconst temp = y;\n\n\t\ty = x % y;\n\t\tx = temp;\n\t}\n\n\treturn x;\n};\n\n/**\n * * Calculate the LCM (Least Common Multiple) of two numbers using the Euclidean algorithm.\n *\n * @param a - First number.\n * @param b - Second number.\n * @returns The LCM of the two numbers.\n */\nexport const _find2NumbersLCM = (a: number, b: number): number => {\n\tconst x = Math.abs(a);\n\tconst y = Math.abs(b);\n\n\treturn (x * y) / _find2NumbersHCF(x, y);\n};\n","import { isNumber } from '../guards/primitives';\nimport type { Numeric } from '../types';\nimport { _find2NumbersHCF, _find2NumbersLCM } from './helpers';\nimport type {\n\tConvertedDecimal,\n\tDecimalOptions,\n\tRandomNumberOptions,\n} from './types';\n\n/**\n * * Utility to generate a random number between a given range.\n * * If no options are provided, it will generate a random number between `0` and `100` (inclusive).\n * * If `min` is greater than `max`, it will swap the values and generate a random number.\n *\n * @param options - Options for configuring random number generator.\n * @returns Random number.\n */\nexport const getRandomNumber = (options?: RandomNumberOptions): number => {\n\tconst {\n\t\tmin = 0,\n\t\tmax = 100,\n\t\tincludeMin = true,\n\t\tincludeMax = true,\n\t} = options || {};\n\n\tlet minimum = min,\n\t\tmaximum = max;\n\n\tif (min > max) {\n\t\t[minimum, maximum] = [max, min];\n\n\t\treturn getRandomNumber({\n\t\t\tmin: minimum,\n\t\t\tmax: maximum,\n\t\t\tincludeMin,\n\t\t\tincludeMax,\n\t\t});\n\t}\n\n\tif (min === max) {\n\t\treturn min;\n\t}\n\n\tif (includeMin && includeMax) {\n\t\t// Generate random number between min and max, inclusive\n\t\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t}\n\n\tif (!includeMin && !includeMax) {\n\t\t// Generate random number between min and max, exclusive\n\t\treturn Math.floor(Math.random() * (max - min - 1)) + min + 1;\n\t}\n\n\tif (includeMin && !includeMax) {\n\t\t// Generate random number between min and max, inclusive of min but exclusive of max\n\t\treturn Math.floor(Math.random() * (max - min)) + min;\n\t}\n\n\tif (!includeMin && includeMax) {\n\t\t// Generate random number between min and max, exclusive of min but inclusive of max\n\t\treturn Math.floor(Math.random() * (max - min)) + min + 1;\n\t}\n\n\treturn 0;\n};\n\n/**\n * * Utility to round a number to given decimal places.\n *\n * @param input - Number or `stringified` number to round.\n * @param options - Options for rounding behavior, including decimal places and return type.\n * @returns Converted number as `number` (default) or `string` (if `isString` is `true`).\n */\nexport const convertToDecimal = <T extends boolean | undefined = false>(\n\tinput: Numeric,\n\toptions?: DecimalOptions<T>,\n): ConvertedDecimal<T> => {\n\tconst { decimalPlaces = 2, isString = false } = options || {};\n\n\tconst number = typeof input === 'number' ? input : Number(input);\n\n\treturn isString ?\n\t\t\t(number.toFixed(decimalPlaces) as ConvertedDecimal<T>)\n\t\t:\t(Number(number.toFixed(decimalPlaces)) as ConvertedDecimal<T>);\n};\n\n/**\n * * Calculates the HCF/GCD of multiple numbers.\n *\n * @param numbers - List of numbers to find the HCF/GCD for.\n * @returns The HCF/GCD of all the provided numbers.\n */\nexport const calculateHCF = (...numbers: Numeric[]): number => {\n\tconst converted = numbers?.map(Number);\n\n\tif (converted?.length === 0) return 0;\n\n\tlet hcf = converted[0];\n\n\tfor (let i = 1; i < converted?.length; i++) {\n\t\thcf = _find2NumbersHCF(hcf, converted[i]);\n\t}\n\n\treturn hcf;\n};\n\n/**\n * * Calculates the LCM/LCD of multiple numbers.\n *\n * @param numbers - List of numbers to find the LCM/LCD for.\n * @returns The LCM/LCD of all the provided numbers.\n */\nexport const calculateLCM = (...numbers: Numeric[]): number => {\n\tconst converted = numbers?.map(Number);\n\n\tif (converted?.length === 0) return 0;\n\n\tlet lcm = converted[0];\n\n\tfor (let i = 1; i < converted?.length; i++) {\n\t\tlcm = _find2NumbersLCM(lcm, converted[i]);\n\t}\n\n\treturn lcm;\n};\n\n/**\n * * Sums up all digits of a number.\n *\n * @param num The input number.\n * @returns The sum of its digits.\n */\nexport function sumDigits(num: Numeric): number {\n\treturn Math.abs(Number(num))\n\t\t.toString()\n\t\t.split('')\n\t\t.reduce((sum, digit) => sum + Number(digit), 0);\n}\n\n/**\n * * Sums up numbers.\n *\n * @param numbers The input numbers.\n * @returns The sum of the numbers.\n */\nexport function sumNumbers(...numbers: Numeric[]): number {\n\treturn numbers\n\t\t?.map((num) => Number(num))\n\t\t?.reduce((sum, number) => sum + number, 0);\n}\n\n/**\n * * Reverses a number (e.g., `123` → `321`).\n *\n * @param num The number to reverse.\n * @returns The reversed number.\n */\nexport function reverseNumber(num: Numeric): number {\n\tconst reversed = parseInt(\n\t\tMath.abs(Number(num)).toString().split('').reverse().join(''),\n\t\t10,\n\t);\n\n\treturn Number(num) < 0 ? -reversed : reversed;\n}\n\n/**\n * * Calculates the average of a set of numbers.\n *\n * @param numbers - A list of numbers for which to calculate the average.\n * @returns The average of the provided numbers. Returns `NaN` if no numbers are valid.\n */\nexport function getAverage(...numbers: Numeric[]): number {\n\tlet sum = 0;\n\tlet count = 0;\n\n\tfor (const n of numbers) {\n\t\tconst num = Number(n);\n\t\tif (typeof num === 'number' && !isNaN(num)) {\n\t\t\tsum += num;\n\t\t\tcount++;\n\t\t}\n\t}\n\n\treturn count === 0 ? NaN : Math.round((sum / count) * 1000) / 1000;\n}\n\n/**\n * * Rounds a number to a specified number of decimal places.\n *\n * @param number - The number to round.\n * @param roundTo - The number of decimal places to round to (default is `2`).\n * - If `roundTo` is negative, the number is rounded to the left of the decimal point (e.g., `-1` rounds to the nearest 10, `-2` to nearest 100 etc.).\n * @returns The rounded number, either in float or integer (if a whole number).\n *\n * @example\n * roundNumber(1234.56, -2); // 1200\n * roundNumber(1234.56, 1); // 1234.6\n */\nexport function roundNumber(number: Numeric, roundTo = 2): number {\n\tconst factor = Math.pow(10, roundTo);\n\n\tconst num = isNumber(number) ? number : Number(number);\n\n\treturn Math.round(num * factor) / factor;\n}\n","import type { Numeric } from '../types';\nimport { CURRENCY_LOCALES } from './constants';\nimport type { CurrencyCode, LocaleCode } from './types';\n\n/**\n * * Rounds a number to the nearest specified interval.\n * @param value - The number to round.\n * @param interval - The interval to round to. Defaults to `5`.\n * @returns The number rounded to the nearest interval.\n * @example roundToNearest(27, 5) → 25\n */\nexport const roundToNearest = (value: Numeric, interval = 5): number => {\n\treturn Math.round(Number(value) / interval) * interval;\n};\n\n/**\n * * Formats a number as a currency string.\n * @param value - The number to format.\n * @param currency - The currency code (default: `USD`).\n * @param locale - The locale for formatting (default: matching currency locale).\n * @returns A formatted currency string.\n * @example formatCurrency(1234.56) → \"$1,234.56\"\n * @example formatCurrency(1234.56, \"USD\") → \"$1,234.56\"\n * @example formatCurrency(1234.56, \"USD\", \"en-US\") → \"$1,234.56\"\n */\nexport const formatCurrency = (\n\tvalue: Numeric,\n\tcurrency: CurrencyCode = 'USD',\n\tlocale?: LocaleCode,\n): string => {\n\tconst selectedLocale: LocaleCode =\n\t\tlocale ? locale : CURRENCY_LOCALES[currency];\n\n\treturn new Intl.NumberFormat(selectedLocale, {\n\t\tstyle: 'currency',\n\t\tcurrency,\n\t}).format(value);\n};\n\n/**\n * * Clamps a number within a specified range.\n * @param value - The number to clamp.\n * @param min - The minimum allowed value.\n * @param max - The maximum allowed value.\n * @returns The clamped number.\n * @example clampNumber(15, 10, 20) → 15\n * @example clampNumber(5, 10, 20) → 10\n * @example clampNumber(25, 10, 20) → 20\n */\nexport const clampNumber = (\n\tvalue: number,\n\tmin: number,\n\tmax: number,\n): number => {\n\treturn Math.max(min, Math.min(value, max));\n};\n\n/**\n * * Generates a random floating-point number within a range.\n * @param min - The minimum value.\n * @param max - The maximum value.\n * @returns A random floating-point number between min and max.\n * @example randomFloat(1.5, 3.5) → 2.84623\n */\nexport const getRandomFloat = (min: Numeric, max: Numeric): number => {\n\treturn Math.random() * (Number(max) - Number(min)) + Number(min);\n};\n\n/**\n * * Returns the ordinal suffix for a given number (e.g., 1 -> 'st', 2 -> 'nd', 3 -> 'rd', 4 -> 'th' etc.).\n * @description The function handles special cases for 11, 12, and 13, which all use 'th' despite the last digit.\n * If the `withNumber` parameter is `true`, the function returns the number along with its ordinal suffix (e.g., \"1st\").\n * Otherwise, it returns only the ordinal suffix (e.g., \"st\").\n *\n * @param num - The number or number string to get the ordinal suffix for.\n * @param withNumber - Whether to include the number along with its ordinal suffix (defaults to `true`).\n * @returns The appropriate ordinal suffix, optionally with the number (e.g., '1st' or 'st`, '2nd' or 'nd' and so on.).\n */\nexport const getOrdinal = (num: Numeric, withNumber = true): string => {\n\tconst remainder10 = Number(num) % 10;\n\tconst remainder100 = Number(num) % 100;\n\n\tlet suffix: string;\n\n\tif (remainder10 === 1 && remainder100 !== 11) {\n\t\tsuffix = 'st';\n\t} else if (remainder10 === 2 && remainder100 !== 12) {\n\t\tsuffix = 'nd';\n\t} else if (remainder10 === 3 && remainder100 !== 13) {\n\t\tsuffix = 'rd';\n\t} else {\n\t\tsuffix = 'th';\n\t}\n\n\treturn withNumber ? String(num).concat(suffix) : suffix;\n};\n","import type { Numeric } from '../types';\nimport type {\n\tConvertOptions,\n\tCurrencyCode,\n\tFrankFurter,\n\tLocaleCode,\n\tSupportedCurrency,\n} from './types';\nimport { formatCurrency } from './utilities';\n\n// const rateCache: Map<string, number> = new Map();\n\n/**\n * * A utility class for handling currency operations like formatting and conversion.\n *\n * - Supports formatting based on locale.\n * - Converts between **fiat currencies supported by `api.frankfurter.app`**.\n * - Automatically caches conversion rates to reduce redundant API calls.\n * - Intended for use with numeric inputs (number or numeric string).\n */\nexport class Currency {\n\treadonly #amount: number;\n\treadonly #code: CurrencyCode;\n\t/**\n\t * * The formatted currency string (e.g., `$1,000.00`).\n\t *\n\t * - Generated using the `en-US` locale during construction.\n\t * - This is a display-friendly version of the currency value.\n\t * - For formatting with other locales, use the `format(locale)` method.\n\t */\n\treadonly currency: string;\n\n\t/**\n\t * Creates an instance of the Currency class.\n\t *\n\t * @param amount - The numeric amount of currency (e.g., `100`, `'99.99'`).\n\t * @param code - The ISO 4217 currency code representing the currency (e.g., `'USD'`, `'EUR'`).\n\t */\n\tconstructor(amount: Numeric, code: CurrencyCode) {\n\t\tthis.#amount = Number(amount);\n\t\tthis.#code = code;\n\t\tthis.currency = this.format('en-US');\n\t}\n\n\tstatic readonly #rateCache: Map<string, number> = new Map();\n\n\t/** * Clears cached rates that were fetched previously. */\n\tstatic clearRateCache(): void {\n\t\tCurrency.#rateCache.clear();\n\t}\n\n\t/**\n\t * @instance Formats the currency for a given locale.\n\t * @param locale - The target locale (e.g., 'de-DE')\n\t * @returns The formatted currency string\n\t */\n\tformat(locale?: LocaleCode): string {\n\t\treturn formatCurrency(this.#amount, this.#code, locale);\n\t}\n\n\t/**\n\t * @instance Converts the current currency amount to a target currency using real-time exchange rates.\n\t *\n\t * - Uses `api.frankfurter.app` to fetch live exchange rates.\n\t * - Supports **only the following fiat currencies**:\n\t * `AUD`, `BGN`, `BRL`, `CAD`, `CHF`, `CNY`, `CZK`, `DKK`, `EUR`, `GBP`, `HKD`, `HUF`, `IDR`, `ILS`, `INR`, `ISK`, `JPY`,\n\t * `KRW`, `MXN`, `MYR`, `NOK`, `NZD`, `PHP`, `PLN`, `RON`, `SEK`, `SGD`, `THB`, `TRY`, `USD`, `ZAR`.\n\t * - Uses cached rates unless `forceRefresh` is set to `true`.\n\t * - If API fails or currency not supported, falls back to `fallbackRate` if provided.\n\t *\n\t * @param to - The target currency code (must be one of the supported ones, e.g., `'EUR'`, `'USD'`).\n\t * @param options - Optional settings:\n\t * - `fallbackRate`: A manual exchange rate to use if the API call fails or currency is not supported.\n\t * - `forceRefresh`: If true, ignores cached rates and fetches fresh data.\n\t * @returns The converted amount as a number.\n\t * @throws Will throw if the API call fails and no `fallbackRate` is provided.\n\t */\n\tasync convert(\n\t\tto: SupportedCurrency | CurrencyCode,\n\t\toptions?: ConvertOptions,\n\t): Promise<number> {\n\t\tconst key = `${this.#code}->${to}`;\n\n\t\tif (!options?.forceRefresh && Currency.#rateCache.has(key)) {\n\t\t\tconst cachedRate = Currency.#rateCache.get(key)!;\n\n\t\t\treturn this.#amount * cachedRate;\n\t\t}\n\n\t\ttry {\n\t\t\tconst rate = await this.#fetchFromFrankfurter(to);\n\t\t\tCurrency.#rateCache.set(key, rate);\n\n\t\t\treturn this.#amount * rate;\n\t\t} catch (error) {\n\t\t\tif (options?.fallbackRate != null) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Currency conversion failed (${this.#code} → ${to}): ${(error as Error).message}. Using fallback rate...`,\n\t\t\t\t);\n\n\t\t\t\treturn this.#amount * options.fallbackRate;\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t`Currency conversion failed (${this.#code} → ${to}): ${(error as Error).message}`,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * @private Attempts to fetch rate from frankfurter.app\n\t * @param to - Target currency code\n\t * @returns Exchange rate (multiplier)\n\t */\n\tasync #fetchFromFrankfurter(to: CurrencyCode): Promise<number> {\n\t\tconst url = `https://api.frankfurter.app/latest?amount=${this.#amount}&from=${this.#code}`;\n\n\t\ttry {\n\t\t\tconst res = await fetch(url, { redirect: 'error' });\n\n\t\t\tif (!res.ok)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`FrankFurter Error: ${res.status}. \"${res.statusText}\"`,\n\t\t\t\t);\n\n\t\t\tconst data: FrankFurter = await res.json();\n\n\t\t\tif (!data.rates?.[to]) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Currency \"${to}\" not found in FrankFurter Database!`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn data.rates[to] / this.#amount;\n\t\t} catch (error) {\n\t\t\tthrow new Error(\n\t\t\t\t(error as Error).message ||\n\t\t\t\t\t`Failed to fetch data from FrankFurter API`,\n\t\t\t);\n\t\t}\n\t}\n}\n","import { PREFIX_MULTIPLIERS } from './constants';\nimport type { SIPrefix, UnitKey, UnitNumberMethods } from './types';\n\n/**\n * @class Represents a measurable unit and supports conversions between various types of units.\n *\n * Includes static methods for:\n * - Length: meters, feet, kilometers, miles\n * - Mass: kilograms, pounds, grams, ounces\n * - Temperature: Celsius, Fahrenheit, Kelvin\n * - Volume: liters, gallons\n * - Area: square meters, square feet\n * - Speed: km/h, mph\n * - Time: hours, minutes, seconds, days\n * - Digital Storage: kilobytes, megabytes, gigabytes\n * - Energy: joules, calories\n * - Pressure: atm, pascals\n * - Frequency: Hz, kHz\n */\nexport class Unit {\n\treadonly #value: number;\n\treadonly #unit?: UnitKey;\n\n\t/**\n\t * * Creates an instance of the Unit class.\n\t * @param value The numeric value to work with.\n\t * @param unit The unit type of the value (e.g., 'kg', 'm', 'kb').\n\t */\n\tconstructor(value: number, unit?: UnitKey) {\n\t\tthis.#value = value;\n\t\tthis.#unit = unit;\n\t}\n\n\t/**\n\t * @instance Returns the original value with unit (if passed in the constructor).\n\t * @returns A string in the format \"value unit\".\n\t */\n\ttoString(): string {\n\t\treturn `${this.#value} ${this.#unit ?? ''}`.trim();\n\t}\n\n\t/**\n\t * @instance Converts using scientific prefixes (e.g., kB to MB, mg to g).\n\t *\n\t * @param fromPrefix The SI prefix of the source unit.\n\t * @param toPrefix The SI prefix of the target unit.\n\t * @returns The converted numeric value.\n\t */\n\tconvertByPrefix(fromPrefix: SIPrefix, toPrefix: SIPrefix): number {\n\t\treturn Unit.convertByPrefix(this.#value, fromPrefix, toPrefix);\n\t}\n\n\t/**\n\t * @instance Converts from prefixed unit string to another (e.g., kB to MB, mg to g).\n\t *\n\t * @param from Prefixed unit string (e.g., 'kB', 'mg').\n\t * @param to Target prefixed unit string (e.g., 'MB', 'g').\n\t * @returns The converted numeric value.\n\t */\n\tconvertFromTo(from: string, to: string): number {\n\t\treturn Unit.convertFromTo(this.#value, from, to);\n\t}\n\n\t/**\n\t * @instance Converts the value using a static method name from the `Unit` class.\n\t *\n\t * - **N.B.** *Provides IntelliSense and type safety for method selection.*\n\t *\n\t * @param methodName - A static `Unit` method that accepts a number and returns a number.\n\t * @returns The converted numeric value.\n\t */\n\tconvert(methodName: UnitNumberMethods): number {\n\t\tconst method = Unit[methodName];\n\n\t\tif (typeof method !== 'function') {\n\t\t\tthrow new Error(`Method ${methodName} is not a valid method!`);\n\t\t}\n\n\t\treturn method(this.#value);\n\t}\n\n\t// ! ----- Static Conversion Methods ----- ! //\n\n\t/**\n\t * @static Converts a value using scientific prefixes (e.g., kB to MB, mg to g).\n\t *\n\t * @param value The value to convert.\n\t * @param fromPrefix The SI prefix of the source unit.\n\t * @param toPrefix The SI prefix of the target unit.\n\t * @returns The converted numeric value.\n\t */\n\tstatic convertByPrefix(\n\t\tvalue: number,\n\t\tfromPrefix: SIPrefix,\n\t\ttoPrefix: SIPrefix,\n\t): number {\n\t\tconst fromMultiplier = PREFIX_MULTIPLIERS[fromPrefix];\n\t\tconst toMultiplier = PREFIX_MULTIPLIERS[toPrefix];\n\n\t\treturn (value * fromMultiplier) / toMultiplier;\n\t}\n\n\t/**\n\t * @static Converts from prefixed unit string to another (e.g., kB to MB, mg to g).\n\t *\n\t * @param value The numeric value.\n\t * @param from Prefixed unit string (e.g., 'kB', 'mg').\n\t * @param to Target prefixed unit string (e.g., 'MB', 'g').\n\t * @returns The converted numeric value.\n\t */\n\tstatic convertFromTo(value: number, from: string, to: string): number {\n\t\tconst extractPrefix = (str: string): [SIPrefix, string] => {\n\t\t\tconst match = str.match(/^(da|[yzafpnμumcdhkMGTPEZY]?)(.+)$/);\n\t\t\tif (!match) throw new Error(`Invalid unit format: ${str}`);\n\n\t\t\treturn [match[1] as SIPrefix, match[2]];\n\t\t};\n\n\t\tconst [fromPrefix, fromUnit] = extractPrefix(from);\n\t\tconst [toPrefix, toUnit] = extractPrefix(to);\n\n\t\tif (fromUnit !== toUnit) {\n\t\t\tthrow new Error(`Mismatched units: ${fromUnit} vs ${toUnit}`);\n\t\t}\n\n\t\treturn Unit.convertByPrefix(value, fromPrefix, toPrefix);\n\t}\n\n\t/** Converts meters to feet. */\n\tstatic metersToFeet(m: number): number {\n\t\treturn m * 3.28084;\n\t}\n\n\t/** Converts feet to meters. */\n\tstatic feetToMeters(ft: number): number {\n\t\treturn ft / 3.28084;\n\t}\n\n\t/** Converts kilometers to miles. */\n\tstatic kmToMiles(km: number): number {\n\t\treturn km * 0.621371;\n\t}\n\n\t/** Converts miles to kilometers. */\n\tstatic milesToKm(mi: number): number {\n\t\treturn mi / 0.621371;\n\t}\n\n\t/** Converts kilograms to pounds. */\n\tstatic kgToLbs(kg: number): number {\n\t\treturn kg * 2.20462;\n\t}\n\n\t/** Converts pounds to kilograms. */\n\tstatic lbsToKg(lbs: number): number {\n\t\treturn lbs / 2.20462;\n\t}\n\n\t/** Converts grams to ounces. */\n\tstatic gramsToOunces(g: number): number {\n\t\treturn g * 0.035274;\n\t}\n\n\t/** Converts ounces to grams. */\n\tstatic ouncesToGrams(oz: number): number {\n\t\treturn oz / 0.035274;\n\t}\n\n\t/** Converts Celsius to Fahrenheit. */\n\tstatic celsiusToFahrenheit(c: number): number {\n\t\treturn (c * 9) / 5 + 32;\n\t}\n\n\t/** Converts Fahrenheit to Celsius. */\n\tstatic fahrenheitToCelsius(f: number): number {\n\t\treturn ((f - 32) * 5) / 9;\n\t}\n\n\t/** Converts Celsius to Kelvin. */\n\tstatic celsiusToKelvin(c: number): number {\n\t\treturn c + 273.15;\n\t}\n\n\t/** Converts Kelvin to Celsius. */\n\tstatic kelvinToCelsius(k: number): number {\n\t\treturn k - 273.15;\n\t}\n\n\t/** Converts Fahrenheit to Kelvin. */\n\tstatic fahrenheitToKelvin(f: number): number {\n\t\treturn ((f - 32) * 5) / 9 + 273.15;\n\t}\n\n\t/** Converts Kelvin to Fahrenheit. */\n\tstatic kelvinToFahrenheit(k: number): number {\n\t\treturn ((k - 273.15) * 9) / 5 + 32;\n\t}\n\n\t/** Converts milliliters to liters. */\n\tstatic mlToLiters(ml: number): number {\n\t\treturn ml / 1000;\n\t}\n\n\t/** Converts liters to milliliters. */\n\tstatic litersToMl(l: number): number {\n\t\treturn l * 1000;\n\t}\n\n\t/** Converts gallons to milliliters. */\n\tstatic gallonsToMl(gal: number): number {\n\t\treturn gal * 3785.41;\n\t}\n\n\t/** Converts milliliters to gallons. */\n\tstatic mlToGallons(ml: number): number {\n\t\treturn ml / 3785.41;\n\t}\n\n\t/** Converts liters to gallons. */\n\tstatic litersToGallons(l: number): number {\n\t\treturn l * 0.264172;\n\t}\n\n\t/** Converts gallons to liters. */\n\tstatic gallonsToLiters(gal: number): number {\n\t\treturn gal / 0.264172;\n\t}\n\n\t/** Converts square meters to square feet. */\n\tstatic sqmToSqft(sqm: number): number {\n\t\treturn sqm * 10.7639;\n\t}\n\n\t/** Converts square feet to square meters. */\n\tstatic sqftToSqm(sqft: number): number {\n\t\treturn sqft / 10.7639;\n\t}\n\n\t/** Converts kilometers per hour to miles per hour. */\n\tstatic kmphToMph(kmph: number): number {\n\t\treturn kmph * 0.621371;\n\t}\n\n\t/** Converts miles per hour to kilometers per hour. */\n\tstatic mphToKmph(mph: number): number {\n\t\treturn mph / 0.621371;\n\t}\n\n\t/** Converts minutes to hours. */\n\tstatic minutesToHours(min: number): number {\n\t\treturn min / 60;\n\t}\n\n\t/** Converts seconds to minutes. */\n\tstatic secondsToMinutes(sec: number): number {\n\t\treturn sec / 60;\n\t}\n\n\t/** Converts hours to days. */\n\tstatic hoursToDays(hr: number): number {\n\t\treturn hr / 24;\n\t}\n\n\t/** Converts hours to minutes. */\n\tstatic hoursToMinutes(h: number): number {\n\t\treturn h * 60;\n\t}\n\n\t/** Converts minutes to seconds. */\n\tstatic minutesToSeconds(m: number): number {\n\t\treturn m * 60;\n\t}\n\n\t/** Converts days to hours. */\n\tstatic daysToHours(d: number): number {\n\t\treturn d * 24;\n\t}\n\n\t/** Converts megabytes to gigabytes. */\n\tstatic mbToGb(mb: number): number {\n\t\treturn mb / 1024;\n\t}\n\n\t/** Converts gigabytes to megabytes. */\n\tstatic gbToMb(gb: number): number {\n\t\treturn gb * 1024;\n\t}\n\n\t/** Converts kilobytes to megabytes. */\n\tstatic kbToMb(kb: number): number {\n\t\treturn kb / 1024;\n\t}\n\n\t/** Converts kilobytes to gigabytes. */\n\tstatic kbToGb(kb: number): number {\n\t\treturn kb / (1024 * 1024);\n\t}\n\n\t/** Converts gigabytes to kilobytes. */\n\tstatic gbToKb(gb: number): number {\n\t\treturn gb * 1024 * 1024;\n\t}\n\n\t/** Converts bytes to kilobytes. */\n\tstatic bytesToKb(bytes: number): number {\n\t\treturn bytes / 1024;\n\t}\n\n\t/** Converts kilobytes to bytes. */\n\tstatic kbToBytes(kb: number): number {\n\t\treturn kb * 1024;\n\t}\n\n\t/** Converts megabytes to kilobytes. */\n\tstatic mbToKb(mb: number): number {\n\t\treturn mb * 1024;\n\t}\n\n\t/** Converts gigabytes to terabytes. */\n\tstatic gbToTb(gb: number): number {\n\t\treturn gb / 1024;\n\t}\n\n\t/** Converts terabytes to gigabytes. */\n\tstatic tbToGb(tb: number): number {\n\t\treturn tb * 1024;\n\t}\n\n\t/** Converts joules to calories. */\n\tstatic joulesToCalories(j: number): number {\n\t\treturn j * 0.239006;\n\t}\n\n\t/** Converts calories to joules. */\n\tstatic caloriesToJoules(cal: number): number {\n\t\treturn cal / 0.239006;\n\t}\n\n\t/** Converts calories to kilojoules. */\n\tstatic caloriesToKJoules(cal: number): number {\n\t\treturn cal / 0.239006 / 1000;\n\t}\n\n\t/** Converts kilojoules to calories. */\n\tstatic kJoulesToCalories(kj: number): number {\n\t\treturn kj * 1000 * 0.239006;\n\t}\n\n\t/** Converts atmospheres to pascals. */\n\tstatic atmToPascal(atm: number): number {\n\t\treturn atm * 101325;\n\t}\n\n\t/** Converts pascals to atmospheres. */\n\tstatic pascalToAtm(pa: number): number {\n\t\treturn pa / 101325;\n\t}\n\n\t/** Converts bar to pascals. */\n\tstatic barToPascal(bar: number): number {\n\t\treturn bar * 100000;\n\t}\n\n\t/** Converts pascals to bar. */\n\tstatic pascalToBar(pa: number): number {\n\t\treturn pa / 100000;\n\t}\n\n\t/** Converts hertz to kilohertz. */\n\tstatic hzToKHz(hz: number): number {\n\t\treturn hz / 1000;\n\t}\n\n\t/** Converts kilohertz to hertz. */\n\tstatic kHzToHz(khz: number): number {\n\t\treturn khz * 1000;\n\t}\n\n\t/** Converts hertz to megahertz. */\n\tstatic hzToMHz(hz: number): number {\n\t\treturn hz / 1_000_000;\n\t}\n\n\t/** Converts megahertz to hertz. */\n\tstatic mHzToHz(mhz: number): number {\n\t\treturn mhz * 1_000_000;\n\t}\n\n\t/** Converts kilohertz to megahertz. */\n\tstatic kHzToMHz(khz: number): number {\n\t\treturn khz / 1000;\n\t}\n\n\t/** Converts megahertz to kilohertz. */\n\tstatic mHzToKHz(mhz: number): number {\n\t\treturn mhz * 1000;\n\t}\n\n\t/** Converts centimeters to meters. */\n\tstatic cmToMeters(cm: number): number {\n\t\treturn cm / 100;\n\t}\n\n\t/** Converts meters to centimeters. */\n\tstatic metersToCm(m: number): number {\n\t\treturn m * 100;\n\t}\n\n\t/** Converts millimeters to meters. */\n\tstatic mmToMeters(mm: number): number {\n\t\treturn mm / 1000;\n\t}\n\n\t/** Converts meters to millimeters. */\n\tstatic metersToMm(m: number): number {\n\t\treturn m * 1000;\n\t}\n\n\t/** Converts square kilometers to square meters. */\n\tstatic sqkmToSqm(sqkm: number): number {\n\t\treturn sqkm * 1_000_000;\n\t}\n\n\t/** Converts square meters to square kilometers. */\n\tstatic sqmToSqkm(sqm: number): number {\n\t\treturn sqm / 1_000_000;\n\t}\n\n\t/** Converts square feet to square inches. */\n\tstatic sqftToSqin(sqft: number): number {\n\t\treturn sqft * 144;\n\t}\n\n\t/** Converts square inches to square feet. */\n\tstatic sqinToSqft(sqin: number): number {\n\t\treturn sqin / 144;\n\t}\n\n\t/** Converts watts to kilowatts. */\n\tstatic wattsToKw(w: number): number {\n\t\treturn w / 1000;\n\t}\n\n\t/** Converts kilowatts to watts. */\n\tstatic kwToWatts(kw: number): number {\n\t\treturn kw * 1000;\n\t}\n}\n","/**\n * * Check if a number is even or not.\n *\n * @param input The number to check.\n * @returns Boolean: `true` if even and `false` if not even.\n */\nexport const isEven = (input: number): boolean => {\n\treturn input % 2 === 0;\n};\n\n/**\n * * Checks if a number is odd or not.\n *\n * @param input The number to check.\n * @returns Boolean: `true` if odd and `false` if not odd.\n */\nexport const isOdd = (input: number): boolean => {\n\treturn input % 2 !== 0;\n};\n\n/**\n * * Checks if a number is a multiple of another number.\n *\n * @param input - The number to check.\n * @param multipleOf - The number to check against.\n * @returns `true` if `input` is a multiple of `multipleOf`, otherwise `false`.\n */\nexport const isMultiple = (input: number, multipleOf: number): boolean => {\n\treturn input % multipleOf === 0;\n};\n\n/**\n * * Checks if a number is a perfect square.\n *\n * @param num The number to check.\n * @returns `true` if the number is a perfect square, otherwise `false`.\n */\nexport function isPerfectSquare(num: number): boolean {\n\treturn Number.isInteger(Math.sqrt(num));\n}\n\n/**\n * * Checks if a number is part of the Fibonacci sequence.\n *\n * @param num The number to check.\n * @returns `true` if the number is a Fibonacci number, otherwise `false`.\n */\nexport function isFibonacci(num: number): boolean {\n\treturn (\n\t\tisPerfectSquare(5 * num * num + 4) || isPerfectSquare(5 * num * num - 4)\n\t);\n}\n\n/**\n * * Checks whether any input is not a finite number.\n *\n * @param numbers - The list of numbers to validate.\n * @returns `true` if any input is not finite.\n */\nexport function areInvalidNumbers(...numbers: number[]): boolean {\n\treturn numbers?.some((n) => !Number.isFinite(n));\n}\n","import { getAverage } from './basics';\nimport { areInvalidNumbers } from './guards';\nimport type { PercentageOptions } from './types';\n\n/**\n * * Performs a percentage-related calculation based on the given mode and inputs.\n *\n * - `get-percent`: Calculates what percentage the `part` is of the `total`.\n * - `get-value`: Calculates the value from a given `percentage` of a `total`.\n * - `get-original`: Calculates the original value from a known `value` and `percentage`.\n * - `get-change-percent`: Percent increase/decrease from `oldValue` to `newValue`.\n * - `apply-percent-change`: Applies increase/decrease by `percentage` to `baseValue`.\n * - `get-percent-difference`: Absolute percent difference between two values.\n * - `inverse-percent`: What percent `total` is of `part`.\n *\n * @param options - The calculation mode and inputs required for the operation.\n * @returns The calculated number rounded to three decimal places, or `NaN` if input is invalid.\n */\nexport function calculatePercentage(options: PercentageOptions): number {\n\tconst { roundTo = 3 } = options;\n\n\t/**\n\t * - Rounds a number to the specified number of decimal places.\n\t *\n\t * @param num - The number to round.\n\t * @returns The rounded number.\n\t */\n\tconst _roundNumber = (num: number) => {\n\t\tconst factor = Math.pow(10, roundTo);\n\n\t\treturn Math.round(num * factor) / factor;\n\t};\n\n\tswitch (options?.mode) {\n\t\tcase 'get-percent': {\n\t\t\tconst { part, total } = options;\n\n\t\t\tif (areInvalidNumbers(part, total) || total === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\treturn _roundNumber((part / total) * 100);\n\t\t}\n\n\t\tcase 'get-value': {\n\t\t\tconst { percentage, total } = options;\n\n\t\t\tif (areInvalidNumbers(percentage, total) || total === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\treturn _roundNumber((percentage / 100) * total);\n\t\t}\n\n\t\tcase 'get-original': {\n\t\t\tconst { percentage, value } = options;\n\n\t\t\tif (areInvalidNumbers(percentage, value) || percentage === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\treturn _roundNumber((value / percentage) * 100);\n\t\t}\n\n\t\tcase 'get-change-percent': {\n\t\t\tconst { oldValue, newValue } = options;\n\n\t\t\tif (areInvalidNumbers(oldValue, newValue) || oldValue === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\tconst change = ((newValue - oldValue) / oldValue) * 100;\n\n\t\t\treturn _roundNumber(change);\n\t\t}\n\n\t\tcase 'apply-percent-change': {\n\t\t\tconst { baseValue, percentage } = options;\n\n\t\t\tif (areInvalidNumbers(baseValue, percentage)) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\tconst value = baseValue * (1 + percentage / 100);\n\n\t\t\treturn _roundNumber(value);\n\t\t}\n\n\t\tcase 'get-percent-difference': {\n\t\t\tconst { value1, value2 } = options;\n\n\t\t\tif (areInvalidNumbers(value1, value2)) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\tconst avg = getAverage(value1, value2);\n\n\t\t\tif (avg === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\tconst diff = (Math.abs(value1 - value2) / avg) * 100;\n\n\t\t\treturn _roundNumber(diff);\n\t\t}\n\n\t\tcase 'inverse-percent': {\n\t\t\tconst { part, total } = options;\n\n\t\t\tif (areInvalidNumbers(part, total) || part === 0) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\n\t\t\treturn _roundNumber((total / part) * 100);\n\t\t}\n\n\t\tdefault:\n\t\t\treturn NaN;\n\t}\n}\n","import type { Numeric } from '../types';\n\n/**\n * * Generates the first `limit` Fibonacci numbers.\n *\n * @param limit The number of Fibonacci numbers to generate.\n * @returns An array containing the first `limit` Fibonacci numbers.\n */\nexport function getFibonacciSeries(limit: Numeric): number[] {\n\tconst cLimit = Number(limit);\n\n\tif (!Number.isFinite(cLimit) || cLimit <= 0) {\n\t\treturn [];\n\t}\n\n\tif (cLimit === 1) return [0];\n\n\tconst series: number[] = [0, 1];\n\n\tfor (let i = 2; i < cLimit; i++) {\n\t\tseries.push(series[i - 1] + series[i - 2]);\n\t}\n\n\treturn series;\n}\n\n/**\n * * Generates the first `limit` Fibonacci numbers using recursion with memoization.\n *\n * @param limit - The number of Fibonacci numbers to generate.\n * @returns An array containing the first `limit` Fibonacci numbers.\n */\nexport function getFibonacciSeriesMemo(limit: Numeric): number[] {\n\tconst cLimit = Number(limit);\n\n\tif (!Number.isFinite(cLimit) || cLimit <= 0) return [];\n\n\tif (cLimit === 1) return [0];\n\n\tconst memo = new Map<number, number>([\n\t\t[0, 0],\n\t\t[1, 1],\n\t]);\n\n\tconst fib = (n: number): number => {\n\t\tif (memo.has(n)) return memo.get(n)!;\n\t\tconst val = fib(n - 1) + fib(n - 2);\n\t\tmemo.set(n, val);\n\t\treturn val;\n\t};\n\n\treturn Array.from({ length: cLimit }, (_, i) => fib(i));\n}\n\n/**\n * * Generator function for Fibonacci sequence up to a given limit.\n *\n * @param limit - Number of Fibonacci numbers to generate.\n * @param onYield - Optional callback triggered on each yield with the current value and index.\n * @returns A generator yielding Fibonacci numbers one by one.\n */\nexport function* fibonacciGenerator(\n\tlimit: Numeric,\n\tonYield?: (value: number, index: number) => void,\n): Generator<number, void, void> {\n\tconst cLimit = Number(limit);\n\n\tif (!Number.isFinite(cLimit) || cLimit < 0) return;\n\n\tlet a = 0;\n\tlet b = 1;\n\n\tfor (let i = 0; i < cLimit; i++) {\n\t\tonYield?.(a, i);\n\t\tyield a;\n\t\t[a, b] = [b, a + b];\n\t}\n}\n\n/**\n * * Calculates the `n`-th Fibonacci number using optimized space.\n *\n * @param index - The index (0-based) of the Fibonacci number.\n * @returns The index=`n`-th Fibonacci number.\n */\nexport function getNthFibonacci(index: Numeric): number {\n\tconst n = Number(index);\n\n\tif (!Number.isFinite(n) || n < 0) return NaN;\n\tif (n === 0) return 0;\n\tif (n === 1) return 1;\n\n\tlet a = 0,\n\t\tb = 1;\n\n\tfor (let i = 2; i <= n; i++) {\n\t\t[a, b] = [b, a + b];\n\t}\n\n\treturn b;\n}\n","import type { Numeric } from '../types';\nimport { THOUSANDS } from './constants';\nimport { _convertLessThanThousand } from './helpers';\n\n/**\n * * Converts a numeric value into its corresponding English word representation.\n * @warning ***Supports numeric values up to `10e19` or `10^20` (one hundred quintillion).***\n * @warning ***Decimal values are ignored; only the integer part is converted.***\n * @param number - The number to convert into words.\n * @returns The number converted in words.\n */\nexport function numberToWords(num: Numeric): string {\n\tlet number = Math.trunc(Number(num));\n\n\tif (!Number.isFinite(number) || isNaN(number)) {\n\t\treturn 'Invalid Number!';\n\t}\n\n\tconst isNegative = number < 0;\n\n\tif (number === 0) return 'zero';\n\n\tnumber = Math.abs(number);\n\n\tlet i = 0;\n\tlet result = '';\n\n\twhile (number > 0) {\n\t\tif (i >= THOUSANDS.length) {\n\t\t\treturn `Number exceeds supported range (max is 10e19 aka 10^20)`;\n\t\t}\n\n\t\tif (number % 1000 !== 0) {\n\t\t\tconst isLastGroup = i === 0 && number % 100 < 100;\n\t\t\tconst prefix = _convertLessThanThousand(number % 1000, isLastGroup);\n\n\t\t\tresult = `${prefix} ${THOUSANDS[i]} ${result}`;\n\t\t}\n\n\t\tnumber = Math.floor(number / 1000);\n\n\t\ti++;\n\t}\n\n\tconst finalResult = result.trim().replace(/\\s+/g, ' ');\n\n\treturn isNegative ? `minus ${finalResult}` : finalResult;\n}\n\n/**\n * * Converts a number to a Roman numeral.\n * @param num - The number to convert. Number must be `between 1 and 3999`.\n * @returns The Roman numeral representation.\n *\n * @example convertToRomanNumerals(29) → \"XXIX\"\n */\nexport const convertToRomanNumerals = (num: Numeric): string => {\n\tlet number = Number(num);\n\n\tif (number <= 0 || number >= 4000)\n\t\tthrow new RangeError('Number must be between 1 and 3999');\n\n\tconst romanMap: [number, string][] = [\n\t\t[1000, 'M'],\n\t\t[900, 'CM'],\n\t\t[500, 'D'],\n\t\t[400, 'CD'],\n\t\t[100, 'C'],\n\t\t[90, 'XC'],\n\t\t[50, 'L'],\n\t\t[40, 'XL'],\n\t\t[10, 'X'],\n\t\t[9, 'IX'],\n\t\t[5, 'V'],\n\t\t[4, 'IV'],\n\t\t[1, 'I'],\n\t];\n\n\tlet result = '';\n\tfor (const [value, numeral] of romanMap) {\n\t\twhile (number >= value) {\n\t\t\tresult += numeral;\n\t\t\tnumber -= value;\n\t\t}\n\t}\n\treturn result;\n};\n","/**\n * * Checks if a number is prime.\n *\n * @param number The number to check.\n * @returns Boolean: `true` if the number is prime, otherwise `false`.\n */\nexport const isPrime = (number: number): boolean => {\n\tif (number < 2) return false;\n\tif (number === 2 || number === 3) return true;\n\tif (number % 2 === 0 || number % 3 === 0) return false;\n\n\tfor (let i = 5; i * i <= number; i += 6) {\n\t\tif (number % i === 0 || number % (i + 2) === 0) return false;\n\t}\n\n\treturn true;\n};\n\n/**\n * * Find prime numbers in a given range.\n *\n * @param start The starting number of the range. Default is `1`.\n * @param end The ending number of the range. Default is `1000`.\n * @returns An array of prime numbers within the range (inclusive).\n */\nexport const findPrimeNumbers = (start = 1, end = 1000): number[] => {\n\tlet startNumber = start,\n\t\tendNumber = end;\n\n\tif (start > end) {\n\t\t[startNumber, endNumber] = [end, start];\n\t}\n\n\treturn Array.from(\n\t\t{ length: endNumber - startNumber + 1 },\n\t\t(_, i) => startNumber + i,\n\t).filter(isPrime);\n};\n","import type { GenericObject } from '../object/types';\nimport type { Flattened } from './types';\n\n/**\n * * Flattens a nested array recursively or wraps any non-array data type in an array.\n *\n * @param input - The input value, which can be a nested array or a non-array value.\n * @returns A fully flattened array of type `Flatten<T>`. If the input is not an array, it wraps it in a single-element array.\n */\nexport const flattenArray = <T>(input: T | T[]): Flattened<T>[] => {\n\tif (!Array.isArray(input)) return [input] as Flattened<T>[];\n\n\treturn input.reduce<Flattened<T>[]>((acc, item) => {\n\t\t// If item is an array, recursively flatten it; otherwise, add it directly.\n\t\treturn acc.concat(Array.isArray(item) ? flattenArray(item) : [item]);\n\t}, []);\n};\n\n/**\n * @deprecated _Please, use `findAll` instance method from `Finder` class for **more advanced filtering and searching.**_\n *\n * * Filters an array of objects based on multiple conditions for specified keys.\n * @param array - The array of objects to filter.\n * @param conditions - An object where keys represent the property names and values represent filter conditions.\n * The conditions can be a function `(value: T[K]) => boolean`.\n * @returns The filtered array of objects.\n * @throws `Error` If the input is not a valid array.\n */\nexport const filterArrayOfObjects = <T extends GenericObject>(\n\tarray: T[],\n\tconditions: { [K in keyof T]?: (value: T[K] | undefined) => boolean },\n): T[] => {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('The provided input is not a valid array!');\n\t}\n\n\treturn array?.filter((item) =>\n\t\tObject.entries(conditions)?.every(([key, conditionFn]) => {\n\t\t\tif (typeof conditionFn === 'function') {\n\t\t\t\treturn conditionFn(\n\t\t\t\t\titem[key as keyof T] as T[keyof T] | undefined,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn true;\n\t\t}),\n\t);\n};\n\n/**\n * * Checks if a value is an empty array or an array with only empty values.\n *\n * @param value - The value to check.\n * @returns `true` if the value is not an array, an empty array, or an array containing only `null`, `undefined`, empty objects, or empty arrays.\n */\nexport const isInvalidOrEmptyArray = <T>(value: T): boolean => {\n\tif (!Array.isArray(value)) return true;\n\n\tif (value?.length === 0) return true;\n\n\treturn value?.every(\n\t\t(item) =>\n\t\t\titem == null ||\n\t\t\t(Array.isArray(item) && item?.length === 0) ||\n\t\t\t(typeof item === 'object' && Object.keys(item || {})?.length === 0),\n\t);\n};\n\n/**\n * * Shuffle the elements of an array.\n *\n * @param array Array to shuffle.\n * @returns Shuffled array.\n */\nexport const shuffleArray = <T>(array: T[]): T[] => {\n\tif (isInvalidOrEmptyArray(array)) return array;\n\n\tconst shuffled = structuredClone(array);\n\n\tfor (let i = shuffled?.length - 1; i > 0; i--) {\n\t\tconst j = Math.floor(Math.random() * (i + 1));\n\t\t[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];\n\t}\n\n\treturn shuffled;\n};\n\n/**\n * * Get the last element of an array.\n *\n * @param array Array to get the last element from.\n * @returns The last element or `undefined` if the array is empty.\n */\nexport const getLastArrayElement = <T>(array: T[]): T | undefined => {\n\treturn array?.length > 0 ? array[array?.length - 1] : undefined;\n};\n","import type { GenericObject } from '../object/types';\nimport type { AsyncFunction, GenericFn } from '../types';\nimport { isString } from './primitives';\n\n/**\n * * Type guard to check if a value is an array.\n * @param value - The value to check.\n * @returns `true` if the value is an array, otherwise `false`.\n */\nexport function isArray<T>(value: unknown): value is Array<T> {\n\treturn Array.isArray(value);\n}\n\n/**\n * * Type guard to check if a value is an array with length.\n * @param value - The value to check.\n * @returns `true` if the value is an array with length, otherwise `false`.\n */\nexport function isValidArray<T>(value: unknown): value is Array<T> {\n\treturn Array.isArray(value) && value?.length > 0;\n}\n\n/**\n * * Type guard to check if a value is an object (excluding null).\n * @param value - The value to check.\n * @returns `true` if the value is an object, otherwise `false`.\n */\nexport function isObject(value: unknown): value is Record<string, unknown> {\n\treturn value !== null && typeof value === 'object' && !isArray(value);\n}\n\n/**\n * * Type guard to check if a value is an object (excluding null) and has keys in it.\n * @param value - The value to check.\n * @returns `true` if the value is an object with valid keys, otherwise `false`.\n */\nexport function isNotEmptyObject(\n\tvalue: unknown,\n): value is Record<string, unknown> {\n\treturn isObject(value) && Object.keys(value)?.length > 0;\n}\n\n/**\n * * Type guard to check if a value is an object with specific keys.\n * @param value - The value to check.\n * @param keys - The set of keys the object should contain.\n * @returns `true` if the value is an object with the specified keys, otherwise `false`.\n */\nexport function isObjectWithKeys<T extends Record<string, unknown>>(\n\tvalue: unknown,\n\tkeys: (keyof T)[],\n): value is T {\n\treturn isObject(value) && keys?.every((key) => key in value);\n}\n\n/**\n * * Type guard to check if a value is an empty object.\n * @param value - The value to check.\n * @returns `true` if the value is an empty object, otherwise `false`.\n */\nexport function isEmptyObject<T extends GenericObject>(value: T): boolean {\n\treturn isObject(value) && Object.keys(value)?.length === 0;\n}\n\n/**\n * * Type guard to check if a value is a function.\n * @param value - The value to check.\n * @returns `true` if the value is a function, otherwise `false`.\n */\nexport function isFunction(value: unknown): value is GenericFn {\n\treturn typeof value === 'function';\n}\n\n/**\n * * Determines whether the provided property descriptor represents a method.\n *\n * @param descriptor - The property descriptor to check.\n * @returns `true` if the descriptor is defined and its value is a function; otherwise, `false`.\n */\nexport const isMethodDescriptor = (\n\tdescriptor: PropertyDescriptor | undefined,\n): boolean => {\n\treturn !!descriptor && typeof descriptor?.value === 'function';\n};\n\n/**\n * * Type guard to check if a value is a Date object.\n * @param value - The value to check.\n * @returns `true` if the value is a Date object, otherwise `false`.\n */\nexport function isDate(value: unknown): value is Date {\n\treturn value instanceof Date;\n}\n\n/**\n * * Type guard to check if a value is an array of a specific type.\n * @param value - The value to check.\n * @param typeCheck - The type guard function to check each item of the array.\n * @returns `true` if the value is an array of the specified type, otherwise `false`.\n */\nexport function isArrayOfType<T>(\n\tvalue: unknown,\n\ttypeCheck: (item: unknown) => item is T,\n): value is T[] {\n\treturn isArray(value) && value?.every(typeCheck);\n}\n\n/**\n * * Type guard to check if a value is a Promise.\n * @param value - The value to check.\n * @returns `true` if the value is a Promise, otherwise `false`.\n */\nexport function isPromise(value: unknown): value is Promise<unknown> {\n\treturn isObject(value) && isFunction(value.then);\n}\n\n/**\n * * Type guard to check if a value is a Set.\n * @param value - The value to check.\n * @returns `true` if the value is a Set, otherwise `false`.\n */\nexport function isSet<T>(value: unknown): value is Set<T> {\n\treturn value instanceof Set;\n}\n\n/**\n * * Type guard to check if a value is a Map.\n * @param value - The value to check.\n * @returns `true` if the value is a Map, otherwise `false`.\n */\nexport function isMap<K, V>(value: unknown): value is Map<K, V> {\n\treturn value instanceof Map;\n}\n\n/**\n * * Type guard to check if a value is a RegExp.\n * @param value - The value to check.\n * @returns `true` if the value is a RegExp, otherwise `false`.\n */\nexport function isRegExp(value: unknown): value is RegExp {\n\treturn value instanceof RegExp;\n}\n\n/**\n * * Type guard to check if a value is an Error object.\n * @param value - The value to check.\n * @returns `true` if the value is an Error object, otherwise `false`.\n */\nexport function isError(value: unknown): value is Error {\n\treturn value instanceof Error;\n}\n\n/**\n * * Type guard to check if a string is valid JSON.\n * @param value - The value to check.\n * @returns `true` if the value is valid JSON, otherwise `false`.\n */\nexport function isJSON(value: unknown): value is string {\n\tif (!isString(value)) return false;\n\n\ttry {\n\t\tJSON.parse(value);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/**\n * * Type guard to check if a function returns a Promise.\n * @param fn - The function to check.\n * @returns `true` if the function returns a Promise, otherwise `false`.\n */\nexport function isReturningPromise<T>(fn: unknown): fn is AsyncFunction<T> {\n\treturn isFunction(fn) && fn.constructor?.name === 'AsyncFunction';\n}\n","import type { SortNature } from './types';\n\n/**\n * * Compare two strings using natural sorting (e.g., \"file2\" < \"file10\").\n * Optionally supports case-insensitive and locale-aware string chunk comparisons.\n *\n * @param a - The first string to compare.\n * @param b - The second string to compare.\n * @param options - Optional settings to configure comparison behavior.\n * @param options.caseInsensitive - If true, compares string chunks without case sensitivity. Defaults to `true`.\n * @param options.localeAware - If true, uses localeCompare for string chunk comparisons. Defaults to `false`.\n * @returns A negative number if `a` comes before `b`, a positive number if `a` comes after `b`, or 0 if equal.\n */\nexport function naturalSort(\n\ta: string,\n\tb: string,\n\toptions?: SortNature,\n): number {\n\tconst { caseInsensitive = true, localeAware = false } = options || {};\n\n\t/**\n\t * * Splits a string into an array of number and non-number chunks.\n\t * @param str - The string to split.\n\t * @returns An array of string and number parts.\n\t */\n\tconst _createChunks = (str: string): (string | number)[] => {\n\t\tconst chunks: (string | number)[] = [];\n\n\t\tlet current = '';\n\t\tlet isNumeric = false;\n\n\t\tfor (const char of str) {\n\t\t\tconst charIsNum = !Number.isNaN(Number(char));\n\n\t\t\tif (current?.length === 0) {\n\t\t\t\tcurrent = char;\n\t\t\t\tisNumeric = charIsNum;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (charIsNum === isNumeric) {\n\t\t\t\tcurrent += char;\n\t\t\t} else {\n\t\t\t\tchunks?.push(isNumeric ? Number(current) : current);\n\t\t\t\tcurrent = char;\n\t\t\t\tisNumeric = charIsNum;\n\t\t\t}\n\t\t}\n\n\t\tif (current?.length > 0) {\n\t\t\tchunks?.push(isNumeric ? Number(current) : current);\n\t\t}\n\n\t\treturn chunks;\n\t};\n\n\tconst aChunks = _createChunks(a);\n\tconst bChunks = _createChunks(b);\n\n\tfor (let i = 0; i < Math.min(aChunks?.length, bChunks?.length); i++) {\n\t\tlet aChunk = aChunks[i];\n\t\tlet bChunk = bChunks[i];\n\n\t\t// Normalize string chunks if case-insensitive\n\t\tif (\n\t\t\tcaseInsensitive &&\n\t\t\ttypeof aChunk === 'string' &&\n\t\t\ttypeof bChunk === 'string'\n\t\t) {\n\t\t\taChunk = aChunk?.toLowerCase();\n\t\t\tbChunk = bChunk?.toLowerCase();\n\t\t}\n\n\t\t// Compare types: number vs string\n\t\tif (typeof aChunk !== typeof bChunk) {\n\t\t\treturn typeof aChunk === 'string' ? 1 : -1;\n\t\t}\n\n\t\t// Compare same-type chunks\n\t\tif (aChunk !== bChunk) {\n\t\t\tif (typeof aChunk === 'number' && typeof bChunk === 'number') {\n\t\t\t\treturn aChunk - bChunk;\n\t\t\t}\n\n\t\t\tif (typeof aChunk === 'string' && typeof bChunk === 'string') {\n\t\t\t\tif (localeAware) {\n\t\t\t\t\tconst cmp = aChunk.localeCompare(bChunk, undefined, {\n\t\t\t\t\t\tsensitivity: caseInsensitive ? 'accent' : 'variant',\n\t\t\t\t\t});\n\t\t\t\t\tif (cmp !== 0) return cmp;\n\t\t\t\t}\n\t\t\t\treturn aChunk < bChunk ? -1 : 1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn aChunks?.length - bChunks?.length;\n}\n","import {\n\tisArrayOfType,\n\tisObject,\n\tisValidArray,\n} from '../guards/non-primitives';\nimport { isBoolean, isNumber, isString } from '../guards/primitives';\nimport type { GenericObject } from '../object/types';\nimport type { OrderOption, SortByOption, SortOptions } from './types';\nimport { naturalSort } from './utils';\n\n/**\n * * Sorts an array of objects.\n *\n * - Sorts array by the specified field.\n *\n * @param array - The array of objects to sort.\n * @param options - Sorting options.\n * @returns The sorted array.\n */\nexport function sortAnArray<T extends GenericObject>(\n\tarray: T[],\n\toptions: SortByOption<T>,\n): T[];\n\n/**\n * * Sorts an array of `strings`, `numbers` or `boolean`.\n *\n * @param array - The array of `strings`, `numbers` or `boolean` to sort.\n * @param options - Sorting options.\n * @returns The sorted array.\n */\nexport function sortAnArray<T extends string | number | boolean>(\n\tarray: T[],\n\toptions?: OrderOption,\n): T[];\n\n/**\n * * Sorts an array of strings, numbers, booleans, or objects based on the provided options.\n *\n * - If the array contains strings, it sorts them alphabetically.\n * - If the array contains numbers, it sorts them numerically.\n * - If the array contains booleans, it sorts them by their boolean value.\n * - If the array contains objects, it sorts them by the specified field in the options `sortByField`.\n *\n * @param array - The array to sort.\n * @param options - Sorting options for objects.\n * @returns The sorted array.\n */\nexport function sortAnArray<\n\tT extends number | string | boolean | GenericObject,\n>(array: T[], options?: SortOptions<T>): T[] {\n\tif (!isValidArray(array)) return array;\n\n\t// Check if the array contains strings\n\tif (isArrayOfType(array, isString)) {\n\t\treturn [...array].sort((a, b) =>\n\t\t\toptions?.sortOrder === 'desc' ?\n\t\t\t\tnaturalSort(b, a)\n\t\t\t:\tnaturalSort(a, b),\n\t\t);\n\t}\n\n\t// Check if the array contains numbers\n\tif (isArrayOfType(array, isNumber)) {\n\t\treturn [...array].sort((a, b) =>\n\t\t\toptions?.sortOrder === 'desc' ? b - a : a - b,\n\t\t);\n\t}\n\n\t// Check if the array contains booleans\n\tif (isArrayOfType(array, isBoolean)) {\n\t\treturn [...array].sort((a, b) =>\n\t\t\toptions?.sortOrder === 'desc' ?\n\t\t\t\tNumber(b) - Number(a)\n\t\t\t:\tNumber(a) - Number(b),\n\t\t);\n\t}\n\n\t// Handle array of objects\n\tif (isArrayOfType(array, isObject) && options && 'sortByField' in options) {\n\t\treturn [...array].sort((a, b) => {\n\t\t\tconst _getKeyValue = (obj: T, path: string): unknown => {\n\t\t\t\treturn path\n\t\t\t\t\t.split('.')\n\t\t\t\t\t.reduce<unknown>(\n\t\t\t\t\t\t(acc, key) => (acc as T)?.[key as keyof T],\n\t\t\t\t\t\tobj,\n\t\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst keyA = _getKeyValue(a, options?.sortByField);\n\t\t\tconst keyB = _getKeyValue(b, options?.sortByField);\n\n\t\t\tif (keyA == null || keyB == null) {\n\t\t\t\treturn keyA == null ? 1 : -1;\n\t\t\t}\n\n\t\t\tif (typeof keyA === 'string' && typeof keyB === 'string') {\n\t\t\t\treturn options?.sortOrder === 'desc' ?\n\t\t\t\t\t\tnaturalSort(keyB, keyA)\n\t\t\t\t\t:\tnaturalSort(keyA, keyB);\n\t\t\t}\n\n\t\t\tif (typeof keyA === 'number' && typeof keyB === 'number') {\n\t\t\t\treturn options?.sortOrder === 'desc' ?\n\t\t\t\t\t\tkeyB - keyA\n\t\t\t\t\t:\tkeyA - keyB;\n\t\t\t}\n\n\t\t\tif (typeof keyA === 'boolean' && typeof keyB === 'boolean') {\n\t\t\t\treturn options?.sortOrder === 'desc' ?\n\t\t\t\t\t\tNumber(keyB) - Number(keyA)\n\t\t\t\t\t:\tNumber(keyA) - Number(keyB);\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t});\n\t}\n\n\treturn array;\n}\n","import { isArray } from './non-primitives';\nimport { isString } from './primitives';\n\n/**\n * * Type guard to check if a value is a valid email string.\n * @param value - The value to check.\n * @returns `true` if the value is a valid email, otherwise `false`.\n */\nexport function isEmail(value: unknown): value is string {\n\treturn (\n\t\tisString(value) &&\n\t\t/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/.test(value)\n\t);\n}\n\n/**\n * * Type guard to check if a value is an array of valid email strings.\n * @param value - The value to check.\n * @returns `true` if the value is an array of valid email strings, otherwise `false`.\n */\nexport function isEmailArray(value: unknown): value is string[] {\n\treturn isArray(value) && value?.every(isEmail);\n}\n\n/**\n * * Type guard to check if a value is a valid date string.\n * @param value - The value to check.\n * @returns `true` if the value is a valid date string, otherwise `false`.\n */\nexport function isDateString(value: unknown): value is string {\n\treturn isString(value) && !isNaN(Date.parse(value));\n}\n\n/**\n * * Type guard to check if a value is a valid UUID (v4).\n * @param value - The value to check.\n * @returns `true` if the value is a valid UUID, otherwise `false`.\n */\nexport function isUUID(value: unknown): value is string {\n\treturn (\n\t\tisString(value) &&\n\t\t/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(\n\t\t\tvalue,\n\t\t)\n\t);\n}\n\n/**\n * * Type guard to check if the code is running in a browser environment.\n * @returns `true` if the code is running in a browser, otherwise `false`.\n */\nexport function isBrowser(): boolean {\n\treturn typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * * Type guard to check if the code is running in a Node.js environment.\n * @returns `true` if the code is running in Node.js, otherwise `false`.\n */\nexport function isNode(): boolean {\n\treturn (\n\t\ttypeof process !== 'undefined' &&\n\t\tprocess.versions != null &&\n\t\tprocess.versions.node != null\n\t);\n}\n\n/**\n * * Type guard to check if a value is a valid URL.\n * @param value - The value to check.\n * @returns `true` if the value is a valid URL, otherwise `false`.\n */\nexport function isURL(value: unknown): value is string {\n\ttry {\n\t\tnew URL(isString(value) ? value : '');\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/**\n * * Type guard to check if a value is a valid Base64 encoded string.\n * @param value - The value to check.\n * @returns `true` if the value is a valid Base64 string, otherwise `false`.\n */\nexport function isBase64(value: unknown): value is string {\n\treturn (\n\t\tisString(value) &&\n\t\t/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(\n\t\t\tvalue,\n\t\t)\n\t);\n}\n\n/**\n * * Type guard to check if a value is a valid phone number.\n * @param value - The value to check.\n * @returns `true` if the value is a valid phone number, otherwise `false`.\n */\nexport function isPhoneNumber(value: unknown): value is string {\n\treturn isString(value) && /^\\+?[1-9]\\d{1,14}$/.test(value);\n}\n\n/**\n * * Type guard to check if a value is a valid IP address (IPv4 or IPv6).\n * @param value - The value to check.\n * @returns `true` if the value is a valid IP address, otherwise `false`.\n */\nexport function isIPAddress(value: unknown): value is string {\n\treturn (\n\t\tisString(value) &&\n\t\t/^(?:\\d{1,3}\\.){3}\\d{1,3}$|^([a-f0-9:]+:+)+[a-f0-9]+$/i.test(value)\n\t);\n}\n\n/**\n * * Type guard to check if the current environment matches a given string.\n * @param env - The expected environment (e.g., \"production\", \"development\").\n * @returns `true` if the current environment matches, otherwise `false`.\n */\nexport function isEnvironment(env: string): boolean {\n\treturn process.env.NODE_ENV === env;\n}\n\n/**\n * * Type guard to check if a value is a numeric string.\n * @param value - The value to check.\n * @returns `true` if the value is a numeric string, otherwise `false`.\n */\nexport function isNumericString(value: unknown): value is `${number}` {\n\treturn isString(value) && /^\\d+(\\.\\d+)?$/.test(value);\n}\n","import { isInvalidOrEmptyArray } from '../array/basics';\nimport { sortAnArray } from '../array/sort';\nimport { isMethodDescriptor, isObject } from '../guards/non-primitives';\nimport { isString } from '../guards/primitives';\nimport { isNumericString } from '../guards/specials';\nimport type { GenericObject } from '../object/types';\nimport type {\n\tClassDetails,\n\tConstructor,\n\tDelayedFn,\n\tThrottledFn,\n\tVoidFunction,\n} from '../types';\n\n/**\n * * Deeply compare two values (arrays, objects, or primitive values).\n *\n * @param a First value to compare.\n * @param b Second value to compare.\n * @returns Whether the values are deeply equal.\n */\nexport const isDeepEqual = <T>(a: T, b: T): boolean => {\n\t// If both values are strictly equal (handles primitive types and same references)\n\tif (a === b) return true;\n\n\t// If the types of the two values are different\n\tif (typeof a !== typeof b) return false;\n\n\t// If either is null or undefined, they must both be null or undefined\n\tif (a === null || b === null) return a === b;\n\n\t// Check for array equality\n\tif (Array.isArray(a) && Array.isArray(b)) {\n\t\tif (a?.length !== b?.length) return false;\n\t\treturn a?.every((element, index) => isDeepEqual(element, b[index]));\n\t}\n\n\t// Check for object equality\n\tif (typeof a === 'object' && typeof b === 'object') {\n\t\tconst aKeys = Object.keys(a);\n\t\tconst bKeys = Object.keys(b);\n\n\t\tif (aKeys?.length !== bKeys?.length) return false;\n\n\t\treturn aKeys?.every((key) =>\n\t\t\tisDeepEqual((a as GenericObject)[key], (b as GenericObject)[key]),\n\t\t);\n\t}\n\n\treturn false;\n};\n\n/**\n * * Utility to convert an array to string with custom separator.\n *\n * @param array Array to convert.\n * @param separator Separate each element of the array. Can be `,`, `-`, `|` etc. Default is `,`.\n * @returns Converted array in string format with the separator.\n */\nexport const convertArrayToString = <T>(\n\tarray: T[],\n\tseparator: string = ',',\n): string => {\n\tif (!isInvalidOrEmptyArray) {\n\t\tthrow new Error('Please, provide a valid array!');\n\t}\n\treturn array.join(separator);\n};\n\n/**\n * * A generic debounce function that delays the execution of a callback.\n *\n * @param callback - The function to debounce.\n * @param delay - The delay in milliseconds. Default is `300ms`.\n * @returns A debounced version of the callback function.\n *\n * @example\n * const debouncedSearch = debounceAction((query: string) => {\n * console.log(`Searching for: ${query}`);\n * }, 300);\n *\n * debouncedSearch('laptop'); // Executes after 300ms of inactivity.\n */\nexport function debounceAction<T extends VoidFunction>(\n\tcallback: T,\n\tdelay = 300,\n): DelayedFn<T> {\n\tlet timeoutId: ReturnType<typeof setTimeout> | undefined = undefined;\n\n\treturn (...args: Parameters<T>) => {\n\t\t// Clear the previous timeout\n\t\tclearTimeout(timeoutId);\n\n\t\t// Set a new timeout\n\t\ttimeoutId = setTimeout(() => {\n\t\t\tcallback(...args);\n\t\t}, delay);\n\t};\n}\n\n/**\n * * A generic throttle function that ensures a callback is executed at most once per specified interval.\n *\n * @param callback - The function to throttle.\n * @param delay - The delay in milliseconds. Default is `150ms`.\n * @returns A throttled version of the callback function.\n *\n * @example\n * const throttledResize = throttleAction(() => {\n * console.log('Resized');\n * }, 300);\n *\n * window.addEventListener('resize', throttledResize);\n */\nexport function throttleAction<T extends VoidFunction>(\n\tcallback: T,\n\tdelay = 150,\n): ThrottledFn<T> {\n\tlet lastCall = 0;\n\n\treturn (...args: Parameters<T>) => {\n\t\tconst now = Date.now();\n\n\t\tif (now - lastCall >= delay) {\n\t\t\tlastCall = now;\n\t\t\tcallback(...args);\n\t\t}\n\t};\n}\n\n/**\n * * Retrieves the names of all instance methods defined directly on a class prototype.\n *\n * @param cls - The class constructor (not an instance).\n * @returns A sorted array of instance method names.\n */\nexport function getInstanceMethodNames(cls: Constructor): string[] {\n\tconst prototype = cls.prototype;\n\n\tconst methods = Object.getOwnPropertyNames(prototype).filter((method) => {\n\t\tif (method === 'constructor') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(prototype, method);\n\n\t\treturn isMethodDescriptor(descriptor);\n\t});\n\n\treturn sortAnArray(methods);\n}\n\n/**\n * * Retrieves the names of all static methods defined directly on a class constructor.\n *\n * @param cls - The class constructor (not an instance).\n * @returns A sorted array of static method names.\n */\nexport function getStaticMethodNames(cls: Constructor): string[] {\n\tconst methods = Object.getOwnPropertyNames(cls).filter((method) => {\n\t\treturn (\n\t\t\tmethod !== 'prototype' && method !== 'name' && method !== 'length'\n\t\t);\n\t});\n\n\treturn sortAnArray(methods);\n}\n\n/**\n * * Counts the number of instance methods defined directly on a class prototype.\n *\n * @param cls - The class constructor (not an instance).\n * @returns The number of instance methods defined on the class prototype.\n */\nexport function countInstanceMethods(cls: Constructor): number {\n\treturn getInstanceMethodNames(cls)?.length;\n}\n\n/**\n * * Counts the number of static methods defined directly on a class constructor.\n *\n * @param cls - The class constructor (not an instance).\n * @returns The number of static methods defined on the class constructor.\n */\nexport function countStaticMethods(cls: Constructor): number {\n\treturn getStaticMethodNames(cls)?.length;\n}\n\n/**\n * * Gathers detailed information about the instance and static methods of a class.\n *\n * @param cls - The class constructor (not an instance).\n * @returns An object containing names and counts of instance and static methods.\n */\nexport function getClassDetails(cls: Constructor): ClassDetails {\n\tconst instanceNames = getInstanceMethodNames(cls);\n\tconst staticNames = getStaticMethodNames(cls);\n\n\treturn {\n\t\tinstanceNames,\n\t\tstaticNames,\n\t\tinstances: instanceNames?.length,\n\t\tstatics: staticNames?.length,\n\t\ttotal: instanceNames?.length + staticNames?.length,\n\t};\n}\n\n/**\n * * Parses any valid JSON string, optionally converting stringified primitives inside (nested) arrays or objects.\n *\n * @template T - Expected return type (default is unknown).\n * @param value - The JSON string to parse.\n * @param parsePrimitives - Whether to convert stringified primitives (default: `true`).\n * @returns The parsed JSON value typed as `T`, or the original parsed value with optional primitive conversion.\n * - Returns `{}` if parsing fails, such as when the input is malformed or invalid JSON or passing single quoted string.\n *\n * - *Unlike `parseJsonToObject`, which ensures the root value is an object,\n * this function returns any valid JSON structure such as arrays, strings, numbers, or objects.*\n *\n * This is useful when you're not sure of the root structure of the JSON, or when you expect something other than an object.\n *\n * @see `parseJsonToObject` for strict object-only parsing.\n */\nexport const parseJSON = <T = unknown>(\n\tvalue: string,\n\tparsePrimitives = true,\n): T => {\n\ttry {\n\t\tconst parsed = JSON.parse(value);\n\n\t\treturn (parsePrimitives ? deepParsePrimitives(parsed) : parsed) as T;\n\t} catch {\n\t\treturn {} as T;\n\t}\n};\n\n/**\n * * Recursively parses primitive values inside objects and arrays.\n *\n * @template T - Expected return type after parsing (default is unknown).\n * @param input - Any input value to parse recursively.\n * @returns Input with primitives (strings like \"true\", \"123\") converted, typed as `T`.\n */\nexport function deepParsePrimitives<T = unknown>(input: unknown): T {\n\tif (Array.isArray(input)) {\n\t\treturn input?.map(deepParsePrimitives) as T;\n\t}\n\n\tif (isObject(input)) {\n\t\tconst result: Record<string, unknown> = {};\n\n\t\tfor (const [key, value] of Object.entries(input)) {\n\t\t\tresult[key] = deepParsePrimitives(value);\n\t\t}\n\n\t\treturn result as T;\n\t}\n\n\tif (isString(input)) {\n\t\tif (/^(true|false)$/i.test(input)) {\n\t\t\treturn (input?.toLowerCase() === 'true') as T;\n\t\t}\n\n\t\tif (isNumericString(input)) {\n\t\t\treturn Number(input) as T;\n\t\t}\n\n\t\tif (input === 'null') {\n\t\t\treturn null as T;\n\t\t}\n\n\t\tif (input === 'undefined') {\n\t\t\treturn undefined as T;\n\t\t}\n\n\t\treturn input as T;\n\t}\n\n\treturn input as T;\n}\n","import { shuffleArray } from '../array/basics';\nimport { convertArrayToString } from '../utils';\nimport { getRandomNumber } from './basics';\nimport { isEven, isOdd } from './guards';\nimport { _applyMultiples } from './helpers';\nimport { isPrime } from './prime';\nimport type { NumberType, RangedNumbers, RangeOptions } from './types';\n\n/**\n * * Function to get numbers within a range based on the provided `NumberType` and options.\n * * Returns either a string or an array of numbers based on the `getAs` property in options.\n *\n * @param type - The type of numbers to generate ('random', 'prime', etc.).\n * @param options - Options to configure number generation, including range and formatting.\n * @returns Either a string or an array of numbers.\n */\nexport function getNumbersInRange<T extends boolean = false>(\n\ttype: NumberType = 'any',\n\toptions?: RangeOptions<T>,\n): RangedNumbers<T> {\n\tconst {\n\t\tgetAsString = false,\n\t\tmin = 0,\n\t\tmax = 100,\n\t\tincludeMin = true,\n\t\tincludeMax = true,\n\t\tseparator = ', ',\n\t\tmultiplesOf,\n\t} = options || {};\n\n\tlet output: number[] = [];\n\n\t/**\n\t * Helper function to apply range and get array of numbers in that range.\n\t *\n\t * @param start The start of the range.\n\t * @param end The end of the range.\n\t * @returns The array of numbers in the range.\n\t */\n\tconst _applyRangeOptions = (start: number, end: number): number[] => {\n\t\tlet startNumber = start;\n\t\tlet endNumber = end;\n\n\t\tif (start > end) {\n\t\t\t[startNumber, endNumber] = [end, start];\n\t\t}\n\n\t\tconst numbers: number[] = [];\n\n\t\tfor (let i = startNumber; i <= endNumber; i++) {\n\t\t\tif (\n\t\t\t\ti >= startNumber &&\n\t\t\t\ti <= endNumber &&\n\t\t\t\t(includeMin || i > startNumber) &&\n\t\t\t\t(includeMax || i < endNumber)\n\t\t\t) {\n\t\t\t\tnumbers.push(i);\n\t\t\t}\n\t\t}\n\t\treturn numbers;\n\t};\n\n\tif (type === 'prime' && multiplesOf !== undefined) {\n\t\tconsole.warn(\n\t\t\t'Warning: The \"multiplesOf\" option is ignored when the type is \"prime\"!',\n\t\t);\n\t}\n\n\tswitch (type) {\n\t\tcase 'random':\n\t\t\toutput = shuffleArray(\n\t\t\t\t_applyRangeOptions(min, max).map((n) =>\n\t\t\t\t\tgetRandomNumber({\n\t\t\t\t\t\tmin: n,\n\t\t\t\t\t\tmax: n,\n\t\t\t\t\t\tincludeMin,\n\t\t\t\t\t\tincludeMax,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t);\n\t\t\tbreak;\n\n\t\tcase 'prime':\n\t\t\toutput = _applyRangeOptions(min, max).filter(isPrime);\n\t\t\tbreak;\n\n\t\tcase 'odd':\n\t\t\toutput = _applyRangeOptions(min, max).filter(isOdd);\n\t\t\tbreak;\n\n\t\tcase 'even':\n\t\t\toutput = _applyRangeOptions(min, max).filter(isEven);\n\t\t\tbreak;\n\n\t\tcase 'natural':\n\t\t\toutput = _applyRangeOptions(Math.max(min, 1), max);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\toutput = _applyRangeOptions(min, max);\n\t\t\tbreak;\n\t}\n\n\tif (type !== 'prime') {\n\t\toutput = _applyMultiples(output, multiplesOf);\n\t}\n\n\treturn getAsString ?\n\t\t\t(convertArrayToString(output, separator) as RangedNumbers<T>)\n\t\t:\t(output as RangedNumbers<T>);\n}\n","/** Colors based on the ASCII value of the letter. */\nexport const alphabetColorPalette = [\n\t'#00094C',\n\t'#00376E',\n\t'#005600',\n\t'#024647',\n\t'#423067',\n\t'#55188E',\n\t'#00453E',\n\t'#00516C',\n\t'#263E0D',\n\t'#0F6F3F',\n\t'#730073',\n\t'#053636',\n\t'#253654',\n\t'#4682B4',\n\t'#3253B6',\n\t'#43616C',\n\t'#036C44',\n\t'#30784F',\n\t'#601C1C',\n\t'#690000',\n\t'#005B00',\n\t'#BF0E6C',\n\t'#008080',\n\t'#475F47',\n\t'#546F1C',\n\t'#824809',\n];\n\n/** Colors based on the index of numbers. */\nexport const numberColorPalette = [\n\t'#893213',\n\t'#A44C15',\n\t'#8B4513',\n\t'#8A1D33',\n\t'#3B543B',\n\t'#342656',\n\t'#A43522',\n\t'#04605F',\n\t'#B5680A',\n\t'#6437B3',\n];\n\nexport const PERCENT_VALUES = [\n\t0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n\t21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\n\t40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,\n\t59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,\n\t78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,\n\t97, 98, 99, 100,\n] as const;\n","import type {\n\tAlphaValue,\n\tHex6,\n\tHex8,\n\tHSL,\n\tHSLA,\n\tPercent,\n\tRGB,\n\tRGBA,\n} from './types';\n\n/**\n * * Converts opacity percentage (0-100) to a 2-digit hex string.\n *\n * @param opacity - The opacity value as a percentage (0-100).\n * @returns A 2-digit hex string representing the alpha value.\n */\nexport const _convertOpacityToHex = (opacity: Percent): string => {\n\t// Ensure opacity is between 0 and 100\n\tconst validOpacity = Math.min(100, Math.max(0, opacity));\n\t// Convert to a value between 0 and 255, then to a hex string\n\tconst alpha = Math.round((validOpacity / 100) * 255);\n\t// Ensure it's 2 digits (e.g., 0x0A instead of 0xA)\n\treturn alpha.toString(16).padStart(2, '0').toUpperCase();\n};\n\n/**\n * * Applies an opacity value to a color string.\n * @param color The color string to apply opacity to.\n * @param opacity The opacity value as a percentage (0-100).\n * @returns The color string with the opacity value applied.\n */\nexport const _applyOpacity = (color: string, opacity: string): string => {\n\treturn color.concat(opacity);\n};\n\n/**\n * * Helper function to generate a random HSL color.\n *\n * @returns A random HSL color string.\n */\nexport const _generateRandomHSL = (): HSL => {\n\tconst hue = Math.floor(Math.random() * 360);\n\tconst saturation = 75 + Math.floor(Math.random() * 25);\n\tconst lightness = 50 + Math.floor(Math.random() * 15);\n\treturn `hsl(${hue}, ${saturation}%, ${lightness}%)`;\n};\n\n/**\n * * Helper function to check if the new color is visually too similar to the previous one.\n * * It compares the hue, saturation, and lightness difference between the new color and the last one generated.\n *\n * @param recentColors - Array of recently generated colors.\n * @param newColor - The new color to compare.\n * @returns `Boolean` : `true` if the new color is similar to the previous one.\n */\nexport const _isSimilarToLast = (\n\trecentColors: string[],\n\tnewColor: string,\n): boolean => {\n\tif (recentColors?.length === 0) return false;\n\n\tconst newHSL = newColor.match(/hsl\\((\\d+), (\\d+)%, (\\d+)%\\)/);\n\tconst lastHSL = recentColors[recentColors?.length - 1].match(\n\t\t/hsl\\((\\d+), (\\d+)%, (\\d+)%\\)/,\n\t);\n\n\tif (!newHSL || !lastHSL) return false;\n\n\tconst newHue = parseInt(newHSL[1], 10);\n\tconst newSaturation = parseInt(newHSL[2], 10);\n\tconst newLightness = parseInt(newHSL[3], 10);\n\n\tconst lastHue = parseInt(lastHSL[1], 10);\n\tconst lastSaturation = parseInt(lastHSL[2], 10);\n\tconst lastLightness = parseInt(lastHSL[3], 10);\n\n\tconst hueDifference = Math.abs(newHue - lastHue);\n\tconst saturationDifference = Math.abs(newSaturation - lastSaturation);\n\tconst lightnessDifference = Math.abs(newLightness - lastLightness);\n\n\treturn (\n\t\thueDifference < 48 &&\n\t\tsaturationDifference < 24 &&\n\t\tlightnessDifference < 16\n\t);\n};\n\n/**\n * @private Checks if a color is in `Hex` format.\n *\n * @param color Color to check.\n * @returns Boolean: `true` if it's a `Hex` color, `false` if not.\n */\nexport function _isHex6(color: string): color is Hex6 {\n\treturn /^#[0-9A-Fa-f]{6}$/.test(color);\n}\n\n/**\n * @private Checks if a color is in `Hex8` format.\n *\n * @param color Color to check.\n * @returns Boolean: `true` if it's a `Hex8` color, `false` if not.\n */\nexport function _isHex8(color: string): color is Hex8 {\n\treturn /^#[0-9A-Fa-f]{8}$/.test(color);\n}\n\n/**\n * @private Checks if a color is in `RGB` format and within valid ranges.\n *\n * @param color Color to check.\n * @returns `true` if it's a `RGB` color, `false` if not.\n */\nexport function _isRGB(color: string): color is RGB {\n\tconst match = color.match(\n\t\t/^rgb\\(\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?)\\s*\\)$/,\n\t);\n\tif (!match) return false;\n\tconst [r, g, b] = match.slice(1).map(Number);\n\treturn (\n\t\t_isValidRGBComponent(r) &&\n\t\t_isValidRGBComponent(g) &&\n\t\t_isValidRGBComponent(b)\n\t);\n}\n\n/**\n * @private Checks if a color is in `RGBA` format and within valid ranges.\n *\n * @param color Color to check.\n * @returns `true` if it's a `RGBA` color, `false` if not.\n */\nexport function _isRGBA(color: string): color is RGBA {\n\tconst match = color.match(\n\t\t/^rgba\\(\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(0|1|0?\\.\\d+)\\s*\\)$/,\n\t);\n\tif (!match) return false;\n\tconst [r, g, b, a] = match.slice(1).map(Number);\n\treturn (\n\t\t_isValidRGBComponent(r) &&\n\t\t_isValidRGBComponent(g) &&\n\t\t_isValidRGBComponent(b) &&\n\t\t_isValidAlpha(a)\n\t);\n}\n\n/**\n * @private Checks if a color is in `HSL` format and within valid ranges.\n *\n * @param color Color to check.\n * @returns `true` if it's a `HSL` color, `false` if not.\n */\nexport function _isHSL(color: string): color is HSL {\n\tconst match = color.match(\n\t\t/^hsl\\(\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?)%,\\s*(\\d{1,3}(?:\\.\\d+)?)%\\s*\\)$/,\n\t);\n\tif (!match) return false;\n\tconst [h, s, l] = match.slice(1).map(Number);\n\treturn _isValidHue(h) && _isValidPercentage(s) && _isValidPercentage(l);\n}\n\n/**\n * @private Checks if a color is in `HSLA` format and within valid ranges.\n *\n * @param color Color to check.\n * @returns `true` if it's a `HSLA` color, `false` if not.\n */\nexport function _isHSLA(color: string): color is HSLA {\n\tconst match = color.match(\n\t\t/^hsla\\(\\s*(\\d{1,3}(?:\\.\\d+)?),\\s*(\\d{1,3}(?:\\.\\d+)?)%,\\s*(\\d{1,3}(?:\\.\\d+)?)%,\\s*(0|1|0?\\.\\d+)\\s*\\)$/,\n\t);\n\tif (!match) return false;\n\tconst [h, s, l, a] = match.slice(1).map(Number);\n\treturn (\n\t\t_isValidHue(h) &&\n\t\t_isValidPercentage(s) &&\n\t\t_isValidPercentage(l) &&\n\t\t_isValidAlpha(a)\n\t);\n}\n\n/**\n * @private Checks if a number is valid alpha value.\n *\n * @param value Alpha value to check.\n * @returns `true` if it's a valid alpha value, `false` if not.\n */\nexport function _isValidAlpha(value: number): value is AlphaValue {\n\treturn value >= 0 && value <= 1 && !isNaN(value);\n}\n\n/** * @private Validates RGB component (0–255). */\nexport function _isValidRGBComponent(value: number): boolean {\n\treturn value >= 0 && value <= 255;\n}\n\n/** * @private Validates HSL hue (0–360). */\nexport function _isValidHue(value: number): boolean {\n\treturn value >= 0 && value <= 360;\n}\n\n/** * @private Validates HSL percentage components (0–100). */\nexport function _isValidPercentage(value: number): boolean {\n\treturn value >= 0 && value <= 100;\n}\n","import { alphabetColorPalette, numberColorPalette } from './constants';\nimport { _applyOpacity, _convertOpacityToHex } from './helpers';\nimport type { ColorInput, ColorInputArray, Percent } from './types';\n\n/**\n * * Generates a hex color based on the first character (initial) of a string or number.\n *\n * - For numbers, it uses 10 predefined colors (0-9).\n * - For letters, it uses 26 predefined colors (A-Z).\n * - Invalid characters handled with a fallback color.\n * @param input - A string or number.\n * @param opacity - A value from 0 to 100 representing the opacity percentage.\n * @returns A hex color for the first character of the provided string/number.\n */\nexport function getColorForInitial(\n\tinput: string | number,\n\topacity?: Percent,\n): string;\n\n/**\n * * Generates an array of hex colors based on the first character (initial) of an array of strings/numbers or even nested arrays of strings/numbers.\n *\n * - For numbers, it uses 10 predefined colors (0-9).\n * - For letters, it uses 26 predefined colors (A-Z).\n * - For empty array it returns all 36 colors.\n * - Invalid characters and inputs are handled with a fallback color.\n * @param input - A string, number, or an array of strings/numbers or even nested arrays of strings/numbers.\n * @param opacity - A value from 0 to 100 representing the opacity percentage.\n * @returns A hex color for a string/number, or an array of hex colors for each element of the provided array.\n */\nexport function getColorForInitial(\n\tinput: ColorInputArray,\n\topacity?: Percent,\n): string[];\n\n/**\n * * Generates a hex color based on the first character (initial) of a string or number; or an array of hex colors based on the first character (initial) of an array of strings/numbers or even nested arrays of strings/numbers.\n *\n * - For numbers, it uses 10 predefined colors (0-9).\n * - For letters, it uses 26 predefined colors (A-Z).\n * - For empty array it returns all 36 colors.\n * - Invalid characters and inputs are handled with a fallback color.\n * @param input - A string, number, or an array of strings/numbers or even nested arrays of strings/numbers.\n * @param opacity - A value from 0 to 100 representing the opacity percentage.\n * @returns A hex color for a string/number, or an array of hex colors for each element of the provided array.\n */\nexport function getColorForInitial(\n\tinput: ColorInput | ColorInputArray = '',\n\topacity: Percent = 100,\n): string | string[] {\n\tlet initial: string;\n\n\tconst hexOpacity = _convertOpacityToHex(opacity);\n\n\tconst numbers = '0123456789';\n\n\t// Handle empty string case\n\tif (!input) return _applyOpacity('#010514', hexOpacity);\n\n\t// Handle string input\n\tif (typeof input === 'string') {\n\t\tinitial = input[0];\n\n\t\t// Handle number as string\n\t\tif (numbers.includes(initial)) {\n\t\t\treturn _applyOpacity(\n\t\t\t\tnumberColorPalette[parseInt(initial, 10)],\n\t\t\t\thexOpacity,\n\t\t\t);\n\t\t}\n\n\t\tconst upperInitial = initial.toUpperCase();\n\t\tconst index = upperInitial.charCodeAt(0) - 'A'.charCodeAt(0);\n\n\t\t// Validate alphabet\n\t\tif (index >= 0 && index < alphabetColorPalette?.length) {\n\t\t\treturn _applyOpacity(alphabetColorPalette[index], hexOpacity);\n\t\t}\n\n\t\treturn _applyOpacity('#010514', hexOpacity);\n\t\t// Handle number input\n\t} else if (typeof input === 'number' && !isNaN(input)) {\n\t\tinitial = input.toString()[0];\n\n\t\tif (numbers.includes(initial)) {\n\t\t\treturn _applyOpacity(\n\t\t\t\tnumberColorPalette[parseInt(initial, 10)],\n\t\t\t\thexOpacity,\n\t\t\t);\n\t\t}\n\n\t\treturn _applyOpacity('#010514', hexOpacity);\n\t\t// Handle array of strings/numbers\n\t} else if (Array.isArray(input)) {\n\t\tif (input?.length < 1)\n\t\t\treturn [...alphabetColorPalette, ...numberColorPalette].map(\n\t\t\t\t(color) => _applyOpacity(color, hexOpacity),\n\t\t\t);\n\n\t\treturn input\n\t\t\t.map((el) => {\n\t\t\t\tif (Array.isArray(el)) {\n\t\t\t\t\treturn getColorForInitial(el, opacity);\n\t\t\t\t}\n\t\t\t\treturn getColorForInitial(el, opacity);\n\t\t\t})\n\t\t\t.flat();\n\t}\n\n\treturn _applyOpacity('#010514', hexOpacity);\n}\n","import { _isHSL, _isHSLA, _isRGB, _isRGBA } from './helpers';\nimport type { AlphaValues, HSL, HSLA, RGB, RGBA, SolidValues } from './types';\n\n/**\n * * Extracts numbers from a color string like `rgb(66, 103, 69)` or `hsl(120, 42.86%, 41.18%)`.\n * * Converts percentage values to decimal (e.g., `42.86%` → `42.86`).\n *\n * @param color The color string in RGB or HSL format.\n * @returns A tuple of 3 extracted numbers. `[number, number, number]`\n *\n * @remarks If the input color is not in `HSL` or `RGB` format, it will return `[0, 0, 0]`\n */\nexport const extractSolidColorValues = (color: HSL | RGB): SolidValues => {\n\tif (_isHSL(color) || _isRGB(color)) {\n\t\treturn (color.match(/[\\d.]+%?/g) || [])?.map((value) =>\n\t\t\tparseFloat(value),\n\t\t) as SolidValues;\n\t}\n\n\treturn [0, 0, 0];\n};\n\n/**\n * * Extracts numbers from a color string like `rgba(66, 103, 69, 0.6)` or `hsla(120, 42.86%, 41.18%, 0.9)`.\n * * Converts percentage values to decimal (e.g., `42.86%` → `42.86`).\n *\n * @param color The color string in RGBA or HSLA format.\n * @returns A tuple of 4 extracted numbers. `[number, number, number, number]`\n *\n * @remarks If the input color is not in `HSLA` or `RGBA` format, it will return `[0, 0, 0, 0]`\n */\nexport const extractAlphaColorValues = (color: HSLA | RGBA): AlphaValues => {\n\tif (_isHSLA(color) || _isRGBA(color)) {\n\t\treturn (color.match(/[\\d.]+%?/g) || [])?.map((value) =>\n\t\t\tparseFloat(value),\n\t\t) as AlphaValues;\n\t}\n\n\treturn [0, 0, 0, 0];\n};\n","import {\n\t_convertOpacityToHex,\n\t_isHex6,\n\t_isHex8,\n\t_isHSL,\n\t_isHSLA,\n\t_isRGB,\n\t_isRGBA,\n\t_isValidAlpha,\n} from './helpers';\nimport type {\n\tColorType,\n\tConvertedColors,\n\tHex,\n\tHex6,\n\tHex8,\n\tHSL,\n\tHSLA,\n\tPercent,\n\tRGB,\n\tRGBA,\n} from './types';\nimport { extractAlphaColorValues, extractSolidColorValues } from './utils';\n\n/**\n * * Converts HSL to RGB color format.\n *\n * @param h - The hue component of the HSL color, in degrees (0 to 360).\n * @param s - The saturation component of the HSL color, as a percentage (0 to 100).\n * @param l - The lightness component of the HSL color, as a percentage (0 to 100).\n * @returns A string representing the color in RGB format (e.g., `rgb(255, 0, 0)`).\n */\nexport const convertHslToRgb = (h: number, s: number, l: number): RGB => {\n\t// Normalize the HSL values\n\ts /= 100;\n\tl /= 100;\n\n\tconst c = (1 - Math.abs(2 * l - 1)) * s;\n\tconst x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n\tconst m = l - c / 2;\n\n\tlet r = 0,\n\t\tg = 0,\n\t\tb = 0;\n\n\tif (h >= 0 && h < 60) [r, g] = [c, x];\n\telse if (h >= 60 && h < 120) [r, g] = [x, c];\n\telse if (h >= 120 && h < 180) [g, b] = [c, x];\n\telse if (h >= 180 && h < 240) [g, b] = [x, c];\n\telse if (h >= 240 && h < 300) [r, b] = [x, c];\n\telse if (h >= 300 && h < 360) [r, b] = [c, x];\n\n\tr = Math.round((r + m) * 255);\n\tg = Math.round((g + m) * 255);\n\tb = Math.round((b + m) * 255);\n\n\treturn `rgb(${r}, ${g}, ${b})`;\n};\n\n/**\n * * Converts RGB to HSL color format.\n *\n * @param r - The red component of the RGB color, in the range 0 to 255.\n * @param g - The green component of the RGB color, in the range 0 to 255.\n * @param b - The blue component of the RGB color, in the range 0 to 255.\n * @returns A string representing the color in HSL format (e.g., `hsl(0, 100%, 50%)`).\n */\nexport const convertRgbToHsl = (r: number, g: number, b: number): HSL => {\n\tr /= 255;\n\tg /= 255;\n\tb /= 255;\n\n\tconst max = Math.max(r, g, b);\n\tconst min = Math.min(r, g, b);\n\n\tlet h = 0,\n\t\ts = 0;\n\n\tconst l = (max + min) / 2;\n\n\tif (max !== min) {\n\t\tconst diff = max - min;\n\n\t\ts = l > 0.5 ? diff / (2 - max - min) : diff / (max + min);\n\n\t\tswitch (max) {\n\t\t\tcase r:\n\t\t\t\th = (g - b) / diff + (g < b ? 6 : 0);\n\t\t\t\tbreak;\n\t\t\tcase g:\n\t\t\t\th = (b - r) / diff + 2;\n\t\t\t\tbreak;\n\t\t\tcase b:\n\t\t\t\th = (r - g) / diff + 4;\n\t\t\t\tbreak;\n\t\t}\n\n\t\th *= 60;\n\t}\n\n\treturn `hsl(${Math.round(h)}, ${Number((s * 100).toFixed(2))}%, ${Number((l * 100).toFixed(2))}%)`;\n};\n\n/**\n * * Converts HSL to Hex color format.\n *\n * @param h - The hue component of the HSL color, in degrees (0 to 360).\n * @param s - The saturation component of the HSL color, as a percentage (0 to 100).\n * @param l - The lightness component of the HSL color, as a percentage (0 to 100).\n * @returns A string representing the color in Hex format (e.g., `#FF0000`).\n */\nexport const convertHslToHex = (h: number, s: number, l: number): Hex6 => {\n\tconst rgb = convertHslToRgb(h, s, l).match(/\\d+/g)!.map(Number);\n\n\treturn convertRgbToHex(rgb[0], rgb[1], rgb[2]);\n};\n\n/**\n * * Converts Hex to HSL color format.\n *\n * @param hex - A string representing the color in Hex format (e.g., `#FF0000`).\n * @returns A string representing the color in HSL format (e.g., `hsl(0, 100%, 50%)`).\n */\nexport const convertHexToHsl = (hex: Hex6 | Hex): HSL => {\n\tlet newHex = hex.replace('#', '');\n\n\tif (newHex?.length === 3) {\n\t\tnewHex = newHex\n\t\t\t?.split('')\n\t\t\t?.map((char) => char + char)\n\t\t\t?.join('');\n\t}\n\n\tconst r = parseInt(newHex.slice(0, 2), 16);\n\tconst g = parseInt(newHex.slice(2, 4), 16);\n\tconst b = parseInt(newHex.slice(4, 6), 16);\n\n\treturn convertRgbToHsl(r, g, b);\n};\n\n/**\n * * Converts RGB to Hex color format.\n *\n * @param r - The red component of the RGB color, in the range 0 to 255.\n * @param g - The green component of the RGB color, in the range 0 to 255.\n * @param b - The blue component of the RGB color, in the range 0 to 255.\n * @returns A string representing the color in Hex format (e.g., `#FF0000`).\n */\nexport const convertRgbToHex = (r: number, g: number, b: number): Hex6 => {\n\tconst hex = [r, g, b]\n\t\t?.map((v) => v.toString(16).padStart(2, '0'))\n\t\t?.join('')\n\t\t?.toUpperCase();\n\n\treturn `#${hex}` as Hex6;\n};\n\n/**\n * * Converts Hex to RGB color format.\n *\n * @param hex - A string representing the color in Hex format (e.g., `#FF0000`).\n * @returns A string representing the color in RGB format (e.g., `rgb(255, 0, 0)`).\n */\nexport const convertHexToRgb = (hex: Hex6 | Hex | string): RGB => {\n\t// Remove the # if present\n\tlet newHex = hex.replace('#', '');\n\n\tif (newHex?.length === 3) {\n\t\tnewHex = newHex\n\t\t\t?.split('')\n\t\t\t?.map((char) => char + char)\n\t\t\t?.join('');\n\t}\n\n\tconst r = parseInt(newHex.slice(0, 2), 16);\n\tconst g = parseInt(newHex.slice(2, 4), 16);\n\tconst b = parseInt(newHex.slice(4, 6), 16);\n\n\treturn `rgb(${r}, ${g}, ${b})`;\n};\n\n/**\n * * Converts RGB to RGBA format, adding alpha (opacity).\n *\n * @param r - The red component of the RGB color, in the range 0 to 255.\n * @param g - The green component of the RGB color, in the range 0 to 255.\n * @param b - The blue component of the RGB color, in the range 0 to 255.\n * @param a - The alpha (opacity) value, in the range 0 to 1.\n * @returns A string representing the color in RGBA format (e.g., `rgba(255, 0, 0, 0.5)`).\n */\nexport const convertRgbToRgba = (\n\tr: number,\n\tg: number,\n\tb: number,\n\ta: number = 1,\n): RGBA => {\n\tlet newAlpha = a;\n\n\tif (!_isValidAlpha(a)) {\n\t\tnewAlpha = 1;\n\n\t\tconsole.warn(`Alpha value must be between 0-1, ${a} converted to 1!`);\n\t}\n\n\treturn `rgba(${r}, ${g}, ${b}, ${parseFloat(newAlpha.toFixed(1))})`;\n};\n\n/**\n * * Converts RGBA to Hex format, including alpha channel as part of Hex8.\n *\n * @param r - The red component of the RGB color, in the range 0 to 255.\n * @param g - The green component of the RGB color, in the range 0 to 255.\n * @param b - The blue component of the RGB color, in the range 0 to 255.\n * @param a - The alpha (opacity) value, in the range 0 to 1.\n * @returns A string representing the color in Hex8 format (e.g., `#FF000080`).\n */\nexport const convertRgbaToHex8 = (\n\tr: number,\n\tg: number,\n\tb: number,\n\ta: number = 1,\n): Hex8 => {\n\tlet newAlpha = a;\n\n\tif (!_isValidAlpha(a)) {\n\t\tnewAlpha = 1;\n\n\t\tconsole.warn(`Alpha value must be between 0-1, ${a} converted to 1!`);\n\t}\n\n\tconst hex = convertRgbToHex(r, g, b);\n\n\tconst alphaHex = _convertOpacityToHex(\n\t\tMath.round(newAlpha * 100) as Percent,\n\t);\n\n\treturn `${hex}${alphaHex}` as Hex8;\n};\n\n/**\n * * Converts HSLA to RGBA color format, including alpha channel.\n *\n * @param h - The hue component of the HSL color, in degrees (0 to 360).\n * @param s - The saturation component of the HSL color, as a percentage (0 to 100).\n * @param l - The lightness component of the HSL color, as a percentage (0 to 100).\n * @param a - The alpha (opacity) value, in the range 0 to 1.\n * @returns A string representing the color in RGBA format (e.g., `rgba(255, 0, 0, 0.5)`).\n */\nexport const convertHslaToRgba = (\n\th: number,\n\ts: number,\n\tl: number,\n\ta: number = 1,\n): RGBA => {\n\tlet newAlpha = a;\n\n\tif (!_isValidAlpha(a)) {\n\t\tnewAlpha = 1;\n\n\t\tconsole.warn(`Alpha value must be between 0-1, ${a} converted to 1!`);\n\t}\n\n\tconst rgb = convertHslToRgb(h, s, l);\n\tconst rgbNumbers = extractSolidColorValues(rgb);\n\n\treturn convertRgbToRgba(\n\t\trgbNumbers[0],\n\t\trgbNumbers[1],\n\t\trgbNumbers[2],\n\t\tparseFloat(newAlpha.toFixed(1)),\n\t);\n};\n\n/**\n * * Converts RGBA to HSLA color format, including alpha channel.\n *\n * @param r - The red component of the RGB color, in the range 0 to 255.\n * @param g - The green component of the RGB color, in the range 0 to 255.\n * @param b - The blue component of the RGB color, in the range 0 to 255.\n * @param a - The alpha (opacity) value, in the range 0 to 1.\n * @returns A string representing the color in HSLA format (e.g., `hsla(0, 100%, 50%, 0.5)`).\n */\nexport const convertRgbaToHsla = (\n\tr: number,\n\tg: number,\n\tb: number,\n\ta: number = 1,\n): HSLA => {\n\tlet newAlpha = a;\n\n\tif (!_isValidAlpha(a)) {\n\t\tnewAlpha = 1;\n\n\t\tconsole.warn(`Alpha value must be between 0-1, ${a} converted to 1!`);\n\t}\n\n\tconst hsl = convertRgbToHsl(r, g, b);\n\tconst hslNumbers = extractSolidColorValues(hsl);\n\n\treturn `hsla(${hslNumbers[0]}, ${hslNumbers[1]}%, ${hslNumbers[2]}%, ${parseFloat(newAlpha.toFixed(1))})`;\n};\n\n/**\n * * Converts Hex8 to RGBA color format, including alpha channel.\n * - `Special Note:` Cast the parameter to `Hex8` before converting to `RGBA`.\n * @example convertHex8ToRgba('#FFF122DE' as Hex8)\n *\n * @param hex8 - A string representing the color in Hex8 format (e.g., `#FF000080`).\n * @returns A string representing the color in RGBA format (e.g., `rgba(255, 0, 0, 0.5)`).\n */\nexport const convertHex8ToRgba = (hex8: Hex8): RGBA => {\n\tconst hex = hex8.replace('#', '');\n\tconst r = parseInt(hex.slice(0, 2), 16);\n\tconst g = parseInt(hex.slice(2, 4), 16);\n\tconst b = parseInt(hex.slice(4, 6), 16);\n\tconst a = parseInt(hex.slice(6, 8), 16) / 255;\n\n\treturn `rgba(${r}, ${g}, ${b}, ${parseFloat(a.toFixed(1))})`;\n};\n\n/**\n * * Converts HSLA to Hex8 color format, including alpha channel.\n *\n * @param h - The hue component of the HSL color, in degrees (0 to 360).\n * @param s - The saturation component of the HSL color, as a percentage (0 to 100).\n * @param l - The lightness component of the HSL color, as a percentage (0 to 100).\n * @param a - The alpha (opacity) value, in the range 0 to 1.\n * @returns A string representing the color in Hex8 format (e.g., `#658789DF`).\n */\nexport const convertHslaToHex8 = (\n\th: number,\n\ts: number,\n\tl: number,\n\ta: number = 1,\n): Hex8 => {\n\tlet newAlpha = a;\n\n\tif (!_isValidAlpha(a)) {\n\t\tnewAlpha = 1;\n\n\t\tconsole.warn(`Alpha value must be between 0-1, ${a} converted to 1!`);\n\t}\n\n\tconst hex = convertHslToHex(h, s, l);\n\n\tconst alphaHex = _convertOpacityToHex(\n\t\tMath.round(newAlpha * 100) as Percent,\n\t);\n\n\treturn `${hex}${alphaHex}` as Hex8;\n};\n\n/**\n * * Converts Hex8 to HSLA color format.\n * - `Special Note:` Cast the parameter to `Hex8` before converting to `HSLA`.\n * @example convertHex8ToHsla('#FFF122DE' as Hex8)\n *\n * @param hex - A string representing the color in Hex format (e.g., `#FF0000DE`).\n * @returns A string representing the color in HSLA format..\n */\nexport const convertHex8ToHsla = (hex8: Hex8): HSLA => {\n\tconst rgba = convertHex8ToRgba(hex8);\n\n\treturn convertRgbaToHsla(...extractAlphaColorValues(rgba as RGBA));\n};\n\n/**\n * * Converts a `Hex` color code to `RGB` and `HSL` formats.\n * - `Special Note:` Cast the parameter to `Hex6` before converting to `RGB` and `HSL`.\n * @example convertColorCode('#FFF122' as Hex6)\n *\n * @param color The `Hex` color code (e.g., `#3c6945`).\n * @returns An object containing the `RGB` and `HSL` formats of the given `Hex` color.\n */\nexport function convertColorCode(color: Hex6): {\n\trgb: RGB;\n\thsl: HSL;\n};\n\n/**\n * * Converts an `RGB` color to `Hex` and `HSL` formats.\n *\n * @param color The `RGB` color string (e.g., `rgb(60, 105, 69)`).\n * @returns An object containing the `Hex` and `HSL` formats of the given `RGB` color.\n */\nexport function convertColorCode(color: RGB): {\n\thex: Hex6;\n\thsl: HSL;\n};\n\n/**\n * * Converts an `HSL` color to `Hex` and `RGB` formats.\n *\n * @param color The `HSL` color string (e.g., `hsl(132, 27.27%, 32.35%)`).\n * @returns An object containing the `Hex` and `RGB` formats of the given `HSL` color.\n */\nexport function convertColorCode(color: HSL): {\n\thex: Hex6;\n\trgb: RGB;\n};\n\n/**\n * * Converts a `Hex8` color code to `RGB` and `HSL` formats.\n * - `Special Note:` Cast the parameter to `Hex8` before converting to `RGBA` and `HSLA`.\n * @example convertColorCode('#FFF122DE' as Hex8)\n *\n * @param color The `Hex8` color code (e.g., `#3c6945`).\n * @returns An object containing the `RGB` and `HSL` formats of the given `Hex8` color.\n */\nexport function convertColorCode(color: Hex8): {\n\trgba: RGBA;\n\thsla: HSLA;\n};\n\n/**\n * * Converts an `RGBA` color to `Hex8` and `HSLA` formats.\n *\n * @param color The `RGBA` color string (e.g., `rgb(60, 105, 69)`).\n * @returns An object containing the `Hex8` and `HSLA` formats of the given `RGBA` color.\n */\nexport function convertColorCode(color: RGBA): {\n\thex8: Hex8;\n\thsla: HSLA;\n};\n\n/**\n * * Converts an `HSLA` color to `Hex8` and `RGBA` formats.\n *\n * @param color The `HSLA` color string (e.g., `hsl(132, 27.27%, 32.35%)`).\n * @returns An object containing the `Hex8` and `RGBA` formats of the given `HSLA` color.\n */\nexport function convertColorCode(color: HSLA): {\n\thex8: Hex8;\n\trgba: RGBA;\n};\n\n/**\n * * Converts a color from `Hex`, `RGB`, or `HSL` format to its equivalent representations.\n *\n * @param color The color string in `Hex`, `RGB`, or `HSL` format.\n * @returns The converted color representations excluding the input format.\n * @throws If the color format is unrecognized throws `Error`.\n */\nexport function convertColorCode(color: ColorType): ConvertedColors<ColorType> {\n\tif (_isHex6(color)) {\n\t\treturn {\n\t\t\trgb: convertHexToRgb(color),\n\t\t\thsl: convertHexToHsl(color),\n\t\t} as ConvertedColors<Hex6>;\n\t}\n\n\tif (_isRGB(color)) {\n\t\tconst rgbValues = extractSolidColorValues(color as RGB);\n\n\t\treturn {\n\t\t\thex: convertRgbToHex(...rgbValues),\n\t\t\thsl: convertRgbToHsl(...rgbValues),\n\t\t} as ConvertedColors<RGB>;\n\t}\n\n\tif (_isHSL(color)) {\n\t\tconst hslValues = extractSolidColorValues(color as HSL);\n\n\t\treturn {\n\t\t\thex: convertHslToHex(...hslValues),\n\t\t\trgb: convertHslToRgb(...hslValues),\n\t\t} as ConvertedColors<HSL>;\n\t}\n\n\tif (_isHex8(color)) {\n\t\treturn {\n\t\t\trgba: convertHex8ToRgba(color),\n\t\t\thsla: convertHex8ToHsla(color),\n\t\t} as ConvertedColors<Hex8>;\n\t}\n\n\tif (_isRGBA(color)) {\n\t\tconst rgbaValues = extractAlphaColorValues(color as RGBA);\n\n\t\treturn {\n\t\t\thex8: convertRgbaToHex8(...rgbaValues),\n\t\t\thsla: convertRgbaToHsla(...rgbaValues),\n\t\t} as ConvertedColors<RGBA>;\n\t}\n\n\tif (_isHSLA(color)) {\n\t\tconst hslaValues = extractAlphaColorValues(color as HSLA);\n\n\t\treturn {\n\t\t\thex8: convertHslaToHex8(...hslaValues),\n\t\t\trgba: convertHslaToRgba(...hslaValues),\n\t\t} as ConvertedColors<HSLA>;\n\t}\n\n\tthrow new Error(`Unrecognized Color Format! ${color}`);\n}\n","import { convertColorCode } from './convert';\nimport { _generateRandomHSL, _isSimilarToLast } from './helpers';\nimport type { Hex6, HSL, RGB } from './types';\n\n/** Track previously generated colors. */\nconst generatedColors = new Set<string>();\n\n/** Array of recently generated colors */\nconst recentColors: string[] = [];\n\n/**\n * * Utility to generate a unique random HSL color.\n *\n * @param maxColors - The maximum number of recent colors to store in memory. Default is `16`.\n * @returns Generated unique random color in `HSL` format.\n */\nexport const generateRandomHSLColor = (maxColors: number = 16): HSL => {\n\tlet color: HSL;\n\n\t// Keep generating until a unique color is found that is also different from the last one\n\tdo {\n\t\tcolor = _generateRandomHSL();\n\t} while (\n\t\tgeneratedColors.has(color) ||\n\t\t_isSimilarToLast(recentColors, color)\n\t);\n\n\t// Add the newly generated color to the set and recent colors\n\tgeneratedColors.add(color);\n\trecentColors.push(color);\n\n\t// Limit the recent colors to the last `maxColors` to avoid excessive memory usage\n\tif (recentColors?.length > maxColors) {\n\t\trecentColors?.shift();\n\t}\n\n\treturn color;\n};\n\n/**\n * * Utility to generate a unique random color in Hex and RGB format.\n *\n * @param maxColors - The maximum number of recent colors to store in memory. Default is `16`.\n * @returns An object of generated unique random color in both `Hex` and `RGB` formats.\n */\nexport const generateRandomColorInHexRGB = (\n\tmaxColors: number = 16,\n): {\n\thex: Hex6;\n\trgb: RGB;\n} => {\n\treturn convertColorCode(generateRandomHSLColor(maxColors));\n};\n","export const CSS_COLORS = {\n\tblack: '#000000',\n\tsilver: '#C0C0C0',\n\tgray: '#808080',\n\twhite: '#FFFFFF',\n\tmaroon: '#800000',\n\tred: '#FF0000',\n\tpurple: '#800080',\n\tfuchsia: '#FF00FF',\n\tgreen: '#008000',\n\tlime: '#00FF00',\n\tolive: '#808000',\n\tyellow: '#FFFF00',\n\tnavy: '#000080',\n\tblue: '#0000FF',\n\tteal: '#008080',\n\taqua: '#00FFFF',\n\taliceblue: '#F0F8FF',\n\tantiquewhite: '#FAEBD7',\n\taquamarine: '#7FFFD4',\n\tazure: '#F0FFFF',\n\tbeige: '#F5F5DC',\n\tbisque: '#FFE4C4',\n\tblanchedalmond: '#FFEBCD',\n\tblueviolet: '#8A2BE2',\n\tbrown: '#A52A2A',\n\tburlywood: '#DEB887',\n\tcadetblue: '#5F9EA0',\n\tchartreuse: '#7FFF00',\n\tchocolate: '#D2691E',\n\tcoral: '#FF7F50',\n\tcornflowerblue: '#6495ED',\n\tcornsilk: '#FFF8DC',\n\tcrimson: '#DC143C',\n\tcyan: '#00FFFF',\n\tdarkblue: '#00008B',\n\tdarkcyan: '#008B8B',\n\tdarkgoldenrod: '#B8860B',\n\tdarkgray: '#A9A9A9',\n\tdarkgreen: '#006400',\n\tdarkgrey: '#A9A9A9',\n\tdarkkhaki: '#BDB76B',\n\tdarkmagenta: '#8B008B',\n\tdarkolivegreen: '#556B2F',\n\tdarkorange: '#FF8C00',\n\tdarkorchid: '#9932CC',\n\tdarkred: '#8B0000',\n\tdarksalmon: '#E9967A',\n\tdarkseagreen: '#8FBC8F',\n\tdarkslateblue: '#483D8B',\n\tdarkslategray: '#2F4F4F',\n\tdarkslategrey: '#2F4F4F',\n\tdarkturquoise: '#00CED1',\n\tdarkviolet: '#9400D3',\n\tdeeppink: '#FF1493',\n\tdeepskyblue: '#00BFFF',\n\tdimgray: '#696969',\n\tdimgrey: '#696969',\n\tdodgerblue: '#1E90FF',\n\tfirebrick: '#B22222',\n\tfloralwhite: '#FFFAF0',\n\tforestgreen: '#228B22',\n\tgainsboro: '#DCDCDC',\n\tghostwhite: '#F8F8FF',\n\tgold: '#FFD700',\n\tgoldenrod: '#DAA520',\n\tgreenyellow: '#ADFF2F',\n\tgrey: '#808080',\n\thoneydew: '#F0FFF0',\n\thotpink: '#FF69B4',\n\tindianred: '#CD5C5C',\n\tindigo: '#4B0082',\n\tivory: '#FFFFF0',\n\tkhaki: '#F0E68C',\n\tlavender: '#E6E6FA',\n\tlavenderblush: '#FFF0F5',\n\tlawngreen: '#7CFC00',\n\tlemonchiffon: '#FFFACD',\n\tlightblue: '#ADD8E6',\n\tlightcoral: '#F08080',\n\tlightcyan: '#E0FFFF',\n\tlightgoldenrodyellow: '#FAFAD2',\n\tlightgray: '#D3D3D3',\n\tlightgreen: '#90EE90',\n\tlightgrey: '#D3D3D3',\n\tlightpink: '#FFB6C1',\n\tlightsalmon: '#FFA07A',\n\tlightseagreen: '#20B2AA',\n\tlightskyblue: '#87CEFA',\n\tlightslategray: '#778899',\n\tlightslategrey: '#778899',\n\tlightsteelblue: '#B0C4DE',\n\tlightyellow: '#FFFFE0',\n\tlimegreen: '#32CD32',\n\tlinen: '#FAF0E6',\n\tmagenta: '#FF00FF',\n\tmediumaquamarine: '#66CDAA',\n\tmediumblue: '#0000CD',\n\tmediumorchid: '#BA55D3',\n\tmediumpurple: '#9370DB',\n\tmediumseagreen: '#3CB371',\n\tmediumslateblue: '#7B68EE',\n\tmediumspringgreen: '#00FA9A',\n\tmediumturquoise: '#48D1CC',\n\tmediumvioletred: '#C71585',\n\tmidnightblue: '#191970',\n\tmintcream: '#F5FFFA',\n\tmistyrose: '#FFE4E1',\n\tmoccasin: '#FFE4B5',\n\tnavajowhite: '#FFDEAD',\n\toldlace: '#FDF5E6',\n\tolivedrab: '#6B8E23',\n\torange: '#FFA500',\n\torangered: '#FF4500',\n\torchid: '#DA70D6',\n\tpalegoldenrod: '#EEE8AA',\n\tpalegreen: '#98FB98',\n\tpaleturquoise: '#AFEEEE',\n\tpalevioletred: '#DB7093',\n\tpapayawhip: '#FFEFD5',\n\tpeachpuff: '#FFDAB9',\n\tperu: '#CD853F',\n\tpink: '#FFC0CB',\n\tplum: '#DDA0DD',\n\tpowderblue: '#B0E0E6',\n\trebeccapurple: '#663399',\n\trosybrown: '#BC8F8F',\n\troyalblue: '#4169E1',\n\tsaddlebrown: '#8B4513',\n\tsalmon: '#FA8072',\n\tsandybrown: '#F4A460',\n\tseagreen: '#2E8B57',\n\tseashell: '#FFF5EE',\n\tsienna: '#A0522D',\n\tskyblue: '#87CEEB',\n\tslateblue: '#6A5ACD',\n\tslategray: '#708090',\n\tslategrey: '#708090',\n\tsnow: '#FFFAFA',\n\tspringgreen: '#00FF7F',\n\tsteelblue: '#4682B4',\n\ttan: '#D2B48C',\n\tthistle: '#D8BFD8',\n\ttomato: '#FF6347',\n\ttransparent: '#00000000',\n\tturquoise: '#40E0D0',\n\tviolet: '#EE82EE',\n\twheat: '#F5DEB3',\n\twhitesmoke: '#F5F5F5',\n\tyellowgreen: '#9ACD32',\n\tgrape: '#CC5DE8',\n\tdark: '#3B3B3B',\n\tvolcano: '#FA541C',\n\tgeekblue: '#2F54EB',\n\tsuccess: '#4CAF50',\n\tinfo: '#2196F3',\n\twarning: '#FF9800',\n\terror: '#F44336',\n} as const;\n","import { convertColorCode } from './convert';\nimport { CSS_COLORS } from './css-colors';\nimport {\n\t_convertOpacityToHex,\n\t_isHSL,\n\t_isHSLA,\n\t_isRGB,\n\t_isRGBA,\n} from './helpers';\nimport { generateRandomHSLColor } from './random';\nimport type {\n\tAlphaColors,\n\tAnalogous,\n\tColors,\n\tColorType,\n\tCSSColor,\n\tHex6,\n\tHex8,\n\tHSL,\n\tHSLA,\n\tPercent,\n\tRGB,\n\tRGBA,\n\tSolidColors,\n\tTetrad,\n\tTriad,\n} from './types';\nimport { extractAlphaColorValues, extractSolidColorValues } from './utils';\n\nconst hsl = generateRandomHSLColor();\nconst { hex, rgb } = convertColorCode(hsl);\n\n/**\n * * Class representing a color and its conversions among `Hex`, `Hex8` `RGB`, `RGBA`, `HSL` and `HSLA` formats.\n * * It has 13 instance methods to manipulate and play with the color values.\n * * It has 7 static methods that can be used to check if a color is in `Hex`, `Hex8` `RGB`, `RGBA`, `HSL` or `HSLA` format.\n *\n * @property hex - The color in `Hex` format.\n * @property hex8 - The color in `Hex8` format.\n * @property rgb - The color in `RGB` format.\n * @property rgba - The color in `RGBA` format.\n * @property hsl - The color in `HSL` format.\n * @property hsla - The color in `HSLA` format.\n */\nexport class Color {\n\tpublic hex: Hex6;\n\tpublic hex8: Hex8;\n\tpublic rgb: RGB;\n\tpublic rgba: RGBA;\n\tpublic hsl: HSL;\n\tpublic hsla: HSLA;\n\n\t/**\n\t * * Creates a new `Color` instance with a random color and automatically converts the generated color to all other supported formats: `Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, and `HSLA`.\n\t *\n\t * @description\n\t * The `Color` class generates a random color in six common color representations:\n\t * - `Hex` (e.g., `#ff5733`)\n\t * - `Hex8` (Hex with opacity, e.g., `#ff573380`)\n\t * - `RGB` (e.g., `rgb(255, 87, 51)`)\n\t * - `RGBA` (e.g., `rgba(255, 87, 51, 1)`)\n\t * - `HSL` (e.g., `hsl(14, 100%, 60%)`)\n\t * - `HSLA` (e.g., `hsla(14, 100%, 60%, 1)`)\n\t *\n\t * Additionally:\n\t * - It has 13 instance methods to manipulate and play with the color values.\n\t * - Use static methods like `Color.isHex6(color)` to validate color strings.\n\t *\n\t * @example\n\t * // Generate a random color\n\t * const randomColor = new Color();\n\t * console.log(randomColor.hex, randomColor.rgb, randomColor.hsl);\n\t *\n\t * @returns Instance of `Color`.\n\t */\n\tconstructor();\n\n\t/**\n\t * * Creates a new `Color` instance with the input color and automatically converts it to all other supported formats: `Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, and `HSLA`.\n\t *\n\t * @description\n\t * The `Color` class allows seamless transformation between six common color representations:\n\t * - `Hex` (e.g., `#ff5733`)\n\t * - `Hex8` (Hex with opacity, e.g., `#ff573380`)\n\t * - `RGB` (e.g., `rgb(255, 87, 51)`)\n\t * - `RGBA` (e.g., `rgba(255, 87, 51, 1)`)\n\t * - `HSL` (e.g., `hsl(14, 100%, 60%)`)\n\t * - `HSLA` (e.g., `hsla(14, 100%, 60%, 1)`)\n\t *\n\t * You can create a color from any of these formats, and the class will populate the rest.\n\t *\n\t * Additionally:\n\t * - It has 13 instance methods to manipulate and play with the color values.\n\t * - Use available 7 static methods like `Color.isHex6(color)` to validate color strings.\n\t *\n\t * @param color - A color string in any supported format (`Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, or `HSLA`) to convert in all other formats (includes the current format).\n\t *\n\t * @example\n\t * // Convert an existing Hex color to all other formats\n\t * const color = new Color(\"#ff5733\");\n\t * console.log(color.rgb); // 'rgb(255, 87, 51)'\n\t * console.log(color.hsl); // 'hsl(14, 100%, 60%)'\n\t * console.log(color.rgba); // 'rgba(255, 87, 51, 1)'\n\t * console.log(color.hsla); // 'hsla(14, 100%, 60%, 1)'\n\t * console.log(color.hex8); // '#FF5733FF'\n\t *\n\t * @example\n\t * // Handle a color with alpha\n\t * const alphaColor = new Color(\"rgba(255, 0, 0, 0.5)\");\n\t * console.log(alphaColor.hex8); // '#FF000080'\n\t * console.log(alphaColor.hsla); // 'hsla(0, 100%, 50%, 0.5)'\n\t *\n\t * @returns Instance of `Color`.\n\t */\n\tconstructor(color: ColorType);\n\n\t/**\n\t * * Creates a new `Color` instance using a standard (CSS) named color and automatically converts it to all other supported formats: `Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, and `HSLA`.\n\t *\n\t * @description\n\t * This allows you to use any valid named color from standard `150+ `CSS color names (e.g., `\"red\"`, `\"blue\"`, `\"rebeccapurple\"`)\n\t *\n\t * @param color - A named color string from standard `150+ `CSS color names.\n\t *\n\t * @example\n\t * // Using a CSS named color\n\t * const sky = new Color(\"skyblue\");\n\t * console.log(sky.hex); // '#87CEEB'\n\t * console.log(sky.rgba); // 'rgba(135, 206, 235, 1)'\n\t *\n\t * @returns Instance of `Color`.\n\t */\n\tconstructor(color: CSSColor);\n\n\t/**\n\t * * Creates a new `Color` instance and automatically converts the input color to all other supported formats: `Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, and `HSLA`.\n\t *\n\t * @description\n\t * The `Color` class allows seamless transformation between six common color representations:\n\t * - `Hex` (e.g., `#ff5733`)\n\t * - `Hex8` (Hex with opacity, e.g., `#ff573380`)\n\t * - `RGB` (e.g., `rgb(255, 87, 51)`)\n\t * - `RGBA` (e.g., `rgba(255, 87, 51, 1)`)\n\t * - `HSL` (e.g., `hsl(14, 100%, 60%)`)\n\t * - `HSLA` (e.g., `hsla(14, 100%, 60%, 1)`)\n\t *\n\t * You can create a color from any of these formats, and the class will populate the rest.\n\t * If no color is passed, a random color will be generated.\n\t *\n\t * Additionally:\n\t * - It has 13 instance methods to manipulate and play with the color values.\n\t * - Use static methods like `Color.isHex6(color)` to validate color strings.\n\t *\n\t * @param color - An optional input color string in any supported format (`Hex`, `Hex8`, `RGB`, `RGBA`, `HSL`, or `HSLA`) to convert in all other (includes the current format) formats.\n\t *\n\t * @example\n\t * // Convert an existing Hex color to all other formats\n\t * const color = new Color(\"#ff5733\");\n\t * console.log(color.rgb); // 'rgb(255, 87, 51)'\n\t * console.log(color.hsl); // 'hsl(14, 100%, 60%)'\n\t * console.log(color.rgba); // 'rgba(255, 87, 51, 1)'\n\t * console.log(color.hsla); // 'hsla(14, 100%, 60%, 1)'\n\t * console.log(color.hex8); // '#FF5733FF'\n\t *\n\t * @example\n\t * // Handle a color with alpha\n\t * const alphaColor = new Color(\"rgba(255, 0, 0, 0.5)\");\n\t * console.log(alphaColor.hex8); // '#FF000080'\n\t * console.log(alphaColor.hsla); // 'hsla(0, 100%, 50%, 0.5)'\n\t *\n\t * @example\n\t * // Generate a random color\n\t * const randomColor = new Color();\n\t * console.log(randomColor.hex, randomColor.rgb, randomColor.hsl);\n\t *\n\t * @returns Instance of `Color`.\n\t */\n\tconstructor(color?: ColorType | CSSColor) {\n\t\tif (color) {\n\t\t\tif (Color.isCSSColor(color)) {\n\t\t\t\tconst newColor = new Color(CSS_COLORS[color]);\n\n\t\t\t\tthis.hex = newColor.hex;\n\t\t\t\tthis.hex8 = newColor.hex8;\n\t\t\t\tthis.rgb = newColor.rgb;\n\t\t\t\tthis.rgba = newColor.rgba;\n\t\t\t\tthis.hsl = newColor.hsl;\n\t\t\t\tthis.hsla = newColor.hsla;\n\t\t\t} else {\n\t\t\t\tconst colors = this.#convertColorToOthers(color);\n\n\t\t\t\tif ('hex8' in colors) {\n\t\t\t\t\t// Extract alpha color values (Hex8, RGBA, HSLA)\n\t\t\t\t\tconst rgbaValues = extractAlphaColorValues(colors.rgba);\n\t\t\t\t\tconst hslaValues = extractAlphaColorValues(colors.hsla);\n\n\t\t\t\t\tthis.hex = colors.hex8.toUpperCase().slice(0, 7) as Hex6;\n\t\t\t\t\tthis.hex8 = colors.hex8.toUpperCase() as Hex8;\n\t\t\t\t\tthis.rgb = `rgb(${rgbaValues[0]}, ${rgbaValues[1]}, ${rgbaValues[2]})`;\n\t\t\t\t\tthis.rgba = colors.rgba;\n\t\t\t\t\tthis.hsl = `hsl(${hslaValues[0]}, ${hslaValues[1]}%, ${hslaValues[2]}%)`;\n\t\t\t\t\tthis.hsla = colors.hsla;\n\t\t\t\t} else {\n\t\t\t\t\t// Extract solid color values (Hex, RGB, HSL)\n\t\t\t\t\tconst rgbValues = extractSolidColorValues(colors.rgb);\n\t\t\t\t\tconst hslValues = extractSolidColorValues(colors.hsl);\n\n\t\t\t\t\tthis.hex = colors.hex.toUpperCase() as Hex6;\n\t\t\t\t\tthis.hex8 =\n\t\t\t\t\t\t`${colors.hex.toUpperCase()}${_convertOpacityToHex(100)}` as Hex8;\n\t\t\t\t\tthis.rgb = colors.rgb;\n\t\t\t\t\tthis.rgba = `rgba(${rgbValues[0]}, ${rgbValues[1]}, ${rgbValues[2]}, 1)`;\n\t\t\t\t\tthis.hsl = colors.hsl;\n\t\t\t\t\tthis.hsla = `hsla(${hslValues[0]}, ${hslValues[1]}%, ${hslValues[2]}%, 1)`;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst rgbValues = extractSolidColorValues(rgb);\n\t\t\tconst hslValues = extractSolidColorValues(hsl);\n\n\t\t\t// Generate random colors\n\t\t\tthis.hex = hex.toUpperCase() as Hex6;\n\t\t\tthis.hex8 =\n\t\t\t\t`${hex.toUpperCase()}${_convertOpacityToHex(100)}` as Hex8;\n\t\t\tthis.rgb = rgb;\n\t\t\tthis.rgba = `rgba(${rgbValues[0]}, ${rgbValues[1]}, ${rgbValues[2]}, 1)`;\n\t\t\tthis.hsl = hsl;\n\t\t\tthis.hsla = `hsla(${hslValues[0]}, ${hslValues[1]}%, ${hslValues[2]}%, 1)`;\n\t\t}\n\t}\n\n\t/** - Iterates over the color representations (Hex, RGB, HSL). */\n\t*[Symbol.iterator]() {\n\t\tyield this.hex;\n\t\tyield this.hex8;\n\t\tyield this.rgb;\n\t\tyield this.rgba;\n\t\tyield this.hsl;\n\t\tyield this.hsla;\n\t}\n\n\t/**\n\t * @instance Applies or modifies the opacity of a color. Mutate the original instance.\n\t * - For solid colors (Hex6/RGB/HSL): Adds an alpha channel with the specified opacity.\n\t * - For alpha colors (Hex8/RGBA/HSLA): Updates the existing alpha channel.\n\t *\n\t * @param opacity - A number between 0-100 representing the opacity percentage.\n\t * @returns A new instance of `Color` containing all color formats with the applied opacity.\n\t *\n\t * @example\n\t * const color = new Color(\"#ff0000\");\n\t * const alpha50 = color.applyOpacity(50); // 50% opacity\n\t * console.log(alpha50.rgba); // rgba(255, 0, 0, 0.5)\n\t *\n\t * @example\n\t * const alphaColor = new Color(\"#ff000080\"); // Color with 50% opacity\n\t * const alpha75 = alphaColor.applyOpacity(75); // Change to 75% opacity\n\t * console.log(alpha75.hex8); // #FF0000BF\n\t */\n\tapplyOpacity(opacity: Percent): Color {\n\t\tconst validOpacity = Math.min(100, Math.max(0, opacity));\n\t\tconst alphaHex = _convertOpacityToHex(opacity);\n\t\tconst alphaDecimal = validOpacity / 100;\n\n\t\tconst rgbValues = extractSolidColorValues(this.rgb);\n\t\tconst hslValues = extractSolidColorValues(this.hsl);\n\n\t\treturn Color.#fromParts({\n\t\t\thex: this.hex.slice(0, 7).toUpperCase() as Hex6,\n\t\t\thex8: `${this.hex.slice(0, 7)}${alphaHex}`.toUpperCase() as Hex8,\n\t\t\trgb: `rgb(${rgbValues[0]}, ${rgbValues[1]}, ${rgbValues[2]})`,\n\t\t\trgba: `rgba(${rgbValues[0]}, ${rgbValues[1]}, ${rgbValues[2]}, ${alphaDecimal})`,\n\t\t\thsl: `hsl(${hslValues[0]}, ${hslValues[1]}%, ${hslValues[2]}%)`,\n\t\t\thsla: `hsla(${hslValues[0]}, ${hslValues[1]}%, ${hslValues[2]}%, ${alphaDecimal})`,\n\t\t});\n\t}\n\n\t/**\n\t * @instance Darkens the color by reducing the lightness by the given percentage.\n\t * @param percent - The percentage to darken (0–100).\n\t * @returns A new `Color` instance with the modified darkness.\n\t */\n\tapplyDarkness(percent: Percent): Color {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst newL = Math.max(0, l - percent);\n\n\t\tconst newHSL = `hsl(${h}, ${s}%, ${newL}%)` as HSL;\n\n\t\treturn new Color(newHSL).applyOpacity((a * 100) as Percent);\n\t}\n\n\t/**\n\t * @instance Lightens the color by increasing the lightness by the given percentage.\n\t * @param percent - The percentage to brighten (0–100).\n\t * @returns A new `Color` instance with the modified lightness.\n\t */\n\tapplyBrightness(percent: Percent): Color {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst newL = Math.min(100, l + percent);\n\n\t\tconst newHSL = `hsl(${h}, ${s}%, ${newL}%)` as HSL;\n\n\t\treturn new Color(newHSL).applyOpacity((a * 100) as Percent);\n\t}\n\n\t/**\n\t * @instance Reduces the saturation of the color to make it appear duller.\n\t * @param percent - The percentage to reduce saturation (0–100).\n\t * @returns A new `Color` instance with the modified saturation.\n\t */\n\tapplyDullness(percent: Percent): Color {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst newS = Math.max(0, s - percent);\n\n\t\tconst newHSL = `hsl(${h}, ${newS}%, ${l}%)` as HSL;\n\n\t\treturn new Color(newHSL).applyOpacity((a * 100) as Percent);\n\t}\n\n\t/**\n\t * @instance Softens the color toward white by reducing saturation and increasing lightness based on a percentage.\n\t * - *This creates a soft UI-like white shade effect (similar to some UI libraries' light color scale).*\n\t * @param percent - Value from 0 to 100 representing how far to push the color toward white.\n\t * @returns A new `Color` instance shifted toward white.\n\t */\n\tapplyWhiteShade(percent: Percent): Color {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\t// Cap values to avoid overshooting\n\t\tconst newS = Math.max(0, s - (s * percent) / 100);\n\t\tconst newL = Math.min(100, l + ((100 - l) * percent) / 100);\n\n\t\tconst newHSL = `hsl(${h}, ${newS}%, ${newL}%)` as HSL;\n\n\t\treturn new Color(newHSL).applyOpacity((a * 100) as Percent);\n\t}\n\n\t/**\n\t * @instance Blends the current color with another color based on the given weight.\n\t *\n\t * - **NOTE:** *If any of the input colors has opacity (alpha channel), it might be lost or distorted from the generated alpha variants of the respective color formats.*\n\t *\n\t * @param other - The color in any 6 `(Hex, Hex8 RGB, RGBA, HSL or HSLA)` format to blend with.\n\t * @param weight - A number from 0 to 1 indicating the weight of the other color. Defaults to `0.5`.\n\t * - `weight = 0` → only the original color.\n\t * - `weight = 1` → only the other color.\n\t * - `weight = 0.5` → equal blend between the two.\n\t * @returns A new `Color` instance representing the blended result, with proper alpha blending.\n\t */\n\tblendWith(other: ColorType | CSSColor, weight = 0.5): Color {\n\t\tconst w = Math.max(0, Math.min(1, weight));\n\n\t\tconst converted =\n\t\t\tColor.isCSSColor(other) ? new Color(other) : new Color(other);\n\n\t\tconst [r1, b1, g1, a1] = extractAlphaColorValues(this.rgba);\n\t\tconst [r2, b2, g2, a2] = extractAlphaColorValues(converted.rgba);\n\n\t\tconst alpha = Math.round((a1 * (1 - w) + a2 * w) * 100) / 100;\n\n\t\tconst blendChannel = (c1: number, c2: number): number => {\n\t\t\treturn Math.round((c1 * a1 * (1 - w) + c2 * a2 * w) / alpha);\n\t\t};\n\n\t\tconst r = blendChannel(r1, r2);\n\t\tconst g = blendChannel(g1, g2);\n\t\tconst b = blendChannel(b1, b2);\n\n\t\tconst blended = `rgba(${r}, ${g}, ${b}, ${alpha})`;\n\n\t\treturn new Color(blended as RGBA);\n\t}\n\n\t/**\n\t * @instance Calculates the contrast ratio between this color and another color (WCAG).\n\t * @param other - The other color to compare against.\n\t * @returns A number representing the contrast ratio (rounded to 2 decimal places).\n\t */\n\tcontrastRatio(other: ColorType | CSSColor): number {\n\t\tconst newColor =\n\t\t\tColor.isCSSColor(other) ? new Color(other) : new Color(other);\n\n\t\tconst luminance = (rgb: RGB): number => {\n\t\t\tconst [r, g, b] = extractSolidColorValues(rgb).map((v) => {\n\t\t\t\tconst c = v / 255;\n\t\t\t\treturn c <= 0.03928 ?\n\t\t\t\t\t\tc / 12.92\n\t\t\t\t\t:\tMath.pow((c + 0.055) / 1.055, 2.4);\n\t\t\t});\n\n\t\t\treturn 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\t\t};\n\n\t\tconst lum1 = luminance(this.rgb);\n\t\tconst lum2 = luminance(newColor.rgb);\n\n\t\tconst brighter = Math.max(lum1, lum2);\n\t\tconst darker = Math.min(lum1, lum2);\n\n\t\tconst ratio = (brighter + 0.05) / (darker + 0.05);\n\n\t\treturn Math.round(ratio * 100) / 100;\n\t}\n\n\t/**\n\t * @instance Returns the complementary color by rotating the hue 180 degrees.\n\t * @returns A new Color that is the complement of the current color.\n\t */\n\tgetComplementaryColor(): Color {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst newHue = (h + 180) % 360;\n\n\t\tconst newHSL = `hsl(${newHue}, ${s}%, ${l}%)` as HSL;\n\n\t\treturn new Color(newHSL).applyOpacity((a * 100) as Percent);\n\t}\n\n\t/**\n\t * @instance Generates a color scheme of analogous colors, including the base color.\n\t * Analogous colors are next to each other on the color wheel (±30°).\n\t * @returns An array of three Color instances: [base, left, right].\n\t */\n\tgetAnalogousColors(): Analogous {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst left = `hsl(${(h + 330) % 360}, ${s}%, ${l}%)` as HSL;\n\t\tconst right = `hsl(${(h + 30) % 360}, ${s}%, ${l}%)` as HSL;\n\n\t\tconst analogous = [this, new Color(left), new Color(right)];\n\n\t\treturn analogous.map((c) =>\n\t\t\tc.applyOpacity((a * 100) as Percent),\n\t\t) as Analogous;\n\t}\n\n\t/**\n\t * @instance Generates a color triad scheme including the base color.\n\t * Triadic colors are evenly spaced (120° apart) on the color wheel.\n\t * @returns An array of three Color instances: [base, triad1, triad2].\n\t */\n\tgetTriadColors(): Triad {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst c1 = `hsl(${(h + 120) % 360}, ${s}%, ${l}%)` as HSL;\n\t\tconst c2 = `hsl(${(h + 240) % 360}, ${s}%, ${l}%)` as HSL;\n\n\t\tconst triad = [this, new Color(c1), new Color(c2)];\n\n\t\treturn triad.map((c) => c.applyOpacity((a * 100) as Percent)) as Triad;\n\t}\n\n\t/**\n\t * @instance Generates a tetradic color scheme including the base color.\n\t * Tetradic colors form a rectangle on the color wheel (90° apart).\n\t * @returns An array of four Color instances: [base, tetrad1, tetrad2, tetrad3].\n\t */\n\tgetTetradColors(): Tetrad {\n\t\tconst [h, s, l, a] = extractAlphaColorValues(this.hsla);\n\n\t\tconst c1 = `hsl(${(h + 90) % 360}, ${s}%, ${l}%)` as HSL;\n\t\tconst c2 = `hsl(${(h + 180) % 360}, ${s}%, ${l}%)` as HSL;\n\t\tconst c3 = `hsl(${(h + 270) % 360}, ${s}%, ${l}%)` as HSL;\n\n\t\tconst tetrad = [this, new Color(c1), new Color(c2), new Color(c3)];\n\n\t\treturn tetrad.map((c) =>\n\t\t\tc.applyOpacity((a * 100) as Percent),\n\t\t) as Tetrad;\n\t}\n\n\t/**\n\t * @instance Gets the `WCAG` accessibility rating between this and another color.\n\t * @param other - The other color to test contrast against.\n\t * @returns 'Fail', 'AA', or 'AAA' based on `WCAG 2.1` contrast standards.\n\t */\n\tgetWCAGRating(other: ColorType | CSSColor): 'Fail' | 'AA' | 'AAA' {\n\t\tconst ratio = this.contrastRatio(other);\n\n\t\tif (ratio >= 7) return 'AAA';\n\t\tif (ratio >= 4.5) return 'AA';\n\t\treturn 'Fail';\n\t}\n\n\t/**\n\t * @instance Determines if the color is light based on its perceived brightness.\n\t * @returns `true` if light, `false` if dark.\n\t */\n\tisLightColor(): boolean {\n\t\tconst [r, g, b] = extractSolidColorValues(this.rgb);\n\n\t\tconst brightness = (r * 299 + g * 587 + b * 114) / 1000;\n\n\t\treturn brightness > 127.5;\n\t}\n\n\t/**\n\t * @static Checks if a color is in `Hex6` format.\n\t *\n\t * @param color Color to check.\n\t * @returns Boolean: `true` if it's a `Hex6` color, `false` if not.\n\t */\n\tstatic isHex6(color: string): color is Hex6 {\n\t\treturn /^#[0-9A-Fa-f]{6}$/.test(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is in `Hex8` format.\n\t *\n\t * @param color Color to check.\n\t * @returns Boolean: `true` if it's a `Hex8` color, `false` if not.\n\t */\n\tstatic isHex8(color: string): color is Hex8 {\n\t\treturn /^#[0-9A-Fa-f]{8}$/.test(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is in `RGB` format and within valid ranges.\n\t *\n\t * @param color Color to check.\n\t * @returns `true` if it's a `RGB` color, `false` if not.\n\t */\n\tstatic isRGB(color: string): color is RGB {\n\t\treturn _isRGB(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is in `RGBA` format and within valid ranges.\n\t *\n\t * @param color Color to check.\n\t * @returns `true` if it's a `RGBA` color, `false` if not.\n\t */\n\tstatic isRGBA(color: string): color is RGBA {\n\t\treturn _isRGBA(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is in `HSL` format and within valid ranges.\n\t *\n\t * @param color Color to check.\n\t * @returns `true` if it's a `HSL` color, `false` if not.\n\t */\n\tstatic isHSL(color: string): color is HSL {\n\t\treturn _isHSL(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is in `HSLA` format and within valid ranges.\n\t *\n\t * @param color Color to check.\n\t * @returns `true` if it's a `HSLA` color, `false` if not.\n\t */\n\tstatic isHSLA(color: string): color is HSLA {\n\t\treturn _isHSLA(color);\n\t}\n\n\t/**\n\t * @static Checks if a color is a valid CSS color name.\n\t * - This method checks against a predefined list of CSS color names.\n\t * - It does not validate format types like Hex, RGB, or HSL or their alpha channels.\n\t *\n\t * @param color - The color to check.\n\t * @returns `true` if the color is a valid CSS color name, `false` otherwise.\n\t */\n\tstatic isCSSColor(color: string): color is CSSColor {\n\t\treturn (\n\t\t\t!Color.isHex6(color) &&\n\t\t\t!Color.isHex8(color) &&\n\t\t\t!_isRGB(color) &&\n\t\t\t!_isRGBA(color) &&\n\t\t\t!_isHSL(color) &&\n\t\t\t!_isHSLA(color) &&\n\t\t\tcolor in CSS_COLORS\n\t\t);\n\t}\n\n\t/**\n\t * @private Converts the given color to all other formats while preserving the original.\n\t *\n\t * @param color - The color to convert.\n\t * @returns An object containing Hex, RGB, and HSL representations.\n\t */\n\t#convertColorToOthers(color: ColorType): SolidColors | AlphaColors {\n\t\tif (Color.isHex6(color)) {\n\t\t\tconst { rgb, hsl } = convertColorCode(color);\n\t\t\treturn { hex: color, rgb, hsl };\n\t\t} else if (Color.isRGB(color)) {\n\t\t\tconst { hex, hsl } = convertColorCode(color);\n\t\t\treturn { hex, rgb: color, hsl };\n\t\t} else if (Color.isHSL(color)) {\n\t\t\tconst { hex, rgb } = convertColorCode(color);\n\t\t\treturn { hex, rgb, hsl: color };\n\t\t} else if (Color.isHex8(color)) {\n\t\t\tconst { rgba, hsla } = convertColorCode(color);\n\t\t\treturn { hex8: color, rgba, hsla };\n\t\t} else if (Color.isRGBA(color)) {\n\t\t\tconst { hex8, hsla } = convertColorCode(color);\n\t\t\treturn { hex8, rgba: color, hsla };\n\t\t} else if (Color.isHSLA(color)) {\n\t\t\tconst { hex8, rgba } = convertColorCode(color);\n\t\t\treturn { hex8, rgba, hsla: color };\n\t\t}\n\n\t\tthrow new Error(`Unrecognized color format: ${color}`);\n\t}\n\n\t/**\n\t * @private @static Internal factory to create a Color instance from parsed parts.\n\t * @param parts All the color parts as object.\n\t * @returns An instance of `Color`.\n\t */\n\tstatic #fromParts(parts: Colors): Color {\n\t\tconst color = Object.create(Color.prototype) as Color;\n\t\tcolor.hex = parts.hex;\n\t\tcolor.hex8 = parts.hex8;\n\t\tcolor.rgb = parts.rgb;\n\t\tcolor.rgba = parts.rgba;\n\t\tcolor.hsl = parts.hsl;\n\t\tcolor.hsla = parts.hsla;\n\n\t\treturn color;\n\t}\n}\n","import { isString } from '../guards/primitives';\nimport { isNumericString } from '../guards/specials';\nimport type { Numeric } from '../types';\nimport type { Time, UTCOffSet } from './types';\n\n/**\n * * Checks if the provided value is a valid time string in \"HH:MM\" format.\n *\n * @param value - The value to check.\n * @returns `true` if the value is a valid time string, `false` otherwise.\n */\nexport function isValidTime(value: unknown): value is Time {\n\tif (!isString(value)) return false;\n\n\tconst [hourStr, minuteStr] = value.split(':');\n\n\tif (!isNumericString(hourStr) || !isNumericString(minuteStr)) return false;\n\n\tconst hour = Number(hourStr);\n\tconst minute = Number(minuteStr);\n\n\treturn hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59;\n}\n\n/**\n * * Checks if the provided value is a valid UTCOffSet (e.g. `UTC-01:30`).\n *\n * @param value - The value to check.\n * @returns `true` if the value is a valid utc offset, `false` otherwise.\n */\nexport function isValidUTCOffSet(value: unknown): value is UTCOffSet {\n\tif (!isString(value)) return false;\n\n\treturn /^UTC[+-]?\\d{1,2}:\\d{2}$/.test(value);\n}\n\n/**\n * * Checks if the year is a leap year.\n *\n * - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.\n * - For example, 2000 and 2400 are leap years, but 1900 and 2100 are not.\n * @param year The year to check.\n * @returns `true` if the year is a leap year, `false` otherwise.\n */\nexport function isLeapYear(year: Numeric): boolean {\n\treturn (\n\t\t(Number(year) % 4 === 0 && Number(year) % 100 !== 0) ||\n\t\tNumber(year) % 400 === 0\n\t);\n}\n\n/**\n * * Checks if a value is a date-like object from `Date`, `Chronos`, `Moment.js`, `Day.js`, `Luxon`, `JS-Joda`, or `Temporal`\n * @param value Value to check if it is date-like object.\n * @returns `true` if the value is date-like object, otherwise `false`.\n */\nexport function isDateLike(value: unknown): boolean {\n\tif (value instanceof Date) return true;\n\n\tif (value && typeof value === 'object') {\n\t\tconst v = value as Record<string, unknown>;\n\n\t\t// Chronos, Moment or Day.js\n\t\tif (\n\t\t\ttypeof v.format === 'function' &&\n\t\t\ttypeof v.toJSON === 'function' &&\n\t\t\ttypeof v.toISOString === 'function'\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Luxon\n\t\tif (\n\t\t\ttypeof v.toISO === 'function' &&\n\t\t\ttypeof v.toFormat === 'function' &&\n\t\t\ttypeof v.isValid === 'boolean'\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// JS-Joda\n\t\tif (\n\t\t\ttypeof v.plus === 'function' &&\n\t\t\ttypeof v.minus === 'function' &&\n\t\t\ttypeof v.equals === 'function' &&\n\t\t\ttypeof v.getClass === 'function'\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Temporal\n\t\tif (\n\t\t\ttypeof v.toJSON === 'function' &&\n\t\t\ttypeof v.toString === 'function' &&\n\t\t\t['PlainDate', 'ZonedDateTime', 'Instant'].includes(\n\t\t\t\tv.constructor?.name ?? '',\n\t\t\t)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","import type { Numeric } from '../types';\nimport type { Time, UTCOffSet } from './types';\n\n/**\n * * Extracts the hour and minute from a time string in `HH:MM` or `-HH:MM` format.\n *\n * @param time - The time string to extract from.\n * @return The extracted hour and minute as number tuple.\n */\nexport function extractHourMinute(time: `-${Time}` | Time): [number, number] {\n\tconst [hour, minute] = time.split(':').map(Number);\n\n\treturn [hour, minute];\n}\n\n/**\n * * Converts a time string `HH:MM` or `-HH:MM` into total minutes from `00:00`.\n *\n * @param time - The time in `HH:MM` or `-HH:MM` format.\n * @returns The total minutes elapsed since `00:00`.\n */\nexport function getTotalMinutes(time: `-${Time}` | Time): number {\n\tconst isNegative = time.startsWith('-');\n\n\tconst [h, m] = extractHourMinute(\n\t\tisNegative ? (time.slice(1) as Time) : time,\n\t);\n\n\tconst total = h * 60 + m;\n\n\treturn isNegative ? -total : total;\n}\n\n/**\n * * Returns the current date and time as `Date` object.\n * - All the methods and properties of `new Date()` are accessible.\n *\n * @returns The current date and time as a `Date` object.\n */\nexport function getCurrentDateTime(): Date {\n\treturn new Date();\n}\n\n/**\n * * Extract Time in `HH:MM` format from given UTC value.\n *\n * @param utc UTC value in `UTC-01:30` or `UTC+01:30` format.\n * @returns The UTC value in `HH:MM` format.\n */\nexport function extractTimeFromUTC(utc: UTCOffSet): `-${Time}` | Time {\n\treturn utc.replace(/^UTC[+]?/g, '') as `-${Time}` | Time;\n}\n\n/**\n * * Converts a UTC value in `UTC-01:30` or `UTC+01:30` format into total minutes in number.\n *\n * @param time - UTC value in `UTC-01:30` or `UTC+01:30` format.\n * @returns The total minutes elapsed since `00:00`.\n */\nexport function extractMinutesFromUTC(utc: UTCOffSet): number {\n\treturn getTotalMinutes(extractTimeFromUTC(utc));\n}\n\n/**\n * * Converts a minute-based offset to a UTC offset string in the format `UTC±HH:MM`.\n *\n * @param minutes - The offset in minutes (positive or negative).\n * @returns A formatted UTC offset string like `UTC+05:30` or `UTC-04:00`.\n */\nexport function formatUTCOffset(minutes: Numeric): UTCOffSet {\n\tconst numMIn = typeof minutes === 'number' ? minutes : Number(minutes);\n\n\tconst sign = numMIn < 0 ? '-' : '+';\n\tconst abs = Math.abs(numMIn);\n\tconst hours = String(Math.floor(abs / 60)).padStart(2, '0');\n\tconst mins = String(abs % 60).padStart(2, '0');\n\n\treturn `UTC${sign}${hours}:${mins}` as UTCOffSet;\n}\n","import { isValidTime } from './guards';\nimport type { GreetingConfigs } from './types';\nimport {\n\textractHourMinute,\n\tgetCurrentDateTime,\n\tgetTotalMinutes,\n} from './utils';\n\n/**\n * * Returns a greeting message based on the provided time or current time.\n *\n * @param configs - Configuration options for greeting times and messages.\n * @returns The appropriate greeting message.\n */\nexport function getGreeting(configs?: GreetingConfigs): string {\n\tconst {\n\t\tmorningEnds = '11:59',\n\t\tnoonEnds = '12:59',\n\t\tafternoonEnds = '17:59',\n\t\teveningEnds = '23:59',\n\t\tmidnightEnds = '02:59',\n\t\tcurrentTime,\n\t\tappendToMsg = '',\n\t\tprependToMsg = '',\n\t\tmorningMessage = 'Good Morning!',\n\t\tnoonMessage = 'Good Noon!',\n\t\tafternoonMessage = 'Good Afternoon!',\n\t\teveningMessage = 'Good Evening!',\n\t\tmidnightMessage = 'Hello, Night Owl!',\n\t\tdefaultMessage = 'Greetings!',\n\t} = configs || {};\n\n\tlet hour: number;\n\tlet minute: number;\n\n\tif (currentTime && isValidTime(currentTime)) {\n\t\t[hour, minute] = extractHourMinute(currentTime);\n\t} else {\n\t\thour = getCurrentDateTime().getHours();\n\t\tminute = getCurrentDateTime().getMinutes();\n\t}\n\n\tconst currentTotalMinutes = hour * 60 + minute;\n\n\tconst morningEndMinutes = getTotalMinutes(morningEnds);\n\tconst noonEndMinutes = getTotalMinutes(noonEnds);\n\tconst afternoonEndMinutes = getTotalMinutes(afternoonEnds);\n\tconst eveningEndMinutes = getTotalMinutes(eveningEnds);\n\tconst midnightEndMinutes = getTotalMinutes(midnightEnds);\n\n\tif (currentTotalMinutes <= midnightEndMinutes) {\n\t\treturn prependToMsg.concat(midnightMessage.concat(appendToMsg));\n\t} else if (currentTotalMinutes <= morningEndMinutes) {\n\t\treturn prependToMsg.concat(morningMessage.concat(appendToMsg));\n\t} else if (currentTotalMinutes <= noonEndMinutes) {\n\t\treturn prependToMsg.concat(noonMessage.concat(appendToMsg));\n\t} else if (currentTotalMinutes <= afternoonEndMinutes) {\n\t\treturn prependToMsg.concat(afternoonMessage.concat(appendToMsg));\n\t} else if (currentTotalMinutes <= eveningEndMinutes) {\n\t\treturn prependToMsg.concat(eveningMessage.concat(appendToMsg));\n\t} else {\n\t\treturn prependToMsg.concat(defaultMessage.concat(appendToMsg));\n\t}\n}\n","import type { DayPart, Hours, UTCOffSet } from './types';\n\nexport const ORIGIN = Symbol('origin');\n\nexport const DAYS = [\n\t'Sunday',\n\t'Monday',\n\t'Tuesday',\n\t'Wednesday',\n\t'Thursday',\n\t'Friday',\n\t'Saturday',\n] as const;\n\nexport const MONTHS = [\n\t'January',\n\t'February',\n\t'March',\n\t'April',\n\t'May',\n\t'June',\n\t'July',\n\t'August',\n\t'September',\n\t'October',\n\t'November',\n\t'December',\n] as const;\n\nexport const YEAR_FORMATS = ['YYYY', 'YY', 'yyyy', 'yy'] as const;\nexport const MONTH_FORMATS = ['M', 'MM', 'mmm', 'mmmm'] as const;\nexport const DATE_FORMATS = ['DD', 'D', 'Do'] as const;\nexport const DAY_FORMATS = ['d', 'dd', 'ddd'] as const;\nexport const HOUR_FORMATS = ['H', 'HH', 'hh', 'h'] as const;\nexport const MINUTE_FORMATS = ['mm', 'm'] as const;\nexport const SECOND_FORMATS = ['ss', 's'] as const;\nexport const MILLISECOND_FORMATS = ['ms', 'mss'] as const;\nexport const TIME_FORMATS = ['a', 'A'] as const;\n\nexport const sortedFormats = [\n\t...YEAR_FORMATS,\n\t...MONTH_FORMATS,\n\t...DAY_FORMATS,\n\t...DATE_FORMATS,\n\t...HOUR_FORMATS,\n\t...MINUTE_FORMATS,\n\t...SECOND_FORMATS,\n\t...MILLISECOND_FORMATS,\n\t...TIME_FORMATS,\n].sort((a, b) => b.length - a.length);\n\nexport const TIME_ZONES = {\n\t// UTC -12:00 to -01:00 (Mostly Pacific Islands, Americas)\n\t/** International Date Line West (Baker Island, Howland Island) */\n\tIDLW: -12 * 60,\n\t/** Baker Island Time (Uninhabited) */\n\tBIT: -12 * 60,\n\t/** Samoa Standard Time (American Samoa, Midway) */\n\tSST: -11 * 60,\n\t/** Niue Time */\n\tNUT: -11 * 60,\n\t/** Hawaii-Aleutian Standard Time (USA-Hawaii) */\n\tHST: -10 * 60,\n\t/** Cook Island Time */\n\tCKT: -10 * 60,\n\t/** Tahiti Time (French Polynesia) */\n\tTAHT: -10 * 60,\n\t/** Alaska Standard Time (USA-Alaska) */\n\tAKST: -9 * 60,\n\t/** Gambier Time (French Polynesia) */\n\tGAMT: -9 * 60,\n\t/** Paraguay Time (Summer UTC-3) */\n\tPYT: -9 * 60,\n\t/** Marquesas Islands Time (UTC−09:30) */\n\tMART: -9.5 * 60,\n\t/** Hawaii-Aleutian Daylight Time (USA-Hawaii, DST) */\n\tHDT: -9 * 60,\n\t/** Pacific Standard Time (USA-West Coast, Canada) */\n\tPST: -8 * 60,\n\t/** Alaska Daylight Time (USA-Alaska, DST) */\n\tAKDT: -8 * 60,\n\t/** Mountain Standard Time (USA/Canada Rockies) */\n\tMST: -7 * 60,\n\t/** Mountain Daylight Time (USA/Canada Rockies, DST) */\n\tMDT: -6 * 60,\n\t/** Pacific Daylight Time (USA-West Coast, Canada, DST) */\n\tPDT: -7 * 60,\n\t/** Central Standard Time (USA/Canada Central) */\n\tCST: -6 * 60,\n\t/** Central Daylight Time (USA/Canada Central, DST) */\n\tCDT: -5 * 60,\n\t/** Easter Island Time (Chile) */\n\tEAST: -6 * 60,\n\t/** Eastern Standard Time (USA/Canada East Coast) */\n\tEST: -5 * 60,\n\t/** Eastern Daylight Time (USA/Canada East Coast, DST) */\n\tEDT: -4 * 60,\n\t/** Peru Time */\n\tPET: -5 * 60,\n\t/** Colombia Time */\n\tCOT: -5 * 60,\n\t/** Acre Time (Brazil-West) */\n\tACT: -5 * 60,\n\t/** Atlantic Standard Time (Canada-Maritime, Caribbean) */\n\tAST: -4 * 60,\n\t/** Bolivia Time */\n\tBOT: -4 * 60,\n\t/** Venezuelan Standard Time */\n\tVET: -4 * 60,\n\t/** Guyana Time */\n\tGYT: -4 * 60,\n\t/** Chile Standard Time */\n\tCLT: -4 * 60,\n\t/** Atlantic Daylight Time (Canada-Maritime, DST) */\n\tADT: -3 * 60,\n\t/** Brasília Time (Brazil-East) */\n\tBRT: -3 * 60,\n\t/** Argentina Time */\n\tART: -3 * 60,\n\t/** Uruguay Time */\n\tUYT: -3 * 60,\n\t/** Falkland Islands Summer Time */\n\tFKST: -3 * 60,\n\t/** Saint Pierre and Miquelon Standard Time */\n\tPMST: -3 * 60,\n\t/** Chile Summer Time (DST) */\n\tCLST: -3 * 60,\n\t/** French Guiana Time */\n\tGFT: -3 * 60,\n\t/** Newfoundland Standard Time */\n\tNST: -3.5 * 60,\n\t/** Newfoundland Daylight Time (DST) */\n\tNDT: -2.5 * 60,\n\t/** Fernando de Noronha Time (Brazil) */\n\tFNT: -2 * 60,\n\t/** South Georgia Time */\n\t'GST-South Georgia': -2 * 60,\n\t/** Brazil Summer Time (DST) */\n\tBRST: -2 * 60,\n\t/** Azores Time (Portugal) */\n\tAZOT: -1 * 60,\n\t/** Cape Verde Time */\n\tCVT: -1 * 60,\n\n\t// UTC ±00:00 (Europe, Africa, Greenland)\n\t/** Greenwich Mean Time (UK, Iceland, West Africa) */\n\tGMT: 0,\n\t/** Coordinated Universal Time */\n\tUTC: 0,\n\t/** Western European Time (Portugal, Morocco) */\n\tWET: 0,\n\t/** Eastern Greenland Summer Time */\n\tEGST: 0,\n\t/** Central European Time (France, Germany, Italy) */\n\tCET: 1 * 60,\n\t/** West Africa Time (Nigeria, Algeria) */\n\tWAT: 1 * 60,\n\t/** Middle European Time (Historical) */\n\tMET: 1 * 60,\n\t/** Western European Summer Time (Summer UTC+1) */\n\tWEST: 1 * 60,\n\t/** British Summer Time (UK DST) */\n\t'BST-UK': 1 * 60,\n\t/** Central European Summer Time (DST) */\n\tCEST: 2 * 60,\n\t/** Middle European Summer Time (DST) */\n\tMEST: 2 * 60,\n\n\t// UTC +02:00 to +05:00 (Europe, Africa, Middle East, Russia)\n\t/** Eastern European Time (Greece, Finland, Egypt) */\n\tEET: 2 * 60,\n\t/** Central Africa Time (Sudan, South Africa) */\n\tCAT: 2 * 60,\n\t/** South Africa Standard Time */\n\tSAST: 2 * 60,\n\t/** Israel Standard Time */\n\t'IST-ISRAEL': 2 * 60,\n\t/** Israel Daylight Time (DST) */\n\t'IST-IL': 2 * 60,\n\t/** Eastern European Summer Time */\n\tEEST: 3 * 60,\n\t/** Moscow Time (Russia-West) */\n\tMSK: 3 * 60,\n\t/** Syowa Time (Antarctica) */\n\tSYOT: 3 * 60,\n\t/** Arabia Standard Time (Iraq, Saudi Arabia) */\n\t'AST-ARAB': 3 * 60,\n\t/** East Africa Time (Kenya, Ethiopia) */\n\tEAT: 3 * 60,\n\t/** Iran Standard Time */\n\tIRST: 3.5 * 60,\n\t/** Iran Daylight Time (DST) */\n\tIRDT: 4.5 * 60,\n\t/** Armenia Time */\n\tAMT: 4 * 60,\n\t/** Georgia Time */\n\tGET: 4 * 60,\n\t/** Azerbaijan Time */\n\tAZT: 4 * 60,\n\t/** Mauritius Time */\n\tMUT: 4 * 60,\n\t/** Seychelles Time */\n\tSCT: 4 * 60,\n\t/** Gulf Standard Time (UAE, Oman) */\n\t'GST-GULF': 4 * 60,\n\t/** Samara Time (Russia) */\n\tSAMT: 4 * 60,\n\t/** Pakistan Standard Time */\n\tPKT: 5 * 60,\n\t/** Tajikistan Time */\n\tTJT: 5 * 60,\n\t/** Turkmenistan Time */\n\tTMT: 5 * 60,\n\t/** Uzbekistan Time */\n\tUZT: 5 * 60,\n\t/** Aqtobe Time (Kazakhstan) */\n\tAQTT: 5 * 60,\n\t/** Yekaterinburg Time (Russia) */\n\tYEKT: 5 * 60,\n\t/** Yekaterinburg Summer Time (Russia, DST) */\n\tYEKST: 5 * 60,\n\t/** India Standard Time */\n\t'IST-IN': 5.5 * 60,\n\n\t// UTC +05:30 to +09:00 (South Asia, Russia, Southeast Asia)\n\t/** Nepal Time (UTC+05:45) */\n\tNPT: 5.75 * 60,\n\t/** Nepal Time (alternative) */\n\t'NPT-NEPAL': 5.75 * 60,\n\t/** Bangladesh Time */\n\tBDT: 6 * 60,\n\t/** Bangladesh Standard Time */\n\t'BST-BD': 6 * 60,\n\t/** Bhutan Time */\n\tBTT: 6 * 60,\n\t/** Almaty Time (Kazakhstan) */\n\tALMT: 6 * 60,\n\t/** Omsk Time (Russia) */\n\tOMST: 6 * 60,\n\t/** Myanmar Time */\n\tMMT: 6.5 * 60,\n\t/** Cocos Islands Time */\n\tCCT: 6.5 * 60,\n\t/** Indochina Time (Thailand, Vietnam) */\n\tICT: 7 * 60,\n\t/** Thailand Standard Time */\n\tTHA: 7 * 60,\n\t/** Krasnoyarsk Time (Russia) */\n\tKRAT: 7 * 60,\n\t/** Western Indonesia Time (Jakarta) */\n\tWIB: 7 * 60,\n\t/** Hong Kong Time */\n\tHKT: 8 * 60,\n\t/** China Standard Time */\n\t'CST-CHINA': 8 * 60,\n\t/** Singapore Time */\n\tSGT: 8 * 60,\n\t/** Malaysia Time */\n\tMYT: 8 * 60,\n\t/** Philippines Time */\n\tPHT: 8 * 60,\n\t/** Irkutsk Time (Russia) */\n\tIRKT: 8 * 60,\n\t/** Irkutsk Daylight Time (Russia, DST) */\n\t'IRKT-DST': 9 * 60,\n\t/** Irkutsk Time (Russia, alternative) */\n\t'IRKT-RU': 8 * 60,\n\t/** Australian Western Standard Time */\n\tAWST: 8 * 60,\n\t/** Australian Central Western Standard Time (Eucla, UTC+08:45) */\n\tACWST: 8.75 * 60,\n\t/** Western Indonesia Time (Bali) */\n\tWITA: 8 * 60,\n\t/** Japan Standard Time */\n\tJST: 9 * 60,\n\t/** Korea Standard Time */\n\tKST: 9 * 60,\n\t/** Palau Time */\n\tPWT: 9 * 60,\n\t/** Yakutsk Time (Russia) */\n\tYAKT: 9 * 60,\n\t/** Eastern Indonesia Time (Jayapura) */\n\tWIT: 9 * 60,\n\n\t// UTC +09:30 to +14:00 (Australia, Pacific Islands, Russia)\n\t/** Australian Central Standard Time */\n\tACST: 9.5 * 60,\n\t/** Australian Central Daylight Time (DST) */\n\tACDT: 10.5 * 60,\n\t/** Australian Eastern Standard Time */\n\tAEST: 10 * 60,\n\t/** Australian Eastern Daylight Time (DST) */\n\tAEDT: 11 * 60,\n\t/** Vladivostok Time (Russia) */\n\tVLAT: 10 * 60,\n\t/** Lord Howe Standard Time (UTC+10:30) */\n\tLHST: 10.5 * 60,\n\t/** Lord Howe Daylight Time (DST +30min) */\n\tLHDT: 11 * 60,\n\t/** Sakhalin Time (Russia) */\n\tSAKT: 11 * 60,\n\t/** Magadan Time (Russia) */\n\tMAGT: 11 * 60,\n\t/** Norfolk Time (Australia) */\n\tNFT: 11 * 60,\n\t/** Chamorro Standard Time (Guam, Northern Mariana Islands) */\n\tCHST: 10 * 60,\n\t/** New Zealand Standard Time */\n\tNZST: 12 * 60,\n\t/** New Zealand Daylight Time (DST) */\n\tNZDT: 13 * 60,\n\t/** Fiji Time */\n\tFJT: 12 * 60,\n\t/** Tuvalu Time */\n\tTVT: 12 * 60,\n\t/** Chatham Standard Time (New Zealand) */\n\tCHAST: 12.75 * 60,\n\t/** Chatham Daylight Time (New Zealand, DST) */\n\tCHADT: 13.75 * 60,\n\t/** Chatham Standard Time (alternative) */\n\t'CHAST-NZ': 12.75 * 60,\n\t/** Phoenix Island Time (Kiribati) */\n\tPHOT: 13 * 60,\n\t/** Tokelau Time */\n\tTKT: 13 * 60,\n\t/** Tonga Time */\n\tTOT: 13 * 60,\n\t/** New Zealand Antarctica Time */\n\tNZAT: 13 * 60,\n\t/** Line Islands Time (Kiribati) */\n\tLINT: 14 * 60,\n\n\t// Antarctica (used in research stations)\n\t/** Rothera Time (Antarctica) */\n\tROTT: -3 * 60,\n\t/** Mawson Time (Antarctica) */\n\tMAWT: 5 * 60,\n\t/** Petropavlovsk-Kamchatsky Time (Russia) */\n\tPETT: 12 * 60,\n} as const;\n\nexport const TIME_ZONE_LABELS: Record<UTCOffSet, string> = {\n\t'UTC-12:00': 'Baker Island Time', // and Howland Island\n\t// 'UTC-11:30': 'Niue Time',\n\t// 'UTC-11:00': 'Niue Time',\n\t'UTC-11:00': 'Samoa Standard Time',\n\t// 'UTC-10:30': 'Marquesas Time',\n\t'UTC-10:00': 'Hawaii-Aleutian Standard Time',\n\t'UTC-09:30': 'Marquesas Islands Time',\n\t'UTC-09:00': 'Alaskan Standard Time',\n\t// 'UTC-08:30': 'Pitcairn Standard Time',\n\t'UTC-08:00': 'Pacific Standard Time',\n\t'UTC-07:30': 'Mountain Standard Time (Unofficial)',\n\t'UTC-07:00': 'Mountain Standard Time',\n\t'UTC-06:30': 'Central America Time (Unofficial)',\n\t'UTC-06:00': 'Central Standard Time',\n\t// 'UTC-05:30': 'Venezuelan Standard Time (Historical)',\n\t'UTC-05:00': 'Eastern Standard Time',\n\t// 'UTC-04:30': 'Venezuelan Standard Time',\n\t'UTC-04:00': 'Atlantic Standard Time',\n\t'UTC-03:30': 'Newfoundland Standard Time',\n\t'UTC-03:00': 'SA Eastern Standard Time',\n\t'UTC-02:30': 'Mid-Atlantic Time (Unofficial)',\n\t'UTC-02:00': 'Mid-Atlantic Standard Time',\n\t'UTC-01:30': 'Azores Time (Unofficial)',\n\t'UTC-01:00': 'Cape Verde Time',\n\t'UTC+00:00': 'Greenwich Mean Time',\n\t'UTC+00:30': 'British Summer Time (Historical)',\n\t'UTC+01:00': 'Central European Standard Time',\n\t'UTC+01:30': 'Central Africa Time (Unofficial)',\n\t'UTC+02:00': 'Eastern European Standard Time',\n\t'UTC+02:30': 'Israel Standard Time (Historical)',\n\t'UTC+03:00': 'Arab Standard Time',\n\t'UTC+03:30': 'Iran Standard Time',\n\t'UTC+04:00': 'Gulf Standard Time',\n\t'UTC+04:30': 'Afghanistan Time',\n\t'UTC+05:00': 'Pakistan Standard Time',\n\t'UTC+05:30': 'India Standard Time',\n\t'UTC+05:45': 'Nepal Standard Time',\n\t'UTC+06:00': 'Bangladesh Standard Time',\n\t'UTC+06:30': 'Myanmar Standard Time',\n\t'UTC+07:00': 'Indochina Standard Time',\n\t'UTC+07:30': 'Western Indonesia Time (Unofficial)',\n\t'UTC+08:00': 'China Standard Time',\n\t'UTC+08:30': 'North Korea Standard Time',\n\t'UTC+08:45': 'South-Western Australia Standard Time',\n\t'UTC+09:00': 'Japan Standard Time',\n\t'UTC+09:30': 'Central Australia Standard Time',\n\t'UTC+10:00': 'Eastern Australia Standard Time',\n\t'UTC+10:30': 'Lord Howe Standard Time',\n\t'UTC+11:00': 'Central Pacific Standard Time',\n\t// 'UTC+11:30': 'Norfolk Island Time',\n\t'UTC+12:00': 'New Zealand Standard Time',\n\t'UTC+12:45': 'Chatham Islands Time',\n\t'UTC+13:00': 'Phoenix Island Time',\n\t'UTC+13:45': 'Tokelau Time (Unofficial)',\n\t'UTC+14:00': 'Line Islands Time',\n} as Record<UTCOffSet, string>;\n\n/** Ranges for day parts. */\nexport const DEFAULT_RANGES: Record<DayPart, [Hours, Hours]> = {\n\tnight: ['21', '23'],\n\tmidnight: ['00', '01'],\n\tlateNight: ['02', '04'],\n\tmorning: ['05', '11'],\n\tafternoon: ['12', '16'],\n\tevening: ['17', '20'],\n} as const;\n\nexport const ZODIAC_SIGNS = [\n\t['Capricorn', [1, 19]],\n\t['Aquarius', [2, 18]],\n\t['Pisces', [3, 20]],\n\t['Aries', [4, 19]],\n\t['Taurus', [5, 20]],\n\t['Gemini', [6, 20]],\n\t['Cancer', [7, 22]],\n\t['Leo', [8, 22]],\n\t['Virgo', [9, 22]],\n\t['Libra', [10, 22]],\n\t['Scorpio', [11, 21]],\n\t['Sagittarius', [12, 21]],\n\t['Capricorn', [12, 31]],\n] as const;\n","import { isString } from '../guards/primitives';\nimport type { LocaleCode } from '../number/types';\nimport { getOrdinal, roundToNearest } from '../number/utilities';\nimport { formatUnitWithPlural } from '../string/convert';\nimport { isPalindrome } from '../string/guards';\nimport {\n\tDAYS,\n\tDEFAULT_RANGES,\n\tMONTHS,\n\tORIGIN,\n\tsortedFormats,\n\tTIME_ZONE_LABELS,\n\tTIME_ZONES,\n\tZODIAC_SIGNS,\n} from './constants';\nimport { isLeapYear, isValidUTCOffSet } from './guards';\nimport type {\n\tChronosFormat,\n\tChronosInput,\n\tChronosMethods,\n\tChronosObject,\n\tDayPart,\n\tDayPartConfig,\n\tFormatOptions,\n\tQuarter,\n\tStrictFormat,\n\tTimeDuration,\n\tTimeParts,\n\tTimeUnit,\n\tTimeZone,\n\tUTCOffSet,\n\tZodiacSign,\n} from './types';\nimport { extractMinutesFromUTC, formatUTCOffset } from './utils';\n\n/**\n * * Creates a new immutable `Chronos` instance.\n *\n * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n *\n * @param value - A date value (`number`, `string`, `Date`, or `Chronos` object).\n * - If a string is provided, it should be in a format that can be parsed by the Date constructor.\n * - If a number is provided, it should be a timestamp (milliseconds since the Unix epoch).\n * - If a Date object is provided, it will be used as is.\n * - If a Chronos object is provided, it will be converted to a Date object.\n *\n * **It also accepts number values as following:**\n * - **`year, month, date, hours, minutes, seconds, milliseconds`**: Individual components of a date-time to construct a `Chronos` instance.\n * - **`year`**: A number representing the year. If the year is between 0 and 99, it will be assumed to be the year 1900 + the provided year.\n * - **`month`**: A number between 1 and 12 representing the month (1 for January, 12 for December). It is adjusted internally to a 0-based index (0 for January, 11 for December).\n * - **`date`**: A number between 1 and 31 representing the day of the month.\n * - **`hours`**: A number between 0 and 23 representing the hour of the day.\n * - **`minutes`**: A number between 0 and 59 representing the minutes past the hour.\n * - **`seconds`**: A number between 0 and 59 representing the seconds past the minute.\n * - **`milliseconds`**: A number between 0 and 999 representing the milliseconds past the second.\n *\n * @returns Instance of `Chronos` with all methods and properties.\n */\nexport class Chronos {\n\treadonly #date: Date;\n\t#offset: UTCOffSet;\n\t[ORIGIN]?: ChronosMethods | 'root';\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * Accepts no arguments (defaults to now).\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor();\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * @param value - A date value in `number`, it should be a timestamp (milliseconds since the Unix epoch).\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(value: number);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param value - A date value in `string`, it should be in a format that can be parsed by the `Date` constructor.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(value: string);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param value - A date value as `Date` object, it will be used as is.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(value: Date);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param value - A date value as `Chronos` object.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(value: Chronos);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n\t * @param month The month as a number between 1 and 12 (January to December).\n\t * @param date The date as a number between 1 and 31.\n\t * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.\n\t * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.\n\t * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.\n\t * @param ms A number from 0 to 999 that specifies the milliseconds.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(\n\t\tyear: number,\n\t\tmonth: number,\n\t\tdate?: number,\n\t\thours?: number,\n\t\tminutes?: number,\n\t\tseconds?: number,\n\t\tms?: number,\n\t);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param value - A date value (`number`, `string`, `Date`, or `Chronos` object).\n\t * - If a string is provided, it should be in a format that can be parsed by the `Date` constructor.\n\t * - If a number is provided, it should be a timestamp (milliseconds since the Unix epoch).\n\t * - If a Date object is provided, it will be used as is.\n\t * - If a Chronos object is provided, it will be used directly.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(value?: ChronosInput);\n\n\t/**\n\t * * Creates a new immutable `Chronos` instance.\n\t *\n\t * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n\t * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n\t *\n\t * @param valueOrYear The value in number, string, Date or Chronos format or the full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n\t * @param month The month as a number between 1 and 12 (January to December).\n\t * @param date The date as a number between 1 and 31.\n\t * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.\n\t * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.\n\t * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.\n\t * @param ms A number from 0 to 999 that specifies the milliseconds.\n\t *\n\t * @returns Instance of `Chronos` with all methods and properties.\n\t */\n\tconstructor(\n\t\tvalueOrYear?: ChronosInput,\n\t\tmonth?: number,\n\t\tdate?: number,\n\t\thours?: number,\n\t\tminutes?: number,\n\t\tseconds?: number,\n\t\tms?: number,\n\t) {\n\t\tif (typeof valueOrYear === 'number' && typeof month === 'number') {\n\t\t\tthis.#date = new Date(\n\t\t\t\tvalueOrYear,\n\t\t\t\tmonth - 1,\n\t\t\t\tdate ?? 1,\n\t\t\t\thours ?? 0,\n\t\t\t\tminutes ?? 0,\n\t\t\t\tseconds ?? 0,\n\t\t\t\tms ?? 0,\n\t\t\t);\n\t\t} else {\n\t\t\tthis.#date = this.#toNewDate(valueOrYear);\n\t\t}\n\n\t\tthis[ORIGIN] = 'root';\n\t\tthis.#offset = `UTC${this.getUTCOffset()}` as UTCOffSet;\n\t}\n\n\t*[Symbol.iterator](): IterableIterator<[string, number]> {\n\t\tyield ['year', this.year];\n\t\tyield ['month', this.month];\n\t\tyield ['isoMonth', this.month + 1];\n\t\tyield ['date', this.date];\n\t\tyield ['weekDay', this.weekDay];\n\t\tyield ['isoWeekDay', this.weekDay + 1];\n\t\tyield ['hour', this.hour];\n\t\tyield ['minute', this.minute];\n\t\tyield ['second', this.second];\n\t\tyield ['millisecond', this.millisecond];\n\t\tyield ['timestamp', this.timestamp];\n\t\tyield ['unix', this.unix];\n\t}\n\n\t/**\n\t * * Enables primitive coercion like `console.log`, `${chronos}`, etc.\n\t * @param hint - The type hint provided by the JS engine.\n\t * @returns The primitive value based on the hint.\n\t */\n\t[Symbol.toPrimitive](hint: string): string | number {\n\t\tif (hint === 'number') return this.valueOf();\n\t\treturn this.toLocalISOString();\n\t}\n\n\t[Symbol.replace](string: string, replacement: string): string {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc':\n\t\t\t\treturn string.replace(\n\t\t\t\t\tthis.toISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t\treplacement,\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn string.replace(\n\t\t\t\t\tthis.toLocalISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t\treplacement,\n\t\t\t\t);\n\t\t}\n\t}\n\n\t[Symbol.search](string: string): number {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc':\n\t\t\t\treturn string.indexOf(\n\t\t\t\t\tthis.toISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn string.indexOf(\n\t\t\t\t\tthis.toLocalISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t}\n\t}\n\n\t[Symbol.split](string: string): string[] {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc':\n\t\t\t\treturn string.split(\n\t\t\t\t\tthis.toISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn string.split(\n\t\t\t\t\tthis.toLocalISOString().replace(\n\t\t\t\t\t\t/\\.\\d+(Z|[+-]\\d{2}:\\d{2})?$/,\n\t\t\t\t\t\t'',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t}\n\t}\n\n\tget [Symbol.toStringTag](): string {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\t\treturn this.toISOString().replace('Z', this.#offset.slice(3));\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc':\n\t\t\t\treturn this.#toLocalISOString().replace(\n\t\t\t\t\tthis.getUTCOffset(),\n\t\t\t\t\t'Z',\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn this.#toLocalISOString();\n\t\t}\n\t}\n\n\t/**\n\t * @private Method to create native `Date` instance from date-like data types.\n\t * @param value The value to convert into `Date`.\n\t * @returns Instance of native Date object.\n\t */\n\t#toNewDate(value?: ChronosInput): Date {\n\t\tconst date =\n\t\t\tvalue instanceof Chronos ?\n\t\t\t\tvalue.toDate()\n\t\t\t:\tnew Date(value ?? Date.now());\n\n\t\t// Check if the date is invalid\n\t\tif (isNaN(date.getTime())) {\n\t\t\tthrow new Error('Provided date is invalid!');\n\t\t}\n\n\t\treturn date;\n\t}\n\n\t/**\n\t * @private Method to tag origin of the `Chronos` instance.\n\t *\n\t * @param origin Origin of the instance, the method name from where it was created.\n\t * @param offset Optional UTC offset in `UTC+12:00` format.\n\t * @returns The `Chronos` instance with the specified origin.\n\t */\n\t#withOrigin(origin: ChronosMethods, offset?: UTCOffSet): Chronos {\n\t\tconst instance = new Chronos(this.#date);\n\t\tinstance[ORIGIN] = origin;\n\t\tif (offset) instance.#offset = offset;\n\t\treturn instance;\n\t}\n\n\t/**\n\t * @private Formats the current `Chronos` date using the specified template.\n\t *\n\t * @param format - The desired date format.\n\t * @param useUTC - Whether to use UTC or local time.\n\t * @returns Formatted date string.\n\t */\n\t#format(format: string, useUTC = false): string {\n\t\tconst year =\n\t\t\tuseUTC ? this.#date.getUTCFullYear() : this.#date.getFullYear();\n\t\tconst month = useUTC ? this.#date.getUTCMonth() : this.#date.getMonth();\n\t\tconst day = useUTC ? this.#date.getUTCDay() : this.#date.getDay();\n\t\tconst date = useUTC ? this.#date.getUTCDate() : this.#date.getDate();\n\t\tconst hours = useUTC ? this.#date.getUTCHours() : this.#date.getHours();\n\t\tconst minutes =\n\t\t\tuseUTC ? this.#date.getUTCMinutes() : this.#date.getMinutes();\n\t\tconst seconds =\n\t\t\tuseUTC ? this.#date.getUTCSeconds() : this.#date.getSeconds();\n\t\tconst milliseconds =\n\t\t\tuseUTC ?\n\t\t\t\tthis.#date.getUTCMilliseconds()\n\t\t\t:\tthis.#date.getMilliseconds();\n\n\t\tconst dateComponents: Record<ChronosFormat, string> = {\n\t\t\tYYYY: String(year),\n\t\t\tYY: String(year).slice(-2),\n\t\t\tyyyy: String(year),\n\t\t\tyy: String(year).slice(-2),\n\t\t\tM: String(month + 1),\n\t\t\tMM: String(month + 1).padStart(2, '0'),\n\t\t\tmmm: MONTHS[month].slice(0, 3),\n\t\t\tmmmm: MONTHS[month],\n\t\t\td: DAYS[day].slice(0, 2),\n\t\t\tdd: DAYS[day].slice(0, 3),\n\t\t\tddd: DAYS[day],\n\t\t\tD: String(date),\n\t\t\tDD: String(date).padStart(2, '0'),\n\t\t\tDo: getOrdinal(date),\n\t\t\tH: String(hours),\n\t\t\tHH: String(hours).padStart(2, '0'),\n\t\t\th: String(hours % 12 || 12),\n\t\t\thh: String(hours % 12 || 12).padStart(2, '0'),\n\t\t\tm: String(minutes),\n\t\t\tmm: String(minutes).padStart(2, '0'),\n\t\t\ts: String(seconds),\n\t\t\tss: String(seconds).padStart(2, '0'),\n\t\t\tms: String(milliseconds),\n\t\t\tmss: String(milliseconds).padStart(3, '0'),\n\t\t\ta: hours < 12 ? 'am' : 'pm',\n\t\t\tA: hours < 12 ? 'AM' : 'PM',\n\t\t};\n\n\t\tlet result = '';\n\t\tlet i = 0;\n\n\t\twhile (i < format?.length) {\n\t\t\tlet matched = false;\n\n\t\t\tfor (const token of sortedFormats) {\n\t\t\t\tconst ahead = format?.slice(i, i + token?.length);\n\t\t\t\tconst prev = i === 0 ? '' : format[i - 1];\n\t\t\t\tconst next = format[i + token?.length] ?? '';\n\n\t\t\t\t// Check non-alphanumeric boundaries\n\t\t\t\tconst prevOk = i === 0 || /[^a-zA-Z0-9]/.test(prev);\n\t\t\t\tconst nextOk =\n\t\t\t\t\ti + token?.length >= format?.length ||\n\t\t\t\t\t/[^a-zA-Z0-9]/.test(next);\n\n\t\t\t\tif (ahead === token && prevOk && nextOk) {\n\t\t\t\t\tresult += dateComponents[token];\n\t\t\t\t\ti += token?.length;\n\t\t\t\t\tmatched = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!matched) {\n\t\t\t\tresult += format[i];\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/** @private Returns ISO string with local time zone offset */\n\t#toLocalISOString(): string {\n\t\tconst pad = (n: number, p = 2) => String(n).padStart(p, '0');\n\n\t\treturn `${this.year}-${pad(this.month + 1)}-${pad(this.date)}T${pad(this.hour)}:${pad(this.minute)}:${pad(this.second)}.${pad(this.millisecond, 3)}${this.getUTCOffset()}`;\n\t}\n\n\t/**\n\t * @private Normalizes duration values based on sign and `absolute` flag.\n\t * @param result The raw time breakdown to normalize.\n\t * @param absolute If true, ensures all values are positive.\n\t * @param isFuture Whether the duration was forward (true) or backward (false).\n\t * @returns The normalized duration object.\n\t */\n\t#normalizeDuration(\n\t\tresult: TimeDuration,\n\t\tabsolute: boolean,\n\t\tisFuture: boolean,\n\t): TimeDuration {\n\t\tconst entries = Object.entries(result) as [\n\t\t\tkeyof TimeDuration,\n\t\t\tnumber,\n\t\t][];\n\n\t\tif (!absolute && !isFuture) {\n\t\t\tfor (const [key, value] of entries) {\n\t\t\t\tif (value !== 0) {\n\t\t\t\t\tresult[key] = value * -1;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (absolute) {\n\t\t\tfor (const [key, value] of entries) {\n\t\t\t\tresult[key] = Math.abs(value);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/** Gets the full year of the date. */\n\tget year(): number {\n\t\treturn this.#date.getFullYear();\n\t}\n\n\t/** Gets the month (0-11) of the date. */\n\tget month(): number {\n\t\treturn this.#date.getMonth();\n\t}\n\n\t/** Gets the day of the month (1-31). */\n\tget date(): number {\n\t\treturn this.#date.getDate();\n\t}\n\n\t/** Gets the day of the week (0-6, where 0 is Sunday). */\n\tget weekDay(): number {\n\t\treturn this.#date.getDay();\n\t}\n\n\t/** Gets the hour (0-23) of the date. */\n\tget hour(): number {\n\t\treturn this.#date.getHours();\n\t}\n\n\t/** Gets the minute (0-59) of the date. */\n\tget minute(): number {\n\t\treturn this.#date.getMinutes();\n\t}\n\n\t/** Gets the second (0-59) of the date. */\n\tget second(): number {\n\t\treturn this.#date.getSeconds();\n\t}\n\n\t/** Gets the millisecond (0-999) of the date. */\n\tget millisecond(): number {\n\t\treturn this.#date.getMilliseconds();\n\t}\n\n\t/** Gets ISO weekday: 1 = Monday, 7 = Sunday */\n\tget isoWeekday(): number {\n\t\tconst day = this.weekDay;\n\n\t\treturn day === 0 ? 7 : day;\n\t}\n\n\t/** Gets ISO month (1–12 instead of 0–11) */\n\tget isoMonth(): number {\n\t\treturn this.month + 1;\n\t}\n\n\t/** Returns the Unix timestamp (seconds since the Unix epoch: January 1, 1970, UTC). */\n\tget unix(): number {\n\t\treturn Math.floor(this.#date.getTime() / 1000);\n\t}\n\n\t/** Gets the time value in milliseconds since midnight, January 1, 1970 UTC. */\n\tget timestamp(): number {\n\t\treturn this.#date.getTime();\n\t}\n\n\t/** * Gets the last date (number) of the current month `(28, 29, 30 or 31)`. */\n\tget lastDateOfMonth(): 28 | 29 | 30 | 31 {\n\t\treturn this.lastDayOfMonth().#date.getDate() as 28 | 29 | 30 | 31;\n\t}\n\n\t/** @instance Returns a debug-friendly string for `console.log` or `util.inspect`. */\n\tinspect(): string {\n\t\treturn `[Chronos ${this.toLocalISOString()}]`;\n\t}\n\n\t/** @instance Enables JSON.stringify and logging in the console (in Browser environment) to show readable output. */\n\ttoJSON(): string {\n\t\treturn this.toLocalISOString();\n\t}\n\n\t/** @instance Enables arithmetic and comparison operations (e.g., +new Chronos()). */\n\tvalueOf(): number {\n\t\treturn this.getTimeStamp();\n\t}\n\n\t/** @instance Clones and returns a new Chronos instance with the same date. */\n\tclone(): Chronos {\n\t\treturn new Chronos(this.#date).#withOrigin(\n\t\t\tthis[ORIGIN] as ChronosMethods,\n\t\t);\n\t}\n\n\t/** @instance Gets the native `Date` instance (read-only). */\n\ttoDate(): Date {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc': {\n\t\t\t\tconst mins = this.getUTCOffsetMinutes();\n\n\t\t\t\tconst date = this.addMinutes(mins);\n\n\t\t\t\treturn date.toDate();\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn new Date(this.#date);\n\t\t}\n\t}\n\n\t/** @instance Returns a string representation of a date. The format of the string depends on the locale. */\n\ttoString(): string {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone': {\n\t\t\t\tconst gmt = this.#offset.replace('UTC', 'GMT').replace(':', '');\n\t\t\t\tconst label = TIME_ZONE_LABELS[this.#offset] ?? this.#offset;\n\n\t\t\t\treturn this.#date\n\t\t\t\t\t.toString()\n\t\t\t\t\t.replace(/GMT[+-]\\d{4} \\([^)]+\\)/, `${gmt} (${label})`);\n\t\t\t}\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc': {\n\t\t\t\tconst mins = this.getUTCOffsetMinutes();\n\n\t\t\t\tconst date = this.addMinutes(mins);\n\n\t\t\t\treturn date.toString();\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn this.#date.toString();\n\t\t}\n\t}\n\n\t/** @instance Returns ISO string with local time zone offset */\n\ttoLocalISOString(): string {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc': {\n\t\t\t\tconst previousOffset = this.getTimeZoneOffsetMinutes();\n\t\t\t\tconst currentOffset = this.getUTCOffsetMinutes();\n\n\t\t\t\tconst date = this.addMinutes(-previousOffset - currentOffset);\n\n\t\t\t\treturn date.#toLocalISOString();\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn this.#toLocalISOString();\n\t\t}\n\t}\n\n\t/** @instance Returns a date as a string value in ISO format. */\n\ttoISOString(): string {\n\t\tswitch (this[ORIGIN]) {\n\t\t\tcase 'timeZone':\n\t\t\t\treturn this.#toLocalISOString().replace(\n\t\t\t\t\tthis.getUTCOffset(),\n\t\t\t\t\tthis.#offset.slice(3),\n\t\t\t\t);\n\t\t\tcase 'toUTC':\n\t\t\tcase 'utc':\n\t\t\t\treturn this.#toLocalISOString().replace(\n\t\t\t\t\tthis.getUTCOffset(),\n\t\t\t\t\t'Z',\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn this.#date.toISOString();\n\t\t}\n\t}\n\n\t/**\n\t * @instance Wrapper over native `toLocaleString`\n\t * @description Converts a date and time to a string by using the current or specified locale.\n\t *\n\t * @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n\t * @param options An object that contains one or more properties that specify comparison options.\n\t */\n\ttoLocaleString(\n\t\tlocale?: LocaleCode | Intl.Locale | (LocaleCode | Intl.Locale)[],\n\t\toptions?: Intl.DateTimeFormatOptions,\n\t): string {\n\t\treturn this.#date.toLocaleString(locale, options);\n\t}\n\n\t/** @instance Returns the time value in milliseconds since midnight, January 1, 1970 UTC. */\n\tgetTimeStamp(): number {\n\t\treturn this.#date.getTime();\n\t}\n\n\t/**\n\t * @instance Formats the date into a custom string format (local time).\n\t *\n\t * @param format - The desired format (Default format is `dd, mmm DD, YYYY HH:mm:ss` = `Sun, Apr 06, 2025 16:11:55`).\n\t * @param useUTC - Optional `useUTC` to get the formatted time using UTC Offset, defaults to `false`. Equivalent to `formatUTC()` method if set to `true`.\n\t * @returns Formatted date string in desired format (in local time unless `useUTC` passed as `true`).\n\t */\n\tformat(format?: string, useUTC = false): string {\n\t\treturn this.#format(format ?? 'dd, mmm DD, YYYY HH:mm:ss', useUTC);\n\t}\n\n\t/**\n\t * @instance Formats the date into a predefined strict string format using local time or UTC.\n\t *\n\t * @remarks Offers over 21,000 predefined formats with full IntelliSense support.\n\t *\n\t * @param format - The desired format string. Defaults to `'dd, mmm DD, YYYY HH:mm:ss'`\n\t * (e.g., `'Sun, Apr 06, 2025 16:11:55'`).\n\t * @param useUTC - If `true`, formats the date in UTC (equivalent to `formatUTC()`);\n\t * defaults to `false` (local time).\n\t * @returns A formatted date string in the specified format\n\t */\n\tformatStrict(format?: StrictFormat, useUTC = false): string {\n\t\treturn this.#format(format ?? 'dd, mmm DD, YYYY HH:mm:ss', useUTC);\n\t}\n\n\t/**\n\t * @instance Formats the date into a custom string format (UTC time).\n\t *\n\t * @param format - The desired format (Default format is `dd, mmm DD, YYYY HH:mm:ss:mss` = `Sun, Apr 06, 2025 16:11:55:379`).\n\t * @returns Formatted date string in desired format (UTC time).\n\t */\n\tformatUTC(format: string = 'dd, mmm DD, YYYY HH:mm:ss:mss'): string {\n\t\tswitch (this.#offset) {\n\t\t\tcase 'UTC+00:00':\n\t\t\t\treturn this.#format(format, false);\n\t\t\tdefault:\n\t\t\t\treturn this.#format(format, true);\n\t\t}\n\t}\n\n\t/**\n\t * @instance Adds seconds and returns a new immutable instance.\n\t * @param seconds - Number of seconds to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddSeconds(seconds: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setSeconds(newDate.getSeconds() + seconds);\n\t\treturn new Chronos(newDate).#withOrigin('addSeconds');\n\t}\n\n\t/**\n\t * @instance Adds minutes and returns a new immutable instance.\n\t * @param minutes - Number of minutes to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddMinutes(minutes: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setMinutes(newDate.getMinutes() + minutes);\n\t\treturn new Chronos(newDate).#withOrigin('addMinutes');\n\t}\n\n\t/**\n\t * @instance Adds hours and returns a new immutable instance.\n\t * @param hours - Number of hours to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddHours(hours: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setHours(newDate.getHours() + hours);\n\t\treturn new Chronos(newDate).#withOrigin('addHours');\n\t}\n\n\t/**\n\t * @instance Adds days and returns a new immutable instance.\n\t * @param days - Number of days to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddDays(days: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setDate(newDate.getDate() + days);\n\t\treturn new Chronos(newDate).#withOrigin('addDays');\n\t}\n\n\t/**\n\t * @instance Adds weeks and returns a new immutable instance.\n\t * @param weeks - Number of weeks to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddWeeks(weeks: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setDate(newDate.getDate() + weeks * 7);\n\t\treturn new Chronos(newDate).#withOrigin('addWeeks');\n\t}\n\n\t/**\n\t * @instance Adds months and returns a new immutable instance.\n\t * @param months - Number of months to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddMonths(months: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setMonth(newDate.getMonth() + months);\n\t\treturn new Chronos(newDate).#withOrigin('addMonths');\n\t}\n\n\t/**\n\t * @instance Adds years and returns a new immutable instance.\n\t * @param years - Number of years to add.\n\t * @returns A new `Chronos` instance with the updated date.\n\t */\n\taddYears(years: number): Chronos {\n\t\tconst newDate = new Date(this.#date);\n\t\tnewDate.setFullYear(newDate.getFullYear() + years);\n\t\treturn new Chronos(newDate).#withOrigin('addYears');\n\t}\n\n\t/**\n\t * @instance Create a new instance of `Chronos` in the specified timezone.\n\t *\n\t * @param zone - Standard timezone abbreviation (e.g., 'IST', 'UTC', 'EST') or UTC Offset in `UTC-01:30` format.\n\t * @returns A new instance of `Chronos` with time in the given timezone. Invalid input sets time-zone to `UTC`.\n\t */\n\ttimeZone(zone: TimeZone | UTCOffSet): Chronos {\n\t\tlet targetOffset: number;\n\t\tlet stringOffset: UTCOffSet;\n\n\t\tif (isValidUTCOffSet(zone)) {\n\t\t\ttargetOffset = extractMinutesFromUTC(zone);\n\t\t\tstringOffset = zone;\n\t\t} else {\n\t\t\ttargetOffset = TIME_ZONES[zone] ?? TIME_ZONES['UTC'];\n\t\t\tstringOffset = formatUTCOffset(targetOffset);\n\t\t}\n\n\t\tconst previousOffset = this.getTimeZoneOffsetMinutes();\n\t\tconst relativeOffset = targetOffset - previousOffset;\n\n\t\tconst adjustedTime = new Date(\n\t\t\tthis.#date.getTime() + relativeOffset * 60 * 1000,\n\t\t);\n\n\t\treturn new Chronos(adjustedTime).#withOrigin('timeZone', stringOffset);\n\t}\n\n\t/**\n\t * @instance Checks if the year is a leap year.\n\t * - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.\n\t * - For example, 2000 and 2400 are leap years, but 1900 and 2100 are not.\n\t * @returns `true` if the year is a leap year, `false` otherwise.\n\t */\n\tisLeapYear(): boolean {\n\t\tconst year = this.#date.getFullYear();\n\n\t\treturn isLeapYear(year);\n\t}\n\n\t/** @instance Checks if the current date is today. */\n\tisToday(): boolean {\n\t\treturn this.getRelativeDay() === 0;\n\t}\n\n\t/** @instance Checks if the current date is tomorrow. */\n\tisTomorrow(): boolean {\n\t\treturn this.getRelativeDay() === 1;\n\t}\n\n\t/** @instance Checks if the current date is yesterday. */\n\tisYesterday(): boolean {\n\t\treturn this.getRelativeDay() === -1;\n\t}\n\n\t/** @instance Checks if another date is exactly equal to this one */\n\tisEqual(other: ChronosInput): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn this.timestamp === time.timestamp;\n\t}\n\n\t/** @instance Checks if another date is exactly equal to or before this one */\n\tisEqualOrBefore(other: ChronosInput): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn this.timestamp <= time.timestamp;\n\t}\n\n\t/** @instance Checks if another date is exactly equal to or after this one */\n\tisEqualOrAfter(other: ChronosInput): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn this.timestamp >= time.timestamp;\n\t}\n\n\t/**\n\t * @instance Checks if another date is the same as this one in a specific unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit to compare.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tisSame(\n\t\tother: ChronosInput,\n\t\tunit: TimeUnit,\n\t\tweekStartsOn: number = 0,\n\t): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn (\n\t\t\tthis.startOf(unit, weekStartsOn).toDate().getTime() ===\n\t\t\ttime.startOf(unit, weekStartsOn).toDate().getTime()\n\t\t);\n\t}\n\n\t/**\n\t * @instance Checks if this date is before another date in a specific unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit to compare.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tisBefore(\n\t\tother: ChronosInput,\n\t\tunit: TimeUnit,\n\t\tweekStartsOn: number = 0,\n\t): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn (\n\t\t\tthis.startOf(unit, weekStartsOn).toDate().getTime() <\n\t\t\ttime.startOf(unit, weekStartsOn).toDate().getTime()\n\t\t);\n\t}\n\n\t/**\n\t * @instance Checks if this date is after another date in a specific unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit to compare.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tisAfter(\n\t\tother: ChronosInput,\n\t\tunit: TimeUnit,\n\t\tweekStartsOn: number = 0,\n\t): boolean {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\treturn (\n\t\t\tthis.startOf(unit, weekStartsOn).toDate().getTime() >\n\t\t\ttime.startOf(unit, weekStartsOn).toDate().getTime()\n\t\t);\n\t}\n\n\t/**\n\t * @instance Checks if this date is the same or before another date in a specific unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit to compare.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tisSameOrBefore(\n\t\tother: ChronosInput,\n\t\tunit: TimeUnit,\n\t\tweekStartsOn: number = 0,\n\t): boolean {\n\t\treturn (\n\t\t\tthis.isSame(other, unit, weekStartsOn) ||\n\t\t\tthis.isBefore(other, unit, weekStartsOn)\n\t\t);\n\t}\n\n\t/**\n\t * @instance Checks if this date is the same or after another date in a specific unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit to compare.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tisSameOrAfter(\n\t\tother: ChronosInput,\n\t\tunit: TimeUnit,\n\t\tweekStartsOn: number = 0,\n\t): boolean {\n\t\treturn (\n\t\t\tthis.isSame(other, unit, weekStartsOn) ||\n\t\t\tthis.isAfter(other, unit, weekStartsOn)\n\t\t);\n\t}\n\n\t/**\n\t * @instance Checks if the current date is between the given start and end dates.\n\t *\n\t * @param start - The start of the range.\n\t * @param end - The end of the range.\n\t * @param inclusive - Specifies whether the comparison is inclusive or exclusive:\n\t * - `'[]'`: inclusive of both start and end (≥ start and ≤ end)\n\t * - `'[)'`: inclusive of start, exclusive of end (≥ start and < end)\n\t * - `'(]'`: exclusive of start, inclusive of end (> start and ≤ end)\n\t * - `'()'`: exclusive of both start and end (> start and < end)\n\t *\n\t * @returns `true` if the current date is within the specified range based on the `inclusive` mode.\n\t */\n\tisBetween(\n\t\tstart: ChronosInput,\n\t\tend: ChronosInput,\n\t\tinclusive: '[]' | '[)' | '(]' | '()' = '()',\n\t): boolean {\n\t\tconst s = new Chronos(start).valueOf();\n\t\tconst e = new Chronos(end).valueOf();\n\t\tconst t = this.valueOf();\n\n\t\tswitch (inclusive) {\n\t\t\tcase '[]':\n\t\t\t\treturn t >= s && t <= e;\n\t\t\tcase '[)':\n\t\t\t\treturn t >= s && t < e;\n\t\t\tcase '(]':\n\t\t\t\treturn t > s && t <= e;\n\t\t\tcase '()':\n\t\t\t\treturn t > s && t < e;\n\t\t}\n\t}\n\n\t/**\n\t * @instance Checks if the current date falls on a weekend.\n\t *\n\t * @param weekStartsOn Optional day the week starts on (0–6). Default is `0` (Sunday).\n\t * @param weekendLength Optional length of the weekend (1 or 2). Default is `2`.\n\t * @returns Whether the date is a weekend.\n\t *\n\t * @description\n\t * Weekend is determined based on `weekStartsOn` and `weekendLength`.\n\t *\n\t * - `weekStartsOn` is a 0-based index (0 = Sunday, 1 = Monday, ..., 6 = Saturday).\n\t * - `weekendLength` defines how many days are considered weekend (1 or 2). Default is 2.\n\t * If 1, only the last day of the week is treated as weekend.\n\t * If 2, the last two days are treated as weekend.\n\t */\n\tisWeekend(weekStartsOn: number = 0, weekendLength: 1 | 2 = 2): boolean {\n\t\tconst day = this.#date.getDay();\n\t\tconst lastDayOfWeek = (weekStartsOn + 6) % 7;\n\t\tconst secondLastDay = (weekStartsOn + 5) % 7;\n\n\t\tif (weekendLength === 1) {\n\t\t\treturn day === lastDayOfWeek;\n\t\t}\n\n\t\treturn day === lastDayOfWeek || day === secondLastDay;\n\t}\n\n\t/**\n\t * @instance Checks if the current date is a workday (non-weekend day).\n\t *\n\t * @param weekStartsOn Optional day the week starts on (0–6). Default is `0` (Sunday).\n\t * @param weekendLength Optional length of the weekend (1 or 2). Default is `2`.\n\t * @returns Whether the date is a workday.\n\t *\n\t * @description\n\t * Weekends are determined by `weekStartsOn` and `weekendLength`.\n\t *\n\t * - `weekStartsOn` is a 0-based index (0 = Sunday, 1 = Monday, ..., 6 = Saturday).\n\t * - `weekendLength` defines how many days are considered weekend (1 or 2). Default is 2.\n\t */\n\tisWorkday(weekStartsOn: number = 0, weekendLength: 1 | 2 = 2): boolean {\n\t\treturn !this.isWeekend(weekStartsOn, weekendLength);\n\t}\n\n\t/**\n\t * @instance Checks if the current date and time fall within business hours.\n\t *\n\t * @param businessStartHour Optional starting hour of business time (0–23). Defaults to `9` (9 AM).\n\t * @param businessEndHour Optional ending hour of business time (0–23). Defaults to `17` (5 PM).\n\t * @param weekStartsOn Optional day the week starts on (0–6). Default is `0` (Sunday).\n\t * @param weekendLength Optional weekend length (1 or 2). Default is `2`.\n\t *\n\t * @returns Whether the current time is within business hours.\n\t *\n\t * @remarks\n\t * * Business hours are typically 9 AM to 5 PM on weekdays.\n\t * * Supports standard and overnight business hours. Overnight means `end < start`.\n\t * * Example: `businessStartHour = 22`, `businessEndHour = 6` will cover 10 PM to 6 AM next day.\n\t *\n\t * * *Weekends are determined by `weekStartsOn` and `weekendLength` using the `isWeekend()` method.*\n\t *\n\t * - Business hours are `[businessStartHour, businessEndHour)`.\n\t * - If `weekendLength` is `1`, only the last day of the week is treated as weekend.\n\t * - If `weekendLength` is `2`, the last two days are treated as weekend.\n\t */\n\tisBusinessHour(\n\t\tbusinessStartHour: number = 9,\n\t\tbusinessEndHour: number = 17,\n\t\tweekStartsOn: number = 0,\n\t\tweekendLength: 1 | 2 = 2,\n\t): boolean {\n\t\tif (this.isWeekend(weekStartsOn, weekendLength)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst hour = this.#date.getHours();\n\n\t\tif (businessStartHour === businessEndHour) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (businessStartHour < businessEndHour) {\n\t\t\t// Normal range, e.g. 9 → 17\n\t\t\treturn hour >= businessStartHour && hour < businessEndHour;\n\t\t} else {\n\t\t\t// Overnight shift, e.g. 22 → 6\n\t\t\treturn hour >= businessStartHour || hour < businessEndHour;\n\t\t}\n\t}\n\n\t/**\n\t * @instance Checks if the current date is a palindrome in either padded or non-padded format.\n\t *\n\t * @remarks\n\t * A palindrome date reads the same forward and backward, excluding delimiters.\n\t * This method checks both zero-padded (`MM-DD`) and non-padded (`M-D`) formats for flexibility.\n\t *\n\t * Examples of palindromes:\n\t * - `'2020-02-02'` → `'20200202'` ✅\n\t * - `'2112-11-12'` → `'21121112'` ❌\n\t * - `'2011-01-11'` (from `'YY-M-D'`) → `'11111'` ✅\n\t * - `'2011-01-11'` (from `'YYYY-M-D'`) → `'11111'` ❌\n\t *\n\t * @param shortYear - If `true`, uses `'YY-MM-DD'` and `'YY-M-D'` formats.\n\t * If `false`, uses `'YYYY-MM-DD'` and `'YYYY-M-D'` formats.\n\t * Defaults to `false`.\n\t *\n\t * @returns `true` if either padded or non-padded formatted date is a palindrome, otherwise `false`.\n\t *\n\t * @example\n\t * new Chronos('2020-02-02').isPalindromeDate(); // true\n\t * new Chronos('2112-11-12').isPalindromeDate(); // false\n\t * new Chronos('2011-1-11').isPalindromeDate(); // false (from '2011111')\n\t * new Chronos('2011-1-11').isPalindromeDate(true); // true (from '11111')\n\t * new Chronos('2024-04-11').isPalindromeDate(); // false\n\t */\n\tisPalindromeDate(shortYear = false): boolean {\n\t\tconst padded = this.formatStrict(shortYear ? 'YY-MM-DD' : 'YYYY-MM-DD');\n\t\tconst normal = this.formatStrict(shortYear ? 'YY-M-D' : 'YYYY-M-D');\n\t\treturn isPalindrome(padded) || isPalindrome(normal);\n\t}\n\n\t/**\n\t * @instance Checks if the date is within daylight saving time (DST).\n\t * @returns Whether the date is in DST.\n\t */\n\tisDST(): boolean {\n\t\tconst year = this.#date.getFullYear();\n\n\t\tconst jan = new Date(year, 0, 1).getTimezoneOffset();\n\n\t\tconst jul = new Date(year, 6, 1).getTimezoneOffset();\n\n\t\treturn this.#date.getTimezoneOffset() < Math.max(jan, jul);\n\t}\n\n\t/** @instance Checks if current day is the first day of the current month. */\n\tisFirstDayOfMonth(): boolean {\n\t\treturn this.isSame(this.firstDayOfMonth(), 'day');\n\t}\n\n\t/** @instance Checks if current day is the last day of the current month. */\n\tisLastDayOfMonth(): boolean {\n\t\treturn this.isSame(this.lastDayOfMonth(), 'day');\n\t}\n\n\t/**\n\t * @instance Returns full time difference from now (or a specified time) down to a given level.\n\t *\n\t * @param level Determines the smallest unit to include in the output (e.g., 'minute' will show up to minutes, ignoring seconds). Defaults to `minute`.\n\t * @param withSuffixPrefix If `true`, adds `\"in\"` or `\"ago\"` depending on whether the time is in the future or past. Defaults to `true`.\n\t * @param time An optional time value to compare with (`string`, `number`, `Date`, or `Chronos` instance). Defaults to `now`.\n\t * @returns The difference as a human-readable string, e.g., `2 years 1 month 9 days 18 hours 56 minutes ago`.\n\t */\n\tfromNow(\n\t\tlevel: Exclude<TimeUnit, 'millisecond'> = 'minute',\n\t\twithSuffixPrefix: boolean = true,\n\t\ttime?: ChronosInput,\n\t): string {\n\t\tconst now = this.#toNewDate(time);\n\n\t\tconst target = this.#date;\n\n\t\tconst isFuture = target > now;\n\n\t\tconst from = isFuture ? now : target;\n\t\tconst to = isFuture ? target : now;\n\n\t\tlet years = to.getFullYear() - from.getFullYear();\n\t\tlet months = to.getMonth() - from.getMonth();\n\t\tlet days = to.getDate() - from.getDate();\n\t\tlet weeks = 0;\n\t\tlet hours = to.getHours() - from.getHours();\n\t\tlet minutes = to.getMinutes() - from.getMinutes();\n\t\tlet seconds = to.getSeconds() - from.getSeconds();\n\n\t\t// Adjust negative values\n\t\tif (seconds < 0) {\n\t\t\tseconds += 60;\n\t\t\tminutes--;\n\t\t}\n\n\t\tif (minutes < 0) {\n\t\t\tminutes += 60;\n\t\t\thours--;\n\t\t}\n\n\t\tif (hours < 0) {\n\t\t\thours += 24;\n\t\t\tdays--;\n\t\t}\n\n\t\tif (level === 'week' || level === 'day') {\n\t\t\tweeks = Math.floor(days / 7);\n\t\t\tdays = days % 7;\n\t\t}\n\n\t\tif (days < 0) {\n\t\t\tconst prevMonth = new Date(to.getFullYear(), to.getMonth(), 0);\n\n\t\t\tdays += prevMonth.getDate();\n\t\t\tmonths--;\n\t\t}\n\n\t\tif (months < 0) {\n\t\t\tmonths += 12;\n\t\t\tyears--;\n\t\t}\n\n\t\tconst unitOrder = [\n\t\t\t'year',\n\t\t\t'month',\n\t\t\t'week',\n\t\t\t'day',\n\t\t\t'hour',\n\t\t\t'minute',\n\t\t\t'second',\n\t\t] as const;\n\n\t\tconst lvlIdx = unitOrder.indexOf(level);\n\n\t\tconst parts: string[] = [];\n\n\t\tif (lvlIdx >= 0 && years > 0 && lvlIdx >= unitOrder.indexOf('year')) {\n\t\t\tparts?.push(formatUnitWithPlural(years, 'year'));\n\t\t}\n\t\tif (lvlIdx >= unitOrder.indexOf('month') && months > 0) {\n\t\t\tparts?.push(formatUnitWithPlural(months, 'month'));\n\t\t}\n\t\tif (lvlIdx >= unitOrder.indexOf('week') && weeks > 0) {\n\t\t\tparts?.push(formatUnitWithPlural(weeks, 'week'));\n\t\t}\n\t\tif (lvlIdx >= unitOrder.indexOf('day') && days > 0) {\n\t\t\tparts?.push(formatUnitWithPlural(days, 'day'));\n\t\t}\n\t\tif (lvlIdx >= unitOrder.indexOf('hour') && hours > 0) {\n\t\t\tparts?.push(formatUnitWithPlural(hours, 'hour'));\n\t\t}\n\t\tif (lvlIdx >= unitOrder.indexOf('minute') && minutes > 0) {\n\t\t\tparts?.push(formatUnitWithPlural(minutes, 'minute'));\n\t\t}\n\t\tif (\n\t\t\tlvlIdx >= unitOrder.indexOf('second') &&\n\t\t\t(seconds > 0 || parts?.length === 0)\n\t\t) {\n\t\t\tparts?.push(formatUnitWithPlural(seconds, 'second'));\n\t\t}\n\n\t\tlet prefix = '';\n\t\tlet suffix = '';\n\n\t\tif (withSuffixPrefix) {\n\t\t\tif (isFuture) {\n\t\t\t\tprefix = 'in ';\n\t\t\t} else {\n\t\t\t\tsuffix = ' ago';\n\t\t\t}\n\t\t}\n\n\t\treturn `${prefix}${parts?.join(' ')}${suffix}`;\n\t}\n\n\t/**\n\t * * Returns the part of day (`'midnight', 'lateNight', 'night', 'morning', 'afternoon', 'evening'`) based on the current hour.\n\t *\n\t * *Supports both normal and wraparound (overnight) ranges.*\n\t *\n\t * @param config - Optional custom hour ranges for each part of day.\n\t * Each range must be a tuple of strings as `[startHour, endHour]` in 24-hour format (e.g., `['06', '11']`).\n\t * Supports wraparound ranges like `['22', '04']` that cross midnight.\n\t *\n\t * **Default Ranges:**\n\t * - night: ['21', '23']\n\t * - midnight: ['00', '01']\n\t * - lateNight: ['02', '04']\n\t * - morning: ['05', '11']\n\t * - afternoon: ['12', '16']\n\t * - evening: ['17', '20']\n\t *\n\t * @returns The current part of the day as a string.\n\t *\n\t * @example\n\t * chronosInstance.getPartOfDay(); // e.g., 'morning'\n\t *\n\t * @example\n\t * // Example with custom ranges\n\t * chronosInstance.getPartOfDay({\n\t * night: ['22', '04'],\n\t * morning: ['05', '11'],\n\t * afternoon: ['12', '16'],\n\t * evening: ['17', '21'],\n\t * lateNight: ['01', '03'],\n\t * midnight: ['00', '00'],\n\t * });\n\t */\n\tgetPartOfDay(config?: Partial<DayPartConfig>): DayPart {\n\t\tconst hour = this.#date.getHours();\n\n\t\tconst ranges: DayPartConfig = {\n\t\t\t...DEFAULT_RANGES,\n\t\t\t...config,\n\t\t};\n\n\t\tfor (const [part, [start, end]] of Object.entries(ranges)) {\n\t\t\tconst from = Number(start);\n\t\t\tconst to = Number(end);\n\n\t\t\tif (from <= to) {\n\t\t\t\tif (hour >= from && hour <= to) {\n\t\t\t\t\treturn part as DayPart;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Wraparound logic (e.g., 20 to 04 means 20–23 OR 00–04)\n\t\t\t\tif (hour >= from || hour <= to) {\n\t\t\t\t\treturn part as DayPart;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn 'night';\n\t}\n\n\t/**\n\t * @instance Returns the number of full years between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeYear(time?: ChronosInput): number {\n\t\tconst now = this.#toNewDate(time);\n\n\t\tlet years = this.#date.getFullYear() - now.getFullYear();\n\n\t\tconst noYearMonthDay =\n\t\t\tnow.getMonth() < this.#date.getMonth() ||\n\t\t\t(now.getMonth() === this.#date.getMonth() &&\n\t\t\t\tnow.getDate() < this.#date.getDate());\n\n\t\tif (noYearMonthDay) {\n\t\t\tyears--;\n\t\t}\n\n\t\treturn years;\n\t}\n\n\t/**\n\t * @instance Returns the number of full months between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeMonth(time?: ChronosInput): number {\n\t\tconst now = this.#toNewDate(time);\n\n\t\tlet months =\n\t\t\t(this.#date.getFullYear() - now.getFullYear()) * 12 +\n\t\t\t(this.#date.getMonth() - now.getMonth());\n\n\t\tconst hasNotHadMonthDay = now.getDate() < this.#date.getDate();\n\n\t\tif (hasNotHadMonthDay) {\n\t\t\tmonths--;\n\t\t}\n\n\t\treturn months;\n\t}\n\n\t/**\n\t * @instance Determines if the given date is today, tomorrow, yesterday or any relative day.\n\t * @param date - The date to compare (Date object).\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns\n\t * - `-1` if the date is yesterday.\n\t * - `0` if the date is today.\n\t * - `1` if the date is tomorrow.\n\t * - Other positive or negative numbers for other relative days (e.g., `-2` for two days ago, `2` for two days ahead).\n\t */\n\tgetRelativeDay(time?: ChronosInput): number {\n\t\tconst today = this.#toNewDate(time);\n\t\t// Set the time of today to 00:00:00 for comparison purposes\n\t\ttoday.setHours(0, 0, 0, 0);\n\n\t\t// Normalize the input date to 00:00:00\n\t\tconst inputDate = this.#date;\n\t\tinputDate.setHours(0, 0, 0, 0);\n\n\t\tconst diffTime = inputDate.getTime() - today.getTime();\n\t\tconst diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));\n\n\t\treturn diffDays;\n\t}\n\n\t/**\n\t * @instance Determines how many full weeks apart the input date is from the `Chronos` instance.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns Difference in weeks; negative if past, positive if future.\n\t */\n\tgetRelativeWeek(time?: ChronosInput): number {\n\t\tconst relativeDays = this.getRelativeDay(time);\n\t\treturn Math.floor(relativeDays / 7);\n\t}\n\n\t/**\n\t * @instance Returns the number of full hours between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeHour(time?: ChronosInput): number {\n\t\tconst diff = this.#date.getTime() - this.#toNewDate(time).getTime();\n\t\treturn Math.floor(diff / (1000 * 60 * 60));\n\t}\n\n\t/**\n\t * @instance Returns the number of full minutes between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeMinute(time?: ChronosInput): number {\n\t\tconst diff = this.#date.getTime() - this.#toNewDate(time).getTime();\n\t\treturn Math.floor(diff / (1000 * 60));\n\t}\n\n\t/**\n\t * @instance Returns the number of full seconds between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeSecond(time?: ChronosInput): number {\n\t\tconst diff = this.#date.getTime() - this.#toNewDate(time).getTime();\n\t\treturn Math.floor(diff / 1000);\n\t}\n\n\t/**\n\t * @instance Returns the number of milliseconds between the input date and now.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tgetRelativeMilliSecond(time?: ChronosInput): number {\n\t\treturn this.#date.getTime() - this.#toNewDate(time).getTime();\n\t}\n\n\t/** @instance Returns a new Chronos instance set to the first day of the current month. */\n\tfirstDayOfMonth(): Chronos {\n\t\tconst year = this.#date.getFullYear();\n\t\tconst month = this.#date.getMonth();\n\t\tconst lastDate = new Date(year, month, 1);\n\t\treturn new Chronos(lastDate).#withOrigin('firstDayOfMonth');\n\t}\n\n\t/** @instance Returns a new Chronos instance set to the last day of the current month. */\n\tlastDayOfMonth(): Chronos {\n\t\tconst year = this.#date.getFullYear();\n\t\tconst month = this.#date.getMonth() + 1;\n\t\tconst lastDate = new Date(year, month, 0);\n\t\treturn new Chronos(lastDate).#withOrigin('lastDayOfMonth');\n\t}\n\n\t/**\n\t * @instance Compares the stored date with now, returning the difference in the specified unit.\n\t *\n\t * @param unit The time unit to compare by. Defaults to 'minute'.\n\t * @param time Optional time to compare with the `Chronos` date/time.\n\t * @returns The difference in number, negative is `Chronos` time is a past time else positive.\n\t */\n\tcompare(unit: TimeUnit = 'minute', time?: ChronosInput): number {\n\t\tswitch (unit) {\n\t\t\tcase 'year':\n\t\t\t\treturn this.getRelativeYear(time);\n\t\t\tcase 'month':\n\t\t\t\treturn this.getRelativeMonth(time);\n\t\t\tcase 'day':\n\t\t\t\treturn this.getRelativeDay(time);\n\t\t\tcase 'week':\n\t\t\t\treturn this.getRelativeWeek(time);\n\t\t\tcase 'hour':\n\t\t\t\treturn this.getRelativeHour(time);\n\t\t\tcase 'minute':\n\t\t\t\treturn this.getRelativeMinute(time);\n\t\t\tcase 'second':\n\t\t\t\treturn this.getRelativeSecond(time);\n\t\t\tcase 'millisecond':\n\t\t\t\treturn this.getRelativeMilliSecond(time);\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported time unit: ${unit}`);\n\t\t}\n\t}\n\n\t/**\n\t * @instance Returns a new Chronos instance at the start of a given unit.\n\t * @param unit The unit to reset (e.g., year, month, day).\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tstartOf(unit: TimeUnit, weekStartsOn: number = 0): Chronos {\n\t\tconst d = new Date(this.#date);\n\n\t\tswitch (unit) {\n\t\t\tcase 'year':\n\t\t\t\td.setMonth(0, 1);\n\t\t\t\td.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'month':\n\t\t\t\td.setDate(1);\n\t\t\t\td.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'week': {\n\t\t\t\tconst day = d.getDay();\n\t\t\t\tconst diff = (day - weekStartsOn + 7) % 7;\n\t\t\t\td.setDate(d.getDate() - diff);\n\t\t\t\td.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'day':\n\t\t\t\td.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'hour':\n\t\t\t\td.setMinutes(0, 0, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'minute':\n\t\t\t\td.setSeconds(0, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'second':\n\t\t\t\td.setMilliseconds(0);\n\t\t\t\tbreak;\n\t\t\tcase 'millisecond':\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn new Chronos(d).#withOrigin('startOf');\n\t}\n\n\t/**\n\t * @instance Returns a new Chronos instance at the end of a given unit.\n\t * @param unit The unit to adjust (e.g., year, month, day).\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t */\n\tendOf(unit: TimeUnit, weekStartsOn: number = 0): Chronos {\n\t\treturn this.startOf(unit, weekStartsOn)\n\t\t\t.add(1, unit)\n\t\t\t.add(-1, 'millisecond')\n\t\t\t.#withOrigin('endOf');\n\t}\n\n\t/**\n\t * @instance Returns a new Chronos instance with the specified unit added.\n\t * @param amount The amount to add (can be negative).\n\t * @param unit The time unit to add.\n\t */\n\tadd(amount: number, unit: TimeUnit): Chronos {\n\t\tconst d = new Date(this.#date);\n\n\t\tswitch (unit) {\n\t\t\tcase 'millisecond':\n\t\t\t\td.setMilliseconds(d.getMilliseconds() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'second':\n\t\t\t\td.setSeconds(d.getSeconds() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'minute':\n\t\t\t\td.setMinutes(d.getMinutes() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'hour':\n\t\t\t\td.setHours(d.getHours() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'day':\n\t\t\t\td.setDate(d.getDate() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'week':\n\t\t\t\td.setDate(d.getDate() + amount * 7);\n\t\t\t\tbreak;\n\t\t\tcase 'month':\n\t\t\t\td.setMonth(d.getMonth() + amount);\n\t\t\t\tbreak;\n\t\t\tcase 'year':\n\t\t\t\td.setFullYear(d.getFullYear() + amount);\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn new Chronos(d).#withOrigin('add');\n\t}\n\n\t/**\n\t * @instance Returns a new Chronos instance with the specified unit subtracted.\n\t * @param amount The amount to subtract (can be negative).\n\t * @param unit The time unit to add.\n\t */\n\tsubtract(amount: number, unit: TimeUnit): Chronos {\n\t\treturn this.add(-amount, unit).#withOrigin('subtract');\n\t}\n\n\t/**\n\t * @instance Gets the value of a specific time unit from the date.\n\t * @param unit The unit to retrieve.\n\t */\n\tget(unit: TimeUnit): number {\n\t\tswitch (unit) {\n\t\t\tcase 'year':\n\t\t\t\treturn this.#date.getFullYear();\n\t\t\tcase 'month':\n\t\t\t\treturn this.#date.getMonth();\n\t\t\tcase 'day':\n\t\t\t\treturn this.#date.getDate();\n\t\t\tcase 'week':\n\t\t\t\treturn this.getWeek();\n\t\t\tcase 'hour':\n\t\t\t\treturn this.#date.getHours();\n\t\t\tcase 'minute':\n\t\t\t\treturn this.#date.getMinutes();\n\t\t\tcase 'second':\n\t\t\t\treturn this.#date.getSeconds();\n\t\t\tcase 'millisecond':\n\t\t\t\treturn this.#date.getMilliseconds();\n\t\t}\n\t}\n\n\t/**\n\t * @instance Returns a new Chronos instance with the specified unit set to the given value.\n\t * @param unit The unit to modify.\n\t * @param value The value to set for the unit.\n\t */\n\tset(unit: TimeUnit, value: number): Chronos {\n\t\tconst d = new Date(this.#date);\n\n\t\tswitch (unit) {\n\t\t\tcase 'year':\n\t\t\t\td.setFullYear(value);\n\t\t\t\tbreak;\n\t\t\tcase 'month':\n\t\t\t\td.setMonth(value);\n\t\t\t\tbreak;\n\t\t\tcase 'day':\n\t\t\t\td.setDate(value);\n\t\t\t\tbreak;\n\t\t\tcase 'week':\n\t\t\t\treturn this.setWeek(value);\n\t\t\tcase 'hour':\n\t\t\t\td.setHours(value);\n\t\t\t\tbreak;\n\t\t\tcase 'minute':\n\t\t\t\td.setMinutes(value);\n\t\t\t\tbreak;\n\t\t\tcase 'second':\n\t\t\t\td.setSeconds(value);\n\t\t\t\tbreak;\n\t\t\tcase 'millisecond':\n\t\t\t\td.setMilliseconds(value);\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn new Chronos(d).#withOrigin('set');\n\t}\n\n\t/**\n\t * @instance Returns the difference between this and another date in the given unit.\n\t * @param other The other date to compare.\n\t * @param unit The unit in which to return the difference.\n\t */\n\tdiff(other: ChronosInput, unit: TimeUnit): number {\n\t\tconst time = other instanceof Chronos ? other : new Chronos(other);\n\n\t\tconst msDiff = this.#date.getTime() - time.toDate().getTime();\n\n\t\tswitch (unit) {\n\t\t\tcase 'millisecond':\n\t\t\t\treturn msDiff;\n\t\t\tcase 'second':\n\t\t\t\treturn msDiff / 1e3;\n\t\t\tcase 'minute':\n\t\t\t\treturn msDiff / 6e4;\n\t\t\tcase 'hour':\n\t\t\t\treturn msDiff / 3.6e6;\n\t\t\tcase 'day':\n\t\t\t\treturn msDiff / 8.64e7;\n\t\t\tcase 'week':\n\t\t\t\treturn msDiff / 6.048e8;\n\t\t\tcase 'month':\n\t\t\t\treturn (\n\t\t\t\t\t(this.get('year') - time.get('year')) * 12 +\n\t\t\t\t\t(this.get('month') - time.get('month'))\n\t\t\t\t);\n\t\t\tcase 'year':\n\t\t\t\treturn this.get('year') - time.get('year');\n\t\t}\n\t}\n\n\t/**\n\t * @instance Returns a human-readable relative calendar time like \"Today at 3:00 PM\"\n\t * @param baseDate Optional base date to compare with.\n\t */\n\tcalendar(baseDate?: ChronosInput): string {\n\t\tconst base = baseDate ? new Chronos(baseDate) : new Chronos();\n\t\tconst input = this.startOf('day');\n\n\t\tconst comparison = base.startOf('day');\n\t\tconst diff = input.diff(comparison, 'day');\n\n\t\tconst timeStr = this.toDate().toLocaleString(undefined, {\n\t\t\thour: 'numeric',\n\t\t\tminute: '2-digit',\n\t\t});\n\n\t\tif (diff === 0) return `Today at ${timeStr}`;\n\t\tif (diff === 1) return `Tomorrow at ${timeStr}`;\n\t\tif (diff === -1) return `Yesterday at ${timeStr}`;\n\n\t\treturn this.toDate().toLocaleString(undefined, {\n\t\t\tmonth: 'long',\n\t\t\tday: '2-digit',\n\t\t\tyear: 'numeric',\n\t\t\tweekday: 'long',\n\t\t\thour: 'numeric',\n\t\t\tminute: '2-digit',\n\t\t});\n\t}\n\n\t/** @instance Returns a short human-readable string like \"2h ago\", \"in 5m\" */\n\tfromNowShort(): string {\n\t\tconst now = new Chronos();\n\t\tconst diffInSeconds = this.diff(now, 'second');\n\n\t\tconst abs = Math.abs(diffInSeconds);\n\n\t\tconst suffix = diffInSeconds >= 0 ? 'in ' : '';\n\t\tconst postfix = diffInSeconds < 0 ? ' ago' : '';\n\n\t\tif (abs < 60) {\n\t\t\treturn `${suffix}${Math.floor(abs)}s${postfix}`;\n\t\t} else if (abs < 3600) {\n\t\t\treturn `${suffix}${Math.floor(abs / 60)}m${postfix}`;\n\t\t} else if (abs < 86400) {\n\t\t\treturn `${suffix}${Math.floor(abs / 3600)}h${postfix}`;\n\t\t} else if (abs < 2592000) {\n\t\t\treturn `${suffix}${Math.floor(abs / 86400)}d${postfix}`;\n\t\t} else if (abs < 31536000) {\n\t\t\treturn `${suffix}${Math.floor(abs / 2592000)}mo${postfix}`;\n\t\t} else {\n\t\t\treturn `${suffix}${Math.floor(abs / 31536000)}y${postfix}`;\n\t\t}\n\t}\n\n\t/**\n\t * @instance Sets the date to the Monday of the specified ISO week number within the current year.\n\t * This method assumes ISO week logic, where week 1 is the week containing January 4th.\n\t *\n\t * @param week The ISO week number (1–53) to set the date to.\n\t * @returns A new Chronos instance set to the start (Monday) of the specified week.\n\t */\n\tsetWeek(week: number): Chronos {\n\t\tconst d = new Date(this.#date);\n\n\t\tconst year = d.getFullYear();\n\t\tconst jan4 = new Date(year, 0, 4);\n\t\tconst dayOfWeek = jan4.getDay() || 7; // Make Sunday (0) into 7\n\t\tconst weekStart = new Date(jan4);\n\t\tweekStart.setDate(jan4.getDate() - (dayOfWeek - 1)); // Move to Monday\n\n\t\tweekStart.setDate(weekStart.getDate() + (week - 1) * 7); // Move to target week\n\t\td.setFullYear(weekStart.getFullYear());\n\t\td.setMonth(weekStart.getMonth());\n\t\td.setDate(weekStart.getDate());\n\n\t\treturn new Chronos(d).#withOrigin('setWeek');\n\t}\n\n\t/**\n\t * @instance Calculates the ISO 8601 week number of the year.\n\t *\n\t * ISO weeks start on Monday, and the first week of the year is the one containing January 4th.\n\t *\n\t * @returns Week number (1–53).\n\t */\n\tgetWeek(): number {\n\t\tconst target = this.startOf('week', 1).add(3, 'day'); // Thursday of current ISO week\n\n\t\tconst firstThursday = new Chronos(target.year, 1, 4) // January 4\n\t\t\t.startOf('week', 1)\n\t\t\t.add(3, 'day'); // Thursday of first ISO week\n\n\t\treturn target.diff(firstThursday, 'week') + 1;\n\t}\n\n\t/**\n\t * @instance Calculates the week number of the year based on custom week start.\n\t * @param weekStartsOn Optional: Day the week starts on (0 = Sunday, 1 = Monday). Applicable if week day is required. Default is `0`.\n\t * @returns Week number (1-53).\n\t */\n\tgetWeekOfYear(weekStartsOn: number = 0): number {\n\t\tconst startOfYear = new Chronos(this.year, 1, 1);\n\t\tconst startOfFirstWeek = startOfYear.startOf('week', weekStartsOn);\n\n\t\tconst week = this.startOf('week', weekStartsOn).diff(\n\t\t\tstartOfFirstWeek,\n\t\t\t'week',\n\t\t);\n\n\t\treturn week + 1;\n\t}\n\n\t/**\n\t * @instance Returns the ISO week-numbering year for the current date.\n\t *\n\t * The ISO week-numbering year may differ from the calendar year.\n\t * For example, January 1st may fall in the last ISO week of the previous year.\n\t *\n\t * @param weekStartsOn Optional: Defines the start day of the week (0 = Sunday, 1 = Monday).\n\t * Defaults to 0 (Sunday). Use 1 for strict ISO 8601.\n\t * @returns The ISO week-numbering year.\n\t */\n\tgetWeekYear(weekStartsOn: number = 0): number {\n\t\tconst d = this.startOf('week', weekStartsOn).add(3, 'day'); // Thursday of current ISO week\n\t\treturn d.year;\n\t}\n\n\t/** @instance Returns day of year (1 - 366) */\n\tgetDayOfYear(): number {\n\t\tconst start = new Date(this.year, 0, 1);\n\t\tconst diff = this.#date.getTime() - start.getTime();\n\t\treturn Math.floor(diff / 86400000) + 1;\n\t}\n\n\t/**\n\t * @instance Returns the zodiac sign for the current date.\n\t * @returns The Western zodiac sign.\n\t */\n\tgetZodiacSign(): ZodiacSign {\n\t\tconst day = this.#date.getDate();\n\t\tconst month = this.#date.getMonth() + 1;\n\n\t\tfor (const [sign, [m, d]] of ZODIAC_SIGNS) {\n\t\t\tif (month === m && day <= d) {\n\t\t\t\treturn sign;\n\t\t\t}\n\t\t}\n\n\t\treturn 'Capricorn';\n\t}\n\n\t/** @instance Returns number of days in current month */\n\tdaysInMonth(): number {\n\t\treturn new Date(this.year, this.month + 1, 0).getDate();\n\t}\n\n\t/** @instance Converts to object with all date unit parts */\n\ttoObject(): ChronosObject {\n\t\treturn Object.fromEntries([...this]) as unknown as ChronosObject;\n\t}\n\n\t/** @instance Converts to array with all date unit parts */\n\ttoArray() {\n\t\treturn Object.values(this.toObject());\n\t}\n\n\t/**\n\t * @instance Returns the academic year based on a typical start in July and end in June.\n\t * @returns The academic year in format `YYYY-YYYY`.\n\t */\n\ttoAcademicYear(): `${number}-${number}` {\n\t\tconst year = this.#date.getFullYear();\n\t\tconst month = this.#date.getMonth();\n\t\tif (month >= 6) {\n\t\t\treturn `${year}-${year + 1}`;\n\t\t}\n\t\treturn `${year - 1}-${year}`;\n\t}\n\n\t/**\n\t * @instance Returns the **calendar quarter** (1 to 4) of the current date.\n\t *\n\t * @remarks\n\t * A calendar year is divided into four quarters:\n\t *\n\t * - `Q1`: January to March\n\t * - `Q2`: April to June\n\t * - `Q3`: July to September\n\t * - `Q4`: October to December\n\t *\n\t * This method strictly uses the **calendar year**. For fiscal quarters, use `toFiscalQuarter()` instead.\n\t *\n\t * @example\n\t * new Chronos('2025-02-14').toQuarter(); // 1\n\t * new Chronos('2025-08-09').toQuarter(); // 3\n\t *\n\t * @returns The calendar quarter number (1–4).\n\t */\n\ttoQuarter(): Quarter {\n\t\tconst month = this.#date.getMonth();\n\t\treturn (Math.floor(month / 3) + 1) as Quarter;\n\t}\n\n\t/**\n\t * @instance Returns the fiscal quarter based on custom fiscal year start (defaults to July).\n\t * @param startMonth - The fiscal year start month (1-12), default is July (7).\n\t * @returns The fiscal quarter (1-4).\n\t */\n\ttoFiscalQuarter(startMonth: number = 7): Quarter {\n\t\tconst month = this.#date.getMonth() + 1;\n\t\tconst adjusted = (month - startMonth + 12) % 12;\n\t\treturn (Math.floor(adjusted / 3) + 1) as Quarter;\n\t}\n\n\t/**\n\t * @instance Returns the system's current UTC offset formatted as `+06:00` or `-07:00`.\n\t *\n\t * - *Unlike `Date.prototype.getTimezoneOffset()`, which returns the offset in minutes **behind** UTC (positive for locations west of UTC and negative for east), this method returns the more intuitive sign format used in time zone representations (e.g., `UTC+06:00` means 6 hours **ahead** of UTC).*\n\t *\n\t * @returns The (local) system's UTC offset in `±HH:mm` format.\n\t */\n\tgetUTCOffset(): string {\n\t\tconst offset = -this.#date.getTimezoneOffset();\n\t\tconst sign = offset >= 0 ? '+' : '-';\n\n\t\tconst pad = (n: number) =>\n\t\t\tString(Math.floor(Math.abs(n))).padStart(2, '0');\n\n\t\treturn `${sign}${pad(offset / 60)}:${pad(offset % 60)}`;\n\t}\n\n\t/**\n\t * @instance Returns the timezone offset of this `Chronos` instance in `+06:00` or `-07:00` format maintaining current timezone.\n\t *\n\t * - *Unlike `Date.prototype.getTimezoneOffset()`, which returns the offset in minutes **behind** UTC (positive for locations west of UTC and negative for east), this method returns the more intuitive sign format used in time zone representations (e.g., `UTC+06:00` means 6 hours **ahead** of UTC).*\n\t *\n\t * @returns The timezone offset string in `±HH:mm` format maintaining the current timezone regardless of system having different one.\n\t */\n\tgetTimeZoneOffset(): string {\n\t\treturn this.#offset.replace('UTC', '');\n\t}\n\n\t/**\n\t * @instance Returns the system's UTC offset in minutes.\n\t *\n\t * - *Unlike JavaScript's `Date.prototype.getTimezoneOffset()`, this method returns a positive value if the local time is ahead of UTC, and negative if behind UTC.*\n\t *\n\t * For example, for `UTC+06:00`, this returns `360`; for `UTC-05:30`, this returns `-330`.\n\t *\n\t * @returns The system's UTC offset in minutes, matching the sign convention used in `±HH:mm`.\n\t */\n\tgetUTCOffsetMinutes(): number {\n\t\treturn -this.#date.getTimezoneOffset();\n\t}\n\n\t/**\n\t * @instance Returns the current `Chronos` instance's UTC offset in minutes.\n\t *\n\t * This reflects the parsed or stored offset used internally by Chronos and follows the same\n\t * sign convention: positive for timezones ahead of UTC, negative for behind.\n\t *\n\t * @returns The UTC offset in minutes maintaining the current timezone regardless of system having different one.\n\t */\n\tgetTimeZoneOffsetMinutes(): number {\n\t\treturn extractMinutesFromUTC(this.#offset);\n\t}\n\n\t/** @instance Returns new Chronos instance in UTC */\n\ttoUTC(): Chronos {\n\t\tif (this.#offset === 'UTC+00:00') {\n\t\t\treturn this.#withOrigin('toUTC');\n\t\t}\n\n\t\tconst date = this.#date;\n\n\t\tconst previousOffset = this.getTimeZoneOffsetMinutes();\n\n\t\tconst utc = new Date(date.getTime() - previousOffset * 60 * 1000);\n\n\t\treturn new Chronos(utc).#withOrigin('toUTC');\n\t}\n\n\t/** @instance Returns new Chronos instance in local time */\n\ttoLocal(): Chronos {\n\t\tconst previousOffset = this.getTimeZoneOffsetMinutes();\n\n\t\tconst localOffset = -this.#date.getTimezoneOffset();\n\n\t\tconst relativeOffset = previousOffset - localOffset;\n\n\t\tconst localTime = new Date(\n\t\t\tthis.#date.getTime() - relativeOffset * 60 * 1000,\n\t\t);\n\n\t\treturn new Chronos(localTime).#withOrigin('toLocal');\n\t}\n\n\t/**\n\t * @static Parses a date string with a given format (limited support only).\n\t *\n\t * * **Supported format tokens**:\n\t * - `YYYY`: Full year (e.g., 2023)\n\t * - `YY`: Two-digit year (e.g., 23 for 2023, 99 for 1999)\n\t * - `MM`: Month (01-12)\n\t * - `M`: Month (1-9)\n\t * - `DD`: Day of the month (01-31)\n\t * - `D`: Day of the month (1-9)\n\t * - `HH`: Hour (00-23)\n\t * - `H`: Hour (0-9)\n\t * - `mm`: Minute (00-59)\n\t * - `m`: Minute (0-9)\n\t * - `ss`: Second (00-59)\n\t * - `s`: Second (0-9)\n\t *\n\t * **Example**:\n\t * ```ts\n\t * Chronos.parse('23-12-31 15:30:45', 'YY-MM-DD HH:mm:ss');\n\t * // returns Chronos instance with the parsed date 2023-12-31T15:30:45\n\t * ```\n\t *\n\t * @param dateStr - The date string to be parsed\n\t * @param format - The format of the date string. Tokens like `YYYY`, `MM`, `DD`, `HH`, `mm`, `ss` are used to specify the structure.\n\t * @returns A new `Chronos` instance representing the parsed date.\n\t * @throws `Error` If the date string does not match the format.\n\t */\n\tstatic parse(dateStr: string, format: string): Chronos {\n\t\tconst tokenPatterns: Record<string, string> = {\n\t\t\tYYYY: '(?<YYYY>\\\\d{4})',\n\t\t\tYY: '(?<YY>\\\\d{2})',\n\t\t\tMM: '(?<MM>\\\\d{2})',\n\t\t\tM: '(?<M>\\\\d{1,2})',\n\t\t\tDD: '(?<DD>\\\\d{2})',\n\t\t\tD: '(?<D>\\\\d{1,2})',\n\t\t\tHH: '(?<HH>\\\\d{2})',\n\t\t\tH: '(?<H>\\\\d{1,2})',\n\t\t\tmm: '(?<mm>\\\\d{2})',\n\t\t\tm: '(?<m>\\\\d{1,2})',\n\t\t\tss: '(?<ss>\\\\d{2})',\n\t\t\ts: '(?<s>\\\\d{1,2})',\n\t\t};\n\n\t\tconst tokenToComponent: Record<string, keyof ChronosDateParts> = {\n\t\t\tYYYY: 'year',\n\t\t\tYY: 'year',\n\t\t\tMM: 'month',\n\t\t\tM: 'month',\n\t\t\tDD: 'date',\n\t\t\tD: 'date',\n\t\t\tHH: 'hour',\n\t\t\tH: 'hour',\n\t\t\tmm: 'minute',\n\t\t\tm: 'minute',\n\t\t\tss: 'second',\n\t\t\ts: 'second',\n\t\t};\n\n\t\ttype ChronosDateParts = {\n\t\t\tyear: number;\n\t\t\tmonth: number;\n\t\t\tdate: number;\n\t\t\thour: number;\n\t\t\tminute: number;\n\t\t\tsecond: number;\n\t\t};\n\n\t\tconst tokenRegex = new RegExp(\n\t\t\tObject.keys(tokenPatterns).join('|'),\n\t\t\t'g',\n\t\t);\n\n\t\tconst trimmedInput = dateStr.trim();\n\n\t\tconst regexStr = format\n\t\t\t.trim()\n\t\t\t.replace(tokenRegex, (token) => tokenPatterns[token] ?? token)\n\t\t\t.replace(/\\s+/g, '\\\\s*');\n\n\t\tconst match = new RegExp(`^${regexStr}\\\\s*$`).exec(trimmedInput);\n\n\t\tif (!match?.groups) {\n\t\t\tthrow new Error('Invalid date format');\n\t\t}\n\n\t\tconst parts: Partial<ChronosDateParts> = {};\n\n\t\tfor (const [token, value] of Object.entries(match.groups)) {\n\t\t\tconst key = tokenToComponent[token];\n\t\t\tif (key) {\n\t\t\t\tlet num = Number(value);\n\t\t\t\tif (token === 'YY') num += num < 100 ? 2000 : 0;\n\t\t\t\tparts[key] = num;\n\t\t\t}\n\t\t}\n\n\t\treturn new Chronos(\n\t\t\tnew Date(\n\t\t\t\tparts?.year ?? 1970,\n\t\t\t\t(parts?.month ?? 1) - 1,\n\t\t\t\tparts?.date ?? 1,\n\t\t\t\tparts?.hour ?? 0,\n\t\t\t\tparts?.minute ?? 0,\n\t\t\t\tparts?.second ?? 0,\n\t\t\t),\n\t\t).#withOrigin('parse');\n\t}\n\n\t/**\n\t * @instance Rounds the current date-time to the nearest specified unit and interval.\n\t *\n\t * - *Rounding is based on proximity to the start or end of the specified unit.*\n\t * - *For example, rounding `2025-05-23` by 'day' returns either midnight of May 23 or May 24, depending on the time of day.*\n\t *\n\t * @param unit - The time unit to round to (`year`, `month`, `week`, `day`, `hour`, `minute`, `second`, `millisecond`).\n\t * @param nearest - Optional granularity of rounding. (Defaults to `1`).\n\t *\n\t * @returns A new `Chronos` instance at the nearest rounded point in time. For wrong unit returns current instance.\n\t *\n\t * @remarks\n\t * - Rounding for `'month'` is based on how far into the month the date is. If past the midpoint, it rounds to the next month.\n\t * - Month indices are 0-based internally (January = 0), but the resulting date reflects the correct calendar month.\n\t * - For `'week'` unit, rounding is performed by comparing proximity to the start and end of the ISO week (Monday to Sunday).\n\t * - If the date is closer to the next Monday, it rounds forward; otherwise, it rounds back to the previous Monday.\n\t */\n\tround(unit: TimeUnit, nearest = 1): Chronos {\n\t\tconst date = new Date(this.#date);\n\n\t\tswitch (unit) {\n\t\t\tcase 'millisecond': {\n\t\t\t\tconst rounded = roundToNearest(date.getMilliseconds(), nearest);\n\n\t\t\t\tdate.setMilliseconds(rounded);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'second': {\n\t\t\t\tconst fullSecond =\n\t\t\t\t\tdate.getSeconds() + date.getMilliseconds() / 1000;\n\n\t\t\t\tconst rounded = roundToNearest(fullSecond, nearest);\n\t\t\t\tdate.setSeconds(rounded, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'minute': {\n\t\t\t\tconst fullMinute =\n\t\t\t\t\tdate.getMinutes() +\n\t\t\t\t\tdate.getSeconds() / 60 +\n\t\t\t\t\tdate.getMilliseconds() / 60000;\n\n\t\t\t\tconst rounded = roundToNearest(fullMinute, nearest);\n\t\t\t\tdate.setMinutes(rounded, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'hour': {\n\t\t\t\tconst fullHour =\n\t\t\t\t\tdate.getHours() +\n\t\t\t\t\tdate.getMinutes() / 60 +\n\t\t\t\t\tdate.getSeconds() / 3600 +\n\t\t\t\t\tdate.getMilliseconds() / 3600000;\n\n\t\t\t\tconst rounded = roundToNearest(fullHour, nearest);\n\t\t\t\tdate.setHours(rounded, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'day': {\n\t\t\t\tconst fullDay =\n\t\t\t\t\tdate.getDate() +\n\t\t\t\t\t(date.getHours() / 24 +\n\t\t\t\t\t\tdate.getMinutes() / 1440 +\n\t\t\t\t\t\tdate.getSeconds() / 86400 +\n\t\t\t\t\t\tdate.getMilliseconds() / 86400000);\n\n\t\t\t\tconst rounded = roundToNearest(fullDay, nearest);\n\t\t\t\tdate.setDate(rounded);\n\t\t\t\tdate.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'week': {\n\t\t\t\tconst weekday = this.#date.getDay(); // 0 (Sun) to 6 (Sat)\n\t\t\t\tconst offsetToMonday = (weekday + 6) % 7; // 0 for Mon, 1 for Tue, ..., 6 for Sun\n\n\t\t\t\tconst startOfWeek = new Date(this.#date);\n\t\t\t\tstartOfWeek.setDate(startOfWeek.getDate() - offsetToMonday);\n\t\t\t\tstartOfWeek.setHours(0, 0, 0, 0);\n\n\t\t\t\tconst endOfWeek = new Date(startOfWeek);\n\t\t\t\tendOfWeek.setDate(endOfWeek.getDate() + 7);\n\n\t\t\t\tconst diffToStart = Math.abs(\n\t\t\t\t\tthis.#date.getTime() - startOfWeek.getTime(),\n\t\t\t\t);\n\n\t\t\t\tconst diffToEnd = Math.abs(\n\t\t\t\t\tendOfWeek.getTime() - this.#date.getTime(),\n\t\t\t\t);\n\n\t\t\t\tconst rounded =\n\t\t\t\t\tdiffToEnd < diffToStart ? endOfWeek : startOfWeek;\n\n\t\t\t\treturn new Chronos(rounded).#withOrigin('round');\n\t\t\t}\n\n\t\t\tcase 'month': {\n\t\t\t\tconst fullMonth =\n\t\t\t\t\tdate.getMonth() + date.getDate() / this.lastDateOfMonth;\n\n\t\t\t\tconst roundedMonth = roundToNearest(fullMonth, nearest);\n\t\t\t\tdate.setMonth(roundedMonth, 1);\n\t\t\t\tdate.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'year': {\n\t\t\t\tconst dayOfYear = Math.floor(\n\t\t\t\t\t(date.getTime() -\n\t\t\t\t\t\tnew Date(date.getFullYear(), 0, 1).getTime()) /\n\t\t\t\t\t\t86400000,\n\t\t\t\t);\n\n\t\t\t\tconst isLeap =\n\t\t\t\t\tnew Date(date.getFullYear(), 1, 29).getDate() === 29;\n\n\t\t\t\tconst totalDays = isLeap ? 366 : 365;\n\t\t\t\tconst fullYear = date.getFullYear() + dayOfYear / totalDays;\n\t\t\t\tconst roundedYear = roundToNearest(fullYear, nearest);\n\t\t\t\tdate.setFullYear(roundedYear, 0, 1);\n\t\t\t\tdate.setHours(0, 0, 0, 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn this;\n\t\t}\n\n\t\treturn new Chronos(date).#withOrigin('round');\n\t}\n\n\t/**\n\t * @instance Returns the full time duration breakdown between current input (start) and another time (to).\n\t * @param toTime The time to compare with. Defaults to now.\n\t * @param absolute If true, returns all values as positive numbers. Defaults to `true`.\n\t * @returns An object of time units: years, months, days, hours, minutes, seconds, milliseconds.\n\t */\n\tduration(toTime?: ChronosInput, absolute = true): TimeDuration {\n\t\tconst now = this.#date;\n\t\tconst target = this.#toNewDate(toTime);\n\n\t\tconst isFuture = target > now;\n\t\tconst from = isFuture ? now : target;\n\t\tconst to = isFuture ? target : now;\n\n\t\tlet years = to.getFullYear() - from.getFullYear();\n\t\tlet months = to.getMonth() - from.getMonth();\n\t\tlet days = to.getDate() - from.getDate();\n\t\tlet hours = to.getHours() - from.getHours();\n\t\tlet minutes = to.getMinutes() - from.getMinutes();\n\t\tlet seconds = to.getSeconds() - from.getSeconds();\n\t\tlet milliseconds = to.getMilliseconds() - from.getMilliseconds();\n\n\t\tif (milliseconds < 0) {\n\t\t\tmilliseconds += 1000;\n\t\t\tseconds--;\n\t\t}\n\n\t\tif (seconds < 0) {\n\t\t\tseconds += 60;\n\t\t\tminutes--;\n\t\t}\n\n\t\tif (minutes < 0) {\n\t\t\tminutes += 60;\n\t\t\thours--;\n\t\t}\n\n\t\tif (hours < 0) {\n\t\t\thours += 24;\n\t\t\tdays--;\n\t\t}\n\n\t\tif (days < 0) {\n\t\t\tconst prevMonth = new Date(to.getFullYear(), to.getMonth(), 0);\n\t\t\tdays += prevMonth.getDate();\n\t\t\tmonths--;\n\t\t}\n\n\t\tif (months < 0) {\n\t\t\tmonths += 12;\n\t\t\tyears--;\n\t\t}\n\n\t\tconst result: TimeDuration = {\n\t\t\tyears,\n\t\t\tmonths,\n\t\t\tdays,\n\t\t\thours,\n\t\t\tminutes,\n\t\t\tseconds,\n\t\t\tmilliseconds,\n\t\t};\n\n\t\treturn this.#normalizeDuration(result, absolute, isFuture);\n\t}\n\n\t/**\n\t * @static Returns the current date and time in a specified format in local time.\n\t * * Default format is dd, `mmm DD, YYYY HH:mm:ss` = `Sun, Apr 06, 2025 16:11:55`\n\t * @param options - Configure format string and whether to format using utc offset.\n\t * @returns Formatted date string in desired format.\n\t */\n\tstatic today(options?: FormatOptions): string {\n\t\tconst { format = 'dd, mmm DD, YYYY HH:mm:ss', useUTC = false } =\n\t\t\toptions || {};\n\t\tconst today = new Date();\n\t\treturn new Chronos(today).#format(format, useUTC);\n\t}\n\n\t/**\n\t * @static Returns a new `Chronos` instance representing yesterday's date.\n\t *\n\t * @returns A `Chronos` instance for the previous calendar day.\n\t */\n\tstatic yesterday(): Chronos {\n\t\tconst today = new Date();\n\n\t\tconst yesterday = today.setDate(today.getDate() - 1);\n\n\t\treturn new Chronos(yesterday).#withOrigin('yesterday');\n\t}\n\n\t/**\n\t * @static Returns a new `Chronos` instance representing tomorrow's date.\n\t *\n\t * @returns A `Chronos` instance for the next calendar day.\n\t */\n\tstatic tomorrow(): Chronos {\n\t\tconst today = new Date();\n\n\t\tconst yesterday = today.setDate(today.getDate() + 1);\n\n\t\treturn new Chronos(yesterday).#withOrigin('tomorrow');\n\t}\n\n\t/**\n\t * @static Returns the number of milliseconds elapsed since midnight, January 1, 1970 Universal Coordinated Time (UTC).\n\t * * It basically calls `Date.now()`.\n\t * @returns The number of milliseconds elapsed since the Unix epoch.\n\t */\n\tstatic now(): number {\n\t\treturn Date.now();\n\t}\n\n\t/**\n\t * @static Creates a UTC-based Chronos instance.\n\t * If no date is provided, it uses the current date and time.\n\t *\n\t * **This is the base time, meaning conversion in other timezone will consider UTC time as the base time.**\n\t *\n\t * @param dateLike Optional input date to base the UTC time on.\n\t * If omitted, the current system date/time is used.\n\t * @returns A new Chronos instance representing the UTC equivalent of the input.\n\t */\n\tstatic utc(dateLike?: ChronosInput): Chronos {\n\t\tconst chronos = new Chronos(dateLike);\n\n\t\tif (chronos.#offset === 'UTC+00:00') {\n\t\t\treturn chronos.#withOrigin('utc');\n\t\t}\n\n\t\tconst previousOffset = chronos.getTimeZoneOffsetMinutes();\n\n\t\tconst date = chronos.#date;\n\n\t\tconst utc = new Date(date.getTime() - previousOffset * 60 * 1000);\n\n\t\treturn new Chronos(utc).#withOrigin('utc');\n\t}\n\n\t/**\n\t * @static Formats a time-only string into a formatted time string.\n\t *\n\t * @param time - Time string to be formatted. Supported formats include:\n\t * - `HH:mm` → e.g., `'14:50'`\n\t * - `HH:mm:ss` → e.g., `'14:50:00'`\n\t * - `HH:mm:ss.mss` → e.g., `'14:50:00.800'`\n\t * - `HH:mm+TimeZoneOffset(HH)` → e.g., `'14:50+06'`\n\t * - `HH:mm+TimeZoneOffset(HH:mm)` → e.g., `'14:50+06:00'`\n\t * - `HH:mm:ss+TimeZoneOffset(HH)` → e.g., `'14:50:00+06'`\n\t * - `HH:mm:ss+TimeZoneOffset(HH:mm)` → e.g., `'14:50:00+05:30'`\n\t * - `HH:mm:ss.mss+TimeZoneOffset(HH)` → e.g., `'14:50:00.800+06'`\n\t * - `HH:mm:ss.mss+TimeZoneOffset(HH:mm)` → e.g., `'14:50:00.800+06:30'`\n\t *\n\t * * *Input will default to today's date and assume local timezone if no offset is provided.*\n\t *\n\t * @param format - Format string accepted by `formatStrict()` method (`TimeParts`). Default: `hh:mm:ss a` → 02:33:36 pm.\n\t * @returns Formatted time string in local (System) time.\n\t */\n\tstatic formatTimePart(time: string, format?: TimeParts) {\n\t\tfunction normalizeOffset(timeStr: string): string {\n\t\t\treturn timeStr.replace(/([+-]\\d{2})(?!:)/, '$1:00');\n\t\t}\n\n\t\tconst timeWithDate = `${new Chronos().#format('YYYY-MM-DD')}T${normalizeOffset(\n\t\t\ttime,\n\t\t)}`;\n\n\t\treturn new Chronos(timeWithDate).formatStrict(format ?? 'hh:mm:ss a');\n\t}\n\n\t/**\n\t * @static Returns earliest Chronos\n\t * @param dates Date inputs.\n\t */\n\tstatic min(...dates: ChronosInput[]): Chronos {\n\t\treturn new Chronos(\n\t\t\tMath.min(...dates.map((d) => new Chronos(d).valueOf())),\n\t\t).#withOrigin('min');\n\t}\n\n\t/**\n\t * @static Returns latest Chronos\n\t * @param dates Date inputs.\n\t */\n\tstatic max(...dates: ChronosInput[]): Chronos {\n\t\treturn new Chronos(\n\t\t\tMath.max(...dates.map((d) => new Chronos(d).valueOf())),\n\t\t).#withOrigin('max');\n\t}\n\n\t/**\n\t * @static Checks if the year in the date string or year (from 0 - 9999) is a leap year.\n\t * - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.\n\t * - For example, 2000 and 2400 are leap years, but 1900 and 2100 are not.\n\t *\n\t * @description\n\t * This method accepts different types of date inputs and extracts the year to check if it's a leap year.\n\t * If the provided date is a `number`, it will be treated as a year (must be a valid year from 0 to 9999).\n\t * If the year is out of this range (negative or larger than 9999), it will be treated as a Unix timestamp.\n\t * If the provided date is a string or a `Date` object, it will be parsed and the year will be extracted.\n\t * If a `Chronos` instance is passed, the year will be directly accessed from the instance.\n\t *\n\t * @param date - A `number` (year or Unix timestamp), `string`, `Date`, or `Chronos` instance representing a date.\n\t * @returns `true` if the year is a leap year, `false` otherwise.\n\t */\n\tstatic isLeapYear(date: ChronosInput): boolean {\n\t\tlet year: number;\n\n\t\tif (typeof date === 'number') {\n\t\t\tif (date > 0 && date <= 9999) {\n\t\t\t\tyear = date;\n\t\t\t} else {\n\t\t\t\tyear = new Chronos(date).year;\n\t\t\t}\n\t\t} else {\n\t\t\tyear = date instanceof Chronos ? date.year : new Chronos(date).year;\n\t\t}\n\n\t\treturn isLeapYear(year);\n\t}\n\n\t/**\n\t * @static Checks if the given value is a valid `Date` object.\n\t * - A value is considered valid if it is an instance of the built-in `Date` class.\n\t * - This does not check whether the date itself is valid (e.g., `new Date('invalid')`).\n\t * @param value - The value to test.\n\t * @returns `true` if the value is a valid Date object, otherwise `false`.\n\t */\n\tstatic isValidDate(value: unknown): value is Date {\n\t\treturn value instanceof Date;\n\t}\n\n\t/**\n\t * @static Checks if the given value is a valid date string.\n\t * - A value is considered a valid date string if it is a string and can be parsed by `Date.parse()`.\n\t * - This uses the native JavaScript date parser internally.\n\t * @param value - The value to test.\n\t * @returns `true` if the value is a valid date string, otherwise `false`.\n\t */\n\tstatic isDateString(value: unknown): value is string {\n\t\treturn isString(value) && !isNaN(Date.parse(value));\n\t}\n\n\t/**\n\t * @static Checks if the given value is an instance of `Chronos`.\n\t * - Useful for verifying Chronos objects in type guards or validations.\n\t * @param value - The value to test.\n\t * @returns `true` if the value is an instance of `Chronos`, otherwise `false`.\n\t */\n\tstatic isValidChronos(value: unknown): value is Chronos {\n\t\treturn value instanceof Chronos;\n\t}\n}\n","import { Chronos } from '..';\nimport type { Any } from '../types';\nimport type { ChronosInput, ChronosStatics } from './types';\n\n/**\n * * Converts a date into a Chronos object and access to all `Chronos` methods and properties.\n *\n * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n *\n * @description\n * This function serves as a wrapper around the `Chronos` class constructor and allows you to create a new `Chronos` instance from various types of date representations.\n * The following types of input are supported:\n *\n * - **`string`**: A string representing a date, which can be parsed by the JavaScript `Date` constructor.\n * Example: `\"2023-12-31\"`.\n * - **`number`**: A timestamp representing the number of milliseconds since the Unix epoch.\n * Example: `1672531199000`.\n * - **`Date`**: A JavaScript `Date` object.\n * - **`Chronos`**: A `Chronos` instance created by the same constructor.\n * - **`year, month, date, hours, minutes, seconds, milliseconds`**: Individual components of a date-time to construct a `Chronos` instance.\n * - **`year`**: A number representing the year. If the year is between 0 and 99, it will be assumed to be the year 1900 + the provided year.\n * - **`month`**: A number between 1 and 12 representing the month (1 for January, 12 for December). It is adjusted internally to a 0-based index (0 for January, 11 for December).\n * - **`date`**: A number between 1 and 31 representing the day of the month.\n * - **`hours`**: A number between 0 and 23 representing the hour of the day.\n * - **`minutes`**: A number between 0 and 59 representing the minutes past the hour.\n * - **`seconds`**: A number between 0 and 59 representing the seconds past the minute.\n * - **`milliseconds`**: A number between 0 and 999 representing the milliseconds past the second.\n *\n * This function also allows you to access static methods from the `Chronos` class, as it copies all static methods from `Chronos` to the `chronos` function itself.\n * Therefore, static methods can be called either through the `Chronos` class directly or through the `chronos` function.\n *\n * @example\n * Example usage:\n *\n * ```ts\n * const chronosInstanceFn = chronos(\"2023-12-31\");\n * const chronosInstanceClass = new Chronos(\"2023-12-31\");\n * const sameInstanceFn = chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * const sameInstanceClass = Chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * ```\n *\n * @param valueOrYear The value in number, string, Date or Chronos format or the full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n * @param month The month as a number between 1 and 12 (January to December).\n * @param date The date as a number between 1 and 31.\n * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.\n * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.\n * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.\n * @param ms A number from 0 to 999 that specifies the milliseconds.\n *\n * @returns new `Chronos` instance representing the provided date with all methods and properties.\n *\n * @static\n * @remarks\n * Static methods can be accessed from both the `Chronos` class and the `chronos` function.\n * Static methods from the `Chronos` class are copied over to the `chronos` function, so you can call them like:\n * ```ts\n * chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * // Or\n * Chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * ```\n */\nconst chronos = ((\n\tvalueOrYear?: ChronosInput,\n\tmonth?: number,\n\tdate?: number,\n\thours?: number,\n\tminutes?: number,\n\tseconds?: number,\n\tms?: number,\n) => {\n\tlet newChronos: Chronos;\n\n\tif (typeof valueOrYear === 'number' && typeof month === 'number') {\n\t\tnewChronos = new Chronos(\n\t\t\tvalueOrYear,\n\t\t\tmonth,\n\t\t\tdate ?? 1,\n\t\t\thours ?? 0,\n\t\t\tminutes ?? 0,\n\t\t\tseconds ?? 0,\n\t\t\tms ?? 0,\n\t\t);\n\t} else {\n\t\tnewChronos = new Chronos(valueOrYear);\n\t}\n\n\treturn newChronos;\n}) as ChronosStatics;\n\n/**\n * @remarks\n * Static methods from the `Chronos` class are copied over to the `chronos` function.\n * Therefore, you can access static methods from `Chronos` both through the `Chronos` class and the `chronos` function.\n *\n * **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC\n * and convert it to the **equivalent local time** using the current environment's UTC offset.*\n *\n * Example usage:\n * ```ts\n * chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * // Or\n * Chronos.parse(\"2023-12-31\", \"YYYY-MM-DD\");\n * ```\n *\n * *No need to call `chronos` for accessing the static methods. Simply call the static methods.*\n *\n * **Available Static Methods:**\n *\n * ```ts\n * today(options?: FormatOptions): string\n * yesterday(): Chronos;\n * tomorrow(): Chronos\n * now(): number\n * parse(dateStr: string, format: string): Chronos\n * utc(dateLike: ChronosInput): Chronos\n * min(...dates: ChronosInput[]): Chronos\n * max(...dates: ChronosInput[]): Chronos\n * isLeapYear(date: ChronosInput): boolean\n * isValidDate(value: unknown): boolean\n * isDateString(value: unknown): boolean\n * isValidChronos(value: unknown): boolean\n * ```\n */\nconst typedChronos = chronos as ChronosStatics;\n\n// ? Add static methods from Chronos class to the chronos function\nObject.getOwnPropertyNames(Chronos).forEach((method) => {\n\t// Exclude non-method properties like `length`, `name`, `prototype`\n\tif (method !== 'prototype' && method !== 'name' && method !== 'length') {\n\t\t(chronos as Any)[method] = (Chronos as Any)[method];\n\t}\n});\n\nexport { typedChronos as chronos };\n","import type { OwnKeys } from '../types';\nimport type { FindOptions } from './types';\n\ntype KeySelector<T> =\n\t| Extract<OwnKeys<T>, string | number>\n\t| ((item: T) => string | number);\n\ntype CacheEntry<T> = { result: T[]; timestamp: number };\n\n/**\n * The `Finder` class performs optimized searching on arrays.\n * It supports binary search, fuzzy search, and smart caching with TTL.\n */\nexport class Finder<T> {\n\tstatic readonly #DEFAULT_TTL = 1000 * 60 * 5;\n\n\treadonly #cachedResult: Map<string, CacheEntry<T>> = new Map();\n\treadonly #sortedCache: Map<string, CacheEntry<T>> = new Map();\n\treadonly #ttl: number;\n\treadonly #items: T[];\n\n\t/**\n\t * * Creates a new `Finder` instance with a static array of items.\n\t *\n\t * @param data An array of items to initialize the search dataset.\n\t * @param ttl Optional time-to-live (in milliseconds) for cached search results. Defaults to {@link Finder.#DEFAULT_TTL 5 Minutes}.\n\t */\n\tconstructor(data: T[], ttl?: number);\n\n\t/**\n\t * * Creates a new `Finder` instance with a lazy-evaluated item provider.\n\t *\n\t * @param cb A function returning an array of items to initialize the search dataset.\n\t * @param ttl Time-to-live (in milliseconds) for cached search results. Defaults to {@link Finder.#DEFAULT_TTL 5 Minutes}.\n\t */\n\tconstructor(cb: () => T[], ttl?: number);\n\n\t/**\n\t * * Creates a new `Finder` instance.\n\t *\n\t * @param data The initial array of items or a callback returning them.\n\t * @param ttl Time-to-live (in milliseconds) for cached search results. Defaults to {@link Finder.#DEFAULT_TTL 5 Minutes}.\n\t */\n\tconstructor(data: T[] | (() => T[]), ttl: number = Finder.#DEFAULT_TTL) {\n\t\tthis.#ttl = ttl;\n\t\tthis.#items = typeof data === 'function' ? data() : data;\n\t}\n\n\t/**\n\t * @instance Clears cache globally or for a specific key.\n\t * @param key Optional key to clear only a specific cache entry.\n\t */\n\tclearCache(key?: string): void {\n\t\tif (key) {\n\t\t\tthis.#cachedResult.delete(key);\n\t\t} else {\n\t\t\tthis.#cachedResult.clear();\n\t\t}\n\t}\n\n\t/**\n\t * @instance Finds all items that match the provided matcher using optional caching or fuzzy logic.\n\t * @param matcher The value to match against.\n\t * @param keySelector Property key or selector function.\n\t * @param options Optional settings for search behavior and source list.\n\t */\n\tfindAll(\n\t\tmatcher: string | number,\n\t\tkeySelector: KeySelector<T>,\n\t\toptions?: FindOptions<T>,\n\t): T[] {\n\t\tconst {\n\t\t\tfuzzy = false,\n\t\t\tneedSorting = true,\n\t\t\tcacheKey = 'finder-cache',\n\t\t\tforceBinary = false,\n\t\t\tcaseInsensitive = true,\n\t\t\tdata,\n\t\t} = options ?? {};\n\n\t\tconst source =\n\t\t\ttypeof data === 'function' ? data() : (data ?? this.#items);\n\n\t\tif (!source?.length) return [];\n\n\t\tconst rawGetKey =\n\t\t\ttypeof keySelector === 'function' ? keySelector : (\n\t\t\t\t(item: T) => item[keySelector] as string | number\n\t\t\t);\n\n\t\tconst getKey = Finder.#createMemoizedKeyGetter(rawGetKey);\n\n\t\tconst normalizedMatcher =\n\t\t\tcaseInsensitive && typeof matcher === 'string' ?\n\t\t\t\tmatcher.toLowerCase()\n\t\t\t:\tmatcher;\n\n\t\tif (cacheKey) {\n\t\t\tconst entry = this.#cachedResult.get(cacheKey);\n\n\t\t\tif (entry && Date.now() - entry.timestamp < this.#ttl) {\n\t\t\t\treturn entry.result;\n\t\t\t} else {\n\t\t\t\tthis.#cachedResult.delete(cacheKey);\n\t\t\t}\n\t\t}\n\n\t\tlet results: T[] = [];\n\n\t\tif (source.length < 100 && !forceBinary) {\n\t\t\tresults = source.filter((item) => {\n\t\t\t\tconst key = getKey(item);\n\t\t\t\tconst value =\n\t\t\t\t\tcaseInsensitive && typeof key === 'string' ?\n\t\t\t\t\t\tkey.toLowerCase()\n\t\t\t\t\t:\tkey;\n\t\t\t\treturn value === normalizedMatcher;\n\t\t\t});\n\t\t} else {\n\t\t\tconst sorted =\n\t\t\t\tneedSorting ?\n\t\t\t\t\tthis.#sortAndCache(source, getKey, cacheKey)\n\t\t\t\t:\tsource;\n\n\t\t\tconst firstMatch = this.binarySearch(\n\t\t\t\tsorted,\n\t\t\t\tnormalizedMatcher,\n\t\t\t\tgetKey,\n\t\t\t\tcaseInsensitive,\n\t\t\t);\n\n\t\t\tif (firstMatch) {\n\t\t\t\tconst baseKey = getKey(firstMatch);\n\n\t\t\t\tconst base =\n\t\t\t\t\tcaseInsensitive && typeof baseKey === 'string' ?\n\t\t\t\t\t\tbaseKey.toLowerCase()\n\t\t\t\t\t:\tbaseKey;\n\n\t\t\t\tresults = sorted.filter((item) => {\n\t\t\t\t\tconst key = getKey(item);\n\n\t\t\t\t\tconst value =\n\t\t\t\t\t\tcaseInsensitive && typeof key === 'string' ?\n\t\t\t\t\t\t\tkey.toLowerCase()\n\t\t\t\t\t\t:\tkey;\n\n\t\t\t\t\treturn value === base;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (!results.length && fuzzy && typeof normalizedMatcher === 'string') {\n\t\t\tresults = source.filter((item) => {\n\t\t\t\tconst rawKey = getKey(item);\n\n\t\t\t\tconst key =\n\t\t\t\t\tcaseInsensitive && typeof rawKey === 'string' ?\n\t\t\t\t\t\trawKey.toLowerCase()\n\t\t\t\t\t:\tString(rawKey);\n\n\t\t\t\treturn this.#match(key, normalizedMatcher);\n\t\t\t});\n\t\t}\n\n\t\tif (cacheKey) {\n\t\t\tthis.#cachedResult.set(cacheKey, {\n\t\t\t\tresult: results,\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t});\n\t\t}\n\n\t\treturn results;\n\t}\n\n\t/**\n\t * @instance Finds first matching item that matches the provided matcher using optional caching or fuzzy logic.\n\t * @param matcher The value to match.\n\t * @param keySelector Property key or selector function.\n\t * @param options Optional behavior flags and item source.\n\t */\n\tfindOne(\n\t\tmatcher: string | number,\n\t\tkeySelector: KeySelector<T>,\n\t\toptions?: FindOptions<T>,\n\t): T | undefined {\n\t\tconst {\n\t\t\tfuzzy = false,\n\t\t\tneedSorting = true,\n\t\t\tcacheKey = 'finder-cache',\n\t\t\tforceBinary = false,\n\t\t\tcaseInsensitive = true,\n\t\t\tdata,\n\t\t} = options ?? {};\n\n\t\tconst source =\n\t\t\ttypeof data === 'function' ? data() : (data ?? this.#items);\n\n\t\tif (!source?.length) return undefined;\n\n\t\tconst rawGetKey =\n\t\t\ttypeof keySelector === 'function' ? keySelector : (\n\t\t\t\t(item: T) => item[keySelector] as string | number\n\t\t\t);\n\n\t\tconst getKey = Finder.#createMemoizedKeyGetter(rawGetKey);\n\n\t\tconst normalizedMatcher =\n\t\t\tcaseInsensitive && typeof matcher === 'string' ?\n\t\t\t\tmatcher.toLowerCase()\n\t\t\t:\tmatcher;\n\n\t\tif (cacheKey) {\n\t\t\tconst entry = this.#cachedResult.get(cacheKey);\n\n\t\t\tif (entry && Date.now() - entry.timestamp < this.#ttl) {\n\t\t\t\treturn entry.result[0];\n\t\t\t} else {\n\t\t\t\tthis.#cachedResult.delete(cacheKey);\n\t\t\t}\n\t\t}\n\n\t\tlet result: T | undefined;\n\n\t\tif (source?.length < 100 && !forceBinary) {\n\t\t\tresult = source?.find((item) => {\n\t\t\t\tconst key = getKey(item);\n\t\t\t\tconst value =\n\t\t\t\t\tcaseInsensitive && typeof key === 'string' ?\n\t\t\t\t\t\tkey.toLowerCase()\n\t\t\t\t\t:\tkey;\n\t\t\t\treturn value === normalizedMatcher;\n\t\t\t});\n\t\t} else {\n\t\t\tresult = this.binarySearch(\n\t\t\t\tneedSorting ?\n\t\t\t\t\tthis.#sortAndCache(source, getKey, cacheKey)\n\t\t\t\t:\tsource,\n\t\t\t\tnormalizedMatcher,\n\t\t\t\tgetKey,\n\t\t\t\tcaseInsensitive,\n\t\t\t);\n\t\t}\n\n\t\tif (!result && fuzzy && typeof normalizedMatcher === 'string') {\n\t\t\treturn this.fuzzySearch(\n\t\t\t\tsource,\n\t\t\t\tnormalizedMatcher,\n\t\t\t\tgetKey,\n\t\t\t\tcaseInsensitive,\n\t\t\t);\n\t\t}\n\n\t\tif (cacheKey && result) {\n\t\t\tthis.#cachedResult.set(cacheKey, {\n\t\t\t\tresult: [result],\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t});\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * @instance Asynchronous variant of `findAll` that accepts a promise-based data supplier.\n\t * @param supplier Async function resolving the items list.\n\t * @param matcher The value to match.\n\t * @param keySelector Property key or selector function.\n\t * @param options Optional settings for search behavior and cache.\n\t */\n\tasync findAllAsync(\n\t\tsupplier: () => Promise<T[]>,\n\t\tmatcher: string | number,\n\t\tkeySelector: KeySelector<T>,\n\t\toptions?: Omit<FindOptions<T>, 'items'>,\n\t): Promise<T[]> {\n\t\tconst items = await supplier();\n\n\t\treturn this.findAll(matcher, keySelector, { ...options, data: items });\n\t}\n\n\t/**\n\t * @instance Asynchronous variant of `findOne`.\n\t * @param supplier Async function resolving the items list.\n\t * @param matcher The value to match.\n\t * @param keySelector Property key or selector function.\n\t * @param options Optional settings for behavior and cache.\n\t */\n\tasync findOneAsync(\n\t\tsupplier: () => Promise<T[]>,\n\t\tmatcher: string | number,\n\t\tkeySelector: KeySelector<T>,\n\t\toptions?: Omit<FindOptions<T>, 'items'>,\n\t): Promise<T | undefined> {\n\t\tconst items = await supplier();\n\n\t\treturn this.findOne(matcher, keySelector, { ...options, data: items });\n\t}\n\n\t/**\n\t * @instance Performs a binary search on a sorted array using a custom key selector.\n\t *\n\t * @param sorted - The sorted array of items to search.\n\t * @param matcher - The value to search for.\n\t * @param keySelector - A function that extracts the comparable key from each item.\n\t * @param caseInsensitive - Whether to compare string keys ignoring case.\n\t * @returns The first matching item if found; otherwise, undefined.\n\t */\n\tbinarySearch(\n\t\tsorted: T[],\n\t\tmatcher: string | number,\n\t\tkeySelector: (item: T) => string | number,\n\t\tcaseInsensitive: boolean,\n\t): T | undefined {\n\t\tlet min = 0,\n\t\t\tmax = sorted?.length - 1;\n\n\t\twhile (min <= max) {\n\t\t\tconst mid = Math.floor((min + max) / 2);\n\t\t\tconst midKey = keySelector(sorted[mid]);\n\t\t\tconst key =\n\t\t\t\tcaseInsensitive && typeof midKey === 'string' ?\n\t\t\t\t\tmidKey.toLowerCase()\n\t\t\t\t:\tmidKey;\n\n\t\t\tif (key === matcher) return sorted[mid];\n\t\t\tif (key < matcher) min = mid + 1;\n\t\t\telse max = mid - 1;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * @instance Performs a fuzzy search on an array by matching characters in sequence.\n\t *\n\t * @param array - The array of items to search.\n\t * @param matcher - The fuzzy search string to match against.\n\t * @param keySelector - A function that extracts the key to search from each item.\n\t * @param caseInsensitive - Whether to compare ignoring case for string values.\n\t * @returns The first fuzzy-matching item if found; otherwise, undefined.\n\t */\n\tfuzzySearch(\n\t\tarray: T[],\n\t\tmatcher: string,\n\t\tkeySelector: (item: T) => string | number,\n\t\tcaseInsensitive: boolean,\n\t): T | undefined {\n\t\tfor (const item of array) {\n\t\t\tconst rawKey = keySelector(item);\n\t\t\tconst key =\n\t\t\t\tcaseInsensitive && typeof rawKey === 'string' ?\n\t\t\t\t\trawKey.toLowerCase()\n\t\t\t\t:\tString(rawKey);\n\t\t\tif (this.#match(key, matcher)) return item;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * @private Checks if the characters in the target string appear in order within the source string.\n\t * @param source Source string to search within.\n\t * @param target Target string to match against the source string.\n\t * @returns True if the target string is a fuzzy match within the source string; otherwise, false.\n\t */\n\t#match(source: string, target: string): boolean {\n\t\tlet i = 0;\n\n\t\tfor (const char of target) {\n\t\t\ti = source?.indexOf(char, i);\n\t\t\tif (i === -1) return false;\n\t\t\ti++;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * @private Sorts an array and caches the result for a specified time-to-live (TTL).\n\t * @param data Data to sort and cache.\n\t * @param getKey Key extraction function.\n\t * @param cacheKey Optional cache key for storing the result.\n\t * @returns\n\t */\n\t#sortAndCache(\n\t\tdata: T[],\n\t\tgetKey: (item: T) => string | number,\n\t\tcacheKey?: string,\n\t) {\n\t\tif (cacheKey) {\n\t\t\tconst entry = this.#sortedCache.get(cacheKey);\n\n\t\t\tif (entry && Date.now() - entry.timestamp < this.#ttl) {\n\t\t\t\treturn entry.result;\n\t\t\t} else {\n\t\t\t\tthis.#sortedCache.delete(cacheKey);\n\t\t\t}\n\t\t}\n\n\t\tconst sorted = [...data].sort((a, b) => {\n\t\t\tconst keyA = getKey(a);\n\t\t\tconst keyB = getKey(b);\n\t\t\treturn (\n\t\t\t\tkeyA < keyB ? -1\n\t\t\t\t: keyA > keyB ? 1\n\t\t\t\t: 0\n\t\t\t);\n\t\t});\n\n\t\tif (cacheKey) {\n\t\t\tthis.#sortedCache.set(cacheKey, {\n\t\t\t\tresult: sorted,\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t});\n\t\t}\n\n\t\treturn sorted;\n\t}\n\n\t/**\n\t * @static @private Creates a memoized version of a key extractor.\n\t * @param getKey Original key extraction function\n\t */\n\tstatic #createMemoizedKeyGetter<T>(\n\t\tgetKey: (item: T) => string | number,\n\t): (item: T) => string | number {\n\t\tconst cache = new Map<T, string | number>();\n\n\t\treturn (item: T): string | number => {\n\t\t\tif (cache.has(item)) return cache.get(item)!;\n\t\t\tconst key = getKey(item);\n\t\t\tcache.set(item, key);\n\t\t\treturn key;\n\t\t};\n\t}\n}\n","import { isNumber } from '../guards/primitives';\nimport type { GenericObject } from '../object/types';\nimport { isDeepEqual } from '../utils';\nimport type { FieldValue, Option, OptionsConfig } from './types';\n\n/**\n * * Converts an array of objects into a formatted array of options.\n *\n * @param data - An array of objects to convert into options.\n * @param config - The configuration object to specify the keys for the `value` (firstFieldName) and `label` (secondFieldName) fields and rename as needed.\n * @returns An array of options, where each option has `value` and `label` fields as default or as specified by user in the config options.\n */\nexport function createOptionsArray<\n\tT extends GenericObject,\n\tK1 extends string = 'value',\n\tK2 extends string = 'label',\n\tV extends boolean = false,\n>(\n\tdata: T[],\n\tconfig: OptionsConfig<T, K1, K2, V>,\n): Array<{ [P in K1 | K2]: FieldValue<P, T, K1, K2, V> }> {\n\tconst {\n\t\tfirstFieldKey,\n\t\tsecondFieldKey,\n\t\tfirstFieldName = 'value' as K1,\n\t\tsecondFieldName = 'label' as K2,\n\t\tretainNumberValue = false,\n\t} = config || {};\n\n\tif (data && data?.length) {\n\t\treturn data?.map((datum) => {\n\t\t\tconst firstValue =\n\t\t\t\tretainNumberValue && isNumber(datum[firstFieldKey]) ?\n\t\t\t\t\tdatum[firstFieldKey]\n\t\t\t\t:\tString(datum[firstFieldKey] ?? '');\n\n\t\t\treturn {\n\t\t\t\t[firstFieldName]: firstValue,\n\t\t\t\t[secondFieldName]: String(datum[secondFieldKey] ?? ''),\n\t\t\t};\n\t\t}) as Array<Option<T, K1, K2, V>>;\n\t} else {\n\t\treturn [] as Array<Option<T, K1, K2, V>>;\n\t}\n}\n\n/**\n * * Removes duplicate values from an array, supporting deep comparison for objects and arrays.\n *\n * @param array - The array from which duplicates need to be removed.\n * @returns A new array with duplicates removed.\n */\nexport function removeDuplicatesFromArray<T>(array: T[]): T[] {\n\treturn array?.filter(\n\t\t(item, index, self) =>\n\t\t\tindex === self?.findIndex((el) => isDeepEqual(el, item)),\n\t);\n}\n\n/**\n * * Finds duplicate values in an array, runs deep comparison for objects and arrays.\n *\n * @param array - The array in which to find duplicates.\n * @returns An array containing all duplicate entries (each one only once).\n */\nexport function getDuplicates<T>(array: T[]): T[] {\n\tconst seen: T[] = [];\n\tconst duplicates: T[] = [];\n\n\tfor (const item of array) {\n\t\tconst hasSeen = seen?.find((el) => isDeepEqual(el, item));\n\t\tconst hasDuplicate = duplicates?.find((el) => isDeepEqual(el, item));\n\n\t\tif (hasSeen && !hasDuplicate) {\n\t\t\tduplicates?.push(item);\n\t\t} else if (!hasSeen) {\n\t\t\tseen?.push(item);\n\t\t}\n\t}\n\n\treturn duplicates;\n}\n\n/**\n * * Finds elements missing from one array compared to another using deep comparison.\n *\n * @param options - Configuration to specify which array to compare and direction of check.\n * @returns An array of missing elements based on the comparison direction.\n */\n\n/**\n * * Finds elements missing from one array compared to another using deep comparison.\n *\n * @param array1 The first array to compare.\n * @param array2 The second array to compare.\n * @param missingFrom Which direction to compare for missing values:.\n *\t\t\t\t\t - `'from-first'` → values in `array1` missing in `array2`.\n *\t\t\t\t\t - `'from-second'` → values in `array2` missing in `array1`.\n * @returns An array of missing elements based on the comparison direction.\n */\nexport function findMissingElements<T, U>(\n\tarray1: T[],\n\tarray2: U[],\n\tmissingFrom: 'from-first' | 'from-second',\n): (T | U)[] {\n\tconst source = (missingFrom === 'from-first' ? array1 : array2) ?? [];\n\tconst target = (missingFrom === 'from-first' ? array2 : array1) ?? [];\n\n\treturn source.filter((s) => !target?.some((t) => isDeepEqual(t, s)));\n}\n\n/**\n * * Splits an array into chunks of a given size.\n *\n * @param arr The array to split.\n * @param chunkSize The size of each chunk.\n * @returns An array of chunked arrays.\n */\nexport function splitArray<T>(arr: T[], chunkSize: number): T[][] {\n\tconst result: T[][] = [];\n\n\tfor (let i = 0; i < arr?.length; i += chunkSize) {\n\t\tresult.push(arr.slice(i, i + chunkSize));\n\t}\n\n\treturn result;\n}\n\n/**\n * * Rotates an array left or right by a given number of steps.\n *\n * @param arr The array to rotate.\n * @param steps The number of positions to rotate (positive: right, negative: left).\n * @returns The rotated array.\n */\nexport function rotateArray<T>(arr: T[], steps: number): T[] {\n\tconst length = arr?.length;\n\n\tif (length === 0) return arr;\n\n\tconst offset = ((steps % length) + length) % length;\n\n\treturn arr.slice(-offset).concat(arr.slice(0, -offset));\n}\n\n/**\n * * Moves an element within an array from one index to another.\n *\n * @param arr The array to modify.\n * @param fromIndex The index of the element to move.\n * @param toIndex The new index for the element.\n * @returns A new array with the element moved.\n */\nexport function moveArrayElement<T>(\n\tarr: T[],\n\tfromIndex: number,\n\ttoIndex: number,\n): T[] {\n\tconst newArr = [...arr];\n\n\tconst [item] = newArr.splice(fromIndex, 1);\n\n\tnewArr.splice(toIndex, 0, item);\n\n\treturn newArr;\n}\n","import type { CustomFile, FileUpload, OriginFileObj } from './types';\n\n/**\n * * Checks if a given value is a valid `FormData` & it's not empty.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `FormData` and not empty, otherwise `false`.\n */\nexport function isValidFormData(value: unknown): value is FormData {\n\tif (!(value instanceof FormData)) return false;\n\n\tif ('entries' in value) {\n\t\tif (typeof value.entries !== 'function') {\n\t\t\tconsole.warn('`FormData.entries()` is not supported!');\n\t\t\treturn false;\n\t\t}\n\n\t\treturn Array.from(value.entries())?.length > 0;\n\t}\n\n\treturn false;\n}\n\n/**\n * * Checks if a given value is an `OriginFileObj`.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `OriginFileObj`, otherwise `false`.\n */\nexport function isOriginFileObj(value: unknown): value is OriginFileObj {\n\tif (typeof value !== 'object' || value === null || Array.isArray(value)) {\n\t\treturn false;\n\t}\n\n\tconst obj = value as Record<string, unknown>;\n\n\treturn typeof obj.uid === 'string';\n}\n\n/**\n * * Checks if a given value is a `CustomFile`.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `CustomFile`, otherwise `false`.\n */\nexport function isCustomFile(value: unknown): value is CustomFile {\n\tif (typeof value !== 'object' || value === null || Array.isArray(value)) {\n\t\treturn false;\n\t}\n\n\tconst obj = value as Record<string, unknown>;\n\n\treturn 'originFileObj' in obj && isOriginFileObj(obj.originFileObj);\n}\n\n/**\n * * Checks if a given value is an array of `CustomFile` objects.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `CustomFile[]`, otherwise `false`.\n */\nexport function isCustomFileArray(value: unknown): value is CustomFile[] {\n\treturn (\n\t\tArray.isArray(value) && value?.length > 0 && value?.every(isCustomFile)\n\t);\n}\n\n/**\n * * Checks if a given value is an array of `File/Blob` objects.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `File[]` or `Blob[]`, otherwise `false`.\n */\nexport function isFileArray(value: unknown): value is File[] | Blob[] {\n\treturn (\n\t\tArray.isArray(value) && value?.length > 0 && value?.every(isFileOrBlob)\n\t);\n}\n\n/**\n * * Checks if a given value is an instance of `FileList`.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `FileList`, otherwise `false`.\n */\nexport function isFileList(value: unknown): value is FileList {\n\treturn typeof FileList !== 'undefined' && value instanceof FileList;\n}\n\n/**\n * * Checks if a given value is an instance of `File` or `Blob`.\n * @param value - The value to check.\n * @returns `true` if the value is an instance of `File` or `Blob`, otherwise `false`.\n */\nexport function isFileOrBlob(value: unknown): value is File | Blob {\n\treturn (\n\t\t(typeof File !== 'undefined' && value instanceof File) ||\n\t\t(typeof Blob !== 'undefined' && value instanceof Blob)\n\t);\n}\n\n/**\n * * Checks if a given value is a `FileUpload` object.\n * @param value - The value to check.\n * @returns `true` if the value is a valid `FileUpload`, otherwise `false`.\n */\nexport function isFileUpload(value: unknown): value is FileUpload {\n\tif (typeof value !== 'object' || value === null || Array.isArray(value)) {\n\t\treturn false;\n\t}\n\n\tconst obj = value as Record<string, unknown>;\n\n\treturn (\n\t\t('file' in obj && isCustomFile(obj.file)) ||\n\t\t('fileList' in obj && isCustomFileArray(obj.fileList))\n\t);\n}\n","import { isDateLike } from '../date/guards';\nimport {\n\tisEmptyObject,\n\tisNotEmptyObject,\n\tisValidArray,\n} from '../guards/non-primitives';\nimport { isNonEmptyString } from '../guards/primitives';\nimport type {\n\tDotNotationKey,\n\tGenericObject,\n\tKeyForObject,\n} from '../object/types';\nimport {\n\tisCustomFile,\n\tisCustomFileArray,\n\tisFileArray,\n\tisFileList,\n\tisFileOrBlob,\n\tisFileUpload,\n} from './guards';\nimport type { FormDataConfigs } from './types';\n\n/**\n * * Utility to convert object into FormData in a controlled way.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n *\n * @param data - The source object to control and convert to FormData.\n * @param configs - Configuration options to control the formData.\n * @returns `FormData` instance containing the sanitized and transformed data.\n */\nexport const createControlledFormData = <T extends GenericObject>(\n\tdata: T,\n\tconfigs?: FormDataConfigs<T>,\n): FormData => {\n\tconst formData = new FormData();\n\n\tconst { stringifyNested = '*' } = configs || {};\n\n\t/** - Helper to check if a key should be lowercase */\n\tconst shouldLowercaseKeys = (key: string) => {\n\t\treturn Array.isArray(configs?.lowerCaseKeys) ?\n\t\t\t\tconfigs?.lowerCaseKeys?.some(\n\t\t\t\t\t(path) => key === path || key.startsWith(`${path}.`),\n\t\t\t\t)\n\t\t\t:\tconfigs?.lowerCaseKeys === '*';\n\t};\n\n\t/** - Helper to check if a key should be lowercase */\n\tconst shouldLowercaseValue = (key: string) => {\n\t\treturn Array.isArray(configs?.lowerCaseValues) ?\n\t\t\t\tconfigs.lowerCaseValues?.some(\n\t\t\t\t\t(path) => key === path || key?.startsWith(`${path}.`),\n\t\t\t\t)\n\t\t\t:\tconfigs?.lowerCaseValues === '*';\n\t};\n\n\t/** - Transforms key to lowercase if needed */\n\tconst _transformKey = (key: string) => {\n\t\treturn shouldLowercaseKeys(key) ? key.toLowerCase() : key;\n\t};\n\n\t/** - Helper function to check if a key matches a breakArray key. */\n\tconst isRequiredKey = (key: string) => {\n\t\tconst transformedKey = _transformKey(key);\n\n\t\treturn Array.isArray(configs?.requiredKeys) ?\n\t\t\t\tconfigs?.requiredKeys?.some(\n\t\t\t\t\t(path) =>\n\t\t\t\t\t\ttransformedKey === path ||\n\t\t\t\t\t\ttransformedKey?.startsWith(`${path}.`),\n\t\t\t\t)\n\t\t\t:\tconfigs?.requiredKeys === '*';\n\t};\n\n\t/** - Helper function to check if a key matches a dotNotation path to preserve. */\n\tconst shouldDotNotate = (key: string) => {\n\t\tconst transformedKey = _transformKey(key);\n\n\t\treturn Array.isArray(configs?.dotNotateNested) ?\n\t\t\t\tconfigs.dotNotateNested.includes(\n\t\t\t\t\ttransformedKey as KeyForObject<T>,\n\t\t\t\t)\n\t\t\t:\tconfigs?.dotNotateNested === '*';\n\t};\n\n\t/** - Helper function to check if a key matches a stringifyNested key. */\n\tconst shouldStringify = (key: string) => {\n\t\tconst transformedKey = _transformKey(key);\n\n\t\treturn Array.isArray(stringifyNested) ?\n\t\t\t\tstringifyNested.includes(transformedKey as KeyForObject<T>)\n\t\t\t:\tstringifyNested === '*';\n\t};\n\n\t/** - Helper function to check if a key matches a breakArray key. */\n\tconst shouldBreakArray = (key: string) => {\n\t\tconst transformedKey = _transformKey(key);\n\n\t\treturn Array.isArray(configs?.breakArray) ?\n\t\t\t\tconfigs.breakArray.includes(transformedKey as KeyForObject<T>)\n\t\t\t:\tconfigs?.breakArray === '*';\n\t};\n\n\t/** - Helper to clean object by removing null/undefined/empty values while respecting required keys */\n\tconst _cleanObject = (\n\t\tobj: GenericObject,\n\t\tparentKey = '',\n\t): GenericObject => {\n\t\treturn Object.entries(obj).reduce((acc, [key, value]) => {\n\t\t\tconst transformedKey = _transformKey(key);\n\n\t\t\tconst fullKey =\n\t\t\t\tparentKey ? `${parentKey}.${transformedKey}` : transformedKey;\n\n\t\t\t// * Skip ignored keys (don't include them in the cleaned object)\n\t\t\tif (configs?.ignoreKeys?.includes(fullKey as DotNotationKey<T>)) {\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\tconst isNotNullish = value != null && value !== '';\n\n\t\t\t// * Keep value if:\n\t\t\t// * 1. It's required OR\n\t\t\t// * 2. It's not null/undefined AND not empty string/object/array\n\t\t\tconst shouldKeep =\n\t\t\t\tisRequiredKey(fullKey) ||\n\t\t\t\tisNotNullish ||\n\t\t\t\tisNonEmptyString(value) ||\n\t\t\t\tisValidArray(value) ||\n\t\t\t\tisNotEmptyObject(value);\n\n\t\t\tif (shouldKeep) {\n\t\t\t\tif (isNotEmptyObject(value)) {\n\t\t\t\t\t// * Recursively clean nested objects\n\t\t\t\t\tconst cleaned = _cleanObject(value, fullKey);\n\n\t\t\t\t\tif (isRequiredKey(fullKey) || isNotEmptyObject(cleaned)) {\n\t\t\t\t\t\tacc[transformedKey] = cleaned;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (typeof value === 'string') {\n\t\t\t\t\t\tacc[transformedKey] = value?.toLowerCase();\n\t\t\t\t\t} else if (Array.isArray(value)) {\n\t\t\t\t\t\tif (isRequiredKey(fullKey) || isValidArray(value)) {\n\t\t\t\t\t\t\tacc[transformedKey] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (isEmptyObject(value)) {\n\t\t\t\t\t\tif (isRequiredKey(fullKey)) {\n\t\t\t\t\t\t\tacc[transformedKey] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tacc[transformedKey] = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, {} as GenericObject);\n\t};\n\n\t/** * Helper function to add values to formData */\n\tconst _addToFormData = (key: string, value: unknown) => {\n\t\tconst transformedKey = _transformKey(key);\n\n\t\tif (isCustomFileArray(value)) {\n\t\t\tvalue?.forEach((file) =>\n\t\t\t\tformData.append(transformedKey, file?.originFileObj),\n\t\t\t);\n\t\t} else if (isFileUpload(value)) {\n\t\t\tif (value?.fileList) {\n\t\t\t\tvalue?.fileList.forEach((file) =>\n\t\t\t\t\tformData.append(transformedKey, file?.originFileObj),\n\t\t\t\t);\n\t\t\t} else if (value?.file) {\n\t\t\t\tif (isCustomFile(value?.file)) {\n\t\t\t\t\tformData.append(transformedKey, value?.file?.originFileObj);\n\t\t\t\t} else {\n\t\t\t\t\tformData.append(transformedKey, value?.file);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isFileOrBlob(value)) {\n\t\t\tformData.append(transformedKey, value);\n\t\t} else if (isFileList(value)) {\n\t\t\tfor (let i = 0; i < value?.length; i++) {\n\t\t\t\tformData.append(transformedKey, value.item(i)!);\n\t\t\t}\n\t\t} else if (Array.isArray(value)) {\n\t\t\tif (isFileArray(value)) {\n\t\t\t\tif (shouldBreakArray(key)) {\n\t\t\t\t\tvalue?.forEach((item, index) => {\n\t\t\t\t\t\t_addToFormData(`${transformedKey}[${index}]`, item);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tvalue?.forEach((item) => {\n\t\t\t\t\t\tformData.append(transformedKey, item);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (isValidArray(value)) {\n\t\t\t\tif (shouldBreakArray(key)) {\n\t\t\t\t\tvalue?.forEach((item, index) => {\n\t\t\t\t\t\t_addToFormData(`${transformedKey}[${index}]`, item);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tformData.append(transformedKey, JSON.stringify(value));\n\t\t\t\t}\n\t\t\t} else if (isRequiredKey(key)) {\n\t\t\t\tformData.append(transformedKey, JSON.stringify(value));\n\t\t\t}\n\t\t} else if (isDateLike(value)) {\n\t\t\tformData.append(transformedKey, JSON.parse(JSON.stringify(value)));\n\t\t} else if (isNotEmptyObject(value)) {\n\t\t\tif (shouldStringify(key) && !shouldDotNotate(key)) {\n\t\t\t\t// * Clean object before stringifying, preserving required keys\n\t\t\t\tconst cleanedValue = _cleanObject(value, key);\n\n\t\t\t\tif (isNotEmptyObject(cleanedValue) || isRequiredKey(key)) {\n\t\t\t\t\tformData.append(\n\t\t\t\t\t\ttransformedKey,\n\t\t\t\t\t\tJSON.stringify(cleanedValue),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tObject.entries(value).forEach(([nestedKey, nestedValue]) => {\n\t\t\t\t\t_addToFormData(`${key}.${nestedKey}`, nestedValue);\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tconst isNotNullish = value != null && value !== '';\n\n\t\t\tif (isNotNullish || isRequiredKey(key)) {\n\t\t\t\tif (typeof value === 'string' && shouldLowercaseValue(key)) {\n\t\t\t\t\tformData.append(transformedKey, value?.toLowerCase());\n\t\t\t\t} else {\n\t\t\t\t\t// ! CONFUSED UNGA-BUNGA\n\t\t\t\t\tformData.append(transformedKey, value as Blob);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t/** - Helper to process object */\n\tconst _processObject = (obj: GenericObject, parentKey = '') => {\n\t\tObject.entries(obj).forEach(([key, value]) => {\n\t\t\tconst transformedKey = _transformKey(key);\n\n\t\t\tconst fullKey =\n\t\t\t\tparentKey ? `${parentKey}.${transformedKey}` : transformedKey;\n\n\t\t\t// * Skip keys that are in ignoreKeys\n\t\t\tif (configs?.ignoreKeys?.includes(fullKey as DotNotationKey<T>)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// * Trim string values if trimStrings is enabled\n\t\t\tif (configs?.trimStrings && typeof value === 'string') {\n\t\t\t\tvalue = value?.trim();\n\t\t\t}\n\n\t\t\t// * Check if this key is preserved as dot-notation\n\t\t\tif (shouldDotNotate(fullKey)) {\n\t\t\t\t_addToFormData(fullKey, value);\n\t\t\t} else if (isNotEmptyObject(value) && !shouldStringify(fullKey)) {\n\t\t\t\t// * Process nested objects\n\t\t\t\t_processObject(value, key);\n\t\t\t} else if (isFileOrBlob(value)) {\n\t\t\t\t_addToFormData(key, value);\n\t\t\t} else if (isDateLike(value)) {\n\t\t\t\t_addToFormData(key, JSON.parse(JSON.stringify(value)));\n\t\t\t} else if (isEmptyObject(value)) {\n\t\t\t\tif (isRequiredKey(fullKey)) {\n\t\t\t\t\t_addToFormData(key, JSON.stringify(value));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// * For other cases, just append as key-value\n\t\t\t\t_addToFormData(key, value);\n\t\t\t}\n\t\t});\n\t};\n\n\tif (isNotEmptyObject(data)) {\n\t\t_processObject(data);\n\t}\n\n\treturn formData;\n};\n","import {\n\tisArrayOfType,\n\tisNotEmptyObject,\n\tisObject,\n} from '../guards/non-primitives';\nimport { isString } from '../guards/primitives';\nimport { trimString } from '../string/basics';\nimport type { Any, FlattenPartial, PartialOrRequired } from '../types';\nimport type { DotNotationKey, GenericObject, SanitizeOptions } from './types';\n\n/**\n * * Trims all the words in a string.\n *\n * @param input String to sanitize.\n * @returns Sanitized string .\n */\nexport function sanitizeData(input: string): string;\n\n/**\n * * Trims all the words in an array of strings.\n *\n * @param input Array of strings to sanitize.\n * @returns Sanitized array of strings.\n */\nexport function sanitizeData(input: string[]): string[];\n\n/**\n * * Sanitizes an object by ignoring specified keys and trimming string values based on options provided.\n * * Also excludes nullish values (`null`, `undefined`), falsy (`nullish` + `0` & `\"\"`) or empty values (`object`, `array`) if specified.\n *\n * @param object - The object to sanitize.\n * @param options - Options that define which keys to ignore, whether to trim string values, and whether to exclude nullish, falsy or empty values.\n * @param _return - By default return type is as it is, passing this parameter `true` makes the return type `Partial<T>`.\n * @returns A new object with the specified modifications.\n */\nexport function sanitizeData<\n\tT extends GenericObject,\n\tB extends PartialOrRequired = 'required',\n>(\n\tobject: T,\n\toptions?: SanitizeOptions<T>,\n\t_return?: B,\n): B extends 'partial' ? FlattenPartial<T> : T;\n\n/**\n * * Sanitizes a deeply nested array that may contain arrays, objects or other (mixed) data types.\n * * Preserves structure while removing empty values and trimming strings and other operations.\n *\n * @param array - A mixed array that may contain arrays, objects or other data types.\n * @param options - Options to trim and filter values.\n * @param _return - By default return type is as it is, passing this parameter `partial` makes the return type `Partial<T>`.\n * @returns A new sanitized array with the specified modifications.\n */\nexport function sanitizeData<\n\tT extends GenericObject,\n\tB extends PartialOrRequired = 'required',\n>(\n\tarray: T[],\n\toptions?: SanitizeOptions<T>,\n\t_return?: B,\n): B extends 'partial' ? FlattenPartial<T>[] : T[];\n\n/**\n * * Sanitizes a string, array of strings, an object or array of objects by ignoring specified keys and trimming string values.\n * * Also excludes nullish values (null, undefined) if specified. Always ignores empty nested object(s).\n *\n * @param input - The string, object or array of strings or objects to sanitize.\n * @param options - Options for processing.\n * @param _return - By default return type is as it is, passing this parameter `partial` makes the return type `Partial<T>`.\n * @returns A new string, object or array of strings or objects with the specified modifications.\n */\nexport function sanitizeData<\n\tT extends GenericObject,\n\tB extends PartialOrRequired = 'required',\n>(\n\tinput: string | string[] | T | T[],\n\toptions?: SanitizeOptions<T>,\n\t_return?: B,\n):\n\t| string\n\t| string[]\n\t| (B extends 'partial' ? FlattenPartial<T> : T)\n\t| (B extends 'partial' ? FlattenPartial<T>[] : T[]) {\n\tconst {\n\t\tkeysToIgnore = [],\n\t\trequiredKeys = [],\n\t\ttrimStrings = true,\n\t\tignoreNullish = false,\n\t\tignoreFalsy = false,\n\t\tignoreEmpty = false,\n\t} = options || {};\n\n\t// Flatten the object keys and use the keys for comparison\n\tconst ignoreKeySet = new Set(keysToIgnore);\n\n\t/**\n\t * * Determines if a key is required\n\t * @param key The key to check.\n\t * @returns `true` if the key is required, otherwise `false`.\n\t */\n\tconst isRequiredKey = (key: string) => {\n\t\treturn Array.isArray(requiredKeys) ?\n\t\t\t\trequiredKeys?.some(\n\t\t\t\t\t(path) => key === path || key.startsWith(`${path}.`),\n\t\t\t\t)\n\t\t\t:\trequiredKeys === '*';\n\t};\n\n\t/**\n\t * * Check if a value is an object and determines whether it should skip based on `ignoreEmpty` flag.\n\t * @param obj Object value to check.\n\t * @returns `true` if the object is skippable, otherwise `false`.\n\t */\n\tconst _skipObject = (obj: unknown): boolean => {\n\t\treturn ignoreEmpty && isObject(obj) && !isNotEmptyObject(obj);\n\t};\n\n\t/**\n\t * * Recursively process an array and its nested content(s).\n\t * @param arr Array to process.\n\t * @param path Full path as dot notation if needed.\n\t * @returns Processed array.\n\t */\n\tconst _processArray = (arr: unknown[], path: string): unknown[] => {\n\t\treturn arr\n\t\t\t?.map((item) => {\n\t\t\t\tif (isString(item) && trimStrings) {\n\t\t\t\t\treturn trimString(item);\n\t\t\t\t}\n\n\t\t\t\tif (Array.isArray(item)) {\n\t\t\t\t\t// Recursive sanitize\n\t\t\t\t\treturn _processArray(item, path);\n\t\t\t\t}\n\n\t\t\t\tif (isObject(item)) {\n\t\t\t\t\treturn _processObject(item as T, path);\n\t\t\t\t}\n\n\t\t\t\treturn item;\n\t\t\t})\n\t\t\t?.filter((v) => {\n\t\t\t\tif (ignoreNullish && v == null) return false;\n\t\t\t\tif (ignoreFalsy && !v) return false;\n\t\t\t\tif (_skipObject(v) && !isRequiredKey(path)) return false;\n\t\t\t\treturn true;\n\t\t\t});\n\t};\n\n\t/**\n\t * * Helper function to process a single object.\n\t *\n\t * @param object The object to process.\n\t * @param parentPath The parent path of a key.\n\t * */\n\tconst _processObject = (object: T, parentPath = '') =>\n\t\tObject.entries(object).reduce((acc, [key, value]) => {\n\t\t\t// Compute the full key path\n\t\t\tconst fullKeyPath = parentPath ? `${parentPath}.${key}` : key;\n\n\t\t\t// Skip ignored keys\n\t\t\tif (ignoreKeySet.has(fullKeyPath as DotNotationKey<T>)) {\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\t// Exclude nullish values if specified\n\t\t\tif (ignoreNullish && !isRequiredKey(fullKeyPath) && value == null) {\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\t// Exclude falsy values `0`, `false`, `null` and `undefined`\n\t\t\tif (ignoreFalsy && !value && !isRequiredKey(fullKeyPath)) {\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\tif (isString(value) && trimStrings) {\n\t\t\t\t// Trim string values if enabled\n\t\t\t\tacc[key as keyof T] = trimString(value) as T[keyof T];\n\t\t\t} else if (value && isObject(value)) {\n\t\t\t\t// Recursively process nested objects\n\t\t\t\tconst processedValue = _processObject(value as T, fullKeyPath);\n\t\t\t\t// Add the property conditionally if it's not an empty object\n\t\t\t\tif (\n\t\t\t\t\t!ignoreEmpty ||\n\t\t\t\t\tisRequiredKey(fullKeyPath) ||\n\t\t\t\t\tisNotEmptyObject(processedValue)\n\t\t\t\t) {\n\t\t\t\t\tacc[key as keyof T] = processedValue as T[keyof T];\n\t\t\t\t}\n\t\t\t} else if (value && Array.isArray(value)) {\n\t\t\t\t// Keep file arrays untouched\n\t\t\t\t// if (isFileArray(value) || isCustomFileArray(value)) {\n\t\t\t\t// \tacc[key as keyof T] = value as T[keyof T];\n\t\t\t\t// }\n\t\t\t\tconst processedArray = _processArray(value, fullKeyPath);\n\n\t\t\t\tif (\n\t\t\t\t\t!ignoreEmpty ||\n\t\t\t\t\tisRequiredKey(fullKeyPath) ||\n\t\t\t\t\tprocessedArray?.length > 0\n\t\t\t\t) {\n\t\t\t\t\tacc[key as keyof T] = processedArray as T[keyof T];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Add other values untouched\n\t\t\t\tacc[key as keyof T] = value as T[keyof T];\n\t\t\t}\n\n\t\t\treturn acc;\n\t\t}, {} as T);\n\n\t// Process strings\n\tif (isString(input)) {\n\t\treturn trimString(input);\n\t}\n\n\t// Process array of strings and objects\n\tif (Array.isArray(input)) {\n\t\t// Process array of strings\n\t\tif (isArrayOfType(input, isString)) {\n\t\t\treturn trimString(input);\n\t\t}\n\n\t\t// * Handle arrays with nested strings/arrays/objects\n\t\treturn input\n\t\t\t?.map((item) => sanitizeData(item, options, _return))\n\t\t\t?.filter((val) => {\n\t\t\t\tif (ignoreNullish && val == null) return false;\n\t\t\t\tif (ignoreFalsy && !val) return false;\n\t\t\t\tif (_skipObject(val)) return false;\n\n\t\t\t\treturn true;\n\t\t\t}) as B extends 'partial' ? FlattenPartial<T>[] : T[];\n\t}\n\n\t// Process object\n\tif (isObject(input)) {\n\t\treturn _processObject(input) as B extends 'partial' ? FlattenPartial<T>\n\t\t:\tT;\n\t}\n\n\treturn input;\n}\n\n/**\n * * Parse an object of stringified values into their appropriate primitive types.\n *\n * @description\n * - Attempts to convert string values into `boolean`, `number`, or JSON-parsed objects/arrays.\n * - Non-string values except arrays/objects are left unchanged. Nested arrays/objects are parsed recursively.\n *\n * @param object - The object with potentially stringified primitive values.\n * @param parseNested - Whether to convert stringified primitives in nested arrays/objects. (default: `true`).\n * @returns A new object with parsed values converted to their original types.\n */\nexport function parseObjectValues<T extends GenericObject>(\n\tobject: T,\n\tparseNested = true,\n): { [K in keyof T]: Any } {\n\tfunction _deepParseValues(data: unknown): unknown {\n\t\tif (Array.isArray(data)) {\n\t\t\treturn data?.map(_deepParseValues);\n\t\t} else if (isNotEmptyObject(data)) {\n\t\t\tconst result: Record<string, unknown> = {};\n\n\t\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\t\tresult[key] = parseNested ? _deepParseValues(value) : value;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t} else if (isString(data)) {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(data);\n\n\t\t\t\treturn _deepParseValues(parsed);\n\t\t\t} catch {\n\t\t\t\tif (data === 'true') return true;\n\t\t\t\telse if (data === 'false') {\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (data === 'null') {\n\t\t\t\t\treturn null;\n\t\t\t\t} else if (data === 'undefined') {\n\t\t\t\t\treturn undefined;\n\t\t\t\t} else if (!isNaN(Number(data))) {\n\t\t\t\t\treturn Number(data);\n\t\t\t\t} else return data;\n\t\t\t}\n\t\t}\n\t\treturn data;\n\t}\n\n\tconst parsedBody: GenericObject = {};\n\n\tif (isNotEmptyObject(object)) {\n\t\tObject.entries(object)?.forEach(([key, value]) => {\n\t\t\tparsedBody[key] = _deepParseValues(value);\n\t\t});\n\t}\n\n\treturn parsedBody as { [K in keyof T]: Any };\n}\n","import {\n\tisEmptyObject,\n\tisNotEmptyObject,\n\tisObject,\n} from '../guards/non-primitives';\nimport type { Any, FlattenPartial } from '../types';\nimport { isDeepEqual } from '../utils';\nimport { parseObjectValues } from './sanitize';\nimport type { GenericObject } from './types';\n\n/**\n * * Deeply merge two or more objects using `Map`.\n *\n * @param objects Objects to merge.\n * @returns Merged object.\n */\nexport const mergeObjects = <T extends GenericObject>(...objects: T[]): T => {\n\tconst map = new Map<string, Any>();\n\n\tobjects?.forEach((obj) => {\n\t\tfor (const key in obj) {\n\t\t\tconst existingValue = map.get(key);\n\n\t\t\tif ((obj[key] as T) instanceof Object && !Array.isArray(obj[key])) {\n\t\t\t\t// If the key already exists in the map and both are objects, merge them\n\t\t\t\tif (\n\t\t\t\t\texistingValue &&\n\t\t\t\t\texistingValue instanceof Object &&\n\t\t\t\t\t!Array.isArray(existingValue)\n\t\t\t\t) {\n\t\t\t\t\tmap.set(\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tmergeObjects(\n\t\t\t\t\t\t\texistingValue as GenericObject,\n\t\t\t\t\t\t\tobj[key] as GenericObject,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise, just set the value\n\t\t\t\t\tmap.set(key, obj[key]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If it's not an object, just set the value\n\t\t\t\tmap.set(key, obj[key]);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst result = {} as T;\n\n\tmap?.forEach((value, key) => {\n\t\tresult[key as keyof T] = value as T[keyof T];\n\t});\n\n\treturn result;\n};\n\n/**\n * * Deeply merge objects and flatten nested objects.\n * * Useful for flattening a single object or merging multiple objects with duplicate key(s).\n * * If keys are duplicated, the last object's value will be used.\n *\n * @param objects Objects to merge.\n * @returns Merged object with flattened structure.\n */\nexport const mergeAndFlattenObjects = <T extends GenericObject>(\n\t...objects: T[]\n): GenericObject => {\n\tconst map = new Map<string, unknown>();\n\n\tconst _flattenObject = (obj: GenericObject, parentKey: keyof T = '') => {\n\t\tfor (const key in obj) {\n\t\t\tconst newKey = parentKey ? `${String(parentKey)}.${key}` : key;\n\t\t\tif (obj[key] instanceof Object && !Array.isArray(obj[key])) {\n\t\t\t\t// Recursively flatten nested objects\n\t\t\t\t_flattenObject(obj[key] as GenericObject, newKey);\n\t\t\t} else {\n\t\t\t\t// Set the flattened key\n\t\t\t\tmap.set(newKey, obj[key]);\n\t\t\t}\n\t\t}\n\t};\n\n\tobjects?.forEach((obj) => _flattenObject(obj));\n\n\tconst result = {} as T;\n\n\tmap?.forEach((value, key) => {\n\t\tresult[key as keyof T] = value as T[keyof T];\n\t});\n\n\treturn result;\n};\n\n/**\n * * Flattens a nested object into key-value format.\n *\n * @param object - The `object` to flatten.\n * @returns A `flattened object` in key-value format.\n */\nexport const flattenObjectKeyValue = <T extends GenericObject>(\n\tobject: T,\n): T => {\n\tconst flattened: GenericObject = {};\n\n\tfor (const [key, value] of Object.entries(object)) {\n\t\tif (\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t!Array.isArray(value)\n\t\t) {\n\t\t\t// Recursively flatten nested objects\n\t\t\tconst nestedFlattened = flattenObjectKeyValue(value);\n\t\t\tObject.assign(flattened, nestedFlattened);\n\t\t} else {\n\t\t\t// Directly assign non-object values\n\t\t\tflattened[key] = value;\n\t\t}\n\t}\n\n\treturn flattened as T;\n};\n\n/**\n * * Flattens a nested object into a dot notation format.\n *\n * @param object - The `object` to flatten.\n * @returns A `flattened object` with dot notation keys.\n */\nexport const flattenObjectDotNotation = <T extends GenericObject>(\n\tobject: T,\n): GenericObject => {\n\t/**\n\t * * Recursively flattens an object, transforming nested structures into dot-notation keys.\n\t *\n\t * @param source - The `object` to be flattened.\n\t * @param prefix - The prefix to prepend to each key. Used for nested objects.\n\t * @returns A flattened version of the input object.\n\t */\n\tconst _flattenObject = (source: T, prefix: keyof T = ''): GenericObject => {\n\t\tconst flattened: GenericObject = {};\n\n\t\tfor (const [key, value] of Object.entries(source)) {\n\t\t\t// Construct the dot-notation key\n\t\t\tconst newKey = prefix ? `${String(prefix)}.${key}` : key;\n\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\ttypeof value === 'object' &&\n\t\t\t\t!Array.isArray(value) &&\n\t\t\t\tvalue !== null\n\t\t\t) {\n\t\t\t\t// Recursively process nested objects\n\t\t\t\tObject.assign(flattened, _flattenObject(value as T, newKey));\n\t\t\t} else {\n\t\t\t\t// Directly assign non-object values\n\t\t\t\tflattened[newKey] = value;\n\t\t\t}\n\t\t}\n\n\t\treturn flattened;\n\t};\n\n\t// Call the recursive function with an empty prefix initially\n\treturn _flattenObject(object);\n};\n\n/**\n * * Extracts only the fields that have changed between the original and updated object.\n *\n * @param baseObject The original object to compare against.\n * @param updatedObject The modified object containing potential updates.\n * @returns A new object containing only the changed fields.\n */\nexport const extractUpdatedFields = <T extends GenericObject>(\n\tbaseObject: T,\n\tupdatedObject: FlattenPartial<T>,\n): FlattenPartial<T> => {\n\tconst updatedFields: FlattenPartial<T> = {};\n\n\tfor (const key in updatedObject) {\n\t\tif (\n\t\t\tkey in baseObject &&\n\t\t\t!isDeepEqual(updatedObject[key], baseObject[key])\n\t\t) {\n\t\t\tif (updatedObject[key] && isNotEmptyObject(updatedObject[key])) {\n\t\t\t\tupdatedFields[key] = extractUpdatedFields(\n\t\t\t\t\tbaseObject[key],\n\t\t\t\t\tupdatedObject[key] as FlattenPartial<T>,\n\t\t\t\t) as T[keyof T];\n\n\t\t\t\tif (updatedFields[key] && isEmptyObject(updatedFields[key])) {\n\t\t\t\t\tdelete updatedFields[key];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tupdatedFields[key] = updatedObject[key];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn updatedFields;\n};\n\n/**\n * * Extracts only new fields that exist in updatedObject but not in baseObject.\n *\n * @param baseObject The original object to compare against.\n * @param updatedObject The modified object containing potential new fields.\n * @returns A new object containing only the new fields.\n */\nexport const extractNewFields = <\n\tT extends GenericObject,\n\tU extends GenericObject,\n>(\n\tbaseObject: T,\n\tupdatedObject: FlattenPartial<T> & FlattenPartial<U>,\n): FlattenPartial<U> => {\n\tconst newFields: FlattenPartial<U> = {};\n\n\tfor (const key in updatedObject) {\n\t\tif (!(key in baseObject)) {\n\t\t\t// Directly assign new fields\n\t\t\tnewFields[key as keyof FlattenPartial<U>] = updatedObject[key];\n\t\t} else if (\n\t\t\tisNotEmptyObject(updatedObject[key]) &&\n\t\t\tisNotEmptyObject(baseObject[key])\n\t\t) {\n\t\t\t// Recursively extract new fields inside nested objects\n\t\t\tconst nestedNewFields = extractNewFields(\n\t\t\t\tbaseObject[key] as T,\n\t\t\t\tupdatedObject[key] as FlattenPartial<T> & FlattenPartial<U>,\n\t\t\t);\n\n\t\t\tif (isNotEmptyObject(nestedNewFields)) {\n\t\t\t\tnewFields[key as keyof FlattenPartial<U>] =\n\t\t\t\t\tnestedNewFields as T[keyof T];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newFields;\n};\n\n/**\n * * Extracts changed fields from the updated object while also identifying newly added keys.\n *\n * @param baseObject The original object to compare against.\n * @param updatedObject The modified object containing potential updates.\n * @returns An object containing modified fields and new fields separately.\n */\nexport const extractUpdatedAndNewFields = <\n\tT extends GenericObject,\n\tU extends GenericObject,\n>(\n\tbaseObject: T,\n\tupdatedObject: FlattenPartial<T> & FlattenPartial<U>,\n): FlattenPartial<T> & FlattenPartial<U> => {\n\tconst updatedFields: FlattenPartial<T> = {};\n\tconst newFields: FlattenPartial<U> = {};\n\n\tfor (const key in updatedObject) {\n\t\tif (!(key in baseObject)) {\n\t\t\tnewFields[key as keyof FlattenPartial<U>] = updatedObject[key];\n\t\t} else if (!isDeepEqual(updatedObject[key], baseObject[key])) {\n\t\t\tif (updatedObject[key] && isNotEmptyObject(updatedObject[key])) {\n\t\t\t\tupdatedFields[key as keyof T] = extractUpdatedAndNewFields(\n\t\t\t\t\tbaseObject[key] as T,\n\t\t\t\t\tupdatedObject[key],\n\t\t\t\t) as T[keyof T];\n\n\t\t\t\tif (updatedFields[key] && isEmptyObject(updatedFields[key])) {\n\t\t\t\t\tdelete updatedFields[key];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tupdatedFields[key as keyof T] = updatedObject[key];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { ...updatedFields, ...newFields };\n};\n\n/**\n * * Safely parses a JSON string into an object.\n * * Optionally converts stringified primitive values inside the object (e.g., `\"0\"` → `0`, `\"true\"` → `true`, `\"null\"` → `null`).\n *\n * @param value - The JSON string to parse.\n * @param parsePrimitives - Whether to convert stringified primitives into real values (default: `true`).\n * @returns A parsed object with primitive conversions, or an empty object on failure or if the root is not a valid object.\n * - Returns `{}` if parsing fails, such as when the input is malformed or invalid JSON or passing single quoted string.\n *\n * - **N.B.** This function will return an empty object if the JSON string is invalid or if the root element is not an object.\n *\n * - *Unlike `parseJSON`, which returns any valid JSON structure (including arrays, strings, numbers, etc.),\n * this function strictly ensures that the result is an object and optionally transforms stringified primitives.*\n *\n * @see parseJSON - For parsing generic JSON values (arrays, numbers, etc.) with optional primitive transformation.\n *\n */\nexport const parseJsonToObject = <T extends GenericObject = GenericObject>(\n\tvalue: string,\n\tparsePrimitives = true,\n): T => {\n\ttry {\n\t\tconst data = JSON.parse(value) as T;\n\n\t\tif (!isObject(data)) {\n\t\t\treturn {} as T;\n\t\t}\n\n\t\treturn parsePrimitives ? parseObjectValues<T>(data) : data;\n\t} catch {\n\t\treturn {} as T;\n\t}\n};\n","import { flattenObjectKeyValue } from '../object/objectify';\nimport { parseObjectValues } from '../object/sanitize';\nimport type { QueryObject, StrictObject } from '../object/types';\nimport type { QueryString } from '../string/types';\nimport { deepParsePrimitives } from '../utils';\n\n/**\n * * Utility to generate query parameters from an object.\n *\n * @param params - Object containing query parameters.\n * @returns A query string as a URL-encoded string, e.g., `?key1=value1&key2=value2`.\n *\n * @example\n * generateQueryParams({ key1: 'value1', key2: 42 }); // \"?key1=value1&key2=42\"\n * generateQueryParams({ key1: ['value1', 'value2'], key2: 42 }); // \"?key1=value1&key1=value2&key2=42\"\n * generateQueryParams({ key1: '', key2: null }); // \"\"\n * generateQueryParams({ key1: true, key2: false }); // \"?key1=true&key2=false\"\n * generateQueryParams({ filters: { category: 'laptop', price: 1000 } }); // \"?category=laptop&price=1000\"\n */\nexport const generateQueryParams = <T extends QueryObject>(\n\tparams: T = {} as T,\n): QueryString => {\n\t// Flatten the nested object into key-value pairs\n\tconst flattenedParams = flattenObjectKeyValue(params);\n\n\t// Generate the query string\n\tconst queryParams = Object.entries(flattenedParams)\n\t\t?.filter(\n\t\t\t([_, value]) =>\n\t\t\t\tvalue !== undefined &&\n\t\t\t\tvalue !== null &&\n\t\t\t\t!(typeof value === 'string' && value?.trim() === ''),\n\t\t)\n\t\t?.flatMap(([key, value]) =>\n\t\t\tArray.isArray(value) ?\n\t\t\t\tvalue\n\t\t\t\t\t?.filter(\n\t\t\t\t\t\t(v) =>\n\t\t\t\t\t\t\tv !== undefined &&\n\t\t\t\t\t\t\tv !== null &&\n\t\t\t\t\t\t\t!(typeof v === 'string' && v.trim() === ''),\n\t\t\t\t\t)\n\t\t\t\t\t?.map(\n\t\t\t\t\t\t(v) =>\n\t\t\t\t\t\t\t`${encodeURIComponent(key)}=${encodeURIComponent(\n\t\t\t\t\t\t\t\ttypeof v === 'boolean' ? String(v) : String(v),\n\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t)\n\t\t\t:\t`${encodeURIComponent(key)}=${encodeURIComponent(\n\t\t\t\t\ttypeof value === 'boolean' ? String(value) : String(value),\n\t\t\t\t)}`,\n\t\t)\n\t\t.join('&');\n\n\treturn queryParams ? `?${queryParams}` : '';\n};\n\n/**\n * * Get query params as standard `JavaScript` Object `Record<string, string>`.\n *\n * - **Note:** *Extracts query parameters from the current URL (window.location.search).*\n *\n * @returns Query string as key-value paired object. `Record<string, string>`.\n */\nexport function getQueryParams(): Record<string, string> {\n\treturn Object.fromEntries(new URLSearchParams(window?.location?.search));\n}\n\n/**\n * * Update query params in the browser URL with given key and value.\n * @param key Key for the query to update.\n * @param value Value to updated against the given key.\n */\nexport function updateQueryParam(key: string, value: string) {\n\tconst url = new URL(window.location.href);\n\turl.searchParams.set(key, value);\n\twindow.history.replaceState({}, '', url?.toString());\n}\n\n/**\n * Parses a query string (with optional `?` prefix) into an object.\n * Supports multiple values for the same key by returning arrays.\n * Optionally parses primitive string values into actual types (e.g., \"1\" → 1, \"true\" → true).\n *\n * - **Note:** *This function does **not** access or depend on `current URL` a.k.a `window.location.search`.*\n *\n * @param query - The query string to parse.\n * @param parsePrimitives - Whether to convert stringified primitives into real values (default: true).\n * @returns An object where keys are strings and values can be string, array, number, boolean, or null.\n */\nexport const parseQueryString = (\n\tquery: string,\n\tparsePrimitives = true,\n): StrictObject => {\n\tconst params = new URLSearchParams(\n\t\tquery.startsWith('?') ? query.slice(1) : query,\n\t);\n\n\tconst entries: StrictObject = {};\n\n\tfor (const [key, value] of params.entries()) {\n\t\tif (key in entries) {\n\t\t\tconst current = entries[key];\n\n\t\t\tconst array =\n\t\t\t\tArray.isArray(current) ? [...current, value] : [current, value];\n\n\t\t\tentries[key] = parsePrimitives ? deepParsePrimitives(array) : array;\n\t\t} else {\n\t\t\tentries[key] = value;\n\t\t}\n\t}\n\n\treturn parsePrimitives ? parseObjectValues(entries) : entries;\n};\n","import { generateQueryParams } from '../dom/query';\nimport { parseObjectValues } from '../object/sanitize';\nimport type { ParsedFormData, SerializedForm } from './types';\n\n/**\n * * Serialize form data into an object or a query string.\n * - **N.B.** Be cautious when using this in SSR (Server-Side Rendering) environments (such as `Next.js` Server Components), as it may not work as expected.\n *\n * @param form - The form element to serialize.\n * @param toQueryString - Whether to return the result as a query string. If false, returns an object.\n * @returns The serialized form data as an object or query string.\n */\nexport function serializeForm<T extends boolean = false>(\n\tform: HTMLFormElement,\n\ttoQueryString: T = false as T,\n): SerializedForm<T> {\n\tconst formData = new FormData(form);\n\tconst data: Record<string, string | string[]> = {};\n\n\tformData?.forEach((value, key) => {\n\t\t// If the key already exists, we make it an array to handle multiple selections\n\t\tif (data[key]) {\n\t\t\tdata[key] =\n\t\t\t\tArray.isArray(data[key]) ?\n\t\t\t\t\t[...data[key], value.toString()]\n\t\t\t\t:\t[data[key], value.toString()];\n\t\t} else {\n\t\t\tdata[key] = value.toString();\n\t\t}\n\t});\n\n\tif (toQueryString) {\n\t\tconst queryString = generateQueryParams(data);\n\t\treturn queryString as SerializedForm<T>;\n\t}\n\n\treturn data as SerializedForm<T>;\n}\n\n/**\n * * Parse form data from a `FormData` object or query string into a structured object format.\n *\n * @param data - The `FormData` object or query string to parse.\n * @param parsePrimitives - Whether to parse string values into primitive types (e.g., boolean, number, array, object). Defaults to `true`.\n * @returns The parsed form data as an object.\n */\nexport function parseFormData<T extends FormData | string>(\n\tdata: T,\n\tparsePrimitives = true,\n): ParsedFormData<T> {\n\tconst parsed: Record<string, unknown> = {};\n\n\tif (typeof data === 'string') {\n\t\tconst params = new URLSearchParams(data);\n\n\t\tparams?.forEach((value, key) => {\n\t\t\tconst existing = parsed[key];\n\n\t\t\tif (typeof existing === 'string') {\n\t\t\t\tparsed[key] = [existing, value];\n\t\t\t} else if (Array.isArray(existing)) {\n\t\t\t\tparsed[key] = [...existing, value];\n\t\t\t} else {\n\t\t\t\tparsed[key] = value;\n\t\t\t}\n\t\t});\n\t} else {\n\t\tdata?.forEach((value, key) => {\n\t\t\tconst existing = parsed[key];\n\n\t\t\tif (value instanceof File) {\n\t\t\t\tif (Array.isArray(existing)) {\n\t\t\t\t\tparsed[key] = [...existing, value];\n\t\t\t\t} else if (existing instanceof File) {\n\t\t\t\t\tparsed[key] = [existing, value];\n\t\t\t\t} else {\n\t\t\t\t\tparsed[key] = value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (typeof existing === 'string') {\n\t\t\t\t\tparsed[key] = [existing, value];\n\t\t\t\t} else if (Array.isArray(existing)) {\n\t\t\t\t\tparsed[key] = [...existing, value];\n\t\t\t\t} else {\n\t\t\t\t\tparsed[key] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tif (parsePrimitives) {\n\t\treturn parseObjectValues(parsed) as ParsedFormData<T>;\n\t} else {\n\t\treturn parsed as ParsedFormData<T>;\n\t}\n}\n","import type { GenericObject } from './types';\n\n/**\n * * Deep clone an object.\n *\n * @param obj Object to clone.\n * @returns Deep cloned object.\n */\nexport const cloneObject = <T extends GenericObject>(obj: T): T => {\n\treturn JSON.parse(JSON.stringify(obj));\n};\n\n/**\n * * Count the number of fields in an object.\n *\n * @param obj Object to check.\n * @returns Number of fields in the object.\n */\nexport const countObjectFields = <T extends GenericObject>(obj: T): number => {\n\tif (obj != null) return Object.keys(obj)?.length;\n\n\treturn 0;\n};\n","import type { Any } from '../types';\nimport type {\n\tDotNotationKey,\n\tGenericObject,\n\tNumberified,\n\tStringified,\n} from './types';\n\n/**\n * * Converts the values of specified keys in an object to numbers.\n * * Supports nested objects using dot-notation keys.\n *\n * @param data The object to convert.\n * @param options Options object specifying the conversion mapping.\n * - `keys`: The keys in the objects to be converted (dot-notation supported).\n * - `convertTo`: The target type, either `\"string\"` or `\"number\"`.\n * @returns The modified object with the converted values as `\"string\"` or `\"number\"`.\n */\nexport function convertObjectValues<\n\tT extends GenericObject,\n\tC extends 'string' | 'number',\n>(\n\tdata: T,\n\toptions: { keys: DotNotationKey<T>[]; convertTo: C },\n): C extends 'string' ? Stringified<T>\n: C extends 'number' ? Numberified<T>\n: never;\n\n/**\n * * Converts the values of specified keys in an array of objects to numbers or strings.\n * * Supports nested objects using dot-notation keys.\n *\n * @param data The array of objects to convert.\n * @param options Options object specifying the conversion mapping.\n * - `keys`: The keys in the objects to be converted (dot-notation supported).\n * - `convertTo`: The target type, either `\"string\"` or `\"number\"`.\n * @returns The modified array of objects with the converted values as `\"string\"` or `\"number\"`.\n */\nexport function convertObjectValues<\n\tT extends GenericObject,\n\tC extends 'string' | 'number',\n>(\n\tdata: T[],\n\toptions: { keys: DotNotationKey<T>[]; convertTo: C },\n): C extends 'string' ? Stringified<T>[]\n: C extends 'number' ? Numberified<T>[]\n: never;\n\n/**\n * * Converts the values of specified keys in an object or array of objects to either string or number.\n * * Supports nested objects using dot-notation keys.\n *\n * @param data The object or array of objects to convert.\n * @param options Options object specifying the conversion mapping.\n * - `keys`: The keys in the object to be converted (dot-notation supported).\n * - `convertTo`: The target type, either \"string\" or \"number\".\n * @returns The modified object or array of objects with the converted values, with updated types.\n */\nexport function convertObjectValues<\n\tT extends GenericObject,\n\tC extends 'string' | 'number',\n>(\n\tdata: T | T[],\n\toptions: { keys: DotNotationKey<T>[]; convertTo: C },\n): C extends 'string' ? Stringified<T> | Stringified<T>[]\n: C extends 'number' ? Numberified<T> | Numberified<T>[]\n: never {\n\tconst { keys, convertTo } = options;\n\n\t/** * Helper function to determine if value should be preserved. */\n\tconst _shouldPreserveValue = (value: unknown): boolean =>\n\t\tconvertTo === 'number' &&\n\t\t(typeof value !== 'string' || isNaN(Number(value)));\n\n\t/** * Helper function to resolve a dot-notation key path and modify the corresponding value in the object. */\n\tconst _setValueAtPath = (\n\t\tobj: T,\n\t\tpath: string,\n\t\tconvertTo: 'string' | 'number',\n\t): T => {\n\t\tconst segments = path.split('.');\n\n\t\tlet current: Any = obj;\n\n\t\tsegments?.forEach((key, index) => {\n\t\t\tif (index === segments?.length - 1) {\n\t\t\t\tconst value = current[key];\n\n\t\t\t\tif (_shouldPreserveValue(value)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (convertTo === 'string' && typeof value !== 'string') {\n\t\t\t\t\tcurrent[key] = String(value);\n\t\t\t\t} else if (\n\t\t\t\t\tconvertTo === 'number' &&\n\t\t\t\t\ttypeof value !== 'number' &&\n\t\t\t\t\t!isNaN(Number(value))\n\t\t\t\t) {\n\t\t\t\t\tcurrent[key] = Number(value);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (typeof current[key] === 'object' && current[key] !== null) {\n\t\t\t\t\tcurrent = current[key];\n\t\t\t\t} else {\n\t\t\t\t\tcurrent[key] = {};\n\t\t\t\t\tcurrent = current[key];\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn obj;\n\t};\n\n\t/** * Recursively process a single object. */\n\tconst _convertValue = (obj: T): T => {\n\t\tlet newObj = structuredClone(obj);\n\n\t\tkeys?.forEach((key) => {\n\t\t\tnewObj = _setValueAtPath(newObj, key, convertTo);\n\t\t});\n\n\t\treturn newObj;\n\t};\n\n\tif (Array.isArray(data)) {\n\t\treturn data?.map((d) => _convertValue(d)) as C extends 'string' ?\n\t\t\tStringified<T>[]\n\t\t: C extends 'number' ? Numberified<T>[]\n\t\t: never;\n\t}\n\n\treturn _convertValue(data) as C extends 'string' ?\n\t\tStringified<T> | Stringified<T>[]\n\t: C extends 'number' ? Numberified<T> | Numberified<T>[]\n\t: never;\n}\n\n/**\n * * Pick specific fields from an object and create a new object with specified fields.\n *\n * @description This function creates a new object containing only the specified fields from the source object.\n * It is useful for creating a new object with a subset of properties from an existing object.\n *\n * @param T The type of the source object.\n * @param U The type of the keys to pick from the source object.\n *\n * @param source The source object from which to pick fields.\n * @param keys\tThe keys of the fields to pick from the source object.\n *\n * @returns An object containing only the picked fields.\n */\nexport function pickFields<T extends GenericObject, U extends keyof T>(\n\tsource: T,\n\tkeys: U[],\n): { [K in U]: T[K] } {\n\tconst result = {} as { [K in U]: T[K] };\n\n\tkeys?.forEach((key) => {\n\t\tresult[key] = source[key];\n\t});\n\n\treturn result;\n}\n\n/**\n * * Pick specific fields from an object based on a given condition.\n *\n * @description This function creates a new object containing only the fields that satisfy the given condition.\n * The condition can be based on the field's value or type, depending on the implementation.\n *\n * @param T The type of the source object.\n *\n * @param source The source object from which to pick fields.\n * @param condition A function that takes the key and value of a property and returns a boolean indicating whether the property should be picked.\n *\n * @returns An object containing only the fields that satisfy the condition.\n */\nexport function pickObjectFieldsByCondition<T extends GenericObject>(\n\tsource: T,\n\tcondition: (key: keyof T, value: T[keyof T]) => boolean,\n): Partial<T> {\n\tconst result: Partial<T> = {};\n\n\tObject.entries(source)?.forEach(([key, value]) => {\n\t\tif (condition(key as keyof T, value)) {\n\t\t\tresult[key as keyof T] = value;\n\t\t}\n\t});\n\n\treturn result;\n}\n\n/**\n * * Remap fields from one object to another.\n * @description This function creates a new object with fields remapped from the source object to the target object based on the provided field map.\n *\n * @param source The source object from which to remap fields.\n * @param fieldMap An object that maps target keys to source keys.\n * @returns An object with fields remapped according to the field map.\n */\nexport function remapFields<\n\tSource extends GenericObject,\n\tTarget extends Record<string, keyof Source>,\n>(\n\tsource: Source,\n\tfieldMap: Target,\n): {\n\t[K in keyof Target]: Source[Target[K]];\n} {\n\tconst result = {} as {\n\t\t[K in keyof Target]: Source[Target[K]];\n\t};\n\n\tfor (const targetKey in fieldMap) {\n\t\tconst sourceKey = fieldMap[targetKey];\n\t\tresult[targetKey] = source[sourceKey];\n\t}\n\n\treturn result;\n}\n","/**\n * * Scrolls smoothly to the given element with an optional vertical offset.\n * @param element The target element to scroll to.\n * @param offset Additional vertical offset in pixels (positive moves down, negative moves up).\n */\nexport function smoothScrollTo(element: HTMLElement, offset = 0) {\n\telement.scrollIntoView({ behavior: 'smooth', block: 'start' });\n\n\tif (offset !== 0) {\n\t\tsetTimeout(() => {\n\t\t\twindow.scrollBy({ top: offset, behavior: 'smooth' });\n\t\t}, 300); // Delay to ensure smooth scrolling effect\n\t}\n}\n\n/**\n * * Toggles full-screen mode for a given element (or the `document` by default).\n * @param element The element to toggle fullscreen mode for (default: document root).\n */\nexport function toggleFullScreen(element = document.documentElement) {\n\tconst doc = document as Document & {\n\t\twebkitFullscreenElement?: Element | null;\n\t\twebkitExitFullscreen?: () => Promise<void>;\n\t};\n\n\tconst elem = element as HTMLElement & {\n\t\twebkitRequestFullscreen?: () => Promise<void>;\n\t};\n\n\tif (!doc.fullscreenElement && !doc.webkitFullscreenElement) {\n\t\tif (elem.requestFullscreen) {\n\t\t\telem.requestFullscreen();\n\t\t} else if (elem.webkitRequestFullscreen) {\n\t\t\telem.webkitRequestFullscreen();\n\t\t}\n\t} else {\n\t\tif (doc.exitFullscreen) {\n\t\t\tdoc.exitFullscreen();\n\t\t} else if (doc.webkitExitFullscreen) {\n\t\t\tdoc.webkitExitFullscreen();\n\t\t}\n\t}\n}\n\n/**\n * * Copies text to the clipboard, falling back to legacy methods if needed.\n * @param text - The text to copy.\n * @returns A promise that resolves when the text is copied.\n */\nexport async function copyToClipboard(text: string): Promise<void> {\n\ttry {\n\t\tif (navigator?.clipboard?.writeText) {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t} else {\n\t\t\tconst textArea = document.createElement('textarea');\n\n\t\t\ttextArea.value = text;\n\t\t\ttextArea.style.position = 'fixed';\n\t\t\ttextArea.style.opacity = '0';\n\t\t\tdocument.body.appendChild(textArea);\n\n\t\t\ttextArea.select();\n\t\t\ttextArea.setSelectionRange(0, textArea.value?.length);\n\n\t\t\tconst success = document.execCommand('copy');\n\n\t\t\tdocument.body.removeChild(textArea);\n\n\t\t\tif (!success) {\n\t\t\t\tthrow new Error('Cannot execute command in this environment!');\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\tconsole.error('Failed to copy text:', error);\n\t\tthrow error;\n\t} finally {\n\t\tconst textArea = document.querySelector('textarea[style*=\"fixed\"]');\n\n\t\tif (textArea) {\n\t\t\tdocument.body.removeChild(textArea);\n\t\t}\n\t}\n}\n","// * ****************** Local Storage ****************** * //\n\n/**\n * * Get item(s) from local storage.\n *\n * @param key - Key to get item(s) from local storage.\n * @returns Returns saved item(s) from local storage if it exists with that key.\n */\nexport const getFromLocalStorage = <T>(key: string): T | null => {\n\tconst item = localStorage.getItem(key);\n\n\tif (!item) return null;\n\n\treturn JSON.parse(item) as T;\n};\n\n/**\n * * Save item(s) in local storage.\n *\n * @param key - Key to save an item(s).\n * @param value - The item(s)/value to save.\n */\nexport const saveToLocalStorage = <T>(key: string, value: T): void => {\n\tlocalStorage.setItem(key, JSON.stringify(value));\n};\n\n/**\n * * Remove item(s) from local storage.\n *\n * @param key - Key to delete item(s) from local storage.\n */\nexport const removeFromLocalStorage = (key: string): void => {\n\tlocalStorage.removeItem(key);\n};\n\n// * ****************** Session Storage ****************** * //\n\n/**\n * * Get item(s) from session storage.\n *\n * @param key - Key to get item(s) from session storage.\n * @returns Returns saved item(s) from session storage if it exists with that key.\n */\nexport const getFromSessionStorage = <T>(key: string): T | null => {\n\tconst item = sessionStorage.getItem(key);\n\n\tif (!item) return null;\n\n\treturn JSON.parse(item) as T;\n};\n\n/**\n * * Save item(s) in session storage.\n *\n * @param key - Key to save an item(s).\n * @param value - The item(s)/value to save.\n */\nexport const saveToSessionStorage = <T>(key: string, value: T): void => {\n\tsessionStorage.setItem(key, JSON.stringify(value));\n};\n\n/**\n * * Remove item(s) from session storage.\n *\n * @param key - Key to delete item(s) from session storage.\n */\nexport const removeFromSessionStorage = (key: string): void => {\n\tsessionStorage.removeItem(key);\n};\n","import type {\n\tFromMetaOptions,\n\tPageListOptions,\n\tPaginatorMeta,\n\tPaginatorOptions,\n} from './types';\n\n/** * Generates pagination logic, offsets, metadata and other pagination logic(s) for APIs and UIs. */\nexport class Paginator {\n\treadonly #totalItems: number;\n\treadonly #perPage: number;\n\treadonly #currentPage: number;\n\n\t/**\n\t * * Creates an instance of the Paginator.\n\t * @param options - The options for pagination.\n\t */\n\tconstructor(options: PaginatorOptions) {\n\t\tconst {\n\t\t\ttotalItems,\n\t\t\titemsPerPage = 10,\n\t\t\tcurrentPage = 1,\n\t\t} = options ?? {};\n\n\t\tthis.#totalItems = Math.max(0, Number(totalItems));\n\t\tthis.#perPage = Math.max(1, Number(itemsPerPage));\n\t\tthis.#currentPage = Math.max(1, Number(currentPage));\n\t}\n\n\t/**\n\t * @instance Returns a new Paginator instance with the given page number.\n\t * * This method does not modify the current instance.\n\t * - **N.B.** *If the provided page is out of range, it will be clamped between 1 and the last page.*\n\t * @param page - The new current page to use.\n\t * @returns A new Paginator instance with the updated (clamped) page.\n\t */\n\twithPage(page: number): Paginator {\n\t\tconst safePage = Math.min(Math.max(1, page), this.totalPages());\n\n\t\treturn new Paginator({\n\t\t\ttotalItems: this.#totalItems,\n\t\t\titemsPerPage: this.#perPage,\n\t\t\tcurrentPage: safePage,\n\t\t});\n\t}\n\n\t/**\n\t * @instance Returns a new Paginator instance with the given items per page.\n\t * - **N.B.** *If the value is less than `1`, it will be clamped to 1.*\n\t * @param perPage - New items per page value.\n\t * @returns A new Paginator instance with updated items per page.\n\t */\n\twithPerPage(perPage: number): Paginator {\n\t\tconst safePerPage = Math.max(1, perPage);\n\t\treturn new Paginator({\n\t\t\ttotalItems: this.#totalItems,\n\t\t\titemsPerPage: safePerPage,\n\t\t\tcurrentPage: this.#currentPage,\n\t\t});\n\t}\n\n\t/**\n\t * @instance Returns a new Paginator instance with the given total items.\n\t * - **N.B.** *If the value is `negative`, it will be clamped to `0`.*\n\t * @param totalItems - New total items value.\n\t * @returns A new Paginator instance with updated total items.\n\t */\n\twithTotalItems(totalItems: number): Paginator {\n\t\tconst safeTotalItems = Math.max(0, totalItems);\n\t\treturn new Paginator({\n\t\t\ttotalItems: safeTotalItems,\n\t\t\titemsPerPage: this.#perPage,\n\t\t\tcurrentPage: this.#currentPage,\n\t\t});\n\t}\n\n\t/**\n\t * @instance Returns a new Paginator instance with updated pagination options.\n\t * - **N.B.** *Any value provided will override the existing one, with clamping applied for safety.*\n\t * @param options - Partial pagination options to override the current instance.\n\t * @returns A new Paginator instance with merged and clamped options.\n\t */\n\twithOptions(options: Partial<PaginatorOptions>): Paginator {\n\t\tconst newTotalItems = Math.max(\n\t\t\t0,\n\t\t\toptions.totalItems ? Number(options.totalItems) : this.#totalItems,\n\t\t);\n\t\tconst newItemsPerPage = Math.max(\n\t\t\t1,\n\t\t\toptions.itemsPerPage ? Number(options.itemsPerPage) : this.#perPage,\n\t\t);\n\t\tconst totalPages = Math.ceil(newTotalItems / newItemsPerPage);\n\t\tconst newCurrentPage = Math.min(\n\t\t\tMath.max(\n\t\t\t\t1,\n\t\t\t\toptions.currentPage ?\n\t\t\t\t\tNumber(options.currentPage)\n\t\t\t\t:\tthis.#currentPage,\n\t\t\t),\n\t\t\ttotalPages,\n\t\t);\n\n\t\treturn new Paginator({\n\t\t\ttotalItems: newTotalItems,\n\t\t\titemsPerPage: newItemsPerPage,\n\t\t\tcurrentPage: newCurrentPage,\n\t\t});\n\t}\n\n\t/**\n\t * @instance Calculates the offset (number of items to skip) based on the `current page` and `items per page`.\n\t * @returns The number of items to skip.\n\t */\n\toffset(): number {\n\t\treturn (this.#currentPage - 1) * this.#perPage;\n\t}\n\n\t/**\n\t * @instance Calculates the offset (number of items to skip) based on the `current page` and `items per page`.\n\t * @alias of {@link offset}\n\t * @returns The number of items to skip.\n\t */\n\tgetOffset(): number {\n\t\treturn this.offset();\n\t}\n\n\t/**\n\t * @instance Calculates the number of items to skip based on the `current page` and `items per page`.\n\t * @alias of {@link offset}\n\t * @returns The number of items to skip.\n\t */\n\tskipCount(): number {\n\t\treturn this.offset();\n\t}\n\n\t/**\n\t * @instance Calculates the total number of pages based on `total items` and `items per page`.\n\t * @returns The total number of pages.\n\t */\n\ttotalPages(): number {\n\t\treturn Math.ceil(this.#totalItems / this.#perPage);\n\t}\n\n\t/**\n\t * * Returns pagination metadata useful for API responses or UI rendering.\n\t * @returns An object with pagination metadata.\n\t */\n\tgetMeta(): PaginatorMeta {\n\t\tconst totalPages = this.totalPages();\n\t\treturn {\n\t\t\ttotalItems: this.#totalItems,\n\t\t\tcurrentPage: this.#currentPage,\n\t\t\titemsPerPage: this.#perPage,\n\t\t\ttotalPages,\n\t\t\thasPrev: this.hasPrevPage(),\n\t\t\thasNext: this.hasNextPage(),\n\t\t\tisFirst: this.isFirstPage(),\n\t\t\tisLast: this.isLastPage(),\n\t\t\toffset: this.offset(),\n\t\t};\n\t}\n\n\t/**\n\t * @instance Returns the next page number if it exists.\n\t * @returns The next page number or null if it's the last page.\n\t */\n\tnextPage(): number | null {\n\t\treturn this.#currentPage < this.totalPages() ?\n\t\t\t\tthis.#currentPage + 1\n\t\t\t:\tnull;\n\t}\n\n\t/**\n\t * @instance Returns the previous page number if it exists.\n\t * @returns The previous page number or null if it's the first page.\n\t */\n\tprevPage(): number | null {\n\t\treturn this.#currentPage > 1 ? this.#currentPage - 1 : null;\n\t}\n\n\t/**\n\t * @instance Checks if the current page is the first page.\n\t * @returns Whether the current page is the first page.\n\t */\n\tisFirstPage(): boolean {\n\t\treturn this.#currentPage === 1;\n\t}\n\n\t/**\n\t * @instance Checks if the current page is the last page.\n\t * @returns Whether the current page is the last page.\n\t */\n\tisLastPage(): boolean {\n\t\treturn this.#currentPage === this.totalPages();\n\t}\n\n\t/**\n\t * @instance Checks if a previous page exists.\n\t * @returns Whether a previous page exists.\n\t */\n\thasPrevPage(): boolean {\n\t\treturn this.#currentPage > 1;\n\t}\n\n\t/**\n\t * @instance Checks if a next page exists.\n\t * @returns Whether a next page exists.\n\t */\n\thasNextPage(): boolean {\n\t\treturn this.#currentPage < this.totalPages();\n\t}\n\n\t/**\n\t * @instance Creates an array of page numbers for UI pagination display.\n\t * @param options Options for customizing the page list.\n\t * @returns An array of visible page numbers.\n\t */\n\tpageList(options: PageListOptions = {}): number[] {\n\t\tconst total = this.totalPages();\n\t\tconst edgeCount = Math.max(0, options.edgeCount ?? 1);\n\t\tconst siblingCount = Math.max(0, options.siblingCount ?? 1);\n\t\tconst start = Math.max(this.#currentPage - siblingCount, edgeCount + 1);\n\t\tconst end = Math.min(\n\t\t\tthis.#currentPage + siblingCount,\n\t\t\ttotal - edgeCount,\n\t\t);\n\n\t\tconst _getRange = (from: number, to: number): number[] => {\n\t\t\treturn from > to ?\n\t\t\t\t\t[]\n\t\t\t\t:\tArray.from({ length: to - from + 1 }, (_, i) => from + i);\n\t\t};\n\n\t\tconst startPages = _getRange(1, edgeCount);\n\t\tconst middlePages = _getRange(start, end);\n\t\tconst endPages = _getRange(total - edgeCount + 1, total);\n\n\t\tconst pages = new Set<number>([\n\t\t\t...startPages,\n\t\t\t...middlePages,\n\t\t\t...endPages,\n\t\t]);\n\n\t\treturn Array.from(pages).sort((a, b) => a - b);\n\t}\n\n\t/**\n\t * @instance Returns the first page number.\n\t * @returns Always returns 1.\n\t */\n\tfirstPage(): number {\n\t\treturn 1;\n\t}\n\n\t/**\n\t * @instance Returns the last page number based on total items and per page count.\n\t * @returns The last page number.\n\t */\n\tlastPage(): number {\n\t\treturn this.totalPages();\n\t}\n\n\t/**\n\t * @instance Checks if a page number is valid within the pagination range.\n\t * @param page - The page number to validate.\n\t * @returns Whether the page number is within range.\n\t */\n\tisPageValid(page: number): boolean {\n\t\tconst p = Math.floor(page);\n\t\treturn p >= 1 && p <= this.totalPages();\n\t}\n\n\t/**\n\t * @static Creates a new Paginator instance from a meta object.\n\t * @param meta - A pagination metadata object.\n\t * @returns A new Paginator instance.\n\t */\n\tstatic fromMeta(meta: FromMetaOptions): Paginator {\n\t\treturn new Paginator({\n\t\t\ttotalItems: meta.totalItems,\n\t\t\titemsPerPage: meta.itemsPerPage,\n\t\t\tcurrentPage: meta.currentPage,\n\t\t});\n\t}\n}\n"],"mappings":";;;;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