import { Component, Event, Prop, h } from "@stencil/core";
import state from "../../../store";
export class TitleBar {
  constructor() {
    this.heading = 1;
    this.disableUnderline = false;
  }
  render() {
    var _a, _b;
    const HeadingTag = `h${this.heading}`;
    return (h("ion-toolbar", { style: {
        "--background": "transparent",
        "--padding-start": "0",
        "--padding-end": "0",
      }, class: "ion-padding-horizontal" },
      h("ion-buttons", { style: {
          display: "flex",
          alignItems: "center",
        }, slot: "start" },
        this.back && (h("ion-back-button", { icon: "arrow-back", defaultHref: this.back })),
        h("slot", { name: "start" }),
        this.icon && (h("ion-icon", { name: this.icon, class: "ft-icon-style", style: { marginRight: "8px" } })),
        this.pin && (h("ion-button", { onClick: () => this.fireenjinTrigger.emit({
            name: "pin",
            payload: this.pin,
          }) },
          h("ion-icon", { name: "pin", color: ((_a = ((state === null || state === void 0 ? void 0 : state.pins) || [])
              .map((pin) => pin === null || pin === void 0 ? void 0 : pin.href)) === null || _a === void 0 ? void 0 : _a.includes((_b = this.pin) === null || _b === void 0 ? void 0 : _b.href))
              ? "primary"
              : null })))),
      h(HeadingTag, { class: {
          "underline-title": !this.disableUnderline,
          "ion-margin-vertical": true,
        }, style: { paddingTop: "0" } },
        h("slot", null)),
      h("slot", { name: "end" })));
  }
  static get is() { return "floodteam-title-bar"; }
  static get properties() { return {
    "heading": {
      "type": "number",
      "mutable": false,
      "complexType": {
        "original": "number",
        "resolved": "number",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "heading",
      "reflect": false,
      "defaultValue": "1"
    },
    "disableUnderline": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "disable-underline",
      "reflect": false,
      "defaultValue": "false"
    },
    "pin": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "Pin",
        "resolved": "{ __typename?: \"Pin\"; createdAt?: string; createdBy?: User; href?: string; icon?: string; id?: string; name?: string; order?: number; payload?: any; trigger?: string; updatedAt?: string; updatedBy?: User; user?: User; }",
        "references": {
          "Pin": {
            "location": "import",
            "path": "../../../sdk"
          }
        }
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "icon": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "icon",
      "reflect": false
    },
    "back": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "back",
      "reflect": false
    }
  }; }
  static get events() { return [{
      "method": "fireenjinTrigger",
      "name": "fireenjinTrigger",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "FireEnjinTriggerInput",
        "resolved": "FireEnjinTriggerInput",
        "references": {
          "FireEnjinTriggerInput": {
            "location": "import",
            "path": "@fireenjin/sdk"
          }
        }
      }
    }]; }
}
//# sourceMappingURL=title-bar.js.map