/*!
 * KoliBri - The accessible HTML-Standard
 */
'use strict';

var index = require('./index-DBbl8tEq.js');
var variantQuote = require('./variant-quote-DUWZtljE.js');
var component = require('./component-CYZTV5r0.js');
var controller = require('./controller-DHsc-8t1.js');
require('./common-DAAt5YQ7.js');
require('./normalizers-R90MJyQR.js');
require('./_Uint8Array-BAQUGozM.js');
require('./isArray-BOIOdEQh.js');
require('./component-4yrnT9ww.js');
require('./tslib.es6-Cm0ytgPY.js');
require('./bem-registry-D9uDM1GJ.js');
require('./clsx-Bm_HQUnh.js');
require('./component-C1vBQDN-.js');
require('./align-floating-elements-DfUaAAqe.js');
require('./tooltip-open-tracking-Ba0udJRU.js');
require('./align-e4FQ7dUp.js');
require('./label-CrUhy8f0.js');
require('./base-controller-DAzsTqX9.js');

const KolTooltipWc = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.controller = new controller.TooltipController(variantQuote.BaseWebComponent.stateLess);
        this._align = 'top';
    }
    validateAlign(value) {
        var _a;
        (_a = this.controller) === null || _a === void 0 ? void 0 : _a.watchAlign(value);
    }
    validateId(value) {
        var _a;
        (_a = this.controller) === null || _a === void 0 ? void 0 : _a.watchId(value);
    }
    validateLabel(value) {
        var _a;
        (_a = this.controller) === null || _a === void 0 ? void 0 : _a.watchLabel(value);
    }
    hideTooltip() {
        var _a;
        return Promise.resolve((_a = this.controller) === null || _a === void 0 ? void 0 : _a.hideTooltip());
    }
    componentWillLoad() {
        this.controller.componentWillLoad({
            label: this._label,
            align: this._align,
            badgeText: this._badgeText,
            id: this._id,
        });
    }
    connectedCallback() {
        var _a, _b, _c;
        (_a = this.controller) === null || _a === void 0 ? void 0 : _a.initContext(((_c = (_b = this.host) === null || _b === void 0 ? void 0 : _b.previousElementSibling) !== null && _c !== void 0 ? _c : undefined));
    }
    componentDidRender() {
        var _a;
        if (this.host) {
            (_a = this.controller) === null || _a === void 0 ? void 0 : _a.handleEventListeners(this.host);
        }
    }
    disconnectedCallback() {
        var _a;
        (_a = this.controller) === null || _a === void 0 ? void 0 : _a.destroy();
    }
    render() {
        return (index.h(index.Host, { key: 'f677d58b886cdb9f1aab620608155ee412e0ef7d', class: "kol-tooltip" }, index.h(component.TooltipFC, { key: 'd86d1adc81a94fbb1116532e9f2529d96362834d', label: this.controller.getRenderProp('label'), badgeText: this._badgeText, id: this.controller.getRenderProp('id'), refFloating: (el) => { var _a; return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setTooltipElementRef(el); } })));
    }
    get host() { return index.getElement(this); }
    static get watchers() { return {
        "_align": ["validateAlign"],
        "_id": ["validateId"],
        "_label": ["validateLabel"]
    }; }
};

exports.kol_tooltip_wc = KolTooltipWc;
//# sourceMappingURL=kol-tooltip-wc.entry.cjs.js.map
