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

import { template, spread, mergeProps, memo, insert, createComponent, Dynamic } from 'solid-js/web';
import { splitProps, For } from 'solid-js';
import defaultAttributes from './defaultAttributes.js';
import { hasA11yProp } from './shared/src/utils/hasA11yProp.js';
import { mergeClasses } from './shared/src/utils/mergeClasses.js';
import { toKebabCase } from './shared/src/utils/toKebabCase.js';
import { toPascalCase } from './shared/src/utils/toPascalCase.js';

var _tmpl$ = /*#__PURE__*/template(`<svg>`);
const Icon = props => {
  const [localProps, rest] = splitProps(props, ['color', 'size', 'strokeWidth', 'children', 'class', 'name', 'iconNode', 'absoluteStrokeWidth']);
  return (() => {
    var _el$ = _tmpl$();
    spread(_el$, mergeProps(defaultAttributes, {
      get width() {
        return localProps.size ?? defaultAttributes.width;
      },
      get height() {
        return localProps.size ?? defaultAttributes.height;
      },
      get stroke() {
        return localProps.color ?? defaultAttributes.stroke;
      },
      get ["stroke-width"]() {
        return memo(() => !!localProps.absoluteStrokeWidth)() ? Number(localProps.strokeWidth ?? defaultAttributes['stroke-width']) * 24 / Number(localProps.size) : Number(localProps.strokeWidth ?? defaultAttributes['stroke-width']);
      },
      get ["class"]() {
        return mergeClasses('lucide', 'lucide-icon', ...(localProps.name != null ? [`lucide-${toKebabCase(toPascalCase(localProps.name))}`, `lucide-${toKebabCase(localProps.name)}`] : []), localProps.class != null ? localProps.class : '');
      },
      get ["aria-hidden"]() {
        return !localProps.children && !hasA11yProp(rest) ? 'true' : undefined;
      }
    }, rest), true, true);
    insert(_el$, createComponent(For, {
      get each() {
        return localProps.iconNode;
      },
      children: ([elementName, attrs]) => {
        return createComponent(Dynamic, mergeProps({
          component: elementName
        }, attrs));
      }
    }));
    return _el$;
  })();
};

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