import { UMB_PICKER_CONTEXT } from './picker.context.token.js';
import { UmbPickerSearchManager } from './search/manager/picker-search.manager.js';
import { UmbContextBase } from '../../../libs/class-api/index.js';
import { UmbInteractionMemoryManager } from '../interaction-memory/index.js';
import { UmbSelectionManager } from '../utils/index.js';
import { UMB_PROPERTY_TYPE_BASED_PROPERTY_CONTEXT } from '../../content/content/index.js';
export class UmbPickerContext extends UmbContextBase {
    constructor(host) {
        super(host, UMB_PICKER_CONTEXT);
        this.interactionMemory = new UmbInteractionMemoryManager(this);
        this.selection = new UmbSelectionManager(this);
        this.search = new UmbPickerSearchManager(this);
        /* TODO: Move this implementation to another place. The generic picker context shouldn't be aware of property and data types.
        It also gives an illegal import of content module */
        this.consumeContext(UMB_PROPERTY_TYPE_BASED_PROPERTY_CONTEXT, (context) => {
            this.observe(context?.dataType, (dataType) => {
                this.dataType = dataType;
            });
        });
    }
}
