var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; import { icon } from "@mariozechner/mini-lit"; import { LitElement } from "lit"; import { property, state } from "lit/decorators.js"; import { html } from "lit/html.js"; import { Check, Copy } from "lucide"; import { i18n } from "../utils/i18n.js"; export class ConsoleBlock extends LitElement { constructor() { super(...arguments); this.content = ""; this.variant = "default"; this.copied = false; } createRenderRoot() { return this; } connectedCallback() { super.connectedCallback(); this.style.display = "block"; } async copy() { try { await navigator.clipboard.writeText(this.content || ""); this.copied = true; setTimeout(() => { this.copied = false; }, 1500); } catch (e) { console.error("Copy failed", e); } } updated() { // Auto-scroll to bottom on content changes const container = this.querySelector(".console-scroll"); if (container) { container.scrollTop = container.scrollHeight; } } render() { const isError = this.variant === "error"; const textClass = isError ? "text-destructive" : "text-foreground"; return html `
${i18n("console")}
${this.content || ""}
`; } } __decorate([ property() ], ConsoleBlock.prototype, "content", void 0); __decorate([ property() ], ConsoleBlock.prototype, "variant", void 0); __decorate([ state() ], ConsoleBlock.prototype, "copied", void 0); // Register custom element if (!customElements.get("console-block")) { customElements.define("console-block", ConsoleBlock); } //# sourceMappingURL=ConsoleBlock.js.map