{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hat-glasses",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "hat-glasses.tsx",
      "content": "\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface HatGlassesIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface HatGlassesIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst HAT_VARIANTS: Variants = {\n  normal: {\n    rotate: 0,\n    y: 0,\n  },\n  animate: {\n    rotate: [0, -4, 2, 0],\n    y: [0, -3, 1, 0],\n    transition: {\n      duration: 0.5,\n      ease: \"easeOut\",\n      times: [0, 0.35, 0.65, 1],\n    },\n  },\n};\n\nconst GLASSES_VARIANTS: Variants = {\n  normal: {\n    scale: 1,\n    y: 0,\n  },\n  animate: {\n    scale: [1, 0.96, 1],\n    y: [0, 1, 0],\n    transition: {\n      delay: 0.28,\n      duration: 0.32,\n      ease: \"easeInOut\",\n    },\n  },\n};\n\nconst HatGlassesIcon = forwardRef<HatGlassesIconHandle, HatGlassesIconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const controls = useAnimation();\n    const isControlledRef = useRef(false);\n\n    useImperativeHandle(ref, () => {\n      isControlledRef.current = true;\n      return {\n        startAnimation: () => controls.start(\"animate\"),\n        stopAnimation: () => controls.start(\"normal\"),\n      };\n    });\n\n    const handleMouseEnter = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (!isControlledRef.current) {\n          controls.start(\"animate\");\n        }\n        onMouseEnter?.(e);\n      },\n      [controls, onMouseEnter]\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (!isControlledRef.current) {\n          controls.start(\"normal\");\n        }\n        onMouseLeave?.(e);\n      },\n      [controls, onMouseLeave]\n    );\n\n    return (\n      <div\n        className={cn(className)}\n        onMouseEnter={handleMouseEnter}\n        onMouseLeave={handleMouseLeave}\n        {...props}\n      >\n        <svg\n          fill=\"none\"\n          height={size}\n          stroke=\"currentColor\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          strokeWidth=\"2\"\n          style={{ overflow: \"visible\" }}\n          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <motion.g\n            animate={controls}\n            initial=\"normal\"\n            style={{ originX: \"12px\", originY: \"11px\" }}\n            variants={HAT_VARIANTS}\n          >\n            <path d=\"m19 11-2.11-6.657a2 2 0 0 0-2.752-1.148l-1.276.61A2 2 0 0 1 12 4H8.5a2 2 0 0 0-1.925 1.456L5 11\" />\n            <path d=\"M2 11h20\" />\n          </motion.g>\n\n          <motion.g\n            animate={controls}\n            initial=\"normal\"\n            variants={GLASSES_VARIANTS}\n          >\n            <path d=\"M14 18a2 2 0 0 0-4 0\" />\n            <circle cx=\"17\" cy=\"18\" r=\"3\" />\n            <circle cx=\"7\" cy=\"18\" r=\"3\" />\n          </motion.g>\n        </svg>\n      </div>\n    );\n  }\n);\n\nHatGlassesIcon.displayName = \"HatGlassesIcon\";\n\nexport { HatGlassesIcon };\n",
      "type": "registry:ui"
    }
  ]
}
