export const IBMI_KNOWN_EXTENSIONS=new Set(['.rpgle','.sqlrpgle','.clle','.cl','.clp','.dspf','.pf','.lf','.prtf','.table.sql','.index.sql','.proc.sql','.bnd','.msgf','.bnddir']);const INELIGIBLE_EXTENSIONS=new Set(['.md','.yml','.yaml','.xml','.html','.htm','.css','.js','.ts','.json','.lock','.log','.sh','.bat','.cmd','.mk','.png','.jpg','.jpeg','.gif','.svg','.ico','.zip','.tar','.gz','.pdf']),INELIGIBLE_FILENAMES=new Set(['.gitignore','.gitattributes','.gitmodules','.editorconfig','.prettierrc','.eslintrc','.npmrc','.env','license','makefile','dockerfile','jenkinsfile','.dockerignore']);export function getIbmiExtension(_0x282d22){const _0x52051e=_0x282d22['split']('/')['pop']();for(const _0x1c147b of IBMI_KNOWN_EXTENSIONS){if(_0x1c147b['includes']('.')&&_0x1c147b!=='.'+_0x52051e['split']('.')['pop']()){if(_0x52051e['toLowerCase']()['endsWith'](_0x1c147b))return _0x1c147b;}}const _0x19489c=_0x52051e['lastIndexOf']('.');return _0x19489c>=0x0?_0x52051e['substring'](_0x19489c)['toLowerCase']():'';}export function getMemberName(_0x4ab4fc){const _0xc24a4a=_0x4ab4fc['split']('/')['pop'](),_0x2eb199=getIbmiExtension(_0x4ab4fc);return _0x2eb199?_0xc24a4a['substring'](0x0,_0xc24a4a['length']-_0x2eb199['length']):_0xc24a4a;}export function getSourceFileName(_0x541491){const _0x252aab=_0x541491['split']('/');return _0x252aab['length']>=0x2?_0x252aab[_0x252aab['length']-0x2]:'';}export function validateIbmiFile(_0x3960ea){const _0x3c389b=_0x3960ea['split']('/')['pop'](),_0x2bc898=_0x3c389b['toLowerCase']();if(INELIGIBLE_FILENAMES['has'](_0x2bc898))return{'valid':![],'reason':'\x22'+_0x3c389b+'\x22\x20is\x20not\x20an\x20IBM\x20i\x20source\x20type'};const _0x3cdd79=_0x2bc898['lastIndexOf']('.');if(_0x3cdd79>=0x0){const _0x2a9721=_0x2bc898['substring'](_0x3cdd79);if(INELIGIBLE_EXTENSIONS['has'](_0x2a9721))return{'valid':![],'reason':'\x22'+_0x2a9721+'\x22\x20files\x20are\x20not\x20IBM\x20i\x20source\x20types'};}const _0x1fde38=getSourceFileName(_0x3960ea),_0x45356b=getMemberName(_0x3960ea);if(_0x1fde38['length']>0xa)return{'valid':![],'reason':'Directory\x20name\x20\x22'+_0x1fde38+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20source\x20file\x20name\x20limit)'};if(_0x45356b['length']>0xa)return{'valid':![],'reason':'File\x20name\x20\x22'+_0x45356b+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20member\x20name\x20limit)'};const _0x1fb1ed=getIbmiExtension(_0x3960ea);if(_0x1fb1ed){const _0x13997a=_0x1fb1ed['startsWith']('.')?_0x1fb1ed['substring'](0x1):_0x1fb1ed;if(_0x13997a['length']>0xa)return{'valid':![],'reason':'Extension\x20\x22'+_0x1fb1ed+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20member\x20type\x20limit)'};}return{'valid':!![]};}export function hasKnownIbmiExtension(_0x2cf0de){const _0xf06978=getIbmiExtension(_0x2cf0de);return IBMI_KNOWN_EXTENSIONS['has'](_0xf06978);}