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 { DeesElement, customElement, html, css, cssManager, property, } from '@design.estate/dees-element';
import './sz-traffic-card.js';
import './sz-reverse-proxy-card.js';
import './sz-certificates-card.js';
let SzStatusGridNetwork = (() => {
    let _classDecorators = [customElement('sz-status-grid-network')];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = DeesElement;
    let _traffic_decorators;
    let _traffic_initializers = [];
    let _traffic_extraInitializers = [];
    let _proxy_decorators;
    let _proxy_initializers = [];
    let _proxy_extraInitializers = [];
    let _certificates_decorators;
    let _certificates_initializers = [];
    let _certificates_extraInitializers = [];
    var SzStatusGridNetwork = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _traffic_decorators = [property({ type: Object })];
            _proxy_decorators = [property({ type: Object })];
            _certificates_decorators = [property({ type: Object })];
            __esDecorate(this, null, _traffic_decorators, { kind: "accessor", name: "traffic", static: false, private: false, access: { has: obj => "traffic" in obj, get: obj => obj.traffic, set: (obj, value) => { obj.traffic = value; } }, metadata: _metadata }, _traffic_initializers, _traffic_extraInitializers);
            __esDecorate(this, null, _proxy_decorators, { kind: "accessor", name: "proxy", static: false, private: false, access: { has: obj => "proxy" in obj, get: obj => obj.proxy, set: (obj, value) => { obj.proxy = value; } }, metadata: _metadata }, _proxy_initializers, _proxy_extraInitializers);
            __esDecorate(this, null, _certificates_decorators, { kind: "accessor", name: "certificates", static: false, private: false, access: { has: obj => "certificates" in obj, get: obj => obj.certificates, set: (obj, value) => { obj.certificates = value; } }, metadata: _metadata }, _certificates_initializers, _certificates_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            SzStatusGridNetwork = _classThis = _classDescriptor.value;
            if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
        }
        static demo = () => html `
    <div style="padding: 24px; max-width: 1400px;">
      <sz-status-grid-network
        .traffic=${{
            requests: 125420,
            errors: 150,
            errorPercent: 0.12,
            avgResponse: 45,
            reqPerMin: 847,
            status2xx: 95.2,
            status3xx: 2.1,
            status4xx: 2.3,
            status5xx: 0.4,
        }}
        .proxy=${{
            httpPort: '80',
            httpsPort: '443',
            httpActive: true,
            httpsActive: true,
            routeCount: '12',
        }}
        .certificates=${{
            valid: 8,
            expiring: 2,
            expired: 0,
        }}
      ></sz-status-grid-network>
    </div>
  `;
        static demoGroups = ['Dashboard Grids'];
        #traffic_accessor_storage = __runInitializers(this, _traffic_initializers, {
            requests: 0,
            errors: 0,
            errorPercent: 0,
            avgResponse: 0,
            reqPerMin: 0,
            status2xx: 0,
            status3xx: 0,
            status4xx: 0,
            status5xx: 0,
        });
        get traffic() { return this.#traffic_accessor_storage; }
        set traffic(value) { this.#traffic_accessor_storage = value; }
        #proxy_accessor_storage = (__runInitializers(this, _traffic_extraInitializers), __runInitializers(this, _proxy_initializers, {
            httpPort: '80',
            httpsPort: '443',
            httpActive: false,
            httpsActive: false,
            routeCount: '0',
        }));
        get proxy() { return this.#proxy_accessor_storage; }
        set proxy(value) { this.#proxy_accessor_storage = value; }
        #certificates_accessor_storage = (__runInitializers(this, _proxy_extraInitializers), __runInitializers(this, _certificates_initializers, {
            valid: 0,
            expiring: 0,
            expired: 0,
        }));
        get certificates() { return this.#certificates_accessor_storage; }
        set certificates(value) { this.#certificates_accessor_storage = value; }
        static styles = [
            cssManager.defaultStyles,
            css `
      :host {
        display: block;
      }

      .grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        align-items: stretch;
      }

      .grid > * {
        height: 100%;
      }

      @media (min-width: 768px) {
        .grid {
          grid-template-columns: 1fr 1fr;
        }
      }

      @media (min-width: 1024px) {
        .grid {
          grid-template-columns: 2fr 1fr 1fr;
        }
      }
    `,
        ];
        render() {
            return html `
      <div class="grid">
        <sz-traffic-card
          .data=${this.traffic}
        ></sz-traffic-card>
        <sz-reverse-proxy-card
          httpPort="${this.proxy.httpPort}"
          httpsPort="${this.proxy.httpsPort}"
          ?httpActive=${this.proxy.httpActive}
          ?httpsActive=${this.proxy.httpsActive}
          routeCount="${this.proxy.routeCount}"
        ></sz-reverse-proxy-card>
        <sz-certificates-card
          valid="${this.certificates.valid}"
          expiring="${this.certificates.expiring}"
          expired="${this.certificates.expired}"
        ></sz-certificates-card>
      </div>
    `;
        }
        constructor() {
            super(...arguments);
            __runInitializers(this, _certificates_extraInitializers);
        }
        static {
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return SzStatusGridNetwork = _classThis;
})();
export { SzStatusGridNetwork };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3otc3RhdHVzLWdyaWQtbmV0d29yay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX3dlYi9lbGVtZW50cy9zei1zdGF0dXMtZ3JpZC1uZXR3b3JrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxPQUFPLEVBQ0wsV0FBVyxFQUNYLGFBQWEsRUFDYixJQUFJLEVBQ0osR0FBRyxFQUNILFVBQVUsRUFDVixRQUFRLEdBRVQsTUFBTSw2QkFBNkIsQ0FBQztBQUVyQyxPQUFPLHNCQUFzQixDQUFDO0FBQzlCLE9BQU8sNEJBQTRCLENBQUM7QUFDcEMsT0FBTywyQkFBMkIsQ0FBQztJQXlCdEIsbUJBQW1COzRCQUQvQixhQUFhLENBQUMsd0JBQXdCLENBQUM7Ozs7c0JBQ0MsV0FBVzs7Ozs7Ozs7OzttQ0FBbkIsU0FBUSxXQUFXOzs7O21DQWlDakQsUUFBUSxDQUFDLEVBQUUsSUFBSSxFQUFFLE1BQU0sRUFBRSxDQUFDO2lDQWExQixRQUFRLENBQUMsRUFBRSxJQUFJLEVBQUUsTUFBTSxFQUFFLENBQUM7d0NBUzFCLFFBQVEsQ0FBQyxFQUFFLElBQUksRUFBRSxNQUFNLEVBQUUsQ0FBQztZQXJCM0IsMEtBQWdCLE9BQU8sNkJBQVAsT0FBTyx5RkFVckI7WUFHRixvS0FBZ0IsS0FBSyw2QkFBTCxLQUFLLHFGQU1uQjtZQUdGLHlMQUFnQixZ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