import { Component, Event, Host, h, Prop } from "@stencil/core";
export class ItemSite {
  constructor() {
    this.detail = true;
    this.disabled = false;
  }
  openTab(event, selectedTab) {
    event.stopPropagation();
    event.preventDefault();
    this.floodteamOpenSiteEditModal.emit({
      site: this.site,
      selectedTab,
    });
  }
  render() {
    var _a, _b, _c, _d, _e, _f, _g, _h, _j;
    return (h(Host, null,
      h("ion-item", { detail: this.detail, href: this.href, disabled: this.disabled },
        h("ion-label", null,
          h("h3", null, ((_a = this.site) === null || _a === void 0 ? void 0 : _a.name) ? this.site.name : "Common"),
          h("ion-grid", null,
            h("ion-row", null,
              h("ion-col", { size: "3" },
                h("ion-chip", { onClick: (event) => this.openTab(event, "photos") },
                  h("ion-icon", { name: "images" }),
                  h("ion-label", null, ((_c = (_b = this.site) === null || _b === void 0 ? void 0 : _b.photos) === null || _c === void 0 ? void 0 : _c.length) ? this.site.photos.length : 0))),
              h("ion-col", { size: "3" },
                h("ion-chip", { onClick: (event) => this.openTab(event, "info") },
                  h("ion-icon", { name: "construct" }),
                  h("ion-label", null, ((_e = (_d = this.site) === null || _d === void 0 ? void 0 : _d.equipment) === null || _e === void 0 ? void 0 : _e.length)
                    ? this.site.equipment.length
                    : 0))),
              h("ion-col", { size: "3" },
                h("ion-chip", { onClick: (event) => this.openTab(event, "info") },
                  h("ion-icon", { name: "reader" }),
                  h("ion-label", null, ((_g = (_f = this.site) === null || _f === void 0 ? void 0 : _f.services) === null || _g === void 0 ? void 0 : _g.length)
                    ? this.site.services.length
                    : 0))),
              h("ion-col", { size: "3" },
                h("ion-chip", { onClick: (event) => this.openTab(event, "dots") },
                  h("ion-icon", { name: "ellipse" }),
                  h("ion-label", null, ((_j = (_h = this.site) === null || _h === void 0 ? void 0 : _h.dots) === null || _j === void 0 ? void 0 : _j.length) ? this.site.dots.length : 0)))))))));
  }
  static get is() { return "floodteam-item-site"; }
  static get originalStyleUrls() { return {
    "$": ["item-site.css"]
  }; }
  static get styleUrls() { return {
    "$": ["item-site.css"]
  }; }
  static get properties() { return {
    "href": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "href",
      "reflect": false
    },
    "detail": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "detail",
      "reflect": false,
      "defaultValue": "true"
    },
    "disabled": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "disabled",
      "reflect": false,
      "defaultValue": "false"
    },
    "site": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "Partial<Site>",
        "resolved": "{ __typename?: \"Site\"; affectedAreaTotalCuft?: number; affectedAreaTotalSqft?: number; affectedAreas?: Area[]; areaTotalCuft?: number; areaTotalSqft?: number; areas?: Area[]; ceilingType?: string; chamber?: number; class?: number; createdAt?: string; createdBy?: User; dots?: Dot[]; equipment?: SiteEquipment[]; exhaust?: Exhaust; floorType?: string; id?: string; inventories?: Inventory[]; job?: Job; level?: number; name?: string; photos?: Photo[]; services?: ScopeService[]; updatedAt?: string; updatedBy?: User; wallType?: string; }",
        "references": {
          "Partial": {
            "location": "global"
          },
          "Site": {
            "location": "import",
            "path": "../../../sdk"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    }
  }; }
  static get events() { return [{
      "method": "floodteamOpenSiteEditModal",
      "name": "floodteamOpenSiteEditModal",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }]; }
}
//# sourceMappingURL=item-site.js.map