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, MapToComponentMethod, VegaSlimmer } from 'vega-slimmer/core';
/** The class `VegaPopoverAppenderRenderer` extends `VegaSlimmer` and provides methods to append popover content in a React TypeScript application. */
export class VegaPopoverAppenderRenderer extends VegaSlimmer {
  /**
   * The function appends the content of a popover slot to a popover content box.
   */
  appendPopoverSlotContent() {
    const popoverSlot = this.host.querySelector("[slot='popover']");
    if (popoverSlot) {
      this.popoverContentBox.appendChild(popoverSlot);
    }
  }
  /**
   * The function returns the HTML element representing the Vega Popover Content Box.
   *
   * @returns {HTMLVegaPopoverContentBoxElement} An HTMLVegaPopoverContentBoxElement is being returned.
   */
  getPopoverContentBox() {
    return this.popoverContentBox;
  }
  /**
   * The `render` function returns a JSX element for a `vega-popover-content-box` component with a ref assigned to `this.popoverContentBox`.
   *
   * @returns {HTMLVegaPopoverContentBoxElement} An HTMLVegaPopoverContentBoxElement element wrapped in a vega-popover-content-box component is being returned.
   */
  render() {
    return (h("vega-popover-content-box", { ref: (el) => (this.popoverContentBox = el), showArrow: this.showArrow, padding: this.padding }));
  }
}
__decorate([
  MapToComponentField()
], VegaPopoverAppenderRenderer.prototype, "host", void 0);
__decorate([
  MapToComponentField()
], VegaPopoverAppenderRenderer.prototype, "showArrow", void 0);
__decorate([
  MapToComponentField()
], VegaPopoverAppenderRenderer.prototype, "padding", void 0);
__decorate([
  MapToComponentMethod('componentDidRender')
], VegaPopoverAppenderRenderer.prototype, "appendPopoverSlotContent", null);
