{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "utils",
  "title": "Utils",
  "type": "registry:lib",
  "files": [
    {
      "path": "packages/registry-react/bootstrap/utils/utils.ts",
      "content": "import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs))\n}\n\nexport const DEFAULT_AUTH_REDIRECT = '/dashboard'\n\n/**\n * Validates a redirect target to protect against open-redirect phishing attacks.\n * Rejects external URLs (`https://evil.com`), protocol-relative URLs (`//evil.com`),\n * and backslash bypasses (`/\\evil.com`), returning the safe fallback.\n */\nexport function safeRedirectPath(value: string | null | undefined, fallback = DEFAULT_AUTH_REDIRECT): string {\n  const candidate = value?.trim()\n  if (!candidate) return fallback\n  if (!candidate.startsWith('/') || candidate.startsWith('//') || candidate.includes('\\\\')) return fallback\n\n  try {\n    const url = new URL(candidate, 'https://uipkge.local')\n    if (url.origin !== 'https://uipkge.local') return fallback\n    return `${url.pathname}${url.search}${url.hash}`\n  } catch {\n    return fallback\n  }\n}\n",
      "type": "registry:lib",
      "target": "~/lib/utils.ts"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [],
  "description": "Tailwind class merge helper: cn(). Combines clsx and tailwind-merge."
}