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 SzNetworkDnsView = (() => {
    let _classDecorators = [customElement('sz-network-dns-view')];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = DeesElement;
    let _records_decorators;
    let _records_initializers = [];
    let _records_extraInitializers = [];
    var SzNetworkDnsView = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _records_decorators = [property({ type: Array })];
            __esDecorate(this, null, _records_decorators, { kind: "accessor", name: "records", static: false, private: false, access: { has: obj => "records" in obj, get: obj => obj.records, set: (obj, value) => { obj.records = value; } }, metadata: _metadata }, _records_initializers, _records_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            SzNetworkDnsView = _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: 1000px;">
      <sz-network-dns-view
        .records=${[
            { domain: 'pr.task.vc', type: 'A', value: '195.201.98.232' },
            { domain: 'outline.task.vc', type: 'A', value: '195.201.98.232' },
            { domain: 'ns1.task.vc', type: 'A', value: '212.95.99.130' },
            { domain: 'bleu.de', type: 'A', value: '212.95.99.130' },
            { domain: 'mail.bleu.de', type: 'MX', value: '10 mail.bleu.de' },
        ]}
      ></sz-network-dns-view>
    </div>
  `;
        #records_accessor_storage = __runInitializers(this, _records_initializers, []);
        get records() { return this.#records_accessor_storage; }
        set records(value) { this.#records_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')};
      }

      .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 80px 2fr 100px;
        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 80px 2fr 100px;
        gap: 16px;
        padding: 12px 16px;
        border-bottom: 1px solid ${cssManager.bdTheme('#f4f4f5', '#27272a')};
        font-size: 14px;
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
        transition: background 200ms ease;
      }

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

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

      .domain {
        font-weight: 500;
      }

      .type-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 2px 8px;
        background: ${cssManager.bdTheme('#dbeafe', 'rgba(59, 130, 246, 0.2)')};
        color: ${cssManager.bdTheme('#2563eb', '#60a5fa')};
        border-radius: 4px;
        font-size: 12px;
        font-weight: 600;
      }

      .value {
        font-family: monospace;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
      }

      .delete-button {
        padding: 6px 12px;
        background: transparent;
        border: 1px solid ${cssManager.bdTheme('#fee2e2', 'rgba(239, 68, 68, 0.3)')};
        border-radius: 4px;
        font-size: 13px;
        color: ${cssManager.bdTheme('#dc2626', '#ef4444')};
        cursor: pointer;
        transition: all 200ms ease;
      }

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

      .empty-state {
        padding: 48px 24px;
        text-align: center;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
      }
    `,
        ];
        render() {
            return html `
      <div class="header">
        <span class="description">Manage DNS records synced with Cloudflare</span>
        <button class="sync-button" @click=${() => this.handleSync()}>
          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
            <path d="M21 12a9 9 0 0 1-9 9m9-9a9 9 0 0 0-9-9m9 9H3m9 9a9 9 0 0 1-9-9m9 9c1.66 0 3-4.03 3-9s-1.34-9-3-9m0 18c-1.66 0-3-4.03-3-9s1.34-9 3-9"/>
          </svg>
          Sync Cloudflare
        </button>
      </div>

      <div class="table-container">
        <div class="table-header">
          <span>Domain</span>
          <span>Type</span>
          <span>Value</span>
          <span>Actions</span>
        </div>
        ${this.records.length > 0 ? this.records.map(record => html `
          <div class="table-row">
            <span class="domain">${record.domain}</span>
            <span><span class="type-badge">${record.type}</span></span>
            <span class="value">${record.value}</span>
            <span>
              <button class="delete-button" @click=${() => this.handleDelete(record)}>Delete</button>
            </span>
          </div>
        `) : html `
          <div class="empty-state">No DNS records found</div>
        `}
      </div>
    `;
        }
        handleSync() {
            this.dispatchEvent(new CustomEvent('sync', { bubbles: true, composed: true }));
        }
        handleDelete(record) {
            this.dispatchEvent(new CustomEvent('delete', { detail: record, bubbles: true, composed: true }));
        }
        constructor() {
            super(...arguments);
            __runInitializers(this, _records_extraInitializers);
        }
        static {
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return SzNetworkDnsView = _classThis;
})();
export { SzNetworkDnsView };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3otbmV0d29yay1kbnMtdmlldy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX3dlYi9lbGVtZW50cy9zei1uZXR3b3JrLWRucy12aWV3LnRzIl0sIm5hbWVzIj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