'use client';
import { __decorate } from 'tslib';
import { query, property } from 'lit/decorators.js';
import SgdsElement from './sgds-element.js';
import css_248z$5 from './card.js';
import css_248z from '../styles/text-variants.js';
import css_248z$1 from '../styles/bg-variants.js';
import css_248z$2 from '../styles/border-variants.js';
import css_248z$3 from '../styles/header-class.js';
import css_248z$4 from '../styles/paragraph.js';

class CardElement extends SgdsElement {
    constructor() {
        super(...arguments);
        /** Extends the link passed in either `footer` or `link`(deprecated) slot.
         */
        this.stretchedLink = false;
        /** Disables the card  */
        this.disabled = false;
        /** When true, hides the default border of the card. */
        this.hideBorder = false;
        /** When true, applies a tinted background color to the card. */
        this.tinted = false;
        /** Sets the orientation of the card. Available options: `vertical`, `horizontal` */
        this.orientation = "vertical";
    }
    handleTitleSlotChange(e) {
        const childNodes = e.target.assignedNodes({ flatten: true });
        if (this.stretchedLink && childNodes[0] instanceof HTMLAnchorElement) {
            const hyperlink = childNodes[0].querySelector("a") || childNodes[0];
            hyperlink.removeAttribute("href");
        }
        return;
    }
    warnLinkSlotMisused(e) {
        const childNodes = e.target.assignedNodes({ flatten: true });
        if (childNodes.length > 1) {
            return console.error("Multiple elements passed into SgdsCard's link slot");
        }
    }
}
CardElement.styles = [...SgdsElement.styles, css_248z, css_248z$1, css_248z$2, css_248z$3, css_248z$4, css_248z$5];
__decorate([
    query("a.card")
], CardElement.prototype, "card", void 0);
__decorate([
    property({ type: Boolean, reflect: true })
], CardElement.prototype, "stretchedLink", void 0);
__decorate([
    property({ type: Boolean, reflect: true })
], CardElement.prototype, "disabled", void 0);
__decorate([
    property({ type: Boolean, reflect: true })
], CardElement.prototype, "hideBorder", void 0);
__decorate([
    property({ type: Boolean, reflect: true })
], CardElement.prototype, "tinted", void 0);
__decorate([
    property({ type: String, reflect: true })
], CardElement.prototype, "orientation", void 0);

export { CardElement };
//# sourceMappingURL=card-element.js.map
