'use strict';
import { wellKnownMetaProps } from '../../../../../fd-toolbox-core/constants/meta-constants.js';
import { relationTypes } from '../../../../../fd-toolbox/enums/enums.js';
import { isWithIndexer } from '../../../../../fd-toolbox/types/ensure-type.js';
import { routes } from '../../../../../fd-toolbox/routing/routes.js';
import { silentChangeUrl } from '../../../../../fd-toolbox/routing/routers.js';
import { getOptionalPropertyValue } from '../../../../../fd-toolbox/objects/property-value.js';
import { propertyTypeFormats } from '../../../constants/property-type-formats.js';
import { enumDefaultColor, enumValueToColor } from '../../../table/table-constants.js';
import { getResourceUrl } from '../../../services/meta-navigations.js';
import { jsBasicTypes } from '../../../../../base-repo/constants/basic-types.js';

var __defProp=Object['defineProperty'],__name=(_0x5acdd3,_0x4fbc8c)=>__defProp(_0x5acdd3,'name',{'value':_0x4fbc8c,'configurable':!![]});function isColorful(_0x129205,_0x15afb4){return _0x129205['typeFormat']===propertyTypeFormats['enum']&&_0x15afb4['colorful'];}__name(isColorful,'isColorful');function isExpandProperty(_0x45e5e8){return Boolean(_0x45e5e8['relation']?.['expandForDescription'])&&_0x45e5e8['relation']?.['type']===relationTypes['manyToOne'];}__name(isExpandProperty,'isExpandProperty');function isDescriptionProperty(_0x12d0a1,_0x4bec92){return _0x12d0a1['description']['resourceDescriptionProperty']===_0x4bec92;}__name(isDescriptionProperty,'isDescriptionProperty');function getBackgroundColorClassName(_0xe266af,_0x205abc){const _0x9499d3=_0x205abc[_0xe266af];if(typeof _0x9499d3!==jsBasicTypes['number'])return enumDefaultColor;return enumValueToColor[Number(_0x9499d3)]||enumDefaultColor;}__name(getBackgroundColorClassName,'getBackgroundColorClassName');function getRelatedResourceImageUrl(_0x3ca488,_0x27e6dd){let _0x534df2;if(_0x27e6dd['relation']?.['expandPropertyName']){const _0x4908ae=_0x3ca488[_0x27e6dd['relation']['expandPropertyName']];if(isWithIndexer(_0x4908ae)){const _0x540f1a=getOptionalPropertyValue(_0x4908ae,wellKnownMetaProps['imageUrl']);_0x534df2=_0x540f1a;}}return _0x534df2;}__name(getRelatedResourceImageUrl,'getRelatedResourceImageUrl');function onViewClick(_0x169b65,_0x1e0363){const _0xa717a1=getResourceUrl(routes['view'],_0x169b65,_0x1e0363);silentChangeUrl(_0xa717a1);}__name(onViewClick,'onViewClick');

export { getBackgroundColorClassName, getRelatedResourceImageUrl, isColorful, isDescriptionProperty, isExpandProperty, onViewClick };
