{"version":3,"file":"extract-component-imports.cjs","sources":["../../../src/cli/utils/extract-component-imports.ts"],"sourcesContent":["/**\n * Extracts component imports from a given content string.\n *\n * @param {string} content - The content string to extract component imports from.\n * @returns {string[]} An array of extracted component imports.\n */\nexport function extractComponentImports(content: string): string[] {\n  const importRegex = /import\\s+(?:{([^}]+)}|\\*\\s+as\\s+\\w+)\\s+from\\s+['\"]flowbite-react(?:\\/[^'\"]*)?['\"]/g;\n  const matches = content.match(importRegex);\n\n  if (!matches) {\n    return [];\n  }\n\n  return matches\n    .flatMap((match) => {\n      if (match.includes(\"* as\")) {\n        return \"*\";\n      }\n      return (match.match(/{([^}]+)}/)?.[1] ?? \"\").replace(/\\/\\/[^\\n]*/g, \"\");\n    })\n    .flatMap((components) => components.split(\",\"))\n    .map((component) => component.trim().split(\" as \")[0])\n    .filter((component) => component && (component === \"*\" || /^[A-Z][a-zA-Z0-9_]*$/.test(component)));\n}\n"],"names":[],"mappings":";;AACO,SAAS,uBAAuB,CAAC,OAAO,EAAE;AACjD,EAAE,MAAM,WAAW,GAAG,oFAAoF;AAC1G,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC;AAC5C,EAAE,IAAI,CAAC,OAAO,EAAE;AAChB,IAAI,OAAO,EAAE;AACb,EAAE;AACF,EAAE,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK;AACpC,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAChC,MAAM,OAAO,GAAG;AAChB,IAAI;AACJ,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;AAC3E,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,KAAK,SAAS,KAAK,SAAS,KAAK,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;AAC3M;;;;"}