import { p as proxyCustomElement, H, c as createEvent, h } from './p-a53686b3.js';
import { r as randomIdGenerator } from './p-ffe5c0e8.js';
import { N as NotificationAlertHeadingLevel, p as NotificationAlertSize, q as NotificationAlertVariation, u as TypographyVariation } from './p-5a256d98.js';
import './p-717306ef.js';
import './p-a4a001e1.js';
import { b as ButtonVariation } from './p-f518a4cf.js';
import './p-7e32c40b.js';
import './p-dcdffb3c.js';
import './p-5d21a361.js';
import './p-ad16c7a1.js';
import './p-f40f4b2a.js';
import './p-1f68d501.js';
import './p-ee88e3f1.js';
import './p-8142cc73.js';
import './p-905ccb30.js';
import './p-bc3d2778.js';
import './p-c8429245.js';
import './p-06625463.js';
import './p-f447b984.js';
import './p-9c5a93d8.js';
import './p-7933b555.js';
import './p-0f6c0360.js';
import './p-814ca2ad.js';
import './p-d8a98b3b.js';
import './p-07303cb5.js';
import './p-5f8dc01a.js';
import './p-2a023831.js';
import './p-5ba6737a.js';
import './p-e4a9f8f0.js';
import './p-f2a6768b.js';
import './p-40657c82.js';
import './p-f600576a.js';
import './p-3b20ec86.js';
import './p-9dd5d6c8.js';
import './p-77a93845.js';
import './p-06f939ab.js';
import './p-8cd2d6dd.js';
import './p-484a1d6d.js';
import './p-0f3fbb1e.js';
import './p-820e795b.js';
import './p-46cbbcb5.js';
import './p-d74742b8.js';
import './p-6e383896.js';
import './p-4bad4fb0.js';
import './p-d1886fff.js';
import './p-a6ca40fc.js';
import './p-b0e88537.js';
import './p-cdcaf0eb.js';
import { d as defineCustomElement$7 } from './p-e8fc33ed.js';
import { d as defineCustomElement$6 } from './p-e25ae6dc.js';
import { d as defineCustomElement$5 } from './p-31096d78.js';
import { d as defineCustomElement$4 } from './p-c102c5fe.js';
import { d as defineCustomElement$3 } from './p-915b1874.js';
import { d as defineCustomElement$2 } from './p-70ca6868.js';
import { d as defineCustomElement$1 } from './p-5c53d1d4.js';

const notificationAlertCss = ".sc-digi-notification-alert-h{--digi--notification-alert--heading--font-weight:var(--digi--typography--heading-3--font-weight--desktop);--digi--notification-alert--heading--font-size:var(--digi--typography--heading-3--font-size--desktop);--digi--notification-alert--heading--font-size--large:var(--digi--typography--heading-3--font-size--desktop-large);--digi--notification-alert--icon--padding--large:var(--digi--gutter--largest);--digi--notification-alert--icon--padding--medium:var(--digi--gutter--largest);--digi--notification-alert--icon--padding--small:var(--digi--gutter--large);--digi--notification-alert--icon--width--large:2.25rem;--digi--notification-alert--icon--width--medium:1.4375rem;--digi--notification-alert--icon--width--small:1.4375rem;--digi--notification-alert--max-width--large:100%;--digi--notification-alert--max-width--medium:31.25rem;--digi--notification-alert--max-width--small:18.75rem;--digi--notification-alert--border--informative:var(--digi--border-width--secondary) solid var(--digi--color--border--sentiment--info);--digi--notification-alert--icon--color--informative:var(--digi--color--icon--secondary);--digi--notification-alert--icon--background--informative:var(--digi--color--background--sentiment--info--primary);--digi--notification-alert--border--success:var(--digi--border-width--secondary) solid var(--digi--color--border--sentiment--success);--digi--notification-alert--icon--color--success:var(--digi--color--icon--secondary);--digi--notification-alert--icon--background--success:var(--digi--color--background--sentiment--success--primary);--digi--notification-alert--border--warning:var(--digi--border-width--secondary) solid var(--digi--color--border--sentiment--warning);--digi--notification-alert--icon--color--warning:var(--digi--color--icon--primary);--digi--notification-alert--icon--background--warning:var(--digi--color--background--sentiment--warning--primary);--digi--notification-alert--border--danger:var(--digi--border-width--secondary) solid var(--digi--color--border--sentiment--error);--digi--notification-alert--icon--color--danger:var(--digi--color--icon--secondary);--digi--notification-alert--icon--background--danger:var(--digi--color--background--sentiment--error--primary)}.sc-digi-notification-alert-h .digi-notification-alert.sc-digi-notification-alert{position:relative;max-width:var(--MAX-WIDTH)}.sc-digi-notification-alert-h .digi-notification-alert--variation-info.sc-digi-notification-alert{--BORDER:var(--digi--notification-alert--border--informative);--ICON--COLOR:var(--digi--notification-alert--icon--color--informative);--ICON--BACKGROUND:var(--digi--notification-alert--icon--background--informative)}.sc-digi-notification-alert-h .digi-notification-alert--variation-success.sc-digi-notification-alert{--BORDER:var(--digi--notification-alert--border--success);--ICON--COLOR:var(--digi--notification-alert--icon--color--success);--ICON--BACKGROUND:var(--digi--notification-alert--icon--background--success)}.sc-digi-notification-alert-h .digi-notification-alert--variation-danger.sc-digi-notification-alert{--BORDER:var(--digi--notification-alert--border--danger);--ICON--COLOR:var(--digi--notification-alert--icon--color--danger);--ICON--BACKGROUND:var(--digi--notification-alert--icon--background--danger)}.sc-digi-notification-alert-h .digi-notification-alert--variation-warning.sc-digi-notification-alert{--BORDER:var(--digi--notification-alert--border--warning);--ICON--COLOR:var(--digi--notification-alert--icon--color--warning);--ICON--BACKGROUND:var(--digi--notification-alert--icon--background--warning)}.sc-digi-notification-alert-h .digi-notification-alert--size-large.sc-digi-notification-alert{--MAX-WIDTH:var(--digi--notification-alert--max-width--large);--ICON--PADDING:var(--digi--notification-alert--icon--padding--large);--ICON--WIDTH:var(--digi--notification-alert--icon--width--large)}.sc-digi-notification-alert-h .digi-notification-alert--size-medium.sc-digi-notification-alert{--MAX-WIDTH:var(--digi--notification-alert--max-width--medium);--ICON--PADDING:var(--digi--notification-alert--icon--padding--medium);--ICON--WIDTH:var(--digi--notification-alert--icon--width--medium)}.sc-digi-notification-alert-h .digi-notification-alert--size-small.sc-digi-notification-alert{--MAX-WIDTH:var(--digi--notification-alert--max-width--small);--ICON--PADDING:var(--digi--notification-alert--icon--padding--small);--ICON--WIDTH:var(--digi--notification-alert--icon--width--small)}.sc-digi-notification-alert-h .digi-notification-alert--size-small.sc-digi-notification-alert .digi-notification-alert__close-button__text.sc-digi-notification-alert{border:0;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sc-digi-notification-alert-h .digi-notification-alert--closeable.sc-digi-notification-alert .digi-notification-alert__wrapper.sc-digi-notification-alert{display:flex;justify-content:space-between;flex-direction:row-reverse}.sc-digi-notification-alert-h .digi-notification-alert--closeable.sc-digi-notification-alert .digi-notification-alert__text.sc-digi-notification-alert{padding-right:0}.sc-digi-notification-alert-h .digi-notification-alert__layout.sc-digi-notification-alert{display:flex;align-items:stretch;gap:0}.sc-digi-notification-alert-h .digi-notification-alert__icon.sc-digi-notification-alert{background:var(--ICON--BACKGROUND);padding:var(--ICON--PADDING);display:flex;align-items:center;justify-content:center;height:100%;box-sizing:border-box}.sc-digi-notification-alert-h .digi-notification-alert__icon.sc-digi-notification-alert>*.sc-digi-notification-alert{--digi--icon--width:var(--ICON--WIDTH);--digi--icon--color:var(--ICON--COLOR)}.sc-digi-notification-alert-h .digi-notification-alert__wrapper.sc-digi-notification-alert{display:flex;border:var(--BORDER);background-color:var(--digi--color--background--primary);border-left:none;height:100%;box-sizing:border-box}.sc-digi-notification-alert-h .digi-notification-alert__text.sc-digi-notification-alert{padding:var(--digi--gutter--largest)}.sc-digi-notification-alert-h .digi-notification-alert__close-button.sc-digi-notification-alert{--digi--button--color--function:var(--digi--color--text--primary);--digi--button--color--function--hover:var(--digi--color--text--primary)}@media screen and (max-width: 47.9375rem){.sc-digi-notification-alert-h .digi-notification-alert__close-button__text.sc-digi-notification-alert{border:0;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}}.sc-digi-notification-alert-h .digi-notification-alert__heading.sc-digi-notification-alert{font-family:var(--digi--global--typography--font-family--default);font-size:var(--digi--notification-alert--heading--font-size);font-weight:var(--digi--notification-alert--heading--font-weight);color:var(--digi--color--text--primary);margin:0;display:block}@media (min-width: 61.9375rem){.sc-digi-notification-alert-h .digi-notification-alert__heading.sc-digi-notification-alert{font-size:var(--digi--notification-alert--heading--font-size--large)}}.sc-digi-notification-alert-h .digi-notification-alert__heading.sc-digi-notification-alert:focus{outline:none}.sc-digi-notification-alert-h .digi-notification-alert__content.sc-digi-notification-alert>*.sc-digi-notification-alert{--digi--typography--max-width:var(--MAX-WIDTH);--digi--typography--margin-top--text:var(--digi--gutter--small)}.sc-digi-notification-alert-h .icon-wrapper.sc-digi-notification-alert{align-items:stretch}.sc-digi-notification-alert-h .main-wrapper.sc-digi-notification-alert{flex:1}";
const DigiNotificationAlertStyle0 = notificationAlertCss;

const NotificationAlert = /*@__PURE__*/ proxyCustomElement(class NotificationAlert extends H {
    constructor() {
        super();
        this.__registerHost();
        this.afOnClose = createEvent(this, "afOnClose", 7);
        this.afOnReady = createEvent(this, "afOnReady", 3);
        this.listItems = [];
        this.afHeading = undefined;
        this.afHeadingLevel = NotificationAlertHeadingLevel.H2;
        this.afSize = NotificationAlertSize.LARGE;
        this.afVariation = NotificationAlertVariation.INFO;
        this.afCloseable = false;
        this.afCloseAriaLabel = 'Stäng meddelandet';
        this.afId = randomIdGenerator('digi-notification-alert');
    }
    /**
     * Hämtar en referens till rubrikelementet. Bra för att t.ex. sätta fokus programmatiskt.
     * @en Returns a reference to the heading element. Handy for setting focus programmatically.
     */
    async afMGetHeadingElement() {
        return this._heading;
    }
    clickHandler(e) {
        this.afOnClose.emit(e);
    }
    componentDidLoad() {
        this.afOnReady.emit();
    }
    get cssModifiers() {
        return {
            [`digi-notification-alert--size-${this.afSize}`]: !!this.afSize,
            [`digi-notification-alert--variation-${this.afVariation}`]: !!this.afVariation,
            'digi-notification-alert--closeable': this.afCloseable
        };
    }
    get icon() {
        switch (this.afVariation) {
            case NotificationAlertVariation.SUCCESS:
                return h("digi-icon-notification-succes", null);
            case NotificationAlertVariation.WARNING:
                return h("digi-icon-notification-warning", null);
            case NotificationAlertVariation.DANGER:
                return h("digi-icon-notification-error", null);
            default:
                return h("digi-icon-notification-info", null);
        }
    }
    render() {
        return (h("div", { key: 'a65e377eef21711500336dffce094f7b40f35ce4', class: Object.assign({ 'digi-notification-alert': true }, this.cssModifiers) }, h("div", { key: 'a9a876baf7de65aa8eb93d5137c9059f93344d0a', class: "digi-notification-alert__layout" }, h("div", { key: '07193a4975b0f7f4f90423b36ac94b56d211c4e0', class: "icon-wrapper" }, h("div", { key: '66b386e44e4efb140964441afbaec022cc0d39ec', class: "digi-notification-alert__icon", slot: "media" }, this.icon)), h("div", { key: '3ae5fe83e801949034abef041510eb135a59f13b', class: "main-wrapper" }, h("div", { key: '3bd030aae0bbe614f6d3b5d60ede4eedfe94e199', class: "digi-notification-alert__wrapper" }, this.afCloseable && (h("digi-button", { key: 'b9378b953d4c075539cc6b8d523a52418633b3bc', "af-aria-label": this.afCloseAriaLabel, "af-variation": ButtonVariation.FUNCTION, onAfOnClick: (e) => this.clickHandler(e), class: "digi-notification-alert__close-button" }, h("span", { key: '491e27b98a6311c6a946a0c087b2312dd02bf0de', class: "digi-notification-alert__close-button__text" }, "St\u00E4ng"), h("digi-icon-x", { key: '6aba84a687b5fab08c1086a03628a3be7c9e9a30', slot: "icon-secondary", "aria-hidden": "true" }))), h("div", { key: '124516eb32cce95d50019522e808ebe0e0ccc5f8', class: "digi-notification-alert__text" }, this.afHeading &&
            this.afSize === NotificationAlertSize.LARGE && (h(this.afHeadingLevel, { key: '201565155f6d59df45b5127ce99bc7b65972d303', ref: (el) => (this._heading = el), tabindex: "-1", class: "digi-notification-alert__heading" }, this.afHeading)), h("div", { key: 'f5dc3c6c2f150b3ce472903955a4b2eae65e7f21', class: "digi-notification-alert__content" }, h("digi-typography", { key: 'e32223d898eabb4b2798e780548e6bff3fbfaf38', "af-variation": TypographyVariation.SMALL }, h("slot", { key: '7188bfa5ddbbe94832968dc9a1ae0bbd2c668e06' })))))))));
    }
    get hostElement() { return this; }
    static get style() { return DigiNotificationAlertStyle0; }
}, [6, "digi-notification-alert", {
        "afHeading": [1, "af-heading"],
        "afHeadingLevel": [1, "af-heading-level"],
        "afSize": [1, "af-size"],
        "afVariation": [1, "af-variation"],
        "afCloseable": [4, "af-closeable"],
        "afCloseAriaLabel": [1, "af-close-aria-label"],
        "afId": [1, "af-id"],
        "afMGetHeadingElement": [64]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["digi-notification-alert", "digi-button", "digi-icon-notification-error", "digi-icon-notification-info", "digi-icon-notification-succes", "digi-icon-notification-warning", "digi-icon-x", "digi-typography"];
    components.forEach(tagName => { switch (tagName) {
        case "digi-notification-alert":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, NotificationAlert);
            }
            break;
        case "digi-button":
            if (!customElements.get(tagName)) {
                defineCustomElement$7();
            }
            break;
        case "digi-icon-notification-error":
            if (!customElements.get(tagName)) {
                defineCustomElement$6();
            }
            break;
        case "digi-icon-notification-info":
            if (!customElements.get(tagName)) {
                defineCustomElement$5();
            }
            break;
        case "digi-icon-notification-succes":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "digi-icon-notification-warning":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "digi-icon-x":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
        case "digi-typography":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}

export { NotificationAlert as N, defineCustomElement as d };
