var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { h } from '@stencil/core';
import { MapToComponentField, VegaSlimmer } from 'vega-slimmer/core';
/** The `VegaInputPrefixSlotRenderer` class in TypeScript React renders a prefix icon for a VegaInput component, checking for the existence of a specific slot named "prefix-icon" in the host element. */
export class VegaInputPrefixSlotRenderer extends VegaSlimmer {
  render() {
    const hasSlotContent = this.hasPrefixSlot();
    if (this.prefixIcon || hasSlotContent) {
      return (h("div", { class: {
          'vega-input-prefix': true,
          'vega-input-prefix-slot': hasSlotContent,
        }, part: "prefix-icon-container" },
        this.prefixIcon && !hasSlotContent ? (h("vega-icon", { icon: this.prefixIcon, size: "size-16", "aria-hidden": "true" })) : null,
        h("slot", { name: "prefix-icon" })));
    }
  }
  /**
   * The function checks if a specific slot named "prefix-icon" exists in the host element.
   *
   * @returns {boolean} The `hasPrefixSlot()` method returns a boolean value - `true` if the host element has a
   * child element with the slot attribute set to "prefix-icon", and `false` otherwise.
   */
  hasPrefixSlot() {
    return this.host.querySelector('[slot="prefix-icon"]') ? true : false;
  }
}
__decorate([
  MapToComponentField()
], VegaInputPrefixSlotRenderer.prototype, "host", void 0);
__decorate([
  MapToComponentField()
], VegaInputPrefixSlotRenderer.prototype, "prefixIcon", void 0);
