/**
 * @license @lucide/vue v1.18.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */

import { computed, h } from 'vue';
import { isEmptyString } from './shared/src/utils/isEmptyString.mjs';
import { mergeClasses } from './shared/src/utils/mergeClasses.mjs';
import { toKebabCase } from './shared/src/utils/toKebabCase.mjs';
import { toPascalCase } from './shared/src/utils/toPascalCase.mjs';
import defaultAttributes from './defaultAttributes.mjs';
import { useLucideProps } from './context.mjs';

const Icon = ({
  name,
  iconNode,
  absoluteStrokeWidth,
  "absolute-stroke-width": absoluteStrokeWidthKebabCase,
  strokeWidth,
  "stroke-width": strokeWidthKebabCase,
  size,
  color,
  ...props
}, { slots }) => {
  const {
    size: contextSize,
    color: contextColor,
    strokeWidth: contextStrokeWidth = 2,
    absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,
    class: contextClass = ""
  } = useLucideProps();
  const calculatedStrokeWidth = computed(() => {
    const isAbsoluteStrokeWidth = isEmptyString(absoluteStrokeWidth) || isEmptyString(absoluteStrokeWidthKebabCase) || absoluteStrokeWidth === true || absoluteStrokeWidthKebabCase === true || contextAbsoluteStrokeWidth === true;
    const strokeWidthValue = strokeWidth || strokeWidthKebabCase || contextStrokeWidth || defaultAttributes["stroke-width"];
    if (isAbsoluteStrokeWidth) {
      return Number(strokeWidthValue) * 24 / Number(size ?? contextSize ?? defaultAttributes.width);
    }
    return strokeWidthValue;
  });
  return h(
    "svg",
    {
      ...defaultAttributes,
      ...props,
      width: size ?? contextSize ?? defaultAttributes.width,
      height: size ?? contextSize ?? defaultAttributes.height,
      stroke: color ?? contextColor ?? defaultAttributes.stroke,
      "stroke-width": calculatedStrokeWidth.value,
      class: mergeClasses(
        "lucide",
        contextClass,
        ...name ? [`lucide-${toKebabCase(toPascalCase(name))}-icon`, `lucide-${toKebabCase(name)}`] : ["lucide-icon"]
      )
    },
    [...iconNode.map((child) => h(...child)), ...slots.default ? [slots.default()] : []]
  );
};

export { Icon as default };
//# sourceMappingURL=Icon.mjs.map
