'use strict';
import { resourceNames } from '../../../../fd-toolbox/resources/resource-names.js';
import { editResourceConfigDisplayModes } from './edit-resource-config-display-mode.js';
import { getResourceViewUrl } from '../../services/meta-navigations.js';
import { multiListSectionNamespaces, multiListSectionNames } from '../../components/multi-list/multi-list-constants.js';
import { RolesSettingsLinks } from '../../components/user-settings/RolesSettingsLinks.js';
import { crudActions } from '../../../../fd-toolbox/enums/enums.js';
import { resourceIds } from '../../../../fd-toolbox/constants/resource-id-constants.js';
import { hasResourcePermission } from '../../auth/permissions/permission-checker.js';
import { editResourceLayoutTypes } from '../edit-resource-constants.js';
import { getNewUuid, uuidVersions } from '../../../../fd-toolbox/uuids.js';
import { defaultGlobalConfig } from '../../providers/global-provider/default-config.js';
import { displayLabels } from '../../../../base-repo/constants/display-labels.js';

var __defProp=Object['defineProperty'],__name=(_0x3ee50b,_0x57e96a)=>__defProp(_0x3ee50b,'name',{'value':_0x57e96a,'configurable':!![]});function getRelatedEditResourceConfig(_0x33bcf6){if(_0x33bcf6===resourceNames['item'])return getItemRelatedConfig();return getRelatedDefaultConfig();}__name(getRelatedEditResourceConfig,'getRelatedEditResourceConfig');function fillODataFromEditResourceConfig(_0x1127c2,_0x17e889){for(let _0x53139d of _0x17e889['propertyConfigs']){_0x53139d[-0x47*-0x8b+0x1956*0x1+-0x3c2*0x11]['expand']&&_0x1127c2['expands']['push'](_0x53139d[0xabc*-0x1+-0xf7b*0x1+0x1a38]['propertyName']);}}__name(fillODataFromEditResourceConfig,'fillODataFromEditResourceConfig');function getDefaultEditResourceConfig(_0x4473b4){const _0x52c575={'propertyConfigs':new Map(),'hideTopSaveButton':![],'hideBottomSaveButton':![],'hideTopCancelButton':![],'hideBottomCancelButton':![],'hideTopDeleteButton':![],'hideBottomDeleteButton':![],'hideExpandButton':![],'showManageLinks':!![],'showTitle':!![],'showBackArrow':!![],'showResourceImage':!![],'showSavingStatus':!![],'backArrowUrl':getResourceViewUrl(_0x4473b4)};return _0x52c575;}__name(getDefaultEditResourceConfig,'getDefaultEditResourceConfig');function getEmptyEditResourceConfig(){const _0x189ffe={'propertyConfigs':new Map()};return _0x189ffe;}__name(getEmptyEditResourceConfig,'getEmptyEditResourceConfig');function setPropertyVisibility(_0x2fdf5a,_0x4fa17e){for(let _0x3e8d23 of _0x2fdf5a){_0x4fa17e['propertyConfigs']['set'](_0x3e8d23,{'visible':!![],'propertyName':_0x3e8d23});}}__name(setPropertyVisibility,'setPropertyVisibility');function hideProperties(_0x42f78e,_0x5a2364){for(let _0x35df0e of _0x42f78e){let _0x3d9961=getPropertyConfigSetDefault(_0x5a2364,_0x35df0e);_0x3d9961['visible']=![];}}__name(hideProperties,'hideProperties');function getItemConfig(){let _0x3fcc5b=getDefaultEditResourceConfig(resourceNames['item']),_0x214c93=['TimeLimitMinutes','IsOverdue','DueDate',displayLabels['code'],'ItemToItemCategoryList','QuestionAnswerList','ItemParticipantList','UserScheduleList','ItemToTagList','ChildItemList','ItemToDeckList','HintList','CommentList','ItemToItemList','VideoReviewList','AdditionalContent'];return hideProperties(_0x214c93,_0x3fcc5b),_0x3fcc5b;}__name(getItemConfig,'getItemConfig');function getProductOrStoreSettingConfig(){const _0x51eb1c=getEmptyEditResourceConfig();return _0x51eb1c['hiddenRelatedResources']=[resourceNames['blob']],_0x51eb1c;}__name(getProductOrStoreSettingConfig,'getProductOrStoreSettingConfig');function getUserSettingConfig(){const _0x30113f=getEmptyEditResourceConfig();return _0x30113f['additionalResources']=[resourceNames['userSetting'],resourceNames['workspaceSetting']],_0x30113f['hiddenRelatedResources']=[resourceNames['user']],_0x30113f['tabsConfig']={'layoutType':editResourceLayoutTypes['navigation'],'isCommentTabVisible':![]},_0x30113f['multiListSections']=[getRolesMultiListSection()],_0x30113f;}__name(getUserSettingConfig,'getUserSettingConfig');function refreshDefaultEditResourceConfigs(){defaultGlobalConfig['editResourceConfigs']={[resourceNames['userSetting']]:getUserSettingConfig(),[resourceNames['product']]:getProductOrStoreSettingConfig(),[resourceNames['store']]:getProductOrStoreSettingConfig()};}__name(refreshDefaultEditResourceConfigs,'refreshDefaultEditResourceConfigs');function getRelatedDefaultConfig(){return {'propertyConfigs':new Map(),'displayMode':editResourceConfigDisplayModes['compact'],'hideTopSaveButton':!![],'hideBottomSaveButton':!![],'hideTopCancelButton':!![],'hideBottomCancelButton':!![],'hideTopDeleteButton':!![],'hideBottomDeleteButton':!![],'showManageLinks':![],'showBackArrow':!![]};}__name(getRelatedDefaultConfig,'getRelatedDefaultConfig');function getItemRelatedConfig(){let _0x209536=getRelatedDefaultConfig();_0x209536['whitelistPropertiesOnly']=!![];let _0xfeb94b=['Content'];return setPropertyVisibility(_0xfeb94b,_0x209536),_0x209536;}__name(getItemRelatedConfig,'getItemRelatedConfig');function getRolesMultiListSection(){const _0x7d8347={'displayName':multiListSectionNames['rolesAndPermissions'],'component':RolesSettingsLinks,'id':getNewUuid(uuidVersions['v5'],multiListSectionNamespaces['rolesAndPermissions'],multiListSectionNames['rolesAndPermissions']),'hasPermission':hasResourcePermission(resourceIds['userRole'],crudActions['create'])};return _0x7d8347;}__name(getRolesMultiListSection,'getRolesMultiListSection');function getPropertyConfigSetDefault(_0x9e96a0,_0x269832){let _0x39275e=_0x9e96a0['propertyConfigs']['get'](_0x269832);if(_0x39275e)return _0x39275e;else {let _0x2fde88={'propertyName':_0x269832};return _0x9e96a0['propertyConfigs']['set'](_0x269832,_0x2fde88),_0x2fde88;}}__name(getPropertyConfigSetDefault,'getPropertyConfigSetDefault');

export { fillODataFromEditResourceConfig, getDefaultEditResourceConfig, getEmptyEditResourceConfig, getItemConfig, getProductOrStoreSettingConfig, getRelatedEditResourceConfig, getUserSettingConfig, hideProperties, refreshDefaultEditResourceConfigs, setPropertyVisibility };
