import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__useBlockCollection_mjs__ from "./useBlockCollection.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__useDateVariable_mjs__ from "./useDateVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__useFilterVariable_mjs__ from "./useFilterVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__useFormVariable_mjs__ from "./useFormVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__useIterationVariable_mjs__ from "./useIterationVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__useParentRecordVariable_mjs__ from "./useParentRecordVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__usePopupVariable_mjs__ from "./usePopupVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__useRecordVariable_mjs__ from "./useRecordVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__useRoleVariable_mjs__ from "./useRoleVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__useUserVariable_mjs__ from "./useUserVariable.mjs";
const useVariableOptions = (param)=>{
    let { collectionField, form, uiSchema, operator, noDisabled, targetFieldSchema, record } = param;
    var _record___parent;
    const { name: blockCollectionName = null == record ? void 0 : record.__collectionName } = (0, __WEBPACK_EXTERNAL_MODULE__useBlockCollection_mjs__.useBlockCollection)();
    const blockParentCollectionName = null == record ? void 0 : null === (_record___parent = record.__parent) || void 0 === _record___parent ? void 0 : _record___parent.__collectionName;
    const { currentUserSettings } = (0, __WEBPACK_EXTERNAL_MODULE__useUserVariable_mjs__.useCurrentUserVariable)({
        maxDepth: 3,
        uiSchema: uiSchema,
        collectionField,
        noDisabled,
        targetFieldSchema
    });
    const { currentRoleSettings } = (0, __WEBPACK_EXTERNAL_MODULE__useRoleVariable_mjs__.useCurrentRoleVariable)({
        uiSchema: uiSchema,
        collectionField,
        noDisabled,
        targetFieldSchema
    });
    const { datetimeSettings } = (0, __WEBPACK_EXTERNAL_MODULE__useDateVariable_mjs__.useDatetimeVariable)({
        operator,
        schema: uiSchema,
        noDisabled
    });
    const { currentFormSettings, shouldDisplayCurrentForm } = (0, __WEBPACK_EXTERNAL_MODULE__useFormVariable_mjs__.useCurrentFormVariable)({
        schema: uiSchema,
        collectionField,
        noDisabled,
        targetFieldSchema,
        form
    });
    const { currentObjectSettings, shouldDisplayCurrentObject } = (0, __WEBPACK_EXTERNAL_MODULE__useIterationVariable_mjs__.useCurrentObjectVariable)({
        collectionField,
        schema: uiSchema,
        noDisabled,
        targetFieldSchema
    });
    const { currentRecordSettings, shouldDisplayCurrentRecord } = (0, __WEBPACK_EXTERNAL_MODULE__useRecordVariable_mjs__.useCurrentRecordVariable)({
        schema: uiSchema,
        collectionField,
        noDisabled,
        targetFieldSchema
    });
    const { settings: popupRecordSettings, shouldDisplayPopupRecord } = (0, __WEBPACK_EXTERNAL_MODULE__usePopupVariable_mjs__.usePopupVariable)({
        schema: uiSchema,
        collectionField,
        noDisabled,
        targetFieldSchema
    });
    const { currentParentRecordSettings, shouldDisplayCurrentParentRecord } = (0, __WEBPACK_EXTERNAL_MODULE__useParentRecordVariable_mjs__.useCurrentParentRecordVariable)({
        schema: uiSchema,
        collectionName: blockParentCollectionName,
        collectionField,
        noDisabled,
        targetFieldSchema
    });
    const { currentCustomFilterSetting, shouldDisplayCustomFilter } = (0, __WEBPACK_EXTERNAL_MODULE__useFilterVariable_mjs__.useFilterVariable)({
        schema: uiSchema,
        form,
        collectionName: blockParentCollectionName,
        collectionField,
        targetFieldSchema
    });
    return (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>[
            currentUserSettings,
            currentRoleSettings,
            datetimeSettings,
            shouldDisplayCurrentForm && currentFormSettings,
            shouldDisplayCurrentObject && currentObjectSettings,
            shouldDisplayCurrentRecord && currentRecordSettings,
            shouldDisplayCurrentParentRecord && currentParentRecordSettings,
            shouldDisplayPopupRecord && popupRecordSettings,
            shouldDisplayCustomFilter && currentCustomFilterSetting
        ].filter(Boolean), [
        currentUserSettings,
        currentRoleSettings,
        datetimeSettings,
        shouldDisplayCurrentForm,
        currentFormSettings,
        shouldDisplayCurrentObject,
        currentObjectSettings,
        shouldDisplayCurrentRecord,
        currentRecordSettings,
        shouldDisplayCurrentParentRecord,
        currentParentRecordSettings,
        shouldDisplayPopupRecord,
        popupRecordSettings,
        currentCustomFilterSetting,
        shouldDisplayCustomFilter
    ]);
};
export { useVariableOptions };
