{"version":3,"file":"utils.mjs","names":[],"sources":["../../src/Tag/utils.ts"],"sourcesContent":["import { cssVar } from 'antd-style';\nimport { camelCase } from 'es-toolkit/compat';\n\nexport const presetColors = [\n  'red',\n  'volcano',\n  'orange',\n  'gold',\n  'yellow',\n  'lime',\n  'green',\n  'cyan',\n  'blue',\n  'geekblue',\n  'purple',\n  'magenta',\n  'gray',\n];\n\nexport const presetSystemColors = new Set(['error', 'warning', 'success', 'info', 'processing']);\n\nconst toKebabCase = (value: string) =>\n  value\n    .replaceAll(/([a-z])([A-Z])/g, '$1-$2')\n    .replaceAll(/([a-z])(\\d)/g, '$1-$2')\n    .replaceAll(/(\\d)([A-Z])/g, '$1-$2')\n    .replaceAll(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n    .toLowerCase();\n\nconst getCssVar = (tokenKey: string) => {\n  const mapped = (cssVar as Record<string, string>)[tokenKey];\n  return mapped || `var(--ant-${toKebabCase(tokenKey)})`;\n};\n\nexport const colorsPreset = (type: string, ...keys: string[]) =>\n  getCssVar(camelCase([type, ...keys].join('-')));\n\nexport const colorsPresetSystem = (type: string, ...keys: string[]) => {\n  const t = type === 'processing' ? 'info' : type;\n  return getCssVar(camelCase(['color', t, ...keys].join('-')));\n};\n"],"mappings":";;;AAGA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,qCAAqB,IAAI,IAAI;CAAC;CAAS;CAAW;CAAW;CAAQ;AAAY,CAAC;AAE/F,MAAM,eAAe,UACnB,MACG,WAAW,mBAAmB,OAAO,CAAC,CACtC,WAAW,gBAAgB,OAAO,CAAC,CACnC,WAAW,gBAAgB,OAAO,CAAC,CACnC,WAAW,yBAAyB,OAAO,CAAC,CAC5C,YAAY;AAEjB,MAAM,aAAa,aAAqB;CAEtC,OADgB,OAAkC,aACjC,aAAa,YAAY,QAAQ,EAAE;AACtD;AAEA,MAAa,gBAAgB,MAAc,GAAG,SAC5C,UAAU,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;AAEhD,MAAa,sBAAsB,MAAc,GAAG,SAAmB;CAErE,OAAO,UAAU,UAAU;EAAC;EADlB,SAAS,eAAe,SAAS;EACH,GAAG;CAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;AAC7D"}