{"version":3,"file":"getLineHeight.utils.cjs","sources":["../../../../../../src/components/forms/text-area/hooks/utils/getLineHeight.utils.ts"],"sourcesContent":["import { FALLBACK_LINE_HEIGHT, FALLBACK_LINE_HEIGHT_RATIO } from '@components/forms/text-area/hooks/constants'\r\n\r\n/**\r\n * Reads the resolved line-height of an element. `line-height: normal` (and\r\n * any non-length value) parses to NaN, which would poison the height math,\r\n * so we fall back to a font-size-derived value.\r\n */\r\nexport const getLineHeight = (computed: CSSStyleDeclaration): number => {\r\n    const lineHeight = parseFloat(computed.lineHeight)\r\n    if (!Number.isNaN(lineHeight)) {\r\n        return lineHeight\r\n    }\r\n\r\n    const fontSize = parseFloat(computed.fontSize)\r\n    return Number.isNaN(fontSize) ? FALLBACK_LINE_HEIGHT : fontSize * FALLBACK_LINE_HEIGHT_RATIO\r\n}\r\n"],"names":["getLineHeight","computed","lineHeight","fontSize","FALLBACK_LINE_HEIGHT","FALLBACK_LINE_HEIGHT_RATIO"],"mappings":"0HAOaA,EAAiBC,GAA0C,CACpE,MAAMC,EAAa,WAAWD,EAAS,UAAU,EACjD,GAAI,CAAC,OAAO,MAAMC,CAAU,EACxB,OAAOA,EAGX,MAAMC,EAAW,WAAWF,EAAS,QAAQ,EAC7C,OAAO,OAAO,MAAME,CAAQ,EAAIC,EAAAA,qBAAuBD,EAAWE,EAAAA,0BACtE"}