{"version":3,"sources":["node_modules/@angular/cdk/fesm2022/coercion.mjs"],"sourcesContent":["import { ElementRef } from '@angular/core';\n\n/** Coerces a data-bound value (typically a string) to a boolean. */\nfunction coerceBooleanProperty(value) {\n return value != null && `${value}` !== 'false';\n}\nfunction coerceNumberProperty(value, fallbackValue = 0) {\n return _isNumberValue(value) ? Number(value) : fallbackValue;\n}\n/**\n * Whether the provided value is considered a number.\n * @docs-private\n */\nfunction _isNumberValue(value) {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n return !isNaN(parseFloat(value)) && !isNaN(Number(value));\n}\nfunction coerceArray(value) {\n return Array.isArray(value) ? value : [value];\n}\n\n/** Coerces a value to a CSS pixel value. */\nfunction coerceCssPixelValue(value) {\n if (value == null) {\n return '';\n }\n return typeof value === 'string' ? value : `${value}px`;\n}\n\n/**\n * Coerces an ElementRef or an Element into an element.\n * Useful for APIs that can accept either a ref or the native element itself.\n */\nfunction coerceElement(elementOrRef) {\n return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n}\n\n/**\n * Coerces a value to an array of trimmed non-empty strings.\n * Any input that is not an array, `null` or `undefined` will be turned into a string\n * via `toString()` and subsequently split with the given separator.\n * `null` and `undefined` will result in an empty array.\n * This results in the following outcomes:\n * - `null` -> `[]`\n * - `[null]` -> `[\"null\"]`\n * - `[\"a\", \"b \", \" \"]` -> `[\"a\", \"b\"]`\n * - `[1, [2, 3]]` -> `[\"1\", \"2,3\"]`\n * - `[{ a: 0 }]` -> `[\"[object Object]\"]`\n * - `{ a: 0 }` -> `[\"[object\", \"Object]\"]`\n *\n * Useful for defining CSS classes or table columns.\n * @param value the value to coerce into an array of strings\n * @param separator split-separator if value isn't an array\n */\nfunction coerceStringArray(value, separator = /\\s+/) {\n const result = [];\n if (value != null) {\n const sourceValues = Array.isArray(value) ? value : `${value}`.split(separator);\n for (const sourceValue of sourceValues) {\n const trimmedString = `${sourceValue}`.trim();\n if (trimmedString) {\n result.push(trimmedString);\n }\n }\n }\n return result;\n}\nexport { _isNumberValue, coerceArray, coerceBooleanProperty, coerceCssPixelValue, coerceElement, coerceNumberProperty, coerceStringArray };\n"],"mappings":"yCAGA,SAASA,EAAsBC,EAAO,CACpC,OAAOA,GAAS,MAAQ,GAAGA,CAAK,IAAO,OACzC,CACA,SAASC,EAAqBD,EAAOE,EAAgB,EAAG,CACtD,OAAOC,EAAeH,CAAK,EAAI,OAAOA,CAAK,EAAIE,CACjD,CAKA,SAASC,EAAeH,EAAO,CAI7B,MAAO,CAAC,MAAM,WAAWA,CAAK,CAAC,GAAK,CAAC,MAAM,OAAOA,CAAK,CAAC,CAC1D,CACA,SAASI,EAAYJ,EAAO,CAC1B,OAAO,MAAM,QAAQA,CAAK,EAAIA,EAAQ,CAACA,CAAK,CAC9C,CAGA,SAASK,EAAoBL,EAAO,CAClC,OAAIA,GAAS,KACJ,GAEF,OAAOA,GAAU,SAAWA,EAAQ,GAAGA,CAAK,IACrD,CAMA,SAASM,EAAcC,EAAc,CACnC,OAAOA,aAAwBC,EAAaD,EAAa,cAAgBA,CAC3E,CAmBA,SAASE,EAAkBT,EAAOU,EAAY,MAAO,CACnD,IAAMC,EAAS,CAAC,EAChB,GAAIX,GAAS,KAAM,CACjB,IAAMY,EAAe,MAAM,QAAQZ,CAAK,EAAIA,EAAQ,GAAGA,CAAK,GAAG,MAAMU,CAAS,EAC9E,QAAWG,KAAeD,EAAc,CACtC,IAAME,EAAgB,GAAGD,CAAW,GAAG,KAAK,EACxCC,GACFH,EAAO,KAAKG,CAAa,CAE7B,CACF,CACA,OAAOH,CACT","names":["coerceBooleanProperty","value","coerceNumberProperty","fallbackValue","_isNumberValue","coerceArray","coerceCssPixelValue","coerceElement","elementOrRef","ElementRef","coerceStringArray","separator","result","sourceValues","sourceValue","trimmedString"],"x_google_ignoreList":[0]}