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 SzServicesListView = (() => {
    let _classDecorators = [customElement('sz-services-list-view')];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = DeesElement;
    let _services_decorators;
    let _services_initializers = [];
    let _services_extraInitializers = [];
    var SzServicesListView = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _services_decorators = [property({ type: Array })];
            __esDecorate(this, null, _services_decorators, { kind: "accessor", name: "services", static: false, private: false, access: { has: obj => "services" in obj, get: obj => obj.services, set: (obj, value) => { obj.services = value; } }, metadata: _metadata }, _services_initializers, _services_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            SzServicesListView = _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-services-list-view
        .services=${[
            { name: 'test-nginx', image: 'nginx:alpine', domain: 'app.bleu.de', status: 'running' },
            { name: 'hello-world', image: 'localhost:3000/hello-world:latest', domain: 'hello.task.vc', status: 'running' },
            { name: 'test-v2', image: 'localhost:3000/test-registry:v1', domain: null, status: 'running' },
            { name: 'api-service', image: 'node:18-alpine', domain: 'api.example.com', status: 'stopped' },
        ]}
      ></sz-services-list-view>
    </div>
  `;
        #services_accessor_storage = __runInitializers(this, _services_initializers, []);
        get services() { return this.#services_accessor_storage; }
        set services(value) { this.#services_accessor_storage = value; }
        static styles = [
            cssManager.defaultStyles,
            css `
      :host {
        display: block;
      }

      .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: 1.5fr 2fr 1.5fr 100px 200px;
        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: 1.5fr 2fr 1.5fr 100px 200px;
        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')};
      }

      .service-name {
        font-weight: 500;
        color: ${cssManager.bdTheme('#2563eb', '#60a5fa')};
        cursor: pointer;
      }

      .service-name:hover {
        text-decoration: underline;
      }

      .image {
        font-family: monospace;
        font-size: 13px;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .domain-link {
        color: ${cssManager.bdTheme('#2563eb', '#60a5fa')};
        text-decoration: none;
      }

      .domain-link:hover {
        text-decoration: underline;
      }

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

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

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

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

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

      .actions {
        display: flex;
        gap: 8px;
      }

      .action-button {
        padding: 4px 10px;
        background: transparent;
        border: 1px solid ${cssManager.bdTheme('#e4e4e7', '#27272a')};
        border-radius: 4px;
        font-size: 12px;
        cursor: pointer;
        transition: all 200ms ease;
      }

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

      .action-button.stop {
        color: ${cssManager.bdTheme('#ca8a04', '#facc15')};
        border-color: ${cssManager.bdTheme('#fef9c3', 'rgba(250, 204, 21, 0.3)')};
      }

      .action-button.start {
        color: ${cssManager.bdTheme('#16a34a', '#22c55e')};
        border-color: ${cssManager.bdTheme('#dcfce7', 'rgba(34, 197, 94, 0.3)')};
      }

      .action-button.restart {
        color: ${cssManager.bdTheme('#2563eb', '#60a5fa')};
        border-color: ${cssManager.bdTheme('#dbeafe', 'rgba(59, 130, 246, 0.3)')};
      }

      .action-button.delete {
        color: ${cssManager.bdTheme('#dc2626', '#ef4444')};
        border-color: ${cssManager.bdTheme('#fee2e2', 'rgba(239, 68, 68, 0.3)')};
      }

      .empty-state {
        padding: 48px 24px;
        text-align: center;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
      }
    `,
        ];
        render() {
            return html `
      <div class="table-container">
        <div class="table-header">
          <span>Name</span>
          <span>Image</span>
          <span>Domain</span>
          <span>Status</span>
          <span>Actions</span>
        </div>
        ${this.services.length > 0 ? this.services.map(service => html `
          <div class="table-row">
            <span class="service-name" @click=${() => this.handleServiceClick(service)}>${service.name}</span>
            <span class="image" title="${service.image}">${service.image}</span>
            <span>
              ${service.domain
                ? html `<a class="domain-link" href="https://${service.domain}" target="_blank">${service.domain}</a>`
                : '-'}
            </span>
            <span><span class="status-badge ${service.status}">${service.status}</span></span>
            <span class="actions">
              ${service.status === 'running'
                ? html `<button class="action-button stop" @click=${() => this.handleAction(service, 'stop')}>Stop</button>`
                : html `<button class="action-button start" @click=${() => this.handleAction(service, 'start')}>Start</button>`}
              <button class="action-button restart" @click=${() => this.handleAction(service, 'restart')}>Restart</button>
              <button class="action-button delete" @click=${() => this.handleAction(service, 'delete')}>Delete</button>
            </span>
          </div>
        `) : html `
          <div class="empty-state">No services deployed</div>
        `}
      </div>
    `;
        }
        handleServiceClick(service) {
            this.dispatchEvent(new CustomEvent('service-click', { detail: service, bubbles: true, composed: true }));
        }
        handleAction(service, action) {
            this.dispatchEvent(new CustomEvent('service-action', { detail: { service, action }, bubbles: true, composed: true }));
        }
        constructor() {
            super(...arguments);
            __runInitializers(this, _services_extraInitializers);
        }
        static {
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return SzServicesListView = _classThis;
})();
export { SzServicesListView };
//# sourceMappingURL=data:application/json;base64, 