import { r as registerInstance, h, a as Host } from './index-55463a54.js';
import { c as createDefaultConfig, i as useLanguage } from './ui-store-76bb0e8e.js';
import { S as SyncWithStore } from './index-dafb4b7f.js';

const rtkLogoCss = ":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:flex;flex-direction:column;align-items:center;justify-content:center;color:rgb(var(--rtk-colors-text-1000, 255 255 255));height:100%;width:auto}svg,img{height:100%;width:auto}.brand-color{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}";
const RtkLogoStyle0 = rtkLogoCss;

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 RtkLogo = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        /** Config object */
        this.config = createDefaultConfig();
        /** Language */
        this.t = useLanguage();
    }
    connectedCallback() {
        this.configChanged(this.config);
        this.meetingChanged(this.meeting);
    }
    configChanged(config) {
        var _a;
        if (config != null) {
            const configLogo = (_a = config === null || config === void 0 ? void 0 : config.designTokens) === null || _a === void 0 ? void 0 : _a.logo;
            // NOTE(callmetarush): Only update logo if not passed via prop
            if (configLogo != null && this.logoUrl == null) {
                this.logoUrl = configLogo;
            }
        }
    }
    meetingChanged(meeting) {
        var _a, _b, _c, _d;
        if (meeting != null) {
            const meetingLogo = (_d = (_c = (_b = (_a = meeting.self) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.header) === null || _c === void 0 ? void 0 : _c.elements) === null || _d === void 0 ? void 0 : _d.logo;
            if (meetingLogo != null && this.logoUrl == null) {
                this.logoUrl = meetingLogo;
            }
        }
    }
    render() {
        if (!this.logoUrl || this.logoUrl === '') {
            return null;
        }
        const logo = this.logoUrl;
        const text = this.t('logo');
        return (h(Host, { class: "loaded" }, h("img", { src: logo, alt: text })));
    }
    static get watchers() { return {
        "config": ["configChanged"],
        "meeting": ["meetingChanged"]
    }; }
};
__decorate([
    SyncWithStore()
], RtkLogo.prototype, "config", void 0);
__decorate([
    SyncWithStore()
], RtkLogo.prototype, "meeting", void 0);
__decorate([
    SyncWithStore()
], RtkLogo.prototype, "t", void 0);
RtkLogo.style = RtkLogoStyle0;

export { RtkLogo as rtk_logo };
