import { getIconElement, isDefinedIcon } from "./chunk-ZUETELRC.js"; import { DevToolbarWindow, settings } from "./chunk-LEX3GG7N.js"; import "./chunk-5WRI5ZAA.js"; // node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/badge.js var sizes = ["small", "large"]; var styles = ["purple", "gray", "red", "green", "yellow", "blue"]; var DevToolbarBadge = class extends HTMLElement { _size = "small"; _badgeStyle = "purple"; get size() { return this._size; } set size(value) { if (!sizes.includes(value)) { settings.logger.error( `Invalid size: ${value}, expected one of ${sizes.join(", ")}, got ${value}.` ); return; } this._size = value; this.updateStyle(); } get badgeStyle() { return this._badgeStyle; } set badgeStyle(value) { if (!styles.includes(value)) { settings.logger.error( `Invalid style: ${value}, expected one of ${styles.join(", ")}, got ${value}.` ); return; } this._badgeStyle = value; this.updateStyle(); } shadowRoot; static observedAttributes = ["badge-style", "size"]; constructor() { super(); this.shadowRoot = this.attachShadow({ mode: "open" }); this.shadowRoot.innerHTML = `
`; } connectedCallback() { this.updateStyle(); } attributeChangedCallback() { if (this.hasAttribute("badge-style")) this.badgeStyle = this.getAttribute("badge-style"); if (this.hasAttribute("size")) this.size = this.getAttribute("size"); } updateStyle() { const style = this.shadowRoot.querySelector("#selected-style"); if (style) { style.innerHTML = ` .badge { --text-color: var(--${this.badgeStyle}-text); --border-color: var(--${this.badgeStyle}-border); --size: var(--${this.size}); }`; } } }; // node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/button.js var sizes2 = ["small", "medium", "large"]; var styles2 = ["ghost", "outline", "purple", "gray", "red", "green", "yellow", "blue"]; var borderRadii = ["normal", "rounded"]; var DevToolbarButton = class extends HTMLElement { _size = "small"; _buttonStyle = "purple"; _buttonBorderRadius = "normal"; get size() { return this._size; } set size(value) { if (!sizes2.includes(value)) { settings.logger.error( `Invalid size: ${value}, expected one of ${sizes2.join(", ")}, got ${value}.` ); return; } this._size = value; this.updateStyle(); } get buttonStyle() { return this._buttonStyle; } set buttonStyle(value) { if (!styles2.includes(value)) { settings.logger.error( `Invalid style: ${value}, expected one of ${styles2.join(", ")}, got ${value}.` ); return; } this._buttonStyle = value; this.updateStyle(); } get buttonBorderRadius() { return this._buttonBorderRadius; } set buttonBorderRadius(value) { if (!borderRadii.includes(value)) { settings.logger.error( `Invalid border-radius: ${value}, expected one of ${borderRadii.join(", ")}, got ${value}.` ); return; } this._buttonBorderRadius = value; this.updateStyle(); } static observedAttributes = ["button-style", "size", "button-border-radius"]; shadowRoot; constructor() { super(); this.shadowRoot = this.attachShadow({ mode: "open" }); this.shadowRoot.innerHTML = ` `; } connectedCallback() { this.updateStyle(); } updateStyle() { const style = this.shadowRoot.querySelector("#selected-style"); if (style) { style.innerHTML = ` button { --background: var(--${this.buttonStyle}-background); --border: var(--${this.buttonStyle}-border); --font-size: var(--${this.size}-font-size); --text-color: var(--${this.buttonStyle}-text); ${this.buttonBorderRadius === "normal" ? "--padding: var(--" + this.size + "-padding);" : "--padding: var(--" + this.size + "-rounded-padding);"} --border-radius: var(--${this.buttonBorderRadius}-border-radius); }`; } } attributeChangedCallback() { if (this.hasAttribute("size")) this.size = this.getAttribute("size"); if (this.hasAttribute("button-style")) this.buttonStyle = this.getAttribute("button-style"); } }; // node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/card.js var styles3 = ["purple", "gray", "red", "green", "yellow", "blue"]; var DevToolbarCard = class extends HTMLElement { link; clickAction; shadowRoot; _cardStyle = "purple"; get cardStyle() { return this._cardStyle; } set cardStyle(value) { if (!styles3.includes(value)) { settings.logger.error( `Invalid style: ${value}, expected one of ${styles3.join(", ")}, got ${value}.` ); return; } this._cardStyle = value; this.updateStyle(); } static observedAttributes = ["card-style"]; constructor() { super(); this.shadowRoot = this.attachShadow({ mode: "open" }); this.link = this.getAttribute("link"); } attributeChangedCallback() { if (this.hasAttribute("card-style")) this.cardStyle = this.getAttribute("card-style"); this.updateStyle(); } updateStyle() { const style = this.shadowRoot.querySelector("#selected-style"); if (style) { style.innerHTML = ` :host { --hover-background: var(--${this.cardStyle}-hover-background); --hover-border: var(--${this.cardStyle}-hover-border); } `; } } connectedCallback() { const element = this.link ? "a" : this.clickAction ? "button" : "div"; this.shadowRoot.innerHTML += ` <${element}${this.link ? ` href="${this.link}" target="_blank"` : ``} id="astro-overlay-card"> `; this.updateStyle(); if (this.clickAction) { this.shadowRoot.getElementById("astro-overlay-card")?.addEventListener("click", this.clickAction); } } }; // node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/highlight.js var styles4 = ["purple", "gray", "red", "green", "yellow", "blue"]; var DevToolbarHighlight = class extends HTMLElement { icon; _highlightStyle = "purple"; get highlightStyle() { return this._highlightStyle; } set highlightStyle(value) { if (!styles4.includes(value)) { settings.logger.error( `Invalid style: ${value}, expected one of ${styles4.join(", ")}, got ${value}.` ); return; } this._highlightStyle = value; this.updateStyle(); } static observedAttributes = ["highlight-style"]; shadowRoot; constructor() { super(); this.shadowRoot = this.attachShadow({ mode: "open" }); this.icon = this.hasAttribute("icon") ? this.getAttribute("icon") : void 0; this.shadowRoot.innerHTML = ` `; } updateStyle() { const style = this.shadowRoot.querySelector("#selected-style"); if (style) { style.innerHTML = ` :host { --background: var(--${this.highlightStyle}-background); --border: var(--${this.highlightStyle}-border); }`; } } attributeChangedCallback() { if (this.hasAttribute("highlight-style")) this.highlightStyle = this.getAttribute("highlight-style"); } connectedCallback() { this.updateStyle(); if (this.icon) { let iconContainer = document.createElement("div"); iconContainer.classList.add("icon"); let iconElement; if (isDefinedIcon(this.icon)) { iconElement = getIconElement(this.icon); } else { iconElement = document.createElementNS("http://www.w3.org/2000/svg", "svg"); iconElement.setAttribute("viewBox", "0 0 16 16"); iconElement.innerHTML = this.icon; } if (iconElement) { iconElement?.style.setProperty("width", "16px"); iconElement?.style.setProperty("height", "16px"); iconContainer.append(iconElement); this.shadowRoot.append(iconContainer); } } } }; // node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/icon.js var DevToolbarIcon = class extends HTMLElement { _icon = void 0; shadowRoot; get icon() { return this._icon; } set icon(name) { this._icon = name; this.buildTemplate(); } constructor() { super(); this.shadowRoot = this.attachShadow({ mode: "open" }); if (this.hasAttribute("icon")) { this.icon = this.getAttribute("icon"); } else { this.buildTemplate(); } } getIconHTML(icon) { if (icon && isDefinedIcon(icon)) { return getIconElement(icon)?.outerHTML ?? ""; } return ""; } buildTemplate() { this.shadowRoot.innerHTML = ` ${this.getIconHTML(this._icon)}`; } }; // node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/radio-checkbox.js var styles5 = ["purple", "gray", "red", "green", "yellow", "blue"]; var DevToolbarRadioCheckbox = class extends HTMLElement { _radioStyle = "purple"; input; shadowRoot; get radioStyle() { return this._radioStyle; } set radioStyle(value) { if (!styles5.includes(value)) { console.error(`Invalid style: ${value}, expected one of ${styles5.join(", ")}.`); return; } this._radioStyle = value; this.updateStyle(); } static observedAttributes = ["radio-style", "checked", "disabled", "name", "value"]; constructor() { super(); this.shadowRoot = this.attachShadow({ mode: "open" }); this.shadowRoot.innerHTML = ` `; this.input = document.createElement("input"); this.input.type = "radio"; this.shadowRoot.append(this.input); } connectedCallback() { this.updateInputState(); this.updateStyle(); } updateStyle() { const styleElement = this.shadowRoot.querySelector("#selected-style"); if (styleElement) { styleElement.innerHTML = ` :host { --unchecked-color: var(--${this._radioStyle}-unchecked); --checked-color: var(--${this._radioStyle}-checked); } `; } } updateInputState() { this.input.checked = this.hasAttribute("checked"); this.input.disabled = this.hasAttribute("disabled"); this.input.name = this.getAttribute("name") || ""; this.input.value = this.getAttribute("value") || ""; } attributeChangedCallback() { if (this.hasAttribute("radio-style")) { this.radioStyle = this.getAttribute("radio-style"); } this.updateInputState(); } }; // node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/select.js var styles6 = ["purple", "gray", "red", "green", "yellow", "blue"]; var DevToolbarSelect = class extends HTMLElement { shadowRoot; element; _selectStyle = "gray"; get selectStyle() { return this._selectStyle; } set selectStyle(value) { if (!styles6.includes(value)) { settings.logger.error(`Invalid style: ${value}, expected one of ${styles6.join(", ")}.`); return; } this._selectStyle = value; this.updateStyle(); } static observedAttributes = ["select-style"]; constructor() { super(); this.shadowRoot = this.attachShadow({ mode: "open" }); this.shadowRoot.innerHTML = ` `; this.element = document.createElement("select"); this.shadowRoot.addEventListener("slotchange", (event) => { if (event.target instanceof HTMLSlotElement) { this.element.append(...event.target.assignedNodes()); } }); } connectedCallback() { this.element.name = "dev-toolbar-select"; this.shadowRoot.append(this.element); this.updateStyle(); } attributeChangedCallback() { if (this.hasAttribute("select-style")) { this.selectStyle = this.getAttribute("select-style"); } } updateStyle() { const style = this.shadowRoot.querySelector("#selected-style"); if (style) { style.innerHTML = ` :host { --text-color: var(--${this.selectStyle}-text); --border-color: var(--${this.selectStyle}-border); } `; } } }; // node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/toggle.js var styles7 = ["purple", "gray", "red", "green", "yellow", "blue"]; var DevToolbarToggle = class extends HTMLElement { shadowRoot; input; _toggleStyle = "gray"; get toggleStyle() { return this._toggleStyle; } set toggleStyle(value) { if (!styles7.includes(value)) { settings.logger.error(`Invalid style: ${value}, expected one of ${styles7.join(", ")}.`); return; } this._toggleStyle = value; this.updateStyle(); } static observedAttributes = ["toggle-style"]; constructor() { super(); this.shadowRoot = this.attachShadow({ mode: "open" }); this.shadowRoot.innerHTML = ` `; this.input = document.createElement("input"); } attributeChangedCallback() { if (this.hasAttribute("toggle-style")) this.toggleStyle = this.getAttribute("toggle-style"); } updateStyle() { const style = this.shadowRoot.querySelector("#selected-style"); if (style) { style.innerHTML = ` :host { --bg-on: var(--${this.toggleStyle}-bg-on); --border-off: var(--${this.toggleStyle}-border-off); --border-on: var(--${this.toggleStyle}-border-on); } `; } } connectedCallback() { this.input.type = "checkbox"; this.input.name = "dev-toolbar-toggle"; this.shadowRoot.append(this.input); this.updateStyle(); } get value() { return this.input.value; } set value(val) { this.input.value = val; } }; // node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/tooltip.js var DevToolbarTooltip = class extends HTMLElement { sections = []; shadowRoot; constructor() { super(); this.shadowRoot = this.attachShadow({ mode: "open" }); } connectedCallback() { this.shadowRoot.innerHTML = `