import { p as proxyCustomElement, H, e as createEvent, h, c as Host } from './p-ae373651.js';
import { e as defaultIconPack, i as useLanguage } from './p-5b3a7f00.js';
import { S as SyncWithStore } from './p-070aa695.js';
import { d as defineCustomElement$1 } from './p-85587a5c.js';

const rtkConfirmationModalCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:flex;flex-direction:column;overflow:hidden;border-radius:var(--rtk-border-radius-md, 8px);padding:var(--rtk-space-8, 32px);width:100%;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));width:400px;max-width:80%}.leave-modal{width:100%;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.leave-modal .header h2{margin:var(--rtk-space-0, 0px)}.leave-modal .content{font-size:14px}.leave-modal p{margin-top:var(--rtk-space-3, 12px);margin-bottom:var(--rtk-space-3, 12px)}.leave-meeting{display:flex;flex-direction:row;justify-content:space-between;gap:var(--rtk-space-4, 16px)}.leave-meeting rtk-button{color:rgb(var(--rtk-colors-text-1000, 255 255 255));flex:1 1 0%}.br-secondary-btn{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.br-secondary-btn:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}";
const RtkConfirmationModalStyle0 = rtkConfirmationModalCss;

var __decorate = (undefined && undefined.__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;
};
const RtkConfirmationModal = /*@__PURE__*/ proxyCustomElement(class RtkConfirmationModal extends H {
    constructor() {
        super();
        this.__registerHost();
        this.__attachShadow();
        this.stateUpdate = createEvent(this, "rtkStateUpdate", 7);
        this.keyPressListener = (e) => {
            if (e.key === 'Escape') {
                this.close();
            }
        };
        /** Icon pack */
        this.iconPack = defaultIconPack;
        /** Language */
        this.t = useLanguage();
        this.close = () => {
            this.states.activeConfirmationModal.onClose(this.stateUpdate, this.states, this.meeting);
            this.stateUpdate.emit({ activeConfirmationModal: { active: false } });
            this.states.activeConfirmationModal = { active: false };
        };
        this.onConfirmation = async () => {
            this.states.activeConfirmationModal.onClick(this.stateUpdate, this.states, this.meeting);
            this.stateUpdate.emit({ activeConfirmationModal: { active: false } });
            this.states.activeConfirmationModal = { active: false };
        };
    }
    connectedCallback() {
        document.addEventListener('keydown', this.keyPressListener);
    }
    componentDidLoad() { }
    disconnectedCallback() {
        document.removeEventListener('keydown', this.keyPressListener);
    }
    render() {
        var _a, _b;
        const state = this.states.activeConfirmationModal;
        return (h(Host, { key: 'faaa0531618c40c1e31ab3f77a9b038cd917244e' }, h("div", { key: '930c37d5d2e290a739d50dcd9c2ad298465850d3', class: "leave-modal" }, h("div", { key: '0bfb807f0f28d8bc1a28c03c548eca5b0e36eaab', class: "header" }, h("h2", { key: '0985fb052282b0b67ec259bd4e3b555405bc7283', class: "title" }, state.header ? this.t(state.header) : this.t('cta.confirmation'))), state.content && h("p", { key: '99ea852e8d28f4164a6bd159dcb1b967c92b7a63', class: "message" }, this.t(state.content)), h("div", { key: '44073f19fa772c1d4c4bcc4962be90aad26b6965', class: "content" }, h("div", { key: '823c39dfd07659d5f9391242acdac1654e14b588', class: "leave-meeting" }, h("rtk-button", { key: 'e549f53577a5a3b4e677fac6b66f5024868c748f', variant: "secondary", title: state.cancelText ? this.t(state.cancelText) : this.t('cancel'), onClick: this.close, class: "br-secondary-btn" }, state.cancelText ? this.t(state.cancelText) : this.t('cancel')), h("rtk-button", { key: 'da7969392d5781fb63e999c6e4c6b022f7aae23d', onClick: () => this.onConfirmation(), variant: (_b = (_a = this.states.activeConfirmationModal) === null || _a === void 0 ? void 0 : _a.variant) !== null && _b !== void 0 ? _b : 'danger', title: state.ctaText ? this.t(state.ctaText) : this.t('yes') }, state.ctaText ? this.t(state.ctaText) : this.t('yes')))))));
    }
    static get style() { return RtkConfirmationModalStyle0; }
}, [1, "rtk-confirmation-modal", {
        "meeting": [16],
        "states": [16],
        "iconPack": [16],
        "t": [16]
    }]);
__decorate([
    SyncWithStore()
], RtkConfirmationModal.prototype, "meeting", void 0);
__decorate([
    SyncWithStore()
], RtkConfirmationModal.prototype, "states", void 0);
__decorate([
    SyncWithStore()
], RtkConfirmationModal.prototype, "iconPack", void 0);
__decorate([
    SyncWithStore()
], RtkConfirmationModal.prototype, "t", void 0);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["rtk-confirmation-modal", "rtk-button"];
    components.forEach(tagName => { switch (tagName) {
        case "rtk-confirmation-modal":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, RtkConfirmationModal);
            }
            break;
        case "rtk-button":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}
defineCustomElement();

export { RtkConfirmationModal as R, defineCustomElement as d };
