'use client';
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var tslib = require('tslib');
var decorators_js = require('lit/decorators.js');
var sgdsElement = require('./sgds-element.cjs.js');
var card = require('./card.cjs.js');
var textVariants = require('../styles/text-variants.cjs.js');
var bgVariants = require('../styles/bg-variants.cjs.js');
var borderVariants = require('../styles/border-variants.cjs.js');
var headerClass = require('../styles/header-class.cjs.js');
var paragraph = require('../styles/paragraph.cjs.js');

class CardElement extends sgdsElement["default"] {
    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["default"].styles, textVariants["default"], bgVariants["default"], borderVariants["default"], headerClass["default"], paragraph["default"], card["default"]];
tslib.__decorate([
    decorators_js.query("a.card")
], CardElement.prototype, "card", void 0);
tslib.__decorate([
    decorators_js.property({ type: Boolean, reflect: true })
], CardElement.prototype, "stretchedLink", void 0);
tslib.__decorate([
    decorators_js.property({ type: Boolean, reflect: true })
], CardElement.prototype, "disabled", void 0);
tslib.__decorate([
    decorators_js.property({ type: Boolean, reflect: true })
], CardElement.prototype, "hideBorder", void 0);
tslib.__decorate([
    decorators_js.property({ type: Boolean, reflect: true })
], CardElement.prototype, "tinted", void 0);
tslib.__decorate([
    decorators_js.property({ type: String, reflect: true })
], CardElement.prototype, "orientation", void 0);

exports.CardElement = CardElement;
//# sourceMappingURL=card-element.cjs.js.map
