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 SzRegistryExternalView = (() => {
    let _classDecorators = [customElement('sz-registry-external-view')];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = DeesElement;
    let _registries_decorators;
    let _registries_initializers = [];
    let _registries_extraInitializers = [];
    var SzRegistryExternalView = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _registries_decorators = [property({ type: Array })];
            __esDecorate(this, null, _registries_decorators, { kind: "accessor", name: "registries", static: false, private: false, access: { has: obj => "registries" in obj, get: obj => obj.registries, set: (obj, value) => { obj.registries = value; } }, metadata: _metadata }, _registries_initializers, _registries_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            SzRegistryExternalView = _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: 800px;">
      <sz-registry-external-view
        .registries=${[
            { id: '1', name: 'Docker Hub', url: 'docker.io', username: 'myuser', type: 'dockerhub' },
            { id: '2', name: 'GitHub Container Registry', url: 'ghcr.io', username: 'myorg', type: 'ghcr' },
        ]}
      ></sz-registry-external-view>
    </div>
  `;
        #registries_accessor_storage = __runInitializers(this, _registries_initializers, []);
        get registries() { return this.#registries_accessor_storage; }
        set registries(value) { this.#registries_accessor_storage = value; }
        static styles = [
            cssManager.defaultStyles,
            css `
      :host {
        display: block;
      }

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

      .header-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .header-title {
        font-size: 18px;
        font-weight: 600;
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
      }

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

      .add-button {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        background: ${cssManager.bdTheme('#18181b', '#fafafa')};
        border: none;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 500;
        color: ${cssManager.bdTheme('#fafafa', '#18181b')};
        cursor: pointer;
        transition: all 200ms ease;
      }

      .add-button:hover {
        opacity: 0.9;
      }

      .registry-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .registry-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px;
        background: ${cssManager.bdTheme('#ffffff', '#09090b')};
        border: 1px solid ${cssManager.bdTheme('#e4e4e7', '#27272a')};
        border-radius: 8px;
      }

      .registry-info {
        display: flex;
        align-items: center;
        gap: 12px;
      }

      .registry-icon {
        width: 40px;
        height: 40px;
        background: ${cssManager.bdTheme('#f4f4f5', '#18181b')};
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
      }

      .registry-details {
        display: flex;
        flex-direction: column;
        gap: 2px;
      }

      .registry-name {
        font-size: 14px;
        font-weight: 500;
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
      }

      .registry-url {
        font-size: 13px;
        font-family: monospace;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
      }

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

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

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

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

      .action-button.delete:hover {
        background: ${cssManager.bdTheme('#fee2e2', 'rgba(239, 68, 68, 0.2)')};
      }

      .empty-state {
        background: ${cssManager.bdTheme('#ffffff', '#09090b')};
        border: 1px solid ${cssManager.bdTheme('#e4e4e7', '#27272a')};
        border-radius: 8px;
        padding: 48px 24px;
        text-align: center;
      }

      .empty-icon {
        width: 48px;
        height: 48px;
        margin: 0 auto 16px;
        color: ${cssManager.bdTheme('#a1a1aa', '#52525b')};
      }

      .empty-title {
        font-size: 16px;
        font-weight: 600;
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
        margin-bottom: 8px;
      }

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

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

      .empty-button:hover {
        background: ${cssManager.bdTheme('#f4f4f5', '#18181b')};
      }
    `,
        ];
        render() {
            return html `
      <div class="header">
        <div class="header-info">
          <div class="header-title">External Registries</div>
          <div class="header-subtitle">Add credentials for private Docker registries</div>
        </div>
        <button class="add-button" @click=${() => this.handleAdd()}>Add Registry</button>
      </div>

      ${this.registries.length > 0 ? html `
        <div class="registry-list">
          ${this.registries.map(registry => html `
            <div class="registry-item">
              <div class="registry-info">
                <div class="registry-icon">
                  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                    <path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path>
                  </svg>
                </div>
                <div class="registry-details">
                  <div class="registry-name">${registry.name}</div>
                  <div class="registry-url">${registry.url} (${registry.username})</div>
                </div>
              </div>
              <div class="registry-actions">
                <button class="action-button" @click=${() => this.handleEdit(registry)}>Edit</button>
                <button class="action-button delete" @click=${() => this.handleDelete(registry)}>Delete</button>
              </div>
            </div>
          `)}
        </div>
      ` : html `
        <div class="empty-state">
          <svg class="empty-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
            <path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path>
            <polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline>
            <line x1="12" y1="22.08" x2="12" y2="12"></line>
          </svg>
          <div class="empty-title">No external registries</div>
          <div class="empty-description">Add credentials for Docker Hub, GitHub Container Registry, or other private registries.</div>
          <button class="empty-button" @click=${() => this.handleAdd()}>Add External Registry</button>
        </div>
      `}
    `;
        }
        handleAdd() {
            this.dispatchEvent(new CustomEvent('add', { bubbles: true, composed: true }));
        }
        handleEdit(registry) {
            this.dispatchEvent(new CustomEvent('edit', { detail: registry, bubbles: true, composed: true }));
        }
        handleDelete(registry) {
            this.dispatchEvent(new CustomEvent('delete', { detail: registry, bubbles: true, composed: true }));
        }
        constructor() {
            super(...arguments);
            __runInitializers(this, _registries_extraInitializers);
        }
        static {
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return SzRegistryExternalView = _classThis;
})();
export { SzRegistryExternalView };
//# sourceMappingURL=data:application/json;base64, 