'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 rtkSettingsToggleCss = ":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}";
const RtkSettingsToggleStyle0 = rtkSettingsToggleCss;

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 RtkSettingsToggle = class {
    constructor(hostRef) {
        index$1.registerInstance(this, hostRef);
        this.stateUpdate = index$1.createEvent(this, "rtkStateUpdate", 7);
        /** Variant */
        this.variant = 'button';
        /** Icon pack */
        this.iconPack = uiStore.defaultIconPack;
        /** Language */
        this.t = uiStore.useLanguage();
    }
    toggleSettings() {
        const updatePartial = { activeSettings: true, activeMoreMenu: false };
        this.states = Object.assign(Object.assign({}, this.states), updatePartial);
        this.stateUpdate.emit(updatePartial);
    }
    render() {
        const text = this.t('settings');
        return (index$1.h(index$1.Host, { key: '921afc41ed4a6019ff882c896855ab455b3edfb7', title: text }, index$1.h("rtk-controlbar-button", { key: '88d4194fee24f1b96769e06e3a935d516ad543b0', part: "controlbar-button", size: this.size, iconPack: this.iconPack, onClick: () => this.toggleSettings(), icon: this.iconPack.settings, label: text, variant: this.variant })));
    }
};
__decorate([
    index.SyncWithStore()
], RtkSettingsToggle.prototype, "states", void 0);
__decorate([
    index.SyncWithStore()
], RtkSettingsToggle.prototype, "iconPack", void 0);
__decorate([
    index.SyncWithStore()
], RtkSettingsToggle.prototype, "t", void 0);
RtkSettingsToggle.style = RtkSettingsToggleStyle0;

exports.rtk_settings_toggle = RtkSettingsToggle;
