{
  "version": 3,
  "sources": ["../../../src/utils/row-height-presets/row-height-presets.ts"],
  "sourcesContent": ["export const ROW_HEIGHT_PRESETS = {\n\tsmall: 200,\n\tmedium: 300,\n\tlarge: 400,\n} as const;\n\nexport type RowHeightPreset = keyof typeof ROW_HEIGHT_PRESETS;\n\nexport const DEFAULT_ROW_HEIGHT = ROW_HEIGHT_PRESETS.medium;\n\nconst PRESET_ENTRIES = Object.entries( ROW_HEIGHT_PRESETS ) as [\n\tRowHeightPreset,\n\tnumber,\n][];\n\n/**\n * Maps a stored pixel height to the nearest preset so legacy freeform\n * values still resolve to a valid toggle option.\n *\n * @param rowHeight Row height in pixels.\n */\nexport function rowHeightToPreset( rowHeight: number ): RowHeightPreset {\n\tlet closest: RowHeightPreset = 'medium';\n\tlet minDistance = Infinity;\n\n\tfor ( const [ preset, value ] of PRESET_ENTRIES ) {\n\t\tconst distance = Math.abs( rowHeight - value );\n\t\tif ( distance < minDistance ) {\n\t\t\tminDistance = distance;\n\t\t\tclosest = preset;\n\t\t}\n\t}\n\n\treturn closest;\n}\n\nexport function presetToRowHeight( preset: RowHeightPreset ): number {\n\treturn ROW_HEIGHT_PRESETS[ preset ];\n}\n\nexport function snapRowHeight( rowHeight: number ): number {\n\treturn presetToRowHeight( rowHeightToPreset( rowHeight ) );\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,qBAAqB;AAAA,EACjC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACR;AAIO,IAAM,qBAAqB,mBAAmB;AAErD,IAAM,iBAAiB,OAAO,QAAS,kBAAmB;AAWnD,SAAS,kBAAmB,WAAqC;AACvE,MAAI,UAA2B;AAC/B,MAAI,cAAc;AAElB,aAAY,CAAE,QAAQ,KAAM,KAAK,gBAAiB;AACjD,UAAM,WAAW,KAAK,IAAK,YAAY,KAAM;AAC7C,QAAK,WAAW,aAAc;AAC7B,oBAAc;AACd,gBAAU;AAAA,IACX;AAAA,EACD;AAEA,SAAO;AACR;AAEO,SAAS,kBAAmB,QAAkC;AACpE,SAAO,mBAAoB,MAAO;AACnC;AAEO,SAAS,cAAe,WAA4B;AAC1D,SAAO,kBAAmB,kBAAmB,SAAU,CAAE;AAC1D;",
  "names": []
}
