'use strict';
import { emptyUuid } from '../../../../fd-toolbox/constants/constants.js';
import { propertyTypes } from '../../../../fd-toolbox/enums/enums.js';
import { isEmptyNullOrUndefined } from '../../../../fd-toolbox/functions/value-checking-functions.js';
import { withIdProps } from '../../../../fd-toolbox-core/types/resource-with-id.js';
import { isGuid, isFlagsEnum, isEnum } from '../../core/property-types.js';
import { isParsableAsNumber } from '../../../../fd-toolbox/value-checkers.js';

var __defProp=Object['defineProperty'],__name=(_0x149b37,_0x24c623)=>__defProp(_0x149b37,'name',{'value':_0x24c623,'configurable':!![]});function getValidators(_0x22d95c){let _0x2c8a11={};if(_0x22d95c['name']!==withIdProps['id']&&isGuid(_0x22d95c['typeFormat'],_0x22d95c['relation']))_0x2c8a11['validate']=getGuidValidator(_0x22d95c['required']);else {if(isFlagsEnum(_0x22d95c['type'],_0x22d95c['typeFormat']))_0x2c8a11['required']=!![];else {if(isEnum(_0x22d95c['type'],_0x22d95c['typeFormat']))_0x2c8a11['validate']=getNumberValidator(_0x22d95c['required'],![]);else {if(_0x22d95c['type']===propertyTypes['integer'])_0x2c8a11['validate']=getNumberValidator(_0x22d95c['required'],!![]);else _0x22d95c['required']&&(_0x2c8a11['required']=!![]);}}}return _0x2c8a11;}__name(getValidators,'getValidators');function getNumberValidator(_0x2e17a0,_0xbbcd0a=!![]){return _0x1b55da=>{let _0x165931=!![];if(_0x2e17a0)(!isParsableAsNumber(_0x1b55da)||_0xbbcd0a&&parseFloat(_0x1b55da)<0x1c1+0x3*0x47a+-0xf2e)&&(_0x165931=![]);else !isEmptyNullOrUndefined(_0x1b55da)&&!isParsableAsNumber(_0x1b55da)&&(_0x165931=![]);return _0x165931;};}__name(getNumberValidator,'getNumberValidator');function getGuidValidator(_0x56a042){return _0x49f0cf=>{return !(_0x56a042&&(!_0x49f0cf||_0x49f0cf===emptyUuid));};}__name(getGuidValidator,'getGuidValidator');

export { getValidators };
