"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
(()=>{
    __webpack_require__.r = function(exports1) {
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    useVariableOptions: ()=>useVariableOptions
});
const external_react_namespaceObject = require("react");
const external_useBlockCollection_js_namespaceObject = require("./useBlockCollection.js");
const external_useDateVariable_js_namespaceObject = require("./useDateVariable.js");
const external_useFilterVariable_js_namespaceObject = require("./useFilterVariable.js");
const external_useFormVariable_js_namespaceObject = require("./useFormVariable.js");
const external_useIterationVariable_js_namespaceObject = require("./useIterationVariable.js");
const external_useParentRecordVariable_js_namespaceObject = require("./useParentRecordVariable.js");
const external_usePopupVariable_js_namespaceObject = require("./usePopupVariable.js");
const external_useRecordVariable_js_namespaceObject = require("./useRecordVariable.js");
const external_useRoleVariable_js_namespaceObject = require("./useRoleVariable.js");
const external_useUserVariable_js_namespaceObject = require("./useUserVariable.js");
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, external_useBlockCollection_js_namespaceObject.useBlockCollection)();
    const blockParentCollectionName = null == record ? void 0 : null === (_record___parent = record.__parent) || void 0 === _record___parent ? void 0 : _record___parent.__collectionName;
    const { currentUserSettings } = (0, external_useUserVariable_js_namespaceObject.useCurrentUserVariable)({
        maxDepth: 3,
        uiSchema: uiSchema,
        collectionField,
        noDisabled,
        targetFieldSchema
    });
    const { currentRoleSettings } = (0, external_useRoleVariable_js_namespaceObject.useCurrentRoleVariable)({
        uiSchema: uiSchema,
        collectionField,
        noDisabled,
        targetFieldSchema
    });
    const { datetimeSettings } = (0, external_useDateVariable_js_namespaceObject.useDatetimeVariable)({
        operator,
        schema: uiSchema,
        noDisabled
    });
    const { currentFormSettings, shouldDisplayCurrentForm } = (0, external_useFormVariable_js_namespaceObject.useCurrentFormVariable)({
        schema: uiSchema,
        collectionField,
        noDisabled,
        targetFieldSchema,
        form
    });
    const { currentObjectSettings, shouldDisplayCurrentObject } = (0, external_useIterationVariable_js_namespaceObject.useCurrentObjectVariable)({
        collectionField,
        schema: uiSchema,
        noDisabled,
        targetFieldSchema
    });
    const { currentRecordSettings, shouldDisplayCurrentRecord } = (0, external_useRecordVariable_js_namespaceObject.useCurrentRecordVariable)({
        schema: uiSchema,
        collectionField,
        noDisabled,
        targetFieldSchema
    });
    const { settings: popupRecordSettings, shouldDisplayPopupRecord } = (0, external_usePopupVariable_js_namespaceObject.usePopupVariable)({
        schema: uiSchema,
        collectionField,
        noDisabled,
        targetFieldSchema
    });
    const { currentParentRecordSettings, shouldDisplayCurrentParentRecord } = (0, external_useParentRecordVariable_js_namespaceObject.useCurrentParentRecordVariable)({
        schema: uiSchema,
        collectionName: blockParentCollectionName,
        collectionField,
        noDisabled,
        targetFieldSchema
    });
    const { currentCustomFilterSetting, shouldDisplayCustomFilter } = (0, external_useFilterVariable_js_namespaceObject.useFilterVariable)({
        schema: uiSchema,
        form,
        collectionName: blockParentCollectionName,
        collectionField,
        targetFieldSchema
    });
    return (0, external_react_namespaceObject.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
    ]);
};
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
