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';
let SzNetworkDomainsView = (() => {
    let _classDecorators = [customElement('sz-network-domains-view')];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = DeesElement;
    let _domains_decorators;
    let _domains_initializers = [];
    let _domains_extraInitializers = [];
    let _stats_decorators;
    let _stats_initializers = [];
    let _stats_extraInitializers = [];
    var SzNetworkDomainsView = 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 })];
            _stats_decorators = [property({ type: Object })];
            __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(this, null, _stats_decorators, { kind: "accessor", name: "stats", static: false, private: false, access: { has: obj => "stats" in obj, get: obj => obj.stats, set: (obj, value) => { obj.stats = value; } }, metadata: _metadata }, _stats_initializers, _stats_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            SzNetworkDomainsView = _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: 1200px;">
      <sz-network-domains-view
        .domains=${[
            { domain: 'bleu.de', provider: 'cloudflare', serviceCount: 2, certificateStatus: 'valid', expiresIn: '52 days' },
            { domain: 'task.vc', provider: 'cloudflare', serviceCount: 1, certificateStatus: 'valid', expiresIn: '52 days' },
            { domain: 'example.com', provider: 'cloudflare', serviceCount: 0, certificateStatus: 'expiring', expiresIn: '7 days' },
        ]}
        .stats=${{ total: 3, valid: 2, expiring: 1, expired: 0 }}
      ></sz-network-domains-view>
    </div>
  `;
        static demoGroups = ['Network'];
        #domains_accessor_storage = __runInitializers(this, _domains_initializers, []);
        get domains() { return this.#domains_accessor_storage; }
        set domains(value) { this.#domains_accessor_storage = value; }
        #stats_accessor_storage = (__runInitializers(this, _domains_extraInitializers), __runInitializers(this, _stats_initializers, {
            total: 0,
            valid: 0,
            expiring: 0,
            expired: 0,
        }));
        get stats() { return this.#stats_accessor_storage; }
        set stats(value) { this.#stats_accessor_storage = value; }
        static styles = [
            cssManager.defaultStyles,
            css `
      :host {
        display: block;
      }

      .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
      }

      .description {
        font-size: 14px;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
      }

      .sync-button {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        background: ${cssManager.bdTheme('#ffffff', '#09090b')};
        border: 1px solid ${cssManager.bdTheme('#e4e4e7', '#27272a')};
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
        cursor: pointer;
        transition: all 200ms ease;
      }

      .sync-button:hover {
        background: ${cssManager.bdTheme('#f4f4f5', '#18181b')};
        border-color: ${cssManager.bdTheme('#d4d4d8', '#3f3f46')};
      }

      dees-statsgrid {
        display: block;
        margin-bottom: 24px;
      }

      .table-container {
        background: ${cssManager.bdTheme('#ffffff', '#09090b')};
        border: 1px solid ${cssManager.bdTheme('#e4e4e7', '#27272a')};
        border-radius: 8px;
        overflow: hidden;
      }

      .table-header {
        display: grid;
        grid-template-columns: 2fr 1fr 80px 100px 100px 80px;
        gap: 16px;
        padding: 12px 16px;
        background: ${cssManager.bdTheme('#f4f4f5', '#18181b')};
        border-bottom: 1px solid ${cssManager.bdTheme('#e4e4e7', '#27272a')};
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
      }

      .table-row {
        display: grid;
        grid-template-columns: 2fr 1fr 80px 100px 100px 80px;
        gap: 16px;
        padding: 12px 16px;
        border-bottom: 1px solid ${cssManager.bdTheme('#f4f4f5', '#27272a')};
        font-size: 14px;
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
        align-items: center;
        transition: background 200ms ease;
      }

      .table-row:last-child {
        border-bottom: none;
      }

      .table-row:hover {
        background: ${cssManager.bdTheme('#f4f4f5', '#18181b')};
      }

      .domain-name {
        font-weight: 500;
      }

      .provider {
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
      }

      .status-badge {
        display: inline-flex;
        align-items: center;
        padding: 2px 8px;
        border-radius: 9999px;
        font-size: 12px;
        font-weight: 500;
      }

      .status-badge.valid {
        background: ${cssManager.bdTheme('#dcfce7', 'rgba(34, 197, 94, 0.2)')};
        color: ${cssManager.bdTheme('#16a34a', '#22c55e')};
      }

      .status-badge.expiring {
        background: ${cssManager.bdTheme('#fef9c3', 'rgba(250, 204, 21, 0.2)')};
        color: ${cssManager.bdTheme('#ca8a04', '#facc15')};
      }

      .status-badge.expired,
      .status-badge.pending {
        background: ${cssManager.bdTheme('#fee2e2', 'rgba(239, 68, 68, 0.2)')};
        color: ${cssManager.bdTheme('#dc2626', '#ef4444')};
      }

      .expires {
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
      }

      .view-button {
        padding: 6px 12px;
        background: ${cssManager.bdTheme('#ffffff', '#09090b')};
        border: 1px solid ${cssManager.bdTheme('#e4e4e7', '#27272a')};
        border-radius: 4px;
        font-size: 13px;
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
        cursor: pointer;
        transition: all 200ms ease;
      }

      .view-button:hover {
        background: ${cssManager.bdTheme('#f4f4f5', '#18181b')};
      }

      .empty-state {
        padding: 48px 24px;
        text-align: center;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
      }
    `,
        ];
        get tiles() {
            return [
                {
                    id: 'total',
                    title: 'Total Domains',
                    value: this.stats.total,
                    type: 'number',
                    icon: 'lucide:globe',
                },
                {
                    id: 'valid',
                    title: 'Valid Certificates',
                    value: this.stats.valid,
                    type: 'number',
                    icon: 'lucide:shieldCheck',
                    color: '#22c55e',
                },
                {
                    id: 'expiring',
                    title: 'Expiring Soon',
                    value: this.stats.expiring,
                    type: 'number',
                    icon: 'lucide:shieldAlert',
                    color: this.stats.expiring > 0 ? '#f59e0b' : undefined,
                },
                {
                    id: 'expired',
                    title: 'Expired/Pending',
                    value: this.stats.expired,
                    type: 'number',
                    icon: 'lucide:circleOff',
                    color: this.stats.expired > 0 ? '#ef4444' : undefined,
                },
            ];
        }
        render() {
            return html `
      <div class="header">
        <span class="description">Manage domains and SSL certificates</span>
        <button class="sync-button" @click=${() => this.handleSync()}>Sync Cloudflare</button>
      </div>

      <dees-statsgrid
        .tiles=${this.tiles}
        .minTileWidth=${200}
      ></dees-statsgrid>

      <div class="table-container">
        <div class="table-header">
          <span>Domain</span>
          <span>Provider</span>
          <span>Services</span>
          <span>Certificate</span>
          <span>Expires</span>
          <span>Actions</span>
        </div>
        ${this.domains.length > 0 ? this.domains.map(domain => html `
          <div class="table-row">
            <span class="domain-name">${domain.domain}</span>
            <span class="provider">${domain.provider}</span>
            <span>${domain.serviceCount}</span>
            <span><span class="status-badge ${domain.certificateStatus}">${domain.certificateStatus}</span></span>
            <span class="expires">${domain.expiresIn || '-'}</span>
            <span>
              <button class="view-button" @click=${() => this.handleView(domain)}>View</button>
            </span>
          </div>
        `) : html `
          <div class="empty-state">No domains configured</div>
        `}
      </div>
    `;
        }
        handleSync() {
            this.dispatchEvent(new CustomEvent('sync', { bubbles: true, composed: true }));
        }
        handleView(domain) {
            this.dispatchEvent(new CustomEvent('view', { detail: domain, bubbles: true, composed: true }));
        }
        constructor() {
            super(...arguments);
            __runInitializers(this, _stats_extraInitializers);
        }
        static {
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return SzNetworkDomainsView = _classThis;
})();
export { SzNetworkDomainsView };
//# sourceMappingURL=data:application/json;base64, 