import * as __WEBPACK_EXTERNAL_MODULE_react_i18next__ from "react-i18next";
import * as __WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__ from "../../../api-client/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__useBaseVariable_mjs__ from "./useBaseVariable.mjs";
const useRoleVariable = (param)=>{
    let { collectionField, uiSchema, noDisabled, targetFieldSchema, maxDepth = 0 } = param;
    const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
    const result = (0, __WEBPACK_EXTERNAL_MODULE__useBaseVariable_mjs__.useBaseVariable)({
        collectionField,
        uiSchema,
        maxDepth,
        name: '$nRole',
        title: t('Current role'),
        collectionName: 'roles',
        noDisabled,
        targetFieldSchema,
        noChildren: true
    });
    return result;
};
const useCurrentRoleVariable = function() {
    let { collectionField, uiSchema, noDisabled, targetFieldSchema, maxDepth = 0 } = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    var _apiClient_auth;
    const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
    const apiClient = (0, __WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__.useAPIClient)();
    const currentRoleSettings = (0, __WEBPACK_EXTERNAL_MODULE__useBaseVariable_mjs__.useBaseVariable)({
        collectionField,
        uiSchema,
        maxDepth,
        name: '$nRole',
        title: t('Current role'),
        collectionName: 'roles',
        noDisabled,
        targetFieldSchema,
        noChildren: true
    });
    return {
        currentRoleSettings,
        currentRoleCtx: null === (_apiClient_auth = apiClient.auth) || void 0 === _apiClient_auth ? void 0 : _apiClient_auth.role
    };
};
export { useCurrentRoleVariable, useRoleVariable };
