function _check_private_redeclaration(obj, privateCollection) {
    if (privateCollection.has(obj)) {
        throw new TypeError("Cannot initialize the same private elements twice on an object");
    }
}
function _class_apply_descriptor_get(receiver, descriptor) {
    if (descriptor.get) {
        return descriptor.get.call(receiver);
    }
    return descriptor.value;
}
function _class_apply_descriptor_set(receiver, descriptor, value) {
    if (descriptor.set) {
        descriptor.set.call(receiver, value);
    } else {
        if (!descriptor.writable) {
            throw new TypeError("attempted to set read only private field");
        }
        descriptor.value = value;
    }
}
function _class_extract_field_descriptor(receiver, privateMap, action) {
    if (!privateMap.has(receiver)) {
        throw new TypeError("attempted to " + action + " private field on non-instance");
    }
    return privateMap.get(receiver);
}
function _class_private_field_get(receiver, privateMap) {
    var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
    return _class_apply_descriptor_get(receiver, descriptor);
}
function _class_private_field_init(obj, privateMap, value) {
    _check_private_redeclaration(obj, privateMap);
    privateMap.set(obj, value);
}
function _class_private_field_set(receiver, privateMap, value) {
    var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
    _class_apply_descriptor_set(receiver, descriptor, value);
    return value;
}
function _class_private_method_get(receiver, privateSet, fn) {
    if (!privateSet.has(receiver)) {
        throw new TypeError("attempted to get private field on non-instance");
    }
    return fn;
}
function _class_private_method_init(obj, privateSet) {
    _check_private_redeclaration(obj, privateSet);
    privateSet.add(obj);
}
import { mixin } from '../../../helpers/object.mjs';
import localHooks from '../../../mixins/localHooks.mjs';
import { getCheckboxElement, includesValue } from '../utils/utils.mjs';
import EventManager from '../../../eventManager.mjs';
import { InputController } from './inputController.mjs';
import { selectItem, deselectItem, createSearchInputWrapper, createSearchIcon, createSearchInputElement, createSeparatorElement, createListElement, getDropdownWidth, deselectAllItems, defocusItem, focusItemAt, disableUncheckedCheckboxes, enableAllCheckboxes, createListItemElement } from './utils.mjs';
var /**
   * Handsontable instance id.
   */ _instanceId = /*#__PURE__*/ new WeakMap(), /**
   * Element that wraps the dropdown list inside the editor UI.
   *
   * @private
   * @type {HTMLDivElement|null}
   */ _containerElement = /*#__PURE__*/ new WeakMap(), /**
   * `<ul>` element containing all checkbox rows.
   *
   * @private
   * @type {HTMLUListElement|null}
   */ _dropdownListElement = /*#__PURE__*/ new WeakMap(), /**
   * Search input element for filtering dropdown entries.
   *
   * @private
   * @type {HTMLInputElement|null}
   */ _searchInputElement = /*#__PURE__*/ new WeakMap(), /**
   * Separator element between the search input and the dropdown list.
   *
   * @private
   * @type {HTMLDivElement|null}
   */ _separatorElement = /*#__PURE__*/ new WeakMap(), /**
   * Wrapper element for the search input.
   *
   * @private
   * @type {HTMLDivElement|null}
   */ _searchInputWrapper = /*#__PURE__*/ new WeakMap(), /**
   * Input controller for managing the search input.
   *
   * @private
   * @type {InputController|null}
   */ _inputController = /*#__PURE__*/ new WeakMap(), /**
   * Cached document reference used for DOM operations.
   *
   * @private
   * @type {Document|null}
   */ _rootDocument = /*#__PURE__*/ new WeakMap(), /**
   * Event manager for handling checkbox change events.
   *
   * @private
   * @type {EventManager}
   */ _eventManager = /*#__PURE__*/ new WeakMap(), /**
   * Cache for the dropdown controller.
   *
   * @private
   * @type {object}
   */ _cache = /*#__PURE__*/ new WeakMap(), /**
   * Selects the item at the given index.
   *
   * @param {number} index Index of the item to focus.
   */ _focusItem = /*#__PURE__*/ new WeakSet(), /**
   * Checks if the dropdown requires flipping vertically.
   *
   * @param {object} availableSpace Available space object.
   * @returns {boolean}
   */ _requiresFlippingVertically = /*#__PURE__*/ new WeakSet(), /**
   * Toggles the vertical flip.
   *
   * @param {object} availableSpace Available space object.
   */ _toggleVerticalFlip = /*#__PURE__*/ new WeakSet(), /**
   * Gets the height of an entry.
   *
   * @returns {number} Height of an entry.
   */ _getEntryHeight = /*#__PURE__*/ new WeakSet(), /**
   * Gets the height of the list.
   *
   * @param {boolean} maxRowsCalculation If true, the height will be calculated for the maximum number of rows.
   * @returns {number} Height of the list.
   */ _getListHeight = /*#__PURE__*/ new WeakSet(), /**
   * Gets the height of the search input wrapper.
   *
   * @returns {number} Height of the search input wrapper.
   */ _getSearchInputWrapperHeight = /*#__PURE__*/ new WeakSet(), /**
   * Adds a single row to the dropdown and optionally marks it as checked.
   *
   * @param {object} options Options object.
   * @param {Document} options.rootDocument Root document element.
   * @param {string} options.itemKey Key stored in the associated checkbox dataset.
   * @param {string} options.itemValue Text content rendered next to the checkbox.
   * @param {number} options.indexWithinList Index of the item within the list.
   * @param {boolean} [options.checked=false] Flag indicating whether the checkbox starts selected.
   * @param {boolean} [options.disabled=false] Flag indicating whether the checkbox starts disabled.
   */ _addDropdownItem = /*#__PURE__*/ new WeakSet(), /**
   * Wires checkbox change events to toggle selection and emit hooks.
   *
   * @param {HTMLLIElement} itemElement Dropdown row element.
   */ _registerEvents = /*#__PURE__*/ new WeakSet(), /**
   * Unregisters events from the item element.
   *
   * @param {HTMLLIElement} itemElement Dropdown row element.
   */ _unregisterEvents = /*#__PURE__*/ new WeakSet(), /**
   * Resets the cache.
   */ _resetCache = /*#__PURE__*/ new WeakSet();
/**
 * Renders and manages the dropdown list used by the `MultiSelectEditor`.
 * Responsible for rendering checkbox rows and emitting hooks when values change.
 *
 * @private
 * @class DropdownController
 */ export class DropdownController {
    /**
   * Builds required DOM elements and inserts them into the container.
   */ init() {
        _class_private_field_set(this, _dropdownListElement, createListElement({
            root: _class_private_field_get(this, _rootDocument)
        }));
        _class_private_field_set(this, _searchInputElement, createSearchInputElement({
            root: _class_private_field_get(this, _rootDocument)
        }));
        const searchIcon = createSearchIcon({
            root: _class_private_field_get(this, _rootDocument)
        });
        _class_private_field_set(this, _searchInputWrapper, createSearchInputWrapper({
            root: _class_private_field_get(this, _rootDocument)
        }));
        _class_private_field_set(this, _separatorElement, createSeparatorElement({
            root: _class_private_field_get(this, _rootDocument)
        }));
        _class_private_field_get(this, _searchInputWrapper).appendChild(searchIcon);
        _class_private_field_get(this, _searchInputWrapper).appendChild(_class_private_field_get(this, _searchInputElement));
        _class_private_field_get(this, _containerElement).appendChild(_class_private_field_get(this, _searchInputWrapper));
        _class_private_field_get(this, _containerElement).appendChild(_class_private_field_get(this, _separatorElement));
        _class_private_field_get(this, _containerElement).appendChild(_class_private_field_get(this, _dropdownListElement));
        _class_private_field_set(this, _inputController, new InputController({
            input: _class_private_field_get(this, _searchInputElement),
            eventManager: _class_private_field_get(this, _eventManager)
        }));
    }
    /**
   * Sets the number of visible rows in the dropdown.
   *
   * @param {number} visibleRowsNumber Number of visible rows.
   */ setVisibleRowsNumberSetting(visibleRowsNumber) {
        _class_private_field_get(this, _cache).visibleRowsNumberSetting = visibleRowsNumber;
    }
    /**
   * Sets the source sort function.
   *
   * @param {Function} sourceSortFunction Source sort function.
   */ setSourceSortFunction(sourceSortFunction) {
        _class_private_field_get(this, _cache).sourceSortFunction = sourceSortFunction ?? null;
    }
    /**
   * Sets the visibility of the search input.
   *
   * @param {boolean} [searchInput=true] If true, the search input will be displayed.
   */ setSearchInputVisibility(searchInput = true) {
        _class_private_field_get(this, _searchInputWrapper).style.display = searchInput ? '' : 'none';
        _class_private_field_get(this, _separatorElement).style.display = searchInput ? '' : 'none';
        _class_private_field_get(this, _inputController).toggle(searchInput);
    }
    /**
   * Populates the dropdown with provided entries and marks selected ones.
   *
   * @param {string[]|object[]} entries Collection of primitive values or `[value, label]` tuples.
   * @param {Array<*>} [checkedValues=[]] Values that should be rendered as checked.
   */ fillDropdown(entries, checkedValues = []) {
        this.removeAllDropdownItems();
        _class_private_field_get(this, _cache).currentlySelectedItemIndex = 0;
        if (!Array.isArray(checkedValues)) {
            checkedValues = [];
        }
        if (_class_private_field_get(this, _cache).sourceSortFunction) {
            entries = _class_private_field_get(this, _cache).sourceSortFunction(entries);
        }
        entries.forEach((elem, indexWithinList)=>{
            _class_private_method_get(this, _addDropdownItem, addDropdownItem).call(this, {
                rootDocument: _class_private_field_get(this, _rootDocument),
                itemKey: elem?.key,
                itemValue: elem?.value ?? elem,
                indexWithinList,
                checked: includesValue(checkedValues, elem),
                disabled: _class_private_field_get(this, _cache).areCheckboxesDisabled
            });
        });
        _class_private_field_get(this, _cache).entriesCount = entries.length;
        this.runLocalHooks('afterDropdownFill');
    }
    /**
   * Controls dropdown height based on entry count and configured visible rows.
   *
   * @param {object} availableSpace Available space object.
   * @param {boolean} noFlip If true, the dropdown will not be flipped vertically.
   */ updateDimensions(availableSpace, noFlip = false) {
        const entryHeight = _class_private_method_get(this, _getEntryHeight, getEntryHeight).call(this);
        const requiresFlippingVertically1 = _class_private_method_get(this, _requiresFlippingVertically, requiresFlippingVertically).call(this, availableSpace);
        const availableHeight = requiresFlippingVertically1 ? availableSpace.spaceAbove : availableSpace.spaceBelow;
        if (!noFlip && requiresFlippingVertically1) {
            _class_private_field_get(this, _cache).flippedVertically = true;
        }
        if (_class_private_field_get(this, _cache).entriesCount > 0 && availableHeight < this.getHeight(true)) {
            const maxRenderableItems = Math.max(Math.floor((availableHeight - _class_private_method_get(this, _getSearchInputWrapperHeight, getSearchInputWrapperHeight).call(this)) / entryHeight) - 1, 1);
            _class_private_field_get(this, _cache).actualRenderedItemsCount = _class_private_field_get(this, _cache).visibleRowsNumberSetting ? Math.min(maxRenderableItems, _class_private_field_get(this, _cache).visibleRowsNumberSetting) : maxRenderableItems;
        } else {
            _class_private_field_get(this, _cache).actualRenderedItemsCount = Math.min(_class_private_field_get(this, _cache).entriesCount, _class_private_field_get(this, _cache).visibleRowsNumberSetting);
        }
        if (_class_private_field_get(this, _cache).actualRenderedItemsCount && _class_private_field_get(this, _cache).entriesCount > _class_private_field_get(this, _cache).actualRenderedItemsCount) {
            _class_private_field_get(this, _containerElement).style.height = `${this.getHeight()}px`;
        } else {
            _class_private_field_get(this, _containerElement).style.height = '';
        }
        _class_private_method_get(this, _toggleVerticalFlip, toggleVerticalFlip).call(this, availableSpace);
        _class_private_field_get(this, _containerElement).scrollTop = 0;
    }
    /**
   * Gets the width of the dropdown.
   *
   * @returns {number} Width of the dropdown.
   */ getDropdownWidth() {
        return getDropdownWidth({
            dropdownListElement: _class_private_field_get(this, _dropdownListElement)
        });
    }
    /**
   * Deselects all items in the dropdown.
   */ deselectAllItems() {
        deselectAllItems({
            dropdownListElement: _class_private_field_get(this, _dropdownListElement)
        });
    }
    /**
   * Focuses the first item in the dropdown.
   */ focusFirstItem() {
        if (_class_private_field_get(this, _cache).entriesCount > 0) {
            _class_private_method_get(this, _focusItem, focusItem).call(this, 0);
        }
    }
    /**
   * Focuses the item at the given index.
   *
   * @param {number} index Index of the item to focus.
   */ focusItem(index) {
        _class_private_method_get(this, _focusItem, focusItem).call(this, index);
    }
    /**
   * Selects the previous item in the dropdown.
   */ focusPreviousItem() {
        if (_class_private_field_get(this, _cache).currentlySelectedItemIndex === 0) {
            this.focusSearchInput();
            return;
        }
        defocusItem({
            dropdownListElement: _class_private_field_get(this, _dropdownListElement),
            index: _class_private_field_get(this, _cache).currentlySelectedItemIndex
        });
        _class_private_method_get(this, _focusItem, focusItem).call(this, _class_private_field_get(this, _cache).currentlySelectedItemIndex - 1);
    }
    /**
   * Selects the next item in the dropdown.
   */ focusNextItem() {
        if (_class_private_field_get(this, _cache).currentlySelectedItemIndex === _class_private_field_get(this, _cache).entriesCount - 1) {
            return;
        }
        defocusItem({
            dropdownListElement: _class_private_field_get(this, _dropdownListElement),
            index: _class_private_field_get(this, _cache).currentlySelectedItemIndex
        });
        _class_private_method_get(this, _focusItem, focusItem).call(this, _class_private_field_get(this, _cache).currentlySelectedItemIndex + 1);
    }
    /**
   * Focuses the search input element.
   */ focusSearchInput() {
        if (_class_private_field_get(this, _searchInputElement)) {
            _class_private_field_get(this, _searchInputElement).focus();
        }
    }
    /**
   * Resets the cache and the dropdown position and height.
   */ reset() {
        this.removeAllDropdownItems();
        _class_private_method_get(this, _resetCache, resetCache).call(this);
        if (_class_private_field_get(this, _searchInputElement)) {
            _class_private_field_get(this, _searchInputElement).value = '';
        }
        _class_private_field_get(this, _containerElement).style.position = '';
        _class_private_field_get(this, _containerElement).style.top = '';
        _class_private_field_get(this, _containerElement).style.height = '';
        _class_private_field_get(this, _containerElement).scrollTop = 0;
    }
    /**
   * Checks if the dropdown is flipped vertically.
   *
   * @returns {boolean}
   */ isFlippedVertically() {
        return _class_private_field_get(this, _cache).flippedVertically;
    }
    /**
   * Gets the height of the dropdown.
   *
   * @param {boolean} maxRowsCalculation If true, the height will be calculated for the maximum number of rows.
   * @param {boolean} outerWidth If true, the width will be calculated for the outer width.
   * @returns {number} Height of the dropdown.
   */ getHeight(maxRowsCalculation = false, outerWidth = false) {
        const computedStyle = _class_private_field_get(this, _rootDocument).defaultView.getComputedStyle(_class_private_field_get(this, _containerElement));
        return _class_private_method_get(this, _getListHeight, getListHeight).call(this, maxRowsCalculation) + _class_private_method_get(this, _getSearchInputWrapperHeight, getSearchInputWrapperHeight).call(this) + (outerWidth === true ? 2 * parseInt(computedStyle.getPropertyValue('--ht-menu-vertical-padding'), 10) : 0);
    }
    /**
   * Gets the input controller instance.
   *
   * @returns {InputController|null} The input controller instance.
   */ getInputController() {
        return _class_private_field_get(this, _inputController);
    }
    /**
   * Removes all dropdown rows.
   */ removeAllDropdownItems() {
        Array.from(_class_private_field_get(this, _dropdownListElement).children).forEach((itemElement)=>_class_private_method_get(this, _unregisterEvents, unregisterEvents).call(this, itemElement));
        _class_private_field_get(this, _cache).checkboxChangeListeners.clear();
        _class_private_field_get(this, _dropdownListElement).innerHTML = '';
    }
    /**
   * Disables the unchecked checkboxes.
   */ disableCheckboxes() {
        _class_private_field_get(this, _cache).areCheckboxesDisabled = true;
        disableUncheckedCheckboxes({
            dropdownListElement: _class_private_field_get(this, _dropdownListElement)
        });
    }
    /**
   * Enables the checkboxes.
   */ enableCheckboxes() {
        _class_private_field_get(this, _cache).areCheckboxesDisabled = false;
        enableAllCheckboxes({
            dropdownListElement: _class_private_field_get(this, _dropdownListElement)
        });
    }
    /**
   * Creates a dropdown renderer attached to the provided container.
   *
   * @param {HTMLDivElement} containerElement Host element created by the editor.
   * @param {string} instanceId Handsontable instance id.
   */ constructor(containerElement, instanceId){
        _class_private_method_init(this, _focusItem);
        _class_private_method_init(this, _requiresFlippingVertically);
        _class_private_method_init(this, _toggleVerticalFlip);
        _class_private_method_init(this, _getEntryHeight);
        _class_private_method_init(this, _getListHeight);
        _class_private_method_init(this, _getSearchInputWrapperHeight);
        _class_private_method_init(this, _addDropdownItem);
        _class_private_method_init(this, _registerEvents);
        _class_private_method_init(this, _unregisterEvents);
        _class_private_method_init(this, _resetCache);
        _class_private_field_init(this, _instanceId, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _containerElement, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _dropdownListElement, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _searchInputElement, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _separatorElement, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _searchInputWrapper, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _inputController, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _rootDocument, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _eventManager, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _cache, {
            writable: true,
            value: void 0
        });
        _class_private_field_set(this, _instanceId, null);
        _class_private_field_set(this, _containerElement, null);
        _class_private_field_set(this, _dropdownListElement, null);
        _class_private_field_set(this, _searchInputElement, null);
        _class_private_field_set(this, _separatorElement, null);
        _class_private_field_set(this, _searchInputWrapper, null);
        _class_private_field_set(this, _inputController, null);
        _class_private_field_set(this, _rootDocument, null);
        _class_private_field_set(this, _eventManager, new EventManager(this));
        _class_private_field_set(this, _cache, {
            visibleRowsNumber: null,
            entriesCount: 0,
            flippedVertically: false,
            currentlySelectedItemIndex: 0,
            checkboxChangeListeners: new Map(),
            areCheckboxesDisabled: false,
            sourceSortFunction: null
        });
        _class_private_field_set(this, _containerElement, containerElement);
        _class_private_field_set(this, _rootDocument, _class_private_field_get(this, _containerElement).ownerDocument);
        _class_private_field_set(this, _instanceId, instanceId);
        this.init();
    }
}
function focusItem(index) {
    _class_private_field_get(this, _cache).currentlySelectedItemIndex = index;
    focusItemAt({
        dropdownListElement: _class_private_field_get(this, _dropdownListElement),
        index
    });
}
function requiresFlippingVertically(availableSpace) {
    const { spaceAbove, spaceBelow, cellHeight } = availableSpace;
    return this.getHeight(true) > spaceBelow && spaceAbove > spaceBelow + cellHeight;
}
function toggleVerticalFlip(availableSpace) {
    const { cellHeight } = availableSpace;
    const flipNeeded = _class_private_field_get(this, _cache).flippedVertically;
    if (flipNeeded) {
        _class_private_field_get(this, _containerElement).style.position = 'absolute';
        _class_private_field_get(this, _containerElement).style.top = `${-this.getHeight(false, true) - cellHeight - 2}px`;
    } else {
        _class_private_field_get(this, _containerElement).style.position = '';
        _class_private_field_get(this, _containerElement).style.top = '';
    }
}
function getEntryHeight() {
    const computedStyle = _class_private_field_get(this, _rootDocument).defaultView.getComputedStyle(_class_private_field_get(this, _containerElement));
    return 2 * parseInt(computedStyle.getPropertyValue('--ht-menu-item-vertical-padding'), 10) + parseInt(computedStyle.getPropertyValue('--ht-line-height'), 10);
}
function getListHeight(maxRowsCalculation = false) {
    const maxRenderedItems = _class_private_field_get(this, _cache).entriesCount;
    const actualRenderedItems = maxRowsCalculation ? maxRenderedItems : _class_private_field_get(this, _cache).actualRenderedItemsCount ?? maxRenderedItems;
    const entryHeight = _class_private_method_get(this, _getEntryHeight, getEntryHeight).call(this);
    const listHeight = actualRenderedItems * entryHeight;
    return listHeight;
}
function getSearchInputWrapperHeight() {
    if (!_class_private_field_get(this, _inputController).enabled) {
        return 0;
    }
    const computedStyle = _class_private_field_get(this, _rootDocument).defaultView.getComputedStyle(_class_private_field_get(this, _containerElement));
    const searchInputWrapperHeight = _class_private_field_get(this, _searchInputWrapper).offsetHeight;
    const separatorHeight = _class_private_field_get(this, _separatorElement).offsetHeight + 2 * parseInt(computedStyle.getPropertyValue('--ht-menu-vertical-padding'), 10);
    return searchInputWrapperHeight + separatorHeight;
}
function addDropdownItem({ rootDocument, itemKey, itemValue, indexWithinList, checked = false, disabled = false }) {
    const itemElement = createListItemElement({
        rootDocument,
        instanceId: _class_private_field_get(this, _instanceId),
        itemKey,
        itemValue,
        indexWithinList,
        checked,
        disabled
    });
    if (checked) {
        selectItem(itemElement);
    }
    _class_private_method_get(this, _registerEvents, registerEvents).call(this, itemElement);
    _class_private_field_get(this, _dropdownListElement).appendChild(itemElement);
}
function registerEvents(itemElement) {
    const checkbox = getCheckboxElement(itemElement);
    const checkboxChangeListener = ()=>{
        // Checkbox was just natively checked (so checked = was unchecked when clicked)
        if (checkbox.dataset.disabled === 'true' && checkbox.checked) {
            checkbox.checked = false;
            return;
        }
        if (checkbox.checked) {
            selectItem(itemElement);
            this.runLocalHooks('afterDropdownItemChecked', checkbox.dataset.key, checkbox.dataset.value);
        } else {
            deselectItem(itemElement);
            this.runLocalHooks('afterDropdownItemUnchecked', checkbox.dataset.key, checkbox.dataset.value);
        }
    };
    const itemClickListener = (event)=>{
        if (event.target === checkbox || checkbox.dataset.disabled === 'true' || event.target.tagName === 'LABEL') {
            return;
        }
        checkbox.checked = !checkbox.checked;
        checkbox.dispatchEvent(new Event('change'));
    };
    _class_private_field_get(this, _cache).checkboxChangeListeners.set(checkbox, {
        change: checkboxChangeListener,
        click: itemClickListener
    });
    _class_private_field_get(this, _eventManager).addEventListener(checkbox, 'change', checkboxChangeListener);
    _class_private_field_get(this, _eventManager).addEventListener(itemElement, 'click', itemClickListener);
}
function unregisterEvents(itemElement) {
    const checkbox = getCheckboxElement(itemElement);
    const checkboxListeners = _class_private_field_get(this, _cache).checkboxChangeListeners.get(checkbox);
    _class_private_field_get(this, _eventManager).removeEventListener(checkbox, 'change', checkboxListeners.change);
    _class_private_field_get(this, _eventManager).removeEventListener(itemElement, 'click', checkboxListeners.click);
    _class_private_field_get(this, _cache).checkboxChangeListeners.delete(checkbox);
}
function resetCache() {
    _class_private_field_get(this, _cache).visibleRowsNumberSetting = null;
    _class_private_field_get(this, _cache).entriesCount = 0;
    _class_private_field_get(this, _cache).flippedVertically = false;
    _class_private_field_get(this, _cache).currentlySelectedItemIndex = 0;
    _class_private_field_get(this, _cache).checkboxChangeListeners.clear();
    _class_private_field_get(this, _cache).areCheckboxesDisabled = false;
    _class_private_field_get(this, _cache).sourceSortFunction = null;
}
mixin(DropdownController, localHooks);
