'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-fd2bbf0b.js');
const store = require('./store-953d336c.js');
require('./index-81aa1bcb.js');
require('./getCache-c039a6ae.js');
require('./_commonjsHelpers-a5111d61.js');
require('./logic-d8c34975.js');
require('./index-6307644b.js');

const appInventoryListCss = "";

let AppInventoryList = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  componentDidLoad() {
    if (!(index.Build === null || index.Build === void 0 ? void 0 : index.Build.isBrowser))
      return;
  }
  render() {
    var _a, _b, _c, _d, _e, _f;
    return [
      index.h("ion-content", { class: "ion-padding" }, index.h("floodteam-title-bar", null, index.h("ion-router-link", { href: "/inventory" }, "Inventory"), index.h("ion-buttons", { slot: "end" }, index.h("ion-button", { fill: "solid", color: "primary", href: "/inventory/new" }, "Add"))), index.h("fireenjin-search-bar", { paginationEl: this.paginationEl, filters: ((_a = store.state === null || store.state === void 0 ? void 0 : store.state.claims) === null || _a === void 0 ? void 0 : _a.tester) || ((_b = store.state === null || store.state === void 0 ? void 0 : store.state.claims) === null || _b === void 0 ? void 0 : _b.admin)
          ? [
            {
              name: "tags",
              label: "Tags",
              icon: "pricetags",
              multiple: true,
              options: [
                {
                  label: "Imported",
                  value: "imported",
                },
              ],
            },
            {
              name: "locationId",
              label: "Location",
              icon: "business",
              options: ((_c = store.state === null || store.state === void 0 ? void 0 : store.state.locations) === null || _c === void 0 ? void 0 : _c.length)
                ? store.state.locations.map((location) => ({
                  label: location.name,
                  value: location.id,
                }))
                : [],
              value: ((_d = store.state === null || store.state === void 0 ? void 0 : store.state.claims) === null || _d === void 0 ? void 0 : _d.tester) && ((_f = (_e = store.state === null || store.state === void 0 ? void 0 : store.state.profile) === null || _e === void 0 ? void 0 : _e.location) === null || _f === void 0 ? void 0 : _f.id)
                ? store.state.profile.location.id
                : null,
            },
          ]
          : null }), index.h("fireenjin-pagination", { ref: (el) => (this.paginationEl = el), listEl: ({ result }) => (index.h("ion-item", { href: `/inventory/${result.id}`, detail: true }, index.h("ion-label", null, index.h("h2", null, result.name ? result.name : "", " ")))), endpoint: "listInventories", limit: 24, resultsKey: "inventories" })),
    ];
  }
};
AppInventoryList.style = appInventoryListCss;

exports.app_inventory_list = AppInventoryList;

//# sourceMappingURL=app-inventory-list.cjs.entry.js.map