export class DropdownFocusUtil {
    connectedCallback(component) {
        this.component = component;
    }
    focusOptionByLabel(key, options = {}) {
        this.component.labelToFocus = (this.component.labelToFocus + key).trim();
        if (this.component.labelToFocus.length > 0) {
            clearTimeout(this.keyHitTimeout);
            this.keyHitTimeout = setTimeout(() => {
                var _a;
                (_a = this.component.listEl) === null || _a === void 0 ? void 0 : _a.focusByLabel(this.component.labelToFocus, options);
            }, 100);
            clearTimeout(this.timeout);
            this.timeout = setTimeout(async () => {
                this.component.labelToFocus = '';
            }, 1000);
        }
    }
}
