'use strict';

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

const index$1 = require('./index-2e5758b6.js');
const uiStore = require('./ui-store-583d205a.js');
const index = require('./index-3f8e5441.js');

const rtkRecordingIndicatorCss = ":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{display:block}:host([data-hidden]){display:none}:host[size='sm']{margin-left:var(--rtk-space-1, 4px);margin-right:var(--rtk-space-1, 4px)}.indicator{display:flex;flex-direction:row;align-items:center;font-size:14px;--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}rtk-icon{margin-right:var(--rtk-space-1, 4px);height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);animation:blink 4s linear infinite}:host([size='sm']) rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}:host([size='sm']) .indicator span{display:none}@keyframes blink{0%,10%{opacity:0}11%,100%{opacity:1}}";
const RtkRecordingIndicatorStyle0 = rtkRecordingIndicatorCss;

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 RtkRecordingIndicator = class {
    constructor(hostRef) {
        index$1.registerInstance(this, hostRef);
        /** Language */
        this.t = uiStore.useLanguage();
        /** Icon pack */
        this.iconPack = uiStore.defaultIconPack;
        this.setIsRecording = (recordingState) => {
            this.isRecording = recordingState === 'RECORDING';
        };
    }
    connectedCallback() {
        this.meetingChanged(this.meeting);
    }
    disconnectedCallback() {
        var _a;
        (_a = this.meeting) === null || _a === void 0 ? void 0 : _a.recording.removeListener('recordingUpdate', this.updateRecordingStatus);
    }
    meetingChanged(meeting) {
        if (meeting != null) {
            this.setIsRecording(meeting.recording.recordingState);
            this.updateRecordingStatus = (recordingState) => {
                this.setIsRecording(recordingState);
            };
            meeting.recording.addListener('recordingUpdate', this.updateRecordingStatus);
        }
    }
    render() {
        return (index$1.h(index$1.Host, { key: 'c4246e4721b0ca5fbc689a90688f1239df60ecad', "data-hidden": !this.isRecording }, this.isRecording && (index$1.h("div", { key: 'ce19b3649bba8a91cd22770534762c932b934557', class: "indicator", "aria-label": this.t('recording.indicator'), part: "indicator" }, index$1.h("rtk-icon", { key: '9d2ae89fef0d4e1e0d3546f765f48be8a6da6b5a', icon: this.iconPack.recording, "aria-hidden": true, tabIndex: -1, part: "icon" }), index$1.h("span", { key: 'cedf044a1a96c164022d734be2baf7e568fb849e' }, this.t('recording.label'))))));
    }
    static get watchers() { return {
        "meeting": ["meetingChanged"]
    }; }
};
__decorate([
    index.SyncWithStore()
], RtkRecordingIndicator.prototype, "meeting", void 0);
__decorate([
    index.SyncWithStore()
], RtkRecordingIndicator.prototype, "t", void 0);
__decorate([
    index.SyncWithStore()
], RtkRecordingIndicator.prototype, "iconPack", void 0);
RtkRecordingIndicator.style = RtkRecordingIndicatorStyle0;

exports.rtk_recording_indicator = RtkRecordingIndicator;
