import { h } from "@stencil/core";
import { popoverController } from "@ionic/core";
import { _t } from "../i18n/i18n";
export class ShareButton {
  constructor() {
    this.clickOpen = async (e) => await this.openPopover(e);
    this.icon = "share-social";
  }
  async openPopover(ev) {
    const options = {
      component: document.createElement("gl-share"),
      ev: ev,
    };
    const popover = await popoverController.create(options);
    await popover.present();
    return popover;
  }
  render() {
    return (h("ion-button", { title: _t("webmapgl.share-button.title"), onClick: this.clickOpen }, h("ion-icon", { slot: "icon-only", name: this.icon })));
  }
  static get is() { return "gl-share-button"; }
  static get properties() {
    return {
      "icon": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Icon from the Ionicons set used in the button."
        },
        "attribute": "icon",
        "reflect": false,
        "defaultValue": "\"share-social\""
      }
    };
  }
}
//# sourceMappingURL=share-button.js.map
