import { UMB_STATIC_FILE_ROOT_ENTITY_TYPE } from './constants.js';
import { UmbStaticFileTreeServerDataSource } from './static-file-tree.server.data-source.js';
import { UMB_STATIC_FILE_TREE_STORE_CONTEXT } from './static-file-tree.store.context-token.js';
import { UmbTreeRepositoryBase } from '../../core/tree/index.js';
export class UmbStaticFileTreeRepository extends UmbTreeRepositoryBase {
    constructor(host) {
        super(host, UmbStaticFileTreeServerDataSource, UMB_STATIC_FILE_TREE_STORE_CONTEXT);
    }
    async requestTreeRoot() {
        const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 0 });
        const hasChildren = treeRootData ? treeRootData.total > 0 : false;
        const data = {
            unique: null,
            entityType: UMB_STATIC_FILE_ROOT_ENTITY_TYPE,
            name: 'Static Files',
            hasChildren,
            isFolder: true,
        };
        return { data };
    }
}
export default UmbStaticFileTreeRepository;
