"use client";
'use strict';

var react$1 = require('motion/react');
var react = require('react');
var clsx = require('clsx');
var tailwindMerge = require('tailwind-merge');
var jsxRuntime = require('react/jsx-runtime');

var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
function cn(...inputs) {
  return tailwindMerge.twMerge(clsx.clsx(inputs));
}
var HeartIcon = react.forwardRef(
  (_a, ref) => {
    var _b = _a, { onMouseEnter, onMouseLeave, className, size = 28 } = _b, props = __objRest(_b, ["onMouseEnter", "onMouseLeave", "className", "size"]);
    const controls = react$1.useAnimation();
    const isControlledRef = react.useRef(false);
    react.useImperativeHandle(ref, () => {
      isControlledRef.current = true;
      return {
        startAnimation: () => controls.start("animate"),
        stopAnimation: () => controls.start("normal")
      };
    });
    const handleMouseEnter = react.useCallback(
      (e) => {
        if (isControlledRef.current) {
          onMouseEnter == null ? void 0 : onMouseEnter(e);
        } else {
          controls.start("animate");
        }
      },
      [controls, onMouseEnter]
    );
    const handleMouseLeave = react.useCallback(
      (e) => {
        if (isControlledRef.current) {
          onMouseLeave == null ? void 0 : onMouseLeave(e);
        } else {
          controls.start("normal");
        }
      },
      [controls, onMouseLeave]
    );
    return /* @__PURE__ */ jsxRuntime.jsx(
      "div",
      __spreadProps(__spreadValues({
        className: cn(className),
        onMouseEnter: handleMouseEnter,
        onMouseLeave: handleMouseLeave
      }, props), {
        children: /* @__PURE__ */ jsxRuntime.jsx(
          react$1.motion.svg,
          {
            animate: controls,
            fill: "none",
            height: size,
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: "2",
            transition: {
              duration: 0.45,
              repeat: 2
            },
            variants: {
              normal: { scale: 1 },
              animate: { scale: [1, 1.08, 1] }
            },
            viewBox: "0 0 24 24",
            width: size,
            xmlns: "http://www.w3.org/2000/svg",
            children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z" })
          }
        )
      })
    );
  }
);
HeartIcon.displayName = "HeartIcon";

exports.HeartIcon = HeartIcon;
//# sourceMappingURL=heart.cjs.map
//# sourceMappingURL=heart.cjs.map