/*!
 * KoliBri - The accessible HTML-Standard
 */
import { r as registerInstance, h, H as Host } from './index-Brmny3Vg.js';
import { _ as __decorate } from './tslib.es6-QNbPBOk5.js';
import { B as BaseWebComponent } from './variant-quote-BMV8GZX8.js';
import { C as ClickButtonFC } from './component-DohIJBPw.js';
import './common-DEEjER7G.js';
import { l as labelProp } from './label-DPd4-fag.js';
import { B as BaseController } from './base-controller-CXhqh4cR.js';
import { d as delegateFocus, c as createCtaRef } from './element-interaction-C5-6aPzz.js';
import './normalizers-pgU77mXp.js';
import './_Uint8Array-kJHDjtoP.js';
import './isArray-CcrBs4JM.js';
import './bem-registry-B9CzNnO1.js';
import './element-focus-BQXzaLL9.js';

const clickButtonPropsConfig = {
    required: [labelProp],
};

class ClickButtonController extends BaseController {
    constructor(stateAccess) {
        super(stateAccess, clickButtonPropsConfig);
        this.handleClick = () => {
            console.log(this, 'button clicked');
        };
    }
    componentWillLoad(props) {
        const { label } = props;
        this.watchLabel(label);
    }
    watchLabel(value) {
        labelProp.apply(value, (v) => {
            this.setRenderProp('label', v);
        });
    }
}

const KolClickButton = class extends BaseWebComponent {
    constructor(hostRef) {
        super();
        registerInstance(this, hostRef);
        this.ctrl = new ClickButtonController(this.stateAccess);
        this.buttonRef = createCtaRef();
    }
    watchLabel(value) {
        this.ctrl.watchLabel(value);
    }
    async focus(options) { }
    componentWillLoad() {
        this.ctrl.componentWillLoad({
            label: this._label,
        });
    }
    render() {
        return (h(Host, { key: '922d574d34d7ff5632a9b5489bbf4b205f64f3bd' }, h(ClickButtonFC, { key: '3546de6fd6b08ff2c01efc46943cf26ce50252c4', label: this.ctrl.getRenderProp('label'), refButton: this.buttonRef, handleClick: this.ctrl.handleClick })));
    }
    static get watchers() { return {
        "_label": ["watchLabel"]
    }; }
};
__decorate([
    delegateFocus('buttonRef')
], KolClickButton.prototype, "focus", null);

export { KolClickButton as kol_click_button };
//# sourceMappingURL=kol-click-button.entry.js.map
