var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
        var context = {};
        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
        if (kind === "accessor") {
            if (result === void 0) continue;
            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
            if (_ = accept(result.get)) descriptor.get = _;
            if (_ = accept(result.set)) descriptor.set = _;
            if (_ = accept(result.init)) initializers.unshift(_);
        }
        else if (_ = accept(result)) {
            if (kind === "field") initializers.unshift(_);
            else descriptor[key] = _;
        }
    }
    if (target) Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
};
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
};
import { LitElement, html, css, property, customElement } from './plugins.js';
import { sharedStyles, tableStyles } from './sw-dash-styles.js';
import { SwDashTable } from './sw-dash-table.js';
/**
 * Domains table view component
 */
let SwDashDomains = (() => {
    let _classDecorators = [customElement('sw-dash-domains')];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = LitElement;
    let _domains_decorators;
    let _domains_initializers = [];
    let _domains_extraInitializers = [];
    var SwDashDomains = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _domains_decorators = [property({ type: Array })];
            __esDecorate(this, null, _domains_decorators, { kind: "accessor", name: "domains", static: false, private: false, access: { has: obj => "domains" in obj, get: obj => obj.domains, set: (obj, value) => { obj.domains = value; } }, metadata: _metadata }, _domains_initializers, _domains_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            SwDashDomains = _classThis = _classDescriptor.value;
            if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
        }
        static styles = [
            sharedStyles,
            tableStyles,
            css `
      :host {
        display: block;
      }
    `
        ];
        #domains_accessor_storage = __runInitializers(this, _domains_initializers, []);
        get domains() { return this.#domains_accessor_storage; }
        set domains(value) { this.#domains_accessor_storage = value; }
        columns = (__runInitializers(this, _domains_extraInitializers), [
            { key: 'domain', label: 'Domain' },
            { key: 'totalResources', label: 'Resources', className: 'num', formatter: SwDashTable.formatNumber },
            { key: 'totalSize', label: 'Total Size', className: 'num', formatter: SwDashTable.formatBytes },
            { key: 'totalHits', label: 'Hits', className: 'num', formatter: SwDashTable.formatNumber },
            { key: 'totalMisses', label: 'Misses', className: 'num', formatter: SwDashTable.formatNumber },
            { key: 'hitRate', label: 'Hit Rate' },
        ]);
        render() {
            return html `
      <sw-dash-table
        .columns="${this.columns}"
        .data="${this.domains}"
        filterPlaceholder="Filter domains..."
        infoLabel="domains"
      ></sw-dash-table>
    `;
        }
        static {
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return SwDashDomains = _classThis;
})();
export { SwDashDomains };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ctZGFzaC1kb21haW5zLmpzIiwic291cmNlUm9vdCI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