@screenbook/cli 1.3.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["CONFIG_FILES","duplicateIds: string[]","cycles: CycleInfo[]","path: string[]","current: string | null | undefined","lines: string[]","errors: ValidationError[]","bestMatch: string | undefined","matrix: number[][]","lines: string[]","screens: ScreenWithFilePath[]","routeFiles: string[]","missing: CoverageData[\"missing\"]","byOwner: CoverageData[\"byOwner\"]","byTag: CoverageData[\"byTag\"]","lines: string[]","screens: ScreenWithFilePath[]","results: CheckResult[]","version","summary: string[]","result: FlatRoute[]","fullPath: string","warnings: string[]","content: string","ast: ReturnType<typeof parse>","routes: ParsedRoute[]","parseRoutesArray","classNode: any","parseRouteObject","path: string | undefined","component: string | undefined","children: ParsedRoute[] | undefined","redirectTo: string | undefined","loc","warnings: string[]","content: string","ast: ReturnType<typeof parse>","routes: ParsedRoute[]","parseRoutesArray","parseRouteObject","paths: string[]","component: string | undefined","children: ParsedRoute[] | undefined","extractLazyImportPath","loc","warnings: string[]","content: string","ast: ReturnType<typeof parse>","extractLazyImportPath","routeDef: RouteDefinition","parentVarName: string | undefined","childNames: string[]","routes: ParsedRoute[]","route: ParsedRoute","children: ParsedRoute[]","warnings: string[]","content: string","ast: ReturnType<typeof parse>","routes: ParsedRoute[]","parseRoutesArray","parseRouteObject","route: ParsedRoute","parts: string[]","loc","warnings: string[]","content: string","ast: ReturnType<typeof parse>","routes: ParsedRoute[]","route: ParsedRoute","parseResult: ParseResult","screenMeta: InferredScreenMeta","transitive: TransitiveDependency[]","queue: Array<{ id: string; path: string[] }>","lines: string[]","screens: Screen[]","FRAMEWORKS: FrameworkDefinition[]","framework: FrameworkInfo | null","missingMeta: string[]","covered: string[]","flatRoutes: FlatRoute[]","parseResult: ParseResult","missingMeta: FlatRoute[]","covered: FlatRoute[]","invalid: InvalidNavigation[]","orphans: Screen[]","lines: string[]","changedFiles: string[]","screens: Screen[]","results: ImpactResult[]","version: string"],"sources":["../src/utils/config.ts","../src/utils/cycleDetection.ts","../src/utils/errors.ts","../src/utils/logger.ts","../src/utils/validation.ts","../src/commands/build.ts","../src/commands/dev.ts","../src/commands/doctor.ts","../src/utils/routeParserUtils.ts","../src/utils/angularRouterParser.ts","../src/utils/solidRouterParser.ts","../src/utils/tanstackRouterParser.ts","../src/utils/reactRouterParser.ts","../src/utils/vueRouterParser.ts","../src/commands/generate.ts","../src/utils/impactAnalysis.ts","../src/commands/impact.ts","../src/utils/detectFramework.ts","../src/commands/init.ts","../src/commands/lint.ts","../src/utils/prImpact.ts","../src/commands/pr-impact.ts","../src/index.ts"],"sourcesContent":["import { existsSync } from \"node:fs\"\nimport { resolve } from \"node:path\"\nimport { type Config, defineConfig } from \"@screenbook/core\"\nimport { createJiti } from \"jiti\"\n\nconst CONFIG_FILES = [\n\t\"screenbook.config.ts\",\n\t\"screenbook.config.js\",\n\t\"screenbook.config.mjs\",\n]\n\nexport async function loadConfig(configPath?: string): Promise<Config> {\n\tconst cwd = process.cwd()\n\n\t// If config path is provided, use it\n\tif (configPath) {\n\t\tconst absolutePath = resolve(cwd, configPath)\n\t\tif (!existsSync(absolutePath)) {\n\t\t\tthrow new Error(`Config file not found: ${configPath}`)\n\t\t}\n\t\treturn await importConfig(absolutePath, cwd)\n\t}\n\n\t// Search for config file in cwd\n\tfor (const configFile of CONFIG_FILES) {\n\t\tconst absolutePath = resolve(cwd, configFile)\n\t\tif (existsSync(absolutePath)) {\n\t\t\treturn await importConfig(absolutePath, cwd)\n\t\t}\n\t}\n\n\t// Return default config if no config file found\n\treturn defineConfig()\n}\n\nasync function importConfig(\n\tabsolutePath: string,\n\tcwd: string,\n): Promise<Config> {\n\tconst jiti = createJiti(cwd)\n\tconst module = (await jiti.import(absolutePath)) as { default?: Config }\n\n\tif (module.default) {\n\t\treturn module.default\n\t}\n\n\tthrow new Error(`Config file must have a default export: ${absolutePath}`)\n}\n","import type { Screen } from \"@screenbook/core\"\n\n/**\n * Information about a detected cycle\n */\nexport interface CycleInfo {\n\t/**\n\t * Array of screen IDs forming the cycle, including the repeated start node\n\t * @example [\"A\", \"B\", \"C\", \"A\"]\n\t */\n\tcycle: string[]\n\t/**\n\t * True if any screen in the cycle has allowCycles: true\n\t */\n\tallowed: boolean\n}\n\n/**\n * Result of cycle detection analysis\n */\nexport interface CycleDetectionResult {\n\t/**\n\t * True if any cycles were detected\n\t */\n\thasCycles: boolean\n\t/**\n\t * All detected cycles\n\t */\n\tcycles: CycleInfo[]\n\t/**\n\t * Cycles that are not allowed (allowed: false)\n\t */\n\tdisallowedCycles: CycleInfo[]\n\t/**\n\t * Screen IDs that appear more than once (indicates data issue)\n\t */\n\tduplicateIds: string[]\n}\n\n// Node colors for DFS\nenum Color {\n\tWhite = 0, // Unvisited\n\tGray = 1, // In progress (on current path)\n\tBlack = 2, // Completed\n}\n\n/**\n * Detect circular navigation dependencies in screen definitions.\n * Uses DFS with coloring algorithm: O(V + E) complexity.\n *\n * @example\n * ```ts\n * const screens = [\n * { id: \"A\", next: [\"B\"] },\n * { id: \"B\", next: [\"C\"] },\n * { id: \"C\", next: [\"A\"] }, // Creates cycle A → B → C → A\n * ]\n * const result = detectCycles(screens)\n * // result.hasCycles === true\n * // result.cycles[0].cycle === [\"A\", \"B\", \"C\", \"A\"]\n * ```\n */\nexport function detectCycles(screens: Screen[]): CycleDetectionResult {\n\tconst screenMap = new Map<string, Screen>()\n\tconst duplicateIds: string[] = []\n\n\t// Build screen map and detect duplicates\n\tfor (const screen of screens) {\n\t\tif (!screen.id || typeof screen.id !== \"string\") {\n\t\t\t// Skip screens with invalid IDs\n\t\t\tcontinue\n\t\t}\n\t\tif (screenMap.has(screen.id)) {\n\t\t\tduplicateIds.push(screen.id)\n\t\t}\n\t\tscreenMap.set(screen.id, screen)\n\t}\n\n\tconst color = new Map<string, Color>()\n\tconst parent = new Map<string, string | null>()\n\tconst cycles: CycleInfo[] = []\n\n\t// Initialize all nodes as white\n\tfor (const id of screenMap.keys()) {\n\t\tcolor.set(id, Color.White)\n\t}\n\n\t// DFS from each unvisited node\n\tfor (const id of screenMap.keys()) {\n\t\tif (color.get(id) === Color.White) {\n\t\t\tdfs(id, null)\n\t\t}\n\t}\n\n\tfunction dfs(nodeId: string, parentId: string | null): void {\n\t\tcolor.set(nodeId, Color.Gray)\n\t\tparent.set(nodeId, parentId)\n\n\t\tconst node = screenMap.get(nodeId)\n\t\tconst neighbors = node?.next ?? []\n\n\t\tfor (const neighborId of neighbors) {\n\t\t\tconst neighborColor = color.get(neighborId)\n\n\t\t\tif (neighborColor === Color.Gray) {\n\t\t\t\t// Back edge found - cycle detected\n\t\t\t\tconst cyclePath = reconstructCycle(nodeId, neighborId)\n\t\t\t\tconst allowed = isCycleAllowed(cyclePath, screenMap)\n\t\t\t\tcycles.push({ cycle: cyclePath, allowed })\n\t\t\t} else if (neighborColor === Color.White) {\n\t\t\t\t// Only visit if the neighbor exists in our screen map\n\t\t\t\tif (screenMap.has(neighborId)) {\n\t\t\t\t\tdfs(neighborId, nodeId)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If Black, already fully processed - skip\n\t\t}\n\n\t\tcolor.set(nodeId, Color.Black)\n\t}\n\n\t/**\n\t * Reconstruct cycle path from back edge\n\t */\n\tfunction reconstructCycle(from: string, to: string): string[] {\n\t\tconst path: string[] = []\n\t\tlet current: string | null | undefined = from\n\t\tconst visited = new Set<string>()\n\t\tconst maxIterations = screenMap.size + 1\n\n\t\t// Trace back from 'from' to 'to' with loop guard\n\t\twhile (\n\t\t\tcurrent &&\n\t\t\tcurrent !== to &&\n\t\t\t!visited.has(current) &&\n\t\t\tpath.length < maxIterations\n\t\t) {\n\t\t\tvisited.add(current)\n\t\t\tpath.unshift(current)\n\t\t\tcurrent = parent.get(current)\n\t\t}\n\n\t\t// Add 'to' at the beginning (the cycle start)\n\t\tpath.unshift(to)\n\n\t\t// Add 'to' at the end to close the cycle\n\t\tpath.push(to)\n\n\t\treturn path\n\t}\n\n\tconst disallowedCycles = cycles.filter((c) => !c.allowed)\n\n\treturn {\n\t\thasCycles: cycles.length > 0,\n\t\tcycles,\n\t\tdisallowedCycles,\n\t\tduplicateIds,\n\t}\n}\n\n/**\n * Check if any screen in the cycle has allowCycles: true\n */\nfunction isCycleAllowed(\n\tcyclePath: string[],\n\tscreenMap: Map<string, Screen>,\n): boolean {\n\t// Exclude the last element as it's a duplicate of the first\n\tconst uniqueNodes = cyclePath.slice(0, -1)\n\n\tfor (const nodeId of uniqueNodes) {\n\t\tconst screen = screenMap.get(nodeId)\n\t\tif (screen?.allowCycles === true) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n/**\n * Format cycle information for console output\n *\n * @example\n * ```\n * Cycle 1: A → B → C → A\n * Cycle 2 (allowed): D → E → D\n * ```\n */\nexport function formatCycleWarnings(cycles: CycleInfo[]): string {\n\tif (cycles.length === 0) {\n\t\treturn \"\"\n\t}\n\n\tconst lines: string[] = []\n\n\tfor (let i = 0; i < cycles.length; i++) {\n\t\tconst cycle = cycles[i]\n\t\tif (!cycle) continue\n\n\t\tconst cycleStr = cycle.cycle.join(\" → \")\n\t\tconst allowedSuffix = cycle.allowed ? \" (allowed)\" : \"\"\n\t\tlines.push(` Cycle ${i + 1}${allowedSuffix}: ${cycleStr}`)\n\t}\n\n\treturn lines.join(\"\\n\")\n}\n\n/**\n * Get a summary of cycle detection results\n */\nexport function getCycleSummary(result: CycleDetectionResult): string {\n\tif (!result.hasCycles) {\n\t\treturn \"No circular navigation detected\"\n\t}\n\n\tconst total = result.cycles.length\n\tconst disallowed = result.disallowedCycles.length\n\tconst allowed = total - disallowed\n\n\tif (disallowed === 0) {\n\t\treturn `${total} circular navigation${total > 1 ? \"s\" : \"\"} detected (all allowed)`\n\t}\n\n\tif (allowed === 0) {\n\t\treturn `${total} circular navigation${total > 1 ? \"s\" : \"\"} detected`\n\t}\n\n\treturn `${total} circular navigation${total > 1 ? \"s\" : \"\"} detected (${disallowed} not allowed, ${allowed} allowed)`\n}\n","import type { ErrorOptions } from \"./logger.js\"\n\n/**\n * Centralized error definitions for consistent error messages across CLI commands\n */\nexport const ERRORS = {\n\t// ============================================\n\t// Configuration Errors\n\t// ============================================\n\n\tROUTES_PATTERN_MISSING: {\n\t\ttitle: \"Routes configuration not found\",\n\t\tsuggestion:\n\t\t\t\"Add routesPattern (for file-based routing) or routesFile (for config-based routing) to your screenbook.config.ts.\",\n\t\texample: `import { defineConfig } from \"@screenbook/core\"\n\n// Option 1: File-based routing (Next.js, Nuxt, etc.)\nexport default defineConfig({\n routesPattern: \"src/pages/**/page.tsx\",\n})\n\n// Option 2: Config-based routing (Vue Router, React Router, etc.)\nexport default defineConfig({\n routesFile: \"src/router/routes.ts\",\n})`,\n\t} satisfies ErrorOptions,\n\n\tROUTES_FILE_NOT_FOUND: (filePath: string): ErrorOptions => ({\n\t\ttitle: `Routes file not found: ${filePath}`,\n\t\tsuggestion:\n\t\t\t\"Check the routesFile path in your screenbook.config.ts. The file should export a routes array.\",\n\t\texample: `import { defineConfig } from \"@screenbook/core\"\n\nexport default defineConfig({\n routesFile: \"src/router/routes.ts\", // Make sure this file exists\n})`,\n\t}),\n\n\tROUTES_FILE_PARSE_ERROR: (filePath: string, error: string): ErrorOptions => ({\n\t\ttitle: `Failed to parse routes file: ${filePath}`,\n\t\tmessage: error,\n\t\tsuggestion:\n\t\t\t\"Ensure the file exports a valid routes array. Check for syntax errors or unsupported patterns.\",\n\t}),\n\n\tCONFIG_NOT_FOUND: {\n\t\ttitle: \"Configuration file not found\",\n\t\tsuggestion:\n\t\t\t\"Run 'screenbook init' to create a screenbook.config.ts file, or create one manually.\",\n\t\texample: `import { defineConfig } from \"@screenbook/core\"\n\nexport default defineConfig({\n metaPattern: \"src/**/screen.meta.ts\",\n})`,\n\t} satisfies ErrorOptions,\n\n\t// ============================================\n\t// Build/File Errors\n\t// ============================================\n\n\tSCREENS_NOT_FOUND: {\n\t\ttitle: \"screens.json not found\",\n\t\tsuggestion: \"Run 'screenbook build' first to generate the screen catalog.\",\n\t\tmessage:\n\t\t\t\"If you haven't set up Screenbook yet, run 'screenbook init' to get started.\",\n\t} satisfies ErrorOptions,\n\n\tSCREENS_PARSE_ERROR: {\n\t\ttitle: \"Failed to parse screens.json\",\n\t\tsuggestion:\n\t\t\t\"The screens.json file may be corrupted. Try running 'screenbook build' to regenerate it.\",\n\t} satisfies ErrorOptions,\n\n\tMETA_FILE_LOAD_ERROR: (filePath: string): ErrorOptions => ({\n\t\ttitle: `Failed to load ${filePath}`,\n\t\tsuggestion:\n\t\t\t\"Check the file for syntax errors or missing exports. The file should export a 'screen' object.\",\n\t\texample: `import { defineScreen } from \"@screenbook/core\"\n\nexport const screen = defineScreen({\n id: \"example.screen\",\n title: \"Example Screen\",\n route: \"/example\",\n})`,\n\t}),\n\n\t// ============================================\n\t// Command Argument Errors\n\t// ============================================\n\n\tAPI_NAME_REQUIRED: {\n\t\ttitle: \"API name is required\",\n\t\tsuggestion: \"Provide the API name as an argument.\",\n\t\texample: `screenbook impact UserAPI.getProfile\nscreenbook impact \"PaymentAPI.*\" # Use quotes for patterns`,\n\t} satisfies ErrorOptions,\n\n\t// ============================================\n\t// Git Errors\n\t// ============================================\n\n\tGIT_CHANGED_FILES_ERROR: (baseBranch: string): ErrorOptions => ({\n\t\ttitle: \"Failed to get changed files from git\",\n\t\tmessage: `Make sure you are in a git repository and the base branch '${baseBranch}' exists.`,\n\t\tsuggestion: `Verify the base branch exists with: git branch -a | grep ${baseBranch}`,\n\t}),\n\n\tGIT_NOT_REPOSITORY: {\n\t\ttitle: \"Not a git repository\",\n\t\tsuggestion:\n\t\t\t\"This command requires a git repository. Initialize one with 'git init' or navigate to an existing repository.\",\n\t} satisfies ErrorOptions,\n\n\t// ============================================\n\t// Server Errors\n\t// ============================================\n\n\tSERVER_START_FAILED: (error: string): ErrorOptions => ({\n\t\ttitle: \"Failed to start development server\",\n\t\tmessage: error,\n\t\tsuggestion:\n\t\t\t\"Check if the port is already in use or if there are any dependency issues.\",\n\t}),\n\n\t// ============================================\n\t// Validation Errors\n\t// ============================================\n\n\tVALIDATION_FAILED: (errorCount: number): ErrorOptions => ({\n\t\ttitle: `Validation failed with ${errorCount} error${errorCount === 1 ? \"\" : \"s\"}`,\n\t\tsuggestion:\n\t\t\t\"Fix the validation errors above. Screen references must point to existing screens.\",\n\t}),\n\n\t// ============================================\n\t// Lint Errors\n\t// ============================================\n\n\tLINT_MISSING_META: (\n\t\tmissingCount: number,\n\t\ttotalRoutes: number,\n\t): ErrorOptions => ({\n\t\ttitle: `${missingCount} route${missingCount === 1 ? \"\" : \"s\"} missing screen.meta.ts`,\n\t\tmessage: `Found ${totalRoutes} route file${totalRoutes === 1 ? \"\" : \"s\"}, but ${missingCount} ${missingCount === 1 ? \"is\" : \"are\"} missing colocated screen.meta.ts.`,\n\t\tsuggestion:\n\t\t\t\"Add screen.meta.ts files next to your route files, or run 'screenbook generate' to create them.\",\n\t}),\n\n\t// ============================================\n\t// Cycle Detection Errors\n\t// ============================================\n\n\tCYCLES_DETECTED: (cycleCount: number): ErrorOptions => ({\n\t\ttitle: `${cycleCount} circular navigation${cycleCount === 1 ? \"\" : \"s\"} detected`,\n\t\tsuggestion:\n\t\t\t\"Review the navigation flow. Use 'allowCycles: true' in screen.meta.ts to allow intentional cycles, or use --allow-cycles to suppress all warnings.\",\n\t\texample: `// Allow a specific screen to be part of cycles\nexport const screen = defineScreen({\n id: \"billing.invoice.detail\",\n next: [\"billing.invoices\"],\n allowCycles: true, // This cycle is intentional\n})`,\n\t}),\n}\n","import pc from \"picocolors\"\n\n/**\n * Structured error options for detailed error messages\n */\nexport interface ErrorOptions {\n\t/** Error title (shown after \"Error:\") */\n\ttitle: string\n\t/** Additional error message/details */\n\tmessage?: string\n\t/** Actionable suggestion for the user */\n\tsuggestion?: string\n\t/** Code example to help the user */\n\texample?: string\n}\n\n/**\n * Logger utility for consistent, color-coded CLI output\n */\nexport const logger = {\n\t// ============================================\n\t// Status Messages\n\t// ============================================\n\n\t/**\n\t * Success message (green checkmark)\n\t */\n\tsuccess: (msg: string): void => {\n\t\tconsole.log(`${pc.green(\"✓\")} ${msg}`)\n\t},\n\n\t/**\n\t * Error message (red X)\n\t */\n\terror: (msg: string): void => {\n\t\tconsole.error(`${pc.red(\"✗\")} ${pc.red(`Error: ${msg}`)}`)\n\t},\n\n\t/**\n\t * Warning message (yellow warning sign)\n\t */\n\twarn: (msg: string): void => {\n\t\tconsole.log(`${pc.yellow(\"⚠\")} ${pc.yellow(`Warning: ${msg}`)}`)\n\t},\n\n\t/**\n\t * Info message (cyan info icon)\n\t */\n\tinfo: (msg: string): void => {\n\t\tconsole.log(`${pc.cyan(\"ℹ\")} ${msg}`)\n\t},\n\n\t// ============================================\n\t// Detailed Error with Guidance\n\t// ============================================\n\n\t/**\n\t * Display a detailed error with actionable suggestions\n\t */\n\terrorWithHelp: (options: ErrorOptions): void => {\n\t\tconst { title, message, suggestion, example } = options\n\n\t\tconsole.error()\n\t\tconsole.error(`${pc.red(\"✗\")} ${pc.red(`Error: ${title}`)}`)\n\n\t\tif (message) {\n\t\t\tconsole.error()\n\t\t\tconsole.error(` ${message}`)\n\t\t}\n\n\t\tif (suggestion) {\n\t\t\tconsole.error()\n\t\t\tconsole.error(` ${pc.cyan(\"Suggestion:\")} ${suggestion}`)\n\t\t}\n\n\t\tif (example) {\n\t\t\tconsole.error()\n\t\t\tconsole.error(` ${pc.dim(\"Example:\")}`)\n\t\t\tfor (const line of example.split(\"\\n\")) {\n\t\t\t\tconsole.error(` ${pc.dim(line)}`)\n\t\t\t}\n\t\t}\n\n\t\tconsole.error()\n\t},\n\n\t// ============================================\n\t// Progress Indicators\n\t// ============================================\n\n\t/**\n\t * Step indicator (dimmed arrow)\n\t */\n\tstep: (msg: string): void => {\n\t\tconsole.log(`${pc.dim(\"→\")} ${msg}`)\n\t},\n\n\t/**\n\t * Done/completed indicator (green checkmark with green text)\n\t */\n\tdone: (msg: string): void => {\n\t\tconsole.log(`${pc.green(\"✓\")} ${pc.green(msg)}`)\n\t},\n\n\t/**\n\t * Item success (green checkmark, indented)\n\t */\n\titemSuccess: (msg: string): void => {\n\t\tconsole.log(` ${pc.green(\"✓\")} ${msg}`)\n\t},\n\n\t/**\n\t * Item failure (red X, indented)\n\t */\n\titemError: (msg: string): void => {\n\t\tconsole.log(` ${pc.red(\"✗\")} ${msg}`)\n\t},\n\n\t/**\n\t * Item warning (yellow warning, indented)\n\t */\n\titemWarn: (msg: string): void => {\n\t\tconsole.log(` ${pc.yellow(\"⚠\")} ${msg}`)\n\t},\n\n\t// ============================================\n\t// Plain Output\n\t// ============================================\n\n\t/**\n\t * Plain log (no prefix)\n\t */\n\tlog: (msg: string): void => {\n\t\tconsole.log(msg)\n\t},\n\n\t/**\n\t * Blank line\n\t */\n\tblank: (): void => {\n\t\tconsole.log()\n\t},\n\n\t// ============================================\n\t// Formatting Helpers\n\t// ============================================\n\n\t/**\n\t * Bold text\n\t */\n\tbold: (msg: string): string => pc.bold(msg),\n\n\t/**\n\t * Dimmed text\n\t */\n\tdim: (msg: string): string => pc.dim(msg),\n\n\t/**\n\t * Code/command text (cyan)\n\t */\n\tcode: (msg: string): string => pc.cyan(msg),\n\n\t/**\n\t * File path text (underlined)\n\t */\n\tpath: (msg: string): string => pc.underline(msg),\n\n\t/**\n\t * Highlight text (cyan bold)\n\t */\n\thighlight: (msg: string): string => pc.cyan(pc.bold(msg)),\n\n\t/**\n\t * Green text\n\t */\n\tgreen: (msg: string): string => pc.green(msg),\n\n\t/**\n\t * Red text\n\t */\n\tred: (msg: string): string => pc.red(msg),\n\n\t/**\n\t * Yellow text\n\t */\n\tyellow: (msg: string): string => pc.yellow(msg),\n}\n","import type { Screen } from \"@screenbook/core\"\n\nexport interface ValidationError {\n\tscreenId: string\n\tfield: \"next\" | \"entryPoints\"\n\tinvalidRef: string\n\tsuggestion?: string\n}\n\nexport interface ValidationResult {\n\tvalid: boolean\n\terrors: ValidationError[]\n}\n\n/**\n * Validate screen references (next and entryPoints)\n */\nexport function validateScreenReferences(screens: Screen[]): ValidationResult {\n\tconst screenIds = new Set(screens.map((s) => s.id))\n\tconst errors: ValidationError[] = []\n\n\tfor (const screen of screens) {\n\t\t// Validate next references\n\t\tif (screen.next) {\n\t\t\tfor (const nextId of screen.next) {\n\t\t\t\tif (!screenIds.has(nextId)) {\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tscreenId: screen.id,\n\t\t\t\t\t\tfield: \"next\",\n\t\t\t\t\t\tinvalidRef: nextId,\n\t\t\t\t\t\tsuggestion: findSimilar(nextId, screenIds),\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Validate entryPoints references\n\t\tif (screen.entryPoints) {\n\t\t\tfor (const entryId of screen.entryPoints) {\n\t\t\t\tif (!screenIds.has(entryId)) {\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tscreenId: screen.id,\n\t\t\t\t\t\tfield: \"entryPoints\",\n\t\t\t\t\t\tinvalidRef: entryId,\n\t\t\t\t\t\tsuggestion: findSimilar(entryId, screenIds),\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\tvalid: errors.length === 0,\n\t\terrors,\n\t}\n}\n\n/**\n * Find similar screen ID using Levenshtein distance\n */\nfunction findSimilar(\n\ttarget: string,\n\tcandidates: Set<string>,\n): string | undefined {\n\tlet bestMatch: string | undefined\n\tlet bestDistance = Number.POSITIVE_INFINITY\n\n\t// Only suggest if distance is reasonable (less than 40% of target length)\n\tconst maxDistance = Math.ceil(target.length * 0.4)\n\n\tfor (const candidate of candidates) {\n\t\tconst distance = levenshteinDistance(target, candidate)\n\t\tif (distance < bestDistance && distance <= maxDistance) {\n\t\t\tbestDistance = distance\n\t\t\tbestMatch = candidate\n\t\t}\n\t}\n\n\treturn bestMatch\n}\n\n/**\n * Calculate Levenshtein distance between two strings\n */\nfunction levenshteinDistance(a: string, b: string): number {\n\t// Pre-initialize matrix with proper dimensions\n\tconst matrix: number[][] = Array.from({ length: a.length + 1 }, () =>\n\t\tArray.from({ length: b.length + 1 }, () => 0),\n\t)\n\n\t// Helper to safely get/set matrix values (matrix is pre-initialized, so these are always valid)\n\tconst get = (i: number, j: number): number => matrix[i]?.[j] ?? 0\n\tconst set = (i: number, j: number, value: number): void => {\n\t\tconst row = matrix[i]\n\t\tif (row) row[j] = value\n\t}\n\n\t// Initialize first column\n\tfor (let i = 0; i <= a.length; i++) {\n\t\tset(i, 0, i)\n\t}\n\n\t// Initialize first row\n\tfor (let j = 0; j <= b.length; j++) {\n\t\tset(0, j, j)\n\t}\n\n\t// Fill the matrix\n\tfor (let i = 1; i <= a.length; i++) {\n\t\tfor (let j = 1; j <= b.length; j++) {\n\t\t\tconst cost = a[i - 1] === b[j - 1] ? 0 : 1\n\t\t\tset(\n\t\t\t\ti,\n\t\t\t\tj,\n\t\t\t\tMath.min(\n\t\t\t\t\tget(i - 1, j) + 1, // deletion\n\t\t\t\t\tget(i, j - 1) + 1, // insertion\n\t\t\t\t\tget(i - 1, j - 1) + cost, // substitution\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\n\treturn get(a.length, b.length)\n}\n\n/**\n * Format validation errors for console output\n */\nexport function formatValidationErrors(errors: ValidationError[]): string {\n\tconst lines: string[] = []\n\n\tfor (const error of errors) {\n\t\tlines.push(` Screen \"${error.screenId}\"`)\n\t\tlines.push(\n\t\t\t` → ${error.field} references non-existent screen \"${error.invalidRef}\"`,\n\t\t)\n\t\tif (error.suggestion) {\n\t\t\tlines.push(` Did you mean \"${error.suggestion}\"?`)\n\t\t}\n\t\tlines.push(\"\")\n\t}\n\n\treturn lines.join(\"\\n\")\n}\n","import { existsSync, mkdirSync, writeFileSync } from \"node:fs\"\nimport { dirname, join, resolve } from \"node:path\"\nimport type { Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport { createJiti } from \"jiti\"\nimport { glob } from \"tinyglobby\"\nimport { loadConfig } from \"../utils/config.js\"\nimport {\n\tdetectCycles,\n\tformatCycleWarnings,\n\tgetCycleSummary,\n} from \"../utils/cycleDetection.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport { logger } from \"../utils/logger.js\"\nimport {\n\tformatValidationErrors,\n\tvalidateScreenReferences,\n} from \"../utils/validation.js\"\n\nexport interface CoverageData {\n\ttotal: number\n\tcovered: number\n\tpercentage: number\n\tmissing: Array<{\n\t\troute: string\n\t\tsuggestedPath: string\n\t}>\n\tbyOwner: Record<string, { count: number; screens: string[] }>\n\tbyTag: Record<string, number>\n\ttimestamp: string\n}\n\nexport const buildCommand = define({\n\tname: \"build\",\n\tdescription: \"Build screen metadata JSON from screen.meta.ts files\",\n\targs: {\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\toutDir: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"o\",\n\t\t\tdescription: \"Output directory\",\n\t\t},\n\t\tstrict: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"s\",\n\t\t\tdescription: \"Fail on validation errors and disallowed cycles\",\n\t\t\tdefault: false,\n\t\t},\n\t\tallowCycles: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription: \"Suppress all circular navigation warnings\",\n\t\t\tdefault: false,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst outDir = ctx.values.outDir ?? config.outDir\n\t\tconst cwd = process.cwd()\n\n\t\tlogger.info(\"Building screen metadata...\")\n\n\t\t// Find all screen.meta.ts files\n\t\tconst files = await glob(config.metaPattern, {\n\t\t\tcwd,\n\t\t\tignore: config.ignore,\n\t\t})\n\n\t\tif (files.length === 0) {\n\t\t\tlogger.warn(\n\t\t\t\t`No screen.meta.ts files found matching: ${config.metaPattern}`,\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\tlogger.info(`Found ${files.length} screen files`)\n\n\t\t// Create jiti instance for loading TypeScript files\n\t\tconst jiti = createJiti(cwd)\n\n\t\t// Extended screen type with file path (for internal use)\n\t\ttype ScreenWithFilePath = Screen & { filePath: string }\n\n\t\t// Load and collect screen metadata\n\t\tconst screens: ScreenWithFilePath[] = []\n\n\t\tfor (const file of files) {\n\t\t\tconst absolutePath = resolve(cwd, file)\n\n\t\t\ttry {\n\t\t\t\tconst module = (await jiti.import(absolutePath)) as { screen?: Screen }\n\t\t\t\tif (module.screen) {\n\t\t\t\t\tscreens.push({ ...module.screen, filePath: absolutePath })\n\t\t\t\t\tlogger.itemSuccess(module.screen.id)\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tlogger.itemError(`Failed to load ${file}`)\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\tlogger.log(` ${logger.dim(error.message)}`)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Validate screen references\n\t\tconst validation = validateScreenReferences(screens)\n\t\tif (!validation.valid) {\n\t\t\tlogger.blank()\n\t\t\tlogger.warn(\"Invalid screen references found:\")\n\t\t\tlogger.log(formatValidationErrors(validation.errors))\n\n\t\t\tif (ctx.values.strict) {\n\t\t\t\tlogger.errorWithHelp(ERRORS.VALIDATION_FAILED(validation.errors.length))\n\t\t\t\tprocess.exit(1)\n\t\t\t}\n\t\t}\n\n\t\t// Detect circular navigation\n\t\tif (!ctx.values.allowCycles) {\n\t\t\tconst cycleResult = detectCycles(screens)\n\t\t\tif (cycleResult.hasCycles) {\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.warn(getCycleSummary(cycleResult))\n\t\t\t\tlogger.log(formatCycleWarnings(cycleResult.cycles))\n\n\t\t\t\tif (ctx.values.strict && cycleResult.disallowedCycles.length > 0) {\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.errorWithHelp(\n\t\t\t\t\t\tERRORS.CYCLES_DETECTED(cycleResult.disallowedCycles.length),\n\t\t\t\t\t)\n\t\t\t\t\tprocess.exit(1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Generate screens.json\n\t\tconst outputPath = join(cwd, outDir, \"screens.json\")\n\t\tconst outputDir = dirname(outputPath)\n\n\t\tif (!existsSync(outputDir)) {\n\t\t\tmkdirSync(outputDir, { recursive: true })\n\t\t}\n\n\t\twriteFileSync(outputPath, JSON.stringify(screens, null, 2))\n\t\tlogger.blank()\n\t\tlogger.success(`Generated ${logger.path(outputPath)}`)\n\n\t\t// Generate Mermaid graph\n\t\tconst mermaidPath = join(cwd, outDir, \"graph.mmd\")\n\t\tconst mermaidContent = generateMermaidGraph(screens)\n\t\twriteFileSync(mermaidPath, mermaidContent)\n\t\tlogger.success(`Generated ${logger.path(mermaidPath)}`)\n\n\t\t// Generate coverage.json\n\t\tconst coverage = await generateCoverageData(config, cwd, screens)\n\t\tconst coveragePath = join(cwd, outDir, \"coverage.json\")\n\t\twriteFileSync(coveragePath, JSON.stringify(coverage, null, 2))\n\t\tlogger.success(`Generated ${logger.path(coveragePath)}`)\n\t\tlogger.blank()\n\t\tlogger.done(\n\t\t\t`Coverage: ${coverage.covered}/${coverage.total} (${coverage.percentage}%)`,\n\t\t)\n\t},\n})\n\nasync function generateCoverageData(\n\tconfig: { routesPattern?: string; metaPattern: string; ignore: string[] },\n\tcwd: string,\n\tscreens: Screen[],\n): Promise<CoverageData> {\n\t// Get all route files if routesPattern is configured\n\tlet routeFiles: string[] = []\n\tif (config.routesPattern) {\n\t\trouteFiles = await glob(config.routesPattern, {\n\t\t\tcwd,\n\t\t\tignore: config.ignore,\n\t\t})\n\t}\n\n\t// Get directories that have screen.meta.ts\n\tconst _metaDirs = new Set(\n\t\tscreens.map((s) => {\n\t\t\t// Extract directory from route or id\n\t\t\tconst parts = s.id.split(\".\")\n\t\t\treturn parts.slice(0, -1).join(\"/\") || parts[0]\n\t\t}),\n\t)\n\n\t// Find missing routes (routes without screen.meta.ts)\n\tconst missing: CoverageData[\"missing\"] = []\n\tfor (const routeFile of routeFiles) {\n\t\tconst routeDir = dirname(routeFile)\n\t\tconst hasMetaFile = screens.some((s) => {\n\t\t\t// Check if any screen's route matches this route file's directory\n\t\t\tconst screenDir = s.id.replace(/\\./g, \"/\")\n\t\t\treturn (\n\t\t\t\trouteDir.includes(screenDir) ||\n\t\t\t\tscreenDir.includes(\n\t\t\t\t\trouteDir.replace(/^src\\/pages\\//, \"\").replace(/^app\\//, \"\"),\n\t\t\t\t)\n\t\t\t)\n\t\t})\n\n\t\tif (!hasMetaFile) {\n\t\t\tmissing.push({\n\t\t\t\troute: routeFile,\n\t\t\t\tsuggestedPath: join(dirname(routeFile), \"screen.meta.ts\"),\n\t\t\t})\n\t\t}\n\t}\n\n\t// Calculate coverage\n\tconst total = routeFiles.length > 0 ? routeFiles.length : screens.length\n\tconst covered = screens.length\n\tconst percentage = total > 0 ? Math.round((covered / total) * 100) : 100\n\n\t// Group by owner\n\tconst byOwner: CoverageData[\"byOwner\"] = {}\n\tfor (const screen of screens) {\n\t\tconst owners = screen.owner || [\"unassigned\"]\n\t\tfor (const owner of owners) {\n\t\t\tif (!byOwner[owner]) {\n\t\t\t\tbyOwner[owner] = { count: 0, screens: [] }\n\t\t\t}\n\t\t\tbyOwner[owner].count++\n\t\t\tbyOwner[owner].screens.push(screen.id)\n\t\t}\n\t}\n\n\t// Group by tag\n\tconst byTag: CoverageData[\"byTag\"] = {}\n\tfor (const screen of screens) {\n\t\tconst tags = screen.tags || []\n\t\tfor (const tag of tags) {\n\t\t\tbyTag[tag] = (byTag[tag] || 0) + 1\n\t\t}\n\t}\n\n\treturn {\n\t\ttotal,\n\t\tcovered,\n\t\tpercentage,\n\t\tmissing,\n\t\tbyOwner,\n\t\tbyTag,\n\t\ttimestamp: new Date().toISOString(),\n\t}\n}\n\nfunction generateMermaidGraph(screens: Screen[]): string {\n\tconst lines: string[] = [\"flowchart TD\"]\n\n\t// Create nodes\n\tfor (const screen of screens) {\n\t\tconst label = screen.title.replace(/\"/g, \"'\")\n\t\tlines.push(` ${sanitizeId(screen.id)}[\"${label}\"]`)\n\t}\n\n\tlines.push(\"\")\n\n\t// Create edges from next relationships\n\tfor (const screen of screens) {\n\t\tif (screen.next) {\n\t\t\tfor (const nextId of screen.next) {\n\t\t\t\tlines.push(` ${sanitizeId(screen.id)} --> ${sanitizeId(nextId)}`)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\")\n}\n\nfunction sanitizeId(id: string): string {\n\treturn id.replace(/\\./g, \"_\")\n}\n","import { spawn } from \"node:child_process\"\nimport { copyFileSync, existsSync, mkdirSync, writeFileSync } from \"node:fs\"\nimport { createRequire } from \"node:module\"\nimport { dirname, join, resolve } from \"node:path\"\nimport type { Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport { createJiti } from \"jiti\"\nimport { glob } from \"tinyglobby\"\nimport { loadConfig } from \"../utils/config.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport { logger } from \"../utils/logger.js\"\n\nexport const devCommand = define({\n\tname: \"dev\",\n\tdescription: \"Start the Screenbook development server\",\n\targs: {\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\tport: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"p\",\n\t\t\tdescription: \"Port to run the server on\",\n\t\t\tdefault: \"4321\",\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst port = ctx.values.port ?? \"4321\"\n\t\tconst cwd = process.cwd()\n\n\t\tlogger.info(\"Starting Screenbook development server...\")\n\n\t\t// First, build the screen metadata\n\t\tawait buildScreens(config, cwd)\n\n\t\t// Find the UI package location\n\t\tconst uiPackagePath = resolveUiPackage()\n\n\t\tif (!uiPackagePath) {\n\t\t\tlogger.errorWithHelp({\n\t\t\t\ttitle: \"Could not find @screenbook/ui package\",\n\t\t\t\tsuggestion:\n\t\t\t\t\t\"Make sure @screenbook/ui is installed. Run 'npm install @screenbook/ui' or 'pnpm add @screenbook/ui'.\",\n\t\t\t})\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\t// Copy screens.json and coverage.json to UI package\n\t\tconst screensJsonPath = join(cwd, config.outDir, \"screens.json\")\n\t\tconst coverageJsonPath = join(cwd, config.outDir, \"coverage.json\")\n\t\tconst uiScreensDir = join(uiPackagePath, \".screenbook\")\n\n\t\tif (!existsSync(uiScreensDir)) {\n\t\t\tmkdirSync(uiScreensDir, { recursive: true })\n\t\t}\n\n\t\tif (existsSync(screensJsonPath)) {\n\t\t\tcopyFileSync(screensJsonPath, join(uiScreensDir, \"screens.json\"))\n\t\t}\n\n\t\tif (existsSync(coverageJsonPath)) {\n\t\t\tcopyFileSync(coverageJsonPath, join(uiScreensDir, \"coverage.json\"))\n\t\t}\n\n\t\t// Start Astro dev server\n\t\tlogger.blank()\n\t\tlogger.info(\n\t\t\t`Starting UI server on ${logger.highlight(`http://localhost:${port}`)}`,\n\t\t)\n\n\t\tconst astroProcess = spawn(\"npx\", [\"astro\", \"dev\", \"--port\", port], {\n\t\t\tcwd: uiPackagePath,\n\t\t\tstdio: \"inherit\",\n\t\t\tshell: true,\n\t\t})\n\n\t\tastroProcess.on(\"error\", (error) => {\n\t\t\tlogger.errorWithHelp(ERRORS.SERVER_START_FAILED(error.message))\n\t\t\tprocess.exit(1)\n\t\t})\n\n\t\tastroProcess.on(\"close\", (code) => {\n\t\t\tprocess.exit(code ?? 0)\n\t\t})\n\n\t\t// Handle graceful shutdown\n\t\tprocess.on(\"SIGINT\", () => {\n\t\t\tastroProcess.kill(\"SIGINT\")\n\t\t})\n\n\t\tprocess.on(\"SIGTERM\", () => {\n\t\t\tastroProcess.kill(\"SIGTERM\")\n\t\t})\n\t},\n})\n\nasync function buildScreens(\n\tconfig: { metaPattern: string; outDir: string; ignore: string[] },\n\tcwd: string,\n): Promise<void> {\n\tconst files = await glob(config.metaPattern, {\n\t\tcwd,\n\t\tignore: config.ignore,\n\t})\n\n\tif (files.length === 0) {\n\t\tlogger.warn(`No screen.meta.ts files found matching: ${config.metaPattern}`)\n\t\treturn\n\t}\n\n\tlogger.info(`Found ${files.length} screen files`)\n\n\t// Extended screen type with file path (for internal use)\n\ttype ScreenWithFilePath = Screen & { filePath: string }\n\n\tconst jiti = createJiti(cwd)\n\tconst screens: ScreenWithFilePath[] = []\n\n\tfor (const file of files) {\n\t\tconst absolutePath = resolve(cwd, file)\n\n\t\ttry {\n\t\t\tconst module = (await jiti.import(absolutePath)) as { screen?: Screen }\n\t\t\tif (module.screen) {\n\t\t\t\tscreens.push({ ...module.screen, filePath: absolutePath })\n\t\t\t\tlogger.itemSuccess(module.screen.id)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogger.itemError(`Failed to load ${file}`)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tlogger.log(` ${logger.dim(error.message)}`)\n\t\t\t}\n\t\t}\n\t}\n\n\tconst outputPath = join(cwd, config.outDir, \"screens.json\")\n\tconst outputDir = dirname(outputPath)\n\n\tif (!existsSync(outputDir)) {\n\t\tmkdirSync(outputDir, { recursive: true })\n\t}\n\n\twriteFileSync(outputPath, JSON.stringify(screens, null, 2))\n\tlogger.blank()\n\tlogger.success(`Generated ${logger.path(outputPath)}`)\n}\n\nfunction resolveUiPackage(): string | null {\n\t// Try to resolve @screenbook/ui from node_modules\n\ttry {\n\t\tconst require = createRequire(import.meta.url)\n\t\tconst uiPackageJson = require.resolve(\"@screenbook/ui/package.json\")\n\t\treturn dirname(uiPackageJson)\n\t} catch {\n\t\t// Fallback: look in common locations\n\t\tconst possiblePaths = [\n\t\t\tjoin(process.cwd(), \"node_modules\", \"@screenbook\", \"ui\"),\n\t\t\tjoin(process.cwd(), \"..\", \"ui\"),\n\t\t\tjoin(process.cwd(), \"packages\", \"ui\"),\n\t\t]\n\n\t\tfor (const p of possiblePaths) {\n\t\t\tif (existsSync(join(p, \"package.json\"))) {\n\t\t\t\treturn p\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n}\n","import { existsSync, readFileSync } from \"node:fs\"\nimport { join, resolve } from \"node:path\"\nimport { define } from \"gunshi\"\nimport { glob } from \"tinyglobby\"\nimport { loadConfig } from \"../utils/config.js\"\nimport { logger } from \"../utils/logger.js\"\n\nconst CONFIG_FILES = [\n\t\"screenbook.config.ts\",\n\t\"screenbook.config.js\",\n\t\"screenbook.config.mjs\",\n]\n\nexport interface CheckResult {\n\tname: string\n\tstatus: \"pass\" | \"fail\" | \"warn\"\n\tmessage: string\n\tsuggestion?: string\n}\n\ninterface PackageJson {\n\tdependencies?: Record<string, string>\n\tdevDependencies?: Record<string, string>\n}\n\nexport const doctorCommand = define({\n\tname: \"doctor\",\n\tdescription: \"Diagnose common issues with Screenbook setup\",\n\targs: {\n\t\tverbose: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"v\",\n\t\t\tdescription: \"Show detailed output\",\n\t\t\tdefault: false,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst cwd = process.cwd()\n\t\tconst verbose = ctx.values.verbose\n\n\t\tlogger.log(\"\")\n\t\tlogger.log(logger.bold(\"Screenbook Doctor\"))\n\t\tlogger.log(\"─────────────────\")\n\t\tlogger.log(\"\")\n\n\t\tconst results: CheckResult[] = []\n\n\t\t// Run all checks\n\t\tresults.push(await checkConfigFile(cwd))\n\t\tresults.push(await checkDependencies(cwd))\n\n\t\t// Load config for remaining checks\n\t\tconst config = await loadConfig()\n\n\t\tresults.push(await checkMetaPattern(cwd, config.metaPattern, config.ignore))\n\t\tresults.push(\n\t\t\tawait checkRoutesPattern(cwd, config.routesPattern, config.ignore),\n\t\t)\n\t\tresults.push(await checkBuildOutput(cwd, config.outDir))\n\t\tresults.push(await checkVersionCompatibility(cwd))\n\t\tresults.push(await checkGitRepository(cwd))\n\n\t\t// Display results\n\t\tdisplayResults(results, verbose)\n\t},\n})\n\n// Exported for testing\nexport async function checkConfigFile(cwd: string): Promise<CheckResult> {\n\tfor (const configFile of CONFIG_FILES) {\n\t\tconst absolutePath = resolve(cwd, configFile)\n\t\tif (existsSync(absolutePath)) {\n\t\t\treturn {\n\t\t\t\tname: \"Config file\",\n\t\t\t\tstatus: \"pass\",\n\t\t\t\tmessage: `Found: ${configFile}`,\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\tname: \"Config file\",\n\t\tstatus: \"warn\",\n\t\tmessage: \"No config file found (using defaults)\",\n\t\tsuggestion: \"Run 'screenbook init' to create a config file\",\n\t}\n}\n\nexport async function checkDependencies(cwd: string): Promise<CheckResult> {\n\tconst packageJsonPath = join(cwd, \"package.json\")\n\n\tif (!existsSync(packageJsonPath)) {\n\t\treturn {\n\t\t\tname: \"Dependencies\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: \"package.json not found\",\n\t\t\tsuggestion: \"Run 'npm init' or 'pnpm init' to create package.json\",\n\t\t}\n\t}\n\n\ttry {\n\t\tconst content = readFileSync(packageJsonPath, \"utf-8\")\n\t\tconst pkg = JSON.parse(content) as PackageJson\n\n\t\tconst allDeps = { ...pkg.dependencies, ...pkg.devDependencies }\n\t\tconst unifiedVersion = allDeps.screenbook\n\t\tconst coreVersion = allDeps[\"@screenbook/core\"]\n\t\tconst cliVersion = allDeps[\"@screenbook/cli\"]\n\n\t\t// Check for unified screenbook package first\n\t\tif (unifiedVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Dependencies\",\n\t\t\t\tstatus: \"pass\",\n\t\t\t\tmessage: `screenbook@${unifiedVersion}`,\n\t\t\t}\n\t\t}\n\n\t\tif (!coreVersion && !cliVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Dependencies\",\n\t\t\t\tstatus: \"fail\",\n\t\t\t\tmessage: \"Screenbook packages not installed\",\n\t\t\t\tsuggestion:\n\t\t\t\t\t\"Run 'pnpm add -D screenbook' or 'pnpm add -D @screenbook/core @screenbook/cli' to install\",\n\t\t\t}\n\t\t}\n\n\t\tif (!coreVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Dependencies\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: \"@screenbook/core not found in dependencies\",\n\t\t\t\tsuggestion: \"Run 'pnpm add -D @screenbook/core' to install\",\n\t\t\t}\n\t\t}\n\n\t\tif (!cliVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Dependencies\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: \"@screenbook/cli not found in dependencies\",\n\t\t\t\tsuggestion: \"Run 'pnpm add -D @screenbook/cli' to install\",\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tname: \"Dependencies\",\n\t\t\tstatus: \"pass\",\n\t\t\tmessage: `@screenbook/core@${coreVersion}, @screenbook/cli@${cliVersion}`,\n\t\t}\n\t} catch {\n\t\treturn {\n\t\t\tname: \"Dependencies\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: \"Failed to read package.json\",\n\t\t\tsuggestion: \"Ensure package.json is valid JSON\",\n\t\t}\n\t}\n}\n\nexport async function checkMetaPattern(\n\tcwd: string,\n\tmetaPattern: string,\n\tignore: string[],\n): Promise<CheckResult> {\n\ttry {\n\t\tconst files = await glob(metaPattern, { cwd, ignore })\n\n\t\tif (files.length === 0) {\n\t\t\treturn {\n\t\t\t\tname: \"Screen meta files\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: `No files matching: ${metaPattern}`,\n\t\t\t\tsuggestion: \"Run 'screenbook generate' to create screen.meta.ts files\",\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tname: \"Screen meta files\",\n\t\t\tstatus: \"pass\",\n\t\t\tmessage: `Found ${files.length} screen.meta.ts file${files.length > 1 ? \"s\" : \"\"}`,\n\t\t}\n\t} catch {\n\t\treturn {\n\t\t\tname: \"Screen meta files\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: `Invalid pattern: ${metaPattern}`,\n\t\t\tsuggestion: \"Check metaPattern in your config file\",\n\t\t}\n\t}\n}\n\nexport async function checkRoutesPattern(\n\tcwd: string,\n\troutesPattern: string | undefined,\n\tignore: string[],\n): Promise<CheckResult> {\n\tif (!routesPattern) {\n\t\treturn {\n\t\t\tname: \"Routes pattern\",\n\t\t\tstatus: \"warn\",\n\t\t\tmessage: \"routesPattern not configured\",\n\t\t\tsuggestion:\n\t\t\t\t\"Set routesPattern in config to enable 'lint' and 'generate' commands\",\n\t\t}\n\t}\n\n\ttry {\n\t\tconst files = await glob(routesPattern, { cwd, ignore })\n\n\t\tif (files.length === 0) {\n\t\t\treturn {\n\t\t\t\tname: \"Routes pattern\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: `No files matching: ${routesPattern}`,\n\t\t\t\tsuggestion: \"Check routesPattern in your config file\",\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tname: \"Routes pattern\",\n\t\t\tstatus: \"pass\",\n\t\t\tmessage: `Found ${files.length} route file${files.length > 1 ? \"s\" : \"\"}`,\n\t\t}\n\t} catch {\n\t\treturn {\n\t\t\tname: \"Routes pattern\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: `Invalid pattern: ${routesPattern}`,\n\t\t\tsuggestion: \"Check routesPattern in your config file\",\n\t\t}\n\t}\n}\n\nexport async function checkBuildOutput(\n\tcwd: string,\n\toutDir: string,\n): Promise<CheckResult> {\n\tconst screensJsonPath = join(cwd, outDir, \"screens.json\")\n\n\tif (!existsSync(screensJsonPath)) {\n\t\treturn {\n\t\t\tname: \"Build output\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: `screens.json not found in ${outDir}/`,\n\t\t\tsuggestion: \"Run 'screenbook build' to generate metadata\",\n\t\t}\n\t}\n\n\ttry {\n\t\tconst content = readFileSync(screensJsonPath, \"utf-8\")\n\t\tconst screens = JSON.parse(content) as unknown[]\n\n\t\treturn {\n\t\t\tname: \"Build output\",\n\t\t\tstatus: \"pass\",\n\t\t\tmessage: `screens.json contains ${screens.length} screen${screens.length > 1 ? \"s\" : \"\"}`,\n\t\t}\n\t} catch {\n\t\treturn {\n\t\t\tname: \"Build output\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: \"screens.json is corrupted\",\n\t\t\tsuggestion: \"Run 'screenbook build' to regenerate\",\n\t\t}\n\t}\n}\n\nexport async function checkVersionCompatibility(\n\tcwd: string,\n): Promise<CheckResult> {\n\tconst packageJsonPath = join(cwd, \"package.json\")\n\n\tif (!existsSync(packageJsonPath)) {\n\t\treturn {\n\t\t\tname: \"Version compatibility\",\n\t\t\tstatus: \"warn\",\n\t\t\tmessage: \"Cannot check - package.json not found\",\n\t\t}\n\t}\n\n\ttry {\n\t\tconst content = readFileSync(packageJsonPath, \"utf-8\")\n\t\tconst pkg = JSON.parse(content) as PackageJson\n\n\t\tconst allDeps = { ...pkg.dependencies, ...pkg.devDependencies }\n\t\tconst unifiedVersion = allDeps.screenbook\n\t\tconst coreVersion = allDeps[\"@screenbook/core\"]\n\t\tconst cliVersion = allDeps[\"@screenbook/cli\"]\n\n\t\t// Unified package - no compatibility check needed\n\t\tif (unifiedVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Version compatibility\",\n\t\t\t\tstatus: \"pass\",\n\t\t\t\tmessage: \"Using unified screenbook package\",\n\t\t\t}\n\t\t}\n\n\t\tif (!coreVersion || !cliVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Version compatibility\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: \"Cannot check - packages not installed\",\n\t\t\t}\n\t\t}\n\n\t\t// Extract major version (handle ^, ~, etc.)\n\t\tconst extractMajor = (version: string): string => {\n\t\t\tconst cleaned = version.replace(/^[\\^~>=<]+/, \"\")\n\t\t\treturn cleaned.split(\".\")[0] ?? \"0\"\n\t\t}\n\n\t\tconst coreMajor = extractMajor(coreVersion)\n\t\tconst cliMajor = extractMajor(cliVersion)\n\n\t\tif (coreMajor !== cliMajor) {\n\t\t\treturn {\n\t\t\t\tname: \"Version compatibility\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: `Major version mismatch: core@${coreVersion} vs cli@${cliVersion}`,\n\t\t\t\tsuggestion: \"Update packages to matching major versions\",\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tname: \"Version compatibility\",\n\t\t\tstatus: \"pass\",\n\t\t\tmessage: \"Package versions are compatible\",\n\t\t}\n\t} catch {\n\t\treturn {\n\t\t\tname: \"Version compatibility\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: \"Failed to read package.json\",\n\t\t}\n\t}\n}\n\nexport async function checkGitRepository(cwd: string): Promise<CheckResult> {\n\tconst gitDir = join(cwd, \".git\")\n\n\tif (!existsSync(gitDir)) {\n\t\treturn {\n\t\t\tname: \"Git repository\",\n\t\t\tstatus: \"warn\",\n\t\t\tmessage: \"Not a git repository\",\n\t\t\tsuggestion:\n\t\t\t\t\"Run 'git init' to enable 'pr-impact' command for PR analysis\",\n\t\t}\n\t}\n\n\treturn {\n\t\tname: \"Git repository\",\n\t\tstatus: \"pass\",\n\t\tmessage: \"Git repository detected\",\n\t}\n}\n\nfunction displayResults(results: CheckResult[], verbose: boolean): void {\n\tlet passCount = 0\n\tlet failCount = 0\n\tlet warnCount = 0\n\n\tfor (const result of results) {\n\t\tconst icon =\n\t\t\tresult.status === \"pass\"\n\t\t\t\t? logger.green(\"✓\")\n\t\t\t\t: result.status === \"fail\"\n\t\t\t\t\t? logger.red(\"✗\")\n\t\t\t\t\t: logger.yellow(\"⚠\")\n\n\t\tconst statusColor =\n\t\t\tresult.status === \"pass\"\n\t\t\t\t? logger.green\n\t\t\t\t: result.status === \"fail\"\n\t\t\t\t\t? logger.red\n\t\t\t\t\t: logger.yellow\n\n\t\tlogger.log(`${icon} ${statusColor(result.name)}: ${result.message}`)\n\n\t\tif (result.suggestion && (result.status !== \"pass\" || verbose)) {\n\t\t\tlogger.log(` ${logger.dim(\"→\")} ${result.suggestion}`)\n\t\t}\n\n\t\tif (result.status === \"pass\") passCount++\n\t\telse if (result.status === \"fail\") failCount++\n\t\telse warnCount++\n\t}\n\n\tlogger.log(\"\")\n\n\tconst summary: string[] = []\n\tif (passCount > 0) summary.push(logger.green(`${passCount} passed`))\n\tif (failCount > 0) summary.push(logger.red(`${failCount} failed`))\n\tif (warnCount > 0) summary.push(logger.yellow(`${warnCount} warnings`))\n\n\tlogger.log(`Summary: ${summary.join(\", \")}`)\n\n\tif (failCount > 0) {\n\t\tlogger.log(\"\")\n\t\tlogger.log(\n\t\t\tlogger.dim(\"Run the suggested commands above to fix the issues.\"),\n\t\t)\n\t}\n}\n","import { resolve } from \"node:path\"\n\n/**\n * Supported router types for auto-detection.\n * Detection order: TanStack Router -> Solid Router -> Angular Router -> React Router -> Vue Router.\n */\nexport type RouterType =\n\t| \"react-router\"\n\t| \"vue-router\"\n\t| \"tanstack-router\"\n\t| \"solid-router\"\n\t| \"angular-router\"\n\t| \"unknown\"\n\n/**\n * Parsed route from router config (Vue Router, React Router, etc.)\n */\nexport interface ParsedRoute {\n\tpath: string\n\tname?: string\n\tcomponent?: string\n\tchildren?: ParsedRoute[]\n\tredirect?: string\n}\n\n/**\n * Flattened route with computed properties\n */\nexport interface FlatRoute {\n\t/** Full path including parent paths */\n\tfullPath: string\n\t/** Route name if defined */\n\tname?: string\n\t/** Component file path if available */\n\tcomponentPath?: string\n\t/** Computed screen ID from path */\n\tscreenId: string\n\t/** Computed screen title from path */\n\tscreenTitle: string\n\t/** Nesting depth */\n\tdepth: number\n}\n\n/**\n * Result of parsing a router config file\n */\nexport interface ParseResult {\n\troutes: ParsedRoute[]\n\twarnings: string[]\n}\n\n/**\n * Resolve relative import path to absolute path\n */\nexport function resolveImportPath(importPath: string, baseDir: string): string {\n\tif (importPath.startsWith(\".\")) {\n\t\treturn resolve(baseDir, importPath)\n\t}\n\treturn importPath\n}\n\n/**\n * Flatten nested routes into a flat list with computed properties\n */\nexport function flattenRoutes(\n\troutes: ParsedRoute[],\n\tparentPath = \"\",\n\tdepth = 0,\n): FlatRoute[] {\n\tconst result: FlatRoute[] = []\n\n\tfor (const route of routes) {\n\t\t// Skip redirect-only routes\n\t\tif (route.redirect && !route.component) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Compute full path\n\t\tlet fullPath: string\n\t\tif (route.path.startsWith(\"/\")) {\n\t\t\tfullPath = route.path\n\t\t} else if (parentPath === \"/\") {\n\t\t\tfullPath = `/${route.path}`\n\t\t} else {\n\t\t\tfullPath = parentPath ? `${parentPath}/${route.path}` : `/${route.path}`\n\t\t}\n\n\t\t// Normalize path\n\t\tfullPath = fullPath.replace(/\\/+/g, \"/\")\n\t\tif (fullPath !== \"/\" && fullPath.endsWith(\"/\")) {\n\t\t\tfullPath = fullPath.slice(0, -1)\n\t\t}\n\n\t\t// Handle empty path (index routes)\n\t\tif (fullPath === \"\") {\n\t\t\tfullPath = parentPath || \"/\"\n\t\t}\n\n\t\t// Only add routes with components (skip abstract parent routes)\n\t\tif (route.component || !route.children) {\n\t\t\tresult.push({\n\t\t\t\tfullPath,\n\t\t\t\tname: route.name,\n\t\t\t\tcomponentPath: route.component,\n\t\t\t\tscreenId: pathToScreenId(fullPath),\n\t\t\t\tscreenTitle: pathToScreenTitle(fullPath),\n\t\t\t\tdepth,\n\t\t\t})\n\t\t}\n\n\t\t// Process children\n\t\tif (route.children) {\n\t\t\tresult.push(...flattenRoutes(route.children, fullPath, depth + 1))\n\t\t}\n\t}\n\n\treturn result\n}\n\n/**\n * Convert route path to screen ID\n * /user/:id/profile -> user.id.profile\n */\nexport function pathToScreenId(path: string): string {\n\tif (path === \"/\" || path === \"\") {\n\t\treturn \"home\"\n\t}\n\n\treturn path\n\t\t.replace(/^\\//, \"\") // Remove leading slash\n\t\t.replace(/\\/$/, \"\") // Remove trailing slash\n\t\t.split(\"/\")\n\t\t.map((segment) => {\n\t\t\t// Convert :param to param\n\t\t\tif (segment.startsWith(\":\")) {\n\t\t\t\treturn segment.slice(1)\n\t\t\t}\n\t\t\t// Convert *catchall or ** to catchall\n\t\t\tif (segment.startsWith(\"*\")) {\n\t\t\t\t// Handle ** (Angular) as catchall\n\t\t\t\tif (segment === \"**\") {\n\t\t\t\t\treturn \"catchall\"\n\t\t\t\t}\n\t\t\t\treturn segment.slice(1) || \"catchall\"\n\t\t\t}\n\t\t\treturn segment\n\t\t})\n\t\t.join(\".\")\n}\n\n/**\n * Convert route path to screen title\n * /user/:id/profile -> Profile\n */\nexport function pathToScreenTitle(path: string): string {\n\tif (path === \"/\" || path === \"\") {\n\t\treturn \"Home\"\n\t}\n\n\tconst segments = path\n\t\t.replace(/^\\//, \"\")\n\t\t.replace(/\\/$/, \"\")\n\t\t.split(\"/\")\n\t\t.filter((s) => !s.startsWith(\":\") && !s.startsWith(\"*\"))\n\n\tconst lastSegment = segments[segments.length - 1] || \"Home\"\n\n\t// Convert kebab-case or snake_case to Title Case\n\treturn lastSegment\n\t\t.split(/[-_]/)\n\t\t.map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(\" \")\n}\n","import { readFileSync } from \"node:fs\"\nimport { dirname, resolve } from \"node:path\"\nimport { parse } from \"@babel/parser\"\nimport {\n\ttype ParsedRoute,\n\ttype ParseResult,\n\tresolveImportPath,\n} from \"./routeParserUtils.js\"\n\n// Re-export shared types\nexport type { ParsedRoute, ParseResult }\n\n/**\n * Parse Angular Router configuration file and extract routes.\n * Supports both Standalone (Angular 14+) and NgModule patterns.\n *\n * Supported patterns:\n * - `export const routes: Routes = [...]`\n * - `const routes: Routes = [...]`\n * - `RouterModule.forRoot([...])`\n * - `RouterModule.forChild([...])`\n * - `export default [...]`\n * - `export default [...] satisfies Routes`\n *\n * @param filePath - Path to the router configuration file\n * @param preloadedContent - Optional pre-read file content. When provided, the file is not read from disk,\n * enabling testing with virtual content or avoiding duplicate file reads.\n * @returns ParseResult containing extracted routes and any warnings\n * @throws Error if the file cannot be read or contains syntax errors\n */\nexport function parseAngularRouterConfig(\n\tfilePath: string,\n\tpreloadedContent?: string,\n): ParseResult {\n\tconst absolutePath = resolve(filePath)\n\tconst routesFileDir = dirname(absolutePath)\n\tconst warnings: string[] = []\n\n\t// Read file with proper error handling (skip if content is preloaded)\n\tlet content: string\n\tif (preloadedContent !== undefined) {\n\t\tcontent = preloadedContent\n\t} else {\n\t\ttry {\n\t\t\tcontent = readFileSync(absolutePath, \"utf-8\")\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to read routes file \"${absolutePath}\": ${message}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Parse with Babel - wrap for better error messages\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", [\"decorators\", { decoratorsBeforeExport: true }]],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Syntax error in routes file \"${absolutePath}\": ${error.message}`,\n\t\t\t)\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tthrow new Error(`Failed to parse routes file \"${absolutePath}\": ${message}`)\n\t}\n\n\tconst routes: ParsedRoute[] = []\n\n\t// Find routes array in the AST\n\tfor (const node of ast.program.body) {\n\t\t// Handle: const routes: Routes = [...] or export const routes: Routes = [...]\n\t\tif (node.type === \"VariableDeclaration\") {\n\t\t\tfor (const decl of node.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\t// Check if it looks like a routes array (name contains \"route\" or has Routes type)\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\t\t\t\t\tconst typeAnnotation = (decl.id as any).typeAnnotation?.typeAnnotation\n\t\t\t\t\tconst isRoutesVariable =\n\t\t\t\t\t\tdecl.id.name.toLowerCase().includes(\"route\") ||\n\t\t\t\t\t\t(typeAnnotation?.type === \"TSTypeReference\" &&\n\t\t\t\t\t\t\ttypeAnnotation.typeName?.type === \"Identifier\" &&\n\t\t\t\t\t\t\ttypeAnnotation.typeName.name === \"Routes\")\n\t\t\t\t\tif (isRoutesVariable) {\n\t\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export const routes: Routes = [...]\n\t\tif (\n\t\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t\t) {\n\t\t\tfor (const decl of node.declaration.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\t\t\t\t\tconst typeAnnotation = (decl.id as any).typeAnnotation?.typeAnnotation\n\t\t\t\t\tconst isRoutesVariable =\n\t\t\t\t\t\tdecl.id.name.toLowerCase().includes(\"route\") ||\n\t\t\t\t\t\t(typeAnnotation?.type === \"TSTypeReference\" &&\n\t\t\t\t\t\t\ttypeAnnotation.typeName?.type === \"Identifier\" &&\n\t\t\t\t\t\t\ttypeAnnotation.typeName.name === \"Routes\")\n\t\t\t\t\tif (isRoutesVariable) {\n\t\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export default [...] (less common but possible)\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(node.declaration, routesFileDir, warnings)\n\t\t\troutes.push(...parsed)\n\t\t}\n\n\t\t// Handle: export default [...] satisfies Routes\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"TSSatisfiesExpression\" &&\n\t\t\tnode.declaration.expression.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(\n\t\t\t\tnode.declaration.expression,\n\t\t\t\troutesFileDir,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t\troutes.push(...parsed)\n\t\t}\n\n\t\t// Handle NgModule pattern: RouterModule.forRoot([...]) or RouterModule.forChild([...])\n\t\t// This can appear in @NgModule decorator or as a call expression\n\t\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\t\tlet classNode: any = null\n\t\tif (node.type === \"ClassDeclaration\") {\n\t\t\tclassNode = node\n\t\t} else if (\n\t\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: AST node types require type assertions\n\t\t\t(node as any).declaration?.type === \"ClassDeclaration\"\n\t\t) {\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: AST node types require type assertions\n\t\t\tclassNode = (node as any).declaration\n\t\t}\n\n\t\tif (classNode) {\n\t\t\tconst decorators = classNode.decorators || []\n\t\t\tfor (const decorator of decorators) {\n\t\t\t\tif (decorator.expression?.type === \"CallExpression\") {\n\t\t\t\t\tconst routesFromDecorator = extractRoutesFromNgModule(\n\t\t\t\t\t\tdecorator.expression,\n\t\t\t\t\t\troutesFileDir,\n\t\t\t\t\t\twarnings,\n\t\t\t\t\t)\n\t\t\t\t\troutes.push(...routesFromDecorator)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle standalone RouterModule.forRoot/forChild calls in exports\n\t\tif (node.type === \"ExpressionStatement\") {\n\t\t\tconst routesFromExpr = extractRoutesFromExpression(\n\t\t\t\tnode.expression,\n\t\t\t\troutesFileDir,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t\troutes.push(...routesFromExpr)\n\t\t}\n\t}\n\n\t// Warn if no routes were found\n\tif (routes.length === 0) {\n\t\twarnings.push(\n\t\t\t\"No routes found. Supported patterns: 'export const routes: Routes = [...]', 'RouterModule.forRoot([...])', or 'RouterModule.forChild([...])'\",\n\t\t)\n\t}\n\n\treturn { routes, warnings }\n}\n\n/**\n * Extract routes from @NgModule decorator\n */\nfunction extractRoutesFromNgModule(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tcallExpr: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\t// Check if it's @NgModule({...})\n\tif (\n\t\tcallExpr.callee?.type === \"Identifier\" &&\n\t\tcallExpr.callee.name === \"NgModule\"\n\t) {\n\t\tconst arg = callExpr.arguments[0]\n\t\tif (arg?.type === \"ObjectExpression\") {\n\t\t\tfor (const prop of arg.properties) {\n\t\t\t\tif (\n\t\t\t\t\tprop.type === \"ObjectProperty\" &&\n\t\t\t\t\tprop.key?.type === \"Identifier\" &&\n\t\t\t\t\tprop.key.name === \"imports\"\n\t\t\t\t) {\n\t\t\t\t\tif (prop.value?.type === \"ArrayExpression\") {\n\t\t\t\t\t\tfor (const element of prop.value.elements) {\n\t\t\t\t\t\t\tif (!element) continue\n\t\t\t\t\t\t\tconst extracted = extractRoutesFromExpression(\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\tbaseDir,\n\t\t\t\t\t\t\t\twarnings,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\troutes.push(...extracted)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Extract routes from RouterModule.forRoot/forChild call expressions\n */\nfunction extractRoutesFromExpression(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\tif (node?.type !== \"CallExpression\") return routes\n\n\tconst callee = node.callee\n\tif (\n\t\tcallee?.type === \"MemberExpression\" &&\n\t\tcallee.object?.type === \"Identifier\" &&\n\t\tcallee.object.name === \"RouterModule\" &&\n\t\tcallee.property?.type === \"Identifier\" &&\n\t\t(callee.property.name === \"forRoot\" || callee.property.name === \"forChild\")\n\t) {\n\t\tconst routesArg = node.arguments[0]\n\t\tif (routesArg?.type === \"ArrayExpression\") {\n\t\t\tconst parsed = parseRoutesArray(routesArg, baseDir, warnings)\n\t\t\troutes.push(...parsed)\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Parse an array expression containing route objects\n */\nfunction parseRoutesArray(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tarrayNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const element of arrayNode.elements) {\n\t\tif (!element) continue\n\n\t\t// Handle spread elements\n\t\tif (element.type === \"SpreadElement\") {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Spread operator detected${loc}. Routes from spread cannot be statically analyzed.`,\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\n\t\tif (element.type === \"ObjectExpression\") {\n\t\t\tconst parsedRoute = parseRouteObject(element, baseDir, warnings)\n\t\t\tif (parsedRoute) {\n\t\t\t\troutes.push(parsedRoute)\n\t\t\t}\n\t\t} else {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Non-object route element (${element.type})${loc}. Only object literals can be statically analyzed.`,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Parse a single route object expression\n */\nfunction parseRouteObject(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tobjectNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute | null {\n\tlet path: string | undefined\n\tlet component: string | undefined\n\tlet children: ParsedRoute[] | undefined\n\tlet redirectTo: string | undefined\n\tlet hasPath = false\n\n\tfor (const prop of objectNode.properties) {\n\t\tif (prop.type !== \"ObjectProperty\") continue\n\t\tif (prop.key.type !== \"Identifier\") continue\n\n\t\tconst key = prop.key.name\n\n\t\tswitch (key) {\n\t\t\tcase \"path\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\tpath = prop.value.value\n\t\t\t\t\thasPath = true\n\t\t\t\t} else {\n\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t`Dynamic path value (${prop.value.type})${loc}. Only string literal paths can be statically analyzed.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"component\":\n\t\t\t\t// Direct component reference: component: HomeComponent\n\t\t\t\tif (prop.value.type === \"Identifier\") {\n\t\t\t\t\tcomponent = prop.value.name\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"loadComponent\":\n\t\t\t\t// Lazy component: loadComponent: () => import('./path').then(m => m.Component)\n\t\t\t\tcomponent = extractLazyComponent(prop.value, baseDir, warnings)\n\t\t\t\tbreak\n\n\t\t\tcase \"loadChildren\": {\n\t\t\t\t// Lazy children: loadChildren: () => import('./path').then(m => m.routes)\n\t\t\t\t// We just note this for now - the actual routes are in another file\n\t\t\t\tconst lazyPath = extractLazyPath(prop.value, baseDir, warnings)\n\t\t\t\tif (lazyPath) {\n\t\t\t\t\tcomponent = `[lazy: ${lazyPath}]`\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tcase \"children\":\n\t\t\t\tif (prop.value.type === \"ArrayExpression\") {\n\t\t\t\t\tchildren = parseRoutesArray(prop.value, baseDir, warnings)\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"redirectTo\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\tredirectTo = prop.value.value\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\t// Skip these properties (not relevant for screen detection)\n\t\t\tcase \"pathMatch\":\n\t\t\tcase \"canActivate\":\n\t\t\tcase \"canDeactivate\":\n\t\t\tcase \"canMatch\":\n\t\t\tcase \"resolve\":\n\t\t\tcase \"data\":\n\t\t\tcase \"title\":\n\t\t\tcase \"providers\":\n\t\t\tcase \"runGuardsAndResolvers\":\n\t\t\tcase \"outlet\":\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// Skip redirect-only routes (no component)\n\tif (redirectTo && !component && !children) {\n\t\treturn null\n\t}\n\n\t// Skip routes without path (unless they have children for layout purposes)\n\tif (!hasPath) {\n\t\tif (children && children.length > 0) {\n\t\t\treturn { path: \"\", component, children }\n\t\t}\n\t\treturn null\n\t}\n\n\treturn {\n\t\tpath: path || \"\",\n\t\tcomponent,\n\t\tchildren,\n\t}\n}\n\n/**\n * Extract component from lazy loadComponent pattern\n * loadComponent: () => import('./path').then(m => m.Component)\n */\nfunction extractLazyComponent(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Arrow function: () => import('./path').then(m => m.Component)\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\t// Handle .then(m => m.Component) chain\n\t\tif (\n\t\t\tbody.type === \"CallExpression\" &&\n\t\t\tbody.callee?.type === \"MemberExpression\" &&\n\t\t\tbody.callee.property?.type === \"Identifier\" &&\n\t\t\tbody.callee.property.name === \"then\"\n\t\t) {\n\t\t\tconst importCall = body.callee.object\n\t\t\tconst thenArg = body.arguments[0]\n\n\t\t\t// Check if it's an import() call\n\t\t\tif (\n\t\t\t\timportCall?.type === \"CallExpression\" &&\n\t\t\t\timportCall.callee?.type === \"Import\"\n\t\t\t) {\n\t\t\t\t// Check if the argument is a string literal\n\t\t\t\tif (importCall.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\t\tconst importPath = resolveImportPath(\n\t\t\t\t\t\timportCall.arguments[0].value,\n\t\t\t\t\t\tbaseDir,\n\t\t\t\t\t)\n\n\t\t\t\t\t// Extract component name from .then(m => m.Component)\n\t\t\t\t\tif (\n\t\t\t\t\t\tthenArg?.type === \"ArrowFunctionExpression\" &&\n\t\t\t\t\t\tthenArg.body?.type === \"MemberExpression\" &&\n\t\t\t\t\t\tthenArg.body.property?.type === \"Identifier\"\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn `${importPath}#${thenArg.body.property.name}`\n\t\t\t\t\t}\n\n\t\t\t\t\treturn importPath\n\t\t\t\t}\n\t\t\t\t// Dynamic import path - warn the user\n\t\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Lazy loadComponent with dynamic path${loc}. Only string literal imports can be analyzed.`,\n\t\t\t\t)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t}\n\n\t\t// Direct import without .then(): () => import('./path')\n\t\tif (body.type === \"CallExpression\" && body.callee?.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Lazy loadComponent with dynamic path${loc}. Only string literal imports can be analyzed.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\twarnings.push(\n\t\t`Unrecognized loadComponent pattern (${node.type})${loc}. Expected arrow function with import().then().`,\n\t)\n\treturn undefined\n}\n\n/**\n * Extract path from lazy loadChildren pattern\n * loadChildren: () => import('./path').then(m => m.routes)\n */\nfunction extractLazyPath(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\t// Handle .then() chain\n\t\tif (\n\t\t\tbody.type === \"CallExpression\" &&\n\t\t\tbody.callee?.type === \"MemberExpression\" &&\n\t\t\tbody.callee.property?.type === \"Identifier\" &&\n\t\t\tbody.callee.property.name === \"then\"\n\t\t) {\n\t\t\tconst importCall = body.callee.object\n\t\t\tif (\n\t\t\t\timportCall?.type === \"CallExpression\" &&\n\t\t\t\timportCall.callee?.type === \"Import\" &&\n\t\t\t\timportCall.arguments[0]?.type === \"StringLiteral\"\n\t\t\t) {\n\t\t\t\treturn resolveImportPath(importCall.arguments[0].value, baseDir)\n\t\t\t}\n\t\t}\n\n\t\t// Direct import without .then()\n\t\tif (body.type === \"CallExpression\" && body.callee?.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t}\n\t}\n\n\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\twarnings.push(\n\t\t`Unrecognized loadChildren pattern (${node.type})${loc}. Expected arrow function with import().`,\n\t)\n\treturn undefined\n}\n\n/**\n * Detect if content is Angular Router based on patterns.\n * Checks for @angular/router import, RouterModule patterns, or Routes type annotation.\n */\nexport function isAngularRouterContent(content: string): boolean {\n\t// Check for Angular Router import\n\tif (content.includes(\"@angular/router\")) {\n\t\treturn true\n\t}\n\n\t// Check for RouterModule patterns\n\tif (\n\t\tcontent.includes(\"RouterModule.forRoot\") ||\n\t\tcontent.includes(\"RouterModule.forChild\")\n\t) {\n\t\treturn true\n\t}\n\n\t// Check for Routes type annotation: : Routes = or : Routes[\n\tif (/:\\s*Routes\\s*[=[]/.test(content)) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n","import { readFileSync } from \"node:fs\"\nimport { dirname, resolve } from \"node:path\"\nimport { parse } from \"@babel/parser\"\nimport {\n\ttype ParsedRoute,\n\ttype ParseResult,\n\tresolveImportPath,\n} from \"./routeParserUtils.js\"\n\n// Re-export shared types\nexport type { ParsedRoute, ParseResult }\n\n/**\n * Parse Solid Router configuration file and extract routes.\n * Supports various export patterns including `export const routes`, `export default`,\n * and TypeScript's `satisfies` operator.\n *\n * @param filePath - Path to the router configuration file\n * @param preloadedContent - Optional pre-read file content to avoid duplicate file reads\n * @returns ParseResult containing extracted routes and any warnings\n * @throws Error if the file cannot be read or contains syntax errors\n */\nexport function parseSolidRouterConfig(\n\tfilePath: string,\n\tpreloadedContent?: string,\n): ParseResult {\n\tconst absolutePath = resolve(filePath)\n\tconst routesFileDir = dirname(absolutePath)\n\tconst warnings: string[] = []\n\n\t// Read file with proper error handling (skip if content is preloaded)\n\tlet content: string\n\tif (preloadedContent !== undefined) {\n\t\tcontent = preloadedContent\n\t} else {\n\t\ttry {\n\t\t\tcontent = readFileSync(absolutePath, \"utf-8\")\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to read routes file \"${absolutePath}\": ${message}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Parse with Babel - wrap for better error messages\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", \"jsx\"],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Syntax error in routes file \"${absolutePath}\": ${error.message}`,\n\t\t\t)\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tthrow new Error(`Failed to parse routes file \"${absolutePath}\": ${message}`)\n\t}\n\n\tconst routes: ParsedRoute[] = []\n\n\t// Find routes array in the AST\n\tfor (const node of ast.program.body) {\n\t\t// Handle: const routes = [...]\n\t\tif (node.type === \"VariableDeclaration\") {\n\t\t\tfor (const decl of node.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export const routes = [...]\n\t\tif (\n\t\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t\t) {\n\t\t\tfor (const decl of node.declaration.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export default [...]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(node.declaration, routesFileDir, warnings)\n\t\t\troutes.push(...parsed)\n\t\t}\n\n\t\t// Handle: export default [...] satisfies RouteDefinition[]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"TSSatisfiesExpression\" &&\n\t\t\tnode.declaration.expression.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(\n\t\t\t\tnode.declaration.expression,\n\t\t\t\troutesFileDir,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t\troutes.push(...parsed)\n\t\t}\n\t}\n\n\t// Warn if no routes were found\n\tif (routes.length === 0) {\n\t\twarnings.push(\n\t\t\t\"No routes found. Supported patterns: 'export const routes = [...]' or 'export default [...]'\",\n\t\t)\n\t}\n\n\treturn { routes, warnings }\n}\n\n/**\n * Parse an array expression containing route objects\n */\nfunction parseRoutesArray(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tarrayNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const element of arrayNode.elements) {\n\t\tif (!element) continue\n\n\t\t// Handle spread elements\n\t\tif (element.type === \"SpreadElement\") {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Spread operator detected${loc}. Routes from spread cannot be statically analyzed.`,\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\n\t\tif (element.type === \"ObjectExpression\") {\n\t\t\tconst parsedRoutes = parseRouteObject(element, baseDir, warnings)\n\t\t\troutes.push(...parsedRoutes)\n\t\t} else {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Non-object route element (${element.type})${loc}. Only object literals can be statically analyzed.`,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Parse a single route object expression\n * Returns array to handle multiple paths case: path: [\"/a\", \"/b\"]\n */\nfunction parseRouteObject(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tobjectNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tlet paths: string[] = []\n\tlet component: string | undefined\n\tlet children: ParsedRoute[] | undefined\n\tlet hasPath = false\n\n\tfor (const prop of objectNode.properties) {\n\t\tif (prop.type !== \"ObjectProperty\") continue\n\t\tif (prop.key.type !== \"Identifier\") continue\n\n\t\tconst key = prop.key.name\n\n\t\tswitch (key) {\n\t\t\tcase \"path\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\tpaths = [prop.value.value]\n\t\t\t\t\thasPath = true\n\t\t\t\t} else if (prop.value.type === \"ArrayExpression\") {\n\t\t\t\t\t// Solid Router supports path arrays: path: [\"/login\", \"/register\"]\n\t\t\t\t\tconst arrayElementCount = prop.value.elements.filter(Boolean).length\n\t\t\t\t\tpaths = extractPathArray(prop.value, warnings)\n\t\t\t\t\thasPath = paths.length > 0\n\t\t\t\t\t// Warn if path array had elements but none were extractable\n\t\t\t\t\tif (arrayElementCount > 0 && paths.length === 0) {\n\t\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t\t`Path array contains only dynamic values${loc}. No static paths could be extracted.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t`Dynamic path value (${prop.value.type})${loc}. Only string literal paths can be statically analyzed.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"component\":\n\t\t\t\tcomponent = extractComponent(prop.value, baseDir, warnings)\n\t\t\t\tbreak\n\n\t\t\tcase \"children\":\n\t\t\t\tif (prop.value.type === \"ArrayExpression\") {\n\t\t\t\t\tchildren = parseRoutesArray(prop.value, baseDir, warnings)\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\t// preload and matchFilters are ignored (not relevant for screen detection)\n\t\t}\n\t}\n\n\t// Skip routes without path (abstract layout wrappers)\n\tif (!hasPath) {\n\t\t// If it has children, process them with empty parent path contribution\n\t\tif (children && children.length > 0) {\n\t\t\treturn [{ path: \"\", component, children }]\n\t\t}\n\t\treturn []\n\t}\n\n\t// Create routes for each path (handles path arrays)\n\treturn paths.map((path) => ({\n\t\tpath,\n\t\tcomponent,\n\t\tchildren,\n\t}))\n}\n\n/**\n * Extract paths from array expression\n * path: [\"/login\", \"/register\"] -> [\"/login\", \"/register\"]\n */\nfunction extractPathArray(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tarrayNode: any,\n\twarnings: string[],\n): string[] {\n\tconst paths: string[] = []\n\n\tfor (const element of arrayNode.elements) {\n\t\tif (!element) continue\n\n\t\tif (element.type === \"StringLiteral\") {\n\t\t\tpaths.push(element.value)\n\t\t} else {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Non-string path in array (${element.type})${loc}. Only string literal paths can be analyzed.`,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn paths\n}\n\n/**\n * Extract component from various patterns\n * - Direct identifier: component: Home\n * - Lazy component: component: lazy(() => import(\"./Home\"))\n */\nfunction extractComponent(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Direct component reference: component: Home\n\tif (node.type === \"Identifier\") {\n\t\treturn node.name\n\t}\n\n\t// Lazy component: component: lazy(() => import(\"./path\"))\n\tif (node.type === \"CallExpression\") {\n\t\tconst callee = node.callee\n\t\tif (callee.type === \"Identifier\" && callee.name === \"lazy\") {\n\t\t\tconst lazyArg = node.arguments[0]\n\t\t\tif (lazyArg) {\n\t\t\t\treturn extractLazyImportPath(lazyArg, baseDir, warnings)\n\t\t\t}\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`lazy() called without arguments${loc}. Expected arrow function with import().`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// Other call expressions not supported - add warning\n\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\tconst calleeName = callee.type === \"Identifier\" ? callee.name : \"unknown\"\n\t\twarnings.push(\n\t\t\t`Unrecognized component pattern: ${calleeName}(...)${loc}. Only 'lazy(() => import(...))' is supported.`,\n\t\t)\n\t\treturn undefined\n\t}\n\n\t// Arrow function component: component: () => <Home />\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tif (node.body.type === \"JSXElement\") {\n\t\t\tconst openingElement = node.body.openingElement\n\t\t\tif (openingElement?.name?.type === \"JSXIdentifier\") {\n\t\t\t\treturn openingElement.name.name\n\t\t\t}\n\t\t\t// JSXMemberExpression (namespaced components like <UI.Button />)\n\t\t\tif (openingElement?.name?.type === \"JSXMemberExpression\") {\n\t\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Namespaced JSX component (e.g., <UI.Button />)${loc}. Component extraction not supported for member expressions. Consider using a direct component reference or create a wrapper component.`,\n\t\t\t\t)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t}\n\t\t// Block body arrow functions\n\t\tif (node.body.type === \"BlockStatement\") {\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Arrow function with block body${loc}. Only concise arrow functions returning JSX directly can be analyzed.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// JSX Fragments\n\t\tif (node.body.type === \"JSXFragment\") {\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`JSX Fragment detected${loc}. Cannot extract component name from fragments.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// Conditional expressions\n\t\tif (node.body.type === \"ConditionalExpression\") {\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\t// Try to extract component names from both branches for context\n\t\t\tlet componentInfo = \"\"\n\t\t\tconst consequent = node.body.consequent\n\t\t\tconst alternate = node.body.alternate\n\t\t\tif (\n\t\t\t\tconsequent?.type === \"JSXElement\" &&\n\t\t\t\talternate?.type === \"JSXElement\"\n\t\t\t) {\n\t\t\t\tconst consName = consequent.openingElement?.name?.name || \"unknown\"\n\t\t\t\tconst altName = alternate.openingElement?.name?.name || \"unknown\"\n\t\t\t\tcomponentInfo = ` (${consName} or ${altName})`\n\t\t\t}\n\t\t\twarnings.push(\n\t\t\t\t`Conditional component${componentInfo}${loc}. Only static JSX elements can be analyzed. Consider extracting to a separate component.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// Unrecognized arrow function body\n\t\tconst arrowLoc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\twarnings.push(\n\t\t\t`Unrecognized arrow function body (${node.body.type})${arrowLoc}. Component will not be extracted.`,\n\t\t)\n\t\treturn undefined\n\t}\n\n\t// Catch-all for unrecognized component patterns\n\tif (node) {\n\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\twarnings.push(\n\t\t\t`Unrecognized component pattern (${node.type})${loc}. Component will not be extracted.`,\n\t\t)\n\t}\n\treturn undefined\n}\n\n/**\n * Extract import path from lazy function argument\n * () => import(\"./pages/Dashboard\") -> resolved path\n */\nfunction extractLazyImportPath(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Arrow function: () => import('./path')\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\tif (body.type === \"CallExpression\" && body.callee.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t\t// Dynamic import argument\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Lazy import with dynamic path${loc}. Only string literal imports can be analyzed.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\t// Unrecognized lazy pattern\n\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\twarnings.push(\n\t\t`Unrecognized lazy pattern (${node.type})${loc}. Expected arrow function with import().`,\n\t)\n\treturn undefined\n}\n\n/**\n * Detect if content is Solid Router based on patterns.\n * Note: Called by detectRouterType() in reactRouterParser.ts before React Router detection\n * because Solid Router and React Router share similar syntax patterns (both use `path` and `component`).\n * The detection order matters: TanStack Router -> Solid Router -> Angular Router -> React Router -> Vue Router.\n */\nexport function isSolidRouterContent(content: string): boolean {\n\t// Check for Solid Router specific import\n\tif (content.includes(\"@solidjs/router\")) {\n\t\treturn true\n\t}\n\n\t// Check for old package name\n\tif (content.includes(\"solid-app-router\")) {\n\t\treturn true\n\t}\n\n\t// Check for Solid.js lazy with route pattern\n\t// This is a weaker check, so we need to be more specific\n\tif (\n\t\tcontent.includes(\"solid-js\") &&\n\t\t/\\blazy\\s*\\(/.test(content) &&\n\t\t/\\bcomponent\\s*:/.test(content) &&\n\t\t/\\bpath\\s*:/.test(content)\n\t) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n","import { readFileSync } from \"node:fs\"\nimport { dirname, resolve } from \"node:path\"\nimport { parse } from \"@babel/parser\"\nimport {\n\ttype ParsedRoute,\n\ttype ParseResult,\n\tresolveImportPath,\n} from \"./routeParserUtils.js\"\n\n// Re-export shared types\nexport type { ParsedRoute, ParseResult }\n\n/**\n * Internal route definition collected from createRoute/createRootRoute calls\n */\ninterface RouteDefinition {\n\tvariableName: string\n\tpath?: string\n\tcomponent?: string\n\tparentVariableName?: string\n\tisRoot: boolean\n\tchildren?: string[] // Variable names of child routes from addChildren\n}\n\n/**\n * Parse TanStack Router configuration file and extract routes\n */\nexport function parseTanStackRouterConfig(\n\tfilePath: string,\n\tpreloadedContent?: string,\n): ParseResult {\n\tconst absolutePath = resolve(filePath)\n\tconst routesFileDir = dirname(absolutePath)\n\tconst warnings: string[] = []\n\n\t// Read file with proper error handling (skip if content is preloaded)\n\tlet content: string\n\tif (preloadedContent !== undefined) {\n\t\tcontent = preloadedContent\n\t} else {\n\t\ttry {\n\t\t\tcontent = readFileSync(absolutePath, \"utf-8\")\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to read routes file \"${absolutePath}\": ${message}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Parse with Babel - wrap for better error messages\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", \"jsx\"],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Syntax error in routes file \"${absolutePath}\": ${error.message}`,\n\t\t\t)\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tthrow new Error(`Failed to parse routes file \"${absolutePath}\": ${message}`)\n\t}\n\n\t// Collect all route definitions from the AST\n\tconst routeMap = new Map<string, RouteDefinition>()\n\n\t// Two-pass AST processing is required because TanStack Router uses a function-based API\n\t// where routes are defined as variables and then composed using .addChildren().\n\t// Pass 1 must collect all route definitions first, so Pass 2 can resolve variable references.\n\n\t// First pass: collect all createRoute/createRootRoute calls\n\tfor (const node of ast.program.body) {\n\t\tcollectRouteDefinitions(node, routeMap, routesFileDir, warnings)\n\t}\n\n\t// Second pass: process addChildren calls to build parent-child relationships\n\tfor (const node of ast.program.body) {\n\t\tprocessAddChildrenCalls(node, routeMap, warnings)\n\t}\n\n\t// Build the route tree from collected definitions\n\tconst routes = buildRouteTree(routeMap, warnings)\n\n\t// Warn if no routes were found\n\tif (routes.length === 0) {\n\t\twarnings.push(\n\t\t\t\"No routes found. Supported patterns: 'createRootRoute()', 'createRoute()', and '.addChildren([...])'\",\n\t\t)\n\t}\n\n\treturn { routes, warnings }\n}\n\n/**\n * Collect route definitions from AST nodes\n */\nfunction collectRouteDefinitions(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\trouteMap: Map<string, RouteDefinition>,\n\tbaseDir: string,\n\twarnings: string[],\n): void {\n\t// Handle: const xxxRoute = createRoute({ ... }) or createRootRoute({ ... })\n\tif (node.type === \"VariableDeclaration\") {\n\t\tfor (const decl of node.declarations) {\n\t\t\tif (decl.id.type !== \"Identifier\") continue\n\n\t\t\tconst variableName = decl.id.name\n\n\t\t\t// Handle direct createRoute/createRootRoute call\n\t\t\tif (decl.init?.type === \"CallExpression\") {\n\t\t\t\tconst routeDef = extractRouteFromCallExpression(\n\t\t\t\t\tdecl.init,\n\t\t\t\t\tvariableName,\n\t\t\t\t\tbaseDir,\n\t\t\t\t\twarnings,\n\t\t\t\t)\n\t\t\t\tif (routeDef) {\n\t\t\t\t\trouteMap.set(variableName, routeDef)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle createRoute(...).lazy(...) pattern\n\t\t\tif (\n\t\t\t\tdecl.init?.type === \"CallExpression\" &&\n\t\t\t\tdecl.init.callee?.type === \"MemberExpression\" &&\n\t\t\t\tdecl.init.callee.property?.type === \"Identifier\" &&\n\t\t\t\tdecl.init.callee.property.name === \"lazy\"\n\t\t\t) {\n\t\t\t\t// The createRoute call is in callee.object\n\t\t\t\tconst createRouteCall = decl.init.callee.object\n\t\t\t\tif (createRouteCall?.type === \"CallExpression\") {\n\t\t\t\t\tconst routeDef = extractRouteFromCallExpression(\n\t\t\t\t\t\tcreateRouteCall,\n\t\t\t\t\t\tvariableName,\n\t\t\t\t\t\tbaseDir,\n\t\t\t\t\t\twarnings,\n\t\t\t\t\t)\n\t\t\t\t\tif (routeDef) {\n\t\t\t\t\t\t// Extract lazy import path\n\t\t\t\t\t\tconst lazyArg = decl.init.arguments[0]\n\t\t\t\t\t\tif (lazyArg) {\n\t\t\t\t\t\t\tconst lazyPath = extractLazyImportPath(lazyArg, baseDir, warnings)\n\t\t\t\t\t\t\tif (lazyPath) {\n\t\t\t\t\t\t\t\trouteDef.component = lazyPath\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trouteMap.set(variableName, routeDef)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Handle: export const xxxRoute = createRoute({ ... })\n\tif (\n\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t) {\n\t\tfor (const decl of node.declaration.declarations) {\n\t\t\tif (decl.id.type !== \"Identifier\") continue\n\n\t\t\tconst variableName = decl.id.name\n\n\t\t\tif (decl.init?.type === \"CallExpression\") {\n\t\t\t\tconst routeDef = extractRouteFromCallExpression(\n\t\t\t\t\tdecl.init,\n\t\t\t\t\tvariableName,\n\t\t\t\t\tbaseDir,\n\t\t\t\t\twarnings,\n\t\t\t\t)\n\t\t\t\tif (routeDef) {\n\t\t\t\t\trouteMap.set(variableName, routeDef)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Extract route definition from a CallExpression (createRoute or createRootRoute)\n */\nfunction extractRouteFromCallExpression(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tcallNode: any,\n\tvariableName: string,\n\tbaseDir: string,\n\twarnings: string[],\n): RouteDefinition | null {\n\tconst callee = callNode.callee\n\n\t// Check if it's createRoute or createRootRoute\n\tlet isRoot = false\n\tlet optionsArg = callNode.arguments[0]\n\n\tif (callee.type === \"Identifier\") {\n\t\tif (callee.name === \"createRootRoute\") {\n\t\t\tisRoot = true\n\t\t} else if (callee.name === \"createRootRouteWithContext\") {\n\t\t\tisRoot = true\n\t\t} else if (callee.name !== \"createRoute\") {\n\t\t\treturn null\n\t\t}\n\t} else if (callee.type === \"CallExpression\") {\n\t\t// Handle curried form: createRootRouteWithContext<T>()({...})\n\t\tconst innerCallee = callee.callee\n\t\tif (\n\t\t\tinnerCallee?.type === \"Identifier\" &&\n\t\t\tinnerCallee.name === \"createRootRouteWithContext\"\n\t\t) {\n\t\t\tisRoot = true\n\t\t\t// Options are in the outer call's arguments\n\t\t\toptionsArg = callNode.arguments[0]\n\t\t} else {\n\t\t\treturn null\n\t\t}\n\t} else {\n\t\treturn null\n\t}\n\n\tconst routeDef: RouteDefinition = {\n\t\tvariableName,\n\t\tisRoot,\n\t}\n\tif (optionsArg?.type === \"ObjectExpression\") {\n\t\tfor (const prop of optionsArg.properties) {\n\t\t\tif (prop.type !== \"ObjectProperty\") continue\n\t\t\tif (prop.key.type !== \"Identifier\") continue\n\n\t\t\tconst key = prop.key.name\n\n\t\t\tswitch (key) {\n\t\t\t\tcase \"path\":\n\t\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\t\t// Normalize TanStack Router path: $param -> :param\n\t\t\t\t\t\trouteDef.path = normalizeTanStackPath(prop.value.value)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t\t`Dynamic path value (${prop.value.type})${loc}. Only string literal paths can be statically analyzed.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"component\":\n\t\t\t\t\trouteDef.component = extractComponentValue(\n\t\t\t\t\t\tprop.value,\n\t\t\t\t\t\tbaseDir,\n\t\t\t\t\t\twarnings,\n\t\t\t\t\t)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"getParentRoute\":\n\t\t\t\t\t// Extract parent route variable name from arrow function\n\t\t\t\t\tif (prop.value.type === \"ArrowFunctionExpression\") {\n\t\t\t\t\t\tconst body = prop.value.body\n\t\t\t\t\t\tif (body.type === \"Identifier\") {\n\t\t\t\t\t\t\trouteDef.parentVariableName = body.name\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t\t\t`Dynamic getParentRoute${loc}. Only static route references can be analyzed.`,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn routeDef\n}\n\n/**\n * Extract component value from different patterns\n * Returns undefined with a warning for unrecognized patterns\n */\nfunction extractComponentValue(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Direct component reference: component: Home\n\tif (node.type === \"Identifier\") {\n\t\treturn node.name\n\t}\n\n\t// lazyRouteComponent(() => import('./path'))\n\tif (node.type === \"CallExpression\") {\n\t\tconst callee = node.callee\n\t\tif (callee.type === \"Identifier\" && callee.name === \"lazyRouteComponent\") {\n\t\t\tconst importArg = node.arguments[0]\n\t\t\tif (importArg) {\n\t\t\t\treturn extractLazyImportPath(importArg, baseDir, warnings)\n\t\t\t}\n\t\t\t// lazyRouteComponent called without arguments\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`lazyRouteComponent called without arguments${loc}. Expected arrow function with import().`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// Other call expressions are not supported\n\t\treturn undefined\n\t}\n\n\t// Arrow function component: component: () => <Home />\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\t// Check if body is JSX\n\t\tif (node.body.type === \"JSXElement\") {\n\t\t\tconst openingElement = node.body.openingElement\n\t\t\tif (openingElement?.name?.type === \"JSXIdentifier\") {\n\t\t\t\treturn openingElement.name.name\n\t\t\t}\n\t\t\t// Handle JSXMemberExpression like <Namespace.Component />\n\t\t\tif (openingElement?.name?.type === \"JSXMemberExpression\") {\n\t\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Namespaced JSX component${loc}. Component extraction not fully supported for member expressions.`,\n\t\t\t\t)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t}\n\t\t// Block body arrow functions: () => { return <Home /> }\n\t\tif (node.body.type === \"BlockStatement\") {\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Arrow function with block body${loc}. Only concise arrow functions returning JSX directly can be analyzed.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// JSX Fragment: () => <>...</>\n\t\tif (node.body.type === \"JSXFragment\") {\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`JSX Fragment detected${loc}. Cannot extract component name from fragments.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\treturn undefined\n}\n\n/**\n * Extract import path from lazy function patterns\n */\nfunction extractLazyImportPath(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Arrow function: () => import('./path')\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\t// Direct import: () => import('./path')\n\t\tif (body.type === \"CallExpression\" && body.callee.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t}\n\n\t\t// Chained: () => import('./path').then(d => d.Route)\n\t\tif (\n\t\t\tbody.type === \"CallExpression\" &&\n\t\t\tbody.callee.type === \"MemberExpression\" &&\n\t\t\tbody.callee.object?.type === \"CallExpression\" &&\n\t\t\tbody.callee.object.callee?.type === \"Import\"\n\t\t) {\n\t\t\tconst importCall = body.callee.object\n\t\t\tif (importCall.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(importCall.arguments[0].value, baseDir)\n\t\t\t}\n\t\t}\n\t}\n\n\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\twarnings.push(\n\t\t`Unrecognized lazy pattern (${node.type})${loc}. Expected arrow function with import().`,\n\t)\n\treturn undefined\n}\n\n/**\n * Process addChildren calls to establish parent-child relationships\n */\nfunction processAddChildrenCalls(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\trouteMap: Map<string, RouteDefinition>,\n\twarnings: string[],\n): void {\n\t// Handle: const routeTree = rootRoute.addChildren([...])\n\t// or: const routeTree = rootRoute.addChildren([indexRoute, aboutRoute.addChildren([...])])\n\tif (node.type === \"VariableDeclaration\") {\n\t\tfor (const decl of node.declarations) {\n\t\t\tprocessAddChildrenExpression(decl.init, routeMap, warnings)\n\t\t}\n\t}\n\n\t// Handle: export const routeTree = rootRoute.addChildren([...])\n\tif (\n\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t) {\n\t\tfor (const decl of node.declaration.declarations) {\n\t\t\tprocessAddChildrenExpression(decl.init, routeMap, warnings)\n\t\t}\n\t}\n}\n\n/**\n * Recursively process addChildren expressions\n */\nfunction processAddChildrenExpression(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\texpr: any,\n\trouteMap: Map<string, RouteDefinition>,\n\twarnings: string[],\n): string | undefined {\n\tif (!expr) return undefined\n\n\t// Handle: parentRoute.addChildren([...])\n\tif (\n\t\texpr.type === \"CallExpression\" &&\n\t\texpr.callee?.type === \"MemberExpression\" &&\n\t\texpr.callee.property?.type === \"Identifier\" &&\n\t\texpr.callee.property.name === \"addChildren\"\n\t) {\n\t\t// Get parent route variable name\n\t\tlet parentVarName: string | undefined\n\t\tif (expr.callee.object?.type === \"Identifier\") {\n\t\t\tparentVarName = expr.callee.object.name\n\t\t} else if (expr.callee.object?.type === \"CallExpression\") {\n\t\t\t// Nested addChildren: parentRoute.addChildren([...]).addChildren([...])\n\t\t\t// This is rare but handle recursively\n\t\t\tparentVarName = processAddChildrenExpression(\n\t\t\t\texpr.callee.object,\n\t\t\t\trouteMap,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t}\n\n\t\tif (!parentVarName) return undefined\n\n\t\tconst parentDef = routeMap.get(parentVarName)\n\t\tif (!parentDef) {\n\t\t\tconst loc = expr.loc ? ` at line ${expr.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Parent route \"${parentVarName}\" not found${loc}. Ensure it's defined with createRoute/createRootRoute.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\n\t\t// Process children array\n\t\tconst childrenArg = expr.arguments[0]\n\t\tif (childrenArg?.type === \"ArrayExpression\") {\n\t\t\tconst childNames: string[] = []\n\n\t\t\tfor (const element of childrenArg.elements) {\n\t\t\t\tif (!element) continue\n\n\t\t\t\t// Direct reference: indexRoute\n\t\t\t\tif (element.type === \"Identifier\") {\n\t\t\t\t\tchildNames.push(element.name)\n\t\t\t\t}\n\t\t\t\t// Nested addChildren: aboutRoute.addChildren([...])\n\t\t\t\telse if (element.type === \"CallExpression\") {\n\t\t\t\t\tconst nestedParent = processAddChildrenExpression(\n\t\t\t\t\t\telement,\n\t\t\t\t\t\trouteMap,\n\t\t\t\t\t\twarnings,\n\t\t\t\t\t)\n\t\t\t\t\tif (nestedParent) {\n\t\t\t\t\t\tchildNames.push(nestedParent)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Spread operator\n\t\t\t\telse if (element.type === \"SpreadElement\") {\n\t\t\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t`Spread operator detected${loc}. Routes from spread cannot be statically analyzed.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tparentDef.children = childNames\n\t\t}\n\n\t\treturn parentVarName\n\t}\n\n\treturn undefined\n}\n\n/**\n * Build the route tree from collected definitions\n */\nfunction buildRouteTree(\n\trouteMap: Map<string, RouteDefinition>,\n\twarnings: string[],\n): ParsedRoute[] {\n\t// Find root routes\n\tconst rootDefs = Array.from(routeMap.values()).filter((def) => def.isRoot)\n\n\tif (rootDefs.length === 0) {\n\t\t// No explicit root route, try to build from parent relationships\n\t\treturn buildTreeFromParentRelations(routeMap, warnings)\n\t}\n\n\t// Build tree starting from root routes\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const rootDef of rootDefs) {\n\t\t// Use a Set to track visited routes and detect circular references\n\t\tconst visited = new Set<string>()\n\t\tconst rootRoute = buildRouteFromDefinition(\n\t\t\trootDef,\n\t\t\trouteMap,\n\t\t\twarnings,\n\t\t\tvisited,\n\t\t)\n\t\tif (rootRoute) {\n\t\t\t// If root has children, return only the children (root is typically just a layout)\n\t\t\t// because the root route in TanStack Router serves as a layout wrapper\n\t\t\tif (rootRoute.children && rootRoute.children.length > 0) {\n\t\t\t\troutes.push(...rootRoute.children)\n\t\t\t} else if (rootRoute.path) {\n\t\t\t\troutes.push(rootRoute)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Build tree when there's no explicit root route\n * Falls back to finding routes that have no parent relationship defined\n */\nfunction buildTreeFromParentRelations(\n\trouteMap: Map<string, RouteDefinition>,\n\twarnings: string[],\n): ParsedRoute[] {\n\t// Find routes without parents (top-level routes)\n\tconst topLevelDefs = Array.from(routeMap.values()).filter(\n\t\t(def) => !def.parentVariableName && !def.isRoot,\n\t)\n\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const def of topLevelDefs) {\n\t\tconst visited = new Set<string>()\n\t\tconst route = buildRouteFromDefinition(def, routeMap, warnings, visited)\n\t\tif (route) {\n\t\t\troutes.push(route)\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Build a ParsedRoute from a RouteDefinition\n * @param visited - Set of visited variable names for circular reference detection\n */\nfunction buildRouteFromDefinition(\n\tdef: RouteDefinition,\n\trouteMap: Map<string, RouteDefinition>,\n\twarnings: string[],\n\tvisited: Set<string>,\n): ParsedRoute | null {\n\t// Circular reference detection\n\tif (visited.has(def.variableName)) {\n\t\twarnings.push(\n\t\t\t`Circular reference detected: route \"${def.variableName}\" references itself in the route tree.`,\n\t\t)\n\t\treturn null\n\t}\n\tvisited.add(def.variableName)\n\n\tconst route: ParsedRoute = {\n\t\tpath: def.path ?? \"\",\n\t\tcomponent: def.component,\n\t}\n\n\t// Process children\n\tif (def.children && def.children.length > 0) {\n\t\tconst children: ParsedRoute[] = []\n\t\tfor (const childName of def.children) {\n\t\t\tconst childDef = routeMap.get(childName)\n\t\t\tif (childDef) {\n\t\t\t\tconst childRoute = buildRouteFromDefinition(\n\t\t\t\t\tchildDef,\n\t\t\t\t\trouteMap,\n\t\t\t\t\twarnings,\n\t\t\t\t\tvisited,\n\t\t\t\t)\n\t\t\t\tif (childRoute) {\n\t\t\t\t\tchildren.push(childRoute)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Child route \"${childName}\" not found. Ensure it's defined with createRoute.`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tif (children.length > 0) {\n\t\t\troute.children = children\n\t\t}\n\t}\n\n\treturn route\n}\n\n/**\n * Normalize TanStack Router path syntax to standard format\n * /$ (trailing catch-all) -> /*\n * $ (standalone splat) -> *\n * $param (dynamic segment) -> :param\n */\nfunction normalizeTanStackPath(path: string): string {\n\treturn (\n\t\tpath\n\t\t\t// Convert catch-all: $ at end -> *\n\t\t\t.replace(/\\/\\$$/, \"/*\")\n\t\t\t// Convert single $ to * (splat route)\n\t\t\t.replace(/^\\$$/, \"*\")\n\t\t\t// Convert $param to :param\n\t\t\t.replace(/\\$([a-zA-Z_][a-zA-Z0-9_]*)/g, \":$1\")\n\t)\n}\n\n/**\n * Detect if content is TanStack Router based on patterns\n */\nexport function isTanStackRouterContent(content: string): boolean {\n\t// Check for TanStack Router specific imports\n\tif (content.includes(\"@tanstack/react-router\")) {\n\t\treturn true\n\t}\n\n\t// Check for createRootRoute pattern\n\tif (content.includes(\"createRootRoute\")) {\n\t\treturn true\n\t}\n\n\t// Check for createRoute with getParentRoute (TanStack Router specific)\n\tif (content.includes(\"createRoute\") && content.includes(\"getParentRoute\")) {\n\t\treturn true\n\t}\n\n\t// Check for lazyRouteComponent (TanStack Router specific)\n\tif (content.includes(\"lazyRouteComponent\")) {\n\t\treturn true\n\t}\n\n\t// Check for addChildren pattern (TanStack Router specific)\n\tif (/\\.addChildren\\s*\\(/.test(content)) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n","import { readFileSync } from \"node:fs\"\nimport { dirname, resolve } from \"node:path\"\nimport { parse } from \"@babel/parser\"\nimport { isAngularRouterContent } from \"./angularRouterParser.js\"\nimport {\n\ttype ParsedRoute,\n\ttype ParseResult,\n\ttype RouterType,\n\tresolveImportPath,\n} from \"./routeParserUtils.js\"\nimport { isSolidRouterContent } from \"./solidRouterParser.js\"\nimport { isTanStackRouterContent } from \"./tanstackRouterParser.js\"\n\n// Re-export shared types\nexport type { ParsedRoute, ParseResult, RouterType }\n// Re-export router detection for convenience\nexport { isAngularRouterContent, isSolidRouterContent, isTanStackRouterContent }\n\n/**\n * Router factory function names to detect\n */\nconst ROUTER_FACTORY_NAMES = [\n\t\"createBrowserRouter\",\n\t\"createHashRouter\",\n\t\"createMemoryRouter\",\n]\n\n/**\n * Parse React Router configuration file and extract routes\n */\nexport function parseReactRouterConfig(\n\tfilePath: string,\n\tpreloadedContent?: string,\n): ParseResult {\n\tconst absolutePath = resolve(filePath)\n\tconst routesFileDir = dirname(absolutePath)\n\tconst warnings: string[] = []\n\n\t// Read file with proper error handling (skip if content is preloaded)\n\tlet content: string\n\tif (preloadedContent !== undefined) {\n\t\tcontent = preloadedContent\n\t} else {\n\t\ttry {\n\t\t\tcontent = readFileSync(absolutePath, \"utf-8\")\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to read routes file \"${absolutePath}\": ${message}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Parse with Babel - wrap for better error messages\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", \"jsx\"],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Syntax error in routes file \"${absolutePath}\": ${error.message}`,\n\t\t\t)\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tthrow new Error(`Failed to parse routes file \"${absolutePath}\": ${message}`)\n\t}\n\n\tconst routes: ParsedRoute[] = []\n\n\t// Find routes array in the AST\n\tfor (const node of ast.program.body) {\n\t\t// Handle: const router = createBrowserRouter([...])\n\t\tif (node.type === \"VariableDeclaration\") {\n\t\t\tfor (const decl of node.declarations) {\n\t\t\t\tif (decl.init?.type === \"CallExpression\") {\n\t\t\t\t\tconst callee = decl.init.callee\n\t\t\t\t\tif (\n\t\t\t\t\t\tcallee.type === \"Identifier\" &&\n\t\t\t\t\t\tROUTER_FACTORY_NAMES.includes(callee.name)\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst firstArg = decl.init.arguments[0]\n\t\t\t\t\t\tif (firstArg?.type === \"ArrayExpression\") {\n\t\t\t\t\t\t\tconst parsed = parseRoutesArray(firstArg, routesFileDir, warnings)\n\t\t\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export const router = createBrowserRouter([...])\n\t\t// and: export const routes = [...]\n\t\tif (\n\t\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t\t) {\n\t\t\tfor (const decl of node.declaration.declarations) {\n\t\t\t\t// Handle: export const router = createBrowserRouter([...])\n\t\t\t\tif (decl.init?.type === \"CallExpression\") {\n\t\t\t\t\tconst callee = decl.init.callee\n\t\t\t\t\tif (\n\t\t\t\t\t\tcallee.type === \"Identifier\" &&\n\t\t\t\t\t\tROUTER_FACTORY_NAMES.includes(callee.name)\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst firstArg = decl.init.arguments[0]\n\t\t\t\t\t\tif (firstArg?.type === \"ArrayExpression\") {\n\t\t\t\t\t\t\tconst parsed = parseRoutesArray(firstArg, routesFileDir, warnings)\n\t\t\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle: export const routes = [...]\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: const routes = [...]; (for later export)\n\t\tif (node.type === \"VariableDeclaration\") {\n\t\t\tfor (const decl of node.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export default [...]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(node.declaration, routesFileDir, warnings)\n\t\t\troutes.push(...parsed)\n\t\t}\n\n\t\t// Handle: export default [...] satisfies RouteObject[]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"TSSatisfiesExpression\" &&\n\t\t\tnode.declaration.expression.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(\n\t\t\t\tnode.declaration.expression,\n\t\t\t\troutesFileDir,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t\troutes.push(...parsed)\n\t\t}\n\t}\n\n\t// Warn if no routes were found\n\tif (routes.length === 0) {\n\t\twarnings.push(\n\t\t\t\"No routes found. Supported patterns: 'createBrowserRouter([...])', 'export const routes = [...]', or 'export default [...]'\",\n\t\t)\n\t}\n\n\treturn { routes, warnings }\n}\n\n/**\n * Parse an array expression containing route objects\n */\nfunction parseRoutesArray(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tarrayNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const element of arrayNode.elements) {\n\t\tif (!element) continue\n\n\t\t// Handle spread elements\n\t\tif (element.type === \"SpreadElement\") {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Spread operator detected${loc}. Routes from spread cannot be statically analyzed.`,\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\n\t\tif (element.type === \"ObjectExpression\") {\n\t\t\tconst route = parseRouteObject(element, baseDir, warnings)\n\t\t\tif (route) {\n\t\t\t\troutes.push(route)\n\t\t\t}\n\t\t} else {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Non-object route element (${element.type})${loc}. Only object literals can be statically analyzed.`,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Parse a single route object expression\n */\nfunction parseRouteObject(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tobjectNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute | null {\n\tconst route: ParsedRoute = {\n\t\tpath: \"\",\n\t}\n\tlet isIndexRoute = false\n\tlet hasPath = false\n\n\tfor (const prop of objectNode.properties) {\n\t\tif (prop.type !== \"ObjectProperty\") continue\n\t\tif (prop.key.type !== \"Identifier\") continue\n\n\t\tconst key = prop.key.name\n\n\t\tswitch (key) {\n\t\t\tcase \"path\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\troute.path = prop.value.value\n\t\t\t\t\thasPath = true\n\t\t\t\t} else {\n\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t`Dynamic path value (${prop.value.type})${loc}. Only string literal paths can be statically analyzed.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"index\":\n\t\t\t\tif (prop.value.type === \"BooleanLiteral\" && prop.value.value === true) {\n\t\t\t\t\tisIndexRoute = true\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"element\":\n\t\t\t\troute.component = extractComponentFromJSX(prop.value, warnings)\n\t\t\t\tbreak\n\n\t\t\tcase \"Component\":\n\t\t\t\tif (prop.value.type === \"Identifier\") {\n\t\t\t\t\troute.component = prop.value.name\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"lazy\": {\n\t\t\t\tconst lazyPath = extractLazyImportPath(prop.value, baseDir, warnings)\n\t\t\t\tif (lazyPath) {\n\t\t\t\t\troute.component = lazyPath\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tcase \"children\":\n\t\t\t\tif (prop.value.type === \"ArrayExpression\") {\n\t\t\t\t\troute.children = parseRoutesArray(prop.value, baseDir, warnings)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// Handle index routes\n\tif (isIndexRoute) {\n\t\troute.path = \"\"\n\t\treturn route\n\t}\n\n\t// Skip routes without path (layout wrappers without path)\n\t// These are parent routes that only serve as layout containers\n\tif (!hasPath && !isIndexRoute) {\n\t\t// If it has children, process them with empty parent path contribution\n\t\tif (route.children && route.children.length > 0) {\n\t\t\t// Return a route with empty path to act as layout\n\t\t\troute.path = \"\"\n\t\t\treturn route\n\t\t}\n\t\treturn null\n\t}\n\n\treturn route\n}\n\n/**\n * Extract component name from JSX element\n * element: <Dashboard /> -> \"Dashboard\"\n */\nfunction extractComponentFromJSX(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\twarnings: string[],\n): string | undefined {\n\tif (node.type === \"JSXElement\") {\n\t\tconst openingElement = node.openingElement\n\t\tif (openingElement?.name?.type === \"JSXIdentifier\") {\n\t\t\treturn openingElement.name.name\n\t\t}\n\t\tif (openingElement?.name?.type === \"JSXMemberExpression\") {\n\t\t\t// Handle <Namespace.Component />\n\t\t\tconst parts: string[] = []\n\t\t\tlet current = openingElement.name\n\t\t\twhile (current) {\n\t\t\t\tif (current.type === \"JSXIdentifier\") {\n\t\t\t\t\tparts.unshift(current.name)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif (current.type === \"JSXMemberExpression\") {\n\t\t\t\t\tif (current.property?.type === \"JSXIdentifier\") {\n\t\t\t\t\t\tparts.unshift(current.property.name)\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = current.object\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn parts.join(\".\")\n\t\t}\n\n\t\t// Check if it has children (wrapper component)\n\t\tif (\n\t\t\tnode.children &&\n\t\t\tnode.children.length > 0 &&\n\t\t\topeningElement?.name?.type === \"JSXIdentifier\"\n\t\t) {\n\t\t\tconst wrapperName = openingElement.name.name\n\t\t\t// Find the first JSX child\n\t\t\tfor (const child of node.children) {\n\t\t\t\tif (child.type === \"JSXElement\") {\n\t\t\t\t\tconst childComponent = extractComponentFromJSX(child, warnings)\n\t\t\t\t\tif (childComponent) {\n\t\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t\t`Wrapper component detected: <${wrapperName}>. Using wrapper name for screen.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t\treturn wrapperName\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Handle JSXFragment\n\tif (node.type === \"JSXFragment\") {\n\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\twarnings.push(\n\t\t\t`JSX Fragment detected${loc}. Cannot extract component name from fragments. Consider wrapping in a named component.`,\n\t\t)\n\t\treturn undefined\n\t}\n\n\t// Catch-all for unrecognized element patterns\n\tif (node) {\n\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\twarnings.push(\n\t\t\t`Unrecognized element pattern (${node.type})${loc}. Component will not be extracted.`,\n\t\t)\n\t}\n\treturn undefined\n}\n\n/**\n * Extract import path from lazy function\n * lazy: () => import(\"./pages/Dashboard\") -> resolved path\n */\nfunction extractLazyImportPath(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Arrow function: () => import('./path')\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\tif (body.type === \"CallExpression\" && body.callee.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t\t// Dynamic import argument\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Lazy import with dynamic path${loc}. Only string literal imports can be statically analyzed.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\t// Unrecognized lazy pattern\n\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\twarnings.push(\n\t\t`Unrecognized lazy pattern (${node.type})${loc}. Expected arrow function with import().`,\n\t)\n\treturn undefined\n}\n\n/**\n * Detect if content is React Router based on patterns\n */\nexport function isReactRouterContent(content: string): boolean {\n\t// Check for React Router specific patterns\n\tif (\n\t\tcontent.includes(\"createBrowserRouter\") ||\n\t\tcontent.includes(\"createHashRouter\") ||\n\t\tcontent.includes(\"createMemoryRouter\") ||\n\t\tcontent.includes(\"RouteObject\")\n\t) {\n\t\treturn true\n\t}\n\n\t// Check for JSX element pattern in routes\n\tif (/element:\\s*</.test(content)) {\n\t\treturn true\n\t}\n\n\t// Check for Component property pattern (uppercase)\n\tif (/Component:\\s*[A-Z]/.test(content)) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n/**\n * Detect if content is Vue Router based on patterns\n */\nexport function isVueRouterContent(content: string): boolean {\n\t// Check for Vue Router specific patterns\n\tif (\n\t\tcontent.includes(\"RouteRecordRaw\") ||\n\t\tcontent.includes(\"vue-router\") ||\n\t\tcontent.includes(\".vue\")\n\t) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n/**\n * Detect router type from file content.\n * Detection order: TanStack Router -> Solid Router -> Angular Router -> React Router -> Vue Router.\n * This order ensures more specific patterns are checked before more generic ones.\n */\nexport function detectRouterType(content: string): RouterType {\n\t// Check TanStack Router first (more specific patterns)\n\tif (isTanStackRouterContent(content)) {\n\t\treturn \"tanstack-router\"\n\t}\n\t// Check Solid Router before React Router (both use similar patterns)\n\tif (isSolidRouterContent(content)) {\n\t\treturn \"solid-router\"\n\t}\n\t// Check Angular Router before React Router (distinct patterns)\n\tif (isAngularRouterContent(content)) {\n\t\treturn \"angular-router\"\n\t}\n\tif (isReactRouterContent(content)) {\n\t\treturn \"react-router\"\n\t}\n\tif (isVueRouterContent(content)) {\n\t\treturn \"vue-router\"\n\t}\n\treturn \"unknown\"\n}\n","import { readFileSync } from \"node:fs\"\nimport { dirname, resolve } from \"node:path\"\nimport { parse } from \"@babel/parser\"\nimport {\n\ttype FlatRoute,\n\tflattenRoutes,\n\ttype ParsedRoute,\n\ttype ParseResult,\n\tpathToScreenId,\n\tpathToScreenTitle,\n\tresolveImportPath,\n} from \"./routeParserUtils.js\"\n\n// Re-export shared types and utilities\nexport type { ParsedRoute, FlatRoute, ParseResult }\nexport { flattenRoutes, pathToScreenId, pathToScreenTitle }\n\n/**\n * Parse Vue Router configuration file and extract routes\n */\nexport function parseVueRouterConfig(\n\tfilePath: string,\n\tpreloadedContent?: string,\n): ParseResult {\n\tconst absolutePath = resolve(filePath)\n\tconst routesFileDir = dirname(absolutePath)\n\tconst warnings: string[] = []\n\n\t// Read file with proper error handling (skip if content is preloaded)\n\tlet content: string\n\tif (preloadedContent !== undefined) {\n\t\tcontent = preloadedContent\n\t} else {\n\t\ttry {\n\t\t\tcontent = readFileSync(absolutePath, \"utf-8\")\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to read routes file \"${absolutePath}\": ${message}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Parse with Babel - wrap for better error messages\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", \"jsx\"],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Syntax error in routes file \"${absolutePath}\": ${error.message}`,\n\t\t\t)\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tthrow new Error(`Failed to parse routes file \"${absolutePath}\": ${message}`)\n\t}\n\n\tconst routes: ParsedRoute[] = []\n\n\t// Find routes array in the AST\n\tfor (const node of ast.program.body) {\n\t\t// Handle: export const routes = [...]\n\t\tif (\n\t\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t\t) {\n\t\t\tfor (const decl of node.declaration.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: const routes = [...]; export { routes }\n\t\tif (node.type === \"VariableDeclaration\") {\n\t\t\tfor (const decl of node.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export default [...]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(node.declaration, routesFileDir, warnings)\n\t\t\troutes.push(...parsed)\n\t\t}\n\n\t\t// Handle: export default [...] satisfies RouteRecordRaw[]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"TSSatisfiesExpression\" &&\n\t\t\tnode.declaration.expression.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(\n\t\t\t\tnode.declaration.expression,\n\t\t\t\troutesFileDir,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t\troutes.push(...parsed)\n\t\t}\n\t}\n\n\t// Warn if no routes were found\n\tif (routes.length === 0) {\n\t\twarnings.push(\n\t\t\t\"No routes array found. Supported patterns: 'export const routes = [...]', 'export default [...]', or 'export default [...] satisfies RouteRecordRaw[]'\",\n\t\t)\n\t}\n\n\treturn { routes, warnings }\n}\n\n/**\n * Parse an array expression containing route objects\n */\nfunction parseRoutesArray(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tarrayNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const element of arrayNode.elements) {\n\t\tif (!element) continue\n\n\t\t// Handle spread elements\n\t\tif (element.type === \"SpreadElement\") {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Spread operator detected${loc}. Routes from spread cannot be statically analyzed.`,\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\n\t\tif (element.type === \"ObjectExpression\") {\n\t\t\tconst route = parseRouteObject(element, baseDir, warnings)\n\t\t\tif (route) {\n\t\t\t\troutes.push(route)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Parse a single route object expression\n */\nfunction parseRouteObject(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tobjectNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute | null {\n\tconst route: ParsedRoute = {\n\t\tpath: \"\",\n\t}\n\n\tfor (const prop of objectNode.properties) {\n\t\tif (prop.type !== \"ObjectProperty\") continue\n\t\tif (prop.key.type !== \"Identifier\") continue\n\n\t\tconst key = prop.key.name\n\n\t\tswitch (key) {\n\t\t\tcase \"path\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\troute.path = prop.value.value\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"name\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\troute.name = prop.value.value\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"redirect\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\troute.redirect = prop.value.value\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"component\":\n\t\t\t\troute.component = extractComponentPath(prop.value, baseDir)\n\t\t\t\tbreak\n\n\t\t\tcase \"children\":\n\t\t\t\tif (prop.value.type === \"ArrayExpression\") {\n\t\t\t\t\troute.children = parseRoutesArray(prop.value, baseDir, warnings)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// Skip routes without path\n\tif (!route.path) {\n\t\treturn null\n\t}\n\n\treturn route\n}\n\n/**\n * Extract component path from various component definitions\n */\n// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\nfunction extractComponentPath(node: any, baseDir: string): string | undefined {\n\t// Direct identifier: component: HomeView\n\tif (node.type === \"Identifier\") {\n\t\treturn undefined // Can't resolve without tracking imports\n\t}\n\n\t// Arrow function with import: () => import('./views/Home.vue')\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\t// () => import('./path')\n\t\tif (body.type === \"CallExpression\" && body.callee.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t}\n\n\t\t// () => import(/* webpackChunkName */ './path')\n\t\tif (body.type === \"CallExpression\" && body.callee.type === \"Import\") {\n\t\t\tfor (const arg of body.arguments) {\n\t\t\t\tif (arg.type === \"StringLiteral\") {\n\t\t\t\t\treturn resolveImportPath(arg.value, baseDir)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined\n}\n","import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\"\nimport { dirname, join, relative, resolve } from \"node:path\"\nimport { define } from \"gunshi\"\nimport prompts from \"prompts\"\nimport { glob } from \"tinyglobby\"\nimport { parseAngularRouterConfig } from \"../utils/angularRouterParser.js\"\nimport { loadConfig } from \"../utils/config.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport { logger } from \"../utils/logger.js\"\nimport {\n\tdetectRouterType,\n\tparseReactRouterConfig,\n} from \"../utils/reactRouterParser.js\"\nimport {\n\ttype FlatRoute,\n\tflattenRoutes,\n\ttype ParseResult,\n} from \"../utils/routeParserUtils.js\"\nimport { parseSolidRouterConfig } from \"../utils/solidRouterParser.js\"\nimport { parseTanStackRouterConfig } from \"../utils/tanstackRouterParser.js\"\nimport { parseVueRouterConfig } from \"../utils/vueRouterParser.js\"\n\nexport const generateCommand = define({\n\tname: \"generate\",\n\tdescription: \"Auto-generate screen.meta.ts files from route files\",\n\targs: {\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\tdryRun: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"n\",\n\t\t\tdescription: \"Show what would be generated without writing files\",\n\t\t\tdefault: false,\n\t\t},\n\t\tforce: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"f\",\n\t\t\tdescription: \"Overwrite existing screen.meta.ts files\",\n\t\t\tdefault: false,\n\t\t},\n\t\tinteractive: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"i\",\n\t\t\tdescription: \"Interactively confirm or modify each screen\",\n\t\t\tdefault: false,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst cwd = process.cwd()\n\t\tconst dryRun = ctx.values.dryRun ?? false\n\t\tconst force = ctx.values.force ?? false\n\t\tconst interactive = ctx.values.interactive ?? false\n\n\t\t// Check for routes configuration\n\t\tif (!config.routesPattern && !config.routesFile) {\n\t\t\tlogger.errorWithHelp(ERRORS.ROUTES_PATTERN_MISSING)\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\t// Use routesFile mode (config-based routing)\n\t\tif (config.routesFile) {\n\t\t\tawait generateFromRoutesFile(config.routesFile, cwd, {\n\t\t\t\tdryRun,\n\t\t\t\tforce,\n\t\t\t\tinteractive,\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\t// Use routesPattern mode (file-based routing)\n\t\tawait generateFromRoutesPattern(config.routesPattern as string, cwd, {\n\t\t\tdryRun,\n\t\t\tforce,\n\t\t\tinteractive,\n\t\t\tignore: config.ignore,\n\t\t})\n\t},\n})\n\ninterface GenerateFromRoutesFileOptions {\n\tdryRun: boolean\n\tforce: boolean\n\tinteractive: boolean\n}\n\n/**\n * Generate screen.meta.ts files from a router config file (Vue Router or React Router)\n */\nasync function generateFromRoutesFile(\n\troutesFile: string,\n\tcwd: string,\n\toptions: GenerateFromRoutesFileOptions,\n): Promise<void> {\n\tconst { dryRun, force, interactive } = options\n\tconst absoluteRoutesFile = resolve(cwd, routesFile)\n\n\t// Check if routes file exists\n\tif (!existsSync(absoluteRoutesFile)) {\n\t\tlogger.errorWithHelp(ERRORS.ROUTES_FILE_NOT_FOUND(routesFile))\n\t\tprocess.exit(1)\n\t}\n\n\t// Detect router type\n\tconst content = readFileSync(absoluteRoutesFile, \"utf-8\")\n\tconst routerType = detectRouterType(content)\n\n\tconst routerTypeDisplay =\n\t\trouterType === \"tanstack-router\"\n\t\t\t? \"TanStack Router\"\n\t\t\t: routerType === \"solid-router\"\n\t\t\t\t? \"Solid Router\"\n\t\t\t\t: routerType === \"angular-router\"\n\t\t\t\t\t? \"Angular Router\"\n\t\t\t\t\t: routerType === \"react-router\"\n\t\t\t\t\t\t? \"React Router\"\n\t\t\t\t\t\t: routerType === \"vue-router\"\n\t\t\t\t\t\t\t? \"Vue Router\"\n\t\t\t\t\t\t\t: \"unknown\"\n\n\tlogger.info(\n\t\t`Parsing routes from ${logger.path(routesFile)} (${routerTypeDisplay})...`,\n\t)\n\tlogger.blank()\n\n\t// Parse the routes file with the appropriate parser\n\tlet parseResult: ParseResult\n\ttry {\n\t\tif (routerType === \"tanstack-router\") {\n\t\t\tparseResult = parseTanStackRouterConfig(absoluteRoutesFile)\n\t\t} else if (routerType === \"solid-router\") {\n\t\t\tparseResult = parseSolidRouterConfig(absoluteRoutesFile)\n\t\t} else if (routerType === \"angular-router\") {\n\t\t\tparseResult = parseAngularRouterConfig(absoluteRoutesFile)\n\t\t} else if (routerType === \"react-router\") {\n\t\t\tparseResult = parseReactRouterConfig(absoluteRoutesFile)\n\t\t} else if (routerType === \"vue-router\") {\n\t\t\tparseResult = parseVueRouterConfig(absoluteRoutesFile)\n\t\t} else {\n\t\t\t// Unknown router type - warn user and attempt Vue Router parser as fallback\n\t\t\tlogger.warn(\n\t\t\t\t`Could not auto-detect router type for ${logger.path(routesFile)}. Attempting to parse as Vue Router.`,\n\t\t\t)\n\t\t\tlogger.log(\n\t\t\t\t` ${logger.dim(\"If parsing fails, check that your router imports are explicit.\")}`,\n\t\t\t)\n\t\t\tparseResult = parseVueRouterConfig(absoluteRoutesFile)\n\t\t}\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tlogger.errorWithHelp(ERRORS.ROUTES_FILE_PARSE_ERROR(routesFile, message))\n\t\tprocess.exit(1)\n\t}\n\n\t// Show warnings\n\tfor (const warning of parseResult.warnings) {\n\t\tlogger.warn(warning)\n\t}\n\n\t// Flatten routes\n\tconst flatRoutes = flattenRoutes(parseResult.routes)\n\n\tif (flatRoutes.length === 0) {\n\t\tlogger.warn(\"No routes found in the config file\")\n\t\treturn\n\t}\n\n\tlogger.log(`Found ${flatRoutes.length} routes`)\n\tlogger.blank()\n\n\tlet created = 0\n\tlet skipped = 0\n\n\tfor (const route of flatRoutes) {\n\t\t// Determine where to place screen.meta.ts\n\t\tconst metaPath = determineMetaPath(route, cwd)\n\t\tconst absoluteMetaPath = resolve(cwd, metaPath)\n\n\t\tif (!force && existsSync(absoluteMetaPath)) {\n\t\t\tif (!interactive) {\n\t\t\t\tskipped++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlogger.itemWarn(\n\t\t\t\t`Exists: ${logger.path(metaPath)} (use --force to overwrite)`,\n\t\t\t)\n\t\t\tskipped++\n\t\t\tcontinue\n\t\t}\n\n\t\tconst screenMeta: InferredScreenMeta = {\n\t\t\tid: route.screenId,\n\t\t\ttitle: route.screenTitle,\n\t\t\troute: route.fullPath,\n\t\t}\n\n\t\tif (interactive) {\n\t\t\tconst result = await promptForScreen(route.fullPath, screenMeta)\n\n\t\t\tif (result.skip) {\n\t\t\t\tlogger.itemWarn(`Skipped: ${logger.path(metaPath)}`)\n\t\t\t\tskipped++\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst content = generateScreenMetaContent(result.meta, {\n\t\t\t\towner: result.owner,\n\t\t\t\ttags: result.tags,\n\t\t\t})\n\n\t\t\tif (dryRun) {\n\t\t\t\tlogDryRunOutput(metaPath, result.meta, result.owner, result.tags)\n\t\t\t\tcreated++\n\t\t\t} else if (safeWriteFile(absoluteMetaPath, metaPath, content)) {\n\t\t\t\tcreated++\n\t\t\t}\n\t\t} else {\n\t\t\tconst content = generateScreenMetaContent(screenMeta)\n\n\t\t\tif (dryRun) {\n\t\t\t\tlogDryRunOutput(metaPath, screenMeta)\n\t\t\t\tcreated++\n\t\t\t} else if (safeWriteFile(absoluteMetaPath, metaPath, content)) {\n\t\t\t\tcreated++\n\t\t\t}\n\t\t}\n\t}\n\n\tlogSummary(created, skipped, dryRun)\n}\n\ninterface GenerateFromRoutesPatternOptions {\n\tdryRun: boolean\n\tforce: boolean\n\tinteractive: boolean\n\tignore: string[]\n}\n\n/**\n * Generate screen.meta.ts files from route files matching a glob pattern\n */\nasync function generateFromRoutesPattern(\n\troutesPattern: string,\n\tcwd: string,\n\toptions: GenerateFromRoutesPatternOptions,\n): Promise<void> {\n\tconst { dryRun, force, interactive, ignore } = options\n\n\tlogger.info(\"Scanning for route files...\")\n\tlogger.blank()\n\n\t// Find all route files\n\tconst routeFiles = await glob(routesPattern, {\n\t\tcwd,\n\t\tignore,\n\t})\n\n\tif (routeFiles.length === 0) {\n\t\tlogger.warn(`No route files found matching: ${routesPattern}`)\n\t\treturn\n\t}\n\n\tlogger.log(`Found ${routeFiles.length} route files`)\n\tlogger.blank()\n\n\tlet created = 0\n\tlet skipped = 0\n\n\tfor (const routeFile of routeFiles) {\n\t\tconst routeDir = dirname(routeFile)\n\t\tconst metaPath = join(routeDir, \"screen.meta.ts\")\n\t\tconst absoluteMetaPath = join(cwd, metaPath)\n\n\t\tif (!force && existsSync(absoluteMetaPath)) {\n\t\t\tif (!interactive) {\n\t\t\t\tskipped++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlogger.itemWarn(\n\t\t\t\t`Exists: ${logger.path(metaPath)} (use --force to overwrite)`,\n\t\t\t)\n\t\t\tskipped++\n\t\t\tcontinue\n\t\t}\n\n\t\t// Generate screen metadata from path\n\t\tconst screenMeta = inferScreenMeta(routeDir, routesPattern)\n\n\t\tif (interactive) {\n\t\t\tconst result = await promptForScreen(routeFile, screenMeta)\n\n\t\t\tif (result.skip) {\n\t\t\t\tlogger.itemWarn(`Skipped: ${logger.path(metaPath)}`)\n\t\t\t\tskipped++\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst content = generateScreenMetaContent(result.meta, {\n\t\t\t\towner: result.owner,\n\t\t\t\ttags: result.tags,\n\t\t\t})\n\n\t\t\tif (dryRun) {\n\t\t\t\tlogDryRunOutput(metaPath, result.meta, result.owner, result.tags)\n\t\t\t\tcreated++\n\t\t\t} else if (safeWriteFile(absoluteMetaPath, metaPath, content)) {\n\t\t\t\tcreated++\n\t\t\t}\n\t\t} else {\n\t\t\tconst content = generateScreenMetaContent(screenMeta)\n\n\t\t\tif (dryRun) {\n\t\t\t\tlogDryRunOutput(metaPath, screenMeta)\n\t\t\t\tcreated++\n\t\t\t} else if (safeWriteFile(absoluteMetaPath, metaPath, content)) {\n\t\t\t\tcreated++\n\t\t\t}\n\t\t}\n\t}\n\n\tlogSummary(created, skipped, dryRun)\n}\n\n/**\n * Determine where to place screen.meta.ts for a route\n */\nfunction determineMetaPath(route: FlatRoute, cwd: string): string {\n\t// If component path is available, place screen.meta.ts next to it\n\tif (route.componentPath) {\n\t\tconst componentDir = dirname(route.componentPath)\n\t\tconst relativePath = relative(cwd, componentDir)\n\t\t// Ensure path doesn't escape cwd\n\t\tif (!relativePath.startsWith(\"..\")) {\n\t\t\treturn join(relativePath, \"screen.meta.ts\")\n\t\t}\n\t}\n\n\t// Fall back to src/screens/{screenId}/screen.meta.ts\n\tconst screenDir = route.screenId.replace(/\\./g, \"/\")\n\treturn join(\"src\", \"screens\", screenDir, \"screen.meta.ts\")\n}\n\n/**\n * Ensure the directory for a file exists\n */\nfunction ensureDirectoryExists(filePath: string): void {\n\tconst dir = dirname(filePath)\n\tif (!existsSync(dir)) {\n\t\ttry {\n\t\t\tmkdirSync(dir, { recursive: true })\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(`Failed to create directory \"${dir}\": ${message}`)\n\t\t}\n\t}\n}\n\n/**\n * Safely write a file with error handling\n * Returns true if successful, false if failed\n */\nfunction safeWriteFile(\n\tabsolutePath: string,\n\trelativePath: string,\n\tcontent: string,\n): boolean {\n\ttry {\n\t\tensureDirectoryExists(absolutePath)\n\t\twriteFileSync(absolutePath, content)\n\t\tlogger.itemSuccess(`Created: ${logger.path(relativePath)}`)\n\t\treturn true\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tlogger.itemError(\n\t\t\t`Failed to create ${logger.path(relativePath)}: ${message}`,\n\t\t)\n\t\treturn false\n\t}\n}\n\n/**\n * Log dry run output for a screen\n */\nfunction logDryRunOutput(\n\tmetaPath: string,\n\tmeta: InferredScreenMeta,\n\towner?: string[],\n\ttags?: string[],\n): void {\n\tlogger.step(`Would create: ${logger.path(metaPath)}`)\n\tlogger.log(` ${logger.dim(`id: \"${meta.id}\"`)}`)\n\tlogger.log(` ${logger.dim(`title: \"${meta.title}\"`)}`)\n\tlogger.log(` ${logger.dim(`route: \"${meta.route}\"`)}`)\n\tif (owner && owner.length > 0) {\n\t\tlogger.log(\n\t\t\t` ${logger.dim(`owner: [${owner.map((o) => `\"${o}\"`).join(\", \")}]`)}`,\n\t\t)\n\t}\n\tif (tags && tags.length > 0) {\n\t\tlogger.log(\n\t\t\t` ${logger.dim(`tags: [${tags.map((t) => `\"${t}\"`).join(\", \")}]`)}`,\n\t\t)\n\t}\n\tlogger.blank()\n}\n\n/**\n * Log summary after generation\n */\nfunction logSummary(created: number, skipped: number, dryRun: boolean): void {\n\tlogger.blank()\n\tif (dryRun) {\n\t\tlogger.info(`Would create ${created} files (${skipped} already exist)`)\n\t\tlogger.blank()\n\t\tlogger.log(`Run without ${logger.code(\"--dry-run\")} to create files`)\n\t} else {\n\t\tlogger.done(`Created ${created} files (${skipped} skipped)`)\n\t\tif (created > 0) {\n\t\t\tlogger.blank()\n\t\t\tlogger.log(logger.bold(\"Next steps:\"))\n\t\t\tlogger.log(\" 1. Review and customize the generated screen.meta.ts files\")\n\t\t\tlogger.log(\n\t\t\t\t` 2. Run ${logger.code(\"screenbook dev\")} to view your screen catalog`,\n\t\t\t)\n\t\t}\n\t}\n}\n\ninterface InferredScreenMeta {\n\tid: string\n\ttitle: string\n\troute: string\n}\n\ninterface InteractiveResult {\n\tskip: boolean\n\tmeta: InferredScreenMeta\n\towner: string[]\n\ttags: string[]\n}\n\n/**\n * Parse comma-separated string into array\n */\nexport function parseCommaSeparated(input: string): string[] {\n\tif (!input.trim()) return []\n\treturn input\n\t\t.split(\",\")\n\t\t.map((s) => s.trim())\n\t\t.filter(Boolean)\n}\n\n/**\n * Prompt user for screen metadata in interactive mode\n */\nasync function promptForScreen(\n\trouteFile: string,\n\tinferred: InferredScreenMeta,\n): Promise<InteractiveResult> {\n\tlogger.blank()\n\tlogger.info(`Found: ${logger.path(routeFile)}`)\n\tlogger.blank()\n\tlogger.log(\n\t\t` ${logger.dim(\"ID:\")} ${inferred.id} ${logger.dim(\"(inferred)\")}`,\n\t)\n\tlogger.log(\n\t\t` ${logger.dim(\"Title:\")} ${inferred.title} ${logger.dim(\"(inferred)\")}`,\n\t)\n\tlogger.log(\n\t\t` ${logger.dim(\"Route:\")} ${inferred.route} ${logger.dim(\"(inferred)\")}`,\n\t)\n\tlogger.blank()\n\n\tconst response = await prompts([\n\t\t{\n\t\t\ttype: \"confirm\",\n\t\t\tname: \"proceed\",\n\t\t\tmessage: \"Generate this screen?\",\n\t\t\tinitial: true,\n\t\t},\n\t\t{\n\t\t\ttype: (prev) => (prev ? \"text\" : null),\n\t\t\tname: \"id\",\n\t\t\tmessage: \"ID\",\n\t\t\tinitial: inferred.id,\n\t\t},\n\t\t{\n\t\t\ttype: (_prev, values) => (values.proceed ? \"text\" : null),\n\t\t\tname: \"title\",\n\t\t\tmessage: \"Title\",\n\t\t\tinitial: inferred.title,\n\t\t},\n\t\t{\n\t\t\ttype: (_prev, values) => (values.proceed ? \"text\" : null),\n\t\t\tname: \"owner\",\n\t\t\tmessage: \"Owner (comma-separated)\",\n\t\t\tinitial: \"\",\n\t\t},\n\t\t{\n\t\t\ttype: (_prev, values) => (values.proceed ? \"text\" : null),\n\t\t\tname: \"tags\",\n\t\t\tmessage: \"Tags (comma-separated)\",\n\t\t\tinitial: inferred.id.split(\".\")[0] || \"\",\n\t\t},\n\t])\n\n\tif (!response.proceed) {\n\t\treturn { skip: true, meta: inferred, owner: [], tags: [] }\n\t}\n\n\treturn {\n\t\tskip: false,\n\t\tmeta: {\n\t\t\tid: response.id || inferred.id,\n\t\t\ttitle: response.title || inferred.title,\n\t\t\troute: inferred.route,\n\t\t},\n\t\towner: parseCommaSeparated(response.owner || \"\"),\n\t\ttags: parseCommaSeparated(response.tags || \"\"),\n\t}\n}\n\n/**\n * Infer screen metadata from the route file path\n */\nfunction inferScreenMeta(\n\trouteDir: string,\n\troutesPattern: string,\n): InferredScreenMeta {\n\t// Extract base directory from pattern (e.g., \"src/pages\" from \"src/pages/**/page.tsx\")\n\tconst patternBase = routesPattern.split(\"*\")[0]?.replace(/\\/$/, \"\") ?? \"\"\n\n\t// Get relative path from pattern base\n\tconst relativePath = relative(patternBase, routeDir)\n\n\t// Handle root route\n\tif (!relativePath || relativePath === \".\") {\n\t\treturn {\n\t\t\tid: \"home\",\n\t\t\ttitle: \"Home\",\n\t\t\troute: \"/\",\n\t\t}\n\t}\n\n\t// Clean up path segments (remove route groups like (marketing), handle dynamic segments)\n\tconst segments = relativePath\n\t\t.split(\"/\")\n\t\t.filter((s) => s && !s.startsWith(\"(\") && !s.endsWith(\")\"))\n\t\t.map((s) =>\n\t\t\ts.replace(/^\\[\\.\\.\\..*\\]$/, \"catchall\").replace(/^\\[(.+)\\]$/, \"$1\"),\n\t\t)\n\n\t// Generate ID from segments (e.g., \"billing.invoice.detail\")\n\tconst id = segments.join(\".\")\n\n\t// Generate title from last segment (e.g., \"Invoice Detail\" from \"invoice-detail\")\n\tconst lastSegment = segments[segments.length - 1] || \"home\"\n\tconst title = lastSegment\n\t\t.split(/[-_]/)\n\t\t.map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(\" \")\n\n\t// Generate route from path (e.g., \"/billing/invoice/:id\")\n\tconst routeSegments = relativePath\n\t\t.split(\"/\")\n\t\t.filter((s) => s && !s.startsWith(\"(\") && !s.endsWith(\")\"))\n\t\t.map((s) => {\n\t\t\t// Convert [id] to :id, [...slug] to *\n\t\t\tif (s.startsWith(\"[...\") && s.endsWith(\"]\")) {\n\t\t\t\treturn \"*\"\n\t\t\t}\n\t\t\tif (s.startsWith(\"[\") && s.endsWith(\"]\")) {\n\t\t\t\treturn `:${s.slice(1, -1)}`\n\t\t\t}\n\t\t\treturn s\n\t\t})\n\tconst route = `/${routeSegments.join(\"/\")}`\n\n\treturn { id, title, route }\n}\n\ninterface GenerateOptions {\n\towner?: string[]\n\ttags?: string[]\n}\n\n/**\n * Generate screen.meta.ts file content\n */\nfunction generateScreenMetaContent(\n\tmeta: InferredScreenMeta,\n\toptions?: GenerateOptions,\n): string {\n\t// Use provided values or infer defaults\n\tconst owner = options?.owner ?? []\n\tconst tags =\n\t\toptions?.tags && options.tags.length > 0\n\t\t\t? options.tags\n\t\t\t: [meta.id.split(\".\")[0] || \"general\"]\n\n\tconst ownerStr =\n\t\towner.length > 0 ? `[${owner.map((o) => `\"${o}\"`).join(\", \")}]` : \"[]\"\n\tconst tagsStr = `[${tags.map((t) => `\"${t}\"`).join(\", \")}]`\n\n\treturn `import { defineScreen } from \"@screenbook/core\"\n\nexport const screen = defineScreen({\n\tid: \"${meta.id}\",\n\ttitle: \"${meta.title}\",\n\troute: \"${meta.route}\",\n\n\t// Team or individual responsible for this screen\n\towner: ${ownerStr},\n\n\t// Tags for filtering in the catalog\n\ttags: ${tagsStr},\n\n\t// APIs/services this screen depends on (for impact analysis)\n\t// Example: [\"UserAPI.getProfile\", \"PaymentService.checkout\"]\n\tdependsOn: [],\n\n\t// Screen IDs that can navigate to this screen\n\tentryPoints: [],\n\n\t// Screen IDs this screen can navigate to\n\tnext: [],\n})\n`\n}\n","import type { Screen } from \"@screenbook/core\"\n\nexport interface TransitiveDependency {\n\tscreen: Screen\n\tpath: string[]\n}\n\nexport interface ImpactResult {\n\tapi: string\n\tdirect: Screen[]\n\ttransitive: TransitiveDependency[]\n\ttotalCount: number\n}\n\n/**\n * Check if a screen's dependsOn matches the API name (supports partial matching).\n * - \"InvoiceAPI\" matches \"InvoiceAPI.getDetail\"\n * - \"InvoiceAPI.getDetail\" matches \"InvoiceAPI.getDetail\"\n */\nfunction matchesDependency(dependency: string, apiName: string): boolean {\n\t// Exact match\n\tif (dependency === apiName) {\n\t\treturn true\n\t}\n\t// Partial match: apiName is a prefix of dependency\n\tif (dependency.startsWith(`${apiName}.`)) {\n\t\treturn true\n\t}\n\t// Partial match: dependency is a prefix of apiName\n\tif (apiName.startsWith(`${dependency}.`)) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n/**\n * Find screens that directly depend on the given API.\n */\nfunction findDirectDependents(screens: Screen[], apiName: string): Screen[] {\n\treturn screens.filter((screen) =>\n\t\tscreen.dependsOn?.some((dep) => matchesDependency(dep, apiName)),\n\t)\n}\n\n/**\n * Build a reverse navigation graph: screenId -> screens that can navigate to it.\n * This is built from the `entryPoints` field.\n */\nfunction _buildReverseNavigationGraph(\n\tscreens: Screen[],\n): Map<string, Set<string>> {\n\tconst graph = new Map<string, Set<string>>()\n\n\tfor (const screen of screens) {\n\t\t// entryPoints lists screens that can navigate TO this screen\n\t\t// So we want to find screens that navigate FROM here\n\t\t// Actually, we need to reverse: if A.entryPoints includes B,\n\t\t// then B can navigate to A, so B is affected if A is affected\n\n\t\t// For transitive analysis:\n\t\t// If screen A depends on API, and screen B has entryPoints: [\"A\"],\n\t\t// then B can navigate to A, meaning users can reach A from B\n\t\t// So if A is impacted, we should show B as transitively impacted\n\n\t\tif (!screen.entryPoints) continue\n\n\t\tfor (const entryPoint of screen.entryPoints) {\n\t\t\tif (!graph.has(screen.id)) {\n\t\t\t\tgraph.set(screen.id, new Set())\n\t\t\t}\n\t\t\tgraph.get(screen.id)?.add(entryPoint)\n\t\t}\n\t}\n\n\treturn graph\n}\n\n/**\n * Build a navigation graph from `next` field: screenId -> screens it can navigate to.\n */\nfunction buildNavigationGraph(screens: Screen[]): Map<string, Set<string>> {\n\tconst graph = new Map<string, Set<string>>()\n\n\tfor (const screen of screens) {\n\t\tif (!screen.next) continue\n\n\t\tif (!graph.has(screen.id)) {\n\t\t\tgraph.set(screen.id, new Set())\n\t\t}\n\t\tfor (const nextId of screen.next) {\n\t\t\tgraph.get(screen.id)?.add(nextId)\n\t\t}\n\t}\n\n\treturn graph\n}\n\n/**\n * Find all transitive dependents using BFS.\n * A screen is transitively dependent if it can navigate to a directly dependent screen.\n */\nfunction findTransitiveDependents(\n\tscreens: Screen[],\n\tdirectDependentIds: Set<string>,\n\tmaxDepth: number,\n): TransitiveDependency[] {\n\tconst _screenMap = new Map(screens.map((s) => [s.id, s]))\n\tconst navigationGraph = buildNavigationGraph(screens)\n\tconst transitive: TransitiveDependency[] = []\n\tconst visited = new Set<string>()\n\n\t// For each screen, check if it can reach a directly dependent screen\n\tfor (const screen of screens) {\n\t\tif (directDependentIds.has(screen.id)) {\n\t\t\tcontinue // Skip direct dependents\n\t\t}\n\n\t\tconst path = findPathToDirectDependent(\n\t\t\tscreen.id,\n\t\t\tdirectDependentIds,\n\t\t\tnavigationGraph,\n\t\t\tmaxDepth,\n\t\t\tnew Set(),\n\t\t)\n\n\t\tif (path && !visited.has(screen.id)) {\n\t\t\tvisited.add(screen.id)\n\t\t\ttransitive.push({\n\t\t\t\tscreen,\n\t\t\t\tpath,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn transitive\n}\n\n/**\n * Find a path from a screen to any directly dependent screen using BFS.\n */\nfunction findPathToDirectDependent(\n\tstartId: string,\n\ttargetIds: Set<string>,\n\tgraph: Map<string, Set<string>>,\n\tmaxDepth: number,\n\tvisited: Set<string>,\n): string[] | null {\n\tif (visited.has(startId)) {\n\t\treturn null\n\t}\n\n\tconst queue: Array<{ id: string; path: string[] }> = [\n\t\t{ id: startId, path: [startId] },\n\t]\n\tconst localVisited = new Set<string>([startId])\n\n\twhile (queue.length > 0) {\n\t\tconst current = queue.shift()\n\t\tif (!current) break\n\n\t\tif (current.path.length > maxDepth + 1) {\n\t\t\tcontinue\n\t\t}\n\n\t\tconst neighbors = graph.get(current.id)\n\t\tif (!neighbors) {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor (const neighborId of neighbors) {\n\t\t\tif (localVisited.has(neighborId)) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst newPath = [...current.path, neighborId]\n\n\t\t\t// Check if path exceeds maxDepth (path includes start, so maxDepth+1 is the max length)\n\t\t\tif (newPath.length > maxDepth + 1) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif (targetIds.has(neighborId)) {\n\t\t\t\treturn newPath\n\t\t\t}\n\n\t\t\tlocalVisited.add(neighborId)\n\t\t\tqueue.push({ id: neighborId, path: newPath })\n\t\t}\n\t}\n\n\treturn null\n}\n\n/**\n * Analyze the impact of a change to an API on the screen catalog.\n */\nexport function analyzeImpact(\n\tscreens: Screen[],\n\tapiName: string,\n\tmaxDepth = 3,\n): ImpactResult {\n\t// Find direct dependents\n\tconst direct = findDirectDependents(screens, apiName)\n\tconst directIds = new Set(direct.map((s) => s.id))\n\n\t// Find transitive dependents\n\tconst transitive = findTransitiveDependents(screens, directIds, maxDepth)\n\n\treturn {\n\t\tapi: apiName,\n\t\tdirect,\n\t\ttransitive,\n\t\ttotalCount: direct.length + transitive.length,\n\t}\n}\n\n/**\n * Format the impact result as text output.\n */\nexport function formatImpactText(result: ImpactResult): string {\n\tconst lines: string[] = []\n\n\tlines.push(`Impact Analysis: ${result.api}`)\n\tlines.push(\"\")\n\n\tif (result.direct.length > 0) {\n\t\tlines.push(\n\t\t\t`Direct (${result.direct.length} screen${result.direct.length > 1 ? \"s\" : \"\"}):`,\n\t\t)\n\t\tfor (const screen of result.direct) {\n\t\t\tconst owner = screen.owner?.length ? ` [${screen.owner.join(\", \")}]` : \"\"\n\t\t\tlines.push(` - ${screen.id} ${screen.route}${owner}`)\n\t\t}\n\t\tlines.push(\"\")\n\t}\n\n\tif (result.transitive.length > 0) {\n\t\tlines.push(\n\t\t\t`Transitive (${result.transitive.length} screen${result.transitive.length > 1 ? \"s\" : \"\"}):`,\n\t\t)\n\t\tfor (const { path } of result.transitive) {\n\t\t\tlines.push(` - ${path.join(\" -> \")}`)\n\t\t}\n\t\tlines.push(\"\")\n\t}\n\n\tif (result.totalCount === 0) {\n\t\tlines.push(\"No screens depend on this API.\")\n\t\tlines.push(\"\")\n\t} else {\n\t\tlines.push(\n\t\t\t`Total: ${result.totalCount} screen${result.totalCount > 1 ? \"s\" : \"\"} affected`,\n\t\t)\n\t}\n\n\treturn lines.join(\"\\n\")\n}\n\n/**\n * Format the impact result as JSON output.\n */\nexport function formatImpactJson(result: ImpactResult): string {\n\treturn JSON.stringify(\n\t\t{\n\t\t\tapi: result.api,\n\t\t\tsummary: {\n\t\t\t\tdirectCount: result.direct.length,\n\t\t\t\ttransitiveCount: result.transitive.length,\n\t\t\t\ttotalCount: result.totalCount,\n\t\t\t},\n\t\t\tdirect: result.direct.map((s) => ({\n\t\t\t\tid: s.id,\n\t\t\t\ttitle: s.title,\n\t\t\t\troute: s.route,\n\t\t\t\towner: s.owner,\n\t\t\t})),\n\t\t\ttransitive: result.transitive.map(({ screen, path }) => ({\n\t\t\t\tid: screen.id,\n\t\t\t\ttitle: screen.title,\n\t\t\t\troute: screen.route,\n\t\t\t\tpath,\n\t\t\t})),\n\t\t},\n\t\tnull,\n\t\t2,\n\t)\n}\n","import { existsSync, readFileSync } from \"node:fs\"\nimport { join } from \"node:path\"\nimport type { Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport { loadConfig } from \"../utils/config.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport {\n\tanalyzeImpact,\n\tformatImpactJson,\n\tformatImpactText,\n} from \"../utils/impactAnalysis.js\"\nimport { logger } from \"../utils/logger.js\"\n\nexport const impactCommand = define({\n\tname: \"impact\",\n\tdescription: \"Analyze which screens depend on a specific API/service\",\n\targs: {\n\t\tapi: {\n\t\t\ttype: \"positional\",\n\t\t\tdescription:\n\t\t\t\t\"API or service name to analyze (e.g., InvoiceAPI.getDetail)\",\n\t\t\trequired: true,\n\t\t},\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\tformat: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"f\",\n\t\t\tdescription: \"Output format: text (default) or json\",\n\t\t\tdefault: \"text\",\n\t\t},\n\t\tdepth: {\n\t\t\ttype: \"number\",\n\t\t\tshort: \"d\",\n\t\t\tdescription: \"Maximum depth for transitive dependencies\",\n\t\t\tdefault: 3,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst cwd = process.cwd()\n\n\t\tconst apiName = ctx.values.api\n\t\tif (!apiName) {\n\t\t\tlogger.errorWithHelp(ERRORS.API_NAME_REQUIRED)\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tconst format = ctx.values.format ?? \"text\"\n\t\tconst depth = ctx.values.depth ?? 3\n\n\t\t// Load screens.json\n\t\tconst screensPath = join(cwd, config.outDir, \"screens.json\")\n\n\t\tif (!existsSync(screensPath)) {\n\t\t\tlogger.errorWithHelp(ERRORS.SCREENS_NOT_FOUND)\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tlet screens: Screen[]\n\t\ttry {\n\t\t\tconst content = readFileSync(screensPath, \"utf-8\")\n\t\t\tscreens = JSON.parse(content) as Screen[]\n\t\t} catch (error) {\n\t\t\tlogger.errorWithHelp({\n\t\t\t\t...ERRORS.SCREENS_PARSE_ERROR,\n\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t})\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tif (screens.length === 0) {\n\t\t\tlogger.warn(\"No screens found in the catalog.\")\n\t\t\tlogger.blank()\n\t\t\tlogger.log(\"Run 'screenbook generate' to create screen.meta.ts files,\")\n\t\t\tlogger.log(\"then 'screenbook build' to generate the catalog.\")\n\t\t\treturn\n\t\t}\n\n\t\t// Analyze impact\n\t\tconst result = analyzeImpact(screens, apiName, depth)\n\n\t\t// Output result\n\t\tif (format === \"json\") {\n\t\t\tlogger.log(formatImpactJson(result))\n\t\t} else {\n\t\t\tlogger.log(formatImpactText(result))\n\t\t}\n\t},\n})\n","import { existsSync, readFileSync } from \"node:fs\"\nimport { join } from \"node:path\"\nimport prompts from \"prompts\"\n\nexport interface FrameworkInfo {\n\tname: string\n\troutesPattern: string\n\tmetaPattern: string\n}\n\ninterface FrameworkDefinition extends FrameworkInfo {\n\tpackages: string[]\n\tconfigFiles: string[]\n\t/**\n\t * Additional check to distinguish variants (e.g., App Router vs Pages Router)\n\t */\n\tcheck?: (cwd: string) => boolean\n}\n\nconst FRAMEWORKS: FrameworkDefinition[] = [\n\t{\n\t\tname: \"Next.js (App Router)\",\n\t\tpackages: [\"next\"],\n\t\tconfigFiles: [\"next.config.js\", \"next.config.mjs\", \"next.config.ts\"],\n\t\troutesPattern: \"app/**/page.tsx\",\n\t\tmetaPattern: \"app/**/screen.meta.ts\",\n\t\tcheck: (cwd) =>\n\t\t\texistsSync(join(cwd, \"app\")) || existsSync(join(cwd, \"src/app\")),\n\t},\n\t{\n\t\tname: \"Next.js (Pages Router)\",\n\t\tpackages: [\"next\"],\n\t\tconfigFiles: [\"next.config.js\", \"next.config.mjs\", \"next.config.ts\"],\n\t\troutesPattern: \"pages/**/*.tsx\",\n\t\tmetaPattern: \"pages/**/screen.meta.ts\",\n\t\tcheck: (cwd) =>\n\t\t\texistsSync(join(cwd, \"pages\")) || existsSync(join(cwd, \"src/pages\")),\n\t},\n\t{\n\t\tname: \"Remix\",\n\t\tpackages: [\"@remix-run/react\", \"remix\"],\n\t\tconfigFiles: [\"remix.config.js\", \"vite.config.ts\"],\n\t\troutesPattern: \"app/routes/**/*.tsx\",\n\t\tmetaPattern: \"app/routes/**/screen.meta.ts\",\n\t},\n\t{\n\t\tname: \"Nuxt\",\n\t\tpackages: [\"nuxt\"],\n\t\tconfigFiles: [\"nuxt.config.ts\", \"nuxt.config.js\", \"nuxt.config.mjs\"],\n\t\troutesPattern: \"pages/**/*.vue\",\n\t\tmetaPattern: \"pages/**/screen.meta.ts\",\n\t\tcheck: (cwd) => {\n\t\t\t// Nuxt 4 uses app/pages, Nuxt 3 uses pages\n\t\t\tif (existsSync(join(cwd, \"app/pages\"))) {\n\t\t\t\treturn false // Will be handled by Nuxt 4 definition\n\t\t\t}\n\t\t\treturn existsSync(join(cwd, \"pages\"))\n\t\t},\n\t},\n\t{\n\t\tname: \"Nuxt 4\",\n\t\tpackages: [\"nuxt\"],\n\t\tconfigFiles: [\"nuxt.config.ts\", \"nuxt.config.js\"],\n\t\troutesPattern: \"app/pages/**/*.vue\",\n\t\tmetaPattern: \"app/pages/**/screen.meta.ts\",\n\t\tcheck: (cwd) => existsSync(join(cwd, \"app/pages\")),\n\t},\n\t{\n\t\tname: \"Astro\",\n\t\tpackages: [\"astro\"],\n\t\tconfigFiles: [\n\t\t\t\"astro.config.mjs\",\n\t\t\t\"astro.config.js\",\n\t\t\t\"astro.config.ts\",\n\t\t\t\"astro.config.cjs\",\n\t\t],\n\t\troutesPattern: \"src/pages/**/*.astro\",\n\t\tmetaPattern: \"src/pages/**/screen.meta.ts\",\n\t},\n\t{\n\t\tname: \"SolidStart\",\n\t\tpackages: [\"@solidjs/start\"],\n\t\tconfigFiles: [\"app.config.ts\", \"app.config.js\"],\n\t\troutesPattern: \"src/routes/**/*.tsx\",\n\t\tmetaPattern: \"src/routes/**/screen.meta.ts\",\n\t\tcheck: (cwd) => existsSync(join(cwd, \"src/routes\")),\n\t},\n\t{\n\t\tname: \"QwikCity\",\n\t\tpackages: [\"@builder.io/qwik-city\"],\n\t\tconfigFiles: [\"vite.config.ts\", \"vite.config.js\", \"vite.config.mjs\"],\n\t\t// QwikCity uses index.tsx files as page components (e.g., about/index.tsx not about.tsx)\n\t\troutesPattern: \"src/routes/**/index.tsx\",\n\t\tmetaPattern: \"src/routes/**/screen.meta.ts\",\n\t\tcheck: (cwd) => existsSync(join(cwd, \"src/routes\")),\n\t},\n\t{\n\t\tname: \"TanStack Start\",\n\t\tpackages: [\"@tanstack/react-start\", \"@tanstack/start\"],\n\t\tconfigFiles: [\"app.config.ts\", \"app.config.js\"],\n\t\troutesPattern: \"src/routes/**/*.tsx\",\n\t\tmetaPattern: \"src/routes/**/screen.meta.ts\",\n\t\t// TanStack Start requires __root.tsx for file-based routing\n\t\tcheck: (cwd) => existsSync(join(cwd, \"src/routes/__root.tsx\")),\n\t},\n\t{\n\t\tname: \"Vite + Vue\",\n\t\tpackages: [\"vite\", \"vue\"],\n\t\tconfigFiles: [\"vite.config.ts\", \"vite.config.js\", \"vite.config.mjs\"],\n\t\troutesPattern: \"src/pages/**/*.vue\",\n\t\tmetaPattern: \"src/pages/**/screen.meta.ts\",\n\t\t// Check that react is NOT present to avoid matching React projects\n\t\tcheck: (cwd) => {\n\t\t\tconst packageJson = readPackageJson(cwd)\n\t\t\tif (!packageJson) return false\n\t\t\treturn !hasPackage(packageJson, \"react\")\n\t\t},\n\t},\n\t{\n\t\tname: \"Vite + React\",\n\t\tpackages: [\"vite\", \"react\"],\n\t\tconfigFiles: [\"vite.config.ts\", \"vite.config.js\", \"vite.config.mjs\"],\n\t\troutesPattern: \"src/pages/**/*.tsx\",\n\t\tmetaPattern: \"src/pages/**/screen.meta.ts\",\n\t},\n]\n\ninterface PackageJson {\n\tdependencies?: Record<string, string>\n\tdevDependencies?: Record<string, string>\n}\n\nfunction readPackageJson(cwd: string): PackageJson | null {\n\tconst packageJsonPath = join(cwd, \"package.json\")\n\tif (!existsSync(packageJsonPath)) {\n\t\treturn null\n\t}\n\ttry {\n\t\tconst content = readFileSync(packageJsonPath, \"utf-8\")\n\t\treturn JSON.parse(content)\n\t} catch (error) {\n\t\tconsole.warn(\n\t\t\t`Warning: Failed to parse package.json at ${packageJsonPath}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t)\n\t\treturn null\n\t}\n}\n\nfunction hasPackage(packageJson: PackageJson, packageName: string): boolean {\n\treturn !!(\n\t\tpackageJson.dependencies?.[packageName] ||\n\t\tpackageJson.devDependencies?.[packageName]\n\t)\n}\n\nfunction hasConfigFile(cwd: string, configFiles: string[]): boolean {\n\treturn configFiles.some((file) => existsSync(join(cwd, file)))\n}\n\n/**\n * Auto-detect the frontend framework in a project directory.\n * Returns framework info if detected, null otherwise.\n */\nexport function detectFramework(cwd: string): FrameworkInfo | null {\n\tconst packageJson = readPackageJson(cwd)\n\tif (!packageJson) {\n\t\treturn null\n\t}\n\n\tfor (const framework of FRAMEWORKS) {\n\t\t// Check if required packages are present\n\t\tconst hasRequiredPackage = framework.packages.some((pkg) =>\n\t\t\thasPackage(packageJson, pkg),\n\t\t)\n\t\tif (!hasRequiredPackage) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Check for config files\n\t\tconst hasConfig = hasConfigFile(cwd, framework.configFiles)\n\t\tif (!hasConfig) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Run additional check if defined\n\t\tif (framework.check && !framework.check(cwd)) {\n\t\t\tcontinue\n\t\t}\n\n\t\treturn {\n\t\t\tname: framework.name,\n\t\t\troutesPattern: framework.routesPattern,\n\t\t\tmetaPattern: framework.metaPattern,\n\t\t}\n\t}\n\n\treturn null\n}\n\n/**\n * Interactive framework selection when auto-detection fails.\n */\nexport async function promptFrameworkSelection(): Promise<FrameworkInfo | null> {\n\tconst choices = FRAMEWORKS.filter(\n\t\t// Remove duplicates (e.g., Nuxt 4 vs Nuxt)\n\t\t(fw, idx, arr) =>\n\t\t\tarr.findIndex((f) => f.routesPattern === fw.routesPattern) === idx,\n\t).map((fw) => ({\n\t\ttitle: fw.name,\n\t\tvalue: fw,\n\t}))\n\n\tchoices.push({\n\t\ttitle: \"Other (manual configuration)\",\n\t\tvalue: null as unknown as FrameworkDefinition,\n\t})\n\n\tconst response = await prompts({\n\t\ttype: \"select\",\n\t\tname: \"framework\",\n\t\tmessage: \"Select your frontend framework:\",\n\t\tchoices,\n\t})\n\n\tif (!response.framework) {\n\t\treturn null\n\t}\n\n\treturn {\n\t\tname: response.framework.name,\n\t\troutesPattern: response.framework.routesPattern,\n\t\tmetaPattern: response.framework.metaPattern,\n\t}\n}\n\n/**\n * Detect framework or prompt user if detection fails.\n */\nexport async function detectOrPromptFramework(\n\tcwd: string,\n): Promise<FrameworkInfo | null> {\n\tconst detected = detectFramework(cwd)\n\tif (detected) {\n\t\treturn detected\n\t}\n\treturn promptFrameworkSelection()\n}\n","import { existsSync, readFileSync, writeFileSync } from \"node:fs\"\nimport { join } from \"node:path\"\nimport { define } from \"gunshi\"\nimport {\n\tdetectFramework,\n\ttype FrameworkInfo,\n\tpromptFrameworkSelection,\n} from \"../utils/detectFramework.js\"\nimport { logger } from \"../utils/logger.js\"\n\nfunction generateConfigTemplate(framework: FrameworkInfo | null): string {\n\tif (framework) {\n\t\treturn `import { defineConfig } from \"@screenbook/core\"\n\nexport default defineConfig({\n\t// Auto-detected: ${framework.name}\n\tmetaPattern: \"${framework.metaPattern}\",\n\troutesPattern: \"${framework.routesPattern}\",\n\toutDir: \".screenbook\",\n})\n`\n\t}\n\n\t// Fallback template when no framework detected\n\treturn `import { defineConfig } from \"@screenbook/core\"\n\nexport default defineConfig({\n\t// Glob pattern for screen metadata files\n\tmetaPattern: \"src/**/screen.meta.ts\",\n\n\t// Glob pattern for route files (uncomment and adjust for your framework):\n\t// routesPattern: \"src/pages/**/page.tsx\", // Vite/React\n\t// routesPattern: \"app/**/page.tsx\", // Next.js App Router\n\t// routesPattern: \"pages/**/*.tsx\", // Next.js Pages Router\n\t// routesPattern: \"app/routes/**/*.tsx\", // Remix\n\t// routesPattern: \"pages/**/*.vue\", // Nuxt\n\t// routesPattern: \"src/pages/**/*.astro\", // Astro\n\n\toutDir: \".screenbook\",\n})\n`\n}\n\nfunction printValueProposition(): void {\n\tlogger.blank()\n\tlogger.log(logger.bold(\"What Screenbook gives you:\"))\n\tlogger.log(\" - Screen catalog with search & filter\")\n\tlogger.log(\" - Navigation graph visualization\")\n\tlogger.log(\" - Impact analysis (API -> affected screens)\")\n\tlogger.log(\" - CI lint for documentation coverage\")\n}\n\nfunction printNextSteps(hasRoutesPattern: boolean): void {\n\tlogger.blank()\n\tlogger.log(logger.bold(\"Next steps:\"))\n\tif (hasRoutesPattern) {\n\t\tlogger.log(\n\t\t\t` 1. Run ${logger.code(\"screenbook generate\")} to auto-create screen.meta.ts files`,\n\t\t)\n\t\tlogger.log(\n\t\t\t` 2. Run ${logger.code(\"screenbook dev\")} to start the UI server`,\n\t\t)\n\t} else {\n\t\tlogger.log(\" 1. Configure routesPattern in screenbook.config.ts\")\n\t\tlogger.log(\n\t\t\t` 2. Run ${logger.code(\"screenbook generate\")} to auto-create screen.meta.ts files`,\n\t\t)\n\t\tlogger.log(\n\t\t\t` 3. Run ${logger.code(\"screenbook dev\")} to start the UI server`,\n\t\t)\n\t}\n\tlogger.blank()\n\tlogger.log(\"screen.meta.ts files are created alongside your route files:\")\n\tlogger.blank()\n\tlogger.log(logger.dim(\" src/pages/dashboard/\"))\n\tlogger.log(logger.dim(\" page.tsx # Your route file\"))\n\tlogger.log(\n\t\tlogger.dim(\" screen.meta.ts # Auto-generated, customize as needed\"),\n\t)\n}\n\nexport const initCommand = define({\n\tname: \"init\",\n\tdescription: \"Initialize Screenbook in a project\",\n\targs: {\n\t\tforce: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"f\",\n\t\t\tdescription: \"Overwrite existing files\",\n\t\t\tdefault: false,\n\t\t},\n\t\tskipDetect: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription: \"Skip framework auto-detection\",\n\t\t\tdefault: false,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst cwd = process.cwd()\n\t\tconst force = ctx.values.force ?? false\n\t\tconst skipDetect = ctx.values.skipDetect ?? false\n\n\t\tlogger.info(\"Initializing Screenbook...\")\n\t\tlogger.blank()\n\n\t\t// Framework detection\n\t\tlet framework: FrameworkInfo | null = null\n\n\t\tif (!skipDetect) {\n\t\t\tframework = detectFramework(cwd)\n\n\t\t\tif (framework) {\n\t\t\t\tlogger.itemSuccess(`Detected: ${framework.name}`)\n\t\t\t} else {\n\t\t\t\tlogger.log(\" Could not auto-detect framework\")\n\t\t\t\tlogger.blank()\n\t\t\t\tframework = await promptFrameworkSelection()\n\n\t\t\t\tif (framework) {\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.itemSuccess(`Selected: ${framework.name}`)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Create screenbook.config.ts\n\t\tconst configPath = join(cwd, \"screenbook.config.ts\")\n\t\tif (!force && existsSync(configPath)) {\n\t\t\tlogger.log(\n\t\t\t\t` ${logger.dim(\"-\")} screenbook.config.ts already exists ${logger.dim(\"(skipped)\")}`,\n\t\t\t)\n\t\t} else {\n\t\t\tconst configContent = generateConfigTemplate(framework)\n\t\t\twriteFileSync(configPath, configContent)\n\t\t\tlogger.itemSuccess(\"Created screenbook.config.ts\")\n\t\t}\n\n\t\t// Update .gitignore\n\t\tconst gitignorePath = join(cwd, \".gitignore\")\n\t\tconst screenbookIgnore = \".screenbook\"\n\n\t\tif (existsSync(gitignorePath)) {\n\t\t\tconst gitignoreContent = readFileSync(gitignorePath, \"utf-8\")\n\t\t\tif (!gitignoreContent.includes(screenbookIgnore)) {\n\t\t\t\tconst newContent = `${gitignoreContent.trimEnd()}\\n\\n# Screenbook\\n${screenbookIgnore}\\n`\n\t\t\t\twriteFileSync(gitignorePath, newContent)\n\t\t\t\tlogger.itemSuccess(\"Added .screenbook to .gitignore\")\n\t\t\t} else {\n\t\t\t\tlogger.log(\n\t\t\t\t\t` ${logger.dim(\"-\")} .screenbook already in .gitignore ${logger.dim(\"(skipped)\")}`,\n\t\t\t\t)\n\t\t\t}\n\t\t} else {\n\t\t\twriteFileSync(gitignorePath, `# Screenbook\\n${screenbookIgnore}\\n`)\n\t\t\tlogger.itemSuccess(\"Created .gitignore with .screenbook\")\n\t\t}\n\n\t\tlogger.blank()\n\t\tlogger.done(\"Screenbook initialized successfully!\")\n\n\t\tprintValueProposition()\n\t\tprintNextSteps(framework !== null)\n\t},\n})\n","import { existsSync, readFileSync } from \"node:fs\"\nimport { dirname, join, relative, resolve } from \"node:path\"\nimport type { AdoptionConfig, Config, Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport { minimatch } from \"minimatch\"\nimport { glob } from \"tinyglobby\"\nimport { parseAngularRouterConfig } from \"../utils/angularRouterParser.js\"\nimport { loadConfig } from \"../utils/config.js\"\nimport {\n\tdetectCycles,\n\tformatCycleWarnings,\n\tgetCycleSummary,\n} from \"../utils/cycleDetection.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport { logger } from \"../utils/logger.js\"\nimport {\n\tdetectRouterType,\n\tparseReactRouterConfig,\n} from \"../utils/reactRouterParser.js\"\nimport type { FlatRoute, ParseResult } from \"../utils/routeParserUtils.js\"\nimport { flattenRoutes } from \"../utils/routeParserUtils.js\"\nimport { parseSolidRouterConfig } from \"../utils/solidRouterParser.js\"\nimport { parseTanStackRouterConfig } from \"../utils/tanstackRouterParser.js\"\nimport { parseVueRouterConfig } from \"../utils/vueRouterParser.js\"\n\nexport const lintCommand = define({\n\tname: \"lint\",\n\tdescription: \"Detect routes without screen.meta.ts files\",\n\targs: {\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\tallowCycles: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription: \"Suppress circular navigation warnings\",\n\t\t\tdefault: false,\n\t\t},\n\t\tstrict: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"s\",\n\t\t\tdescription: \"Fail on disallowed cycles\",\n\t\t\tdefault: false,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst cwd = process.cwd()\n\t\tconst adoption = config.adoption ?? { mode: \"full\" }\n\t\tlet hasWarnings = false\n\n\t\t// Check for routes configuration\n\t\tif (!config.routesPattern && !config.routesFile) {\n\t\t\tlogger.errorWithHelp(ERRORS.ROUTES_PATTERN_MISSING)\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tlogger.info(\"Linting screen metadata coverage...\")\n\t\tif (adoption.mode === \"progressive\") {\n\t\t\tlogger.log(`Mode: Progressive adoption`)\n\t\t\tif (adoption.includePatterns?.length) {\n\t\t\t\tlogger.log(`Checking: ${adoption.includePatterns.join(\", \")}`)\n\t\t\t}\n\t\t\tif (adoption.minimumCoverage != null) {\n\t\t\t\tlogger.log(`Minimum coverage: ${adoption.minimumCoverage}%`)\n\t\t\t}\n\t\t}\n\t\tlogger.blank()\n\n\t\t// Use routesFile mode (config-based routing)\n\t\tif (config.routesFile) {\n\t\t\tawait lintRoutesFile(\n\t\t\t\tconfig.routesFile,\n\t\t\t\tcwd,\n\t\t\t\tconfig,\n\t\t\t\tadoption,\n\t\t\t\tctx.values.allowCycles ?? false,\n\t\t\t\tctx.values.strict ?? false,\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\t// Use routesPattern mode (file-based routing)\n\t\t// Find all route files\n\t\tlet routeFiles = await glob(config.routesPattern as string, {\n\t\t\tcwd,\n\t\t\tignore: config.ignore,\n\t\t})\n\n\t\t// In progressive mode, filter to only included patterns\n\t\tif (adoption.mode === \"progressive\" && adoption.includePatterns?.length) {\n\t\t\trouteFiles = routeFiles.filter((file) =>\n\t\t\t\tadoption.includePatterns?.some((pattern) => minimatch(file, pattern)),\n\t\t\t)\n\t\t}\n\n\t\tif (routeFiles.length === 0) {\n\t\t\tlogger.warn(`No route files found matching: ${config.routesPattern}`)\n\t\t\tif (adoption.mode === \"progressive\" && adoption.includePatterns?.length) {\n\t\t\t\tlogger.log(\n\t\t\t\t\t` ${logger.dim(`(filtered by includePatterns: ${adoption.includePatterns.join(\", \")})`)}`,\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\t// Find all screen.meta.ts files\n\t\tconst metaFiles = await glob(config.metaPattern, {\n\t\t\tcwd,\n\t\t\tignore: config.ignore,\n\t\t})\n\n\t\t// Build a set of directories that have screen.meta.ts\n\t\tconst metaDirs = new Set<string>()\n\t\tfor (const metaFile of metaFiles) {\n\t\t\tmetaDirs.add(dirname(metaFile))\n\t\t}\n\n\t\t// Check each route file - simple colocation check\n\t\tconst missingMeta: string[] = []\n\t\tconst covered: string[] = []\n\n\t\tfor (const routeFile of routeFiles) {\n\t\t\tconst routeDir = dirname(routeFile)\n\n\t\t\t// Check if there's a screen.meta.ts in the same directory\n\t\t\tif (metaDirs.has(routeDir)) {\n\t\t\t\tcovered.push(routeFile)\n\t\t\t} else {\n\t\t\t\tmissingMeta.push(routeFile)\n\t\t\t}\n\t\t}\n\n\t\t// Report results\n\t\tconst total = routeFiles.length\n\t\tconst coveredCount = covered.length\n\t\tconst missingCount = missingMeta.length\n\t\tconst coveragePercent = Math.round((coveredCount / total) * 100)\n\n\t\tlogger.log(`Found ${total} route files`)\n\t\tlogger.log(`Coverage: ${coveredCount}/${total} (${coveragePercent}%)`)\n\t\tlogger.blank()\n\n\t\t// Determine if lint should fail\n\t\tconst minimumCoverage = adoption.minimumCoverage ?? 100\n\t\tconst passedCoverage = coveragePercent >= minimumCoverage\n\n\t\tif (missingCount > 0) {\n\t\t\tlogger.log(`Missing screen.meta.ts (${missingCount} files):`)\n\t\t\tlogger.blank()\n\n\t\t\tfor (const file of missingMeta) {\n\t\t\t\tconst suggestedMetaPath = join(dirname(file), \"screen.meta.ts\")\n\t\t\t\tlogger.itemError(file)\n\t\t\t\tlogger.log(` ${logger.dim(\"→\")} ${logger.path(suggestedMetaPath)}`)\n\t\t\t}\n\n\t\t\tlogger.blank()\n\t\t}\n\n\t\tif (!passedCoverage) {\n\t\t\tlogger.error(\n\t\t\t\t`Lint failed: Coverage ${coveragePercent}% is below minimum ${minimumCoverage}%`,\n\t\t\t)\n\t\t\tprocess.exit(1)\n\t\t} else if (missingCount > 0) {\n\t\t\tlogger.success(\n\t\t\t\t`Coverage ${coveragePercent}% meets minimum ${minimumCoverage}%`,\n\t\t\t)\n\t\t\tif (adoption.mode === \"progressive\") {\n\t\t\t\tlogger.log(\n\t\t\t\t\t` ${logger.dim(\"Tip:\")} Increase minimumCoverage in config to gradually improve coverage`,\n\t\t\t\t)\n\t\t\t}\n\t\t} else {\n\t\t\tlogger.done(\"All routes have screen.meta.ts files\")\n\t\t}\n\n\t\t// Check for orphan screens (unreachable screens) and cycles\n\t\tconst screensPath = join(cwd, config.outDir, \"screens.json\")\n\t\tif (existsSync(screensPath)) {\n\t\t\ttry {\n\t\t\t\tconst content = readFileSync(screensPath, \"utf-8\")\n\t\t\t\tconst screens = JSON.parse(content) as Screen[]\n\n\t\t\t\t// Check for orphan screens\n\t\t\t\tconst orphans = findOrphanScreens(screens)\n\n\t\t\t\tif (orphans.length > 0) {\n\t\t\t\t\thasWarnings = true\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.warn(`Orphan screens detected (${orphans.length}):`)\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.log(\" These screens have no entryPoints and are not\")\n\t\t\t\t\tlogger.log(\" referenced in any other screen's 'next' array.\")\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tfor (const orphan of orphans) {\n\t\t\t\t\t\tlogger.itemWarn(`${orphan.id} ${logger.dim(orphan.route)}`)\n\t\t\t\t\t}\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t` ${logger.dim(\"Consider adding entryPoints or removing these screens.\")}`,\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\t// Check for circular navigation\n\t\t\t\tif (!ctx.values.allowCycles) {\n\t\t\t\t\tconst cycleResult = detectCycles(screens)\n\t\t\t\t\tif (cycleResult.hasCycles) {\n\t\t\t\t\t\thasWarnings = true\n\t\t\t\t\t\tlogger.blank()\n\t\t\t\t\t\tlogger.warn(getCycleSummary(cycleResult))\n\t\t\t\t\t\tlogger.log(formatCycleWarnings(cycleResult.cycles))\n\t\t\t\t\t\tlogger.blank()\n\t\t\t\t\t\tif (cycleResult.disallowedCycles.length > 0) {\n\t\t\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t\t\t` ${logger.dim(\"Use 'allowCycles: true' in screen.meta.ts to allow intentional cycles.\")}`,\n\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\tif (ctx.values.strict) {\n\t\t\t\t\t\t\t\tlogger.blank()\n\t\t\t\t\t\t\t\tlogger.errorWithHelp(\n\t\t\t\t\t\t\t\t\tERRORS.CYCLES_DETECTED(cycleResult.disallowedCycles.length),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tprocess.exit(1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check for invalid navigation references\n\t\t\t\tconst invalidNavs = findInvalidNavigations(screens)\n\t\t\t\tif (invalidNavs.length > 0) {\n\t\t\t\t\thasWarnings = true\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.warn(`Invalid navigation targets (${invalidNavs.length}):`)\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t\" These navigation references point to non-existent screens.\",\n\t\t\t\t\t)\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tfor (const inv of invalidNavs) {\n\t\t\t\t\t\tlogger.itemWarn(\n\t\t\t\t\t\t\t`${inv.screenId} → ${logger.dim(inv.field)}: \"${inv.target}\"`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t` ${logger.dim(\"Check that these screen IDs exist in your codebase.\")}`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t// Handle specific error types\n\t\t\t\tif (error instanceof SyntaxError) {\n\t\t\t\t\tlogger.warn(\"Failed to parse screens.json - file may be corrupted\")\n\t\t\t\t\tlogger.log(` ${logger.dim(\"Run 'screenbook build' to regenerate.\")}`)\n\t\t\t\t\thasWarnings = true\n\t\t\t\t} else if (error instanceof Error) {\n\t\t\t\t\tlogger.warn(`Failed to analyze screens.json: ${error.message}`)\n\t\t\t\t\thasWarnings = true\n\t\t\t\t} else {\n\t\t\t\t\tlogger.warn(`Failed to analyze screens.json: ${String(error)}`)\n\t\t\t\t\thasWarnings = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasWarnings) {\n\t\t\tlogger.blank()\n\t\t\tlogger.warn(\"Lint completed with warnings.\")\n\t\t}\n\t},\n})\n\n/**\n * Lint screen.meta.ts coverage for routesFile mode (config-based routing)\n */\nasync function lintRoutesFile(\n\troutesFile: string,\n\tcwd: string,\n\tconfig: Pick<Config, \"metaPattern\" | \"outDir\" | \"ignore\">,\n\tadoption: AdoptionConfig,\n\tallowCycles: boolean,\n\tstrict: boolean,\n): Promise<boolean> {\n\tlet hasWarnings = false\n\tconst absoluteRoutesFile = resolve(cwd, routesFile)\n\n\t// Check if routes file exists\n\tif (!existsSync(absoluteRoutesFile)) {\n\t\tlogger.errorWithHelp(ERRORS.ROUTES_FILE_NOT_FOUND(routesFile))\n\t\tprocess.exit(1)\n\t}\n\n\tlogger.log(`Parsing routes from ${logger.path(routesFile)}...`)\n\tlogger.blank()\n\n\t// Parse the routes file with auto-detection\n\tlet flatRoutes: FlatRoute[]\n\ttry {\n\t\tconst content = readFileSync(absoluteRoutesFile, \"utf-8\")\n\t\tconst routerType = detectRouterType(content)\n\n\t\tlet parseResult: ParseResult\n\t\tif (routerType === \"tanstack-router\") {\n\t\t\tparseResult = parseTanStackRouterConfig(absoluteRoutesFile, content)\n\t\t} else if (routerType === \"solid-router\") {\n\t\t\tparseResult = parseSolidRouterConfig(absoluteRoutesFile, content)\n\t\t} else if (routerType === \"angular-router\") {\n\t\t\tparseResult = parseAngularRouterConfig(absoluteRoutesFile, content)\n\t\t} else if (routerType === \"react-router\") {\n\t\t\tparseResult = parseReactRouterConfig(absoluteRoutesFile, content)\n\t\t} else if (routerType === \"vue-router\") {\n\t\t\tparseResult = parseVueRouterConfig(absoluteRoutesFile, content)\n\t\t} else {\n\t\t\t// Unknown router type - warn user and attempt Vue Router parser as fallback\n\t\t\tlogger.warn(\n\t\t\t\t`Could not auto-detect router type for ${logger.path(routesFile)}. Attempting to parse as Vue Router.`,\n\t\t\t)\n\t\t\tlogger.log(\n\t\t\t\t` ${logger.dim(\"If parsing fails, check that your router imports are explicit.\")}`,\n\t\t\t)\n\t\t\thasWarnings = true\n\t\t\tparseResult = parseVueRouterConfig(absoluteRoutesFile, content)\n\t\t}\n\n\t\t// Show warnings\n\t\tfor (const warning of parseResult.warnings) {\n\t\t\tlogger.warn(warning)\n\t\t\thasWarnings = true\n\t\t}\n\n\t\tflatRoutes = flattenRoutes(parseResult.routes)\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tlogger.errorWithHelp(ERRORS.ROUTES_FILE_PARSE_ERROR(routesFile, message))\n\t\tprocess.exit(1)\n\t}\n\n\tif (flatRoutes.length === 0) {\n\t\tlogger.warn(\"No routes found in the config file\")\n\t\treturn hasWarnings\n\t}\n\n\t// Find all screen.meta.ts files\n\tconst metaFiles = await glob(config.metaPattern, {\n\t\tcwd,\n\t\tignore: config.ignore,\n\t})\n\n\t// Build a set of directories that have screen.meta.ts\n\tconst metaDirs = new Set<string>()\n\t// Also build a map from directory basename to full path for component name matching\n\tconst metaDirsByName = new Map<string, string>()\n\tfor (const metaFile of metaFiles) {\n\t\tconst dir = dirname(metaFile)\n\t\tmetaDirs.add(dir)\n\t\t// Store lowercase basename for case-insensitive matching\n\t\tconst baseName = dir.split(\"/\").pop()?.toLowerCase() || \"\"\n\t\tif (baseName) {\n\t\t\tmetaDirsByName.set(baseName, dir)\n\t\t}\n\t}\n\n\t// Check each route for screen.meta.ts coverage\n\tconst missingMeta: FlatRoute[] = []\n\tconst covered: FlatRoute[] = []\n\n\tfor (const route of flatRoutes) {\n\t\t// Skip layout routes (components ending with \"Layout\" that typically don't need screen.meta)\n\t\tif (route.componentPath?.endsWith(\"Layout\")) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Try multiple matching strategies\n\t\tlet matched = false\n\n\t\t// Strategy 1: Check by determineMetaDir (path-based matching)\n\t\tconst metaPath = determineMetaDir(route, cwd)\n\t\tif (metaDirs.has(metaPath)) {\n\t\t\tmatched = true\n\t\t}\n\n\t\t// Strategy 2: Match by component name (for React Router)\n\t\tif (!matched && route.componentPath) {\n\t\t\tconst componentName = route.componentPath.toLowerCase()\n\t\t\tif (metaDirsByName.has(componentName)) {\n\t\t\t\tmatched = true\n\t\t\t}\n\n\t\t\t// Also try matching the last word of component name\n\t\t\t// e.g., \"UserProfile\" -> check for \"profile\" directory\n\t\t\tif (!matched) {\n\t\t\t\t// Split by uppercase letters to get parts\n\t\t\t\tconst parts = route.componentPath.split(/(?=[A-Z])/)\n\t\t\t\tconst lastPart = parts[parts.length - 1]\n\t\t\t\tif (parts.length > 1 && lastPart) {\n\t\t\t\t\tif (metaDirsByName.has(lastPart.toLowerCase())) {\n\t\t\t\t\t\tmatched = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Strategy 3: Match by screenId path pattern\n\t\tif (!matched) {\n\t\t\tconst screenPath = route.screenId.replace(/\\./g, \"/\")\n\t\t\tfor (const dir of metaDirs) {\n\t\t\t\tif (dir.endsWith(screenPath)) {\n\t\t\t\t\tmatched = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (matched) {\n\t\t\tcovered.push(route)\n\t\t} else {\n\t\t\tmissingMeta.push(route)\n\t\t}\n\t}\n\n\t// Report results\n\tconst total = covered.length + missingMeta.length\n\tconst coveredCount = covered.length\n\tconst missingCount = missingMeta.length\n\tconst coveragePercent = Math.round((coveredCount / total) * 100)\n\n\tlogger.log(`Found ${total} routes`)\n\tlogger.log(`Coverage: ${coveredCount}/${total} (${coveragePercent}%)`)\n\tlogger.blank()\n\n\t// Determine if lint should fail\n\tconst minimumCoverage = adoption.minimumCoverage ?? 100\n\tconst passedCoverage = coveragePercent >= minimumCoverage\n\n\tif (missingCount > 0) {\n\t\tlogger.log(`Missing screen.meta.ts (${missingCount} routes):`)\n\t\tlogger.blank()\n\n\t\tfor (const route of missingMeta) {\n\t\t\tconst suggestedMetaPath = determineSuggestedMetaPath(route, cwd)\n\t\t\tlogger.itemError(\n\t\t\t\t`${route.fullPath} ${logger.dim(`(${route.screenId})`)}`,\n\t\t\t)\n\t\t\tlogger.log(` ${logger.dim(\"→\")} ${logger.path(suggestedMetaPath)}`)\n\t\t}\n\n\t\tlogger.blank()\n\t}\n\n\tif (!passedCoverage) {\n\t\tlogger.error(\n\t\t\t`Lint failed: Coverage ${coveragePercent}% is below minimum ${minimumCoverage}%`,\n\t\t)\n\t\tprocess.exit(1)\n\t} else if (missingCount > 0) {\n\t\tlogger.success(\n\t\t\t`Coverage ${coveragePercent}% meets minimum ${minimumCoverage}%`,\n\t\t)\n\t\tif (adoption.mode === \"progressive\") {\n\t\t\tlogger.log(\n\t\t\t\t` ${logger.dim(\"Tip:\")} Increase minimumCoverage in config to gradually improve coverage`,\n\t\t\t)\n\t\t}\n\t} else {\n\t\tlogger.done(\"All routes have screen.meta.ts files\")\n\t}\n\n\t// Check for orphan screens and cycles using screens.json\n\tconst screensPath = join(cwd, config.outDir, \"screens.json\")\n\tif (existsSync(screensPath)) {\n\t\ttry {\n\t\t\tconst content = readFileSync(screensPath, \"utf-8\")\n\t\t\tconst screens = JSON.parse(content) as Screen[]\n\n\t\t\t// Check for orphan screens\n\t\t\tconst orphans = findOrphanScreens(screens)\n\n\t\t\tif (orphans.length > 0) {\n\t\t\t\thasWarnings = true\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.warn(`Orphan screens detected (${orphans.length}):`)\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(\" These screens have no entryPoints and are not\")\n\t\t\t\tlogger.log(\" referenced in any other screen's 'next' array.\")\n\t\t\t\tlogger.blank()\n\t\t\t\tfor (const orphan of orphans) {\n\t\t\t\t\tlogger.itemWarn(`${orphan.id} ${logger.dim(orphan.route)}`)\n\t\t\t\t}\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(\n\t\t\t\t\t` ${logger.dim(\"Consider adding entryPoints or removing these screens.\")}`,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t// Check for circular navigation\n\t\t\tif (!allowCycles) {\n\t\t\t\tconst cycleResult = detectCycles(screens)\n\t\t\t\tif (cycleResult.hasCycles) {\n\t\t\t\t\thasWarnings = true\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.warn(getCycleSummary(cycleResult))\n\t\t\t\t\tlogger.log(formatCycleWarnings(cycleResult.cycles))\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tif (cycleResult.disallowedCycles.length > 0) {\n\t\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t\t` ${logger.dim(\"Use 'allowCycles: true' in screen.meta.ts to allow intentional cycles.\")}`,\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\tif (strict) {\n\t\t\t\t\t\t\tlogger.blank()\n\t\t\t\t\t\t\tlogger.errorWithHelp(\n\t\t\t\t\t\t\t\tERRORS.CYCLES_DETECTED(cycleResult.disallowedCycles.length),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tprocess.exit(1)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check for invalid navigation references\n\t\t\tconst invalidNavs = findInvalidNavigations(screens)\n\t\t\tif (invalidNavs.length > 0) {\n\t\t\t\thasWarnings = true\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.warn(`Invalid navigation targets (${invalidNavs.length}):`)\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(\n\t\t\t\t\t\" These navigation references point to non-existent screens.\",\n\t\t\t\t)\n\t\t\t\tlogger.blank()\n\t\t\t\tfor (const inv of invalidNavs) {\n\t\t\t\t\tlogger.itemWarn(\n\t\t\t\t\t\t`${inv.screenId} → ${logger.dim(inv.field)}: \"${inv.target}\"`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(\n\t\t\t\t\t` ${logger.dim(\"Check that these screen IDs exist in your codebase.\")}`,\n\t\t\t\t)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (error instanceof SyntaxError) {\n\t\t\t\tlogger.warn(\"Failed to parse screens.json - file may be corrupted\")\n\t\t\t\tlogger.log(` ${logger.dim(\"Run 'screenbook build' to regenerate.\")}`)\n\t\t\t\thasWarnings = true\n\t\t\t} else if (error instanceof Error) {\n\t\t\t\tlogger.warn(`Failed to analyze screens.json: ${error.message}`)\n\t\t\t\thasWarnings = true\n\t\t\t} else {\n\t\t\t\tlogger.warn(`Failed to analyze screens.json: ${String(error)}`)\n\t\t\t\thasWarnings = true\n\t\t\t}\n\t\t}\n\t}\n\n\tif (hasWarnings) {\n\t\tlogger.blank()\n\t\tlogger.warn(\"Lint completed with warnings.\")\n\t}\n\n\treturn hasWarnings\n}\n\n/**\n * Determine the directory where screen.meta.ts should be for a route\n */\nfunction determineMetaDir(route: FlatRoute, cwd: string): string {\n\t// If component path is available, check relative to component directory\n\tif (route.componentPath) {\n\t\tconst componentDir = dirname(route.componentPath)\n\t\tconst relativePath = relative(cwd, componentDir)\n\t\t// Ensure path doesn't escape cwd\n\t\tif (!relativePath.startsWith(\"..\")) {\n\t\t\treturn relativePath\n\t\t}\n\t}\n\n\t// Fall back to src/screens/{screenId} convention\n\tconst screenDir = route.screenId.replace(/\\./g, \"/\")\n\treturn join(\"src\", \"screens\", screenDir)\n}\n\n/**\n * Determine the suggested screen.meta.ts path for a route\n */\nfunction determineSuggestedMetaPath(route: FlatRoute, cwd: string): string {\n\tconst metaDir = determineMetaDir(route, cwd)\n\treturn join(metaDir, \"screen.meta.ts\")\n}\n\ninterface InvalidNavigation {\n\tscreenId: string\n\tfield: string\n\ttarget: string\n}\n\n/**\n * Find navigation references that point to non-existent screens.\n * Checks `next`, `entryPoints` arrays and mock navigation targets.\n */\nfunction findInvalidNavigations(screens: Screen[]): InvalidNavigation[] {\n\tconst screenIds = new Set(screens.map((s) => s.id))\n\tconst invalid: InvalidNavigation[] = []\n\n\tfor (const screen of screens) {\n\t\t// Check next array\n\t\tif (screen.next) {\n\t\t\tfor (const target of screen.next) {\n\t\t\t\tif (!screenIds.has(target)) {\n\t\t\t\t\tinvalid.push({ screenId: screen.id, field: \"next\", target })\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check entryPoints array\n\t\tif (screen.entryPoints) {\n\t\t\tfor (const target of screen.entryPoints) {\n\t\t\t\tif (!screenIds.has(target)) {\n\t\t\t\t\tinvalid.push({ screenId: screen.id, field: \"entryPoints\", target })\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn invalid\n}\n\n/**\n * Find screens that are unreachable (orphans).\n * A screen is an orphan if:\n * - It has no entryPoints defined\n * - AND it's not referenced in any other screen's `next` array\n */\nfunction findOrphanScreens(screens: Screen[]): Screen[] {\n\t// Build a set of all screen IDs that are referenced in `next` arrays\n\tconst referencedIds = new Set<string>()\n\tfor (const screen of screens) {\n\t\tif (screen.next) {\n\t\t\tfor (const nextId of screen.next) {\n\t\t\t\treferencedIds.add(nextId)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Find orphan screens\n\tconst orphans: Screen[] = []\n\tfor (const screen of screens) {\n\t\tconst hasEntryPoints = screen.entryPoints && screen.entryPoints.length > 0\n\t\tconst isReferenced = referencedIds.has(screen.id)\n\n\t\t// A screen is an orphan if it has no entry points AND is not referenced\n\t\tif (!hasEntryPoints && !isReferenced) {\n\t\t\torphans.push(screen)\n\t\t}\n\t}\n\n\treturn orphans\n}\n","import { basename, dirname } from \"node:path\"\nimport type { ImpactResult } from \"./impactAnalysis.js\"\n\n/**\n * Extract potential API names from changed file paths.\n * Looks for common API file patterns.\n */\nexport function extractApiNames(files: string[]): string[] {\n\tconst apis = new Set<string>()\n\n\tfor (const file of files) {\n\t\tconst fileName = basename(file, \".ts\")\n\t\t\t.replace(/\\.tsx?$/, \"\")\n\t\t\t.replace(/\\.js$/, \"\")\n\t\t\t.replace(/\\.jsx?$/, \"\")\n\n\t\tconst dirName = basename(dirname(file))\n\n\t\t// Pattern: src/api/InvoiceAPI.ts -> InvoiceAPI\n\t\tif (\n\t\t\tfile.includes(\"/api/\") ||\n\t\t\tfile.includes(\"/apis/\") ||\n\t\t\tfile.includes(\"/services/\")\n\t\t) {\n\t\t\tif (\n\t\t\t\tfileName.endsWith(\"API\") ||\n\t\t\t\tfileName.endsWith(\"Api\") ||\n\t\t\t\tfileName.endsWith(\"Service\")\n\t\t\t) {\n\t\t\t\tapis.add(fileName)\n\t\t\t}\n\t\t}\n\n\t\t// Pattern: src/services/invoice/index.ts -> InvoiceService\n\t\tif (\n\t\t\tfile.includes(\"/services/\") &&\n\t\t\t(fileName === \"index\" || fileName === dirName)\n\t\t) {\n\t\t\tconst serviceName = `${capitalize(dirName)}Service`\n\t\t\tapis.add(serviceName)\n\t\t}\n\n\t\t// Pattern: src/api/invoice.ts -> InvoiceAPI\n\t\tif (file.includes(\"/api/\") || file.includes(\"/apis/\")) {\n\t\t\tif (!fileName.endsWith(\"API\") && !fileName.endsWith(\"Api\")) {\n\t\t\t\tconst apiName = `${capitalize(fileName)}API`\n\t\t\t\tapis.add(apiName)\n\t\t\t}\n\t\t}\n\n\t\t// Pattern: explicit API/Service file names\n\t\tif (\n\t\t\tfileName.toLowerCase().includes(\"api\") ||\n\t\t\tfileName.toLowerCase().includes(\"service\")\n\t\t) {\n\t\t\tapis.add(fileName)\n\t\t}\n\t}\n\n\treturn Array.from(apis).sort()\n}\n\nexport function capitalize(str: string): string {\n\treturn str.charAt(0).toUpperCase() + str.slice(1)\n}\n\n/**\n * Format the results as Markdown for PR comments.\n */\nexport function formatMarkdown(\n\tchangedFiles: string[],\n\tdetectedApis: string[],\n\tresults: ImpactResult[],\n): string {\n\tconst lines: string[] = []\n\n\tlines.push(\"## Screenbook Impact Analysis\")\n\tlines.push(\"\")\n\n\tif (results.length === 0) {\n\t\tlines.push(\"No screen impacts detected from the API changes in this PR.\")\n\t\tlines.push(\"\")\n\t\tlines.push(\"<details>\")\n\t\tlines.push(\"<summary>Detected APIs (no screen dependencies)</summary>\")\n\t\tlines.push(\"\")\n\t\tfor (const api of detectedApis) {\n\t\t\tlines.push(`- \\`${api}\\``)\n\t\t}\n\t\tlines.push(\"\")\n\t\tlines.push(\"</details>\")\n\t\treturn lines.join(\"\\n\")\n\t}\n\n\t// Summary\n\tconst totalDirect = results.reduce((sum, r) => sum + r.direct.length, 0)\n\tconst totalTransitive = results.reduce(\n\t\t(sum, r) => sum + r.transitive.length,\n\t\t0,\n\t)\n\tconst totalScreens = totalDirect + totalTransitive\n\n\tlines.push(\n\t\t`**${totalScreens} screen${totalScreens > 1 ? \"s\" : \"\"} affected** by changes to ${results.length} API${results.length > 1 ? \"s\" : \"\"}`,\n\t)\n\tlines.push(\"\")\n\n\t// Per-API breakdown\n\tfor (const result of results) {\n\t\tlines.push(`### ${result.api}`)\n\t\tlines.push(\"\")\n\n\t\tif (result.direct.length > 0) {\n\t\t\tlines.push(`**Direct dependencies** (${result.direct.length}):`)\n\t\t\tlines.push(\"\")\n\t\t\tlines.push(\"| Screen | Route | Owner |\")\n\t\t\tlines.push(\"|--------|-------|-------|\")\n\t\t\tfor (const screen of result.direct) {\n\t\t\t\tconst owner = screen.owner?.join(\", \") ?? \"-\"\n\t\t\t\tlines.push(`| ${screen.id} | \\`${screen.route}\\` | ${owner} |`)\n\t\t\t}\n\t\t\tlines.push(\"\")\n\t\t}\n\n\t\tif (result.transitive.length > 0) {\n\t\t\tlines.push(`**Transitive dependencies** (${result.transitive.length}):`)\n\t\t\tlines.push(\"\")\n\t\t\tfor (const { path } of result.transitive) {\n\t\t\t\tlines.push(`- ${path.join(\" → \")}`)\n\t\t\t}\n\t\t\tlines.push(\"\")\n\t\t}\n\t}\n\n\t// Changed files summary\n\tlines.push(\"<details>\")\n\tlines.push(`<summary>Changed files (${changedFiles.length})</summary>`)\n\tlines.push(\"\")\n\tfor (const file of changedFiles.slice(0, 20)) {\n\t\tlines.push(`- \\`${file}\\``)\n\t}\n\tif (changedFiles.length > 20) {\n\t\tlines.push(`- ... and ${changedFiles.length - 20} more`)\n\t}\n\tlines.push(\"\")\n\tlines.push(\"</details>\")\n\n\treturn lines.join(\"\\n\")\n}\n","import { execSync } from \"node:child_process\"\nimport { existsSync, readFileSync } from \"node:fs\"\nimport { join } from \"node:path\"\nimport type { Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport { loadConfig } from \"../utils/config.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport { analyzeImpact, type ImpactResult } from \"../utils/impactAnalysis.js\"\nimport { logger } from \"../utils/logger.js\"\nimport { extractApiNames, formatMarkdown } from \"../utils/prImpact.js\"\n\nexport const prImpactCommand = define({\n\tname: \"pr-impact\",\n\tdescription: \"Analyze impact of changed files in a PR\",\n\targs: {\n\t\tbase: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"b\",\n\t\t\tdescription: \"Base branch to compare against (default: main)\",\n\t\t\tdefault: \"main\",\n\t\t},\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\tformat: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"f\",\n\t\t\tdescription: \"Output format: markdown (default) or json\",\n\t\t\tdefault: \"markdown\",\n\t\t},\n\t\tdepth: {\n\t\t\ttype: \"number\",\n\t\t\tshort: \"d\",\n\t\t\tdescription: \"Maximum depth for transitive dependencies\",\n\t\t\tdefault: 3,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst cwd = process.cwd()\n\n\t\tconst baseBranch = ctx.values.base ?? \"main\"\n\t\tconst format = ctx.values.format ?? \"markdown\"\n\t\tconst depth = ctx.values.depth ?? 3\n\n\t\t// Get changed files from git\n\t\tlet changedFiles: string[]\n\t\ttry {\n\t\t\tconst gitOutput = execSync(\n\t\t\t\t`git diff --name-only ${baseBranch}...HEAD 2>/dev/null || git diff --name-only ${baseBranch} HEAD`,\n\t\t\t\t{ cwd, encoding: \"utf-8\" },\n\t\t\t)\n\t\t\tchangedFiles = gitOutput\n\t\t\t\t.split(\"\\n\")\n\t\t\t\t.map((f) => f.trim())\n\t\t\t\t.filter((f) => f.length > 0)\n\t\t} catch {\n\t\t\tlogger.errorWithHelp(ERRORS.GIT_CHANGED_FILES_ERROR(baseBranch))\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tif (changedFiles.length === 0) {\n\t\t\tlogger.info(\"No changed files found.\")\n\t\t\treturn\n\t\t}\n\n\t\t// Extract potential API names from changed files\n\t\tconst apiNames = extractApiNames(changedFiles)\n\n\t\tif (apiNames.length === 0) {\n\t\t\tif (format === \"markdown\") {\n\t\t\t\tlogger.log(\"## Screenbook Impact Analysis\")\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(\"No API-related changes detected in this PR.\")\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(`Changed files: ${changedFiles.length}`)\n\t\t\t} else {\n\t\t\t\tlogger.log(\n\t\t\t\t\tJSON.stringify({ apis: [], results: [], changedFiles }, null, 2),\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\t// Load screens.json\n\t\tconst screensPath = join(cwd, config.outDir, \"screens.json\")\n\n\t\tif (!existsSync(screensPath)) {\n\t\t\tlogger.errorWithHelp(ERRORS.SCREENS_NOT_FOUND)\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tlet screens: Screen[]\n\t\ttry {\n\t\t\tconst content = readFileSync(screensPath, \"utf-8\")\n\t\t\tscreens = JSON.parse(content) as Screen[]\n\t\t} catch (error) {\n\t\t\tlogger.errorWithHelp({\n\t\t\t\t...ERRORS.SCREENS_PARSE_ERROR,\n\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t})\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\t// Analyze impact for each API\n\t\tconst results: ImpactResult[] = []\n\t\tfor (const apiName of apiNames) {\n\t\t\tconst result = analyzeImpact(screens, apiName, depth)\n\t\t\tif (result.totalCount > 0) {\n\t\t\t\tresults.push(result)\n\t\t\t}\n\t\t}\n\n\t\t// Output results\n\t\tif (format === \"json\") {\n\t\t\tlogger.log(\n\t\t\t\tJSON.stringify(\n\t\t\t\t\t{\n\t\t\t\t\t\tchangedFiles,\n\t\t\t\t\t\tdetectedApis: apiNames,\n\t\t\t\t\t\tresults: results.map((r) => ({\n\t\t\t\t\t\t\tapi: r.api,\n\t\t\t\t\t\t\tdirectCount: r.direct.length,\n\t\t\t\t\t\t\ttransitiveCount: r.transitive.length,\n\t\t\t\t\t\t\ttotalCount: r.totalCount,\n\t\t\t\t\t\t\tdirect: r.direct.map((s) => ({\n\t\t\t\t\t\t\t\tid: s.id,\n\t\t\t\t\t\t\t\ttitle: s.title,\n\t\t\t\t\t\t\t\troute: s.route,\n\t\t\t\t\t\t\t\towner: s.owner,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\ttransitive: r.transitive.map(({ screen, path }) => ({\n\t\t\t\t\t\t\t\tid: screen.id,\n\t\t\t\t\t\t\t\ttitle: screen.title,\n\t\t\t\t\t\t\t\troute: screen.route,\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t})),\n\t\t\t\t\t},\n\t\t\t\t\tnull,\n\t\t\t\t\t2,\n\t\t\t\t),\n\t\t\t)\n\t\t} else {\n\t\t\tlogger.log(formatMarkdown(changedFiles, apiNames, results))\n\t\t}\n\t},\n})\n","#!/usr/bin/env node\n\nimport { readFileSync } from \"node:fs\"\nimport { dirname, join } from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { cli, define } from \"gunshi\"\nimport { buildCommand } from \"./commands/build.js\"\nimport { devCommand } from \"./commands/dev.js\"\nimport { doctorCommand } from \"./commands/doctor.js\"\nimport { generateCommand } from \"./commands/generate.js\"\nimport { impactCommand } from \"./commands/impact.js\"\nimport { initCommand } from \"./commands/init.js\"\nimport { lintCommand } from \"./commands/lint.js\"\nimport { prImpactCommand } from \"./commands/pr-impact.js\"\n\nconst __dirname = dirname(fileURLToPath(import.meta.url))\nconst packageJson = JSON.parse(\n\treadFileSync(join(__dirname, \"..\", \"package.json\"), \"utf-8\"),\n)\nconst version: string = packageJson.version\n\nconst mainCommand = define({\n\tname: \"screenbook\",\n\tdescription: \"Screen catalog and navigation graph generator\",\n\trun: () => {\n\t\tconsole.log(\"Usage: screenbook <command>\")\n\t\tconsole.log(\"\")\n\t\tconsole.log(\"Commands:\")\n\t\tconsole.log(\" init Initialize Screenbook in a project\")\n\t\tconsole.log(\" generate Auto-generate screen.meta.ts from routes\")\n\t\tconsole.log(\" build Build screen metadata JSON\")\n\t\tconsole.log(\" dev Start the development server\")\n\t\tconsole.log(\" lint Detect routes without screen.meta\")\n\t\tconsole.log(\" impact Analyze API dependency impact\")\n\t\tconsole.log(\" pr-impact Analyze PR changes impact\")\n\t\tconsole.log(\" doctor Diagnose common setup issues\")\n\t\tconsole.log(\"\")\n\t\tconsole.log(\"Run 'screenbook <command> --help' for more information\")\n\t},\n})\n\nawait cli(process.argv.slice(2), mainCommand, {\n\tname: \"screenbook\",\n\tversion,\n\tsubCommands: {\n\t\tinit: initCommand,\n\t\tgenerate: generateCommand,\n\t\tbuild: buildCommand,\n\t\tdev: devCommand,\n\t\tlint: lintCommand,\n\t\timpact: impactCommand,\n\t\t\"pr-impact\": prImpactCommand,\n\t\tdoctor: doctorCommand,\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;AAKA,MAAMA,iBAAe;CACpB;CACA;CACA;CACA;AAED,eAAsB,WAAW,YAAsC;CACtE,MAAM,MAAM,QAAQ,KAAK;AAGzB,KAAI,YAAY;EACf,MAAM,eAAe,QAAQ,KAAK,WAAW;AAC7C,MAAI,CAAC,WAAW,aAAa,CAC5B,OAAM,IAAI,MAAM,0BAA0B,aAAa;AAExD,SAAO,MAAM,aAAa,cAAc,IAAI;;AAI7C,MAAK,MAAM,cAAcA,gBAAc;EACtC,MAAM,eAAe,QAAQ,KAAK,WAAW;AAC7C,MAAI,WAAW,aAAa,CAC3B,QAAO,MAAM,aAAa,cAAc,IAAI;;AAK9C,QAAO,cAAc;;AAGtB,eAAe,aACd,cACA,KACkB;CAElB,MAAM,SAAU,MADH,WAAW,IAAI,CACD,OAAO,aAAa;AAE/C,KAAI,OAAO,QACV,QAAO,OAAO;AAGf,OAAM,IAAI,MAAM,2CAA2C,eAAe;;;;;ACN3E,IAAK,0CAAL;AACC;AACA;AACA;;EAHI;;;;;;;;;;;;;;;;;AAsBL,SAAgB,aAAa,SAAyC;CACrE,MAAM,4BAAY,IAAI,KAAqB;CAC3C,MAAMC,eAAyB,EAAE;AAGjC,MAAK,MAAM,UAAU,SAAS;AAC7B,MAAI,CAAC,OAAO,MAAM,OAAO,OAAO,OAAO,SAEtC;AAED,MAAI,UAAU,IAAI,OAAO,GAAG,CAC3B,cAAa,KAAK,OAAO,GAAG;AAE7B,YAAU,IAAI,OAAO,IAAI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,YAAY,EAAE,WAAW,KAAK,EAAE,QAAQ,YAAY;KACnD,IAAI,OAAO;KACX,OAAO,OAAO;KACd,OAAO,OAAO;KACd;KACA,EAAE;IACH,EAAE;GACH,EACD,MACA,EACA,CACD;MAED,QAAO,IAAI,eAAe,cAAc,UAAU,QAAQ,CAAC;;CAG7D,CAAC;;;;ACtIF,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAIzD,MAAMC,UAHc,KAAK,MACxB,aAAa,KAAK,WAAW,MAAM,eAAe,EAAE,QAAQ,CAC5D,CACmC;AAEpC,MAAM,cAAc,OAAO;CAC1B,MAAM;CACN,aAAa;CACb,WAAW;AACV,UAAQ,IAAI,8BAA8B;AAC1C,UAAQ,IAAI,GAAG;AACf,UAAQ,IAAI,YAAY;AACxB,UAAQ,IAAI,kDAAkD;AAC9D,UAAQ,IAAI,wDAAwD;AACpE,UAAQ,IAAI,0CAA0C;AACtD,UAAQ,IAAI,4CAA4C;AACxD,UAAQ,IAAI,iDAAiD;AAC7D,UAAQ,IAAI,6CAA6C;AACzD,UAAQ,IAAI,yCAAyC;AACrD,UAAQ,IAAI,4CAA4C;AACxD,UAAQ,IAAI,GAAG;AACf,UAAQ,IAAI,yDAAyD;;CAEtE,CAAC;AAEF,MAAM,IAAI,QAAQ,KAAK,MAAM,EAAE,EAAE,aAAa;CAC7C,MAAM;CACN;CACA,aAAa;EACZ,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;EACR,aAAa;EACb,QAAQ;EACR;CACD,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["CONFIG_FILES","module","duplicateIds: string[]","cycles: CycleInfo[]","path: string[]","current: string | null | undefined","lines: string[]","errors: ValidationError[]","bestMatch: string | undefined","matrix: number[][]","lines: string[]","define","screens: ScreenWithFilePath[]","module","routeFiles: string[]","missing: CoverageData[\"missing\"]","byOwner: CoverageData[\"byOwner\"]","byTag: CoverageData[\"byTag\"]","lines: string[]","define","resolveUiPackage","screens: ScreenWithFilePath[]","module","define","results: CheckResult[]","version","summary: string[]","result: FlatRoute[]","fullPath: string","warnings: string[]","content: string","ast: ReturnType<typeof parse>","routes: ParsedRoute[]","parseRoutesArray","classNode: any","parseRouteObject","path: string | undefined","component: string | undefined","children: ParsedRoute[] | undefined","redirectTo: string | undefined","loc","navigations: DetectedNavigation[]","warnings: string[]","ast: ReturnType<typeof parse>","line","templateNavigations: DetectedNavigation[]","scriptNavigations: DetectedNavigation[]","warnings: string[]","warning: string","navigations: DetectedNavigation[]","parserErrors: string[]","parser","imports: DetectedApiImport[]","warnings: string[]","ast: ReturnType<typeof parse>","warnings: string[]","content: string","ast: ReturnType<typeof parse>","routes: ParsedRoute[]","parseRoutesArray","parseRouteObject","paths: string[]","component: string | undefined","children: ParsedRoute[] | undefined","extractLazyImportPath","loc","warnings: string[]","content: string","ast: ReturnType<typeof parse>","extractLazyImportPath","routeDef: RouteDefinition","parentVarName: string | undefined","childNames: string[]","routes: ParsedRoute[]","route: ParsedRoute","children: ParsedRoute[]","warnings: string[]","content: string","ast: ReturnType<typeof parse>","routes: ParsedRoute[]","parseRoutesArray","parseRouteObject","route: ParsedRoute","parts: string[]","loc","warnings: string[]","content: string","ast: ReturnType<typeof parse>","routes: ParsedRoute[]","route: ParsedRoute","global","exports","sourceFile","comparator","version","needle","section","parser","templateNavigations: DetectedNavigation[]","scriptNavigations: DetectedNavigation[]","warnings: string[]","parse","navigations: DetectedNavigation[]","NodeTypes","define","parseResult: ParseResult","screenMeta: InferredScreenMeta","detectedApis: string[]","detectedNext: string[]","componentContent: string","routeContent: string","transitive: TransitiveDependency[]","queue: Array<{ id: string; path: string[] }>","lines: string[]","define","screens: Screen[]","FRAMEWORKS: FrameworkDefinition[]","screens: ScreenWithFilePath[]","module","define","framework: FrameworkInfo | null","define","missingMeta: string[]","covered: string[]","flatRoutes: FlatRoute[]","parseResult: ParseResult","missingMeta: FlatRoute[]","covered: FlatRoute[]","invalid: InvalidNavigation[]","orphans: Screen[]","lines: string[]","define","changedFiles: string[]","screens: Screen[]","results: ImpactResult[]","version: string","define"],"sources":["../src/utils/config.ts","../src/utils/cycleDetection.ts","../src/utils/errors.ts","../src/utils/logger.ts","../src/utils/validation.ts","../src/commands/build.ts","../src/commands/dev.ts","../src/commands/doctor.ts","../src/utils/routeParserUtils.ts","../src/utils/angularRouterParser.ts","../src/utils/navigationAnalyzer.ts","../src/utils/angularTemplateAnalyzer.ts","../src/utils/apiImportAnalyzer.ts","../src/utils/solidRouterParser.ts","../src/utils/tanstackRouterParser.ts","../src/utils/reactRouterParser.ts","../src/utils/vueRouterParser.ts","../../../node_modules/.pnpm/@vue+shared@3.5.26/node_modules/@vue/shared/dist/shared.cjs.prod.js","../../../node_modules/.pnpm/@vue+shared@3.5.26/node_modules/@vue/shared/dist/shared.cjs.js","../../../node_modules/.pnpm/@vue+shared@3.5.26/node_modules/@vue/shared/index.js","../../../node_modules/.pnpm/entities@7.0.0/node_modules/entities/dist/commonjs/decode-codepoint.js","../../../node_modules/.pnpm/entities@7.0.0/node_modules/entities/dist/commonjs/internal/decode-shared.js","../../../node_modules/.pnpm/entities@7.0.0/node_modules/entities/dist/commonjs/generated/decode-data-html.js","../../../node_modules/.pnpm/entities@7.0.0/node_modules/entities/dist/commonjs/generated/decode-data-xml.js","../../../node_modules/.pnpm/entities@7.0.0/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js","../../../node_modules/.pnpm/entities@7.0.0/node_modules/entities/dist/commonjs/decode.js","../../../node_modules/.pnpm/estree-walker@2.0.2/node_modules/estree-walker/dist/umd/estree-walker.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/util.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/source-map.js","../../../node_modules/.pnpm/@vue+compiler-core@3.5.26/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js","../../../node_modules/.pnpm/@vue+compiler-core@3.5.26/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js","../../../node_modules/.pnpm/@vue+compiler-core@3.5.26/node_modules/@vue/compiler-core/index.js","../src/utils/vueSFCTemplateAnalyzer.ts","../src/commands/generate.ts","../src/utils/impactAnalysis.ts","../src/commands/impact.ts","../src/utils/detectFramework.ts","../src/utils/isInteractive.ts","../src/commands/init.ts","../src/commands/lint.ts","../src/utils/prImpact.ts","../src/commands/pr-impact.ts","../src/index.ts"],"sourcesContent":["import { existsSync } from \"node:fs\"\nimport { resolve } from \"node:path\"\nimport { type Config, defineConfig } from \"@screenbook/core\"\nimport { createJiti } from \"jiti\"\n\nconst CONFIG_FILES = [\n\t\"screenbook.config.ts\",\n\t\"screenbook.config.js\",\n\t\"screenbook.config.mjs\",\n]\n\nexport async function loadConfig(configPath?: string): Promise<Config> {\n\tconst cwd = process.cwd()\n\n\t// If config path is provided, use it\n\tif (configPath) {\n\t\tconst absolutePath = resolve(cwd, configPath)\n\t\tif (!existsSync(absolutePath)) {\n\t\t\tthrow new Error(`Config file not found: ${configPath}`)\n\t\t}\n\t\treturn await importConfig(absolutePath, cwd)\n\t}\n\n\t// Search for config file in cwd\n\tfor (const configFile of CONFIG_FILES) {\n\t\tconst absolutePath = resolve(cwd, configFile)\n\t\tif (existsSync(absolutePath)) {\n\t\t\treturn await importConfig(absolutePath, cwd)\n\t\t}\n\t}\n\n\t// Return default config if no config file found\n\treturn defineConfig()\n}\n\nasync function importConfig(\n\tabsolutePath: string,\n\tcwd: string,\n): Promise<Config> {\n\tconst jiti = createJiti(cwd)\n\tconst module = (await jiti.import(absolutePath)) as { default?: Config }\n\n\tif (module.default) {\n\t\treturn module.default\n\t}\n\n\tthrow new Error(`Config file must have a default export: ${absolutePath}`)\n}\n","import type { Screen } from \"@screenbook/core\"\n\n/**\n * Information about a detected cycle\n */\nexport interface CycleInfo {\n\t/**\n\t * Array of screen IDs forming the cycle, including the repeated start node\n\t * @example [\"A\", \"B\", \"C\", \"A\"]\n\t */\n\tcycle: string[]\n\t/**\n\t * True if any screen in the cycle has allowCycles: true\n\t */\n\tallowed: boolean\n}\n\n/**\n * Result of cycle detection analysis\n */\nexport interface CycleDetectionResult {\n\t/**\n\t * True if any cycles were detected\n\t */\n\thasCycles: boolean\n\t/**\n\t * All detected cycles\n\t */\n\tcycles: CycleInfo[]\n\t/**\n\t * Cycles that are not allowed (allowed: false)\n\t */\n\tdisallowedCycles: CycleInfo[]\n\t/**\n\t * Screen IDs that appear more than once (indicates data issue)\n\t */\n\tduplicateIds: string[]\n}\n\n// Node colors for DFS\nenum Color {\n\tWhite = 0, // Unvisited\n\tGray = 1, // In progress (on current path)\n\tBlack = 2, // Completed\n}\n\n/**\n * Detect circular navigation dependencies in screen definitions.\n * Uses DFS with coloring algorithm: O(V + E) complexity.\n *\n * @example\n * ```ts\n * const screens = [\n * { id: \"A\", next: [\"B\"] },\n * { id: \"B\", next: [\"C\"] },\n * { id: \"C\", next: [\"A\"] }, // Creates cycle A → B → C → A\n * ]\n * const result = detectCycles(screens)\n * // result.hasCycles === true\n * // result.cycles[0].cycle === [\"A\", \"B\", \"C\", \"A\"]\n * ```\n */\nexport function detectCycles(screens: Screen[]): CycleDetectionResult {\n\tconst screenMap = new Map<string, Screen>()\n\tconst duplicateIds: string[] = []\n\n\t// Build screen map and detect duplicates\n\tfor (const screen of screens) {\n\t\tif (!screen.id || typeof screen.id !== \"string\") {\n\t\t\t// Skip screens with invalid IDs\n\t\t\tcontinue\n\t\t}\n\t\tif (screenMap.has(screen.id)) {\n\t\t\tduplicateIds.push(screen.id)\n\t\t}\n\t\tscreenMap.set(screen.id, screen)\n\t}\n\n\tconst color = new Map<string, Color>()\n\tconst parent = new Map<string, string | null>()\n\tconst cycles: CycleInfo[] = []\n\n\t// Initialize all nodes as white\n\tfor (const id of screenMap.keys()) {\n\t\tcolor.set(id, Color.White)\n\t}\n\n\t// DFS from each unvisited node\n\tfor (const id of screenMap.keys()) {\n\t\tif (color.get(id) === Color.White) {\n\t\t\tdfs(id, null)\n\t\t}\n\t}\n\n\tfunction dfs(nodeId: string, parentId: string | null): void {\n\t\tcolor.set(nodeId, Color.Gray)\n\t\tparent.set(nodeId, parentId)\n\n\t\tconst node = screenMap.get(nodeId)\n\t\tconst neighbors = node?.next ?? []\n\n\t\tfor (const neighborId of neighbors) {\n\t\t\tconst neighborColor = color.get(neighborId)\n\n\t\t\tif (neighborColor === Color.Gray) {\n\t\t\t\t// Back edge found - cycle detected\n\t\t\t\tconst cyclePath = reconstructCycle(nodeId, neighborId)\n\t\t\t\tconst allowed = isCycleAllowed(cyclePath, screenMap)\n\t\t\t\tcycles.push({ cycle: cyclePath, allowed })\n\t\t\t} else if (neighborColor === Color.White) {\n\t\t\t\t// Only visit if the neighbor exists in our screen map\n\t\t\t\tif (screenMap.has(neighborId)) {\n\t\t\t\t\tdfs(neighborId, nodeId)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If Black, already fully processed - skip\n\t\t}\n\n\t\tcolor.set(nodeId, Color.Black)\n\t}\n\n\t/**\n\t * Reconstruct cycle path from back edge\n\t */\n\tfunction reconstructCycle(from: string, to: string): string[] {\n\t\tconst path: string[] = []\n\t\tlet current: string | null | undefined = from\n\t\tconst visited = new Set<string>()\n\t\tconst maxIterations = screenMap.size + 1\n\n\t\t// Trace back from 'from' to 'to' with loop guard\n\t\twhile (\n\t\t\tcurrent &&\n\t\t\tcurrent !== to &&\n\t\t\t!visited.has(current) &&\n\t\t\tpath.length < maxIterations\n\t\t) {\n\t\t\tvisited.add(current)\n\t\t\tpath.unshift(current)\n\t\t\tcurrent = parent.get(current)\n\t\t}\n\n\t\t// Add 'to' at the beginning (the cycle start)\n\t\tpath.unshift(to)\n\n\t\t// Add 'to' at the end to close the cycle\n\t\tpath.push(to)\n\n\t\treturn path\n\t}\n\n\tconst disallowedCycles = cycles.filter((c) => !c.allowed)\n\n\treturn {\n\t\thasCycles: cycles.length > 0,\n\t\tcycles,\n\t\tdisallowedCycles,\n\t\tduplicateIds,\n\t}\n}\n\n/**\n * Check if any screen in the cycle has allowCycles: true\n */\nfunction isCycleAllowed(\n\tcyclePath: string[],\n\tscreenMap: Map<string, Screen>,\n): boolean {\n\t// Exclude the last element as it's a duplicate of the first\n\tconst uniqueNodes = cyclePath.slice(0, -1)\n\n\tfor (const nodeId of uniqueNodes) {\n\t\tconst screen = screenMap.get(nodeId)\n\t\tif (screen?.allowCycles === true) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n/**\n * Format cycle information for console output\n *\n * @example\n * ```\n * Cycle 1: A → B → C → A\n * Cycle 2 (allowed): D → E → D\n * ```\n */\nexport function formatCycleWarnings(cycles: CycleInfo[]): string {\n\tif (cycles.length === 0) {\n\t\treturn \"\"\n\t}\n\n\tconst lines: string[] = []\n\n\tfor (let i = 0; i < cycles.length; i++) {\n\t\tconst cycle = cycles[i]\n\t\tif (!cycle) continue\n\n\t\tconst cycleStr = cycle.cycle.join(\" → \")\n\t\tconst allowedSuffix = cycle.allowed ? \" (allowed)\" : \"\"\n\t\tlines.push(` Cycle ${i + 1}${allowedSuffix}: ${cycleStr}`)\n\t}\n\n\treturn lines.join(\"\\n\")\n}\n\n/**\n * Get a summary of cycle detection results\n */\nexport function getCycleSummary(result: CycleDetectionResult): string {\n\tif (!result.hasCycles) {\n\t\treturn \"No circular navigation detected\"\n\t}\n\n\tconst total = result.cycles.length\n\tconst disallowed = result.disallowedCycles.length\n\tconst allowed = total - disallowed\n\n\tif (disallowed === 0) {\n\t\treturn `${total} circular navigation${total > 1 ? \"s\" : \"\"} detected (all allowed)`\n\t}\n\n\tif (allowed === 0) {\n\t\treturn `${total} circular navigation${total > 1 ? \"s\" : \"\"} detected`\n\t}\n\n\treturn `${total} circular navigation${total > 1 ? \"s\" : \"\"} detected (${disallowed} not allowed, ${allowed} allowed)`\n}\n","import type { ErrorOptions } from \"./logger.js\"\n\n/**\n * Centralized error definitions for consistent error messages across CLI commands\n */\nexport const ERRORS = {\n\t// ============================================\n\t// Configuration Errors\n\t// ============================================\n\n\tROUTES_PATTERN_MISSING: {\n\t\ttitle: \"Routes configuration not found\",\n\t\tsuggestion:\n\t\t\t\"Add routesPattern (for file-based routing) or routesFile (for config-based routing) to your screenbook.config.ts.\",\n\t\texample: `import { defineConfig } from \"@screenbook/core\"\n\n// Option 1: File-based routing (Next.js, Nuxt, etc.)\nexport default defineConfig({\n routesPattern: \"src/pages/**/page.tsx\",\n})\n\n// Option 2: Config-based routing (Vue Router, React Router, etc.)\nexport default defineConfig({\n routesFile: \"src/router/routes.ts\",\n})`,\n\t} satisfies ErrorOptions,\n\n\tROUTES_FILE_NOT_FOUND: (filePath: string): ErrorOptions => ({\n\t\ttitle: `Routes file not found: ${filePath}`,\n\t\tsuggestion:\n\t\t\t\"Check the routesFile path in your screenbook.config.ts. The file should export a routes array.\",\n\t\texample: `import { defineConfig } from \"@screenbook/core\"\n\nexport default defineConfig({\n routesFile: \"src/router/routes.ts\", // Make sure this file exists\n})`,\n\t}),\n\n\tROUTES_FILE_PARSE_ERROR: (filePath: string, error: string): ErrorOptions => ({\n\t\ttitle: `Failed to parse routes file: ${filePath}`,\n\t\tmessage: error,\n\t\tsuggestion:\n\t\t\t\"Ensure the file exports a valid routes array. Check for syntax errors or unsupported patterns.\",\n\t}),\n\n\tCONFIG_NOT_FOUND: {\n\t\ttitle: \"Configuration file not found\",\n\t\tsuggestion:\n\t\t\t\"Run 'screenbook init' to create a screenbook.config.ts file, or create one manually.\",\n\t\texample: `import { defineConfig } from \"@screenbook/core\"\n\nexport default defineConfig({\n metaPattern: \"src/**/screen.meta.ts\",\n})`,\n\t} satisfies ErrorOptions,\n\n\t// ============================================\n\t// Build/File Errors\n\t// ============================================\n\n\tSCREENS_NOT_FOUND: {\n\t\ttitle: \"screens.json not found\",\n\t\tsuggestion: \"Run 'screenbook build' first to generate the screen catalog.\",\n\t\tmessage:\n\t\t\t\"If you haven't set up Screenbook yet, run 'screenbook init' to get started.\",\n\t} satisfies ErrorOptions,\n\n\tSCREENS_PARSE_ERROR: {\n\t\ttitle: \"Failed to parse screens.json\",\n\t\tsuggestion:\n\t\t\t\"The screens.json file may be corrupted. Try running 'screenbook build' to regenerate it.\",\n\t} satisfies ErrorOptions,\n\n\tMETA_FILE_LOAD_ERROR: (filePath: string): ErrorOptions => ({\n\t\ttitle: `Failed to load ${filePath}`,\n\t\tsuggestion:\n\t\t\t\"Check the file for syntax errors or missing exports. The file should export a 'screen' object.\",\n\t\texample: `import { defineScreen } from \"@screenbook/core\"\n\nexport const screen = defineScreen({\n id: \"example.screen\",\n title: \"Example Screen\",\n route: \"/example\",\n})`,\n\t}),\n\n\t// ============================================\n\t// Command Argument Errors\n\t// ============================================\n\n\tAPI_NAME_REQUIRED: {\n\t\ttitle: \"API name is required\",\n\t\tsuggestion: \"Provide the API name as an argument.\",\n\t\texample: `screenbook impact UserAPI.getProfile\nscreenbook impact \"PaymentAPI.*\" # Use quotes for patterns`,\n\t} satisfies ErrorOptions,\n\n\t// ============================================\n\t// Git Errors\n\t// ============================================\n\n\tGIT_CHANGED_FILES_ERROR: (baseBranch: string): ErrorOptions => ({\n\t\ttitle: \"Failed to get changed files from git\",\n\t\tmessage: `Make sure you are in a git repository and the base branch '${baseBranch}' exists.`,\n\t\tsuggestion: `Verify the base branch exists with: git branch -a | grep ${baseBranch}`,\n\t}),\n\n\tGIT_NOT_REPOSITORY: {\n\t\ttitle: \"Not a git repository\",\n\t\tsuggestion:\n\t\t\t\"This command requires a git repository. Initialize one with 'git init' or navigate to an existing repository.\",\n\t} satisfies ErrorOptions,\n\n\t// ============================================\n\t// Server Errors\n\t// ============================================\n\n\tSERVER_START_FAILED: (error: string): ErrorOptions => ({\n\t\ttitle: \"Failed to start development server\",\n\t\tmessage: error,\n\t\tsuggestion:\n\t\t\t\"Check if the port is already in use or if there are any dependency issues.\",\n\t}),\n\n\t// ============================================\n\t// Validation Errors\n\t// ============================================\n\n\tVALIDATION_FAILED: (errorCount: number): ErrorOptions => ({\n\t\ttitle: `Validation failed with ${errorCount} error${errorCount === 1 ? \"\" : \"s\"}`,\n\t\tsuggestion:\n\t\t\t\"Fix the validation errors above. Screen references must point to existing screens.\",\n\t}),\n\n\t// ============================================\n\t// Lint Errors\n\t// ============================================\n\n\tLINT_MISSING_META: (\n\t\tmissingCount: number,\n\t\ttotalRoutes: number,\n\t): ErrorOptions => ({\n\t\ttitle: `${missingCount} route${missingCount === 1 ? \"\" : \"s\"} missing screen.meta.ts`,\n\t\tmessage: `Found ${totalRoutes} route file${totalRoutes === 1 ? \"\" : \"s\"}, but ${missingCount} ${missingCount === 1 ? \"is\" : \"are\"} missing colocated screen.meta.ts.`,\n\t\tsuggestion:\n\t\t\t\"Add screen.meta.ts files next to your route files, or run 'screenbook generate' to create them.\",\n\t}),\n\n\t// ============================================\n\t// Cycle Detection Errors\n\t// ============================================\n\n\tCYCLES_DETECTED: (cycleCount: number): ErrorOptions => ({\n\t\ttitle: `${cycleCount} circular navigation${cycleCount === 1 ? \"\" : \"s\"} detected`,\n\t\tsuggestion:\n\t\t\t\"Review the navigation flow. Use 'allowCycles: true' in screen.meta.ts to allow intentional cycles, or use --allow-cycles to suppress all warnings.\",\n\t\texample: `// Allow a specific screen to be part of cycles\nexport const screen = defineScreen({\n id: \"billing.invoice.detail\",\n next: [\"billing.invoices\"],\n allowCycles: true, // This cycle is intentional\n})`,\n\t}),\n}\n","import pc from \"picocolors\"\n\n/**\n * Structured error options for detailed error messages\n */\nexport interface ErrorOptions {\n\t/** Error title (shown after \"Error:\") */\n\ttitle: string\n\t/** Additional error message/details */\n\tmessage?: string\n\t/** Actionable suggestion for the user */\n\tsuggestion?: string\n\t/** Code example to help the user */\n\texample?: string\n}\n\n/**\n * Logger utility for consistent, color-coded CLI output\n */\nexport const logger = {\n\t// ============================================\n\t// Status Messages\n\t// ============================================\n\n\t/**\n\t * Success message (green checkmark)\n\t */\n\tsuccess: (msg: string): void => {\n\t\tconsole.log(`${pc.green(\"✓\")} ${msg}`)\n\t},\n\n\t/**\n\t * Error message (red X)\n\t */\n\terror: (msg: string): void => {\n\t\tconsole.error(`${pc.red(\"✗\")} ${pc.red(`Error: ${msg}`)}`)\n\t},\n\n\t/**\n\t * Warning message (yellow warning sign)\n\t */\n\twarn: (msg: string): void => {\n\t\tconsole.log(`${pc.yellow(\"⚠\")} ${pc.yellow(`Warning: ${msg}`)}`)\n\t},\n\n\t/**\n\t * Info message (cyan info icon)\n\t */\n\tinfo: (msg: string): void => {\n\t\tconsole.log(`${pc.cyan(\"ℹ\")} ${msg}`)\n\t},\n\n\t// ============================================\n\t// Detailed Error with Guidance\n\t// ============================================\n\n\t/**\n\t * Display a detailed error with actionable suggestions\n\t */\n\terrorWithHelp: (options: ErrorOptions): void => {\n\t\tconst { title, message, suggestion, example } = options\n\n\t\tconsole.error()\n\t\tconsole.error(`${pc.red(\"✗\")} ${pc.red(`Error: ${title}`)}`)\n\n\t\tif (message) {\n\t\t\tconsole.error()\n\t\t\tconsole.error(` ${message}`)\n\t\t}\n\n\t\tif (suggestion) {\n\t\t\tconsole.error()\n\t\t\tconsole.error(` ${pc.cyan(\"Suggestion:\")} ${suggestion}`)\n\t\t}\n\n\t\tif (example) {\n\t\t\tconsole.error()\n\t\t\tconsole.error(` ${pc.dim(\"Example:\")}`)\n\t\t\tfor (const line of example.split(\"\\n\")) {\n\t\t\t\tconsole.error(` ${pc.dim(line)}`)\n\t\t\t}\n\t\t}\n\n\t\tconsole.error()\n\t},\n\n\t// ============================================\n\t// Progress Indicators\n\t// ============================================\n\n\t/**\n\t * Step indicator (dimmed arrow)\n\t */\n\tstep: (msg: string): void => {\n\t\tconsole.log(`${pc.dim(\"→\")} ${msg}`)\n\t},\n\n\t/**\n\t * Done/completed indicator (green checkmark with green text)\n\t */\n\tdone: (msg: string): void => {\n\t\tconsole.log(`${pc.green(\"✓\")} ${pc.green(msg)}`)\n\t},\n\n\t/**\n\t * Item success (green checkmark, indented)\n\t */\n\titemSuccess: (msg: string): void => {\n\t\tconsole.log(` ${pc.green(\"✓\")} ${msg}`)\n\t},\n\n\t/**\n\t * Item failure (red X, indented)\n\t */\n\titemError: (msg: string): void => {\n\t\tconsole.log(` ${pc.red(\"✗\")} ${msg}`)\n\t},\n\n\t/**\n\t * Item warning (yellow warning, indented)\n\t */\n\titemWarn: (msg: string): void => {\n\t\tconsole.log(` ${pc.yellow(\"⚠\")} ${msg}`)\n\t},\n\n\t// ============================================\n\t// Plain Output\n\t// ============================================\n\n\t/**\n\t * Plain log (no prefix)\n\t */\n\tlog: (msg: string): void => {\n\t\tconsole.log(msg)\n\t},\n\n\t/**\n\t * Blank line\n\t */\n\tblank: (): void => {\n\t\tconsole.log()\n\t},\n\n\t// ============================================\n\t// Formatting Helpers\n\t// ============================================\n\n\t/**\n\t * Bold text\n\t */\n\tbold: (msg: string): string => pc.bold(msg),\n\n\t/**\n\t * Dimmed text\n\t */\n\tdim: (msg: string): string => pc.dim(msg),\n\n\t/**\n\t * Code/command text (cyan)\n\t */\n\tcode: (msg: string): string => pc.cyan(msg),\n\n\t/**\n\t * File path text (underlined)\n\t */\n\tpath: (msg: string): string => pc.underline(msg),\n\n\t/**\n\t * Highlight text (cyan bold)\n\t */\n\thighlight: (msg: string): string => pc.cyan(pc.bold(msg)),\n\n\t/**\n\t * Green text\n\t */\n\tgreen: (msg: string): string => pc.green(msg),\n\n\t/**\n\t * Red text\n\t */\n\tred: (msg: string): string => pc.red(msg),\n\n\t/**\n\t * Yellow text\n\t */\n\tyellow: (msg: string): string => pc.yellow(msg),\n}\n","import type { Screen } from \"@screenbook/core\"\n\nexport interface ValidationError {\n\tscreenId: string\n\tfield: \"next\" | \"entryPoints\"\n\tinvalidRef: string\n\tsuggestion?: string\n}\n\nexport interface ValidationResult {\n\tvalid: boolean\n\terrors: ValidationError[]\n}\n\n/**\n * Validate screen references (next and entryPoints)\n */\nexport function validateScreenReferences(screens: Screen[]): ValidationResult {\n\tconst screenIds = new Set(screens.map((s) => s.id))\n\tconst errors: ValidationError[] = []\n\n\tfor (const screen of screens) {\n\t\t// Validate next references\n\t\tif (screen.next) {\n\t\t\tfor (const nextId of screen.next) {\n\t\t\t\tif (!screenIds.has(nextId)) {\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tscreenId: screen.id,\n\t\t\t\t\t\tfield: \"next\",\n\t\t\t\t\t\tinvalidRef: nextId,\n\t\t\t\t\t\tsuggestion: findSimilar(nextId, screenIds),\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Validate entryPoints references\n\t\tif (screen.entryPoints) {\n\t\t\tfor (const entryId of screen.entryPoints) {\n\t\t\t\tif (!screenIds.has(entryId)) {\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tscreenId: screen.id,\n\t\t\t\t\t\tfield: \"entryPoints\",\n\t\t\t\t\t\tinvalidRef: entryId,\n\t\t\t\t\t\tsuggestion: findSimilar(entryId, screenIds),\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\tvalid: errors.length === 0,\n\t\terrors,\n\t}\n}\n\n/**\n * Find similar screen ID using Levenshtein distance\n */\nfunction findSimilar(\n\ttarget: string,\n\tcandidates: Set<string>,\n): string | undefined {\n\tlet bestMatch: string | undefined\n\tlet bestDistance = Number.POSITIVE_INFINITY\n\n\t// Only suggest if distance is reasonable (less than 40% of target length)\n\tconst maxDistance = Math.ceil(target.length * 0.4)\n\n\tfor (const candidate of candidates) {\n\t\tconst distance = levenshteinDistance(target, candidate)\n\t\tif (distance < bestDistance && distance <= maxDistance) {\n\t\t\tbestDistance = distance\n\t\t\tbestMatch = candidate\n\t\t}\n\t}\n\n\treturn bestMatch\n}\n\n/**\n * Calculate Levenshtein distance between two strings\n */\nfunction levenshteinDistance(a: string, b: string): number {\n\t// Pre-initialize matrix with proper dimensions\n\tconst matrix: number[][] = Array.from({ length: a.length + 1 }, () =>\n\t\tArray.from({ length: b.length + 1 }, () => 0),\n\t)\n\n\t// Helper to safely get/set matrix values (matrix is pre-initialized, so these are always valid)\n\tconst get = (i: number, j: number): number => matrix[i]?.[j] ?? 0\n\tconst set = (i: number, j: number, value: number): void => {\n\t\tconst row = matrix[i]\n\t\tif (row) row[j] = value\n\t}\n\n\t// Initialize first column\n\tfor (let i = 0; i <= a.length; i++) {\n\t\tset(i, 0, i)\n\t}\n\n\t// Initialize first row\n\tfor (let j = 0; j <= b.length; j++) {\n\t\tset(0, j, j)\n\t}\n\n\t// Fill the matrix\n\tfor (let i = 1; i <= a.length; i++) {\n\t\tfor (let j = 1; j <= b.length; j++) {\n\t\t\tconst cost = a[i - 1] === b[j - 1] ? 0 : 1\n\t\t\tset(\n\t\t\t\ti,\n\t\t\t\tj,\n\t\t\t\tMath.min(\n\t\t\t\t\tget(i - 1, j) + 1, // deletion\n\t\t\t\t\tget(i, j - 1) + 1, // insertion\n\t\t\t\t\tget(i - 1, j - 1) + cost, // substitution\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\n\treturn get(a.length, b.length)\n}\n\n/**\n * Format validation errors for console output\n */\nexport function formatValidationErrors(errors: ValidationError[]): string {\n\tconst lines: string[] = []\n\n\tfor (const error of errors) {\n\t\tlines.push(` Screen \"${error.screenId}\"`)\n\t\tlines.push(\n\t\t\t` → ${error.field} references non-existent screen \"${error.invalidRef}\"`,\n\t\t)\n\t\tif (error.suggestion) {\n\t\t\tlines.push(` Did you mean \"${error.suggestion}\"?`)\n\t\t}\n\t\tlines.push(\"\")\n\t}\n\n\treturn lines.join(\"\\n\")\n}\n","import { existsSync, mkdirSync, writeFileSync } from \"node:fs\"\nimport { dirname, join, resolve } from \"node:path\"\nimport type { Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport { createJiti } from \"jiti\"\nimport { glob } from \"tinyglobby\"\nimport { loadConfig } from \"../utils/config.js\"\nimport {\n\tdetectCycles,\n\tformatCycleWarnings,\n\tgetCycleSummary,\n} from \"../utils/cycleDetection.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport { logger } from \"../utils/logger.js\"\nimport {\n\tformatValidationErrors,\n\tvalidateScreenReferences,\n} from \"../utils/validation.js\"\n\nexport interface CoverageData {\n\ttotal: number\n\tcovered: number\n\tpercentage: number\n\tmissing: Array<{\n\t\troute: string\n\t\tsuggestedPath: string\n\t}>\n\tbyOwner: Record<string, { count: number; screens: string[] }>\n\tbyTag: Record<string, number>\n\ttimestamp: string\n}\n\nexport const buildCommand = define({\n\tname: \"build\",\n\tdescription: \"Build screen metadata JSON from screen.meta.ts files\",\n\targs: {\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\toutDir: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"o\",\n\t\t\tdescription: \"Output directory\",\n\t\t},\n\t\tstrict: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"s\",\n\t\t\tdescription: \"Fail on validation errors and disallowed cycles\",\n\t\t\tdefault: false,\n\t\t},\n\t\tallowCycles: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription: \"Suppress all circular navigation warnings\",\n\t\t\tdefault: false,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst outDir = ctx.values.outDir ?? config.outDir\n\t\tconst cwd = process.cwd()\n\n\t\tlogger.info(\"Building screen metadata...\")\n\n\t\t// Find all screen.meta.ts files\n\t\tconst files = await glob(config.metaPattern, {\n\t\t\tcwd,\n\t\t\tignore: config.ignore,\n\t\t})\n\n\t\tif (files.length === 0) {\n\t\t\tlogger.warn(\n\t\t\t\t`No screen.meta.ts files found matching: ${config.metaPattern}`,\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\tlogger.info(`Found ${files.length} screen files`)\n\n\t\t// Create jiti instance for loading TypeScript files\n\t\tconst jiti = createJiti(cwd)\n\n\t\t// Extended screen type with file path (for internal use)\n\t\ttype ScreenWithFilePath = Screen & { filePath: string }\n\n\t\t// Load and collect screen metadata\n\t\tconst screens: ScreenWithFilePath[] = []\n\n\t\tfor (const file of files) {\n\t\t\tconst absolutePath = resolve(cwd, file)\n\n\t\t\ttry {\n\t\t\t\tconst module = (await jiti.import(absolutePath)) as { screen?: Screen }\n\t\t\t\tif (module.screen) {\n\t\t\t\t\tscreens.push({ ...module.screen, filePath: absolutePath })\n\t\t\t\t\tlogger.itemSuccess(module.screen.id)\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tlogger.itemError(`Failed to load ${file}`)\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\tlogger.log(` ${logger.dim(error.message)}`)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Validate screen references\n\t\tconst validation = validateScreenReferences(screens)\n\t\tif (!validation.valid) {\n\t\t\tlogger.blank()\n\t\t\tlogger.warn(\"Invalid screen references found:\")\n\t\t\tlogger.log(formatValidationErrors(validation.errors))\n\n\t\t\tif (ctx.values.strict) {\n\t\t\t\tlogger.errorWithHelp(ERRORS.VALIDATION_FAILED(validation.errors.length))\n\t\t\t\tprocess.exit(1)\n\t\t\t}\n\t\t}\n\n\t\t// Detect circular navigation\n\t\tif (!ctx.values.allowCycles) {\n\t\t\tconst cycleResult = detectCycles(screens)\n\t\t\tif (cycleResult.hasCycles) {\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.warn(getCycleSummary(cycleResult))\n\t\t\t\tlogger.log(formatCycleWarnings(cycleResult.cycles))\n\n\t\t\t\tif (ctx.values.strict && cycleResult.disallowedCycles.length > 0) {\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.errorWithHelp(\n\t\t\t\t\t\tERRORS.CYCLES_DETECTED(cycleResult.disallowedCycles.length),\n\t\t\t\t\t)\n\t\t\t\t\tprocess.exit(1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Generate screens.json\n\t\tconst outputPath = join(cwd, outDir, \"screens.json\")\n\t\tconst outputDir = dirname(outputPath)\n\n\t\tif (!existsSync(outputDir)) {\n\t\t\tmkdirSync(outputDir, { recursive: true })\n\t\t}\n\n\t\twriteFileSync(outputPath, JSON.stringify(screens, null, 2))\n\t\tlogger.blank()\n\t\tlogger.success(`Generated ${logger.path(outputPath)}`)\n\n\t\t// Generate Mermaid graph\n\t\tconst mermaidPath = join(cwd, outDir, \"graph.mmd\")\n\t\tconst mermaidContent = generateMermaidGraph(screens)\n\t\twriteFileSync(mermaidPath, mermaidContent)\n\t\tlogger.success(`Generated ${logger.path(mermaidPath)}`)\n\n\t\t// Generate coverage.json\n\t\tconst coverage = await generateCoverageData(config, cwd, screens)\n\t\tconst coveragePath = join(cwd, outDir, \"coverage.json\")\n\t\twriteFileSync(coveragePath, JSON.stringify(coverage, null, 2))\n\t\tlogger.success(`Generated ${logger.path(coveragePath)}`)\n\t\tlogger.blank()\n\t\tlogger.done(\n\t\t\t`Coverage: ${coverage.covered}/${coverage.total} (${coverage.percentage}%)`,\n\t\t)\n\t},\n})\n\nasync function generateCoverageData(\n\tconfig: { routesPattern?: string; metaPattern: string; ignore: string[] },\n\tcwd: string,\n\tscreens: Screen[],\n): Promise<CoverageData> {\n\t// Get all route files if routesPattern is configured\n\tlet routeFiles: string[] = []\n\tif (config.routesPattern) {\n\t\trouteFiles = await glob(config.routesPattern, {\n\t\t\tcwd,\n\t\t\tignore: config.ignore,\n\t\t})\n\t}\n\n\t// Get directories that have screen.meta.ts\n\tconst _metaDirs = new Set(\n\t\tscreens.map((s) => {\n\t\t\t// Extract directory from route or id\n\t\t\tconst parts = s.id.split(\".\")\n\t\t\treturn parts.slice(0, -1).join(\"/\") || parts[0]\n\t\t}),\n\t)\n\n\t// Find missing routes (routes without screen.meta.ts)\n\tconst missing: CoverageData[\"missing\"] = []\n\tfor (const routeFile of routeFiles) {\n\t\tconst routeDir = dirname(routeFile)\n\t\tconst hasMetaFile = screens.some((s) => {\n\t\t\t// Check if any screen's route matches this route file's directory\n\t\t\tconst screenDir = s.id.replace(/\\./g, \"/\")\n\t\t\treturn (\n\t\t\t\trouteDir.includes(screenDir) ||\n\t\t\t\tscreenDir.includes(\n\t\t\t\t\trouteDir.replace(/^src\\/pages\\//, \"\").replace(/^app\\//, \"\"),\n\t\t\t\t)\n\t\t\t)\n\t\t})\n\n\t\tif (!hasMetaFile) {\n\t\t\tmissing.push({\n\t\t\t\troute: routeFile,\n\t\t\t\tsuggestedPath: join(dirname(routeFile), \"screen.meta.ts\"),\n\t\t\t})\n\t\t}\n\t}\n\n\t// Calculate coverage\n\tconst total = routeFiles.length > 0 ? routeFiles.length : screens.length\n\tconst covered = screens.length\n\tconst percentage = total > 0 ? Math.round((covered / total) * 100) : 100\n\n\t// Group by owner\n\tconst byOwner: CoverageData[\"byOwner\"] = {}\n\tfor (const screen of screens) {\n\t\tconst owners = screen.owner || [\"unassigned\"]\n\t\tfor (const owner of owners) {\n\t\t\tif (!byOwner[owner]) {\n\t\t\t\tbyOwner[owner] = { count: 0, screens: [] }\n\t\t\t}\n\t\t\tbyOwner[owner].count++\n\t\t\tbyOwner[owner].screens.push(screen.id)\n\t\t}\n\t}\n\n\t// Group by tag\n\tconst byTag: CoverageData[\"byTag\"] = {}\n\tfor (const screen of screens) {\n\t\tconst tags = screen.tags || []\n\t\tfor (const tag of tags) {\n\t\t\tbyTag[tag] = (byTag[tag] || 0) + 1\n\t\t}\n\t}\n\n\treturn {\n\t\ttotal,\n\t\tcovered,\n\t\tpercentage,\n\t\tmissing,\n\t\tbyOwner,\n\t\tbyTag,\n\t\ttimestamp: new Date().toISOString(),\n\t}\n}\n\nfunction generateMermaidGraph(screens: Screen[]): string {\n\tconst lines: string[] = [\"flowchart TD\"]\n\n\t// Create nodes\n\tfor (const screen of screens) {\n\t\tconst label = screen.title.replace(/\"/g, \"'\")\n\t\tlines.push(` ${sanitizeId(screen.id)}[\"${label}\"]`)\n\t}\n\n\tlines.push(\"\")\n\n\t// Create edges from next relationships\n\tfor (const screen of screens) {\n\t\tif (screen.next) {\n\t\t\tfor (const nextId of screen.next) {\n\t\t\t\tlines.push(` ${sanitizeId(screen.id)} --> ${sanitizeId(nextId)}`)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\")\n}\n\nfunction sanitizeId(id: string): string {\n\treturn id.replace(/\\./g, \"_\")\n}\n","import { spawn } from \"node:child_process\"\nimport { copyFileSync, existsSync, mkdirSync, writeFileSync } from \"node:fs\"\nimport { createRequire } from \"node:module\"\nimport { dirname, join, resolve } from \"node:path\"\nimport type { Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport { createJiti } from \"jiti\"\nimport { glob } from \"tinyglobby\"\nimport { loadConfig } from \"../utils/config.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport { logger } from \"../utils/logger.js\"\n\nexport const devCommand = define({\n\tname: \"dev\",\n\tdescription: \"Start the Screenbook development server\",\n\targs: {\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\tport: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"p\",\n\t\t\tdescription: \"Port to run the server on\",\n\t\t\tdefault: \"4321\",\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst port = ctx.values.port ?? \"4321\"\n\t\tconst cwd = process.cwd()\n\n\t\tlogger.info(\"Starting Screenbook development server...\")\n\n\t\t// First, build the screen metadata\n\t\tawait buildScreens(config, cwd)\n\n\t\t// Find the UI package location\n\t\tconst uiPackagePath = resolveUiPackage()\n\n\t\tif (!uiPackagePath) {\n\t\t\tlogger.errorWithHelp({\n\t\t\t\ttitle: \"Could not find @screenbook/ui package\",\n\t\t\t\tsuggestion:\n\t\t\t\t\t\"Make sure @screenbook/ui is installed. Run 'npm install @screenbook/ui' or 'pnpm add @screenbook/ui'.\",\n\t\t\t})\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\t// Copy screens.json and coverage.json to UI package\n\t\tconst screensJsonPath = join(cwd, config.outDir, \"screens.json\")\n\t\tconst coverageJsonPath = join(cwd, config.outDir, \"coverage.json\")\n\t\tconst uiScreensDir = join(uiPackagePath, \".screenbook\")\n\n\t\tif (!existsSync(uiScreensDir)) {\n\t\t\tmkdirSync(uiScreensDir, { recursive: true })\n\t\t}\n\n\t\tif (existsSync(screensJsonPath)) {\n\t\t\tcopyFileSync(screensJsonPath, join(uiScreensDir, \"screens.json\"))\n\t\t}\n\n\t\tif (existsSync(coverageJsonPath)) {\n\t\t\tcopyFileSync(coverageJsonPath, join(uiScreensDir, \"coverage.json\"))\n\t\t}\n\n\t\t// Start Astro dev server\n\t\tlogger.blank()\n\t\tlogger.info(\n\t\t\t`Starting UI server on ${logger.highlight(`http://localhost:${port}`)}`,\n\t\t)\n\n\t\tconst astroProcess = spawn(\"npx\", [\"astro\", \"dev\", \"--port\", port], {\n\t\t\tcwd: uiPackagePath,\n\t\t\tstdio: \"inherit\",\n\t\t\tshell: true,\n\t\t})\n\n\t\tastroProcess.on(\"error\", (error) => {\n\t\t\tlogger.errorWithHelp(ERRORS.SERVER_START_FAILED(error.message))\n\t\t\tprocess.exit(1)\n\t\t})\n\n\t\tastroProcess.on(\"close\", (code) => {\n\t\t\tprocess.exit(code ?? 0)\n\t\t})\n\n\t\t// Handle graceful shutdown\n\t\tprocess.on(\"SIGINT\", () => {\n\t\t\tastroProcess.kill(\"SIGINT\")\n\t\t})\n\n\t\tprocess.on(\"SIGTERM\", () => {\n\t\t\tastroProcess.kill(\"SIGTERM\")\n\t\t})\n\t},\n})\n\nexport async function buildScreens(\n\tconfig: { metaPattern: string; outDir: string; ignore: string[] },\n\tcwd: string,\n): Promise<void> {\n\tconst files = await glob(config.metaPattern, {\n\t\tcwd,\n\t\tignore: config.ignore,\n\t})\n\n\tif (files.length === 0) {\n\t\tlogger.warn(`No screen.meta.ts files found matching: ${config.metaPattern}`)\n\t\treturn\n\t}\n\n\tlogger.info(`Found ${files.length} screen files`)\n\n\t// Extended screen type with file path (for internal use)\n\ttype ScreenWithFilePath = Screen & { filePath: string }\n\n\tconst jiti = createJiti(cwd)\n\tconst screens: ScreenWithFilePath[] = []\n\n\tfor (const file of files) {\n\t\tconst absolutePath = resolve(cwd, file)\n\n\t\ttry {\n\t\t\tconst module = (await jiti.import(absolutePath)) as { screen?: Screen }\n\t\t\tif (module.screen) {\n\t\t\t\tscreens.push({ ...module.screen, filePath: absolutePath })\n\t\t\t\tlogger.itemSuccess(module.screen.id)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogger.itemError(`Failed to load ${file}`)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tlogger.log(` ${logger.dim(error.message)}`)\n\t\t\t}\n\t\t}\n\t}\n\n\tconst outputPath = join(cwd, config.outDir, \"screens.json\")\n\tconst outputDir = dirname(outputPath)\n\n\tif (!existsSync(outputDir)) {\n\t\tmkdirSync(outputDir, { recursive: true })\n\t}\n\n\twriteFileSync(outputPath, JSON.stringify(screens, null, 2))\n\tlogger.blank()\n\tlogger.success(`Generated ${logger.path(outputPath)}`)\n}\n\nexport function resolveUiPackage(): string | null {\n\t// Try to resolve @screenbook/ui from node_modules\n\ttry {\n\t\tconst require = createRequire(import.meta.url)\n\t\tconst uiPackageJson = require.resolve(\"@screenbook/ui/package.json\")\n\t\treturn dirname(uiPackageJson)\n\t} catch {\n\t\t// Fallback: look in common locations\n\t\tconst possiblePaths = [\n\t\t\tjoin(process.cwd(), \"node_modules\", \"@screenbook\", \"ui\"),\n\t\t\tjoin(process.cwd(), \"..\", \"ui\"),\n\t\t\tjoin(process.cwd(), \"packages\", \"ui\"),\n\t\t]\n\n\t\tfor (const p of possiblePaths) {\n\t\t\tif (existsSync(join(p, \"package.json\"))) {\n\t\t\t\treturn p\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n}\n","import { existsSync, readFileSync } from \"node:fs\"\nimport { join, resolve } from \"node:path\"\nimport { define } from \"gunshi\"\nimport { glob } from \"tinyglobby\"\nimport { loadConfig } from \"../utils/config.js\"\nimport { logger } from \"../utils/logger.js\"\n\nconst CONFIG_FILES = [\n\t\"screenbook.config.ts\",\n\t\"screenbook.config.js\",\n\t\"screenbook.config.mjs\",\n]\n\nexport interface CheckResult {\n\tname: string\n\tstatus: \"pass\" | \"fail\" | \"warn\"\n\tmessage: string\n\tsuggestion?: string\n}\n\ninterface PackageJson {\n\tdependencies?: Record<string, string>\n\tdevDependencies?: Record<string, string>\n}\n\nexport const doctorCommand = define({\n\tname: \"doctor\",\n\tdescription: \"Diagnose common issues with Screenbook setup\",\n\targs: {\n\t\tverbose: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"v\",\n\t\t\tdescription: \"Show detailed output\",\n\t\t\tdefault: false,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst cwd = process.cwd()\n\t\tconst verbose = ctx.values.verbose\n\n\t\tlogger.log(\"\")\n\t\tlogger.log(logger.bold(\"Screenbook Doctor\"))\n\t\tlogger.log(\"─────────────────\")\n\t\tlogger.log(\"\")\n\n\t\tconst results: CheckResult[] = []\n\n\t\t// Run all checks\n\t\tresults.push(await checkConfigFile(cwd))\n\t\tresults.push(await checkDependencies(cwd))\n\n\t\t// Load config for remaining checks\n\t\tconst config = await loadConfig()\n\n\t\tresults.push(await checkMetaPattern(cwd, config.metaPattern, config.ignore))\n\t\tresults.push(\n\t\t\tawait checkRoutesPattern(cwd, config.routesPattern, config.ignore),\n\t\t)\n\t\tresults.push(await checkBuildOutput(cwd, config.outDir))\n\t\tresults.push(await checkVersionCompatibility(cwd))\n\t\tresults.push(await checkGitRepository(cwd))\n\n\t\t// Display results\n\t\tdisplayResults(results, verbose)\n\t},\n})\n\n// Exported for testing\nexport async function checkConfigFile(cwd: string): Promise<CheckResult> {\n\tfor (const configFile of CONFIG_FILES) {\n\t\tconst absolutePath = resolve(cwd, configFile)\n\t\tif (existsSync(absolutePath)) {\n\t\t\treturn {\n\t\t\t\tname: \"Config file\",\n\t\t\t\tstatus: \"pass\",\n\t\t\t\tmessage: `Found: ${configFile}`,\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\tname: \"Config file\",\n\t\tstatus: \"warn\",\n\t\tmessage: \"No config file found (using defaults)\",\n\t\tsuggestion: \"Run 'screenbook init' to create a config file\",\n\t}\n}\n\nexport async function checkDependencies(cwd: string): Promise<CheckResult> {\n\tconst packageJsonPath = join(cwd, \"package.json\")\n\n\tif (!existsSync(packageJsonPath)) {\n\t\treturn {\n\t\t\tname: \"Dependencies\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: \"package.json not found\",\n\t\t\tsuggestion: \"Run 'npm init' or 'pnpm init' to create package.json\",\n\t\t}\n\t}\n\n\ttry {\n\t\tconst content = readFileSync(packageJsonPath, \"utf-8\")\n\t\tconst pkg = JSON.parse(content) as PackageJson\n\n\t\tconst allDeps = { ...pkg.dependencies, ...pkg.devDependencies }\n\t\tconst unifiedVersion = allDeps.screenbook\n\t\tconst coreVersion = allDeps[\"@screenbook/core\"]\n\t\tconst cliVersion = allDeps[\"@screenbook/cli\"]\n\n\t\t// Check for unified screenbook package first\n\t\tif (unifiedVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Dependencies\",\n\t\t\t\tstatus: \"pass\",\n\t\t\t\tmessage: `screenbook@${unifiedVersion}`,\n\t\t\t}\n\t\t}\n\n\t\tif (!coreVersion && !cliVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Dependencies\",\n\t\t\t\tstatus: \"fail\",\n\t\t\t\tmessage: \"Screenbook packages not installed\",\n\t\t\t\tsuggestion:\n\t\t\t\t\t\"Run 'pnpm add -D screenbook' or 'pnpm add -D @screenbook/core @screenbook/cli' to install\",\n\t\t\t}\n\t\t}\n\n\t\tif (!coreVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Dependencies\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: \"@screenbook/core not found in dependencies\",\n\t\t\t\tsuggestion: \"Run 'pnpm add -D @screenbook/core' to install\",\n\t\t\t}\n\t\t}\n\n\t\tif (!cliVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Dependencies\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: \"@screenbook/cli not found in dependencies\",\n\t\t\t\tsuggestion: \"Run 'pnpm add -D @screenbook/cli' to install\",\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tname: \"Dependencies\",\n\t\t\tstatus: \"pass\",\n\t\t\tmessage: `@screenbook/core@${coreVersion}, @screenbook/cli@${cliVersion}`,\n\t\t}\n\t} catch {\n\t\treturn {\n\t\t\tname: \"Dependencies\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: \"Failed to read package.json\",\n\t\t\tsuggestion: \"Ensure package.json is valid JSON\",\n\t\t}\n\t}\n}\n\nexport async function checkMetaPattern(\n\tcwd: string,\n\tmetaPattern: string,\n\tignore: string[],\n): Promise<CheckResult> {\n\ttry {\n\t\tconst files = await glob(metaPattern, { cwd, ignore })\n\n\t\tif (files.length === 0) {\n\t\t\treturn {\n\t\t\t\tname: \"Screen meta files\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: `No files matching: ${metaPattern}`,\n\t\t\t\tsuggestion: \"Run 'screenbook generate' to create screen.meta.ts files\",\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tname: \"Screen meta files\",\n\t\t\tstatus: \"pass\",\n\t\t\tmessage: `Found ${files.length} screen.meta.ts file${files.length > 1 ? \"s\" : \"\"}`,\n\t\t}\n\t} catch {\n\t\treturn {\n\t\t\tname: \"Screen meta files\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: `Invalid pattern: ${metaPattern}`,\n\t\t\tsuggestion: \"Check metaPattern in your config file\",\n\t\t}\n\t}\n}\n\nexport async function checkRoutesPattern(\n\tcwd: string,\n\troutesPattern: string | undefined,\n\tignore: string[],\n): Promise<CheckResult> {\n\tif (!routesPattern) {\n\t\treturn {\n\t\t\tname: \"Routes pattern\",\n\t\t\tstatus: \"warn\",\n\t\t\tmessage: \"routesPattern not configured\",\n\t\t\tsuggestion:\n\t\t\t\t\"Set routesPattern in config to enable 'lint' and 'generate' commands\",\n\t\t}\n\t}\n\n\ttry {\n\t\tconst files = await glob(routesPattern, { cwd, ignore })\n\n\t\tif (files.length === 0) {\n\t\t\treturn {\n\t\t\t\tname: \"Routes pattern\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: `No files matching: ${routesPattern}`,\n\t\t\t\tsuggestion: \"Check routesPattern in your config file\",\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tname: \"Routes pattern\",\n\t\t\tstatus: \"pass\",\n\t\t\tmessage: `Found ${files.length} route file${files.length > 1 ? \"s\" : \"\"}`,\n\t\t}\n\t} catch {\n\t\treturn {\n\t\t\tname: \"Routes pattern\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: `Invalid pattern: ${routesPattern}`,\n\t\t\tsuggestion: \"Check routesPattern in your config file\",\n\t\t}\n\t}\n}\n\nexport async function checkBuildOutput(\n\tcwd: string,\n\toutDir: string,\n): Promise<CheckResult> {\n\tconst screensJsonPath = join(cwd, outDir, \"screens.json\")\n\n\tif (!existsSync(screensJsonPath)) {\n\t\treturn {\n\t\t\tname: \"Build output\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: `screens.json not found in ${outDir}/`,\n\t\t\tsuggestion: \"Run 'screenbook build' to generate metadata\",\n\t\t}\n\t}\n\n\ttry {\n\t\tconst content = readFileSync(screensJsonPath, \"utf-8\")\n\t\tconst screens = JSON.parse(content) as unknown[]\n\n\t\treturn {\n\t\t\tname: \"Build output\",\n\t\t\tstatus: \"pass\",\n\t\t\tmessage: `screens.json contains ${screens.length} screen${screens.length > 1 ? \"s\" : \"\"}`,\n\t\t}\n\t} catch {\n\t\treturn {\n\t\t\tname: \"Build output\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: \"screens.json is corrupted\",\n\t\t\tsuggestion: \"Run 'screenbook build' to regenerate\",\n\t\t}\n\t}\n}\n\nexport async function checkVersionCompatibility(\n\tcwd: string,\n): Promise<CheckResult> {\n\tconst packageJsonPath = join(cwd, \"package.json\")\n\n\tif (!existsSync(packageJsonPath)) {\n\t\treturn {\n\t\t\tname: \"Version compatibility\",\n\t\t\tstatus: \"warn\",\n\t\t\tmessage: \"Cannot check - package.json not found\",\n\t\t}\n\t}\n\n\ttry {\n\t\tconst content = readFileSync(packageJsonPath, \"utf-8\")\n\t\tconst pkg = JSON.parse(content) as PackageJson\n\n\t\tconst allDeps = { ...pkg.dependencies, ...pkg.devDependencies }\n\t\tconst unifiedVersion = allDeps.screenbook\n\t\tconst coreVersion = allDeps[\"@screenbook/core\"]\n\t\tconst cliVersion = allDeps[\"@screenbook/cli\"]\n\n\t\t// Unified package - no compatibility check needed\n\t\tif (unifiedVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Version compatibility\",\n\t\t\t\tstatus: \"pass\",\n\t\t\t\tmessage: \"Using unified screenbook package\",\n\t\t\t}\n\t\t}\n\n\t\tif (!coreVersion || !cliVersion) {\n\t\t\treturn {\n\t\t\t\tname: \"Version compatibility\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: \"Cannot check - packages not installed\",\n\t\t\t}\n\t\t}\n\n\t\t// Extract major version (handle ^, ~, etc.)\n\t\tconst extractMajor = (version: string): string => {\n\t\t\tconst cleaned = version.replace(/^[\\^~>=<]+/, \"\")\n\t\t\treturn cleaned.split(\".\")[0] ?? \"0\"\n\t\t}\n\n\t\tconst coreMajor = extractMajor(coreVersion)\n\t\tconst cliMajor = extractMajor(cliVersion)\n\n\t\tif (coreMajor !== cliMajor) {\n\t\t\treturn {\n\t\t\t\tname: \"Version compatibility\",\n\t\t\t\tstatus: \"warn\",\n\t\t\t\tmessage: `Major version mismatch: core@${coreVersion} vs cli@${cliVersion}`,\n\t\t\t\tsuggestion: \"Update packages to matching major versions\",\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tname: \"Version compatibility\",\n\t\t\tstatus: \"pass\",\n\t\t\tmessage: \"Package versions are compatible\",\n\t\t}\n\t} catch {\n\t\treturn {\n\t\t\tname: \"Version compatibility\",\n\t\t\tstatus: \"fail\",\n\t\t\tmessage: \"Failed to read package.json\",\n\t\t}\n\t}\n}\n\nexport async function checkGitRepository(cwd: string): Promise<CheckResult> {\n\tconst gitDir = join(cwd, \".git\")\n\n\tif (!existsSync(gitDir)) {\n\t\treturn {\n\t\t\tname: \"Git repository\",\n\t\t\tstatus: \"warn\",\n\t\t\tmessage: \"Not a git repository\",\n\t\t\tsuggestion:\n\t\t\t\t\"Run 'git init' to enable 'pr-impact' command for PR analysis\",\n\t\t}\n\t}\n\n\treturn {\n\t\tname: \"Git repository\",\n\t\tstatus: \"pass\",\n\t\tmessage: \"Git repository detected\",\n\t}\n}\n\nfunction displayResults(results: CheckResult[], verbose: boolean): void {\n\tlet passCount = 0\n\tlet failCount = 0\n\tlet warnCount = 0\n\n\tfor (const result of results) {\n\t\tconst icon =\n\t\t\tresult.status === \"pass\"\n\t\t\t\t? logger.green(\"✓\")\n\t\t\t\t: result.status === \"fail\"\n\t\t\t\t\t? logger.red(\"✗\")\n\t\t\t\t\t: logger.yellow(\"⚠\")\n\n\t\tconst statusColor =\n\t\t\tresult.status === \"pass\"\n\t\t\t\t? logger.green\n\t\t\t\t: result.status === \"fail\"\n\t\t\t\t\t? logger.red\n\t\t\t\t\t: logger.yellow\n\n\t\tlogger.log(`${icon} ${statusColor(result.name)}: ${result.message}`)\n\n\t\tif (result.suggestion && (result.status !== \"pass\" || verbose)) {\n\t\t\tlogger.log(` ${logger.dim(\"→\")} ${result.suggestion}`)\n\t\t}\n\n\t\tif (result.status === \"pass\") passCount++\n\t\telse if (result.status === \"fail\") failCount++\n\t\telse warnCount++\n\t}\n\n\tlogger.log(\"\")\n\n\tconst summary: string[] = []\n\tif (passCount > 0) summary.push(logger.green(`${passCount} passed`))\n\tif (failCount > 0) summary.push(logger.red(`${failCount} failed`))\n\tif (warnCount > 0) summary.push(logger.yellow(`${warnCount} warnings`))\n\n\tlogger.log(`Summary: ${summary.join(\", \")}`)\n\n\tif (failCount > 0) {\n\t\tlogger.log(\"\")\n\t\tlogger.log(\n\t\t\tlogger.dim(\"Run the suggested commands above to fix the issues.\"),\n\t\t)\n\t}\n}\n","import { resolve } from \"node:path\"\n\n/**\n * Supported router types for auto-detection.\n * Detection order: TanStack Router -> Solid Router -> Angular Router -> React Router -> Vue Router.\n */\nexport type RouterType =\n\t| \"react-router\"\n\t| \"vue-router\"\n\t| \"tanstack-router\"\n\t| \"solid-router\"\n\t| \"angular-router\"\n\t| \"unknown\"\n\n/**\n * Parsed route from router config (Vue Router, React Router, etc.)\n */\nexport interface ParsedRoute {\n\tpath: string\n\tname?: string\n\tcomponent?: string\n\tchildren?: ParsedRoute[]\n\tredirect?: string\n}\n\n/**\n * Flattened route with computed properties\n */\nexport interface FlatRoute {\n\t/** Full path including parent paths */\n\tfullPath: string\n\t/** Route name if defined */\n\tname?: string\n\t/** Component file path if available */\n\tcomponentPath?: string\n\t/** Computed screen ID from path */\n\tscreenId: string\n\t/** Computed screen title from path */\n\tscreenTitle: string\n\t/** Nesting depth */\n\tdepth: number\n}\n\n/**\n * Result of parsing a router config file\n */\nexport interface ParseResult {\n\troutes: ParsedRoute[]\n\twarnings: string[]\n}\n\n/**\n * Resolve relative import path to absolute path\n */\nexport function resolveImportPath(importPath: string, baseDir: string): string {\n\tif (importPath.startsWith(\".\")) {\n\t\treturn resolve(baseDir, importPath)\n\t}\n\treturn importPath\n}\n\n/**\n * Flatten nested routes into a flat list with computed properties\n */\nexport function flattenRoutes(\n\troutes: ParsedRoute[],\n\tparentPath = \"\",\n\tdepth = 0,\n): FlatRoute[] {\n\tconst result: FlatRoute[] = []\n\n\tfor (const route of routes) {\n\t\t// Skip redirect-only routes\n\t\tif (route.redirect && !route.component) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Compute full path\n\t\tlet fullPath: string\n\t\tif (route.path.startsWith(\"/\")) {\n\t\t\tfullPath = route.path\n\t\t} else if (parentPath === \"/\") {\n\t\t\tfullPath = `/${route.path}`\n\t\t} else {\n\t\t\tfullPath = parentPath ? `${parentPath}/${route.path}` : `/${route.path}`\n\t\t}\n\n\t\t// Normalize path\n\t\tfullPath = fullPath.replace(/\\/+/g, \"/\")\n\t\tif (fullPath !== \"/\" && fullPath.endsWith(\"/\")) {\n\t\t\tfullPath = fullPath.slice(0, -1)\n\t\t}\n\n\t\t// Handle empty path (index routes)\n\t\tif (fullPath === \"\") {\n\t\t\tfullPath = parentPath || \"/\"\n\t\t}\n\n\t\t// Only add routes with components (skip abstract parent routes)\n\t\tif (route.component || !route.children) {\n\t\t\tresult.push({\n\t\t\t\tfullPath,\n\t\t\t\tname: route.name,\n\t\t\t\tcomponentPath: route.component,\n\t\t\t\tscreenId: pathToScreenId(fullPath),\n\t\t\t\tscreenTitle: pathToScreenTitle(fullPath),\n\t\t\t\tdepth,\n\t\t\t})\n\t\t}\n\n\t\t// Process children\n\t\tif (route.children) {\n\t\t\tresult.push(...flattenRoutes(route.children, fullPath, depth + 1))\n\t\t}\n\t}\n\n\treturn result\n}\n\n/**\n * Convert route path to screen ID\n * /user/:id/profile -> user.id.profile\n */\nexport function pathToScreenId(path: string): string {\n\tif (path === \"/\" || path === \"\") {\n\t\treturn \"home\"\n\t}\n\n\treturn path\n\t\t.replace(/^\\//, \"\") // Remove leading slash\n\t\t.replace(/\\/$/, \"\") // Remove trailing slash\n\t\t.split(\"/\")\n\t\t.map((segment) => {\n\t\t\t// Convert :param to param\n\t\t\tif (segment.startsWith(\":\")) {\n\t\t\t\treturn segment.slice(1)\n\t\t\t}\n\t\t\t// Convert *catchall or ** to catchall\n\t\t\tif (segment.startsWith(\"*\")) {\n\t\t\t\t// Handle ** (Angular) as catchall\n\t\t\t\tif (segment === \"**\") {\n\t\t\t\t\treturn \"catchall\"\n\t\t\t\t}\n\t\t\t\treturn segment.slice(1) || \"catchall\"\n\t\t\t}\n\t\t\treturn segment\n\t\t})\n\t\t.join(\".\")\n}\n\n/**\n * Convert route path to screen title\n * /user/:id/profile -> Profile\n */\nexport function pathToScreenTitle(path: string): string {\n\tif (path === \"/\" || path === \"\") {\n\t\treturn \"Home\"\n\t}\n\n\tconst segments = path\n\t\t.replace(/^\\//, \"\")\n\t\t.replace(/\\/$/, \"\")\n\t\t.split(\"/\")\n\t\t.filter((s) => !s.startsWith(\":\") && !s.startsWith(\"*\"))\n\n\tconst lastSegment = segments[segments.length - 1] || \"Home\"\n\n\t// Convert kebab-case or snake_case to Title Case\n\treturn lastSegment\n\t\t.split(/[-_]/)\n\t\t.map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(\" \")\n}\n","import { readFileSync } from \"node:fs\"\nimport { dirname, resolve } from \"node:path\"\nimport { parse } from \"@babel/parser\"\nimport {\n\ttype ParsedRoute,\n\ttype ParseResult,\n\tresolveImportPath,\n} from \"./routeParserUtils.js\"\n\n// Re-export shared types\nexport type { ParsedRoute, ParseResult }\n\n/**\n * Parse Angular Router configuration file and extract routes.\n * Supports both Standalone (Angular 14+) and NgModule patterns.\n *\n * Supported patterns:\n * - `export const routes: Routes = [...]`\n * - `const routes: Routes = [...]`\n * - `RouterModule.forRoot([...])`\n * - `RouterModule.forChild([...])`\n * - `export default [...]`\n * - `export default [...] satisfies Routes`\n *\n * @param filePath - Path to the router configuration file\n * @param preloadedContent - Optional pre-read file content. When provided, the file is not read from disk,\n * enabling testing with virtual content or avoiding duplicate file reads.\n * @returns ParseResult containing extracted routes and any warnings\n * @throws Error if the file cannot be read or contains syntax errors\n */\nexport function parseAngularRouterConfig(\n\tfilePath: string,\n\tpreloadedContent?: string,\n): ParseResult {\n\tconst absolutePath = resolve(filePath)\n\tconst routesFileDir = dirname(absolutePath)\n\tconst warnings: string[] = []\n\n\t// Read file with proper error handling (skip if content is preloaded)\n\tlet content: string\n\tif (preloadedContent !== undefined) {\n\t\tcontent = preloadedContent\n\t} else {\n\t\ttry {\n\t\t\tcontent = readFileSync(absolutePath, \"utf-8\")\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to read routes file \"${absolutePath}\": ${message}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Parse with Babel - wrap for better error messages\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", [\"decorators\", { decoratorsBeforeExport: true }]],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Syntax error in routes file \"${absolutePath}\": ${error.message}`,\n\t\t\t)\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tthrow new Error(`Failed to parse routes file \"${absolutePath}\": ${message}`)\n\t}\n\n\tconst routes: ParsedRoute[] = []\n\n\t// Find routes array in the AST\n\tfor (const node of ast.program.body) {\n\t\t// Handle: const routes: Routes = [...] or export const routes: Routes = [...]\n\t\tif (node.type === \"VariableDeclaration\") {\n\t\t\tfor (const decl of node.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\t// Check if it looks like a routes array (name contains \"route\" or has Routes type)\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\t\t\t\t\tconst typeAnnotation = (decl.id as any).typeAnnotation?.typeAnnotation\n\t\t\t\t\tconst isRoutesVariable =\n\t\t\t\t\t\tdecl.id.name.toLowerCase().includes(\"route\") ||\n\t\t\t\t\t\t(typeAnnotation?.type === \"TSTypeReference\" &&\n\t\t\t\t\t\t\ttypeAnnotation.typeName?.type === \"Identifier\" &&\n\t\t\t\t\t\t\ttypeAnnotation.typeName.name === \"Routes\")\n\t\t\t\t\tif (isRoutesVariable) {\n\t\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export const routes: Routes = [...]\n\t\tif (\n\t\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t\t) {\n\t\t\tfor (const decl of node.declaration.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\t\t\t\t\tconst typeAnnotation = (decl.id as any).typeAnnotation?.typeAnnotation\n\t\t\t\t\tconst isRoutesVariable =\n\t\t\t\t\t\tdecl.id.name.toLowerCase().includes(\"route\") ||\n\t\t\t\t\t\t(typeAnnotation?.type === \"TSTypeReference\" &&\n\t\t\t\t\t\t\ttypeAnnotation.typeName?.type === \"Identifier\" &&\n\t\t\t\t\t\t\ttypeAnnotation.typeName.name === \"Routes\")\n\t\t\t\t\tif (isRoutesVariable) {\n\t\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export default [...] (less common but possible)\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(node.declaration, routesFileDir, warnings)\n\t\t\troutes.push(...parsed)\n\t\t}\n\n\t\t// Handle: export default [...] satisfies Routes\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"TSSatisfiesExpression\" &&\n\t\t\tnode.declaration.expression.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(\n\t\t\t\tnode.declaration.expression,\n\t\t\t\troutesFileDir,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t\troutes.push(...parsed)\n\t\t}\n\n\t\t// Handle NgModule pattern: RouterModule.forRoot([...]) or RouterModule.forChild([...])\n\t\t// This can appear in @NgModule decorator or as a call expression\n\t\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\t\tlet classNode: any = null\n\t\tif (node.type === \"ClassDeclaration\") {\n\t\t\tclassNode = node\n\t\t} else if (\n\t\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: AST node types require type assertions\n\t\t\t(node as any).declaration?.type === \"ClassDeclaration\"\n\t\t) {\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: AST node types require type assertions\n\t\t\tclassNode = (node as any).declaration\n\t\t}\n\n\t\tif (classNode) {\n\t\t\tconst decorators = classNode.decorators || []\n\t\t\tfor (const decorator of decorators) {\n\t\t\t\tif (decorator.expression?.type === \"CallExpression\") {\n\t\t\t\t\tconst routesFromDecorator = extractRoutesFromNgModule(\n\t\t\t\t\t\tdecorator.expression,\n\t\t\t\t\t\troutesFileDir,\n\t\t\t\t\t\twarnings,\n\t\t\t\t\t)\n\t\t\t\t\troutes.push(...routesFromDecorator)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle standalone RouterModule.forRoot/forChild calls in exports\n\t\tif (node.type === \"ExpressionStatement\") {\n\t\t\tconst routesFromExpr = extractRoutesFromExpression(\n\t\t\t\tnode.expression,\n\t\t\t\troutesFileDir,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t\troutes.push(...routesFromExpr)\n\t\t}\n\t}\n\n\t// Warn if no routes were found\n\tif (routes.length === 0) {\n\t\twarnings.push(\n\t\t\t\"No routes found. Supported patterns: 'export const routes: Routes = [...]', 'RouterModule.forRoot([...])', or 'RouterModule.forChild([...])'\",\n\t\t)\n\t}\n\n\treturn { routes, warnings }\n}\n\n/**\n * Extract routes from @NgModule decorator\n */\nfunction extractRoutesFromNgModule(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tcallExpr: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\t// Check if it's @NgModule({...})\n\tif (\n\t\tcallExpr.callee?.type === \"Identifier\" &&\n\t\tcallExpr.callee.name === \"NgModule\"\n\t) {\n\t\tconst arg = callExpr.arguments[0]\n\t\tif (arg?.type === \"ObjectExpression\") {\n\t\t\tfor (const prop of arg.properties) {\n\t\t\t\tif (\n\t\t\t\t\tprop.type === \"ObjectProperty\" &&\n\t\t\t\t\tprop.key?.type === \"Identifier\" &&\n\t\t\t\t\tprop.key.name === \"imports\"\n\t\t\t\t) {\n\t\t\t\t\tif (prop.value?.type === \"ArrayExpression\") {\n\t\t\t\t\t\tfor (const element of prop.value.elements) {\n\t\t\t\t\t\t\tif (!element) continue\n\t\t\t\t\t\t\tconst extracted = extractRoutesFromExpression(\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\tbaseDir,\n\t\t\t\t\t\t\t\twarnings,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\troutes.push(...extracted)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Extract routes from RouterModule.forRoot/forChild call expressions\n */\nfunction extractRoutesFromExpression(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\tif (node?.type !== \"CallExpression\") return routes\n\n\tconst callee = node.callee\n\tif (\n\t\tcallee?.type === \"MemberExpression\" &&\n\t\tcallee.object?.type === \"Identifier\" &&\n\t\tcallee.object.name === \"RouterModule\" &&\n\t\tcallee.property?.type === \"Identifier\" &&\n\t\t(callee.property.name === \"forRoot\" || callee.property.name === \"forChild\")\n\t) {\n\t\tconst routesArg = node.arguments[0]\n\t\tif (routesArg?.type === \"ArrayExpression\") {\n\t\t\tconst parsed = parseRoutesArray(routesArg, baseDir, warnings)\n\t\t\troutes.push(...parsed)\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Parse an array expression containing route objects\n */\nfunction parseRoutesArray(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tarrayNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const element of arrayNode.elements) {\n\t\tif (!element) continue\n\n\t\t// Handle spread elements\n\t\tif (element.type === \"SpreadElement\") {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Spread operator detected${loc}. Routes from spread cannot be statically analyzed.`,\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\n\t\tif (element.type === \"ObjectExpression\") {\n\t\t\tconst parsedRoute = parseRouteObject(element, baseDir, warnings)\n\t\t\tif (parsedRoute) {\n\t\t\t\troutes.push(parsedRoute)\n\t\t\t}\n\t\t} else {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Non-object route element (${element.type})${loc}. Only object literals can be statically analyzed.`,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Parse a single route object expression\n */\nfunction parseRouteObject(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tobjectNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute | null {\n\tlet path: string | undefined\n\tlet component: string | undefined\n\tlet children: ParsedRoute[] | undefined\n\tlet redirectTo: string | undefined\n\tlet hasPath = false\n\n\tfor (const prop of objectNode.properties) {\n\t\tif (prop.type !== \"ObjectProperty\") continue\n\t\tif (prop.key.type !== \"Identifier\") continue\n\n\t\tconst key = prop.key.name\n\n\t\tswitch (key) {\n\t\t\tcase \"path\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\tpath = prop.value.value\n\t\t\t\t\thasPath = true\n\t\t\t\t} else {\n\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t`Dynamic path value (${prop.value.type})${loc}. Only string literal paths can be statically analyzed.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"component\":\n\t\t\t\t// Direct component reference: component: HomeComponent\n\t\t\t\tif (prop.value.type === \"Identifier\") {\n\t\t\t\t\tcomponent = prop.value.name\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"loadComponent\":\n\t\t\t\t// Lazy component: loadComponent: () => import('./path').then(m => m.Component)\n\t\t\t\tcomponent = extractLazyComponent(prop.value, baseDir, warnings)\n\t\t\t\tbreak\n\n\t\t\tcase \"loadChildren\": {\n\t\t\t\t// Lazy children: loadChildren: () => import('./path').then(m => m.routes)\n\t\t\t\t// We just note this for now - the actual routes are in another file\n\t\t\t\tconst lazyPath = extractLazyPath(prop.value, baseDir, warnings)\n\t\t\t\tif (lazyPath) {\n\t\t\t\t\tcomponent = `[lazy: ${lazyPath}]`\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tcase \"children\":\n\t\t\t\tif (prop.value.type === \"ArrayExpression\") {\n\t\t\t\t\tchildren = parseRoutesArray(prop.value, baseDir, warnings)\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"redirectTo\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\tredirectTo = prop.value.value\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\t// Skip these properties (not relevant for screen detection)\n\t\t\tcase \"pathMatch\":\n\t\t\tcase \"canActivate\":\n\t\t\tcase \"canDeactivate\":\n\t\t\tcase \"canMatch\":\n\t\t\tcase \"resolve\":\n\t\t\tcase \"data\":\n\t\t\tcase \"title\":\n\t\t\tcase \"providers\":\n\t\t\tcase \"runGuardsAndResolvers\":\n\t\t\tcase \"outlet\":\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// Skip redirect-only routes (no component)\n\tif (redirectTo && !component && !children) {\n\t\treturn null\n\t}\n\n\t// Skip routes without path (unless they have children for layout purposes)\n\tif (!hasPath) {\n\t\tif (children && children.length > 0) {\n\t\t\treturn { path: \"\", component, children }\n\t\t}\n\t\treturn null\n\t}\n\n\treturn {\n\t\tpath: path || \"\",\n\t\tcomponent,\n\t\tchildren,\n\t}\n}\n\n/**\n * Extract component from lazy loadComponent pattern\n * loadComponent: () => import('./path').then(m => m.Component)\n */\nfunction extractLazyComponent(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Arrow function: () => import('./path').then(m => m.Component)\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\t// Handle .then(m => m.Component) chain\n\t\tif (\n\t\t\tbody.type === \"CallExpression\" &&\n\t\t\tbody.callee?.type === \"MemberExpression\" &&\n\t\t\tbody.callee.property?.type === \"Identifier\" &&\n\t\t\tbody.callee.property.name === \"then\"\n\t\t) {\n\t\t\tconst importCall = body.callee.object\n\t\t\tconst thenArg = body.arguments[0]\n\n\t\t\t// Check if it's an import() call\n\t\t\tif (\n\t\t\t\timportCall?.type === \"CallExpression\" &&\n\t\t\t\timportCall.callee?.type === \"Import\"\n\t\t\t) {\n\t\t\t\t// Check if the argument is a string literal\n\t\t\t\tif (importCall.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\t\tconst importPath = resolveImportPath(\n\t\t\t\t\t\timportCall.arguments[0].value,\n\t\t\t\t\t\tbaseDir,\n\t\t\t\t\t)\n\n\t\t\t\t\t// Extract component name from .then(m => m.Component)\n\t\t\t\t\tif (\n\t\t\t\t\t\tthenArg?.type === \"ArrowFunctionExpression\" &&\n\t\t\t\t\t\tthenArg.body?.type === \"MemberExpression\" &&\n\t\t\t\t\t\tthenArg.body.property?.type === \"Identifier\"\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn `${importPath}#${thenArg.body.property.name}`\n\t\t\t\t\t}\n\n\t\t\t\t\treturn importPath\n\t\t\t\t}\n\t\t\t\t// Dynamic import path - warn the user\n\t\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Lazy loadComponent with dynamic path${loc}. Only string literal imports can be analyzed.`,\n\t\t\t\t)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t}\n\n\t\t// Direct import without .then(): () => import('./path')\n\t\tif (body.type === \"CallExpression\" && body.callee?.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Lazy loadComponent with dynamic path${loc}. Only string literal imports can be analyzed.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\twarnings.push(\n\t\t`Unrecognized loadComponent pattern (${node.type})${loc}. Expected arrow function with import().then().`,\n\t)\n\treturn undefined\n}\n\n/**\n * Extract path from lazy loadChildren pattern\n * loadChildren: () => import('./path').then(m => m.routes)\n */\nfunction extractLazyPath(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\t// Handle .then() chain\n\t\tif (\n\t\t\tbody.type === \"CallExpression\" &&\n\t\t\tbody.callee?.type === \"MemberExpression\" &&\n\t\t\tbody.callee.property?.type === \"Identifier\" &&\n\t\t\tbody.callee.property.name === \"then\"\n\t\t) {\n\t\t\tconst importCall = body.callee.object\n\t\t\tif (\n\t\t\t\timportCall?.type === \"CallExpression\" &&\n\t\t\t\timportCall.callee?.type === \"Import\" &&\n\t\t\t\timportCall.arguments[0]?.type === \"StringLiteral\"\n\t\t\t) {\n\t\t\t\treturn resolveImportPath(importCall.arguments[0].value, baseDir)\n\t\t\t}\n\t\t}\n\n\t\t// Direct import without .then()\n\t\tif (body.type === \"CallExpression\" && body.callee?.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t}\n\t}\n\n\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\twarnings.push(\n\t\t`Unrecognized loadChildren pattern (${node.type})${loc}. Expected arrow function with import().`,\n\t)\n\treturn undefined\n}\n\n/**\n * Detect if content is Angular Router based on patterns.\n * Checks for @angular/router import, RouterModule patterns, or Routes type annotation.\n */\nexport function isAngularRouterContent(content: string): boolean {\n\t// Check for Angular Router import\n\tif (content.includes(\"@angular/router\")) {\n\t\treturn true\n\t}\n\n\t// Check for RouterModule patterns\n\tif (\n\t\tcontent.includes(\"RouterModule.forRoot\") ||\n\t\tcontent.includes(\"RouterModule.forChild\")\n\t) {\n\t\treturn true\n\t}\n\n\t// Check for Routes type annotation: : Routes = or : Routes[\n\tif (/:\\s*Routes\\s*[=[]/.test(content)) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n","import { parse } from \"@babel/parser\"\nimport { pathToScreenId } from \"./routeParserUtils.js\"\n\n/**\n * Detected navigation target from a source file\n */\nexport interface DetectedNavigation {\n\t/** The target path (e.g., \"/users\", \"/billing/invoices/:id\") */\n\treadonly path: string\n\t/** Converted screen ID using pathToScreenId */\n\treadonly screenId: string\n\t/** Navigation method type */\n\treadonly type:\n\t\t| \"link\"\n\t\t| \"router-push\"\n\t\t| \"navigate\"\n\t\t| \"redirect\"\n\t\t| \"navigate-by-url\"\n\t/** Line number where detected */\n\treadonly line: number\n}\n\n/**\n * Factory function to create DetectedNavigation with proper screenId derivation.\n * Ensures the screenId is always correctly derived from the path.\n */\nexport function createDetectedNavigation(\n\tpath: string,\n\ttype: DetectedNavigation[\"type\"],\n\tline: number,\n): DetectedNavigation {\n\t// Strip query params and hash from path before converting to screenId\n\tconst pathWithoutQuery = path.split(\"?\")[0] ?? path\n\tconst cleanPath = pathWithoutQuery.split(\"#\")[0] ?? pathWithoutQuery\n\treturn {\n\t\tpath,\n\t\tscreenId: pathToScreenId(cleanPath),\n\t\ttype,\n\t\tline,\n\t}\n}\n\n/**\n * Result of analyzing a file for navigation\n */\nexport interface NavigationAnalysisResult {\n\t/** Detected navigation targets */\n\treadonly navigations: readonly DetectedNavigation[]\n\t/** Any warnings during analysis */\n\treadonly warnings: readonly string[]\n}\n\n/**\n * Result of analyzing a component for navigation.\n * Shared interface for framework-specific analyzers (Angular, Vue SFC, etc.)\n */\nexport interface ComponentAnalysisResult {\n\t/** Navigation targets detected in template */\n\treadonly templateNavigations: readonly DetectedNavigation[]\n\t/** Navigation targets detected in script */\n\treadonly scriptNavigations: readonly DetectedNavigation[]\n\t/** Any warnings during analysis */\n\treadonly warnings: readonly string[]\n}\n\n/**\n * Deduplicate navigations by screenId.\n * Exported for use by framework-specific analyzers.\n *\n * @param navigations - Array of detected navigations\n * @returns Array with duplicate screenIds removed (keeps first occurrence)\n */\nexport function deduplicateByScreenId(\n\tnavigations: DetectedNavigation[],\n): DetectedNavigation[] {\n\tconst seen = new Set<string>()\n\treturn navigations.filter((nav) => {\n\t\tif (seen.has(nav.screenId)) {\n\t\t\treturn false\n\t\t}\n\t\tseen.add(nav.screenId)\n\t\treturn true\n\t})\n}\n\n/**\n * Result of framework detection\n */\nexport interface FrameworkDetectionResult {\n\t/** Detected or default framework */\n\treadonly framework: NavigationFramework\n\t/** Whether the framework was explicitly detected (false means defaulted to Next.js) */\n\treadonly detected: boolean\n}\n\n/**\n * Navigation framework to detect\n */\nexport type NavigationFramework =\n\t| \"nextjs\"\n\t| \"react-router\"\n\t| \"vue-router\"\n\t| \"angular\"\n\t| \"solid-router\"\n\t| \"tanstack-router\"\n\n/**\n * Analyze a file's content for navigation patterns.\n *\n * Supports:\n * - Next.js: `<Link href=\"/path\">`, `router.push(\"/path\")`, `router.replace(\"/path\")`, `redirect(\"/path\")`\n * - React Router: `<Link to=\"/path\">`, `navigate(\"/path\")`\n * - Vue Router: `router.push(\"/path\")`, `router.replace(\"/path\")`, `router.push({ path: \"/path\" })`\n * - Angular: `router.navigate(['/path'])`, `router.navigateByUrl('/path')`\n * - Solid Router: `<A href=\"/path\">`, `navigate(\"/path\")`\n * - TanStack Router: `<Link to=\"/path\">`, `navigate({ to: \"/path\" })`\n *\n * @param content - The file content to analyze\n * @param framework - The navigation framework to detect\n * @returns Analysis result with detected navigations and warnings\n */\nexport function analyzeNavigation(\n\tcontent: string,\n\tframework: NavigationFramework,\n): NavigationAnalysisResult {\n\tconst navigations: DetectedNavigation[] = []\n\tconst warnings: string[] = []\n\n\t// Parse with Babel\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", \"jsx\", \"decorators-legacy\"],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\twarnings.push(`Syntax error during navigation analysis: ${error.message}`)\n\t\t\treturn { navigations, warnings }\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\twarnings.push(`Failed to parse file for navigation analysis: ${message}`)\n\t\treturn { navigations, warnings }\n\t}\n\n\t// Walk the AST with error handling\n\ttry {\n\t\twalkNode(ast.program, (node) => {\n\t\t\t// Detect JSX Link components\n\t\t\tif (node.type === \"JSXOpeningElement\") {\n\t\t\t\tconst linkNav = extractLinkNavigation(node, framework, warnings)\n\t\t\t\tif (linkNav) {\n\t\t\t\t\tnavigations.push(linkNav)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Detect call expressions (router.push, router.replace, navigate, redirect)\n\t\t\tif (node.type === \"CallExpression\") {\n\t\t\t\tconst callNav = extractCallNavigation(node, framework, warnings)\n\t\t\t\tif (callNav) {\n\t\t\t\t\tnavigations.push(callNav)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof RangeError) {\n\t\t\twarnings.push(\n\t\t\t\t`File too complex for navigation analysis (${error.message}). Consider simplifying the file structure.`,\n\t\t\t)\n\t\t\treturn { navigations, warnings }\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tconst errorType = error?.constructor?.name ?? \"Unknown\"\n\t\twarnings.push(`Unexpected ${errorType} during AST traversal: ${message}`)\n\t\treturn { navigations, warnings }\n\t}\n\n\t// Remove duplicates (same screenId)\n\tconst seen = new Set<string>()\n\tconst uniqueNavigations = navigations.filter((nav) => {\n\t\tif (seen.has(nav.screenId)) {\n\t\t\treturn false\n\t\t}\n\t\tseen.add(nav.screenId)\n\t\treturn true\n\t})\n\n\treturn { navigations: uniqueNavigations, warnings }\n}\n\n/**\n * Extract navigation from JSX Link component\n */\nfunction extractLinkNavigation(\n\t// biome-ignore lint/suspicious/noExplicitAny: Babel AST nodes have complex union types that are impractical to fully type\n\tnode: any,\n\tframework: NavigationFramework,\n\twarnings: string[],\n): DetectedNavigation | null {\n\t// Check if it's a Link component\n\tif (node.name?.type !== \"JSXIdentifier\") {\n\t\treturn null\n\t}\n\n\tconst componentName = node.name.name\n\t// Solid Router uses <A> component, others use <Link>\n\tif (componentName !== \"Link\" && componentName !== \"A\") {\n\t\treturn null\n\t}\n\n\t// Determine which attribute to look for based on framework\n\t// Next.js and Solid Router use href, React Router uses to\n\tconst attrName =\n\t\tframework === \"nextjs\" || framework === \"solid-router\" ? \"href\" : \"to\"\n\n\tfor (const attr of node.attributes || []) {\n\t\tif (\n\t\t\tattr.type === \"JSXAttribute\" &&\n\t\t\tattr.name?.type === \"JSXIdentifier\" &&\n\t\t\tattr.name.name === attrName\n\t\t) {\n\t\t\t// String literal: href=\"/path\"\n\t\t\tif (attr.value?.type === \"StringLiteral\") {\n\t\t\t\tconst path = attr.value.value\n\t\t\t\tif (isValidInternalPath(path)) {\n\t\t\t\t\treturn createDetectedNavigation(\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\"link\",\n\t\t\t\t\t\tnode.loc?.start.line ?? 0,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// JSX expression: href={\"/path\"} or href={`/path`}\n\t\t\tif (attr.value?.type === \"JSXExpressionContainer\") {\n\t\t\t\tconst expr = attr.value.expression\n\n\t\t\t\t// Simple string literal in expression\n\t\t\t\tif (expr.type === \"StringLiteral\") {\n\t\t\t\t\tconst path = expr.value\n\t\t\t\t\tif (isValidInternalPath(path)) {\n\t\t\t\t\t\treturn createDetectedNavigation(\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\"link\",\n\t\t\t\t\t\t\tnode.loc?.start.line ?? 0,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Template literal with no expressions (static template)\n\t\t\t\tif (\n\t\t\t\t\texpr.type === \"TemplateLiteral\" &&\n\t\t\t\t\texpr.expressions.length === 0 &&\n\t\t\t\t\texpr.quasis.length === 1\n\t\t\t\t) {\n\t\t\t\t\tconst path = expr.quasis[0].value.cooked\n\t\t\t\t\tif (path && isValidInternalPath(path)) {\n\t\t\t\t\t\treturn createDetectedNavigation(\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\"link\",\n\t\t\t\t\t\t\tnode.loc?.start.line ?? 0,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Dynamic expression - add warning with actionable guidance\n\t\t\t\tconst line = node.loc?.start.line ?? 0\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Dynamic ${componentName} ${attrName} at line ${line} cannot be statically analyzed. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null\n}\n\n/**\n * Extract navigation from function calls (router.push, router.replace, navigate, redirect)\n */\nfunction extractCallNavigation(\n\t// biome-ignore lint/suspicious/noExplicitAny: Babel AST nodes have complex union types that are impractical to fully type\n\tnode: any,\n\tframework: NavigationFramework,\n\twarnings: string[],\n): DetectedNavigation | null {\n\tconst callee = node.callee\n\n\t// router.push() or router.replace() - Next.js\n\tif (\n\t\tframework === \"nextjs\" &&\n\t\tcallee?.type === \"MemberExpression\" &&\n\t\tcallee.object?.type === \"Identifier\" &&\n\t\tcallee.object.name === \"router\" &&\n\t\tcallee.property?.type === \"Identifier\" &&\n\t\t(callee.property.name === \"push\" || callee.property.name === \"replace\")\n\t) {\n\t\treturn extractPathFromCallArgs(node, \"router-push\", warnings)\n\t}\n\n\t// router.push() or router.replace() - Vue Router\n\tif (\n\t\tframework === \"vue-router\" &&\n\t\tcallee?.type === \"MemberExpression\" &&\n\t\tcallee.object?.type === \"Identifier\" &&\n\t\tcallee.object.name === \"router\" &&\n\t\tcallee.property?.type === \"Identifier\" &&\n\t\t(callee.property.name === \"push\" || callee.property.name === \"replace\")\n\t) {\n\t\treturn extractPathFromCallArgs(node, \"router-push\", warnings)\n\t}\n\n\t// navigate() - React Router or Solid Router\n\tif (\n\t\t(framework === \"react-router\" || framework === \"solid-router\") &&\n\t\tcallee?.type === \"Identifier\" &&\n\t\tcallee.name === \"navigate\"\n\t) {\n\t\treturn extractPathFromCallArgs(node, \"navigate\", warnings)\n\t}\n\n\t// navigate({ to: '/path' }) - TanStack Router\n\tif (\n\t\tframework === \"tanstack-router\" &&\n\t\tcallee?.type === \"Identifier\" &&\n\t\tcallee.name === \"navigate\"\n\t) {\n\t\treturn extractPathFromObjectArg(node, \"navigate\", warnings, \"to\")\n\t}\n\n\t// redirect() - Next.js\n\tif (\n\t\tframework === \"nextjs\" &&\n\t\tcallee?.type === \"Identifier\" &&\n\t\tcallee.name === \"redirect\"\n\t) {\n\t\treturn extractPathFromCallArgs(node, \"redirect\", warnings)\n\t}\n\n\t// router.navigate() - Angular Router\n\t// Matches: this.router.navigate(['/path']) or router.navigate(['/path'])\n\tif (\n\t\tframework === \"angular\" &&\n\t\tcallee?.type === \"MemberExpression\" &&\n\t\tcallee.property?.type === \"Identifier\" &&\n\t\tcallee.property.name === \"navigate\"\n\t) {\n\t\tconst obj = callee.object\n\t\t// Match: this.router.navigate() or router.navigate()\n\t\tif (\n\t\t\t(obj?.type === \"MemberExpression\" &&\n\t\t\t\tobj.property?.type === \"Identifier\" &&\n\t\t\t\tobj.property.name === \"router\") ||\n\t\t\t(obj?.type === \"Identifier\" && obj.name === \"router\")\n\t\t) {\n\t\t\treturn extractPathFromArrayArg(node, \"navigate\", warnings)\n\t\t}\n\t}\n\n\t// router.navigateByUrl() - Angular Router\n\tif (\n\t\tframework === \"angular\" &&\n\t\tcallee?.type === \"MemberExpression\" &&\n\t\tcallee.property?.type === \"Identifier\" &&\n\t\tcallee.property.name === \"navigateByUrl\"\n\t) {\n\t\tconst obj = callee.object\n\t\tif (\n\t\t\t(obj?.type === \"MemberExpression\" &&\n\t\t\t\tobj.property?.type === \"Identifier\" &&\n\t\t\t\tobj.property.name === \"router\") ||\n\t\t\t(obj?.type === \"Identifier\" && obj.name === \"router\")\n\t\t) {\n\t\t\treturn extractPathFromCallArgs(node, \"navigate-by-url\", warnings)\n\t\t}\n\t}\n\n\treturn null\n}\n\n/**\n * Extract path from function call arguments\n */\nfunction extractPathFromCallArgs(\n\t// biome-ignore lint/suspicious/noExplicitAny: Babel AST nodes have complex union types that are impractical to fully type\n\tnode: any,\n\ttype: DetectedNavigation[\"type\"],\n\twarnings: string[],\n): DetectedNavigation | null {\n\tconst firstArg = node.arguments?.[0]\n\n\tif (!firstArg) {\n\t\treturn null\n\t}\n\n\t// String literal\n\tif (firstArg.type === \"StringLiteral\") {\n\t\tconst path = firstArg.value\n\t\tif (isValidInternalPath(path)) {\n\t\t\treturn createDetectedNavigation(path, type, node.loc?.start.line ?? 0)\n\t\t}\n\t}\n\n\t// Template literal with no expressions\n\tif (\n\t\tfirstArg.type === \"TemplateLiteral\" &&\n\t\tfirstArg.expressions.length === 0 &&\n\t\tfirstArg.quasis.length === 1\n\t) {\n\t\tconst path = firstArg.quasis[0].value.cooked\n\t\tif (path && isValidInternalPath(path)) {\n\t\t\treturn createDetectedNavigation(path, type, node.loc?.start.line ?? 0)\n\t\t}\n\t}\n\n\t// Object argument with path property (Vue Router style): { path: \"/users\" }\n\tif (firstArg.type === \"ObjectExpression\") {\n\t\tfor (const prop of firstArg.properties || []) {\n\t\t\tif (\n\t\t\t\tprop.type === \"ObjectProperty\" &&\n\t\t\t\tprop.key?.type === \"Identifier\" &&\n\t\t\t\tprop.key.name === \"path\"\n\t\t\t) {\n\t\t\t\t// String literal value\n\t\t\t\tif (prop.value?.type === \"StringLiteral\") {\n\t\t\t\t\tconst path = prop.value.value\n\t\t\t\t\tif (isValidInternalPath(path)) {\n\t\t\t\t\t\treturn createDetectedNavigation(\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tnode.loc?.start.line ?? 0,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Static template literal value\n\t\t\t\tif (\n\t\t\t\t\tprop.value?.type === \"TemplateLiteral\" &&\n\t\t\t\t\tprop.value.expressions.length === 0 &&\n\t\t\t\t\tprop.value.quasis.length === 1\n\t\t\t\t) {\n\t\t\t\t\tconst path = prop.value.quasis[0].value.cooked\n\t\t\t\t\tif (path && isValidInternalPath(path)) {\n\t\t\t\t\t\treturn createDetectedNavigation(\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tnode.loc?.start.line ?? 0,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Object without static path (named route or dynamic path)\n\t\tconst line = node.loc?.start.line ?? 0\n\t\twarnings.push(\n\t\t\t`Object-based navigation at line ${line} cannot be statically analyzed. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t\t)\n\t\treturn null\n\t}\n\n\t// Dynamic argument - add warning with actionable guidance\n\tconst line = node.loc?.start.line ?? 0\n\twarnings.push(\n\t\t`Dynamic navigation path at line ${line} cannot be statically analyzed. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t)\n\n\treturn null\n}\n\n/**\n * Extract path from object argument with a specific property.\n *\n * @param node - The AST CallExpression node\n * @param type - The navigation type to assign\n * @param warnings - Array to collect warnings\n * @param propertyName - The property name to look for (e.g., \"to\" for TanStack Router)\n * @returns DetectedNavigation if a valid path is found, null otherwise\n *\n * @example\n * // TanStack Router: navigate({ to: '/users' }) -> extracts '/users'\n */\nfunction extractPathFromObjectArg(\n\t// biome-ignore lint/suspicious/noExplicitAny: Babel AST nodes have complex union types that are impractical to fully type\n\tnode: any,\n\ttype: DetectedNavigation[\"type\"],\n\twarnings: string[],\n\tpropertyName: string,\n): DetectedNavigation | null {\n\tconst firstArg = node.arguments?.[0]\n\n\tif (!firstArg) {\n\t\tconst line = node.loc?.start.line ?? 0\n\t\twarnings.push(\n\t\t\t`Navigation call at line ${line} has no arguments. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t\t)\n\t\treturn null\n\t}\n\n\t// Object argument with specified property: { to: \"/users\" } or { path: \"/users\" }\n\tif (firstArg.type === \"ObjectExpression\") {\n\t\tfor (const prop of firstArg.properties || []) {\n\t\t\tif (\n\t\t\t\tprop.type === \"ObjectProperty\" &&\n\t\t\t\tprop.key?.type === \"Identifier\" &&\n\t\t\t\tprop.key.name === propertyName\n\t\t\t) {\n\t\t\t\t// String literal value\n\t\t\t\tif (prop.value?.type === \"StringLiteral\") {\n\t\t\t\t\tconst path = prop.value.value\n\t\t\t\t\tif (isValidInternalPath(path)) {\n\t\t\t\t\t\treturn createDetectedNavigation(\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tnode.loc?.start.line ?? 0,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Static template literal value\n\t\t\t\tif (\n\t\t\t\t\tprop.value?.type === \"TemplateLiteral\" &&\n\t\t\t\t\tprop.value.expressions.length === 0 &&\n\t\t\t\t\tprop.value.quasis.length === 1\n\t\t\t\t) {\n\t\t\t\t\tconst path = prop.value.quasis[0].value.cooked\n\t\t\t\t\tif (path && isValidInternalPath(path)) {\n\t\t\t\t\t\treturn createDetectedNavigation(\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tnode.loc?.start.line ?? 0,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Object without static property (named route or dynamic path)\n\t\tconst line = node.loc?.start.line ?? 0\n\t\twarnings.push(\n\t\t\t`Object-based navigation at line ${line} cannot be statically analyzed. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t\t)\n\t\treturn null\n\t}\n\n\t// Non-object argument - add warning with actionable guidance\n\tconst line = node.loc?.start.line ?? 0\n\twarnings.push(\n\t\t`navigate() at line ${line} expects an object argument with a '${propertyName}' property (e.g., navigate({ ${propertyName}: '/path' })). Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t)\n\n\treturn null\n}\n\n/**\n * Extract path from array argument (Angular Router style)\n * e.g., router.navigate(['/users', userId]) -> extracts '/users'\n */\nfunction extractPathFromArrayArg(\n\t// biome-ignore lint/suspicious/noExplicitAny: Babel AST nodes have complex union types that are impractical to fully type\n\tnode: any,\n\ttype: DetectedNavigation[\"type\"],\n\twarnings: string[],\n): DetectedNavigation | null {\n\tconst firstArg = node.arguments?.[0]\n\n\tif (!firstArg) {\n\t\t// No argument provided\n\t\tconst line = node.loc?.start.line ?? 0\n\t\twarnings.push(\n\t\t\t`Navigation call at line ${line} has no arguments. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t\t)\n\t\treturn null\n\t}\n\n\t// Array expression: ['/path', ...]\n\tif (firstArg.type === \"ArrayExpression\") {\n\t\tif (firstArg.elements.length === 0) {\n\t\t\t// Empty array\n\t\t\tconst line = node.loc?.start.line ?? 0\n\t\t\twarnings.push(\n\t\t\t\t`Navigation call at line ${line} has an empty array. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t\t\t)\n\t\t\treturn null\n\t\t}\n\t\tconst firstElement = firstArg.elements[0]\n\n\t\t// String literal as first element\n\t\tif (firstElement?.type === \"StringLiteral\") {\n\t\t\tconst path = firstElement.value\n\t\t\tif (isValidInternalPath(path)) {\n\t\t\t\treturn createDetectedNavigation(path, type, node.loc?.start.line ?? 0)\n\t\t\t}\n\t\t}\n\n\t\t// Static template literal as first element\n\t\tif (\n\t\t\tfirstElement?.type === \"TemplateLiteral\" &&\n\t\t\tfirstElement.expressions.length === 0 &&\n\t\t\tfirstElement.quasis.length === 1\n\t\t) {\n\t\t\tconst path = firstElement.quasis[0].value.cooked\n\t\t\tif (path && isValidInternalPath(path)) {\n\t\t\t\treturn createDetectedNavigation(path, type, node.loc?.start.line ?? 0)\n\t\t\t}\n\t\t}\n\n\t\t// Dynamic first element\n\t\tconst line = node.loc?.start.line ?? 0\n\t\twarnings.push(\n\t\t\t`Dynamic navigation path at line ${line} cannot be statically analyzed. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t\t)\n\t\treturn null\n\t}\n\n\t// Non-array argument (dynamic)\n\tconst line = node.loc?.start.line ?? 0\n\twarnings.push(\n\t\t`Dynamic navigation path at line ${line} cannot be statically analyzed. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t)\n\treturn null\n}\n\n/**\n * Check if a path is a valid internal path (not external URL or hash link)\n */\nexport function isValidInternalPath(path: string): boolean {\n\t// Skip external URLs\n\tif (\n\t\tpath.startsWith(\"http://\") ||\n\t\tpath.startsWith(\"https://\") ||\n\t\tpath.startsWith(\"//\")\n\t) {\n\t\treturn false\n\t}\n\t// Skip hash-only links\n\tif (path.startsWith(\"#\")) {\n\t\treturn false\n\t}\n\t// Skip mailto and tel links\n\tif (path.startsWith(\"mailto:\") || path.startsWith(\"tel:\")) {\n\t\treturn false\n\t}\n\t// Must start with /\n\treturn path.startsWith(\"/\")\n}\n\n/**\n * Walk AST node recursively\n */\nfunction walkNode(\n\t// biome-ignore lint/suspicious/noExplicitAny: Babel AST nodes have complex union types that are impractical to fully type\n\tnode: any,\n\t// biome-ignore lint/suspicious/noExplicitAny: Babel AST nodes have complex union types that are impractical to fully type\n\tcallback: (node: any) => void,\n): void {\n\tif (!node || typeof node !== \"object\") return\n\n\tcallback(node)\n\n\tfor (const key of Object.keys(node)) {\n\t\tconst child = node[key]\n\t\tif (Array.isArray(child)) {\n\t\t\tfor (const item of child) {\n\t\t\t\twalkNode(item, callback)\n\t\t\t}\n\t\t} else if (child && typeof child === \"object\" && child.type) {\n\t\t\twalkNode(child, callback)\n\t\t}\n\t}\n}\n\n/**\n * Merge detected navigation targets with existing `next` array.\n * Removes duplicates and preserves manual entries.\n *\n * @param existing - Existing next array (may include manual entries)\n * @param detected - Newly detected navigation targets\n * @returns Merged array without duplicates\n */\nexport function mergeNext(\n\texisting: string[],\n\tdetected: DetectedNavigation[],\n): string[] {\n\tconst merged = new Set(existing)\n\n\tfor (const nav of detected) {\n\t\tmerged.add(nav.screenId)\n\t}\n\n\treturn Array.from(merged).sort()\n}\n\n/**\n * Detect navigation framework from file content.\n * Returns both the framework and whether it was explicitly detected.\n */\nexport function detectNavigationFramework(\n\tcontent: string,\n): FrameworkDetectionResult {\n\t// Check for Next.js patterns\n\tif (\n\t\tcontent.includes(\"next/link\") ||\n\t\tcontent.includes(\"next/navigation\") ||\n\t\tcontent.includes(\"next/router\")\n\t) {\n\t\treturn { framework: \"nextjs\", detected: true }\n\t}\n\n\t// Check for Vue Router patterns\n\tif (content.includes(\"vue-router\")) {\n\t\treturn { framework: \"vue-router\", detected: true }\n\t}\n\n\t// Check for Angular Router patterns\n\tif (content.includes(\"@angular/router\")) {\n\t\treturn { framework: \"angular\", detected: true }\n\t}\n\n\t// Check for Solid Router patterns\n\tif (content.includes(\"@solidjs/router\")) {\n\t\treturn { framework: \"solid-router\", detected: true }\n\t}\n\n\t// Check for TanStack Router patterns\n\tif (content.includes(\"@tanstack/react-router\")) {\n\t\treturn { framework: \"tanstack-router\", detected: true }\n\t}\n\n\t// Check for React Router patterns\n\tif (\n\t\tcontent.includes(\"react-router\") ||\n\t\tcontent.includes(\"@remix-run/react\")\n\t) {\n\t\treturn { framework: \"react-router\", detected: true }\n\t}\n\n\t// Check for useNavigate (React Router)\n\tif (content.includes(\"useNavigate\")) {\n\t\treturn { framework: \"react-router\", detected: true }\n\t}\n\n\t// Default to Next.js (more common in file-based routing projects)\n\treturn { framework: \"nextjs\", detected: false }\n}\n","import { readFileSync } from \"node:fs\"\nimport { dirname, resolve } from \"node:path\"\nimport { Parser } from \"htmlparser2\"\nimport {\n\tanalyzeNavigation,\n\ttype ComponentAnalysisResult,\n\tcreateDetectedNavigation,\n\ttype DetectedNavigation,\n\tdeduplicateByScreenId,\n\tisValidInternalPath,\n} from \"./navigationAnalyzer.js\"\n\n/**\n * Result of analyzing an Angular component for navigation.\n * Type alias for the shared ComponentAnalysisResult.\n */\nexport type AngularComponentAnalysisResult = ComponentAnalysisResult\n\n/**\n * Analyze an Angular component for navigation patterns.\n *\n * Detects:\n * - Template: `<a routerLink=\"/path\">`, `<a [routerLink]=\"'/path'\">`, `<a [routerLink]=\"['/path']\">`\n * - Script: `router.navigate(['/path'])`, `router.navigateByUrl('/path')`\n *\n * Results are deduplicated by screenId, keeping the first occurrence.\n *\n * @param content - The Angular component content to analyze\n * @param filePath - The file path (used for error messages and resolving templateUrl)\n * @param _cwd - The current working directory (unused, kept for API consistency with other analyzers)\n * @returns Analysis result with detected navigations and warnings\n *\n * @throws Never - All errors are caught and converted to warnings\n */\nexport function analyzeAngularComponent(\n\tcontent: string,\n\tfilePath: string,\n\t_cwd: string,\n): AngularComponentAnalysisResult {\n\tconst templateNavigations: DetectedNavigation[] = []\n\tconst scriptNavigations: DetectedNavigation[] = []\n\tconst warnings: string[] = []\n\n\ttry {\n\t\t// Extract template content from @Component decorator\n\t\tconst templateResult = extractTemplateContent(content, filePath)\n\n\t\tif (templateResult.warning) {\n\t\t\twarnings.push(templateResult.warning)\n\t\t}\n\n\t\tif (templateResult.content) {\n\t\t\tconst templateNavs = analyzeTemplateHTML(templateResult.content, warnings)\n\t\t\ttemplateNavigations.push(...templateNavs)\n\t\t}\n\n\t\t// Analyze script with existing navigation analyzer\n\t\tconst scriptResult = analyzeNavigation(content, \"angular\")\n\t\tscriptNavigations.push(...scriptResult.navigations)\n\t\twarnings.push(...scriptResult.warnings)\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\twarnings.push(`Syntax error in ${filePath}: ${error.message}`)\n\t\t} else if (error instanceof RangeError) {\n\t\t\twarnings.push(\n\t\t\t\t`${filePath}: File too complex for navigation analysis. Consider simplifying the component structure.`,\n\t\t\t)\n\t\t} else {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\twarnings.push(\n\t\t\t\t`${filePath}: Unexpected error during analysis: ${message}. Please report this as a bug.`,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn {\n\t\ttemplateNavigations: deduplicateByScreenId(templateNavigations),\n\t\tscriptNavigations: deduplicateByScreenId(scriptNavigations),\n\t\twarnings,\n\t}\n}\n\n/**\n * Result of template extraction.\n */\ninterface TemplateExtractionResult {\n\t/** The extracted template content, or null if not found */\n\tcontent: string | null\n\t/** Warning message if extraction failed */\n\twarning: string | null\n}\n\n/**\n * Extract template content from @Component decorator.\n *\n * Handles both inline `template` and external `templateUrl` properties.\n * Uses regex-based extraction for reliability with Angular's decorator syntax.\n *\n * Limitations:\n * - Does not handle templates containing unescaped backticks\n * - Does not handle escaped quotes within template strings\n * - Returns warning if templateUrl file cannot be read\n *\n * @param content - The component TypeScript content\n * @param filePath - The file path for resolving relative templateUrl\n * @returns Extraction result with content and optional warning\n */\nfunction extractTemplateContent(\n\tcontent: string,\n\tfilePath: string,\n): TemplateExtractionResult {\n\t// Try to extract inline template using regex\n\t// Pattern 1: template: `...` (template literal)\n\t// Note: This simple pattern does not handle templates containing backticks\n\tconst backtickPattern = /template\\s*:\\s*`([^`]*)`/\n\tconst templateLiteralMatch = content.match(backtickPattern)\n\tif (templateLiteralMatch?.[1] !== undefined) {\n\t\treturn { content: templateLiteralMatch[1], warning: null }\n\t}\n\n\t// Pattern 2: template: '...' (single-quoted string)\n\tconst singleQuoteMatch = content.match(/template\\s*:\\s*'([^']*)'/)\n\tif (singleQuoteMatch?.[1] !== undefined) {\n\t\treturn { content: singleQuoteMatch[1], warning: null }\n\t}\n\n\t// Pattern 3: template: \"...\" (double-quoted string)\n\tconst doubleQuoteMatch = content.match(/template\\s*:\\s*\"([^\"]*)\"/)\n\tif (doubleQuoteMatch?.[1] !== undefined) {\n\t\treturn { content: doubleQuoteMatch[1], warning: null }\n\t}\n\n\t// Pattern 4: templateUrl: '...' or templateUrl: \"...\" (external file)\n\tconst templateUrlMatch = content.match(/templateUrl\\s*:\\s*['\"]([^'\"]+)['\"]/)\n\tif (templateUrlMatch?.[1]) {\n\t\tconst templatePath = resolve(dirname(filePath), templateUrlMatch[1])\n\t\ttry {\n\t\t\treturn { content: readFileSync(templatePath, \"utf-8\"), warning: null }\n\t\t} catch (error) {\n\t\t\tconst errorCode = (error as NodeJS.ErrnoException).code\n\t\t\tlet warning: string\n\n\t\t\tif (errorCode === \"ENOENT\") {\n\t\t\t\twarning =\n\t\t\t\t\t`Template file not found: ${templatePath}. ` +\n\t\t\t\t\t\"Navigation in this template will not be detected. \" +\n\t\t\t\t\t\"Add navigation targets manually to the 'next' field in screen.meta.ts.\"\n\t\t\t} else if (errorCode === \"EACCES\") {\n\t\t\t\twarning =\n\t\t\t\t\t`Permission denied reading template: ${templatePath}. ` +\n\t\t\t\t\t\"Check file permissions to enable template analysis.\"\n\t\t\t} else {\n\t\t\t\tconst msg = error instanceof Error ? error.message : String(error)\n\t\t\t\twarning = `Failed to read template file ${templatePath}: ${msg}`\n\t\t\t}\n\n\t\t\treturn { content: null, warning }\n\t\t}\n\t}\n\n\treturn { content: null, warning: null }\n}\n\n/**\n * Analyze HTML template for routerLink directives.\n *\n * Note: Line numbers are approximate as htmlparser2 only tracks newlines in text nodes,\n * not in tags or attributes. Line numbers may drift from actual positions.\n *\n * @param html - The HTML template content\n * @param warnings - Array to collect warnings (mutated)\n * @returns Array of detected navigation targets\n */\nfunction analyzeTemplateHTML(\n\thtml: string,\n\twarnings: string[],\n): DetectedNavigation[] {\n\tconst navigations: DetectedNavigation[] = []\n\tlet currentLine = 1\n\tconst parserErrors: string[] = []\n\n\tconst parser = new Parser({\n\t\tonopentag(_name, attribs) {\n\t\t\t// Note: htmlparser2 lowercases attribute names\n\t\t\t// Check for static routerLink (becomes routerlink)\n\t\t\tif (\"routerlink\" in attribs) {\n\t\t\t\tconst value = attribs.routerlink\n\t\t\t\tif (value) {\n\t\t\t\t\tif (isValidInternalPath(value)) {\n\t\t\t\t\t\tnavigations.push(\n\t\t\t\t\t\t\tcreateDetectedNavigation(value, \"link\", currentLine),\n\t\t\t\t\t\t)\n\t\t\t\t\t} else if (!value.startsWith(\"/\") && !value.includes(\"://\")) {\n\t\t\t\t\t\t// Looks like a relative path - warn user\n\t\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t\t`routerLink at line ~${currentLine} has relative path \"${value}\". ` +\n\t\t\t\t\t\t\t\t\"Angular routerLink paths should start with '/' for absolute routing. \" +\n\t\t\t\t\t\t\t\t\"Navigation will not be detected for this link.\",\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\t// External URLs are intentionally skipped without warning\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check for property binding [routerLink] (becomes [routerlink])\n\t\t\tif (\"[routerlink]\" in attribs) {\n\t\t\t\tconst expression = attribs[\"[routerlink]\"]\n\t\t\t\tconst nav = extractRouterLinkPath(expression, currentLine, warnings)\n\t\t\t\tif (nav) {\n\t\t\t\t\tnavigations.push(nav)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tontext(text) {\n\t\t\t// Track approximate line numbers by counting newlines in text nodes.\n\t\t\t// Note: Line numbers may be approximate as newlines in tags/attributes are not counted.\n\t\t\tcurrentLine += (text.match(/\\n/g) || []).length\n\t\t},\n\t\tonerror(error) {\n\t\t\tparserErrors.push(\n\t\t\t\t`HTML parsing error at line ~${currentLine}: ${error.message}. ` +\n\t\t\t\t\t\"Some navigation targets may not be detected.\",\n\t\t\t)\n\t\t},\n\t})\n\n\tparser.write(html)\n\tparser.end()\n\n\t// Add any parser errors to warnings\n\twarnings.push(...parserErrors)\n\n\treturn navigations\n}\n\n/**\n * Extract path from [routerLink] binding expression.\n *\n * Handles:\n * - String literals: `[routerLink]=\"'/path'\"` or `[routerLink]='\"/path\"'`\n * - Array literals: `[routerLink]=\"['/path']\"` or `[routerLink]=\"['/path', param]\"`\n * - Warns on dynamic expressions: `[routerLink]=\"dynamicPath\"`\n *\n * Note: Does not handle escaped quotes (e.g., \\' or \\\"). This is acceptable\n * because Angular routerLink paths should not contain quotes.\n *\n * @param expression - The binding expression value\n * @param line - Line number for warning messages (approximate)\n * @param warnings - Array to collect warnings (mutated)\n * @returns Detected navigation or null if path cannot be extracted\n */\nfunction extractRouterLinkPath(\n\texpression: string,\n\tline: number,\n\twarnings: string[],\n): DetectedNavigation | null {\n\tif (!expression) {\n\t\twarnings.push(\n\t\t\t`Empty [routerLink] binding at line ~${line}. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t\t)\n\t\treturn null\n\t}\n\n\tconst trimmed = expression.trim()\n\n\t// Check for string literal: '/path' or \"/path\"\n\tif (\n\t\t(trimmed.startsWith(\"'\") && trimmed.endsWith(\"'\")) ||\n\t\t(trimmed.startsWith('\"') && trimmed.endsWith('\"'))\n\t) {\n\t\tconst path = trimmed.slice(1, -1)\n\t\tif (isValidInternalPath(path)) {\n\t\t\treturn createDetectedNavigation(path, \"link\", line)\n\t\t}\n\t\tif (!path.startsWith(\"/\") && !path.includes(\"://\")) {\n\t\t\twarnings.push(\n\t\t\t\t`[routerLink] at line ~${line} has relative path \"${path}\". ` +\n\t\t\t\t\t\"Angular routerLink paths should start with '/' for absolute routing. \" +\n\t\t\t\t\t\"Navigation will not be detected for this link.\",\n\t\t\t)\n\t\t}\n\t\treturn null\n\t}\n\n\t// Check for array literal: ['/path'] or ['/path', param]\n\tif (trimmed.startsWith(\"[\") && trimmed.endsWith(\"]\")) {\n\t\tconst arrayContent = trimmed.slice(1, -1).trim()\n\n\t\t// Find the first element (path) - handle comma separation\n\t\tconst firstComma = findFirstCommaOutsideQuotes(arrayContent)\n\t\tconst firstElement =\n\t\t\tfirstComma >= 0\n\t\t\t\t? arrayContent.slice(0, firstComma).trim()\n\t\t\t\t: arrayContent.trim()\n\n\t\t// Check if first element is a string literal\n\t\tif (\n\t\t\t(firstElement.startsWith(\"'\") && firstElement.endsWith(\"'\")) ||\n\t\t\t(firstElement.startsWith('\"') && firstElement.endsWith('\"'))\n\t\t) {\n\t\t\tconst path = firstElement.slice(1, -1)\n\t\t\tif (isValidInternalPath(path)) {\n\t\t\t\treturn createDetectedNavigation(path, \"link\", line)\n\t\t\t}\n\t\t\tif (!path.startsWith(\"/\") && !path.includes(\"://\")) {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`[routerLink] at line ~${line} has relative path \"${path}\". ` +\n\t\t\t\t\t\t\"Angular routerLink paths should start with '/' for absolute routing. \" +\n\t\t\t\t\t\t\"Navigation will not be detected for this link.\",\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n\n\t// Dynamic expression - cannot be statically analyzed\n\twarnings.push(\n\t\t`Dynamic [routerLink] binding at line ~${line} cannot be statically analyzed. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t)\n\treturn null\n}\n\n/**\n * Find the index of the first comma outside of quotes.\n *\n * Note: Does not handle escaped quotes (e.g., \\' or \\\"). This is acceptable\n * because Angular routerLink paths should not contain quotes.\n *\n * @param str - The string to search\n * @returns Index of first comma, or -1 if not found\n */\nfunction findFirstCommaOutsideQuotes(str: string): number {\n\tlet inSingleQuote = false\n\tlet inDoubleQuote = false\n\n\tfor (let i = 0; i < str.length; i++) {\n\t\tconst char = str[i]\n\n\t\tif (char === \"'\" && !inDoubleQuote) {\n\t\t\tinSingleQuote = !inSingleQuote\n\t\t} else if (char === '\"' && !inSingleQuote) {\n\t\t\tinDoubleQuote = !inDoubleQuote\n\t\t} else if (char === \",\" && !inSingleQuote && !inDoubleQuote) {\n\t\t\treturn i\n\t\t}\n\t}\n\n\treturn -1\n}\n","import { parse } from \"@babel/parser\"\nimport type { ApiIntegrationConfig } from \"@screenbook/core\"\n\n/**\n * Detected API import from a source file\n */\nexport interface DetectedApiImport {\n\t/** The imported name (function, hook, or type) */\n\timportName: string\n\t/** The source package */\n\tpackageName: string\n\t/** Transformed name for dependsOn field (packageName/importName or custom) */\n\tdependsOnName: string\n\t/** Line number of the import */\n\tline: number\n}\n\n/**\n * Result of analyzing a file for API imports\n */\nexport interface ApiAnalysisResult {\n\t/** Detected API imports */\n\timports: DetectedApiImport[]\n\t/** Any warnings during analysis */\n\twarnings: string[]\n}\n\n/**\n * Analyze a file's content for API client imports.\n *\n * Supports:\n * - Named imports: `import { getUsers, createUser } from \"@api/client\"`\n * - Default imports: `import api from \"@api/client\"` (with warning)\n * - Namespace imports: `import * as api from \"@api/client\"` (with warning)\n *\n * @param content - The file content to analyze\n * @param config - API integration configuration\n * @returns Analysis result with detected imports and warnings\n */\nexport function analyzeApiImports(\n\tcontent: string,\n\tconfig: ApiIntegrationConfig,\n): ApiAnalysisResult {\n\tconst imports: DetectedApiImport[] = []\n\tconst warnings: string[] = []\n\n\t// Parse with Babel\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", \"jsx\"],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\twarnings.push(`Syntax error during import analysis: ${error.message}`)\n\t\t\treturn { imports, warnings }\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\twarnings.push(`Failed to parse file for import analysis: ${message}`)\n\t\treturn { imports, warnings }\n\t}\n\n\t// Normalize client packages for matching\n\tconst clientPackages = new Set(config.clientPackages)\n\n\t// Find import declarations\n\tfor (const node of ast.program.body) {\n\t\tif (node.type !== \"ImportDeclaration\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tconst source = node.source.value\n\t\tconst line = node.loc?.start.line ?? 0\n\n\t\t// Check if this import is from a configured client package\n\t\tif (!isMatchingPackage(source, clientPackages)) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Skip type-only imports\n\t\tif (node.importKind === \"type\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor (const specifier of node.specifiers) {\n\t\t\t// Skip type-only specifiers within a regular import\n\t\t\tif (\n\t\t\t\tspecifier.type === \"ImportSpecifier\" &&\n\t\t\t\tspecifier.importKind === \"type\"\n\t\t\t) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif (specifier.type === \"ImportSpecifier\") {\n\t\t\t\t// Named import: import { getUsers } from \"@api/client\"\n\t\t\t\tconst importedName =\n\t\t\t\t\tspecifier.imported.type === \"Identifier\"\n\t\t\t\t\t\t? specifier.imported.name\n\t\t\t\t\t\t: specifier.imported.value\n\n\t\t\t\tconst transformedName = config.extractApiName\n\t\t\t\t\t? config.extractApiName(importedName)\n\t\t\t\t\t: importedName\n\n\t\t\t\timports.push({\n\t\t\t\t\timportName: importedName,\n\t\t\t\t\tpackageName: source,\n\t\t\t\t\tdependsOnName: `${source}/${transformedName}`,\n\t\t\t\t\tline,\n\t\t\t\t})\n\t\t\t} else if (specifier.type === \"ImportDefaultSpecifier\") {\n\t\t\t\t// Default import: import api from \"@api/client\"\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Default import from \"${source}\" at line ${line} cannot be statically analyzed. Consider using named imports.`,\n\t\t\t\t)\n\t\t\t} else if (specifier.type === \"ImportNamespaceSpecifier\") {\n\t\t\t\t// Namespace import: import * as api from \"@api/client\"\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Namespace import from \"${source}\" at line ${line} cannot be statically analyzed. Consider using named imports.`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { imports, warnings }\n}\n\n/**\n * Check if a source path matches any of the configured client packages.\n * Supports exact match and path prefix matching.\n */\nfunction isMatchingPackage(\n\tsource: string,\n\tclientPackages: Set<string>,\n): boolean {\n\t// Exact match\n\tif (clientPackages.has(source)) {\n\t\treturn true\n\t}\n\n\t// Check if source starts with any client package (for subpath imports)\n\t// e.g., \"@api/client\" should match \"@api/client/users\"\n\tfor (const pkg of clientPackages) {\n\t\tif (source.startsWith(`${pkg}/`)) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n/**\n * Merge detected API dependencies with existing ones.\n * Removes duplicates and preserves manual entries.\n *\n * @param existing - Existing dependsOn array (may include manual entries)\n * @param detected - Newly detected API dependencies\n * @returns Merged array without duplicates\n */\nexport function mergeDependsOn(\n\texisting: string[],\n\tdetected: DetectedApiImport[],\n): string[] {\n\tconst merged = new Set(existing)\n\n\tfor (const dep of detected) {\n\t\tmerged.add(dep.dependsOnName)\n\t}\n\n\treturn Array.from(merged).sort()\n}\n","import { readFileSync } from \"node:fs\"\nimport { dirname, resolve } from \"node:path\"\nimport { parse } from \"@babel/parser\"\nimport {\n\ttype ParsedRoute,\n\ttype ParseResult,\n\tresolveImportPath,\n} from \"./routeParserUtils.js\"\n\n// Re-export shared types\nexport type { ParsedRoute, ParseResult }\n\n/**\n * Parse Solid Router configuration file and extract routes.\n * Supports various export patterns including `export const routes`, `export default`,\n * and TypeScript's `satisfies` operator.\n *\n * @param filePath - Path to the router configuration file\n * @param preloadedContent - Optional pre-read file content to avoid duplicate file reads\n * @returns ParseResult containing extracted routes and any warnings\n * @throws Error if the file cannot be read or contains syntax errors\n */\nexport function parseSolidRouterConfig(\n\tfilePath: string,\n\tpreloadedContent?: string,\n): ParseResult {\n\tconst absolutePath = resolve(filePath)\n\tconst routesFileDir = dirname(absolutePath)\n\tconst warnings: string[] = []\n\n\t// Read file with proper error handling (skip if content is preloaded)\n\tlet content: string\n\tif (preloadedContent !== undefined) {\n\t\tcontent = preloadedContent\n\t} else {\n\t\ttry {\n\t\t\tcontent = readFileSync(absolutePath, \"utf-8\")\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to read routes file \"${absolutePath}\": ${message}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Parse with Babel - wrap for better error messages\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", \"jsx\"],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Syntax error in routes file \"${absolutePath}\": ${error.message}`,\n\t\t\t)\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tthrow new Error(`Failed to parse routes file \"${absolutePath}\": ${message}`)\n\t}\n\n\tconst routes: ParsedRoute[] = []\n\n\t// Find routes array in the AST\n\tfor (const node of ast.program.body) {\n\t\t// Handle: const routes = [...]\n\t\tif (node.type === \"VariableDeclaration\") {\n\t\t\tfor (const decl of node.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export const routes = [...]\n\t\tif (\n\t\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t\t) {\n\t\t\tfor (const decl of node.declaration.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export default [...]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(node.declaration, routesFileDir, warnings)\n\t\t\troutes.push(...parsed)\n\t\t}\n\n\t\t// Handle: export default [...] satisfies RouteDefinition[]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"TSSatisfiesExpression\" &&\n\t\t\tnode.declaration.expression.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(\n\t\t\t\tnode.declaration.expression,\n\t\t\t\troutesFileDir,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t\troutes.push(...parsed)\n\t\t}\n\t}\n\n\t// Warn if no routes were found\n\tif (routes.length === 0) {\n\t\twarnings.push(\n\t\t\t\"No routes found. Supported patterns: 'export const routes = [...]' or 'export default [...]'\",\n\t\t)\n\t}\n\n\treturn { routes, warnings }\n}\n\n/**\n * Parse an array expression containing route objects\n */\nfunction parseRoutesArray(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tarrayNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const element of arrayNode.elements) {\n\t\tif (!element) continue\n\n\t\t// Handle spread elements\n\t\tif (element.type === \"SpreadElement\") {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Spread operator detected${loc}. Routes from spread cannot be statically analyzed.`,\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\n\t\tif (element.type === \"ObjectExpression\") {\n\t\t\tconst parsedRoutes = parseRouteObject(element, baseDir, warnings)\n\t\t\troutes.push(...parsedRoutes)\n\t\t} else {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Non-object route element (${element.type})${loc}. Only object literals can be statically analyzed.`,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Parse a single route object expression\n * Returns array to handle multiple paths case: path: [\"/a\", \"/b\"]\n */\nfunction parseRouteObject(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tobjectNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tlet paths: string[] = []\n\tlet component: string | undefined\n\tlet children: ParsedRoute[] | undefined\n\tlet hasPath = false\n\n\tfor (const prop of objectNode.properties) {\n\t\tif (prop.type !== \"ObjectProperty\") continue\n\t\tif (prop.key.type !== \"Identifier\") continue\n\n\t\tconst key = prop.key.name\n\n\t\tswitch (key) {\n\t\t\tcase \"path\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\tpaths = [prop.value.value]\n\t\t\t\t\thasPath = true\n\t\t\t\t} else if (prop.value.type === \"ArrayExpression\") {\n\t\t\t\t\t// Solid Router supports path arrays: path: [\"/login\", \"/register\"]\n\t\t\t\t\tconst arrayElementCount = prop.value.elements.filter(Boolean).length\n\t\t\t\t\tpaths = extractPathArray(prop.value, warnings)\n\t\t\t\t\thasPath = paths.length > 0\n\t\t\t\t\t// Warn if path array had elements but none were extractable\n\t\t\t\t\tif (arrayElementCount > 0 && paths.length === 0) {\n\t\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t\t`Path array contains only dynamic values${loc}. No static paths could be extracted.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t`Dynamic path value (${prop.value.type})${loc}. Only string literal paths can be statically analyzed.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"component\":\n\t\t\t\tcomponent = extractComponent(prop.value, baseDir, warnings)\n\t\t\t\tbreak\n\n\t\t\tcase \"children\":\n\t\t\t\tif (prop.value.type === \"ArrayExpression\") {\n\t\t\t\t\tchildren = parseRoutesArray(prop.value, baseDir, warnings)\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\t// preload and matchFilters are ignored (not relevant for screen detection)\n\t\t}\n\t}\n\n\t// Skip routes without path (abstract layout wrappers)\n\tif (!hasPath) {\n\t\t// If it has children, process them with empty parent path contribution\n\t\tif (children && children.length > 0) {\n\t\t\treturn [{ path: \"\", component, children }]\n\t\t}\n\t\treturn []\n\t}\n\n\t// Create routes for each path (handles path arrays)\n\treturn paths.map((path) => ({\n\t\tpath,\n\t\tcomponent,\n\t\tchildren,\n\t}))\n}\n\n/**\n * Extract paths from array expression\n * path: [\"/login\", \"/register\"] -> [\"/login\", \"/register\"]\n */\nfunction extractPathArray(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tarrayNode: any,\n\twarnings: string[],\n): string[] {\n\tconst paths: string[] = []\n\n\tfor (const element of arrayNode.elements) {\n\t\tif (!element) continue\n\n\t\tif (element.type === \"StringLiteral\") {\n\t\t\tpaths.push(element.value)\n\t\t} else {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Non-string path in array (${element.type})${loc}. Only string literal paths can be analyzed.`,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn paths\n}\n\n/**\n * Extract component from various patterns\n * - Direct identifier: component: Home\n * - Lazy component: component: lazy(() => import(\"./Home\"))\n */\nfunction extractComponent(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Direct component reference: component: Home\n\tif (node.type === \"Identifier\") {\n\t\treturn node.name\n\t}\n\n\t// Lazy component: component: lazy(() => import(\"./path\"))\n\tif (node.type === \"CallExpression\") {\n\t\tconst callee = node.callee\n\t\tif (callee.type === \"Identifier\" && callee.name === \"lazy\") {\n\t\t\tconst lazyArg = node.arguments[0]\n\t\t\tif (lazyArg) {\n\t\t\t\treturn extractLazyImportPath(lazyArg, baseDir, warnings)\n\t\t\t}\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`lazy() called without arguments${loc}. Expected arrow function with import().`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// Other call expressions not supported - add warning\n\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\tconst calleeName = callee.type === \"Identifier\" ? callee.name : \"unknown\"\n\t\twarnings.push(\n\t\t\t`Unrecognized component pattern: ${calleeName}(...)${loc}. Only 'lazy(() => import(...))' is supported.`,\n\t\t)\n\t\treturn undefined\n\t}\n\n\t// Arrow function component: component: () => <Home />\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tif (node.body.type === \"JSXElement\") {\n\t\t\tconst openingElement = node.body.openingElement\n\t\t\tif (openingElement?.name?.type === \"JSXIdentifier\") {\n\t\t\t\treturn openingElement.name.name\n\t\t\t}\n\t\t\t// JSXMemberExpression (namespaced components like <UI.Button />)\n\t\t\tif (openingElement?.name?.type === \"JSXMemberExpression\") {\n\t\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Namespaced JSX component (e.g., <UI.Button />)${loc}. Component extraction not supported for member expressions. Consider using a direct component reference or create a wrapper component.`,\n\t\t\t\t)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t}\n\t\t// Block body arrow functions\n\t\tif (node.body.type === \"BlockStatement\") {\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Arrow function with block body${loc}. Only concise arrow functions returning JSX directly can be analyzed.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// JSX Fragments\n\t\tif (node.body.type === \"JSXFragment\") {\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`JSX Fragment detected${loc}. Cannot extract component name from fragments.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// Conditional expressions\n\t\tif (node.body.type === \"ConditionalExpression\") {\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\t// Try to extract component names from both branches for context\n\t\t\tlet componentInfo = \"\"\n\t\t\tconst consequent = node.body.consequent\n\t\t\tconst alternate = node.body.alternate\n\t\t\tif (\n\t\t\t\tconsequent?.type === \"JSXElement\" &&\n\t\t\t\talternate?.type === \"JSXElement\"\n\t\t\t) {\n\t\t\t\tconst consName = consequent.openingElement?.name?.name || \"unknown\"\n\t\t\t\tconst altName = alternate.openingElement?.name?.name || \"unknown\"\n\t\t\t\tcomponentInfo = ` (${consName} or ${altName})`\n\t\t\t}\n\t\t\twarnings.push(\n\t\t\t\t`Conditional component${componentInfo}${loc}. Only static JSX elements can be analyzed. Consider extracting to a separate component.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// Unrecognized arrow function body\n\t\tconst arrowLoc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\twarnings.push(\n\t\t\t`Unrecognized arrow function body (${node.body.type})${arrowLoc}. Component will not be extracted.`,\n\t\t)\n\t\treturn undefined\n\t}\n\n\t// Catch-all for unrecognized component patterns\n\tif (node) {\n\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\twarnings.push(\n\t\t\t`Unrecognized component pattern (${node.type})${loc}. Component will not be extracted.`,\n\t\t)\n\t}\n\treturn undefined\n}\n\n/**\n * Extract import path from lazy function argument\n * () => import(\"./pages/Dashboard\") -> resolved path\n */\nfunction extractLazyImportPath(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Arrow function: () => import('./path')\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\tif (body.type === \"CallExpression\" && body.callee.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t\t// Dynamic import argument\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Lazy import with dynamic path${loc}. Only string literal imports can be analyzed.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\t// Unrecognized lazy pattern\n\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\twarnings.push(\n\t\t`Unrecognized lazy pattern (${node.type})${loc}. Expected arrow function with import().`,\n\t)\n\treturn undefined\n}\n\n/**\n * Detect if content is Solid Router based on patterns.\n * Note: Called by detectRouterType() in reactRouterParser.ts before React Router detection\n * because Solid Router and React Router share similar syntax patterns (both use `path` and `component`).\n * The detection order matters: TanStack Router -> Solid Router -> Angular Router -> React Router -> Vue Router.\n */\nexport function isSolidRouterContent(content: string): boolean {\n\t// Check for Solid Router specific import\n\tif (content.includes(\"@solidjs/router\")) {\n\t\treturn true\n\t}\n\n\t// Check for old package name\n\tif (content.includes(\"solid-app-router\")) {\n\t\treturn true\n\t}\n\n\t// Check for Solid.js lazy with route pattern\n\t// This is a weaker check, so we need to be more specific\n\tif (\n\t\tcontent.includes(\"solid-js\") &&\n\t\t/\\blazy\\s*\\(/.test(content) &&\n\t\t/\\bcomponent\\s*:/.test(content) &&\n\t\t/\\bpath\\s*:/.test(content)\n\t) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n","import { readFileSync } from \"node:fs\"\nimport { dirname, resolve } from \"node:path\"\nimport { parse } from \"@babel/parser\"\nimport {\n\ttype ParsedRoute,\n\ttype ParseResult,\n\tresolveImportPath,\n} from \"./routeParserUtils.js\"\n\n// Re-export shared types\nexport type { ParsedRoute, ParseResult }\n\n/**\n * Internal route definition collected from createRoute/createRootRoute calls\n */\ninterface RouteDefinition {\n\tvariableName: string\n\tpath?: string\n\tcomponent?: string\n\tparentVariableName?: string\n\tisRoot: boolean\n\tchildren?: string[] // Variable names of child routes from addChildren\n}\n\n/**\n * Parse TanStack Router configuration file and extract routes\n */\nexport function parseTanStackRouterConfig(\n\tfilePath: string,\n\tpreloadedContent?: string,\n): ParseResult {\n\tconst absolutePath = resolve(filePath)\n\tconst routesFileDir = dirname(absolutePath)\n\tconst warnings: string[] = []\n\n\t// Read file with proper error handling (skip if content is preloaded)\n\tlet content: string\n\tif (preloadedContent !== undefined) {\n\t\tcontent = preloadedContent\n\t} else {\n\t\ttry {\n\t\t\tcontent = readFileSync(absolutePath, \"utf-8\")\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to read routes file \"${absolutePath}\": ${message}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Parse with Babel - wrap for better error messages\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", \"jsx\"],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Syntax error in routes file \"${absolutePath}\": ${error.message}`,\n\t\t\t)\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tthrow new Error(`Failed to parse routes file \"${absolutePath}\": ${message}`)\n\t}\n\n\t// Collect all route definitions from the AST\n\tconst routeMap = new Map<string, RouteDefinition>()\n\n\t// Two-pass AST processing is required because TanStack Router uses a function-based API\n\t// where routes are defined as variables and then composed using .addChildren().\n\t// Pass 1 must collect all route definitions first, so Pass 2 can resolve variable references.\n\n\t// First pass: collect all createRoute/createRootRoute calls\n\tfor (const node of ast.program.body) {\n\t\tcollectRouteDefinitions(node, routeMap, routesFileDir, warnings)\n\t}\n\n\t// Second pass: process addChildren calls to build parent-child relationships\n\tfor (const node of ast.program.body) {\n\t\tprocessAddChildrenCalls(node, routeMap, warnings)\n\t}\n\n\t// Build the route tree from collected definitions\n\tconst routes = buildRouteTree(routeMap, warnings)\n\n\t// Warn if no routes were found\n\tif (routes.length === 0) {\n\t\twarnings.push(\n\t\t\t\"No routes found. Supported patterns: 'createRootRoute()', 'createRoute()', and '.addChildren([...])'\",\n\t\t)\n\t}\n\n\treturn { routes, warnings }\n}\n\n/**\n * Collect route definitions from AST nodes\n */\nfunction collectRouteDefinitions(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\trouteMap: Map<string, RouteDefinition>,\n\tbaseDir: string,\n\twarnings: string[],\n): void {\n\t// Handle: const xxxRoute = createRoute({ ... }) or createRootRoute({ ... })\n\tif (node.type === \"VariableDeclaration\") {\n\t\tfor (const decl of node.declarations) {\n\t\t\tif (decl.id.type !== \"Identifier\") continue\n\n\t\t\tconst variableName = decl.id.name\n\n\t\t\t// Handle direct createRoute/createRootRoute call\n\t\t\tif (decl.init?.type === \"CallExpression\") {\n\t\t\t\tconst routeDef = extractRouteFromCallExpression(\n\t\t\t\t\tdecl.init,\n\t\t\t\t\tvariableName,\n\t\t\t\t\tbaseDir,\n\t\t\t\t\twarnings,\n\t\t\t\t)\n\t\t\t\tif (routeDef) {\n\t\t\t\t\trouteMap.set(variableName, routeDef)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle createRoute(...).lazy(...) pattern\n\t\t\tif (\n\t\t\t\tdecl.init?.type === \"CallExpression\" &&\n\t\t\t\tdecl.init.callee?.type === \"MemberExpression\" &&\n\t\t\t\tdecl.init.callee.property?.type === \"Identifier\" &&\n\t\t\t\tdecl.init.callee.property.name === \"lazy\"\n\t\t\t) {\n\t\t\t\t// The createRoute call is in callee.object\n\t\t\t\tconst createRouteCall = decl.init.callee.object\n\t\t\t\tif (createRouteCall?.type === \"CallExpression\") {\n\t\t\t\t\tconst routeDef = extractRouteFromCallExpression(\n\t\t\t\t\t\tcreateRouteCall,\n\t\t\t\t\t\tvariableName,\n\t\t\t\t\t\tbaseDir,\n\t\t\t\t\t\twarnings,\n\t\t\t\t\t)\n\t\t\t\t\tif (routeDef) {\n\t\t\t\t\t\t// Extract lazy import path\n\t\t\t\t\t\tconst lazyArg = decl.init.arguments[0]\n\t\t\t\t\t\tif (lazyArg) {\n\t\t\t\t\t\t\tconst lazyPath = extractLazyImportPath(lazyArg, baseDir, warnings)\n\t\t\t\t\t\t\tif (lazyPath) {\n\t\t\t\t\t\t\t\trouteDef.component = lazyPath\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trouteMap.set(variableName, routeDef)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Handle: export const xxxRoute = createRoute({ ... })\n\tif (\n\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t) {\n\t\tfor (const decl of node.declaration.declarations) {\n\t\t\tif (decl.id.type !== \"Identifier\") continue\n\n\t\t\tconst variableName = decl.id.name\n\n\t\t\tif (decl.init?.type === \"CallExpression\") {\n\t\t\t\tconst routeDef = extractRouteFromCallExpression(\n\t\t\t\t\tdecl.init,\n\t\t\t\t\tvariableName,\n\t\t\t\t\tbaseDir,\n\t\t\t\t\twarnings,\n\t\t\t\t)\n\t\t\t\tif (routeDef) {\n\t\t\t\t\trouteMap.set(variableName, routeDef)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Extract route definition from a CallExpression (createRoute or createRootRoute)\n */\nfunction extractRouteFromCallExpression(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tcallNode: any,\n\tvariableName: string,\n\tbaseDir: string,\n\twarnings: string[],\n): RouteDefinition | null {\n\tconst callee = callNode.callee\n\n\t// Check if it's createRoute or createRootRoute\n\tlet isRoot = false\n\tlet optionsArg = callNode.arguments[0]\n\n\tif (callee.type === \"Identifier\") {\n\t\tif (callee.name === \"createRootRoute\") {\n\t\t\tisRoot = true\n\t\t} else if (callee.name === \"createRootRouteWithContext\") {\n\t\t\tisRoot = true\n\t\t} else if (callee.name !== \"createRoute\") {\n\t\t\treturn null\n\t\t}\n\t} else if (callee.type === \"CallExpression\") {\n\t\t// Handle curried form: createRootRouteWithContext<T>()({...})\n\t\tconst innerCallee = callee.callee\n\t\tif (\n\t\t\tinnerCallee?.type === \"Identifier\" &&\n\t\t\tinnerCallee.name === \"createRootRouteWithContext\"\n\t\t) {\n\t\t\tisRoot = true\n\t\t\t// Options are in the outer call's arguments\n\t\t\toptionsArg = callNode.arguments[0]\n\t\t} else {\n\t\t\treturn null\n\t\t}\n\t} else {\n\t\treturn null\n\t}\n\n\tconst routeDef: RouteDefinition = {\n\t\tvariableName,\n\t\tisRoot,\n\t}\n\tif (optionsArg?.type === \"ObjectExpression\") {\n\t\tfor (const prop of optionsArg.properties) {\n\t\t\tif (prop.type !== \"ObjectProperty\") continue\n\t\t\tif (prop.key.type !== \"Identifier\") continue\n\n\t\t\tconst key = prop.key.name\n\n\t\t\tswitch (key) {\n\t\t\t\tcase \"path\":\n\t\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\t\t// Normalize TanStack Router path: $param -> :param\n\t\t\t\t\t\trouteDef.path = normalizeTanStackPath(prop.value.value)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t\t`Dynamic path value (${prop.value.type})${loc}. Only string literal paths can be statically analyzed.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"component\":\n\t\t\t\t\trouteDef.component = extractComponentValue(\n\t\t\t\t\t\tprop.value,\n\t\t\t\t\t\tbaseDir,\n\t\t\t\t\t\twarnings,\n\t\t\t\t\t)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"getParentRoute\":\n\t\t\t\t\t// Extract parent route variable name from arrow function\n\t\t\t\t\tif (prop.value.type === \"ArrowFunctionExpression\") {\n\t\t\t\t\t\tconst body = prop.value.body\n\t\t\t\t\t\tif (body.type === \"Identifier\") {\n\t\t\t\t\t\t\trouteDef.parentVariableName = body.name\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t\t\t`Dynamic getParentRoute${loc}. Only static route references can be analyzed.`,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn routeDef\n}\n\n/**\n * Extract component value from different patterns\n * Returns undefined with a warning for unrecognized patterns\n */\nfunction extractComponentValue(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Direct component reference: component: Home\n\tif (node.type === \"Identifier\") {\n\t\treturn node.name\n\t}\n\n\t// lazyRouteComponent(() => import('./path'))\n\tif (node.type === \"CallExpression\") {\n\t\tconst callee = node.callee\n\t\tif (callee.type === \"Identifier\" && callee.name === \"lazyRouteComponent\") {\n\t\t\tconst importArg = node.arguments[0]\n\t\t\tif (importArg) {\n\t\t\t\treturn extractLazyImportPath(importArg, baseDir, warnings)\n\t\t\t}\n\t\t\t// lazyRouteComponent called without arguments\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`lazyRouteComponent called without arguments${loc}. Expected arrow function with import().`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// Other call expressions are not supported\n\t\treturn undefined\n\t}\n\n\t// Arrow function component: component: () => <Home />\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\t// Check if body is JSX\n\t\tif (node.body.type === \"JSXElement\") {\n\t\t\tconst openingElement = node.body.openingElement\n\t\t\tif (openingElement?.name?.type === \"JSXIdentifier\") {\n\t\t\t\treturn openingElement.name.name\n\t\t\t}\n\t\t\t// Handle JSXMemberExpression like <Namespace.Component />\n\t\t\tif (openingElement?.name?.type === \"JSXMemberExpression\") {\n\t\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Namespaced JSX component${loc}. Component extraction not fully supported for member expressions.`,\n\t\t\t\t)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t}\n\t\t// Block body arrow functions: () => { return <Home /> }\n\t\tif (node.body.type === \"BlockStatement\") {\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Arrow function with block body${loc}. Only concise arrow functions returning JSX directly can be analyzed.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t\t// JSX Fragment: () => <>...</>\n\t\tif (node.body.type === \"JSXFragment\") {\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`JSX Fragment detected${loc}. Cannot extract component name from fragments.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\treturn undefined\n}\n\n/**\n * Extract import path from lazy function patterns\n */\nfunction extractLazyImportPath(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Arrow function: () => import('./path')\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\t// Direct import: () => import('./path')\n\t\tif (body.type === \"CallExpression\" && body.callee.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t}\n\n\t\t// Chained: () => import('./path').then(d => d.Route)\n\t\tif (\n\t\t\tbody.type === \"CallExpression\" &&\n\t\t\tbody.callee.type === \"MemberExpression\" &&\n\t\t\tbody.callee.object?.type === \"CallExpression\" &&\n\t\t\tbody.callee.object.callee?.type === \"Import\"\n\t\t) {\n\t\t\tconst importCall = body.callee.object\n\t\t\tif (importCall.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(importCall.arguments[0].value, baseDir)\n\t\t\t}\n\t\t}\n\t}\n\n\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\twarnings.push(\n\t\t`Unrecognized lazy pattern (${node.type})${loc}. Expected arrow function with import().`,\n\t)\n\treturn undefined\n}\n\n/**\n * Process addChildren calls to establish parent-child relationships\n */\nfunction processAddChildrenCalls(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\trouteMap: Map<string, RouteDefinition>,\n\twarnings: string[],\n): void {\n\t// Handle: const routeTree = rootRoute.addChildren([...])\n\t// or: const routeTree = rootRoute.addChildren([indexRoute, aboutRoute.addChildren([...])])\n\tif (node.type === \"VariableDeclaration\") {\n\t\tfor (const decl of node.declarations) {\n\t\t\tprocessAddChildrenExpression(decl.init, routeMap, warnings)\n\t\t}\n\t}\n\n\t// Handle: export const routeTree = rootRoute.addChildren([...])\n\tif (\n\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t) {\n\t\tfor (const decl of node.declaration.declarations) {\n\t\t\tprocessAddChildrenExpression(decl.init, routeMap, warnings)\n\t\t}\n\t}\n}\n\n/**\n * Recursively process addChildren expressions\n */\nfunction processAddChildrenExpression(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\texpr: any,\n\trouteMap: Map<string, RouteDefinition>,\n\twarnings: string[],\n): string | undefined {\n\tif (!expr) return undefined\n\n\t// Handle: parentRoute.addChildren([...])\n\tif (\n\t\texpr.type === \"CallExpression\" &&\n\t\texpr.callee?.type === \"MemberExpression\" &&\n\t\texpr.callee.property?.type === \"Identifier\" &&\n\t\texpr.callee.property.name === \"addChildren\"\n\t) {\n\t\t// Get parent route variable name\n\t\tlet parentVarName: string | undefined\n\t\tif (expr.callee.object?.type === \"Identifier\") {\n\t\t\tparentVarName = expr.callee.object.name\n\t\t} else if (expr.callee.object?.type === \"CallExpression\") {\n\t\t\t// Nested addChildren: parentRoute.addChildren([...]).addChildren([...])\n\t\t\t// This is rare but handle recursively\n\t\t\tparentVarName = processAddChildrenExpression(\n\t\t\t\texpr.callee.object,\n\t\t\t\trouteMap,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t}\n\n\t\tif (!parentVarName) return undefined\n\n\t\tconst parentDef = routeMap.get(parentVarName)\n\t\tif (!parentDef) {\n\t\t\tconst loc = expr.loc ? ` at line ${expr.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Parent route \"${parentVarName}\" not found${loc}. Ensure it's defined with createRoute/createRootRoute.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\n\t\t// Process children array\n\t\tconst childrenArg = expr.arguments[0]\n\t\tif (childrenArg?.type === \"ArrayExpression\") {\n\t\t\tconst childNames: string[] = []\n\n\t\t\tfor (const element of childrenArg.elements) {\n\t\t\t\tif (!element) continue\n\n\t\t\t\t// Direct reference: indexRoute\n\t\t\t\tif (element.type === \"Identifier\") {\n\t\t\t\t\tchildNames.push(element.name)\n\t\t\t\t}\n\t\t\t\t// Nested addChildren: aboutRoute.addChildren([...])\n\t\t\t\telse if (element.type === \"CallExpression\") {\n\t\t\t\t\tconst nestedParent = processAddChildrenExpression(\n\t\t\t\t\t\telement,\n\t\t\t\t\t\trouteMap,\n\t\t\t\t\t\twarnings,\n\t\t\t\t\t)\n\t\t\t\t\tif (nestedParent) {\n\t\t\t\t\t\tchildNames.push(nestedParent)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Spread operator\n\t\t\t\telse if (element.type === \"SpreadElement\") {\n\t\t\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t`Spread operator detected${loc}. Routes from spread cannot be statically analyzed.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tparentDef.children = childNames\n\t\t}\n\n\t\treturn parentVarName\n\t}\n\n\treturn undefined\n}\n\n/**\n * Build the route tree from collected definitions\n */\nfunction buildRouteTree(\n\trouteMap: Map<string, RouteDefinition>,\n\twarnings: string[],\n): ParsedRoute[] {\n\t// Find root routes\n\tconst rootDefs = Array.from(routeMap.values()).filter((def) => def.isRoot)\n\n\tif (rootDefs.length === 0) {\n\t\t// No explicit root route, try to build from parent relationships\n\t\treturn buildTreeFromParentRelations(routeMap, warnings)\n\t}\n\n\t// Build tree starting from root routes\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const rootDef of rootDefs) {\n\t\t// Use a Set to track visited routes and detect circular references\n\t\tconst visited = new Set<string>()\n\t\tconst rootRoute = buildRouteFromDefinition(\n\t\t\trootDef,\n\t\t\trouteMap,\n\t\t\twarnings,\n\t\t\tvisited,\n\t\t)\n\t\tif (rootRoute) {\n\t\t\t// If root has children, return only the children (root is typically just a layout)\n\t\t\t// because the root route in TanStack Router serves as a layout wrapper\n\t\t\tif (rootRoute.children && rootRoute.children.length > 0) {\n\t\t\t\troutes.push(...rootRoute.children)\n\t\t\t} else if (rootRoute.path) {\n\t\t\t\troutes.push(rootRoute)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Build tree when there's no explicit root route\n * Falls back to finding routes that have no parent relationship defined\n */\nfunction buildTreeFromParentRelations(\n\trouteMap: Map<string, RouteDefinition>,\n\twarnings: string[],\n): ParsedRoute[] {\n\t// Find routes without parents (top-level routes)\n\tconst topLevelDefs = Array.from(routeMap.values()).filter(\n\t\t(def) => !def.parentVariableName && !def.isRoot,\n\t)\n\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const def of topLevelDefs) {\n\t\tconst visited = new Set<string>()\n\t\tconst route = buildRouteFromDefinition(def, routeMap, warnings, visited)\n\t\tif (route) {\n\t\t\troutes.push(route)\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Build a ParsedRoute from a RouteDefinition\n * @param visited - Set of visited variable names for circular reference detection\n */\nfunction buildRouteFromDefinition(\n\tdef: RouteDefinition,\n\trouteMap: Map<string, RouteDefinition>,\n\twarnings: string[],\n\tvisited: Set<string>,\n): ParsedRoute | null {\n\t// Circular reference detection\n\tif (visited.has(def.variableName)) {\n\t\twarnings.push(\n\t\t\t`Circular reference detected: route \"${def.variableName}\" references itself in the route tree.`,\n\t\t)\n\t\treturn null\n\t}\n\tvisited.add(def.variableName)\n\n\tconst route: ParsedRoute = {\n\t\tpath: def.path ?? \"\",\n\t\tcomponent: def.component,\n\t}\n\n\t// Process children\n\tif (def.children && def.children.length > 0) {\n\t\tconst children: ParsedRoute[] = []\n\t\tfor (const childName of def.children) {\n\t\t\tconst childDef = routeMap.get(childName)\n\t\t\tif (childDef) {\n\t\t\t\tconst childRoute = buildRouteFromDefinition(\n\t\t\t\t\tchildDef,\n\t\t\t\t\trouteMap,\n\t\t\t\t\twarnings,\n\t\t\t\t\tvisited,\n\t\t\t\t)\n\t\t\t\tif (childRoute) {\n\t\t\t\t\tchildren.push(childRoute)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Child route \"${childName}\" not found. Ensure it's defined with createRoute.`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tif (children.length > 0) {\n\t\t\troute.children = children\n\t\t}\n\t}\n\n\treturn route\n}\n\n/**\n * Normalize TanStack Router path syntax to standard format\n * /$ (trailing catch-all) -> /*\n * $ (standalone splat) -> *\n * $param (dynamic segment) -> :param\n */\nfunction normalizeTanStackPath(path: string): string {\n\treturn (\n\t\tpath\n\t\t\t// Convert catch-all: $ at end -> *\n\t\t\t.replace(/\\/\\$$/, \"/*\")\n\t\t\t// Convert single $ to * (splat route)\n\t\t\t.replace(/^\\$$/, \"*\")\n\t\t\t// Convert $param to :param\n\t\t\t.replace(/\\$([a-zA-Z_][a-zA-Z0-9_]*)/g, \":$1\")\n\t)\n}\n\n/**\n * Detect if content is TanStack Router based on patterns\n */\nexport function isTanStackRouterContent(content: string): boolean {\n\t// Check for TanStack Router specific imports\n\tif (content.includes(\"@tanstack/react-router\")) {\n\t\treturn true\n\t}\n\n\t// Check for createRootRoute pattern\n\tif (content.includes(\"createRootRoute\")) {\n\t\treturn true\n\t}\n\n\t// Check for createRoute with getParentRoute (TanStack Router specific)\n\tif (content.includes(\"createRoute\") && content.includes(\"getParentRoute\")) {\n\t\treturn true\n\t}\n\n\t// Check for lazyRouteComponent (TanStack Router specific)\n\tif (content.includes(\"lazyRouteComponent\")) {\n\t\treturn true\n\t}\n\n\t// Check for addChildren pattern (TanStack Router specific)\n\tif (/\\.addChildren\\s*\\(/.test(content)) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n","import { readFileSync } from \"node:fs\"\nimport { dirname, resolve } from \"node:path\"\nimport { parse } from \"@babel/parser\"\nimport { isAngularRouterContent } from \"./angularRouterParser.js\"\nimport {\n\ttype ParsedRoute,\n\ttype ParseResult,\n\ttype RouterType,\n\tresolveImportPath,\n} from \"./routeParserUtils.js\"\nimport { isSolidRouterContent } from \"./solidRouterParser.js\"\nimport { isTanStackRouterContent } from \"./tanstackRouterParser.js\"\n\n// Re-export shared types\nexport type { ParsedRoute, ParseResult, RouterType }\n// Re-export router detection for convenience\nexport { isAngularRouterContent, isSolidRouterContent, isTanStackRouterContent }\n\n/**\n * Router factory function names to detect\n */\nconst ROUTER_FACTORY_NAMES = [\n\t\"createBrowserRouter\",\n\t\"createHashRouter\",\n\t\"createMemoryRouter\",\n]\n\n/**\n * Parse React Router configuration file and extract routes\n */\nexport function parseReactRouterConfig(\n\tfilePath: string,\n\tpreloadedContent?: string,\n): ParseResult {\n\tconst absolutePath = resolve(filePath)\n\tconst routesFileDir = dirname(absolutePath)\n\tconst warnings: string[] = []\n\n\t// Read file with proper error handling (skip if content is preloaded)\n\tlet content: string\n\tif (preloadedContent !== undefined) {\n\t\tcontent = preloadedContent\n\t} else {\n\t\ttry {\n\t\t\tcontent = readFileSync(absolutePath, \"utf-8\")\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to read routes file \"${absolutePath}\": ${message}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Parse with Babel - wrap for better error messages\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", \"jsx\"],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Syntax error in routes file \"${absolutePath}\": ${error.message}`,\n\t\t\t)\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tthrow new Error(`Failed to parse routes file \"${absolutePath}\": ${message}`)\n\t}\n\n\tconst routes: ParsedRoute[] = []\n\n\t// Find routes array in the AST\n\tfor (const node of ast.program.body) {\n\t\t// Handle: const router = createBrowserRouter([...])\n\t\tif (node.type === \"VariableDeclaration\") {\n\t\t\tfor (const decl of node.declarations) {\n\t\t\t\tif (decl.init?.type === \"CallExpression\") {\n\t\t\t\t\tconst callee = decl.init.callee\n\t\t\t\t\tif (\n\t\t\t\t\t\tcallee.type === \"Identifier\" &&\n\t\t\t\t\t\tROUTER_FACTORY_NAMES.includes(callee.name)\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst firstArg = decl.init.arguments[0]\n\t\t\t\t\t\tif (firstArg?.type === \"ArrayExpression\") {\n\t\t\t\t\t\t\tconst parsed = parseRoutesArray(firstArg, routesFileDir, warnings)\n\t\t\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export const router = createBrowserRouter([...])\n\t\t// and: export const routes = [...]\n\t\tif (\n\t\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t\t) {\n\t\t\tfor (const decl of node.declaration.declarations) {\n\t\t\t\t// Handle: export const router = createBrowserRouter([...])\n\t\t\t\tif (decl.init?.type === \"CallExpression\") {\n\t\t\t\t\tconst callee = decl.init.callee\n\t\t\t\t\tif (\n\t\t\t\t\t\tcallee.type === \"Identifier\" &&\n\t\t\t\t\t\tROUTER_FACTORY_NAMES.includes(callee.name)\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst firstArg = decl.init.arguments[0]\n\t\t\t\t\t\tif (firstArg?.type === \"ArrayExpression\") {\n\t\t\t\t\t\t\tconst parsed = parseRoutesArray(firstArg, routesFileDir, warnings)\n\t\t\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle: export const routes = [...]\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: const routes = [...]; (for later export)\n\t\tif (node.type === \"VariableDeclaration\") {\n\t\t\tfor (const decl of node.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export default [...]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(node.declaration, routesFileDir, warnings)\n\t\t\troutes.push(...parsed)\n\t\t}\n\n\t\t// Handle: export default [...] satisfies RouteObject[]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"TSSatisfiesExpression\" &&\n\t\t\tnode.declaration.expression.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(\n\t\t\t\tnode.declaration.expression,\n\t\t\t\troutesFileDir,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t\troutes.push(...parsed)\n\t\t}\n\t}\n\n\t// Warn if no routes were found\n\tif (routes.length === 0) {\n\t\twarnings.push(\n\t\t\t\"No routes found. Supported patterns: 'createBrowserRouter([...])', 'export const routes = [...]', or 'export default [...]'\",\n\t\t)\n\t}\n\n\treturn { routes, warnings }\n}\n\n/**\n * Parse an array expression containing route objects\n */\nfunction parseRoutesArray(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tarrayNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const element of arrayNode.elements) {\n\t\tif (!element) continue\n\n\t\t// Handle spread elements\n\t\tif (element.type === \"SpreadElement\") {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Spread operator detected${loc}. Routes from spread cannot be statically analyzed.`,\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\n\t\tif (element.type === \"ObjectExpression\") {\n\t\t\tconst route = parseRouteObject(element, baseDir, warnings)\n\t\t\tif (route) {\n\t\t\t\troutes.push(route)\n\t\t\t}\n\t\t} else {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Non-object route element (${element.type})${loc}. Only object literals can be statically analyzed.`,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Parse a single route object expression\n */\nfunction parseRouteObject(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tobjectNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute | null {\n\tconst route: ParsedRoute = {\n\t\tpath: \"\",\n\t}\n\tlet isIndexRoute = false\n\tlet hasPath = false\n\n\tfor (const prop of objectNode.properties) {\n\t\tif (prop.type !== \"ObjectProperty\") continue\n\t\tif (prop.key.type !== \"Identifier\") continue\n\n\t\tconst key = prop.key.name\n\n\t\tswitch (key) {\n\t\t\tcase \"path\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\troute.path = prop.value.value\n\t\t\t\t\thasPath = true\n\t\t\t\t} else {\n\t\t\t\t\tconst loc = prop.loc ? ` at line ${prop.loc.start.line}` : \"\"\n\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t`Dynamic path value (${prop.value.type})${loc}. Only string literal paths can be statically analyzed.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"index\":\n\t\t\t\tif (prop.value.type === \"BooleanLiteral\" && prop.value.value === true) {\n\t\t\t\t\tisIndexRoute = true\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"element\":\n\t\t\t\troute.component = extractComponentFromJSX(prop.value, warnings)\n\t\t\t\tbreak\n\n\t\t\tcase \"Component\":\n\t\t\t\tif (prop.value.type === \"Identifier\") {\n\t\t\t\t\troute.component = prop.value.name\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"lazy\": {\n\t\t\t\tconst lazyPath = extractLazyImportPath(prop.value, baseDir, warnings)\n\t\t\t\tif (lazyPath) {\n\t\t\t\t\troute.component = lazyPath\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tcase \"children\":\n\t\t\t\tif (prop.value.type === \"ArrayExpression\") {\n\t\t\t\t\troute.children = parseRoutesArray(prop.value, baseDir, warnings)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// Handle index routes\n\tif (isIndexRoute) {\n\t\troute.path = \"\"\n\t\treturn route\n\t}\n\n\t// Skip routes without path (layout wrappers without path)\n\t// These are parent routes that only serve as layout containers\n\tif (!hasPath && !isIndexRoute) {\n\t\t// If it has children, process them with empty parent path contribution\n\t\tif (route.children && route.children.length > 0) {\n\t\t\t// Return a route with empty path to act as layout\n\t\t\troute.path = \"\"\n\t\t\treturn route\n\t\t}\n\t\treturn null\n\t}\n\n\treturn route\n}\n\n/**\n * Extract component name from JSX element\n * element: <Dashboard /> -> \"Dashboard\"\n */\nfunction extractComponentFromJSX(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\twarnings: string[],\n): string | undefined {\n\tif (node.type === \"JSXElement\") {\n\t\tconst openingElement = node.openingElement\n\t\tif (openingElement?.name?.type === \"JSXIdentifier\") {\n\t\t\treturn openingElement.name.name\n\t\t}\n\t\tif (openingElement?.name?.type === \"JSXMemberExpression\") {\n\t\t\t// Handle <Namespace.Component />\n\t\t\tconst parts: string[] = []\n\t\t\tlet current = openingElement.name\n\t\t\twhile (current) {\n\t\t\t\tif (current.type === \"JSXIdentifier\") {\n\t\t\t\t\tparts.unshift(current.name)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif (current.type === \"JSXMemberExpression\") {\n\t\t\t\t\tif (current.property?.type === \"JSXIdentifier\") {\n\t\t\t\t\t\tparts.unshift(current.property.name)\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = current.object\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn parts.join(\".\")\n\t\t}\n\n\t\t// Check if it has children (wrapper component)\n\t\tif (\n\t\t\tnode.children &&\n\t\t\tnode.children.length > 0 &&\n\t\t\topeningElement?.name?.type === \"JSXIdentifier\"\n\t\t) {\n\t\t\tconst wrapperName = openingElement.name.name\n\t\t\t// Find the first JSX child\n\t\t\tfor (const child of node.children) {\n\t\t\t\tif (child.type === \"JSXElement\") {\n\t\t\t\t\tconst childComponent = extractComponentFromJSX(child, warnings)\n\t\t\t\t\tif (childComponent) {\n\t\t\t\t\t\twarnings.push(\n\t\t\t\t\t\t\t`Wrapper component detected: <${wrapperName}>. Using wrapper name for screen.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t\treturn wrapperName\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Handle JSXFragment\n\tif (node.type === \"JSXFragment\") {\n\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\twarnings.push(\n\t\t\t`JSX Fragment detected${loc}. Cannot extract component name from fragments. Consider wrapping in a named component.`,\n\t\t)\n\t\treturn undefined\n\t}\n\n\t// Catch-all for unrecognized element patterns\n\tif (node) {\n\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\twarnings.push(\n\t\t\t`Unrecognized element pattern (${node.type})${loc}. Component will not be extracted.`,\n\t\t)\n\t}\n\treturn undefined\n}\n\n/**\n * Extract import path from lazy function\n * lazy: () => import(\"./pages/Dashboard\") -> resolved path\n */\nfunction extractLazyImportPath(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tnode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): string | undefined {\n\t// Arrow function: () => import('./path')\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\tif (body.type === \"CallExpression\" && body.callee.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t\t// Dynamic import argument\n\t\t\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Lazy import with dynamic path${loc}. Only string literal imports can be statically analyzed.`,\n\t\t\t)\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\t// Unrecognized lazy pattern\n\tconst loc = node.loc ? ` at line ${node.loc.start.line}` : \"\"\n\twarnings.push(\n\t\t`Unrecognized lazy pattern (${node.type})${loc}. Expected arrow function with import().`,\n\t)\n\treturn undefined\n}\n\n/**\n * Detect if content is React Router based on patterns\n */\nexport function isReactRouterContent(content: string): boolean {\n\t// Check for React Router specific patterns\n\tif (\n\t\tcontent.includes(\"createBrowserRouter\") ||\n\t\tcontent.includes(\"createHashRouter\") ||\n\t\tcontent.includes(\"createMemoryRouter\") ||\n\t\tcontent.includes(\"RouteObject\")\n\t) {\n\t\treturn true\n\t}\n\n\t// Check for JSX element pattern in routes\n\tif (/element:\\s*</.test(content)) {\n\t\treturn true\n\t}\n\n\t// Check for Component property pattern (uppercase)\n\tif (/Component:\\s*[A-Z]/.test(content)) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n/**\n * Detect if content is Vue Router based on patterns\n */\nexport function isVueRouterContent(content: string): boolean {\n\t// Check for Vue Router specific patterns\n\tif (\n\t\tcontent.includes(\"RouteRecordRaw\") ||\n\t\tcontent.includes(\"vue-router\") ||\n\t\tcontent.includes(\".vue\")\n\t) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n/**\n * Detect router type from file content.\n * Detection order: TanStack Router -> Solid Router -> Angular Router -> React Router -> Vue Router.\n * This order ensures more specific patterns are checked before more generic ones.\n */\nexport function detectRouterType(content: string): RouterType {\n\t// Check TanStack Router first (more specific patterns)\n\tif (isTanStackRouterContent(content)) {\n\t\treturn \"tanstack-router\"\n\t}\n\t// Check Solid Router before React Router (both use similar patterns)\n\tif (isSolidRouterContent(content)) {\n\t\treturn \"solid-router\"\n\t}\n\t// Check Angular Router before React Router (distinct patterns)\n\tif (isAngularRouterContent(content)) {\n\t\treturn \"angular-router\"\n\t}\n\tif (isReactRouterContent(content)) {\n\t\treturn \"react-router\"\n\t}\n\tif (isVueRouterContent(content)) {\n\t\treturn \"vue-router\"\n\t}\n\treturn \"unknown\"\n}\n","import { readFileSync } from \"node:fs\"\nimport { dirname, resolve } from \"node:path\"\nimport { parse } from \"@babel/parser\"\nimport {\n\ttype FlatRoute,\n\tflattenRoutes,\n\ttype ParsedRoute,\n\ttype ParseResult,\n\tpathToScreenId,\n\tpathToScreenTitle,\n\tresolveImportPath,\n} from \"./routeParserUtils.js\"\n\n// Re-export shared types and utilities\nexport type { ParsedRoute, FlatRoute, ParseResult }\nexport { flattenRoutes, pathToScreenId, pathToScreenTitle }\n\n/**\n * Parse Vue Router configuration file and extract routes\n */\nexport function parseVueRouterConfig(\n\tfilePath: string,\n\tpreloadedContent?: string,\n): ParseResult {\n\tconst absolutePath = resolve(filePath)\n\tconst routesFileDir = dirname(absolutePath)\n\tconst warnings: string[] = []\n\n\t// Read file with proper error handling (skip if content is preloaded)\n\tlet content: string\n\tif (preloadedContent !== undefined) {\n\t\tcontent = preloadedContent\n\t} else {\n\t\ttry {\n\t\t\tcontent = readFileSync(absolutePath, \"utf-8\")\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to read routes file \"${absolutePath}\": ${message}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Parse with Babel - wrap for better error messages\n\tlet ast: ReturnType<typeof parse>\n\ttry {\n\t\tast = parse(content, {\n\t\t\tsourceType: \"module\",\n\t\t\tplugins: [\"typescript\", \"jsx\"],\n\t\t})\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Syntax error in routes file \"${absolutePath}\": ${error.message}`,\n\t\t\t)\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tthrow new Error(`Failed to parse routes file \"${absolutePath}\": ${message}`)\n\t}\n\n\tconst routes: ParsedRoute[] = []\n\n\t// Find routes array in the AST\n\tfor (const node of ast.program.body) {\n\t\t// Handle: export const routes = [...]\n\t\tif (\n\t\t\tnode.type === \"ExportNamedDeclaration\" &&\n\t\t\tnode.declaration?.type === \"VariableDeclaration\"\n\t\t) {\n\t\t\tfor (const decl of node.declaration.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: const routes = [...]; export { routes }\n\t\tif (node.type === \"VariableDeclaration\") {\n\t\t\tfor (const decl of node.declarations) {\n\t\t\t\tif (\n\t\t\t\t\tdecl.id.type === \"Identifier\" &&\n\t\t\t\t\tdecl.id.name === \"routes\" &&\n\t\t\t\t\tdecl.init?.type === \"ArrayExpression\"\n\t\t\t\t) {\n\t\t\t\t\tconst parsed = parseRoutesArray(decl.init, routesFileDir, warnings)\n\t\t\t\t\troutes.push(...parsed)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle: export default [...]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(node.declaration, routesFileDir, warnings)\n\t\t\troutes.push(...parsed)\n\t\t}\n\n\t\t// Handle: export default [...] satisfies RouteRecordRaw[]\n\t\tif (\n\t\t\tnode.type === \"ExportDefaultDeclaration\" &&\n\t\t\tnode.declaration.type === \"TSSatisfiesExpression\" &&\n\t\t\tnode.declaration.expression.type === \"ArrayExpression\"\n\t\t) {\n\t\t\tconst parsed = parseRoutesArray(\n\t\t\t\tnode.declaration.expression,\n\t\t\t\troutesFileDir,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t\troutes.push(...parsed)\n\t\t}\n\t}\n\n\t// Warn if no routes were found\n\tif (routes.length === 0) {\n\t\twarnings.push(\n\t\t\t\"No routes array found. Supported patterns: 'export const routes = [...]', 'export default [...]', or 'export default [...] satisfies RouteRecordRaw[]'\",\n\t\t)\n\t}\n\n\treturn { routes, warnings }\n}\n\n/**\n * Parse an array expression containing route objects\n */\nfunction parseRoutesArray(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tarrayNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute[] {\n\tconst routes: ParsedRoute[] = []\n\n\tfor (const element of arrayNode.elements) {\n\t\tif (!element) continue\n\n\t\t// Handle spread elements\n\t\tif (element.type === \"SpreadElement\") {\n\t\t\tconst loc = element.loc ? ` at line ${element.loc.start.line}` : \"\"\n\t\t\twarnings.push(\n\t\t\t\t`Spread operator detected${loc}. Routes from spread cannot be statically analyzed.`,\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\n\t\tif (element.type === \"ObjectExpression\") {\n\t\t\tconst route = parseRouteObject(element, baseDir, warnings)\n\t\t\tif (route) {\n\t\t\t\troutes.push(route)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn routes\n}\n\n/**\n * Parse a single route object expression\n */\nfunction parseRouteObject(\n\t// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\n\tobjectNode: any,\n\tbaseDir: string,\n\twarnings: string[],\n): ParsedRoute | null {\n\tconst route: ParsedRoute = {\n\t\tpath: \"\",\n\t}\n\n\tfor (const prop of objectNode.properties) {\n\t\tif (prop.type !== \"ObjectProperty\") continue\n\t\tif (prop.key.type !== \"Identifier\") continue\n\n\t\tconst key = prop.key.name\n\n\t\tswitch (key) {\n\t\t\tcase \"path\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\troute.path = prop.value.value\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"name\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\troute.name = prop.value.value\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"redirect\":\n\t\t\t\tif (prop.value.type === \"StringLiteral\") {\n\t\t\t\t\troute.redirect = prop.value.value\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"component\":\n\t\t\t\troute.component = extractComponentPath(prop.value, baseDir)\n\t\t\t\tbreak\n\n\t\t\tcase \"children\":\n\t\t\t\tif (prop.value.type === \"ArrayExpression\") {\n\t\t\t\t\troute.children = parseRoutesArray(prop.value, baseDir, warnings)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// Skip routes without path\n\tif (!route.path) {\n\t\treturn null\n\t}\n\n\treturn route\n}\n\n/**\n * Extract component path from various component definitions\n */\n// biome-ignore lint/suspicious/noExplicitAny: AST node types are complex\nfunction extractComponentPath(node: any, baseDir: string): string | undefined {\n\t// Direct identifier: component: HomeView\n\tif (node.type === \"Identifier\") {\n\t\treturn undefined // Can't resolve without tracking imports\n\t}\n\n\t// Arrow function with import: () => import('./views/Home.vue')\n\tif (node.type === \"ArrowFunctionExpression\") {\n\t\tconst body = node.body\n\n\t\t// () => import('./path')\n\t\tif (body.type === \"CallExpression\" && body.callee.type === \"Import\") {\n\t\t\tif (body.arguments[0]?.type === \"StringLiteral\") {\n\t\t\t\treturn resolveImportPath(body.arguments[0].value, baseDir)\n\t\t\t}\n\t\t}\n\n\t\t// () => import(/* webpackChunkName */ './path')\n\t\tif (body.type === \"CallExpression\" && body.callee.type === \"Import\") {\n\t\t\tfor (const arg of body.arguments) {\n\t\t\t\tif (arg.type === \"StringLiteral\") {\n\t\t\t\t\treturn resolveImportPath(arg.value, baseDir)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined\n}\n","/**\n* @vue/shared v3.5.26\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\n'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// @__NO_SIDE_EFFECTS__\nfunction makeMap(str) {\n const map = /* @__PURE__ */ Object.create(null);\n for (const key of str.split(\",\")) map[key] = 1;\n return (val) => val in map;\n}\n\nconst EMPTY_OBJ = {};\nconst EMPTY_ARR = [];\nconst NOOP = () => {\n};\nconst NO = () => false;\nconst isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter\n(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);\nconst isModelListener = (key) => key.startsWith(\"onUpdate:\");\nconst extend = Object.assign;\nconst remove = (arr, el) => {\n const i = arr.indexOf(el);\n if (i > -1) {\n arr.splice(i, 1);\n }\n};\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key);\nconst isArray = Array.isArray;\nconst isMap = (val) => toTypeString(val) === \"[object Map]\";\nconst isSet = (val) => toTypeString(val) === \"[object Set]\";\nconst isDate = (val) => toTypeString(val) === \"[object Date]\";\nconst isRegExp = (val) => toTypeString(val) === \"[object RegExp]\";\nconst isFunction = (val) => typeof val === \"function\";\nconst isString = (val) => typeof val === \"string\";\nconst isSymbol = (val) => typeof val === \"symbol\";\nconst isObject = (val) => val !== null && typeof val === \"object\";\nconst isPromise = (val) => {\n return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);\n};\nconst objectToString = Object.prototype.toString;\nconst toTypeString = (value) => objectToString.call(value);\nconst toRawType = (value) => {\n return toTypeString(value).slice(8, -1);\n};\nconst isPlainObject = (val) => toTypeString(val) === \"[object Object]\";\nconst isIntegerKey = (key) => isString(key) && key !== \"NaN\" && key[0] !== \"-\" && \"\" + parseInt(key, 10) === key;\nconst isReservedProp = /* @__PURE__ */ makeMap(\n // the leading comma is intentional so empty string \"\" is also included\n \",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted\"\n);\nconst isBuiltInDirective = /* @__PURE__ */ makeMap(\n \"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo\"\n);\nconst cacheStringFunction = (fn) => {\n const cache = /* @__PURE__ */ Object.create(null);\n return ((str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n });\n};\nconst camelizeRE = /-\\w/g;\nconst camelize = cacheStringFunction(\n (str) => {\n return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());\n }\n);\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction(\n (str) => str.replace(hyphenateRE, \"-$1\").toLowerCase()\n);\nconst capitalize = cacheStringFunction((str) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n});\nconst toHandlerKey = cacheStringFunction(\n (str) => {\n const s = str ? `on${capitalize(str)}` : ``;\n return s;\n }\n);\nconst hasChanged = (value, oldValue) => !Object.is(value, oldValue);\nconst invokeArrayFns = (fns, ...arg) => {\n for (let i = 0; i < fns.length; i++) {\n fns[i](...arg);\n }\n};\nconst def = (obj, key, value, writable = false) => {\n Object.defineProperty(obj, key, {\n configurable: true,\n enumerable: false,\n writable,\n value\n });\n};\nconst looseToNumber = (val) => {\n const n = parseFloat(val);\n return isNaN(n) ? val : n;\n};\nconst toNumber = (val) => {\n const n = isString(val) ? Number(val) : NaN;\n return isNaN(n) ? val : n;\n};\nlet _globalThis;\nconst getGlobalThis = () => {\n return _globalThis || (_globalThis = typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : {});\n};\nconst identRE = /^[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*$/;\nfunction genPropsAccessExp(name) {\n return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;\n}\nfunction genCacheKey(source, options) {\n return source + JSON.stringify(\n options,\n (_, val) => typeof val === \"function\" ? val.toString() : val\n );\n}\n\nconst PatchFlags = {\n \"TEXT\": 1,\n \"1\": \"TEXT\",\n \"CLASS\": 2,\n \"2\": \"CLASS\",\n \"STYLE\": 4,\n \"4\": \"STYLE\",\n \"PROPS\": 8,\n \"8\": \"PROPS\",\n \"FULL_PROPS\": 16,\n \"16\": \"FULL_PROPS\",\n \"NEED_HYDRATION\": 32,\n \"32\": \"NEED_HYDRATION\",\n \"STABLE_FRAGMENT\": 64,\n \"64\": \"STABLE_FRAGMENT\",\n \"KEYED_FRAGMENT\": 128,\n \"128\": \"KEYED_FRAGMENT\",\n \"UNKEYED_FRAGMENT\": 256,\n \"256\": \"UNKEYED_FRAGMENT\",\n \"NEED_PATCH\": 512,\n \"512\": \"NEED_PATCH\",\n \"DYNAMIC_SLOTS\": 1024,\n \"1024\": \"DYNAMIC_SLOTS\",\n \"DEV_ROOT_FRAGMENT\": 2048,\n \"2048\": \"DEV_ROOT_FRAGMENT\",\n \"CACHED\": -1,\n \"-1\": \"CACHED\",\n \"BAIL\": -2,\n \"-2\": \"BAIL\"\n};\nconst PatchFlagNames = {\n [1]: `TEXT`,\n [2]: `CLASS`,\n [4]: `STYLE`,\n [8]: `PROPS`,\n [16]: `FULL_PROPS`,\n [32]: `NEED_HYDRATION`,\n [64]: `STABLE_FRAGMENT`,\n [128]: `KEYED_FRAGMENT`,\n [256]: `UNKEYED_FRAGMENT`,\n [512]: `NEED_PATCH`,\n [1024]: `DYNAMIC_SLOTS`,\n [2048]: `DEV_ROOT_FRAGMENT`,\n [-1]: `CACHED`,\n [-2]: `BAIL`\n};\n\nconst ShapeFlags = {\n \"ELEMENT\": 1,\n \"1\": \"ELEMENT\",\n \"FUNCTIONAL_COMPONENT\": 2,\n \"2\": \"FUNCTIONAL_COMPONENT\",\n \"STATEFUL_COMPONENT\": 4,\n \"4\": \"STATEFUL_COMPONENT\",\n \"TEXT_CHILDREN\": 8,\n \"8\": \"TEXT_CHILDREN\",\n \"ARRAY_CHILDREN\": 16,\n \"16\": \"ARRAY_CHILDREN\",\n \"SLOTS_CHILDREN\": 32,\n \"32\": \"SLOTS_CHILDREN\",\n \"TELEPORT\": 64,\n \"64\": \"TELEPORT\",\n \"SUSPENSE\": 128,\n \"128\": \"SUSPENSE\",\n \"COMPONENT_SHOULD_KEEP_ALIVE\": 256,\n \"256\": \"COMPONENT_SHOULD_KEEP_ALIVE\",\n \"COMPONENT_KEPT_ALIVE\": 512,\n \"512\": \"COMPONENT_KEPT_ALIVE\",\n \"COMPONENT\": 6,\n \"6\": \"COMPONENT\"\n};\n\nconst SlotFlags = {\n \"STABLE\": 1,\n \"1\": \"STABLE\",\n \"DYNAMIC\": 2,\n \"2\": \"DYNAMIC\",\n \"FORWARDED\": 3,\n \"3\": \"FORWARDED\"\n};\nconst slotFlagsText = {\n [1]: \"STABLE\",\n [2]: \"DYNAMIC\",\n [3]: \"FORWARDED\"\n};\n\nconst GLOBALS_ALLOWED = \"Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol\";\nconst isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);\nconst isGloballyWhitelisted = isGloballyAllowed;\n\nconst range = 2;\nfunction generateCodeFrame(source, start = 0, end = source.length) {\n start = Math.max(0, Math.min(start, source.length));\n end = Math.max(0, Math.min(end, source.length));\n if (start > end) return \"\";\n let lines = source.split(/(\\r?\\n)/);\n const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);\n lines = lines.filter((_, idx) => idx % 2 === 0);\n let count = 0;\n const res = [];\n for (let i = 0; i < lines.length; i++) {\n count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);\n if (count >= start) {\n for (let j = i - range; j <= i + range || end > count; j++) {\n if (j < 0 || j >= lines.length) continue;\n const line = j + 1;\n res.push(\n `${line}${\" \".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`\n );\n const lineLength = lines[j].length;\n const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;\n if (j === i) {\n const pad = start - (count - (lineLength + newLineSeqLength));\n const length = Math.max(\n 1,\n end > count ? lineLength - pad : end - start\n );\n res.push(` | ` + \" \".repeat(pad) + \"^\".repeat(length));\n } else if (j > i) {\n if (end > count) {\n const length = Math.max(Math.min(end - count, lineLength), 1);\n res.push(` | ` + \"^\".repeat(length));\n }\n count += lineLength + newLineSeqLength;\n }\n }\n break;\n }\n }\n return res.join(\"\\n\");\n}\n\nfunction normalizeStyle(value) {\n if (isArray(value)) {\n const res = {};\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);\n if (normalized) {\n for (const key in normalized) {\n res[key] = normalized[key];\n }\n }\n }\n return res;\n } else if (isString(value) || isObject(value)) {\n return value;\n }\n}\nconst listDelimiterRE = /;(?![^(]*\\))/g;\nconst propertyDelimiterRE = /:([^]+)/;\nconst styleCommentRE = /\\/\\*[^]*?\\*\\//g;\nfunction parseStringStyle(cssText) {\n const ret = {};\n cssText.replace(styleCommentRE, \"\").split(listDelimiterRE).forEach((item) => {\n if (item) {\n const tmp = item.split(propertyDelimiterRE);\n tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\n }\n });\n return ret;\n}\nfunction stringifyStyle(styles) {\n if (!styles) return \"\";\n if (isString(styles)) return styles;\n let ret = \"\";\n for (const key in styles) {\n const value = styles[key];\n if (isString(value) || typeof value === \"number\") {\n const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);\n ret += `${normalizedKey}:${value};`;\n }\n }\n return ret;\n}\nfunction normalizeClass(value) {\n let res = \"\";\n if (isString(value)) {\n res = value;\n } else if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const normalized = normalizeClass(value[i]);\n if (normalized) {\n res += normalized + \" \";\n }\n }\n } else if (isObject(value)) {\n for (const name in value) {\n if (value[name]) {\n res += name + \" \";\n }\n }\n }\n return res.trim();\n}\nfunction normalizeProps(props) {\n if (!props) return null;\n let { class: klass, style } = props;\n if (klass && !isString(klass)) {\n props.class = normalizeClass(klass);\n }\n if (style) {\n props.style = normalizeStyle(style);\n }\n return props;\n}\n\nconst HTML_TAGS = \"html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot\";\nconst SVG_TAGS = \"svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view\";\nconst MATH_TAGS = \"annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics\";\nconst VOID_TAGS = \"area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr\";\nconst isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);\nconst isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);\nconst isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);\nconst isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);\n\nconst specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\nconst isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);\nconst isBooleanAttr = /* @__PURE__ */ makeMap(\n specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`\n);\nfunction includeBooleanAttr(value) {\n return !!value || value === \"\";\n}\nconst unsafeAttrCharRE = /[>/=\"'\\u0009\\u000a\\u000c\\u0020]/;\nconst attrValidationCache = {};\nfunction isSSRSafeAttrName(name) {\n if (attrValidationCache.hasOwnProperty(name)) {\n return attrValidationCache[name];\n }\n const isUnsafe = unsafeAttrCharRE.test(name);\n if (isUnsafe) {\n console.error(`unsafe attribute name: ${name}`);\n }\n return attrValidationCache[name] = !isUnsafe;\n}\nconst propsToAttrMap = {\n acceptCharset: \"accept-charset\",\n className: \"class\",\n htmlFor: \"for\",\n httpEquiv: \"http-equiv\"\n};\nconst isKnownHtmlAttr = /* @__PURE__ */ makeMap(\n `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`\n);\nconst isKnownSvgAttr = /* @__PURE__ */ makeMap(\n `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`\n);\nconst isKnownMathMLAttr = /* @__PURE__ */ makeMap(\n `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns`\n);\nfunction isRenderableAttrValue(value) {\n if (value == null) {\n return false;\n }\n const type = typeof value;\n return type === \"string\" || type === \"number\" || type === \"boolean\";\n}\n\nconst escapeRE = /[\"'&<>]/;\nfunction escapeHtml(string) {\n const str = \"\" + string;\n const match = escapeRE.exec(str);\n if (!match) {\n return str;\n }\n let html = \"\";\n let escaped;\n let index;\n let lastIndex = 0;\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34:\n escaped = \"&quot;\";\n break;\n case 38:\n escaped = \"&amp;\";\n break;\n case 39:\n escaped = \"&#39;\";\n break;\n case 60:\n escaped = \"&lt;\";\n break;\n case 62:\n escaped = \"&gt;\";\n break;\n default:\n continue;\n }\n if (lastIndex !== index) {\n html += str.slice(lastIndex, index);\n }\n lastIndex = index + 1;\n html += escaped;\n }\n return lastIndex !== index ? html + str.slice(lastIndex, index) : html;\n}\nconst commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;\nfunction escapeHtmlComment(src) {\n return src.replace(commentStripRE, \"\");\n}\nconst cssVarNameEscapeSymbolsRE = /[ !\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~]/g;\nfunction getEscapedCssVarName(key, doubleEscape) {\n return key.replace(\n cssVarNameEscapeSymbolsRE,\n (s) => doubleEscape ? s === '\"' ? '\\\\\\\\\\\\\"' : `\\\\\\\\${s}` : `\\\\${s}`\n );\n}\n\nfunction looseCompareArrays(a, b) {\n if (a.length !== b.length) return false;\n let equal = true;\n for (let i = 0; equal && i < a.length; i++) {\n equal = looseEqual(a[i], b[i]);\n }\n return equal;\n}\nfunction looseEqual(a, b) {\n if (a === b) return true;\n let aValidType = isDate(a);\n let bValidType = isDate(b);\n if (aValidType || bValidType) {\n return aValidType && bValidType ? a.getTime() === b.getTime() : false;\n }\n aValidType = isSymbol(a);\n bValidType = isSymbol(b);\n if (aValidType || bValidType) {\n return a === b;\n }\n aValidType = isArray(a);\n bValidType = isArray(b);\n if (aValidType || bValidType) {\n return aValidType && bValidType ? looseCompareArrays(a, b) : false;\n }\n aValidType = isObject(a);\n bValidType = isObject(b);\n if (aValidType || bValidType) {\n if (!aValidType || !bValidType) {\n return false;\n }\n const aKeysCount = Object.keys(a).length;\n const bKeysCount = Object.keys(b).length;\n if (aKeysCount !== bKeysCount) {\n return false;\n }\n for (const key in a) {\n const aHasKey = a.hasOwnProperty(key);\n const bHasKey = b.hasOwnProperty(key);\n if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n return String(a) === String(b);\n}\nfunction looseIndexOf(arr, val) {\n return arr.findIndex((item) => looseEqual(item, val));\n}\n\nconst isRef = (val) => {\n return !!(val && val[\"__v_isRef\"] === true);\n};\nconst toDisplayString = (val) => {\n return isString(val) ? val : val == null ? \"\" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);\n};\nconst replacer = (_key, val) => {\n if (isRef(val)) {\n return replacer(_key, val.value);\n } else if (isMap(val)) {\n return {\n [`Map(${val.size})`]: [...val.entries()].reduce(\n (entries, [key, val2], i) => {\n entries[stringifySymbol(key, i) + \" =>\"] = val2;\n return entries;\n },\n {}\n )\n };\n } else if (isSet(val)) {\n return {\n [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))\n };\n } else if (isSymbol(val)) {\n return stringifySymbol(val);\n } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {\n return String(val);\n }\n return val;\n};\nconst stringifySymbol = (v, i = \"\") => {\n var _a;\n return (\n // Symbol.description in es2019+ so we need to cast here to pass\n // the lib: es2016 check\n isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v\n );\n};\n\nfunction normalizeCssVarValue(value) {\n if (value == null) {\n return \"initial\";\n }\n if (typeof value === \"string\") {\n return value === \"\" ? \" \" : value;\n }\n return String(value);\n}\n\nexports.EMPTY_ARR = EMPTY_ARR;\nexports.EMPTY_OBJ = EMPTY_OBJ;\nexports.NO = NO;\nexports.NOOP = NOOP;\nexports.PatchFlagNames = PatchFlagNames;\nexports.PatchFlags = PatchFlags;\nexports.ShapeFlags = ShapeFlags;\nexports.SlotFlags = SlotFlags;\nexports.camelize = camelize;\nexports.capitalize = capitalize;\nexports.cssVarNameEscapeSymbolsRE = cssVarNameEscapeSymbolsRE;\nexports.def = def;\nexports.escapeHtml = escapeHtml;\nexports.escapeHtmlComment = escapeHtmlComment;\nexports.extend = extend;\nexports.genCacheKey = genCacheKey;\nexports.genPropsAccessExp = genPropsAccessExp;\nexports.generateCodeFrame = generateCodeFrame;\nexports.getEscapedCssVarName = getEscapedCssVarName;\nexports.getGlobalThis = getGlobalThis;\nexports.hasChanged = hasChanged;\nexports.hasOwn = hasOwn;\nexports.hyphenate = hyphenate;\nexports.includeBooleanAttr = includeBooleanAttr;\nexports.invokeArrayFns = invokeArrayFns;\nexports.isArray = isArray;\nexports.isBooleanAttr = isBooleanAttr;\nexports.isBuiltInDirective = isBuiltInDirective;\nexports.isDate = isDate;\nexports.isFunction = isFunction;\nexports.isGloballyAllowed = isGloballyAllowed;\nexports.isGloballyWhitelisted = isGloballyWhitelisted;\nexports.isHTMLTag = isHTMLTag;\nexports.isIntegerKey = isIntegerKey;\nexports.isKnownHtmlAttr = isKnownHtmlAttr;\nexports.isKnownMathMLAttr = isKnownMathMLAttr;\nexports.isKnownSvgAttr = isKnownSvgAttr;\nexports.isMap = isMap;\nexports.isMathMLTag = isMathMLTag;\nexports.isModelListener = isModelListener;\nexports.isObject = isObject;\nexports.isOn = isOn;\nexports.isPlainObject = isPlainObject;\nexports.isPromise = isPromise;\nexports.isRegExp = isRegExp;\nexports.isRenderableAttrValue = isRenderableAttrValue;\nexports.isReservedProp = isReservedProp;\nexports.isSSRSafeAttrName = isSSRSafeAttrName;\nexports.isSVGTag = isSVGTag;\nexports.isSet = isSet;\nexports.isSpecialBooleanAttr = isSpecialBooleanAttr;\nexports.isString = isString;\nexports.isSymbol = isSymbol;\nexports.isVoidTag = isVoidTag;\nexports.looseEqual = looseEqual;\nexports.looseIndexOf = looseIndexOf;\nexports.looseToNumber = looseToNumber;\nexports.makeMap = makeMap;\nexports.normalizeClass = normalizeClass;\nexports.normalizeCssVarValue = normalizeCssVarValue;\nexports.normalizeProps = normalizeProps;\nexports.normalizeStyle = normalizeStyle;\nexports.objectToString = objectToString;\nexports.parseStringStyle = parseStringStyle;\nexports.propsToAttrMap = propsToAttrMap;\nexports.remove = remove;\nexports.slotFlagsText = slotFlagsText;\nexports.stringifyStyle = stringifyStyle;\nexports.toDisplayString = toDisplayString;\nexports.toHandlerKey = toHandlerKey;\nexports.toNumber = toNumber;\nexports.toRawType = toRawType;\nexports.toTypeString = toTypeString;\n","/**\n* @vue/shared v3.5.26\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\n'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// @__NO_SIDE_EFFECTS__\nfunction makeMap(str) {\n const map = /* @__PURE__ */ Object.create(null);\n for (const key of str.split(\",\")) map[key] = 1;\n return (val) => val in map;\n}\n\nconst EMPTY_OBJ = Object.freeze({}) ;\nconst EMPTY_ARR = Object.freeze([]) ;\nconst NOOP = () => {\n};\nconst NO = () => false;\nconst isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter\n(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);\nconst isModelListener = (key) => key.startsWith(\"onUpdate:\");\nconst extend = Object.assign;\nconst remove = (arr, el) => {\n const i = arr.indexOf(el);\n if (i > -1) {\n arr.splice(i, 1);\n }\n};\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key);\nconst isArray = Array.isArray;\nconst isMap = (val) => toTypeString(val) === \"[object Map]\";\nconst isSet = (val) => toTypeString(val) === \"[object Set]\";\nconst isDate = (val) => toTypeString(val) === \"[object Date]\";\nconst isRegExp = (val) => toTypeString(val) === \"[object RegExp]\";\nconst isFunction = (val) => typeof val === \"function\";\nconst isString = (val) => typeof val === \"string\";\nconst isSymbol = (val) => typeof val === \"symbol\";\nconst isObject = (val) => val !== null && typeof val === \"object\";\nconst isPromise = (val) => {\n return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);\n};\nconst objectToString = Object.prototype.toString;\nconst toTypeString = (value) => objectToString.call(value);\nconst toRawType = (value) => {\n return toTypeString(value).slice(8, -1);\n};\nconst isPlainObject = (val) => toTypeString(val) === \"[object Object]\";\nconst isIntegerKey = (key) => isString(key) && key !== \"NaN\" && key[0] !== \"-\" && \"\" + parseInt(key, 10) === key;\nconst isReservedProp = /* @__PURE__ */ makeMap(\n // the leading comma is intentional so empty string \"\" is also included\n \",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted\"\n);\nconst isBuiltInDirective = /* @__PURE__ */ makeMap(\n \"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo\"\n);\nconst cacheStringFunction = (fn) => {\n const cache = /* @__PURE__ */ Object.create(null);\n return ((str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n });\n};\nconst camelizeRE = /-\\w/g;\nconst camelize = cacheStringFunction(\n (str) => {\n return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());\n }\n);\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction(\n (str) => str.replace(hyphenateRE, \"-$1\").toLowerCase()\n);\nconst capitalize = cacheStringFunction((str) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n});\nconst toHandlerKey = cacheStringFunction(\n (str) => {\n const s = str ? `on${capitalize(str)}` : ``;\n return s;\n }\n);\nconst hasChanged = (value, oldValue) => !Object.is(value, oldValue);\nconst invokeArrayFns = (fns, ...arg) => {\n for (let i = 0; i < fns.length; i++) {\n fns[i](...arg);\n }\n};\nconst def = (obj, key, value, writable = false) => {\n Object.defineProperty(obj, key, {\n configurable: true,\n enumerable: false,\n writable,\n value\n });\n};\nconst looseToNumber = (val) => {\n const n = parseFloat(val);\n return isNaN(n) ? val : n;\n};\nconst toNumber = (val) => {\n const n = isString(val) ? Number(val) : NaN;\n return isNaN(n) ? val : n;\n};\nlet _globalThis;\nconst getGlobalThis = () => {\n return _globalThis || (_globalThis = typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : {});\n};\nconst identRE = /^[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*$/;\nfunction genPropsAccessExp(name) {\n return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;\n}\nfunction genCacheKey(source, options) {\n return source + JSON.stringify(\n options,\n (_, val) => typeof val === \"function\" ? val.toString() : val\n );\n}\n\nconst PatchFlags = {\n \"TEXT\": 1,\n \"1\": \"TEXT\",\n \"CLASS\": 2,\n \"2\": \"CLASS\",\n \"STYLE\": 4,\n \"4\": \"STYLE\",\n \"PROPS\": 8,\n \"8\": \"PROPS\",\n \"FULL_PROPS\": 16,\n \"16\": \"FULL_PROPS\",\n \"NEED_HYDRATION\": 32,\n \"32\": \"NEED_HYDRATION\",\n \"STABLE_FRAGMENT\": 64,\n \"64\": \"STABLE_FRAGMENT\",\n \"KEYED_FRAGMENT\": 128,\n \"128\": \"KEYED_FRAGMENT\",\n \"UNKEYED_FRAGMENT\": 256,\n \"256\": \"UNKEYED_FRAGMENT\",\n \"NEED_PATCH\": 512,\n \"512\": \"NEED_PATCH\",\n \"DYNAMIC_SLOTS\": 1024,\n \"1024\": \"DYNAMIC_SLOTS\",\n \"DEV_ROOT_FRAGMENT\": 2048,\n \"2048\": \"DEV_ROOT_FRAGMENT\",\n \"CACHED\": -1,\n \"-1\": \"CACHED\",\n \"BAIL\": -2,\n \"-2\": \"BAIL\"\n};\nconst PatchFlagNames = {\n [1]: `TEXT`,\n [2]: `CLASS`,\n [4]: `STYLE`,\n [8]: `PROPS`,\n [16]: `FULL_PROPS`,\n [32]: `NEED_HYDRATION`,\n [64]: `STABLE_FRAGMENT`,\n [128]: `KEYED_FRAGMENT`,\n [256]: `UNKEYED_FRAGMENT`,\n [512]: `NEED_PATCH`,\n [1024]: `DYNAMIC_SLOTS`,\n [2048]: `DEV_ROOT_FRAGMENT`,\n [-1]: `CACHED`,\n [-2]: `BAIL`\n};\n\nconst ShapeFlags = {\n \"ELEMENT\": 1,\n \"1\": \"ELEMENT\",\n \"FUNCTIONAL_COMPONENT\": 2,\n \"2\": \"FUNCTIONAL_COMPONENT\",\n \"STATEFUL_COMPONENT\": 4,\n \"4\": \"STATEFUL_COMPONENT\",\n \"TEXT_CHILDREN\": 8,\n \"8\": \"TEXT_CHILDREN\",\n \"ARRAY_CHILDREN\": 16,\n \"16\": \"ARRAY_CHILDREN\",\n \"SLOTS_CHILDREN\": 32,\n \"32\": \"SLOTS_CHILDREN\",\n \"TELEPORT\": 64,\n \"64\": \"TELEPORT\",\n \"SUSPENSE\": 128,\n \"128\": \"SUSPENSE\",\n \"COMPONENT_SHOULD_KEEP_ALIVE\": 256,\n \"256\": \"COMPONENT_SHOULD_KEEP_ALIVE\",\n \"COMPONENT_KEPT_ALIVE\": 512,\n \"512\": \"COMPONENT_KEPT_ALIVE\",\n \"COMPONENT\": 6,\n \"6\": \"COMPONENT\"\n};\n\nconst SlotFlags = {\n \"STABLE\": 1,\n \"1\": \"STABLE\",\n \"DYNAMIC\": 2,\n \"2\": \"DYNAMIC\",\n \"FORWARDED\": 3,\n \"3\": \"FORWARDED\"\n};\nconst slotFlagsText = {\n [1]: \"STABLE\",\n [2]: \"DYNAMIC\",\n [3]: \"FORWARDED\"\n};\n\nconst GLOBALS_ALLOWED = \"Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol\";\nconst isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);\nconst isGloballyWhitelisted = isGloballyAllowed;\n\nconst range = 2;\nfunction generateCodeFrame(source, start = 0, end = source.length) {\n start = Math.max(0, Math.min(start, source.length));\n end = Math.max(0, Math.min(end, source.length));\n if (start > end) return \"\";\n let lines = source.split(/(\\r?\\n)/);\n const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);\n lines = lines.filter((_, idx) => idx % 2 === 0);\n let count = 0;\n const res = [];\n for (let i = 0; i < lines.length; i++) {\n count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);\n if (count >= start) {\n for (let j = i - range; j <= i + range || end > count; j++) {\n if (j < 0 || j >= lines.length) continue;\n const line = j + 1;\n res.push(\n `${line}${\" \".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`\n );\n const lineLength = lines[j].length;\n const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;\n if (j === i) {\n const pad = start - (count - (lineLength + newLineSeqLength));\n const length = Math.max(\n 1,\n end > count ? lineLength - pad : end - start\n );\n res.push(` | ` + \" \".repeat(pad) + \"^\".repeat(length));\n } else if (j > i) {\n if (end > count) {\n const length = Math.max(Math.min(end - count, lineLength), 1);\n res.push(` | ` + \"^\".repeat(length));\n }\n count += lineLength + newLineSeqLength;\n }\n }\n break;\n }\n }\n return res.join(\"\\n\");\n}\n\nfunction normalizeStyle(value) {\n if (isArray(value)) {\n const res = {};\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);\n if (normalized) {\n for (const key in normalized) {\n res[key] = normalized[key];\n }\n }\n }\n return res;\n } else if (isString(value) || isObject(value)) {\n return value;\n }\n}\nconst listDelimiterRE = /;(?![^(]*\\))/g;\nconst propertyDelimiterRE = /:([^]+)/;\nconst styleCommentRE = /\\/\\*[^]*?\\*\\//g;\nfunction parseStringStyle(cssText) {\n const ret = {};\n cssText.replace(styleCommentRE, \"\").split(listDelimiterRE).forEach((item) => {\n if (item) {\n const tmp = item.split(propertyDelimiterRE);\n tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\n }\n });\n return ret;\n}\nfunction stringifyStyle(styles) {\n if (!styles) return \"\";\n if (isString(styles)) return styles;\n let ret = \"\";\n for (const key in styles) {\n const value = styles[key];\n if (isString(value) || typeof value === \"number\") {\n const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);\n ret += `${normalizedKey}:${value};`;\n }\n }\n return ret;\n}\nfunction normalizeClass(value) {\n let res = \"\";\n if (isString(value)) {\n res = value;\n } else if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const normalized = normalizeClass(value[i]);\n if (normalized) {\n res += normalized + \" \";\n }\n }\n } else if (isObject(value)) {\n for (const name in value) {\n if (value[name]) {\n res += name + \" \";\n }\n }\n }\n return res.trim();\n}\nfunction normalizeProps(props) {\n if (!props) return null;\n let { class: klass, style } = props;\n if (klass && !isString(klass)) {\n props.class = normalizeClass(klass);\n }\n if (style) {\n props.style = normalizeStyle(style);\n }\n return props;\n}\n\nconst HTML_TAGS = \"html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot\";\nconst SVG_TAGS = \"svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view\";\nconst MATH_TAGS = \"annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics\";\nconst VOID_TAGS = \"area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr\";\nconst isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);\nconst isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);\nconst isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);\nconst isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);\n\nconst specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\nconst isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);\nconst isBooleanAttr = /* @__PURE__ */ makeMap(\n specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`\n);\nfunction includeBooleanAttr(value) {\n return !!value || value === \"\";\n}\nconst unsafeAttrCharRE = /[>/=\"'\\u0009\\u000a\\u000c\\u0020]/;\nconst attrValidationCache = {};\nfunction isSSRSafeAttrName(name) {\n if (attrValidationCache.hasOwnProperty(name)) {\n return attrValidationCache[name];\n }\n const isUnsafe = unsafeAttrCharRE.test(name);\n if (isUnsafe) {\n console.error(`unsafe attribute name: ${name}`);\n }\n return attrValidationCache[name] = !isUnsafe;\n}\nconst propsToAttrMap = {\n acceptCharset: \"accept-charset\",\n className: \"class\",\n htmlFor: \"for\",\n httpEquiv: \"http-equiv\"\n};\nconst isKnownHtmlAttr = /* @__PURE__ */ makeMap(\n `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`\n);\nconst isKnownSvgAttr = /* @__PURE__ */ makeMap(\n `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`\n);\nconst isKnownMathMLAttr = /* @__PURE__ */ makeMap(\n `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns`\n);\nfunction isRenderableAttrValue(value) {\n if (value == null) {\n return false;\n }\n const type = typeof value;\n return type === \"string\" || type === \"number\" || type === \"boolean\";\n}\n\nconst escapeRE = /[\"'&<>]/;\nfunction escapeHtml(string) {\n const str = \"\" + string;\n const match = escapeRE.exec(str);\n if (!match) {\n return str;\n }\n let html = \"\";\n let escaped;\n let index;\n let lastIndex = 0;\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34:\n escaped = \"&quot;\";\n break;\n case 38:\n escaped = \"&amp;\";\n break;\n case 39:\n escaped = \"&#39;\";\n break;\n case 60:\n escaped = \"&lt;\";\n break;\n case 62:\n escaped = \"&gt;\";\n break;\n default:\n continue;\n }\n if (lastIndex !== index) {\n html += str.slice(lastIndex, index);\n }\n lastIndex = index + 1;\n html += escaped;\n }\n return lastIndex !== index ? html + str.slice(lastIndex, index) : html;\n}\nconst commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;\nfunction escapeHtmlComment(src) {\n return src.replace(commentStripRE, \"\");\n}\nconst cssVarNameEscapeSymbolsRE = /[ !\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~]/g;\nfunction getEscapedCssVarName(key, doubleEscape) {\n return key.replace(\n cssVarNameEscapeSymbolsRE,\n (s) => doubleEscape ? s === '\"' ? '\\\\\\\\\\\\\"' : `\\\\\\\\${s}` : `\\\\${s}`\n );\n}\n\nfunction looseCompareArrays(a, b) {\n if (a.length !== b.length) return false;\n let equal = true;\n for (let i = 0; equal && i < a.length; i++) {\n equal = looseEqual(a[i], b[i]);\n }\n return equal;\n}\nfunction looseEqual(a, b) {\n if (a === b) return true;\n let aValidType = isDate(a);\n let bValidType = isDate(b);\n if (aValidType || bValidType) {\n return aValidType && bValidType ? a.getTime() === b.getTime() : false;\n }\n aValidType = isSymbol(a);\n bValidType = isSymbol(b);\n if (aValidType || bValidType) {\n return a === b;\n }\n aValidType = isArray(a);\n bValidType = isArray(b);\n if (aValidType || bValidType) {\n return aValidType && bValidType ? looseCompareArrays(a, b) : false;\n }\n aValidType = isObject(a);\n bValidType = isObject(b);\n if (aValidType || bValidType) {\n if (!aValidType || !bValidType) {\n return false;\n }\n const aKeysCount = Object.keys(a).length;\n const bKeysCount = Object.keys(b).length;\n if (aKeysCount !== bKeysCount) {\n return false;\n }\n for (const key in a) {\n const aHasKey = a.hasOwnProperty(key);\n const bHasKey = b.hasOwnProperty(key);\n if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n return String(a) === String(b);\n}\nfunction looseIndexOf(arr, val) {\n return arr.findIndex((item) => looseEqual(item, val));\n}\n\nconst isRef = (val) => {\n return !!(val && val[\"__v_isRef\"] === true);\n};\nconst toDisplayString = (val) => {\n return isString(val) ? val : val == null ? \"\" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);\n};\nconst replacer = (_key, val) => {\n if (isRef(val)) {\n return replacer(_key, val.value);\n } else if (isMap(val)) {\n return {\n [`Map(${val.size})`]: [...val.entries()].reduce(\n (entries, [key, val2], i) => {\n entries[stringifySymbol(key, i) + \" =>\"] = val2;\n return entries;\n },\n {}\n )\n };\n } else if (isSet(val)) {\n return {\n [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))\n };\n } else if (isSymbol(val)) {\n return stringifySymbol(val);\n } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {\n return String(val);\n }\n return val;\n};\nconst stringifySymbol = (v, i = \"\") => {\n var _a;\n return (\n // Symbol.description in es2019+ so we need to cast here to pass\n // the lib: es2016 check\n isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v\n );\n};\n\nfunction normalizeCssVarValue(value) {\n if (value == null) {\n return \"initial\";\n }\n if (typeof value === \"string\") {\n return value === \"\" ? \" \" : value;\n }\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n {\n console.warn(\n \"[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:\",\n value\n );\n }\n }\n return String(value);\n}\n\nexports.EMPTY_ARR = EMPTY_ARR;\nexports.EMPTY_OBJ = EMPTY_OBJ;\nexports.NO = NO;\nexports.NOOP = NOOP;\nexports.PatchFlagNames = PatchFlagNames;\nexports.PatchFlags = PatchFlags;\nexports.ShapeFlags = ShapeFlags;\nexports.SlotFlags = SlotFlags;\nexports.camelize = camelize;\nexports.capitalize = capitalize;\nexports.cssVarNameEscapeSymbolsRE = cssVarNameEscapeSymbolsRE;\nexports.def = def;\nexports.escapeHtml = escapeHtml;\nexports.escapeHtmlComment = escapeHtmlComment;\nexports.extend = extend;\nexports.genCacheKey = genCacheKey;\nexports.genPropsAccessExp = genPropsAccessExp;\nexports.generateCodeFrame = generateCodeFrame;\nexports.getEscapedCssVarName = getEscapedCssVarName;\nexports.getGlobalThis = getGlobalThis;\nexports.hasChanged = hasChanged;\nexports.hasOwn = hasOwn;\nexports.hyphenate = hyphenate;\nexports.includeBooleanAttr = includeBooleanAttr;\nexports.invokeArrayFns = invokeArrayFns;\nexports.isArray = isArray;\nexports.isBooleanAttr = isBooleanAttr;\nexports.isBuiltInDirective = isBuiltInDirective;\nexports.isDate = isDate;\nexports.isFunction = isFunction;\nexports.isGloballyAllowed = isGloballyAllowed;\nexports.isGloballyWhitelisted = isGloballyWhitelisted;\nexports.isHTMLTag = isHTMLTag;\nexports.isIntegerKey = isIntegerKey;\nexports.isKnownHtmlAttr = isKnownHtmlAttr;\nexports.isKnownMathMLAttr = isKnownMathMLAttr;\nexports.isKnownSvgAttr = isKnownSvgAttr;\nexports.isMap = isMap;\nexports.isMathMLTag = isMathMLTag;\nexports.isModelListener = isModelListener;\nexports.isObject = isObject;\nexports.isOn = isOn;\nexports.isPlainObject = isPlainObject;\nexports.isPromise = isPromise;\nexports.isRegExp = isRegExp;\nexports.isRenderableAttrValue = isRenderableAttrValue;\nexports.isReservedProp = isReservedProp;\nexports.isSSRSafeAttrName = isSSRSafeAttrName;\nexports.isSVGTag = isSVGTag;\nexports.isSet = isSet;\nexports.isSpecialBooleanAttr = isSpecialBooleanAttr;\nexports.isString = isString;\nexports.isSymbol = isSymbol;\nexports.isVoidTag = isVoidTag;\nexports.looseEqual = looseEqual;\nexports.looseIndexOf = looseIndexOf;\nexports.looseToNumber = looseToNumber;\nexports.makeMap = makeMap;\nexports.normalizeClass = normalizeClass;\nexports.normalizeCssVarValue = normalizeCssVarValue;\nexports.normalizeProps = normalizeProps;\nexports.normalizeStyle = normalizeStyle;\nexports.objectToString = objectToString;\nexports.parseStringStyle = parseStringStyle;\nexports.propsToAttrMap = propsToAttrMap;\nexports.remove = remove;\nexports.slotFlagsText = slotFlagsText;\nexports.stringifyStyle = stringifyStyle;\nexports.toDisplayString = toDisplayString;\nexports.toHandlerKey = toHandlerKey;\nexports.toNumber = toNumber;\nexports.toRawType = toRawType;\nexports.toTypeString = toTypeString;\n","'use strict'\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./dist/shared.cjs.prod.js')\n} else {\n module.exports = require('./dist/shared.cjs.js')\n}\n","\"use strict\";\n// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromCodePoint = void 0;\nexports.replaceCodePoint = replaceCodePoint;\nexports.decodeCodePoint = decodeCodePoint;\nconst decodeMap = new Map([\n [0, 65533],\n // C1 Unicode control character reference replacements\n [128, 8364],\n [130, 8218],\n [131, 402],\n [132, 8222],\n [133, 8230],\n [134, 8224],\n [135, 8225],\n [136, 710],\n [137, 8240],\n [138, 352],\n [139, 8249],\n [140, 338],\n [142, 381],\n [145, 8216],\n [146, 8217],\n [147, 8220],\n [148, 8221],\n [149, 8226],\n [150, 8211],\n [151, 8212],\n [152, 732],\n [153, 8482],\n [154, 353],\n [155, 8250],\n [156, 339],\n [158, 382],\n [159, 376],\n]);\n/**\n * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.\n */\nexports.fromCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, n/no-unsupported-features/es-builtins\n(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : ((codePoint) => {\n let output = \"\";\n if (codePoint > 65535) {\n codePoint -= 65536;\n output += String.fromCharCode(((codePoint >>> 10) & 1023) | 55296);\n codePoint = 56320 | (codePoint & 1023);\n }\n output += String.fromCharCode(codePoint);\n return output;\n});\n/**\n * Replace the given code point with a replacement character if it is a\n * surrogate or is outside the valid range. Otherwise return the code\n * point unchanged.\n */\nfunction replaceCodePoint(codePoint) {\n var _a;\n if ((codePoint >= 55296 && codePoint <= 57343) ||\n codePoint > 1114111) {\n return 65533;\n }\n return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;\n}\n/**\n * Replace the code point if relevant, then convert it to a string.\n *\n * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.\n * @param codePoint The code point to decode.\n * @returns The decoded code point.\n */\nfunction decodeCodePoint(codePoint) {\n return (0, exports.fromCodePoint)(replaceCodePoint(codePoint));\n}\n//# sourceMappingURL=decode-codepoint.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decodeBase64 = decodeBase64;\n/*\n * Shared base64 decode helper for generated decode data.\n * Assumes global atob is available.\n */\nfunction decodeBase64(input) {\n const binary = \n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n typeof atob === \"function\"\n ? // Browser (and Node >=16)\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n atob(input)\n : // Older Node versions (<16)\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n typeof Buffer.from === \"function\"\n ? // eslint-disable-next-line n/no-unsupported-features/node-builtins\n Buffer.from(input, \"base64\").toString(\"binary\")\n : // eslint-disable-next-line unicorn/no-new-buffer, n/no-deprecated-api\n new Buffer(input, \"base64\").toString(\"binary\");\n const evenLength = binary.length & ~1; // Round down to even length\n const out = new Uint16Array(evenLength / 2);\n for (let index = 0, outIndex = 0; index < evenLength; index += 2) {\n const lo = binary.charCodeAt(index);\n const hi = binary.charCodeAt(index + 1);\n out[outIndex++] = lo | (hi << 8);\n }\n return out;\n}\n//# sourceMappingURL=decode-shared.js.map","\"use strict\";\n// Generated using scripts/write-decode-map.ts\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.htmlDecodeTree = void 0;\nconst decode_shared_js_1 = require(\"../internal/decode-shared.js\");\nexports.htmlDecodeTree = (0, decode_shared_js_1.decodeBase64)(\"QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQAR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Lt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg\");\n//# sourceMappingURL=decode-data-html.js.map","\"use strict\";\n// Generated using scripts/write-decode-map.ts\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.xmlDecodeTree = void 0;\nconst decode_shared_js_1 = require(\"../internal/decode-shared.js\");\nexports.xmlDecodeTree = (0, decode_shared_js_1.decodeBase64)(\"AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg\");\n//# sourceMappingURL=decode-data-xml.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BinTrieFlags = void 0;\n/**\n * Bit flags & masks for the binary trie encoding used for entity decoding.\n *\n * Bit layout (16 bits total):\n * 15..14 VALUE_LENGTH (+1 encoding; 0 => no value)\n * 13 FLAG13. If valueLength>0: semicolon required flag (implicit ';').\n * If valueLength==0: compact run flag.\n * 12..7 BRANCH_LENGTH Branch length (0 => single branch in 6..0 if jumpOffset==char) OR run length (when compact run)\n * 6..0 JUMP_TABLE Jump offset (jump table) OR single-branch char code OR first run char\n */\nvar BinTrieFlags;\n(function (BinTrieFlags) {\n BinTrieFlags[BinTrieFlags[\"VALUE_LENGTH\"] = 49152] = \"VALUE_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"FLAG13\"] = 8192] = \"FLAG13\";\n BinTrieFlags[BinTrieFlags[\"BRANCH_LENGTH\"] = 8064] = \"BRANCH_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"JUMP_TABLE\"] = 127] = \"JUMP_TABLE\";\n})(BinTrieFlags || (exports.BinTrieFlags = BinTrieFlags = {}));\n//# sourceMappingURL=bin-trie-flags.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.xmlDecodeTree = exports.htmlDecodeTree = exports.replaceCodePoint = exports.fromCodePoint = exports.decodeCodePoint = exports.EntityDecoder = exports.DecodingMode = void 0;\nexports.determineBranch = determineBranch;\nexports.decodeHTML = decodeHTML;\nexports.decodeHTMLAttribute = decodeHTMLAttribute;\nexports.decodeHTMLStrict = decodeHTMLStrict;\nexports.decodeXML = decodeXML;\nconst decode_codepoint_js_1 = require(\"./decode-codepoint.js\");\nconst decode_data_html_js_1 = require(\"./generated/decode-data-html.js\");\nconst decode_data_xml_js_1 = require(\"./generated/decode-data-xml.js\");\nconst bin_trie_flags_js_1 = require(\"./internal/bin-trie-flags.js\");\nvar CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"NUM\"] = 35] = \"NUM\";\n CharCodes[CharCodes[\"SEMI\"] = 59] = \"SEMI\";\n CharCodes[CharCodes[\"EQUALS\"] = 61] = \"EQUALS\";\n CharCodes[CharCodes[\"ZERO\"] = 48] = \"ZERO\";\n CharCodes[CharCodes[\"NINE\"] = 57] = \"NINE\";\n CharCodes[CharCodes[\"LOWER_A\"] = 97] = \"LOWER_A\";\n CharCodes[CharCodes[\"LOWER_F\"] = 102] = \"LOWER_F\";\n CharCodes[CharCodes[\"LOWER_X\"] = 120] = \"LOWER_X\";\n CharCodes[CharCodes[\"LOWER_Z\"] = 122] = \"LOWER_Z\";\n CharCodes[CharCodes[\"UPPER_A\"] = 65] = \"UPPER_A\";\n CharCodes[CharCodes[\"UPPER_F\"] = 70] = \"UPPER_F\";\n CharCodes[CharCodes[\"UPPER_Z\"] = 90] = \"UPPER_Z\";\n})(CharCodes || (CharCodes = {}));\n/** Bit that needs to be set to convert an upper case ASCII character to lower case */\nconst TO_LOWER_BIT = 32;\nfunction isNumber(code) {\n return code >= CharCodes.ZERO && code <= CharCodes.NINE;\n}\nfunction isHexadecimalCharacter(code) {\n return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) ||\n (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F));\n}\nfunction isAsciiAlphaNumeric(code) {\n return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) ||\n (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) ||\n isNumber(code));\n}\n/**\n * Checks if the given character is a valid end character for an entity in an attribute.\n *\n * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.\n * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state\n */\nfunction isEntityInAttributeInvalidEnd(code) {\n return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);\n}\nvar EntityDecoderState;\n(function (EntityDecoderState) {\n EntityDecoderState[EntityDecoderState[\"EntityStart\"] = 0] = \"EntityStart\";\n EntityDecoderState[EntityDecoderState[\"NumericStart\"] = 1] = \"NumericStart\";\n EntityDecoderState[EntityDecoderState[\"NumericDecimal\"] = 2] = \"NumericDecimal\";\n EntityDecoderState[EntityDecoderState[\"NumericHex\"] = 3] = \"NumericHex\";\n EntityDecoderState[EntityDecoderState[\"NamedEntity\"] = 4] = \"NamedEntity\";\n})(EntityDecoderState || (EntityDecoderState = {}));\nvar DecodingMode;\n(function (DecodingMode) {\n /** Entities in text nodes that can end with any character. */\n DecodingMode[DecodingMode[\"Legacy\"] = 0] = \"Legacy\";\n /** Only allow entities terminated with a semicolon. */\n DecodingMode[DecodingMode[\"Strict\"] = 1] = \"Strict\";\n /** Entities in attributes have limitations on ending characters. */\n DecodingMode[DecodingMode[\"Attribute\"] = 2] = \"Attribute\";\n})(DecodingMode || (exports.DecodingMode = DecodingMode = {}));\n/**\n * Token decoder with support of writing partial entities.\n */\nclass EntityDecoder {\n constructor(\n /** The tree used to decode entities. */\n // biome-ignore lint/correctness/noUnusedPrivateClassMembers: False positive\n decodeTree, \n /**\n * The function that is called when a codepoint is decoded.\n *\n * For multi-byte named entities, this will be called multiple times,\n * with the second codepoint, and the same `consumed` value.\n *\n * @param codepoint The decoded codepoint.\n * @param consumed The number of bytes consumed by the decoder.\n */\n emitCodePoint, \n /** An object that is used to produce errors. */\n errors) {\n this.decodeTree = decodeTree;\n this.emitCodePoint = emitCodePoint;\n this.errors = errors;\n /** The current state of the decoder. */\n this.state = EntityDecoderState.EntityStart;\n /** Characters that were consumed while parsing an entity. */\n this.consumed = 1;\n /**\n * The result of the entity.\n *\n * Either the result index of a numeric entity, or the codepoint of a\n * numeric entity.\n */\n this.result = 0;\n /** The current index in the decode tree. */\n this.treeIndex = 0;\n /** The number of characters that were consumed in excess. */\n this.excess = 1;\n /** The mode in which the decoder is operating. */\n this.decodeMode = DecodingMode.Strict;\n }\n /** Resets the instance to make it reusable. */\n startEntity(decodeMode) {\n this.decodeMode = decodeMode;\n this.state = EntityDecoderState.EntityStart;\n this.result = 0;\n this.treeIndex = 0;\n this.excess = 1;\n this.consumed = 1;\n }\n /**\n * Write an entity to the decoder. This can be called multiple times with partial entities.\n * If the entity is incomplete, the decoder will return -1.\n *\n * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the\n * entity is incomplete, and resume when the next string is written.\n *\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n write(input, offset) {\n switch (this.state) {\n case EntityDecoderState.EntityStart: {\n if (input.charCodeAt(offset) === CharCodes.NUM) {\n this.state = EntityDecoderState.NumericStart;\n this.consumed += 1;\n return this.stateNumericStart(input, offset + 1);\n }\n this.state = EntityDecoderState.NamedEntity;\n return this.stateNamedEntity(input, offset);\n }\n case EntityDecoderState.NumericStart: {\n return this.stateNumericStart(input, offset);\n }\n case EntityDecoderState.NumericDecimal: {\n return this.stateNumericDecimal(input, offset);\n }\n case EntityDecoderState.NumericHex: {\n return this.stateNumericHex(input, offset);\n }\n case EntityDecoderState.NamedEntity: {\n return this.stateNamedEntity(input, offset);\n }\n }\n }\n /**\n * Switches between the numeric decimal and hexadecimal states.\n *\n * Equivalent to the `Numeric character reference state` in the HTML spec.\n *\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericStart(input, offset) {\n if (offset >= input.length) {\n return -1;\n }\n if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {\n this.state = EntityDecoderState.NumericHex;\n this.consumed += 1;\n return this.stateNumericHex(input, offset + 1);\n }\n this.state = EntityDecoderState.NumericDecimal;\n return this.stateNumericDecimal(input, offset);\n }\n /**\n * Parses a hexadecimal numeric entity.\n *\n * Equivalent to the `Hexademical character reference state` in the HTML spec.\n *\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericHex(input, offset) {\n while (offset < input.length) {\n const char = input.charCodeAt(offset);\n if (isNumber(char) || isHexadecimalCharacter(char)) {\n // Convert hex digit to value (0-15); 'a'/'A' -> 10.\n const digit = char <= CharCodes.NINE\n ? char - CharCodes.ZERO\n : (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;\n this.result = this.result * 16 + digit;\n this.consumed++;\n offset++;\n }\n else {\n return this.emitNumericEntity(char, 3);\n }\n }\n return -1; // Incomplete entity\n }\n /**\n * Parses a decimal numeric entity.\n *\n * Equivalent to the `Decimal character reference state` in the HTML spec.\n *\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericDecimal(input, offset) {\n while (offset < input.length) {\n const char = input.charCodeAt(offset);\n if (isNumber(char)) {\n this.result = this.result * 10 + (char - CharCodes.ZERO);\n this.consumed++;\n offset++;\n }\n else {\n return this.emitNumericEntity(char, 2);\n }\n }\n return -1; // Incomplete entity\n }\n /**\n * Validate and emit a numeric entity.\n *\n * Implements the logic from the `Hexademical character reference start\n * state` and `Numeric character reference end state` in the HTML spec.\n *\n * @param lastCp The last code point of the entity. Used to see if the\n * entity was terminated with a semicolon.\n * @param expectedLength The minimum number of characters that should be\n * consumed. Used to validate that at least one digit\n * was consumed.\n * @returns The number of characters that were consumed.\n */\n emitNumericEntity(lastCp, expectedLength) {\n var _a;\n // Ensure we consumed at least one digit.\n if (this.consumed <= expectedLength) {\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n // Figure out if this is a legit end of the entity\n if (lastCp === CharCodes.SEMI) {\n this.consumed += 1;\n }\n else if (this.decodeMode === DecodingMode.Strict) {\n return 0;\n }\n this.emitCodePoint((0, decode_codepoint_js_1.replaceCodePoint)(this.result), this.consumed);\n if (this.errors) {\n if (lastCp !== CharCodes.SEMI) {\n this.errors.missingSemicolonAfterCharacterReference();\n }\n this.errors.validateNumericCharacterReference(this.result);\n }\n return this.consumed;\n }\n /**\n * Parses a named entity.\n *\n * Equivalent to the `Named character reference state` in the HTML spec.\n *\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNamedEntity(input, offset) {\n const { decodeTree } = this;\n let current = decodeTree[this.treeIndex];\n // The length is the number of bytes of the value, including the current byte.\n let valueLength = (current & bin_trie_flags_js_1.BinTrieFlags.VALUE_LENGTH) >> 14;\n while (offset < input.length) {\n // Handle compact runs (possibly inline): valueLength == 0 and SEMI_REQUIRED bit set.\n if (valueLength === 0 && (current & bin_trie_flags_js_1.BinTrieFlags.FLAG13) !== 0) {\n const runLength = (current & bin_trie_flags_js_1.BinTrieFlags.BRANCH_LENGTH) >> 7; /* 2..63 */\n const firstChar = current & bin_trie_flags_js_1.BinTrieFlags.JUMP_TABLE;\n // Fast-fail if we don't have enough remaining input for the full run (incomplete entity)\n if (offset + runLength > input.length)\n return -1;\n // Verify first char\n if (input.charCodeAt(offset) !== firstChar) {\n return this.result === 0\n ? 0\n : this.emitNotTerminatedNamedEntity();\n }\n offset++;\n this.excess++;\n // Remaining characters after the first\n const remaining = runLength - 1;\n // Iterate over packed 2-char words\n for (let runPos = 1; runPos < runLength; runPos += 2) {\n const packedWord = decodeTree[this.treeIndex + 1 + ((runPos - 1) >> 1)];\n const low = packedWord & 0xff;\n if (input.charCodeAt(offset) !== low) {\n return this.result === 0\n ? 0\n : this.emitNotTerminatedNamedEntity();\n }\n offset++;\n this.excess++;\n const high = (packedWord >> 8) & 0xff;\n if (runPos + 1 < runLength) {\n if (input.charCodeAt(offset) !== high) {\n return this.result === 0\n ? 0\n : this.emitNotTerminatedNamedEntity();\n }\n offset++;\n this.excess++;\n }\n }\n this.treeIndex += 1 + ((remaining + 1) >> 1);\n current = decodeTree[this.treeIndex];\n valueLength = (current & bin_trie_flags_js_1.BinTrieFlags.VALUE_LENGTH) >> 14;\n }\n if (offset >= input.length)\n break;\n const char = input.charCodeAt(offset);\n /*\n * Implicit semicolon handling for nodes that require a semicolon but\n * don't have an explicit ';' branch stored in the trie. If we have\n * a value on the current node, it requires a semicolon, and the\n * current input character is a semicolon, emit the entity using the\n * current node (without descending further).\n */\n if (char === CharCodes.SEMI &&\n valueLength !== 0 &&\n (current & bin_trie_flags_js_1.BinTrieFlags.FLAG13) !== 0) {\n return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);\n }\n this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);\n if (this.treeIndex < 0) {\n return this.result === 0 ||\n // If we are parsing an attribute\n (this.decodeMode === DecodingMode.Attribute &&\n // We shouldn't have consumed any characters after the entity,\n (valueLength === 0 ||\n // And there should be no invalid characters.\n isEntityInAttributeInvalidEnd(char)))\n ? 0\n : this.emitNotTerminatedNamedEntity();\n }\n current = decodeTree[this.treeIndex];\n valueLength = (current & bin_trie_flags_js_1.BinTrieFlags.VALUE_LENGTH) >> 14;\n // If the branch is a value, store it and continue\n if (valueLength !== 0) {\n // If the entity is terminated by a semicolon, we are done.\n if (char === CharCodes.SEMI) {\n return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);\n }\n // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.\n if (this.decodeMode !== DecodingMode.Strict &&\n (current & bin_trie_flags_js_1.BinTrieFlags.FLAG13) === 0) {\n this.result = this.treeIndex;\n this.consumed += this.excess;\n this.excess = 0;\n }\n }\n // Increment offset & excess for next iteration\n offset++;\n this.excess++;\n }\n return -1;\n }\n /**\n * Emit a named entity that was not terminated with a semicolon.\n *\n * @returns The number of characters consumed.\n */\n emitNotTerminatedNamedEntity() {\n var _a;\n const { result, decodeTree } = this;\n const valueLength = (decodeTree[result] & bin_trie_flags_js_1.BinTrieFlags.VALUE_LENGTH) >> 14;\n this.emitNamedEntityData(result, valueLength, this.consumed);\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();\n return this.consumed;\n }\n /**\n * Emit a named entity.\n *\n * @param result The index of the entity in the decode tree.\n * @param valueLength The number of bytes in the entity.\n * @param consumed The number of characters consumed.\n *\n * @returns The number of characters consumed.\n */\n emitNamedEntityData(result, valueLength, consumed) {\n const { decodeTree } = this;\n this.emitCodePoint(valueLength === 1\n ? decodeTree[result] &\n ~(bin_trie_flags_js_1.BinTrieFlags.VALUE_LENGTH | bin_trie_flags_js_1.BinTrieFlags.FLAG13)\n : decodeTree[result + 1], consumed);\n if (valueLength === 3) {\n // For multi-byte values, we need to emit the second byte.\n this.emitCodePoint(decodeTree[result + 2], consumed);\n }\n return consumed;\n }\n /**\n * Signal to the parser that the end of the input was reached.\n *\n * Remaining data will be emitted and relevant errors will be produced.\n *\n * @returns The number of characters consumed.\n */\n end() {\n var _a;\n switch (this.state) {\n case EntityDecoderState.NamedEntity: {\n // Emit a named entity if we have one.\n return this.result !== 0 &&\n (this.decodeMode !== DecodingMode.Attribute ||\n this.result === this.treeIndex)\n ? this.emitNotTerminatedNamedEntity()\n : 0;\n }\n // Otherwise, emit a numeric entity if we have one.\n case EntityDecoderState.NumericDecimal: {\n return this.emitNumericEntity(0, 2);\n }\n case EntityDecoderState.NumericHex: {\n return this.emitNumericEntity(0, 3);\n }\n case EntityDecoderState.NumericStart: {\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n case EntityDecoderState.EntityStart: {\n // Return 0 if we have no entity.\n return 0;\n }\n }\n }\n}\nexports.EntityDecoder = EntityDecoder;\n/**\n * Creates a function that decodes entities in a string.\n *\n * @param decodeTree The decode tree.\n * @returns A function that decodes entities in a string.\n */\nfunction getDecoder(decodeTree) {\n let returnValue = \"\";\n const decoder = new EntityDecoder(decodeTree, (data) => (returnValue += (0, decode_codepoint_js_1.fromCodePoint)(data)));\n return function decodeWithTrie(input, decodeMode) {\n let lastIndex = 0;\n let offset = 0;\n while ((offset = input.indexOf(\"&\", offset)) >= 0) {\n returnValue += input.slice(lastIndex, offset);\n decoder.startEntity(decodeMode);\n const length = decoder.write(input, \n // Skip the \"&\"\n offset + 1);\n if (length < 0) {\n lastIndex = offset + decoder.end();\n break;\n }\n lastIndex = offset + length;\n // If `length` is 0, skip the current `&` and continue.\n offset = length === 0 ? lastIndex + 1 : lastIndex;\n }\n const result = returnValue + input.slice(lastIndex);\n // Make sure we don't keep a reference to the final string.\n returnValue = \"\";\n return result;\n };\n}\n/**\n * Determines the branch of the current node that is taken given the current\n * character. This function is used to traverse the trie.\n *\n * @param decodeTree The trie.\n * @param current The current node.\n * @param nodeIdx The index right after the current node and its value.\n * @param char The current character.\n * @returns The index of the next node, or -1 if no branch is taken.\n */\nfunction determineBranch(decodeTree, current, nodeIndex, char) {\n const branchCount = (current & bin_trie_flags_js_1.BinTrieFlags.BRANCH_LENGTH) >> 7;\n const jumpOffset = current & bin_trie_flags_js_1.BinTrieFlags.JUMP_TABLE;\n // Case 1: Single branch encoded in jump offset\n if (branchCount === 0) {\n return jumpOffset !== 0 && char === jumpOffset ? nodeIndex : -1;\n }\n // Case 2: Multiple branches encoded in jump table\n if (jumpOffset) {\n const value = char - jumpOffset;\n return value < 0 || value >= branchCount\n ? -1\n : decodeTree[nodeIndex + value] - 1;\n }\n // Case 3: Multiple branches encoded in packed dictionary (two keys per uint16)\n const packedKeySlots = (branchCount + 1) >> 1;\n /*\n * Treat packed keys as a virtual sorted array of length `branchCount`.\n * Key(i) = low byte for even i, high byte for odd i in slot i>>1.\n */\n let lo = 0;\n let hi = branchCount - 1;\n while (lo <= hi) {\n const mid = (lo + hi) >>> 1;\n const slot = mid >> 1;\n const packed = decodeTree[nodeIndex + slot];\n const midKey = (packed >> ((mid & 1) * 8)) & 0xff;\n if (midKey < char) {\n lo = mid + 1;\n }\n else if (midKey > char) {\n hi = mid - 1;\n }\n else {\n return decodeTree[nodeIndex + packedKeySlots + mid];\n }\n }\n return -1;\n}\nconst htmlDecoder = /* #__PURE__ */ getDecoder(decode_data_html_js_1.htmlDecodeTree);\nconst xmlDecoder = /* #__PURE__ */ getDecoder(decode_data_xml_js_1.xmlDecodeTree);\n/**\n * Decodes an HTML string.\n *\n * @param htmlString The string to decode.\n * @param mode The decoding mode.\n * @returns The decoded string.\n */\nfunction decodeHTML(htmlString, mode = DecodingMode.Legacy) {\n return htmlDecoder(htmlString, mode);\n}\n/**\n * Decodes an HTML string in an attribute.\n *\n * @param htmlAttribute The string to decode.\n * @returns The decoded string.\n */\nfunction decodeHTMLAttribute(htmlAttribute) {\n return htmlDecoder(htmlAttribute, DecodingMode.Attribute);\n}\n/**\n * Decodes an HTML string, requiring all entities to be terminated by a semicolon.\n *\n * @param htmlString The string to decode.\n * @returns The decoded string.\n */\nfunction decodeHTMLStrict(htmlString) {\n return htmlDecoder(htmlString, DecodingMode.Strict);\n}\n/**\n * Decodes an XML string, requiring all entities to be terminated by a semicolon.\n *\n * @param xmlString The string to decode.\n * @returns The decoded string.\n */\nfunction decodeXML(xmlString) {\n return xmlDecoder(xmlString, DecodingMode.Strict);\n}\nvar decode_codepoint_js_2 = require(\"./decode-codepoint.js\");\nObject.defineProperty(exports, \"decodeCodePoint\", { enumerable: true, get: function () { return decode_codepoint_js_2.decodeCodePoint; } });\nObject.defineProperty(exports, \"fromCodePoint\", { enumerable: true, get: function () { return decode_codepoint_js_2.fromCodePoint; } });\nObject.defineProperty(exports, \"replaceCodePoint\", { enumerable: true, get: function () { return decode_codepoint_js_2.replaceCodePoint; } });\n// Re-export for use by eg. htmlparser2\nvar decode_data_html_js_2 = require(\"./generated/decode-data-html.js\");\nObject.defineProperty(exports, \"htmlDecodeTree\", { enumerable: true, get: function () { return decode_data_html_js_2.htmlDecodeTree; } });\nvar decode_data_xml_js_2 = require(\"./generated/decode-data-xml.js\");\nObject.defineProperty(exports, \"xmlDecodeTree\", { enumerable: true, get: function () { return decode_data_xml_js_2.xmlDecodeTree; } });\n//# sourceMappingURL=decode.js.map","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(global = global || self, factory(global.estreeWalker = {}));\n}(this, (function (exports) { 'use strict';\n\n\t// @ts-check\n\t/** @typedef { import('estree').BaseNode} BaseNode */\n\n\t/** @typedef {{\n\t\tskip: () => void;\n\t\tremove: () => void;\n\t\treplace: (node: BaseNode) => void;\n\t}} WalkerContext */\n\n\tclass WalkerBase {\n\t\tconstructor() {\n\t\t\t/** @type {boolean} */\n\t\t\tthis.should_skip = false;\n\n\t\t\t/** @type {boolean} */\n\t\t\tthis.should_remove = false;\n\n\t\t\t/** @type {BaseNode | null} */\n\t\t\tthis.replacement = null;\n\n\t\t\t/** @type {WalkerContext} */\n\t\t\tthis.context = {\n\t\t\t\tskip: () => (this.should_skip = true),\n\t\t\t\tremove: () => (this.should_remove = true),\n\t\t\t\treplace: (node) => (this.replacement = node)\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t *\n\t\t * @param {any} parent\n\t\t * @param {string} prop\n\t\t * @param {number} index\n\t\t * @param {BaseNode} node\n\t\t */\n\t\treplace(parent, prop, index, node) {\n\t\t\tif (parent) {\n\t\t\t\tif (index !== null) {\n\t\t\t\t\tparent[prop][index] = node;\n\t\t\t\t} else {\n\t\t\t\t\tparent[prop] = node;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t *\n\t\t * @param {any} parent\n\t\t * @param {string} prop\n\t\t * @param {number} index\n\t\t */\n\t\tremove(parent, prop, index) {\n\t\t\tif (parent) {\n\t\t\t\tif (index !== null) {\n\t\t\t\t\tparent[prop].splice(index, 1);\n\t\t\t\t} else {\n\t\t\t\t\tdelete parent[prop];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// @ts-check\n\n\t/** @typedef { import('estree').BaseNode} BaseNode */\n\t/** @typedef { import('./walker.js').WalkerContext} WalkerContext */\n\n\t/** @typedef {(\n\t * this: WalkerContext,\n\t * node: BaseNode,\n\t * parent: BaseNode,\n\t * key: string,\n\t * index: number\n\t * ) => void} SyncHandler */\n\n\tclass SyncWalker extends WalkerBase {\n\t\t/**\n\t\t *\n\t\t * @param {SyncHandler} enter\n\t\t * @param {SyncHandler} leave\n\t\t */\n\t\tconstructor(enter, leave) {\n\t\t\tsuper();\n\n\t\t\t/** @type {SyncHandler} */\n\t\t\tthis.enter = enter;\n\n\t\t\t/** @type {SyncHandler} */\n\t\t\tthis.leave = leave;\n\t\t}\n\n\t\t/**\n\t\t *\n\t\t * @param {BaseNode} node\n\t\t * @param {BaseNode} parent\n\t\t * @param {string} [prop]\n\t\t * @param {number} [index]\n\t\t * @returns {BaseNode}\n\t\t */\n\t\tvisit(node, parent, prop, index) {\n\t\t\tif (node) {\n\t\t\t\tif (this.enter) {\n\t\t\t\t\tconst _should_skip = this.should_skip;\n\t\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\t\tthis.should_skip = false;\n\t\t\t\t\tthis.should_remove = false;\n\t\t\t\t\tthis.replacement = null;\n\n\t\t\t\t\tthis.enter.call(this.context, node, parent, prop, index);\n\n\t\t\t\t\tif (this.replacement) {\n\t\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.should_remove) {\n\t\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst skipped = this.should_skip;\n\t\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\t\tthis.should_skip = _should_skip;\n\t\t\t\t\tthis.should_remove = _should_remove;\n\t\t\t\t\tthis.replacement = _replacement;\n\n\t\t\t\t\tif (skipped) return node;\n\t\t\t\t\tif (removed) return null;\n\t\t\t\t}\n\n\t\t\t\tfor (const key in node) {\n\t\t\t\t\tconst value = node[key];\n\n\t\t\t\t\tif (typeof value !== \"object\") {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (Array.isArray(value)) {\n\t\t\t\t\t\tfor (let i = 0; i < value.length; i += 1) {\n\t\t\t\t\t\t\tif (value[i] !== null && typeof value[i].type === 'string') {\n\t\t\t\t\t\t\t\tif (!this.visit(value[i], node, key, i)) {\n\t\t\t\t\t\t\t\t\t// removed\n\t\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (value !== null && typeof value.type === \"string\") {\n\t\t\t\t\t\tthis.visit(value, node, key, null);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.leave) {\n\t\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\t\tthis.replacement = null;\n\t\t\t\t\tthis.should_remove = false;\n\n\t\t\t\t\tthis.leave.call(this.context, node, parent, prop, index);\n\n\t\t\t\t\tif (this.replacement) {\n\t\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.should_remove) {\n\t\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\t\tthis.replacement = _replacement;\n\t\t\t\t\tthis.should_remove = _should_remove;\n\n\t\t\t\t\tif (removed) return null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn node;\n\t\t}\n\t}\n\n\t// @ts-check\n\n\t/** @typedef { import('estree').BaseNode} BaseNode */\n\t/** @typedef { import('./walker').WalkerContext} WalkerContext */\n\n\t/** @typedef {(\n\t * this: WalkerContext,\n\t * node: BaseNode,\n\t * parent: BaseNode,\n\t * key: string,\n\t * index: number\n\t * ) => Promise<void>} AsyncHandler */\n\n\tclass AsyncWalker extends WalkerBase {\n\t\t/**\n\t\t *\n\t\t * @param {AsyncHandler} enter\n\t\t * @param {AsyncHandler} leave\n\t\t */\n\t\tconstructor(enter, leave) {\n\t\t\tsuper();\n\n\t\t\t/** @type {AsyncHandler} */\n\t\t\tthis.enter = enter;\n\n\t\t\t/** @type {AsyncHandler} */\n\t\t\tthis.leave = leave;\n\t\t}\n\n\t\t/**\n\t\t *\n\t\t * @param {BaseNode} node\n\t\t * @param {BaseNode} parent\n\t\t * @param {string} [prop]\n\t\t * @param {number} [index]\n\t\t * @returns {Promise<BaseNode>}\n\t\t */\n\t\tasync visit(node, parent, prop, index) {\n\t\t\tif (node) {\n\t\t\t\tif (this.enter) {\n\t\t\t\t\tconst _should_skip = this.should_skip;\n\t\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\t\tthis.should_skip = false;\n\t\t\t\t\tthis.should_remove = false;\n\t\t\t\t\tthis.replacement = null;\n\n\t\t\t\t\tawait this.enter.call(this.context, node, parent, prop, index);\n\n\t\t\t\t\tif (this.replacement) {\n\t\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.should_remove) {\n\t\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst skipped = this.should_skip;\n\t\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\t\tthis.should_skip = _should_skip;\n\t\t\t\t\tthis.should_remove = _should_remove;\n\t\t\t\t\tthis.replacement = _replacement;\n\n\t\t\t\t\tif (skipped) return node;\n\t\t\t\t\tif (removed) return null;\n\t\t\t\t}\n\n\t\t\t\tfor (const key in node) {\n\t\t\t\t\tconst value = node[key];\n\n\t\t\t\t\tif (typeof value !== \"object\") {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (Array.isArray(value)) {\n\t\t\t\t\t\tfor (let i = 0; i < value.length; i += 1) {\n\t\t\t\t\t\t\tif (value[i] !== null && typeof value[i].type === 'string') {\n\t\t\t\t\t\t\t\tif (!(await this.visit(value[i], node, key, i))) {\n\t\t\t\t\t\t\t\t\t// removed\n\t\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (value !== null && typeof value.type === \"string\") {\n\t\t\t\t\t\tawait this.visit(value, node, key, null);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.leave) {\n\t\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\t\tthis.replacement = null;\n\t\t\t\t\tthis.should_remove = false;\n\n\t\t\t\t\tawait this.leave.call(this.context, node, parent, prop, index);\n\n\t\t\t\t\tif (this.replacement) {\n\t\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.should_remove) {\n\t\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\t\tthis.replacement = _replacement;\n\t\t\t\t\tthis.should_remove = _should_remove;\n\n\t\t\t\t\tif (removed) return null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn node;\n\t\t}\n\t}\n\n\t// @ts-check\n\n\t/** @typedef { import('estree').BaseNode} BaseNode */\n\t/** @typedef { import('./sync.js').SyncHandler} SyncHandler */\n\t/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */\n\n\t/**\n\t *\n\t * @param {BaseNode} ast\n\t * @param {{\n\t * enter?: SyncHandler\n\t * leave?: SyncHandler\n\t * }} walker\n\t * @returns {BaseNode}\n\t */\n\tfunction walk(ast, { enter, leave }) {\n\t\tconst instance = new SyncWalker(enter, leave);\n\t\treturn instance.visit(ast, null);\n\t}\n\n\t/**\n\t *\n\t * @param {BaseNode} ast\n\t * @param {{\n\t * enter?: AsyncHandler\n\t * leave?: AsyncHandler\n\t * }} walker\n\t * @returns {Promise<BaseNode>}\n\t */\n\tasync function asyncWalk(ast, { enter, leave }) {\n\t\tconst instance = new AsyncWalker(enter, leave);\n\t\treturn await instance.visit(ast, null);\n\t}\n\n\texports.asyncWalk = asyncWalk;\n\texports.walk = walk;\n\n\tObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\nvar MAX_CACHED_INPUTS = 32;\n\n/**\n * Takes some function `f(input) -> result` and returns a memoized version of\n * `f`.\n *\n * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The\n * memoization is a dumb-simple, linear least-recently-used cache.\n */\nfunction lruMemoize(f) {\n var cache = [];\n\n return function(input) {\n for (var i = 0; i < cache.length; i++) {\n if (cache[i].input === input) {\n var temp = cache[0];\n cache[0] = cache[i];\n cache[i] = temp;\n return cache[0].result;\n }\n }\n\n var result = f(input);\n\n cache.unshift({\n input,\n result,\n });\n\n if (cache.length > MAX_CACHED_INPUTS) {\n cache.pop();\n }\n\n return result;\n };\n}\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '<dir>/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nvar normalize = lruMemoize(function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n // Split the path into parts between `/` characters. This is much faster than\n // using `.split(/\\/+/g)`.\n var parts = [];\n var start = 0;\n var i = 0;\n while (true) {\n start = i;\n i = path.indexOf(\"/\", start);\n if (i === -1) {\n parts.push(path.slice(start));\n break;\n } else {\n parts.push(path.slice(start, i));\n while (i < path.length && path[i] === \"/\") {\n i++;\n }\n }\n }\n\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n});\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\nfunction compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {\n var cmp\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, {\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n }));\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n if (this._validateMapping(generated, original, source, name) === false) {\n return;\n }\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n var message = 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n\n if (this._ignoreInvalidMapping) {\n if (typeof console !== 'undefined' && console.warn) {\n console.warn(message);\n }\n return false;\n } else {\n throw new Error(message);\n }\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n var message = 'Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n });\n\n if (this._ignoreInvalidMapping) {\n if (typeof console !== 'undefined' && console.warn) {\n console.warn(message);\n }\n return false;\n } else {\n throw new Error(message)\n }\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\nfunction SortTemplate(comparator) {\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot, false) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n return doQuickSort;\n}\n\nfunction cloneSort(comparator) {\n let template = SortTemplate.toString();\n let templateFn = new Function(`return ${template}`)();\n return templateFn(comparator);\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\n\nlet sortCache = new WeakMap();\nexports.quickSort = function (ary, comparator, start = 0) {\n let doQuickSort = sortCache.get(comparator);\n if (doQuickSort === void 0) {\n doQuickSort = cloneSort(comparator);\n sortCache.set(comparator, doQuickSort);\n }\n doQuickSort(ary, comparator, start, ary.length - 1);\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n var boundCallback = aCallback.bind(context);\n var names = this._names;\n var sources = this._sources;\n var sourceMapURL = this._sourceMapURL;\n\n for (var i = 0, n = mappings.length; i < n; i++) {\n var mapping = mappings[i];\n var source = mapping.source === null ? null : sources.at(mapping.source);\n if(source !== null) {\n source = util.computeSourceURL(sourceRoot, source, sourceMapURL);\n }\n boundCallback({\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : names.at(mapping.name)\n });\n }\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\n\nconst compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine;\nfunction sortGenerated(array, start) {\n let l = array.length;\n let n = array.length - start;\n if (n <= 1) {\n return;\n } else if (n == 2) {\n let a = array[start];\n let b = array[start + 1];\n if (compareGenerated(a, b) > 0) {\n array[start] = b;\n array[start + 1] = a;\n }\n } else if (n < 20) {\n for (let i = start; i < l; i++) {\n for (let j = i; j > start; j--) {\n let a = array[j - 1];\n let b = array[j];\n if (compareGenerated(a, b) <= 0) {\n break;\n }\n array[j - 1] = b;\n array[j] = a;\n }\n }\n } else {\n quickSort(array, compareGenerated, start);\n }\n}\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n let subarrayStart = 0;\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n\n sortGenerated(generatedMappings, subarrayStart);\n subarrayStart = generatedMappings.length;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n let currentSource = mapping.source;\n while (originalMappings.length <= currentSource) {\n originalMappings.push(null);\n }\n if (originalMappings[currentSource] === null) {\n originalMappings[currentSource] = [];\n }\n originalMappings[currentSource].push(mapping);\n }\n }\n }\n\n sortGenerated(generatedMappings, subarrayStart);\n this.__generatedMappings = generatedMappings;\n\n for (var i = 0; i < originalMappings.length; i++) {\n if (originalMappings[i] != null) {\n quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource);\n }\n }\n this.__originalMappings = [].concat(...originalMappings);\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content || content === '') {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n if(source !== null) {\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n }\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex] || '';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || '';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n","/**\n* @vue/compiler-core v3.5.26\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\n'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar shared = require('@vue/shared');\nvar decode = require('entities/decode');\nvar parser = require('@babel/parser');\nvar estreeWalker = require('estree-walker');\nvar sourceMapJs = require('source-map-js');\n\nconst FRAGMENT = /* @__PURE__ */ Symbol(``);\nconst TELEPORT = /* @__PURE__ */ Symbol(``);\nconst SUSPENSE = /* @__PURE__ */ Symbol(``);\nconst KEEP_ALIVE = /* @__PURE__ */ Symbol(``);\nconst BASE_TRANSITION = /* @__PURE__ */ Symbol(\n ``\n);\nconst OPEN_BLOCK = /* @__PURE__ */ Symbol(``);\nconst CREATE_BLOCK = /* @__PURE__ */ Symbol(``);\nconst CREATE_ELEMENT_BLOCK = /* @__PURE__ */ Symbol(\n ``\n);\nconst CREATE_VNODE = /* @__PURE__ */ Symbol(``);\nconst CREATE_ELEMENT_VNODE = /* @__PURE__ */ Symbol(\n ``\n);\nconst CREATE_COMMENT = /* @__PURE__ */ Symbol(\n ``\n);\nconst CREATE_TEXT = /* @__PURE__ */ Symbol(\n ``\n);\nconst CREATE_STATIC = /* @__PURE__ */ Symbol(\n ``\n);\nconst RESOLVE_COMPONENT = /* @__PURE__ */ Symbol(\n ``\n);\nconst RESOLVE_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol(\n ``\n);\nconst RESOLVE_DIRECTIVE = /* @__PURE__ */ Symbol(\n ``\n);\nconst RESOLVE_FILTER = /* @__PURE__ */ Symbol(\n ``\n);\nconst WITH_DIRECTIVES = /* @__PURE__ */ Symbol(\n ``\n);\nconst RENDER_LIST = /* @__PURE__ */ Symbol(``);\nconst RENDER_SLOT = /* @__PURE__ */ Symbol(``);\nconst CREATE_SLOTS = /* @__PURE__ */ Symbol(``);\nconst TO_DISPLAY_STRING = /* @__PURE__ */ Symbol(\n ``\n);\nconst MERGE_PROPS = /* @__PURE__ */ Symbol(``);\nconst NORMALIZE_CLASS = /* @__PURE__ */ Symbol(\n ``\n);\nconst NORMALIZE_STYLE = /* @__PURE__ */ Symbol(\n ``\n);\nconst NORMALIZE_PROPS = /* @__PURE__ */ Symbol(\n ``\n);\nconst GUARD_REACTIVE_PROPS = /* @__PURE__ */ Symbol(\n ``\n);\nconst TO_HANDLERS = /* @__PURE__ */ Symbol(``);\nconst CAMELIZE = /* @__PURE__ */ Symbol(``);\nconst CAPITALIZE = /* @__PURE__ */ Symbol(``);\nconst TO_HANDLER_KEY = /* @__PURE__ */ Symbol(\n ``\n);\nconst SET_BLOCK_TRACKING = /* @__PURE__ */ Symbol(\n ``\n);\nconst PUSH_SCOPE_ID = /* @__PURE__ */ Symbol(``);\nconst POP_SCOPE_ID = /* @__PURE__ */ Symbol(``);\nconst WITH_CTX = /* @__PURE__ */ Symbol(``);\nconst UNREF = /* @__PURE__ */ Symbol(``);\nconst IS_REF = /* @__PURE__ */ Symbol(``);\nconst WITH_MEMO = /* @__PURE__ */ Symbol(``);\nconst IS_MEMO_SAME = /* @__PURE__ */ Symbol(``);\nconst helperNameMap = {\n [FRAGMENT]: `Fragment`,\n [TELEPORT]: `Teleport`,\n [SUSPENSE]: `Suspense`,\n [KEEP_ALIVE]: `KeepAlive`,\n [BASE_TRANSITION]: `BaseTransition`,\n [OPEN_BLOCK]: `openBlock`,\n [CREATE_BLOCK]: `createBlock`,\n [CREATE_ELEMENT_BLOCK]: `createElementBlock`,\n [CREATE_VNODE]: `createVNode`,\n [CREATE_ELEMENT_VNODE]: `createElementVNode`,\n [CREATE_COMMENT]: `createCommentVNode`,\n [CREATE_TEXT]: `createTextVNode`,\n [CREATE_STATIC]: `createStaticVNode`,\n [RESOLVE_COMPONENT]: `resolveComponent`,\n [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,\n [RESOLVE_DIRECTIVE]: `resolveDirective`,\n [RESOLVE_FILTER]: `resolveFilter`,\n [WITH_DIRECTIVES]: `withDirectives`,\n [RENDER_LIST]: `renderList`,\n [RENDER_SLOT]: `renderSlot`,\n [CREATE_SLOTS]: `createSlots`,\n [TO_DISPLAY_STRING]: `toDisplayString`,\n [MERGE_PROPS]: `mergeProps`,\n [NORMALIZE_CLASS]: `normalizeClass`,\n [NORMALIZE_STYLE]: `normalizeStyle`,\n [NORMALIZE_PROPS]: `normalizeProps`,\n [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,\n [TO_HANDLERS]: `toHandlers`,\n [CAMELIZE]: `camelize`,\n [CAPITALIZE]: `capitalize`,\n [TO_HANDLER_KEY]: `toHandlerKey`,\n [SET_BLOCK_TRACKING]: `setBlockTracking`,\n [PUSH_SCOPE_ID]: `pushScopeId`,\n [POP_SCOPE_ID]: `popScopeId`,\n [WITH_CTX]: `withCtx`,\n [UNREF]: `unref`,\n [IS_REF]: `isRef`,\n [WITH_MEMO]: `withMemo`,\n [IS_MEMO_SAME]: `isMemoSame`\n};\nfunction registerRuntimeHelpers(helpers) {\n Object.getOwnPropertySymbols(helpers).forEach((s) => {\n helperNameMap[s] = helpers[s];\n });\n}\n\nconst Namespaces = {\n \"HTML\": 0,\n \"0\": \"HTML\",\n \"SVG\": 1,\n \"1\": \"SVG\",\n \"MATH_ML\": 2,\n \"2\": \"MATH_ML\"\n};\nconst NodeTypes = {\n \"ROOT\": 0,\n \"0\": \"ROOT\",\n \"ELEMENT\": 1,\n \"1\": \"ELEMENT\",\n \"TEXT\": 2,\n \"2\": \"TEXT\",\n \"COMMENT\": 3,\n \"3\": \"COMMENT\",\n \"SIMPLE_EXPRESSION\": 4,\n \"4\": \"SIMPLE_EXPRESSION\",\n \"INTERPOLATION\": 5,\n \"5\": \"INTERPOLATION\",\n \"ATTRIBUTE\": 6,\n \"6\": \"ATTRIBUTE\",\n \"DIRECTIVE\": 7,\n \"7\": \"DIRECTIVE\",\n \"COMPOUND_EXPRESSION\": 8,\n \"8\": \"COMPOUND_EXPRESSION\",\n \"IF\": 9,\n \"9\": \"IF\",\n \"IF_BRANCH\": 10,\n \"10\": \"IF_BRANCH\",\n \"FOR\": 11,\n \"11\": \"FOR\",\n \"TEXT_CALL\": 12,\n \"12\": \"TEXT_CALL\",\n \"VNODE_CALL\": 13,\n \"13\": \"VNODE_CALL\",\n \"JS_CALL_EXPRESSION\": 14,\n \"14\": \"JS_CALL_EXPRESSION\",\n \"JS_OBJECT_EXPRESSION\": 15,\n \"15\": \"JS_OBJECT_EXPRESSION\",\n \"JS_PROPERTY\": 16,\n \"16\": \"JS_PROPERTY\",\n \"JS_ARRAY_EXPRESSION\": 17,\n \"17\": \"JS_ARRAY_EXPRESSION\",\n \"JS_FUNCTION_EXPRESSION\": 18,\n \"18\": \"JS_FUNCTION_EXPRESSION\",\n \"JS_CONDITIONAL_EXPRESSION\": 19,\n \"19\": \"JS_CONDITIONAL_EXPRESSION\",\n \"JS_CACHE_EXPRESSION\": 20,\n \"20\": \"JS_CACHE_EXPRESSION\",\n \"JS_BLOCK_STATEMENT\": 21,\n \"21\": \"JS_BLOCK_STATEMENT\",\n \"JS_TEMPLATE_LITERAL\": 22,\n \"22\": \"JS_TEMPLATE_LITERAL\",\n \"JS_IF_STATEMENT\": 23,\n \"23\": \"JS_IF_STATEMENT\",\n \"JS_ASSIGNMENT_EXPRESSION\": 24,\n \"24\": \"JS_ASSIGNMENT_EXPRESSION\",\n \"JS_SEQUENCE_EXPRESSION\": 25,\n \"25\": \"JS_SEQUENCE_EXPRESSION\",\n \"JS_RETURN_STATEMENT\": 26,\n \"26\": \"JS_RETURN_STATEMENT\"\n};\nconst ElementTypes = {\n \"ELEMENT\": 0,\n \"0\": \"ELEMENT\",\n \"COMPONENT\": 1,\n \"1\": \"COMPONENT\",\n \"SLOT\": 2,\n \"2\": \"SLOT\",\n \"TEMPLATE\": 3,\n \"3\": \"TEMPLATE\"\n};\nconst ConstantTypes = {\n \"NOT_CONSTANT\": 0,\n \"0\": \"NOT_CONSTANT\",\n \"CAN_SKIP_PATCH\": 1,\n \"1\": \"CAN_SKIP_PATCH\",\n \"CAN_CACHE\": 2,\n \"2\": \"CAN_CACHE\",\n \"CAN_STRINGIFY\": 3,\n \"3\": \"CAN_STRINGIFY\"\n};\nconst locStub = {\n start: { line: 1, column: 1, offset: 0 },\n end: { line: 1, column: 1, offset: 0 },\n source: \"\"\n};\nfunction createRoot(children, source = \"\") {\n return {\n type: 0,\n source,\n children,\n helpers: /* @__PURE__ */ new Set(),\n components: [],\n directives: [],\n hoists: [],\n imports: [],\n cached: [],\n temps: 0,\n codegenNode: void 0,\n loc: locStub\n };\n}\nfunction createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {\n if (context) {\n if (isBlock) {\n context.helper(OPEN_BLOCK);\n context.helper(getVNodeBlockHelper(context.inSSR, isComponent));\n } else {\n context.helper(getVNodeHelper(context.inSSR, isComponent));\n }\n if (directives) {\n context.helper(WITH_DIRECTIVES);\n }\n }\n return {\n type: 13,\n tag,\n props,\n children,\n patchFlag,\n dynamicProps,\n directives,\n isBlock,\n disableTracking,\n isComponent,\n loc\n };\n}\nfunction createArrayExpression(elements, loc = locStub) {\n return {\n type: 17,\n loc,\n elements\n };\n}\nfunction createObjectExpression(properties, loc = locStub) {\n return {\n type: 15,\n loc,\n properties\n };\n}\nfunction createObjectProperty(key, value) {\n return {\n type: 16,\n loc: locStub,\n key: shared.isString(key) ? createSimpleExpression(key, true) : key,\n value\n };\n}\nfunction createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {\n return {\n type: 4,\n loc,\n content,\n isStatic,\n constType: isStatic ? 3 : constType\n };\n}\nfunction createInterpolation(content, loc) {\n return {\n type: 5,\n loc,\n content: shared.isString(content) ? createSimpleExpression(content, false, loc) : content\n };\n}\nfunction createCompoundExpression(children, loc = locStub) {\n return {\n type: 8,\n loc,\n children\n };\n}\nfunction createCallExpression(callee, args = [], loc = locStub) {\n return {\n type: 14,\n loc,\n callee,\n arguments: args\n };\n}\nfunction createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {\n return {\n type: 18,\n params,\n returns,\n newline,\n isSlot,\n loc\n };\n}\nfunction createConditionalExpression(test, consequent, alternate, newline = true) {\n return {\n type: 19,\n test,\n consequent,\n alternate,\n newline,\n loc: locStub\n };\n}\nfunction createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) {\n return {\n type: 20,\n index,\n value,\n needPauseTracking,\n inVOnce,\n needArraySpread: false,\n loc: locStub\n };\n}\nfunction createBlockStatement(body) {\n return {\n type: 21,\n body,\n loc: locStub\n };\n}\nfunction createTemplateLiteral(elements) {\n return {\n type: 22,\n elements,\n loc: locStub\n };\n}\nfunction createIfStatement(test, consequent, alternate) {\n return {\n type: 23,\n test,\n consequent,\n alternate,\n loc: locStub\n };\n}\nfunction createAssignmentExpression(left, right) {\n return {\n type: 24,\n left,\n right,\n loc: locStub\n };\n}\nfunction createSequenceExpression(expressions) {\n return {\n type: 25,\n expressions,\n loc: locStub\n };\n}\nfunction createReturnStatement(returns) {\n return {\n type: 26,\n returns,\n loc: locStub\n };\n}\nfunction getVNodeHelper(ssr, isComponent) {\n return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;\n}\nfunction getVNodeBlockHelper(ssr, isComponent) {\n return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;\n}\nfunction convertToBlock(node, { helper, removeHelper, inSSR }) {\n if (!node.isBlock) {\n node.isBlock = true;\n removeHelper(getVNodeHelper(inSSR, node.isComponent));\n helper(OPEN_BLOCK);\n helper(getVNodeBlockHelper(inSSR, node.isComponent));\n }\n}\n\nconst defaultDelimitersOpen = new Uint8Array([123, 123]);\nconst defaultDelimitersClose = new Uint8Array([125, 125]);\nfunction isTagStartChar(c) {\n return c >= 97 && c <= 122 || c >= 65 && c <= 90;\n}\nfunction isWhitespace(c) {\n return c === 32 || c === 10 || c === 9 || c === 12 || c === 13;\n}\nfunction isEndOfTagSection(c) {\n return c === 47 || c === 62 || isWhitespace(c);\n}\nfunction toCharCodes(str) {\n const ret = new Uint8Array(str.length);\n for (let i = 0; i < str.length; i++) {\n ret[i] = str.charCodeAt(i);\n }\n return ret;\n}\nconst Sequences = {\n Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),\n // CDATA[\n CdataEnd: new Uint8Array([93, 93, 62]),\n // ]]>\n CommentEnd: new Uint8Array([45, 45, 62]),\n // `-->`\n ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),\n // `<\\/script`\n StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),\n // `</style`\n TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]),\n // `</title`\n TextareaEnd: new Uint8Array([\n 60,\n 47,\n 116,\n 101,\n 120,\n 116,\n 97,\n 114,\n 101,\n 97\n ])\n // `</textarea\n};\nclass Tokenizer {\n constructor(stack, cbs) {\n this.stack = stack;\n this.cbs = cbs;\n /** The current state the tokenizer is in. */\n this.state = 1;\n /** The read buffer. */\n this.buffer = \"\";\n /** The beginning of the section that is currently being read. */\n this.sectionStart = 0;\n /** The index within the buffer that we are currently looking at. */\n this.index = 0;\n /** The start of the last entity. */\n this.entityStart = 0;\n /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */\n this.baseState = 1;\n /** For special parsing behavior inside of script and style tags. */\n this.inRCDATA = false;\n /** For disabling RCDATA tags handling */\n this.inXML = false;\n /** For disabling interpolation parsing in v-pre */\n this.inVPre = false;\n /** Record newline positions for fast line / column calculation */\n this.newlines = [];\n this.mode = 0;\n this.delimiterOpen = defaultDelimitersOpen;\n this.delimiterClose = defaultDelimitersClose;\n this.delimiterIndex = -1;\n this.currentSequence = void 0;\n this.sequenceIndex = 0;\n {\n this.entityDecoder = new decode.EntityDecoder(\n decode.htmlDecodeTree,\n (cp, consumed) => this.emitCodePoint(cp, consumed)\n );\n }\n }\n get inSFCRoot() {\n return this.mode === 2 && this.stack.length === 0;\n }\n reset() {\n this.state = 1;\n this.mode = 0;\n this.buffer = \"\";\n this.sectionStart = 0;\n this.index = 0;\n this.baseState = 1;\n this.inRCDATA = false;\n this.currentSequence = void 0;\n this.newlines.length = 0;\n this.delimiterOpen = defaultDelimitersOpen;\n this.delimiterClose = defaultDelimitersClose;\n }\n /**\n * Generate Position object with line / column information using recorded\n * newline positions. We know the index is always going to be an already\n * processed index, so all the newlines up to this index should have been\n * recorded.\n */\n getPos(index) {\n let line = 1;\n let column = index + 1;\n const length = this.newlines.length;\n let j = -1;\n if (length > 100) {\n let l = -1;\n let r = length;\n while (l + 1 < r) {\n const m = l + r >>> 1;\n this.newlines[m] < index ? l = m : r = m;\n }\n j = l;\n } else {\n for (let i = length - 1; i >= 0; i--) {\n if (index > this.newlines[i]) {\n j = i;\n break;\n }\n }\n }\n if (j >= 0) {\n line = j + 2;\n column = index - this.newlines[j];\n }\n return {\n column,\n line,\n offset: index\n };\n }\n peek() {\n return this.buffer.charCodeAt(this.index + 1);\n }\n stateText(c) {\n if (c === 60) {\n if (this.index > this.sectionStart) {\n this.cbs.ontext(this.sectionStart, this.index);\n }\n this.state = 5;\n this.sectionStart = this.index;\n } else if (c === 38) {\n this.startEntity();\n } else if (!this.inVPre && c === this.delimiterOpen[0]) {\n this.state = 2;\n this.delimiterIndex = 0;\n this.stateInterpolationOpen(c);\n }\n }\n stateInterpolationOpen(c) {\n if (c === this.delimiterOpen[this.delimiterIndex]) {\n if (this.delimiterIndex === this.delimiterOpen.length - 1) {\n const start = this.index + 1 - this.delimiterOpen.length;\n if (start > this.sectionStart) {\n this.cbs.ontext(this.sectionStart, start);\n }\n this.state = 3;\n this.sectionStart = start;\n } else {\n this.delimiterIndex++;\n }\n } else if (this.inRCDATA) {\n this.state = 32;\n this.stateInRCDATA(c);\n } else {\n this.state = 1;\n this.stateText(c);\n }\n }\n stateInterpolation(c) {\n if (c === this.delimiterClose[0]) {\n this.state = 4;\n this.delimiterIndex = 0;\n this.stateInterpolationClose(c);\n }\n }\n stateInterpolationClose(c) {\n if (c === this.delimiterClose[this.delimiterIndex]) {\n if (this.delimiterIndex === this.delimiterClose.length - 1) {\n this.cbs.oninterpolation(this.sectionStart, this.index + 1);\n if (this.inRCDATA) {\n this.state = 32;\n } else {\n this.state = 1;\n }\n this.sectionStart = this.index + 1;\n } else {\n this.delimiterIndex++;\n }\n } else {\n this.state = 3;\n this.stateInterpolation(c);\n }\n }\n stateSpecialStartSequence(c) {\n const isEnd = this.sequenceIndex === this.currentSequence.length;\n const isMatch = isEnd ? (\n // If we are at the end of the sequence, make sure the tag name has ended\n isEndOfTagSection(c)\n ) : (\n // Otherwise, do a case-insensitive comparison\n (c | 32) === this.currentSequence[this.sequenceIndex]\n );\n if (!isMatch) {\n this.inRCDATA = false;\n } else if (!isEnd) {\n this.sequenceIndex++;\n return;\n }\n this.sequenceIndex = 0;\n this.state = 6;\n this.stateInTagName(c);\n }\n /** Look for an end tag. For <title> and <textarea>, also decode entities. */\n stateInRCDATA(c) {\n if (this.sequenceIndex === this.currentSequence.length) {\n if (c === 62 || isWhitespace(c)) {\n const endOfText = this.index - this.currentSequence.length;\n if (this.sectionStart < endOfText) {\n const actualIndex = this.index;\n this.index = endOfText;\n this.cbs.ontext(this.sectionStart, endOfText);\n this.index = actualIndex;\n }\n this.sectionStart = endOfText + 2;\n this.stateInClosingTagName(c);\n this.inRCDATA = false;\n return;\n }\n this.sequenceIndex = 0;\n }\n if ((c | 32) === this.currentSequence[this.sequenceIndex]) {\n this.sequenceIndex += 1;\n } else if (this.sequenceIndex === 0) {\n if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {\n if (c === 38) {\n this.startEntity();\n } else if (!this.inVPre && c === this.delimiterOpen[0]) {\n this.state = 2;\n this.delimiterIndex = 0;\n this.stateInterpolationOpen(c);\n }\n } else if (this.fastForwardTo(60)) {\n this.sequenceIndex = 1;\n }\n } else {\n this.sequenceIndex = Number(c === 60);\n }\n }\n stateCDATASequence(c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = 28;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n } else {\n this.sequenceIndex = 0;\n this.state = 23;\n this.stateInDeclaration(c);\n }\n }\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n fastForwardTo(c) {\n while (++this.index < this.buffer.length) {\n const cc = this.buffer.charCodeAt(this.index);\n if (cc === 10) {\n this.newlines.push(this.index);\n }\n if (cc === c) {\n return true;\n }\n }\n this.index = this.buffer.length - 1;\n return false;\n }\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n stateInCommentLike(c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index - 2);\n } else {\n this.cbs.oncomment(this.sectionStart, this.index - 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = 1;\n }\n } else if (this.sequenceIndex === 0) {\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n } else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n this.sequenceIndex = 0;\n }\n }\n startSpecial(sequence, offset) {\n this.enterRCDATA(sequence, offset);\n this.state = 31;\n }\n enterRCDATA(sequence, offset) {\n this.inRCDATA = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n }\n stateBeforeTagName(c) {\n if (c === 33) {\n this.state = 22;\n this.sectionStart = this.index + 1;\n } else if (c === 63) {\n this.state = 24;\n this.sectionStart = this.index + 1;\n } else if (isTagStartChar(c)) {\n this.sectionStart = this.index;\n if (this.mode === 0) {\n this.state = 6;\n } else if (this.inSFCRoot) {\n this.state = 34;\n } else if (!this.inXML) {\n if (c === 116) {\n this.state = 30;\n } else {\n this.state = c === 115 ? 29 : 6;\n }\n } else {\n this.state = 6;\n }\n } else if (c === 47) {\n this.state = 8;\n } else {\n this.state = 1;\n this.stateText(c);\n }\n }\n stateInTagName(c) {\n if (isEndOfTagSection(c)) {\n this.handleTagName(c);\n }\n }\n stateInSFCRootTagName(c) {\n if (isEndOfTagSection(c)) {\n const tag = this.buffer.slice(this.sectionStart, this.index);\n if (tag !== \"template\") {\n this.enterRCDATA(toCharCodes(`</` + tag), 0);\n }\n this.handleTagName(c);\n }\n }\n handleTagName(c) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = 11;\n this.stateBeforeAttrName(c);\n }\n stateBeforeClosingTagName(c) {\n if (isWhitespace(c)) ; else if (c === 62) {\n {\n this.cbs.onerr(14, this.index);\n }\n this.state = 1;\n this.sectionStart = this.index + 1;\n } else {\n this.state = isTagStartChar(c) ? 9 : 27;\n this.sectionStart = this.index;\n }\n }\n stateInClosingTagName(c) {\n if (c === 62 || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = 10;\n this.stateAfterClosingTagName(c);\n }\n }\n stateAfterClosingTagName(c) {\n if (c === 62) {\n this.state = 1;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeAttrName(c) {\n if (c === 62) {\n this.cbs.onopentagend(this.index);\n if (this.inRCDATA) {\n this.state = 32;\n } else {\n this.state = 1;\n }\n this.sectionStart = this.index + 1;\n } else if (c === 47) {\n this.state = 7;\n if (this.peek() !== 62) {\n this.cbs.onerr(22, this.index);\n }\n } else if (c === 60 && this.peek() === 47) {\n this.cbs.onopentagend(this.index);\n this.state = 5;\n this.sectionStart = this.index;\n } else if (!isWhitespace(c)) {\n if (c === 61) {\n this.cbs.onerr(\n 19,\n this.index\n );\n }\n this.handleAttrStart(c);\n }\n }\n handleAttrStart(c) {\n if (c === 118 && this.peek() === 45) {\n this.state = 13;\n this.sectionStart = this.index;\n } else if (c === 46 || c === 58 || c === 64 || c === 35) {\n this.cbs.ondirname(this.index, this.index + 1);\n this.state = 14;\n this.sectionStart = this.index + 1;\n } else {\n this.state = 12;\n this.sectionStart = this.index;\n }\n }\n stateInSelfClosingTag(c) {\n if (c === 62) {\n this.cbs.onselfclosingtag(this.index);\n this.state = 1;\n this.sectionStart = this.index + 1;\n this.inRCDATA = false;\n } else if (!isWhitespace(c)) {\n this.state = 11;\n this.stateBeforeAttrName(c);\n }\n }\n stateInAttrName(c) {\n if (c === 61 || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.handleAttrNameEnd(c);\n } else if (c === 34 || c === 39 || c === 60) {\n this.cbs.onerr(\n 17,\n this.index\n );\n }\n }\n stateInDirName(c) {\n if (c === 61 || isEndOfTagSection(c)) {\n this.cbs.ondirname(this.sectionStart, this.index);\n this.handleAttrNameEnd(c);\n } else if (c === 58) {\n this.cbs.ondirname(this.sectionStart, this.index);\n this.state = 14;\n this.sectionStart = this.index + 1;\n } else if (c === 46) {\n this.cbs.ondirname(this.sectionStart, this.index);\n this.state = 16;\n this.sectionStart = this.index + 1;\n }\n }\n stateInDirArg(c) {\n if (c === 61 || isEndOfTagSection(c)) {\n this.cbs.ondirarg(this.sectionStart, this.index);\n this.handleAttrNameEnd(c);\n } else if (c === 91) {\n this.state = 15;\n } else if (c === 46) {\n this.cbs.ondirarg(this.sectionStart, this.index);\n this.state = 16;\n this.sectionStart = this.index + 1;\n }\n }\n stateInDynamicDirArg(c) {\n if (c === 93) {\n this.state = 14;\n } else if (c === 61 || isEndOfTagSection(c)) {\n this.cbs.ondirarg(this.sectionStart, this.index + 1);\n this.handleAttrNameEnd(c);\n {\n this.cbs.onerr(\n 27,\n this.index\n );\n }\n }\n }\n stateInDirModifier(c) {\n if (c === 61 || isEndOfTagSection(c)) {\n this.cbs.ondirmodifier(this.sectionStart, this.index);\n this.handleAttrNameEnd(c);\n } else if (c === 46) {\n this.cbs.ondirmodifier(this.sectionStart, this.index);\n this.sectionStart = this.index + 1;\n }\n }\n handleAttrNameEnd(c) {\n this.sectionStart = this.index;\n this.state = 17;\n this.cbs.onattribnameend(this.index);\n this.stateAfterAttrName(c);\n }\n stateAfterAttrName(c) {\n if (c === 61) {\n this.state = 18;\n } else if (c === 47 || c === 62) {\n this.cbs.onattribend(0, this.sectionStart);\n this.sectionStart = -1;\n this.state = 11;\n this.stateBeforeAttrName(c);\n } else if (!isWhitespace(c)) {\n this.cbs.onattribend(0, this.sectionStart);\n this.handleAttrStart(c);\n }\n }\n stateBeforeAttrValue(c) {\n if (c === 34) {\n this.state = 19;\n this.sectionStart = this.index + 1;\n } else if (c === 39) {\n this.state = 20;\n this.sectionStart = this.index + 1;\n } else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = 21;\n this.stateInAttrValueNoQuotes(c);\n }\n }\n handleInAttrValue(c, quote) {\n if (c === quote || false) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(\n quote === 34 ? 3 : 2,\n this.index + 1\n );\n this.state = 11;\n } else if (c === 38) {\n this.startEntity();\n }\n }\n stateInAttrValueDoubleQuotes(c) {\n this.handleInAttrValue(c, 34);\n }\n stateInAttrValueSingleQuotes(c) {\n this.handleInAttrValue(c, 39);\n }\n stateInAttrValueNoQuotes(c) {\n if (isWhitespace(c) || c === 62) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(1, this.index);\n this.state = 11;\n this.stateBeforeAttrName(c);\n } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) {\n this.cbs.onerr(\n 18,\n this.index\n );\n } else if (c === 38) {\n this.startEntity();\n }\n }\n stateBeforeDeclaration(c) {\n if (c === 91) {\n this.state = 26;\n this.sequenceIndex = 0;\n } else {\n this.state = c === 45 ? 25 : 23;\n }\n }\n stateInDeclaration(c) {\n if (c === 62 || this.fastForwardTo(62)) {\n this.state = 1;\n this.sectionStart = this.index + 1;\n }\n }\n stateInProcessingInstruction(c) {\n if (c === 62 || this.fastForwardTo(62)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = 1;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeComment(c) {\n if (c === 45) {\n this.state = 28;\n this.currentSequence = Sequences.CommentEnd;\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n } else {\n this.state = 23;\n }\n }\n stateInSpecialComment(c) {\n if (c === 62 || this.fastForwardTo(62)) {\n this.cbs.oncomment(this.sectionStart, this.index);\n this.state = 1;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeSpecialS(c) {\n if (c === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n } else if (c === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n } else {\n this.state = 6;\n this.stateInTagName(c);\n }\n }\n stateBeforeSpecialT(c) {\n if (c === Sequences.TitleEnd[3]) {\n this.startSpecial(Sequences.TitleEnd, 4);\n } else if (c === Sequences.TextareaEnd[3]) {\n this.startSpecial(Sequences.TextareaEnd, 4);\n } else {\n this.state = 6;\n this.stateInTagName(c);\n }\n }\n startEntity() {\n {\n this.baseState = this.state;\n this.state = 33;\n this.entityStart = this.index;\n this.entityDecoder.startEntity(\n this.baseState === 1 || this.baseState === 32 ? decode.DecodingMode.Legacy : decode.DecodingMode.Attribute\n );\n }\n }\n stateInEntity() {\n {\n const length = this.entityDecoder.write(this.buffer, this.index);\n if (length >= 0) {\n this.state = this.baseState;\n if (length === 0) {\n this.index = this.entityStart;\n }\n } else {\n this.index = this.buffer.length - 1;\n }\n }\n }\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n parse(input) {\n this.buffer = input;\n while (this.index < this.buffer.length) {\n const c = this.buffer.charCodeAt(this.index);\n if (c === 10 && this.state !== 33) {\n this.newlines.push(this.index);\n }\n switch (this.state) {\n case 1: {\n this.stateText(c);\n break;\n }\n case 2: {\n this.stateInterpolationOpen(c);\n break;\n }\n case 3: {\n this.stateInterpolation(c);\n break;\n }\n case 4: {\n this.stateInterpolationClose(c);\n break;\n }\n case 31: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case 32: {\n this.stateInRCDATA(c);\n break;\n }\n case 26: {\n this.stateCDATASequence(c);\n break;\n }\n case 19: {\n this.stateInAttrValueDoubleQuotes(c);\n break;\n }\n case 12: {\n this.stateInAttrName(c);\n break;\n }\n case 13: {\n this.stateInDirName(c);\n break;\n }\n case 14: {\n this.stateInDirArg(c);\n break;\n }\n case 15: {\n this.stateInDynamicDirArg(c);\n break;\n }\n case 16: {\n this.stateInDirModifier(c);\n break;\n }\n case 28: {\n this.stateInCommentLike(c);\n break;\n }\n case 27: {\n this.stateInSpecialComment(c);\n break;\n }\n case 11: {\n this.stateBeforeAttrName(c);\n break;\n }\n case 6: {\n this.stateInTagName(c);\n break;\n }\n case 34: {\n this.stateInSFCRootTagName(c);\n break;\n }\n case 9: {\n this.stateInClosingTagName(c);\n break;\n }\n case 5: {\n this.stateBeforeTagName(c);\n break;\n }\n case 17: {\n this.stateAfterAttrName(c);\n break;\n }\n case 20: {\n this.stateInAttrValueSingleQuotes(c);\n break;\n }\n case 18: {\n this.stateBeforeAttrValue(c);\n break;\n }\n case 8: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case 10: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case 29: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case 30: {\n this.stateBeforeSpecialT(c);\n break;\n }\n case 21: {\n this.stateInAttrValueNoQuotes(c);\n break;\n }\n case 7: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case 23: {\n this.stateInDeclaration(c);\n break;\n }\n case 22: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case 25: {\n this.stateBeforeComment(c);\n break;\n }\n case 24: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case 33: {\n this.stateInEntity();\n break;\n }\n }\n this.index++;\n }\n this.cleanup();\n this.finish();\n }\n /**\n * Remove data that has already been consumed from the buffer.\n */\n cleanup() {\n if (this.sectionStart !== this.index) {\n if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n } else if (this.state === 19 || this.state === 20 || this.state === 21) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n }\n finish() {\n if (this.state === 33) {\n this.entityDecoder.end();\n this.state = this.baseState;\n }\n this.handleTrailingData();\n this.cbs.onend();\n }\n /** Handle any trailing data. */\n handleTrailingData() {\n const endIndex = this.buffer.length;\n if (this.sectionStart >= endIndex) {\n return;\n }\n if (this.state === 28) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex);\n } else {\n this.cbs.oncomment(this.sectionStart, endIndex);\n }\n } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n }\n emitCodePoint(cp, consumed) {\n {\n if (this.baseState !== 1 && this.baseState !== 32) {\n if (this.sectionStart < this.entityStart) {\n this.cbs.onattribdata(this.sectionStart, this.entityStart);\n }\n this.sectionStart = this.entityStart + consumed;\n this.index = this.sectionStart - 1;\n this.cbs.onattribentity(\n decode.fromCodePoint(cp),\n this.entityStart,\n this.sectionStart\n );\n } else {\n if (this.sectionStart < this.entityStart) {\n this.cbs.ontext(this.sectionStart, this.entityStart);\n }\n this.sectionStart = this.entityStart + consumed;\n this.index = this.sectionStart - 1;\n this.cbs.ontextentity(\n decode.fromCodePoint(cp),\n this.entityStart,\n this.sectionStart\n );\n }\n }\n }\n}\n\nconst CompilerDeprecationTypes = {\n \"COMPILER_IS_ON_ELEMENT\": \"COMPILER_IS_ON_ELEMENT\",\n \"COMPILER_V_BIND_SYNC\": \"COMPILER_V_BIND_SYNC\",\n \"COMPILER_V_BIND_OBJECT_ORDER\": \"COMPILER_V_BIND_OBJECT_ORDER\",\n \"COMPILER_V_ON_NATIVE\": \"COMPILER_V_ON_NATIVE\",\n \"COMPILER_V_IF_V_FOR_PRECEDENCE\": \"COMPILER_V_IF_V_FOR_PRECEDENCE\",\n \"COMPILER_NATIVE_TEMPLATE\": \"COMPILER_NATIVE_TEMPLATE\",\n \"COMPILER_INLINE_TEMPLATE\": \"COMPILER_INLINE_TEMPLATE\",\n \"COMPILER_FILTERS\": \"COMPILER_FILTERS\"\n};\nconst deprecationData = {\n [\"COMPILER_IS_ON_ELEMENT\"]: {\n message: `Platform-native elements with \"is\" prop will no longer be treated as components in Vue 3 unless the \"is\" value is explicitly prefixed with \"vue:\".`,\n link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html`\n },\n [\"COMPILER_V_BIND_SYNC\"]: {\n message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \\`v-bind:${key}.sync\\` should be changed to \\`v-model:${key}\\`.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`\n },\n [\"COMPILER_V_BIND_OBJECT_ORDER\"]: {\n message: `v-bind=\"obj\" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html`\n },\n [\"COMPILER_V_ON_NATIVE\"]: {\n message: `.native modifier for v-on has been removed as is no longer necessary.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html`\n },\n [\"COMPILER_V_IF_V_FOR_PRECEDENCE\"]: {\n message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html`\n },\n [\"COMPILER_NATIVE_TEMPLATE\"]: {\n message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.`\n },\n [\"COMPILER_INLINE_TEMPLATE\"]: {\n message: `\"inline-template\" has been removed in Vue 3.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html`\n },\n [\"COMPILER_FILTERS\"]: {\n message: `filters have been removed in Vue 3. The \"|\" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`\n }\n};\nfunction getCompatValue(key, { compatConfig }) {\n const value = compatConfig && compatConfig[key];\n if (key === \"MODE\") {\n return value || 3;\n } else {\n return value;\n }\n}\nfunction isCompatEnabled(key, context) {\n const mode = getCompatValue(\"MODE\", context);\n const value = getCompatValue(key, context);\n return mode === 3 ? value === true : value !== false;\n}\nfunction checkCompatEnabled(key, context, loc, ...args) {\n const enabled = isCompatEnabled(key, context);\n return enabled;\n}\nfunction warnDeprecation(key, context, loc, ...args) {\n const val = getCompatValue(key, context);\n if (val === \"suppress-warning\") {\n return;\n }\n const { message, link } = deprecationData[key];\n const msg = `(deprecation ${key}) ${typeof message === \"function\" ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;\n const err = new SyntaxError(msg);\n err.code = key;\n if (loc) err.loc = loc;\n context.onWarn(err);\n}\n\nfunction defaultOnError(error) {\n throw error;\n}\nfunction defaultOnWarn(msg) {\n}\nfunction createCompilerError(code, loc, messages, additionalMessage) {\n const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ;\n const error = new SyntaxError(String(msg));\n error.code = code;\n error.loc = loc;\n return error;\n}\nconst ErrorCodes = {\n \"ABRUPT_CLOSING_OF_EMPTY_COMMENT\": 0,\n \"0\": \"ABRUPT_CLOSING_OF_EMPTY_COMMENT\",\n \"CDATA_IN_HTML_CONTENT\": 1,\n \"1\": \"CDATA_IN_HTML_CONTENT\",\n \"DUPLICATE_ATTRIBUTE\": 2,\n \"2\": \"DUPLICATE_ATTRIBUTE\",\n \"END_TAG_WITH_ATTRIBUTES\": 3,\n \"3\": \"END_TAG_WITH_ATTRIBUTES\",\n \"END_TAG_WITH_TRAILING_SOLIDUS\": 4,\n \"4\": \"END_TAG_WITH_TRAILING_SOLIDUS\",\n \"EOF_BEFORE_TAG_NAME\": 5,\n \"5\": \"EOF_BEFORE_TAG_NAME\",\n \"EOF_IN_CDATA\": 6,\n \"6\": \"EOF_IN_CDATA\",\n \"EOF_IN_COMMENT\": 7,\n \"7\": \"EOF_IN_COMMENT\",\n \"EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT\": 8,\n \"8\": \"EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT\",\n \"EOF_IN_TAG\": 9,\n \"9\": \"EOF_IN_TAG\",\n \"INCORRECTLY_CLOSED_COMMENT\": 10,\n \"10\": \"INCORRECTLY_CLOSED_COMMENT\",\n \"INCORRECTLY_OPENED_COMMENT\": 11,\n \"11\": \"INCORRECTLY_OPENED_COMMENT\",\n \"INVALID_FIRST_CHARACTER_OF_TAG_NAME\": 12,\n \"12\": \"INVALID_FIRST_CHARACTER_OF_TAG_NAME\",\n \"MISSING_ATTRIBUTE_VALUE\": 13,\n \"13\": \"MISSING_ATTRIBUTE_VALUE\",\n \"MISSING_END_TAG_NAME\": 14,\n \"14\": \"MISSING_END_TAG_NAME\",\n \"MISSING_WHITESPACE_BETWEEN_ATTRIBUTES\": 15,\n \"15\": \"MISSING_WHITESPACE_BETWEEN_ATTRIBUTES\",\n \"NESTED_COMMENT\": 16,\n \"16\": \"NESTED_COMMENT\",\n \"UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME\": 17,\n \"17\": \"UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME\",\n \"UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE\": 18,\n \"18\": \"UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE\",\n \"UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME\": 19,\n \"19\": \"UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME\",\n \"UNEXPECTED_NULL_CHARACTER\": 20,\n \"20\": \"UNEXPECTED_NULL_CHARACTER\",\n \"UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME\": 21,\n \"21\": \"UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME\",\n \"UNEXPECTED_SOLIDUS_IN_TAG\": 22,\n \"22\": \"UNEXPECTED_SOLIDUS_IN_TAG\",\n \"X_INVALID_END_TAG\": 23,\n \"23\": \"X_INVALID_END_TAG\",\n \"X_MISSING_END_TAG\": 24,\n \"24\": \"X_MISSING_END_TAG\",\n \"X_MISSING_INTERPOLATION_END\": 25,\n \"25\": \"X_MISSING_INTERPOLATION_END\",\n \"X_MISSING_DIRECTIVE_NAME\": 26,\n \"26\": \"X_MISSING_DIRECTIVE_NAME\",\n \"X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END\": 27,\n \"27\": \"X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END\",\n \"X_V_IF_NO_EXPRESSION\": 28,\n \"28\": \"X_V_IF_NO_EXPRESSION\",\n \"X_V_IF_SAME_KEY\": 29,\n \"29\": \"X_V_IF_SAME_KEY\",\n \"X_V_ELSE_NO_ADJACENT_IF\": 30,\n \"30\": \"X_V_ELSE_NO_ADJACENT_IF\",\n \"X_V_FOR_NO_EXPRESSION\": 31,\n \"31\": \"X_V_FOR_NO_EXPRESSION\",\n \"X_V_FOR_MALFORMED_EXPRESSION\": 32,\n \"32\": \"X_V_FOR_MALFORMED_EXPRESSION\",\n \"X_V_FOR_TEMPLATE_KEY_PLACEMENT\": 33,\n \"33\": \"X_V_FOR_TEMPLATE_KEY_PLACEMENT\",\n \"X_V_BIND_NO_EXPRESSION\": 34,\n \"34\": \"X_V_BIND_NO_EXPRESSION\",\n \"X_V_ON_NO_EXPRESSION\": 35,\n \"35\": \"X_V_ON_NO_EXPRESSION\",\n \"X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET\": 36,\n \"36\": \"X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET\",\n \"X_V_SLOT_MIXED_SLOT_USAGE\": 37,\n \"37\": \"X_V_SLOT_MIXED_SLOT_USAGE\",\n \"X_V_SLOT_DUPLICATE_SLOT_NAMES\": 38,\n \"38\": \"X_V_SLOT_DUPLICATE_SLOT_NAMES\",\n \"X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN\": 39,\n \"39\": \"X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN\",\n \"X_V_SLOT_MISPLACED\": 40,\n \"40\": \"X_V_SLOT_MISPLACED\",\n \"X_V_MODEL_NO_EXPRESSION\": 41,\n \"41\": \"X_V_MODEL_NO_EXPRESSION\",\n \"X_V_MODEL_MALFORMED_EXPRESSION\": 42,\n \"42\": \"X_V_MODEL_MALFORMED_EXPRESSION\",\n \"X_V_MODEL_ON_SCOPE_VARIABLE\": 43,\n \"43\": \"X_V_MODEL_ON_SCOPE_VARIABLE\",\n \"X_V_MODEL_ON_PROPS\": 44,\n \"44\": \"X_V_MODEL_ON_PROPS\",\n \"X_V_MODEL_ON_CONST\": 45,\n \"45\": \"X_V_MODEL_ON_CONST\",\n \"X_INVALID_EXPRESSION\": 46,\n \"46\": \"X_INVALID_EXPRESSION\",\n \"X_KEEP_ALIVE_INVALID_CHILDREN\": 47,\n \"47\": \"X_KEEP_ALIVE_INVALID_CHILDREN\",\n \"X_PREFIX_ID_NOT_SUPPORTED\": 48,\n \"48\": \"X_PREFIX_ID_NOT_SUPPORTED\",\n \"X_MODULE_MODE_NOT_SUPPORTED\": 49,\n \"49\": \"X_MODULE_MODE_NOT_SUPPORTED\",\n \"X_CACHE_HANDLER_NOT_SUPPORTED\": 50,\n \"50\": \"X_CACHE_HANDLER_NOT_SUPPORTED\",\n \"X_SCOPE_ID_NOT_SUPPORTED\": 51,\n \"51\": \"X_SCOPE_ID_NOT_SUPPORTED\",\n \"X_VNODE_HOOKS\": 52,\n \"52\": \"X_VNODE_HOOKS\",\n \"X_V_BIND_INVALID_SAME_NAME_ARGUMENT\": 53,\n \"53\": \"X_V_BIND_INVALID_SAME_NAME_ARGUMENT\",\n \"__EXTEND_POINT__\": 54,\n \"54\": \"__EXTEND_POINT__\"\n};\nconst errorMessages = {\n // parse errors\n [0]: \"Illegal comment.\",\n [1]: \"CDATA section is allowed only in XML context.\",\n [2]: \"Duplicate attribute.\",\n [3]: \"End tag cannot have attributes.\",\n [4]: \"Illegal '/' in tags.\",\n [5]: \"Unexpected EOF in tag.\",\n [6]: \"Unexpected EOF in CDATA section.\",\n [7]: \"Unexpected EOF in comment.\",\n [8]: \"Unexpected EOF in script.\",\n [9]: \"Unexpected EOF in tag.\",\n [10]: \"Incorrectly closed comment.\",\n [11]: \"Incorrectly opened comment.\",\n [12]: \"Illegal tag name. Use '&lt;' to print '<'.\",\n [13]: \"Attribute value was expected.\",\n [14]: \"End tag name was expected.\",\n [15]: \"Whitespace was expected.\",\n [16]: \"Unexpected '<!--' in comment.\",\n [17]: `Attribute name cannot contain U+0022 (\"), U+0027 ('), and U+003C (<).`,\n [18]: \"Unquoted attribute value cannot contain U+0022 (\\\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).\",\n [19]: \"Attribute name cannot start with '='.\",\n [21]: \"'<?' is allowed only in XML context.\",\n [20]: `Unexpected null character.`,\n [22]: \"Illegal '/' in tags.\",\n // Vue-specific parse errors\n [23]: \"Invalid end tag.\",\n [24]: \"Element is missing end tag.\",\n [25]: \"Interpolation end sign was not found.\",\n [27]: \"End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.\",\n [26]: \"Legal directive name was expected.\",\n // transform errors\n [28]: `v-if/v-else-if is missing expression.`,\n [29]: `v-if/else branches must use unique keys.`,\n [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,\n [31]: `v-for is missing expression.`,\n [32]: `v-for has invalid expression.`,\n [33]: `<template v-for> key should be placed on the <template> tag.`,\n [34]: `v-bind is missing expression.`,\n [53]: `v-bind with same-name shorthand only allows static argument.`,\n [35]: `v-on is missing expression.`,\n [36]: `Unexpected custom directive on <slot> outlet.`,\n [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,\n [38]: `Duplicate slot names found. `,\n [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,\n [40]: `v-slot can only be used on components or <template> tags.`,\n [41]: `v-model is missing expression.`,\n [42]: `v-model value must be a valid JavaScript member expression.`,\n [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,\n [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,\n [45]: `v-model cannot be used on a const binding because it is not writable.`,\n [46]: `Error parsing JavaScript expression: `,\n [47]: `<KeepAlive> expects exactly one child component.`,\n [52]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,\n // generic errors\n [48]: `\"prefixIdentifiers\" option is not supported in this build of compiler.`,\n [49]: `ES module mode is not supported in this build of compiler.`,\n [50]: `\"cacheHandlers\" option is only supported when the \"prefixIdentifiers\" option is enabled.`,\n [51]: `\"scopeId\" option is only supported in module mode.`,\n // just to fulfill types\n [54]: ``\n};\n\nfunction walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {\n const rootExp = root.type === \"Program\" ? root.body[0].type === \"ExpressionStatement\" && root.body[0].expression : root;\n estreeWalker.walk(root, {\n enter(node, parent) {\n parent && parentStack.push(parent);\n if (parent && parent.type.startsWith(\"TS\") && !TS_NODE_TYPES.includes(parent.type)) {\n return this.skip();\n }\n if (node.type === \"Identifier\") {\n const isLocal = !!knownIds[node.name];\n const isRefed = isReferencedIdentifier(node, parent, parentStack);\n if (includeAll || isRefed && !isLocal) {\n onIdentifier(node, parent, parentStack, isRefed, isLocal);\n }\n } else if (node.type === \"ObjectProperty\" && // eslint-disable-next-line no-restricted-syntax\n (parent == null ? void 0 : parent.type) === \"ObjectPattern\") {\n node.inPattern = true;\n } else if (isFunctionType(node)) {\n if (node.scopeIds) {\n node.scopeIds.forEach((id) => markKnownIds(id, knownIds));\n } else {\n walkFunctionParams(\n node,\n (id) => markScopeIdentifier(node, id, knownIds)\n );\n }\n } else if (node.type === \"BlockStatement\") {\n if (node.scopeIds) {\n node.scopeIds.forEach((id) => markKnownIds(id, knownIds));\n } else {\n walkBlockDeclarations(\n node,\n (id) => markScopeIdentifier(node, id, knownIds)\n );\n }\n } else if (node.type === \"SwitchStatement\") {\n if (node.scopeIds) {\n node.scopeIds.forEach((id) => markKnownIds(id, knownIds));\n } else {\n walkSwitchStatement(\n node,\n false,\n (id) => markScopeIdentifier(node, id, knownIds)\n );\n }\n } else if (node.type === \"CatchClause\" && node.param) {\n if (node.scopeIds) {\n node.scopeIds.forEach((id) => markKnownIds(id, knownIds));\n } else {\n for (const id of extractIdentifiers(node.param)) {\n markScopeIdentifier(node, id, knownIds);\n }\n }\n } else if (isForStatement(node)) {\n if (node.scopeIds) {\n node.scopeIds.forEach((id) => markKnownIds(id, knownIds));\n } else {\n walkForStatement(\n node,\n false,\n (id) => markScopeIdentifier(node, id, knownIds)\n );\n }\n }\n },\n leave(node, parent) {\n parent && parentStack.pop();\n if (node !== rootExp && node.scopeIds) {\n for (const id of node.scopeIds) {\n knownIds[id]--;\n if (knownIds[id] === 0) {\n delete knownIds[id];\n }\n }\n }\n }\n });\n}\nfunction isReferencedIdentifier(id, parent, parentStack) {\n if (!parent) {\n return true;\n }\n if (id.name === \"arguments\") {\n return false;\n }\n if (isReferenced(id, parent, parentStack[parentStack.length - 2])) {\n return true;\n }\n switch (parent.type) {\n case \"AssignmentExpression\":\n case \"AssignmentPattern\":\n return true;\n case \"ObjectProperty\":\n return parent.key !== id && isInDestructureAssignment(parent, parentStack);\n case \"ArrayPattern\":\n return isInDestructureAssignment(parent, parentStack);\n }\n return false;\n}\nfunction isInDestructureAssignment(parent, parentStack) {\n if (parent && (parent.type === \"ObjectProperty\" || parent.type === \"ArrayPattern\")) {\n let i = parentStack.length;\n while (i--) {\n const p = parentStack[i];\n if (p.type === \"AssignmentExpression\") {\n return true;\n } else if (p.type !== \"ObjectProperty\" && !p.type.endsWith(\"Pattern\")) {\n break;\n }\n }\n }\n return false;\n}\nfunction isInNewExpression(parentStack) {\n let i = parentStack.length;\n while (i--) {\n const p = parentStack[i];\n if (p.type === \"NewExpression\") {\n return true;\n } else if (p.type !== \"MemberExpression\") {\n break;\n }\n }\n return false;\n}\nfunction walkFunctionParams(node, onIdent) {\n for (const p of node.params) {\n for (const id of extractIdentifiers(p)) {\n onIdent(id);\n }\n }\n}\nfunction walkBlockDeclarations(block, onIdent) {\n const body = block.type === \"SwitchCase\" ? block.consequent : block.body;\n for (const stmt of body) {\n if (stmt.type === \"VariableDeclaration\") {\n if (stmt.declare) continue;\n for (const decl of stmt.declarations) {\n for (const id of extractIdentifiers(decl.id)) {\n onIdent(id);\n }\n }\n } else if (stmt.type === \"FunctionDeclaration\" || stmt.type === \"ClassDeclaration\") {\n if (stmt.declare || !stmt.id) continue;\n onIdent(stmt.id);\n } else if (isForStatement(stmt)) {\n walkForStatement(stmt, true, onIdent);\n } else if (stmt.type === \"SwitchStatement\") {\n walkSwitchStatement(stmt, true, onIdent);\n }\n }\n}\nfunction isForStatement(stmt) {\n return stmt.type === \"ForOfStatement\" || stmt.type === \"ForInStatement\" || stmt.type === \"ForStatement\";\n}\nfunction walkForStatement(stmt, isVar, onIdent) {\n const variable = stmt.type === \"ForStatement\" ? stmt.init : stmt.left;\n if (variable && variable.type === \"VariableDeclaration\" && (variable.kind === \"var\" ? isVar : !isVar)) {\n for (const decl of variable.declarations) {\n for (const id of extractIdentifiers(decl.id)) {\n onIdent(id);\n }\n }\n }\n}\nfunction walkSwitchStatement(stmt, isVar, onIdent) {\n for (const cs of stmt.cases) {\n for (const stmt2 of cs.consequent) {\n if (stmt2.type === \"VariableDeclaration\" && (stmt2.kind === \"var\" ? isVar : !isVar)) {\n for (const decl of stmt2.declarations) {\n for (const id of extractIdentifiers(decl.id)) {\n onIdent(id);\n }\n }\n }\n }\n walkBlockDeclarations(cs, onIdent);\n }\n}\nfunction extractIdentifiers(param, nodes = []) {\n switch (param.type) {\n case \"Identifier\":\n nodes.push(param);\n break;\n case \"MemberExpression\":\n let object = param;\n while (object.type === \"MemberExpression\") {\n object = object.object;\n }\n nodes.push(object);\n break;\n case \"ObjectPattern\":\n for (const prop of param.properties) {\n if (prop.type === \"RestElement\") {\n extractIdentifiers(prop.argument, nodes);\n } else {\n extractIdentifiers(prop.value, nodes);\n }\n }\n break;\n case \"ArrayPattern\":\n param.elements.forEach((element) => {\n if (element) extractIdentifiers(element, nodes);\n });\n break;\n case \"RestElement\":\n extractIdentifiers(param.argument, nodes);\n break;\n case \"AssignmentPattern\":\n extractIdentifiers(param.left, nodes);\n break;\n }\n return nodes;\n}\nfunction markKnownIds(name, knownIds) {\n if (name in knownIds) {\n knownIds[name]++;\n } else {\n knownIds[name] = 1;\n }\n}\nfunction markScopeIdentifier(node, child, knownIds) {\n const { name } = child;\n if (node.scopeIds && node.scopeIds.has(name)) {\n return;\n }\n markKnownIds(name, knownIds);\n (node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name);\n}\nconst isFunctionType = (node) => {\n return /Function(?:Expression|Declaration)$|Method$/.test(node.type);\n};\nconst isStaticProperty = (node) => node && (node.type === \"ObjectProperty\" || node.type === \"ObjectMethod\") && !node.computed;\nconst isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;\nfunction isReferenced(node, parent, grandparent) {\n switch (parent.type) {\n // yes: PARENT[NODE]\n // yes: NODE.child\n // no: parent.NODE\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n if (parent.property === node) {\n return !!parent.computed;\n }\n return parent.object === node;\n case \"JSXMemberExpression\":\n return parent.object === node;\n // no: let NODE = init;\n // yes: let id = NODE;\n case \"VariableDeclarator\":\n return parent.init === node;\n // yes: () => NODE\n // no: (NODE) => {}\n case \"ArrowFunctionExpression\":\n return parent.body === node;\n // no: class { #NODE; }\n // no: class { get #NODE() {} }\n // no: class { #NODE() {} }\n // no: class { fn() { return this.#NODE; } }\n case \"PrivateName\":\n return false;\n // no: class { NODE() {} }\n // yes: class { [NODE]() {} }\n // no: class { foo(NODE) {} }\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"ObjectMethod\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return false;\n // yes: { [NODE]: \"\" }\n // no: { NODE: \"\" }\n // depends: { NODE }\n // depends: { key: NODE }\n case \"ObjectProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return !grandparent || grandparent.type !== \"ObjectPattern\";\n // no: class { NODE = value; }\n // yes: class { [NODE] = value; }\n // yes: class { key = NODE; }\n case \"ClassProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return true;\n case \"ClassPrivateProperty\":\n return parent.key !== node;\n // no: class NODE {}\n // yes: class Foo extends NODE {}\n case \"ClassDeclaration\":\n case \"ClassExpression\":\n return parent.superClass === node;\n // yes: left = NODE;\n // no: NODE = right;\n case \"AssignmentExpression\":\n return parent.right === node;\n // no: [NODE = foo] = [];\n // yes: [foo = NODE] = [];\n case \"AssignmentPattern\":\n return parent.right === node;\n // no: NODE: for (;;) {}\n case \"LabeledStatement\":\n return false;\n // no: try {} catch (NODE) {}\n case \"CatchClause\":\n return false;\n // no: function foo(...NODE) {}\n case \"RestElement\":\n return false;\n case \"BreakStatement\":\n case \"ContinueStatement\":\n return false;\n // no: function NODE() {}\n // no: function foo(NODE) {}\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n return false;\n // no: export NODE from \"foo\";\n // no: export * as NODE from \"foo\";\n case \"ExportNamespaceSpecifier\":\n case \"ExportDefaultSpecifier\":\n return false;\n // no: export { foo as NODE };\n // yes: export { NODE as foo };\n // no: export { NODE as foo } from \"foo\";\n case \"ExportSpecifier\":\n if (grandparent == null ? void 0 : grandparent.source) {\n return false;\n }\n return parent.local === node;\n // no: import NODE from \"foo\";\n // no: import * as NODE from \"foo\";\n // no: import { NODE as foo } from \"foo\";\n // no: import { foo as NODE } from \"foo\";\n // no: import NODE from \"bar\";\n case \"ImportDefaultSpecifier\":\n case \"ImportNamespaceSpecifier\":\n case \"ImportSpecifier\":\n return false;\n // no: import \"foo\" assert { NODE: \"json\" }\n case \"ImportAttribute\":\n return false;\n // no: <div NODE=\"foo\" />\n case \"JSXAttribute\":\n return false;\n // no: [NODE] = [];\n // no: ({ NODE }) = [];\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n return false;\n // no: new.NODE\n // no: NODE.target\n case \"MetaProperty\":\n return false;\n // yes: type X = { someProperty: NODE }\n // no: type X = { NODE: OtherType }\n case \"ObjectTypeProperty\":\n return parent.key !== node;\n // yes: enum X { Foo = NODE }\n // no: enum X { NODE }\n case \"TSEnumMember\":\n return parent.id !== node;\n // yes: { [NODE]: value }\n // no: { NODE: value }\n case \"TSPropertySignature\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return true;\n }\n return true;\n}\nconst TS_NODE_TYPES = [\n \"TSAsExpression\",\n // foo as number\n \"TSTypeAssertion\",\n // (<number>foo)\n \"TSNonNullExpression\",\n // foo!\n \"TSInstantiationExpression\",\n // foo<string>\n \"TSSatisfiesExpression\"\n // foo satisfies T\n];\nfunction unwrapTSNode(node) {\n if (TS_NODE_TYPES.includes(node.type)) {\n return unwrapTSNode(node.expression);\n } else {\n return node;\n }\n}\n\nconst isStaticExp = (p) => p.type === 4 && p.isStatic;\nfunction isCoreComponent(tag) {\n switch (tag) {\n case \"Teleport\":\n case \"teleport\":\n return TELEPORT;\n case \"Suspense\":\n case \"suspense\":\n return SUSPENSE;\n case \"KeepAlive\":\n case \"keep-alive\":\n return KEEP_ALIVE;\n case \"BaseTransition\":\n case \"base-transition\":\n return BASE_TRANSITION;\n }\n}\nconst nonIdentifierRE = /^$|^\\d|[^\\$\\w\\xA0-\\uFFFF]/;\nconst isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);\nconst validFirstIdentCharRE = /[A-Za-z_$\\xA0-\\uFFFF]/;\nconst validIdentCharRE = /[\\.\\?\\w$\\xA0-\\uFFFF]/;\nconst whitespaceRE = /\\s+[.[]\\s*|\\s*[.[]\\s+/g;\nconst getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;\nconst isMemberExpressionBrowser = (exp) => {\n const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim());\n let state = 0 /* inMemberExp */;\n let stateStack = [];\n let currentOpenBracketCount = 0;\n let currentOpenParensCount = 0;\n let currentStringType = null;\n for (let i = 0; i < path.length; i++) {\n const char = path.charAt(i);\n switch (state) {\n case 0 /* inMemberExp */:\n if (char === \"[\") {\n stateStack.push(state);\n state = 1 /* inBrackets */;\n currentOpenBracketCount++;\n } else if (char === \"(\") {\n stateStack.push(state);\n state = 2 /* inParens */;\n currentOpenParensCount++;\n } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {\n return false;\n }\n break;\n case 1 /* inBrackets */:\n if (char === `'` || char === `\"` || char === \"`\") {\n stateStack.push(state);\n state = 3 /* inString */;\n currentStringType = char;\n } else if (char === `[`) {\n currentOpenBracketCount++;\n } else if (char === `]`) {\n if (!--currentOpenBracketCount) {\n state = stateStack.pop();\n }\n }\n break;\n case 2 /* inParens */:\n if (char === `'` || char === `\"` || char === \"`\") {\n stateStack.push(state);\n state = 3 /* inString */;\n currentStringType = char;\n } else if (char === `(`) {\n currentOpenParensCount++;\n } else if (char === `)`) {\n if (i === path.length - 1) {\n return false;\n }\n if (!--currentOpenParensCount) {\n state = stateStack.pop();\n }\n }\n break;\n case 3 /* inString */:\n if (char === currentStringType) {\n state = stateStack.pop();\n currentStringType = null;\n }\n break;\n }\n }\n return !currentOpenBracketCount && !currentOpenParensCount;\n};\nconst isMemberExpressionNode = (exp, context) => {\n try {\n let ret = exp.ast || parser.parseExpression(getExpSource(exp), {\n plugins: context.expressionPlugins ? [...context.expressionPlugins, \"typescript\"] : [\"typescript\"]\n });\n ret = unwrapTSNode(ret);\n return ret.type === \"MemberExpression\" || ret.type === \"OptionalMemberExpression\" || ret.type === \"Identifier\" && ret.name !== \"undefined\";\n } catch (e) {\n return false;\n }\n};\nconst isMemberExpression = isMemberExpressionNode;\nconst fnExpRE = /^\\s*(?:async\\s*)?(?:\\([^)]*?\\)|[\\w$_]+)\\s*(?::[^=]+)?=>|^\\s*(?:async\\s+)?function(?:\\s+[\\w$]+)?\\s*\\(/;\nconst isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));\nconst isFnExpressionNode = (exp, context) => {\n try {\n let ret = exp.ast || parser.parseExpression(getExpSource(exp), {\n plugins: context.expressionPlugins ? [...context.expressionPlugins, \"typescript\"] : [\"typescript\"]\n });\n if (ret.type === \"Program\") {\n ret = ret.body[0];\n if (ret.type === \"ExpressionStatement\") {\n ret = ret.expression;\n }\n }\n ret = unwrapTSNode(ret);\n return ret.type === \"FunctionExpression\" || ret.type === \"ArrowFunctionExpression\";\n } catch (e) {\n return false;\n }\n};\nconst isFnExpression = isFnExpressionNode;\nfunction advancePositionWithClone(pos, source, numberOfCharacters = source.length) {\n return advancePositionWithMutation(\n {\n offset: pos.offset,\n line: pos.line,\n column: pos.column\n },\n source,\n numberOfCharacters\n );\n}\nfunction advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\n let linesCount = 0;\n let lastNewLinePos = -1;\n for (let i = 0; i < numberOfCharacters; i++) {\n if (source.charCodeAt(i) === 10) {\n linesCount++;\n lastNewLinePos = i;\n }\n }\n pos.offset += numberOfCharacters;\n pos.line += linesCount;\n pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos;\n return pos;\n}\nfunction assert(condition, msg) {\n if (!condition) {\n throw new Error(msg || `unexpected compiler condition`);\n }\n}\nfunction findDir(node, name, allowEmpty = false) {\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 7 && (allowEmpty || p.exp) && (shared.isString(name) ? p.name === name : name.test(p.name))) {\n return p;\n }\n }\n}\nfunction findProp(node, name, dynamicOnly = false, allowEmpty = false) {\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 6) {\n if (dynamicOnly) continue;\n if (p.name === name && (p.value || allowEmpty)) {\n return p;\n }\n } else if (p.name === \"bind\" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) {\n return p;\n }\n }\n}\nfunction isStaticArgOf(arg, name) {\n return !!(arg && isStaticExp(arg) && arg.content === name);\n}\nfunction hasDynamicKeyVBind(node) {\n return node.props.some(\n (p) => p.type === 7 && p.name === \"bind\" && (!p.arg || // v-bind=\"obj\"\n p.arg.type !== 4 || // v-bind:[_ctx.foo]\n !p.arg.isStatic)\n // v-bind:[foo]\n );\n}\nfunction isText$1(node) {\n return node.type === 5 || node.type === 2;\n}\nfunction isVPre(p) {\n return p.type === 7 && p.name === \"pre\";\n}\nfunction isVSlot(p) {\n return p.type === 7 && p.name === \"slot\";\n}\nfunction isTemplateNode(node) {\n return node.type === 1 && node.tagType === 3;\n}\nfunction isSlotOutlet(node) {\n return node.type === 1 && node.tagType === 2;\n}\nconst propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);\nfunction getUnnormalizedProps(props, callPath = []) {\n if (props && !shared.isString(props) && props.type === 14) {\n const callee = props.callee;\n if (!shared.isString(callee) && propsHelperSet.has(callee)) {\n return getUnnormalizedProps(\n props.arguments[0],\n callPath.concat(props)\n );\n }\n }\n return [props, callPath];\n}\nfunction injectProp(node, prop, context) {\n let propsWithInjection;\n let props = node.type === 13 ? node.props : node.arguments[2];\n let callPath = [];\n let parentCall;\n if (props && !shared.isString(props) && props.type === 14) {\n const ret = getUnnormalizedProps(props);\n props = ret[0];\n callPath = ret[1];\n parentCall = callPath[callPath.length - 1];\n }\n if (props == null || shared.isString(props)) {\n propsWithInjection = createObjectExpression([prop]);\n } else if (props.type === 14) {\n const first = props.arguments[0];\n if (!shared.isString(first) && first.type === 15) {\n if (!hasProp(prop, first)) {\n first.properties.unshift(prop);\n }\n } else {\n if (props.callee === TO_HANDLERS) {\n propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [\n createObjectExpression([prop]),\n props\n ]);\n } else {\n props.arguments.unshift(createObjectExpression([prop]));\n }\n }\n !propsWithInjection && (propsWithInjection = props);\n } else if (props.type === 15) {\n if (!hasProp(prop, props)) {\n props.properties.unshift(prop);\n }\n propsWithInjection = props;\n } else {\n propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [\n createObjectExpression([prop]),\n props\n ]);\n if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {\n parentCall = callPath[callPath.length - 2];\n }\n }\n if (node.type === 13) {\n if (parentCall) {\n parentCall.arguments[0] = propsWithInjection;\n } else {\n node.props = propsWithInjection;\n }\n } else {\n if (parentCall) {\n parentCall.arguments[0] = propsWithInjection;\n } else {\n node.arguments[2] = propsWithInjection;\n }\n }\n}\nfunction hasProp(prop, props) {\n let result = false;\n if (prop.key.type === 4) {\n const propKeyName = prop.key.content;\n result = props.properties.some(\n (p) => p.key.type === 4 && p.key.content === propKeyName\n );\n }\n return result;\n}\nfunction toValidAssetId(name, type) {\n return `_${type}_${name.replace(/[^\\w]/g, (searchValue, replaceValue) => {\n return searchValue === \"-\" ? \"_\" : name.charCodeAt(replaceValue).toString();\n })}`;\n}\nfunction hasScopeRef(node, ids) {\n if (!node || Object.keys(ids).length === 0) {\n return false;\n }\n switch (node.type) {\n case 1:\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {\n return true;\n }\n }\n return node.children.some((c) => hasScopeRef(c, ids));\n case 11:\n if (hasScopeRef(node.source, ids)) {\n return true;\n }\n return node.children.some((c) => hasScopeRef(c, ids));\n case 9:\n return node.branches.some((b) => hasScopeRef(b, ids));\n case 10:\n if (hasScopeRef(node.condition, ids)) {\n return true;\n }\n return node.children.some((c) => hasScopeRef(c, ids));\n case 4:\n return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content];\n case 8:\n return node.children.some((c) => shared.isObject(c) && hasScopeRef(c, ids));\n case 5:\n case 12:\n return hasScopeRef(node.content, ids);\n case 2:\n case 3:\n case 20:\n return false;\n default:\n return false;\n }\n}\nfunction getMemoedVNodeCall(node) {\n if (node.type === 14 && node.callee === WITH_MEMO) {\n return node.arguments[1].returns;\n } else {\n return node;\n }\n}\nconst forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+(\\S[\\s\\S]*)/;\nfunction isAllWhitespace(str) {\n for (let i = 0; i < str.length; i++) {\n if (!isWhitespace(str.charCodeAt(i))) {\n return false;\n }\n }\n return true;\n}\nfunction isWhitespaceText(node) {\n return node.type === 2 && isAllWhitespace(node.content) || node.type === 12 && isWhitespaceText(node.content);\n}\nfunction isCommentOrWhitespace(node) {\n return node.type === 3 || isWhitespaceText(node);\n}\n\nconst defaultParserOptions = {\n parseMode: \"base\",\n ns: 0,\n delimiters: [`{{`, `}}`],\n getNamespace: () => 0,\n isVoidTag: shared.NO,\n isPreTag: shared.NO,\n isIgnoreNewlineTag: shared.NO,\n isCustomElement: shared.NO,\n onError: defaultOnError,\n onWarn: defaultOnWarn,\n comments: false,\n prefixIdentifiers: false\n};\nlet currentOptions = defaultParserOptions;\nlet currentRoot = null;\nlet currentInput = \"\";\nlet currentOpenTag = null;\nlet currentProp = null;\nlet currentAttrValue = \"\";\nlet currentAttrStartIndex = -1;\nlet currentAttrEndIndex = -1;\nlet inPre = 0;\nlet inVPre = false;\nlet currentVPreBoundary = null;\nconst stack = [];\nconst tokenizer = new Tokenizer(stack, {\n onerr: emitError,\n ontext(start, end) {\n onText(getSlice(start, end), start, end);\n },\n ontextentity(char, start, end) {\n onText(char, start, end);\n },\n oninterpolation(start, end) {\n if (inVPre) {\n return onText(getSlice(start, end), start, end);\n }\n let innerStart = start + tokenizer.delimiterOpen.length;\n let innerEnd = end - tokenizer.delimiterClose.length;\n while (isWhitespace(currentInput.charCodeAt(innerStart))) {\n innerStart++;\n }\n while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) {\n innerEnd--;\n }\n let exp = getSlice(innerStart, innerEnd);\n if (exp.includes(\"&\")) {\n {\n exp = decode.decodeHTML(exp);\n }\n }\n addNode({\n type: 5,\n content: createExp(exp, false, getLoc(innerStart, innerEnd)),\n loc: getLoc(start, end)\n });\n },\n onopentagname(start, end) {\n const name = getSlice(start, end);\n currentOpenTag = {\n type: 1,\n tag: name,\n ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns),\n tagType: 0,\n // will be refined on tag close\n props: [],\n children: [],\n loc: getLoc(start - 1, end),\n codegenNode: void 0\n };\n },\n onopentagend(end) {\n endOpenTag(end);\n },\n onclosetag(start, end) {\n const name = getSlice(start, end);\n if (!currentOptions.isVoidTag(name)) {\n let found = false;\n for (let i = 0; i < stack.length; i++) {\n const e = stack[i];\n if (e.tag.toLowerCase() === name.toLowerCase()) {\n found = true;\n if (i > 0) {\n emitError(24, stack[0].loc.start.offset);\n }\n for (let j = 0; j <= i; j++) {\n const el = stack.shift();\n onCloseTag(el, end, j < i);\n }\n break;\n }\n }\n if (!found) {\n emitError(23, backTrack(start, 60));\n }\n }\n },\n onselfclosingtag(end) {\n const name = currentOpenTag.tag;\n currentOpenTag.isSelfClosing = true;\n endOpenTag(end);\n if (stack[0] && stack[0].tag === name) {\n onCloseTag(stack.shift(), end);\n }\n },\n onattribname(start, end) {\n currentProp = {\n type: 6,\n name: getSlice(start, end),\n nameLoc: getLoc(start, end),\n value: void 0,\n loc: getLoc(start)\n };\n },\n ondirname(start, end) {\n const raw = getSlice(start, end);\n const name = raw === \".\" || raw === \":\" ? \"bind\" : raw === \"@\" ? \"on\" : raw === \"#\" ? \"slot\" : raw.slice(2);\n if (!inVPre && name === \"\") {\n emitError(26, start);\n }\n if (inVPre || name === \"\") {\n currentProp = {\n type: 6,\n name: raw,\n nameLoc: getLoc(start, end),\n value: void 0,\n loc: getLoc(start)\n };\n } else {\n currentProp = {\n type: 7,\n name,\n rawName: raw,\n exp: void 0,\n arg: void 0,\n modifiers: raw === \".\" ? [createSimpleExpression(\"prop\")] : [],\n loc: getLoc(start)\n };\n if (name === \"pre\") {\n inVPre = tokenizer.inVPre = true;\n currentVPreBoundary = currentOpenTag;\n const props = currentOpenTag.props;\n for (let i = 0; i < props.length; i++) {\n if (props[i].type === 7) {\n props[i] = dirToAttr(props[i]);\n }\n }\n }\n }\n },\n ondirarg(start, end) {\n if (start === end) return;\n const arg = getSlice(start, end);\n if (inVPre && !isVPre(currentProp)) {\n currentProp.name += arg;\n setLocEnd(currentProp.nameLoc, end);\n } else {\n const isStatic = arg[0] !== `[`;\n currentProp.arg = createExp(\n isStatic ? arg : arg.slice(1, -1),\n isStatic,\n getLoc(start, end),\n isStatic ? 3 : 0\n );\n }\n },\n ondirmodifier(start, end) {\n const mod = getSlice(start, end);\n if (inVPre && !isVPre(currentProp)) {\n currentProp.name += \".\" + mod;\n setLocEnd(currentProp.nameLoc, end);\n } else if (currentProp.name === \"slot\") {\n const arg = currentProp.arg;\n if (arg) {\n arg.content += \".\" + mod;\n setLocEnd(arg.loc, end);\n }\n } else {\n const exp = createSimpleExpression(mod, true, getLoc(start, end));\n currentProp.modifiers.push(exp);\n }\n },\n onattribdata(start, end) {\n currentAttrValue += getSlice(start, end);\n if (currentAttrStartIndex < 0) currentAttrStartIndex = start;\n currentAttrEndIndex = end;\n },\n onattribentity(char, start, end) {\n currentAttrValue += char;\n if (currentAttrStartIndex < 0) currentAttrStartIndex = start;\n currentAttrEndIndex = end;\n },\n onattribnameend(end) {\n const start = currentProp.loc.start.offset;\n const name = getSlice(start, end);\n if (currentProp.type === 7) {\n currentProp.rawName = name;\n }\n if (currentOpenTag.props.some(\n (p) => (p.type === 7 ? p.rawName : p.name) === name\n )) {\n emitError(2, start);\n }\n },\n onattribend(quote, end) {\n if (currentOpenTag && currentProp) {\n setLocEnd(currentProp.loc, end);\n if (quote !== 0) {\n if (currentProp.type === 6) {\n if (currentProp.name === \"class\") {\n currentAttrValue = condense(currentAttrValue).trim();\n }\n if (quote === 1 && !currentAttrValue) {\n emitError(13, end);\n }\n currentProp.value = {\n type: 2,\n content: currentAttrValue,\n loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1)\n };\n if (tokenizer.inSFCRoot && currentOpenTag.tag === \"template\" && currentProp.name === \"lang\" && currentAttrValue && currentAttrValue !== \"html\") {\n tokenizer.enterRCDATA(toCharCodes(`</template`), 0);\n }\n } else {\n let expParseMode = 0 /* Normal */;\n {\n if (currentProp.name === \"for\") {\n expParseMode = 3 /* Skip */;\n } else if (currentProp.name === \"slot\") {\n expParseMode = 1 /* Params */;\n } else if (currentProp.name === \"on\" && currentAttrValue.includes(\";\")) {\n expParseMode = 2 /* Statements */;\n }\n }\n currentProp.exp = createExp(\n currentAttrValue,\n false,\n getLoc(currentAttrStartIndex, currentAttrEndIndex),\n 0,\n expParseMode\n );\n if (currentProp.name === \"for\") {\n currentProp.forParseResult = parseForExpression(currentProp.exp);\n }\n let syncIndex = -1;\n if (currentProp.name === \"bind\" && (syncIndex = currentProp.modifiers.findIndex(\n (mod) => mod.content === \"sync\"\n )) > -1 && checkCompatEnabled(\n \"COMPILER_V_BIND_SYNC\",\n currentOptions,\n currentProp.loc,\n currentProp.arg.loc.source\n )) {\n currentProp.name = \"model\";\n currentProp.modifiers.splice(syncIndex, 1);\n }\n }\n }\n if (currentProp.type !== 7 || currentProp.name !== \"pre\") {\n currentOpenTag.props.push(currentProp);\n }\n }\n currentAttrValue = \"\";\n currentAttrStartIndex = currentAttrEndIndex = -1;\n },\n oncomment(start, end) {\n if (currentOptions.comments) {\n addNode({\n type: 3,\n content: getSlice(start, end),\n loc: getLoc(start - 4, end + 3)\n });\n }\n },\n onend() {\n const end = currentInput.length;\n if (tokenizer.state !== 1) {\n switch (tokenizer.state) {\n case 5:\n case 8:\n emitError(5, end);\n break;\n case 3:\n case 4:\n emitError(\n 25,\n tokenizer.sectionStart\n );\n break;\n case 28:\n if (tokenizer.currentSequence === Sequences.CdataEnd) {\n emitError(6, end);\n } else {\n emitError(7, end);\n }\n break;\n case 6:\n case 7:\n case 9:\n case 11:\n case 12:\n case 13:\n case 14:\n case 15:\n case 16:\n case 17:\n case 18:\n case 19:\n // \"\n case 20:\n // '\n case 21:\n emitError(9, end);\n break;\n }\n }\n for (let index = 0; index < stack.length; index++) {\n onCloseTag(stack[index], end - 1);\n emitError(24, stack[index].loc.start.offset);\n }\n },\n oncdata(start, end) {\n if (stack[0].ns !== 0) {\n onText(getSlice(start, end), start, end);\n } else {\n emitError(1, start - 9);\n }\n },\n onprocessinginstruction(start) {\n if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) {\n emitError(\n 21,\n start - 1\n );\n }\n }\n});\nconst forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\nconst stripParensRE = /^\\(|\\)$/g;\nfunction parseForExpression(input) {\n const loc = input.loc;\n const exp = input.content;\n const inMatch = exp.match(forAliasRE);\n if (!inMatch) return;\n const [, LHS, RHS] = inMatch;\n const createAliasExpression = (content, offset, asParam = false) => {\n const start = loc.start.offset + offset;\n const end = start + content.length;\n return createExp(\n content,\n false,\n getLoc(start, end),\n 0,\n asParam ? 1 /* Params */ : 0 /* Normal */\n );\n };\n const result = {\n source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),\n value: void 0,\n key: void 0,\n index: void 0,\n finalized: false\n };\n let valueContent = LHS.trim().replace(stripParensRE, \"\").trim();\n const trimmedOffset = LHS.indexOf(valueContent);\n const iteratorMatch = valueContent.match(forIteratorRE);\n if (iteratorMatch) {\n valueContent = valueContent.replace(forIteratorRE, \"\").trim();\n const keyContent = iteratorMatch[1].trim();\n let keyOffset;\n if (keyContent) {\n keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);\n result.key = createAliasExpression(keyContent, keyOffset, true);\n }\n if (iteratorMatch[2]) {\n const indexContent = iteratorMatch[2].trim();\n if (indexContent) {\n result.index = createAliasExpression(\n indexContent,\n exp.indexOf(\n indexContent,\n result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length\n ),\n true\n );\n }\n }\n }\n if (valueContent) {\n result.value = createAliasExpression(valueContent, trimmedOffset, true);\n }\n return result;\n}\nfunction getSlice(start, end) {\n return currentInput.slice(start, end);\n}\nfunction endOpenTag(end) {\n if (tokenizer.inSFCRoot) {\n currentOpenTag.innerLoc = getLoc(end + 1, end + 1);\n }\n addNode(currentOpenTag);\n const { tag, ns } = currentOpenTag;\n if (ns === 0 && currentOptions.isPreTag(tag)) {\n inPre++;\n }\n if (currentOptions.isVoidTag(tag)) {\n onCloseTag(currentOpenTag, end);\n } else {\n stack.unshift(currentOpenTag);\n if (ns === 1 || ns === 2) {\n tokenizer.inXML = true;\n }\n }\n currentOpenTag = null;\n}\nfunction onText(content, start, end) {\n const parent = stack[0] || currentRoot;\n const lastNode = parent.children[parent.children.length - 1];\n if (lastNode && lastNode.type === 2) {\n lastNode.content += content;\n setLocEnd(lastNode.loc, end);\n } else {\n parent.children.push({\n type: 2,\n content,\n loc: getLoc(start, end)\n });\n }\n}\nfunction onCloseTag(el, end, isImplied = false) {\n if (isImplied) {\n setLocEnd(el.loc, backTrack(end, 60));\n } else {\n setLocEnd(el.loc, lookAhead(end, 62) + 1);\n }\n if (tokenizer.inSFCRoot) {\n if (el.children.length) {\n el.innerLoc.end = shared.extend({}, el.children[el.children.length - 1].loc.end);\n } else {\n el.innerLoc.end = shared.extend({}, el.innerLoc.start);\n }\n el.innerLoc.source = getSlice(\n el.innerLoc.start.offset,\n el.innerLoc.end.offset\n );\n }\n const { tag, ns, children } = el;\n if (!inVPre) {\n if (tag === \"slot\") {\n el.tagType = 2;\n } else if (isFragmentTemplate(el)) {\n el.tagType = 3;\n } else if (isComponent(el)) {\n el.tagType = 1;\n }\n }\n if (!tokenizer.inRCDATA) {\n el.children = condenseWhitespace(children);\n }\n if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {\n const first = children[0];\n if (first && first.type === 2) {\n first.content = first.content.replace(/^\\r?\\n/, \"\");\n }\n }\n if (ns === 0 && currentOptions.isPreTag(tag)) {\n inPre--;\n }\n if (currentVPreBoundary === el) {\n inVPre = tokenizer.inVPre = false;\n currentVPreBoundary = null;\n }\n if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) {\n tokenizer.inXML = false;\n }\n {\n const props = el.props;\n if (!tokenizer.inSFCRoot && isCompatEnabled(\n \"COMPILER_NATIVE_TEMPLATE\",\n currentOptions\n ) && el.tag === \"template\" && !isFragmentTemplate(el)) {\n const parent = stack[0] || currentRoot;\n const index = parent.children.indexOf(el);\n parent.children.splice(index, 1, ...el.children);\n }\n const inlineTemplateProp = props.find(\n (p) => p.type === 6 && p.name === \"inline-template\"\n );\n if (inlineTemplateProp && checkCompatEnabled(\n \"COMPILER_INLINE_TEMPLATE\",\n currentOptions,\n inlineTemplateProp.loc\n ) && el.children.length) {\n inlineTemplateProp.value = {\n type: 2,\n content: getSlice(\n el.children[0].loc.start.offset,\n el.children[el.children.length - 1].loc.end.offset\n ),\n loc: inlineTemplateProp.loc\n };\n }\n }\n}\nfunction lookAhead(index, c) {\n let i = index;\n while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++;\n return i;\n}\nfunction backTrack(index, c) {\n let i = index;\n while (currentInput.charCodeAt(i) !== c && i >= 0) i--;\n return i;\n}\nconst specialTemplateDir = /* @__PURE__ */ new Set([\"if\", \"else\", \"else-if\", \"for\", \"slot\"]);\nfunction isFragmentTemplate({ tag, props }) {\n if (tag === \"template\") {\n for (let i = 0; i < props.length; i++) {\n if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) {\n return true;\n }\n }\n }\n return false;\n}\nfunction isComponent({ tag, props }) {\n if (currentOptions.isCustomElement(tag)) {\n return false;\n }\n if (tag === \"component\" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {\n return true;\n }\n for (let i = 0; i < props.length; i++) {\n const p = props[i];\n if (p.type === 6) {\n if (p.name === \"is\" && p.value) {\n if (p.value.content.startsWith(\"vue:\")) {\n return true;\n } else if (checkCompatEnabled(\n \"COMPILER_IS_ON_ELEMENT\",\n currentOptions,\n p.loc\n )) {\n return true;\n }\n }\n } else if (// :is on plain element - only treat as component in compat mode\n p.name === \"bind\" && isStaticArgOf(p.arg, \"is\") && checkCompatEnabled(\n \"COMPILER_IS_ON_ELEMENT\",\n currentOptions,\n p.loc\n )) {\n return true;\n }\n }\n return false;\n}\nfunction isUpperCase(c) {\n return c > 64 && c < 91;\n}\nconst windowsNewlineRE = /\\r\\n/g;\nfunction condenseWhitespace(nodes) {\n const shouldCondense = currentOptions.whitespace !== \"preserve\";\n let removedWhitespace = false;\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (node.type === 2) {\n if (!inPre) {\n if (isAllWhitespace(node.content)) {\n const prev = nodes[i - 1] && nodes[i - 1].type;\n const next = nodes[i + 1] && nodes[i + 1].type;\n if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {\n removedWhitespace = true;\n nodes[i] = null;\n } else {\n node.content = \" \";\n }\n } else if (shouldCondense) {\n node.content = condense(node.content);\n }\n } else {\n node.content = node.content.replace(windowsNewlineRE, \"\\n\");\n }\n }\n }\n return removedWhitespace ? nodes.filter(Boolean) : nodes;\n}\nfunction hasNewlineChar(str) {\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c === 10 || c === 13) {\n return true;\n }\n }\n return false;\n}\nfunction condense(str) {\n let ret = \"\";\n let prevCharIsWhitespace = false;\n for (let i = 0; i < str.length; i++) {\n if (isWhitespace(str.charCodeAt(i))) {\n if (!prevCharIsWhitespace) {\n ret += \" \";\n prevCharIsWhitespace = true;\n }\n } else {\n ret += str[i];\n prevCharIsWhitespace = false;\n }\n }\n return ret;\n}\nfunction addNode(node) {\n (stack[0] || currentRoot).children.push(node);\n}\nfunction getLoc(start, end) {\n return {\n start: tokenizer.getPos(start),\n // @ts-expect-error allow late attachment\n end: end == null ? end : tokenizer.getPos(end),\n // @ts-expect-error allow late attachment\n source: end == null ? end : getSlice(start, end)\n };\n}\nfunction cloneLoc(loc) {\n return getLoc(loc.start.offset, loc.end.offset);\n}\nfunction setLocEnd(loc, end) {\n loc.end = tokenizer.getPos(end);\n loc.source = getSlice(loc.start.offset, end);\n}\nfunction dirToAttr(dir) {\n const attr = {\n type: 6,\n name: dir.rawName,\n nameLoc: getLoc(\n dir.loc.start.offset,\n dir.loc.start.offset + dir.rawName.length\n ),\n value: void 0,\n loc: dir.loc\n };\n if (dir.exp) {\n const loc = dir.exp.loc;\n if (loc.end.offset < dir.loc.end.offset) {\n loc.start.offset--;\n loc.start.column--;\n loc.end.offset++;\n loc.end.column++;\n }\n attr.value = {\n type: 2,\n content: dir.exp.content,\n loc\n };\n }\n return attr;\n}\nfunction createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) {\n const exp = createSimpleExpression(content, isStatic, loc, constType);\n if (!isStatic && currentOptions.prefixIdentifiers && parseMode !== 3 /* Skip */ && content.trim()) {\n if (isSimpleIdentifier(content)) {\n exp.ast = null;\n return exp;\n }\n try {\n const plugins = currentOptions.expressionPlugins;\n const options = {\n plugins: plugins ? [...plugins, \"typescript\"] : [\"typescript\"]\n };\n if (parseMode === 2 /* Statements */) {\n exp.ast = parser.parse(` ${content} `, options).program;\n } else if (parseMode === 1 /* Params */) {\n exp.ast = parser.parseExpression(`(${content})=>{}`, options);\n } else {\n exp.ast = parser.parseExpression(`(${content})`, options);\n }\n } catch (e) {\n exp.ast = false;\n emitError(46, loc.start.offset, e.message);\n }\n }\n return exp;\n}\nfunction emitError(code, index, message) {\n currentOptions.onError(\n createCompilerError(code, getLoc(index, index), void 0, message)\n );\n}\nfunction reset() {\n tokenizer.reset();\n currentOpenTag = null;\n currentProp = null;\n currentAttrValue = \"\";\n currentAttrStartIndex = -1;\n currentAttrEndIndex = -1;\n stack.length = 0;\n}\nfunction baseParse(input, options) {\n reset();\n currentInput = input;\n currentOptions = shared.extend({}, defaultParserOptions);\n if (options) {\n let key;\n for (key in options) {\n if (options[key] != null) {\n currentOptions[key] = options[key];\n }\n }\n }\n tokenizer.mode = currentOptions.parseMode === \"html\" ? 1 : currentOptions.parseMode === \"sfc\" ? 2 : 0;\n tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;\n const delimiters = options && options.delimiters;\n if (delimiters) {\n tokenizer.delimiterOpen = toCharCodes(delimiters[0]);\n tokenizer.delimiterClose = toCharCodes(delimiters[1]);\n }\n const root = currentRoot = createRoot([], input);\n tokenizer.parse(currentInput);\n root.loc = getLoc(0, input.length);\n root.children = condenseWhitespace(root.children);\n currentRoot = null;\n return root;\n}\n\nfunction cacheStatic(root, context) {\n walk(\n root,\n void 0,\n context,\n // Root node is unfortunately non-hoistable due to potential parent\n // fallthrough attributes.\n !!getSingleElementRoot(root)\n );\n}\nfunction getSingleElementRoot(root) {\n const children = root.children.filter((x) => x.type !== 3);\n return children.length === 1 && children[0].type === 1 && !isSlotOutlet(children[0]) ? children[0] : null;\n}\nfunction walk(node, parent, context, doNotHoistNode = false, inFor = false) {\n const { children } = node;\n const toCache = [];\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (child.type === 1 && child.tagType === 0) {\n const constantType = doNotHoistNode ? 0 : getConstantType(child, context);\n if (constantType > 0) {\n if (constantType >= 2) {\n child.codegenNode.patchFlag = -1;\n toCache.push(child);\n continue;\n }\n } else {\n const codegenNode = child.codegenNode;\n if (codegenNode.type === 13) {\n const flag = codegenNode.patchFlag;\n if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {\n const props = getNodeProps(child);\n if (props) {\n codegenNode.props = context.hoist(props);\n }\n }\n if (codegenNode.dynamicProps) {\n codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);\n }\n }\n }\n } else if (child.type === 12) {\n const constantType = doNotHoistNode ? 0 : getConstantType(child, context);\n if (constantType >= 2) {\n if (child.codegenNode.type === 14 && child.codegenNode.arguments.length > 0) {\n child.codegenNode.arguments.push(\n -1 + (``)\n );\n }\n toCache.push(child);\n continue;\n }\n }\n if (child.type === 1) {\n const isComponent = child.tagType === 1;\n if (isComponent) {\n context.scopes.vSlot++;\n }\n walk(child, node, context, false, inFor);\n if (isComponent) {\n context.scopes.vSlot--;\n }\n } else if (child.type === 11) {\n walk(child, node, context, child.children.length === 1, true);\n } else if (child.type === 9) {\n for (let i2 = 0; i2 < child.branches.length; i2++) {\n walk(\n child.branches[i2],\n node,\n context,\n child.branches[i2].children.length === 1,\n inFor\n );\n }\n }\n }\n let cachedAsArray = false;\n if (toCache.length === children.length && node.type === 1) {\n if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) {\n node.codegenNode.children = getCacheExpression(\n createArrayExpression(node.codegenNode.children)\n );\n cachedAsArray = true;\n } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {\n const slot = getSlotNode(node.codegenNode, \"default\");\n if (slot) {\n slot.returns = getCacheExpression(\n createArrayExpression(slot.returns)\n );\n cachedAsArray = true;\n }\n } else if (node.tagType === 3 && parent && parent.type === 1 && parent.tagType === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 15) {\n const slotName = findDir(node, \"slot\", true);\n const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);\n if (slot) {\n slot.returns = getCacheExpression(\n createArrayExpression(slot.returns)\n );\n cachedAsArray = true;\n }\n }\n }\n if (!cachedAsArray) {\n for (const child of toCache) {\n child.codegenNode = context.cache(child.codegenNode);\n }\n }\n function getCacheExpression(value) {\n const exp = context.cache(value);\n exp.needArraySpread = true;\n return exp;\n }\n function getSlotNode(node2, name) {\n if (node2.children && !shared.isArray(node2.children) && node2.children.type === 15) {\n const slot = node2.children.properties.find(\n (p) => p.key === name || p.key.content === name\n );\n return slot && slot.value;\n }\n }\n if (toCache.length && context.transformHoist) {\n context.transformHoist(children, context, node);\n }\n}\nfunction getConstantType(node, context) {\n const { constantCache } = context;\n switch (node.type) {\n case 1:\n if (node.tagType !== 0) {\n return 0;\n }\n const cached = constantCache.get(node);\n if (cached !== void 0) {\n return cached;\n }\n const codegenNode = node.codegenNode;\n if (codegenNode.type !== 13) {\n return 0;\n }\n if (codegenNode.isBlock && node.tag !== \"svg\" && node.tag !== \"foreignObject\" && node.tag !== \"math\") {\n return 0;\n }\n if (codegenNode.patchFlag === void 0) {\n let returnType2 = 3;\n const generatedPropsType = getGeneratedPropsConstantType(node, context);\n if (generatedPropsType === 0) {\n constantCache.set(node, 0);\n return 0;\n }\n if (generatedPropsType < returnType2) {\n returnType2 = generatedPropsType;\n }\n for (let i = 0; i < node.children.length; i++) {\n const childType = getConstantType(node.children[i], context);\n if (childType === 0) {\n constantCache.set(node, 0);\n return 0;\n }\n if (childType < returnType2) {\n returnType2 = childType;\n }\n }\n if (returnType2 > 1) {\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 7 && p.name === \"bind\" && p.exp) {\n const expType = getConstantType(p.exp, context);\n if (expType === 0) {\n constantCache.set(node, 0);\n return 0;\n }\n if (expType < returnType2) {\n returnType2 = expType;\n }\n }\n }\n }\n if (codegenNode.isBlock) {\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 7) {\n constantCache.set(node, 0);\n return 0;\n }\n }\n context.removeHelper(OPEN_BLOCK);\n context.removeHelper(\n getVNodeBlockHelper(context.inSSR, codegenNode.isComponent)\n );\n codegenNode.isBlock = false;\n context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));\n }\n constantCache.set(node, returnType2);\n return returnType2;\n } else {\n constantCache.set(node, 0);\n return 0;\n }\n case 2:\n case 3:\n return 3;\n case 9:\n case 11:\n case 10:\n return 0;\n case 5:\n case 12:\n return getConstantType(node.content, context);\n case 4:\n return node.constType;\n case 8:\n let returnType = 3;\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (shared.isString(child) || shared.isSymbol(child)) {\n continue;\n }\n const childType = getConstantType(child, context);\n if (childType === 0) {\n return 0;\n } else if (childType < returnType) {\n returnType = childType;\n }\n }\n return returnType;\n case 20:\n return 2;\n default:\n return 0;\n }\n}\nconst allowHoistedHelperSet = /* @__PURE__ */ new Set([\n NORMALIZE_CLASS,\n NORMALIZE_STYLE,\n NORMALIZE_PROPS,\n GUARD_REACTIVE_PROPS\n]);\nfunction getConstantTypeOfHelperCall(value, context) {\n if (value.type === 14 && !shared.isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {\n const arg = value.arguments[0];\n if (arg.type === 4) {\n return getConstantType(arg, context);\n } else if (arg.type === 14) {\n return getConstantTypeOfHelperCall(arg, context);\n }\n }\n return 0;\n}\nfunction getGeneratedPropsConstantType(node, context) {\n let returnType = 3;\n const props = getNodeProps(node);\n if (props && props.type === 15) {\n const { properties } = props;\n for (let i = 0; i < properties.length; i++) {\n const { key, value } = properties[i];\n const keyType = getConstantType(key, context);\n if (keyType === 0) {\n return keyType;\n }\n if (keyType < returnType) {\n returnType = keyType;\n }\n let valueType;\n if (value.type === 4) {\n valueType = getConstantType(value, context);\n } else if (value.type === 14) {\n valueType = getConstantTypeOfHelperCall(value, context);\n } else {\n valueType = 0;\n }\n if (valueType === 0) {\n return valueType;\n }\n if (valueType < returnType) {\n returnType = valueType;\n }\n }\n }\n return returnType;\n}\nfunction getNodeProps(node) {\n const codegenNode = node.codegenNode;\n if (codegenNode.type === 13) {\n return codegenNode.props;\n }\n}\n\nfunction createTransformContext(root, {\n filename = \"\",\n prefixIdentifiers = false,\n hoistStatic = false,\n hmr = false,\n cacheHandlers = false,\n nodeTransforms = [],\n directiveTransforms = {},\n transformHoist = null,\n isBuiltInComponent = shared.NOOP,\n isCustomElement = shared.NOOP,\n expressionPlugins = [],\n scopeId = null,\n slotted = true,\n ssr = false,\n inSSR = false,\n ssrCssVars = ``,\n bindingMetadata = shared.EMPTY_OBJ,\n inline = false,\n isTS = false,\n onError = defaultOnError,\n onWarn = defaultOnWarn,\n compatConfig\n}) {\n const nameMatch = filename.replace(/\\?.*$/, \"\").match(/([^/\\\\]+)\\.\\w+$/);\n const context = {\n // options\n filename,\n selfName: nameMatch && shared.capitalize(shared.camelize(nameMatch[1])),\n prefixIdentifiers,\n hoistStatic,\n hmr,\n cacheHandlers,\n nodeTransforms,\n directiveTransforms,\n transformHoist,\n isBuiltInComponent,\n isCustomElement,\n expressionPlugins,\n scopeId,\n slotted,\n ssr,\n inSSR,\n ssrCssVars,\n bindingMetadata,\n inline,\n isTS,\n onError,\n onWarn,\n compatConfig,\n // state\n root,\n helpers: /* @__PURE__ */ new Map(),\n components: /* @__PURE__ */ new Set(),\n directives: /* @__PURE__ */ new Set(),\n hoists: [],\n imports: [],\n cached: [],\n constantCache: /* @__PURE__ */ new WeakMap(),\n temps: 0,\n identifiers: /* @__PURE__ */ Object.create(null),\n scopes: {\n vFor: 0,\n vSlot: 0,\n vPre: 0,\n vOnce: 0\n },\n parent: null,\n grandParent: null,\n currentNode: root,\n childIndex: 0,\n inVOnce: false,\n // methods\n helper(name) {\n const count = context.helpers.get(name) || 0;\n context.helpers.set(name, count + 1);\n return name;\n },\n removeHelper(name) {\n const count = context.helpers.get(name);\n if (count) {\n const currentCount = count - 1;\n if (!currentCount) {\n context.helpers.delete(name);\n } else {\n context.helpers.set(name, currentCount);\n }\n }\n },\n helperString(name) {\n return `_${helperNameMap[context.helper(name)]}`;\n },\n replaceNode(node) {\n context.parent.children[context.childIndex] = context.currentNode = node;\n },\n removeNode(node) {\n const list = context.parent.children;\n const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1;\n if (!node || node === context.currentNode) {\n context.currentNode = null;\n context.onNodeRemoved();\n } else {\n if (context.childIndex > removalIndex) {\n context.childIndex--;\n context.onNodeRemoved();\n }\n }\n context.parent.children.splice(removalIndex, 1);\n },\n onNodeRemoved: shared.NOOP,\n addIdentifiers(exp) {\n {\n if (shared.isString(exp)) {\n addId(exp);\n } else if (exp.identifiers) {\n exp.identifiers.forEach(addId);\n } else if (exp.type === 4) {\n addId(exp.content);\n }\n }\n },\n removeIdentifiers(exp) {\n {\n if (shared.isString(exp)) {\n removeId(exp);\n } else if (exp.identifiers) {\n exp.identifiers.forEach(removeId);\n } else if (exp.type === 4) {\n removeId(exp.content);\n }\n }\n },\n hoist(exp) {\n if (shared.isString(exp)) exp = createSimpleExpression(exp);\n context.hoists.push(exp);\n const identifier = createSimpleExpression(\n `_hoisted_${context.hoists.length}`,\n false,\n exp.loc,\n 2\n );\n identifier.hoisted = exp;\n return identifier;\n },\n cache(exp, isVNode = false, inVOnce = false) {\n const cacheExp = createCacheExpression(\n context.cached.length,\n exp,\n isVNode,\n inVOnce\n );\n context.cached.push(cacheExp);\n return cacheExp;\n }\n };\n {\n context.filters = /* @__PURE__ */ new Set();\n }\n function addId(id) {\n const { identifiers } = context;\n if (identifiers[id] === void 0) {\n identifiers[id] = 0;\n }\n identifiers[id]++;\n }\n function removeId(id) {\n context.identifiers[id]--;\n }\n return context;\n}\nfunction transform(root, options) {\n const context = createTransformContext(root, options);\n traverseNode(root, context);\n if (options.hoistStatic) {\n cacheStatic(root, context);\n }\n if (!options.ssr) {\n createRootCodegen(root, context);\n }\n root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]);\n root.components = [...context.components];\n root.directives = [...context.directives];\n root.imports = context.imports;\n root.hoists = context.hoists;\n root.temps = context.temps;\n root.cached = context.cached;\n root.transformed = true;\n {\n root.filters = [...context.filters];\n }\n}\nfunction createRootCodegen(root, context) {\n const { helper } = context;\n const { children } = root;\n if (children.length === 1) {\n const singleElementRootChild = getSingleElementRoot(root);\n if (singleElementRootChild && singleElementRootChild.codegenNode) {\n const codegenNode = singleElementRootChild.codegenNode;\n if (codegenNode.type === 13) {\n convertToBlock(codegenNode, context);\n }\n root.codegenNode = codegenNode;\n } else {\n root.codegenNode = children[0];\n }\n } else if (children.length > 1) {\n let patchFlag = 64;\n root.codegenNode = createVNodeCall(\n context,\n helper(FRAGMENT),\n void 0,\n root.children,\n patchFlag,\n void 0,\n void 0,\n true,\n void 0,\n false\n );\n } else ;\n}\nfunction traverseChildren(parent, context) {\n let i = 0;\n const nodeRemoved = () => {\n i--;\n };\n for (; i < parent.children.length; i++) {\n const child = parent.children[i];\n if (shared.isString(child)) continue;\n context.grandParent = context.parent;\n context.parent = parent;\n context.childIndex = i;\n context.onNodeRemoved = nodeRemoved;\n traverseNode(child, context);\n }\n}\nfunction traverseNode(node, context) {\n context.currentNode = node;\n const { nodeTransforms } = context;\n const exitFns = [];\n for (let i2 = 0; i2 < nodeTransforms.length; i2++) {\n const onExit = nodeTransforms[i2](node, context);\n if (onExit) {\n if (shared.isArray(onExit)) {\n exitFns.push(...onExit);\n } else {\n exitFns.push(onExit);\n }\n }\n if (!context.currentNode) {\n return;\n } else {\n node = context.currentNode;\n }\n }\n switch (node.type) {\n case 3:\n if (!context.ssr) {\n context.helper(CREATE_COMMENT);\n }\n break;\n case 5:\n if (!context.ssr) {\n context.helper(TO_DISPLAY_STRING);\n }\n break;\n // for container types, further traverse downwards\n case 9:\n for (let i2 = 0; i2 < node.branches.length; i2++) {\n traverseNode(node.branches[i2], context);\n }\n break;\n case 10:\n case 11:\n case 1:\n case 0:\n traverseChildren(node, context);\n break;\n }\n context.currentNode = node;\n let i = exitFns.length;\n while (i--) {\n exitFns[i]();\n }\n}\nfunction createStructuralDirectiveTransform(name, fn) {\n const matches = shared.isString(name) ? (n) => n === name : (n) => name.test(n);\n return (node, context) => {\n if (node.type === 1) {\n const { props } = node;\n if (node.tagType === 3 && props.some(isVSlot)) {\n return;\n }\n const exitFns = [];\n for (let i = 0; i < props.length; i++) {\n const prop = props[i];\n if (prop.type === 7 && matches(prop.name)) {\n props.splice(i, 1);\n i--;\n const onExit = fn(node, prop, context);\n if (onExit) exitFns.push(onExit);\n }\n }\n return exitFns;\n }\n };\n}\n\nconst PURE_ANNOTATION = `/*@__PURE__*/`;\nconst aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;\nfunction createCodegenContext(ast, {\n mode = \"function\",\n prefixIdentifiers = mode === \"module\",\n sourceMap = false,\n filename = `template.vue.html`,\n scopeId = null,\n optimizeImports = false,\n runtimeGlobalName = `Vue`,\n runtimeModuleName = `vue`,\n ssrRuntimeModuleName = \"vue/server-renderer\",\n ssr = false,\n isTS = false,\n inSSR = false\n}) {\n const context = {\n mode,\n prefixIdentifiers,\n sourceMap,\n filename,\n scopeId,\n optimizeImports,\n runtimeGlobalName,\n runtimeModuleName,\n ssrRuntimeModuleName,\n ssr,\n isTS,\n inSSR,\n source: ast.source,\n code: ``,\n column: 1,\n line: 1,\n offset: 0,\n indentLevel: 0,\n pure: false,\n map: void 0,\n helper(key) {\n return `_${helperNameMap[key]}`;\n },\n push(code, newlineIndex = -2 /* None */, node) {\n context.code += code;\n if (context.map) {\n if (node) {\n let name;\n if (node.type === 4 && !node.isStatic) {\n const content = node.content.replace(/^_ctx\\./, \"\");\n if (content !== node.content && isSimpleIdentifier(content)) {\n name = content;\n }\n }\n if (node.loc.source) {\n addMapping(node.loc.start, name);\n }\n }\n if (newlineIndex === -3 /* Unknown */) {\n advancePositionWithMutation(context, code);\n } else {\n context.offset += code.length;\n if (newlineIndex === -2 /* None */) {\n context.column += code.length;\n } else {\n if (newlineIndex === -1 /* End */) {\n newlineIndex = code.length - 1;\n }\n context.line++;\n context.column = code.length - newlineIndex;\n }\n }\n if (node && node.loc !== locStub && node.loc.source) {\n addMapping(node.loc.end);\n }\n }\n },\n indent() {\n newline(++context.indentLevel);\n },\n deindent(withoutNewLine = false) {\n if (withoutNewLine) {\n --context.indentLevel;\n } else {\n newline(--context.indentLevel);\n }\n },\n newline() {\n newline(context.indentLevel);\n }\n };\n function newline(n) {\n context.push(\"\\n\" + ` `.repeat(n), 0 /* Start */);\n }\n function addMapping(loc, name = null) {\n const { _names, _mappings } = context.map;\n if (name !== null && !_names.has(name)) _names.add(name);\n _mappings.add({\n originalLine: loc.line,\n originalColumn: loc.column - 1,\n // source-map column is 0 based\n generatedLine: context.line,\n generatedColumn: context.column - 1,\n source: filename,\n name\n });\n }\n if (sourceMap) {\n context.map = new sourceMapJs.SourceMapGenerator();\n context.map.setSourceContent(filename, context.source);\n context.map._sources.add(filename);\n }\n return context;\n}\nfunction generate(ast, options = {}) {\n const context = createCodegenContext(ast, options);\n if (options.onContextCreated) options.onContextCreated(context);\n const {\n mode,\n push,\n prefixIdentifiers,\n indent,\n deindent,\n newline,\n scopeId,\n ssr\n } = context;\n const helpers = Array.from(ast.helpers);\n const hasHelpers = helpers.length > 0;\n const useWithBlock = !prefixIdentifiers && mode !== \"module\";\n const genScopeId = scopeId != null && mode === \"module\";\n const isSetupInlined = !!options.inline;\n const preambleContext = isSetupInlined ? createCodegenContext(ast, options) : context;\n if (mode === \"module\") {\n genModulePreamble(ast, preambleContext, genScopeId, isSetupInlined);\n } else {\n genFunctionPreamble(ast, preambleContext);\n }\n const functionName = ssr ? `ssrRender` : `render`;\n const args = ssr ? [\"_ctx\", \"_push\", \"_parent\", \"_attrs\"] : [\"_ctx\", \"_cache\"];\n if (options.bindingMetadata && !options.inline) {\n args.push(\"$props\", \"$setup\", \"$data\", \"$options\");\n }\n const signature = options.isTS ? args.map((arg) => `${arg}: any`).join(\",\") : args.join(\", \");\n if (isSetupInlined) {\n push(`(${signature}) => {`);\n } else {\n push(`function ${functionName}(${signature}) {`);\n }\n indent();\n if (useWithBlock) {\n push(`with (_ctx) {`);\n indent();\n if (hasHelpers) {\n push(\n `const { ${helpers.map(aliasHelper).join(\", \")} } = _Vue\n`,\n -1 /* End */\n );\n newline();\n }\n }\n if (ast.components.length) {\n genAssets(ast.components, \"component\", context);\n if (ast.directives.length || ast.temps > 0) {\n newline();\n }\n }\n if (ast.directives.length) {\n genAssets(ast.directives, \"directive\", context);\n if (ast.temps > 0) {\n newline();\n }\n }\n if (ast.filters && ast.filters.length) {\n newline();\n genAssets(ast.filters, \"filter\", context);\n newline();\n }\n if (ast.temps > 0) {\n push(`let `);\n for (let i = 0; i < ast.temps; i++) {\n push(`${i > 0 ? `, ` : ``}_temp${i}`);\n }\n }\n if (ast.components.length || ast.directives.length || ast.temps) {\n push(`\n`, 0 /* Start */);\n newline();\n }\n if (!ssr) {\n push(`return `);\n }\n if (ast.codegenNode) {\n genNode(ast.codegenNode, context);\n } else {\n push(`null`);\n }\n if (useWithBlock) {\n deindent();\n push(`}`);\n }\n deindent();\n push(`}`);\n return {\n ast,\n code: context.code,\n preamble: isSetupInlined ? preambleContext.code : ``,\n map: context.map ? context.map.toJSON() : void 0\n };\n}\nfunction genFunctionPreamble(ast, context) {\n const {\n ssr,\n prefixIdentifiers,\n push,\n newline,\n runtimeModuleName,\n runtimeGlobalName,\n ssrRuntimeModuleName\n } = context;\n const VueBinding = ssr ? `require(${JSON.stringify(runtimeModuleName)})` : runtimeGlobalName;\n const helpers = Array.from(ast.helpers);\n if (helpers.length > 0) {\n if (prefixIdentifiers) {\n push(\n `const { ${helpers.map(aliasHelper).join(\", \")} } = ${VueBinding}\n`,\n -1 /* End */\n );\n } else {\n push(`const _Vue = ${VueBinding}\n`, -1 /* End */);\n if (ast.hoists.length) {\n const staticHelpers = [\n CREATE_VNODE,\n CREATE_ELEMENT_VNODE,\n CREATE_COMMENT,\n CREATE_TEXT,\n CREATE_STATIC\n ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(\", \");\n push(`const { ${staticHelpers} } = _Vue\n`, -1 /* End */);\n }\n }\n }\n if (ast.ssrHelpers && ast.ssrHelpers.length) {\n push(\n `const { ${ast.ssrHelpers.map(aliasHelper).join(\", \")} } = require(\"${ssrRuntimeModuleName}\")\n`,\n -1 /* End */\n );\n }\n genHoists(ast.hoists, context);\n newline();\n push(`return `);\n}\nfunction genModulePreamble(ast, context, genScopeId, inline) {\n const {\n push,\n newline,\n optimizeImports,\n runtimeModuleName,\n ssrRuntimeModuleName\n } = context;\n if (ast.helpers.size) {\n const helpers = Array.from(ast.helpers);\n if (optimizeImports) {\n push(\n `import { ${helpers.map((s) => helperNameMap[s]).join(\", \")} } from ${JSON.stringify(runtimeModuleName)}\n`,\n -1 /* End */\n );\n push(\n `\n// Binding optimization for webpack code-split\nconst ${helpers.map((s) => `_${helperNameMap[s]} = ${helperNameMap[s]}`).join(\", \")}\n`,\n -1 /* End */\n );\n } else {\n push(\n `import { ${helpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(\", \")} } from ${JSON.stringify(runtimeModuleName)}\n`,\n -1 /* End */\n );\n }\n }\n if (ast.ssrHelpers && ast.ssrHelpers.length) {\n push(\n `import { ${ast.ssrHelpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(\", \")} } from \"${ssrRuntimeModuleName}\"\n`,\n -1 /* End */\n );\n }\n if (ast.imports.length) {\n genImports(ast.imports, context);\n newline();\n }\n genHoists(ast.hoists, context);\n newline();\n if (!inline) {\n push(`export `);\n }\n}\nfunction genAssets(assets, type, { helper, push, newline, isTS }) {\n const resolver = helper(\n type === \"filter\" ? RESOLVE_FILTER : type === \"component\" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE\n );\n for (let i = 0; i < assets.length; i++) {\n let id = assets[i];\n const maybeSelfReference = id.endsWith(\"__self\");\n if (maybeSelfReference) {\n id = id.slice(0, -6);\n }\n push(\n `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`\n );\n if (i < assets.length - 1) {\n newline();\n }\n }\n}\nfunction genHoists(hoists, context) {\n if (!hoists.length) {\n return;\n }\n context.pure = true;\n const { push, newline } = context;\n newline();\n for (let i = 0; i < hoists.length; i++) {\n const exp = hoists[i];\n if (exp) {\n push(`const _hoisted_${i + 1} = `);\n genNode(exp, context);\n newline();\n }\n }\n context.pure = false;\n}\nfunction genImports(importsOptions, context) {\n if (!importsOptions.length) {\n return;\n }\n importsOptions.forEach((imports) => {\n context.push(`import `);\n genNode(imports.exp, context);\n context.push(` from '${imports.path}'`);\n context.newline();\n });\n}\nfunction isText(n) {\n return shared.isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8;\n}\nfunction genNodeListAsArray(nodes, context) {\n const multilines = nodes.length > 3 || nodes.some((n) => shared.isArray(n) || !isText(n));\n context.push(`[`);\n multilines && context.indent();\n genNodeList(nodes, context, multilines);\n multilines && context.deindent();\n context.push(`]`);\n}\nfunction genNodeList(nodes, context, multilines = false, comma = true) {\n const { push, newline } = context;\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (shared.isString(node)) {\n push(node, -3 /* Unknown */);\n } else if (shared.isArray(node)) {\n genNodeListAsArray(node, context);\n } else {\n genNode(node, context);\n }\n if (i < nodes.length - 1) {\n if (multilines) {\n comma && push(\",\");\n newline();\n } else {\n comma && push(\", \");\n }\n }\n }\n}\nfunction genNode(node, context) {\n if (shared.isString(node)) {\n context.push(node, -3 /* Unknown */);\n return;\n }\n if (shared.isSymbol(node)) {\n context.push(context.helper(node));\n return;\n }\n switch (node.type) {\n case 1:\n case 9:\n case 11:\n genNode(node.codegenNode, context);\n break;\n case 2:\n genText(node, context);\n break;\n case 4:\n genExpression(node, context);\n break;\n case 5:\n genInterpolation(node, context);\n break;\n case 12:\n genNode(node.codegenNode, context);\n break;\n case 8:\n genCompoundExpression(node, context);\n break;\n case 3:\n genComment(node, context);\n break;\n case 13:\n genVNodeCall(node, context);\n break;\n case 14:\n genCallExpression(node, context);\n break;\n case 15:\n genObjectExpression(node, context);\n break;\n case 17:\n genArrayExpression(node, context);\n break;\n case 18:\n genFunctionExpression(node, context);\n break;\n case 19:\n genConditionalExpression(node, context);\n break;\n case 20:\n genCacheExpression(node, context);\n break;\n case 21:\n genNodeList(node.body, context, true, false);\n break;\n // SSR only types\n case 22:\n genTemplateLiteral(node, context);\n break;\n case 23:\n genIfStatement(node, context);\n break;\n case 24:\n genAssignmentExpression(node, context);\n break;\n case 25:\n genSequenceExpression(node, context);\n break;\n case 26:\n genReturnStatement(node, context);\n break;\n }\n}\nfunction genText(node, context) {\n context.push(JSON.stringify(node.content), -3 /* Unknown */, node);\n}\nfunction genExpression(node, context) {\n const { content, isStatic } = node;\n context.push(\n isStatic ? JSON.stringify(content) : content,\n -3 /* Unknown */,\n node\n );\n}\nfunction genInterpolation(node, context) {\n const { push, helper, pure } = context;\n if (pure) push(PURE_ANNOTATION);\n push(`${helper(TO_DISPLAY_STRING)}(`);\n genNode(node.content, context);\n push(`)`);\n}\nfunction genCompoundExpression(node, context) {\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (shared.isString(child)) {\n context.push(child, -3 /* Unknown */);\n } else {\n genNode(child, context);\n }\n }\n}\nfunction genExpressionAsPropertyKey(node, context) {\n const { push } = context;\n if (node.type === 8) {\n push(`[`);\n genCompoundExpression(node, context);\n push(`]`);\n } else if (node.isStatic) {\n const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content);\n push(text, -2 /* None */, node);\n } else {\n push(`[${node.content}]`, -3 /* Unknown */, node);\n }\n}\nfunction genComment(node, context) {\n const { push, helper, pure } = context;\n if (pure) {\n push(PURE_ANNOTATION);\n }\n push(\n `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`,\n -3 /* Unknown */,\n node\n );\n}\nfunction genVNodeCall(node, context) {\n const { push, helper, pure } = context;\n const {\n tag,\n props,\n children,\n patchFlag,\n dynamicProps,\n directives,\n isBlock,\n disableTracking,\n isComponent\n } = node;\n let patchFlagString;\n if (patchFlag) {\n {\n patchFlagString = String(patchFlag);\n }\n }\n if (directives) {\n push(helper(WITH_DIRECTIVES) + `(`);\n }\n if (isBlock) {\n push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);\n }\n if (pure) {\n push(PURE_ANNOTATION);\n }\n const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent);\n push(helper(callHelper) + `(`, -2 /* None */, node);\n genNodeList(\n genNullableArgs([tag, props, children, patchFlagString, dynamicProps]),\n context\n );\n push(`)`);\n if (isBlock) {\n push(`)`);\n }\n if (directives) {\n push(`, `);\n genNode(directives, context);\n push(`)`);\n }\n}\nfunction genNullableArgs(args) {\n let i = args.length;\n while (i--) {\n if (args[i] != null) break;\n }\n return args.slice(0, i + 1).map((arg) => arg || `null`);\n}\nfunction genCallExpression(node, context) {\n const { push, helper, pure } = context;\n const callee = shared.isString(node.callee) ? node.callee : helper(node.callee);\n if (pure) {\n push(PURE_ANNOTATION);\n }\n push(callee + `(`, -2 /* None */, node);\n genNodeList(node.arguments, context);\n push(`)`);\n}\nfunction genObjectExpression(node, context) {\n const { push, indent, deindent, newline } = context;\n const { properties } = node;\n if (!properties.length) {\n push(`{}`, -2 /* None */, node);\n return;\n }\n const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);\n push(multilines ? `{` : `{ `);\n multilines && indent();\n for (let i = 0; i < properties.length; i++) {\n const { key, value } = properties[i];\n genExpressionAsPropertyKey(key, context);\n push(`: `);\n genNode(value, context);\n if (i < properties.length - 1) {\n push(`,`);\n newline();\n }\n }\n multilines && deindent();\n push(multilines ? `}` : ` }`);\n}\nfunction genArrayExpression(node, context) {\n genNodeListAsArray(node.elements, context);\n}\nfunction genFunctionExpression(node, context) {\n const { push, indent, deindent } = context;\n const { params, returns, body, newline, isSlot } = node;\n if (isSlot) {\n push(`_${helperNameMap[WITH_CTX]}(`);\n }\n push(`(`, -2 /* None */, node);\n if (shared.isArray(params)) {\n genNodeList(params, context);\n } else if (params) {\n genNode(params, context);\n }\n push(`) => `);\n if (newline || body) {\n push(`{`);\n indent();\n }\n if (returns) {\n if (newline) {\n push(`return `);\n }\n if (shared.isArray(returns)) {\n genNodeListAsArray(returns, context);\n } else {\n genNode(returns, context);\n }\n } else if (body) {\n genNode(body, context);\n }\n if (newline || body) {\n deindent();\n push(`}`);\n }\n if (isSlot) {\n if (node.isNonScopedSlot) {\n push(`, undefined, true`);\n }\n push(`)`);\n }\n}\nfunction genConditionalExpression(node, context) {\n const { test, consequent, alternate, newline: needNewline } = node;\n const { push, indent, deindent, newline } = context;\n if (test.type === 4) {\n const needsParens = !isSimpleIdentifier(test.content);\n needsParens && push(`(`);\n genExpression(test, context);\n needsParens && push(`)`);\n } else {\n push(`(`);\n genNode(test, context);\n push(`)`);\n }\n needNewline && indent();\n context.indentLevel++;\n needNewline || push(` `);\n push(`? `);\n genNode(consequent, context);\n context.indentLevel--;\n needNewline && newline();\n needNewline || push(` `);\n push(`: `);\n const isNested = alternate.type === 19;\n if (!isNested) {\n context.indentLevel++;\n }\n genNode(alternate, context);\n if (!isNested) {\n context.indentLevel--;\n }\n needNewline && deindent(\n true\n /* without newline */\n );\n}\nfunction genCacheExpression(node, context) {\n const { push, helper, indent, deindent, newline } = context;\n const { needPauseTracking, needArraySpread } = node;\n if (needArraySpread) {\n push(`[...(`);\n }\n push(`_cache[${node.index}] || (`);\n if (needPauseTracking) {\n indent();\n push(`${helper(SET_BLOCK_TRACKING)}(-1`);\n if (node.inVOnce) push(`, true`);\n push(`),`);\n newline();\n push(`(`);\n }\n push(`_cache[${node.index}] = `);\n genNode(node.value, context);\n if (needPauseTracking) {\n push(`).cacheIndex = ${node.index},`);\n newline();\n push(`${helper(SET_BLOCK_TRACKING)}(1),`);\n newline();\n push(`_cache[${node.index}]`);\n deindent();\n }\n push(`)`);\n if (needArraySpread) {\n push(`)]`);\n }\n}\nfunction genTemplateLiteral(node, context) {\n const { push, indent, deindent } = context;\n push(\"`\");\n const l = node.elements.length;\n const multilines = l > 3;\n for (let i = 0; i < l; i++) {\n const e = node.elements[i];\n if (shared.isString(e)) {\n push(e.replace(/(`|\\$|\\\\)/g, \"\\\\$1\"), -3 /* Unknown */);\n } else {\n push(\"${\");\n if (multilines) indent();\n genNode(e, context);\n if (multilines) deindent();\n push(\"}\");\n }\n }\n push(\"`\");\n}\nfunction genIfStatement(node, context) {\n const { push, indent, deindent } = context;\n const { test, consequent, alternate } = node;\n push(`if (`);\n genNode(test, context);\n push(`) {`);\n indent();\n genNode(consequent, context);\n deindent();\n push(`}`);\n if (alternate) {\n push(` else `);\n if (alternate.type === 23) {\n genIfStatement(alternate, context);\n } else {\n push(`{`);\n indent();\n genNode(alternate, context);\n deindent();\n push(`}`);\n }\n }\n}\nfunction genAssignmentExpression(node, context) {\n genNode(node.left, context);\n context.push(` = `);\n genNode(node.right, context);\n}\nfunction genSequenceExpression(node, context) {\n context.push(`(`);\n genNodeList(node.expressions, context);\n context.push(`)`);\n}\nfunction genReturnStatement({ returns }, context) {\n context.push(`return `);\n if (shared.isArray(returns)) {\n genNodeListAsArray(returns, context);\n } else {\n genNode(returns, context);\n }\n}\n\nconst isLiteralWhitelisted = /* @__PURE__ */ shared.makeMap(\"true,false,null,this\");\nconst transformExpression = (node, context) => {\n if (node.type === 5) {\n node.content = processExpression(\n node.content,\n context\n );\n } else if (node.type === 1) {\n const memo = findDir(node, \"memo\");\n for (let i = 0; i < node.props.length; i++) {\n const dir = node.props[i];\n if (dir.type === 7 && dir.name !== \"for\") {\n const exp = dir.exp;\n const arg = dir.arg;\n if (exp && exp.type === 4 && !(dir.name === \"on\" && arg) && // key has been processed in transformFor(vMemo + vFor)\n !(memo && arg && arg.type === 4 && arg.content === \"key\")) {\n dir.exp = processExpression(\n exp,\n context,\n // slot args must be processed as function params\n dir.name === \"slot\"\n );\n }\n if (arg && arg.type === 4 && !arg.isStatic) {\n dir.arg = processExpression(arg, context);\n }\n }\n }\n }\n};\nfunction processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) {\n if (!context.prefixIdentifiers || !node.content.trim()) {\n return node;\n }\n const { inline, bindingMetadata } = context;\n const rewriteIdentifier = (raw, parent, id) => {\n const type = shared.hasOwn(bindingMetadata, raw) && bindingMetadata[raw];\n if (inline) {\n const isAssignmentLVal = parent && parent.type === \"AssignmentExpression\" && parent.left === id;\n const isUpdateArg = parent && parent.type === \"UpdateExpression\" && parent.argument === id;\n const isDestructureAssignment = parent && isInDestructureAssignment(parent, parentStack);\n const isNewExpression = parent && isInNewExpression(parentStack);\n const wrapWithUnref = (raw2) => {\n const wrapped = `${context.helperString(UNREF)}(${raw2})`;\n return isNewExpression ? `(${wrapped})` : wrapped;\n };\n if (isConst(type) || type === \"setup-reactive-const\" || localVars[raw]) {\n return raw;\n } else if (type === \"setup-ref\") {\n return `${raw}.value`;\n } else if (type === \"setup-maybe-ref\") {\n return isAssignmentLVal || isUpdateArg || isDestructureAssignment ? `${raw}.value` : wrapWithUnref(raw);\n } else if (type === \"setup-let\") {\n if (isAssignmentLVal) {\n const { right: rVal, operator } = parent;\n const rExp = rawExp.slice(rVal.start - 1, rVal.end - 1);\n const rExpString = stringifyExpression(\n processExpression(\n createSimpleExpression(rExp, false),\n context,\n false,\n false,\n knownIds\n )\n );\n return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore\n` : ``} ? ${raw}.value ${operator} ${rExpString} : ${raw}`;\n } else if (isUpdateArg) {\n id.start = parent.start;\n id.end = parent.end;\n const { prefix: isPrefix, operator } = parent;\n const prefix = isPrefix ? operator : ``;\n const postfix = isPrefix ? `` : operator;\n return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore\n` : ``} ? ${prefix}${raw}.value${postfix} : ${prefix}${raw}${postfix}`;\n } else if (isDestructureAssignment) {\n return raw;\n } else {\n return wrapWithUnref(raw);\n }\n } else if (type === \"props\") {\n return shared.genPropsAccessExp(raw);\n } else if (type === \"props-aliased\") {\n return shared.genPropsAccessExp(bindingMetadata.__propsAliases[raw]);\n }\n } else {\n if (type && type.startsWith(\"setup\") || type === \"literal-const\") {\n return `$setup.${raw}`;\n } else if (type === \"props-aliased\") {\n return `$props['${bindingMetadata.__propsAliases[raw]}']`;\n } else if (type) {\n return `$${type}.${raw}`;\n }\n }\n return `_ctx.${raw}`;\n };\n const rawExp = node.content;\n let ast = node.ast;\n if (ast === false) {\n return node;\n }\n if (ast === null || !ast && isSimpleIdentifier(rawExp)) {\n const isScopeVarReference = context.identifiers[rawExp];\n const isAllowedGlobal = shared.isGloballyAllowed(rawExp);\n const isLiteral = isLiteralWhitelisted(rawExp);\n if (!asParams && !isScopeVarReference && !isLiteral && (!isAllowedGlobal || bindingMetadata[rawExp])) {\n if (isConst(bindingMetadata[rawExp])) {\n node.constType = 1;\n }\n node.content = rewriteIdentifier(rawExp);\n } else if (!isScopeVarReference) {\n if (isLiteral) {\n node.constType = 3;\n } else {\n node.constType = 2;\n }\n }\n return node;\n }\n if (!ast) {\n const source = asRawStatements ? ` ${rawExp} ` : `(${rawExp})${asParams ? `=>{}` : ``}`;\n try {\n ast = parser.parseExpression(source, {\n sourceType: \"module\",\n plugins: context.expressionPlugins\n });\n } catch (e) {\n context.onError(\n createCompilerError(\n 46,\n node.loc,\n void 0,\n e.message\n )\n );\n return node;\n }\n }\n const ids = [];\n const parentStack = [];\n const knownIds = Object.create(context.identifiers);\n walkIdentifiers(\n ast,\n (node2, parent, _, isReferenced, isLocal) => {\n if (isStaticPropertyKey(node2, parent)) {\n return;\n }\n if (node2.name.startsWith(\"_filter_\")) {\n return;\n }\n const needPrefix = isReferenced && canPrefix(node2);\n if (needPrefix && !isLocal) {\n if (isStaticProperty(parent) && parent.shorthand) {\n node2.prefix = `${node2.name}: `;\n }\n node2.name = rewriteIdentifier(node2.name, parent, node2);\n ids.push(node2);\n } else {\n if (!(needPrefix && isLocal) && (!parent || parent.type !== \"CallExpression\" && parent.type !== \"NewExpression\" && parent.type !== \"MemberExpression\")) {\n node2.isConstant = true;\n }\n ids.push(node2);\n }\n },\n true,\n // invoke on ALL identifiers\n parentStack,\n knownIds\n );\n const children = [];\n ids.sort((a, b) => a.start - b.start);\n ids.forEach((id, i) => {\n const start = id.start - 1;\n const end = id.end - 1;\n const last = ids[i - 1];\n const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);\n if (leadingText.length || id.prefix) {\n children.push(leadingText + (id.prefix || ``));\n }\n const source = rawExp.slice(start, end);\n children.push(\n createSimpleExpression(\n id.name,\n false,\n {\n start: advancePositionWithClone(node.loc.start, source, start),\n end: advancePositionWithClone(node.loc.start, source, end),\n source\n },\n id.isConstant ? 3 : 0\n )\n );\n if (i === ids.length - 1 && end < rawExp.length) {\n children.push(rawExp.slice(end));\n }\n });\n let ret;\n if (children.length) {\n ret = createCompoundExpression(children, node.loc);\n ret.ast = ast;\n } else {\n ret = node;\n ret.constType = 3;\n }\n ret.identifiers = Object.keys(knownIds);\n return ret;\n}\nfunction canPrefix(id) {\n if (shared.isGloballyAllowed(id.name)) {\n return false;\n }\n if (id.name === \"require\") {\n return false;\n }\n return true;\n}\nfunction stringifyExpression(exp) {\n if (shared.isString(exp)) {\n return exp;\n } else if (exp.type === 4) {\n return exp.content;\n } else {\n return exp.children.map(stringifyExpression).join(\"\");\n }\n}\nfunction isConst(type) {\n return type === \"setup-const\" || type === \"literal-const\";\n}\n\nconst transformIf = createStructuralDirectiveTransform(\n /^(?:if|else|else-if)$/,\n (node, dir, context) => {\n return processIf(node, dir, context, (ifNode, branch, isRoot) => {\n const siblings = context.parent.children;\n let i = siblings.indexOf(ifNode);\n let key = 0;\n while (i-- >= 0) {\n const sibling = siblings[i];\n if (sibling && sibling.type === 9) {\n key += sibling.branches.length;\n }\n }\n return () => {\n if (isRoot) {\n ifNode.codegenNode = createCodegenNodeForBranch(\n branch,\n key,\n context\n );\n } else {\n const parentCondition = getParentCondition(ifNode.codegenNode);\n parentCondition.alternate = createCodegenNodeForBranch(\n branch,\n key + ifNode.branches.length - 1,\n context\n );\n }\n };\n });\n }\n);\nfunction processIf(node, dir, context, processCodegen) {\n if (dir.name !== \"else\" && (!dir.exp || !dir.exp.content.trim())) {\n const loc = dir.exp ? dir.exp.loc : node.loc;\n context.onError(\n createCompilerError(28, dir.loc)\n );\n dir.exp = createSimpleExpression(`true`, false, loc);\n }\n if (context.prefixIdentifiers && dir.exp) {\n dir.exp = processExpression(dir.exp, context);\n }\n if (dir.name === \"if\") {\n const branch = createIfBranch(node, dir);\n const ifNode = {\n type: 9,\n loc: cloneLoc(node.loc),\n branches: [branch]\n };\n context.replaceNode(ifNode);\n if (processCodegen) {\n return processCodegen(ifNode, branch, true);\n }\n } else {\n const siblings = context.parent.children;\n let i = siblings.indexOf(node);\n while (i-- >= -1) {\n const sibling = siblings[i];\n if (sibling && isCommentOrWhitespace(sibling)) {\n context.removeNode(sibling);\n continue;\n }\n if (sibling && sibling.type === 9) {\n if ((dir.name === \"else-if\" || dir.name === \"else\") && sibling.branches[sibling.branches.length - 1].condition === void 0) {\n context.onError(\n createCompilerError(30, node.loc)\n );\n }\n context.removeNode();\n const branch = createIfBranch(node, dir);\n {\n const key = branch.userKey;\n if (key) {\n sibling.branches.forEach(({ userKey }) => {\n if (isSameKey(userKey, key)) {\n context.onError(\n createCompilerError(\n 29,\n branch.userKey.loc\n )\n );\n }\n });\n }\n }\n sibling.branches.push(branch);\n const onExit = processCodegen && processCodegen(sibling, branch, false);\n traverseNode(branch, context);\n if (onExit) onExit();\n context.currentNode = null;\n } else {\n context.onError(\n createCompilerError(30, node.loc)\n );\n }\n break;\n }\n }\n}\nfunction createIfBranch(node, dir) {\n const isTemplateIf = node.tagType === 3;\n return {\n type: 10,\n loc: node.loc,\n condition: dir.name === \"else\" ? void 0 : dir.exp,\n children: isTemplateIf && !findDir(node, \"for\") ? node.children : [node],\n userKey: findProp(node, `key`),\n isTemplateIf\n };\n}\nfunction createCodegenNodeForBranch(branch, keyIndex, context) {\n if (branch.condition) {\n return createConditionalExpression(\n branch.condition,\n createChildrenCodegenNode(branch, keyIndex, context),\n // make sure to pass in asBlock: true so that the comment node call\n // closes the current block.\n createCallExpression(context.helper(CREATE_COMMENT), [\n '\"\"',\n \"true\"\n ])\n );\n } else {\n return createChildrenCodegenNode(branch, keyIndex, context);\n }\n}\nfunction createChildrenCodegenNode(branch, keyIndex, context) {\n const { helper } = context;\n const keyProperty = createObjectProperty(\n `key`,\n createSimpleExpression(\n `${keyIndex}`,\n false,\n locStub,\n 2\n )\n );\n const { children } = branch;\n const firstChild = children[0];\n const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1;\n if (needFragmentWrapper) {\n if (children.length === 1 && firstChild.type === 11) {\n const vnodeCall = firstChild.codegenNode;\n injectProp(vnodeCall, keyProperty, context);\n return vnodeCall;\n } else {\n let patchFlag = 64;\n return createVNodeCall(\n context,\n helper(FRAGMENT),\n createObjectExpression([keyProperty]),\n children,\n patchFlag,\n void 0,\n void 0,\n true,\n false,\n false,\n branch.loc\n );\n }\n } else {\n const ret = firstChild.codegenNode;\n const vnodeCall = getMemoedVNodeCall(ret);\n if (vnodeCall.type === 13) {\n convertToBlock(vnodeCall, context);\n }\n injectProp(vnodeCall, keyProperty, context);\n return ret;\n }\n}\nfunction isSameKey(a, b) {\n if (!a || a.type !== b.type) {\n return false;\n }\n if (a.type === 6) {\n if (a.value.content !== b.value.content) {\n return false;\n }\n } else {\n const exp = a.exp;\n const branchExp = b.exp;\n if (exp.type !== branchExp.type) {\n return false;\n }\n if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {\n return false;\n }\n }\n return true;\n}\nfunction getParentCondition(node) {\n while (true) {\n if (node.type === 19) {\n if (node.alternate.type === 19) {\n node = node.alternate;\n } else {\n return node;\n }\n } else if (node.type === 20) {\n node = node.value;\n }\n }\n}\n\nconst transformFor = createStructuralDirectiveTransform(\n \"for\",\n (node, dir, context) => {\n const { helper, removeHelper } = context;\n return processFor(node, dir, context, (forNode) => {\n const renderExp = createCallExpression(helper(RENDER_LIST), [\n forNode.source\n ]);\n const isTemplate = isTemplateNode(node);\n const memo = findDir(node, \"memo\");\n const keyProp = findProp(node, `key`, false, true);\n const isDirKey = keyProp && keyProp.type === 7;\n let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);\n if (memo && keyExp && isDirKey) {\n {\n keyProp.exp = keyExp = processExpression(\n keyExp,\n context\n );\n }\n }\n const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;\n if (isTemplate) {\n if (memo) {\n memo.exp = processExpression(\n memo.exp,\n context\n );\n }\n if (keyProperty && keyProp.type !== 6) {\n keyProperty.value = processExpression(\n keyProperty.value,\n context\n );\n }\n }\n const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;\n const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;\n forNode.codegenNode = createVNodeCall(\n context,\n helper(FRAGMENT),\n void 0,\n renderExp,\n fragmentFlag,\n void 0,\n void 0,\n true,\n !isStableFragment,\n false,\n node.loc\n );\n return () => {\n let childBlock;\n const { children } = forNode;\n if (isTemplate) {\n node.children.some((c) => {\n if (c.type === 1) {\n const key = findProp(c, \"key\");\n if (key) {\n context.onError(\n createCompilerError(\n 33,\n key.loc\n )\n );\n return true;\n }\n }\n });\n }\n const needFragmentWrapper = children.length !== 1 || children[0].type !== 1;\n const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;\n if (slotOutlet) {\n childBlock = slotOutlet.codegenNode;\n if (isTemplate && keyProperty) {\n injectProp(childBlock, keyProperty, context);\n }\n } else if (needFragmentWrapper) {\n childBlock = createVNodeCall(\n context,\n helper(FRAGMENT),\n keyProperty ? createObjectExpression([keyProperty]) : void 0,\n node.children,\n 64,\n void 0,\n void 0,\n true,\n void 0,\n false\n );\n } else {\n childBlock = children[0].codegenNode;\n if (isTemplate && keyProperty) {\n injectProp(childBlock, keyProperty, context);\n }\n if (childBlock.isBlock !== !isStableFragment) {\n if (childBlock.isBlock) {\n removeHelper(OPEN_BLOCK);\n removeHelper(\n getVNodeBlockHelper(context.inSSR, childBlock.isComponent)\n );\n } else {\n removeHelper(\n getVNodeHelper(context.inSSR, childBlock.isComponent)\n );\n }\n }\n childBlock.isBlock = !isStableFragment;\n if (childBlock.isBlock) {\n helper(OPEN_BLOCK);\n helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));\n } else {\n helper(getVNodeHelper(context.inSSR, childBlock.isComponent));\n }\n }\n if (memo) {\n const loop = createFunctionExpression(\n createForLoopParams(forNode.parseResult, [\n createSimpleExpression(`_cached`)\n ])\n );\n loop.body = createBlockStatement([\n createCompoundExpression([`const _memo = (`, memo.exp, `)`]),\n createCompoundExpression([\n `if (_cached`,\n ...keyExp ? [` && _cached.key === `, keyExp] : [],\n ` && ${context.helperString(\n IS_MEMO_SAME\n )}(_cached, _memo)) return _cached`\n ]),\n createCompoundExpression([`const _item = `, childBlock]),\n createSimpleExpression(`_item.memo = _memo`),\n createSimpleExpression(`return _item`)\n ]);\n renderExp.arguments.push(\n loop,\n createSimpleExpression(`_cache`),\n createSimpleExpression(String(context.cached.length))\n );\n context.cached.push(null);\n } else {\n renderExp.arguments.push(\n createFunctionExpression(\n createForLoopParams(forNode.parseResult),\n childBlock,\n true\n )\n );\n }\n };\n });\n }\n);\nfunction processFor(node, dir, context, processCodegen) {\n if (!dir.exp) {\n context.onError(\n createCompilerError(31, dir.loc)\n );\n return;\n }\n const parseResult = dir.forParseResult;\n if (!parseResult) {\n context.onError(\n createCompilerError(32, dir.loc)\n );\n return;\n }\n finalizeForParseResult(parseResult, context);\n const { addIdentifiers, removeIdentifiers, scopes } = context;\n const { source, value, key, index } = parseResult;\n const forNode = {\n type: 11,\n loc: dir.loc,\n source,\n valueAlias: value,\n keyAlias: key,\n objectIndexAlias: index,\n parseResult,\n children: isTemplateNode(node) ? node.children : [node]\n };\n context.replaceNode(forNode);\n scopes.vFor++;\n if (context.prefixIdentifiers) {\n value && addIdentifiers(value);\n key && addIdentifiers(key);\n index && addIdentifiers(index);\n }\n const onExit = processCodegen && processCodegen(forNode);\n return () => {\n scopes.vFor--;\n if (context.prefixIdentifiers) {\n value && removeIdentifiers(value);\n key && removeIdentifiers(key);\n index && removeIdentifiers(index);\n }\n if (onExit) onExit();\n };\n}\nfunction finalizeForParseResult(result, context) {\n if (result.finalized) return;\n if (context.prefixIdentifiers) {\n result.source = processExpression(\n result.source,\n context\n );\n if (result.key) {\n result.key = processExpression(\n result.key,\n context,\n true\n );\n }\n if (result.index) {\n result.index = processExpression(\n result.index,\n context,\n true\n );\n }\n if (result.value) {\n result.value = processExpression(\n result.value,\n context,\n true\n );\n }\n }\n result.finalized = true;\n}\nfunction createForLoopParams({ value, key, index }, memoArgs = []) {\n return createParamsList([value, key, index, ...memoArgs]);\n}\nfunction createParamsList(args) {\n let i = args.length;\n while (i--) {\n if (args[i]) break;\n }\n return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false));\n}\n\nconst defaultFallback = createSimpleExpression(`undefined`, false);\nconst trackSlotScopes = (node, context) => {\n if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) {\n const vSlot = findDir(node, \"slot\");\n if (vSlot) {\n const slotProps = vSlot.exp;\n if (context.prefixIdentifiers) {\n slotProps && context.addIdentifiers(slotProps);\n }\n context.scopes.vSlot++;\n return () => {\n if (context.prefixIdentifiers) {\n slotProps && context.removeIdentifiers(slotProps);\n }\n context.scopes.vSlot--;\n };\n }\n }\n};\nconst trackVForSlotScopes = (node, context) => {\n let vFor;\n if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, \"for\"))) {\n const result = vFor.forParseResult;\n if (result) {\n finalizeForParseResult(result, context);\n const { value, key, index } = result;\n const { addIdentifiers, removeIdentifiers } = context;\n value && addIdentifiers(value);\n key && addIdentifiers(key);\n index && addIdentifiers(index);\n return () => {\n value && removeIdentifiers(value);\n key && removeIdentifiers(key);\n index && removeIdentifiers(index);\n };\n }\n }\n};\nconst buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(\n props,\n children,\n false,\n true,\n children.length ? children[0].loc : loc\n);\nfunction buildSlots(node, context, buildSlotFn = buildClientSlotFn) {\n context.helper(WITH_CTX);\n const { children, loc } = node;\n const slotsProperties = [];\n const dynamicSlots = [];\n let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;\n if (!context.ssr && context.prefixIdentifiers) {\n hasDynamicSlots = node.props.some(\n (prop) => isVSlot(prop) && (hasScopeRef(prop.arg, context.identifiers) || hasScopeRef(prop.exp, context.identifiers))\n ) || children.some((child) => hasScopeRef(child, context.identifiers));\n }\n const onComponentSlot = findDir(node, \"slot\", true);\n if (onComponentSlot) {\n const { arg, exp } = onComponentSlot;\n if (arg && !isStaticExp(arg)) {\n hasDynamicSlots = true;\n }\n slotsProperties.push(\n createObjectProperty(\n arg || createSimpleExpression(\"default\", true),\n buildSlotFn(exp, void 0, children, loc)\n )\n );\n }\n let hasTemplateSlots = false;\n let hasNamedDefaultSlot = false;\n const implicitDefaultChildren = [];\n const seenSlotNames = /* @__PURE__ */ new Set();\n let conditionalBranchIndex = 0;\n for (let i = 0; i < children.length; i++) {\n const slotElement = children[i];\n let slotDir;\n if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, \"slot\", true))) {\n if (slotElement.type !== 3) {\n implicitDefaultChildren.push(slotElement);\n }\n continue;\n }\n if (onComponentSlot) {\n context.onError(\n createCompilerError(37, slotDir.loc)\n );\n break;\n }\n hasTemplateSlots = true;\n const { children: slotChildren, loc: slotLoc } = slotElement;\n const {\n arg: slotName = createSimpleExpression(`default`, true),\n exp: slotProps,\n loc: dirLoc\n } = slotDir;\n let staticSlotName;\n if (isStaticExp(slotName)) {\n staticSlotName = slotName ? slotName.content : `default`;\n } else {\n hasDynamicSlots = true;\n }\n const vFor = findDir(slotElement, \"for\");\n const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc);\n let vIf;\n let vElse;\n if (vIf = findDir(slotElement, \"if\")) {\n hasDynamicSlots = true;\n dynamicSlots.push(\n createConditionalExpression(\n vIf.exp,\n buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++),\n defaultFallback\n )\n );\n } else if (vElse = findDir(\n slotElement,\n /^else(?:-if)?$/,\n true\n /* allowEmpty */\n )) {\n let j = i;\n let prev;\n while (j--) {\n prev = children[j];\n if (!isCommentOrWhitespace(prev)) {\n break;\n }\n }\n if (prev && isTemplateNode(prev) && findDir(prev, /^(?:else-)?if$/)) {\n let conditional = dynamicSlots[dynamicSlots.length - 1];\n while (conditional.alternate.type === 19) {\n conditional = conditional.alternate;\n }\n conditional.alternate = vElse.exp ? createConditionalExpression(\n vElse.exp,\n buildDynamicSlot(\n slotName,\n slotFunction,\n conditionalBranchIndex++\n ),\n defaultFallback\n ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);\n } else {\n context.onError(\n createCompilerError(30, vElse.loc)\n );\n }\n } else if (vFor) {\n hasDynamicSlots = true;\n const parseResult = vFor.forParseResult;\n if (parseResult) {\n finalizeForParseResult(parseResult, context);\n dynamicSlots.push(\n createCallExpression(context.helper(RENDER_LIST), [\n parseResult.source,\n createFunctionExpression(\n createForLoopParams(parseResult),\n buildDynamicSlot(slotName, slotFunction),\n true\n )\n ])\n );\n } else {\n context.onError(\n createCompilerError(\n 32,\n vFor.loc\n )\n );\n }\n } else {\n if (staticSlotName) {\n if (seenSlotNames.has(staticSlotName)) {\n context.onError(\n createCompilerError(\n 38,\n dirLoc\n )\n );\n continue;\n }\n seenSlotNames.add(staticSlotName);\n if (staticSlotName === \"default\") {\n hasNamedDefaultSlot = true;\n }\n }\n slotsProperties.push(createObjectProperty(slotName, slotFunction));\n }\n }\n if (!onComponentSlot) {\n const buildDefaultSlotProperty = (props, children2) => {\n const fn = buildSlotFn(props, void 0, children2, loc);\n if (context.compatConfig) {\n fn.isNonScopedSlot = true;\n }\n return createObjectProperty(`default`, fn);\n };\n if (!hasTemplateSlots) {\n slotsProperties.push(buildDefaultSlotProperty(void 0, children));\n } else if (implicitDefaultChildren.length && // #3766\n // with whitespace: 'preserve', whitespaces between slots will end up in\n // implicitDefaultChildren. Ignore if all implicit children are whitespaces.\n !implicitDefaultChildren.every(isWhitespaceText)) {\n if (hasNamedDefaultSlot) {\n context.onError(\n createCompilerError(\n 39,\n implicitDefaultChildren[0].loc\n )\n );\n } else {\n slotsProperties.push(\n buildDefaultSlotProperty(void 0, implicitDefaultChildren)\n );\n }\n }\n }\n const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1;\n let slots = createObjectExpression(\n slotsProperties.concat(\n createObjectProperty(\n `_`,\n // 2 = compiled but dynamic = can skip normalization, but must run diff\n // 1 = compiled and static = can skip normalization AND diff as optimized\n createSimpleExpression(\n slotFlag + (``),\n false\n )\n )\n ),\n loc\n );\n if (dynamicSlots.length) {\n slots = createCallExpression(context.helper(CREATE_SLOTS), [\n slots,\n createArrayExpression(dynamicSlots)\n ]);\n }\n return {\n slots,\n hasDynamicSlots\n };\n}\nfunction buildDynamicSlot(name, fn, index) {\n const props = [\n createObjectProperty(`name`, name),\n createObjectProperty(`fn`, fn)\n ];\n if (index != null) {\n props.push(\n createObjectProperty(`key`, createSimpleExpression(String(index), true))\n );\n }\n return createObjectExpression(props);\n}\nfunction hasForwardedSlots(children) {\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n switch (child.type) {\n case 1:\n if (child.tagType === 2 || hasForwardedSlots(child.children)) {\n return true;\n }\n break;\n case 9:\n if (hasForwardedSlots(child.branches)) return true;\n break;\n case 10:\n case 11:\n if (hasForwardedSlots(child.children)) return true;\n break;\n }\n }\n return false;\n}\n\nconst directiveImportMap = /* @__PURE__ */ new WeakMap();\nconst transformElement = (node, context) => {\n return function postTransformElement() {\n node = context.currentNode;\n if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) {\n return;\n }\n const { tag, props } = node;\n const isComponent = node.tagType === 1;\n let vnodeTag = isComponent ? resolveComponentType(node, context) : `\"${tag}\"`;\n const isDynamicComponent = shared.isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;\n let vnodeProps;\n let vnodeChildren;\n let patchFlag = 0;\n let vnodeDynamicProps;\n let dynamicPropNames;\n let vnodeDirectives;\n let shouldUseBlock = (\n // dynamic component may resolve to plain elements\n isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block\n // updates inside get proper isSVG flag at runtime. (#639, #643)\n // This is technically web-specific, but splitting the logic out of core\n // leads to too much unnecessary complexity.\n (tag === \"svg\" || tag === \"foreignObject\" || tag === \"math\")\n );\n if (props.length > 0) {\n const propsBuildResult = buildProps(\n node,\n context,\n void 0,\n isComponent,\n isDynamicComponent\n );\n vnodeProps = propsBuildResult.props;\n patchFlag = propsBuildResult.patchFlag;\n dynamicPropNames = propsBuildResult.dynamicPropNames;\n const directives = propsBuildResult.directives;\n vnodeDirectives = directives && directives.length ? createArrayExpression(\n directives.map((dir) => buildDirectiveArgs(dir, context))\n ) : void 0;\n if (propsBuildResult.shouldUseBlock) {\n shouldUseBlock = true;\n }\n }\n if (node.children.length > 0) {\n if (vnodeTag === KEEP_ALIVE) {\n shouldUseBlock = true;\n patchFlag |= 1024;\n }\n const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling\n vnodeTag !== TELEPORT && // explained above.\n vnodeTag !== KEEP_ALIVE;\n if (shouldBuildAsSlots) {\n const { slots, hasDynamicSlots } = buildSlots(node, context);\n vnodeChildren = slots;\n if (hasDynamicSlots) {\n patchFlag |= 1024;\n }\n } else if (node.children.length === 1 && vnodeTag !== TELEPORT) {\n const child = node.children[0];\n const type = child.type;\n const hasDynamicTextChild = type === 5 || type === 8;\n if (hasDynamicTextChild && getConstantType(child, context) === 0) {\n patchFlag |= 1;\n }\n if (hasDynamicTextChild || type === 2) {\n vnodeChildren = child;\n } else {\n vnodeChildren = node.children;\n }\n } else {\n vnodeChildren = node.children;\n }\n }\n if (dynamicPropNames && dynamicPropNames.length) {\n vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);\n }\n node.codegenNode = createVNodeCall(\n context,\n vnodeTag,\n vnodeProps,\n vnodeChildren,\n patchFlag === 0 ? void 0 : patchFlag,\n vnodeDynamicProps,\n vnodeDirectives,\n !!shouldUseBlock,\n false,\n isComponent,\n node.loc\n );\n };\n};\nfunction resolveComponentType(node, context, ssr = false) {\n let { tag } = node;\n const isExplicitDynamic = isComponentTag(tag);\n const isProp = findProp(\n node,\n \"is\",\n false,\n true\n /* allow empty */\n );\n if (isProp) {\n if (isExplicitDynamic || isCompatEnabled(\n \"COMPILER_IS_ON_ELEMENT\",\n context\n )) {\n let exp;\n if (isProp.type === 6) {\n exp = isProp.value && createSimpleExpression(isProp.value.content, true);\n } else {\n exp = isProp.exp;\n if (!exp) {\n exp = createSimpleExpression(`is`, false, isProp.arg.loc);\n {\n exp = isProp.exp = processExpression(exp, context);\n }\n }\n }\n if (exp) {\n return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [\n exp\n ]);\n }\n } else if (isProp.type === 6 && isProp.value.content.startsWith(\"vue:\")) {\n tag = isProp.value.content.slice(4);\n }\n }\n const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);\n if (builtIn) {\n if (!ssr) context.helper(builtIn);\n return builtIn;\n }\n {\n const fromSetup = resolveSetupReference(tag, context);\n if (fromSetup) {\n return fromSetup;\n }\n const dotIndex = tag.indexOf(\".\");\n if (dotIndex > 0) {\n const ns = resolveSetupReference(tag.slice(0, dotIndex), context);\n if (ns) {\n return ns + tag.slice(dotIndex);\n }\n }\n }\n if (context.selfName && shared.capitalize(shared.camelize(tag)) === context.selfName) {\n context.helper(RESOLVE_COMPONENT);\n context.components.add(tag + `__self`);\n return toValidAssetId(tag, `component`);\n }\n context.helper(RESOLVE_COMPONENT);\n context.components.add(tag);\n return toValidAssetId(tag, `component`);\n}\nfunction resolveSetupReference(name, context) {\n const bindings = context.bindingMetadata;\n if (!bindings || bindings.__isScriptSetup === false) {\n return;\n }\n const camelName = shared.camelize(name);\n const PascalName = shared.capitalize(camelName);\n const checkType = (type) => {\n if (bindings[name] === type) {\n return name;\n }\n if (bindings[camelName] === type) {\n return camelName;\n }\n if (bindings[PascalName] === type) {\n return PascalName;\n }\n };\n const fromConst = checkType(\"setup-const\") || checkType(\"setup-reactive-const\") || checkType(\"literal-const\");\n if (fromConst) {\n return context.inline ? (\n // in inline mode, const setup bindings (e.g. imports) can be used as-is\n fromConst\n ) : `$setup[${JSON.stringify(fromConst)}]`;\n }\n const fromMaybeRef = checkType(\"setup-let\") || checkType(\"setup-ref\") || checkType(\"setup-maybe-ref\");\n if (fromMaybeRef) {\n return context.inline ? (\n // setup scope bindings that may be refs need to be unrefed\n `${context.helperString(UNREF)}(${fromMaybeRef})`\n ) : `$setup[${JSON.stringify(fromMaybeRef)}]`;\n }\n const fromProps = checkType(\"props\");\n if (fromProps) {\n return `${context.helperString(UNREF)}(${context.inline ? \"__props\" : \"$props\"}[${JSON.stringify(fromProps)}])`;\n }\n}\nfunction buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {\n const { tag, loc: elementLoc, children } = node;\n let properties = [];\n const mergeArgs = [];\n const runtimeDirectives = [];\n const hasChildren = children.length > 0;\n let shouldUseBlock = false;\n let patchFlag = 0;\n let hasRef = false;\n let hasClassBinding = false;\n let hasStyleBinding = false;\n let hasHydrationEventBinding = false;\n let hasDynamicKeys = false;\n let hasVnodeHook = false;\n const dynamicPropNames = [];\n const pushMergeArg = (arg) => {\n if (properties.length) {\n mergeArgs.push(\n createObjectExpression(dedupeProperties(properties), elementLoc)\n );\n properties = [];\n }\n if (arg) mergeArgs.push(arg);\n };\n const pushRefVForMarker = () => {\n if (context.scopes.vFor > 0) {\n properties.push(\n createObjectProperty(\n createSimpleExpression(\"ref_for\", true),\n createSimpleExpression(\"true\")\n )\n );\n }\n };\n const analyzePatchFlag = ({ key, value }) => {\n if (isStaticExp(key)) {\n const name = key.content;\n const isEventHandler = shared.isOn(name);\n if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click\n // dedicated fast path.\n name.toLowerCase() !== \"onclick\" && // omit v-model handlers\n name !== \"onUpdate:modelValue\" && // omit onVnodeXXX hooks\n !shared.isReservedProp(name)) {\n hasHydrationEventBinding = true;\n }\n if (isEventHandler && shared.isReservedProp(name)) {\n hasVnodeHook = true;\n }\n if (isEventHandler && value.type === 14) {\n value = value.arguments[0];\n }\n if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {\n return;\n }\n if (name === \"ref\") {\n hasRef = true;\n } else if (name === \"class\") {\n hasClassBinding = true;\n } else if (name === \"style\") {\n hasStyleBinding = true;\n } else if (name !== \"key\" && !dynamicPropNames.includes(name)) {\n dynamicPropNames.push(name);\n }\n if (isComponent && (name === \"class\" || name === \"style\") && !dynamicPropNames.includes(name)) {\n dynamicPropNames.push(name);\n }\n } else {\n hasDynamicKeys = true;\n }\n };\n for (let i = 0; i < props.length; i++) {\n const prop = props[i];\n if (prop.type === 6) {\n const { loc, name, nameLoc, value } = prop;\n let isStatic = true;\n if (name === \"ref\") {\n hasRef = true;\n pushRefVForMarker();\n if (value && context.inline) {\n const binding = context.bindingMetadata[value.content];\n if (binding === \"setup-let\" || binding === \"setup-ref\" || binding === \"setup-maybe-ref\") {\n isStatic = false;\n properties.push(\n createObjectProperty(\n createSimpleExpression(\"ref_key\", true),\n createSimpleExpression(value.content, true, value.loc)\n )\n );\n }\n }\n }\n if (name === \"is\" && (isComponentTag(tag) || value && value.content.startsWith(\"vue:\") || isCompatEnabled(\n \"COMPILER_IS_ON_ELEMENT\",\n context\n ))) {\n continue;\n }\n properties.push(\n createObjectProperty(\n createSimpleExpression(name, true, nameLoc),\n createSimpleExpression(\n value ? value.content : \"\",\n isStatic,\n value ? value.loc : loc\n )\n )\n );\n } else {\n const { name, arg, exp, loc, modifiers } = prop;\n const isVBind = name === \"bind\";\n const isVOn = name === \"on\";\n if (name === \"slot\") {\n if (!isComponent) {\n context.onError(\n createCompilerError(40, loc)\n );\n }\n continue;\n }\n if (name === \"once\" || name === \"memo\") {\n continue;\n }\n if (name === \"is\" || isVBind && isStaticArgOf(arg, \"is\") && (isComponentTag(tag) || isCompatEnabled(\n \"COMPILER_IS_ON_ELEMENT\",\n context\n ))) {\n continue;\n }\n if (isVOn && ssr) {\n continue;\n }\n if (\n // #938: elements with dynamic keys should be forced into blocks\n isVBind && isStaticArgOf(arg, \"key\") || // inline before-update hooks need to force block so that it is invoked\n // before children\n isVOn && hasChildren && isStaticArgOf(arg, \"vue:before-update\")\n ) {\n shouldUseBlock = true;\n }\n if (isVBind && isStaticArgOf(arg, \"ref\")) {\n pushRefVForMarker();\n }\n if (!arg && (isVBind || isVOn)) {\n hasDynamicKeys = true;\n if (exp) {\n if (isVBind) {\n {\n pushMergeArg();\n if (isCompatEnabled(\n \"COMPILER_V_BIND_OBJECT_ORDER\",\n context\n )) {\n mergeArgs.unshift(exp);\n continue;\n }\n }\n pushRefVForMarker();\n pushMergeArg();\n mergeArgs.push(exp);\n } else {\n pushMergeArg({\n type: 14,\n loc,\n callee: context.helper(TO_HANDLERS),\n arguments: isComponent ? [exp] : [exp, `true`]\n });\n }\n } else {\n context.onError(\n createCompilerError(\n isVBind ? 34 : 35,\n loc\n )\n );\n }\n continue;\n }\n if (isVBind && modifiers.some((mod) => mod.content === \"prop\")) {\n patchFlag |= 32;\n }\n const directiveTransform = context.directiveTransforms[name];\n if (directiveTransform) {\n const { props: props2, needRuntime } = directiveTransform(prop, node, context);\n !ssr && props2.forEach(analyzePatchFlag);\n if (isVOn && arg && !isStaticExp(arg)) {\n pushMergeArg(createObjectExpression(props2, elementLoc));\n } else {\n properties.push(...props2);\n }\n if (needRuntime) {\n runtimeDirectives.push(prop);\n if (shared.isSymbol(needRuntime)) {\n directiveImportMap.set(prop, needRuntime);\n }\n }\n } else if (!shared.isBuiltInDirective(name)) {\n runtimeDirectives.push(prop);\n if (hasChildren) {\n shouldUseBlock = true;\n }\n }\n }\n }\n let propsExpression = void 0;\n if (mergeArgs.length) {\n pushMergeArg();\n if (mergeArgs.length > 1) {\n propsExpression = createCallExpression(\n context.helper(MERGE_PROPS),\n mergeArgs,\n elementLoc\n );\n } else {\n propsExpression = mergeArgs[0];\n }\n } else if (properties.length) {\n propsExpression = createObjectExpression(\n dedupeProperties(properties),\n elementLoc\n );\n }\n if (hasDynamicKeys) {\n patchFlag |= 16;\n } else {\n if (hasClassBinding && !isComponent) {\n patchFlag |= 2;\n }\n if (hasStyleBinding && !isComponent) {\n patchFlag |= 4;\n }\n if (dynamicPropNames.length) {\n patchFlag |= 8;\n }\n if (hasHydrationEventBinding) {\n patchFlag |= 32;\n }\n }\n if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {\n patchFlag |= 512;\n }\n if (!context.inSSR && propsExpression) {\n switch (propsExpression.type) {\n case 15:\n let classKeyIndex = -1;\n let styleKeyIndex = -1;\n let hasDynamicKey = false;\n for (let i = 0; i < propsExpression.properties.length; i++) {\n const key = propsExpression.properties[i].key;\n if (isStaticExp(key)) {\n if (key.content === \"class\") {\n classKeyIndex = i;\n } else if (key.content === \"style\") {\n styleKeyIndex = i;\n }\n } else if (!key.isHandlerKey) {\n hasDynamicKey = true;\n }\n }\n const classProp = propsExpression.properties[classKeyIndex];\n const styleProp = propsExpression.properties[styleKeyIndex];\n if (!hasDynamicKey) {\n if (classProp && !isStaticExp(classProp.value)) {\n classProp.value = createCallExpression(\n context.helper(NORMALIZE_CLASS),\n [classProp.value]\n );\n }\n if (styleProp && // the static style is compiled into an object,\n // so use `hasStyleBinding` to ensure that it is a dynamic style binding\n (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,\n // v-bind:style with static literal object\n styleProp.value.type === 17)) {\n styleProp.value = createCallExpression(\n context.helper(NORMALIZE_STYLE),\n [styleProp.value]\n );\n }\n } else {\n propsExpression = createCallExpression(\n context.helper(NORMALIZE_PROPS),\n [propsExpression]\n );\n }\n break;\n case 14:\n break;\n default:\n propsExpression = createCallExpression(\n context.helper(NORMALIZE_PROPS),\n [\n createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [\n propsExpression\n ])\n ]\n );\n break;\n }\n }\n return {\n props: propsExpression,\n directives: runtimeDirectives,\n patchFlag,\n dynamicPropNames,\n shouldUseBlock\n };\n}\nfunction dedupeProperties(properties) {\n const knownProps = /* @__PURE__ */ new Map();\n const deduped = [];\n for (let i = 0; i < properties.length; i++) {\n const prop = properties[i];\n if (prop.key.type === 8 || !prop.key.isStatic) {\n deduped.push(prop);\n continue;\n }\n const name = prop.key.content;\n const existing = knownProps.get(name);\n if (existing) {\n if (name === \"style\" || name === \"class\" || shared.isOn(name)) {\n mergeAsArray(existing, prop);\n }\n } else {\n knownProps.set(name, prop);\n deduped.push(prop);\n }\n }\n return deduped;\n}\nfunction mergeAsArray(existing, incoming) {\n if (existing.value.type === 17) {\n existing.value.elements.push(incoming.value);\n } else {\n existing.value = createArrayExpression(\n [existing.value, incoming.value],\n existing.loc\n );\n }\n}\nfunction buildDirectiveArgs(dir, context) {\n const dirArgs = [];\n const runtime = directiveImportMap.get(dir);\n if (runtime) {\n dirArgs.push(context.helperString(runtime));\n } else {\n const fromSetup = resolveSetupReference(\"v-\" + dir.name, context);\n if (fromSetup) {\n dirArgs.push(fromSetup);\n } else {\n context.helper(RESOLVE_DIRECTIVE);\n context.directives.add(dir.name);\n dirArgs.push(toValidAssetId(dir.name, `directive`));\n }\n }\n const { loc } = dir;\n if (dir.exp) dirArgs.push(dir.exp);\n if (dir.arg) {\n if (!dir.exp) {\n dirArgs.push(`void 0`);\n }\n dirArgs.push(dir.arg);\n }\n if (Object.keys(dir.modifiers).length) {\n if (!dir.arg) {\n if (!dir.exp) {\n dirArgs.push(`void 0`);\n }\n dirArgs.push(`void 0`);\n }\n const trueExpression = createSimpleExpression(`true`, false, loc);\n dirArgs.push(\n createObjectExpression(\n dir.modifiers.map(\n (modifier) => createObjectProperty(modifier, trueExpression)\n ),\n loc\n )\n );\n }\n return createArrayExpression(dirArgs, dir.loc);\n}\nfunction stringifyDynamicPropNames(props) {\n let propsNamesString = `[`;\n for (let i = 0, l = props.length; i < l; i++) {\n propsNamesString += JSON.stringify(props[i]);\n if (i < l - 1) propsNamesString += \", \";\n }\n return propsNamesString + `]`;\n}\nfunction isComponentTag(tag) {\n return tag === \"component\" || tag === \"Component\";\n}\n\nconst transformSlotOutlet = (node, context) => {\n if (isSlotOutlet(node)) {\n const { children, loc } = node;\n const { slotName, slotProps } = processSlotOutlet(node, context);\n const slotArgs = [\n context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,\n slotName,\n \"{}\",\n \"undefined\",\n \"true\"\n ];\n let expectedLen = 2;\n if (slotProps) {\n slotArgs[2] = slotProps;\n expectedLen = 3;\n }\n if (children.length) {\n slotArgs[3] = createFunctionExpression([], children, false, false, loc);\n expectedLen = 4;\n }\n if (context.scopeId && !context.slotted) {\n expectedLen = 5;\n }\n slotArgs.splice(expectedLen);\n node.codegenNode = createCallExpression(\n context.helper(RENDER_SLOT),\n slotArgs,\n loc\n );\n }\n};\nfunction processSlotOutlet(node, context) {\n let slotName = `\"default\"`;\n let slotProps = void 0;\n const nonNameProps = [];\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 6) {\n if (p.value) {\n if (p.name === \"name\") {\n slotName = JSON.stringify(p.value.content);\n } else {\n p.name = shared.camelize(p.name);\n nonNameProps.push(p);\n }\n }\n } else {\n if (p.name === \"bind\" && isStaticArgOf(p.arg, \"name\")) {\n if (p.exp) {\n slotName = p.exp;\n } else if (p.arg && p.arg.type === 4) {\n const name = shared.camelize(p.arg.content);\n slotName = p.exp = createSimpleExpression(name, false, p.arg.loc);\n {\n slotName = p.exp = processExpression(p.exp, context);\n }\n }\n } else {\n if (p.name === \"bind\" && p.arg && isStaticExp(p.arg)) {\n p.arg.content = shared.camelize(p.arg.content);\n }\n nonNameProps.push(p);\n }\n }\n }\n if (nonNameProps.length > 0) {\n const { props, directives } = buildProps(\n node,\n context,\n nonNameProps,\n false,\n false\n );\n slotProps = props;\n if (directives.length) {\n context.onError(\n createCompilerError(\n 36,\n directives[0].loc\n )\n );\n }\n }\n return {\n slotName,\n slotProps\n };\n}\n\nconst transformOn = (dir, node, context, augmentor) => {\n const { loc, modifiers, arg } = dir;\n if (!dir.exp && !modifiers.length) {\n context.onError(createCompilerError(35, loc));\n }\n let eventName;\n if (arg.type === 4) {\n if (arg.isStatic) {\n let rawName = arg.content;\n if (rawName.startsWith(\"vue:\")) {\n rawName = `vnode-${rawName.slice(4)}`;\n }\n const eventString = node.tagType !== 0 || rawName.startsWith(\"vnode\") || !/[A-Z]/.test(rawName) ? (\n // for non-element and vnode lifecycle event listeners, auto convert\n // it to camelCase. See issue #2249\n shared.toHandlerKey(shared.camelize(rawName))\n ) : (\n // preserve case for plain element listeners that have uppercase\n // letters, as these may be custom elements' custom events\n `on:${rawName}`\n );\n eventName = createSimpleExpression(eventString, true, arg.loc);\n } else {\n eventName = createCompoundExpression([\n `${context.helperString(TO_HANDLER_KEY)}(`,\n arg,\n `)`\n ]);\n }\n } else {\n eventName = arg;\n eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);\n eventName.children.push(`)`);\n }\n let exp = dir.exp;\n if (exp && !exp.content.trim()) {\n exp = void 0;\n }\n let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;\n if (exp) {\n const isMemberExp = isMemberExpression(exp, context);\n const isInlineStatement = !(isMemberExp || isFnExpression(exp, context));\n const hasMultipleStatements = exp.content.includes(`;`);\n if (context.prefixIdentifiers) {\n isInlineStatement && context.addIdentifiers(`$event`);\n exp = dir.exp = processExpression(\n exp,\n context,\n false,\n hasMultipleStatements\n );\n isInlineStatement && context.removeIdentifiers(`$event`);\n shouldCache = context.cacheHandlers && // unnecessary to cache inside v-once\n !context.inVOnce && // runtime constants don't need to be cached\n // (this is analyzed by compileScript in SFC <script setup>)\n !(exp.type === 4 && exp.constType > 0) && // #1541 bail if this is a member exp handler passed to a component -\n // we need to use the original function to preserve arity,\n // e.g. <transition> relies on checking cb.length to determine\n // transition end handling. Inline function is ok since its arity\n // is preserved even when cached.\n !(isMemberExp && node.tagType === 1) && // bail if the function references closure variables (v-for, v-slot)\n // it must be passed fresh to avoid stale values.\n !hasScopeRef(exp, context.identifiers);\n if (shouldCache && isMemberExp) {\n if (exp.type === 4) {\n exp.content = `${exp.content} && ${exp.content}(...args)`;\n } else {\n exp.children = [...exp.children, ` && `, ...exp.children, `(...args)`];\n }\n }\n }\n if (isInlineStatement || shouldCache && isMemberExp) {\n exp = createCompoundExpression([\n `${isInlineStatement ? context.isTS ? `($event: any)` : `$event` : `${context.isTS ? `\n//@ts-ignore\n` : ``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,\n exp,\n hasMultipleStatements ? `}` : `)`\n ]);\n }\n }\n let ret = {\n props: [\n createObjectProperty(\n eventName,\n exp || createSimpleExpression(`() => {}`, false, loc)\n )\n ]\n };\n if (augmentor) {\n ret = augmentor(ret);\n }\n if (shouldCache) {\n ret.props[0].value = context.cache(ret.props[0].value);\n }\n ret.props.forEach((p) => p.key.isHandlerKey = true);\n return ret;\n};\n\nconst transformBind = (dir, _node, context) => {\n const { modifiers, loc } = dir;\n const arg = dir.arg;\n let { exp } = dir;\n if (exp && exp.type === 4 && !exp.content.trim()) {\n {\n context.onError(\n createCompilerError(34, loc)\n );\n return {\n props: [\n createObjectProperty(arg, createSimpleExpression(\"\", true, loc))\n ]\n };\n }\n }\n if (arg.type !== 4) {\n arg.children.unshift(`(`);\n arg.children.push(`) || \"\"`);\n } else if (!arg.isStatic) {\n arg.content = arg.content ? `${arg.content} || \"\"` : `\"\"`;\n }\n if (modifiers.some((mod) => mod.content === \"camel\")) {\n if (arg.type === 4) {\n if (arg.isStatic) {\n arg.content = shared.camelize(arg.content);\n } else {\n arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;\n }\n } else {\n arg.children.unshift(`${context.helperString(CAMELIZE)}(`);\n arg.children.push(`)`);\n }\n }\n if (!context.inSSR) {\n if (modifiers.some((mod) => mod.content === \"prop\")) {\n injectPrefix(arg, \".\");\n }\n if (modifiers.some((mod) => mod.content === \"attr\")) {\n injectPrefix(arg, \"^\");\n }\n }\n return {\n props: [createObjectProperty(arg, exp)]\n };\n};\nconst injectPrefix = (arg, prefix) => {\n if (arg.type === 4) {\n if (arg.isStatic) {\n arg.content = prefix + arg.content;\n } else {\n arg.content = `\\`${prefix}\\${${arg.content}}\\``;\n }\n } else {\n arg.children.unshift(`'${prefix}' + (`);\n arg.children.push(`)`);\n }\n};\n\nconst transformText = (node, context) => {\n if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {\n return () => {\n const children = node.children;\n let currentContainer = void 0;\n let hasText = false;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (isText$1(child)) {\n hasText = true;\n for (let j = i + 1; j < children.length; j++) {\n const next = children[j];\n if (isText$1(next)) {\n if (!currentContainer) {\n currentContainer = children[i] = createCompoundExpression(\n [child],\n child.loc\n );\n }\n currentContainer.children.push(` + `, next);\n children.splice(j, 1);\n j--;\n } else {\n currentContainer = void 0;\n break;\n }\n }\n }\n }\n if (!hasText || // if this is a plain element with a single text child, leave it\n // as-is since the runtime has dedicated fast path for this by directly\n // setting textContent of the element.\n // for component root it's always normalized anyway.\n children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756\n // custom directives can potentially add DOM elements arbitrarily,\n // we need to avoid setting textContent of the element at runtime\n // to avoid accidentally overwriting the DOM elements added\n // by the user through custom directives.\n !node.props.find(\n (p) => p.type === 7 && !context.directiveTransforms[p.name]\n ) && // in compat mode, <template> tags with no special directives\n // will be rendered as a fragment so its children must be\n // converted into vnodes.\n !(node.tag === \"template\"))) {\n return;\n }\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (isText$1(child) || child.type === 8) {\n const callArgs = [];\n if (child.type !== 2 || child.content !== \" \") {\n callArgs.push(child);\n }\n if (!context.ssr && getConstantType(child, context) === 0) {\n callArgs.push(\n 1 + (``)\n );\n }\n children[i] = {\n type: 12,\n content: child,\n loc: child.loc,\n codegenNode: createCallExpression(\n context.helper(CREATE_TEXT),\n callArgs\n )\n };\n }\n }\n };\n }\n};\n\nconst seen$1 = /* @__PURE__ */ new WeakSet();\nconst transformOnce = (node, context) => {\n if (node.type === 1 && findDir(node, \"once\", true)) {\n if (seen$1.has(node) || context.inVOnce || context.inSSR) {\n return;\n }\n seen$1.add(node);\n context.inVOnce = true;\n context.helper(SET_BLOCK_TRACKING);\n return () => {\n context.inVOnce = false;\n const cur = context.currentNode;\n if (cur.codegenNode) {\n cur.codegenNode = context.cache(\n cur.codegenNode,\n true,\n true\n );\n }\n };\n }\n};\n\nconst transformModel = (dir, node, context) => {\n const { exp, arg } = dir;\n if (!exp) {\n context.onError(\n createCompilerError(41, dir.loc)\n );\n return createTransformProps();\n }\n const rawExp = exp.loc.source.trim();\n const expString = exp.type === 4 ? exp.content : rawExp;\n const bindingType = context.bindingMetadata[rawExp];\n if (bindingType === \"props\" || bindingType === \"props-aliased\") {\n context.onError(createCompilerError(44, exp.loc));\n return createTransformProps();\n }\n if (bindingType === \"literal-const\" || bindingType === \"setup-const\") {\n context.onError(createCompilerError(45, exp.loc));\n return createTransformProps();\n }\n const maybeRef = context.inline && (bindingType === \"setup-let\" || bindingType === \"setup-ref\" || bindingType === \"setup-maybe-ref\");\n if (!expString.trim() || !isMemberExpression(exp, context) && !maybeRef) {\n context.onError(\n createCompilerError(42, exp.loc)\n );\n return createTransformProps();\n }\n if (context.prefixIdentifiers && isSimpleIdentifier(expString) && context.identifiers[expString]) {\n context.onError(\n createCompilerError(43, exp.loc)\n );\n return createTransformProps();\n }\n const propName = arg ? arg : createSimpleExpression(\"modelValue\", true);\n const eventName = arg ? isStaticExp(arg) ? `onUpdate:${shared.camelize(arg.content)}` : createCompoundExpression(['\"onUpdate:\" + ', arg]) : `onUpdate:modelValue`;\n let assignmentExp;\n const eventArg = context.isTS ? `($event: any)` : `$event`;\n if (maybeRef) {\n if (bindingType === \"setup-ref\") {\n assignmentExp = createCompoundExpression([\n `${eventArg} => ((`,\n createSimpleExpression(rawExp, false, exp.loc),\n `).value = $event)`\n ]);\n } else {\n const altAssignment = bindingType === \"setup-let\" ? `${rawExp} = $event` : `null`;\n assignmentExp = createCompoundExpression([\n `${eventArg} => (${context.helperString(IS_REF)}(${rawExp}) ? (`,\n createSimpleExpression(rawExp, false, exp.loc),\n `).value = $event : ${altAssignment})`\n ]);\n }\n } else {\n assignmentExp = createCompoundExpression([\n `${eventArg} => ((`,\n exp,\n `) = $event)`\n ]);\n }\n const props = [\n // modelValue: foo\n createObjectProperty(propName, dir.exp),\n // \"onUpdate:modelValue\": $event => (foo = $event)\n createObjectProperty(eventName, assignmentExp)\n ];\n if (context.prefixIdentifiers && !context.inVOnce && context.cacheHandlers && !hasScopeRef(exp, context.identifiers)) {\n props[1].value = context.cache(props[1].value);\n }\n if (dir.modifiers.length && node.tagType === 1) {\n const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);\n const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + \"Modifiers\"']) : `modelModifiers`;\n props.push(\n createObjectProperty(\n modifiersKey,\n createSimpleExpression(\n `{ ${modifiers} }`,\n false,\n dir.loc,\n 2\n )\n )\n );\n }\n return createTransformProps(props);\n};\nfunction createTransformProps(props = []) {\n return { props };\n}\n\nconst validDivisionCharRE = /[\\w).+\\-_$\\]]/;\nconst transformFilter = (node, context) => {\n if (!isCompatEnabled(\"COMPILER_FILTERS\", context)) {\n return;\n }\n if (node.type === 5) {\n rewriteFilter(node.content, context);\n } else if (node.type === 1) {\n node.props.forEach((prop) => {\n if (prop.type === 7 && prop.name !== \"for\" && prop.exp) {\n rewriteFilter(prop.exp, context);\n }\n });\n }\n};\nfunction rewriteFilter(node, context) {\n if (node.type === 4) {\n parseFilter(node, context);\n } else {\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (typeof child !== \"object\") continue;\n if (child.type === 4) {\n parseFilter(child, context);\n } else if (child.type === 8) {\n rewriteFilter(node, context);\n } else if (child.type === 5) {\n rewriteFilter(child.content, context);\n }\n }\n }\n}\nfunction parseFilter(node, context) {\n const exp = node.content;\n let inSingle = false;\n let inDouble = false;\n let inTemplateString = false;\n let inRegex = false;\n let curly = 0;\n let square = 0;\n let paren = 0;\n let lastFilterIndex = 0;\n let c, prev, i, expression, filters = [];\n for (i = 0; i < exp.length; i++) {\n prev = c;\n c = exp.charCodeAt(i);\n if (inSingle) {\n if (c === 39 && prev !== 92) inSingle = false;\n } else if (inDouble) {\n if (c === 34 && prev !== 92) inDouble = false;\n } else if (inTemplateString) {\n if (c === 96 && prev !== 92) inTemplateString = false;\n } else if (inRegex) {\n if (c === 47 && prev !== 92) inRegex = false;\n } else if (c === 124 && // pipe\n exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) {\n if (expression === void 0) {\n lastFilterIndex = i + 1;\n expression = exp.slice(0, i).trim();\n } else {\n pushFilter();\n }\n } else {\n switch (c) {\n case 34:\n inDouble = true;\n break;\n // \"\n case 39:\n inSingle = true;\n break;\n // '\n case 96:\n inTemplateString = true;\n break;\n // `\n case 40:\n paren++;\n break;\n // (\n case 41:\n paren--;\n break;\n // )\n case 91:\n square++;\n break;\n // [\n case 93:\n square--;\n break;\n // ]\n case 123:\n curly++;\n break;\n // {\n case 125:\n curly--;\n break;\n }\n if (c === 47) {\n let j = i - 1;\n let p;\n for (; j >= 0; j--) {\n p = exp.charAt(j);\n if (p !== \" \") break;\n }\n if (!p || !validDivisionCharRE.test(p)) {\n inRegex = true;\n }\n }\n }\n }\n if (expression === void 0) {\n expression = exp.slice(0, i).trim();\n } else if (lastFilterIndex !== 0) {\n pushFilter();\n }\n function pushFilter() {\n filters.push(exp.slice(lastFilterIndex, i).trim());\n lastFilterIndex = i + 1;\n }\n if (filters.length) {\n for (i = 0; i < filters.length; i++) {\n expression = wrapFilter(expression, filters[i], context);\n }\n node.content = expression;\n node.ast = void 0;\n }\n}\nfunction wrapFilter(exp, filter, context) {\n context.helper(RESOLVE_FILTER);\n const i = filter.indexOf(\"(\");\n if (i < 0) {\n context.filters.add(filter);\n return `${toValidAssetId(filter, \"filter\")}(${exp})`;\n } else {\n const name = filter.slice(0, i);\n const args = filter.slice(i + 1);\n context.filters.add(name);\n return `${toValidAssetId(name, \"filter\")}(${exp}${args !== \")\" ? \",\" + args : args}`;\n }\n}\n\nconst seen = /* @__PURE__ */ new WeakSet();\nconst transformMemo = (node, context) => {\n if (node.type === 1) {\n const dir = findDir(node, \"memo\");\n if (!dir || seen.has(node) || context.inSSR) {\n return;\n }\n seen.add(node);\n return () => {\n const codegenNode = node.codegenNode || context.currentNode.codegenNode;\n if (codegenNode && codegenNode.type === 13) {\n if (node.tagType !== 1) {\n convertToBlock(codegenNode, context);\n }\n node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [\n dir.exp,\n createFunctionExpression(void 0, codegenNode),\n `_cache`,\n String(context.cached.length)\n ]);\n context.cached.push(null);\n }\n };\n }\n};\n\nconst transformVBindShorthand = (node, context) => {\n if (node.type === 1) {\n for (const prop of node.props) {\n if (prop.type === 7 && prop.name === \"bind\" && (!prop.exp || // #13930 :foo in in-DOM templates will be parsed into :foo=\"\" by browser\n false) && prop.arg) {\n const arg = prop.arg;\n if (arg.type !== 4 || !arg.isStatic) {\n context.onError(\n createCompilerError(\n 53,\n arg.loc\n )\n );\n prop.exp = createSimpleExpression(\"\", true, arg.loc);\n } else {\n const propName = shared.camelize(arg.content);\n if (validFirstIdentCharRE.test(propName[0]) || // allow hyphen first char for https://github.com/vuejs/language-tools/pull/3424\n propName[0] === \"-\") {\n prop.exp = createSimpleExpression(propName, false, arg.loc);\n }\n }\n }\n }\n }\n};\n\nfunction getBaseTransformPreset(prefixIdentifiers) {\n return [\n [\n transformVBindShorthand,\n transformOnce,\n transformIf,\n transformMemo,\n transformFor,\n ...[transformFilter] ,\n ...prefixIdentifiers ? [\n // order is important\n trackVForSlotScopes,\n transformExpression\n ] : [],\n transformSlotOutlet,\n transformElement,\n trackSlotScopes,\n transformText\n ],\n {\n on: transformOn,\n bind: transformBind,\n model: transformModel\n }\n ];\n}\nfunction baseCompile(source, options = {}) {\n const onError = options.onError || defaultOnError;\n const isModuleMode = options.mode === \"module\";\n const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode;\n if (!prefixIdentifiers && options.cacheHandlers) {\n onError(createCompilerError(50));\n }\n if (options.scopeId && !isModuleMode) {\n onError(createCompilerError(51));\n }\n const resolvedOptions = shared.extend({}, options, {\n prefixIdentifiers\n });\n const ast = shared.isString(source) ? baseParse(source, resolvedOptions) : source;\n const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);\n if (options.isTS) {\n const { expressionPlugins } = options;\n if (!expressionPlugins || !expressionPlugins.includes(\"typescript\")) {\n options.expressionPlugins = [...expressionPlugins || [], \"typescript\"];\n }\n }\n transform(\n ast,\n shared.extend({}, resolvedOptions, {\n nodeTransforms: [\n ...nodeTransforms,\n ...options.nodeTransforms || []\n // user transforms\n ],\n directiveTransforms: shared.extend(\n {},\n directiveTransforms,\n options.directiveTransforms || {}\n // user transforms\n )\n })\n );\n return generate(ast, resolvedOptions);\n}\n\nconst BindingTypes = {\n \"DATA\": \"data\",\n \"PROPS\": \"props\",\n \"PROPS_ALIASED\": \"props-aliased\",\n \"SETUP_LET\": \"setup-let\",\n \"SETUP_CONST\": \"setup-const\",\n \"SETUP_REACTIVE_CONST\": \"setup-reactive-const\",\n \"SETUP_MAYBE_REF\": \"setup-maybe-ref\",\n \"SETUP_REF\": \"setup-ref\",\n \"OPTIONS\": \"options\",\n \"LITERAL_CONST\": \"literal-const\"\n};\n\nconst noopDirectiveTransform = () => ({ props: [] });\n\nexports.generateCodeFrame = shared.generateCodeFrame;\nexports.BASE_TRANSITION = BASE_TRANSITION;\nexports.BindingTypes = BindingTypes;\nexports.CAMELIZE = CAMELIZE;\nexports.CAPITALIZE = CAPITALIZE;\nexports.CREATE_BLOCK = CREATE_BLOCK;\nexports.CREATE_COMMENT = CREATE_COMMENT;\nexports.CREATE_ELEMENT_BLOCK = CREATE_ELEMENT_BLOCK;\nexports.CREATE_ELEMENT_VNODE = CREATE_ELEMENT_VNODE;\nexports.CREATE_SLOTS = CREATE_SLOTS;\nexports.CREATE_STATIC = CREATE_STATIC;\nexports.CREATE_TEXT = CREATE_TEXT;\nexports.CREATE_VNODE = CREATE_VNODE;\nexports.CompilerDeprecationTypes = CompilerDeprecationTypes;\nexports.ConstantTypes = ConstantTypes;\nexports.ElementTypes = ElementTypes;\nexports.ErrorCodes = ErrorCodes;\nexports.FRAGMENT = FRAGMENT;\nexports.GUARD_REACTIVE_PROPS = GUARD_REACTIVE_PROPS;\nexports.IS_MEMO_SAME = IS_MEMO_SAME;\nexports.IS_REF = IS_REF;\nexports.KEEP_ALIVE = KEEP_ALIVE;\nexports.MERGE_PROPS = MERGE_PROPS;\nexports.NORMALIZE_CLASS = NORMALIZE_CLASS;\nexports.NORMALIZE_PROPS = NORMALIZE_PROPS;\nexports.NORMALIZE_STYLE = NORMALIZE_STYLE;\nexports.Namespaces = Namespaces;\nexports.NodeTypes = NodeTypes;\nexports.OPEN_BLOCK = OPEN_BLOCK;\nexports.POP_SCOPE_ID = POP_SCOPE_ID;\nexports.PUSH_SCOPE_ID = PUSH_SCOPE_ID;\nexports.RENDER_LIST = RENDER_LIST;\nexports.RENDER_SLOT = RENDER_SLOT;\nexports.RESOLVE_COMPONENT = RESOLVE_COMPONENT;\nexports.RESOLVE_DIRECTIVE = RESOLVE_DIRECTIVE;\nexports.RESOLVE_DYNAMIC_COMPONENT = RESOLVE_DYNAMIC_COMPONENT;\nexports.RESOLVE_FILTER = RESOLVE_FILTER;\nexports.SET_BLOCK_TRACKING = SET_BLOCK_TRACKING;\nexports.SUSPENSE = SUSPENSE;\nexports.TELEPORT = TELEPORT;\nexports.TO_DISPLAY_STRING = TO_DISPLAY_STRING;\nexports.TO_HANDLERS = TO_HANDLERS;\nexports.TO_HANDLER_KEY = TO_HANDLER_KEY;\nexports.TS_NODE_TYPES = TS_NODE_TYPES;\nexports.UNREF = UNREF;\nexports.WITH_CTX = WITH_CTX;\nexports.WITH_DIRECTIVES = WITH_DIRECTIVES;\nexports.WITH_MEMO = WITH_MEMO;\nexports.advancePositionWithClone = advancePositionWithClone;\nexports.advancePositionWithMutation = advancePositionWithMutation;\nexports.assert = assert;\nexports.baseCompile = baseCompile;\nexports.baseParse = baseParse;\nexports.buildDirectiveArgs = buildDirectiveArgs;\nexports.buildProps = buildProps;\nexports.buildSlots = buildSlots;\nexports.checkCompatEnabled = checkCompatEnabled;\nexports.convertToBlock = convertToBlock;\nexports.createArrayExpression = createArrayExpression;\nexports.createAssignmentExpression = createAssignmentExpression;\nexports.createBlockStatement = createBlockStatement;\nexports.createCacheExpression = createCacheExpression;\nexports.createCallExpression = createCallExpression;\nexports.createCompilerError = createCompilerError;\nexports.createCompoundExpression = createCompoundExpression;\nexports.createConditionalExpression = createConditionalExpression;\nexports.createForLoopParams = createForLoopParams;\nexports.createFunctionExpression = createFunctionExpression;\nexports.createIfStatement = createIfStatement;\nexports.createInterpolation = createInterpolation;\nexports.createObjectExpression = createObjectExpression;\nexports.createObjectProperty = createObjectProperty;\nexports.createReturnStatement = createReturnStatement;\nexports.createRoot = createRoot;\nexports.createSequenceExpression = createSequenceExpression;\nexports.createSimpleExpression = createSimpleExpression;\nexports.createStructuralDirectiveTransform = createStructuralDirectiveTransform;\nexports.createTemplateLiteral = createTemplateLiteral;\nexports.createTransformContext = createTransformContext;\nexports.createVNodeCall = createVNodeCall;\nexports.errorMessages = errorMessages;\nexports.extractIdentifiers = extractIdentifiers;\nexports.findDir = findDir;\nexports.findProp = findProp;\nexports.forAliasRE = forAliasRE;\nexports.generate = generate;\nexports.getBaseTransformPreset = getBaseTransformPreset;\nexports.getConstantType = getConstantType;\nexports.getMemoedVNodeCall = getMemoedVNodeCall;\nexports.getVNodeBlockHelper = getVNodeBlockHelper;\nexports.getVNodeHelper = getVNodeHelper;\nexports.hasDynamicKeyVBind = hasDynamicKeyVBind;\nexports.hasScopeRef = hasScopeRef;\nexports.helperNameMap = helperNameMap;\nexports.injectProp = injectProp;\nexports.isAllWhitespace = isAllWhitespace;\nexports.isCommentOrWhitespace = isCommentOrWhitespace;\nexports.isCoreComponent = isCoreComponent;\nexports.isFnExpression = isFnExpression;\nexports.isFnExpressionBrowser = isFnExpressionBrowser;\nexports.isFnExpressionNode = isFnExpressionNode;\nexports.isFunctionType = isFunctionType;\nexports.isInDestructureAssignment = isInDestructureAssignment;\nexports.isInNewExpression = isInNewExpression;\nexports.isMemberExpression = isMemberExpression;\nexports.isMemberExpressionBrowser = isMemberExpressionBrowser;\nexports.isMemberExpressionNode = isMemberExpressionNode;\nexports.isReferencedIdentifier = isReferencedIdentifier;\nexports.isSimpleIdentifier = isSimpleIdentifier;\nexports.isSlotOutlet = isSlotOutlet;\nexports.isStaticArgOf = isStaticArgOf;\nexports.isStaticExp = isStaticExp;\nexports.isStaticProperty = isStaticProperty;\nexports.isStaticPropertyKey = isStaticPropertyKey;\nexports.isTemplateNode = isTemplateNode;\nexports.isText = isText$1;\nexports.isVPre = isVPre;\nexports.isVSlot = isVSlot;\nexports.isWhitespaceText = isWhitespaceText;\nexports.locStub = locStub;\nexports.noopDirectiveTransform = noopDirectiveTransform;\nexports.processExpression = processExpression;\nexports.processFor = processFor;\nexports.processIf = processIf;\nexports.processSlotOutlet = processSlotOutlet;\nexports.registerRuntimeHelpers = registerRuntimeHelpers;\nexports.resolveComponentType = resolveComponentType;\nexports.stringifyExpression = stringifyExpression;\nexports.toValidAssetId = toValidAssetId;\nexports.trackSlotScopes = trackSlotScopes;\nexports.trackVForSlotScopes = trackVForSlotScopes;\nexports.transform = transform;\nexports.transformBind = transformBind;\nexports.transformElement = transformElement;\nexports.transformExpression = transformExpression;\nexports.transformModel = transformModel;\nexports.transformOn = transformOn;\nexports.transformVBindShorthand = transformVBindShorthand;\nexports.traverseNode = traverseNode;\nexports.unwrapTSNode = unwrapTSNode;\nexports.validFirstIdentCharRE = validFirstIdentCharRE;\nexports.walkBlockDeclarations = walkBlockDeclarations;\nexports.walkFunctionParams = walkFunctionParams;\nexports.walkIdentifiers = walkIdentifiers;\nexports.warnDeprecation = warnDeprecation;\n","/**\n* @vue/compiler-core v3.5.26\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\n'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar shared = require('@vue/shared');\nvar decode = require('entities/decode');\nvar parser = require('@babel/parser');\nvar estreeWalker = require('estree-walker');\nvar sourceMapJs = require('source-map-js');\n\nconst FRAGMENT = /* @__PURE__ */ Symbol(`Fragment` );\nconst TELEPORT = /* @__PURE__ */ Symbol(`Teleport` );\nconst SUSPENSE = /* @__PURE__ */ Symbol(`Suspense` );\nconst KEEP_ALIVE = /* @__PURE__ */ Symbol(`KeepAlive` );\nconst BASE_TRANSITION = /* @__PURE__ */ Symbol(\n `BaseTransition` \n);\nconst OPEN_BLOCK = /* @__PURE__ */ Symbol(`openBlock` );\nconst CREATE_BLOCK = /* @__PURE__ */ Symbol(`createBlock` );\nconst CREATE_ELEMENT_BLOCK = /* @__PURE__ */ Symbol(\n `createElementBlock` \n);\nconst CREATE_VNODE = /* @__PURE__ */ Symbol(`createVNode` );\nconst CREATE_ELEMENT_VNODE = /* @__PURE__ */ Symbol(\n `createElementVNode` \n);\nconst CREATE_COMMENT = /* @__PURE__ */ Symbol(\n `createCommentVNode` \n);\nconst CREATE_TEXT = /* @__PURE__ */ Symbol(\n `createTextVNode` \n);\nconst CREATE_STATIC = /* @__PURE__ */ Symbol(\n `createStaticVNode` \n);\nconst RESOLVE_COMPONENT = /* @__PURE__ */ Symbol(\n `resolveComponent` \n);\nconst RESOLVE_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol(\n `resolveDynamicComponent` \n);\nconst RESOLVE_DIRECTIVE = /* @__PURE__ */ Symbol(\n `resolveDirective` \n);\nconst RESOLVE_FILTER = /* @__PURE__ */ Symbol(\n `resolveFilter` \n);\nconst WITH_DIRECTIVES = /* @__PURE__ */ Symbol(\n `withDirectives` \n);\nconst RENDER_LIST = /* @__PURE__ */ Symbol(`renderList` );\nconst RENDER_SLOT = /* @__PURE__ */ Symbol(`renderSlot` );\nconst CREATE_SLOTS = /* @__PURE__ */ Symbol(`createSlots` );\nconst TO_DISPLAY_STRING = /* @__PURE__ */ Symbol(\n `toDisplayString` \n);\nconst MERGE_PROPS = /* @__PURE__ */ Symbol(`mergeProps` );\nconst NORMALIZE_CLASS = /* @__PURE__ */ Symbol(\n `normalizeClass` \n);\nconst NORMALIZE_STYLE = /* @__PURE__ */ Symbol(\n `normalizeStyle` \n);\nconst NORMALIZE_PROPS = /* @__PURE__ */ Symbol(\n `normalizeProps` \n);\nconst GUARD_REACTIVE_PROPS = /* @__PURE__ */ Symbol(\n `guardReactiveProps` \n);\nconst TO_HANDLERS = /* @__PURE__ */ Symbol(`toHandlers` );\nconst CAMELIZE = /* @__PURE__ */ Symbol(`camelize` );\nconst CAPITALIZE = /* @__PURE__ */ Symbol(`capitalize` );\nconst TO_HANDLER_KEY = /* @__PURE__ */ Symbol(\n `toHandlerKey` \n);\nconst SET_BLOCK_TRACKING = /* @__PURE__ */ Symbol(\n `setBlockTracking` \n);\nconst PUSH_SCOPE_ID = /* @__PURE__ */ Symbol(`pushScopeId` );\nconst POP_SCOPE_ID = /* @__PURE__ */ Symbol(`popScopeId` );\nconst WITH_CTX = /* @__PURE__ */ Symbol(`withCtx` );\nconst UNREF = /* @__PURE__ */ Symbol(`unref` );\nconst IS_REF = /* @__PURE__ */ Symbol(`isRef` );\nconst WITH_MEMO = /* @__PURE__ */ Symbol(`withMemo` );\nconst IS_MEMO_SAME = /* @__PURE__ */ Symbol(`isMemoSame` );\nconst helperNameMap = {\n [FRAGMENT]: `Fragment`,\n [TELEPORT]: `Teleport`,\n [SUSPENSE]: `Suspense`,\n [KEEP_ALIVE]: `KeepAlive`,\n [BASE_TRANSITION]: `BaseTransition`,\n [OPEN_BLOCK]: `openBlock`,\n [CREATE_BLOCK]: `createBlock`,\n [CREATE_ELEMENT_BLOCK]: `createElementBlock`,\n [CREATE_VNODE]: `createVNode`,\n [CREATE_ELEMENT_VNODE]: `createElementVNode`,\n [CREATE_COMMENT]: `createCommentVNode`,\n [CREATE_TEXT]: `createTextVNode`,\n [CREATE_STATIC]: `createStaticVNode`,\n [RESOLVE_COMPONENT]: `resolveComponent`,\n [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,\n [RESOLVE_DIRECTIVE]: `resolveDirective`,\n [RESOLVE_FILTER]: `resolveFilter`,\n [WITH_DIRECTIVES]: `withDirectives`,\n [RENDER_LIST]: `renderList`,\n [RENDER_SLOT]: `renderSlot`,\n [CREATE_SLOTS]: `createSlots`,\n [TO_DISPLAY_STRING]: `toDisplayString`,\n [MERGE_PROPS]: `mergeProps`,\n [NORMALIZE_CLASS]: `normalizeClass`,\n [NORMALIZE_STYLE]: `normalizeStyle`,\n [NORMALIZE_PROPS]: `normalizeProps`,\n [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,\n [TO_HANDLERS]: `toHandlers`,\n [CAMELIZE]: `camelize`,\n [CAPITALIZE]: `capitalize`,\n [TO_HANDLER_KEY]: `toHandlerKey`,\n [SET_BLOCK_TRACKING]: `setBlockTracking`,\n [PUSH_SCOPE_ID]: `pushScopeId`,\n [POP_SCOPE_ID]: `popScopeId`,\n [WITH_CTX]: `withCtx`,\n [UNREF]: `unref`,\n [IS_REF]: `isRef`,\n [WITH_MEMO]: `withMemo`,\n [IS_MEMO_SAME]: `isMemoSame`\n};\nfunction registerRuntimeHelpers(helpers) {\n Object.getOwnPropertySymbols(helpers).forEach((s) => {\n helperNameMap[s] = helpers[s];\n });\n}\n\nconst Namespaces = {\n \"HTML\": 0,\n \"0\": \"HTML\",\n \"SVG\": 1,\n \"1\": \"SVG\",\n \"MATH_ML\": 2,\n \"2\": \"MATH_ML\"\n};\nconst NodeTypes = {\n \"ROOT\": 0,\n \"0\": \"ROOT\",\n \"ELEMENT\": 1,\n \"1\": \"ELEMENT\",\n \"TEXT\": 2,\n \"2\": \"TEXT\",\n \"COMMENT\": 3,\n \"3\": \"COMMENT\",\n \"SIMPLE_EXPRESSION\": 4,\n \"4\": \"SIMPLE_EXPRESSION\",\n \"INTERPOLATION\": 5,\n \"5\": \"INTERPOLATION\",\n \"ATTRIBUTE\": 6,\n \"6\": \"ATTRIBUTE\",\n \"DIRECTIVE\": 7,\n \"7\": \"DIRECTIVE\",\n \"COMPOUND_EXPRESSION\": 8,\n \"8\": \"COMPOUND_EXPRESSION\",\n \"IF\": 9,\n \"9\": \"IF\",\n \"IF_BRANCH\": 10,\n \"10\": \"IF_BRANCH\",\n \"FOR\": 11,\n \"11\": \"FOR\",\n \"TEXT_CALL\": 12,\n \"12\": \"TEXT_CALL\",\n \"VNODE_CALL\": 13,\n \"13\": \"VNODE_CALL\",\n \"JS_CALL_EXPRESSION\": 14,\n \"14\": \"JS_CALL_EXPRESSION\",\n \"JS_OBJECT_EXPRESSION\": 15,\n \"15\": \"JS_OBJECT_EXPRESSION\",\n \"JS_PROPERTY\": 16,\n \"16\": \"JS_PROPERTY\",\n \"JS_ARRAY_EXPRESSION\": 17,\n \"17\": \"JS_ARRAY_EXPRESSION\",\n \"JS_FUNCTION_EXPRESSION\": 18,\n \"18\": \"JS_FUNCTION_EXPRESSION\",\n \"JS_CONDITIONAL_EXPRESSION\": 19,\n \"19\": \"JS_CONDITIONAL_EXPRESSION\",\n \"JS_CACHE_EXPRESSION\": 20,\n \"20\": \"JS_CACHE_EXPRESSION\",\n \"JS_BLOCK_STATEMENT\": 21,\n \"21\": \"JS_BLOCK_STATEMENT\",\n \"JS_TEMPLATE_LITERAL\": 22,\n \"22\": \"JS_TEMPLATE_LITERAL\",\n \"JS_IF_STATEMENT\": 23,\n \"23\": \"JS_IF_STATEMENT\",\n \"JS_ASSIGNMENT_EXPRESSION\": 24,\n \"24\": \"JS_ASSIGNMENT_EXPRESSION\",\n \"JS_SEQUENCE_EXPRESSION\": 25,\n \"25\": \"JS_SEQUENCE_EXPRESSION\",\n \"JS_RETURN_STATEMENT\": 26,\n \"26\": \"JS_RETURN_STATEMENT\"\n};\nconst ElementTypes = {\n \"ELEMENT\": 0,\n \"0\": \"ELEMENT\",\n \"COMPONENT\": 1,\n \"1\": \"COMPONENT\",\n \"SLOT\": 2,\n \"2\": \"SLOT\",\n \"TEMPLATE\": 3,\n \"3\": \"TEMPLATE\"\n};\nconst ConstantTypes = {\n \"NOT_CONSTANT\": 0,\n \"0\": \"NOT_CONSTANT\",\n \"CAN_SKIP_PATCH\": 1,\n \"1\": \"CAN_SKIP_PATCH\",\n \"CAN_CACHE\": 2,\n \"2\": \"CAN_CACHE\",\n \"CAN_STRINGIFY\": 3,\n \"3\": \"CAN_STRINGIFY\"\n};\nconst locStub = {\n start: { line: 1, column: 1, offset: 0 },\n end: { line: 1, column: 1, offset: 0 },\n source: \"\"\n};\nfunction createRoot(children, source = \"\") {\n return {\n type: 0,\n source,\n children,\n helpers: /* @__PURE__ */ new Set(),\n components: [],\n directives: [],\n hoists: [],\n imports: [],\n cached: [],\n temps: 0,\n codegenNode: void 0,\n loc: locStub\n };\n}\nfunction createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {\n if (context) {\n if (isBlock) {\n context.helper(OPEN_BLOCK);\n context.helper(getVNodeBlockHelper(context.inSSR, isComponent));\n } else {\n context.helper(getVNodeHelper(context.inSSR, isComponent));\n }\n if (directives) {\n context.helper(WITH_DIRECTIVES);\n }\n }\n return {\n type: 13,\n tag,\n props,\n children,\n patchFlag,\n dynamicProps,\n directives,\n isBlock,\n disableTracking,\n isComponent,\n loc\n };\n}\nfunction createArrayExpression(elements, loc = locStub) {\n return {\n type: 17,\n loc,\n elements\n };\n}\nfunction createObjectExpression(properties, loc = locStub) {\n return {\n type: 15,\n loc,\n properties\n };\n}\nfunction createObjectProperty(key, value) {\n return {\n type: 16,\n loc: locStub,\n key: shared.isString(key) ? createSimpleExpression(key, true) : key,\n value\n };\n}\nfunction createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {\n return {\n type: 4,\n loc,\n content,\n isStatic,\n constType: isStatic ? 3 : constType\n };\n}\nfunction createInterpolation(content, loc) {\n return {\n type: 5,\n loc,\n content: shared.isString(content) ? createSimpleExpression(content, false, loc) : content\n };\n}\nfunction createCompoundExpression(children, loc = locStub) {\n return {\n type: 8,\n loc,\n children\n };\n}\nfunction createCallExpression(callee, args = [], loc = locStub) {\n return {\n type: 14,\n loc,\n callee,\n arguments: args\n };\n}\nfunction createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {\n return {\n type: 18,\n params,\n returns,\n newline,\n isSlot,\n loc\n };\n}\nfunction createConditionalExpression(test, consequent, alternate, newline = true) {\n return {\n type: 19,\n test,\n consequent,\n alternate,\n newline,\n loc: locStub\n };\n}\nfunction createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) {\n return {\n type: 20,\n index,\n value,\n needPauseTracking,\n inVOnce,\n needArraySpread: false,\n loc: locStub\n };\n}\nfunction createBlockStatement(body) {\n return {\n type: 21,\n body,\n loc: locStub\n };\n}\nfunction createTemplateLiteral(elements) {\n return {\n type: 22,\n elements,\n loc: locStub\n };\n}\nfunction createIfStatement(test, consequent, alternate) {\n return {\n type: 23,\n test,\n consequent,\n alternate,\n loc: locStub\n };\n}\nfunction createAssignmentExpression(left, right) {\n return {\n type: 24,\n left,\n right,\n loc: locStub\n };\n}\nfunction createSequenceExpression(expressions) {\n return {\n type: 25,\n expressions,\n loc: locStub\n };\n}\nfunction createReturnStatement(returns) {\n return {\n type: 26,\n returns,\n loc: locStub\n };\n}\nfunction getVNodeHelper(ssr, isComponent) {\n return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;\n}\nfunction getVNodeBlockHelper(ssr, isComponent) {\n return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;\n}\nfunction convertToBlock(node, { helper, removeHelper, inSSR }) {\n if (!node.isBlock) {\n node.isBlock = true;\n removeHelper(getVNodeHelper(inSSR, node.isComponent));\n helper(OPEN_BLOCK);\n helper(getVNodeBlockHelper(inSSR, node.isComponent));\n }\n}\n\nconst defaultDelimitersOpen = new Uint8Array([123, 123]);\nconst defaultDelimitersClose = new Uint8Array([125, 125]);\nfunction isTagStartChar(c) {\n return c >= 97 && c <= 122 || c >= 65 && c <= 90;\n}\nfunction isWhitespace(c) {\n return c === 32 || c === 10 || c === 9 || c === 12 || c === 13;\n}\nfunction isEndOfTagSection(c) {\n return c === 47 || c === 62 || isWhitespace(c);\n}\nfunction toCharCodes(str) {\n const ret = new Uint8Array(str.length);\n for (let i = 0; i < str.length; i++) {\n ret[i] = str.charCodeAt(i);\n }\n return ret;\n}\nconst Sequences = {\n Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),\n // CDATA[\n CdataEnd: new Uint8Array([93, 93, 62]),\n // ]]>\n CommentEnd: new Uint8Array([45, 45, 62]),\n // `-->`\n ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),\n // `<\\/script`\n StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),\n // `</style`\n TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]),\n // `</title`\n TextareaEnd: new Uint8Array([\n 60,\n 47,\n 116,\n 101,\n 120,\n 116,\n 97,\n 114,\n 101,\n 97\n ])\n // `</textarea\n};\nclass Tokenizer {\n constructor(stack, cbs) {\n this.stack = stack;\n this.cbs = cbs;\n /** The current state the tokenizer is in. */\n this.state = 1;\n /** The read buffer. */\n this.buffer = \"\";\n /** The beginning of the section that is currently being read. */\n this.sectionStart = 0;\n /** The index within the buffer that we are currently looking at. */\n this.index = 0;\n /** The start of the last entity. */\n this.entityStart = 0;\n /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */\n this.baseState = 1;\n /** For special parsing behavior inside of script and style tags. */\n this.inRCDATA = false;\n /** For disabling RCDATA tags handling */\n this.inXML = false;\n /** For disabling interpolation parsing in v-pre */\n this.inVPre = false;\n /** Record newline positions for fast line / column calculation */\n this.newlines = [];\n this.mode = 0;\n this.delimiterOpen = defaultDelimitersOpen;\n this.delimiterClose = defaultDelimitersClose;\n this.delimiterIndex = -1;\n this.currentSequence = void 0;\n this.sequenceIndex = 0;\n {\n this.entityDecoder = new decode.EntityDecoder(\n decode.htmlDecodeTree,\n (cp, consumed) => this.emitCodePoint(cp, consumed)\n );\n }\n }\n get inSFCRoot() {\n return this.mode === 2 && this.stack.length === 0;\n }\n reset() {\n this.state = 1;\n this.mode = 0;\n this.buffer = \"\";\n this.sectionStart = 0;\n this.index = 0;\n this.baseState = 1;\n this.inRCDATA = false;\n this.currentSequence = void 0;\n this.newlines.length = 0;\n this.delimiterOpen = defaultDelimitersOpen;\n this.delimiterClose = defaultDelimitersClose;\n }\n /**\n * Generate Position object with line / column information using recorded\n * newline positions. We know the index is always going to be an already\n * processed index, so all the newlines up to this index should have been\n * recorded.\n */\n getPos(index) {\n let line = 1;\n let column = index + 1;\n const length = this.newlines.length;\n let j = -1;\n if (length > 100) {\n let l = -1;\n let r = length;\n while (l + 1 < r) {\n const m = l + r >>> 1;\n this.newlines[m] < index ? l = m : r = m;\n }\n j = l;\n } else {\n for (let i = length - 1; i >= 0; i--) {\n if (index > this.newlines[i]) {\n j = i;\n break;\n }\n }\n }\n if (j >= 0) {\n line = j + 2;\n column = index - this.newlines[j];\n }\n return {\n column,\n line,\n offset: index\n };\n }\n peek() {\n return this.buffer.charCodeAt(this.index + 1);\n }\n stateText(c) {\n if (c === 60) {\n if (this.index > this.sectionStart) {\n this.cbs.ontext(this.sectionStart, this.index);\n }\n this.state = 5;\n this.sectionStart = this.index;\n } else if (c === 38) {\n this.startEntity();\n } else if (!this.inVPre && c === this.delimiterOpen[0]) {\n this.state = 2;\n this.delimiterIndex = 0;\n this.stateInterpolationOpen(c);\n }\n }\n stateInterpolationOpen(c) {\n if (c === this.delimiterOpen[this.delimiterIndex]) {\n if (this.delimiterIndex === this.delimiterOpen.length - 1) {\n const start = this.index + 1 - this.delimiterOpen.length;\n if (start > this.sectionStart) {\n this.cbs.ontext(this.sectionStart, start);\n }\n this.state = 3;\n this.sectionStart = start;\n } else {\n this.delimiterIndex++;\n }\n } else if (this.inRCDATA) {\n this.state = 32;\n this.stateInRCDATA(c);\n } else {\n this.state = 1;\n this.stateText(c);\n }\n }\n stateInterpolation(c) {\n if (c === this.delimiterClose[0]) {\n this.state = 4;\n this.delimiterIndex = 0;\n this.stateInterpolationClose(c);\n }\n }\n stateInterpolationClose(c) {\n if (c === this.delimiterClose[this.delimiterIndex]) {\n if (this.delimiterIndex === this.delimiterClose.length - 1) {\n this.cbs.oninterpolation(this.sectionStart, this.index + 1);\n if (this.inRCDATA) {\n this.state = 32;\n } else {\n this.state = 1;\n }\n this.sectionStart = this.index + 1;\n } else {\n this.delimiterIndex++;\n }\n } else {\n this.state = 3;\n this.stateInterpolation(c);\n }\n }\n stateSpecialStartSequence(c) {\n const isEnd = this.sequenceIndex === this.currentSequence.length;\n const isMatch = isEnd ? (\n // If we are at the end of the sequence, make sure the tag name has ended\n isEndOfTagSection(c)\n ) : (\n // Otherwise, do a case-insensitive comparison\n (c | 32) === this.currentSequence[this.sequenceIndex]\n );\n if (!isMatch) {\n this.inRCDATA = false;\n } else if (!isEnd) {\n this.sequenceIndex++;\n return;\n }\n this.sequenceIndex = 0;\n this.state = 6;\n this.stateInTagName(c);\n }\n /** Look for an end tag. For <title> and <textarea>, also decode entities. */\n stateInRCDATA(c) {\n if (this.sequenceIndex === this.currentSequence.length) {\n if (c === 62 || isWhitespace(c)) {\n const endOfText = this.index - this.currentSequence.length;\n if (this.sectionStart < endOfText) {\n const actualIndex = this.index;\n this.index = endOfText;\n this.cbs.ontext(this.sectionStart, endOfText);\n this.index = actualIndex;\n }\n this.sectionStart = endOfText + 2;\n this.stateInClosingTagName(c);\n this.inRCDATA = false;\n return;\n }\n this.sequenceIndex = 0;\n }\n if ((c | 32) === this.currentSequence[this.sequenceIndex]) {\n this.sequenceIndex += 1;\n } else if (this.sequenceIndex === 0) {\n if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {\n if (c === 38) {\n this.startEntity();\n } else if (!this.inVPre && c === this.delimiterOpen[0]) {\n this.state = 2;\n this.delimiterIndex = 0;\n this.stateInterpolationOpen(c);\n }\n } else if (this.fastForwardTo(60)) {\n this.sequenceIndex = 1;\n }\n } else {\n this.sequenceIndex = Number(c === 60);\n }\n }\n stateCDATASequence(c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = 28;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n } else {\n this.sequenceIndex = 0;\n this.state = 23;\n this.stateInDeclaration(c);\n }\n }\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n fastForwardTo(c) {\n while (++this.index < this.buffer.length) {\n const cc = this.buffer.charCodeAt(this.index);\n if (cc === 10) {\n this.newlines.push(this.index);\n }\n if (cc === c) {\n return true;\n }\n }\n this.index = this.buffer.length - 1;\n return false;\n }\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n stateInCommentLike(c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index - 2);\n } else {\n this.cbs.oncomment(this.sectionStart, this.index - 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = 1;\n }\n } else if (this.sequenceIndex === 0) {\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n } else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n this.sequenceIndex = 0;\n }\n }\n startSpecial(sequence, offset) {\n this.enterRCDATA(sequence, offset);\n this.state = 31;\n }\n enterRCDATA(sequence, offset) {\n this.inRCDATA = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n }\n stateBeforeTagName(c) {\n if (c === 33) {\n this.state = 22;\n this.sectionStart = this.index + 1;\n } else if (c === 63) {\n this.state = 24;\n this.sectionStart = this.index + 1;\n } else if (isTagStartChar(c)) {\n this.sectionStart = this.index;\n if (this.mode === 0) {\n this.state = 6;\n } else if (this.inSFCRoot) {\n this.state = 34;\n } else if (!this.inXML) {\n if (c === 116) {\n this.state = 30;\n } else {\n this.state = c === 115 ? 29 : 6;\n }\n } else {\n this.state = 6;\n }\n } else if (c === 47) {\n this.state = 8;\n } else {\n this.state = 1;\n this.stateText(c);\n }\n }\n stateInTagName(c) {\n if (isEndOfTagSection(c)) {\n this.handleTagName(c);\n }\n }\n stateInSFCRootTagName(c) {\n if (isEndOfTagSection(c)) {\n const tag = this.buffer.slice(this.sectionStart, this.index);\n if (tag !== \"template\") {\n this.enterRCDATA(toCharCodes(`</` + tag), 0);\n }\n this.handleTagName(c);\n }\n }\n handleTagName(c) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = 11;\n this.stateBeforeAttrName(c);\n }\n stateBeforeClosingTagName(c) {\n if (isWhitespace(c)) ; else if (c === 62) {\n {\n this.cbs.onerr(14, this.index);\n }\n this.state = 1;\n this.sectionStart = this.index + 1;\n } else {\n this.state = isTagStartChar(c) ? 9 : 27;\n this.sectionStart = this.index;\n }\n }\n stateInClosingTagName(c) {\n if (c === 62 || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = 10;\n this.stateAfterClosingTagName(c);\n }\n }\n stateAfterClosingTagName(c) {\n if (c === 62) {\n this.state = 1;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeAttrName(c) {\n if (c === 62) {\n this.cbs.onopentagend(this.index);\n if (this.inRCDATA) {\n this.state = 32;\n } else {\n this.state = 1;\n }\n this.sectionStart = this.index + 1;\n } else if (c === 47) {\n this.state = 7;\n if (this.peek() !== 62) {\n this.cbs.onerr(22, this.index);\n }\n } else if (c === 60 && this.peek() === 47) {\n this.cbs.onopentagend(this.index);\n this.state = 5;\n this.sectionStart = this.index;\n } else if (!isWhitespace(c)) {\n if (c === 61) {\n this.cbs.onerr(\n 19,\n this.index\n );\n }\n this.handleAttrStart(c);\n }\n }\n handleAttrStart(c) {\n if (c === 118 && this.peek() === 45) {\n this.state = 13;\n this.sectionStart = this.index;\n } else if (c === 46 || c === 58 || c === 64 || c === 35) {\n this.cbs.ondirname(this.index, this.index + 1);\n this.state = 14;\n this.sectionStart = this.index + 1;\n } else {\n this.state = 12;\n this.sectionStart = this.index;\n }\n }\n stateInSelfClosingTag(c) {\n if (c === 62) {\n this.cbs.onselfclosingtag(this.index);\n this.state = 1;\n this.sectionStart = this.index + 1;\n this.inRCDATA = false;\n } else if (!isWhitespace(c)) {\n this.state = 11;\n this.stateBeforeAttrName(c);\n }\n }\n stateInAttrName(c) {\n if (c === 61 || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.handleAttrNameEnd(c);\n } else if (c === 34 || c === 39 || c === 60) {\n this.cbs.onerr(\n 17,\n this.index\n );\n }\n }\n stateInDirName(c) {\n if (c === 61 || isEndOfTagSection(c)) {\n this.cbs.ondirname(this.sectionStart, this.index);\n this.handleAttrNameEnd(c);\n } else if (c === 58) {\n this.cbs.ondirname(this.sectionStart, this.index);\n this.state = 14;\n this.sectionStart = this.index + 1;\n } else if (c === 46) {\n this.cbs.ondirname(this.sectionStart, this.index);\n this.state = 16;\n this.sectionStart = this.index + 1;\n }\n }\n stateInDirArg(c) {\n if (c === 61 || isEndOfTagSection(c)) {\n this.cbs.ondirarg(this.sectionStart, this.index);\n this.handleAttrNameEnd(c);\n } else if (c === 91) {\n this.state = 15;\n } else if (c === 46) {\n this.cbs.ondirarg(this.sectionStart, this.index);\n this.state = 16;\n this.sectionStart = this.index + 1;\n }\n }\n stateInDynamicDirArg(c) {\n if (c === 93) {\n this.state = 14;\n } else if (c === 61 || isEndOfTagSection(c)) {\n this.cbs.ondirarg(this.sectionStart, this.index + 1);\n this.handleAttrNameEnd(c);\n {\n this.cbs.onerr(\n 27,\n this.index\n );\n }\n }\n }\n stateInDirModifier(c) {\n if (c === 61 || isEndOfTagSection(c)) {\n this.cbs.ondirmodifier(this.sectionStart, this.index);\n this.handleAttrNameEnd(c);\n } else if (c === 46) {\n this.cbs.ondirmodifier(this.sectionStart, this.index);\n this.sectionStart = this.index + 1;\n }\n }\n handleAttrNameEnd(c) {\n this.sectionStart = this.index;\n this.state = 17;\n this.cbs.onattribnameend(this.index);\n this.stateAfterAttrName(c);\n }\n stateAfterAttrName(c) {\n if (c === 61) {\n this.state = 18;\n } else if (c === 47 || c === 62) {\n this.cbs.onattribend(0, this.sectionStart);\n this.sectionStart = -1;\n this.state = 11;\n this.stateBeforeAttrName(c);\n } else if (!isWhitespace(c)) {\n this.cbs.onattribend(0, this.sectionStart);\n this.handleAttrStart(c);\n }\n }\n stateBeforeAttrValue(c) {\n if (c === 34) {\n this.state = 19;\n this.sectionStart = this.index + 1;\n } else if (c === 39) {\n this.state = 20;\n this.sectionStart = this.index + 1;\n } else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = 21;\n this.stateInAttrValueNoQuotes(c);\n }\n }\n handleInAttrValue(c, quote) {\n if (c === quote || false) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(\n quote === 34 ? 3 : 2,\n this.index + 1\n );\n this.state = 11;\n } else if (c === 38) {\n this.startEntity();\n }\n }\n stateInAttrValueDoubleQuotes(c) {\n this.handleInAttrValue(c, 34);\n }\n stateInAttrValueSingleQuotes(c) {\n this.handleInAttrValue(c, 39);\n }\n stateInAttrValueNoQuotes(c) {\n if (isWhitespace(c) || c === 62) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(1, this.index);\n this.state = 11;\n this.stateBeforeAttrName(c);\n } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) {\n this.cbs.onerr(\n 18,\n this.index\n );\n } else if (c === 38) {\n this.startEntity();\n }\n }\n stateBeforeDeclaration(c) {\n if (c === 91) {\n this.state = 26;\n this.sequenceIndex = 0;\n } else {\n this.state = c === 45 ? 25 : 23;\n }\n }\n stateInDeclaration(c) {\n if (c === 62 || this.fastForwardTo(62)) {\n this.state = 1;\n this.sectionStart = this.index + 1;\n }\n }\n stateInProcessingInstruction(c) {\n if (c === 62 || this.fastForwardTo(62)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = 1;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeComment(c) {\n if (c === 45) {\n this.state = 28;\n this.currentSequence = Sequences.CommentEnd;\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n } else {\n this.state = 23;\n }\n }\n stateInSpecialComment(c) {\n if (c === 62 || this.fastForwardTo(62)) {\n this.cbs.oncomment(this.sectionStart, this.index);\n this.state = 1;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeSpecialS(c) {\n if (c === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n } else if (c === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n } else {\n this.state = 6;\n this.stateInTagName(c);\n }\n }\n stateBeforeSpecialT(c) {\n if (c === Sequences.TitleEnd[3]) {\n this.startSpecial(Sequences.TitleEnd, 4);\n } else if (c === Sequences.TextareaEnd[3]) {\n this.startSpecial(Sequences.TextareaEnd, 4);\n } else {\n this.state = 6;\n this.stateInTagName(c);\n }\n }\n startEntity() {\n {\n this.baseState = this.state;\n this.state = 33;\n this.entityStart = this.index;\n this.entityDecoder.startEntity(\n this.baseState === 1 || this.baseState === 32 ? decode.DecodingMode.Legacy : decode.DecodingMode.Attribute\n );\n }\n }\n stateInEntity() {\n {\n const length = this.entityDecoder.write(this.buffer, this.index);\n if (length >= 0) {\n this.state = this.baseState;\n if (length === 0) {\n this.index = this.entityStart;\n }\n } else {\n this.index = this.buffer.length - 1;\n }\n }\n }\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n parse(input) {\n this.buffer = input;\n while (this.index < this.buffer.length) {\n const c = this.buffer.charCodeAt(this.index);\n if (c === 10 && this.state !== 33) {\n this.newlines.push(this.index);\n }\n switch (this.state) {\n case 1: {\n this.stateText(c);\n break;\n }\n case 2: {\n this.stateInterpolationOpen(c);\n break;\n }\n case 3: {\n this.stateInterpolation(c);\n break;\n }\n case 4: {\n this.stateInterpolationClose(c);\n break;\n }\n case 31: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case 32: {\n this.stateInRCDATA(c);\n break;\n }\n case 26: {\n this.stateCDATASequence(c);\n break;\n }\n case 19: {\n this.stateInAttrValueDoubleQuotes(c);\n break;\n }\n case 12: {\n this.stateInAttrName(c);\n break;\n }\n case 13: {\n this.stateInDirName(c);\n break;\n }\n case 14: {\n this.stateInDirArg(c);\n break;\n }\n case 15: {\n this.stateInDynamicDirArg(c);\n break;\n }\n case 16: {\n this.stateInDirModifier(c);\n break;\n }\n case 28: {\n this.stateInCommentLike(c);\n break;\n }\n case 27: {\n this.stateInSpecialComment(c);\n break;\n }\n case 11: {\n this.stateBeforeAttrName(c);\n break;\n }\n case 6: {\n this.stateInTagName(c);\n break;\n }\n case 34: {\n this.stateInSFCRootTagName(c);\n break;\n }\n case 9: {\n this.stateInClosingTagName(c);\n break;\n }\n case 5: {\n this.stateBeforeTagName(c);\n break;\n }\n case 17: {\n this.stateAfterAttrName(c);\n break;\n }\n case 20: {\n this.stateInAttrValueSingleQuotes(c);\n break;\n }\n case 18: {\n this.stateBeforeAttrValue(c);\n break;\n }\n case 8: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case 10: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case 29: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case 30: {\n this.stateBeforeSpecialT(c);\n break;\n }\n case 21: {\n this.stateInAttrValueNoQuotes(c);\n break;\n }\n case 7: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case 23: {\n this.stateInDeclaration(c);\n break;\n }\n case 22: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case 25: {\n this.stateBeforeComment(c);\n break;\n }\n case 24: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case 33: {\n this.stateInEntity();\n break;\n }\n }\n this.index++;\n }\n this.cleanup();\n this.finish();\n }\n /**\n * Remove data that has already been consumed from the buffer.\n */\n cleanup() {\n if (this.sectionStart !== this.index) {\n if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n } else if (this.state === 19 || this.state === 20 || this.state === 21) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n }\n finish() {\n if (this.state === 33) {\n this.entityDecoder.end();\n this.state = this.baseState;\n }\n this.handleTrailingData();\n this.cbs.onend();\n }\n /** Handle any trailing data. */\n handleTrailingData() {\n const endIndex = this.buffer.length;\n if (this.sectionStart >= endIndex) {\n return;\n }\n if (this.state === 28) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex);\n } else {\n this.cbs.oncomment(this.sectionStart, endIndex);\n }\n } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n }\n emitCodePoint(cp, consumed) {\n {\n if (this.baseState !== 1 && this.baseState !== 32) {\n if (this.sectionStart < this.entityStart) {\n this.cbs.onattribdata(this.sectionStart, this.entityStart);\n }\n this.sectionStart = this.entityStart + consumed;\n this.index = this.sectionStart - 1;\n this.cbs.onattribentity(\n decode.fromCodePoint(cp),\n this.entityStart,\n this.sectionStart\n );\n } else {\n if (this.sectionStart < this.entityStart) {\n this.cbs.ontext(this.sectionStart, this.entityStart);\n }\n this.sectionStart = this.entityStart + consumed;\n this.index = this.sectionStart - 1;\n this.cbs.ontextentity(\n decode.fromCodePoint(cp),\n this.entityStart,\n this.sectionStart\n );\n }\n }\n }\n}\n\nconst CompilerDeprecationTypes = {\n \"COMPILER_IS_ON_ELEMENT\": \"COMPILER_IS_ON_ELEMENT\",\n \"COMPILER_V_BIND_SYNC\": \"COMPILER_V_BIND_SYNC\",\n \"COMPILER_V_BIND_OBJECT_ORDER\": \"COMPILER_V_BIND_OBJECT_ORDER\",\n \"COMPILER_V_ON_NATIVE\": \"COMPILER_V_ON_NATIVE\",\n \"COMPILER_V_IF_V_FOR_PRECEDENCE\": \"COMPILER_V_IF_V_FOR_PRECEDENCE\",\n \"COMPILER_NATIVE_TEMPLATE\": \"COMPILER_NATIVE_TEMPLATE\",\n \"COMPILER_INLINE_TEMPLATE\": \"COMPILER_INLINE_TEMPLATE\",\n \"COMPILER_FILTERS\": \"COMPILER_FILTERS\"\n};\nconst deprecationData = {\n [\"COMPILER_IS_ON_ELEMENT\"]: {\n message: `Platform-native elements with \"is\" prop will no longer be treated as components in Vue 3 unless the \"is\" value is explicitly prefixed with \"vue:\".`,\n link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html`\n },\n [\"COMPILER_V_BIND_SYNC\"]: {\n message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \\`v-bind:${key}.sync\\` should be changed to \\`v-model:${key}\\`.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`\n },\n [\"COMPILER_V_BIND_OBJECT_ORDER\"]: {\n message: `v-bind=\"obj\" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html`\n },\n [\"COMPILER_V_ON_NATIVE\"]: {\n message: `.native modifier for v-on has been removed as is no longer necessary.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html`\n },\n [\"COMPILER_V_IF_V_FOR_PRECEDENCE\"]: {\n message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html`\n },\n [\"COMPILER_NATIVE_TEMPLATE\"]: {\n message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.`\n },\n [\"COMPILER_INLINE_TEMPLATE\"]: {\n message: `\"inline-template\" has been removed in Vue 3.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html`\n },\n [\"COMPILER_FILTERS\"]: {\n message: `filters have been removed in Vue 3. The \"|\" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`,\n link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`\n }\n};\nfunction getCompatValue(key, { compatConfig }) {\n const value = compatConfig && compatConfig[key];\n if (key === \"MODE\") {\n return value || 3;\n } else {\n return value;\n }\n}\nfunction isCompatEnabled(key, context) {\n const mode = getCompatValue(\"MODE\", context);\n const value = getCompatValue(key, context);\n return mode === 3 ? value === true : value !== false;\n}\nfunction checkCompatEnabled(key, context, loc, ...args) {\n const enabled = isCompatEnabled(key, context);\n if (enabled) {\n warnDeprecation(key, context, loc, ...args);\n }\n return enabled;\n}\nfunction warnDeprecation(key, context, loc, ...args) {\n const val = getCompatValue(key, context);\n if (val === \"suppress-warning\") {\n return;\n }\n const { message, link } = deprecationData[key];\n const msg = `(deprecation ${key}) ${typeof message === \"function\" ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;\n const err = new SyntaxError(msg);\n err.code = key;\n if (loc) err.loc = loc;\n context.onWarn(err);\n}\n\nfunction defaultOnError(error) {\n throw error;\n}\nfunction defaultOnWarn(msg) {\n console.warn(`[Vue warn] ${msg.message}`);\n}\nfunction createCompilerError(code, loc, messages, additionalMessage) {\n const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ;\n const error = new SyntaxError(String(msg));\n error.code = code;\n error.loc = loc;\n return error;\n}\nconst ErrorCodes = {\n \"ABRUPT_CLOSING_OF_EMPTY_COMMENT\": 0,\n \"0\": \"ABRUPT_CLOSING_OF_EMPTY_COMMENT\",\n \"CDATA_IN_HTML_CONTENT\": 1,\n \"1\": \"CDATA_IN_HTML_CONTENT\",\n \"DUPLICATE_ATTRIBUTE\": 2,\n \"2\": \"DUPLICATE_ATTRIBUTE\",\n \"END_TAG_WITH_ATTRIBUTES\": 3,\n \"3\": \"END_TAG_WITH_ATTRIBUTES\",\n \"END_TAG_WITH_TRAILING_SOLIDUS\": 4,\n \"4\": \"END_TAG_WITH_TRAILING_SOLIDUS\",\n \"EOF_BEFORE_TAG_NAME\": 5,\n \"5\": \"EOF_BEFORE_TAG_NAME\",\n \"EOF_IN_CDATA\": 6,\n \"6\": \"EOF_IN_CDATA\",\n \"EOF_IN_COMMENT\": 7,\n \"7\": \"EOF_IN_COMMENT\",\n \"EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT\": 8,\n \"8\": \"EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT\",\n \"EOF_IN_TAG\": 9,\n \"9\": \"EOF_IN_TAG\",\n \"INCORRECTLY_CLOSED_COMMENT\": 10,\n \"10\": \"INCORRECTLY_CLOSED_COMMENT\",\n \"INCORRECTLY_OPENED_COMMENT\": 11,\n \"11\": \"INCORRECTLY_OPENED_COMMENT\",\n \"INVALID_FIRST_CHARACTER_OF_TAG_NAME\": 12,\n \"12\": \"INVALID_FIRST_CHARACTER_OF_TAG_NAME\",\n \"MISSING_ATTRIBUTE_VALUE\": 13,\n \"13\": \"MISSING_ATTRIBUTE_VALUE\",\n \"MISSING_END_TAG_NAME\": 14,\n \"14\": \"MISSING_END_TAG_NAME\",\n \"MISSING_WHITESPACE_BETWEEN_ATTRIBUTES\": 15,\n \"15\": \"MISSING_WHITESPACE_BETWEEN_ATTRIBUTES\",\n \"NESTED_COMMENT\": 16,\n \"16\": \"NESTED_COMMENT\",\n \"UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME\": 17,\n \"17\": \"UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME\",\n \"UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE\": 18,\n \"18\": \"UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE\",\n \"UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME\": 19,\n \"19\": \"UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME\",\n \"UNEXPECTED_NULL_CHARACTER\": 20,\n \"20\": \"UNEXPECTED_NULL_CHARACTER\",\n \"UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME\": 21,\n \"21\": \"UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME\",\n \"UNEXPECTED_SOLIDUS_IN_TAG\": 22,\n \"22\": \"UNEXPECTED_SOLIDUS_IN_TAG\",\n \"X_INVALID_END_TAG\": 23,\n \"23\": \"X_INVALID_END_TAG\",\n \"X_MISSING_END_TAG\": 24,\n \"24\": \"X_MISSING_END_TAG\",\n \"X_MISSING_INTERPOLATION_END\": 25,\n \"25\": \"X_MISSING_INTERPOLATION_END\",\n \"X_MISSING_DIRECTIVE_NAME\": 26,\n \"26\": \"X_MISSING_DIRECTIVE_NAME\",\n \"X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END\": 27,\n \"27\": \"X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END\",\n \"X_V_IF_NO_EXPRESSION\": 28,\n \"28\": \"X_V_IF_NO_EXPRESSION\",\n \"X_V_IF_SAME_KEY\": 29,\n \"29\": \"X_V_IF_SAME_KEY\",\n \"X_V_ELSE_NO_ADJACENT_IF\": 30,\n \"30\": \"X_V_ELSE_NO_ADJACENT_IF\",\n \"X_V_FOR_NO_EXPRESSION\": 31,\n \"31\": \"X_V_FOR_NO_EXPRESSION\",\n \"X_V_FOR_MALFORMED_EXPRESSION\": 32,\n \"32\": \"X_V_FOR_MALFORMED_EXPRESSION\",\n \"X_V_FOR_TEMPLATE_KEY_PLACEMENT\": 33,\n \"33\": \"X_V_FOR_TEMPLATE_KEY_PLACEMENT\",\n \"X_V_BIND_NO_EXPRESSION\": 34,\n \"34\": \"X_V_BIND_NO_EXPRESSION\",\n \"X_V_ON_NO_EXPRESSION\": 35,\n \"35\": \"X_V_ON_NO_EXPRESSION\",\n \"X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET\": 36,\n \"36\": \"X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET\",\n \"X_V_SLOT_MIXED_SLOT_USAGE\": 37,\n \"37\": \"X_V_SLOT_MIXED_SLOT_USAGE\",\n \"X_V_SLOT_DUPLICATE_SLOT_NAMES\": 38,\n \"38\": \"X_V_SLOT_DUPLICATE_SLOT_NAMES\",\n \"X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN\": 39,\n \"39\": \"X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN\",\n \"X_V_SLOT_MISPLACED\": 40,\n \"40\": \"X_V_SLOT_MISPLACED\",\n \"X_V_MODEL_NO_EXPRESSION\": 41,\n \"41\": \"X_V_MODEL_NO_EXPRESSION\",\n \"X_V_MODEL_MALFORMED_EXPRESSION\": 42,\n \"42\": \"X_V_MODEL_MALFORMED_EXPRESSION\",\n \"X_V_MODEL_ON_SCOPE_VARIABLE\": 43,\n \"43\": \"X_V_MODEL_ON_SCOPE_VARIABLE\",\n \"X_V_MODEL_ON_PROPS\": 44,\n \"44\": \"X_V_MODEL_ON_PROPS\",\n \"X_V_MODEL_ON_CONST\": 45,\n \"45\": \"X_V_MODEL_ON_CONST\",\n \"X_INVALID_EXPRESSION\": 46,\n \"46\": \"X_INVALID_EXPRESSION\",\n \"X_KEEP_ALIVE_INVALID_CHILDREN\": 47,\n \"47\": \"X_KEEP_ALIVE_INVALID_CHILDREN\",\n \"X_PREFIX_ID_NOT_SUPPORTED\": 48,\n \"48\": \"X_PREFIX_ID_NOT_SUPPORTED\",\n \"X_MODULE_MODE_NOT_SUPPORTED\": 49,\n \"49\": \"X_MODULE_MODE_NOT_SUPPORTED\",\n \"X_CACHE_HANDLER_NOT_SUPPORTED\": 50,\n \"50\": \"X_CACHE_HANDLER_NOT_SUPPORTED\",\n \"X_SCOPE_ID_NOT_SUPPORTED\": 51,\n \"51\": \"X_SCOPE_ID_NOT_SUPPORTED\",\n \"X_VNODE_HOOKS\": 52,\n \"52\": \"X_VNODE_HOOKS\",\n \"X_V_BIND_INVALID_SAME_NAME_ARGUMENT\": 53,\n \"53\": \"X_V_BIND_INVALID_SAME_NAME_ARGUMENT\",\n \"__EXTEND_POINT__\": 54,\n \"54\": \"__EXTEND_POINT__\"\n};\nconst errorMessages = {\n // parse errors\n [0]: \"Illegal comment.\",\n [1]: \"CDATA section is allowed only in XML context.\",\n [2]: \"Duplicate attribute.\",\n [3]: \"End tag cannot have attributes.\",\n [4]: \"Illegal '/' in tags.\",\n [5]: \"Unexpected EOF in tag.\",\n [6]: \"Unexpected EOF in CDATA section.\",\n [7]: \"Unexpected EOF in comment.\",\n [8]: \"Unexpected EOF in script.\",\n [9]: \"Unexpected EOF in tag.\",\n [10]: \"Incorrectly closed comment.\",\n [11]: \"Incorrectly opened comment.\",\n [12]: \"Illegal tag name. Use '&lt;' to print '<'.\",\n [13]: \"Attribute value was expected.\",\n [14]: \"End tag name was expected.\",\n [15]: \"Whitespace was expected.\",\n [16]: \"Unexpected '<!--' in comment.\",\n [17]: `Attribute name cannot contain U+0022 (\"), U+0027 ('), and U+003C (<).`,\n [18]: \"Unquoted attribute value cannot contain U+0022 (\\\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).\",\n [19]: \"Attribute name cannot start with '='.\",\n [21]: \"'<?' is allowed only in XML context.\",\n [20]: `Unexpected null character.`,\n [22]: \"Illegal '/' in tags.\",\n // Vue-specific parse errors\n [23]: \"Invalid end tag.\",\n [24]: \"Element is missing end tag.\",\n [25]: \"Interpolation end sign was not found.\",\n [27]: \"End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.\",\n [26]: \"Legal directive name was expected.\",\n // transform errors\n [28]: `v-if/v-else-if is missing expression.`,\n [29]: `v-if/else branches must use unique keys.`,\n [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,\n [31]: `v-for is missing expression.`,\n [32]: `v-for has invalid expression.`,\n [33]: `<template v-for> key should be placed on the <template> tag.`,\n [34]: `v-bind is missing expression.`,\n [53]: `v-bind with same-name shorthand only allows static argument.`,\n [35]: `v-on is missing expression.`,\n [36]: `Unexpected custom directive on <slot> outlet.`,\n [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,\n [38]: `Duplicate slot names found. `,\n [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,\n [40]: `v-slot can only be used on components or <template> tags.`,\n [41]: `v-model is missing expression.`,\n [42]: `v-model value must be a valid JavaScript member expression.`,\n [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,\n [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,\n [45]: `v-model cannot be used on a const binding because it is not writable.`,\n [46]: `Error parsing JavaScript expression: `,\n [47]: `<KeepAlive> expects exactly one child component.`,\n [52]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,\n // generic errors\n [48]: `\"prefixIdentifiers\" option is not supported in this build of compiler.`,\n [49]: `ES module mode is not supported in this build of compiler.`,\n [50]: `\"cacheHandlers\" option is only supported when the \"prefixIdentifiers\" option is enabled.`,\n [51]: `\"scopeId\" option is only supported in module mode.`,\n // just to fulfill types\n [54]: ``\n};\n\nfunction walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {\n const rootExp = root.type === \"Program\" ? root.body[0].type === \"ExpressionStatement\" && root.body[0].expression : root;\n estreeWalker.walk(root, {\n enter(node, parent) {\n parent && parentStack.push(parent);\n if (parent && parent.type.startsWith(\"TS\") && !TS_NODE_TYPES.includes(parent.type)) {\n return this.skip();\n }\n if (node.type === \"Identifier\") {\n const isLocal = !!knownIds[node.name];\n const isRefed = isReferencedIdentifier(node, parent, parentStack);\n if (includeAll || isRefed && !isLocal) {\n onIdentifier(node, parent, parentStack, isRefed, isLocal);\n }\n } else if (node.type === \"ObjectProperty\" && // eslint-disable-next-line no-restricted-syntax\n (parent == null ? void 0 : parent.type) === \"ObjectPattern\") {\n node.inPattern = true;\n } else if (isFunctionType(node)) {\n if (node.scopeIds) {\n node.scopeIds.forEach((id) => markKnownIds(id, knownIds));\n } else {\n walkFunctionParams(\n node,\n (id) => markScopeIdentifier(node, id, knownIds)\n );\n }\n } else if (node.type === \"BlockStatement\") {\n if (node.scopeIds) {\n node.scopeIds.forEach((id) => markKnownIds(id, knownIds));\n } else {\n walkBlockDeclarations(\n node,\n (id) => markScopeIdentifier(node, id, knownIds)\n );\n }\n } else if (node.type === \"SwitchStatement\") {\n if (node.scopeIds) {\n node.scopeIds.forEach((id) => markKnownIds(id, knownIds));\n } else {\n walkSwitchStatement(\n node,\n false,\n (id) => markScopeIdentifier(node, id, knownIds)\n );\n }\n } else if (node.type === \"CatchClause\" && node.param) {\n if (node.scopeIds) {\n node.scopeIds.forEach((id) => markKnownIds(id, knownIds));\n } else {\n for (const id of extractIdentifiers(node.param)) {\n markScopeIdentifier(node, id, knownIds);\n }\n }\n } else if (isForStatement(node)) {\n if (node.scopeIds) {\n node.scopeIds.forEach((id) => markKnownIds(id, knownIds));\n } else {\n walkForStatement(\n node,\n false,\n (id) => markScopeIdentifier(node, id, knownIds)\n );\n }\n }\n },\n leave(node, parent) {\n parent && parentStack.pop();\n if (node !== rootExp && node.scopeIds) {\n for (const id of node.scopeIds) {\n knownIds[id]--;\n if (knownIds[id] === 0) {\n delete knownIds[id];\n }\n }\n }\n }\n });\n}\nfunction isReferencedIdentifier(id, parent, parentStack) {\n if (!parent) {\n return true;\n }\n if (id.name === \"arguments\") {\n return false;\n }\n if (isReferenced(id, parent, parentStack[parentStack.length - 2])) {\n return true;\n }\n switch (parent.type) {\n case \"AssignmentExpression\":\n case \"AssignmentPattern\":\n return true;\n case \"ObjectProperty\":\n return parent.key !== id && isInDestructureAssignment(parent, parentStack);\n case \"ArrayPattern\":\n return isInDestructureAssignment(parent, parentStack);\n }\n return false;\n}\nfunction isInDestructureAssignment(parent, parentStack) {\n if (parent && (parent.type === \"ObjectProperty\" || parent.type === \"ArrayPattern\")) {\n let i = parentStack.length;\n while (i--) {\n const p = parentStack[i];\n if (p.type === \"AssignmentExpression\") {\n return true;\n } else if (p.type !== \"ObjectProperty\" && !p.type.endsWith(\"Pattern\")) {\n break;\n }\n }\n }\n return false;\n}\nfunction isInNewExpression(parentStack) {\n let i = parentStack.length;\n while (i--) {\n const p = parentStack[i];\n if (p.type === \"NewExpression\") {\n return true;\n } else if (p.type !== \"MemberExpression\") {\n break;\n }\n }\n return false;\n}\nfunction walkFunctionParams(node, onIdent) {\n for (const p of node.params) {\n for (const id of extractIdentifiers(p)) {\n onIdent(id);\n }\n }\n}\nfunction walkBlockDeclarations(block, onIdent) {\n const body = block.type === \"SwitchCase\" ? block.consequent : block.body;\n for (const stmt of body) {\n if (stmt.type === \"VariableDeclaration\") {\n if (stmt.declare) continue;\n for (const decl of stmt.declarations) {\n for (const id of extractIdentifiers(decl.id)) {\n onIdent(id);\n }\n }\n } else if (stmt.type === \"FunctionDeclaration\" || stmt.type === \"ClassDeclaration\") {\n if (stmt.declare || !stmt.id) continue;\n onIdent(stmt.id);\n } else if (isForStatement(stmt)) {\n walkForStatement(stmt, true, onIdent);\n } else if (stmt.type === \"SwitchStatement\") {\n walkSwitchStatement(stmt, true, onIdent);\n }\n }\n}\nfunction isForStatement(stmt) {\n return stmt.type === \"ForOfStatement\" || stmt.type === \"ForInStatement\" || stmt.type === \"ForStatement\";\n}\nfunction walkForStatement(stmt, isVar, onIdent) {\n const variable = stmt.type === \"ForStatement\" ? stmt.init : stmt.left;\n if (variable && variable.type === \"VariableDeclaration\" && (variable.kind === \"var\" ? isVar : !isVar)) {\n for (const decl of variable.declarations) {\n for (const id of extractIdentifiers(decl.id)) {\n onIdent(id);\n }\n }\n }\n}\nfunction walkSwitchStatement(stmt, isVar, onIdent) {\n for (const cs of stmt.cases) {\n for (const stmt2 of cs.consequent) {\n if (stmt2.type === \"VariableDeclaration\" && (stmt2.kind === \"var\" ? isVar : !isVar)) {\n for (const decl of stmt2.declarations) {\n for (const id of extractIdentifiers(decl.id)) {\n onIdent(id);\n }\n }\n }\n }\n walkBlockDeclarations(cs, onIdent);\n }\n}\nfunction extractIdentifiers(param, nodes = []) {\n switch (param.type) {\n case \"Identifier\":\n nodes.push(param);\n break;\n case \"MemberExpression\":\n let object = param;\n while (object.type === \"MemberExpression\") {\n object = object.object;\n }\n nodes.push(object);\n break;\n case \"ObjectPattern\":\n for (const prop of param.properties) {\n if (prop.type === \"RestElement\") {\n extractIdentifiers(prop.argument, nodes);\n } else {\n extractIdentifiers(prop.value, nodes);\n }\n }\n break;\n case \"ArrayPattern\":\n param.elements.forEach((element) => {\n if (element) extractIdentifiers(element, nodes);\n });\n break;\n case \"RestElement\":\n extractIdentifiers(param.argument, nodes);\n break;\n case \"AssignmentPattern\":\n extractIdentifiers(param.left, nodes);\n break;\n }\n return nodes;\n}\nfunction markKnownIds(name, knownIds) {\n if (name in knownIds) {\n knownIds[name]++;\n } else {\n knownIds[name] = 1;\n }\n}\nfunction markScopeIdentifier(node, child, knownIds) {\n const { name } = child;\n if (node.scopeIds && node.scopeIds.has(name)) {\n return;\n }\n markKnownIds(name, knownIds);\n (node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name);\n}\nconst isFunctionType = (node) => {\n return /Function(?:Expression|Declaration)$|Method$/.test(node.type);\n};\nconst isStaticProperty = (node) => node && (node.type === \"ObjectProperty\" || node.type === \"ObjectMethod\") && !node.computed;\nconst isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;\nfunction isReferenced(node, parent, grandparent) {\n switch (parent.type) {\n // yes: PARENT[NODE]\n // yes: NODE.child\n // no: parent.NODE\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n if (parent.property === node) {\n return !!parent.computed;\n }\n return parent.object === node;\n case \"JSXMemberExpression\":\n return parent.object === node;\n // no: let NODE = init;\n // yes: let id = NODE;\n case \"VariableDeclarator\":\n return parent.init === node;\n // yes: () => NODE\n // no: (NODE) => {}\n case \"ArrowFunctionExpression\":\n return parent.body === node;\n // no: class { #NODE; }\n // no: class { get #NODE() {} }\n // no: class { #NODE() {} }\n // no: class { fn() { return this.#NODE; } }\n case \"PrivateName\":\n return false;\n // no: class { NODE() {} }\n // yes: class { [NODE]() {} }\n // no: class { foo(NODE) {} }\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"ObjectMethod\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return false;\n // yes: { [NODE]: \"\" }\n // no: { NODE: \"\" }\n // depends: { NODE }\n // depends: { key: NODE }\n case \"ObjectProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return !grandparent || grandparent.type !== \"ObjectPattern\";\n // no: class { NODE = value; }\n // yes: class { [NODE] = value; }\n // yes: class { key = NODE; }\n case \"ClassProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return true;\n case \"ClassPrivateProperty\":\n return parent.key !== node;\n // no: class NODE {}\n // yes: class Foo extends NODE {}\n case \"ClassDeclaration\":\n case \"ClassExpression\":\n return parent.superClass === node;\n // yes: left = NODE;\n // no: NODE = right;\n case \"AssignmentExpression\":\n return parent.right === node;\n // no: [NODE = foo] = [];\n // yes: [foo = NODE] = [];\n case \"AssignmentPattern\":\n return parent.right === node;\n // no: NODE: for (;;) {}\n case \"LabeledStatement\":\n return false;\n // no: try {} catch (NODE) {}\n case \"CatchClause\":\n return false;\n // no: function foo(...NODE) {}\n case \"RestElement\":\n return false;\n case \"BreakStatement\":\n case \"ContinueStatement\":\n return false;\n // no: function NODE() {}\n // no: function foo(NODE) {}\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n return false;\n // no: export NODE from \"foo\";\n // no: export * as NODE from \"foo\";\n case \"ExportNamespaceSpecifier\":\n case \"ExportDefaultSpecifier\":\n return false;\n // no: export { foo as NODE };\n // yes: export { NODE as foo };\n // no: export { NODE as foo } from \"foo\";\n case \"ExportSpecifier\":\n if (grandparent == null ? void 0 : grandparent.source) {\n return false;\n }\n return parent.local === node;\n // no: import NODE from \"foo\";\n // no: import * as NODE from \"foo\";\n // no: import { NODE as foo } from \"foo\";\n // no: import { foo as NODE } from \"foo\";\n // no: import NODE from \"bar\";\n case \"ImportDefaultSpecifier\":\n case \"ImportNamespaceSpecifier\":\n case \"ImportSpecifier\":\n return false;\n // no: import \"foo\" assert { NODE: \"json\" }\n case \"ImportAttribute\":\n return false;\n // no: <div NODE=\"foo\" />\n case \"JSXAttribute\":\n return false;\n // no: [NODE] = [];\n // no: ({ NODE }) = [];\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n return false;\n // no: new.NODE\n // no: NODE.target\n case \"MetaProperty\":\n return false;\n // yes: type X = { someProperty: NODE }\n // no: type X = { NODE: OtherType }\n case \"ObjectTypeProperty\":\n return parent.key !== node;\n // yes: enum X { Foo = NODE }\n // no: enum X { NODE }\n case \"TSEnumMember\":\n return parent.id !== node;\n // yes: { [NODE]: value }\n // no: { NODE: value }\n case \"TSPropertySignature\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return true;\n }\n return true;\n}\nconst TS_NODE_TYPES = [\n \"TSAsExpression\",\n // foo as number\n \"TSTypeAssertion\",\n // (<number>foo)\n \"TSNonNullExpression\",\n // foo!\n \"TSInstantiationExpression\",\n // foo<string>\n \"TSSatisfiesExpression\"\n // foo satisfies T\n];\nfunction unwrapTSNode(node) {\n if (TS_NODE_TYPES.includes(node.type)) {\n return unwrapTSNode(node.expression);\n } else {\n return node;\n }\n}\n\nconst isStaticExp = (p) => p.type === 4 && p.isStatic;\nfunction isCoreComponent(tag) {\n switch (tag) {\n case \"Teleport\":\n case \"teleport\":\n return TELEPORT;\n case \"Suspense\":\n case \"suspense\":\n return SUSPENSE;\n case \"KeepAlive\":\n case \"keep-alive\":\n return KEEP_ALIVE;\n case \"BaseTransition\":\n case \"base-transition\":\n return BASE_TRANSITION;\n }\n}\nconst nonIdentifierRE = /^$|^\\d|[^\\$\\w\\xA0-\\uFFFF]/;\nconst isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);\nconst validFirstIdentCharRE = /[A-Za-z_$\\xA0-\\uFFFF]/;\nconst validIdentCharRE = /[\\.\\?\\w$\\xA0-\\uFFFF]/;\nconst whitespaceRE = /\\s+[.[]\\s*|\\s*[.[]\\s+/g;\nconst getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;\nconst isMemberExpressionBrowser = (exp) => {\n const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim());\n let state = 0 /* inMemberExp */;\n let stateStack = [];\n let currentOpenBracketCount = 0;\n let currentOpenParensCount = 0;\n let currentStringType = null;\n for (let i = 0; i < path.length; i++) {\n const char = path.charAt(i);\n switch (state) {\n case 0 /* inMemberExp */:\n if (char === \"[\") {\n stateStack.push(state);\n state = 1 /* inBrackets */;\n currentOpenBracketCount++;\n } else if (char === \"(\") {\n stateStack.push(state);\n state = 2 /* inParens */;\n currentOpenParensCount++;\n } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {\n return false;\n }\n break;\n case 1 /* inBrackets */:\n if (char === `'` || char === `\"` || char === \"`\") {\n stateStack.push(state);\n state = 3 /* inString */;\n currentStringType = char;\n } else if (char === `[`) {\n currentOpenBracketCount++;\n } else if (char === `]`) {\n if (!--currentOpenBracketCount) {\n state = stateStack.pop();\n }\n }\n break;\n case 2 /* inParens */:\n if (char === `'` || char === `\"` || char === \"`\") {\n stateStack.push(state);\n state = 3 /* inString */;\n currentStringType = char;\n } else if (char === `(`) {\n currentOpenParensCount++;\n } else if (char === `)`) {\n if (i === path.length - 1) {\n return false;\n }\n if (!--currentOpenParensCount) {\n state = stateStack.pop();\n }\n }\n break;\n case 3 /* inString */:\n if (char === currentStringType) {\n state = stateStack.pop();\n currentStringType = null;\n }\n break;\n }\n }\n return !currentOpenBracketCount && !currentOpenParensCount;\n};\nconst isMemberExpressionNode = (exp, context) => {\n try {\n let ret = exp.ast || parser.parseExpression(getExpSource(exp), {\n plugins: context.expressionPlugins ? [...context.expressionPlugins, \"typescript\"] : [\"typescript\"]\n });\n ret = unwrapTSNode(ret);\n return ret.type === \"MemberExpression\" || ret.type === \"OptionalMemberExpression\" || ret.type === \"Identifier\" && ret.name !== \"undefined\";\n } catch (e) {\n return false;\n }\n};\nconst isMemberExpression = isMemberExpressionNode;\nconst fnExpRE = /^\\s*(?:async\\s*)?(?:\\([^)]*?\\)|[\\w$_]+)\\s*(?::[^=]+)?=>|^\\s*(?:async\\s+)?function(?:\\s+[\\w$]+)?\\s*\\(/;\nconst isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));\nconst isFnExpressionNode = (exp, context) => {\n try {\n let ret = exp.ast || parser.parseExpression(getExpSource(exp), {\n plugins: context.expressionPlugins ? [...context.expressionPlugins, \"typescript\"] : [\"typescript\"]\n });\n if (ret.type === \"Program\") {\n ret = ret.body[0];\n if (ret.type === \"ExpressionStatement\") {\n ret = ret.expression;\n }\n }\n ret = unwrapTSNode(ret);\n return ret.type === \"FunctionExpression\" || ret.type === \"ArrowFunctionExpression\";\n } catch (e) {\n return false;\n }\n};\nconst isFnExpression = isFnExpressionNode;\nfunction advancePositionWithClone(pos, source, numberOfCharacters = source.length) {\n return advancePositionWithMutation(\n {\n offset: pos.offset,\n line: pos.line,\n column: pos.column\n },\n source,\n numberOfCharacters\n );\n}\nfunction advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\n let linesCount = 0;\n let lastNewLinePos = -1;\n for (let i = 0; i < numberOfCharacters; i++) {\n if (source.charCodeAt(i) === 10) {\n linesCount++;\n lastNewLinePos = i;\n }\n }\n pos.offset += numberOfCharacters;\n pos.line += linesCount;\n pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos;\n return pos;\n}\nfunction assert(condition, msg) {\n if (!condition) {\n throw new Error(msg || `unexpected compiler condition`);\n }\n}\nfunction findDir(node, name, allowEmpty = false) {\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 7 && (allowEmpty || p.exp) && (shared.isString(name) ? p.name === name : name.test(p.name))) {\n return p;\n }\n }\n}\nfunction findProp(node, name, dynamicOnly = false, allowEmpty = false) {\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 6) {\n if (dynamicOnly) continue;\n if (p.name === name && (p.value || allowEmpty)) {\n return p;\n }\n } else if (p.name === \"bind\" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) {\n return p;\n }\n }\n}\nfunction isStaticArgOf(arg, name) {\n return !!(arg && isStaticExp(arg) && arg.content === name);\n}\nfunction hasDynamicKeyVBind(node) {\n return node.props.some(\n (p) => p.type === 7 && p.name === \"bind\" && (!p.arg || // v-bind=\"obj\"\n p.arg.type !== 4 || // v-bind:[_ctx.foo]\n !p.arg.isStatic)\n // v-bind:[foo]\n );\n}\nfunction isText$1(node) {\n return node.type === 5 || node.type === 2;\n}\nfunction isVPre(p) {\n return p.type === 7 && p.name === \"pre\";\n}\nfunction isVSlot(p) {\n return p.type === 7 && p.name === \"slot\";\n}\nfunction isTemplateNode(node) {\n return node.type === 1 && node.tagType === 3;\n}\nfunction isSlotOutlet(node) {\n return node.type === 1 && node.tagType === 2;\n}\nconst propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);\nfunction getUnnormalizedProps(props, callPath = []) {\n if (props && !shared.isString(props) && props.type === 14) {\n const callee = props.callee;\n if (!shared.isString(callee) && propsHelperSet.has(callee)) {\n return getUnnormalizedProps(\n props.arguments[0],\n callPath.concat(props)\n );\n }\n }\n return [props, callPath];\n}\nfunction injectProp(node, prop, context) {\n let propsWithInjection;\n let props = node.type === 13 ? node.props : node.arguments[2];\n let callPath = [];\n let parentCall;\n if (props && !shared.isString(props) && props.type === 14) {\n const ret = getUnnormalizedProps(props);\n props = ret[0];\n callPath = ret[1];\n parentCall = callPath[callPath.length - 1];\n }\n if (props == null || shared.isString(props)) {\n propsWithInjection = createObjectExpression([prop]);\n } else if (props.type === 14) {\n const first = props.arguments[0];\n if (!shared.isString(first) && first.type === 15) {\n if (!hasProp(prop, first)) {\n first.properties.unshift(prop);\n }\n } else {\n if (props.callee === TO_HANDLERS) {\n propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [\n createObjectExpression([prop]),\n props\n ]);\n } else {\n props.arguments.unshift(createObjectExpression([prop]));\n }\n }\n !propsWithInjection && (propsWithInjection = props);\n } else if (props.type === 15) {\n if (!hasProp(prop, props)) {\n props.properties.unshift(prop);\n }\n propsWithInjection = props;\n } else {\n propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [\n createObjectExpression([prop]),\n props\n ]);\n if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {\n parentCall = callPath[callPath.length - 2];\n }\n }\n if (node.type === 13) {\n if (parentCall) {\n parentCall.arguments[0] = propsWithInjection;\n } else {\n node.props = propsWithInjection;\n }\n } else {\n if (parentCall) {\n parentCall.arguments[0] = propsWithInjection;\n } else {\n node.arguments[2] = propsWithInjection;\n }\n }\n}\nfunction hasProp(prop, props) {\n let result = false;\n if (prop.key.type === 4) {\n const propKeyName = prop.key.content;\n result = props.properties.some(\n (p) => p.key.type === 4 && p.key.content === propKeyName\n );\n }\n return result;\n}\nfunction toValidAssetId(name, type) {\n return `_${type}_${name.replace(/[^\\w]/g, (searchValue, replaceValue) => {\n return searchValue === \"-\" ? \"_\" : name.charCodeAt(replaceValue).toString();\n })}`;\n}\nfunction hasScopeRef(node, ids) {\n if (!node || Object.keys(ids).length === 0) {\n return false;\n }\n switch (node.type) {\n case 1:\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {\n return true;\n }\n }\n return node.children.some((c) => hasScopeRef(c, ids));\n case 11:\n if (hasScopeRef(node.source, ids)) {\n return true;\n }\n return node.children.some((c) => hasScopeRef(c, ids));\n case 9:\n return node.branches.some((b) => hasScopeRef(b, ids));\n case 10:\n if (hasScopeRef(node.condition, ids)) {\n return true;\n }\n return node.children.some((c) => hasScopeRef(c, ids));\n case 4:\n return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content];\n case 8:\n return node.children.some((c) => shared.isObject(c) && hasScopeRef(c, ids));\n case 5:\n case 12:\n return hasScopeRef(node.content, ids);\n case 2:\n case 3:\n case 20:\n return false;\n default:\n return false;\n }\n}\nfunction getMemoedVNodeCall(node) {\n if (node.type === 14 && node.callee === WITH_MEMO) {\n return node.arguments[1].returns;\n } else {\n return node;\n }\n}\nconst forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+(\\S[\\s\\S]*)/;\nfunction isAllWhitespace(str) {\n for (let i = 0; i < str.length; i++) {\n if (!isWhitespace(str.charCodeAt(i))) {\n return false;\n }\n }\n return true;\n}\nfunction isWhitespaceText(node) {\n return node.type === 2 && isAllWhitespace(node.content) || node.type === 12 && isWhitespaceText(node.content);\n}\nfunction isCommentOrWhitespace(node) {\n return node.type === 3 || isWhitespaceText(node);\n}\n\nconst defaultParserOptions = {\n parseMode: \"base\",\n ns: 0,\n delimiters: [`{{`, `}}`],\n getNamespace: () => 0,\n isVoidTag: shared.NO,\n isPreTag: shared.NO,\n isIgnoreNewlineTag: shared.NO,\n isCustomElement: shared.NO,\n onError: defaultOnError,\n onWarn: defaultOnWarn,\n comments: true,\n prefixIdentifiers: false\n};\nlet currentOptions = defaultParserOptions;\nlet currentRoot = null;\nlet currentInput = \"\";\nlet currentOpenTag = null;\nlet currentProp = null;\nlet currentAttrValue = \"\";\nlet currentAttrStartIndex = -1;\nlet currentAttrEndIndex = -1;\nlet inPre = 0;\nlet inVPre = false;\nlet currentVPreBoundary = null;\nconst stack = [];\nconst tokenizer = new Tokenizer(stack, {\n onerr: emitError,\n ontext(start, end) {\n onText(getSlice(start, end), start, end);\n },\n ontextentity(char, start, end) {\n onText(char, start, end);\n },\n oninterpolation(start, end) {\n if (inVPre) {\n return onText(getSlice(start, end), start, end);\n }\n let innerStart = start + tokenizer.delimiterOpen.length;\n let innerEnd = end - tokenizer.delimiterClose.length;\n while (isWhitespace(currentInput.charCodeAt(innerStart))) {\n innerStart++;\n }\n while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) {\n innerEnd--;\n }\n let exp = getSlice(innerStart, innerEnd);\n if (exp.includes(\"&\")) {\n {\n exp = decode.decodeHTML(exp);\n }\n }\n addNode({\n type: 5,\n content: createExp(exp, false, getLoc(innerStart, innerEnd)),\n loc: getLoc(start, end)\n });\n },\n onopentagname(start, end) {\n const name = getSlice(start, end);\n currentOpenTag = {\n type: 1,\n tag: name,\n ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns),\n tagType: 0,\n // will be refined on tag close\n props: [],\n children: [],\n loc: getLoc(start - 1, end),\n codegenNode: void 0\n };\n },\n onopentagend(end) {\n endOpenTag(end);\n },\n onclosetag(start, end) {\n const name = getSlice(start, end);\n if (!currentOptions.isVoidTag(name)) {\n let found = false;\n for (let i = 0; i < stack.length; i++) {\n const e = stack[i];\n if (e.tag.toLowerCase() === name.toLowerCase()) {\n found = true;\n if (i > 0) {\n emitError(24, stack[0].loc.start.offset);\n }\n for (let j = 0; j <= i; j++) {\n const el = stack.shift();\n onCloseTag(el, end, j < i);\n }\n break;\n }\n }\n if (!found) {\n emitError(23, backTrack(start, 60));\n }\n }\n },\n onselfclosingtag(end) {\n const name = currentOpenTag.tag;\n currentOpenTag.isSelfClosing = true;\n endOpenTag(end);\n if (stack[0] && stack[0].tag === name) {\n onCloseTag(stack.shift(), end);\n }\n },\n onattribname(start, end) {\n currentProp = {\n type: 6,\n name: getSlice(start, end),\n nameLoc: getLoc(start, end),\n value: void 0,\n loc: getLoc(start)\n };\n },\n ondirname(start, end) {\n const raw = getSlice(start, end);\n const name = raw === \".\" || raw === \":\" ? \"bind\" : raw === \"@\" ? \"on\" : raw === \"#\" ? \"slot\" : raw.slice(2);\n if (!inVPre && name === \"\") {\n emitError(26, start);\n }\n if (inVPre || name === \"\") {\n currentProp = {\n type: 6,\n name: raw,\n nameLoc: getLoc(start, end),\n value: void 0,\n loc: getLoc(start)\n };\n } else {\n currentProp = {\n type: 7,\n name,\n rawName: raw,\n exp: void 0,\n arg: void 0,\n modifiers: raw === \".\" ? [createSimpleExpression(\"prop\")] : [],\n loc: getLoc(start)\n };\n if (name === \"pre\") {\n inVPre = tokenizer.inVPre = true;\n currentVPreBoundary = currentOpenTag;\n const props = currentOpenTag.props;\n for (let i = 0; i < props.length; i++) {\n if (props[i].type === 7) {\n props[i] = dirToAttr(props[i]);\n }\n }\n }\n }\n },\n ondirarg(start, end) {\n if (start === end) return;\n const arg = getSlice(start, end);\n if (inVPre && !isVPre(currentProp)) {\n currentProp.name += arg;\n setLocEnd(currentProp.nameLoc, end);\n } else {\n const isStatic = arg[0] !== `[`;\n currentProp.arg = createExp(\n isStatic ? arg : arg.slice(1, -1),\n isStatic,\n getLoc(start, end),\n isStatic ? 3 : 0\n );\n }\n },\n ondirmodifier(start, end) {\n const mod = getSlice(start, end);\n if (inVPre && !isVPre(currentProp)) {\n currentProp.name += \".\" + mod;\n setLocEnd(currentProp.nameLoc, end);\n } else if (currentProp.name === \"slot\") {\n const arg = currentProp.arg;\n if (arg) {\n arg.content += \".\" + mod;\n setLocEnd(arg.loc, end);\n }\n } else {\n const exp = createSimpleExpression(mod, true, getLoc(start, end));\n currentProp.modifiers.push(exp);\n }\n },\n onattribdata(start, end) {\n currentAttrValue += getSlice(start, end);\n if (currentAttrStartIndex < 0) currentAttrStartIndex = start;\n currentAttrEndIndex = end;\n },\n onattribentity(char, start, end) {\n currentAttrValue += char;\n if (currentAttrStartIndex < 0) currentAttrStartIndex = start;\n currentAttrEndIndex = end;\n },\n onattribnameend(end) {\n const start = currentProp.loc.start.offset;\n const name = getSlice(start, end);\n if (currentProp.type === 7) {\n currentProp.rawName = name;\n }\n if (currentOpenTag.props.some(\n (p) => (p.type === 7 ? p.rawName : p.name) === name\n )) {\n emitError(2, start);\n }\n },\n onattribend(quote, end) {\n if (currentOpenTag && currentProp) {\n setLocEnd(currentProp.loc, end);\n if (quote !== 0) {\n if (currentProp.type === 6) {\n if (currentProp.name === \"class\") {\n currentAttrValue = condense(currentAttrValue).trim();\n }\n if (quote === 1 && !currentAttrValue) {\n emitError(13, end);\n }\n currentProp.value = {\n type: 2,\n content: currentAttrValue,\n loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1)\n };\n if (tokenizer.inSFCRoot && currentOpenTag.tag === \"template\" && currentProp.name === \"lang\" && currentAttrValue && currentAttrValue !== \"html\") {\n tokenizer.enterRCDATA(toCharCodes(`</template`), 0);\n }\n } else {\n let expParseMode = 0 /* Normal */;\n {\n if (currentProp.name === \"for\") {\n expParseMode = 3 /* Skip */;\n } else if (currentProp.name === \"slot\") {\n expParseMode = 1 /* Params */;\n } else if (currentProp.name === \"on\" && currentAttrValue.includes(\";\")) {\n expParseMode = 2 /* Statements */;\n }\n }\n currentProp.exp = createExp(\n currentAttrValue,\n false,\n getLoc(currentAttrStartIndex, currentAttrEndIndex),\n 0,\n expParseMode\n );\n if (currentProp.name === \"for\") {\n currentProp.forParseResult = parseForExpression(currentProp.exp);\n }\n let syncIndex = -1;\n if (currentProp.name === \"bind\" && (syncIndex = currentProp.modifiers.findIndex(\n (mod) => mod.content === \"sync\"\n )) > -1 && checkCompatEnabled(\n \"COMPILER_V_BIND_SYNC\",\n currentOptions,\n currentProp.loc,\n currentProp.arg.loc.source\n )) {\n currentProp.name = \"model\";\n currentProp.modifiers.splice(syncIndex, 1);\n }\n }\n }\n if (currentProp.type !== 7 || currentProp.name !== \"pre\") {\n currentOpenTag.props.push(currentProp);\n }\n }\n currentAttrValue = \"\";\n currentAttrStartIndex = currentAttrEndIndex = -1;\n },\n oncomment(start, end) {\n if (currentOptions.comments) {\n addNode({\n type: 3,\n content: getSlice(start, end),\n loc: getLoc(start - 4, end + 3)\n });\n }\n },\n onend() {\n const end = currentInput.length;\n if (tokenizer.state !== 1) {\n switch (tokenizer.state) {\n case 5:\n case 8:\n emitError(5, end);\n break;\n case 3:\n case 4:\n emitError(\n 25,\n tokenizer.sectionStart\n );\n break;\n case 28:\n if (tokenizer.currentSequence === Sequences.CdataEnd) {\n emitError(6, end);\n } else {\n emitError(7, end);\n }\n break;\n case 6:\n case 7:\n case 9:\n case 11:\n case 12:\n case 13:\n case 14:\n case 15:\n case 16:\n case 17:\n case 18:\n case 19:\n // \"\n case 20:\n // '\n case 21:\n emitError(9, end);\n break;\n }\n }\n for (let index = 0; index < stack.length; index++) {\n onCloseTag(stack[index], end - 1);\n emitError(24, stack[index].loc.start.offset);\n }\n },\n oncdata(start, end) {\n if (stack[0].ns !== 0) {\n onText(getSlice(start, end), start, end);\n } else {\n emitError(1, start - 9);\n }\n },\n onprocessinginstruction(start) {\n if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) {\n emitError(\n 21,\n start - 1\n );\n }\n }\n});\nconst forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\nconst stripParensRE = /^\\(|\\)$/g;\nfunction parseForExpression(input) {\n const loc = input.loc;\n const exp = input.content;\n const inMatch = exp.match(forAliasRE);\n if (!inMatch) return;\n const [, LHS, RHS] = inMatch;\n const createAliasExpression = (content, offset, asParam = false) => {\n const start = loc.start.offset + offset;\n const end = start + content.length;\n return createExp(\n content,\n false,\n getLoc(start, end),\n 0,\n asParam ? 1 /* Params */ : 0 /* Normal */\n );\n };\n const result = {\n source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),\n value: void 0,\n key: void 0,\n index: void 0,\n finalized: false\n };\n let valueContent = LHS.trim().replace(stripParensRE, \"\").trim();\n const trimmedOffset = LHS.indexOf(valueContent);\n const iteratorMatch = valueContent.match(forIteratorRE);\n if (iteratorMatch) {\n valueContent = valueContent.replace(forIteratorRE, \"\").trim();\n const keyContent = iteratorMatch[1].trim();\n let keyOffset;\n if (keyContent) {\n keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);\n result.key = createAliasExpression(keyContent, keyOffset, true);\n }\n if (iteratorMatch[2]) {\n const indexContent = iteratorMatch[2].trim();\n if (indexContent) {\n result.index = createAliasExpression(\n indexContent,\n exp.indexOf(\n indexContent,\n result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length\n ),\n true\n );\n }\n }\n }\n if (valueContent) {\n result.value = createAliasExpression(valueContent, trimmedOffset, true);\n }\n return result;\n}\nfunction getSlice(start, end) {\n return currentInput.slice(start, end);\n}\nfunction endOpenTag(end) {\n if (tokenizer.inSFCRoot) {\n currentOpenTag.innerLoc = getLoc(end + 1, end + 1);\n }\n addNode(currentOpenTag);\n const { tag, ns } = currentOpenTag;\n if (ns === 0 && currentOptions.isPreTag(tag)) {\n inPre++;\n }\n if (currentOptions.isVoidTag(tag)) {\n onCloseTag(currentOpenTag, end);\n } else {\n stack.unshift(currentOpenTag);\n if (ns === 1 || ns === 2) {\n tokenizer.inXML = true;\n }\n }\n currentOpenTag = null;\n}\nfunction onText(content, start, end) {\n const parent = stack[0] || currentRoot;\n const lastNode = parent.children[parent.children.length - 1];\n if (lastNode && lastNode.type === 2) {\n lastNode.content += content;\n setLocEnd(lastNode.loc, end);\n } else {\n parent.children.push({\n type: 2,\n content,\n loc: getLoc(start, end)\n });\n }\n}\nfunction onCloseTag(el, end, isImplied = false) {\n if (isImplied) {\n setLocEnd(el.loc, backTrack(end, 60));\n } else {\n setLocEnd(el.loc, lookAhead(end, 62) + 1);\n }\n if (tokenizer.inSFCRoot) {\n if (el.children.length) {\n el.innerLoc.end = shared.extend({}, el.children[el.children.length - 1].loc.end);\n } else {\n el.innerLoc.end = shared.extend({}, el.innerLoc.start);\n }\n el.innerLoc.source = getSlice(\n el.innerLoc.start.offset,\n el.innerLoc.end.offset\n );\n }\n const { tag, ns, children } = el;\n if (!inVPre) {\n if (tag === \"slot\") {\n el.tagType = 2;\n } else if (isFragmentTemplate(el)) {\n el.tagType = 3;\n } else if (isComponent(el)) {\n el.tagType = 1;\n }\n }\n if (!tokenizer.inRCDATA) {\n el.children = condenseWhitespace(children);\n }\n if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {\n const first = children[0];\n if (first && first.type === 2) {\n first.content = first.content.replace(/^\\r?\\n/, \"\");\n }\n }\n if (ns === 0 && currentOptions.isPreTag(tag)) {\n inPre--;\n }\n if (currentVPreBoundary === el) {\n inVPre = tokenizer.inVPre = false;\n currentVPreBoundary = null;\n }\n if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) {\n tokenizer.inXML = false;\n }\n {\n const props = el.props;\n if (isCompatEnabled(\n \"COMPILER_V_IF_V_FOR_PRECEDENCE\",\n currentOptions\n )) {\n let hasIf = false;\n let hasFor = false;\n for (let i = 0; i < props.length; i++) {\n const p = props[i];\n if (p.type === 7) {\n if (p.name === \"if\") {\n hasIf = true;\n } else if (p.name === \"for\") {\n hasFor = true;\n }\n }\n if (hasIf && hasFor) {\n warnDeprecation(\n \"COMPILER_V_IF_V_FOR_PRECEDENCE\",\n currentOptions,\n el.loc\n );\n break;\n }\n }\n }\n if (!tokenizer.inSFCRoot && isCompatEnabled(\n \"COMPILER_NATIVE_TEMPLATE\",\n currentOptions\n ) && el.tag === \"template\" && !isFragmentTemplate(el)) {\n warnDeprecation(\n \"COMPILER_NATIVE_TEMPLATE\",\n currentOptions,\n el.loc\n );\n const parent = stack[0] || currentRoot;\n const index = parent.children.indexOf(el);\n parent.children.splice(index, 1, ...el.children);\n }\n const inlineTemplateProp = props.find(\n (p) => p.type === 6 && p.name === \"inline-template\"\n );\n if (inlineTemplateProp && checkCompatEnabled(\n \"COMPILER_INLINE_TEMPLATE\",\n currentOptions,\n inlineTemplateProp.loc\n ) && el.children.length) {\n inlineTemplateProp.value = {\n type: 2,\n content: getSlice(\n el.children[0].loc.start.offset,\n el.children[el.children.length - 1].loc.end.offset\n ),\n loc: inlineTemplateProp.loc\n };\n }\n }\n}\nfunction lookAhead(index, c) {\n let i = index;\n while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++;\n return i;\n}\nfunction backTrack(index, c) {\n let i = index;\n while (currentInput.charCodeAt(i) !== c && i >= 0) i--;\n return i;\n}\nconst specialTemplateDir = /* @__PURE__ */ new Set([\"if\", \"else\", \"else-if\", \"for\", \"slot\"]);\nfunction isFragmentTemplate({ tag, props }) {\n if (tag === \"template\") {\n for (let i = 0; i < props.length; i++) {\n if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) {\n return true;\n }\n }\n }\n return false;\n}\nfunction isComponent({ tag, props }) {\n if (currentOptions.isCustomElement(tag)) {\n return false;\n }\n if (tag === \"component\" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {\n return true;\n }\n for (let i = 0; i < props.length; i++) {\n const p = props[i];\n if (p.type === 6) {\n if (p.name === \"is\" && p.value) {\n if (p.value.content.startsWith(\"vue:\")) {\n return true;\n } else if (checkCompatEnabled(\n \"COMPILER_IS_ON_ELEMENT\",\n currentOptions,\n p.loc\n )) {\n return true;\n }\n }\n } else if (// :is on plain element - only treat as component in compat mode\n p.name === \"bind\" && isStaticArgOf(p.arg, \"is\") && checkCompatEnabled(\n \"COMPILER_IS_ON_ELEMENT\",\n currentOptions,\n p.loc\n )) {\n return true;\n }\n }\n return false;\n}\nfunction isUpperCase(c) {\n return c > 64 && c < 91;\n}\nconst windowsNewlineRE = /\\r\\n/g;\nfunction condenseWhitespace(nodes) {\n const shouldCondense = currentOptions.whitespace !== \"preserve\";\n let removedWhitespace = false;\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (node.type === 2) {\n if (!inPre) {\n if (isAllWhitespace(node.content)) {\n const prev = nodes[i - 1] && nodes[i - 1].type;\n const next = nodes[i + 1] && nodes[i + 1].type;\n if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {\n removedWhitespace = true;\n nodes[i] = null;\n } else {\n node.content = \" \";\n }\n } else if (shouldCondense) {\n node.content = condense(node.content);\n }\n } else {\n node.content = node.content.replace(windowsNewlineRE, \"\\n\");\n }\n }\n }\n return removedWhitespace ? nodes.filter(Boolean) : nodes;\n}\nfunction hasNewlineChar(str) {\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c === 10 || c === 13) {\n return true;\n }\n }\n return false;\n}\nfunction condense(str) {\n let ret = \"\";\n let prevCharIsWhitespace = false;\n for (let i = 0; i < str.length; i++) {\n if (isWhitespace(str.charCodeAt(i))) {\n if (!prevCharIsWhitespace) {\n ret += \" \";\n prevCharIsWhitespace = true;\n }\n } else {\n ret += str[i];\n prevCharIsWhitespace = false;\n }\n }\n return ret;\n}\nfunction addNode(node) {\n (stack[0] || currentRoot).children.push(node);\n}\nfunction getLoc(start, end) {\n return {\n start: tokenizer.getPos(start),\n // @ts-expect-error allow late attachment\n end: end == null ? end : tokenizer.getPos(end),\n // @ts-expect-error allow late attachment\n source: end == null ? end : getSlice(start, end)\n };\n}\nfunction cloneLoc(loc) {\n return getLoc(loc.start.offset, loc.end.offset);\n}\nfunction setLocEnd(loc, end) {\n loc.end = tokenizer.getPos(end);\n loc.source = getSlice(loc.start.offset, end);\n}\nfunction dirToAttr(dir) {\n const attr = {\n type: 6,\n name: dir.rawName,\n nameLoc: getLoc(\n dir.loc.start.offset,\n dir.loc.start.offset + dir.rawName.length\n ),\n value: void 0,\n loc: dir.loc\n };\n if (dir.exp) {\n const loc = dir.exp.loc;\n if (loc.end.offset < dir.loc.end.offset) {\n loc.start.offset--;\n loc.start.column--;\n loc.end.offset++;\n loc.end.column++;\n }\n attr.value = {\n type: 2,\n content: dir.exp.content,\n loc\n };\n }\n return attr;\n}\nfunction createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) {\n const exp = createSimpleExpression(content, isStatic, loc, constType);\n if (!isStatic && currentOptions.prefixIdentifiers && parseMode !== 3 /* Skip */ && content.trim()) {\n if (isSimpleIdentifier(content)) {\n exp.ast = null;\n return exp;\n }\n try {\n const plugins = currentOptions.expressionPlugins;\n const options = {\n plugins: plugins ? [...plugins, \"typescript\"] : [\"typescript\"]\n };\n if (parseMode === 2 /* Statements */) {\n exp.ast = parser.parse(` ${content} `, options).program;\n } else if (parseMode === 1 /* Params */) {\n exp.ast = parser.parseExpression(`(${content})=>{}`, options);\n } else {\n exp.ast = parser.parseExpression(`(${content})`, options);\n }\n } catch (e) {\n exp.ast = false;\n emitError(46, loc.start.offset, e.message);\n }\n }\n return exp;\n}\nfunction emitError(code, index, message) {\n currentOptions.onError(\n createCompilerError(code, getLoc(index, index), void 0, message)\n );\n}\nfunction reset() {\n tokenizer.reset();\n currentOpenTag = null;\n currentProp = null;\n currentAttrValue = \"\";\n currentAttrStartIndex = -1;\n currentAttrEndIndex = -1;\n stack.length = 0;\n}\nfunction baseParse(input, options) {\n reset();\n currentInput = input;\n currentOptions = shared.extend({}, defaultParserOptions);\n if (options) {\n let key;\n for (key in options) {\n if (options[key] != null) {\n currentOptions[key] = options[key];\n }\n }\n }\n {\n if (currentOptions.decodeEntities) {\n console.warn(\n `[@vue/compiler-core] decodeEntities option is passed but will be ignored in non-browser builds.`\n );\n }\n }\n tokenizer.mode = currentOptions.parseMode === \"html\" ? 1 : currentOptions.parseMode === \"sfc\" ? 2 : 0;\n tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;\n const delimiters = options && options.delimiters;\n if (delimiters) {\n tokenizer.delimiterOpen = toCharCodes(delimiters[0]);\n tokenizer.delimiterClose = toCharCodes(delimiters[1]);\n }\n const root = currentRoot = createRoot([], input);\n tokenizer.parse(currentInput);\n root.loc = getLoc(0, input.length);\n root.children = condenseWhitespace(root.children);\n currentRoot = null;\n return root;\n}\n\nfunction cacheStatic(root, context) {\n walk(\n root,\n void 0,\n context,\n // Root node is unfortunately non-hoistable due to potential parent\n // fallthrough attributes.\n !!getSingleElementRoot(root)\n );\n}\nfunction getSingleElementRoot(root) {\n const children = root.children.filter((x) => x.type !== 3);\n return children.length === 1 && children[0].type === 1 && !isSlotOutlet(children[0]) ? children[0] : null;\n}\nfunction walk(node, parent, context, doNotHoistNode = false, inFor = false) {\n const { children } = node;\n const toCache = [];\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (child.type === 1 && child.tagType === 0) {\n const constantType = doNotHoistNode ? 0 : getConstantType(child, context);\n if (constantType > 0) {\n if (constantType >= 2) {\n child.codegenNode.patchFlag = -1;\n toCache.push(child);\n continue;\n }\n } else {\n const codegenNode = child.codegenNode;\n if (codegenNode.type === 13) {\n const flag = codegenNode.patchFlag;\n if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {\n const props = getNodeProps(child);\n if (props) {\n codegenNode.props = context.hoist(props);\n }\n }\n if (codegenNode.dynamicProps) {\n codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);\n }\n }\n }\n } else if (child.type === 12) {\n const constantType = doNotHoistNode ? 0 : getConstantType(child, context);\n if (constantType >= 2) {\n if (child.codegenNode.type === 14 && child.codegenNode.arguments.length > 0) {\n child.codegenNode.arguments.push(\n -1 + (` /* ${shared.PatchFlagNames[-1]} */` )\n );\n }\n toCache.push(child);\n continue;\n }\n }\n if (child.type === 1) {\n const isComponent = child.tagType === 1;\n if (isComponent) {\n context.scopes.vSlot++;\n }\n walk(child, node, context, false, inFor);\n if (isComponent) {\n context.scopes.vSlot--;\n }\n } else if (child.type === 11) {\n walk(child, node, context, child.children.length === 1, true);\n } else if (child.type === 9) {\n for (let i2 = 0; i2 < child.branches.length; i2++) {\n walk(\n child.branches[i2],\n node,\n context,\n child.branches[i2].children.length === 1,\n inFor\n );\n }\n }\n }\n let cachedAsArray = false;\n if (toCache.length === children.length && node.type === 1) {\n if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) {\n node.codegenNode.children = getCacheExpression(\n createArrayExpression(node.codegenNode.children)\n );\n cachedAsArray = true;\n } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {\n const slot = getSlotNode(node.codegenNode, \"default\");\n if (slot) {\n slot.returns = getCacheExpression(\n createArrayExpression(slot.returns)\n );\n cachedAsArray = true;\n }\n } else if (node.tagType === 3 && parent && parent.type === 1 && parent.tagType === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 15) {\n const slotName = findDir(node, \"slot\", true);\n const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);\n if (slot) {\n slot.returns = getCacheExpression(\n createArrayExpression(slot.returns)\n );\n cachedAsArray = true;\n }\n }\n }\n if (!cachedAsArray) {\n for (const child of toCache) {\n child.codegenNode = context.cache(child.codegenNode);\n }\n }\n function getCacheExpression(value) {\n const exp = context.cache(value);\n exp.needArraySpread = true;\n return exp;\n }\n function getSlotNode(node2, name) {\n if (node2.children && !shared.isArray(node2.children) && node2.children.type === 15) {\n const slot = node2.children.properties.find(\n (p) => p.key === name || p.key.content === name\n );\n return slot && slot.value;\n }\n }\n if (toCache.length && context.transformHoist) {\n context.transformHoist(children, context, node);\n }\n}\nfunction getConstantType(node, context) {\n const { constantCache } = context;\n switch (node.type) {\n case 1:\n if (node.tagType !== 0) {\n return 0;\n }\n const cached = constantCache.get(node);\n if (cached !== void 0) {\n return cached;\n }\n const codegenNode = node.codegenNode;\n if (codegenNode.type !== 13) {\n return 0;\n }\n if (codegenNode.isBlock && node.tag !== \"svg\" && node.tag !== \"foreignObject\" && node.tag !== \"math\") {\n return 0;\n }\n if (codegenNode.patchFlag === void 0) {\n let returnType2 = 3;\n const generatedPropsType = getGeneratedPropsConstantType(node, context);\n if (generatedPropsType === 0) {\n constantCache.set(node, 0);\n return 0;\n }\n if (generatedPropsType < returnType2) {\n returnType2 = generatedPropsType;\n }\n for (let i = 0; i < node.children.length; i++) {\n const childType = getConstantType(node.children[i], context);\n if (childType === 0) {\n constantCache.set(node, 0);\n return 0;\n }\n if (childType < returnType2) {\n returnType2 = childType;\n }\n }\n if (returnType2 > 1) {\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 7 && p.name === \"bind\" && p.exp) {\n const expType = getConstantType(p.exp, context);\n if (expType === 0) {\n constantCache.set(node, 0);\n return 0;\n }\n if (expType < returnType2) {\n returnType2 = expType;\n }\n }\n }\n }\n if (codegenNode.isBlock) {\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 7) {\n constantCache.set(node, 0);\n return 0;\n }\n }\n context.removeHelper(OPEN_BLOCK);\n context.removeHelper(\n getVNodeBlockHelper(context.inSSR, codegenNode.isComponent)\n );\n codegenNode.isBlock = false;\n context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));\n }\n constantCache.set(node, returnType2);\n return returnType2;\n } else {\n constantCache.set(node, 0);\n return 0;\n }\n case 2:\n case 3:\n return 3;\n case 9:\n case 11:\n case 10:\n return 0;\n case 5:\n case 12:\n return getConstantType(node.content, context);\n case 4:\n return node.constType;\n case 8:\n let returnType = 3;\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (shared.isString(child) || shared.isSymbol(child)) {\n continue;\n }\n const childType = getConstantType(child, context);\n if (childType === 0) {\n return 0;\n } else if (childType < returnType) {\n returnType = childType;\n }\n }\n return returnType;\n case 20:\n return 2;\n default:\n return 0;\n }\n}\nconst allowHoistedHelperSet = /* @__PURE__ */ new Set([\n NORMALIZE_CLASS,\n NORMALIZE_STYLE,\n NORMALIZE_PROPS,\n GUARD_REACTIVE_PROPS\n]);\nfunction getConstantTypeOfHelperCall(value, context) {\n if (value.type === 14 && !shared.isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {\n const arg = value.arguments[0];\n if (arg.type === 4) {\n return getConstantType(arg, context);\n } else if (arg.type === 14) {\n return getConstantTypeOfHelperCall(arg, context);\n }\n }\n return 0;\n}\nfunction getGeneratedPropsConstantType(node, context) {\n let returnType = 3;\n const props = getNodeProps(node);\n if (props && props.type === 15) {\n const { properties } = props;\n for (let i = 0; i < properties.length; i++) {\n const { key, value } = properties[i];\n const keyType = getConstantType(key, context);\n if (keyType === 0) {\n return keyType;\n }\n if (keyType < returnType) {\n returnType = keyType;\n }\n let valueType;\n if (value.type === 4) {\n valueType = getConstantType(value, context);\n } else if (value.type === 14) {\n valueType = getConstantTypeOfHelperCall(value, context);\n } else {\n valueType = 0;\n }\n if (valueType === 0) {\n return valueType;\n }\n if (valueType < returnType) {\n returnType = valueType;\n }\n }\n }\n return returnType;\n}\nfunction getNodeProps(node) {\n const codegenNode = node.codegenNode;\n if (codegenNode.type === 13) {\n return codegenNode.props;\n }\n}\n\nfunction createTransformContext(root, {\n filename = \"\",\n prefixIdentifiers = false,\n hoistStatic = false,\n hmr = false,\n cacheHandlers = false,\n nodeTransforms = [],\n directiveTransforms = {},\n transformHoist = null,\n isBuiltInComponent = shared.NOOP,\n isCustomElement = shared.NOOP,\n expressionPlugins = [],\n scopeId = null,\n slotted = true,\n ssr = false,\n inSSR = false,\n ssrCssVars = ``,\n bindingMetadata = shared.EMPTY_OBJ,\n inline = false,\n isTS = false,\n onError = defaultOnError,\n onWarn = defaultOnWarn,\n compatConfig\n}) {\n const nameMatch = filename.replace(/\\?.*$/, \"\").match(/([^/\\\\]+)\\.\\w+$/);\n const context = {\n // options\n filename,\n selfName: nameMatch && shared.capitalize(shared.camelize(nameMatch[1])),\n prefixIdentifiers,\n hoistStatic,\n hmr,\n cacheHandlers,\n nodeTransforms,\n directiveTransforms,\n transformHoist,\n isBuiltInComponent,\n isCustomElement,\n expressionPlugins,\n scopeId,\n slotted,\n ssr,\n inSSR,\n ssrCssVars,\n bindingMetadata,\n inline,\n isTS,\n onError,\n onWarn,\n compatConfig,\n // state\n root,\n helpers: /* @__PURE__ */ new Map(),\n components: /* @__PURE__ */ new Set(),\n directives: /* @__PURE__ */ new Set(),\n hoists: [],\n imports: [],\n cached: [],\n constantCache: /* @__PURE__ */ new WeakMap(),\n temps: 0,\n identifiers: /* @__PURE__ */ Object.create(null),\n scopes: {\n vFor: 0,\n vSlot: 0,\n vPre: 0,\n vOnce: 0\n },\n parent: null,\n grandParent: null,\n currentNode: root,\n childIndex: 0,\n inVOnce: false,\n // methods\n helper(name) {\n const count = context.helpers.get(name) || 0;\n context.helpers.set(name, count + 1);\n return name;\n },\n removeHelper(name) {\n const count = context.helpers.get(name);\n if (count) {\n const currentCount = count - 1;\n if (!currentCount) {\n context.helpers.delete(name);\n } else {\n context.helpers.set(name, currentCount);\n }\n }\n },\n helperString(name) {\n return `_${helperNameMap[context.helper(name)]}`;\n },\n replaceNode(node) {\n {\n if (!context.currentNode) {\n throw new Error(`Node being replaced is already removed.`);\n }\n if (!context.parent) {\n throw new Error(`Cannot replace root node.`);\n }\n }\n context.parent.children[context.childIndex] = context.currentNode = node;\n },\n removeNode(node) {\n if (!context.parent) {\n throw new Error(`Cannot remove root node.`);\n }\n const list = context.parent.children;\n const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1;\n if (removalIndex < 0) {\n throw new Error(`node being removed is not a child of current parent`);\n }\n if (!node || node === context.currentNode) {\n context.currentNode = null;\n context.onNodeRemoved();\n } else {\n if (context.childIndex > removalIndex) {\n context.childIndex--;\n context.onNodeRemoved();\n }\n }\n context.parent.children.splice(removalIndex, 1);\n },\n onNodeRemoved: shared.NOOP,\n addIdentifiers(exp) {\n {\n if (shared.isString(exp)) {\n addId(exp);\n } else if (exp.identifiers) {\n exp.identifiers.forEach(addId);\n } else if (exp.type === 4) {\n addId(exp.content);\n }\n }\n },\n removeIdentifiers(exp) {\n {\n if (shared.isString(exp)) {\n removeId(exp);\n } else if (exp.identifiers) {\n exp.identifiers.forEach(removeId);\n } else if (exp.type === 4) {\n removeId(exp.content);\n }\n }\n },\n hoist(exp) {\n if (shared.isString(exp)) exp = createSimpleExpression(exp);\n context.hoists.push(exp);\n const identifier = createSimpleExpression(\n `_hoisted_${context.hoists.length}`,\n false,\n exp.loc,\n 2\n );\n identifier.hoisted = exp;\n return identifier;\n },\n cache(exp, isVNode = false, inVOnce = false) {\n const cacheExp = createCacheExpression(\n context.cached.length,\n exp,\n isVNode,\n inVOnce\n );\n context.cached.push(cacheExp);\n return cacheExp;\n }\n };\n {\n context.filters = /* @__PURE__ */ new Set();\n }\n function addId(id) {\n const { identifiers } = context;\n if (identifiers[id] === void 0) {\n identifiers[id] = 0;\n }\n identifiers[id]++;\n }\n function removeId(id) {\n context.identifiers[id]--;\n }\n return context;\n}\nfunction transform(root, options) {\n const context = createTransformContext(root, options);\n traverseNode(root, context);\n if (options.hoistStatic) {\n cacheStatic(root, context);\n }\n if (!options.ssr) {\n createRootCodegen(root, context);\n }\n root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]);\n root.components = [...context.components];\n root.directives = [...context.directives];\n root.imports = context.imports;\n root.hoists = context.hoists;\n root.temps = context.temps;\n root.cached = context.cached;\n root.transformed = true;\n {\n root.filters = [...context.filters];\n }\n}\nfunction createRootCodegen(root, context) {\n const { helper } = context;\n const { children } = root;\n if (children.length === 1) {\n const singleElementRootChild = getSingleElementRoot(root);\n if (singleElementRootChild && singleElementRootChild.codegenNode) {\n const codegenNode = singleElementRootChild.codegenNode;\n if (codegenNode.type === 13) {\n convertToBlock(codegenNode, context);\n }\n root.codegenNode = codegenNode;\n } else {\n root.codegenNode = children[0];\n }\n } else if (children.length > 1) {\n let patchFlag = 64;\n if (children.filter((c) => c.type !== 3).length === 1) {\n patchFlag |= 2048;\n }\n root.codegenNode = createVNodeCall(\n context,\n helper(FRAGMENT),\n void 0,\n root.children,\n patchFlag,\n void 0,\n void 0,\n true,\n void 0,\n false\n );\n } else ;\n}\nfunction traverseChildren(parent, context) {\n let i = 0;\n const nodeRemoved = () => {\n i--;\n };\n for (; i < parent.children.length; i++) {\n const child = parent.children[i];\n if (shared.isString(child)) continue;\n context.grandParent = context.parent;\n context.parent = parent;\n context.childIndex = i;\n context.onNodeRemoved = nodeRemoved;\n traverseNode(child, context);\n }\n}\nfunction traverseNode(node, context) {\n context.currentNode = node;\n const { nodeTransforms } = context;\n const exitFns = [];\n for (let i2 = 0; i2 < nodeTransforms.length; i2++) {\n const onExit = nodeTransforms[i2](node, context);\n if (onExit) {\n if (shared.isArray(onExit)) {\n exitFns.push(...onExit);\n } else {\n exitFns.push(onExit);\n }\n }\n if (!context.currentNode) {\n return;\n } else {\n node = context.currentNode;\n }\n }\n switch (node.type) {\n case 3:\n if (!context.ssr) {\n context.helper(CREATE_COMMENT);\n }\n break;\n case 5:\n if (!context.ssr) {\n context.helper(TO_DISPLAY_STRING);\n }\n break;\n // for container types, further traverse downwards\n case 9:\n for (let i2 = 0; i2 < node.branches.length; i2++) {\n traverseNode(node.branches[i2], context);\n }\n break;\n case 10:\n case 11:\n case 1:\n case 0:\n traverseChildren(node, context);\n break;\n }\n context.currentNode = node;\n let i = exitFns.length;\n while (i--) {\n exitFns[i]();\n }\n}\nfunction createStructuralDirectiveTransform(name, fn) {\n const matches = shared.isString(name) ? (n) => n === name : (n) => name.test(n);\n return (node, context) => {\n if (node.type === 1) {\n const { props } = node;\n if (node.tagType === 3 && props.some(isVSlot)) {\n return;\n }\n const exitFns = [];\n for (let i = 0; i < props.length; i++) {\n const prop = props[i];\n if (prop.type === 7 && matches(prop.name)) {\n props.splice(i, 1);\n i--;\n const onExit = fn(node, prop, context);\n if (onExit) exitFns.push(onExit);\n }\n }\n return exitFns;\n }\n };\n}\n\nconst PURE_ANNOTATION = `/*@__PURE__*/`;\nconst aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;\nfunction createCodegenContext(ast, {\n mode = \"function\",\n prefixIdentifiers = mode === \"module\",\n sourceMap = false,\n filename = `template.vue.html`,\n scopeId = null,\n optimizeImports = false,\n runtimeGlobalName = `Vue`,\n runtimeModuleName = `vue`,\n ssrRuntimeModuleName = \"vue/server-renderer\",\n ssr = false,\n isTS = false,\n inSSR = false\n}) {\n const context = {\n mode,\n prefixIdentifiers,\n sourceMap,\n filename,\n scopeId,\n optimizeImports,\n runtimeGlobalName,\n runtimeModuleName,\n ssrRuntimeModuleName,\n ssr,\n isTS,\n inSSR,\n source: ast.source,\n code: ``,\n column: 1,\n line: 1,\n offset: 0,\n indentLevel: 0,\n pure: false,\n map: void 0,\n helper(key) {\n return `_${helperNameMap[key]}`;\n },\n push(code, newlineIndex = -2 /* None */, node) {\n context.code += code;\n if (context.map) {\n if (node) {\n let name;\n if (node.type === 4 && !node.isStatic) {\n const content = node.content.replace(/^_ctx\\./, \"\");\n if (content !== node.content && isSimpleIdentifier(content)) {\n name = content;\n }\n }\n if (node.loc.source) {\n addMapping(node.loc.start, name);\n }\n }\n if (newlineIndex === -3 /* Unknown */) {\n advancePositionWithMutation(context, code);\n } else {\n context.offset += code.length;\n if (newlineIndex === -2 /* None */) {\n context.column += code.length;\n } else {\n if (newlineIndex === -1 /* End */) {\n newlineIndex = code.length - 1;\n }\n context.line++;\n context.column = code.length - newlineIndex;\n }\n }\n if (node && node.loc !== locStub && node.loc.source) {\n addMapping(node.loc.end);\n }\n }\n },\n indent() {\n newline(++context.indentLevel);\n },\n deindent(withoutNewLine = false) {\n if (withoutNewLine) {\n --context.indentLevel;\n } else {\n newline(--context.indentLevel);\n }\n },\n newline() {\n newline(context.indentLevel);\n }\n };\n function newline(n) {\n context.push(\"\\n\" + ` `.repeat(n), 0 /* Start */);\n }\n function addMapping(loc, name = null) {\n const { _names, _mappings } = context.map;\n if (name !== null && !_names.has(name)) _names.add(name);\n _mappings.add({\n originalLine: loc.line,\n originalColumn: loc.column - 1,\n // source-map column is 0 based\n generatedLine: context.line,\n generatedColumn: context.column - 1,\n source: filename,\n name\n });\n }\n if (sourceMap) {\n context.map = new sourceMapJs.SourceMapGenerator();\n context.map.setSourceContent(filename, context.source);\n context.map._sources.add(filename);\n }\n return context;\n}\nfunction generate(ast, options = {}) {\n const context = createCodegenContext(ast, options);\n if (options.onContextCreated) options.onContextCreated(context);\n const {\n mode,\n push,\n prefixIdentifiers,\n indent,\n deindent,\n newline,\n scopeId,\n ssr\n } = context;\n const helpers = Array.from(ast.helpers);\n const hasHelpers = helpers.length > 0;\n const useWithBlock = !prefixIdentifiers && mode !== \"module\";\n const genScopeId = scopeId != null && mode === \"module\";\n const isSetupInlined = !!options.inline;\n const preambleContext = isSetupInlined ? createCodegenContext(ast, options) : context;\n if (mode === \"module\") {\n genModulePreamble(ast, preambleContext, genScopeId, isSetupInlined);\n } else {\n genFunctionPreamble(ast, preambleContext);\n }\n const functionName = ssr ? `ssrRender` : `render`;\n const args = ssr ? [\"_ctx\", \"_push\", \"_parent\", \"_attrs\"] : [\"_ctx\", \"_cache\"];\n if (options.bindingMetadata && !options.inline) {\n args.push(\"$props\", \"$setup\", \"$data\", \"$options\");\n }\n const signature = options.isTS ? args.map((arg) => `${arg}: any`).join(\",\") : args.join(\", \");\n if (isSetupInlined) {\n push(`(${signature}) => {`);\n } else {\n push(`function ${functionName}(${signature}) {`);\n }\n indent();\n if (useWithBlock) {\n push(`with (_ctx) {`);\n indent();\n if (hasHelpers) {\n push(\n `const { ${helpers.map(aliasHelper).join(\", \")} } = _Vue\n`,\n -1 /* End */\n );\n newline();\n }\n }\n if (ast.components.length) {\n genAssets(ast.components, \"component\", context);\n if (ast.directives.length || ast.temps > 0) {\n newline();\n }\n }\n if (ast.directives.length) {\n genAssets(ast.directives, \"directive\", context);\n if (ast.temps > 0) {\n newline();\n }\n }\n if (ast.filters && ast.filters.length) {\n newline();\n genAssets(ast.filters, \"filter\", context);\n newline();\n }\n if (ast.temps > 0) {\n push(`let `);\n for (let i = 0; i < ast.temps; i++) {\n push(`${i > 0 ? `, ` : ``}_temp${i}`);\n }\n }\n if (ast.components.length || ast.directives.length || ast.temps) {\n push(`\n`, 0 /* Start */);\n newline();\n }\n if (!ssr) {\n push(`return `);\n }\n if (ast.codegenNode) {\n genNode(ast.codegenNode, context);\n } else {\n push(`null`);\n }\n if (useWithBlock) {\n deindent();\n push(`}`);\n }\n deindent();\n push(`}`);\n return {\n ast,\n code: context.code,\n preamble: isSetupInlined ? preambleContext.code : ``,\n map: context.map ? context.map.toJSON() : void 0\n };\n}\nfunction genFunctionPreamble(ast, context) {\n const {\n ssr,\n prefixIdentifiers,\n push,\n newline,\n runtimeModuleName,\n runtimeGlobalName,\n ssrRuntimeModuleName\n } = context;\n const VueBinding = ssr ? `require(${JSON.stringify(runtimeModuleName)})` : runtimeGlobalName;\n const helpers = Array.from(ast.helpers);\n if (helpers.length > 0) {\n if (prefixIdentifiers) {\n push(\n `const { ${helpers.map(aliasHelper).join(\", \")} } = ${VueBinding}\n`,\n -1 /* End */\n );\n } else {\n push(`const _Vue = ${VueBinding}\n`, -1 /* End */);\n if (ast.hoists.length) {\n const staticHelpers = [\n CREATE_VNODE,\n CREATE_ELEMENT_VNODE,\n CREATE_COMMENT,\n CREATE_TEXT,\n CREATE_STATIC\n ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(\", \");\n push(`const { ${staticHelpers} } = _Vue\n`, -1 /* End */);\n }\n }\n }\n if (ast.ssrHelpers && ast.ssrHelpers.length) {\n push(\n `const { ${ast.ssrHelpers.map(aliasHelper).join(\", \")} } = require(\"${ssrRuntimeModuleName}\")\n`,\n -1 /* End */\n );\n }\n genHoists(ast.hoists, context);\n newline();\n push(`return `);\n}\nfunction genModulePreamble(ast, context, genScopeId, inline) {\n const {\n push,\n newline,\n optimizeImports,\n runtimeModuleName,\n ssrRuntimeModuleName\n } = context;\n if (ast.helpers.size) {\n const helpers = Array.from(ast.helpers);\n if (optimizeImports) {\n push(\n `import { ${helpers.map((s) => helperNameMap[s]).join(\", \")} } from ${JSON.stringify(runtimeModuleName)}\n`,\n -1 /* End */\n );\n push(\n `\n// Binding optimization for webpack code-split\nconst ${helpers.map((s) => `_${helperNameMap[s]} = ${helperNameMap[s]}`).join(\", \")}\n`,\n -1 /* End */\n );\n } else {\n push(\n `import { ${helpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(\", \")} } from ${JSON.stringify(runtimeModuleName)}\n`,\n -1 /* End */\n );\n }\n }\n if (ast.ssrHelpers && ast.ssrHelpers.length) {\n push(\n `import { ${ast.ssrHelpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(\", \")} } from \"${ssrRuntimeModuleName}\"\n`,\n -1 /* End */\n );\n }\n if (ast.imports.length) {\n genImports(ast.imports, context);\n newline();\n }\n genHoists(ast.hoists, context);\n newline();\n if (!inline) {\n push(`export `);\n }\n}\nfunction genAssets(assets, type, { helper, push, newline, isTS }) {\n const resolver = helper(\n type === \"filter\" ? RESOLVE_FILTER : type === \"component\" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE\n );\n for (let i = 0; i < assets.length; i++) {\n let id = assets[i];\n const maybeSelfReference = id.endsWith(\"__self\");\n if (maybeSelfReference) {\n id = id.slice(0, -6);\n }\n push(\n `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`\n );\n if (i < assets.length - 1) {\n newline();\n }\n }\n}\nfunction genHoists(hoists, context) {\n if (!hoists.length) {\n return;\n }\n context.pure = true;\n const { push, newline } = context;\n newline();\n for (let i = 0; i < hoists.length; i++) {\n const exp = hoists[i];\n if (exp) {\n push(`const _hoisted_${i + 1} = `);\n genNode(exp, context);\n newline();\n }\n }\n context.pure = false;\n}\nfunction genImports(importsOptions, context) {\n if (!importsOptions.length) {\n return;\n }\n importsOptions.forEach((imports) => {\n context.push(`import `);\n genNode(imports.exp, context);\n context.push(` from '${imports.path}'`);\n context.newline();\n });\n}\nfunction isText(n) {\n return shared.isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8;\n}\nfunction genNodeListAsArray(nodes, context) {\n const multilines = nodes.length > 3 || nodes.some((n) => shared.isArray(n) || !isText(n));\n context.push(`[`);\n multilines && context.indent();\n genNodeList(nodes, context, multilines);\n multilines && context.deindent();\n context.push(`]`);\n}\nfunction genNodeList(nodes, context, multilines = false, comma = true) {\n const { push, newline } = context;\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (shared.isString(node)) {\n push(node, -3 /* Unknown */);\n } else if (shared.isArray(node)) {\n genNodeListAsArray(node, context);\n } else {\n genNode(node, context);\n }\n if (i < nodes.length - 1) {\n if (multilines) {\n comma && push(\",\");\n newline();\n } else {\n comma && push(\", \");\n }\n }\n }\n}\nfunction genNode(node, context) {\n if (shared.isString(node)) {\n context.push(node, -3 /* Unknown */);\n return;\n }\n if (shared.isSymbol(node)) {\n context.push(context.helper(node));\n return;\n }\n switch (node.type) {\n case 1:\n case 9:\n case 11:\n assert(\n node.codegenNode != null,\n `Codegen node is missing for element/if/for node. Apply appropriate transforms first.`\n );\n genNode(node.codegenNode, context);\n break;\n case 2:\n genText(node, context);\n break;\n case 4:\n genExpression(node, context);\n break;\n case 5:\n genInterpolation(node, context);\n break;\n case 12:\n genNode(node.codegenNode, context);\n break;\n case 8:\n genCompoundExpression(node, context);\n break;\n case 3:\n genComment(node, context);\n break;\n case 13:\n genVNodeCall(node, context);\n break;\n case 14:\n genCallExpression(node, context);\n break;\n case 15:\n genObjectExpression(node, context);\n break;\n case 17:\n genArrayExpression(node, context);\n break;\n case 18:\n genFunctionExpression(node, context);\n break;\n case 19:\n genConditionalExpression(node, context);\n break;\n case 20:\n genCacheExpression(node, context);\n break;\n case 21:\n genNodeList(node.body, context, true, false);\n break;\n // SSR only types\n case 22:\n genTemplateLiteral(node, context);\n break;\n case 23:\n genIfStatement(node, context);\n break;\n case 24:\n genAssignmentExpression(node, context);\n break;\n case 25:\n genSequenceExpression(node, context);\n break;\n case 26:\n genReturnStatement(node, context);\n break;\n /* v8 ignore start */\n case 10:\n break;\n default:\n {\n assert(false, `unhandled codegen node type: ${node.type}`);\n const exhaustiveCheck = node;\n return exhaustiveCheck;\n }\n }\n}\nfunction genText(node, context) {\n context.push(JSON.stringify(node.content), -3 /* Unknown */, node);\n}\nfunction genExpression(node, context) {\n const { content, isStatic } = node;\n context.push(\n isStatic ? JSON.stringify(content) : content,\n -3 /* Unknown */,\n node\n );\n}\nfunction genInterpolation(node, context) {\n const { push, helper, pure } = context;\n if (pure) push(PURE_ANNOTATION);\n push(`${helper(TO_DISPLAY_STRING)}(`);\n genNode(node.content, context);\n push(`)`);\n}\nfunction genCompoundExpression(node, context) {\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (shared.isString(child)) {\n context.push(child, -3 /* Unknown */);\n } else {\n genNode(child, context);\n }\n }\n}\nfunction genExpressionAsPropertyKey(node, context) {\n const { push } = context;\n if (node.type === 8) {\n push(`[`);\n genCompoundExpression(node, context);\n push(`]`);\n } else if (node.isStatic) {\n const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content);\n push(text, -2 /* None */, node);\n } else {\n push(`[${node.content}]`, -3 /* Unknown */, node);\n }\n}\nfunction genComment(node, context) {\n const { push, helper, pure } = context;\n if (pure) {\n push(PURE_ANNOTATION);\n }\n push(\n `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`,\n -3 /* Unknown */,\n node\n );\n}\nfunction genVNodeCall(node, context) {\n const { push, helper, pure } = context;\n const {\n tag,\n props,\n children,\n patchFlag,\n dynamicProps,\n directives,\n isBlock,\n disableTracking,\n isComponent\n } = node;\n let patchFlagString;\n if (patchFlag) {\n {\n if (patchFlag < 0) {\n patchFlagString = patchFlag + ` /* ${shared.PatchFlagNames[patchFlag]} */`;\n } else {\n const flagNames = Object.keys(shared.PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => shared.PatchFlagNames[n]).join(`, `);\n patchFlagString = patchFlag + ` /* ${flagNames} */`;\n }\n }\n }\n if (directives) {\n push(helper(WITH_DIRECTIVES) + `(`);\n }\n if (isBlock) {\n push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);\n }\n if (pure) {\n push(PURE_ANNOTATION);\n }\n const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent);\n push(helper(callHelper) + `(`, -2 /* None */, node);\n genNodeList(\n genNullableArgs([tag, props, children, patchFlagString, dynamicProps]),\n context\n );\n push(`)`);\n if (isBlock) {\n push(`)`);\n }\n if (directives) {\n push(`, `);\n genNode(directives, context);\n push(`)`);\n }\n}\nfunction genNullableArgs(args) {\n let i = args.length;\n while (i--) {\n if (args[i] != null) break;\n }\n return args.slice(0, i + 1).map((arg) => arg || `null`);\n}\nfunction genCallExpression(node, context) {\n const { push, helper, pure } = context;\n const callee = shared.isString(node.callee) ? node.callee : helper(node.callee);\n if (pure) {\n push(PURE_ANNOTATION);\n }\n push(callee + `(`, -2 /* None */, node);\n genNodeList(node.arguments, context);\n push(`)`);\n}\nfunction genObjectExpression(node, context) {\n const { push, indent, deindent, newline } = context;\n const { properties } = node;\n if (!properties.length) {\n push(`{}`, -2 /* None */, node);\n return;\n }\n const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);\n push(multilines ? `{` : `{ `);\n multilines && indent();\n for (let i = 0; i < properties.length; i++) {\n const { key, value } = properties[i];\n genExpressionAsPropertyKey(key, context);\n push(`: `);\n genNode(value, context);\n if (i < properties.length - 1) {\n push(`,`);\n newline();\n }\n }\n multilines && deindent();\n push(multilines ? `}` : ` }`);\n}\nfunction genArrayExpression(node, context) {\n genNodeListAsArray(node.elements, context);\n}\nfunction genFunctionExpression(node, context) {\n const { push, indent, deindent } = context;\n const { params, returns, body, newline, isSlot } = node;\n if (isSlot) {\n push(`_${helperNameMap[WITH_CTX]}(`);\n }\n push(`(`, -2 /* None */, node);\n if (shared.isArray(params)) {\n genNodeList(params, context);\n } else if (params) {\n genNode(params, context);\n }\n push(`) => `);\n if (newline || body) {\n push(`{`);\n indent();\n }\n if (returns) {\n if (newline) {\n push(`return `);\n }\n if (shared.isArray(returns)) {\n genNodeListAsArray(returns, context);\n } else {\n genNode(returns, context);\n }\n } else if (body) {\n genNode(body, context);\n }\n if (newline || body) {\n deindent();\n push(`}`);\n }\n if (isSlot) {\n if (node.isNonScopedSlot) {\n push(`, undefined, true`);\n }\n push(`)`);\n }\n}\nfunction genConditionalExpression(node, context) {\n const { test, consequent, alternate, newline: needNewline } = node;\n const { push, indent, deindent, newline } = context;\n if (test.type === 4) {\n const needsParens = !isSimpleIdentifier(test.content);\n needsParens && push(`(`);\n genExpression(test, context);\n needsParens && push(`)`);\n } else {\n push(`(`);\n genNode(test, context);\n push(`)`);\n }\n needNewline && indent();\n context.indentLevel++;\n needNewline || push(` `);\n push(`? `);\n genNode(consequent, context);\n context.indentLevel--;\n needNewline && newline();\n needNewline || push(` `);\n push(`: `);\n const isNested = alternate.type === 19;\n if (!isNested) {\n context.indentLevel++;\n }\n genNode(alternate, context);\n if (!isNested) {\n context.indentLevel--;\n }\n needNewline && deindent(\n true\n /* without newline */\n );\n}\nfunction genCacheExpression(node, context) {\n const { push, helper, indent, deindent, newline } = context;\n const { needPauseTracking, needArraySpread } = node;\n if (needArraySpread) {\n push(`[...(`);\n }\n push(`_cache[${node.index}] || (`);\n if (needPauseTracking) {\n indent();\n push(`${helper(SET_BLOCK_TRACKING)}(-1`);\n if (node.inVOnce) push(`, true`);\n push(`),`);\n newline();\n push(`(`);\n }\n push(`_cache[${node.index}] = `);\n genNode(node.value, context);\n if (needPauseTracking) {\n push(`).cacheIndex = ${node.index},`);\n newline();\n push(`${helper(SET_BLOCK_TRACKING)}(1),`);\n newline();\n push(`_cache[${node.index}]`);\n deindent();\n }\n push(`)`);\n if (needArraySpread) {\n push(`)]`);\n }\n}\nfunction genTemplateLiteral(node, context) {\n const { push, indent, deindent } = context;\n push(\"`\");\n const l = node.elements.length;\n const multilines = l > 3;\n for (let i = 0; i < l; i++) {\n const e = node.elements[i];\n if (shared.isString(e)) {\n push(e.replace(/(`|\\$|\\\\)/g, \"\\\\$1\"), -3 /* Unknown */);\n } else {\n push(\"${\");\n if (multilines) indent();\n genNode(e, context);\n if (multilines) deindent();\n push(\"}\");\n }\n }\n push(\"`\");\n}\nfunction genIfStatement(node, context) {\n const { push, indent, deindent } = context;\n const { test, consequent, alternate } = node;\n push(`if (`);\n genNode(test, context);\n push(`) {`);\n indent();\n genNode(consequent, context);\n deindent();\n push(`}`);\n if (alternate) {\n push(` else `);\n if (alternate.type === 23) {\n genIfStatement(alternate, context);\n } else {\n push(`{`);\n indent();\n genNode(alternate, context);\n deindent();\n push(`}`);\n }\n }\n}\nfunction genAssignmentExpression(node, context) {\n genNode(node.left, context);\n context.push(` = `);\n genNode(node.right, context);\n}\nfunction genSequenceExpression(node, context) {\n context.push(`(`);\n genNodeList(node.expressions, context);\n context.push(`)`);\n}\nfunction genReturnStatement({ returns }, context) {\n context.push(`return `);\n if (shared.isArray(returns)) {\n genNodeListAsArray(returns, context);\n } else {\n genNode(returns, context);\n }\n}\n\nconst isLiteralWhitelisted = /* @__PURE__ */ shared.makeMap(\"true,false,null,this\");\nconst transformExpression = (node, context) => {\n if (node.type === 5) {\n node.content = processExpression(\n node.content,\n context\n );\n } else if (node.type === 1) {\n const memo = findDir(node, \"memo\");\n for (let i = 0; i < node.props.length; i++) {\n const dir = node.props[i];\n if (dir.type === 7 && dir.name !== \"for\") {\n const exp = dir.exp;\n const arg = dir.arg;\n if (exp && exp.type === 4 && !(dir.name === \"on\" && arg) && // key has been processed in transformFor(vMemo + vFor)\n !(memo && arg && arg.type === 4 && arg.content === \"key\")) {\n dir.exp = processExpression(\n exp,\n context,\n // slot args must be processed as function params\n dir.name === \"slot\"\n );\n }\n if (arg && arg.type === 4 && !arg.isStatic) {\n dir.arg = processExpression(arg, context);\n }\n }\n }\n }\n};\nfunction processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) {\n if (!context.prefixIdentifiers || !node.content.trim()) {\n return node;\n }\n const { inline, bindingMetadata } = context;\n const rewriteIdentifier = (raw, parent, id) => {\n const type = shared.hasOwn(bindingMetadata, raw) && bindingMetadata[raw];\n if (inline) {\n const isAssignmentLVal = parent && parent.type === \"AssignmentExpression\" && parent.left === id;\n const isUpdateArg = parent && parent.type === \"UpdateExpression\" && parent.argument === id;\n const isDestructureAssignment = parent && isInDestructureAssignment(parent, parentStack);\n const isNewExpression = parent && isInNewExpression(parentStack);\n const wrapWithUnref = (raw2) => {\n const wrapped = `${context.helperString(UNREF)}(${raw2})`;\n return isNewExpression ? `(${wrapped})` : wrapped;\n };\n if (isConst(type) || type === \"setup-reactive-const\" || localVars[raw]) {\n return raw;\n } else if (type === \"setup-ref\") {\n return `${raw}.value`;\n } else if (type === \"setup-maybe-ref\") {\n return isAssignmentLVal || isUpdateArg || isDestructureAssignment ? `${raw}.value` : wrapWithUnref(raw);\n } else if (type === \"setup-let\") {\n if (isAssignmentLVal) {\n const { right: rVal, operator } = parent;\n const rExp = rawExp.slice(rVal.start - 1, rVal.end - 1);\n const rExpString = stringifyExpression(\n processExpression(\n createSimpleExpression(rExp, false),\n context,\n false,\n false,\n knownIds\n )\n );\n return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore\n` : ``} ? ${raw}.value ${operator} ${rExpString} : ${raw}`;\n } else if (isUpdateArg) {\n id.start = parent.start;\n id.end = parent.end;\n const { prefix: isPrefix, operator } = parent;\n const prefix = isPrefix ? operator : ``;\n const postfix = isPrefix ? `` : operator;\n return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore\n` : ``} ? ${prefix}${raw}.value${postfix} : ${prefix}${raw}${postfix}`;\n } else if (isDestructureAssignment) {\n return raw;\n } else {\n return wrapWithUnref(raw);\n }\n } else if (type === \"props\") {\n return shared.genPropsAccessExp(raw);\n } else if (type === \"props-aliased\") {\n return shared.genPropsAccessExp(bindingMetadata.__propsAliases[raw]);\n }\n } else {\n if (type && type.startsWith(\"setup\") || type === \"literal-const\") {\n return `$setup.${raw}`;\n } else if (type === \"props-aliased\") {\n return `$props['${bindingMetadata.__propsAliases[raw]}']`;\n } else if (type) {\n return `$${type}.${raw}`;\n }\n }\n return `_ctx.${raw}`;\n };\n const rawExp = node.content;\n let ast = node.ast;\n if (ast === false) {\n return node;\n }\n if (ast === null || !ast && isSimpleIdentifier(rawExp)) {\n const isScopeVarReference = context.identifiers[rawExp];\n const isAllowedGlobal = shared.isGloballyAllowed(rawExp);\n const isLiteral = isLiteralWhitelisted(rawExp);\n if (!asParams && !isScopeVarReference && !isLiteral && (!isAllowedGlobal || bindingMetadata[rawExp])) {\n if (isConst(bindingMetadata[rawExp])) {\n node.constType = 1;\n }\n node.content = rewriteIdentifier(rawExp);\n } else if (!isScopeVarReference) {\n if (isLiteral) {\n node.constType = 3;\n } else {\n node.constType = 2;\n }\n }\n return node;\n }\n if (!ast) {\n const source = asRawStatements ? ` ${rawExp} ` : `(${rawExp})${asParams ? `=>{}` : ``}`;\n try {\n ast = parser.parseExpression(source, {\n sourceType: \"module\",\n plugins: context.expressionPlugins\n });\n } catch (e) {\n context.onError(\n createCompilerError(\n 46,\n node.loc,\n void 0,\n e.message\n )\n );\n return node;\n }\n }\n const ids = [];\n const parentStack = [];\n const knownIds = Object.create(context.identifiers);\n walkIdentifiers(\n ast,\n (node2, parent, _, isReferenced, isLocal) => {\n if (isStaticPropertyKey(node2, parent)) {\n return;\n }\n if (node2.name.startsWith(\"_filter_\")) {\n return;\n }\n const needPrefix = isReferenced && canPrefix(node2);\n if (needPrefix && !isLocal) {\n if (isStaticProperty(parent) && parent.shorthand) {\n node2.prefix = `${node2.name}: `;\n }\n node2.name = rewriteIdentifier(node2.name, parent, node2);\n ids.push(node2);\n } else {\n if (!(needPrefix && isLocal) && (!parent || parent.type !== \"CallExpression\" && parent.type !== \"NewExpression\" && parent.type !== \"MemberExpression\")) {\n node2.isConstant = true;\n }\n ids.push(node2);\n }\n },\n true,\n // invoke on ALL identifiers\n parentStack,\n knownIds\n );\n const children = [];\n ids.sort((a, b) => a.start - b.start);\n ids.forEach((id, i) => {\n const start = id.start - 1;\n const end = id.end - 1;\n const last = ids[i - 1];\n const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);\n if (leadingText.length || id.prefix) {\n children.push(leadingText + (id.prefix || ``));\n }\n const source = rawExp.slice(start, end);\n children.push(\n createSimpleExpression(\n id.name,\n false,\n {\n start: advancePositionWithClone(node.loc.start, source, start),\n end: advancePositionWithClone(node.loc.start, source, end),\n source\n },\n id.isConstant ? 3 : 0\n )\n );\n if (i === ids.length - 1 && end < rawExp.length) {\n children.push(rawExp.slice(end));\n }\n });\n let ret;\n if (children.length) {\n ret = createCompoundExpression(children, node.loc);\n ret.ast = ast;\n } else {\n ret = node;\n ret.constType = 3;\n }\n ret.identifiers = Object.keys(knownIds);\n return ret;\n}\nfunction canPrefix(id) {\n if (shared.isGloballyAllowed(id.name)) {\n return false;\n }\n if (id.name === \"require\") {\n return false;\n }\n return true;\n}\nfunction stringifyExpression(exp) {\n if (shared.isString(exp)) {\n return exp;\n } else if (exp.type === 4) {\n return exp.content;\n } else {\n return exp.children.map(stringifyExpression).join(\"\");\n }\n}\nfunction isConst(type) {\n return type === \"setup-const\" || type === \"literal-const\";\n}\n\nconst transformIf = createStructuralDirectiveTransform(\n /^(?:if|else|else-if)$/,\n (node, dir, context) => {\n return processIf(node, dir, context, (ifNode, branch, isRoot) => {\n const siblings = context.parent.children;\n let i = siblings.indexOf(ifNode);\n let key = 0;\n while (i-- >= 0) {\n const sibling = siblings[i];\n if (sibling && sibling.type === 9) {\n key += sibling.branches.length;\n }\n }\n return () => {\n if (isRoot) {\n ifNode.codegenNode = createCodegenNodeForBranch(\n branch,\n key,\n context\n );\n } else {\n const parentCondition = getParentCondition(ifNode.codegenNode);\n parentCondition.alternate = createCodegenNodeForBranch(\n branch,\n key + ifNode.branches.length - 1,\n context\n );\n }\n };\n });\n }\n);\nfunction processIf(node, dir, context, processCodegen) {\n if (dir.name !== \"else\" && (!dir.exp || !dir.exp.content.trim())) {\n const loc = dir.exp ? dir.exp.loc : node.loc;\n context.onError(\n createCompilerError(28, dir.loc)\n );\n dir.exp = createSimpleExpression(`true`, false, loc);\n }\n if (context.prefixIdentifiers && dir.exp) {\n dir.exp = processExpression(dir.exp, context);\n }\n if (dir.name === \"if\") {\n const branch = createIfBranch(node, dir);\n const ifNode = {\n type: 9,\n loc: cloneLoc(node.loc),\n branches: [branch]\n };\n context.replaceNode(ifNode);\n if (processCodegen) {\n return processCodegen(ifNode, branch, true);\n }\n } else {\n const siblings = context.parent.children;\n const comments = [];\n let i = siblings.indexOf(node);\n while (i-- >= -1) {\n const sibling = siblings[i];\n if (sibling && isCommentOrWhitespace(sibling)) {\n context.removeNode(sibling);\n if (sibling.type === 3) {\n comments.unshift(sibling);\n }\n continue;\n }\n if (sibling && sibling.type === 9) {\n if ((dir.name === \"else-if\" || dir.name === \"else\") && sibling.branches[sibling.branches.length - 1].condition === void 0) {\n context.onError(\n createCompilerError(30, node.loc)\n );\n }\n context.removeNode();\n const branch = createIfBranch(node, dir);\n if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition>\n !(context.parent && context.parent.type === 1 && (context.parent.tag === \"transition\" || context.parent.tag === \"Transition\"))) {\n branch.children = [...comments, ...branch.children];\n }\n {\n const key = branch.userKey;\n if (key) {\n sibling.branches.forEach(({ userKey }) => {\n if (isSameKey(userKey, key)) {\n context.onError(\n createCompilerError(\n 29,\n branch.userKey.loc\n )\n );\n }\n });\n }\n }\n sibling.branches.push(branch);\n const onExit = processCodegen && processCodegen(sibling, branch, false);\n traverseNode(branch, context);\n if (onExit) onExit();\n context.currentNode = null;\n } else {\n context.onError(\n createCompilerError(30, node.loc)\n );\n }\n break;\n }\n }\n}\nfunction createIfBranch(node, dir) {\n const isTemplateIf = node.tagType === 3;\n return {\n type: 10,\n loc: node.loc,\n condition: dir.name === \"else\" ? void 0 : dir.exp,\n children: isTemplateIf && !findDir(node, \"for\") ? node.children : [node],\n userKey: findProp(node, `key`),\n isTemplateIf\n };\n}\nfunction createCodegenNodeForBranch(branch, keyIndex, context) {\n if (branch.condition) {\n return createConditionalExpression(\n branch.condition,\n createChildrenCodegenNode(branch, keyIndex, context),\n // make sure to pass in asBlock: true so that the comment node call\n // closes the current block.\n createCallExpression(context.helper(CREATE_COMMENT), [\n '\"v-if\"' ,\n \"true\"\n ])\n );\n } else {\n return createChildrenCodegenNode(branch, keyIndex, context);\n }\n}\nfunction createChildrenCodegenNode(branch, keyIndex, context) {\n const { helper } = context;\n const keyProperty = createObjectProperty(\n `key`,\n createSimpleExpression(\n `${keyIndex}`,\n false,\n locStub,\n 2\n )\n );\n const { children } = branch;\n const firstChild = children[0];\n const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1;\n if (needFragmentWrapper) {\n if (children.length === 1 && firstChild.type === 11) {\n const vnodeCall = firstChild.codegenNode;\n injectProp(vnodeCall, keyProperty, context);\n return vnodeCall;\n } else {\n let patchFlag = 64;\n if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {\n patchFlag |= 2048;\n }\n return createVNodeCall(\n context,\n helper(FRAGMENT),\n createObjectExpression([keyProperty]),\n children,\n patchFlag,\n void 0,\n void 0,\n true,\n false,\n false,\n branch.loc\n );\n }\n } else {\n const ret = firstChild.codegenNode;\n const vnodeCall = getMemoedVNodeCall(ret);\n if (vnodeCall.type === 13) {\n convertToBlock(vnodeCall, context);\n }\n injectProp(vnodeCall, keyProperty, context);\n return ret;\n }\n}\nfunction isSameKey(a, b) {\n if (!a || a.type !== b.type) {\n return false;\n }\n if (a.type === 6) {\n if (a.value.content !== b.value.content) {\n return false;\n }\n } else {\n const exp = a.exp;\n const branchExp = b.exp;\n if (exp.type !== branchExp.type) {\n return false;\n }\n if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {\n return false;\n }\n }\n return true;\n}\nfunction getParentCondition(node) {\n while (true) {\n if (node.type === 19) {\n if (node.alternate.type === 19) {\n node = node.alternate;\n } else {\n return node;\n }\n } else if (node.type === 20) {\n node = node.value;\n }\n }\n}\n\nconst transformFor = createStructuralDirectiveTransform(\n \"for\",\n (node, dir, context) => {\n const { helper, removeHelper } = context;\n return processFor(node, dir, context, (forNode) => {\n const renderExp = createCallExpression(helper(RENDER_LIST), [\n forNode.source\n ]);\n const isTemplate = isTemplateNode(node);\n const memo = findDir(node, \"memo\");\n const keyProp = findProp(node, `key`, false, true);\n const isDirKey = keyProp && keyProp.type === 7;\n let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);\n if (memo && keyExp && isDirKey) {\n {\n keyProp.exp = keyExp = processExpression(\n keyExp,\n context\n );\n }\n }\n const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;\n if (isTemplate) {\n if (memo) {\n memo.exp = processExpression(\n memo.exp,\n context\n );\n }\n if (keyProperty && keyProp.type !== 6) {\n keyProperty.value = processExpression(\n keyProperty.value,\n context\n );\n }\n }\n const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;\n const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;\n forNode.codegenNode = createVNodeCall(\n context,\n helper(FRAGMENT),\n void 0,\n renderExp,\n fragmentFlag,\n void 0,\n void 0,\n true,\n !isStableFragment,\n false,\n node.loc\n );\n return () => {\n let childBlock;\n const { children } = forNode;\n if (isTemplate) {\n node.children.some((c) => {\n if (c.type === 1) {\n const key = findProp(c, \"key\");\n if (key) {\n context.onError(\n createCompilerError(\n 33,\n key.loc\n )\n );\n return true;\n }\n }\n });\n }\n const needFragmentWrapper = children.length !== 1 || children[0].type !== 1;\n const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;\n if (slotOutlet) {\n childBlock = slotOutlet.codegenNode;\n if (isTemplate && keyProperty) {\n injectProp(childBlock, keyProperty, context);\n }\n } else if (needFragmentWrapper) {\n childBlock = createVNodeCall(\n context,\n helper(FRAGMENT),\n keyProperty ? createObjectExpression([keyProperty]) : void 0,\n node.children,\n 64,\n void 0,\n void 0,\n true,\n void 0,\n false\n );\n } else {\n childBlock = children[0].codegenNode;\n if (isTemplate && keyProperty) {\n injectProp(childBlock, keyProperty, context);\n }\n if (childBlock.isBlock !== !isStableFragment) {\n if (childBlock.isBlock) {\n removeHelper(OPEN_BLOCK);\n removeHelper(\n getVNodeBlockHelper(context.inSSR, childBlock.isComponent)\n );\n } else {\n removeHelper(\n getVNodeHelper(context.inSSR, childBlock.isComponent)\n );\n }\n }\n childBlock.isBlock = !isStableFragment;\n if (childBlock.isBlock) {\n helper(OPEN_BLOCK);\n helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));\n } else {\n helper(getVNodeHelper(context.inSSR, childBlock.isComponent));\n }\n }\n if (memo) {\n const loop = createFunctionExpression(\n createForLoopParams(forNode.parseResult, [\n createSimpleExpression(`_cached`)\n ])\n );\n loop.body = createBlockStatement([\n createCompoundExpression([`const _memo = (`, memo.exp, `)`]),\n createCompoundExpression([\n `if (_cached`,\n ...keyExp ? [` && _cached.key === `, keyExp] : [],\n ` && ${context.helperString(\n IS_MEMO_SAME\n )}(_cached, _memo)) return _cached`\n ]),\n createCompoundExpression([`const _item = `, childBlock]),\n createSimpleExpression(`_item.memo = _memo`),\n createSimpleExpression(`return _item`)\n ]);\n renderExp.arguments.push(\n loop,\n createSimpleExpression(`_cache`),\n createSimpleExpression(String(context.cached.length))\n );\n context.cached.push(null);\n } else {\n renderExp.arguments.push(\n createFunctionExpression(\n createForLoopParams(forNode.parseResult),\n childBlock,\n true\n )\n );\n }\n };\n });\n }\n);\nfunction processFor(node, dir, context, processCodegen) {\n if (!dir.exp) {\n context.onError(\n createCompilerError(31, dir.loc)\n );\n return;\n }\n const parseResult = dir.forParseResult;\n if (!parseResult) {\n context.onError(\n createCompilerError(32, dir.loc)\n );\n return;\n }\n finalizeForParseResult(parseResult, context);\n const { addIdentifiers, removeIdentifiers, scopes } = context;\n const { source, value, key, index } = parseResult;\n const forNode = {\n type: 11,\n loc: dir.loc,\n source,\n valueAlias: value,\n keyAlias: key,\n objectIndexAlias: index,\n parseResult,\n children: isTemplateNode(node) ? node.children : [node]\n };\n context.replaceNode(forNode);\n scopes.vFor++;\n if (context.prefixIdentifiers) {\n value && addIdentifiers(value);\n key && addIdentifiers(key);\n index && addIdentifiers(index);\n }\n const onExit = processCodegen && processCodegen(forNode);\n return () => {\n scopes.vFor--;\n if (context.prefixIdentifiers) {\n value && removeIdentifiers(value);\n key && removeIdentifiers(key);\n index && removeIdentifiers(index);\n }\n if (onExit) onExit();\n };\n}\nfunction finalizeForParseResult(result, context) {\n if (result.finalized) return;\n if (context.prefixIdentifiers) {\n result.source = processExpression(\n result.source,\n context\n );\n if (result.key) {\n result.key = processExpression(\n result.key,\n context,\n true\n );\n }\n if (result.index) {\n result.index = processExpression(\n result.index,\n context,\n true\n );\n }\n if (result.value) {\n result.value = processExpression(\n result.value,\n context,\n true\n );\n }\n }\n result.finalized = true;\n}\nfunction createForLoopParams({ value, key, index }, memoArgs = []) {\n return createParamsList([value, key, index, ...memoArgs]);\n}\nfunction createParamsList(args) {\n let i = args.length;\n while (i--) {\n if (args[i]) break;\n }\n return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false));\n}\n\nconst defaultFallback = createSimpleExpression(`undefined`, false);\nconst trackSlotScopes = (node, context) => {\n if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) {\n const vSlot = findDir(node, \"slot\");\n if (vSlot) {\n const slotProps = vSlot.exp;\n if (context.prefixIdentifiers) {\n slotProps && context.addIdentifiers(slotProps);\n }\n context.scopes.vSlot++;\n return () => {\n if (context.prefixIdentifiers) {\n slotProps && context.removeIdentifiers(slotProps);\n }\n context.scopes.vSlot--;\n };\n }\n }\n};\nconst trackVForSlotScopes = (node, context) => {\n let vFor;\n if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, \"for\"))) {\n const result = vFor.forParseResult;\n if (result) {\n finalizeForParseResult(result, context);\n const { value, key, index } = result;\n const { addIdentifiers, removeIdentifiers } = context;\n value && addIdentifiers(value);\n key && addIdentifiers(key);\n index && addIdentifiers(index);\n return () => {\n value && removeIdentifiers(value);\n key && removeIdentifiers(key);\n index && removeIdentifiers(index);\n };\n }\n }\n};\nconst buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(\n props,\n children,\n false,\n true,\n children.length ? children[0].loc : loc\n);\nfunction buildSlots(node, context, buildSlotFn = buildClientSlotFn) {\n context.helper(WITH_CTX);\n const { children, loc } = node;\n const slotsProperties = [];\n const dynamicSlots = [];\n let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;\n if (!context.ssr && context.prefixIdentifiers) {\n hasDynamicSlots = node.props.some(\n (prop) => isVSlot(prop) && (hasScopeRef(prop.arg, context.identifiers) || hasScopeRef(prop.exp, context.identifiers))\n ) || children.some((child) => hasScopeRef(child, context.identifiers));\n }\n const onComponentSlot = findDir(node, \"slot\", true);\n if (onComponentSlot) {\n const { arg, exp } = onComponentSlot;\n if (arg && !isStaticExp(arg)) {\n hasDynamicSlots = true;\n }\n slotsProperties.push(\n createObjectProperty(\n arg || createSimpleExpression(\"default\", true),\n buildSlotFn(exp, void 0, children, loc)\n )\n );\n }\n let hasTemplateSlots = false;\n let hasNamedDefaultSlot = false;\n const implicitDefaultChildren = [];\n const seenSlotNames = /* @__PURE__ */ new Set();\n let conditionalBranchIndex = 0;\n for (let i = 0; i < children.length; i++) {\n const slotElement = children[i];\n let slotDir;\n if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, \"slot\", true))) {\n if (slotElement.type !== 3) {\n implicitDefaultChildren.push(slotElement);\n }\n continue;\n }\n if (onComponentSlot) {\n context.onError(\n createCompilerError(37, slotDir.loc)\n );\n break;\n }\n hasTemplateSlots = true;\n const { children: slotChildren, loc: slotLoc } = slotElement;\n const {\n arg: slotName = createSimpleExpression(`default`, true),\n exp: slotProps,\n loc: dirLoc\n } = slotDir;\n let staticSlotName;\n if (isStaticExp(slotName)) {\n staticSlotName = slotName ? slotName.content : `default`;\n } else {\n hasDynamicSlots = true;\n }\n const vFor = findDir(slotElement, \"for\");\n const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc);\n let vIf;\n let vElse;\n if (vIf = findDir(slotElement, \"if\")) {\n hasDynamicSlots = true;\n dynamicSlots.push(\n createConditionalExpression(\n vIf.exp,\n buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++),\n defaultFallback\n )\n );\n } else if (vElse = findDir(\n slotElement,\n /^else(?:-if)?$/,\n true\n /* allowEmpty */\n )) {\n let j = i;\n let prev;\n while (j--) {\n prev = children[j];\n if (!isCommentOrWhitespace(prev)) {\n break;\n }\n }\n if (prev && isTemplateNode(prev) && findDir(prev, /^(?:else-)?if$/)) {\n let conditional = dynamicSlots[dynamicSlots.length - 1];\n while (conditional.alternate.type === 19) {\n conditional = conditional.alternate;\n }\n conditional.alternate = vElse.exp ? createConditionalExpression(\n vElse.exp,\n buildDynamicSlot(\n slotName,\n slotFunction,\n conditionalBranchIndex++\n ),\n defaultFallback\n ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);\n } else {\n context.onError(\n createCompilerError(30, vElse.loc)\n );\n }\n } else if (vFor) {\n hasDynamicSlots = true;\n const parseResult = vFor.forParseResult;\n if (parseResult) {\n finalizeForParseResult(parseResult, context);\n dynamicSlots.push(\n createCallExpression(context.helper(RENDER_LIST), [\n parseResult.source,\n createFunctionExpression(\n createForLoopParams(parseResult),\n buildDynamicSlot(slotName, slotFunction),\n true\n )\n ])\n );\n } else {\n context.onError(\n createCompilerError(\n 32,\n vFor.loc\n )\n );\n }\n } else {\n if (staticSlotName) {\n if (seenSlotNames.has(staticSlotName)) {\n context.onError(\n createCompilerError(\n 38,\n dirLoc\n )\n );\n continue;\n }\n seenSlotNames.add(staticSlotName);\n if (staticSlotName === \"default\") {\n hasNamedDefaultSlot = true;\n }\n }\n slotsProperties.push(createObjectProperty(slotName, slotFunction));\n }\n }\n if (!onComponentSlot) {\n const buildDefaultSlotProperty = (props, children2) => {\n const fn = buildSlotFn(props, void 0, children2, loc);\n if (context.compatConfig) {\n fn.isNonScopedSlot = true;\n }\n return createObjectProperty(`default`, fn);\n };\n if (!hasTemplateSlots) {\n slotsProperties.push(buildDefaultSlotProperty(void 0, children));\n } else if (implicitDefaultChildren.length && // #3766\n // with whitespace: 'preserve', whitespaces between slots will end up in\n // implicitDefaultChildren. Ignore if all implicit children are whitespaces.\n !implicitDefaultChildren.every(isWhitespaceText)) {\n if (hasNamedDefaultSlot) {\n context.onError(\n createCompilerError(\n 39,\n implicitDefaultChildren[0].loc\n )\n );\n } else {\n slotsProperties.push(\n buildDefaultSlotProperty(void 0, implicitDefaultChildren)\n );\n }\n }\n }\n const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1;\n let slots = createObjectExpression(\n slotsProperties.concat(\n createObjectProperty(\n `_`,\n // 2 = compiled but dynamic = can skip normalization, but must run diff\n // 1 = compiled and static = can skip normalization AND diff as optimized\n createSimpleExpression(\n slotFlag + (` /* ${shared.slotFlagsText[slotFlag]} */` ),\n false\n )\n )\n ),\n loc\n );\n if (dynamicSlots.length) {\n slots = createCallExpression(context.helper(CREATE_SLOTS), [\n slots,\n createArrayExpression(dynamicSlots)\n ]);\n }\n return {\n slots,\n hasDynamicSlots\n };\n}\nfunction buildDynamicSlot(name, fn, index) {\n const props = [\n createObjectProperty(`name`, name),\n createObjectProperty(`fn`, fn)\n ];\n if (index != null) {\n props.push(\n createObjectProperty(`key`, createSimpleExpression(String(index), true))\n );\n }\n return createObjectExpression(props);\n}\nfunction hasForwardedSlots(children) {\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n switch (child.type) {\n case 1:\n if (child.tagType === 2 || hasForwardedSlots(child.children)) {\n return true;\n }\n break;\n case 9:\n if (hasForwardedSlots(child.branches)) return true;\n break;\n case 10:\n case 11:\n if (hasForwardedSlots(child.children)) return true;\n break;\n }\n }\n return false;\n}\n\nconst directiveImportMap = /* @__PURE__ */ new WeakMap();\nconst transformElement = (node, context) => {\n return function postTransformElement() {\n node = context.currentNode;\n if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) {\n return;\n }\n const { tag, props } = node;\n const isComponent = node.tagType === 1;\n let vnodeTag = isComponent ? resolveComponentType(node, context) : `\"${tag}\"`;\n const isDynamicComponent = shared.isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;\n let vnodeProps;\n let vnodeChildren;\n let patchFlag = 0;\n let vnodeDynamicProps;\n let dynamicPropNames;\n let vnodeDirectives;\n let shouldUseBlock = (\n // dynamic component may resolve to plain elements\n isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block\n // updates inside get proper isSVG flag at runtime. (#639, #643)\n // This is technically web-specific, but splitting the logic out of core\n // leads to too much unnecessary complexity.\n (tag === \"svg\" || tag === \"foreignObject\" || tag === \"math\")\n );\n if (props.length > 0) {\n const propsBuildResult = buildProps(\n node,\n context,\n void 0,\n isComponent,\n isDynamicComponent\n );\n vnodeProps = propsBuildResult.props;\n patchFlag = propsBuildResult.patchFlag;\n dynamicPropNames = propsBuildResult.dynamicPropNames;\n const directives = propsBuildResult.directives;\n vnodeDirectives = directives && directives.length ? createArrayExpression(\n directives.map((dir) => buildDirectiveArgs(dir, context))\n ) : void 0;\n if (propsBuildResult.shouldUseBlock) {\n shouldUseBlock = true;\n }\n }\n if (node.children.length > 0) {\n if (vnodeTag === KEEP_ALIVE) {\n shouldUseBlock = true;\n patchFlag |= 1024;\n if (node.children.length > 1) {\n context.onError(\n createCompilerError(47, {\n start: node.children[0].loc.start,\n end: node.children[node.children.length - 1].loc.end,\n source: \"\"\n })\n );\n }\n }\n const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling\n vnodeTag !== TELEPORT && // explained above.\n vnodeTag !== KEEP_ALIVE;\n if (shouldBuildAsSlots) {\n const { slots, hasDynamicSlots } = buildSlots(node, context);\n vnodeChildren = slots;\n if (hasDynamicSlots) {\n patchFlag |= 1024;\n }\n } else if (node.children.length === 1 && vnodeTag !== TELEPORT) {\n const child = node.children[0];\n const type = child.type;\n const hasDynamicTextChild = type === 5 || type === 8;\n if (hasDynamicTextChild && getConstantType(child, context) === 0) {\n patchFlag |= 1;\n }\n if (hasDynamicTextChild || type === 2) {\n vnodeChildren = child;\n } else {\n vnodeChildren = node.children;\n }\n } else {\n vnodeChildren = node.children;\n }\n }\n if (dynamicPropNames && dynamicPropNames.length) {\n vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);\n }\n node.codegenNode = createVNodeCall(\n context,\n vnodeTag,\n vnodeProps,\n vnodeChildren,\n patchFlag === 0 ? void 0 : patchFlag,\n vnodeDynamicProps,\n vnodeDirectives,\n !!shouldUseBlock,\n false,\n isComponent,\n node.loc\n );\n };\n};\nfunction resolveComponentType(node, context, ssr = false) {\n let { tag } = node;\n const isExplicitDynamic = isComponentTag(tag);\n const isProp = findProp(\n node,\n \"is\",\n false,\n true\n /* allow empty */\n );\n if (isProp) {\n if (isExplicitDynamic || isCompatEnabled(\n \"COMPILER_IS_ON_ELEMENT\",\n context\n )) {\n let exp;\n if (isProp.type === 6) {\n exp = isProp.value && createSimpleExpression(isProp.value.content, true);\n } else {\n exp = isProp.exp;\n if (!exp) {\n exp = createSimpleExpression(`is`, false, isProp.arg.loc);\n {\n exp = isProp.exp = processExpression(exp, context);\n }\n }\n }\n if (exp) {\n return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [\n exp\n ]);\n }\n } else if (isProp.type === 6 && isProp.value.content.startsWith(\"vue:\")) {\n tag = isProp.value.content.slice(4);\n }\n }\n const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);\n if (builtIn) {\n if (!ssr) context.helper(builtIn);\n return builtIn;\n }\n {\n const fromSetup = resolveSetupReference(tag, context);\n if (fromSetup) {\n return fromSetup;\n }\n const dotIndex = tag.indexOf(\".\");\n if (dotIndex > 0) {\n const ns = resolveSetupReference(tag.slice(0, dotIndex), context);\n if (ns) {\n return ns + tag.slice(dotIndex);\n }\n }\n }\n if (context.selfName && shared.capitalize(shared.camelize(tag)) === context.selfName) {\n context.helper(RESOLVE_COMPONENT);\n context.components.add(tag + `__self`);\n return toValidAssetId(tag, `component`);\n }\n context.helper(RESOLVE_COMPONENT);\n context.components.add(tag);\n return toValidAssetId(tag, `component`);\n}\nfunction resolveSetupReference(name, context) {\n const bindings = context.bindingMetadata;\n if (!bindings || bindings.__isScriptSetup === false) {\n return;\n }\n const camelName = shared.camelize(name);\n const PascalName = shared.capitalize(camelName);\n const checkType = (type) => {\n if (bindings[name] === type) {\n return name;\n }\n if (bindings[camelName] === type) {\n return camelName;\n }\n if (bindings[PascalName] === type) {\n return PascalName;\n }\n };\n const fromConst = checkType(\"setup-const\") || checkType(\"setup-reactive-const\") || checkType(\"literal-const\");\n if (fromConst) {\n return context.inline ? (\n // in inline mode, const setup bindings (e.g. imports) can be used as-is\n fromConst\n ) : `$setup[${JSON.stringify(fromConst)}]`;\n }\n const fromMaybeRef = checkType(\"setup-let\") || checkType(\"setup-ref\") || checkType(\"setup-maybe-ref\");\n if (fromMaybeRef) {\n return context.inline ? (\n // setup scope bindings that may be refs need to be unrefed\n `${context.helperString(UNREF)}(${fromMaybeRef})`\n ) : `$setup[${JSON.stringify(fromMaybeRef)}]`;\n }\n const fromProps = checkType(\"props\");\n if (fromProps) {\n return `${context.helperString(UNREF)}(${context.inline ? \"__props\" : \"$props\"}[${JSON.stringify(fromProps)}])`;\n }\n}\nfunction buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {\n const { tag, loc: elementLoc, children } = node;\n let properties = [];\n const mergeArgs = [];\n const runtimeDirectives = [];\n const hasChildren = children.length > 0;\n let shouldUseBlock = false;\n let patchFlag = 0;\n let hasRef = false;\n let hasClassBinding = false;\n let hasStyleBinding = false;\n let hasHydrationEventBinding = false;\n let hasDynamicKeys = false;\n let hasVnodeHook = false;\n const dynamicPropNames = [];\n const pushMergeArg = (arg) => {\n if (properties.length) {\n mergeArgs.push(\n createObjectExpression(dedupeProperties(properties), elementLoc)\n );\n properties = [];\n }\n if (arg) mergeArgs.push(arg);\n };\n const pushRefVForMarker = () => {\n if (context.scopes.vFor > 0) {\n properties.push(\n createObjectProperty(\n createSimpleExpression(\"ref_for\", true),\n createSimpleExpression(\"true\")\n )\n );\n }\n };\n const analyzePatchFlag = ({ key, value }) => {\n if (isStaticExp(key)) {\n const name = key.content;\n const isEventHandler = shared.isOn(name);\n if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click\n // dedicated fast path.\n name.toLowerCase() !== \"onclick\" && // omit v-model handlers\n name !== \"onUpdate:modelValue\" && // omit onVnodeXXX hooks\n !shared.isReservedProp(name)) {\n hasHydrationEventBinding = true;\n }\n if (isEventHandler && shared.isReservedProp(name)) {\n hasVnodeHook = true;\n }\n if (isEventHandler && value.type === 14) {\n value = value.arguments[0];\n }\n if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {\n return;\n }\n if (name === \"ref\") {\n hasRef = true;\n } else if (name === \"class\") {\n hasClassBinding = true;\n } else if (name === \"style\") {\n hasStyleBinding = true;\n } else if (name !== \"key\" && !dynamicPropNames.includes(name)) {\n dynamicPropNames.push(name);\n }\n if (isComponent && (name === \"class\" || name === \"style\") && !dynamicPropNames.includes(name)) {\n dynamicPropNames.push(name);\n }\n } else {\n hasDynamicKeys = true;\n }\n };\n for (let i = 0; i < props.length; i++) {\n const prop = props[i];\n if (prop.type === 6) {\n const { loc, name, nameLoc, value } = prop;\n let isStatic = true;\n if (name === \"ref\") {\n hasRef = true;\n pushRefVForMarker();\n if (value && context.inline) {\n const binding = context.bindingMetadata[value.content];\n if (binding === \"setup-let\" || binding === \"setup-ref\" || binding === \"setup-maybe-ref\") {\n isStatic = false;\n properties.push(\n createObjectProperty(\n createSimpleExpression(\"ref_key\", true),\n createSimpleExpression(value.content, true, value.loc)\n )\n );\n }\n }\n }\n if (name === \"is\" && (isComponentTag(tag) || value && value.content.startsWith(\"vue:\") || isCompatEnabled(\n \"COMPILER_IS_ON_ELEMENT\",\n context\n ))) {\n continue;\n }\n properties.push(\n createObjectProperty(\n createSimpleExpression(name, true, nameLoc),\n createSimpleExpression(\n value ? value.content : \"\",\n isStatic,\n value ? value.loc : loc\n )\n )\n );\n } else {\n const { name, arg, exp, loc, modifiers } = prop;\n const isVBind = name === \"bind\";\n const isVOn = name === \"on\";\n if (name === \"slot\") {\n if (!isComponent) {\n context.onError(\n createCompilerError(40, loc)\n );\n }\n continue;\n }\n if (name === \"once\" || name === \"memo\") {\n continue;\n }\n if (name === \"is\" || isVBind && isStaticArgOf(arg, \"is\") && (isComponentTag(tag) || isCompatEnabled(\n \"COMPILER_IS_ON_ELEMENT\",\n context\n ))) {\n continue;\n }\n if (isVOn && ssr) {\n continue;\n }\n if (\n // #938: elements with dynamic keys should be forced into blocks\n isVBind && isStaticArgOf(arg, \"key\") || // inline before-update hooks need to force block so that it is invoked\n // before children\n isVOn && hasChildren && isStaticArgOf(arg, \"vue:before-update\")\n ) {\n shouldUseBlock = true;\n }\n if (isVBind && isStaticArgOf(arg, \"ref\")) {\n pushRefVForMarker();\n }\n if (!arg && (isVBind || isVOn)) {\n hasDynamicKeys = true;\n if (exp) {\n if (isVBind) {\n {\n pushMergeArg();\n {\n const hasOverridableKeys = mergeArgs.some((arg2) => {\n if (arg2.type === 15) {\n return arg2.properties.some(({ key }) => {\n if (key.type !== 4 || !key.isStatic) {\n return true;\n }\n return key.content !== \"class\" && key.content !== \"style\" && !shared.isOn(key.content);\n });\n } else {\n return true;\n }\n });\n if (hasOverridableKeys) {\n checkCompatEnabled(\n \"COMPILER_V_BIND_OBJECT_ORDER\",\n context,\n loc\n );\n }\n }\n if (isCompatEnabled(\n \"COMPILER_V_BIND_OBJECT_ORDER\",\n context\n )) {\n mergeArgs.unshift(exp);\n continue;\n }\n }\n pushRefVForMarker();\n pushMergeArg();\n mergeArgs.push(exp);\n } else {\n pushMergeArg({\n type: 14,\n loc,\n callee: context.helper(TO_HANDLERS),\n arguments: isComponent ? [exp] : [exp, `true`]\n });\n }\n } else {\n context.onError(\n createCompilerError(\n isVBind ? 34 : 35,\n loc\n )\n );\n }\n continue;\n }\n if (isVBind && modifiers.some((mod) => mod.content === \"prop\")) {\n patchFlag |= 32;\n }\n const directiveTransform = context.directiveTransforms[name];\n if (directiveTransform) {\n const { props: props2, needRuntime } = directiveTransform(prop, node, context);\n !ssr && props2.forEach(analyzePatchFlag);\n if (isVOn && arg && !isStaticExp(arg)) {\n pushMergeArg(createObjectExpression(props2, elementLoc));\n } else {\n properties.push(...props2);\n }\n if (needRuntime) {\n runtimeDirectives.push(prop);\n if (shared.isSymbol(needRuntime)) {\n directiveImportMap.set(prop, needRuntime);\n }\n }\n } else if (!shared.isBuiltInDirective(name)) {\n runtimeDirectives.push(prop);\n if (hasChildren) {\n shouldUseBlock = true;\n }\n }\n }\n }\n let propsExpression = void 0;\n if (mergeArgs.length) {\n pushMergeArg();\n if (mergeArgs.length > 1) {\n propsExpression = createCallExpression(\n context.helper(MERGE_PROPS),\n mergeArgs,\n elementLoc\n );\n } else {\n propsExpression = mergeArgs[0];\n }\n } else if (properties.length) {\n propsExpression = createObjectExpression(\n dedupeProperties(properties),\n elementLoc\n );\n }\n if (hasDynamicKeys) {\n patchFlag |= 16;\n } else {\n if (hasClassBinding && !isComponent) {\n patchFlag |= 2;\n }\n if (hasStyleBinding && !isComponent) {\n patchFlag |= 4;\n }\n if (dynamicPropNames.length) {\n patchFlag |= 8;\n }\n if (hasHydrationEventBinding) {\n patchFlag |= 32;\n }\n }\n if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {\n patchFlag |= 512;\n }\n if (!context.inSSR && propsExpression) {\n switch (propsExpression.type) {\n case 15:\n let classKeyIndex = -1;\n let styleKeyIndex = -1;\n let hasDynamicKey = false;\n for (let i = 0; i < propsExpression.properties.length; i++) {\n const key = propsExpression.properties[i].key;\n if (isStaticExp(key)) {\n if (key.content === \"class\") {\n classKeyIndex = i;\n } else if (key.content === \"style\") {\n styleKeyIndex = i;\n }\n } else if (!key.isHandlerKey) {\n hasDynamicKey = true;\n }\n }\n const classProp = propsExpression.properties[classKeyIndex];\n const styleProp = propsExpression.properties[styleKeyIndex];\n if (!hasDynamicKey) {\n if (classProp && !isStaticExp(classProp.value)) {\n classProp.value = createCallExpression(\n context.helper(NORMALIZE_CLASS),\n [classProp.value]\n );\n }\n if (styleProp && // the static style is compiled into an object,\n // so use `hasStyleBinding` to ensure that it is a dynamic style binding\n (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,\n // v-bind:style with static literal object\n styleProp.value.type === 17)) {\n styleProp.value = createCallExpression(\n context.helper(NORMALIZE_STYLE),\n [styleProp.value]\n );\n }\n } else {\n propsExpression = createCallExpression(\n context.helper(NORMALIZE_PROPS),\n [propsExpression]\n );\n }\n break;\n case 14:\n break;\n default:\n propsExpression = createCallExpression(\n context.helper(NORMALIZE_PROPS),\n [\n createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [\n propsExpression\n ])\n ]\n );\n break;\n }\n }\n return {\n props: propsExpression,\n directives: runtimeDirectives,\n patchFlag,\n dynamicPropNames,\n shouldUseBlock\n };\n}\nfunction dedupeProperties(properties) {\n const knownProps = /* @__PURE__ */ new Map();\n const deduped = [];\n for (let i = 0; i < properties.length; i++) {\n const prop = properties[i];\n if (prop.key.type === 8 || !prop.key.isStatic) {\n deduped.push(prop);\n continue;\n }\n const name = prop.key.content;\n const existing = knownProps.get(name);\n if (existing) {\n if (name === \"style\" || name === \"class\" || shared.isOn(name)) {\n mergeAsArray(existing, prop);\n }\n } else {\n knownProps.set(name, prop);\n deduped.push(prop);\n }\n }\n return deduped;\n}\nfunction mergeAsArray(existing, incoming) {\n if (existing.value.type === 17) {\n existing.value.elements.push(incoming.value);\n } else {\n existing.value = createArrayExpression(\n [existing.value, incoming.value],\n existing.loc\n );\n }\n}\nfunction buildDirectiveArgs(dir, context) {\n const dirArgs = [];\n const runtime = directiveImportMap.get(dir);\n if (runtime) {\n dirArgs.push(context.helperString(runtime));\n } else {\n const fromSetup = resolveSetupReference(\"v-\" + dir.name, context);\n if (fromSetup) {\n dirArgs.push(fromSetup);\n } else {\n context.helper(RESOLVE_DIRECTIVE);\n context.directives.add(dir.name);\n dirArgs.push(toValidAssetId(dir.name, `directive`));\n }\n }\n const { loc } = dir;\n if (dir.exp) dirArgs.push(dir.exp);\n if (dir.arg) {\n if (!dir.exp) {\n dirArgs.push(`void 0`);\n }\n dirArgs.push(dir.arg);\n }\n if (Object.keys(dir.modifiers).length) {\n if (!dir.arg) {\n if (!dir.exp) {\n dirArgs.push(`void 0`);\n }\n dirArgs.push(`void 0`);\n }\n const trueExpression = createSimpleExpression(`true`, false, loc);\n dirArgs.push(\n createObjectExpression(\n dir.modifiers.map(\n (modifier) => createObjectProperty(modifier, trueExpression)\n ),\n loc\n )\n );\n }\n return createArrayExpression(dirArgs, dir.loc);\n}\nfunction stringifyDynamicPropNames(props) {\n let propsNamesString = `[`;\n for (let i = 0, l = props.length; i < l; i++) {\n propsNamesString += JSON.stringify(props[i]);\n if (i < l - 1) propsNamesString += \", \";\n }\n return propsNamesString + `]`;\n}\nfunction isComponentTag(tag) {\n return tag === \"component\" || tag === \"Component\";\n}\n\nconst transformSlotOutlet = (node, context) => {\n if (isSlotOutlet(node)) {\n const { children, loc } = node;\n const { slotName, slotProps } = processSlotOutlet(node, context);\n const slotArgs = [\n context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,\n slotName,\n \"{}\",\n \"undefined\",\n \"true\"\n ];\n let expectedLen = 2;\n if (slotProps) {\n slotArgs[2] = slotProps;\n expectedLen = 3;\n }\n if (children.length) {\n slotArgs[3] = createFunctionExpression([], children, false, false, loc);\n expectedLen = 4;\n }\n if (context.scopeId && !context.slotted) {\n expectedLen = 5;\n }\n slotArgs.splice(expectedLen);\n node.codegenNode = createCallExpression(\n context.helper(RENDER_SLOT),\n slotArgs,\n loc\n );\n }\n};\nfunction processSlotOutlet(node, context) {\n let slotName = `\"default\"`;\n let slotProps = void 0;\n const nonNameProps = [];\n for (let i = 0; i < node.props.length; i++) {\n const p = node.props[i];\n if (p.type === 6) {\n if (p.value) {\n if (p.name === \"name\") {\n slotName = JSON.stringify(p.value.content);\n } else {\n p.name = shared.camelize(p.name);\n nonNameProps.push(p);\n }\n }\n } else {\n if (p.name === \"bind\" && isStaticArgOf(p.arg, \"name\")) {\n if (p.exp) {\n slotName = p.exp;\n } else if (p.arg && p.arg.type === 4) {\n const name = shared.camelize(p.arg.content);\n slotName = p.exp = createSimpleExpression(name, false, p.arg.loc);\n {\n slotName = p.exp = processExpression(p.exp, context);\n }\n }\n } else {\n if (p.name === \"bind\" && p.arg && isStaticExp(p.arg)) {\n p.arg.content = shared.camelize(p.arg.content);\n }\n nonNameProps.push(p);\n }\n }\n }\n if (nonNameProps.length > 0) {\n const { props, directives } = buildProps(\n node,\n context,\n nonNameProps,\n false,\n false\n );\n slotProps = props;\n if (directives.length) {\n context.onError(\n createCompilerError(\n 36,\n directives[0].loc\n )\n );\n }\n }\n return {\n slotName,\n slotProps\n };\n}\n\nconst transformOn = (dir, node, context, augmentor) => {\n const { loc, modifiers, arg } = dir;\n if (!dir.exp && !modifiers.length) {\n context.onError(createCompilerError(35, loc));\n }\n let eventName;\n if (arg.type === 4) {\n if (arg.isStatic) {\n let rawName = arg.content;\n if (rawName.startsWith(\"vnode\")) {\n context.onError(createCompilerError(52, arg.loc));\n }\n if (rawName.startsWith(\"vue:\")) {\n rawName = `vnode-${rawName.slice(4)}`;\n }\n const eventString = node.tagType !== 0 || rawName.startsWith(\"vnode\") || !/[A-Z]/.test(rawName) ? (\n // for non-element and vnode lifecycle event listeners, auto convert\n // it to camelCase. See issue #2249\n shared.toHandlerKey(shared.camelize(rawName))\n ) : (\n // preserve case for plain element listeners that have uppercase\n // letters, as these may be custom elements' custom events\n `on:${rawName}`\n );\n eventName = createSimpleExpression(eventString, true, arg.loc);\n } else {\n eventName = createCompoundExpression([\n `${context.helperString(TO_HANDLER_KEY)}(`,\n arg,\n `)`\n ]);\n }\n } else {\n eventName = arg;\n eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);\n eventName.children.push(`)`);\n }\n let exp = dir.exp;\n if (exp && !exp.content.trim()) {\n exp = void 0;\n }\n let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;\n if (exp) {\n const isMemberExp = isMemberExpression(exp, context);\n const isInlineStatement = !(isMemberExp || isFnExpression(exp, context));\n const hasMultipleStatements = exp.content.includes(`;`);\n if (context.prefixIdentifiers) {\n isInlineStatement && context.addIdentifiers(`$event`);\n exp = dir.exp = processExpression(\n exp,\n context,\n false,\n hasMultipleStatements\n );\n isInlineStatement && context.removeIdentifiers(`$event`);\n shouldCache = context.cacheHandlers && // unnecessary to cache inside v-once\n !context.inVOnce && // runtime constants don't need to be cached\n // (this is analyzed by compileScript in SFC <script setup>)\n !(exp.type === 4 && exp.constType > 0) && // #1541 bail if this is a member exp handler passed to a component -\n // we need to use the original function to preserve arity,\n // e.g. <transition> relies on checking cb.length to determine\n // transition end handling. Inline function is ok since its arity\n // is preserved even when cached.\n !(isMemberExp && node.tagType === 1) && // bail if the function references closure variables (v-for, v-slot)\n // it must be passed fresh to avoid stale values.\n !hasScopeRef(exp, context.identifiers);\n if (shouldCache && isMemberExp) {\n if (exp.type === 4) {\n exp.content = `${exp.content} && ${exp.content}(...args)`;\n } else {\n exp.children = [...exp.children, ` && `, ...exp.children, `(...args)`];\n }\n }\n }\n if (isInlineStatement || shouldCache && isMemberExp) {\n exp = createCompoundExpression([\n `${isInlineStatement ? context.isTS ? `($event: any)` : `$event` : `${context.isTS ? `\n//@ts-ignore\n` : ``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,\n exp,\n hasMultipleStatements ? `}` : `)`\n ]);\n }\n }\n let ret = {\n props: [\n createObjectProperty(\n eventName,\n exp || createSimpleExpression(`() => {}`, false, loc)\n )\n ]\n };\n if (augmentor) {\n ret = augmentor(ret);\n }\n if (shouldCache) {\n ret.props[0].value = context.cache(ret.props[0].value);\n }\n ret.props.forEach((p) => p.key.isHandlerKey = true);\n return ret;\n};\n\nconst transformBind = (dir, _node, context) => {\n const { modifiers, loc } = dir;\n const arg = dir.arg;\n let { exp } = dir;\n if (exp && exp.type === 4 && !exp.content.trim()) {\n {\n context.onError(\n createCompilerError(34, loc)\n );\n return {\n props: [\n createObjectProperty(arg, createSimpleExpression(\"\", true, loc))\n ]\n };\n }\n }\n if (arg.type !== 4) {\n arg.children.unshift(`(`);\n arg.children.push(`) || \"\"`);\n } else if (!arg.isStatic) {\n arg.content = arg.content ? `${arg.content} || \"\"` : `\"\"`;\n }\n if (modifiers.some((mod) => mod.content === \"camel\")) {\n if (arg.type === 4) {\n if (arg.isStatic) {\n arg.content = shared.camelize(arg.content);\n } else {\n arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;\n }\n } else {\n arg.children.unshift(`${context.helperString(CAMELIZE)}(`);\n arg.children.push(`)`);\n }\n }\n if (!context.inSSR) {\n if (modifiers.some((mod) => mod.content === \"prop\")) {\n injectPrefix(arg, \".\");\n }\n if (modifiers.some((mod) => mod.content === \"attr\")) {\n injectPrefix(arg, \"^\");\n }\n }\n return {\n props: [createObjectProperty(arg, exp)]\n };\n};\nconst injectPrefix = (arg, prefix) => {\n if (arg.type === 4) {\n if (arg.isStatic) {\n arg.content = prefix + arg.content;\n } else {\n arg.content = `\\`${prefix}\\${${arg.content}}\\``;\n }\n } else {\n arg.children.unshift(`'${prefix}' + (`);\n arg.children.push(`)`);\n }\n};\n\nconst transformText = (node, context) => {\n if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {\n return () => {\n const children = node.children;\n let currentContainer = void 0;\n let hasText = false;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (isText$1(child)) {\n hasText = true;\n for (let j = i + 1; j < children.length; j++) {\n const next = children[j];\n if (isText$1(next)) {\n if (!currentContainer) {\n currentContainer = children[i] = createCompoundExpression(\n [child],\n child.loc\n );\n }\n currentContainer.children.push(` + `, next);\n children.splice(j, 1);\n j--;\n } else {\n currentContainer = void 0;\n break;\n }\n }\n }\n }\n if (!hasText || // if this is a plain element with a single text child, leave it\n // as-is since the runtime has dedicated fast path for this by directly\n // setting textContent of the element.\n // for component root it's always normalized anyway.\n children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756\n // custom directives can potentially add DOM elements arbitrarily,\n // we need to avoid setting textContent of the element at runtime\n // to avoid accidentally overwriting the DOM elements added\n // by the user through custom directives.\n !node.props.find(\n (p) => p.type === 7 && !context.directiveTransforms[p.name]\n ) && // in compat mode, <template> tags with no special directives\n // will be rendered as a fragment so its children must be\n // converted into vnodes.\n !(node.tag === \"template\"))) {\n return;\n }\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (isText$1(child) || child.type === 8) {\n const callArgs = [];\n if (child.type !== 2 || child.content !== \" \") {\n callArgs.push(child);\n }\n if (!context.ssr && getConstantType(child, context) === 0) {\n callArgs.push(\n 1 + (` /* ${shared.PatchFlagNames[1]} */` )\n );\n }\n children[i] = {\n type: 12,\n content: child,\n loc: child.loc,\n codegenNode: createCallExpression(\n context.helper(CREATE_TEXT),\n callArgs\n )\n };\n }\n }\n };\n }\n};\n\nconst seen$1 = /* @__PURE__ */ new WeakSet();\nconst transformOnce = (node, context) => {\n if (node.type === 1 && findDir(node, \"once\", true)) {\n if (seen$1.has(node) || context.inVOnce || context.inSSR) {\n return;\n }\n seen$1.add(node);\n context.inVOnce = true;\n context.helper(SET_BLOCK_TRACKING);\n return () => {\n context.inVOnce = false;\n const cur = context.currentNode;\n if (cur.codegenNode) {\n cur.codegenNode = context.cache(\n cur.codegenNode,\n true,\n true\n );\n }\n };\n }\n};\n\nconst transformModel = (dir, node, context) => {\n const { exp, arg } = dir;\n if (!exp) {\n context.onError(\n createCompilerError(41, dir.loc)\n );\n return createTransformProps();\n }\n const rawExp = exp.loc.source.trim();\n const expString = exp.type === 4 ? exp.content : rawExp;\n const bindingType = context.bindingMetadata[rawExp];\n if (bindingType === \"props\" || bindingType === \"props-aliased\") {\n context.onError(createCompilerError(44, exp.loc));\n return createTransformProps();\n }\n if (bindingType === \"literal-const\" || bindingType === \"setup-const\") {\n context.onError(createCompilerError(45, exp.loc));\n return createTransformProps();\n }\n const maybeRef = context.inline && (bindingType === \"setup-let\" || bindingType === \"setup-ref\" || bindingType === \"setup-maybe-ref\");\n if (!expString.trim() || !isMemberExpression(exp, context) && !maybeRef) {\n context.onError(\n createCompilerError(42, exp.loc)\n );\n return createTransformProps();\n }\n if (context.prefixIdentifiers && isSimpleIdentifier(expString) && context.identifiers[expString]) {\n context.onError(\n createCompilerError(43, exp.loc)\n );\n return createTransformProps();\n }\n const propName = arg ? arg : createSimpleExpression(\"modelValue\", true);\n const eventName = arg ? isStaticExp(arg) ? `onUpdate:${shared.camelize(arg.content)}` : createCompoundExpression(['\"onUpdate:\" + ', arg]) : `onUpdate:modelValue`;\n let assignmentExp;\n const eventArg = context.isTS ? `($event: any)` : `$event`;\n if (maybeRef) {\n if (bindingType === \"setup-ref\") {\n assignmentExp = createCompoundExpression([\n `${eventArg} => ((`,\n createSimpleExpression(rawExp, false, exp.loc),\n `).value = $event)`\n ]);\n } else {\n const altAssignment = bindingType === \"setup-let\" ? `${rawExp} = $event` : `null`;\n assignmentExp = createCompoundExpression([\n `${eventArg} => (${context.helperString(IS_REF)}(${rawExp}) ? (`,\n createSimpleExpression(rawExp, false, exp.loc),\n `).value = $event : ${altAssignment})`\n ]);\n }\n } else {\n assignmentExp = createCompoundExpression([\n `${eventArg} => ((`,\n exp,\n `) = $event)`\n ]);\n }\n const props = [\n // modelValue: foo\n createObjectProperty(propName, dir.exp),\n // \"onUpdate:modelValue\": $event => (foo = $event)\n createObjectProperty(eventName, assignmentExp)\n ];\n if (context.prefixIdentifiers && !context.inVOnce && context.cacheHandlers && !hasScopeRef(exp, context.identifiers)) {\n props[1].value = context.cache(props[1].value);\n }\n if (dir.modifiers.length && node.tagType === 1) {\n const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);\n const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + \"Modifiers\"']) : `modelModifiers`;\n props.push(\n createObjectProperty(\n modifiersKey,\n createSimpleExpression(\n `{ ${modifiers} }`,\n false,\n dir.loc,\n 2\n )\n )\n );\n }\n return createTransformProps(props);\n};\nfunction createTransformProps(props = []) {\n return { props };\n}\n\nconst validDivisionCharRE = /[\\w).+\\-_$\\]]/;\nconst transformFilter = (node, context) => {\n if (!isCompatEnabled(\"COMPILER_FILTERS\", context)) {\n return;\n }\n if (node.type === 5) {\n rewriteFilter(node.content, context);\n } else if (node.type === 1) {\n node.props.forEach((prop) => {\n if (prop.type === 7 && prop.name !== \"for\" && prop.exp) {\n rewriteFilter(prop.exp, context);\n }\n });\n }\n};\nfunction rewriteFilter(node, context) {\n if (node.type === 4) {\n parseFilter(node, context);\n } else {\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (typeof child !== \"object\") continue;\n if (child.type === 4) {\n parseFilter(child, context);\n } else if (child.type === 8) {\n rewriteFilter(node, context);\n } else if (child.type === 5) {\n rewriteFilter(child.content, context);\n }\n }\n }\n}\nfunction parseFilter(node, context) {\n const exp = node.content;\n let inSingle = false;\n let inDouble = false;\n let inTemplateString = false;\n let inRegex = false;\n let curly = 0;\n let square = 0;\n let paren = 0;\n let lastFilterIndex = 0;\n let c, prev, i, expression, filters = [];\n for (i = 0; i < exp.length; i++) {\n prev = c;\n c = exp.charCodeAt(i);\n if (inSingle) {\n if (c === 39 && prev !== 92) inSingle = false;\n } else if (inDouble) {\n if (c === 34 && prev !== 92) inDouble = false;\n } else if (inTemplateString) {\n if (c === 96 && prev !== 92) inTemplateString = false;\n } else if (inRegex) {\n if (c === 47 && prev !== 92) inRegex = false;\n } else if (c === 124 && // pipe\n exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) {\n if (expression === void 0) {\n lastFilterIndex = i + 1;\n expression = exp.slice(0, i).trim();\n } else {\n pushFilter();\n }\n } else {\n switch (c) {\n case 34:\n inDouble = true;\n break;\n // \"\n case 39:\n inSingle = true;\n break;\n // '\n case 96:\n inTemplateString = true;\n break;\n // `\n case 40:\n paren++;\n break;\n // (\n case 41:\n paren--;\n break;\n // )\n case 91:\n square++;\n break;\n // [\n case 93:\n square--;\n break;\n // ]\n case 123:\n curly++;\n break;\n // {\n case 125:\n curly--;\n break;\n }\n if (c === 47) {\n let j = i - 1;\n let p;\n for (; j >= 0; j--) {\n p = exp.charAt(j);\n if (p !== \" \") break;\n }\n if (!p || !validDivisionCharRE.test(p)) {\n inRegex = true;\n }\n }\n }\n }\n if (expression === void 0) {\n expression = exp.slice(0, i).trim();\n } else if (lastFilterIndex !== 0) {\n pushFilter();\n }\n function pushFilter() {\n filters.push(exp.slice(lastFilterIndex, i).trim());\n lastFilterIndex = i + 1;\n }\n if (filters.length) {\n warnDeprecation(\n \"COMPILER_FILTERS\",\n context,\n node.loc\n );\n for (i = 0; i < filters.length; i++) {\n expression = wrapFilter(expression, filters[i], context);\n }\n node.content = expression;\n node.ast = void 0;\n }\n}\nfunction wrapFilter(exp, filter, context) {\n context.helper(RESOLVE_FILTER);\n const i = filter.indexOf(\"(\");\n if (i < 0) {\n context.filters.add(filter);\n return `${toValidAssetId(filter, \"filter\")}(${exp})`;\n } else {\n const name = filter.slice(0, i);\n const args = filter.slice(i + 1);\n context.filters.add(name);\n return `${toValidAssetId(name, \"filter\")}(${exp}${args !== \")\" ? \",\" + args : args}`;\n }\n}\n\nconst seen = /* @__PURE__ */ new WeakSet();\nconst transformMemo = (node, context) => {\n if (node.type === 1) {\n const dir = findDir(node, \"memo\");\n if (!dir || seen.has(node) || context.inSSR) {\n return;\n }\n seen.add(node);\n return () => {\n const codegenNode = node.codegenNode || context.currentNode.codegenNode;\n if (codegenNode && codegenNode.type === 13) {\n if (node.tagType !== 1) {\n convertToBlock(codegenNode, context);\n }\n node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [\n dir.exp,\n createFunctionExpression(void 0, codegenNode),\n `_cache`,\n String(context.cached.length)\n ]);\n context.cached.push(null);\n }\n };\n }\n};\n\nconst transformVBindShorthand = (node, context) => {\n if (node.type === 1) {\n for (const prop of node.props) {\n if (prop.type === 7 && prop.name === \"bind\" && (!prop.exp || // #13930 :foo in in-DOM templates will be parsed into :foo=\"\" by browser\n false) && prop.arg) {\n const arg = prop.arg;\n if (arg.type !== 4 || !arg.isStatic) {\n context.onError(\n createCompilerError(\n 53,\n arg.loc\n )\n );\n prop.exp = createSimpleExpression(\"\", true, arg.loc);\n } else {\n const propName = shared.camelize(arg.content);\n if (validFirstIdentCharRE.test(propName[0]) || // allow hyphen first char for https://github.com/vuejs/language-tools/pull/3424\n propName[0] === \"-\") {\n prop.exp = createSimpleExpression(propName, false, arg.loc);\n }\n }\n }\n }\n }\n};\n\nfunction getBaseTransformPreset(prefixIdentifiers) {\n return [\n [\n transformVBindShorthand,\n transformOnce,\n transformIf,\n transformMemo,\n transformFor,\n ...[transformFilter] ,\n ...prefixIdentifiers ? [\n // order is important\n trackVForSlotScopes,\n transformExpression\n ] : [],\n transformSlotOutlet,\n transformElement,\n trackSlotScopes,\n transformText\n ],\n {\n on: transformOn,\n bind: transformBind,\n model: transformModel\n }\n ];\n}\nfunction baseCompile(source, options = {}) {\n const onError = options.onError || defaultOnError;\n const isModuleMode = options.mode === \"module\";\n const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode;\n if (!prefixIdentifiers && options.cacheHandlers) {\n onError(createCompilerError(50));\n }\n if (options.scopeId && !isModuleMode) {\n onError(createCompilerError(51));\n }\n const resolvedOptions = shared.extend({}, options, {\n prefixIdentifiers\n });\n const ast = shared.isString(source) ? baseParse(source, resolvedOptions) : source;\n const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);\n if (options.isTS) {\n const { expressionPlugins } = options;\n if (!expressionPlugins || !expressionPlugins.includes(\"typescript\")) {\n options.expressionPlugins = [...expressionPlugins || [], \"typescript\"];\n }\n }\n transform(\n ast,\n shared.extend({}, resolvedOptions, {\n nodeTransforms: [\n ...nodeTransforms,\n ...options.nodeTransforms || []\n // user transforms\n ],\n directiveTransforms: shared.extend(\n {},\n directiveTransforms,\n options.directiveTransforms || {}\n // user transforms\n )\n })\n );\n return generate(ast, resolvedOptions);\n}\n\nconst BindingTypes = {\n \"DATA\": \"data\",\n \"PROPS\": \"props\",\n \"PROPS_ALIASED\": \"props-aliased\",\n \"SETUP_LET\": \"setup-let\",\n \"SETUP_CONST\": \"setup-const\",\n \"SETUP_REACTIVE_CONST\": \"setup-reactive-const\",\n \"SETUP_MAYBE_REF\": \"setup-maybe-ref\",\n \"SETUP_REF\": \"setup-ref\",\n \"OPTIONS\": \"options\",\n \"LITERAL_CONST\": \"literal-const\"\n};\n\nconst noopDirectiveTransform = () => ({ props: [] });\n\nexports.generateCodeFrame = shared.generateCodeFrame;\nexports.BASE_TRANSITION = BASE_TRANSITION;\nexports.BindingTypes = BindingTypes;\nexports.CAMELIZE = CAMELIZE;\nexports.CAPITALIZE = CAPITALIZE;\nexports.CREATE_BLOCK = CREATE_BLOCK;\nexports.CREATE_COMMENT = CREATE_COMMENT;\nexports.CREATE_ELEMENT_BLOCK = CREATE_ELEMENT_BLOCK;\nexports.CREATE_ELEMENT_VNODE = CREATE_ELEMENT_VNODE;\nexports.CREATE_SLOTS = CREATE_SLOTS;\nexports.CREATE_STATIC = CREATE_STATIC;\nexports.CREATE_TEXT = CREATE_TEXT;\nexports.CREATE_VNODE = CREATE_VNODE;\nexports.CompilerDeprecationTypes = CompilerDeprecationTypes;\nexports.ConstantTypes = ConstantTypes;\nexports.ElementTypes = ElementTypes;\nexports.ErrorCodes = ErrorCodes;\nexports.FRAGMENT = FRAGMENT;\nexports.GUARD_REACTIVE_PROPS = GUARD_REACTIVE_PROPS;\nexports.IS_MEMO_SAME = IS_MEMO_SAME;\nexports.IS_REF = IS_REF;\nexports.KEEP_ALIVE = KEEP_ALIVE;\nexports.MERGE_PROPS = MERGE_PROPS;\nexports.NORMALIZE_CLASS = NORMALIZE_CLASS;\nexports.NORMALIZE_PROPS = NORMALIZE_PROPS;\nexports.NORMALIZE_STYLE = NORMALIZE_STYLE;\nexports.Namespaces = Namespaces;\nexports.NodeTypes = NodeTypes;\nexports.OPEN_BLOCK = OPEN_BLOCK;\nexports.POP_SCOPE_ID = POP_SCOPE_ID;\nexports.PUSH_SCOPE_ID = PUSH_SCOPE_ID;\nexports.RENDER_LIST = RENDER_LIST;\nexports.RENDER_SLOT = RENDER_SLOT;\nexports.RESOLVE_COMPONENT = RESOLVE_COMPONENT;\nexports.RESOLVE_DIRECTIVE = RESOLVE_DIRECTIVE;\nexports.RESOLVE_DYNAMIC_COMPONENT = RESOLVE_DYNAMIC_COMPONENT;\nexports.RESOLVE_FILTER = RESOLVE_FILTER;\nexports.SET_BLOCK_TRACKING = SET_BLOCK_TRACKING;\nexports.SUSPENSE = SUSPENSE;\nexports.TELEPORT = TELEPORT;\nexports.TO_DISPLAY_STRING = TO_DISPLAY_STRING;\nexports.TO_HANDLERS = TO_HANDLERS;\nexports.TO_HANDLER_KEY = TO_HANDLER_KEY;\nexports.TS_NODE_TYPES = TS_NODE_TYPES;\nexports.UNREF = UNREF;\nexports.WITH_CTX = WITH_CTX;\nexports.WITH_DIRECTIVES = WITH_DIRECTIVES;\nexports.WITH_MEMO = WITH_MEMO;\nexports.advancePositionWithClone = advancePositionWithClone;\nexports.advancePositionWithMutation = advancePositionWithMutation;\nexports.assert = assert;\nexports.baseCompile = baseCompile;\nexports.baseParse = baseParse;\nexports.buildDirectiveArgs = buildDirectiveArgs;\nexports.buildProps = buildProps;\nexports.buildSlots = buildSlots;\nexports.checkCompatEnabled = checkCompatEnabled;\nexports.convertToBlock = convertToBlock;\nexports.createArrayExpression = createArrayExpression;\nexports.createAssignmentExpression = createAssignmentExpression;\nexports.createBlockStatement = createBlockStatement;\nexports.createCacheExpression = createCacheExpression;\nexports.createCallExpression = createCallExpression;\nexports.createCompilerError = createCompilerError;\nexports.createCompoundExpression = createCompoundExpression;\nexports.createConditionalExpression = createConditionalExpression;\nexports.createForLoopParams = createForLoopParams;\nexports.createFunctionExpression = createFunctionExpression;\nexports.createIfStatement = createIfStatement;\nexports.createInterpolation = createInterpolation;\nexports.createObjectExpression = createObjectExpression;\nexports.createObjectProperty = createObjectProperty;\nexports.createReturnStatement = createReturnStatement;\nexports.createRoot = createRoot;\nexports.createSequenceExpression = createSequenceExpression;\nexports.createSimpleExpression = createSimpleExpression;\nexports.createStructuralDirectiveTransform = createStructuralDirectiveTransform;\nexports.createTemplateLiteral = createTemplateLiteral;\nexports.createTransformContext = createTransformContext;\nexports.createVNodeCall = createVNodeCall;\nexports.errorMessages = errorMessages;\nexports.extractIdentifiers = extractIdentifiers;\nexports.findDir = findDir;\nexports.findProp = findProp;\nexports.forAliasRE = forAliasRE;\nexports.generate = generate;\nexports.getBaseTransformPreset = getBaseTransformPreset;\nexports.getConstantType = getConstantType;\nexports.getMemoedVNodeCall = getMemoedVNodeCall;\nexports.getVNodeBlockHelper = getVNodeBlockHelper;\nexports.getVNodeHelper = getVNodeHelper;\nexports.hasDynamicKeyVBind = hasDynamicKeyVBind;\nexports.hasScopeRef = hasScopeRef;\nexports.helperNameMap = helperNameMap;\nexports.injectProp = injectProp;\nexports.isAllWhitespace = isAllWhitespace;\nexports.isCommentOrWhitespace = isCommentOrWhitespace;\nexports.isCoreComponent = isCoreComponent;\nexports.isFnExpression = isFnExpression;\nexports.isFnExpressionBrowser = isFnExpressionBrowser;\nexports.isFnExpressionNode = isFnExpressionNode;\nexports.isFunctionType = isFunctionType;\nexports.isInDestructureAssignment = isInDestructureAssignment;\nexports.isInNewExpression = isInNewExpression;\nexports.isMemberExpression = isMemberExpression;\nexports.isMemberExpressionBrowser = isMemberExpressionBrowser;\nexports.isMemberExpressionNode = isMemberExpressionNode;\nexports.isReferencedIdentifier = isReferencedIdentifier;\nexports.isSimpleIdentifier = isSimpleIdentifier;\nexports.isSlotOutlet = isSlotOutlet;\nexports.isStaticArgOf = isStaticArgOf;\nexports.isStaticExp = isStaticExp;\nexports.isStaticProperty = isStaticProperty;\nexports.isStaticPropertyKey = isStaticPropertyKey;\nexports.isTemplateNode = isTemplateNode;\nexports.isText = isText$1;\nexports.isVPre = isVPre;\nexports.isVSlot = isVSlot;\nexports.isWhitespaceText = isWhitespaceText;\nexports.locStub = locStub;\nexports.noopDirectiveTransform = noopDirectiveTransform;\nexports.processExpression = processExpression;\nexports.processFor = processFor;\nexports.processIf = processIf;\nexports.processSlotOutlet = processSlotOutlet;\nexports.registerRuntimeHelpers = registerRuntimeHelpers;\nexports.resolveComponentType = resolveComponentType;\nexports.stringifyExpression = stringifyExpression;\nexports.toValidAssetId = toValidAssetId;\nexports.trackSlotScopes = trackSlotScopes;\nexports.trackVForSlotScopes = trackVForSlotScopes;\nexports.transform = transform;\nexports.transformBind = transformBind;\nexports.transformElement = transformElement;\nexports.transformExpression = transformExpression;\nexports.transformModel = transformModel;\nexports.transformOn = transformOn;\nexports.transformVBindShorthand = transformVBindShorthand;\nexports.traverseNode = traverseNode;\nexports.unwrapTSNode = unwrapTSNode;\nexports.validFirstIdentCharRE = validFirstIdentCharRE;\nexports.walkBlockDeclarations = walkBlockDeclarations;\nexports.walkFunctionParams = walkFunctionParams;\nexports.walkIdentifiers = walkIdentifiers;\nexports.warnDeprecation = warnDeprecation;\n","'use strict'\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./dist/compiler-core.cjs.prod.js')\n} else {\n module.exports = require('./dist/compiler-core.cjs.js')\n}\n","import type { ElementNode, TemplateChildNode } from \"@vue/compiler-core\"\nimport { NodeTypes } from \"@vue/compiler-core\"\nimport { parse } from \"@vue/compiler-sfc\"\nimport {\n\tanalyzeNavigation,\n\ttype ComponentAnalysisResult,\n\tcreateDetectedNavigation,\n\ttype DetectedNavigation,\n\tdeduplicateByScreenId,\n\tisValidInternalPath,\n} from \"./navigationAnalyzer.js\"\n\n/**\n * Result of analyzing a Vue SFC for navigation.\n * Type alias for the shared ComponentAnalysisResult.\n */\nexport type VueSFCAnalysisResult = ComponentAnalysisResult\n\n/**\n * Analyze a Vue Single File Component for navigation patterns.\n *\n * Detects:\n * - Template: `<RouterLink to=\"/path\">`, `<router-link to=\"/path\">`\n * - Template: `:to=\"'/path'\"` (static string binding)\n * - Script: `router.push(\"/path\")`, `router.replace(\"/path\")`\n * - Script: `router.push({ path: \"/path\" })` (object-based navigation)\n *\n * @param content - The Vue SFC content to analyze\n * @param filePath - The file path (used for error messages)\n * @returns Analysis result with detected navigations and warnings\n */\nexport function analyzeVueSFC(\n\tcontent: string,\n\tfilePath: string,\n): VueSFCAnalysisResult {\n\tconst templateNavigations: DetectedNavigation[] = []\n\tconst scriptNavigations: DetectedNavigation[] = []\n\tconst warnings: string[] = []\n\n\ttry {\n\t\tconst { descriptor, errors } = parse(content, {\n\t\t\tfilename: filePath,\n\t\t\tsourceMap: false,\n\t\t})\n\n\t\tfor (const error of errors) {\n\t\t\twarnings.push(`SFC parse error: ${error.message}`)\n\t\t}\n\n\t\tif (descriptor.template?.ast) {\n\t\t\tconst templateResult = analyzeTemplateAST(\n\t\t\t\tdescriptor.template.ast.children,\n\t\t\t\twarnings,\n\t\t\t)\n\t\t\ttemplateNavigations.push(...templateResult)\n\t\t}\n\n\t\tconst scriptContent =\n\t\t\tdescriptor.scriptSetup?.content || descriptor.script?.content\n\t\tif (scriptContent) {\n\t\t\tconst scriptResult = analyzeNavigation(scriptContent, \"vue-router\")\n\t\t\tscriptNavigations.push(...scriptResult.navigations)\n\t\t\twarnings.push(...scriptResult.warnings)\n\t\t}\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\twarnings.push(`SFC syntax error in ${filePath}: ${error.message}`)\n\t\t} else if (error instanceof RangeError) {\n\t\t\twarnings.push(\n\t\t\t\t`${filePath}: File too complex for navigation analysis. Consider simplifying the template structure.`,\n\t\t\t)\n\t\t} else {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\twarnings.push(\n\t\t\t\t`${filePath}: Unexpected error during analysis: ${message}. Please report this as a bug.`,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn {\n\t\ttemplateNavigations: deduplicateByScreenId(templateNavigations),\n\t\tscriptNavigations: deduplicateByScreenId(scriptNavigations),\n\t\twarnings,\n\t}\n}\n\n/**\n * Analyze template AST for RouterLink components.\n *\n * @param nodes - Array of template child nodes to traverse\n * @param warnings - Array to collect warnings during analysis (mutated)\n * @returns Array of detected navigation targets from RouterLink components\n */\nfunction analyzeTemplateAST(\n\tnodes: TemplateChildNode[],\n\twarnings: string[],\n): DetectedNavigation[] {\n\tconst navigations: DetectedNavigation[] = []\n\n\twalkTemplateNodes(nodes, (node) => {\n\t\tif (node.type === NodeTypes.ELEMENT) {\n\t\t\tconst elementNode = node as ElementNode\n\t\t\tif (isRouterLinkComponent(elementNode.tag)) {\n\t\t\t\tconst nav = extractRouterLinkNavigation(elementNode, warnings)\n\t\t\t\tif (nav) {\n\t\t\t\t\tnavigations.push(nav)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\n\treturn navigations\n}\n\n/**\n * Check if a tag is a RouterLink component\n */\nfunction isRouterLinkComponent(tag: string): boolean {\n\treturn tag === \"RouterLink\" || tag === \"router-link\"\n}\n\n/**\n * Extract navigation from RouterLink component.\n *\n * @param node - The element node representing a RouterLink component\n * @param warnings - Array to collect warnings (mutated)\n * @returns Detected navigation or null if no valid path found\n */\nfunction extractRouterLinkNavigation(\n\tnode: ElementNode,\n\twarnings: string[],\n): DetectedNavigation | null {\n\tfor (const prop of node.props) {\n\t\t// Static attribute: to=\"/path\"\n\t\tif (prop.type === NodeTypes.ATTRIBUTE && prop.name === \"to\") {\n\t\t\tif (prop.value) {\n\t\t\t\tconst path = prop.value.content\n\t\t\t\tif (isValidInternalPath(path)) {\n\t\t\t\t\treturn createDetectedNavigation(path, \"link\", prop.loc.start.line)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Dynamic binding: :to=\"'/path'\" or v-bind:to=\"'/path'\"\n\t\tif (prop.type === NodeTypes.DIRECTIVE && prop.name === \"bind\") {\n\t\t\t// Check if this is binding the \"to\" prop\n\t\t\tif (\n\t\t\t\tprop.arg?.type === NodeTypes.SIMPLE_EXPRESSION &&\n\t\t\t\tprop.arg.content === \"to\"\n\t\t\t) {\n\t\t\t\treturn extractDynamicToBinding(prop, node.loc.start.line, warnings)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null\n}\n\n/**\n * Extract path from dynamic :to binding.\n *\n * Handles expressions like `:to=\"'/path'\"` or `v-bind:to=\"'/path'\"`.\n * Complex expressions that cannot be statically analyzed generate warnings.\n *\n * @param directive - The Vue directive AST node\n * @param line - Line number for warning messages\n * @param warnings - Array to collect warnings (mutated)\n * @returns Detected navigation or null if path cannot be extracted\n */\nfunction extractDynamicToBinding(\n\t// biome-ignore lint/suspicious/noExplicitAny: Vue compiler types are complex\n\tdirective: any,\n\tline: number,\n\twarnings: string[],\n): DetectedNavigation | null {\n\tconst exp = directive.exp\n\n\tif (!exp) {\n\t\twarnings.push(\n\t\t\t`Empty :to binding at line ${line}. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t\t)\n\t\treturn null\n\t}\n\n\tif (exp.type === NodeTypes.SIMPLE_EXPRESSION) {\n\t\tconst content = exp.content.trim()\n\n\t\t// Check if it's a static string literal\n\t\tif (isStaticStringLiteral(content)) {\n\t\t\tconst path = extractStringValue(content)\n\t\t\tif (path && isValidInternalPath(path)) {\n\t\t\t\treturn createDetectedNavigation(path, \"link\", line)\n\t\t\t}\n\t\t}\n\n\t\t// Dynamic variable or complex expression\n\t\twarnings.push(\n\t\t\t`Dynamic :to binding at line ${line} cannot be statically analyzed. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t\t)\n\t} else {\n\t\t// Complex expression type (COMPOUND_EXPRESSION, etc.)\n\t\twarnings.push(\n\t\t\t`Complex :to binding at line ${line} uses an unsupported expression type. Add the target screen ID manually to the 'next' field in screen.meta.ts.`,\n\t\t)\n\t}\n\n\treturn null\n}\n\n/**\n * Check if expression content is a static string literal.\n *\n * Recognizes single quotes, double quotes, and template literals without interpolation.\n *\n * @param content - The expression content (e.g., \"'/path'\" or \"`/home`\")\n * @returns true if the content is a statically analyzable string literal\n */\nfunction isStaticStringLiteral(content: string): boolean {\n\t// Single quotes: '/path'\n\tif (content.startsWith(\"'\") && content.endsWith(\"'\")) {\n\t\treturn true\n\t}\n\t// Double quotes: \"/path\"\n\tif (content.startsWith('\"') && content.endsWith('\"')) {\n\t\treturn true\n\t}\n\t// Template literal without interpolation: `/path`\n\tif (\n\t\tcontent.startsWith(\"`\") &&\n\t\tcontent.endsWith(\"`\") &&\n\t\t!content.includes(\"${\")\n\t) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n/**\n * Extract string value from a quoted string\n */\nfunction extractStringValue(content: string): string {\n\treturn content.slice(1, -1)\n}\n\n/**\n * Walk template AST nodes recursively in pre-order traversal.\n *\n * Traverses element nodes, v-if branches, and v-for loop bodies.\n *\n * @param nodes - Array of template child nodes to traverse\n * @param callback - Function called for each node visited\n */\nfunction walkTemplateNodes(\n\tnodes: TemplateChildNode[],\n\tcallback: (node: TemplateChildNode) => void,\n): void {\n\tfor (const node of nodes) {\n\t\tcallback(node)\n\n\t\t// Element nodes have children\n\t\tif (node.type === NodeTypes.ELEMENT) {\n\t\t\tconst elementNode = node as ElementNode\n\t\t\tif (elementNode.children) {\n\t\t\t\twalkTemplateNodes(elementNode.children, callback)\n\t\t\t}\n\t\t}\n\n\t\t// IF nodes have branches with children\n\t\tif (node.type === NodeTypes.IF) {\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: Vue compiler types are complex\n\t\t\tconst ifNode = node as any\n\t\t\tfor (const branch of ifNode.branches || []) {\n\t\t\t\tif (branch.children) {\n\t\t\t\t\twalkTemplateNodes(branch.children, callback)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// FOR nodes have children\n\t\tif (node.type === NodeTypes.FOR) {\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: Vue compiler types are complex\n\t\t\tconst forNode = node as any\n\t\t\tif (forNode.children) {\n\t\t\t\twalkTemplateNodes(forNode.children, callback)\n\t\t\t}\n\t\t}\n\t}\n}\n","import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\"\nimport { dirname, join, relative, resolve } from \"node:path\"\nimport type { ApiIntegrationConfig, Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport prompts from \"prompts\"\nimport { glob } from \"tinyglobby\"\nimport { parseAngularRouterConfig } from \"../utils/angularRouterParser.js\"\nimport { analyzeAngularComponent } from \"../utils/angularTemplateAnalyzer.js\"\nimport { analyzeApiImports } from \"../utils/apiImportAnalyzer.js\"\nimport { loadConfig } from \"../utils/config.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport { logger } from \"../utils/logger.js\"\nimport {\n\tanalyzeNavigation,\n\tdetectNavigationFramework,\n} from \"../utils/navigationAnalyzer.js\"\nimport {\n\tdetectRouterType,\n\tparseReactRouterConfig,\n} from \"../utils/reactRouterParser.js\"\nimport {\n\ttype FlatRoute,\n\tflattenRoutes,\n\ttype ParseResult,\n} from \"../utils/routeParserUtils.js\"\nimport { parseSolidRouterConfig } from \"../utils/solidRouterParser.js\"\nimport { parseTanStackRouterConfig } from \"../utils/tanstackRouterParser.js\"\nimport { parseVueRouterConfig } from \"../utils/vueRouterParser.js\"\nimport { analyzeVueSFC } from \"../utils/vueSFCTemplateAnalyzer.js\"\n\nexport const generateCommand = define({\n\tname: \"generate\",\n\tdescription: \"Auto-generate screen.meta.ts files from route files\",\n\targs: {\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\tdryRun: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"n\",\n\t\t\tdescription: \"Show what would be generated without writing files\",\n\t\t\tdefault: false,\n\t\t},\n\t\tforce: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"f\",\n\t\t\tdescription: \"Overwrite existing screen.meta.ts files\",\n\t\t\tdefault: false,\n\t\t},\n\t\tinteractive: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"i\",\n\t\t\tdescription: \"Interactively confirm or modify each screen\",\n\t\t\tdefault: false,\n\t\t},\n\t\tdetectApi: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"a\",\n\t\t\tdescription:\n\t\t\t\t\"Detect API dependencies from imports (requires apiIntegration config)\",\n\t\t\tdefault: false,\n\t\t},\n\t\tdetectNavigation: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"N\",\n\t\t\tdescription:\n\t\t\t\t\"Detect navigation targets from code (Link, router.push, navigate)\",\n\t\t\tdefault: false,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst cwd = process.cwd()\n\t\tconst dryRun = ctx.values.dryRun ?? false\n\t\tconst force = ctx.values.force ?? false\n\t\tconst interactive = ctx.values.interactive ?? false\n\t\tconst detectApi = ctx.values.detectApi ?? false\n\t\tconst detectNavigation = ctx.values.detectNavigation ?? false\n\n\t\t// Check for routes configuration\n\t\tif (!config.routesPattern && !config.routesFile) {\n\t\t\tlogger.errorWithHelp(ERRORS.ROUTES_PATTERN_MISSING)\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\t// Validate --detect-api requires apiIntegration config\n\t\tif (detectApi && !config.apiIntegration) {\n\t\t\tlogger.error(\n\t\t\t\t`${logger.bold(\"--detect-api\")} requires ${logger.code(\"apiIntegration\")} configuration`,\n\t\t\t)\n\t\t\tlogger.blank()\n\t\t\tlogger.log(\"Add to your screenbook.config.ts:\")\n\t\t\tlogger.blank()\n\t\t\tlogger.log(\n\t\t\t\tlogger.dim(` export default defineConfig({\n apiIntegration: {\n clientPackages: [\"@/api/generated\"],\n },\n })`),\n\t\t\t)\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\t// Use routesFile mode (config-based routing)\n\t\tif (config.routesFile) {\n\t\t\tawait generateFromRoutesFile(config.routesFile, cwd, {\n\t\t\t\tdryRun,\n\t\t\t\tforce,\n\t\t\t\tinteractive,\n\t\t\t\tdetectApi,\n\t\t\t\tdetectNavigation,\n\t\t\t\tapiIntegration: config.apiIntegration,\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\t// Use routesPattern mode (file-based routing)\n\t\tawait generateFromRoutesPattern(config.routesPattern as string, cwd, {\n\t\t\tdryRun,\n\t\t\tforce,\n\t\t\tinteractive,\n\t\t\tignore: config.ignore,\n\t\t\tdetectApi,\n\t\t\tdetectNavigation,\n\t\t\tapiIntegration: config.apiIntegration,\n\t\t})\n\t},\n})\n\ninterface GenerateFromRoutesFileOptions {\n\treadonly dryRun: boolean\n\treadonly force: boolean\n\treadonly interactive: boolean\n\treadonly detectApi: boolean\n\treadonly detectNavigation: boolean\n\treadonly apiIntegration?: ApiIntegrationConfig\n}\n\n/**\n * Generate screen.meta.ts files from a router config file (Vue Router or React Router)\n */\nasync function generateFromRoutesFile(\n\troutesFile: string,\n\tcwd: string,\n\toptions: GenerateFromRoutesFileOptions,\n): Promise<void> {\n\tconst {\n\t\tdryRun,\n\t\tforce,\n\t\tinteractive,\n\t\tdetectApi,\n\t\tdetectNavigation,\n\t\tapiIntegration,\n\t} = options\n\tconst absoluteRoutesFile = resolve(cwd, routesFile)\n\n\t// Check if routes file exists\n\tif (!existsSync(absoluteRoutesFile)) {\n\t\tlogger.errorWithHelp(ERRORS.ROUTES_FILE_NOT_FOUND(routesFile))\n\t\tprocess.exit(1)\n\t}\n\n\t// Detect router type\n\tconst content = readFileSync(absoluteRoutesFile, \"utf-8\")\n\tconst routerType = detectRouterType(content)\n\n\tconst routerTypeDisplay =\n\t\trouterType === \"tanstack-router\"\n\t\t\t? \"TanStack Router\"\n\t\t\t: routerType === \"solid-router\"\n\t\t\t\t? \"Solid Router\"\n\t\t\t\t: routerType === \"angular-router\"\n\t\t\t\t\t? \"Angular Router\"\n\t\t\t\t\t: routerType === \"react-router\"\n\t\t\t\t\t\t? \"React Router\"\n\t\t\t\t\t\t: routerType === \"vue-router\"\n\t\t\t\t\t\t\t? \"Vue Router\"\n\t\t\t\t\t\t\t: \"unknown\"\n\n\tlogger.info(\n\t\t`Parsing routes from ${logger.path(routesFile)} (${routerTypeDisplay})...`,\n\t)\n\tlogger.blank()\n\n\t// Parse the routes file with the appropriate parser\n\tlet parseResult: ParseResult\n\ttry {\n\t\tif (routerType === \"tanstack-router\") {\n\t\t\tparseResult = parseTanStackRouterConfig(absoluteRoutesFile)\n\t\t} else if (routerType === \"solid-router\") {\n\t\t\tparseResult = parseSolidRouterConfig(absoluteRoutesFile)\n\t\t} else if (routerType === \"angular-router\") {\n\t\t\tparseResult = parseAngularRouterConfig(absoluteRoutesFile)\n\t\t} else if (routerType === \"react-router\") {\n\t\t\tparseResult = parseReactRouterConfig(absoluteRoutesFile)\n\t\t} else if (routerType === \"vue-router\") {\n\t\t\tparseResult = parseVueRouterConfig(absoluteRoutesFile)\n\t\t} else {\n\t\t\t// Unknown router type - warn user and attempt Vue Router parser as fallback\n\t\t\tlogger.warn(\n\t\t\t\t`Could not auto-detect router type for ${logger.path(routesFile)}. Attempting to parse as Vue Router.`,\n\t\t\t)\n\t\t\tlogger.log(\n\t\t\t\t` ${logger.dim(\"If parsing fails, check that your router imports are explicit.\")}`,\n\t\t\t)\n\t\t\tparseResult = parseVueRouterConfig(absoluteRoutesFile)\n\t\t}\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tlogger.errorWithHelp(ERRORS.ROUTES_FILE_PARSE_ERROR(routesFile, message))\n\t\tprocess.exit(1)\n\t}\n\n\t// Show warnings\n\tfor (const warning of parseResult.warnings) {\n\t\tlogger.warn(warning)\n\t}\n\n\t// Flatten routes\n\tconst flatRoutes = flattenRoutes(parseResult.routes)\n\n\tif (flatRoutes.length === 0) {\n\t\tlogger.warn(\"No routes found in the config file\")\n\t\treturn\n\t}\n\n\tlogger.log(`Found ${flatRoutes.length} routes`)\n\tlogger.blank()\n\n\tlet created = 0\n\tlet skipped = 0\n\n\tfor (const route of flatRoutes) {\n\t\t// Determine where to place screen.meta.ts\n\t\tconst metaPath = determineMetaPath(route, cwd)\n\t\tconst absoluteMetaPath = resolve(cwd, metaPath)\n\n\t\tif (!force && existsSync(absoluteMetaPath)) {\n\t\t\tif (!interactive) {\n\t\t\t\tskipped++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlogger.itemWarn(\n\t\t\t\t`Exists: ${logger.path(metaPath)} (use --force to overwrite)`,\n\t\t\t)\n\t\t\tskipped++\n\t\t\tcontinue\n\t\t}\n\n\t\tconst screenMeta: InferredScreenMeta = {\n\t\t\tid: route.screenId,\n\t\t\ttitle: route.screenTitle,\n\t\t\troute: route.fullPath,\n\t\t}\n\n\t\t// Detect API dependencies if enabled\n\t\tlet detectedApis: string[] = []\n\t\tif (detectApi && apiIntegration && route.componentPath) {\n\t\t\tconst componentAbsPath = resolve(cwd, route.componentPath)\n\t\t\tif (existsSync(componentAbsPath)) {\n\t\t\t\ttry {\n\t\t\t\t\tconst componentContent = readFileSync(componentAbsPath, \"utf-8\")\n\t\t\t\t\tconst result = analyzeApiImports(componentContent, apiIntegration)\n\t\t\t\t\tdetectedApis = result.imports.map((i) => i.dependsOnName)\n\t\t\t\t\tfor (const warning of result.warnings) {\n\t\t\t\t\t\tlogger.warn(`${logger.path(route.componentPath)}: ${warning}`)\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\t\t\tlogger.warn(\n\t\t\t\t\t\t`${logger.path(route.componentPath)}: Could not analyze for API imports: ${message}`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Detect navigation targets if enabled\n\t\tlet detectedNext: string[] = []\n\t\tif (detectNavigation && route.componentPath) {\n\t\t\tconst componentAbsPath = resolve(cwd, route.componentPath)\n\t\t\tif (existsSync(componentAbsPath)) {\n\t\t\t\tlet componentContent: string\n\t\t\t\ttry {\n\t\t\t\t\tcomponentContent = readFileSync(componentAbsPath, \"utf-8\")\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\t\t\tlogger.warn(\n\t\t\t\t\t\t`${logger.path(route.componentPath)}: Could not read file for navigation analysis: ${message}`,\n\t\t\t\t\t)\n\t\t\t\t\tcomponentContent = \"\"\n\t\t\t\t}\n\n\t\t\t\tif (componentContent) {\n\t\t\t\t\t// Use Vue SFC analyzer for .vue files to detect RouterLink in templates\n\t\t\t\t\tif (route.componentPath.endsWith(\".vue\")) {\n\t\t\t\t\t\tconst result = analyzeVueSFC(componentContent, route.componentPath)\n\t\t\t\t\t\tdetectedNext = [\n\t\t\t\t\t\t\t...result.templateNavigations.map((n) => n.screenId),\n\t\t\t\t\t\t\t...result.scriptNavigations.map((n) => n.screenId),\n\t\t\t\t\t\t]\n\t\t\t\t\t\tfor (const warning of result.warnings) {\n\t\t\t\t\t\t\tlogger.warn(`${logger.path(route.componentPath)}: ${warning}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (route.componentPath.endsWith(\".component.ts\")) {\n\t\t\t\t\t\t// Use Angular component analyzer for .component.ts files\n\t\t\t\t\t\tconst result = analyzeAngularComponent(\n\t\t\t\t\t\t\tcomponentContent,\n\t\t\t\t\t\t\troute.componentPath,\n\t\t\t\t\t\t\tcwd,\n\t\t\t\t\t\t)\n\t\t\t\t\t\tdetectedNext = [\n\t\t\t\t\t\t\t...result.templateNavigations.map((n) => n.screenId),\n\t\t\t\t\t\t\t...result.scriptNavigations.map((n) => n.screenId),\n\t\t\t\t\t\t]\n\t\t\t\t\t\tfor (const warning of result.warnings) {\n\t\t\t\t\t\t\tlogger.warn(`${logger.path(route.componentPath)}: ${warning}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Use standard analyzer for non-Vue files\n\t\t\t\t\t\tconst { framework, detected } =\n\t\t\t\t\t\t\tdetectNavigationFramework(componentContent)\n\t\t\t\t\t\tif (!detected) {\n\t\t\t\t\t\t\tlogger.warn(\n\t\t\t\t\t\t\t\t`${logger.path(route.componentPath)}: Could not detect navigation framework, defaulting to Next.js patterns. Navigation detection may be incomplete.`,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst result = analyzeNavigation(componentContent, framework)\n\t\t\t\t\t\tdetectedNext = result.navigations.map((n) => n.screenId)\n\t\t\t\t\t\tfor (const warning of result.warnings) {\n\t\t\t\t\t\t\tlogger.warn(`${logger.path(route.componentPath)}: ${warning}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (interactive) {\n\t\t\tconst result = await promptForScreen(route.fullPath, screenMeta)\n\n\t\t\tif (result.skip) {\n\t\t\t\tlogger.itemWarn(`Skipped: ${logger.path(metaPath)}`)\n\t\t\t\tskipped++\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst content = generateScreenMetaContent(result.meta, {\n\t\t\t\towner: result.owner,\n\t\t\t\ttags: result.tags,\n\t\t\t\tdependsOn: detectedApis,\n\t\t\t\tnext: detectedNext,\n\t\t\t})\n\n\t\t\tif (dryRun) {\n\t\t\t\tlogDryRunOutput(\n\t\t\t\t\tmetaPath,\n\t\t\t\t\tresult.meta,\n\t\t\t\t\tresult.owner,\n\t\t\t\t\tresult.tags,\n\t\t\t\t\tdetectedApis,\n\t\t\t\t\tdetectedNext,\n\t\t\t\t)\n\t\t\t\tcreated++\n\t\t\t} else if (safeWriteFile(absoluteMetaPath, metaPath, content)) {\n\t\t\t\tcreated++\n\t\t\t}\n\t\t} else {\n\t\t\tconst content = generateScreenMetaContent(screenMeta, {\n\t\t\t\tdependsOn: detectedApis,\n\t\t\t\tnext: detectedNext,\n\t\t\t})\n\n\t\t\tif (dryRun) {\n\t\t\t\tlogDryRunOutput(\n\t\t\t\t\tmetaPath,\n\t\t\t\t\tscreenMeta,\n\t\t\t\t\tundefined,\n\t\t\t\t\tundefined,\n\t\t\t\t\tdetectedApis,\n\t\t\t\t\tdetectedNext,\n\t\t\t\t)\n\t\t\t\tcreated++\n\t\t\t} else if (safeWriteFile(absoluteMetaPath, metaPath, content)) {\n\t\t\t\tcreated++\n\t\t\t}\n\t\t}\n\t}\n\n\tlogSummary(created, skipped, dryRun)\n}\n\nexport interface GenerateFromRoutesPatternOptions {\n\treadonly dryRun: boolean\n\treadonly force: boolean\n\treadonly interactive: boolean\n\treadonly ignore: readonly string[]\n\treadonly detectApi: boolean\n\treadonly detectNavigation: boolean\n\treadonly apiIntegration?: ApiIntegrationConfig\n}\n\n/**\n * Generate screen.meta.ts files from route files matching a glob pattern\n */\nexport async function generateFromRoutesPattern(\n\troutesPattern: string,\n\tcwd: string,\n\toptions: GenerateFromRoutesPatternOptions,\n): Promise<void> {\n\tconst {\n\t\tdryRun,\n\t\tforce,\n\t\tinteractive,\n\t\tignore,\n\t\tdetectApi,\n\t\tdetectNavigation,\n\t\tapiIntegration,\n\t} = options\n\n\tlogger.info(\"Scanning for route files...\")\n\tlogger.blank()\n\n\t// Find all route files\n\tconst routeFiles = await glob(routesPattern, {\n\t\tcwd,\n\t\tignore,\n\t})\n\n\tif (routeFiles.length === 0) {\n\t\tlogger.warn(`No route files found matching: ${routesPattern}`)\n\t\treturn\n\t}\n\n\tlogger.log(`Found ${routeFiles.length} route files`)\n\tlogger.blank()\n\n\tlet created = 0\n\tlet skipped = 0\n\n\tfor (const routeFile of routeFiles) {\n\t\tconst routeDir = dirname(routeFile)\n\t\tconst metaPath = join(routeDir, \"screen.meta.ts\")\n\t\tconst absoluteMetaPath = join(cwd, metaPath)\n\n\t\tif (!force && existsSync(absoluteMetaPath)) {\n\t\t\tif (!interactive) {\n\t\t\t\tskipped++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlogger.itemWarn(\n\t\t\t\t`Exists: ${logger.path(metaPath)} (use --force to overwrite)`,\n\t\t\t)\n\t\t\tskipped++\n\t\t\tcontinue\n\t\t}\n\n\t\t// Generate screen metadata from path\n\t\tconst screenMeta = inferScreenMeta(routeDir, routesPattern)\n\n\t\t// Detect API dependencies if enabled\n\t\tlet detectedApis: string[] = []\n\t\tif (detectApi && apiIntegration) {\n\t\t\tconst absoluteRouteFile = join(cwd, routeFile)\n\t\t\tif (existsSync(absoluteRouteFile)) {\n\t\t\t\ttry {\n\t\t\t\t\tconst routeContent = readFileSync(absoluteRouteFile, \"utf-8\")\n\t\t\t\t\tconst result = analyzeApiImports(routeContent, apiIntegration)\n\t\t\t\t\tdetectedApis = result.imports.map((i) => i.dependsOnName)\n\t\t\t\t\tfor (const warning of result.warnings) {\n\t\t\t\t\t\tlogger.warn(`${logger.path(routeFile)}: ${warning}`)\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\t\t\tlogger.warn(\n\t\t\t\t\t\t`${logger.path(routeFile)}: Could not analyze for API imports: ${message}`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Detect navigation targets if enabled\n\t\tlet detectedNext: string[] = []\n\t\tif (detectNavigation) {\n\t\t\tconst absoluteRouteFile = join(cwd, routeFile)\n\t\t\tif (existsSync(absoluteRouteFile)) {\n\t\t\t\tlet routeContent: string\n\t\t\t\ttry {\n\t\t\t\t\trouteContent = readFileSync(absoluteRouteFile, \"utf-8\")\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\t\t\tlogger.warn(\n\t\t\t\t\t\t`${logger.path(routeFile)}: Could not read file for navigation analysis: ${message}`,\n\t\t\t\t\t)\n\t\t\t\t\trouteContent = \"\"\n\t\t\t\t}\n\n\t\t\t\tif (routeContent) {\n\t\t\t\t\tconst { framework, detected } =\n\t\t\t\t\t\tdetectNavigationFramework(routeContent)\n\t\t\t\t\tif (!detected) {\n\t\t\t\t\t\tlogger.warn(\n\t\t\t\t\t\t\t`${logger.path(routeFile)}: Could not detect navigation framework, defaulting to Next.js patterns. Navigation detection may be incomplete.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tconst result = analyzeNavigation(routeContent, framework)\n\t\t\t\t\tdetectedNext = result.navigations.map((n) => n.screenId)\n\t\t\t\t\tfor (const warning of result.warnings) {\n\t\t\t\t\t\tlogger.warn(`${logger.path(routeFile)}: ${warning}`)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (interactive) {\n\t\t\tconst result = await promptForScreen(routeFile, screenMeta)\n\n\t\t\tif (result.skip) {\n\t\t\t\tlogger.itemWarn(`Skipped: ${logger.path(metaPath)}`)\n\t\t\t\tskipped++\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst content = generateScreenMetaContent(result.meta, {\n\t\t\t\towner: result.owner,\n\t\t\t\ttags: result.tags,\n\t\t\t\tdependsOn: detectedApis,\n\t\t\t\tnext: detectedNext,\n\t\t\t})\n\n\t\t\tif (dryRun) {\n\t\t\t\tlogDryRunOutput(\n\t\t\t\t\tmetaPath,\n\t\t\t\t\tresult.meta,\n\t\t\t\t\tresult.owner,\n\t\t\t\t\tresult.tags,\n\t\t\t\t\tdetectedApis,\n\t\t\t\t\tdetectedNext,\n\t\t\t\t)\n\t\t\t\tcreated++\n\t\t\t} else if (safeWriteFile(absoluteMetaPath, metaPath, content)) {\n\t\t\t\tcreated++\n\t\t\t}\n\t\t} else {\n\t\t\tconst content = generateScreenMetaContent(screenMeta, {\n\t\t\t\tdependsOn: detectedApis,\n\t\t\t\tnext: detectedNext,\n\t\t\t})\n\n\t\t\tif (dryRun) {\n\t\t\t\tlogDryRunOutput(\n\t\t\t\t\tmetaPath,\n\t\t\t\t\tscreenMeta,\n\t\t\t\t\tundefined,\n\t\t\t\t\tundefined,\n\t\t\t\t\tdetectedApis,\n\t\t\t\t\tdetectedNext,\n\t\t\t\t)\n\t\t\t\tcreated++\n\t\t\t} else if (safeWriteFile(absoluteMetaPath, metaPath, content)) {\n\t\t\t\tcreated++\n\t\t\t}\n\t\t}\n\t}\n\n\tlogSummary(created, skipped, dryRun)\n}\n\n/**\n * Determine where to place screen.meta.ts for a route\n */\nfunction determineMetaPath(route: FlatRoute, cwd: string): string {\n\t// If component path is available, place screen.meta.ts next to it\n\tif (route.componentPath) {\n\t\tconst componentDir = dirname(route.componentPath)\n\t\tconst relativePath = relative(cwd, componentDir)\n\t\t// Ensure path doesn't escape cwd\n\t\tif (!relativePath.startsWith(\"..\")) {\n\t\t\treturn join(relativePath, \"screen.meta.ts\")\n\t\t}\n\t}\n\n\t// Fall back to src/screens/{screenId}/screen.meta.ts\n\tconst screenDir = route.screenId.replace(/\\./g, \"/\")\n\treturn join(\"src\", \"screens\", screenDir, \"screen.meta.ts\")\n}\n\n/**\n * Ensure the directory for a file exists\n */\nfunction ensureDirectoryExists(filePath: string): void {\n\tconst dir = dirname(filePath)\n\tif (!existsSync(dir)) {\n\t\ttry {\n\t\t\tmkdirSync(dir, { recursive: true })\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\t\tthrow new Error(`Failed to create directory \"${dir}\": ${message}`)\n\t\t}\n\t}\n}\n\n/**\n * Safely write a file with error handling\n * Returns true if successful, false if failed\n */\nfunction safeWriteFile(\n\tabsolutePath: string,\n\trelativePath: string,\n\tcontent: string,\n): boolean {\n\ttry {\n\t\tensureDirectoryExists(absolutePath)\n\t\twriteFileSync(absolutePath, content)\n\t\tlogger.itemSuccess(`Created: ${logger.path(relativePath)}`)\n\t\treturn true\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tlogger.itemError(\n\t\t\t`Failed to create ${logger.path(relativePath)}: ${message}`,\n\t\t)\n\t\treturn false\n\t}\n}\n\n/**\n * Log dry run output for a screen\n */\nfunction logDryRunOutput(\n\tmetaPath: string,\n\tmeta: InferredScreenMeta,\n\towner?: string[],\n\ttags?: string[],\n\tdependsOn?: string[],\n\tnext?: string[],\n): void {\n\tlogger.step(`Would create: ${logger.path(metaPath)}`)\n\tlogger.log(` ${logger.dim(`id: \"${meta.id}\"`)}`)\n\tlogger.log(` ${logger.dim(`title: \"${meta.title}\"`)}`)\n\tlogger.log(` ${logger.dim(`route: \"${meta.route}\"`)}`)\n\tif (owner && owner.length > 0) {\n\t\tlogger.log(\n\t\t\t` ${logger.dim(`owner: [${owner.map((o) => `\"${o}\"`).join(\", \")}]`)}`,\n\t\t)\n\t}\n\tif (tags && tags.length > 0) {\n\t\tlogger.log(\n\t\t\t` ${logger.dim(`tags: [${tags.map((t) => `\"${t}\"`).join(\", \")}]`)}`,\n\t\t)\n\t}\n\tif (dependsOn && dependsOn.length > 0) {\n\t\tlogger.log(\n\t\t\t` ${logger.dim(`dependsOn: [${dependsOn.map((d) => `\"${d}\"`).join(\", \")}]`)}`,\n\t\t)\n\t}\n\tif (next && next.length > 0) {\n\t\tlogger.log(\n\t\t\t` ${logger.dim(`next: [${next.map((n) => `\"${n}\"`).join(\", \")}]`)}`,\n\t\t)\n\t}\n\tlogger.blank()\n}\n\n/**\n * Log summary after generation\n */\nfunction logSummary(created: number, skipped: number, dryRun: boolean): void {\n\tlogger.blank()\n\tif (dryRun) {\n\t\tlogger.info(`Would create ${created} files (${skipped} already exist)`)\n\t\tlogger.blank()\n\t\tlogger.log(`Run without ${logger.code(\"--dry-run\")} to create files`)\n\t} else {\n\t\tlogger.done(`Created ${created} files (${skipped} skipped)`)\n\t\tif (created > 0) {\n\t\t\tlogger.blank()\n\t\t\tlogger.log(logger.bold(\"Next steps:\"))\n\t\t\tlogger.log(\" 1. Review and customize the generated screen.meta.ts files\")\n\t\t\tlogger.log(\n\t\t\t\t` 2. Run ${logger.code(\"screenbook dev\")} to view your screen catalog`,\n\t\t\t)\n\t\t}\n\t}\n}\n\n/**\n * Subset of Screen containing only auto-inferred fields.\n * Uses Pick to ensure type alignment with the core Screen type.\n */\ntype InferredScreenMeta = Pick<Screen, \"id\" | \"title\" | \"route\">\n\ninterface InteractiveResult {\n\tskip: boolean\n\tmeta: InferredScreenMeta\n\towner: string[]\n\ttags: string[]\n}\n\n/**\n * Parse comma-separated string into array\n */\nexport function parseCommaSeparated(input: string): string[] {\n\tif (!input.trim()) return []\n\treturn input\n\t\t.split(\",\")\n\t\t.map((s) => s.trim())\n\t\t.filter(Boolean)\n}\n\n/**\n * Prompt user for screen metadata in interactive mode\n */\nasync function promptForScreen(\n\trouteFile: string,\n\tinferred: InferredScreenMeta,\n): Promise<InteractiveResult> {\n\tlogger.blank()\n\tlogger.info(`Found: ${logger.path(routeFile)}`)\n\tlogger.blank()\n\tlogger.log(\n\t\t` ${logger.dim(\"ID:\")} ${inferred.id} ${logger.dim(\"(inferred)\")}`,\n\t)\n\tlogger.log(\n\t\t` ${logger.dim(\"Title:\")} ${inferred.title} ${logger.dim(\"(inferred)\")}`,\n\t)\n\tlogger.log(\n\t\t` ${logger.dim(\"Route:\")} ${inferred.route} ${logger.dim(\"(inferred)\")}`,\n\t)\n\tlogger.blank()\n\n\tconst response = await prompts([\n\t\t{\n\t\t\ttype: \"confirm\",\n\t\t\tname: \"proceed\",\n\t\t\tmessage: \"Generate this screen?\",\n\t\t\tinitial: true,\n\t\t},\n\t\t{\n\t\t\ttype: (prev) => (prev ? \"text\" : null),\n\t\t\tname: \"id\",\n\t\t\tmessage: \"ID\",\n\t\t\tinitial: inferred.id,\n\t\t},\n\t\t{\n\t\t\ttype: (_prev, values) => (values.proceed ? \"text\" : null),\n\t\t\tname: \"title\",\n\t\t\tmessage: \"Title\",\n\t\t\tinitial: inferred.title,\n\t\t},\n\t\t{\n\t\t\ttype: (_prev, values) => (values.proceed ? \"text\" : null),\n\t\t\tname: \"owner\",\n\t\t\tmessage: \"Owner (comma-separated)\",\n\t\t\tinitial: \"\",\n\t\t},\n\t\t{\n\t\t\ttype: (_prev, values) => (values.proceed ? \"text\" : null),\n\t\t\tname: \"tags\",\n\t\t\tmessage: \"Tags (comma-separated)\",\n\t\t\tinitial: inferred.id.split(\".\")[0] || \"\",\n\t\t},\n\t])\n\n\tif (!response.proceed) {\n\t\treturn { skip: true, meta: inferred, owner: [], tags: [] }\n\t}\n\n\treturn {\n\t\tskip: false,\n\t\tmeta: {\n\t\t\tid: response.id || inferred.id,\n\t\t\ttitle: response.title || inferred.title,\n\t\t\troute: inferred.route,\n\t\t},\n\t\towner: parseCommaSeparated(response.owner || \"\"),\n\t\ttags: parseCommaSeparated(response.tags || \"\"),\n\t}\n}\n\n/**\n * Infer screen metadata from the route file path\n */\nfunction inferScreenMeta(\n\trouteDir: string,\n\troutesPattern: string,\n): InferredScreenMeta {\n\t// Extract base directory from pattern (e.g., \"src/pages\" from \"src/pages/**/page.tsx\")\n\tconst patternBase = routesPattern.split(\"*\")[0]?.replace(/\\/$/, \"\") ?? \"\"\n\n\t// Get relative path from pattern base\n\tconst relativePath = relative(patternBase, routeDir)\n\n\t// Handle root route\n\tif (!relativePath || relativePath === \".\") {\n\t\treturn {\n\t\t\tid: \"home\",\n\t\t\ttitle: \"Home\",\n\t\t\troute: \"/\",\n\t\t}\n\t}\n\n\t// Clean up path segments (remove route groups like (marketing), handle dynamic segments)\n\tconst segments = relativePath\n\t\t.split(\"/\")\n\t\t.filter((s) => s && !s.startsWith(\"(\") && !s.endsWith(\")\"))\n\t\t.map((s) =>\n\t\t\ts.replace(/^\\[\\.\\.\\..*\\]$/, \"catchall\").replace(/^\\[(.+)\\]$/, \"$1\"),\n\t\t)\n\n\t// Generate ID from segments (e.g., \"billing.invoice.detail\")\n\tconst id = segments.join(\".\")\n\n\t// Generate title from last segment (e.g., \"Invoice Detail\" from \"invoice-detail\")\n\tconst lastSegment = segments[segments.length - 1] || \"home\"\n\tconst title = lastSegment\n\t\t.split(/[-_]/)\n\t\t.map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(\" \")\n\n\t// Generate route from path (e.g., \"/billing/invoice/:id\")\n\tconst routeSegments = relativePath\n\t\t.split(\"/\")\n\t\t.filter((s) => s && !s.startsWith(\"(\") && !s.endsWith(\")\"))\n\t\t.map((s) => {\n\t\t\t// Convert [id] to :id, [...slug] to *\n\t\t\tif (s.startsWith(\"[...\") && s.endsWith(\"]\")) {\n\t\t\t\treturn \"*\"\n\t\t\t}\n\t\t\tif (s.startsWith(\"[\") && s.endsWith(\"]\")) {\n\t\t\t\treturn `:${s.slice(1, -1)}`\n\t\t\t}\n\t\t\treturn s\n\t\t})\n\tconst route = `/${routeSegments.join(\"/\")}`\n\n\treturn { id, title, route }\n}\n\ntype GenerateOptions = Partial<\n\tPick<Screen, \"owner\" | \"tags\" | \"dependsOn\" | \"next\">\n>\n\n/**\n * Generate screen.meta.ts file content\n */\nfunction generateScreenMetaContent(\n\tmeta: InferredScreenMeta,\n\toptions?: GenerateOptions,\n): string {\n\t// Use provided values or infer defaults\n\tconst owner = options?.owner ?? []\n\tconst tags =\n\t\toptions?.tags && options.tags.length > 0\n\t\t\t? options.tags\n\t\t\t: [meta.id.split(\".\")[0] || \"general\"]\n\tconst dependsOn = options?.dependsOn ?? []\n\tconst next = options?.next ?? []\n\n\tconst ownerStr =\n\t\towner.length > 0 ? `[${owner.map((o) => `\"${o}\"`).join(\", \")}]` : \"[]\"\n\tconst tagsStr = `[${tags.map((t) => `\"${t}\"`).join(\", \")}]`\n\tconst dependsOnStr =\n\t\tdependsOn.length > 0\n\t\t\t? `[${dependsOn.map((d) => `\"${d}\"`).join(\", \")}]`\n\t\t\t: \"[]\"\n\tconst nextStr =\n\t\tnext.length > 0 ? `[${next.map((n) => `\"${n}\"`).join(\", \")}]` : \"[]\"\n\n\t// Generate dependsOn comment based on whether APIs were detected\n\tconst dependsOnComment =\n\t\tdependsOn.length > 0\n\t\t\t? \"// Auto-detected API dependencies (add more as needed)\"\n\t\t\t: `// APIs/services this screen depends on (for impact analysis)\n\t// Example: [\"UserAPI.getProfile\", \"PaymentService.checkout\"]`\n\n\t// Generate next comment based on whether navigation was detected\n\tconst nextComment =\n\t\tnext.length > 0\n\t\t\t? \"// Auto-detected navigation targets (add more as needed)\"\n\t\t\t: \"// Screen IDs this screen can navigate to\"\n\n\treturn `import { defineScreen } from \"@screenbook/core\"\n\nexport const screen = defineScreen({\n\tid: \"${meta.id}\",\n\ttitle: \"${meta.title}\",\n\troute: \"${meta.route}\",\n\n\t// Team or individual responsible for this screen\n\towner: ${ownerStr},\n\n\t// Tags for filtering in the catalog\n\ttags: ${tagsStr},\n\n\t${dependsOnComment}\n\tdependsOn: ${dependsOnStr},\n\n\t// Screen IDs that can navigate to this screen\n\tentryPoints: [],\n\n\t${nextComment}\n\tnext: ${nextStr},\n})\n`\n}\n","import type { Screen } from \"@screenbook/core\"\n\nexport interface TransitiveDependency {\n\tscreen: Screen\n\tpath: string[]\n}\n\nexport interface ImpactResult {\n\tapi: string\n\tdirect: Screen[]\n\ttransitive: TransitiveDependency[]\n\ttotalCount: number\n}\n\n/**\n * Check if a screen's dependsOn matches the API name (supports partial matching).\n * - \"InvoiceAPI\" matches \"InvoiceAPI.getDetail\"\n * - \"InvoiceAPI.getDetail\" matches \"InvoiceAPI.getDetail\"\n */\nfunction matchesDependency(dependency: string, apiName: string): boolean {\n\t// Exact match\n\tif (dependency === apiName) {\n\t\treturn true\n\t}\n\t// Partial match: apiName is a prefix of dependency\n\tif (dependency.startsWith(`${apiName}.`)) {\n\t\treturn true\n\t}\n\t// Partial match: dependency is a prefix of apiName\n\tif (apiName.startsWith(`${dependency}.`)) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n/**\n * Find screens that directly depend on the given API.\n */\nfunction findDirectDependents(screens: Screen[], apiName: string): Screen[] {\n\treturn screens.filter((screen) =>\n\t\tscreen.dependsOn?.some((dep) => matchesDependency(dep, apiName)),\n\t)\n}\n\n/**\n * Build a reverse navigation graph: screenId -> screens that can navigate to it.\n * This is built from the `entryPoints` field.\n */\nfunction _buildReverseNavigationGraph(\n\tscreens: Screen[],\n): Map<string, Set<string>> {\n\tconst graph = new Map<string, Set<string>>()\n\n\tfor (const screen of screens) {\n\t\t// entryPoints lists screens that can navigate TO this screen\n\t\t// So we want to find screens that navigate FROM here\n\t\t// Actually, we need to reverse: if A.entryPoints includes B,\n\t\t// then B can navigate to A, so B is affected if A is affected\n\n\t\t// For transitive analysis:\n\t\t// If screen A depends on API, and screen B has entryPoints: [\"A\"],\n\t\t// then B can navigate to A, meaning users can reach A from B\n\t\t// So if A is impacted, we should show B as transitively impacted\n\n\t\tif (!screen.entryPoints) continue\n\n\t\tfor (const entryPoint of screen.entryPoints) {\n\t\t\tif (!graph.has(screen.id)) {\n\t\t\t\tgraph.set(screen.id, new Set())\n\t\t\t}\n\t\t\tgraph.get(screen.id)?.add(entryPoint)\n\t\t}\n\t}\n\n\treturn graph\n}\n\n/**\n * Build a navigation graph from `next` field: screenId -> screens it can navigate to.\n */\nfunction buildNavigationGraph(screens: Screen[]): Map<string, Set<string>> {\n\tconst graph = new Map<string, Set<string>>()\n\n\tfor (const screen of screens) {\n\t\tif (!screen.next) continue\n\n\t\tif (!graph.has(screen.id)) {\n\t\t\tgraph.set(screen.id, new Set())\n\t\t}\n\t\tfor (const nextId of screen.next) {\n\t\t\tgraph.get(screen.id)?.add(nextId)\n\t\t}\n\t}\n\n\treturn graph\n}\n\n/**\n * Find all transitive dependents using BFS.\n * A screen is transitively dependent if it can navigate to a directly dependent screen.\n */\nfunction findTransitiveDependents(\n\tscreens: Screen[],\n\tdirectDependentIds: Set<string>,\n\tmaxDepth: number,\n): TransitiveDependency[] {\n\tconst _screenMap = new Map(screens.map((s) => [s.id, s]))\n\tconst navigationGraph = buildNavigationGraph(screens)\n\tconst transitive: TransitiveDependency[] = []\n\tconst visited = new Set<string>()\n\n\t// For each screen, check if it can reach a directly dependent screen\n\tfor (const screen of screens) {\n\t\tif (directDependentIds.has(screen.id)) {\n\t\t\tcontinue // Skip direct dependents\n\t\t}\n\n\t\tconst path = findPathToDirectDependent(\n\t\t\tscreen.id,\n\t\t\tdirectDependentIds,\n\t\t\tnavigationGraph,\n\t\t\tmaxDepth,\n\t\t\tnew Set(),\n\t\t)\n\n\t\tif (path && !visited.has(screen.id)) {\n\t\t\tvisited.add(screen.id)\n\t\t\ttransitive.push({\n\t\t\t\tscreen,\n\t\t\t\tpath,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn transitive\n}\n\n/**\n * Find a path from a screen to any directly dependent screen using BFS.\n */\nfunction findPathToDirectDependent(\n\tstartId: string,\n\ttargetIds: Set<string>,\n\tgraph: Map<string, Set<string>>,\n\tmaxDepth: number,\n\tvisited: Set<string>,\n): string[] | null {\n\tif (visited.has(startId)) {\n\t\treturn null\n\t}\n\n\tconst queue: Array<{ id: string; path: string[] }> = [\n\t\t{ id: startId, path: [startId] },\n\t]\n\tconst localVisited = new Set<string>([startId])\n\n\twhile (queue.length > 0) {\n\t\tconst current = queue.shift()\n\t\tif (!current) break\n\n\t\tif (current.path.length > maxDepth + 1) {\n\t\t\tcontinue\n\t\t}\n\n\t\tconst neighbors = graph.get(current.id)\n\t\tif (!neighbors) {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor (const neighborId of neighbors) {\n\t\t\tif (localVisited.has(neighborId)) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst newPath = [...current.path, neighborId]\n\n\t\t\t// Check if path exceeds maxDepth (path includes start, so maxDepth+1 is the max length)\n\t\t\tif (newPath.length > maxDepth + 1) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif (targetIds.has(neighborId)) {\n\t\t\t\treturn newPath\n\t\t\t}\n\n\t\t\tlocalVisited.add(neighborId)\n\t\t\tqueue.push({ id: neighborId, path: newPath })\n\t\t}\n\t}\n\n\treturn null\n}\n\n/**\n * Analyze the impact of a change to an API on the screen catalog.\n */\nexport function analyzeImpact(\n\tscreens: Screen[],\n\tapiName: string,\n\tmaxDepth = 3,\n): ImpactResult {\n\t// Find direct dependents\n\tconst direct = findDirectDependents(screens, apiName)\n\tconst directIds = new Set(direct.map((s) => s.id))\n\n\t// Find transitive dependents\n\tconst transitive = findTransitiveDependents(screens, directIds, maxDepth)\n\n\treturn {\n\t\tapi: apiName,\n\t\tdirect,\n\t\ttransitive,\n\t\ttotalCount: direct.length + transitive.length,\n\t}\n}\n\n/**\n * Format the impact result as text output.\n */\nexport function formatImpactText(result: ImpactResult): string {\n\tconst lines: string[] = []\n\n\tlines.push(`Impact Analysis: ${result.api}`)\n\tlines.push(\"\")\n\n\tif (result.direct.length > 0) {\n\t\tlines.push(\n\t\t\t`Direct (${result.direct.length} screen${result.direct.length > 1 ? \"s\" : \"\"}):`,\n\t\t)\n\t\tfor (const screen of result.direct) {\n\t\t\tconst owner = screen.owner?.length ? ` [${screen.owner.join(\", \")}]` : \"\"\n\t\t\tlines.push(` - ${screen.id} ${screen.route}${owner}`)\n\t\t}\n\t\tlines.push(\"\")\n\t}\n\n\tif (result.transitive.length > 0) {\n\t\tlines.push(\n\t\t\t`Transitive (${result.transitive.length} screen${result.transitive.length > 1 ? \"s\" : \"\"}):`,\n\t\t)\n\t\tfor (const { path } of result.transitive) {\n\t\t\tlines.push(` - ${path.join(\" -> \")}`)\n\t\t}\n\t\tlines.push(\"\")\n\t}\n\n\tif (result.totalCount === 0) {\n\t\tlines.push(\"No screens depend on this API.\")\n\t\tlines.push(\"\")\n\t} else {\n\t\tlines.push(\n\t\t\t`Total: ${result.totalCount} screen${result.totalCount > 1 ? \"s\" : \"\"} affected`,\n\t\t)\n\t}\n\n\treturn lines.join(\"\\n\")\n}\n\n/**\n * Format the impact result as JSON output.\n */\nexport function formatImpactJson(result: ImpactResult): string {\n\treturn JSON.stringify(\n\t\t{\n\t\t\tapi: result.api,\n\t\t\tsummary: {\n\t\t\t\tdirectCount: result.direct.length,\n\t\t\t\ttransitiveCount: result.transitive.length,\n\t\t\t\ttotalCount: result.totalCount,\n\t\t\t},\n\t\t\tdirect: result.direct.map((s) => ({\n\t\t\t\tid: s.id,\n\t\t\t\ttitle: s.title,\n\t\t\t\troute: s.route,\n\t\t\t\towner: s.owner,\n\t\t\t})),\n\t\t\ttransitive: result.transitive.map(({ screen, path }) => ({\n\t\t\t\tid: screen.id,\n\t\t\t\ttitle: screen.title,\n\t\t\t\troute: screen.route,\n\t\t\t\tpath,\n\t\t\t})),\n\t\t},\n\t\tnull,\n\t\t2,\n\t)\n}\n","import { existsSync, readFileSync } from \"node:fs\"\nimport { join } from \"node:path\"\nimport type { Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport { loadConfig } from \"../utils/config.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport {\n\tanalyzeImpact,\n\tformatImpactJson,\n\tformatImpactText,\n} from \"../utils/impactAnalysis.js\"\nimport { logger } from \"../utils/logger.js\"\n\nexport const impactCommand = define({\n\tname: \"impact\",\n\tdescription: \"Analyze which screens depend on a specific API/service\",\n\targs: {\n\t\tapi: {\n\t\t\ttype: \"positional\",\n\t\t\tdescription:\n\t\t\t\t\"API or service name to analyze (e.g., InvoiceAPI.getDetail)\",\n\t\t\trequired: true,\n\t\t},\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\tformat: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"f\",\n\t\t\tdescription: \"Output format: text (default) or json\",\n\t\t\tdefault: \"text\",\n\t\t},\n\t\tdepth: {\n\t\t\ttype: \"number\",\n\t\t\tshort: \"d\",\n\t\t\tdescription: \"Maximum depth for transitive dependencies\",\n\t\t\tdefault: 3,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst cwd = process.cwd()\n\n\t\tconst apiName = ctx.values.api\n\t\tif (!apiName) {\n\t\t\tlogger.errorWithHelp(ERRORS.API_NAME_REQUIRED)\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tconst format = ctx.values.format ?? \"text\"\n\t\tconst depth = ctx.values.depth ?? 3\n\n\t\t// Load screens.json\n\t\tconst screensPath = join(cwd, config.outDir, \"screens.json\")\n\n\t\tif (!existsSync(screensPath)) {\n\t\t\tlogger.errorWithHelp(ERRORS.SCREENS_NOT_FOUND)\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tlet screens: Screen[]\n\t\ttry {\n\t\t\tconst content = readFileSync(screensPath, \"utf-8\")\n\t\t\tscreens = JSON.parse(content) as Screen[]\n\t\t} catch (error) {\n\t\t\tlogger.errorWithHelp({\n\t\t\t\t...ERRORS.SCREENS_PARSE_ERROR,\n\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t})\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tif (screens.length === 0) {\n\t\t\tlogger.warn(\"No screens found in the catalog.\")\n\t\t\tlogger.blank()\n\t\t\tlogger.log(\"Run 'screenbook generate' to create screen.meta.ts files,\")\n\t\t\tlogger.log(\"then 'screenbook build' to generate the catalog.\")\n\t\t\treturn\n\t\t}\n\n\t\t// Analyze impact\n\t\tconst result = analyzeImpact(screens, apiName, depth)\n\n\t\t// Output result\n\t\tif (format === \"json\") {\n\t\t\tlogger.log(formatImpactJson(result))\n\t\t} else {\n\t\t\tlogger.log(formatImpactText(result))\n\t\t}\n\t},\n})\n","import { existsSync, readFileSync } from \"node:fs\"\nimport { join } from \"node:path\"\nimport prompts from \"prompts\"\n\nexport interface FrameworkInfo {\n\tname: string\n\troutesPattern: string\n\tmetaPattern: string\n}\n\ninterface FrameworkDefinition extends FrameworkInfo {\n\tpackages: string[]\n\tconfigFiles: string[]\n\t/**\n\t * Additional check to distinguish variants (e.g., App Router vs Pages Router)\n\t */\n\tcheck?: (cwd: string) => boolean\n}\n\nconst FRAMEWORKS: FrameworkDefinition[] = [\n\t{\n\t\tname: \"Next.js (App Router)\",\n\t\tpackages: [\"next\"],\n\t\tconfigFiles: [\"next.config.js\", \"next.config.mjs\", \"next.config.ts\"],\n\t\troutesPattern: \"app/**/page.tsx\",\n\t\tmetaPattern: \"app/**/screen.meta.ts\",\n\t\tcheck: (cwd) =>\n\t\t\texistsSync(join(cwd, \"app\")) || existsSync(join(cwd, \"src/app\")),\n\t},\n\t{\n\t\tname: \"Next.js (Pages Router)\",\n\t\tpackages: [\"next\"],\n\t\tconfigFiles: [\"next.config.js\", \"next.config.mjs\", \"next.config.ts\"],\n\t\troutesPattern: \"pages/**/*.tsx\",\n\t\tmetaPattern: \"pages/**/screen.meta.ts\",\n\t\tcheck: (cwd) =>\n\t\t\texistsSync(join(cwd, \"pages\")) || existsSync(join(cwd, \"src/pages\")),\n\t},\n\t{\n\t\tname: \"Remix\",\n\t\tpackages: [\"@remix-run/react\", \"remix\"],\n\t\tconfigFiles: [\"remix.config.js\", \"vite.config.ts\"],\n\t\troutesPattern: \"app/routes/**/*.tsx\",\n\t\tmetaPattern: \"app/routes/**/screen.meta.ts\",\n\t},\n\t{\n\t\tname: \"Nuxt\",\n\t\tpackages: [\"nuxt\"],\n\t\tconfigFiles: [\"nuxt.config.ts\", \"nuxt.config.js\", \"nuxt.config.mjs\"],\n\t\troutesPattern: \"pages/**/*.vue\",\n\t\tmetaPattern: \"pages/**/screen.meta.ts\",\n\t\tcheck: (cwd) => {\n\t\t\t// Nuxt 4 uses app/pages, Nuxt 3 uses pages\n\t\t\tif (existsSync(join(cwd, \"app/pages\"))) {\n\t\t\t\treturn false // Will be handled by Nuxt 4 definition\n\t\t\t}\n\t\t\treturn existsSync(join(cwd, \"pages\"))\n\t\t},\n\t},\n\t{\n\t\tname: \"Nuxt 4\",\n\t\tpackages: [\"nuxt\"],\n\t\tconfigFiles: [\"nuxt.config.ts\", \"nuxt.config.js\"],\n\t\troutesPattern: \"app/pages/**/*.vue\",\n\t\tmetaPattern: \"app/pages/**/screen.meta.ts\",\n\t\tcheck: (cwd) => existsSync(join(cwd, \"app/pages\")),\n\t},\n\t{\n\t\tname: \"Astro\",\n\t\tpackages: [\"astro\"],\n\t\tconfigFiles: [\n\t\t\t\"astro.config.mjs\",\n\t\t\t\"astro.config.js\",\n\t\t\t\"astro.config.ts\",\n\t\t\t\"astro.config.cjs\",\n\t\t],\n\t\troutesPattern: \"src/pages/**/*.astro\",\n\t\tmetaPattern: \"src/pages/**/screen.meta.ts\",\n\t},\n\t{\n\t\tname: \"SolidStart\",\n\t\tpackages: [\"@solidjs/start\"],\n\t\tconfigFiles: [\"app.config.ts\", \"app.config.js\"],\n\t\troutesPattern: \"src/routes/**/*.tsx\",\n\t\tmetaPattern: \"src/routes/**/screen.meta.ts\",\n\t\tcheck: (cwd) => existsSync(join(cwd, \"src/routes\")),\n\t},\n\t{\n\t\tname: \"QwikCity\",\n\t\tpackages: [\"@builder.io/qwik-city\"],\n\t\tconfigFiles: [\"vite.config.ts\", \"vite.config.js\", \"vite.config.mjs\"],\n\t\t// QwikCity uses index.tsx files as page components (e.g., about/index.tsx not about.tsx)\n\t\troutesPattern: \"src/routes/**/index.tsx\",\n\t\tmetaPattern: \"src/routes/**/screen.meta.ts\",\n\t\tcheck: (cwd) => existsSync(join(cwd, \"src/routes\")),\n\t},\n\t{\n\t\tname: \"TanStack Start\",\n\t\tpackages: [\"@tanstack/react-start\", \"@tanstack/start\"],\n\t\tconfigFiles: [\"app.config.ts\", \"app.config.js\"],\n\t\troutesPattern: \"src/routes/**/*.tsx\",\n\t\tmetaPattern: \"src/routes/**/screen.meta.ts\",\n\t\t// TanStack Start requires __root.tsx for file-based routing\n\t\tcheck: (cwd) => existsSync(join(cwd, \"src/routes/__root.tsx\")),\n\t},\n\t{\n\t\tname: \"Vite + Vue\",\n\t\tpackages: [\"vite\", \"vue\"],\n\t\tconfigFiles: [\"vite.config.ts\", \"vite.config.js\", \"vite.config.mjs\"],\n\t\troutesPattern: \"src/pages/**/*.vue\",\n\t\tmetaPattern: \"src/pages/**/screen.meta.ts\",\n\t\t// Check that react is NOT present to avoid matching React projects\n\t\tcheck: (cwd) => {\n\t\t\tconst packageJson = readPackageJson(cwd)\n\t\t\tif (!packageJson) return false\n\t\t\treturn !hasPackage(packageJson, \"react\")\n\t\t},\n\t},\n\t{\n\t\tname: \"Vite + React\",\n\t\tpackages: [\"vite\", \"react\"],\n\t\tconfigFiles: [\"vite.config.ts\", \"vite.config.js\", \"vite.config.mjs\"],\n\t\troutesPattern: \"src/pages/**/*.tsx\",\n\t\tmetaPattern: \"src/pages/**/screen.meta.ts\",\n\t},\n]\n\ninterface PackageJson {\n\tdependencies?: Record<string, string>\n\tdevDependencies?: Record<string, string>\n}\n\nfunction readPackageJson(cwd: string): PackageJson | null {\n\tconst packageJsonPath = join(cwd, \"package.json\")\n\tif (!existsSync(packageJsonPath)) {\n\t\treturn null\n\t}\n\ttry {\n\t\tconst content = readFileSync(packageJsonPath, \"utf-8\")\n\t\treturn JSON.parse(content)\n\t} catch (error) {\n\t\tconsole.warn(\n\t\t\t`Warning: Failed to parse package.json at ${packageJsonPath}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t)\n\t\treturn null\n\t}\n}\n\nfunction hasPackage(packageJson: PackageJson, packageName: string): boolean {\n\treturn !!(\n\t\tpackageJson.dependencies?.[packageName] ||\n\t\tpackageJson.devDependencies?.[packageName]\n\t)\n}\n\nfunction hasConfigFile(cwd: string, configFiles: string[]): boolean {\n\treturn configFiles.some((file) => existsSync(join(cwd, file)))\n}\n\n/**\n * Auto-detect the frontend framework in a project directory.\n * Returns framework info if detected, null otherwise.\n */\nexport function detectFramework(cwd: string): FrameworkInfo | null {\n\tconst packageJson = readPackageJson(cwd)\n\tif (!packageJson) {\n\t\treturn null\n\t}\n\n\tfor (const framework of FRAMEWORKS) {\n\t\t// Check if required packages are present\n\t\tconst hasRequiredPackage = framework.packages.some((pkg) =>\n\t\t\thasPackage(packageJson, pkg),\n\t\t)\n\t\tif (!hasRequiredPackage) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Check for config files\n\t\tconst hasConfig = hasConfigFile(cwd, framework.configFiles)\n\t\tif (!hasConfig) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Run additional check if defined\n\t\tif (framework.check && !framework.check(cwd)) {\n\t\t\tcontinue\n\t\t}\n\n\t\treturn {\n\t\t\tname: framework.name,\n\t\t\troutesPattern: framework.routesPattern,\n\t\t\tmetaPattern: framework.metaPattern,\n\t\t}\n\t}\n\n\treturn null\n}\n\n/**\n * Interactive framework selection when auto-detection fails.\n */\nexport async function promptFrameworkSelection(): Promise<FrameworkInfo | null> {\n\tconst choices = FRAMEWORKS.filter(\n\t\t// Remove duplicates (e.g., Nuxt 4 vs Nuxt)\n\t\t(fw, idx, arr) =>\n\t\t\tarr.findIndex((f) => f.routesPattern === fw.routesPattern) === idx,\n\t).map((fw) => ({\n\t\ttitle: fw.name,\n\t\tvalue: fw,\n\t}))\n\n\tchoices.push({\n\t\ttitle: \"Other (manual configuration)\",\n\t\tvalue: null as unknown as FrameworkDefinition,\n\t})\n\n\tconst response = await prompts({\n\t\ttype: \"select\",\n\t\tname: \"framework\",\n\t\tmessage: \"Select your frontend framework:\",\n\t\tchoices,\n\t})\n\n\tif (!response.framework) {\n\t\treturn null\n\t}\n\n\treturn {\n\t\tname: response.framework.name,\n\t\troutesPattern: response.framework.routesPattern,\n\t\tmetaPattern: response.framework.metaPattern,\n\t}\n}\n\n/**\n * Detect framework or prompt user if detection fails.\n */\nexport async function detectOrPromptFramework(\n\tcwd: string,\n): Promise<FrameworkInfo | null> {\n\tconst detected = detectFramework(cwd)\n\tif (detected) {\n\t\treturn detected\n\t}\n\treturn promptFrameworkSelection()\n}\n","/**\n * Check if the current environment supports interactive prompts.\n * Returns false in CI environments or when stdin is not a TTY.\n */\nexport function isInteractive(): boolean {\n\t// Standard CI environment variables (check for any truthy value)\n\tif (process.env.CI || process.env.CONTINUOUS_INTEGRATION) {\n\t\treturn false\n\t}\n\n\t// CI-specific environment variables not covered by the generic CI flag\n\tif (\n\t\tprocess.env.GITHUB_ACTIONS ||\n\t\tprocess.env.GITLAB_CI ||\n\t\tprocess.env.JENKINS_URL\n\t) {\n\t\treturn false\n\t}\n\n\t// TTY check - false if stdin is not a terminal\n\treturn process.stdin.isTTY === true\n}\n","import { spawn } from \"node:child_process\"\nimport {\n\tcopyFileSync,\n\texistsSync,\n\tmkdirSync,\n\treadFileSync,\n\twriteFileSync,\n} from \"node:fs\"\nimport { createRequire } from \"node:module\"\nimport { dirname, join, resolve } from \"node:path\"\nimport type { Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport { createJiti } from \"jiti\"\nimport prompts from \"prompts\"\nimport { glob } from \"tinyglobby\"\nimport {\n\tdetectFramework,\n\ttype FrameworkInfo,\n\tpromptFrameworkSelection,\n} from \"../utils/detectFramework.js\"\nimport { isInteractive } from \"../utils/isInteractive.js\"\nimport { logger } from \"../utils/logger.js\"\nimport {\n\ttype GenerateFromRoutesPatternOptions,\n\tgenerateFromRoutesPattern,\n} from \"./generate.js\"\n\nexport function generateConfigTemplate(\n\tframework: FrameworkInfo | null,\n): string {\n\tif (framework) {\n\t\treturn `import { defineConfig } from \"@screenbook/core\"\n\nexport default defineConfig({\n\t// Auto-detected: ${framework.name}\n\tmetaPattern: \"${framework.metaPattern}\",\n\troutesPattern: \"${framework.routesPattern}\",\n\toutDir: \".screenbook\",\n})\n`\n\t}\n\n\t// Fallback template when no framework detected\n\treturn `import { defineConfig } from \"@screenbook/core\"\n\nexport default defineConfig({\n\t// Glob pattern for screen metadata files\n\tmetaPattern: \"src/**/screen.meta.ts\",\n\n\t// Glob pattern for route files (uncomment and adjust for your framework):\n\t// routesPattern: \"src/pages/**/page.tsx\", // Vite/React\n\t// routesPattern: \"app/**/page.tsx\", // Next.js App Router\n\t// routesPattern: \"pages/**/*.tsx\", // Next.js Pages Router\n\t// routesPattern: \"app/routes/**/*.tsx\", // Remix\n\t// routesPattern: \"pages/**/*.vue\", // Nuxt\n\t// routesPattern: \"src/pages/**/*.astro\", // Astro\n\n\toutDir: \".screenbook\",\n})\n`\n}\n\nfunction printValueProposition(): void {\n\tlogger.blank()\n\tlogger.log(logger.bold(\"What Screenbook gives you:\"))\n\tlogger.log(\" - Screen catalog with search & filter\")\n\tlogger.log(\" - Navigation graph visualization\")\n\tlogger.log(\" - Impact analysis (API -> affected screens)\")\n\tlogger.log(\" - CI lint for documentation coverage\")\n}\n\nfunction printNextSteps(hasRoutesPattern: boolean): void {\n\tlogger.blank()\n\tlogger.log(logger.bold(\"Next steps:\"))\n\tif (hasRoutesPattern) {\n\t\tlogger.log(\n\t\t\t` 1. Run ${logger.code(\"screenbook generate\")} to auto-create screen.meta.ts files`,\n\t\t)\n\t\tlogger.log(\n\t\t\t` 2. Run ${logger.code(\"screenbook dev\")} to start the UI server`,\n\t\t)\n\t} else {\n\t\tlogger.log(\" 1. Configure routesPattern in screenbook.config.ts\")\n\t\tlogger.log(\n\t\t\t` 2. Run ${logger.code(\"screenbook generate\")} to auto-create screen.meta.ts files`,\n\t\t)\n\t\tlogger.log(\n\t\t\t` 3. Run ${logger.code(\"screenbook dev\")} to start the UI server`,\n\t\t)\n\t}\n\tlogger.blank()\n\tlogger.log(\"screen.meta.ts files are created alongside your route files:\")\n\tlogger.blank()\n\tlogger.log(logger.dim(\" src/pages/dashboard/\"))\n\tlogger.log(logger.dim(\" page.tsx # Your route file\"))\n\tlogger.log(\n\t\tlogger.dim(\" screen.meta.ts # Auto-generated, customize as needed\"),\n\t)\n}\n\nexport interface ResolveOptionParams {\n\texplicitValue: boolean | undefined\n\tyesAll: boolean\n\tciMode: boolean\n\tciDefault: boolean\n\tpromptMessage: string\n}\n\n/**\n * Resolve a boolean option with priority order:\n * 1. Explicit flag (e.g., --generate or --no-generate) takes precedence\n * 2. -y flag enables all optional features\n * 3. Non-interactive environments (CI mode or no TTY) fall back to ciDefault\n * 4. Otherwise, prompt the user interactively\n */\nexport async function resolveOption(\n\tparams: ResolveOptionParams,\n): Promise<boolean> {\n\tconst { explicitValue, yesAll, ciMode, ciDefault, promptMessage } = params\n\n\t// Priority 1: Explicit flag takes precedence\n\tif (explicitValue !== undefined) {\n\t\treturn explicitValue\n\t}\n\n\t// Priority 2: -y flag answers yes to all\n\tif (yesAll) {\n\t\treturn true\n\t}\n\n\t// Priority 3: Non-interactive environments use ciDefault\n\tif (ciMode || !isInteractive()) {\n\t\treturn ciDefault\n\t}\n\n\t// Priority 4: Interactive prompt\n\tconst response = await prompts({\n\t\ttype: \"confirm\",\n\t\tname: \"value\",\n\t\tmessage: promptMessage,\n\t\tinitial: true,\n\t})\n\n\t// Handle user cancellation (Ctrl+C)\n\tif (response.value === undefined) {\n\t\tlogger.blank()\n\t\tlogger.info(\"Operation cancelled\")\n\t\tprocess.exit(0)\n\t}\n\n\treturn response.value\n}\n\nasync function countRouteFiles(\n\troutesPattern: string,\n\tcwd: string,\n): Promise<number> {\n\tconst files = await glob(routesPattern, { cwd })\n\treturn files.length\n}\n\nasync function runGenerate(routesPattern: string, cwd: string): Promise<void> {\n\tconst options: GenerateFromRoutesPatternOptions = {\n\t\tdryRun: false,\n\t\tforce: false,\n\t\tinteractive: false,\n\t\tignore: [\"**/node_modules/**\"],\n\t\tdetectApi: false,\n\t\tdetectNavigation: false,\n\t\tapiIntegration: undefined,\n\t}\n\n\tawait generateFromRoutesPattern(routesPattern, cwd, options)\n}\n\nasync function buildScreensForDev(\n\tmetaPattern: string,\n\toutDir: string,\n\tcwd: string,\n): Promise<void> {\n\tconst files = await glob(metaPattern, {\n\t\tcwd,\n\t\tignore: [\"**/node_modules/**\"],\n\t})\n\n\tif (files.length === 0) {\n\t\tlogger.warn(`No screen.meta.ts files found matching: ${metaPattern}`)\n\t\treturn\n\t}\n\n\ttype ScreenWithFilePath = Screen & { filePath: string }\n\n\tconst jiti = createJiti(cwd)\n\tconst screens: ScreenWithFilePath[] = []\n\n\tfor (const file of files) {\n\t\tconst absolutePath = resolve(cwd, file)\n\n\t\ttry {\n\t\t\tconst module = (await jiti.import(absolutePath)) as { screen?: Screen }\n\t\t\tif (module.screen) {\n\t\t\t\tscreens.push({ ...module.screen, filePath: absolutePath })\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// Log failed files so users can diagnose issues\n\t\t\tlogger.itemWarn(`Failed to load ${file}`)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tlogger.log(` ${logger.dim(error.message)}`)\n\t\t\t}\n\t\t}\n\t}\n\n\tconst outputPath = join(cwd, outDir, \"screens.json\")\n\tconst outputDir = dirname(outputPath)\n\n\tif (!existsSync(outputDir)) {\n\t\tmkdirSync(outputDir, { recursive: true })\n\t}\n\n\twriteFileSync(outputPath, JSON.stringify(screens, null, 2))\n}\n\nfunction resolveUiPackage(): string | null {\n\ttry {\n\t\tconst require = createRequire(import.meta.url)\n\t\tconst uiPackageJson = require.resolve(\"@screenbook/ui/package.json\")\n\t\treturn dirname(uiPackageJson)\n\t} catch {\n\t\tconst possiblePaths = [\n\t\t\tjoin(process.cwd(), \"node_modules\", \"@screenbook\", \"ui\"),\n\t\t\tjoin(process.cwd(), \"..\", \"ui\"),\n\t\t\tjoin(process.cwd(), \"packages\", \"ui\"),\n\t\t]\n\n\t\tfor (const p of possiblePaths) {\n\t\t\tif (existsSync(join(p, \"package.json\"))) {\n\t\t\t\treturn p\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n}\n\nasync function startDevServer(\n\tmetaPattern: string,\n\toutDir: string,\n\tcwd: string,\n\tport: string,\n): Promise<void> {\n\t// Build screens first\n\tawait buildScreensForDev(metaPattern, outDir, cwd)\n\n\t// Find the UI package\n\tconst uiPackagePath = resolveUiPackage()\n\n\tif (!uiPackagePath) {\n\t\tlogger.warn(\"Could not find @screenbook/ui package\")\n\t\tlogger.log(\n\t\t\t` Run ${logger.code(\"npm install @screenbook/ui\")} to install it`,\n\t\t)\n\t\treturn\n\t}\n\n\t// Copy screens.json to UI package\n\tconst screensJsonPath = join(cwd, outDir, \"screens.json\")\n\tconst uiScreensDir = join(uiPackagePath, \".screenbook\")\n\n\tif (!existsSync(uiScreensDir)) {\n\t\tmkdirSync(uiScreensDir, { recursive: true })\n\t}\n\n\tif (existsSync(screensJsonPath)) {\n\t\tcopyFileSync(screensJsonPath, join(uiScreensDir, \"screens.json\"))\n\t}\n\n\t// Start Astro dev server\n\tlogger.blank()\n\tlogger.info(\n\t\t`Starting UI server on ${logger.highlight(`http://localhost:${port}`)}`,\n\t)\n\tlogger.blank()\n\n\tconst astroProcess = spawn(\"npx\", [\"astro\", \"dev\", \"--port\", port], {\n\t\tcwd: uiPackagePath,\n\t\tstdio: \"inherit\",\n\t\tshell: true,\n\t})\n\n\tastroProcess.on(\"error\", (error) => {\n\t\tlogger.error(`Failed to start server: ${error.message}`)\n\t\tprocess.exit(1)\n\t})\n\n\tastroProcess.on(\"close\", (code) => {\n\t\tprocess.exit(code ?? 0)\n\t})\n\n\t// Handle graceful shutdown\n\tprocess.on(\"SIGINT\", () => {\n\t\tastroProcess.kill(\"SIGINT\")\n\t})\n\n\tprocess.on(\"SIGTERM\", () => {\n\t\tastroProcess.kill(\"SIGTERM\")\n\t})\n}\n\nexport const initCommand = define({\n\tname: \"init\",\n\tdescription: \"Initialize Screenbook in a project\",\n\targs: {\n\t\tforce: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"f\",\n\t\t\tdescription: \"Overwrite existing files\",\n\t\t\tdefault: false,\n\t\t},\n\t\tskipDetect: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription: \"Skip framework auto-detection\",\n\t\t\tdefault: false,\n\t\t},\n\t\tgenerate: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription: \"Auto-generate screen.meta.ts files (--no-generate to skip)\",\n\t\t\tdefault: undefined,\n\t\t\tnegatable: true,\n\t\t},\n\t\tdev: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription: \"Start development server after init (--no-dev to skip)\",\n\t\t\tdefault: undefined,\n\t\t\tnegatable: true,\n\t\t},\n\t\tyes: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"y\",\n\t\t\tdescription: \"Answer yes to all prompts\",\n\t\t\tdefault: false,\n\t\t},\n\t\tci: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription: \"CI mode (no prompts, generate only)\",\n\t\t\tdefault: false,\n\t\t},\n\t\tport: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"p\",\n\t\t\tdescription: \"Port for the dev server\",\n\t\t\tdefault: \"4321\",\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst cwd = process.cwd()\n\t\tconst force = ctx.values.force ?? false\n\t\tconst skipDetect = ctx.values.skipDetect ?? false\n\t\tconst generateFlag = ctx.values.generate\n\t\tconst devFlag = ctx.values.dev\n\t\tconst yesAll = ctx.values.yes ?? false\n\t\tconst ciMode = ctx.values.ci ?? false\n\t\tconst port = ctx.values.port ?? \"4321\"\n\n\t\tlogger.info(\"Initializing Screenbook...\")\n\t\tlogger.blank()\n\n\t\t// Framework detection\n\t\tlet framework: FrameworkInfo | null = null\n\n\t\tif (!skipDetect) {\n\t\t\tframework = detectFramework(cwd)\n\n\t\t\tif (framework) {\n\t\t\t\tlogger.itemSuccess(`Detected: ${framework.name}`)\n\t\t\t} else {\n\t\t\t\tlogger.log(\" Could not auto-detect framework\")\n\n\t\t\t\t// Only prompt for framework selection in interactive mode\n\t\t\t\tif (!ciMode && isInteractive()) {\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tframework = await promptFrameworkSelection()\n\n\t\t\t\t\tif (framework) {\n\t\t\t\t\t\tlogger.blank()\n\t\t\t\t\t\tlogger.itemSuccess(`Selected: ${framework.name}`)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Create screenbook.config.ts\n\t\tconst configPath = join(cwd, \"screenbook.config.ts\")\n\t\tif (!force && existsSync(configPath)) {\n\t\t\tlogger.log(\n\t\t\t\t` ${logger.dim(\"-\")} screenbook.config.ts already exists ${logger.dim(\"(skipped)\")}`,\n\t\t\t)\n\t\t} else {\n\t\t\tconst configContent = generateConfigTemplate(framework)\n\t\t\twriteFileSync(configPath, configContent)\n\t\t\tlogger.itemSuccess(\"Created screenbook.config.ts\")\n\t\t}\n\n\t\t// Update .gitignore\n\t\tconst gitignorePath = join(cwd, \".gitignore\")\n\t\tconst screenbookIgnore = \".screenbook\"\n\n\t\tif (existsSync(gitignorePath)) {\n\t\t\tconst gitignoreContent = readFileSync(gitignorePath, \"utf-8\")\n\t\t\tif (!gitignoreContent.includes(screenbookIgnore)) {\n\t\t\t\tconst newContent = `${gitignoreContent.trimEnd()}\\n\\n# Screenbook\\n${screenbookIgnore}\\n`\n\t\t\t\twriteFileSync(gitignorePath, newContent)\n\t\t\t\tlogger.itemSuccess(\"Added .screenbook to .gitignore\")\n\t\t\t} else {\n\t\t\t\tlogger.log(\n\t\t\t\t\t` ${logger.dim(\"-\")} .screenbook already in .gitignore ${logger.dim(\"(skipped)\")}`,\n\t\t\t\t)\n\t\t\t}\n\t\t} else {\n\t\t\twriteFileSync(gitignorePath, `# Screenbook\\n${screenbookIgnore}\\n`)\n\t\t\tlogger.itemSuccess(\"Created .gitignore with .screenbook\")\n\t\t}\n\n\t\tlogger.blank()\n\t\tlogger.done(\"Screenbook initialized successfully!\")\n\n\t\t// If no framework detected or no routesPattern, show traditional next steps\n\t\tif (!framework?.routesPattern) {\n\t\t\tprintValueProposition()\n\t\t\tprintNextSteps(false)\n\t\t\treturn\n\t\t}\n\n\t\t// Count route files\n\t\tconst routeFileCount = await countRouteFiles(framework.routesPattern, cwd)\n\n\t\tif (routeFileCount === 0) {\n\t\t\tprintValueProposition()\n\t\t\tprintNextSteps(true)\n\t\t\treturn\n\t\t}\n\n\t\t// Prompt for generate\n\t\tlogger.blank()\n\t\tconst shouldGenerate = await resolveOption({\n\t\t\texplicitValue: generateFlag,\n\t\t\tyesAll,\n\t\t\tciMode,\n\t\t\tciDefault: true,\n\t\t\tpromptMessage: `Found ${routeFileCount} route files. Generate screen.meta.ts files?`,\n\t\t})\n\n\t\tif (!shouldGenerate) {\n\t\t\tprintValueProposition()\n\t\t\tprintNextSteps(true)\n\t\t\treturn\n\t\t}\n\n\t\t// Run generate\n\t\tlogger.blank()\n\t\tlogger.info(\"Generating screen metadata...\")\n\t\tlogger.blank()\n\n\t\tawait runGenerate(framework.routesPattern, cwd)\n\n\t\t// In CI mode, skip dev server\n\t\tif (ciMode) {\n\t\t\tlogger.blank()\n\t\t\tlogger.done(\"Initialization complete!\")\n\t\t\treturn\n\t\t}\n\n\t\t// Prompt for dev server\n\t\tlogger.blank()\n\t\tconst shouldDev = await resolveOption({\n\t\t\texplicitValue: devFlag,\n\t\t\tyesAll,\n\t\t\tciMode,\n\t\t\tciDefault: false,\n\t\t\tpromptMessage: \"Start the development server?\",\n\t\t})\n\n\t\tif (!shouldDev) {\n\t\t\tlogger.blank()\n\t\t\tlogger.log(logger.bold(\"Next step:\"))\n\t\t\tlogger.log(\n\t\t\t\t` Run ${logger.code(\"screenbook dev\")} to start the UI server`,\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\t// Start dev server\n\t\tlogger.blank()\n\t\tlogger.info(\"Starting development server...\")\n\n\t\tawait startDevServer(framework.metaPattern, \".screenbook\", cwd, port)\n\t},\n})\n","import { existsSync, readFileSync } from \"node:fs\"\nimport { dirname, join, relative, resolve } from \"node:path\"\nimport type { AdoptionConfig, Config, Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport { minimatch } from \"minimatch\"\nimport { glob } from \"tinyglobby\"\nimport { parseAngularRouterConfig } from \"../utils/angularRouterParser.js\"\nimport { loadConfig } from \"../utils/config.js\"\nimport {\n\tdetectCycles,\n\tformatCycleWarnings,\n\tgetCycleSummary,\n} from \"../utils/cycleDetection.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport { logger } from \"../utils/logger.js\"\nimport {\n\tdetectRouterType,\n\tparseReactRouterConfig,\n} from \"../utils/reactRouterParser.js\"\nimport type { FlatRoute, ParseResult } from \"../utils/routeParserUtils.js\"\nimport { flattenRoutes } from \"../utils/routeParserUtils.js\"\nimport { parseSolidRouterConfig } from \"../utils/solidRouterParser.js\"\nimport { parseTanStackRouterConfig } from \"../utils/tanstackRouterParser.js\"\nimport { parseVueRouterConfig } from \"../utils/vueRouterParser.js\"\n\nexport const lintCommand = define({\n\tname: \"lint\",\n\tdescription: \"Detect routes without screen.meta.ts files\",\n\targs: {\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\tallowCycles: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription: \"Suppress circular navigation warnings\",\n\t\t\tdefault: false,\n\t\t},\n\t\tstrict: {\n\t\t\ttype: \"boolean\",\n\t\t\tshort: \"s\",\n\t\t\tdescription: \"Fail on disallowed cycles\",\n\t\t\tdefault: false,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst cwd = process.cwd()\n\t\tconst adoption = config.adoption ?? { mode: \"full\" }\n\t\tlet hasWarnings = false\n\n\t\t// Check for routes configuration\n\t\tif (!config.routesPattern && !config.routesFile) {\n\t\t\tlogger.errorWithHelp(ERRORS.ROUTES_PATTERN_MISSING)\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tlogger.info(\"Linting screen metadata coverage...\")\n\t\tif (adoption.mode === \"progressive\") {\n\t\t\tlogger.log(`Mode: Progressive adoption`)\n\t\t\tif (adoption.includePatterns?.length) {\n\t\t\t\tlogger.log(`Checking: ${adoption.includePatterns.join(\", \")}`)\n\t\t\t}\n\t\t\tif (adoption.minimumCoverage != null) {\n\t\t\t\tlogger.log(`Minimum coverage: ${adoption.minimumCoverage}%`)\n\t\t\t}\n\t\t}\n\t\tlogger.blank()\n\n\t\t// Use routesFile mode (config-based routing)\n\t\tif (config.routesFile) {\n\t\t\tawait lintRoutesFile(\n\t\t\t\tconfig.routesFile,\n\t\t\t\tcwd,\n\t\t\t\tconfig,\n\t\t\t\tadoption,\n\t\t\t\tctx.values.allowCycles ?? false,\n\t\t\t\tctx.values.strict ?? false,\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\t// Use routesPattern mode (file-based routing)\n\t\t// Find all route files\n\t\tlet routeFiles = await glob(config.routesPattern as string, {\n\t\t\tcwd,\n\t\t\tignore: config.ignore,\n\t\t})\n\n\t\t// In progressive mode, filter to only included patterns\n\t\tif (adoption.mode === \"progressive\" && adoption.includePatterns?.length) {\n\t\t\trouteFiles = routeFiles.filter((file) =>\n\t\t\t\tadoption.includePatterns?.some((pattern) => minimatch(file, pattern)),\n\t\t\t)\n\t\t}\n\n\t\tif (routeFiles.length === 0) {\n\t\t\tlogger.warn(`No route files found matching: ${config.routesPattern}`)\n\t\t\tif (adoption.mode === \"progressive\" && adoption.includePatterns?.length) {\n\t\t\t\tlogger.log(\n\t\t\t\t\t` ${logger.dim(`(filtered by includePatterns: ${adoption.includePatterns.join(\", \")})`)}`,\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\t// Find all screen.meta.ts files\n\t\tconst metaFiles = await glob(config.metaPattern, {\n\t\t\tcwd,\n\t\t\tignore: config.ignore,\n\t\t})\n\n\t\t// Build a set of directories that have screen.meta.ts\n\t\tconst metaDirs = new Set<string>()\n\t\tfor (const metaFile of metaFiles) {\n\t\t\tmetaDirs.add(dirname(metaFile))\n\t\t}\n\n\t\t// Check each route file - simple colocation check\n\t\tconst missingMeta: string[] = []\n\t\tconst covered: string[] = []\n\n\t\tfor (const routeFile of routeFiles) {\n\t\t\tconst routeDir = dirname(routeFile)\n\n\t\t\t// Check if there's a screen.meta.ts in the same directory\n\t\t\tif (metaDirs.has(routeDir)) {\n\t\t\t\tcovered.push(routeFile)\n\t\t\t} else {\n\t\t\t\tmissingMeta.push(routeFile)\n\t\t\t}\n\t\t}\n\n\t\t// Report results\n\t\tconst total = routeFiles.length\n\t\tconst coveredCount = covered.length\n\t\tconst missingCount = missingMeta.length\n\t\tconst coveragePercent = Math.round((coveredCount / total) * 100)\n\n\t\tlogger.log(`Found ${total} route files`)\n\t\tlogger.log(`Coverage: ${coveredCount}/${total} (${coveragePercent}%)`)\n\t\tlogger.blank()\n\n\t\t// Determine if lint should fail\n\t\tconst minimumCoverage = adoption.minimumCoverage ?? 100\n\t\tconst passedCoverage = coveragePercent >= minimumCoverage\n\n\t\tif (missingCount > 0) {\n\t\t\tlogger.log(`Missing screen.meta.ts (${missingCount} files):`)\n\t\t\tlogger.blank()\n\n\t\t\tfor (const file of missingMeta) {\n\t\t\t\tconst suggestedMetaPath = join(dirname(file), \"screen.meta.ts\")\n\t\t\t\tlogger.itemError(file)\n\t\t\t\tlogger.log(` ${logger.dim(\"→\")} ${logger.path(suggestedMetaPath)}`)\n\t\t\t}\n\n\t\t\tlogger.blank()\n\t\t}\n\n\t\tif (!passedCoverage) {\n\t\t\tlogger.error(\n\t\t\t\t`Lint failed: Coverage ${coveragePercent}% is below minimum ${minimumCoverage}%`,\n\t\t\t)\n\t\t\tprocess.exit(1)\n\t\t} else if (missingCount > 0) {\n\t\t\tlogger.success(\n\t\t\t\t`Coverage ${coveragePercent}% meets minimum ${minimumCoverage}%`,\n\t\t\t)\n\t\t\tif (adoption.mode === \"progressive\") {\n\t\t\t\tlogger.log(\n\t\t\t\t\t` ${logger.dim(\"Tip:\")} Increase minimumCoverage in config to gradually improve coverage`,\n\t\t\t\t)\n\t\t\t}\n\t\t} else {\n\t\t\tlogger.done(\"All routes have screen.meta.ts files\")\n\t\t}\n\n\t\t// Check for orphan screens (unreachable screens) and cycles\n\t\tconst screensPath = join(cwd, config.outDir, \"screens.json\")\n\t\tif (existsSync(screensPath)) {\n\t\t\ttry {\n\t\t\t\tconst content = readFileSync(screensPath, \"utf-8\")\n\t\t\t\tconst screens = JSON.parse(content) as Screen[]\n\n\t\t\t\t// Check for orphan screens\n\t\t\t\tconst orphans = findOrphanScreens(screens)\n\n\t\t\t\tif (orphans.length > 0) {\n\t\t\t\t\thasWarnings = true\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.warn(`Orphan screens detected (${orphans.length}):`)\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.log(\" These screens have no entryPoints and are not\")\n\t\t\t\t\tlogger.log(\" referenced in any other screen's 'next' array.\")\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tfor (const orphan of orphans) {\n\t\t\t\t\t\tlogger.itemWarn(`${orphan.id} ${logger.dim(orphan.route)}`)\n\t\t\t\t\t}\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t` ${logger.dim(\"Consider adding entryPoints or removing these screens.\")}`,\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\t// Check for circular navigation\n\t\t\t\tif (!ctx.values.allowCycles) {\n\t\t\t\t\tconst cycleResult = detectCycles(screens)\n\t\t\t\t\tif (cycleResult.hasCycles) {\n\t\t\t\t\t\thasWarnings = true\n\t\t\t\t\t\tlogger.blank()\n\t\t\t\t\t\tlogger.warn(getCycleSummary(cycleResult))\n\t\t\t\t\t\tlogger.log(formatCycleWarnings(cycleResult.cycles))\n\t\t\t\t\t\tlogger.blank()\n\t\t\t\t\t\tif (cycleResult.disallowedCycles.length > 0) {\n\t\t\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t\t\t` ${logger.dim(\"Use 'allowCycles: true' in screen.meta.ts to allow intentional cycles.\")}`,\n\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\tif (ctx.values.strict) {\n\t\t\t\t\t\t\t\tlogger.blank()\n\t\t\t\t\t\t\t\tlogger.errorWithHelp(\n\t\t\t\t\t\t\t\t\tERRORS.CYCLES_DETECTED(cycleResult.disallowedCycles.length),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tprocess.exit(1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check for invalid navigation references\n\t\t\t\tconst invalidNavs = findInvalidNavigations(screens)\n\t\t\t\tif (invalidNavs.length > 0) {\n\t\t\t\t\thasWarnings = true\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.warn(`Invalid navigation targets (${invalidNavs.length}):`)\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t\" These navigation references point to non-existent screens.\",\n\t\t\t\t\t)\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tfor (const inv of invalidNavs) {\n\t\t\t\t\t\tlogger.itemWarn(\n\t\t\t\t\t\t\t`${inv.screenId} → ${logger.dim(inv.field)}: \"${inv.target}\"`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t` ${logger.dim(\"Check that these screen IDs exist in your codebase.\")}`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t// Handle specific error types\n\t\t\t\tif (error instanceof SyntaxError) {\n\t\t\t\t\tlogger.warn(\"Failed to parse screens.json - file may be corrupted\")\n\t\t\t\t\tlogger.log(` ${logger.dim(\"Run 'screenbook build' to regenerate.\")}`)\n\t\t\t\t\thasWarnings = true\n\t\t\t\t} else if (error instanceof Error) {\n\t\t\t\t\tlogger.warn(`Failed to analyze screens.json: ${error.message}`)\n\t\t\t\t\thasWarnings = true\n\t\t\t\t} else {\n\t\t\t\t\tlogger.warn(`Failed to analyze screens.json: ${String(error)}`)\n\t\t\t\t\thasWarnings = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasWarnings) {\n\t\t\tlogger.blank()\n\t\t\tlogger.warn(\"Lint completed with warnings.\")\n\t\t}\n\t},\n})\n\n/**\n * Lint screen.meta.ts coverage for routesFile mode (config-based routing)\n */\nasync function lintRoutesFile(\n\troutesFile: string,\n\tcwd: string,\n\tconfig: Pick<Config, \"metaPattern\" | \"outDir\" | \"ignore\">,\n\tadoption: AdoptionConfig,\n\tallowCycles: boolean,\n\tstrict: boolean,\n): Promise<boolean> {\n\tlet hasWarnings = false\n\tconst absoluteRoutesFile = resolve(cwd, routesFile)\n\n\t// Check if routes file exists\n\tif (!existsSync(absoluteRoutesFile)) {\n\t\tlogger.errorWithHelp(ERRORS.ROUTES_FILE_NOT_FOUND(routesFile))\n\t\tprocess.exit(1)\n\t}\n\n\tlogger.log(`Parsing routes from ${logger.path(routesFile)}...`)\n\tlogger.blank()\n\n\t// Parse the routes file with auto-detection\n\tlet flatRoutes: FlatRoute[]\n\ttry {\n\t\tconst content = readFileSync(absoluteRoutesFile, \"utf-8\")\n\t\tconst routerType = detectRouterType(content)\n\n\t\tlet parseResult: ParseResult\n\t\tif (routerType === \"tanstack-router\") {\n\t\t\tparseResult = parseTanStackRouterConfig(absoluteRoutesFile, content)\n\t\t} else if (routerType === \"solid-router\") {\n\t\t\tparseResult = parseSolidRouterConfig(absoluteRoutesFile, content)\n\t\t} else if (routerType === \"angular-router\") {\n\t\t\tparseResult = parseAngularRouterConfig(absoluteRoutesFile, content)\n\t\t} else if (routerType === \"react-router\") {\n\t\t\tparseResult = parseReactRouterConfig(absoluteRoutesFile, content)\n\t\t} else if (routerType === \"vue-router\") {\n\t\t\tparseResult = parseVueRouterConfig(absoluteRoutesFile, content)\n\t\t} else {\n\t\t\t// Unknown router type - warn user and attempt Vue Router parser as fallback\n\t\t\tlogger.warn(\n\t\t\t\t`Could not auto-detect router type for ${logger.path(routesFile)}. Attempting to parse as Vue Router.`,\n\t\t\t)\n\t\t\tlogger.log(\n\t\t\t\t` ${logger.dim(\"If parsing fails, check that your router imports are explicit.\")}`,\n\t\t\t)\n\t\t\thasWarnings = true\n\t\t\tparseResult = parseVueRouterConfig(absoluteRoutesFile, content)\n\t\t}\n\n\t\t// Show warnings\n\t\tfor (const warning of parseResult.warnings) {\n\t\t\tlogger.warn(warning)\n\t\t\thasWarnings = true\n\t\t}\n\n\t\tflatRoutes = flattenRoutes(parseResult.routes)\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error)\n\t\tlogger.errorWithHelp(ERRORS.ROUTES_FILE_PARSE_ERROR(routesFile, message))\n\t\tprocess.exit(1)\n\t}\n\n\tif (flatRoutes.length === 0) {\n\t\tlogger.warn(\"No routes found in the config file\")\n\t\treturn hasWarnings\n\t}\n\n\t// Find all screen.meta.ts files\n\tconst metaFiles = await glob(config.metaPattern, {\n\t\tcwd,\n\t\tignore: config.ignore,\n\t})\n\n\t// Build a set of directories that have screen.meta.ts\n\tconst metaDirs = new Set<string>()\n\t// Also build a map from directory basename to full path for component name matching\n\tconst metaDirsByName = new Map<string, string>()\n\tfor (const metaFile of metaFiles) {\n\t\tconst dir = dirname(metaFile)\n\t\tmetaDirs.add(dir)\n\t\t// Store lowercase basename for case-insensitive matching\n\t\tconst baseName = dir.split(\"/\").pop()?.toLowerCase() || \"\"\n\t\tif (baseName) {\n\t\t\tmetaDirsByName.set(baseName, dir)\n\t\t}\n\t}\n\n\t// Check each route for screen.meta.ts coverage\n\tconst missingMeta: FlatRoute[] = []\n\tconst covered: FlatRoute[] = []\n\n\tfor (const route of flatRoutes) {\n\t\t// Skip layout routes (components ending with \"Layout\" that typically don't need screen.meta)\n\t\tif (route.componentPath?.endsWith(\"Layout\")) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Try multiple matching strategies\n\t\tlet matched = false\n\n\t\t// Strategy 1: Check by determineMetaDir (path-based matching)\n\t\tconst metaPath = determineMetaDir(route, cwd)\n\t\tif (metaDirs.has(metaPath)) {\n\t\t\tmatched = true\n\t\t}\n\n\t\t// Strategy 2: Match by component name (for React Router)\n\t\tif (!matched && route.componentPath) {\n\t\t\tconst componentName = route.componentPath.toLowerCase()\n\t\t\tif (metaDirsByName.has(componentName)) {\n\t\t\t\tmatched = true\n\t\t\t}\n\n\t\t\t// Also try matching the last word of component name\n\t\t\t// e.g., \"UserProfile\" -> check for \"profile\" directory\n\t\t\tif (!matched) {\n\t\t\t\t// Split by uppercase letters to get parts\n\t\t\t\tconst parts = route.componentPath.split(/(?=[A-Z])/)\n\t\t\t\tconst lastPart = parts[parts.length - 1]\n\t\t\t\tif (parts.length > 1 && lastPart) {\n\t\t\t\t\tif (metaDirsByName.has(lastPart.toLowerCase())) {\n\t\t\t\t\t\tmatched = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Strategy 3: Match by screenId path pattern\n\t\tif (!matched) {\n\t\t\tconst screenPath = route.screenId.replace(/\\./g, \"/\")\n\t\t\tfor (const dir of metaDirs) {\n\t\t\t\tif (dir.endsWith(screenPath)) {\n\t\t\t\t\tmatched = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (matched) {\n\t\t\tcovered.push(route)\n\t\t} else {\n\t\t\tmissingMeta.push(route)\n\t\t}\n\t}\n\n\t// Report results\n\tconst total = covered.length + missingMeta.length\n\tconst coveredCount = covered.length\n\tconst missingCount = missingMeta.length\n\tconst coveragePercent = Math.round((coveredCount / total) * 100)\n\n\tlogger.log(`Found ${total} routes`)\n\tlogger.log(`Coverage: ${coveredCount}/${total} (${coveragePercent}%)`)\n\tlogger.blank()\n\n\t// Determine if lint should fail\n\tconst minimumCoverage = adoption.minimumCoverage ?? 100\n\tconst passedCoverage = coveragePercent >= minimumCoverage\n\n\tif (missingCount > 0) {\n\t\tlogger.log(`Missing screen.meta.ts (${missingCount} routes):`)\n\t\tlogger.blank()\n\n\t\tfor (const route of missingMeta) {\n\t\t\tconst suggestedMetaPath = determineSuggestedMetaPath(route, cwd)\n\t\t\tlogger.itemError(\n\t\t\t\t`${route.fullPath} ${logger.dim(`(${route.screenId})`)}`,\n\t\t\t)\n\t\t\tlogger.log(` ${logger.dim(\"→\")} ${logger.path(suggestedMetaPath)}`)\n\t\t}\n\n\t\tlogger.blank()\n\t}\n\n\tif (!passedCoverage) {\n\t\tlogger.error(\n\t\t\t`Lint failed: Coverage ${coveragePercent}% is below minimum ${minimumCoverage}%`,\n\t\t)\n\t\tprocess.exit(1)\n\t} else if (missingCount > 0) {\n\t\tlogger.success(\n\t\t\t`Coverage ${coveragePercent}% meets minimum ${minimumCoverage}%`,\n\t\t)\n\t\tif (adoption.mode === \"progressive\") {\n\t\t\tlogger.log(\n\t\t\t\t` ${logger.dim(\"Tip:\")} Increase minimumCoverage in config to gradually improve coverage`,\n\t\t\t)\n\t\t}\n\t} else {\n\t\tlogger.done(\"All routes have screen.meta.ts files\")\n\t}\n\n\t// Check for orphan screens and cycles using screens.json\n\tconst screensPath = join(cwd, config.outDir, \"screens.json\")\n\tif (existsSync(screensPath)) {\n\t\ttry {\n\t\t\tconst content = readFileSync(screensPath, \"utf-8\")\n\t\t\tconst screens = JSON.parse(content) as Screen[]\n\n\t\t\t// Check for orphan screens\n\t\t\tconst orphans = findOrphanScreens(screens)\n\n\t\t\tif (orphans.length > 0) {\n\t\t\t\thasWarnings = true\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.warn(`Orphan screens detected (${orphans.length}):`)\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(\" These screens have no entryPoints and are not\")\n\t\t\t\tlogger.log(\" referenced in any other screen's 'next' array.\")\n\t\t\t\tlogger.blank()\n\t\t\t\tfor (const orphan of orphans) {\n\t\t\t\t\tlogger.itemWarn(`${orphan.id} ${logger.dim(orphan.route)}`)\n\t\t\t\t}\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(\n\t\t\t\t\t` ${logger.dim(\"Consider adding entryPoints or removing these screens.\")}`,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t// Check for circular navigation\n\t\t\tif (!allowCycles) {\n\t\t\t\tconst cycleResult = detectCycles(screens)\n\t\t\t\tif (cycleResult.hasCycles) {\n\t\t\t\t\thasWarnings = true\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tlogger.warn(getCycleSummary(cycleResult))\n\t\t\t\t\tlogger.log(formatCycleWarnings(cycleResult.cycles))\n\t\t\t\t\tlogger.blank()\n\t\t\t\t\tif (cycleResult.disallowedCycles.length > 0) {\n\t\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t\t` ${logger.dim(\"Use 'allowCycles: true' in screen.meta.ts to allow intentional cycles.\")}`,\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\tif (strict) {\n\t\t\t\t\t\t\tlogger.blank()\n\t\t\t\t\t\t\tlogger.errorWithHelp(\n\t\t\t\t\t\t\t\tERRORS.CYCLES_DETECTED(cycleResult.disallowedCycles.length),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tprocess.exit(1)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check for invalid navigation references\n\t\t\tconst invalidNavs = findInvalidNavigations(screens)\n\t\t\tif (invalidNavs.length > 0) {\n\t\t\t\thasWarnings = true\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.warn(`Invalid navigation targets (${invalidNavs.length}):`)\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(\n\t\t\t\t\t\" These navigation references point to non-existent screens.\",\n\t\t\t\t)\n\t\t\t\tlogger.blank()\n\t\t\t\tfor (const inv of invalidNavs) {\n\t\t\t\t\tlogger.itemWarn(\n\t\t\t\t\t\t`${inv.screenId} → ${logger.dim(inv.field)}: \"${inv.target}\"`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(\n\t\t\t\t\t` ${logger.dim(\"Check that these screen IDs exist in your codebase.\")}`,\n\t\t\t\t)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (error instanceof SyntaxError) {\n\t\t\t\tlogger.warn(\"Failed to parse screens.json - file may be corrupted\")\n\t\t\t\tlogger.log(` ${logger.dim(\"Run 'screenbook build' to regenerate.\")}`)\n\t\t\t\thasWarnings = true\n\t\t\t} else if (error instanceof Error) {\n\t\t\t\tlogger.warn(`Failed to analyze screens.json: ${error.message}`)\n\t\t\t\thasWarnings = true\n\t\t\t} else {\n\t\t\t\tlogger.warn(`Failed to analyze screens.json: ${String(error)}`)\n\t\t\t\thasWarnings = true\n\t\t\t}\n\t\t}\n\t}\n\n\tif (hasWarnings) {\n\t\tlogger.blank()\n\t\tlogger.warn(\"Lint completed with warnings.\")\n\t}\n\n\treturn hasWarnings\n}\n\n/**\n * Determine the directory where screen.meta.ts should be for a route\n */\nfunction determineMetaDir(route: FlatRoute, cwd: string): string {\n\t// If component path is available, check relative to component directory\n\tif (route.componentPath) {\n\t\tconst componentDir = dirname(route.componentPath)\n\t\tconst relativePath = relative(cwd, componentDir)\n\t\t// Ensure path doesn't escape cwd\n\t\tif (!relativePath.startsWith(\"..\")) {\n\t\t\treturn relativePath\n\t\t}\n\t}\n\n\t// Fall back to src/screens/{screenId} convention\n\tconst screenDir = route.screenId.replace(/\\./g, \"/\")\n\treturn join(\"src\", \"screens\", screenDir)\n}\n\n/**\n * Determine the suggested screen.meta.ts path for a route\n */\nfunction determineSuggestedMetaPath(route: FlatRoute, cwd: string): string {\n\tconst metaDir = determineMetaDir(route, cwd)\n\treturn join(metaDir, \"screen.meta.ts\")\n}\n\ninterface InvalidNavigation {\n\tscreenId: string\n\tfield: string\n\ttarget: string\n}\n\n/**\n * Find navigation references that point to non-existent screens.\n * Checks `next`, `entryPoints` arrays and mock navigation targets.\n */\nfunction findInvalidNavigations(screens: Screen[]): InvalidNavigation[] {\n\tconst screenIds = new Set(screens.map((s) => s.id))\n\tconst invalid: InvalidNavigation[] = []\n\n\tfor (const screen of screens) {\n\t\t// Check next array\n\t\tif (screen.next) {\n\t\t\tfor (const target of screen.next) {\n\t\t\t\tif (!screenIds.has(target)) {\n\t\t\t\t\tinvalid.push({ screenId: screen.id, field: \"next\", target })\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check entryPoints array\n\t\tif (screen.entryPoints) {\n\t\t\tfor (const target of screen.entryPoints) {\n\t\t\t\tif (!screenIds.has(target)) {\n\t\t\t\t\tinvalid.push({ screenId: screen.id, field: \"entryPoints\", target })\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn invalid\n}\n\n/**\n * Find screens that are unreachable (orphans).\n * A screen is an orphan if:\n * - It has no entryPoints defined\n * - AND it's not referenced in any other screen's `next` array\n */\nfunction findOrphanScreens(screens: Screen[]): Screen[] {\n\t// Build a set of all screen IDs that are referenced in `next` arrays\n\tconst referencedIds = new Set<string>()\n\tfor (const screen of screens) {\n\t\tif (screen.next) {\n\t\t\tfor (const nextId of screen.next) {\n\t\t\t\treferencedIds.add(nextId)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Find orphan screens\n\tconst orphans: Screen[] = []\n\tfor (const screen of screens) {\n\t\tconst hasEntryPoints = screen.entryPoints && screen.entryPoints.length > 0\n\t\tconst isReferenced = referencedIds.has(screen.id)\n\n\t\t// A screen is an orphan if it has no entry points AND is not referenced\n\t\tif (!hasEntryPoints && !isReferenced) {\n\t\t\torphans.push(screen)\n\t\t}\n\t}\n\n\treturn orphans\n}\n","import { basename, dirname } from \"node:path\"\nimport type { ImpactResult } from \"./impactAnalysis.js\"\n\n/**\n * Extract potential API names from changed file paths.\n * Looks for common API file patterns.\n */\nexport function extractApiNames(files: string[]): string[] {\n\tconst apis = new Set<string>()\n\n\tfor (const file of files) {\n\t\tconst fileName = basename(file, \".ts\")\n\t\t\t.replace(/\\.tsx?$/, \"\")\n\t\t\t.replace(/\\.js$/, \"\")\n\t\t\t.replace(/\\.jsx?$/, \"\")\n\n\t\tconst dirName = basename(dirname(file))\n\n\t\t// Pattern: src/api/InvoiceAPI.ts -> InvoiceAPI\n\t\tif (\n\t\t\tfile.includes(\"/api/\") ||\n\t\t\tfile.includes(\"/apis/\") ||\n\t\t\tfile.includes(\"/services/\")\n\t\t) {\n\t\t\tif (\n\t\t\t\tfileName.endsWith(\"API\") ||\n\t\t\t\tfileName.endsWith(\"Api\") ||\n\t\t\t\tfileName.endsWith(\"Service\")\n\t\t\t) {\n\t\t\t\tapis.add(fileName)\n\t\t\t}\n\t\t}\n\n\t\t// Pattern: src/services/invoice/index.ts -> InvoiceService\n\t\tif (\n\t\t\tfile.includes(\"/services/\") &&\n\t\t\t(fileName === \"index\" || fileName === dirName)\n\t\t) {\n\t\t\tconst serviceName = `${capitalize(dirName)}Service`\n\t\t\tapis.add(serviceName)\n\t\t}\n\n\t\t// Pattern: src/api/invoice.ts -> InvoiceAPI\n\t\tif (file.includes(\"/api/\") || file.includes(\"/apis/\")) {\n\t\t\tif (!fileName.endsWith(\"API\") && !fileName.endsWith(\"Api\")) {\n\t\t\t\tconst apiName = `${capitalize(fileName)}API`\n\t\t\t\tapis.add(apiName)\n\t\t\t}\n\t\t}\n\n\t\t// Pattern: explicit API/Service file names\n\t\tif (\n\t\t\tfileName.toLowerCase().includes(\"api\") ||\n\t\t\tfileName.toLowerCase().includes(\"service\")\n\t\t) {\n\t\t\tapis.add(fileName)\n\t\t}\n\t}\n\n\treturn Array.from(apis).sort()\n}\n\nexport function capitalize(str: string): string {\n\treturn str.charAt(0).toUpperCase() + str.slice(1)\n}\n\n/**\n * Format the results as Markdown for PR comments.\n */\nexport function formatMarkdown(\n\tchangedFiles: string[],\n\tdetectedApis: string[],\n\tresults: ImpactResult[],\n): string {\n\tconst lines: string[] = []\n\n\tlines.push(\"## Screenbook Impact Analysis\")\n\tlines.push(\"\")\n\n\tif (results.length === 0) {\n\t\tlines.push(\"No screen impacts detected from the API changes in this PR.\")\n\t\tlines.push(\"\")\n\t\tlines.push(\"<details>\")\n\t\tlines.push(\"<summary>Detected APIs (no screen dependencies)</summary>\")\n\t\tlines.push(\"\")\n\t\tfor (const api of detectedApis) {\n\t\t\tlines.push(`- \\`${api}\\``)\n\t\t}\n\t\tlines.push(\"\")\n\t\tlines.push(\"</details>\")\n\t\treturn lines.join(\"\\n\")\n\t}\n\n\t// Summary\n\tconst totalDirect = results.reduce((sum, r) => sum + r.direct.length, 0)\n\tconst totalTransitive = results.reduce(\n\t\t(sum, r) => sum + r.transitive.length,\n\t\t0,\n\t)\n\tconst totalScreens = totalDirect + totalTransitive\n\n\tlines.push(\n\t\t`**${totalScreens} screen${totalScreens > 1 ? \"s\" : \"\"} affected** by changes to ${results.length} API${results.length > 1 ? \"s\" : \"\"}`,\n\t)\n\tlines.push(\"\")\n\n\t// Per-API breakdown\n\tfor (const result of results) {\n\t\tlines.push(`### ${result.api}`)\n\t\tlines.push(\"\")\n\n\t\tif (result.direct.length > 0) {\n\t\t\tlines.push(`**Direct dependencies** (${result.direct.length}):`)\n\t\t\tlines.push(\"\")\n\t\t\tlines.push(\"| Screen | Route | Owner |\")\n\t\t\tlines.push(\"|--------|-------|-------|\")\n\t\t\tfor (const screen of result.direct) {\n\t\t\t\tconst owner = screen.owner?.join(\", \") ?? \"-\"\n\t\t\t\tlines.push(`| ${screen.id} | \\`${screen.route}\\` | ${owner} |`)\n\t\t\t}\n\t\t\tlines.push(\"\")\n\t\t}\n\n\t\tif (result.transitive.length > 0) {\n\t\t\tlines.push(`**Transitive dependencies** (${result.transitive.length}):`)\n\t\t\tlines.push(\"\")\n\t\t\tfor (const { path } of result.transitive) {\n\t\t\t\tlines.push(`- ${path.join(\" → \")}`)\n\t\t\t}\n\t\t\tlines.push(\"\")\n\t\t}\n\t}\n\n\t// Changed files summary\n\tlines.push(\"<details>\")\n\tlines.push(`<summary>Changed files (${changedFiles.length})</summary>`)\n\tlines.push(\"\")\n\tfor (const file of changedFiles.slice(0, 20)) {\n\t\tlines.push(`- \\`${file}\\``)\n\t}\n\tif (changedFiles.length > 20) {\n\t\tlines.push(`- ... and ${changedFiles.length - 20} more`)\n\t}\n\tlines.push(\"\")\n\tlines.push(\"</details>\")\n\n\treturn lines.join(\"\\n\")\n}\n","import { execSync } from \"node:child_process\"\nimport { existsSync, readFileSync } from \"node:fs\"\nimport { join } from \"node:path\"\nimport type { Screen } from \"@screenbook/core\"\nimport { define } from \"gunshi\"\nimport { loadConfig } from \"../utils/config.js\"\nimport { ERRORS } from \"../utils/errors.js\"\nimport { analyzeImpact, type ImpactResult } from \"../utils/impactAnalysis.js\"\nimport { logger } from \"../utils/logger.js\"\nimport { extractApiNames, formatMarkdown } from \"../utils/prImpact.js\"\n\nexport const prImpactCommand = define({\n\tname: \"pr-impact\",\n\tdescription: \"Analyze impact of changed files in a PR\",\n\targs: {\n\t\tbase: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"b\",\n\t\t\tdescription: \"Base branch to compare against (default: main)\",\n\t\t\tdefault: \"main\",\n\t\t},\n\t\tconfig: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"c\",\n\t\t\tdescription: \"Path to config file\",\n\t\t},\n\t\tformat: {\n\t\t\ttype: \"string\",\n\t\t\tshort: \"f\",\n\t\t\tdescription: \"Output format: markdown (default) or json\",\n\t\t\tdefault: \"markdown\",\n\t\t},\n\t\tdepth: {\n\t\t\ttype: \"number\",\n\t\t\tshort: \"d\",\n\t\t\tdescription: \"Maximum depth for transitive dependencies\",\n\t\t\tdefault: 3,\n\t\t},\n\t},\n\trun: async (ctx) => {\n\t\tconst config = await loadConfig(ctx.values.config)\n\t\tconst cwd = process.cwd()\n\n\t\tconst baseBranch = ctx.values.base ?? \"main\"\n\t\tconst format = ctx.values.format ?? \"markdown\"\n\t\tconst depth = ctx.values.depth ?? 3\n\n\t\t// Get changed files from git\n\t\tlet changedFiles: string[]\n\t\ttry {\n\t\t\tconst gitOutput = execSync(\n\t\t\t\t`git diff --name-only ${baseBranch}...HEAD 2>/dev/null || git diff --name-only ${baseBranch} HEAD`,\n\t\t\t\t{ cwd, encoding: \"utf-8\" },\n\t\t\t)\n\t\t\tchangedFiles = gitOutput\n\t\t\t\t.split(\"\\n\")\n\t\t\t\t.map((f) => f.trim())\n\t\t\t\t.filter((f) => f.length > 0)\n\t\t} catch {\n\t\t\tlogger.errorWithHelp(ERRORS.GIT_CHANGED_FILES_ERROR(baseBranch))\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tif (changedFiles.length === 0) {\n\t\t\tlogger.info(\"No changed files found.\")\n\t\t\treturn\n\t\t}\n\n\t\t// Extract potential API names from changed files\n\t\tconst apiNames = extractApiNames(changedFiles)\n\n\t\tif (apiNames.length === 0) {\n\t\t\tif (format === \"markdown\") {\n\t\t\t\tlogger.log(\"## Screenbook Impact Analysis\")\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(\"No API-related changes detected in this PR.\")\n\t\t\t\tlogger.blank()\n\t\t\t\tlogger.log(`Changed files: ${changedFiles.length}`)\n\t\t\t} else {\n\t\t\t\tlogger.log(\n\t\t\t\t\tJSON.stringify({ apis: [], results: [], changedFiles }, null, 2),\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\t// Load screens.json\n\t\tconst screensPath = join(cwd, config.outDir, \"screens.json\")\n\n\t\tif (!existsSync(screensPath)) {\n\t\t\tlogger.errorWithHelp(ERRORS.SCREENS_NOT_FOUND)\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\tlet screens: Screen[]\n\t\ttry {\n\t\t\tconst content = readFileSync(screensPath, \"utf-8\")\n\t\t\tscreens = JSON.parse(content) as Screen[]\n\t\t} catch (error) {\n\t\t\tlogger.errorWithHelp({\n\t\t\t\t...ERRORS.SCREENS_PARSE_ERROR,\n\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t})\n\t\t\tprocess.exit(1)\n\t\t}\n\n\t\t// Analyze impact for each API\n\t\tconst results: ImpactResult[] = []\n\t\tfor (const apiName of apiNames) {\n\t\t\tconst result = analyzeImpact(screens, apiName, depth)\n\t\t\tif (result.totalCount > 0) {\n\t\t\t\tresults.push(result)\n\t\t\t}\n\t\t}\n\n\t\t// Output results\n\t\tif (format === \"json\") {\n\t\t\tlogger.log(\n\t\t\t\tJSON.stringify(\n\t\t\t\t\t{\n\t\t\t\t\t\tchangedFiles,\n\t\t\t\t\t\tdetectedApis: apiNames,\n\t\t\t\t\t\tresults: results.map((r) => ({\n\t\t\t\t\t\t\tapi: r.api,\n\t\t\t\t\t\t\tdirectCount: r.direct.length,\n\t\t\t\t\t\t\ttransitiveCount: r.transitive.length,\n\t\t\t\t\t\t\ttotalCount: r.totalCount,\n\t\t\t\t\t\t\tdirect: r.direct.map((s) => ({\n\t\t\t\t\t\t\t\tid: s.id,\n\t\t\t\t\t\t\t\ttitle: s.title,\n\t\t\t\t\t\t\t\troute: s.route,\n\t\t\t\t\t\t\t\towner: s.owner,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\ttransitive: r.transitive.map(({ screen, path }) => ({\n\t\t\t\t\t\t\t\tid: screen.id,\n\t\t\t\t\t\t\t\ttitle: screen.title,\n\t\t\t\t\t\t\t\troute: screen.route,\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t})),\n\t\t\t\t\t},\n\t\t\t\t\tnull,\n\t\t\t\t\t2,\n\t\t\t\t),\n\t\t\t)\n\t\t} else {\n\t\t\tlogger.log(formatMarkdown(changedFiles, apiNames, results))\n\t\t}\n\t},\n})\n","#!/usr/bin/env node\n\nimport { readFileSync } from \"node:fs\"\nimport { dirname, join } from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { cli, define } from \"gunshi\"\nimport { buildCommand } from \"./commands/build.js\"\nimport { devCommand } from \"./commands/dev.js\"\nimport { doctorCommand } from \"./commands/doctor.js\"\nimport { generateCommand } from \"./commands/generate.js\"\nimport { impactCommand } from \"./commands/impact.js\"\nimport { initCommand } from \"./commands/init.js\"\nimport { lintCommand } from \"./commands/lint.js\"\nimport { prImpactCommand } from \"./commands/pr-impact.js\"\n\nconst __dirname = dirname(fileURLToPath(import.meta.url))\nconst packageJson = JSON.parse(\n\treadFileSync(join(__dirname, \"..\", \"package.json\"), \"utf-8\"),\n)\nconst version: string = packageJson.version\n\nconst mainCommand = define({\n\tname: \"screenbook\",\n\tdescription: \"Screen catalog and navigation graph generator\",\n\trun: () => {\n\t\tconsole.log(\"Usage: screenbook <command>\")\n\t\tconsole.log(\"\")\n\t\tconsole.log(\"Commands:\")\n\t\tconsole.log(\" init Initialize Screenbook in a project\")\n\t\tconsole.log(\" generate Auto-generate screen.meta.ts from routes\")\n\t\tconsole.log(\" build Build screen metadata JSON\")\n\t\tconsole.log(\" dev Start the development server\")\n\t\tconsole.log(\" lint Detect routes without screen.meta\")\n\t\tconsole.log(\" impact Analyze API dependency impact\")\n\t\tconsole.log(\" pr-impact Analyze PR changes impact\")\n\t\tconsole.log(\" doctor Diagnose common setup issues\")\n\t\tconsole.log(\"\")\n\t\tconsole.log(\"Run 'screenbook <command> --help' for more information\")\n\t},\n})\n\nawait cli(process.argv.slice(2), mainCommand, {\n\tname: \"screenbook\",\n\tversion,\n\tsubCommands: {\n\t\tinit: initCommand,\n\t\tgenerate: generateCommand,\n\t\tbuild: buildCommand,\n\t\tdev: devCommand,\n\t\tlint: lintCommand,\n\t\timpact: impactCommand,\n\t\t\"pr-impact\": prImpactCommand,\n\t\tdoctor: doctorCommand,\n\t},\n})\n"],"x_google_ignoreList":[17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAMA,iBAAe;CACpB;CACA;CACA;CACA;AAED,eAAsB,WAAW,YAAsC;CACtE,MAAM,MAAM,QAAQ,KAAK;AAGzB,KAAI,YAAY;EACf,MAAM,eAAe,QAAQ,KAAK,WAAW;AAC7C,MAAI,CAAC,WAAW,aAAa,CAC5B,OAAM,IAAI,MAAM,0BAA0B,aAAa;AAExD,SAAO,MAAM,aAAa,cAAc,IAAI;;AAI7C,MAAK,MAAM,cAAcA,gBAAc;EACtC,MAAM,eAAe,QAAQ,KAAK,WAAW;AAC7C,MAAI,WAAW,aAAa,CAC3B,QAAO,MAAM,aAAa,cAAc,IAAI;;AAK9C,QAAO,cAAc;;AAGtB,eAAe,aACd,cACA,KACkB;CAElB,MAAMC,WAAU,MADH,WAAW,IAAI,CACD,OAAO,aAAa;AAE/C,KAAIA,SAAO,QACV,QAAOA,SAAO;AAGf,OAAM,IAAI,MAAM,2CAA2C,eAAe;;;;;ACN3E,IAAK,0CAAL;AACC;AACA;AACA;;EAHI;;;;;;;;;;;;;;;;;AAsBL,SAAgB,aAAa,SAAyC;CACrE,MAAM,4BA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