import React, { useEffect, useState, useMemo, useCallback, memo } from 'react';
import { EditIcon, DeleteIcon, UploadIcon } from '@fluentui/react-icons';
import { useTranslation } from 'react-i18next';
import { DataBrowserContainer } from '../../../dataBrowser/DataBrowserContainer';
import { CrudTableSidePanel } from '../../../maintenanceEngine/crudBrowser/CrudTableSidePanel';
import { getPrimaryKeyValues, getPathObject } from '../../../utilities/maintenanceEngine/CrudBrowserUtilities';
import { useAuthedUser } from '../../../utilities/auth/useAuthedUser';
import { useAxiosGet } from '../../../utilities/useAxiosGet';
import { apiMutate } from '../../../utilities/useAxiosMutate';
import { toLowerFirstChar, toUpperFirstChar } from '../../../utilities/input/StringUtilities';
import { CardinalityTypeEnums } from '../../../enums/unitySystemEnums';
import { executeQueryAdHoc } from '../../utilities/methodUtils';
import { getSearchObject } from '../../../utilities/search/SearchUtilities';
import { useHandleAxiosSnackbar } from '../../../utilities/apiHelpers';
import { usePromotedMethodEntity } from '../../../hooks/usePromotedMethodEntity';
import { useSearchFilterParamsMap } from '../../../hooks/useSearchFilterParamsMap';
import { Alert } from '@material-ui/lab';
import { v4 as uuid } from 'uuid';
import { useLocation } from 'react-router-dom';
import { useQueryExecutors } from '../../../hooks/useQueryExecutors';
import { mapNodeObjValuesToSearchParameters } from '../../../utilities/tree/TreeUtilities';
import { ConfigService } from '../../../configService';
// const FILTER_PARAMS = [
//   {
//     name: 'tenantName',
//     value: 'ABC Company',
//     type: 'string'
//   },
//   {
//     name: 'productId',
//     value: 'UDP_PRODUCT_ID',
//     type: 'keyword'
//   },
//   {
//     name: 'productId',
//     value: 0,
//     type: 'function'
//   }
// ];
// const FUNCTION_LIST = [() => 1, () => 2];
export const UdpDataBrowserPage = (props) => {
    const { queryId, params } = props;
    const user = useAuthedUser();
    const { t } = useTranslation();
    const [entityData, setEntityData] = useState([]);
    const [gridApi, setGridApi] = useState(null);
    const [alertWarnings, setAlertWarnings] = useState([]);
    const location = useLocation();
    const state = location.state;
    let searchParamStr = location.search;
    let searchParams = new URLSearchParams(searchParamStr);
    const searchParamsQueryId = (state === null || state === void 0 ? void 0 : state.queryId)
        ? state.queryId
        : searchParams.has('queryId') === true
            ? toUpperFirstChar(searchParams.get('queryId'))
            : '';
    const { handleErrorSnackbar, handleSuccessSnackbar } = useHandleAxiosSnackbar();
    const { getCleanData } = useQueryExecutors();
    const udpQueryId = useMemo(() => (params === null || params === void 0 ? void 0 : params.queryId) || queryId || searchParamsQueryId || '', [params, queryId, searchParamsQueryId]);
    const udpTagId = (params === null || params === void 0 ? void 0 : params.udpTagId) || '';
    const [selectedEntity, setSelectedEntity] = useState(null);
    const [foreignKeyData, setForeignKeyData] = useState(null);
    const [udpFieldSearchApiId, setUdpFieldSearchApiId] = useState(null);
    const [loading, setLoading] = useState(false);
    const [apiCatalogId, setApiCatalogId] = useState(null);
    const [entityName, setEntityName] = useState(null);
    const [enteredFromConfig, setEnteredFromConfig] = useState(false);
    const { data: udpOjectFieldInfo } = usePromotedMethodEntity('UdpObjectFieldInfo', true);
    // TODO: Params will be either passed in or hard coded for now until we have a way of configuring/storing them.
    const { getQueryFilterElements } = useSearchFilterParamsMap();
    const [{ data: tpacb, loading: tpacbLoading, error: tpacbError }] = useAxiosGet(ConfigService.integrationV1ApiUrl, `tenantProductApiCatalogBase/tenant/${user === null || user === void 0 ? void 0 : user.currentTenantId}/product/${ConfigService.config.UNITY_PRODUCT_ID}`, {}, !!!user, false);
    const [{ data: apiMethodInstance, loading: apiMethodInstancebLoading, error: apiMethodInstanceError }] = useAxiosGet(ConfigService.integrationV1ApiUrl, `apiMethodInstance/${udpQueryId}`, {}, !!!udpQueryId, false);
    const [{ data: apiMethod, loading: apiMethodLoading, error: apiMethodError }] = useAxiosGet(ConfigService.integrationV1ApiUrl, `apiMethod/${apiMethodInstance === null || apiMethodInstance === void 0 ? void 0 : apiMethodInstance.apiMethodId}`, {}, !!!(apiMethodInstance === null || apiMethodInstance === void 0 ? void 0 : apiMethodInstance.apiMethodId), false);
    const udpCatalogKey = useMemo(() => (apiMethod === null || apiMethod === void 0 ? void 0 : apiMethod.entityName) || '', [apiMethod]);
    const [{ data: catalogObject }] = useAxiosGet(ConfigService.integrationV2ApiUrl, `apiCatalog/${apiCatalogId}/catalogObject/${entityName}`, {}, !!!apiCatalogId || !!!entityName, false);
    /*
      returns {
        entityName: Tenant,
        productId: 1,
        unityBaseGetAllMethod: {apiMethodId: 'f06f7853-5816-4950-a275-5085c3387d57', pathParameters: [{name: "version", in: "path", parameterType: "string", fullReference: ""}]},
        unityBaseGetMethod: {apiMethodId: '06f49cfd-0f1e-475a-812b-73cd3efd9f0d', pathParameters: [{name: "id", in: "path", parameterType: "string", fullReference: ""}, {name: "version", in: "path", parameterType: "string", fullReference: ""}]},
        unityBaseCreateMethod: {apiMethodId: '33310aad-8998-4661-800b-00649d280d31', pathParameters: [{name: "version", in: "path", parameterType: "string", fullReference: ""}]},
        unityBaseUpdateMethod: {apiMethodId: 'fe611db9-47ec-4a27-8840-871fe1323812', pathParameters: [{name: "id", in: "path", parameterType: "string", fullReference: ""}, {name: "version", in: "path", parameterType: "string", fullReference: ""}]},
        unityBaseDeleteMethod: {apiMethodId: 'dafb84b6-e424-43ff-9ef0-774a5795e420', pathParameters: [{name: "id", in: "path", parameterType: "string", fullReference: ""}, {name: "version", in: "path", parameterType: "string", fullReference: ""}]},
      }
    */
    const { data: promotedMethodEntities, loading: promotedMethodsLoading } = usePromotedMethodEntity(entityName);
    const executeCreate = useCallback(async (data) => {
        var _a;
        return apiMutate(ConfigService.integrationV1ApiUrl, `apimethod/executeQueryWithParameters/${(_a = selectedEntity === null || selectedEntity === void 0 ? void 0 : selectedEntity.unityBaseCreateMethod) === null || _a === void 0 ? void 0 : _a.apiMethodId}`, {
            method: 'post'
        }, data);
    }, [selectedEntity]);
    const executeUpdate = useCallback(async (data) => {
        var _a;
        return apiMutate(ConfigService.integrationV1ApiUrl, `apimethod/executeQueryWithParameters/${(_a = selectedEntity === null || selectedEntity === void 0 ? void 0 : selectedEntity.unityBaseUpdateMethod) === null || _a === void 0 ? void 0 : _a.apiMethodId}`, {
            method: 'post'
        }, data);
    }, [selectedEntity]);
    const executeDelete = useCallback(async (data) => {
        var _a;
        return apiMutate(ConfigService.integrationV1ApiUrl, `apimethod/executeQueryWithParameters/${(_a = selectedEntity === null || selectedEntity === void 0 ? void 0 : selectedEntity.unityBaseDeleteMethod) === null || _a === void 0 ? void 0 : _a.apiMethodId}`, {
            method: 'post'
        }, data);
    }, [selectedEntity]);
    const onCreate = useCallback(async (data) => {
        return await executeCreate(data);
    }, [executeCreate]);
    const onUpdate = useCallback(async (data) => {
        return await executeUpdate(data);
    }, [executeUpdate]);
    const onDelete = useCallback(async (data) => {
        return await executeDelete(data);
    }, [executeDelete]);
    // Configured columns data from data builder
    const queryColumnsData = useMemo(() => {
        if (!apiMethodInstance)
            return [];
        let catalogMods = [];
        try {
            const catalogModificationStr = apiMethodInstance.catalogModification;
            const catalogModification = JSON.parse(catalogModificationStr);
            catalogMods = catalogModification;
        }
        catch (_a) {
            console.warn('Error parsing apiMethodInstance catalogModification');
        }
        return catalogMods;
    }, [apiMethodInstance]);
    // Lookups map used for to map lookups to column entries
    const lookupsMap = useMemo(() => {
        // need to return null for Datasource to not render twice
        if (!queryColumnsData.length)
            return null;
        const map = {};
        const lookupColumns = queryColumnsData.filter((column) => {
            var _a;
            return !!((_a = column.extendedProperties) === null || _a === void 0 ? void 0 : _a.lookup);
        });
        lookupColumns.forEach((lc) => {
            var _a, _b, _c;
            map[lc.name] = {
                lookupKeyName: ((_a = lc.extendedProperties) === null || _a === void 0 ? void 0 : _a.lookupKeyName) || '',
                lookupValueName: ((_b = lc.extendedProperties) === null || _b === void 0 ? void 0 : _b.lookupKeyName) || '',
                value: ((_c = lc.extendedProperties) === null || _c === void 0 ? void 0 : _c.lookup) || '',
                filterOn: !!lc.filterOn || false
            };
        });
        return map;
    }, [queryColumnsData]);
    const nodeFilterParams = useMemo(() => {
        let filterParams = [];
        if ((params === null || params === void 0 ? void 0 : params.nodeObj) && (params === null || params === void 0 ? void 0 : params.queryParamMapping)) {
            const mappedParameters = mapNodeObjValuesToSearchParameters(params.nodeObj, params.queryParamMapping);
            if (Object.keys(mappedParameters).length) {
                Object.keys(mappedParameters).forEach((key) => {
                    filterParams.push({
                        name: key,
                        value: mappedParameters[key],
                        type: 'string'
                    });
                });
            }
        }
        return filterParams;
    }, [params]);
    // Additional filter elements
    const searchFilterElements = useMemo(() => {
        const filterElements = [];
        if (!enteredFromConfig && udpTagId) {
            filterElements.push({
                searchField: 'UdpTags.UdpTagAssociationUdpTag.Id',
                searchOperator: '=',
                searchValue: udpTagId
            });
        }
        const queryFilterElements = getQueryFilterElements(apiMethodInstance, nodeFilterParams);
        return filterElements.concat(queryFilterElements);
    }, [
        udpTagId,
        enteredFromConfig,
        getQueryFilterElements,
        apiMethodInstance,
        nodeFilterParams
    ]);
    const entityAttributes = useMemo(() => {
        return (catalogObject === null || catalogObject === void 0 ? void 0 : catalogObject.properties) || [];
    }, [catalogObject]);
    const getMetaDataForUdpField = useCallback(async (entityName) => {
        let fieldInfos = [];
        if (udpFieldSearchApiId) {
            const filterElements = [
                {
                    searchField: 'ObjectInfo.SanitizedName',
                    searchOperator: '=',
                    searchValue: entityName
                }
            ];
            const requestObj = getSearchObject(filterElements, 1, 50, true);
            executeQueryAdHoc({ data: requestObj }, udpFieldSearchApiId).then((resp) => {
                var _a;
                fieldInfos = (_a = resp.data) === null || _a === void 0 ? void 0 : _a.pageList;
            });
        }
        return fieldInfos;
    }, [udpFieldSearchApiId]);
    const getFKMethodEntities = useCallback(async (attributes) => {
        var _a;
        if (!attributes) {
            return [];
        }
        let fkMethods = [];
        for (const attr of attributes) {
            // check if there is a property with this childEntity
            if ((_a = attr === null || attr === void 0 ? void 0 : attr.extendedProperties) === null || _a === void 0 ? void 0 : _a.childEntity) {
                // get the list of child entity field names from the Keys array
                const ceFieldsArr = [];
                // eslint-disable-next-line @typescript-eslint/no-unused-expressions
                Object.keys(attr.extendedProperties.childEntityAssoc || {}).length &&
                    (attr.extendedProperties.childEntityAssoc.Cardinality ===
                        CardinalityTypeEnums.Many_To_Many ||
                        attr.extendedProperties.childEntityAssoc.Cardinality ===
                            CardinalityTypeEnums.One_To_Many) &&
                    !attr.extendedProperties.childEntityAssoc.UdpType &&
                    attr.extendedProperties.childEntityAssoc.Keys.forEach((value, i) => {
                        const name = value.split(',')[0];
                        if (name) {
                            // check name string: if 1 word, lowercase. if 2 words, lower first char
                            ceFieldsArr.push({
                                idx: i,
                                name: /^[A-Z]*$/.test(name)
                                    ? name.toLowerCase()
                                    : toLowerFirstChar(name)
                            });
                        }
                    });
                // find the child entity attribute
                const ceAttr = attributes.find((p) => ceFieldsArr.find((cef) => cef.name === p.name));
                if (ceAttr) {
                    // get list of entity if ceProp exists
                    await apiMutate(ConfigService.integrationV1ApiUrl, `apicatalog/${apiCatalogId}/promotedMethodEntities/${attr.reference}/product/${ConfigService.config.UNITY_PRODUCT_ID}`, {
                        method: 'get'
                    }, {}).then((resp) => {
                        if (resp && resp.data) {
                            fkMethods.push({
                                entityAttribute: ceAttr,
                                entity: resp.data
                            });
                        }
                    });
                }
            }
        }
        return fkMethods;
    }, [apiCatalogId]);
    const getFKAssociationLabel = useCallback(async (entityName) => {
        let fieldsInfo = [];
        fieldsInfo = await getMetaDataForUdpField(entityName);
        if ((fieldsInfo === null || fieldsInfo === void 0 ? void 0 : fieldsInfo.length) <= 0) {
            return '';
        }
        const associationLabelInfo = fieldsInfo === null || fieldsInfo === void 0 ? void 0 : fieldsInfo.find((fi) => {
            var _a, _b;
            return ((_b = (_a = fi.properties) === null || _a === void 0 ? void 0 : _a.maintainenceConfig) === null || _b === void 0 ? void 0 : _b.associationLabel) === 'true';
        });
        return associationLabelInfo === null || associationLabelInfo === void 0 ? void 0 : associationLabelInfo.name;
    }, [getMetaDataForUdpField]);
    const getDataByKey = (obj, k) => {
        var _a;
        if (!obj)
            return null;
        let val = (_a = obj[k]) !== null && _a !== void 0 ? _a : null;
        if (!val) {
            const key = Object.keys(obj).find((objKey) => objKey.toLowerCase().includes(k));
            if (key) {
                val = obj[key];
            }
        }
        return val;
    };
    const getFKData = useCallback(async () => {
        var _a, _b, _c, _d, _e;
        if (!(entityAttributes === null || entityAttributes === void 0 ? void 0 : entityAttributes.length)) {
            return null;
        }
        const fkMethods = await getFKMethodEntities(entityAttributes);
        if (!(fkMethods === null || fkMethods === void 0 ? void 0 : fkMethods.length)) {
            setForeignKeyData([]);
            return [];
        }
        let fkData = [];
        let promises = [];
        let promiseDetails = [];
        const warnings = [];
        for (const method of fkMethods) {
            if (method && ((_a = method === null || method === void 0 ? void 0 : method.entity) === null || _a === void 0 ? void 0 : _a.unityBaseGetAllMethod)) {
                const associationLabel = await getFKAssociationLabel(method.entity.entityName);
                promiseDetails.push({
                    url: ConfigService.integrationV1ApiUrl +
                        `/apimethod/executeQueryWithParameters/${(_c = (_b = method === null || method === void 0 ? void 0 : method.entity) === null || _b === void 0 ? void 0 : _b.unityBaseGetAllMethod) === null || _c === void 0 ? void 0 : _c.apiMethodId}`,
                    fieldName: method.entityAttribute.name,
                    name: method.entity.entityName,
                    associationLabel: associationLabel
                });
                promises.push(apiMutate(ConfigService.integrationV1ApiUrl, `apimethod/executeQueryWithParameters/${(_e = (_d = method === null || method === void 0 ? void 0 : method.entity) === null || _d === void 0 ? void 0 : _d.unityBaseGetAllMethod) === null || _e === void 0 ? void 0 : _e.apiMethodId}`, {
                    method: 'post'
                }, { data: {} }));
            }
            else {
                warnings.push({
                    id: uuid(),
                    message: `${method.entity.entityName}'s Get-All method needs to be promoted`
                });
            }
        }
        setAlertWarnings(warnings);
        Promise.all(promises).then((resp) => {
            resp.forEach((response, index) => {
                if (response.status === 200) {
                    if (response === null || response === void 0 ? void 0 : response.data) {
                        let respData = [];
                        const promiseDetail = promiseDetails.find((p) => {
                            var _a;
                            return p.url === ((_a = response === null || response === void 0 ? void 0 : response.config) === null || _a === void 0 ? void 0 : _a.url) &&
                                !fkData.find((fd) => fd.entityName === p.Name && fd.fieldName === p.fieldName);
                        });
                        response.data.forEach((d) => {
                            const idName = (promiseDetail === null || promiseDetail === void 0 ? void 0 : promiseDetail.fieldName) && d[promiseDetail.fieldName]
                                ? promiseDetail.fieldName
                                : 'id';
                            const id = getDataByKey(d, idName);
                            const name = getDataByKey(d, toLowerFirstChar(promiseDetail.associationLabel) || 'name');
                            respData.push({ id: id, name: name !== null && name !== void 0 ? name : id });
                        });
                        fkData.push({
                            fieldName: promiseDetail.fieldName,
                            entityName: promiseDetail.name,
                            name: promiseDetail.fieldName,
                            data: respData
                        });
                    }
                }
            });
            setForeignKeyData(fkData);
        });
    }, [entityAttributes, getFKMethodEntities, getFKAssociationLabel]);
    const handleOnCreate = useCallback(async (values) => {
        if (selectedEntity) {
            const entityName = selectedEntity === null || selectedEntity === void 0 ? void 0 : selectedEntity.entityName;
            if (selectedEntity === null || selectedEntity === void 0 ? void 0 : selectedEntity.unityBaseCreateMethod) {
                const data = { requestBody: values };
                const response = await onCreate({ data }).catch((res) => {
                    handleErrorSnackbar(res);
                });
                if ((response === null || response === void 0 ? void 0 : response.status) === 200) {
                    handleSuccessSnackbar(entityName
                        ? t(`${entityName} has been created`)
                        : t(`Entity has been created`));
                    gridApi === null || gridApi === void 0 ? void 0 : gridApi.refreshServerSide();
                    return response;
                }
            }
        }
    }, [
        selectedEntity,
        onCreate,
        t,
        handleErrorSnackbar,
        handleSuccessSnackbar,
        gridApi
    ]);
    const handleOnUpdate = useCallback(async (values, primaryKeyValues) => {
        if (selectedEntity) {
            const entityName = selectedEntity === null || selectedEntity === void 0 ? void 0 : selectedEntity.entityName;
            if (selectedEntity === null || selectedEntity === void 0 ? void 0 : selectedEntity.unityBaseUpdateMethod) {
                // Get primary key value object using path parameters and merge with data
                const pathObject = getPathObject(selectedEntity.unityBaseUpdateMethod.pathParameters, primaryKeyValues);
                let data = { requestBody: values };
                if (Array.isArray(pathObject)) {
                    pathObject.forEach((po) => {
                        data[Object.keys(po)[0]] = po[Object.keys(po)[0]];
                    });
                }
                else {
                    data = Object.assign(Object.assign({}, pathObject), { requestBody: values });
                }
                const response = await onUpdate({ data }).catch((res) => {
                    handleErrorSnackbar(res);
                });
                if ((response === null || response === void 0 ? void 0 : response.status) === 200) {
                    handleSuccessSnackbar(entityName
                        ? t(`${entityName} has been updated`)
                        : t(`Entity has been updated`));
                    gridApi === null || gridApi === void 0 ? void 0 : gridApi.refreshServerSide();
                }
            }
        }
    }, [
        selectedEntity,
        onUpdate,
        t,
        gridApi,
        handleErrorSnackbar,
        handleSuccessSnackbar
    ]);
    const handleOnDelete = useCallback(async (value) => {
        value = getCleanData(value, lookupsMap);
        if (selectedEntity) {
            const entityName = selectedEntity === null || selectedEntity === void 0 ? void 0 : selectedEntity.entityName;
            if (selectedEntity === null || selectedEntity === void 0 ? void 0 : selectedEntity.unityBaseDeleteMethod) {
                // Get primary key value object using path parameters and merge with data
                const primaryKeyValues = getPrimaryKeyValues(entityAttributes, value);
                const pathObject = getPathObject(selectedEntity === null || selectedEntity === void 0 ? void 0 : selectedEntity.unityBaseDeleteMethod.pathParameters, primaryKeyValues);
                let data = {};
                if (Array.isArray(pathObject)) {
                    pathObject.forEach((po) => {
                        data[Object.keys(po)[0]] = po[Object.keys(po)[0]];
                    });
                }
                else {
                    data = Object.assign({}, pathObject);
                }
                const response = await onDelete({ data }).catch((res) => {
                    handleErrorSnackbar(res);
                });
                if ((response === null || response === void 0 ? void 0 : response.status) === 200) {
                    handleSuccessSnackbar(entityName
                        ? t(`${entityName} has been deleted`)
                        : t(`Entity has been deleted`));
                    gridApi === null || gridApi === void 0 ? void 0 : gridApi.refreshServerSide();
                }
            }
        }
    }, [
        selectedEntity,
        entityAttributes,
        onDelete,
        t,
        gridApi,
        handleErrorSnackbar,
        handleSuccessSnackbar,
        getCleanData,
        lookupsMap
    ]);
    const handleEntitySelect = useCallback((entityName) => {
        setAlertWarnings([]);
        setEntityName(entityName);
        setEnteredFromConfig(true);
    }, []);
    const removeWarning = useCallback((id) => {
        const updatedWarnings = alertWarnings.filter((warning) => warning.id !== id);
        setAlertWarnings(updatedWarnings);
    }, [alertWarnings]);
    useEffect(() => {
        const setFrKeyData = async () => {
            await getFKData();
        };
        if (entityAttributes && udpFieldSearchApiId !== null) {
            setFrKeyData();
        }
    }, [entityAttributes, getFKData, udpFieldSearchApiId]);
    useEffect(() => {
        if (promotedMethodEntities) {
            setSelectedEntity(promotedMethodEntities);
        }
    }, [promotedMethodEntities]);
    useEffect(() => {
        var _a;
        if (udpOjectFieldInfo) {
            setUdpFieldSearchApiId(((_a = udpOjectFieldInfo === null || udpOjectFieldInfo === void 0 ? void 0 : udpOjectFieldInfo.unityBaseSearchMethod) === null || _a === void 0 ? void 0 : _a.apiMethodId) || '' // If falsy lets set to empty string
            );
        }
    }, [udpOjectFieldInfo]);
    useEffect(() => {
        setAlertWarnings([]);
        if (udpCatalogKey) {
            setEntityName(udpCatalogKey);
        }
    }, [udpCatalogKey]);
    useEffect(() => {
        if (tpacb) {
            setApiCatalogId(tpacb.apiCatalogId);
        }
    }, [tpacb]);
    // Set loading flag based on the API loading flags
    useEffect(() => {
        setLoading(tpacbLoading || promotedMethodsLoading);
    }, [tpacbLoading, promotedMethodsLoading]);
    if (tpacbError) {
        return (React.createElement(Alert, { severity: "error" }, t('There is no Api Catalog associated with your tenant and product')));
    }
    return (React.createElement(React.Fragment, null, alertWarnings.map((warning, idx) => (React.createElement(Alert, { onClose: () => removeWarning(warning.id), severity: "warning", key: idx }, warning.message || ''))), React.createElement(DataBrowserContainer, { entityData: entityData, onCreate: handleOnCreate, onUpdate: handleOnUpdate, onDelete: handleOnDelete, onLoadInquiryNode: (params === null || params === void 0 ? void 0 : params.loadInquiryNode) && (params === null || params === void 0 ? void 0 : params.displayLoadNodeButton) ? params.loadInquiryNode : null, entityAttributes: entityAttributes, foreignKeyData: foreignKeyData, loading: loading, promotedEntity: selectedEntity, isServerSide: true, apiMethod: { apiCatalogId, entityName }, setGridApi: setGridApi, filterElements: searchFilterElements, backToConfigPage: enteredFromConfig ? () => handleEntitySelect(null) : null, queryColumnsData: queryColumnsData, lookupsMap: lookupsMap, disableRowSelction: !(params === null || params === void 0 ? void 0 : params.loadInquiryNode) })));
};
export default memo(UdpDataBrowserPage);
//# sourceMappingURL=UdpDataBrowserPage.js.map