@flosum/cli 0.0.1 → 0.0.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +1 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a0_0x2cdf9a=a0_0x21da;(function(_0x32ebb2,_0x53aae9){const _0x4317dd=a0_0x21da,_0x4405c8=_0x32ebb2();while(!![]){try{const _0x123dda=parseInt(_0x4317dd(0xc8))/0x1*(-parseInt(_0x4317dd(0x197))/0x2)+-parseInt(_0x4317dd(0x19f))/0x3*(-parseInt(_0x4317dd(0x159))/0x4)+parseInt(_0x4317dd(0x1ed))/0x5*(-parseInt(_0x4317dd(0x157))/0x6)+parseInt(_0x4317dd(0xd3))/0x7*(parseInt(_0x4317dd(0x220))/0x8)+parseInt(_0x4317dd(0x1a3))/0x9+parseInt(_0x4317dd(0xd2))/0xa*(parseInt(_0x4317dd(0xe1))/0xb)+parseInt(_0x4317dd(0x133))/0xc*(-parseInt(_0x4317dd(0x200))/0xd);if(_0x123dda===_0x53aae9)break;else _0x4405c8['push'](_0x4405c8['shift']());}catch(_0x3548d6){_0x4405c8['push'](_0x4405c8['shift']());}}}(a0_0x173a,0x3b9c2));const a0_0x433cef=(function(){let _0x2dec95=!![];return function(_0x5a91d7,_0x219766){const _0x560a4e=_0x2dec95?function(){const _0x344cf1=a0_0x21da;if(_0x219766){const _0xa18fff=_0x219766[_0x344cf1(0x1ec)](_0x5a91d7,arguments);return _0x219766=null,_0xa18fff;}}:function(){};return _0x2dec95=![],_0x560a4e;};}()),a0_0x269aa1=a0_0x433cef(this,function(){const _0x5a2344=a0_0x21da;return a0_0x269aa1['toString']()['search']('(((.+)+)+)+$')[_0x5a2344(0x20a)]()['constructor'](a0_0x269aa1)[_0x5a2344(0x132)]('(((.+)+)+)+$');});a0_0x269aa1();'use strict';var node_path=require(a0_0x2cdf9a(0x1d5)),commander=require('commander'),promises=require(a0_0x2cdf9a(0xec)),node_os=require('node:os'),axios=require('axios'),salesforce=require('@flosum/salesforce'),node_crypto=require(a0_0x2cdf9a(0x1ca)),readline=require(a0_0x2cdf9a(0x1c1)),debug=require(a0_0x2cdf9a(0x170)),table=require('table'),path=require(a0_0x2cdf9a(0x16e)),version='0.0.1',config={'version':version};const ROOT_NAME=a0_0x2cdf9a(0x175),DEFAULT_ALIAS_NAME=a0_0x2cdf9a(0xc2);class FileUtils{static async[a0_0x2cdf9a(0x19d)](_0x3d90e4){const _0x75b490=a0_0x2cdf9a,_0x455c22=await promises[_0x75b490(0xd9)](_0x3d90e4,{'withFileTypes':!![]}),_0x39d1c0=[];for(const _0x8893a of _0x455c22){const _0x557104=node_path[_0x75b490(0x11b)](_0x3d90e4,_0x8893a[_0x75b490(0x127)]);if(_0x8893a['isDirectory']()){const _0x208f0d=await FileUtils[_0x75b490(0x19d)](_0x557104);_0x39d1c0[_0x75b490(0x10e)](_0x208f0d);continue;}_0x39d1c0[_0x75b490(0x10e)](_0x557104);}return _0x39d1c0[_0x75b490(0xc5)]();}static async['cleanUpEmptyFolders'](_0x5f2832,_0x265fef=!![]){const _0x39d642=a0_0x2cdf9a,_0x233169=await promises[_0x39d642(0xd9)](_0x5f2832,{'withFileTypes':!![]});let _0x48747e=!![];for(const _0x496b92 of _0x233169){const _0x303e43=node_path[_0x39d642(0x11b)](_0x5f2832,_0x496b92[_0x39d642(0x127)]);if(_0x496b92[_0x39d642(0x135)]()){const _0x1565b0=await FileUtils[_0x39d642(0xfe)](_0x303e43);!_0x1565b0&&(_0x48747e=![]);}else _0x48747e=![];}return _0x265fef&&_0x48747e&&await promises[_0x39d642(0x1c8)](_0x5f2832),_0x48747e;}static async[a0_0x2cdf9a(0x178)](_0x2f7d9e){const _0x49afd4=a0_0x2cdf9a;return promises[_0x49afd4(0x137)](_0x2f7d9e)[_0x49afd4(0x103)](async _0x2df1c4=>{const _0x5bd653=_0x49afd4;return await promises[_0x5bd653(0x15d)](_0x2f7d9e,promises['constants']['R_OK']|promises[_0x5bd653(0x210)][_0x5bd653(0x16b)]),_0x2df1c4[_0x5bd653(0x135)]();})[_0x49afd4(0x12d)](()=>![]);}static async[a0_0x2cdf9a(0x1c0)](_0x483450){const _0x218768=a0_0x2cdf9a;return promises[_0x218768(0x137)](_0x483450)[_0x218768(0x103)](async _0x3c1859=>{const _0x2e2fc2=_0x218768;return await promises[_0x2e2fc2(0x15d)](_0x483450,promises['constants'][_0x2e2fc2(0x184)]|promises[_0x2e2fc2(0x210)][_0x2e2fc2(0x16b)]),_0x3c1859[_0x2e2fc2(0x223)]();})[_0x218768(0x12d)](()=>![]);}}const SYSTEM_FOLDER$1='.'+ROOT_NAME,CREDENTIALS_FILE_NAME=a0_0x2cdf9a(0x107);class CredentialsManager{static async['save'](_0x471ce9){const _0xcff1ad=a0_0x2cdf9a,_0x6ed0ae=node_path[_0xcff1ad(0x11b)](node_os[_0xcff1ad(0x151)](),SYSTEM_FOLDER$1);await promises[_0xcff1ad(0x17d)](_0x6ed0ae,{'recursive':!![]});const _0x59cbe5=node_path[_0xcff1ad(0x11b)](_0x6ed0ae,CREDENTIALS_FILE_NAME),_0x3c8d49=await CredentialsManager[_0xcff1ad(0x11d)](_0x59cbe5),_0x5f5705=_0x3c8d49['find'](({alias:_0x1f85b5})=>_0x1f85b5===_0x471ce9[_0xcff1ad(0x196)]);!_0x5f5705?_0x3c8d49[_0xcff1ad(0x10e)](_0x471ce9):(_0x5f5705[_0xcff1ad(0xbd)]=_0x471ce9['accessToken'],_0x5f5705['globalSettingsUrl']=_0x471ce9[_0xcff1ad(0x153)],_0x5f5705[_0xcff1ad(0x143)]=_0x471ce9[_0xcff1ad(0x143)]),await promises[_0xcff1ad(0x181)](_0x59cbe5,Buffer[_0xcff1ad(0x213)](JSON['stringify'](_0x3c8d49)));}static async[a0_0x2cdf9a(0x231)]({alias:_0x2c1623}){const _0x568db2=a0_0x2cdf9a,_0x74e8cc=node_path[_0x568db2(0x11b)](node_os[_0x568db2(0x151)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x381708=await CredentialsManager[_0x568db2(0x11d)](_0x74e8cc),_0x4406eb=_0x381708[_0x568db2(0x117)](_0x1ba570=>_0x1ba570[_0x568db2(0x196)]===_0x2c1623);if(!_0x4406eb)throw new Error(_0x568db2(0x149)+_0x2c1623+_0x568db2(0x172));return _0x4406eb;}static async[a0_0x2cdf9a(0x201)](){const _0x36d2f1=a0_0x2cdf9a,_0x5ae0e0=node_path[_0x36d2f1(0x11b)](node_os[_0x36d2f1(0x151)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x3eef43=await CredentialsManager[_0x36d2f1(0x11d)](_0x5ae0e0);return _0x3eef43;}static async['getAllCredentials'](_0x2d7248){const _0x3d8130=a0_0x2cdf9a,_0x58fe2f=await FileUtils[_0x3d8130(0x1c0)](_0x2d7248);if(_0x58fe2f){const _0x186fca=await promises[_0x3d8130(0x13b)](_0x2d7248);return JSON[_0x3d8130(0x14f)](_0x186fca[_0x3d8130(0x20a)]());}return[];}static async['delete']({alias:_0x15ea9a}){const _0x404cb8=a0_0x2cdf9a,_0x1a6c4c=node_path[_0x404cb8(0x11b)](node_os[_0x404cb8(0x151)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x2cda3f=await CredentialsManager[_0x404cb8(0x11d)](_0x1a6c4c),_0x1bb732=_0x2cda3f[_0x404cb8(0xef)](_0x106b77=>_0x106b77[_0x404cb8(0x196)]===_0x15ea9a);if(_0x1bb732<0x0)throw new Error('Credentials\x20with\x20alias\x20\x22'+_0x15ea9a+_0x404cb8(0x172));_0x2cda3f[_0x404cb8(0x1d7)](_0x1bb732,0x1),await promises[_0x404cb8(0x181)](_0x1a6c4c,Buffer[_0x404cb8(0x213)](JSON[_0x404cb8(0x192)](_0x2cda3f)));}}class CommitAction{['accessToken'];['devopsUrl'];[a0_0x2cdf9a(0x1b7)];[a0_0x2cdf9a(0x1fb)];[a0_0x2cdf9a(0xe2)];[a0_0x2cdf9a(0x1fe)];['commitDate']=new Date();constructor(_0x2d2490){const _0x2c543c=a0_0x2cdf9a;this[_0x2c543c(0xbd)]=_0x2d2490['accessToken'],this['devopsUrl']=_0x2d2490['devopsUrl'],this[_0x2c543c(0x1b7)]=_0x2d2490['message'],this[_0x2c543c(0x1fb)]=_0x2d2490['branchId'],this[_0x2c543c(0xe2)]=_0x2d2490[_0x2c543c(0xe2)],this[_0x2c543c(0x1fe)]=_0x2d2490[_0x2c543c(0x1fe)];}async[a0_0x2cdf9a(0x20c)](){const _0x4a3db6=a0_0x2cdf9a;try{const _0x18e085=await Promise[_0x4a3db6(0xe5)](this[_0x4a3db6(0xe2)][_0x4a3db6(0xf3)](async _0x4b11ed=>await this['convertToCommit'](_0x4b11ed))),{data:_0x5c3b9b}=await axios[_0x4a3db6(0x1a5)](_0x4a3db6(0x18c)+this[_0x4a3db6(0x1fb)]+_0x4a3db6(0xe7),{'message':this[_0x4a3db6(0x1b7)],'components':_0x18e085},{'headers':{'authorization':_0x4a3db6(0x11a)+this[_0x4a3db6(0xbd)]},'baseURL':this['devopsUrl']});return _0x5c3b9b;}catch(_0x4a5f50){if(axios['isAxiosError'](_0x4a5f50))throw Error(_0x4a5f50[_0x4a3db6(0x11c)]?.['data'][_0x4a3db6(0x1b7)]||_0x4a5f50[_0x4a3db6(0x11c)]?.[_0x4a3db6(0x11f)]||_0x4a5f50[_0x4a3db6(0x1b7)],{'cause':_0x4a5f50});throw _0x4a5f50;}}async['convertToCommit'](_0x3ab385){const _0xc294c5=a0_0x2cdf9a,_0xe672ab=[];for(const {path:_0x4f219c,localPath:_0x1e8c77}of _0x3ab385[_0xc294c5(0xe6)]){_0xe672ab[_0xc294c5(0x10e)](promises[_0xc294c5(0x13b)](_0x1e8c77)['then'](_0x295622=>({'path':_0x4f219c,'content':_0x295622[_0xc294c5(0x20a)](_0xc294c5(0x173))})));}const _0x442b27=await Promise[_0xc294c5(0xe5)](_0xe672ab);return{'name':_0x3ab385[_0xc294c5(0x127)],'type':_0x3ab385[_0xc294c5(0xd5)],'sourceName':_0xc294c5(0xc3),'sourceType':_0xc294c5(0xc3),'externalUpdatedAt':this[_0xc294c5(0x16f)],'externalUpdatedBy':this['userName'],'files':_0x442b27};}}class CreateBranchAction{[a0_0x2cdf9a(0xbd)];[a0_0x2cdf9a(0x143)];constructor(_0x1b8929){const _0x2a2b76=a0_0x2cdf9a;this['accessToken']=_0x1b8929['accessToken'],this[_0x2a2b76(0x143)]=_0x1b8929[_0x2a2b76(0x143)];}async[a0_0x2cdf9a(0x20c)](_0x276050){const _0xd1ec41=a0_0x2cdf9a;try{const {data:_0x2b0299}=await axios['post'](_0xd1ec41(0x1a8),{..._0x276050},{'headers':{'authorization':_0xd1ec41(0x11a)+this['accessToken']},'baseURL':this[_0xd1ec41(0x143)]});return _0x2b0299;}catch(_0xcd6536){if(axios['isAxiosError'](_0xcd6536))throw Error(_0xcd6536['response']?.[_0xd1ec41(0x164)][_0xd1ec41(0x1b7)]||_0xcd6536[_0xd1ec41(0x11c)]?.['statusText']||_0xcd6536[_0xd1ec41(0x1b7)],{'cause':_0xcd6536});throw _0xcd6536;}}}class GetBranchAction{[a0_0x2cdf9a(0xbd)];[a0_0x2cdf9a(0x143)];constructor(_0x5306da){const _0x4d8176=a0_0x2cdf9a;this[_0x4d8176(0xbd)]=_0x5306da[_0x4d8176(0xbd)],this['devopsUrl']=_0x5306da[_0x4d8176(0x143)];}async[a0_0x2cdf9a(0x20c)](_0xe58707){const _0x4711b5=a0_0x2cdf9a;try{const {data:_0x3bf262}=await axios[_0x4711b5(0x231)](_0x4711b5(0x18c)+_0xe58707[_0x4711b5(0x1fb)],{'headers':{'authorization':_0x4711b5(0x11a)+this[_0x4711b5(0xbd)]},'baseURL':this[_0x4711b5(0x143)]});return _0x3bf262;}catch(_0x239500){if(axios[_0x4711b5(0x23b)](_0x239500))throw Error(_0x239500[_0x4711b5(0x11c)]?.[_0x4711b5(0x164)][_0x4711b5(0x1b7)]||_0x239500['response']?.[_0x4711b5(0x11f)]||_0x239500['message'],{'cause':_0x239500});throw _0x239500;}}}class GetDefaultBranchAction{['devopsUrl'];[a0_0x2cdf9a(0xbd)];constructor(_0x367a70){const _0x7b9109=a0_0x2cdf9a;this[_0x7b9109(0x143)]=_0x367a70['devopsUrl'],this['accessToken']=_0x367a70['accessToken'];}async[a0_0x2cdf9a(0x20c)](){const _0x4f35d2=a0_0x2cdf9a;try{const {data:_0x173168}=await axios[_0x4f35d2(0x231)]('fit/branches/default',{'headers':{'authorization':_0x4f35d2(0x11a)+this[_0x4f35d2(0xbd)]},'baseURL':this[_0x4f35d2(0x143)]});return _0x173168;}catch(_0x1ea612){if(axios['isAxiosError'](_0x1ea612))throw Error(_0x1ea612[_0x4f35d2(0x11c)]?.[_0x4f35d2(0x164)][_0x4f35d2(0x1b7)]||_0x1ea612[_0x4f35d2(0x11c)]?.['statusText']||_0x1ea612['message'],{'cause':_0x1ea612});throw _0x1ea612;}}}class GetMeAction{['accessToken'];[a0_0x2cdf9a(0x143)];constructor(_0x4ffffc){const _0x3d1c54=a0_0x2cdf9a;this[_0x3d1c54(0xbd)]=_0x4ffffc[_0x3d1c54(0xbd)],this[_0x3d1c54(0x143)]=_0x4ffffc[_0x3d1c54(0x143)];}async[a0_0x2cdf9a(0x20c)](){const _0x3ce660=a0_0x2cdf9a;try{const {data:_0x2c187e}=await axios[_0x3ce660(0x231)](_0x3ce660(0x1f1),{'headers':{'authorization':_0x3ce660(0x11a)+this[_0x3ce660(0xbd)]},'baseURL':this[_0x3ce660(0x143)]});return _0x2c187e;}catch(_0x5dc8c7){if(axios[_0x3ce660(0x23b)](_0x5dc8c7))throw Error(_0x5dc8c7['response']?.[_0x3ce660(0x164)][_0x3ce660(0x1b7)]||_0x5dc8c7[_0x3ce660(0x11c)]?.['statusText']||_0x5dc8c7[_0x3ce660(0x1b7)],{'cause':_0x5dc8c7});throw _0x5dc8c7;}}}class ListBranchesAction{[a0_0x2cdf9a(0x143)];[a0_0x2cdf9a(0xbd)];[a0_0x2cdf9a(0x132)];constructor(_0x5755dc){const _0x43fcb4=a0_0x2cdf9a;this[_0x43fcb4(0x143)]=_0x5755dc[_0x43fcb4(0x143)],this[_0x43fcb4(0xbd)]=_0x5755dc[_0x43fcb4(0xbd)],this[_0x43fcb4(0x132)]=_0x5755dc[_0x43fcb4(0x132)];}async[a0_0x2cdf9a(0x20c)](){const _0x23680f=a0_0x2cdf9a;try{const _0x43f059=[];let _0x247763=0x0,_0x12fb69=0x0;do{const {data:_0x5313ed}=await axios[_0x23680f(0x231)](_0x23680f(0x1a8),{'headers':{'authorization':_0x23680f(0x11a)+this[_0x23680f(0xbd)]},'params':{'search':this['search'],'offset':_0x247763,'limit':0x64},'baseURL':this[_0x23680f(0x143)]});_0x43f059[_0x23680f(0x10e)](..._0x5313ed[_0x23680f(0x1cc)]),_0x247763+=_0x5313ed[_0x23680f(0x1cc)][_0x23680f(0xc7)],_0x12fb69=_0x5313ed[_0x23680f(0x1aa)];}while(_0x247763<_0x12fb69);return _0x43f059;}catch(_0x4bd313){if(axios[_0x23680f(0x23b)](_0x4bd313))throw Error(_0x4bd313[_0x23680f(0x11c)]?.[_0x23680f(0x164)][_0x23680f(0x1b7)]||_0x4bd313[_0x23680f(0x11c)]?.[_0x23680f(0x11f)]||_0x4bd313[_0x23680f(0x1b7)],{'cause':_0x4bd313});throw _0x4bd313;}}}class ListComponentsAction{['devopsUrl'];[a0_0x2cdf9a(0xbd)];['branchId'];[a0_0x2cdf9a(0x1e0)];[a0_0x2cdf9a(0xd4)];constructor(_0x14a9f3){const _0x4a25a1=a0_0x2cdf9a;this[_0x4a25a1(0x143)]=_0x14a9f3[_0x4a25a1(0x143)],this[_0x4a25a1(0xbd)]=_0x14a9f3['accessToken'],this[_0x4a25a1(0x1fb)]=_0x14a9f3[_0x4a25a1(0x1fb)],this[_0x4a25a1(0x1e0)]=_0x14a9f3[_0x4a25a1(0x1e0)],_0x14a9f3['components']&&(this['indexes']=new Set(_0x14a9f3[_0x4a25a1(0xe2)]['map'](({name:_0x43bdda,type:_0x710d87})=>_0x710d87+'_'+_0x43bdda)));}async*[a0_0x2cdf9a(0x20c)](){const _0x2eb55c=a0_0x2cdf9a;try{let _0x890982=0x0,_0x2e89dc=0x0;do{const {data:_0x27fd6b}=await axios[_0x2eb55c(0x231)](_0x2eb55c(0x18c)+this[_0x2eb55c(0x1fb)]+'/commits/'+this[_0x2eb55c(0x1e0)]+'/components',{'headers':{'authorization':_0x2eb55c(0x11a)+this[_0x2eb55c(0xbd)]},'params':{'offset':_0x890982,'limit':0x64},'baseURL':this[_0x2eb55c(0x143)]});_0x890982+=_0x27fd6b[_0x2eb55c(0x1cc)][_0x2eb55c(0xc7)],_0x2e89dc=_0x27fd6b[_0x2eb55c(0x10f)];let _0x6d85b5=_0x27fd6b[_0x2eb55c(0x1cc)];this['indexes']&&(_0x6d85b5=_0x27fd6b['rows'][_0x2eb55c(0x180)](({name:_0x534380,type:_0x3900c6})=>this[_0x2eb55c(0xd4)]?.[_0x2eb55c(0x1c9)](_0x3900c6+'_'+_0x534380))),yield*_0x6d85b5;}while(_0x890982<_0x2e89dc);}catch(_0x510b57){if(axios['isAxiosError'](_0x510b57))throw Error(_0x510b57[_0x2eb55c(0x11c)]?.[_0x2eb55c(0x164)][_0x2eb55c(0x1b7)]||_0x510b57[_0x2eb55c(0x11c)]?.['statusText']||_0x510b57[_0x2eb55c(0x1b7)],{'cause':_0x510b57});throw _0x510b57;}}}class RetrieveComponentAction{[a0_0x2cdf9a(0x143)];[a0_0x2cdf9a(0xbd)];constructor(_0x563b1a){const _0x4045fc=a0_0x2cdf9a;this[_0x4045fc(0x143)]=_0x563b1a[_0x4045fc(0x143)],this['accessToken']=_0x563b1a['accessToken'];}async[a0_0x2cdf9a(0x20c)](_0xf5037e){const _0x2e1969=a0_0x2cdf9a;try{const {data:{id:_0x2fc4fb,name:_0x2c6e13,type:_0x3da6a9,fHash:_0x259989,files:_0x28736f}}=await axios['get'](_0x2e1969(0x1b8)+_0xf5037e,{'headers':{'authorization':'Token\x20'+this[_0x2e1969(0xbd)]},'baseURL':this[_0x2e1969(0x143)]}),_0x2c6550=_0x28736f['map'](_0x19651b=>({'path':_0x19651b['path'],'content':Buffer[_0x2e1969(0x213)](_0x19651b[_0x2e1969(0x21d)],_0x2e1969(0x173))[_0x2e1969(0x20a)](_0x2e1969(0x179))}));return{'id':_0x2fc4fb,'name':_0x2c6e13,'type':_0x3da6a9,'fHash':_0x259989,'files':_0x2c6550};}catch(_0x40e4fa){if(axios['isAxiosError'](_0x40e4fa))throw Error(_0x40e4fa[_0x2e1969(0x11c)]?.['data'][_0x2e1969(0x1b7)]||_0x40e4fa['response']?.[_0x2e1969(0x11f)]||_0x40e4fa[_0x2e1969(0x1b7)],{'cause':_0x40e4fa});throw _0x40e4fa;}}}const RETRIEVE_COMPONENT_CHUNK_SIZE=0xa;class ApiService{static async[a0_0x2cdf9a(0x1fa)](_0x1a3abd){const _0x273300=a0_0x2cdf9a,_0x2a7825=new ListBranchesAction(_0x1a3abd);return _0x2a7825[_0x273300(0x20c)]();}static async[a0_0x2cdf9a(0x1d9)](_0x46f8b5){const _0x574e26=a0_0x2cdf9a,_0x430b09=new GetDefaultBranchAction(_0x46f8b5);return _0x430b09[_0x574e26(0x20c)]();}static async[a0_0x2cdf9a(0x1b6)](_0x447c92){const _0xcbcf29=a0_0x2cdf9a,_0x553fe1=await ApiService[_0xcbcf29(0x1fa)]({'devopsUrl':_0x447c92[_0xcbcf29(0x143)],'accessToken':_0x447c92[_0xcbcf29(0xbd)],'search':_0x447c92[_0xcbcf29(0x163)]});return _0x553fe1[_0xcbcf29(0x117)](({name:_0x201227})=>_0x201227===_0x447c92['branchName'])||null;}static async['getBranchById'](_0x4b6edc){const _0x1ee177=a0_0x2cdf9a,_0x4aa9f9=new GetBranchAction({'accessToken':_0x4b6edc['accessToken'],'devopsUrl':_0x4b6edc[_0x1ee177(0x143)]});return _0x4aa9f9[_0x1ee177(0x20c)]({'branchId':_0x4b6edc['branchId']});}static[a0_0x2cdf9a(0x100)](_0x302cda){const _0x284aaa=new ListComponentsAction(_0x302cda);return _0x284aaa['execute']();}static async[a0_0x2cdf9a(0x15c)](_0x30ced8){const _0x3ba0d2=a0_0x2cdf9a,_0x28608d=[];for await(const _0x1ed251 of ApiService[_0x3ba0d2(0x100)](_0x30ced8)){_0x28608d[_0x3ba0d2(0x10e)](_0x1ed251);}return _0x28608d;}static async*[a0_0x2cdf9a(0x1d2)](_0x1cff65){const _0x3e0f3e=a0_0x2cdf9a,_0x5c977f=new RetrieveComponentAction({'devopsUrl':_0x1cff65[_0x3e0f3e(0x143)],'accessToken':_0x1cff65[_0x3e0f3e(0xbd)]});let _0x3c5cfe=[];for await(const _0x7968d1 of ApiService[_0x3e0f3e(0x100)]({'devopsUrl':_0x1cff65['devopsUrl'],'accessToken':_0x1cff65[_0x3e0f3e(0xbd)],'branchId':_0x1cff65[_0x3e0f3e(0x1fb)],'commitId':_0x1cff65['commitId'],'components':_0x1cff65[_0x3e0f3e(0xe2)]})){_0x3c5cfe[_0x3e0f3e(0x10e)](_0x5c977f[_0x3e0f3e(0x20c)](_0x7968d1['id'])),_0x3c5cfe[_0x3e0f3e(0xc7)]>=RETRIEVE_COMPONENT_CHUNK_SIZE&&(yield*await Promise['all'](_0x3c5cfe),_0x3c5cfe=[]);}_0x3c5cfe['length']&&(yield*await Promise[_0x3e0f3e(0xe5)](_0x3c5cfe));}static async[a0_0x2cdf9a(0x1c7)]({devopsUrl:_0x55abc0,accessToken:_0x3b9f07,componentId:_0x2fa247}){const _0x45d3dd=a0_0x2cdf9a,_0xec12f4=new RetrieveComponentAction({'devopsUrl':_0x55abc0,'accessToken':_0x3b9f07});return _0xec12f4[_0x45d3dd(0x20c)](_0x2fa247);}static async['getCredentials'](_0x6cc89d){const _0x516843=a0_0x2cdf9a,{accessToken:_0x49efb2,devopsUrl:_0x4e9e05}=await CredentialsManager[_0x516843(0x231)]({'alias':_0x6cc89d});if(!_0x4e9e05)throw new Error(_0x516843(0x15f));return{'accessToken':_0x49efb2,'devopsUrl':_0x4e9e05};}static async[a0_0x2cdf9a(0x203)](_0x990e30){const _0x51043c=a0_0x2cdf9a,_0x196bf2=new GetMeAction(_0x990e30);return _0x196bf2[_0x51043c(0x20c)]();}static async['commit'](_0x5a0103){const _0xd7837a=new CommitAction(_0x5a0103);await _0xd7837a['execute']();}static async[a0_0x2cdf9a(0xed)](_0x4b6754){const _0x39f785=a0_0x2cdf9a,_0xded4e0=new CreateBranchAction({'accessToken':_0x4b6754[_0x39f785(0xbd)],'devopsUrl':_0x4b6754[_0x39f785(0x143)]});return _0xded4e0[_0x39f785(0x20c)]({'name':_0x4b6754['name'],'parentId':_0x4b6754[_0x39f785(0x1e3)]});}}var ConfigName=(_0xe31d14=>{return _0xe31d14['CREDENTIALS_ALIAS']='credentialsAlias',_0xe31d14;})(ConfigName||{}),ChangeType=(_0x245e62=>{const _0x3e37f1=a0_0x2cdf9a;return _0x245e62[_0x3e37f1(0x239)]=_0x3e37f1(0xbe),_0x245e62[_0x3e37f1(0x199)]=_0x3e37f1(0x125),_0x245e62[_0x3e37f1(0x1df)]=_0x3e37f1(0x1ac),_0x245e62;})(ChangeType||{});class CompareWithRemoteBranchAction{[a0_0x2cdf9a(0x143)];['accessToken'];['targetBranchId'];[a0_0x2cdf9a(0x115)];[a0_0x2cdf9a(0xb8)];constructor(_0x477fa9){const _0x2ef00e=a0_0x2cdf9a;this[_0x2ef00e(0x143)]=_0x477fa9[_0x2ef00e(0x143)],this[_0x2ef00e(0xbd)]=_0x477fa9[_0x2ef00e(0xbd)],this[_0x2ef00e(0x21b)]=_0x477fa9['targetBranchId'],this['targetCommitId']=_0x477fa9[_0x2ef00e(0x115)],this[_0x2ef00e(0xb8)]=_0x477fa9[_0x2ef00e(0xb8)];}async[a0_0x2cdf9a(0x20c)](){const _0x4fb4ee=a0_0x2cdf9a,_0x22073e=await ApiService[_0x4fb4ee(0x15c)]({'devopsUrl':this[_0x4fb4ee(0x143)],'accessToken':this[_0x4fb4ee(0xbd)],'branchId':this[_0x4fb4ee(0x21b)],'commitId':this[_0x4fb4ee(0x115)]}),_0x2bf99c=new Map(_0x22073e[_0x4fb4ee(0xf3)](_0x18830c=>[_0x18830c[_0x4fb4ee(0xd5)]+'_'+_0x18830c[_0x4fb4ee(0x127)],_0x18830c])),_0x5ee032=[];for(const _0xa7acb of this['findDeletedAndUpdated'](_0x2bf99c)){_0x5ee032[_0x4fb4ee(0x10e)](_0xa7acb),_0x2bf99c[_0x4fb4ee(0x1e4)](_0xa7acb['type']+'_'+_0xa7acb['name']);}for(const [_0xa663a5,_0x3379e0]of _0x2bf99c[_0x4fb4ee(0x155)]()){const _0xfcb721=this[_0x4fb4ee(0xb8)][_0x4fb4ee(0x12b)][_0x4fb4ee(0x231)](_0xa663a5);!_0xfcb721&&_0x5ee032['push']({'id':_0x3379e0['id'],'name':_0x3379e0['name'],'type':_0x3379e0[_0x4fb4ee(0xd5)],'fHash':_0x3379e0[_0x4fb4ee(0x1c3)],'changeType':ChangeType[_0x4fb4ee(0x239)]});}return _0x5ee032;}*[a0_0x2cdf9a(0xf7)](_0x3ab3cd){const _0x59ceaf=a0_0x2cdf9a;for(const [_0x2cb0c3,_0x5149e2]of this[_0x59ceaf(0xb8)]['componentsState'][_0x59ceaf(0x155)]()){const _0x4874e6=_0x3ab3cd[_0x59ceaf(0x231)](_0x2cb0c3);!_0x4874e6&&(yield{'name':_0x5149e2[_0x59ceaf(0x127)],'type':_0x5149e2['type'],'changeType':ChangeType[_0x59ceaf(0x1df)]}),_0x4874e6&&_0x4874e6[_0x59ceaf(0x1c3)]!==_0x5149e2[_0x59ceaf(0x1c3)]&&(yield{'id':_0x4874e6['id'],'name':_0x4874e6[_0x59ceaf(0x127)],'type':_0x4874e6[_0x59ceaf(0xd5)],'fHash':_0x4874e6[_0x59ceaf(0x1c3)],'changeType':ChangeType['UPDATE']});}}}class ConfigSetAction{['stage'];constructor({stage:_0xfcb729}){this['stage']=_0xfcb729;}async['execute']({name:_0x448626,value:_0x1262d7}){const _0x240d01=a0_0x2cdf9a;switch(_0x448626){case ConfigName[_0x240d01(0x189)]:await CredentialsManager[_0x240d01(0x231)]({'alias':_0x1262d7}),this[_0x240d01(0xb8)]['setConfig'](_0x448626,_0x1262d7);break;default:throw new Error(_0x240d01(0x148)+_0x448626);}}}class FindChangesAction{[a0_0x2cdf9a(0xb8)];constructor(_0x3d87e0){const _0x37e0ac=a0_0x2cdf9a;this[_0x37e0ac(0xb8)]=_0x3d87e0[_0x37e0ac(0xb8)];}async['execute'](){const _0xcbb4b=a0_0x2cdf9a,_0x5f43ce=new Map(this[_0xcbb4b(0xb8)]['componentsState']),_0x5a26ed=[];for await(const {componentName:_0x41b382,componentType:_0xddc9d8,filePaths:_0x5d3b62}of salesforce[_0xcbb4b(0x22b)][_0xcbb4b(0x22a)](this['stage'][_0xcbb4b(0x1d3)])){const _0x2ba22f=_0xddc9d8+'_'+_0x41b382,_0x20d2a2=_0x5f43ce[_0xcbb4b(0x231)](_0x2ba22f),_0x4862ef=_0x5d3b62['map'](_0x2f7ee8=>_0x2f7ee8[_0xcbb4b(0x1ce)](this[_0xcbb4b(0xb8)][_0xcbb4b(0x1d3)]+'/',''));if(!_0x20d2a2){_0x5a26ed[_0xcbb4b(0x10e)]({'type':_0xddc9d8,'name':_0x41b382,'changes':_0x4862ef[_0xcbb4b(0xf3)](_0x54c69f=>({'path':_0x54c69f,'changeType':ChangeType[_0xcbb4b(0x239)]}))});continue;}_0x5f43ce['delete'](_0x2ba22f);const _0x23f3c1=await this[_0xcbb4b(0x235)](_0x4862ef,_0x20d2a2['paths']);_0x23f3c1[_0xcbb4b(0xc7)]&&_0x5a26ed[_0xcbb4b(0x10e)]({'type':_0xddc9d8,'name':_0x41b382,'changes':_0x23f3c1});}for(const [,_0x441843]of _0x5f43ce[_0xcbb4b(0x155)]()){_0x5a26ed[_0xcbb4b(0x10e)]({'type':_0x441843[_0xcbb4b(0xd5)],'name':_0x441843[_0xcbb4b(0x127)],'changes':_0x441843[_0xcbb4b(0x123)][_0xcbb4b(0xf3)](_0x3f4347=>({'path':_0x3f4347,'changeType':ChangeType[_0xcbb4b(0x1df)]}))});}return _0x5a26ed;}async['getUpdatedComponentChanges'](_0x3de7e,_0x402c52){const _0x413495=a0_0x2cdf9a,{lastStageTimestamp:_0x26481c}=this[_0x413495(0xb8)][_0x413495(0x10d)],_0x28d5d4=[];for(const _0x4c2613 of _0x3de7e){const _0x16d7a0=_0x402c52[_0x413495(0x126)](_0x4c2613);if(!_0x16d7a0){_0x28d5d4['push']({'path':_0x4c2613,'changeType':ChangeType['CREATE']});continue;}const {ctimeMs:_0x396dc2,mtimeMs:_0x141006}=await promises[_0x413495(0x137)](_0x4c2613);(!_0x26481c||Math[_0x413495(0x1f4)](_0x141006)>_0x26481c||Math[_0x413495(0x1f4)](_0x396dc2)>_0x26481c)&&_0x28d5d4['push']({'path':_0x4c2613,'changeType':ChangeType[_0x413495(0x199)]});}for(const _0x23d541 of _0x402c52){const _0x5a42a7=!_0x3de7e['includes'](_0x23d541);_0x5a42a7&&_0x28d5d4[_0x413495(0x10e)]({'path':_0x23d541,'changeType':ChangeType[_0x413495(0x1df)]});}return _0x28d5d4;}}const STAGE_FOLDER_NAME=a0_0x2cdf9a(0x1ab),SYSTEM_FOLDER='.'+ROOT_NAME,CONFIG_FILE_NAME='config.json',BRANCH_STATE_FILE_NAME=a0_0x2cdf9a(0x18e),COMPONENTS_STATE_FILE_NAME=a0_0x2cdf9a(0x22e),COMPONENT_PROJECT_PATH=node_path['join'](a0_0x2cdf9a(0x1f5),'main',a0_0x2cdf9a(0xc2)),SFDX_PROJECT_FILE_NAME=a0_0x2cdf9a(0x18a),INITIAL_BRANCH_STATE={'id':null,'name':null,'headCommitId':null,'lastStageTimestamp':null},INITIAL_CONFIG={'credentialsAlias':null};class InitProjectAction{[a0_0x2cdf9a(0xb8)];[a0_0x2cdf9a(0xbb)];constructor({stage:_0x31f077,config:_0x4bafe0}){const _0x375e75=a0_0x2cdf9a;this[_0x375e75(0xb8)]=_0x31f077,this[_0x375e75(0xbb)]=_0x4bafe0;}async['execute'](){const _0x6db568=a0_0x2cdf9a,_0xb24358=new salesforce['CreateProjectSfCommand']({'cwd':node_path[_0x6db568(0xda)](this[_0x6db568(0xb8)][_0x6db568(0x1bb)]),'projectName':node_path[_0x6db568(0x224)](this[_0x6db568(0xb8)]['stagePath'])});await _0xb24358['run']();const _0x144124=await FileUtils[_0x6db568(0x19d)](this['stage'][_0x6db568(0x1bb)]);for(const _0x184eba of _0x144124){const _0x341a43=_0x184eba['split'](STAGE_FOLDER_NAME)[0x1];this[_0x6db568(0xb8)]['registerFileChange']({'path':_0x341a43,'changeType':ChangeType['CREATE']});}if(this[_0x6db568(0xbb)])for(const _0xa18ce4 of Object[_0x6db568(0x214)](ConfigName)){this[_0x6db568(0xb8)][_0x6db568(0x154)](_0xa18ce4,this['config'][_0xa18ce4]);}}}class SaveComponentAction{[a0_0x2cdf9a(0xb8)];constructor(_0x6a25ee){const _0x2116ae=a0_0x2cdf9a;this[_0x2116ae(0xb8)]=_0x6a25ee[_0x2116ae(0xb8)];}async[a0_0x2cdf9a(0x20c)](_0xcda0eb){const _0x218415=a0_0x2cdf9a;switch(_0xcda0eb[_0x218415(0x1a0)]){case ChangeType['CREATE']:{if(!_0xcda0eb[_0x218415(0xc9)])throw new Error('Create:\x20Component\x20not\x20found');await this[_0x218415(0xb8)]['createComponent'](_0xcda0eb['component']);break;}case ChangeType['UPDATE']:if(!_0xcda0eb[_0x218415(0xc9)])throw new Error('Update:\x20Component\x20not\x20found');await this[_0x218415(0xb8)]['updateComponent'](_0xcda0eb[_0x218415(0xc9)]);break;case ChangeType[_0x218415(0x1df)]:await this[_0x218415(0xb8)]['deleteComponent']({'name':_0xcda0eb[_0x218415(0x127)],'type':_0xcda0eb[_0x218415(0xd5)]});break;}}}class UpdateComponentStateAction{[a0_0x2cdf9a(0xb8)];[a0_0x2cdf9a(0x127)];[a0_0x2cdf9a(0xd5)];['changes'];constructor(_0x1383b6){const _0x322c3e=a0_0x2cdf9a;this['stage']=_0x1383b6['stage'],this[_0x322c3e(0x127)]=_0x1383b6[_0x322c3e(0x127)],this['type']=_0x1383b6[_0x322c3e(0xd5)],this[_0x322c3e(0xfa)]=_0x1383b6[_0x322c3e(0xfa)];}async['execute'](){const _0x9793e3=a0_0x2cdf9a,_0x15f259=this[_0x9793e3(0xd5)]+'_'+this[_0x9793e3(0x127)];let _0x2a45e8=this[_0x9793e3(0xb8)]['componentsState']['get'](_0x15f259);!_0x2a45e8&&(_0x2a45e8={'name':this[_0x9793e3(0x127)],'type':this['type'],'fHash':'','paths':[]},this['stage'][_0x9793e3(0x12b)]['set'](_0x15f259,_0x2a45e8));let _0x584ea5;for(const _0x2996b5 of this[_0x9793e3(0xfa)]){this[_0x9793e3(0x230)](_0x2a45e8,_0x2996b5),_0x2996b5[_0x9793e3(0x1a0)]===ChangeType[_0x9793e3(0x239)]&&(_0x584ea5=ChangeType[_0x9793e3(0x239)]);}if(!_0x2a45e8[_0x9793e3(0x123)][_0x9793e3(0xc7)])return this[_0x9793e3(0xb8)][_0x9793e3(0x12b)][_0x9793e3(0x1e4)](_0x15f259),{'name':this[_0x9793e3(0x127)],'type':this[_0x9793e3(0xd5)],'changeType':ChangeType[_0x9793e3(0x1df)]};return!_0x584ea5&&(_0x584ea5=ChangeType[_0x9793e3(0x199)]),_0x2a45e8[_0x9793e3(0x1c3)]=await this[_0x9793e3(0xc4)](_0x2a45e8[_0x9793e3(0x123)]),{..._0x2a45e8,'changeType':_0x584ea5};}['handleFileChange'](_0x400fbe,{path:_0x4e6997,changeType:_0x3a6310}){const _0x2f3a5a=a0_0x2cdf9a;if(_0x3a6310===ChangeType['CREATE']){if(_0x400fbe[_0x2f3a5a(0x123)][_0x2f3a5a(0x126)](_0x4e6997))throw new Error(_0x2f3a5a(0xbc)+_0x4e6997+_0x2f3a5a(0x1de));_0x400fbe['paths'][_0x2f3a5a(0x10e)](_0x4e6997);}if(_0x3a6310===ChangeType[_0x2f3a5a(0x1df)]){const _0xec5d0f=_0x400fbe[_0x2f3a5a(0x123)][_0x2f3a5a(0xf5)](_0x4e6997);if(_0xec5d0f<0x0)throw new Error('File\x20\x22'+_0x4e6997+_0x2f3a5a(0x172));_0x400fbe[_0x2f3a5a(0x123)][_0x2f3a5a(0x1d7)](_0xec5d0f,0x1);}}async[a0_0x2cdf9a(0xc4)](_0xd4f8a4){const _0x442d30=a0_0x2cdf9a,_0x286b2d=node_crypto[_0x442d30(0x1eb)]('sha1');for(const _0x38f98d of _0xd4f8a4){const _0x187839=await promises['readFile'](node_path[_0x442d30(0x11b)](this[_0x442d30(0xb8)][_0x442d30(0x1d3)],_0x38f98d),{'encoding':_0x442d30(0x179)}),_0x2d68de=_0x38f98d[_0x442d30(0x15e)](node_path[_0x442d30(0xcc)])[_0x442d30(0x246)](0x3)[_0x442d30(0x11b)]('/');_0x286b2d['update'](_0x2d68de),_0x286b2d[_0x442d30(0x118)](_0x187839);}const _0x232be9=_0x286b2d[_0x442d30(0x1e2)]('hex');return _0x232be9;}}class Stage{[a0_0x2cdf9a(0x22c)];['_stagePath'];['config'];[a0_0x2cdf9a(0x111)];['_componentsState'];[a0_0x2cdf9a(0x1ef)]=[];['_isUpdateStageTimestamp']=!![];set[a0_0x2cdf9a(0xd6)](_0x4d607b){const _0x141c93=a0_0x2cdf9a;this[_0x141c93(0x22d)]=_0x4d607b;}get[a0_0x2cdf9a(0x1d3)](){const _0x41c574=a0_0x2cdf9a;return this[_0x41c574(0x22c)];}get[a0_0x2cdf9a(0x1bb)](){return this['_stagePath'];}get['branchState'](){const _0xf4248d=a0_0x2cdf9a;return this[_0xf4248d(0x111)];}get[a0_0x2cdf9a(0x12b)](){return this['_componentsState'];}constructor(_0x1f47bb){const _0x24ab21=a0_0x2cdf9a;this['_projectPath']=_0x1f47bb[_0x24ab21(0x1d3)],this[_0x24ab21(0x1a6)]=_0x1f47bb['stagePath'],this[_0x24ab21(0xbb)]=_0x1f47bb[_0x24ab21(0xbb)],this['_branchState']=_0x1f47bb[_0x24ab21(0x10d)],this[_0x24ab21(0x1f3)]=_0x1f47bb[_0x24ab21(0x12b)]?new Map(_0x1f47bb[_0x24ab21(0x12b)][_0x24ab21(0xf3)](_0x567e77=>[_0x567e77[_0x24ab21(0xd5)]+'_'+_0x567e77['name'],_0x567e77])):new Map();}[a0_0x2cdf9a(0x154)](_0x5aa412,_0x285440){const _0x5cf28a=a0_0x2cdf9a;this[_0x5cf28a(0xbb)][_0x5aa412]=_0x285440;}[a0_0x2cdf9a(0x142)](_0x2743ad){const _0x4759eb=a0_0x2cdf9a;this[_0x4759eb(0xbb)][_0x2743ad]=null;}[a0_0x2cdf9a(0x165)](_0x4d9138){const _0x440164=a0_0x2cdf9a;this[_0x440164(0x10d)]['id']=_0x4d9138['id'],this[_0x440164(0x10d)][_0x440164(0x127)]=_0x4d9138[_0x440164(0x127)],this[_0x440164(0x10d)][_0x440164(0x134)]=_0x4d9138[_0x440164(0x134)];}async[a0_0x2cdf9a(0x1c6)](_0x4c7c80){const _0x1308d0=a0_0x2cdf9a,_0x567ef1={'name':_0x4c7c80[_0x1308d0(0x127)],'type':_0x4c7c80[_0x1308d0(0xd5)],'fHash':_0x4c7c80[_0x1308d0(0x1c3)],'paths':_0x4c7c80[_0x1308d0(0xe6)][_0x1308d0(0xf3)](({path:_0x5c2975})=>node_path[_0x1308d0(0x11b)](COMPONENT_PROJECT_PATH,_0x5c2975))};this[_0x1308d0(0x1f3)][_0x1308d0(0x191)](_0x4c7c80['type']+'_'+_0x4c7c80[_0x1308d0(0x127)],_0x567ef1);for(const {path:_0x7856db,content:_0x4452c8}of _0x4c7c80[_0x1308d0(0xe6)]){await this['addFileChange']({'path':node_path[_0x1308d0(0x11b)](COMPONENT_PROJECT_PATH,_0x7856db),'content':_0x4452c8,'changeType':ChangeType[_0x1308d0(0x239)]});}}async[a0_0x2cdf9a(0x152)](_0x153756){const _0x2da338=a0_0x2cdf9a,_0x4a6335=this['_componentsState'][_0x2da338(0x231)](_0x153756[_0x2da338(0xd5)]+'_'+_0x153756[_0x2da338(0x127)]),_0xe018ac=[];if(!_0x4a6335)throw new Error(_0x2da338(0x19b)+_0x153756[_0x2da338(0x127)]+_0x2da338(0x20b)+_0x153756['type']+'\x20not\x20found');for(const _0x9571e4 of _0x4a6335[_0x2da338(0x123)]){await this['addFileChange']({'path':_0x9571e4,'changeType':ChangeType[_0x2da338(0x1df)]});}for(const {path:_0x3054b1,content:_0x274320}of _0x153756[_0x2da338(0xe6)]){const _0x5bcc18=node_path[_0x2da338(0x11b)](COMPONENT_PROJECT_PATH,_0x3054b1);await this[_0x2da338(0x1f9)]({'path':_0x5bcc18,'content':_0x274320,'changeType':ChangeType[_0x2da338(0x239)]}),_0xe018ac[_0x2da338(0x10e)](_0x5bcc18);}_0x4a6335['fHash']=_0x153756[_0x2da338(0x1c3)],_0x4a6335[_0x2da338(0x123)]=_0xe018ac;}async[a0_0x2cdf9a(0xe9)](_0x36921){const _0x1e07cc=a0_0x2cdf9a,_0x29415e=_0x36921[_0x1e07cc(0xd5)]+'_'+_0x36921[_0x1e07cc(0x127)],_0x52f8e0=this['_componentsState']['get'](_0x29415e);if(!_0x52f8e0)throw new Error(_0x1e07cc(0x17a)+_0x36921['name']+_0x1e07cc(0x20b)+_0x36921['type']+'\x20not\x20found');for(const _0x56be5a of _0x52f8e0[_0x1e07cc(0x123)]){await this['addFileChange']({'path':_0x56be5a,'changeType':ChangeType['DELETE']});}this['_componentsState'][_0x1e07cc(0x1e4)](_0x29415e);}async[a0_0x2cdf9a(0x1f9)]({path:_0x3d615b,content:_0x458504,changeType:_0x289c2c}){const _0x1d9cbc=a0_0x2cdf9a;if(_0x289c2c!==ChangeType[_0x1d9cbc(0x1df)]){if(!_0x458504)throw new Error(_0x1d9cbc(0x1e1));const _0x5e86ce=node_path['join'](this['stagePath'],_0x3d615b);await promises[_0x1d9cbc(0x17d)](node_path[_0x1d9cbc(0xda)](_0x5e86ce),{'recursive':!![]}),await promises[_0x1d9cbc(0x181)](_0x5e86ce,_0x458504);}this[_0x1d9cbc(0x1ef)][_0x1d9cbc(0x10e)]({'path':_0x3d615b,'changeType':_0x289c2c});}async[a0_0x2cdf9a(0x18b)](_0x423e06){const _0x242153=a0_0x2cdf9a,_0x2eee40=new UpdateComponentStateAction({'stage':this,..._0x423e06});return _0x2eee40[_0x242153(0x20c)]();}async[a0_0x2cdf9a(0x106)](){}[a0_0x2cdf9a(0x1d0)]({path:_0x45fbbd,changeType:_0x186596}){const _0x44704f=a0_0x2cdf9a;this[_0x44704f(0x1ef)][_0x44704f(0x10e)]({'path':_0x45fbbd,'changeType':_0x186596});}async['apply'](){const _0x59345a=a0_0x2cdf9a,_0x33def8=await FileUtils[_0x59345a(0x178)](this[_0x59345a(0x1bb)]);if(!_0x33def8)throw Error(_0x59345a(0x241));await this[_0x59345a(0x216)](),await this[_0x59345a(0xd7)](),await promises['rm'](this[_0x59345a(0x1bb)],{'recursive':!![]});const _0x48690e=node_path[_0x59345a(0x11b)](this[_0x59345a(0x22c)],COMPONENT_PROJECT_PATH),_0x3993ff=await FileUtils['isDirectoryExists'](_0x48690e);_0x3993ff?await FileUtils[_0x59345a(0xfe)](_0x48690e,![]):await promises[_0x59345a(0x17d)](_0x48690e,{'recursive':!![]});}async[a0_0x2cdf9a(0xb9)](){const _0x57b895=a0_0x2cdf9a;await promises['rm'](this[_0x57b895(0x1bb)],{'recursive':!![],'force':!![]});}async[a0_0x2cdf9a(0x216)](){const _0x5202c7=a0_0x2cdf9a;for(const {path:_0x38027e,changeType:_0x1dcd8a}of this['fileChanges']){switch(_0x1dcd8a){case ChangeType[_0x5202c7(0x239)]:case ChangeType[_0x5202c7(0x199)]:await this[_0x5202c7(0xeb)](_0x38027e);break;case ChangeType[_0x5202c7(0x1df)]:await this[_0x5202c7(0x234)](_0x38027e);break;}}}async[a0_0x2cdf9a(0xeb)](_0x3ed3cf){const _0xfe9cc1=a0_0x2cdf9a,_0x5e722c=node_path[_0xfe9cc1(0x11b)](this['_stagePath'],_0x3ed3cf),_0x2b6df5=node_path[_0xfe9cc1(0x11b)](this[_0xfe9cc1(0x22c)],_0x3ed3cf);await promises[_0xfe9cc1(0x17d)](node_path['dirname'](_0x2b6df5),{'recursive':!![]}),await promises[_0xfe9cc1(0x1a2)](_0x5e722c,_0x2b6df5);}async[a0_0x2cdf9a(0x234)](_0xe9a519){const _0x4dbee7=a0_0x2cdf9a;await promises['rm'](node_path[_0x4dbee7(0x11b)](this[_0x4dbee7(0x22c)],_0xe9a519),{'recursive':!![]});}async['updateSystemFiles'](){const _0x235055=a0_0x2cdf9a;await promises[_0x235055(0x181)](node_path[_0x235055(0x11b)](this[_0x235055(0x1d3)],SYSTEM_FOLDER,CONFIG_FILE_NAME),JSON[_0x235055(0x192)](this[_0x235055(0xbb)])),this[_0x235055(0x22d)]&&(this['branchState'][_0x235055(0xce)]=Date['now']()),await promises[_0x235055(0x181)](node_path[_0x235055(0x11b)](this[_0x235055(0x1d3)],SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),JSON[_0x235055(0x192)](this[_0x235055(0x10d)])),await promises[_0x235055(0x181)](node_path[_0x235055(0x11b)](this[_0x235055(0x1d3)],SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),JSON['stringify'](Array[_0x235055(0x213)](this['_componentsState'][_0x235055(0x214)]())));}}class ProjectManager{static [a0_0x2cdf9a(0x124)];['_stage'];get[a0_0x2cdf9a(0xb8)](){const _0x25c00a=a0_0x2cdf9a;if(!this[_0x25c00a(0x219)])throw new Error('Stage\x20not\x20found');return this['_stage'];}constructor(){}static['getInstance'](){const _0x69d954=a0_0x2cdf9a;return!ProjectManager[_0x69d954(0x124)]&&(ProjectManager[_0x69d954(0x124)]=new ProjectManager()),ProjectManager[_0x69d954(0x124)];}async[a0_0x2cdf9a(0x198)](_0x1c3926){const _0x1a671b=a0_0x2cdf9a,_0x3a559d=node_path['join'](_0x1c3926,SYSTEM_FOLDER,STAGE_FOLDER_NAME);await promises['rm'](_0x3a559d,{'recursive':!![],'force':!![]}),await promises['mkdir'](_0x3a559d,{'recursive':!![]});const _0x1726e8=await this[_0x1a671b(0x146)](_0x1c3926),_0x22032a=await this[_0x1a671b(0x12a)](_0x1c3926),_0x58cbdd=await this[_0x1a671b(0x15a)](_0x1c3926);this[_0x1a671b(0x219)]=new Stage({'projectPath':_0x1c3926,'stagePath':_0x3a559d,'config':_0x1726e8,'branchState':_0x22032a,'componentsState':_0x58cbdd});}async[a0_0x2cdf9a(0xba)](){await this['stage']['apply']();}async[a0_0x2cdf9a(0x156)](){const _0x514ae8=a0_0x2cdf9a;await this[_0x514ae8(0xb8)][_0x514ae8(0xb9)]();}async[a0_0x2cdf9a(0x105)]({config:_0x221fb8}){const _0x581bb4=a0_0x2cdf9a,_0x4ab3cf=new InitProjectAction({'stage':this[_0x581bb4(0xb8)],'config':_0x221fb8});await _0x4ab3cf['execute']();}[a0_0x2cdf9a(0x243)](_0x756be1){const _0x4b910f=a0_0x2cdf9a;this[_0x4b910f(0xb8)][_0x4b910f(0x165)](_0x756be1);}async[a0_0x2cdf9a(0x147)](_0x51ae8f){const _0x2e0ee3=a0_0x2cdf9a,_0x259504=new SaveComponentAction({'stage':this[_0x2e0ee3(0xb8)]});await _0x259504[_0x2e0ee3(0x20c)](_0x51ae8f);}async['findChanges'](){const _0x1766d9=a0_0x2cdf9a,_0x5c3275=new FindChangesAction({'stage':this[_0x1766d9(0xb8)]});return _0x5c3275[_0x1766d9(0x20c)]();}async[a0_0x2cdf9a(0x13c)](_0x1e8e10){const _0x12daa0=a0_0x2cdf9a,_0x231508=new CompareWithRemoteBranchAction({..._0x1e8e10,'stage':this[_0x12daa0(0xb8)]});return _0x231508[_0x12daa0(0x20c)]();}async[a0_0x2cdf9a(0x146)](_0x5c5479){const _0x3be1a4=a0_0x2cdf9a,_0x49560a=node_path['join'](_0x5c5479,SYSTEM_FOLDER,CONFIG_FILE_NAME),_0x1ac47=await FileUtils[_0x3be1a4(0x1c0)](_0x49560a);if(!_0x1ac47)return INITIAL_CONFIG;const _0x4c3535=await promises['readFile'](_0x49560a);return JSON[_0x3be1a4(0x14f)](_0x4c3535[_0x3be1a4(0x20a)]());}async[a0_0x2cdf9a(0x12a)](_0x1f96d2){const _0x53d55d=a0_0x2cdf9a,_0x519ae5=node_path[_0x53d55d(0x11b)](_0x1f96d2,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),_0x46aa2a=await FileUtils[_0x53d55d(0x1c0)](_0x519ae5);if(!_0x46aa2a)return INITIAL_BRANCH_STATE;const _0x2111f1=await promises[_0x53d55d(0x13b)](_0x519ae5);return JSON[_0x53d55d(0x14f)](_0x2111f1[_0x53d55d(0x20a)]());}async[a0_0x2cdf9a(0x15a)](_0x47e4d7){const _0x5478f0=a0_0x2cdf9a,_0x29054a=node_path[_0x5478f0(0x11b)](_0x47e4d7,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),_0xda8053=await FileUtils['isFileExists'](_0x29054a);if(!_0xda8053)return[];const _0x2be539=await promises[_0x5478f0(0x13b)](_0x29054a);return JSON[_0x5478f0(0x14f)](_0x2be539[_0x5478f0(0x20a)]());}async[a0_0x2cdf9a(0x249)](_0x3a2083){const _0x1d449d=a0_0x2cdf9a,_0x286fa8=[node_path[_0x1d449d(0x11b)](_0x3a2083,SYSTEM_FOLDER,CONFIG_FILE_NAME),node_path['join'](_0x3a2083,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),node_path['join'](_0x3a2083,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),node_path['join'](_0x3a2083,SFDX_PROJECT_FILE_NAME)];for(const _0x5b6ff9 of _0x286fa8){const _0x261eeb=await FileUtils[_0x1d449d(0x1c0)](_0x5b6ff9);if(!_0x261eeb)return![];}return!![];}async[a0_0x2cdf9a(0x154)](_0x55d01f,_0x45ff93){const _0x2bab74=a0_0x2cdf9a,_0x45f17c=new ConfigSetAction({'stage':this[_0x2bab74(0xb8)]});await _0x45f17c[_0x2bab74(0x20c)]({'name':_0x55d01f,'value':_0x45ff93});}async[a0_0x2cdf9a(0x142)](_0x1395fc){const _0x3d53d5=a0_0x2cdf9a;this[_0x3d53d5(0xb8)][_0x3d53d5(0x142)](_0x1395fc);}['updateComponentState'](_0x40879a){const _0x396d7d=a0_0x2cdf9a;return this[_0x396d7d(0xb8)][_0x396d7d(0x18b)](_0x40879a);}async[a0_0x2cdf9a(0x1f9)](_0x2cd9e3){const _0x12b318=a0_0x2cdf9a;await this[_0x12b318(0xb8)][_0x12b318(0x1f9)](_0x2cd9e3);}[a0_0x2cdf9a(0x14a)](_0x511edd){const _0x5f5d57=a0_0x2cdf9a;this[_0x5f5d57(0xb8)][_0x5f5d57(0xd6)]=_0x511edd;}}class ReadlineUtils{static async['askString'](_0x3d9090){const _0xec8f33=a0_0x2cdf9a,_0x2d7642=readline[_0xec8f33(0x110)]({'input':process[_0xec8f33(0x1ea)],'output':process['stdout']}),_0x22af8d=await _0x2d7642[_0xec8f33(0x19a)](_0x3d9090);return _0x2d7642[_0xec8f33(0x204)](),_0x22af8d;}}const INFO_COLOR_INDEX='4',WARN_COLOR_INDEX='3',ERROR_COLOR_INDEX='1';class Logger{[a0_0x2cdf9a(0xf1)];[a0_0x2cdf9a(0xc0)];[a0_0x2cdf9a(0x1ba)];[a0_0x2cdf9a(0x195)];constructor({isJson:_0x2b0fd9}){const _0x3b562f=a0_0x2cdf9a;this[_0x3b562f(0xf1)]=_0x2b0fd9,debug[_0x3b562f(0xdd)]=console[_0x3b562f(0xdd)][_0x3b562f(0x171)](console),debug[_0x3b562f(0x24a)](ROOT_NAME+':*'),this['infoDebug']=debug(ROOT_NAME+':INFO'),this[_0x3b562f(0xc0)][_0x3b562f(0x227)]=INFO_COLOR_INDEX,this[_0x3b562f(0x1ba)]=debug(ROOT_NAME+_0x3b562f(0x1cf)),this[_0x3b562f(0x1ba)][_0x3b562f(0x227)]=WARN_COLOR_INDEX,this[_0x3b562f(0x195)]=debug(ROOT_NAME+':ERROR'),this['errorDebug'][_0x3b562f(0x227)]=ERROR_COLOR_INDEX;}[a0_0x2cdf9a(0x217)](_0xbfa9d6){!this['isJson']&&this['infoDebug'](_0xbfa9d6);}[a0_0x2cdf9a(0x19e)](_0x47de9f){const _0x215135=a0_0x2cdf9a;!this[_0x215135(0xf1)]&&this['warnDebug'](_0x47de9f);}[a0_0x2cdf9a(0x1ae)](_0x55b0da){const _0xf68ec0=a0_0x2cdf9a;!this[_0xf68ec0(0xf1)]&&this[_0xf68ec0(0x195)](_0x55b0da);}}class BaseCommand{[a0_0x2cdf9a(0x207)];get[a0_0x2cdf9a(0x183)](){const _0x3541cd=a0_0x2cdf9a;if(!this[_0x3541cd(0x207)])throw new Error('Logger\x20not\x20found');return this[_0x3541cd(0x207)];}[a0_0x2cdf9a(0x1f6)](_0x4288c0){const _0x2ff8d8=a0_0x2cdf9a,_0x45bdcf=new commander[(_0x2ff8d8(0x20f))]()['name'](this[_0x2ff8d8(0x23f)])[_0x2ff8d8(0x17e)](this['description']);for(const {name:_0x4f7ca2,description:_0x45a976,defaultValue:_0x348020}of this[_0x2ff8d8(0xdf)]){_0x45bdcf[_0x2ff8d8(0x1dd)](_0x4f7ca2,_0x45a976,_0x348020);}for(const {flags:_0x5daabd,description:_0x590ea2,defaultValue:_0x29c758}of this[_0x2ff8d8(0x1b1)]){_0x45bdcf[_0x2ff8d8(0x112)](_0x5daabd,_0x590ea2,_0x29c758);}_0x45bdcf['action'](async(..._0x2676bb)=>{const _0x99fde9=_0x2ff8d8,_0x5f615d=this['isJson'](_0x2676bb);this['_logger']=new Logger({'isJson':_0x5f615d});try{const _0x13057a=await this[_0x99fde9(0x20c)](_0x2676bb);_0x13057a['report'](_0x5f615d);}catch(_0x509202){_0x509202 instanceof Error&&this[_0x99fde9(0x183)][_0x99fde9(0x1ae)](_0x509202['message']);throw _0x509202;}}),_0x4288c0['addCommand'](_0x45bdcf);}}class BaseReporter{[a0_0x2cdf9a(0x18f)];get['success'](){return this['_success'];}constructor(_0x57fc68){const _0x32a3c9=a0_0x2cdf9a;this[_0x32a3c9(0x18f)]=_0x57fc68[_0x32a3c9(0x1ad)];}[a0_0x2cdf9a(0x1fc)](_0x3f704d){const _0x102255=a0_0x2cdf9a,_0x1112c0=this['buildReport']();_0x3f704d?this[_0x102255(0x14b)](_0x1112c0):this['print'](_0x1112c0);}[a0_0x2cdf9a(0x14b)](_0x1ee6c3){const _0x278fc3=a0_0x2cdf9a,_0x22e38e=JSON[_0x278fc3(0x192)](_0x1ee6c3,null,0x2);console['log'](_0x22e38e);}}class FailReporter extends BaseReporter{[a0_0x2cdf9a(0x1be)];constructor({failMessage:_0x34b891}){const _0x3596e9=a0_0x2cdf9a;super({'success':![]}),this[_0x3596e9(0x1be)]=_0x34b891;}['buildReport'](){const _0x202be4=a0_0x2cdf9a;return{'success':this[_0x202be4(0x1ad)],'failMessage':this[_0x202be4(0x1be)]};}[a0_0x2cdf9a(0x150)](_0xb7f9fd){const _0x492d46=a0_0x2cdf9a,_0x21ce17=[[_0x492d46(0x14e)],[_0xb7f9fd['failMessage']]];console[_0x492d46(0xdd)](table[_0x492d46(0x221)](_0x21ce17,{'columns':[{'width':0x64}]}));}}class CheckoutReporter extends BaseReporter{[a0_0x2cdf9a(0x16d)];['changes'];constructor({currentBranch:_0x503703,changes:_0x337fc7}){const _0x1a4a33=a0_0x2cdf9a;super({'success':!![]}),this[_0x1a4a33(0x16d)]=_0x503703,this[_0x1a4a33(0xfa)]=_0x337fc7;}['buildReport'](){const _0x6759d9=a0_0x2cdf9a;return{'success':this[_0x6759d9(0x1ad)],'targetBranch':this[_0x6759d9(0x16d)],'changes':this[_0x6759d9(0xfa)]};}[a0_0x2cdf9a(0x150)](_0x5eee0f){const _0x5538e7=a0_0x2cdf9a;console[_0x5538e7(0xdd)](_0x5538e7(0xfd)+this[_0x5538e7(0x16d)][_0x5538e7(0x127)]+'\x0a'),console[_0x5538e7(0xdd)](_0x5538e7(0x245));const _0x4942b4=[[_0x5538e7(0xfc),_0x5538e7(0x1b3),_0x5538e7(0x20e),_0x5538e7(0x16c)]];for(const {changeType:_0x28b5dc,name:_0x5a30ce,type:_0x4d5257,paths:_0x19dff5}of _0x5eee0f['changes']){_0x4942b4[_0x5538e7(0x10e)]([_0x28b5dc,_0x5a30ce,_0x4d5257,_0x19dff5?.[_0x5538e7(0x11b)]('\x0a')||'']);}console['log'](table['table'](_0x4942b4,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class BaseHandler{}class TargetBranchExistHandler extends BaseHandler{[a0_0x2cdf9a(0xbf)];[a0_0x2cdf9a(0x1b5)];[a0_0x2cdf9a(0x215)];[a0_0x2cdf9a(0x183)];[a0_0x2cdf9a(0x205)]=[];constructor(_0x5e42ee){const _0x49a0a9=a0_0x2cdf9a;super(),this[_0x49a0a9(0xbf)]=_0x5e42ee[_0x49a0a9(0xbf)],this[_0x49a0a9(0x1b5)]=_0x5e42ee[_0x49a0a9(0x1b5)],this[_0x49a0a9(0x215)]=_0x5e42ee[_0x49a0a9(0x215)],this[_0x49a0a9(0x183)]=_0x5e42ee['logger'];}async[a0_0x2cdf9a(0x10a)](){const _0x38ead1=a0_0x2cdf9a,_0x310701=await this[_0x38ead1(0x138)]();if(_0x310701)return new FailReporter({'failMessage':_0x38ead1(0x1b4)});return this['logger']['info'](_0x38ead1(0x1ff)),this['logger'][_0x38ead1(0x217)](_0x38ead1(0x114)),await this['retrieveDifference'](),this[_0x38ead1(0x183)][_0x38ead1(0x217)](_0x38ead1(0x1a4)),new CheckoutReporter({'currentBranch':{'id':this[_0x38ead1(0x215)]['id'],'name':this[_0x38ead1(0x215)][_0x38ead1(0x127)],'headCommitId':this[_0x38ead1(0x215)][_0x38ead1(0x134)]},'changes':this[_0x38ead1(0x205)]});}async['areChanges'](){const _0x40556d=a0_0x2cdf9a,_0x3f242d=await this[_0x40556d(0xbf)][_0x40556d(0xde)]();return!!_0x3f242d[_0x40556d(0xc7)];}async[a0_0x2cdf9a(0x13a)](){const _0x512f09=a0_0x2cdf9a,{devopsUrl:_0x34d5f9,accessToken:_0x49e3a2}=this[_0x512f09(0x1b5)],_0x25df72=await this['manager']['compareWithRemoteBranch']({'devopsUrl':_0x34d5f9,'accessToken':_0x49e3a2,'targetBranchId':this['targetBranch']['id'],'targetCommitId':this['targetBranch']['headCommitId']});for(const {id:_0x545b96,name:_0x5bddd7,type:_0x213aae,changeType:_0x2f90fc}of _0x25df72){if(!_0x545b96){if(_0x2f90fc!==ChangeType['DELETE'])throw new Error(_0x512f09(0xcb));await this[_0x512f09(0xbf)][_0x512f09(0x147)]({'name':_0x5bddd7,'type':_0x213aae,'changeType':_0x2f90fc}),this['componentChanges'][_0x512f09(0x10e)]({'changeType':_0x2f90fc,'name':_0x5bddd7,'type':_0x213aae});continue;}const _0x5510f5=await ApiService['retrieveComponentById']({'devopsUrl':_0x34d5f9,'accessToken':_0x49e3a2,'componentId':_0x545b96});if(!_0x5510f5[_0x512f09(0x1c3)])throw new Error(_0x512f09(0x1db)+_0x5510f5['name']+_0x512f09(0xe8)+_0x5510f5[_0x512f09(0xd5)]+_0x512f09(0x172));await this[_0x512f09(0xbf)][_0x512f09(0x147)]({'name':_0x5bddd7,'type':_0x213aae,'changeType':_0x2f90fc,'component':{..._0x5510f5,'fHash':_0x5510f5[_0x512f09(0x1c3)]}}),this[_0x512f09(0x205)][_0x512f09(0x10e)]({'changeType':_0x2f90fc,'name':_0x5bddd7,'type':_0x213aae,'paths':_0x5510f5[_0x512f09(0xe6)][_0x512f09(0xf3)](_0x3d70c6=>_0x3d70c6['path'])});}this[_0x512f09(0xbf)][_0x512f09(0x243)](this[_0x512f09(0x215)]);}}class TargetBranchNotFoundHandler extends BaseHandler{[a0_0x2cdf9a(0x1d3)];[a0_0x2cdf9a(0xbf)];[a0_0x2cdf9a(0x1b5)];[a0_0x2cdf9a(0x17c)];[a0_0x2cdf9a(0x183)];constructor(_0x91401a){const _0x31a7d1=a0_0x2cdf9a;super(),this['projectPath']=_0x91401a[_0x31a7d1(0x1d3)],this['manager']=_0x91401a[_0x31a7d1(0xbf)],this[_0x31a7d1(0x1b5)]=_0x91401a[_0x31a7d1(0x1b5)],this[_0x31a7d1(0x17c)]=_0x91401a['targetBranchName'],this[_0x31a7d1(0x183)]=_0x91401a[_0x31a7d1(0x183)];}async['handle'](){const _0x4c3b28=a0_0x2cdf9a;this['logger']['info']('Creation\x20new\x20branch\x20started');const {id:_0x54df37}=await this[_0x4c3b28(0xbf)][_0x4c3b28(0x12a)](this[_0x4c3b28(0x1d3)]);if(!_0x54df37)return new FailReporter({'failMessage':'To\x20create\x20a\x20new\x20branch\x20a\x20branch\x20should\x20be\x20selected.\x20Checkout\x20on\x20any\x20existing\x20branch'});const _0x2b535d=await ApiService[_0x4c3b28(0xed)]({'accessToken':this['credentials'][_0x4c3b28(0xbd)],'devopsUrl':this['credentials'][_0x4c3b28(0x143)],'name':this[_0x4c3b28(0x17c)],'parentId':_0x54df37});return this['manager']['saveBranchState'](_0x2b535d),this['manager'][_0x4c3b28(0x14a)](![]),this[_0x4c3b28(0x183)][_0x4c3b28(0x217)]('Creation\x20new\x20branch\x20completed'),new CheckoutReporter({'currentBranch':_0x2b535d,'changes':[]});}}function a0_0x21da(_0x6a94f3,_0x2261f9){const _0x9c5978=a0_0x173a();return a0_0x21da=function(_0x269aa1,_0x433cef){_0x269aa1=_0x269aa1-0xb6;let _0x173a8e=_0x9c5978[_0x269aa1];return _0x173a8e;},a0_0x21da(_0x6a94f3,_0x2261f9);}class HandlerFactory{static['create'](_0x482c3b){const _0x389d17=a0_0x2cdf9a;if(_0x482c3b[_0x389d17(0x215)])return new TargetBranchExistHandler({..._0x482c3b,'targetBranch':_0x482c3b[_0x389d17(0x215)]});if(!_0x482c3b[_0x389d17(0x215)])return new TargetBranchNotFoundHandler(_0x482c3b);throw new Error(_0x389d17(0x128));}}class CheckoutCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x1c5);['description']=a0_0x2cdf9a(0x102);[a0_0x2cdf9a(0xdf)]=[];['options']=[{'flags':'-b,\x20--branch\x20<string>','description':a0_0x2cdf9a(0xd0)},{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];[a0_0x2cdf9a(0x1d3)]=process[a0_0x2cdf9a(0x1dc)]();['manager']=ProjectManager[a0_0x2cdf9a(0x1f2)]();async[a0_0x2cdf9a(0x20c)]([{branch:_0x33ae20}]){const _0x469665=a0_0x2cdf9a,_0x308da1=await this['getBranchName'](_0x33ae20);this[_0x469665(0x183)][_0x469665(0x217)](_0x469665(0x1a9)+_0x308da1+_0x469665(0x120));const _0x37e98f=await this[_0x469665(0xbf)]['isInitialized'](this[_0x469665(0x1d3)]);if(!_0x37e98f)return this[_0x469665(0x183)][_0x469665(0x19e)](_0x469665(0x211)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0x37f3cc=await this[_0x469665(0x109)](),_0xa59a91=await ApiService[_0x469665(0x202)](_0x37f3cc);await this[_0x469665(0xbf)]['initStage'](this[_0x469665(0x1d3)]);try{const _0xd45523=await ApiService[_0x469665(0x1b6)]({'devopsUrl':_0xa59a91[_0x469665(0x143)],'accessToken':_0xa59a91['accessToken'],'branchName':_0x308da1}),_0x3f3f3c=HandlerFactory['create']({'projectPath':this[_0x469665(0x1d3)],'manager':this['manager'],'credentials':_0xa59a91,'targetBranch':_0xd45523,'targetBranchName':_0x308da1,'logger':this['logger']}),_0x1a2126=await _0x3f3f3c['handle']();return _0x1a2126[_0x469665(0x1ad)]?(await this['manager'][_0x469665(0xba)](),this[_0x469665(0x183)]['info'](_0x469665(0x1a9)+_0x308da1+_0x469665(0xe3))):await this[_0x469665(0xbf)]['abortStage'](),_0x1a2126;}catch(_0x21fbe0){await this[_0x469665(0xbf)][_0x469665(0x156)]();throw _0x21fbe0;}}[a0_0x2cdf9a(0xf1)]([{json:_0x38e44b}]){return _0x38e44b;}async[a0_0x2cdf9a(0x229)](_0x12e6a2){const _0x285bc4=a0_0x2cdf9a;if(_0x12e6a2)return _0x12e6a2;return ReadlineUtils[_0x285bc4(0x226)]('Enter\x20a\x20branch\x20name:\x20');}async[a0_0x2cdf9a(0x109)](){const _0x1e9177=a0_0x2cdf9a,{credentialsAlias:_0x2bf60e}=await this[_0x1e9177(0xbf)]['readConfig'](this[_0x1e9177(0x1d3)]);if(!_0x2bf60e)throw new Error(_0x1e9177(0xc6));if(typeof _0x2bf60e!==_0x1e9177(0x10c))throw new Error(_0x1e9177(0x1a1));return _0x2bf60e;}}class CloneReporter extends BaseReporter{[a0_0x2cdf9a(0x1d3)];[a0_0x2cdf9a(0xe2)];constructor({projectPath:_0x3c099c,components:_0x381f29}){const _0x436255=a0_0x2cdf9a;super({'success':!![]}),this[_0x436255(0x1d3)]=_0x3c099c,this[_0x436255(0xe2)]=_0x381f29;}[a0_0x2cdf9a(0xca)](){const _0x1e56bd=a0_0x2cdf9a;return{'success':this[_0x1e56bd(0x1ad)],'projectPath':this['projectPath'],'components':this[_0x1e56bd(0xe2)]};}[a0_0x2cdf9a(0x150)](_0x305780){const _0x2af171=a0_0x2cdf9a;console['log'](_0x2af171(0xd1));const _0x545e51=[['Project\x20Path'],[_0x305780[_0x2af171(0x1d3)]]];console['log'](table[_0x2af171(0x221)](_0x545e51,{'columns':[{'width':0x28}]})),console[_0x2af171(0xdd)](_0x2af171(0x194));const _0x102eb2=[['Name',_0x2af171(0x20e),_0x2af171(0x16c)]];for(const {name:_0x14f8cf,type:_0x1e2dc7,paths:_0x58ce19}of _0x305780[_0x2af171(0xe2)]){_0x102eb2[_0x2af171(0x10e)]([_0x14f8cf,_0x1e2dc7,_0x58ce19[_0x2af171(0x11b)]('\x0a')]);}console[_0x2af171(0xdd)](table[_0x2af171(0x221)](_0x102eb2,{'columns':[{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CloneCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x122);[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0x1e8);['arguments']=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':'-n,\x20--name\x20<string>','description':a0_0x2cdf9a(0x247)},{'flags':a0_0x2cdf9a(0xc1),'description':'Alias\x20of\x20credentials\x20which\x20will\x20be\x20used\x20to\x20retrieve\x20your\x20components\x20from\x20devops.','defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();[a0_0x2cdf9a(0x166)]=[];['_credentials'];get['credentials'](){const _0x1fed3d=a0_0x2cdf9a;if(!this[_0x1fed3d(0xb7)])throw new Error(_0x1fed3d(0xb6));return this[_0x1fed3d(0xb7)];}async[a0_0x2cdf9a(0x20c)]([_0x30eba6]){const _0x49405e=a0_0x2cdf9a;this['logger'][_0x49405e(0x217)](_0x49405e(0x218)),this[_0x49405e(0xb7)]=await ApiService['getCredentials'](_0x30eba6['alias']);const _0x356605=await this['buildProjectPath'](_0x30eba6['name']);this[_0x49405e(0x183)]['info'](_0x49405e(0x23c));const _0x458406=await this[_0x49405e(0xbf)][_0x49405e(0x249)](_0x356605);if(_0x458406)return this['logger'][_0x49405e(0x19e)](_0x49405e(0x193)),new FailReporter({'failMessage':_0x49405e(0x193)});await this[_0x49405e(0xbf)]['initStage'](_0x356605);try{return await this[_0x49405e(0xbf)][_0x49405e(0x105)]({'config':{'credentialsAlias':_0x30eba6[_0x49405e(0x196)]}}),this[_0x49405e(0x183)][_0x49405e(0x217)]('Project\x20initialization\x20completed'),await this['retrieve'](),await this[_0x49405e(0xbf)][_0x49405e(0xba)](),this['logger'][_0x49405e(0x217)](_0x49405e(0xd8)),new CloneReporter({'projectPath':_0x356605,'components':this[_0x49405e(0x166)]});}catch(_0x2195d6){await this[_0x49405e(0xbf)][_0x49405e(0x156)]();throw _0x2195d6;}}[a0_0x2cdf9a(0xf1)]([{json:_0x484fdf}]){return _0x484fdf;}async['retrieve'](){const _0x272b41=a0_0x2cdf9a;this[_0x272b41(0x183)]['info'](_0x272b41(0x114));const {accessToken:_0x11c84f,devopsUrl:_0x29805c}=this[_0x272b41(0x1b5)],_0xffb496=await ApiService['getDefaultBranch']({'devopsUrl':_0x29805c,'accessToken':_0x11c84f});this[_0x272b41(0xbf)][_0x272b41(0x243)](_0xffb496);for await(const _0x119374 of ApiService[_0x272b41(0x1d2)]({'devopsUrl':_0x29805c,'accessToken':_0x11c84f,'branchId':_0xffb496['id'],'commitId':_0xffb496[_0x272b41(0x134)]})){if(!_0x119374[_0x272b41(0x1c3)])throw new Error(_0x119374[_0x272b41(0x127)]+_0x272b41(0x20b)+_0x119374[_0x272b41(0xd5)]+_0x272b41(0xf2));await this[_0x272b41(0xbf)][_0x272b41(0x147)]({'name':_0x119374['name'],'type':_0x119374['type'],'changeType':ChangeType['CREATE'],'component':{..._0x119374,'fHash':_0x119374[_0x272b41(0x1c3)]}}),this[_0x272b41(0x166)]['push']({'name':_0x119374[_0x272b41(0x127)],'type':_0x119374[_0x272b41(0xd5)],'paths':_0x119374[_0x272b41(0xe6)][_0x272b41(0xf3)](_0x1dcf3b=>_0x1dcf3b['path'])});}this[_0x272b41(0x183)][_0x272b41(0x217)]('Retrieve\x20components\x20completed');}async[a0_0x2cdf9a(0xdb)](_0x57c6b8){const _0x1b133e=a0_0x2cdf9a;if(_0x57c6b8)return node_path['join'](process[_0x1b133e(0x1dc)](),_0x57c6b8);const _0x2f0251=await ReadlineUtils[_0x1b133e(0x226)](_0x1b133e(0x1af));return node_path[_0x1b133e(0x11b)](process[_0x1b133e(0x1dc)](),_0x2f0251);}}class CommitReporter extends BaseReporter{[a0_0x2cdf9a(0xfa)];constructor({changes:_0x5e8182}){super({'success':!![]}),this['changes']=_0x5e8182;}[a0_0x2cdf9a(0xca)](){const _0x4ceede=a0_0x2cdf9a;return{'success':this[_0x4ceede(0x1ad)],'changes':this['changes']};}[a0_0x2cdf9a(0x150)](_0x363f9f){const _0x2cde79=a0_0x2cdf9a;console[_0x2cde79(0xdd)](_0x2cde79(0xcf));const _0x34b7c1=[[_0x2cde79(0xfc),_0x2cde79(0x1b3),_0x2cde79(0x20e),_0x2cde79(0x16c)]];for(const {changeType:_0x577cc6,name:_0x4044fd,type:_0x59f72f,paths:_0x2b97c7}of _0x363f9f['changes']){_0x34b7c1['push']([_0x577cc6,_0x4044fd,_0x59f72f,_0x2b97c7?.[_0x2cde79(0x11b)]('\x0a')||'']);}console[_0x2cde79(0xdd)](table[_0x2cde79(0x221)](_0x34b7c1,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CommitCommand extends BaseCommand{['commandName']=a0_0x2cdf9a(0x228);[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0xcd);['arguments']=[];['options']=[{'flags':'-m,\x20--message\x20<string>','description':a0_0x2cdf9a(0x1a7)},{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];[a0_0x2cdf9a(0x1d3)]=process['cwd']();[a0_0x2cdf9a(0xbf)]=ProjectManager['getInstance']();[a0_0x2cdf9a(0x205)]=[];[a0_0x2cdf9a(0xb7)];[a0_0x2cdf9a(0x145)];['_localHeadCommit'];[a0_0x2cdf9a(0x240)];get[a0_0x2cdf9a(0x1b5)](){const _0x35fd70=a0_0x2cdf9a;if(!this[_0x35fd70(0xb7)])throw new Error(_0x35fd70(0xb6));return this[_0x35fd70(0xb7)];}get[a0_0x2cdf9a(0x1fb)](){const _0x3f0ab1=a0_0x2cdf9a;if(!this['_branchId'])throw new Error(_0x3f0ab1(0x13e));return this['_branchId'];}get[a0_0x2cdf9a(0x108)](){if(!this['_localHeadCommit'])throw new Error('Local\x20head\x20commit\x20id\x20not\x20found');return this['_localHeadCommit'];}get[a0_0x2cdf9a(0xfa)](){const _0x424046=a0_0x2cdf9a;if(!this[_0x424046(0x240)])throw new Error(_0x424046(0x14d));return this[_0x424046(0x240)];}async[a0_0x2cdf9a(0x20c)]([_0x1cd5b3]){const _0x5d4b54=a0_0x2cdf9a;this[_0x5d4b54(0x183)][_0x5d4b54(0x217)]('Commit\x20started');const _0x35f42b=await this[_0x5d4b54(0xbf)][_0x5d4b54(0x249)](this[_0x5d4b54(0x1d3)]);if(!_0x35f42b)return this['logger'][_0x5d4b54(0x19e)](_0x5d4b54(0x211)),new FailReporter({'failMessage':_0x5d4b54(0x211)});const _0x18b9c4=await this[_0x5d4b54(0x1e7)](_0x1cd5b3['message']);await this[_0x5d4b54(0x23a)](),await this[_0x5d4b54(0x202)]();const _0x1852cb=await this['areRemoteChanges']();if(_0x1852cb)return this[_0x5d4b54(0x183)][_0x5d4b54(0x19e)](_0x5d4b54(0x169)),new FailReporter({'failMessage':_0x5d4b54(0x169)});await this[_0x5d4b54(0xbf)][_0x5d4b54(0x198)](this[_0x5d4b54(0x1d3)]);try{this[_0x5d4b54(0x240)]=await this[_0x5d4b54(0xbf)][_0x5d4b54(0xde)]();if(!this[_0x5d4b54(0xfa)][_0x5d4b54(0xc7)])return this[_0x5d4b54(0x183)]['warn'](_0x5d4b54(0x208)),new FailReporter({'failMessage':_0x5d4b54(0x208)});return await this['findAndCommitChanges'](_0x18b9c4),await this[_0x5d4b54(0xbf)][_0x5d4b54(0xba)](),this['logger'][_0x5d4b54(0x217)](_0x5d4b54(0x113)),new CommitReporter({'changes':this[_0x5d4b54(0x205)]});}catch(_0x1b53f7){await this[_0x5d4b54(0xbf)]['abortStage']();throw _0x1b53f7;}}[a0_0x2cdf9a(0xf1)]([{json:_0x2fde4c}]){return _0x2fde4c;}async['getMessage'](_0x31d35d){const _0x4ed549=a0_0x2cdf9a;if(_0x31d35d)return _0x31d35d;const _0x12e2ac=await ReadlineUtils['askString'](_0x4ed549(0x21a));return _0x12e2ac;}async[a0_0x2cdf9a(0x202)](){const _0x405612=a0_0x2cdf9a,{credentialsAlias:_0x3c4bcc}=await this['manager']['readConfig'](this['projectPath']);if(!_0x3c4bcc)throw new Error('Credentials\x20alias\x20is\x20not\x20configured');if(typeof _0x3c4bcc!==_0x405612(0x10c))throw new Error(_0x405612(0x1a1));this[_0x405612(0xb7)]=await ApiService[_0x405612(0x202)](_0x3c4bcc);}async['getBranchState'](){const _0x1fe3e7=a0_0x2cdf9a,{id:_0x120a36,headCommitId:_0x33ba08}=await this[_0x1fe3e7(0xbf)][_0x1fe3e7(0x12a)](this[_0x1fe3e7(0x1d3)]);this['_branchId']=_0x120a36||void 0x0,this[_0x1fe3e7(0x21f)]=_0x33ba08||void 0x0;}async[a0_0x2cdf9a(0x11e)](){const _0x5329cb=a0_0x2cdf9a,{headCommitId:_0x20f41c}=await ApiService['getBranchById']({'accessToken':this['credentials'][_0x5329cb(0xbd)],'devopsUrl':this[_0x5329cb(0x1b5)]['devopsUrl'],'branchId':this[_0x5329cb(0x1fb)]});return this[_0x5329cb(0x108)]!==_0x20f41c;}async[a0_0x2cdf9a(0x162)](_0x42b595){const _0x194d8f=a0_0x2cdf9a;this[_0x194d8f(0x183)][_0x194d8f(0x217)]('Detecting\x20changes\x20started');const _0x52efa8=await ApiService[_0x194d8f(0x203)]({'accessToken':this['credentials'][_0x194d8f(0xbd)],'devopsUrl':this['credentials'][_0x194d8f(0x143)]}),_0x241950={'accessToken':this[_0x194d8f(0x1b5)][_0x194d8f(0xbd)],'devopsUrl':this[_0x194d8f(0x1b5)][_0x194d8f(0x143)],'message':_0x42b595,'branchId':this[_0x194d8f(0x1fb)],'components':[],'userName':_0x52efa8[_0x194d8f(0x144)]+'\x20'+_0x52efa8['lastName']};for(const _0x4dd40c of this[_0x194d8f(0xfa)]){const _0x57aa46=await this[_0x194d8f(0xbf)]['updateComponentState'](_0x4dd40c),_0x433ea8=this['convertToLocalComponent'](_0x57aa46[_0x194d8f(0x127)],_0x57aa46[_0x194d8f(0xd5)],_0x57aa46?.[_0x194d8f(0x123)]||[]);_0x241950[_0x194d8f(0xe2)]['push'](_0x433ea8),this[_0x194d8f(0x205)][_0x194d8f(0x10e)](_0x57aa46);}this[_0x194d8f(0x183)]['info'](_0x194d8f(0xf4)+this['changes'][_0x194d8f(0xc7)]+_0x194d8f(0x209)),await ApiService[_0x194d8f(0x228)](_0x241950);const _0x26cee2=await ApiService[_0x194d8f(0x12f)]({'accessToken':this[_0x194d8f(0x1b5)]['accessToken'],'devopsUrl':this[_0x194d8f(0x1b5)][_0x194d8f(0x143)],'branchId':this[_0x194d8f(0x1fb)]});this[_0x194d8f(0xbf)][_0x194d8f(0x243)](_0x26cee2);}[a0_0x2cdf9a(0x160)](_0x229d7a,_0x33dd97,_0x37d4e2){const _0x5ff3b4=a0_0x2cdf9a,_0x538957={'name':_0x229d7a,'type':_0x33dd97,'files':[]};for(const _0x9f8d1d of _0x37d4e2){const _0x4141be=_0x9f8d1d[_0x5ff3b4(0x15e)](path['sep'])[_0x5ff3b4(0x246)](0x3)[_0x5ff3b4(0x11b)]('/'),_0x3e18fd=path[_0x5ff3b4(0x11b)](this[_0x5ff3b4(0x1d3)],_0x9f8d1d);_0x538957['files'][_0x5ff3b4(0x10e)]({'path':_0x4141be,'localPath':_0x3e18fd});}return _0x538957;}}class ConfigSetReporter extends BaseReporter{[a0_0x2cdf9a(0x248)];['value'];constructor({configName:_0x1abc77,value:_0x2ae062}){const _0x1fa724=a0_0x2cdf9a;super({'success':!![]}),this['configName']=_0x1abc77,this[_0x1fa724(0x131)]=_0x2ae062;}['buildReport'](){const _0x3f538f=a0_0x2cdf9a;return{'success':this[_0x3f538f(0x1ad)],'configName':this[_0x3f538f(0x248)],'value':this[_0x3f538f(0x131)]};}[a0_0x2cdf9a(0x150)](_0x448135){const _0xa61bd4=a0_0x2cdf9a,_0x246880=[[_0xa61bd4(0x140),_0xa61bd4(0x232)],[_0x448135[_0xa61bd4(0x248)],_0x448135[_0xa61bd4(0x131)]]];console[_0xa61bd4(0xdd)](table['table'](_0x246880));}}const ALLOWED_VALUES=[ConfigName[a0_0x2cdf9a(0x189)]+'(string)'];class ConfigSetCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0xf9);['description']=a0_0x2cdf9a(0x233);['arguments']=[{'name':'<config-name>','description':a0_0x2cdf9a(0x242)+ALLOWED_VALUES[a0_0x2cdf9a(0x11b)](',\x20')+'.'},{'name':a0_0x2cdf9a(0x158),'description':'Config\x20value'}];['options']=[{'flags':a0_0x2cdf9a(0x190),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();async['execute']([_0x516d36,_0x2cb48d]){const _0x282fe6=a0_0x2cdf9a;this[_0x282fe6(0x183)][_0x282fe6(0x217)]('Config\x20set\x20started');const _0x522301=process[_0x282fe6(0x1dc)](),_0x5815ce=await this[_0x282fe6(0xbf)][_0x282fe6(0x249)](_0x522301);if(!_0x5815ce)return this[_0x282fe6(0x183)][_0x282fe6(0x19e)](_0x282fe6(0x211)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});await this['manager'][_0x282fe6(0x198)](_0x522301);try{return await this[_0x282fe6(0xbf)]['setConfig'](_0x516d36,_0x2cb48d),await this[_0x282fe6(0xbf)]['applyStage'](),this['logger'][_0x282fe6(0x217)]('Config\x20set\x20completed'),new ConfigSetReporter({'configName':_0x516d36,'value':_0x2cb48d});}catch(_0x3b59d0){await this['manager'][_0x282fe6(0x156)]();throw _0x3b59d0;}}[a0_0x2cdf9a(0xf1)]([,,{json:_0x53ab9e}]){return _0x53ab9e;}}class ConfigUnsetReporter extends BaseReporter{['configName'];constructor(_0x3ebf0f){const _0x59c338=a0_0x2cdf9a;super({'success':!![]}),this[_0x59c338(0x248)]=_0x3ebf0f[_0x59c338(0x248)];}['buildReport'](){const _0x25f748=a0_0x2cdf9a;return{'success':!![],'configName':this[_0x25f748(0x248)],'value':null};}[a0_0x2cdf9a(0x150)](_0x2a488f){const _0x2597f9=a0_0x2cdf9a,_0x5117b2=[[_0x2597f9(0x140),_0x2597f9(0x232)],[_0x2a488f['configName'],_0x2a488f[_0x2597f9(0x131)]||'NULL']];console[_0x2597f9(0xdd)](table['table'](_0x5117b2));}}class ConfigUnset extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x20d);[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0x187);[a0_0x2cdf9a(0xdf)]=[{'name':a0_0x2cdf9a(0x1e5),'description':'Config\x20name.\x20Allowed\x20values:\x20'+Object[a0_0x2cdf9a(0x214)](ConfigName)[a0_0x2cdf9a(0x11b)](',\x20')+'.'}];['options']=[{'flags':'--json','description':a0_0x2cdf9a(0x186),'defaultValue':![]}];[a0_0x2cdf9a(0x1d3)]=process[a0_0x2cdf9a(0x1dc)]();['manager']=ProjectManager['getInstance']();async['execute']([_0x30b290]){const _0x544aac=a0_0x2cdf9a;this['logger'][_0x544aac(0x217)](_0x544aac(0x1cd));const _0x4e6180=await this[_0x544aac(0xbf)][_0x544aac(0x249)](this[_0x544aac(0x1d3)]);if(!_0x4e6180)return this[_0x544aac(0x183)][_0x544aac(0x19e)]('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':_0x544aac(0x211)});await this[_0x544aac(0xbf)][_0x544aac(0x198)](this['projectPath']);try{return await this[_0x544aac(0xbf)][_0x544aac(0x142)](_0x30b290),await this[_0x544aac(0xbf)][_0x544aac(0xba)](),this['logger']['info']('Config\x20set\x20completed'),new ConfigUnsetReporter({'configName':_0x30b290});}catch(_0x5e33a4){await this[_0x544aac(0xbf)]['abortStage']();throw _0x5e33a4;}}[a0_0x2cdf9a(0xf1)]([,{json:_0x119270}]){return _0x119270;}}class InitReporter extends BaseReporter{[a0_0x2cdf9a(0x1d3)];constructor({projectPath:_0x2dfd61}){const _0x4e6565=a0_0x2cdf9a;super({'success':!![]}),this[_0x4e6565(0x1d3)]=_0x2dfd61;}['buildReport'](){const _0xcdc2ef=a0_0x2cdf9a;return{'success':this[_0xcdc2ef(0x1ad)],'projectPath':this['projectPath']};}['print'](_0x4896ed){const _0x3e3b64=a0_0x2cdf9a,_0x4900bf=[['Project\x20Path'],[_0x4896ed[_0x3e3b64(0x1d3)]]];console[_0x3e3b64(0xdd)](table[_0x3e3b64(0x221)](_0x4900bf,{'columns':[{'width':0x28}]}));}}class InitCommand extends BaseCommand{['commandName']=a0_0x2cdf9a(0x212);['description']=a0_0x2cdf9a(0x238);[a0_0x2cdf9a(0xdf)]=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':'-n,\x20--name\x20<string>','description':a0_0x2cdf9a(0x247)},{'flags':a0_0x2cdf9a(0x190),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();async['execute']([_0x3898d6]){const _0x46d5ae=a0_0x2cdf9a;this['logger'][_0x46d5ae(0x217)](_0x46d5ae(0x23c));const _0x35676c=await this[_0x46d5ae(0xdb)](_0x3898d6[_0x46d5ae(0x127)]),_0x5e291=await this[_0x46d5ae(0xbf)][_0x46d5ae(0x249)](_0x35676c);if(_0x5e291)return this[_0x46d5ae(0x183)][_0x46d5ae(0x19e)](_0x46d5ae(0x193)),new FailReporter({'failMessage':_0x46d5ae(0x193)});await this[_0x46d5ae(0xbf)][_0x46d5ae(0x198)](_0x35676c);try{return await this['manager'][_0x46d5ae(0x105)]({}),await this[_0x46d5ae(0xbf)][_0x46d5ae(0xba)](),this[_0x46d5ae(0x183)][_0x46d5ae(0x217)]('Project\x20initialization\x20completed'),new InitReporter({'projectPath':_0x35676c});}catch(_0x101783){await this[_0x46d5ae(0xbf)][_0x46d5ae(0x156)]();throw _0x101783;}}['isJson']([{json:_0x298a70}]){return _0x298a70;}async['buildProjectPath'](_0x4503bf){const _0x51ab2f=a0_0x2cdf9a;if(_0x4503bf)return node_path[_0x51ab2f(0x11b)](process['cwd'](),_0x4503bf);const _0x2ab5f6=await ReadlineUtils[_0x51ab2f(0x226)](_0x51ab2f(0x1af));return node_path[_0x51ab2f(0x11b)](process[_0x51ab2f(0x1dc)](),_0x2ab5f6);}}class ListBranchesReporter extends BaseReporter{[a0_0x2cdf9a(0x167)];constructor(_0x3bcfb3){const _0x59ee6a=a0_0x2cdf9a;super({'success':!![]}),this[_0x59ee6a(0x167)]=_0x3bcfb3['branches'];}['buildReport'](){const _0x469d6c=a0_0x2cdf9a;return{'success':this[_0x469d6c(0x1ad)],'branches':this['branches']};}[a0_0x2cdf9a(0x150)](_0x4ceea0){const _0x1e2cee=a0_0x2cdf9a,_0x24f3c0=[[_0x1e2cee(0x174)]];for(const _0x2e7605 of _0x4ceea0['branches']){_0x24f3c0[_0x1e2cee(0x10e)]([_0x2e7605]);}console[_0x1e2cee(0xdd)](table[_0x1e2cee(0x221)](_0x24f3c0,{'columns':[{'width':0x1e}]}));}}class ListBranchesCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x1f8);[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0x1f7);['arguments']=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];[a0_0x2cdf9a(0x1d3)]=process['cwd']();[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();async['execute'](){const _0x1c9659=a0_0x2cdf9a;this[_0x1c9659(0x183)][_0x1c9659(0x217)](_0x1c9659(0x23d));const _0x3fdc6e=await this[_0x1c9659(0xbf)][_0x1c9659(0x249)](this[_0x1c9659(0x1d3)]);if(!_0x3fdc6e)return this['logger'][_0x1c9659(0x19e)](_0x1c9659(0x211)),new FailReporter({'failMessage':_0x1c9659(0x211)});const _0x53bcd6=await this[_0x1c9659(0x109)](),{accessToken:_0x349bdf,devopsUrl:_0x1465a4}=await ApiService[_0x1c9659(0x202)](_0x53bcd6),_0x45b138=await ApiService[_0x1c9659(0x1fa)]({'accessToken':_0x349bdf,'devopsUrl':_0x1465a4});return this['logger'][_0x1c9659(0x217)](_0x1c9659(0xea)),new ListBranchesReporter({'branches':_0x45b138[_0x1c9659(0xf3)](_0x132463=>_0x132463[_0x1c9659(0x127)])});}[a0_0x2cdf9a(0xf1)]([{json:_0x457db0}]){return _0x457db0;}async[a0_0x2cdf9a(0x109)](){const _0x35a7e7=a0_0x2cdf9a,{credentialsAlias:_0x25d4e5}=await this[_0x35a7e7(0xbf)][_0x35a7e7(0x146)](this['projectPath']);if(!_0x25d4e5)throw new Error(_0x35a7e7(0xc6));if(typeof _0x25d4e5!=='string')throw new Error('Invalid\x20credentials\x20type');return _0x25d4e5;}}class ListCredentialsReporter extends BaseReporter{[a0_0x2cdf9a(0x1b5)];constructor(_0x2b3bf2){const _0x2a8e66=a0_0x2cdf9a;super({'success':!![]}),this['credentials']=_0x2b3bf2[_0x2a8e66(0x1b5)];}[a0_0x2cdf9a(0xca)](){const _0x243939=a0_0x2cdf9a;return{'success':this[_0x243939(0x1ad)],'credentials':this[_0x243939(0x1b5)]};}[a0_0x2cdf9a(0x150)](_0xb8834f){const _0x1ca6ed=a0_0x2cdf9a,_0x4f27f=[[_0x1ca6ed(0x244),'Global\x20Settings\x20Url',_0x1ca6ed(0x16a)]];for(const {alias:_0x2865f4,globalSettingsUrl:_0x55cf6c,devopsUrl:_0x1f8b2e}of _0xb8834f[_0x1ca6ed(0x1b5)]){_0x4f27f[_0x1ca6ed(0x10e)]([_0x2865f4,_0x55cf6c,_0x1f8b2e||_0x1ca6ed(0xf8)]);}console['log'](table[_0x1ca6ed(0x221)](_0x4f27f));}}class ListCredentialsCommand extends BaseCommand{['commandName']=a0_0x2cdf9a(0x22f);['description']='Display\x20all\x20authorized\x20credentials.';[a0_0x2cdf9a(0xdf)]=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':'--json','description':a0_0x2cdf9a(0x186),'defaultValue':![]}];async[a0_0x2cdf9a(0x20c)](){const _0x38442e=a0_0x2cdf9a;this[_0x38442e(0x183)]['info'](_0x38442e(0x1bd));const _0x250952=await CredentialsManager[_0x38442e(0x201)]();return this['logger']['info'](_0x38442e(0x12c)),new ListCredentialsReporter({'credentials':_0x250952[_0x38442e(0xf3)](({alias:_0x1826c8,globalSettingsUrl:_0x354c8f,devopsUrl:_0x315819})=>({'alias':_0x1826c8,'globalSettingsUrl':_0x354c8f,'devopsUrl':_0x315819}))});}[a0_0x2cdf9a(0xf1)]([{json:_0x34a539}]){return _0x34a539;}}class LoginAction{constructor(_0x121781){this['accessToken']=_0x121781;}async[a0_0x2cdf9a(0x20c)](){const _0x59c2f9=a0_0x2cdf9a;try{const _0x5f08e1=JSON[_0x59c2f9(0x14f)](Buffer[_0x59c2f9(0x213)](this[_0x59c2f9(0xbd)],_0x59c2f9(0x173))['toString'](_0x59c2f9(0x179))),_0x571005=await axios[_0x59c2f9(0x231)]('/api/v1/links',{'headers':{'authorization':_0x59c2f9(0x11a)+this[_0x59c2f9(0xbd)]},'baseURL':_0x5f08e1['applicationUrl']})['then'](({data:_0x547a5c})=>new Map(_0x547a5c['map'](_0xb323e6=>[_0xb323e6[_0x59c2f9(0x127)],_0xb323e6[_0x59c2f9(0x12e)]]))),_0x14c680={'globalSettingsUrl':_0x5f08e1['applicationUrl']};for(const [_0x453234,_0x54b38d]of _0x571005['entries']()){_0x453234===_0x59c2f9(0x23e)&&(_0x14c680[_0x59c2f9(0x143)]=_0x54b38d);}return _0x14c680;}catch(_0x371698){if(axios[_0x59c2f9(0x23b)](_0x371698))throw Error(_0x371698[_0x59c2f9(0x11c)]?.[_0x59c2f9(0x164)][_0x59c2f9(0x1b7)]||_0x371698[_0x59c2f9(0x11c)]?.[_0x59c2f9(0x11f)]||_0x371698[_0x59c2f9(0x1b7)],{'cause':_0x371698});throw _0x371698;}}}class GlobalSettingsService{static async[a0_0x2cdf9a(0x121)]({accessToken:_0x243b18}){const _0x163b4e=a0_0x2cdf9a,_0x36e52d=new LoginAction(_0x243b18);return _0x36e52d[_0x163b4e(0x20c)]();}}class LoginReporter extends BaseReporter{['alias'];[a0_0x2cdf9a(0x153)];[a0_0x2cdf9a(0x143)];constructor({alias:_0x3a2b41,globalSettingsUrl:_0x4f965e,devopsUrl:_0x2983f9}){const _0x563276=a0_0x2cdf9a;super({'success':!![]}),this[_0x563276(0x196)]=_0x3a2b41,this[_0x563276(0x153)]=_0x4f965e,this[_0x563276(0x143)]=_0x2983f9;}[a0_0x2cdf9a(0xca)](){const _0x56af28=a0_0x2cdf9a;return{'success':this[_0x56af28(0x1ad)],'alias':this['alias'],'globalSettingsUrl':this[_0x56af28(0x153)],'devopsUrl':this[_0x56af28(0x143)]};}[a0_0x2cdf9a(0x150)](_0x4f7008){const _0x43ee3e=a0_0x2cdf9a,_0x52c738=[['Alias',_0x43ee3e(0x236),_0x43ee3e(0x16a)],[_0x4f7008[_0x43ee3e(0x196)],_0x4f7008['globalSettingsUrl'],_0x4f7008['devopsUrl']||_0x43ee3e(0xf8)]];console[_0x43ee3e(0xdd)](table[_0x43ee3e(0x221)](_0x52c738));}}class LoginCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x121);[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0x225);['arguments']=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':a0_0x2cdf9a(0xc1),'description':'Alias\x20which\x20saved\x20credentials\x20will\x20be\x20accessed\x20with.','defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x2cdf9a(0x139),'description':a0_0x2cdf9a(0x1e9)+ROOT_NAME+a0_0x2cdf9a(0x206)},{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];async['execute']([_0x5a68eb]){const _0x5396a5=a0_0x2cdf9a;this['logger'][_0x5396a5(0x217)]('Login\x20started');const _0x3a425b=await this[_0x5396a5(0x101)](_0x5a68eb[_0x5396a5(0xf6)]),_0x5b9ea3=await GlobalSettingsService[_0x5396a5(0x121)]({'accessToken':_0x3a425b});return await CredentialsManager[_0x5396a5(0x1b0)]({'alias':_0x5a68eb[_0x5396a5(0x196)],'accessToken':_0x3a425b,'globalSettingsUrl':_0x5b9ea3[_0x5396a5(0x153)],'devopsUrl':_0x5b9ea3[_0x5396a5(0x143)]}),this['logger'][_0x5396a5(0x217)](_0x5396a5(0x1c2)+_0x5a68eb[_0x5396a5(0x196)]+'\x22'),new LoginReporter({'alias':_0x5a68eb[_0x5396a5(0x196)],'globalSettingsUrl':_0x5b9ea3['globalSettingsUrl'],'devopsUrl':_0x5b9ea3[_0x5396a5(0x143)]});}[a0_0x2cdf9a(0xf1)]([{json:_0x3b873f}]){return _0x3b873f;}async[a0_0x2cdf9a(0x101)](_0x328869){const _0x2efed1=a0_0x2cdf9a;if(_0x328869)return _0x328869;const _0x2e4e51=await ReadlineUtils[_0x2efed1(0x226)]('Enter\x20api\x20token:\x20');return _0x2e4e51;}}const DELETED_STATUS=a0_0x2cdf9a(0x1d6);class LogoutReporter extends BaseReporter{[a0_0x2cdf9a(0x196)];constructor({alias:_0x255de3}){super({'success':!![]}),this['alias']=_0x255de3;}['buildReport'](){const _0x14c6ca=a0_0x2cdf9a;return{'success':this[_0x14c6ca(0x1ad)],'alias':this[_0x14c6ca(0x196)],'status':DELETED_STATUS};}[a0_0x2cdf9a(0x150)](_0x4ab271){const _0x34f335=a0_0x2cdf9a,_0x23e901=[['Alias',_0x34f335(0xff)],[_0x4ab271[_0x34f335(0x196)],_0x4ab271[_0x34f335(0xee)]]];console[_0x34f335(0xdd)](table[_0x34f335(0x221)](_0x23e901));}}class LogoutCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x104);['description']='Delete\x20saved\x20credentials.';[a0_0x2cdf9a(0xdf)]=[];['options']=[{'flags':'-a,\x20--alias\x20<string>','description':'Saved\x20credentials\x20alias.','defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x2cdf9a(0x190),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];async[a0_0x2cdf9a(0x20c)]([_0x4e4d6]){const _0xc43a34=a0_0x2cdf9a;return this[_0xc43a34(0x183)][_0xc43a34(0x217)](_0xc43a34(0x237)),await CredentialsManager[_0xc43a34(0x1e4)]({'alias':_0x4e4d6['alias']}),this[_0xc43a34(0x183)][_0xc43a34(0x217)](_0xc43a34(0x182)),new LogoutReporter({'alias':_0x4e4d6[_0xc43a34(0x196)]});}[a0_0x2cdf9a(0xf1)]([{json:_0x419cc0}]){return _0x419cc0;}}class PullReporter extends BaseReporter{[a0_0x2cdf9a(0xfa)];constructor({changes:_0x1b5dac}){const _0x3b788b=a0_0x2cdf9a;super({'success':!![]}),this[_0x3b788b(0xfa)]=_0x1b5dac;}[a0_0x2cdf9a(0xca)](){const _0x54a133=a0_0x2cdf9a;return{'success':this['success'],'changes':this[_0x54a133(0xfa)]};}[a0_0x2cdf9a(0x150)](_0x20d002){const _0x26c1f5=a0_0x2cdf9a;console['log'](_0x26c1f5(0x1d8));const _0x416a5f=[[_0x26c1f5(0xfc),_0x26c1f5(0x1b3),_0x26c1f5(0x20e),_0x26c1f5(0x16c)]];for(const {changeType:_0x3a5c7c,name:_0x506282,type:_0xb36f0e,paths:_0x4a0fa5}of _0x20d002[_0x26c1f5(0xfa)]){_0x416a5f[_0x26c1f5(0x10e)]([_0x3a5c7c,_0x506282,_0xb36f0e,_0x4a0fa5?.[_0x26c1f5(0x11b)]('\x0a')||'']);}console[_0x26c1f5(0xdd)](table[_0x26c1f5(0x221)](_0x416a5f,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class PullCommand extends BaseCommand{['commandName']='pull';[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0x14c);[a0_0x2cdf9a(0xdf)]=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];['projectPath']=process[a0_0x2cdf9a(0x1dc)]();[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();[a0_0x2cdf9a(0x205)]=[];['_credentials'];get['credentials'](){const _0x29a62f=a0_0x2cdf9a;if(!this['_credentials'])throw new Error(_0x29a62f(0xb6));return this[_0x29a62f(0xb7)];}async[a0_0x2cdf9a(0x20c)](){const _0xb968bb=a0_0x2cdf9a;this[_0xb968bb(0x183)][_0xb968bb(0x217)]('Pulling\x20latest\x20updates\x20started');const _0x3eb1fe=await this[_0xb968bb(0xbf)]['isInitialized'](this[_0xb968bb(0x1d3)]);if(!_0x3eb1fe)return this[_0xb968bb(0x183)]['warn']('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0x277485=await this[_0xb968bb(0x109)]();this['_credentials']=await ApiService[_0xb968bb(0x202)](_0x277485);const {id:_0x23e233,headCommitId:_0x17e953}=await this[_0xb968bb(0xbf)][_0xb968bb(0x12a)](this[_0xb968bb(0x1d3)]);if(!_0x23e233)return this[_0xb968bb(0x183)][_0xb968bb(0x19e)](_0xb968bb(0x1ee)),new FailReporter({'failMessage':_0xb968bb(0x1ee)});const _0x5e2d0e=await ApiService['getBranchById']({'accessToken':this['credentials']['accessToken'],'devopsUrl':this[_0xb968bb(0x1b5)][_0xb968bb(0x143)],'branchId':_0x23e233});if(_0x17e953===_0x5e2d0e[_0xb968bb(0x134)])return new PullReporter({'changes':this[_0xb968bb(0x205)]});await this['manager']['initStage'](this[_0xb968bb(0x1d3)]);try{this['logger']['info'](_0xb968bb(0x177));const _0xd38a12=await this[_0xb968bb(0x138)]();if(_0xd38a12)return this[_0xb968bb(0x183)][_0xb968bb(0x19e)](_0xb968bb(0x1b4)),await this[_0xb968bb(0xbf)][_0xb968bb(0x156)](),new FailReporter({'failMessage':_0xb968bb(0x1b4)});return this['logger']['info'](_0xb968bb(0x1ff)),this['logger'][_0xb968bb(0x217)](_0xb968bb(0x114)),await this['retrieveDifference'](_0x5e2d0e),this[_0xb968bb(0x183)][_0xb968bb(0x217)](_0xb968bb(0x1a4)),await this[_0xb968bb(0xbf)]['applyStage'](),this['logger'][_0xb968bb(0x217)](_0xb968bb(0xfb)),new PullReporter({'changes':this[_0xb968bb(0x205)]});}catch(_0x37cef6){await this[_0xb968bb(0xbf)][_0xb968bb(0x156)]();throw _0x37cef6;}}[a0_0x2cdf9a(0xf1)]([{json:_0x160840}]){return _0x160840;}async['getCredentialsAlias'](){const _0x495000=a0_0x2cdf9a,{credentialsAlias:_0xd4eba7}=await this['manager'][_0x495000(0x146)](this[_0x495000(0x1d3)]);if(!_0xd4eba7)throw new Error(_0x495000(0xc6));if(typeof _0xd4eba7!==_0x495000(0x10c))throw new Error(_0x495000(0x1a1));return _0xd4eba7;}async[a0_0x2cdf9a(0x138)](){const _0x439c4e=a0_0x2cdf9a,_0x5d6ecc=await this[_0x439c4e(0xbf)][_0x439c4e(0xde)]();return!!_0x5d6ecc[_0x439c4e(0xc7)];}async[a0_0x2cdf9a(0x13a)](_0x4616eb){const _0x5cb18f=a0_0x2cdf9a,{devopsUrl:_0x489249,accessToken:_0x2b5534}=this[_0x5cb18f(0x1b5)],_0x158e12=await this[_0x5cb18f(0xbf)][_0x5cb18f(0x13c)]({'devopsUrl':_0x489249,'accessToken':_0x2b5534,'targetBranchId':_0x4616eb['id'],'targetCommitId':_0x4616eb['headCommitId']});for(const {id:_0x3097b8,name:_0x5f537a,type:_0x14cacd,changeType:_0x4e88cc}of _0x158e12){if(!_0x3097b8){if(_0x4e88cc!==ChangeType[_0x5cb18f(0x1df)])throw new Error(_0x5cb18f(0xcb));await this[_0x5cb18f(0xbf)][_0x5cb18f(0x147)]({'name':_0x5f537a,'type':_0x14cacd,'changeType':_0x4e88cc}),this[_0x5cb18f(0x205)][_0x5cb18f(0x10e)]({'changeType':_0x4e88cc,'name':_0x5f537a,'type':_0x14cacd});continue;}const _0x161ad4=await ApiService[_0x5cb18f(0x1c7)]({'devopsUrl':_0x489249,'accessToken':_0x2b5534,'componentId':_0x3097b8});if(!_0x161ad4[_0x5cb18f(0x1c3)])throw new Error(_0x5cb18f(0x1db)+_0x161ad4[_0x5cb18f(0x127)]+_0x5cb18f(0xe8)+_0x161ad4[_0x5cb18f(0xd5)]+'\x22\x20not\x20found');await this['manager'][_0x5cb18f(0x147)]({'name':_0x5f537a,'type':_0x14cacd,'changeType':_0x4e88cc,'component':{..._0x161ad4,'fHash':_0x161ad4[_0x5cb18f(0x1c3)]}}),this['componentChanges'][_0x5cb18f(0x10e)]({'changeType':_0x4e88cc,'name':_0x5f537a,'type':_0x14cacd,'paths':_0x161ad4[_0x5cb18f(0xe6)][_0x5cb18f(0xf3)](_0x375e52=>_0x375e52[_0x5cb18f(0x16e)])});}await this[_0x5cb18f(0xbf)]['saveBranchState'](_0x4616eb);}}class RollbackReporter extends BaseReporter{[a0_0x2cdf9a(0x1ef)];constructor({fileChanges:_0x4c2d73}){const _0x28342a=a0_0x2cdf9a;super({'success':!![]}),this[_0x28342a(0x1ef)]=_0x4c2d73;}['buildReport'](){const _0x453e47=a0_0x2cdf9a;return{'success':this['success'],'fileChanges':this[_0x453e47(0x1ef)]};}[a0_0x2cdf9a(0x150)](_0x68072f){const _0x42abd0=a0_0x2cdf9a;console['log'](_0x42abd0(0x116));const _0x308e95=[[_0x42abd0(0xfc),_0x42abd0(0x1bf)]];for(const {changeType:_0x2c4c7e,path:_0x3d8cea}of _0x68072f[_0x42abd0(0x1ef)]){_0x308e95[_0x42abd0(0x10e)]([_0x2c4c7e,_0x3d8cea]);}console[_0x42abd0(0xdd)](table[_0x42abd0(0x221)](_0x308e95,{'columns':[{},{'width':0x28}]}));}}class RollbackCommand extends BaseCommand{['commandName']=a0_0x2cdf9a(0x176);[a0_0x2cdf9a(0x17e)]='Roll\x20back\x20your\x20branch\x20state\x20to\x20last\x20committed\x20one.';[a0_0x2cdf9a(0xdf)]=[];['options']=[{'flags':'--json','description':a0_0x2cdf9a(0x186),'defaultValue':![]}];['projectPath']=process[a0_0x2cdf9a(0x1dc)]();[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();['rollbackTypes']=new Map();[a0_0x2cdf9a(0x19c)]=[];[a0_0x2cdf9a(0x185)]=[];[a0_0x2cdf9a(0xb7)];[a0_0x2cdf9a(0x145)];['_headCommitId'];get[a0_0x2cdf9a(0x1b5)](){const _0x4096ed=a0_0x2cdf9a;if(!this[_0x4096ed(0xb7)])throw new Error(_0x4096ed(0xb6));return this[_0x4096ed(0xb7)];}get[a0_0x2cdf9a(0x1fb)](){const _0x2d8ad4=a0_0x2cdf9a;if(!this[_0x2d8ad4(0x145)])throw new Error(_0x2d8ad4(0x13e));return this[_0x2d8ad4(0x145)];}get[a0_0x2cdf9a(0x134)](){const _0x20c624=a0_0x2cdf9a;if(!this[_0x20c624(0x1b9)])throw new Error(_0x20c624(0x1bc));return this[_0x20c624(0x1b9)];}async['execute'](){const _0x46129c=a0_0x2cdf9a;this[_0x46129c(0x183)]['info'](_0x46129c(0xe4));const _0x49291a=await this[_0x46129c(0xbf)]['isInitialized'](this[_0x46129c(0x1d3)]);if(!_0x49291a)return this[_0x46129c(0x183)][_0x46129c(0x19e)](_0x46129c(0x211)),new FailReporter({'failMessage':_0x46129c(0x211)});const _0x1eb860=await this['getCredentialsAlias']();this[_0x46129c(0xb7)]=await ApiService[_0x46129c(0x202)](_0x1eb860),await this[_0x46129c(0x23a)](),await this[_0x46129c(0xbf)][_0x46129c(0x198)](this[_0x46129c(0x1d3)]);try{this['logger']['info'](_0x46129c(0x13d)),await this['defineRollbackTypes']();if(!this[_0x46129c(0x1cb)][_0x46129c(0x1da)])return this[_0x46129c(0x183)][_0x46129c(0x217)](_0x46129c(0x1f0)),new RollbackReporter({'fileChanges':this[_0x46129c(0x185)]});return this[_0x46129c(0x183)][_0x46129c(0x217)](_0x46129c(0x10b)+this[_0x46129c(0x1cb)][_0x46129c(0x1da)]+_0x46129c(0x1b2)),this[_0x46129c(0x183)][_0x46129c(0x217)](_0x46129c(0x15b)),await this[_0x46129c(0x176)](),this[_0x46129c(0x183)]['info'](_0x46129c(0x1d4)),await this[_0x46129c(0xbf)][_0x46129c(0xba)](),this[_0x46129c(0x183)][_0x46129c(0x217)](_0x46129c(0x1fd)),new RollbackReporter({'fileChanges':this['filesChanges']});}catch(_0x249c6b){await this[_0x46129c(0xbf)][_0x46129c(0x156)]();throw _0x249c6b;}}['isJson']([{json:_0x2cfb97}]){return _0x2cfb97;}async[a0_0x2cdf9a(0x109)](){const _0x55215f=a0_0x2cdf9a,{credentialsAlias:_0x3491b5}=await this[_0x55215f(0xbf)]['readConfig'](this[_0x55215f(0x1d3)]);if(!_0x3491b5)throw new Error(_0x55215f(0xc6));if(typeof _0x3491b5!==_0x55215f(0x10c))throw new Error(_0x55215f(0x1a1));return _0x3491b5;}async[a0_0x2cdf9a(0x23a)](){const _0x4ebb08=a0_0x2cdf9a,{id:_0x47d734,headCommitId:_0x1d2b65}=await this['manager'][_0x4ebb08(0x12a)](this['projectPath']);if(!_0x47d734||!_0x1d2b65)throw new Error('A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first');this[_0x4ebb08(0x145)]=_0x47d734||void 0x0,this[_0x4ebb08(0x1b9)]=_0x1d2b65||void 0x0;}async[a0_0x2cdf9a(0x176)](){const _0x3c7080=a0_0x2cdf9a;if(this[_0x3c7080(0x19c)]['length'])for await(const {files:_0x41d55a}of ApiService[_0x3c7080(0x1d2)]({'devopsUrl':this['credentials'][_0x3c7080(0x143)],'accessToken':this[_0x3c7080(0x1b5)]['accessToken'],'branchId':this[_0x3c7080(0x1fb)],'commitId':this[_0x3c7080(0x134)],'components':this['componentsForRetrieve']})){await this['handleRestore'](_0x41d55a);}for(const [_0x4ab790,_0x387412]of this[_0x3c7080(0x1cb)][_0x3c7080(0x155)]()){if(_0x387412!==ChangeType['DELETE'])throw new Error(_0x3c7080(0xbc)+_0x4ab790+_0x3c7080(0x168));await this[_0x3c7080(0xbf)][_0x3c7080(0x1f9)]({'path':_0x4ab790,'changeType':_0x387412});}return{'success':!![]};}async[a0_0x2cdf9a(0x222)](){const _0x3a1f8f=a0_0x2cdf9a,_0x339c0c=await this[_0x3a1f8f(0xbf)][_0x3a1f8f(0xde)]();for(const {name:_0x34d815,type:_0x32fe3b,changes:_0x238023}of _0x339c0c){let _0x532a66=![];for(const {path:_0x4021b7,changeType:_0xbbb303}of _0x238023){let _0xed78fd;_0xbbb303===ChangeType[_0x3a1f8f(0x239)]?_0xed78fd=ChangeType[_0x3a1f8f(0x1df)]:(_0xed78fd=_0xbbb303===ChangeType[_0x3a1f8f(0x1df)]?ChangeType[_0x3a1f8f(0x239)]:ChangeType[_0x3a1f8f(0x199)],_0x532a66=!![]),this[_0x3a1f8f(0x1cb)][_0x3a1f8f(0x191)](_0x4021b7,_0xed78fd),this[_0x3a1f8f(0x185)]['push']({'changeType':_0xed78fd,'path':_0x4021b7});}_0x532a66&&this[_0x3a1f8f(0x19c)][_0x3a1f8f(0x10e)]({'name':_0x34d815,'type':_0x32fe3b});}}async[a0_0x2cdf9a(0x188)](_0x2b4f68){const _0xb30c4b=a0_0x2cdf9a;for(const {path:_0x5430ee,content:_0x76ff24}of _0x2b4f68){const _0x119dfe=path[_0xb30c4b(0x11b)](COMPONENT_PROJECT_PATH,_0x5430ee),_0x57745c=this[_0xb30c4b(0x1cb)][_0xb30c4b(0x231)](_0x119dfe);if(!_0x57745c)continue;await this['manager'][_0xb30c4b(0x1f9)]({'path':_0x119dfe,'content':_0x76ff24,'changeType':_0x57745c}),this['rollbackTypes']['delete'](_0x119dfe);}}}class StatusReporter extends BaseReporter{[a0_0x2cdf9a(0x130)];constructor({pendingChanges:_0x3ce7ed}){const _0x11e3d7=a0_0x2cdf9a;super({'success':!![]}),this[_0x11e3d7(0x130)]=_0x3ce7ed;}['buildReport'](){const _0x326f6c=a0_0x2cdf9a;return{'success':this[_0x326f6c(0x1ad)],'pendingChanges':this[_0x326f6c(0x130)]};}[a0_0x2cdf9a(0x150)](_0x5e6b16){const _0x15f2ac=a0_0x2cdf9a;console[_0x15f2ac(0xdd)](_0x15f2ac(0x17f));const _0x400d0e=[[_0x15f2ac(0xfc),'File']];for(const {changeType:_0x4827a9,path:_0x7c3206}of _0x5e6b16[_0x15f2ac(0x130)]){_0x400d0e[_0x15f2ac(0x10e)]([_0x4827a9,_0x7c3206]);}console[_0x15f2ac(0xdd)](table[_0x15f2ac(0x221)](_0x400d0e,{'columns':[{},{'width':0x28}]}));}}class StatusCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0xee);['description']=a0_0x2cdf9a(0x1e6);[a0_0x2cdf9a(0xdf)]=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];['projectPath']=process[a0_0x2cdf9a(0x1dc)]();[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();[a0_0x2cdf9a(0x130)]=[];async[a0_0x2cdf9a(0x20c)](){const _0x43419e=a0_0x2cdf9a;this[_0x43419e(0x183)]['info'](_0x43419e(0x13f));const _0x59e623=await this[_0x43419e(0xbf)][_0x43419e(0x249)](this[_0x43419e(0x1d3)]);if(!_0x59e623)return this[_0x43419e(0x183)][_0x43419e(0x19e)](_0x43419e(0x211)),new FailReporter({'failMessage':_0x43419e(0x211)});await this['manager'][_0x43419e(0x198)](this[_0x43419e(0x1d3)]);const _0x34895c=await this[_0x43419e(0xbf)][_0x43419e(0xde)]();for(const {changes:_0x109558}of _0x34895c){for(const {changeType:_0x26aa0f,path:_0x5c8b5b}of _0x109558){this[_0x43419e(0x130)][_0x43419e(0x10e)]({'changeType':_0x26aa0f,'path':_0x5c8b5b});}}return await this['manager'][_0x43419e(0x156)](),this[_0x43419e(0x183)][_0x43419e(0x217)](_0x43419e(0x129)),new StatusReporter({'pendingChanges':this[_0x43419e(0x130)]});}[a0_0x2cdf9a(0xf1)]([{json:_0x18e9a4}]){return _0x18e9a4;}}configurePathEnv();const ROOT_COMMANDS=[LoginCommand,LogoutCommand,ListCredentialsCommand],DEVOPS_COMMANDS=[InitCommand,CloneCommand,CheckoutCommand,ConfigSetCommand,ConfigUnset,PullCommand,CommitCommand,RollbackCommand,StatusCommand,ListBranchesCommand],root=new commander[(a0_0x2cdf9a(0x20f))]()[a0_0x2cdf9a(0x127)](ROOT_NAME)['description'](a0_0x2cdf9a(0x161)+ROOT_NAME+a0_0x2cdf9a(0x18d))[a0_0x2cdf9a(0xf0)](config[a0_0x2cdf9a(0xf0)]);for(const command of ROOT_COMMANDS){new command()[a0_0x2cdf9a(0x1f6)](root);}const devops=new commander[(a0_0x2cdf9a(0x20f))]()[a0_0x2cdf9a(0x127)](a0_0x2cdf9a(0xdc))[a0_0x2cdf9a(0x17e)](a0_0x2cdf9a(0x21c));for(const command of DEVOPS_COMMANDS){new command()[a0_0x2cdf9a(0x1f6)](devops);}root[a0_0x2cdf9a(0x141)](devops),root[a0_0x2cdf9a(0x14f)]();function configurePathEnv(){const _0x51154e=a0_0x2cdf9a,_0x3d0054=process['env'][_0x51154e(0x1c4)]?.[_0x51154e(0x15e)](node_path['delimiter']);if(!_0x3d0054)throw new Error(_0x51154e(0xe0));const _0x224807=node_path[_0x51154e(0x11b)](node_path[_0x51154e(0xda)](__dirname),_0x51154e(0x1d1),_0x51154e(0x119));_0x3d0054[_0x51154e(0x10e)](_0x224807),process[_0x51154e(0x136)][_0x51154e(0x1c4)]=_0x3d0054[_0x51154e(0x11b)](node_path[_0x51154e(0x21e)]);}function a0_0x173a(){const _0x4201c0=['Component\x20id\x20not\x20found\x20after\x20comparison','sep','Commit\x20local\x20changes\x20to\x20a\x20remote\x20branch\x20on\x20devops.','lastStageTimestamp','Committed\x20Components:','A\x20branch\x20name\x20which\x20you\x20checkout\x20on.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','Init\x20Result:','15970MmcsiQ','7QVlRgU','indexes','type','isUpdateStageTimestamp','updateSystemFiles','Cloning\x20completed','readdir','dirname','buildProjectPath','devops','log','findChanges','arguments','PATH\x20env\x20not\x20found','1265mDCERX','components','\x22\x20completed','Rolling\x20back\x20to\x20last\x20committed\x20state\x20started','all','files','/commits','\x22\x20of\x20type\x20\x22','deleteComponent','Listing\x20remote\x20branches\x20completed','applyCreateUpdate','node:fs/promises','createBranch','status','findIndex','version','isJson','\x20was\x20deleted','map','Detecting\x20changes\x20completed.\x20','indexOf','token','findDeletedAndUpdated','Not\x20Found','config-set','changes','Pulling\x20latest\x20updates\x20completed','Change\x20Type','Current\x20Branch:\x20','cleanUpEmptyFolders','Status','listComponentsGenerator','getAccessToken','Checkout\x20on\x20another\x20branch.\x20Checkout\x20command\x20retrieves\x20components\x20missing\x20locally.','then','logout','initProject','changeFile','credentials.json','localHeadCommit','getCredentialsAlias','handle','Looking\x20for\x20changes\x20completed.\x20','string','branchState','push','count','createInterface','_branchState','option','Commit\x20completed','Retrieve\x20components\x20started','targetCommitId','Rolled\x20Back\x20Changes:','find','update','.bin','Token\x20','join','response','getAllCredentials','areRemoteChanges','statusText','\x22\x20started','login','clone','paths','instance','Update','includes','name','Checkout\x20handler\x20not\x20found','Status\x20calculation\x20completed','readBranchState','componentsState','List\x20credentials\x20completed','catch','api','getBranchById','pendingChanges','value','search','5920212wnsmeX','headCommitId','isDirectory','env','stat','areChanges','-t,\x20--token\x20<string>','retrieveDifference','readFile','compareWithRemoteBranch','Looking\x20for\x20changes\x20started','Branch\x20id\x20not\x20found','Status\x20calculation\x20started','Config\x20Name','addCommand','unsetConfig','devopsUrl','firstName','_branchId','readConfig','saveComponent','Unknown\x20config\x20name:\x20','Credentials\x20with\x20alias\x20\x22','setIsUpdateStageTimestamp','printJson','Pull\x20latest\x20branch\x20commit\x20from\x20devops.','Changes\x20not\x20found','Fail\x20Message','parse','print','homedir','updateComponent','globalSettingsUrl','setConfig','entries','abortStage','3582FCqlpm','<value>','1180xwALSV','readComponentsState','Rollback\x20started','listComponents','access','split','Devops\x20url\x20not\x20found','convertToLocalComponent','CLI\x20for\x20work\x20with\x20','findAndCommitChanges','branchName','data','updateBranchState','retrievedComponents','branches','\x22\x20wasn\x27t\x20restored','Local\x20and\x20remote\x20head\x20commits\x20don\x27t\x20match.\x20Use\x20\x22flosum\x20devops\x20pull\x22\x20to\x20retrieve\x20latest\x20updates\x20from\x20devops','Devops\x20Url','W_OK','Files','currentBranch','path','commitDate','debug','bind','\x22\x20not\x20found','base64','Branch\x20Name','flosum','rollback','Checking\x20manual\x20changes\x20started','isDirectoryExists','utf-8','Component\x20','ROOT_COMMANDS','targetBranchName','mkdir','description','Pending\x20Changes:','filter','writeFile','Logout\x20completed','logger','R_OK','filesChanges','Applies\x20json\x20formatted\x20result.','Clear\x20project\x20config\x20property.','handleRestore','CREDENTIALS_ALIAS','sfdx-project.json','updateComponentState','fit/branches/','\x20services','branch-state.json','_success','--json','set','stringify','Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.','Retrieve\x20Result:','errorDebug','alias','14UqRiDC','initStage','UPDATE','question','Update:\x20Component\x20','componentsForRetrieve','getFolderFilePaths','warn','3450pJvVXw','changeType','Invalid\x20credentials\x20type','copyFile','3969972VDMHAc','Retrieve\x20components\x20completed','post','_stagePath','Commit\x20message.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','fit/branches','Checkout\x20on\x20\x22','total','.stage','Delete','success','error','Enter\x20project\x20name:\x20','save','options','\x20files\x20will\x20be\x20rolled\x20back','Name','Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed','credentials','getBranch','message','fit/file-versions/','_headCommitId','warnDebug','stagePath','Head\x20commit\x20id\x20not\x20found','List\x20credentials\x20started','failMessage','File','isFileExists','node:readline/promises','Login\x20successfully\x20completed.\x20You\x20credentials\x20are\x20saved\x20with\x20alias\x20\x22','fHash','PATH','checkout','createComponent','retrieveComponentById','rmdir','has','node:crypto','rollbackTypes','rows','Config\x20set\x20started','replace',':WARN','registerFileChange','node_modules','retrieveComponents','projectPath','Rollback\x20completed','node:path','Deleted','splice','Component\x20Updates:','getDefaultBranch','size','fHash\x20for\x20component\x20\x22','cwd','argument','\x22\x20already\x20exists','DELETE','commitId','Missing\x20content\x20for\x20not\x20Delete\x20change\x20type','digest','parentId','delete','<config-name>','Return\x20all\x20local\x20not\x20committed\x20changes.','getMessage','Initialize\x20salesforce\x20project\x20and\x20retrieve\x20\x22main\x22\x20branch\x20from\x20registered\x20devops\x20tenant.','Token\x20for\x20getting\x20access\x20to\x20','stdin','createHash','apply','1175rdUBjb','A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first','fileChanges','No\x20changes\x20for\x20rollback','auth/me','getInstance','_componentsState','trunc','force-app','register','List\x20all\x20remote\x20branches.','list-branches','addFileChange','listBranches','branchId','report','Rolling\x20back\x20to\x20last\x20committed\x20state\x20completed','userName','Checking\x20manual\x20changes\x20completed','26ztcvAo','list','getCredentials','getMe','close','componentChanges','\x20services.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','_logger','No\x20Local\x20Changes','\x20components\x20will\x20be\x20committed','toString','\x20of\x20type\x20','execute','config-unset','Type','Command','constants','Project\x20is\x20not\x20initialized','init','from','values','targetBranch','applyFileChanges','info','Cloning\x20started','_stage','Enter\x20commit\x20message:\x20','targetBranchId','Devops\x20commands','content','delimiter','_localHeadCommit','3381936QGTkNg','table','defineRollbackTypes','isFile','basename','Login\x20into\x20global\x20settings\x20and\x20retrieve\x20data\x20about\x20related\x20services.','askString','color','commit','getBranchName','scan','SfProjectScanner','_projectPath','_isUpdateStageTimestamp','components-state.json','list-credentials','handleFileChange','get','Value','Set\x20project\x20config.','applyDelete','getUpdatedComponentChanges','Global\x20Settings\x20Url','Logout\x20started','Create\x20salesforce\x20project\x20and\x20cli\x20system\x20files.','CREATE','getBranchState','isAxiosError','Project\x20initialization\x20started','Listing\x20remote\x20branches\x20started','DevOps','commandName','_changes','Stage\x20folder\x20not\x20found','Config\x20name.\x20Allowed\x20values:\x20','saveBranchState','Alias','Project\x20Updates:','slice','A\x20name\x20of\x20a\x20folder\x20where\x20a\x20project\x20will\x20be\x20stored.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','configName','isInitialized','enable','Credentials\x20not\x20found','_credentials','stage','abort','applyStage','config','File\x20\x22','accessToken','Create','manager','infoDebug','-a,\x20--alias\x20<string>','default','CLI','calculateComponentHash','flat','Credentials\x20alias\x20is\x20not\x20configured','length','2228oTNqUO','component','buildReport'];a0_0x173a=function(){return _0x4201c0;};return a0_0x173a();}exports['DEVOPS_COMMANDS']=DEVOPS_COMMANDS,exports[a0_0x2cdf9a(0x17b)]=ROOT_COMMANDS;
2
+ const a0_0x149e33=a0_0x2850;(function(_0x5dd80c,_0x5a5c54){const _0x33b1ba=a0_0x2850,_0x5addc7=_0x5dd80c();while(!![]){try{const _0x3849b6=parseInt(_0x33b1ba(0x252))/0x1*(parseInt(_0x33b1ba(0x24b))/0x2)+parseInt(_0x33b1ba(0x196))/0x3+parseInt(_0x33b1ba(0x170))/0x4+parseInt(_0x33b1ba(0x2cb))/0x5*(-parseInt(_0x33b1ba(0x199))/0x6)+parseInt(_0x33b1ba(0x1d5))/0x7*(parseInt(_0x33b1ba(0x22b))/0x8)+parseInt(_0x33b1ba(0x219))/0x9*(parseInt(_0x33b1ba(0x207))/0xa)+-parseInt(_0x33b1ba(0x262))/0xb;if(_0x3849b6===_0x5a5c54)break;else _0x5addc7['push'](_0x5addc7['shift']());}catch(_0x31025f){_0x5addc7['push'](_0x5addc7['shift']());}}}(a0_0x5dda,0xb3a50));const a0_0x34ec59=(function(){let _0x18bece=!![];return function(_0x34ebeb,_0x565d94){const _0x512d24=_0x18bece?function(){if(_0x565d94){const _0x27ae66=_0x565d94['apply'](_0x34ebeb,arguments);return _0x565d94=null,_0x27ae66;}}:function(){};return _0x18bece=![],_0x512d24;};}()),a0_0x4d58f7=a0_0x34ec59(this,function(){const _0x4e207c=a0_0x2850;return a0_0x4d58f7[_0x4e207c(0x20c)]()[_0x4e207c(0x1b9)](_0x4e207c(0x283))[_0x4e207c(0x20c)]()[_0x4e207c(0x1a8)](a0_0x4d58f7)[_0x4e207c(0x1b9)](_0x4e207c(0x283));});a0_0x4d58f7();'use strict';var node_path=require(a0_0x149e33(0x1e7)),commander=require(a0_0x149e33(0x2c6)),promises=require('node:fs/promises'),node_os=require(a0_0x149e33(0x183)),axios=require(a0_0x149e33(0x2de)),salesforce=require(a0_0x149e33(0x30a)),node_crypto=require(a0_0x149e33(0x263)),readline=require(a0_0x149e33(0x2f6)),debug=require(a0_0x149e33(0x19c)),table=require('table'),version='0.0.2-beta.0',config={'version':version};const ROOT_NAME=a0_0x149e33(0x2b8),DEFAULT_ALIAS_NAME='default',INTERNAL_ERROR='INTERNAL\x20ERROR';class FileUtils{static async['getFolderFilePaths'](_0x3d754e){const _0x2410b0=a0_0x149e33,_0x5141a9=await promises['readdir'](_0x3d754e,{'withFileTypes':!![]}),_0x3e3e65=[];for(const _0x448c22 of _0x5141a9){const _0x1d8f8f=node_path['join'](_0x3d754e,_0x448c22[_0x2410b0(0x25a)]);if(_0x448c22[_0x2410b0(0x18d)]()){const _0x36abaf=await FileUtils[_0x2410b0(0x233)](_0x1d8f8f);_0x3e3e65[_0x2410b0(0x200)](_0x36abaf);continue;}_0x3e3e65[_0x2410b0(0x200)](_0x1d8f8f);}return _0x3e3e65[_0x2410b0(0x1f0)]();}static async['cleanUpEmptyFolders'](_0x407a5e,_0x4ef154=!![]){const _0x21f8e8=a0_0x149e33,_0x51769a=await promises[_0x21f8e8(0x291)](_0x407a5e,{'withFileTypes':!![]});let _0x1cf067=!![];for(const _0x549b79 of _0x51769a){const _0x58642a=node_path[_0x21f8e8(0x19f)](_0x407a5e,_0x549b79['name']);if(_0x549b79['isDirectory']()){const _0x173058=await FileUtils[_0x21f8e8(0x17b)](_0x58642a);!_0x173058&&(_0x1cf067=![]);}else _0x1cf067=![];}return _0x4ef154&&_0x1cf067&&await promises['rmdir'](_0x407a5e),_0x1cf067;}static async[a0_0x149e33(0x2fb)](_0xe6c8a2){const _0x1b88c3=a0_0x149e33;return promises[_0x1b88c3(0x26c)](_0xe6c8a2)[_0x1b88c3(0x304)](async _0x2f5860=>{const _0x1ec61f=_0x1b88c3;return await promises[_0x1ec61f(0x24e)](_0xe6c8a2,promises['constants'][_0x1ec61f(0x2d6)]|promises[_0x1ec61f(0x210)]['W_OK']),_0x2f5860[_0x1ec61f(0x18d)]();})[_0x1b88c3(0x17d)](()=>![]);}static async[a0_0x149e33(0x298)](_0x240705){const _0x36853c=a0_0x149e33;return promises['stat'](_0x240705)[_0x36853c(0x304)](async _0x3fbddb=>{const _0x2bc8b2=_0x36853c;return await promises[_0x2bc8b2(0x24e)](_0x240705,promises[_0x2bc8b2(0x210)][_0x2bc8b2(0x2d6)]|promises[_0x2bc8b2(0x210)][_0x2bc8b2(0x28d)]),_0x3fbddb[_0x2bc8b2(0x162)]();})[_0x36853c(0x17d)](()=>![]);}}const SYSTEM_FOLDER$1='.'+ROOT_NAME,CREDENTIALS_FILE_NAME=a0_0x149e33(0x20f);class CredentialsManager{static async['save'](_0x2a4750){const _0x10e586=a0_0x149e33,_0xf5d14a=node_path[_0x10e586(0x19f)](node_os[_0x10e586(0x259)](),SYSTEM_FOLDER$1);await promises[_0x10e586(0x1ea)](_0xf5d14a,{'recursive':!![]});const _0x304ab1=node_path[_0x10e586(0x19f)](_0xf5d14a,CREDENTIALS_FILE_NAME),_0x49fbe9=await CredentialsManager[_0x10e586(0x1bc)](_0x304ab1),_0x66a18d=_0x49fbe9[_0x10e586(0x2f0)](({alias:_0x3f2465})=>_0x3f2465===_0x2a4750[_0x10e586(0x1c1)]);!_0x66a18d?_0x49fbe9['push'](_0x2a4750):(_0x66a18d['accessToken']=_0x2a4750[_0x10e586(0x2d9)],_0x66a18d['globalSettingsUrl']=_0x2a4750[_0x10e586(0x2a6)],_0x66a18d[_0x10e586(0x245)]=_0x2a4750[_0x10e586(0x245)]),await promises[_0x10e586(0x218)](_0x304ab1,Buffer[_0x10e586(0x20a)](JSON[_0x10e586(0x242)](_0x49fbe9)));}static async[a0_0x149e33(0x1f7)]({alias:_0x12b440}){const _0x34939e=a0_0x149e33,_0x27477a=node_path['join'](node_os[_0x34939e(0x259)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x4062fa=await CredentialsManager[_0x34939e(0x1bc)](_0x27477a),_0x4fd89d=_0x4062fa[_0x34939e(0x2f0)](_0x2d755c=>_0x2d755c['alias']===_0x12b440);if(!_0x4fd89d)throw new Error(_0x34939e(0x1bf)+_0x12b440+_0x34939e(0x1db));return _0x4fd89d;}static async['list'](){const _0x394c22=a0_0x149e33,_0x12a929=node_path['join'](node_os[_0x394c22(0x259)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x4ea7b6=await CredentialsManager[_0x394c22(0x1bc)](_0x12a929);return _0x4ea7b6;}static async['getAllCredentials'](_0x303402){const _0x42fec6=a0_0x149e33,_0x3c7b11=await FileUtils[_0x42fec6(0x298)](_0x303402);if(_0x3c7b11){const _0x38e204=await promises['readFile'](_0x303402);return JSON[_0x42fec6(0x2bd)](_0x38e204[_0x42fec6(0x20c)]());}return[];}static async['delete']({alias:_0x5e7457}){const _0x5a6980=a0_0x149e33,_0x37363e=node_path[_0x5a6980(0x19f)](node_os[_0x5a6980(0x259)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x392351=await CredentialsManager[_0x5a6980(0x1bc)](_0x37363e),_0x30d2d8=_0x392351[_0x5a6980(0x1b4)](_0x517938=>_0x517938['alias']===_0x5e7457);if(_0x30d2d8<0x0)throw new Error(_0x5a6980(0x1bf)+_0x5e7457+'\x22\x20not\x20found');_0x392351[_0x5a6980(0x24a)](_0x30d2d8,0x1),await promises[_0x5a6980(0x218)](_0x37363e,Buffer[_0x5a6980(0x20a)](JSON[_0x5a6980(0x242)](_0x392351)));}}var ManagementType=(_0xcb0c5b=>{const _0x2dd7b7=a0_0x149e33;return _0xcb0c5b[_0x2dd7b7(0x1a9)]=_0x2dd7b7(0x286),_0xcb0c5b['VLOCITY']='Vlocity',_0xcb0c5b;})(ManagementType||{});class CommitAction{[a0_0x149e33(0x2d9)];[a0_0x149e33(0x245)];[a0_0x149e33(0x249)];[a0_0x149e33(0x251)];['components'];[a0_0x149e33(0x2e1)];[a0_0x149e33(0x22c)]=new Date();constructor(_0x34cd84){const _0x7aec3=a0_0x149e33;this[_0x7aec3(0x2d9)]=_0x34cd84[_0x7aec3(0x2d9)],this[_0x7aec3(0x245)]=_0x34cd84[_0x7aec3(0x245)],this[_0x7aec3(0x249)]=_0x34cd84[_0x7aec3(0x249)],this['branchId']=_0x34cd84[_0x7aec3(0x251)],this[_0x7aec3(0x308)]=_0x34cd84[_0x7aec3(0x308)],this['userName']=_0x34cd84[_0x7aec3(0x2e1)];}async[a0_0x149e33(0x2ec)](){const _0x189d8c=a0_0x149e33;try{const _0x109797=await Promise['all'](this[_0x189d8c(0x308)][_0x189d8c(0x1c8)](async _0xf9dc35=>await this['convertToCommit'](_0xf9dc35))),{data:_0x458637}=await axios[_0x189d8c(0x190)]('fit/branches/'+this[_0x189d8c(0x251)]+_0x189d8c(0x234),{'message':this['message'],'components':_0x109797},{'headers':{'authorization':'Token\x20'+this[_0x189d8c(0x2d9)]},'baseURL':this[_0x189d8c(0x245)]});return _0x458637;}catch(_0xfe3f1){if(axios[_0x189d8c(0x1f4)](_0xfe3f1))throw Error(_0xfe3f1[_0x189d8c(0x2f7)]?.[_0x189d8c(0x2b7)][_0x189d8c(0x249)]||_0xfe3f1[_0x189d8c(0x2f7)]?.[_0x189d8c(0x2aa)]||_0xfe3f1['message'],{'cause':_0xfe3f1});throw _0xfe3f1;}}async[a0_0x149e33(0x187)](_0x575dac){const _0xcc6910=a0_0x149e33,_0x59a2c7=[];for(const {path:_0x2bc2b8,localPath:_0x28a392}of _0x575dac['files']){_0x59a2c7['push'](promises[_0xcc6910(0x18c)](_0x28a392)[_0xcc6910(0x304)](_0x332cbe=>({'path':_0x2bc2b8,'content':_0x332cbe['toString'](_0xcc6910(0x1d4))})));}const _0x2cd7e9=await Promise['all'](_0x59a2c7);return{'name':_0x575dac[_0xcc6910(0x25a)],'label':_0x575dac[_0xcc6910(0x21a)],'type':_0x575dac[_0xcc6910(0x26d)],'sourceName':_0xcc6910(0x16c),'sourceType':'CLI','externalUpdatedAt':this[_0xcc6910(0x22c)],'externalUpdatedBy':this[_0xcc6910(0x2e1)],'files':_0x2cd7e9,'managementType':ManagementType[_0xcc6910(0x1a9)]};}}class CreateBranchAction{[a0_0x149e33(0x2d9)];['devopsUrl'];constructor(_0x556adc){const _0x4a9288=a0_0x149e33;this[_0x4a9288(0x2d9)]=_0x556adc[_0x4a9288(0x2d9)],this[_0x4a9288(0x245)]=_0x556adc['devopsUrl'];}async[a0_0x149e33(0x2ec)](_0x3e76ea){const _0x3c75ed=a0_0x149e33;try{const {data:_0x27ab69}=await axios[_0x3c75ed(0x190)](_0x3c75ed(0x1eb),{..._0x3e76ea},{'headers':{'authorization':'Token\x20'+this[_0x3c75ed(0x2d9)]},'baseURL':this[_0x3c75ed(0x245)]});return _0x27ab69;}catch(_0x2bd9c7){if(axios[_0x3c75ed(0x1f4)](_0x2bd9c7))throw Error(_0x2bd9c7[_0x3c75ed(0x2f7)]?.[_0x3c75ed(0x2b7)][_0x3c75ed(0x249)]||_0x2bd9c7[_0x3c75ed(0x2f7)]?.['statusText']||_0x2bd9c7['message'],{'cause':_0x2bd9c7});throw _0x2bd9c7;}}}class GetBranchAction{['accessToken'];['devopsUrl'];constructor(_0x393620){const _0x180363=a0_0x149e33;this[_0x180363(0x2d9)]=_0x393620[_0x180363(0x2d9)],this['devopsUrl']=_0x393620[_0x180363(0x245)];}async[a0_0x149e33(0x2ec)](_0x3d699f){const _0x1387e6=a0_0x149e33;try{const {data:_0x20a830}=await axios[_0x1387e6(0x1f7)](_0x1387e6(0x24f)+_0x3d699f[_0x1387e6(0x251)],{'headers':{'authorization':_0x1387e6(0x279)+this[_0x1387e6(0x2d9)]},'baseURL':this[_0x1387e6(0x245)]});return _0x20a830;}catch(_0x4f9d34){if(axios[_0x1387e6(0x1f4)](_0x4f9d34))throw Error(_0x4f9d34['response']?.[_0x1387e6(0x2b7)][_0x1387e6(0x249)]||_0x4f9d34[_0x1387e6(0x2f7)]?.['statusText']||_0x4f9d34['message'],{'cause':_0x4f9d34});throw _0x4f9d34;}}}class GetDefaultBranchAction{[a0_0x149e33(0x245)];[a0_0x149e33(0x2d9)];constructor(_0x4f61f7){const _0x46936c=a0_0x149e33;this['devopsUrl']=_0x4f61f7[_0x46936c(0x245)],this[_0x46936c(0x2d9)]=_0x4f61f7['accessToken'];}async[a0_0x149e33(0x2ec)](){const _0x483e59=a0_0x149e33;try{const {data:_0x355964}=await axios['get']('fit/branches/default',{'headers':{'authorization':_0x483e59(0x279)+this[_0x483e59(0x2d9)]},'baseURL':this[_0x483e59(0x245)]});return _0x355964;}catch(_0x1a2666){if(axios[_0x483e59(0x1f4)](_0x1a2666))throw Error(_0x1a2666[_0x483e59(0x2f7)]?.[_0x483e59(0x2b7)]['message']||_0x1a2666[_0x483e59(0x2f7)]?.['statusText']||_0x1a2666['message'],{'cause':_0x1a2666});throw _0x1a2666;}}}class GetMeAction{[a0_0x149e33(0x2d9)];['devopsUrl'];constructor(_0x2bcf29){const _0x50ceef=a0_0x149e33;this['accessToken']=_0x2bcf29[_0x50ceef(0x2d9)],this['devopsUrl']=_0x2bcf29[_0x50ceef(0x245)];}async[a0_0x149e33(0x2ec)](){const _0xaf8735=a0_0x149e33;try{const {data:_0x15768b}=await axios[_0xaf8735(0x1f7)](_0xaf8735(0x1e5),{'headers':{'authorization':_0xaf8735(0x279)+this['accessToken']},'baseURL':this['devopsUrl']});return _0x15768b;}catch(_0x2dd42a){if(axios[_0xaf8735(0x1f4)](_0x2dd42a))throw Error(_0x2dd42a['response']?.[_0xaf8735(0x2b7)][_0xaf8735(0x249)]||_0x2dd42a[_0xaf8735(0x2f7)]?.[_0xaf8735(0x2aa)]||_0x2dd42a[_0xaf8735(0x249)],{'cause':_0x2dd42a});throw _0x2dd42a;}}}class ListBranchesAction{[a0_0x149e33(0x245)];[a0_0x149e33(0x2d9)];[a0_0x149e33(0x1b9)];constructor(_0x258b0c){const _0x43624c=a0_0x149e33;this['devopsUrl']=_0x258b0c[_0x43624c(0x245)],this[_0x43624c(0x2d9)]=_0x258b0c[_0x43624c(0x2d9)],this[_0x43624c(0x1b9)]=_0x258b0c[_0x43624c(0x1b9)];}async[a0_0x149e33(0x2ec)](){const _0x133411=a0_0x149e33;try{const _0x769638=[];let _0x45724b=0x0,_0x261768=0x0;do{const {data:_0x4bc902}=await axios['get'](_0x133411(0x1eb),{'headers':{'authorization':_0x133411(0x279)+this['accessToken']},'params':{'search':this[_0x133411(0x1b9)],'offset':_0x45724b,'limit':0x64},'baseURL':this[_0x133411(0x245)]});_0x769638[_0x133411(0x200)](..._0x4bc902['rows']),_0x45724b+=_0x4bc902['rows'][_0x133411(0x27e)],_0x261768=_0x4bc902['total'];}while(_0x45724b<_0x261768);return _0x769638;}catch(_0x3e2c50){if(axios[_0x133411(0x1f4)](_0x3e2c50))throw Error(_0x3e2c50['response']?.['data'][_0x133411(0x249)]||_0x3e2c50[_0x133411(0x2f7)]?.[_0x133411(0x2aa)]||_0x3e2c50[_0x133411(0x249)],{'cause':_0x3e2c50});throw _0x3e2c50;}}}class ListComponentsAction{[a0_0x149e33(0x245)];[a0_0x149e33(0x2d9)];[a0_0x149e33(0x251)];['commitId'];[a0_0x149e33(0x2ea)];constructor(_0x1757fa){const _0x4e9f3d=a0_0x149e33;this['devopsUrl']=_0x1757fa[_0x4e9f3d(0x245)],this[_0x4e9f3d(0x2d9)]=_0x1757fa[_0x4e9f3d(0x2d9)],this[_0x4e9f3d(0x251)]=_0x1757fa[_0x4e9f3d(0x251)],this[_0x4e9f3d(0x1ac)]=_0x1757fa['commitId'],_0x1757fa[_0x4e9f3d(0x308)]&&(this[_0x4e9f3d(0x2ea)]=new Set(_0x1757fa['components'][_0x4e9f3d(0x1c8)](({name:_0x1a55f4,type:_0x1008fc})=>_0x1008fc+'_'+_0x1a55f4)));}async*['execute'](){const _0x3e7960=a0_0x149e33;try{let _0x4b9915=0x0,_0x391acc=0x0;do{const {data:_0x43fdd3}=await axios[_0x3e7960(0x1f7)]('fit/branches/'+this['branchId']+_0x3e7960(0x23b)+this[_0x3e7960(0x1ac)]+_0x3e7960(0x2c5),{'headers':{'authorization':_0x3e7960(0x279)+this['accessToken']},'params':{'offset':_0x4b9915,'limit':0x64,'managementType':ManagementType['SALESFORCE']},'baseURL':this[_0x3e7960(0x245)]});_0x4b9915+=_0x43fdd3['rows'][_0x3e7960(0x27e)],_0x391acc=_0x43fdd3['count'];let _0x4824ee=_0x43fdd3['rows'];this['indexes']&&(_0x4824ee=_0x43fdd3[_0x3e7960(0x2d2)][_0x3e7960(0x284)](({name:_0x5f1592,type:_0x511672})=>this[_0x3e7960(0x2ea)]?.[_0x3e7960(0x16d)](_0x511672+'_'+_0x5f1592))),yield*_0x4824ee;}while(_0x4b9915<_0x391acc);}catch(_0x2e1c2b){if(axios['isAxiosError'](_0x2e1c2b))throw Error(_0x2e1c2b[_0x3e7960(0x2f7)]?.[_0x3e7960(0x2b7)][_0x3e7960(0x249)]||_0x2e1c2b[_0x3e7960(0x2f7)]?.['statusText']||_0x2e1c2b[_0x3e7960(0x249)],{'cause':_0x2e1c2b});throw _0x2e1c2b;}}}class RetrieveComponentAction{[a0_0x149e33(0x245)];[a0_0x149e33(0x2d9)];constructor(_0x52bc20){const _0x316a42=a0_0x149e33;this[_0x316a42(0x245)]=_0x52bc20[_0x316a42(0x245)],this[_0x316a42(0x2d9)]=_0x52bc20['accessToken'];}async[a0_0x149e33(0x2ec)](_0x1bb8c3){const _0x385771=a0_0x149e33;try{const {data:{id:_0x19f511,name:_0x96d2af,type:_0x59433e,fHash:_0x2a5d07,files:_0x4d2859}}=await axios['get'](_0x385771(0x184)+_0x1bb8c3,{'headers':{'authorization':'Token\x20'+this[_0x385771(0x2d9)]},'baseURL':this['devopsUrl']}),_0x1a4a40=_0x4d2859['map'](_0x44c4f5=>({'path':_0x44c4f5[_0x385771(0x2e5)],'content':Buffer[_0x385771(0x20a)](_0x44c4f5[_0x385771(0x1a4)],_0x385771(0x1d4))[_0x385771(0x20c)](_0x385771(0x246))}));return{'id':_0x19f511,'name':_0x96d2af,'type':_0x59433e,'fHash':_0x2a5d07,'files':_0x1a4a40};}catch(_0x122f64){if(axios['isAxiosError'](_0x122f64))throw Error(_0x122f64[_0x385771(0x2f7)]?.[_0x385771(0x2b7)][_0x385771(0x249)]||_0x122f64['response']?.[_0x385771(0x2aa)]||_0x122f64[_0x385771(0x249)],{'cause':_0x122f64});throw _0x122f64;}}}const RETRIEVE_COMPONENT_CHUNK_SIZE=0xa;class ApiService{static async['listBranches'](_0x543ef3){const _0x3058cc=a0_0x149e33,_0x42e4d7=new ListBranchesAction(_0x543ef3);return _0x42e4d7[_0x3058cc(0x2ec)]();}static async[a0_0x149e33(0x2a9)](_0x192afb){const _0x4cb665=a0_0x149e33,_0x5cc0af=new GetDefaultBranchAction(_0x192afb);return _0x5cc0af[_0x4cb665(0x2ec)]();}static async[a0_0x149e33(0x1fe)](_0x35170b){const _0x360233=a0_0x149e33,_0x50ae02=await ApiService[_0x360233(0x299)]({'devopsUrl':_0x35170b[_0x360233(0x245)],'accessToken':_0x35170b[_0x360233(0x2d9)],'search':_0x35170b[_0x360233(0x1c3)]});return _0x50ae02[_0x360233(0x2f0)](({name:_0x40fa47})=>_0x40fa47===_0x35170b['branchName'])||null;}static async[a0_0x149e33(0x22a)](_0xed96c4){const _0x5a44e3=a0_0x149e33,_0x131072=new GetBranchAction({'accessToken':_0xed96c4['accessToken'],'devopsUrl':_0xed96c4[_0x5a44e3(0x245)]});return _0x131072[_0x5a44e3(0x2ec)]({'branchId':_0xed96c4['branchId']});}static[a0_0x149e33(0x2af)](_0x5ca45e){const _0x597ef3=a0_0x149e33,_0x1f9f92=new ListComponentsAction(_0x5ca45e);return _0x1f9f92[_0x597ef3(0x2ec)]();}static async[a0_0x149e33(0x302)](_0x3c5232){const _0x403e6a=a0_0x149e33,_0x5dc500=[];for await(const _0x150347 of ApiService['listComponentsGenerator'](_0x3c5232)){_0x5dc500[_0x403e6a(0x200)](_0x150347);}return _0x5dc500;}static async*[a0_0x149e33(0x239)](_0x38c31c){const _0xef6794=a0_0x149e33,_0x3deab3=new RetrieveComponentAction({'devopsUrl':_0x38c31c[_0xef6794(0x245)],'accessToken':_0x38c31c[_0xef6794(0x2d9)]});let _0x355d0f=[];for await(const _0x3af0d3 of ApiService[_0xef6794(0x2af)]({'devopsUrl':_0x38c31c[_0xef6794(0x245)],'accessToken':_0x38c31c[_0xef6794(0x2d9)],'branchId':_0x38c31c[_0xef6794(0x251)],'commitId':_0x38c31c[_0xef6794(0x1ac)],'components':_0x38c31c[_0xef6794(0x308)]})){_0x355d0f[_0xef6794(0x200)](_0x3deab3[_0xef6794(0x2ec)](_0x3af0d3['id'])),_0x355d0f[_0xef6794(0x27e)]>=RETRIEVE_COMPONENT_CHUNK_SIZE&&(yield*await Promise[_0xef6794(0x28c)](_0x355d0f),_0x355d0f=[]);}_0x355d0f['length']&&(yield*await Promise[_0xef6794(0x28c)](_0x355d0f));}static async[a0_0x149e33(0x238)]({devopsUrl:_0x1cdaf8,accessToken:_0x571b02,componentId:_0x565890}){const _0x28173e=a0_0x149e33,_0x50fc70=new RetrieveComponentAction({'devopsUrl':_0x1cdaf8,'accessToken':_0x571b02});return _0x50fc70[_0x28173e(0x2ec)](_0x565890);}static async[a0_0x149e33(0x275)](_0x499992){const _0x53dd59=a0_0x149e33,{accessToken:_0x37f7c7,devopsUrl:_0x1df3cc}=await CredentialsManager['get']({'alias':_0x499992});if(!_0x1df3cc)throw new Error(_0x53dd59(0x1df));return{'accessToken':_0x37f7c7,'devopsUrl':_0x1df3cc};}static async[a0_0x149e33(0x163)](_0x3b31de){const _0x44ae36=new GetMeAction(_0x3b31de);return _0x44ae36['execute']();}static async[a0_0x149e33(0x253)](_0x6c390a){const _0x384a83=a0_0x149e33,_0x21d98c=new CommitAction(_0x6c390a);await _0x21d98c[_0x384a83(0x2ec)]();}static async[a0_0x149e33(0x274)](_0xccb7ac){const _0x331211=a0_0x149e33,_0x4bccac=new CreateBranchAction({'accessToken':_0xccb7ac[_0x331211(0x2d9)],'devopsUrl':_0xccb7ac[_0x331211(0x245)]});return _0x4bccac[_0x331211(0x2ec)]({'name':_0xccb7ac[_0x331211(0x25a)],'parentId':_0xccb7ac['parentId']});}}var ConfigName=(_0x44fb93=>{const _0x56989f=a0_0x149e33;return _0x44fb93[_0x56989f(0x1ed)]=_0x56989f(0x2c8),_0x44fb93;})(ConfigName||{}),ChangeType=(_0x1749e7=>{const _0x559613=a0_0x149e33;return _0x1749e7[_0x559613(0x2d3)]=_0x559613(0x292),_0x1749e7['UPDATE']=_0x559613(0x243),_0x1749e7[_0x559613(0x2e6)]='Delete',_0x1749e7;})(ChangeType||{});class CompareWithRemoteBranchAction{['devopsUrl'];[a0_0x149e33(0x2d9)];[a0_0x149e33(0x1ca)];[a0_0x149e33(0x2e0)];[a0_0x149e33(0x1c5)];constructor(_0x5b5f40){const _0x47356d=a0_0x149e33;this[_0x47356d(0x245)]=_0x5b5f40[_0x47356d(0x245)],this[_0x47356d(0x2d9)]=_0x5b5f40[_0x47356d(0x2d9)],this['targetBranchId']=_0x5b5f40['targetBranchId'],this['targetCommitId']=_0x5b5f40[_0x47356d(0x2e0)],this[_0x47356d(0x1c5)]=_0x5b5f40[_0x47356d(0x1c5)];}async[a0_0x149e33(0x2ec)](){const _0x2574bf=a0_0x149e33,_0xc14477=await ApiService[_0x2574bf(0x302)]({'devopsUrl':this['devopsUrl'],'accessToken':this[_0x2574bf(0x2d9)],'branchId':this[_0x2574bf(0x1ca)],'commitId':this[_0x2574bf(0x2e0)]}),_0x5caa0f=new Map(_0xc14477[_0x2574bf(0x1c8)](_0x238772=>[_0x238772[_0x2574bf(0x26d)]+'_'+_0x238772[_0x2574bf(0x25a)],_0x238772])),_0x3d1435=[];for(const _0x12be1c of this[_0x2574bf(0x214)](_0x5caa0f)){_0x3d1435[_0x2574bf(0x200)](_0x12be1c),_0x5caa0f[_0x2574bf(0x16f)](_0x12be1c[_0x2574bf(0x26d)]+'_'+_0x12be1c[_0x2574bf(0x25a)]);}for(const [_0x5d219f,_0x32fd5a]of _0x5caa0f[_0x2574bf(0x1e8)]()){const _0x9a4bdb=this['stage'][_0x2574bf(0x1ee)][_0x2574bf(0x1f7)](_0x5d219f);!_0x9a4bdb&&_0x3d1435[_0x2574bf(0x200)]({'id':_0x32fd5a['id'],'name':_0x32fd5a[_0x2574bf(0x25a)],'type':_0x32fd5a[_0x2574bf(0x26d)],'fHash':_0x32fd5a[_0x2574bf(0x2d8)],'changeType':ChangeType[_0x2574bf(0x2d3)]});}return _0x3d1435;}*[a0_0x149e33(0x214)](_0x3f7f3c){const _0x44d7d3=a0_0x149e33;for(const [_0x469325,_0x1d2824]of this[_0x44d7d3(0x1c5)][_0x44d7d3(0x1ee)][_0x44d7d3(0x1e8)]()){const _0x38bfb1=_0x3f7f3c[_0x44d7d3(0x1f7)](_0x469325);!_0x38bfb1&&(yield{'name':_0x1d2824[_0x44d7d3(0x25a)],'type':_0x1d2824[_0x44d7d3(0x26d)],'changeType':ChangeType[_0x44d7d3(0x2e6)]}),_0x38bfb1&&_0x38bfb1[_0x44d7d3(0x2d8)]!==_0x1d2824[_0x44d7d3(0x2d8)]&&(yield{'id':_0x38bfb1['id'],'name':_0x38bfb1[_0x44d7d3(0x25a)],'type':_0x38bfb1[_0x44d7d3(0x26d)],'fHash':_0x38bfb1['fHash'],'changeType':ChangeType['UPDATE']});}}}class ConfigSetAction{[a0_0x149e33(0x1c5)];constructor({stage:_0x447227}){this['stage']=_0x447227;}async[a0_0x149e33(0x2ec)]({name:_0x2516da,value:_0x4d1256}){const _0x5bc17c=a0_0x149e33;switch(_0x2516da){case ConfigName[_0x5bc17c(0x1ed)]:await CredentialsManager[_0x5bc17c(0x1f7)]({'alias':_0x4d1256}),this['stage'][_0x5bc17c(0x181)](_0x2516da,_0x4d1256);break;default:throw new Error(_0x5bc17c(0x2a7)+_0x2516da);}}}class FindChangesAction{[a0_0x149e33(0x1c5)];constructor(_0x264138){const _0x113654=a0_0x149e33;this['stage']=_0x264138[_0x113654(0x1c5)];}async[a0_0x149e33(0x2ec)](){const _0x849437=a0_0x149e33,_0x259eae=new Map(this['stage']['componentsState']),_0xc2b407=[];for await(const {componentName:_0x467c76,componentType:_0xa73d8f,filePaths:_0x4655df}of salesforce['SfProjectScanner'][_0x849437(0x167)](this['stage'][_0x849437(0x2ee)])){const _0x4c034b=_0xa73d8f+'_'+_0x467c76,_0x486b52=_0x259eae[_0x849437(0x1f7)](_0x4c034b),_0x2324e2=_0x4655df[_0x849437(0x1c8)](_0x2ff576=>_0x2ff576['replace'](this[_0x849437(0x1c5)]['projectPath']+'/',''));if(!_0x486b52){_0xc2b407[_0x849437(0x200)]({'type':_0xa73d8f,'name':_0x467c76,'changes':_0x2324e2['map'](_0x45075d=>({'path':_0x45075d,'changeType':ChangeType[_0x849437(0x2d3)]}))});continue;}_0x259eae[_0x849437(0x16f)](_0x4c034b);const _0x21e1db=await this['getUpdatedComponentChanges'](_0x2324e2,_0x486b52[_0x849437(0x1bd)]);_0x21e1db[_0x849437(0x27e)]&&_0xc2b407[_0x849437(0x200)]({'type':_0xa73d8f,'name':_0x467c76,'changes':_0x21e1db});}for(const [,_0x4373f4]of _0x259eae['entries']()){_0xc2b407[_0x849437(0x200)]({'type':_0x4373f4[_0x849437(0x26d)],'name':_0x4373f4[_0x849437(0x25a)],'changes':_0x4373f4[_0x849437(0x1bd)][_0x849437(0x1c8)](_0x438ddf=>({'path':_0x438ddf,'changeType':ChangeType[_0x849437(0x2e6)]}))});}return _0xc2b407;}async[a0_0x149e33(0x2ad)](_0x28b1ed,_0x1fc031){const _0x4a34b2=a0_0x149e33,{lastStageTimestamp:_0x4f46c7}=this[_0x4a34b2(0x1c5)][_0x4a34b2(0x2fe)],_0x4f91b3=[];for(const _0x568804 of _0x28b1ed){const _0x1996eb=_0x1fc031[_0x4a34b2(0x232)](_0x568804);if(!_0x1996eb){_0x4f91b3[_0x4a34b2(0x200)]({'path':_0x568804,'changeType':ChangeType[_0x4a34b2(0x2d3)]});continue;}const {ctimeMs:_0xf4cbdc,mtimeMs:_0x32b141}=await promises['stat'](_0x568804);(!_0x4f46c7||Math[_0x4a34b2(0x28f)](_0x32b141)>_0x4f46c7||Math[_0x4a34b2(0x28f)](_0xf4cbdc)>_0x4f46c7)&&_0x4f91b3[_0x4a34b2(0x200)]({'path':_0x568804,'changeType':ChangeType[_0x4a34b2(0x28a)]});}for(const _0xc71d26 of _0x1fc031){const _0x177076=!_0x28b1ed[_0x4a34b2(0x232)](_0xc71d26);_0x177076&&_0x4f91b3[_0x4a34b2(0x200)]({'path':_0xc71d26,'changeType':ChangeType[_0x4a34b2(0x2e6)]});}return _0x4f91b3;}}const STAGE_FOLDER_NAME=a0_0x149e33(0x193),SYSTEM_FOLDER='.'+ROOT_NAME,CONFIG_FILE_NAME=a0_0x149e33(0x201),BRANCH_STATE_FILE_NAME=a0_0x149e33(0x28b),COMPONENTS_STATE_FILE_NAME=a0_0x149e33(0x1d8),COMPONENT_PROJECT_PATH=node_path[a0_0x149e33(0x19f)](a0_0x149e33(0x273),a0_0x149e33(0x18e),'default'),SFDX_PROJECT_FILE_NAME='sfdx-project.json',INITIAL_BRANCH_STATE={'id':null,'name':null,'headCommitId':null,'lastStageTimestamp':null},INITIAL_CONFIG={'credentialsAlias':null};class InitProjectAction{['stage'];[a0_0x149e33(0x1ec)];constructor({stage:_0x2951d8,config:_0x2e456e}){const _0x13c019=a0_0x149e33;this[_0x13c019(0x1c5)]=_0x2951d8,this['config']=_0x2e456e;}async['execute'](){const _0xa8e76f=a0_0x149e33,_0x36251e=new salesforce[(_0xa8e76f(0x164))]({'cwd':node_path[_0xa8e76f(0x2e4)](this[_0xa8e76f(0x1c5)][_0xa8e76f(0x24d)]),'projectName':node_path[_0xa8e76f(0x202)](this[_0xa8e76f(0x1c5)][_0xa8e76f(0x24d)])});await _0x36251e['run']();const _0x3370cf=await FileUtils[_0xa8e76f(0x233)](this[_0xa8e76f(0x1c5)][_0xa8e76f(0x24d)]);for(const _0xb2d77d of _0x3370cf){const _0x337633=_0xb2d77d[_0xa8e76f(0x268)](STAGE_FOLDER_NAME)[0x1];this[_0xa8e76f(0x1c5)][_0xa8e76f(0x2a2)]({'path':_0x337633,'changeType':ChangeType['CREATE']});}if(this[_0xa8e76f(0x1ec)])for(const _0x28bf78 of Object[_0xa8e76f(0x2bb)](ConfigName)){this[_0xa8e76f(0x1c5)][_0xa8e76f(0x181)](_0x28bf78,this[_0xa8e76f(0x1ec)][_0x28bf78]);}}}class SaveComponentAction{['stage'];constructor(_0x1cc701){const _0x31d512=a0_0x149e33;this[_0x31d512(0x1c5)]=_0x1cc701[_0x31d512(0x1c5)];}async[a0_0x149e33(0x2ec)](_0x4fd64d){const _0x501b8c=a0_0x149e33;switch(_0x4fd64d[_0x501b8c(0x1d0)]){case ChangeType[_0x501b8c(0x2d3)]:{if(!_0x4fd64d['component'])throw new Error('Create:\x20Component\x20not\x20found');await this[_0x501b8c(0x1c5)][_0x501b8c(0x1af)](_0x4fd64d[_0x501b8c(0x1b0)]);break;}case ChangeType[_0x501b8c(0x28a)]:if(!_0x4fd64d[_0x501b8c(0x1b0)])throw new Error(_0x501b8c(0x2df));await this[_0x501b8c(0x1c5)][_0x501b8c(0x244)](_0x4fd64d[_0x501b8c(0x1b0)]);break;case ChangeType[_0x501b8c(0x2e6)]:await this['stage'][_0x501b8c(0x18a)]({'name':_0x4fd64d['name'],'type':_0x4fd64d[_0x501b8c(0x26d)]});break;}}}class UpdateComponentStateAction{[a0_0x149e33(0x1c5)];['name'];['type'];[a0_0x149e33(0x2ae)];constructor(_0x34dea3){const _0x13e2d8=a0_0x149e33;this[_0x13e2d8(0x1c5)]=_0x34dea3[_0x13e2d8(0x1c5)],this[_0x13e2d8(0x25a)]=_0x34dea3['name'],this[_0x13e2d8(0x26d)]=_0x34dea3[_0x13e2d8(0x26d)],this[_0x13e2d8(0x2ae)]=_0x34dea3[_0x13e2d8(0x2ae)];}async[a0_0x149e33(0x2ec)](){const _0x4687f7=a0_0x149e33,_0x9f17bc=this[_0x4687f7(0x26d)]+'_'+this[_0x4687f7(0x25a)];let _0x1002d6=this[_0x4687f7(0x1c5)]['componentsState'][_0x4687f7(0x1f7)](_0x9f17bc),_0x3632eb=ChangeType['UPDATE'];!_0x1002d6&&(_0x1002d6={'name':this[_0x4687f7(0x25a)],'type':this[_0x4687f7(0x26d)],'fHash':'','paths':[]},this[_0x4687f7(0x1c5)]['componentsState']['set'](_0x9f17bc,_0x1002d6),_0x3632eb=ChangeType[_0x4687f7(0x2d3)]);for(const _0x5490c2 of this['changes']){this[_0x4687f7(0x174)](_0x1002d6,_0x5490c2);}if(!_0x1002d6[_0x4687f7(0x1bd)][_0x4687f7(0x27e)])return this[_0x4687f7(0x1c5)][_0x4687f7(0x1ee)][_0x4687f7(0x16f)](_0x9f17bc),{'name':_0x1002d6[_0x4687f7(0x25a)],'type':_0x1002d6[_0x4687f7(0x26d)],'changeType':ChangeType['DELETE']};return _0x1002d6[_0x4687f7(0x2d8)]=await this[_0x4687f7(0x1c7)](_0x1002d6[_0x4687f7(0x1bd)]),{..._0x1002d6,'changeType':_0x3632eb};}[a0_0x149e33(0x174)](_0x2d592e,{path:_0x27b7f8,changeType:_0x2eb62d}){const _0x5d93a4=a0_0x149e33;if(_0x2eb62d===ChangeType[_0x5d93a4(0x2d3)]){if(_0x2d592e[_0x5d93a4(0x1bd)][_0x5d93a4(0x232)](_0x27b7f8))throw new Error(_0x5d93a4(0x261)+_0x27b7f8+'\x22\x20already\x20exists');_0x2d592e[_0x5d93a4(0x1bd)]['push'](_0x27b7f8);}if(_0x2eb62d===ChangeType['DELETE']){const _0x5787e3=_0x2d592e[_0x5d93a4(0x1bd)][_0x5d93a4(0x192)](_0x27b7f8);if(_0x5787e3<0x0)throw new Error(_0x5d93a4(0x261)+_0x27b7f8+_0x5d93a4(0x1db));_0x2d592e['paths'][_0x5d93a4(0x24a)](_0x5787e3,0x1);}}async[a0_0x149e33(0x1c7)](_0x599cb8){const _0x4978a0=a0_0x149e33,_0x54d2b9=node_crypto[_0x4978a0(0x2da)]('sha1');for(const _0x1fdee8 of _0x599cb8){const _0x1dad5d=await promises[_0x4978a0(0x18c)](node_path[_0x4978a0(0x19f)](this[_0x4978a0(0x1c5)]['projectPath'],_0x1fdee8),{'encoding':_0x4978a0(0x246)}),_0x44c5dd=_0x1fdee8[_0x4978a0(0x268)](node_path[_0x4978a0(0x258)])['slice'](0x3)['join']('/');_0x54d2b9[_0x4978a0(0x1dc)](_0x44c5dd),_0x54d2b9[_0x4978a0(0x1dc)](_0x1dad5d);}const _0x83ef1e=_0x54d2b9['digest']('hex');return _0x83ef1e;}}class Stage{[a0_0x149e33(0x2d1)];[a0_0x149e33(0x267)];[a0_0x149e33(0x1ec)];[a0_0x149e33(0x205)];[a0_0x149e33(0x1cd)];[a0_0x149e33(0x18b)]=[];['_isUpdateStageTimestamp']=!![];set[a0_0x149e33(0x300)](_0x17424c){const _0x5c9181=a0_0x149e33;this[_0x5c9181(0x2b2)]=_0x17424c;}get['projectPath'](){const _0x3f30de=a0_0x149e33;return this[_0x3f30de(0x2d1)];}get['stagePath'](){const _0x42d750=a0_0x149e33;return this[_0x42d750(0x267)];}get[a0_0x149e33(0x2fe)](){return this['_branchState'];}get[a0_0x149e33(0x1ee)](){const _0x217445=a0_0x149e33;return this[_0x217445(0x1cd)];}constructor(_0x52022a){const _0x457122=a0_0x149e33;this[_0x457122(0x2d1)]=_0x52022a['projectPath'],this[_0x457122(0x267)]=_0x52022a[_0x457122(0x24d)],this[_0x457122(0x1ec)]=_0x52022a[_0x457122(0x1ec)],this[_0x457122(0x205)]=_0x52022a['branchState'],this['_componentsState']=_0x52022a['componentsState']?new Map(_0x52022a[_0x457122(0x1ee)][_0x457122(0x1c8)](_0x26cf95=>[_0x26cf95[_0x457122(0x26d)]+'_'+_0x26cf95['name'],_0x26cf95])):new Map();}[a0_0x149e33(0x181)](_0x30d114,_0x11c85a){const _0x316933=a0_0x149e33;this[_0x316933(0x1ec)][_0x30d114]=_0x11c85a;}['unsetConfig'](_0x54eab7){const _0x1a1df3=a0_0x149e33;this[_0x1a1df3(0x1ec)][_0x54eab7]=null;}['updateBranchState'](_0x172bf3){const _0x539ca9=a0_0x149e33;this['branchState']['id']=_0x172bf3['id'],this['branchState'][_0x539ca9(0x25a)]=_0x172bf3[_0x539ca9(0x25a)],this['branchState']['headCommitId']=_0x172bf3['headCommitId'];}async[a0_0x149e33(0x1af)](_0x514990){const _0x53d331=a0_0x149e33,_0x35dfd1={'name':_0x514990[_0x53d331(0x25a)],'type':_0x514990[_0x53d331(0x26d)],'fHash':_0x514990[_0x53d331(0x2d8)],'paths':_0x514990['files'][_0x53d331(0x1c8)](({path:_0x298a3b})=>node_path[_0x53d331(0x19f)](COMPONENT_PROJECT_PATH,_0x298a3b))};this[_0x53d331(0x1cd)][_0x53d331(0x287)](_0x514990[_0x53d331(0x26d)]+'_'+_0x514990[_0x53d331(0x25a)],_0x35dfd1);for(const {path:_0x3a33ee,content:_0x5daa8d}of _0x514990[_0x53d331(0x177)]){await this[_0x53d331(0x21c)]({'path':node_path[_0x53d331(0x19f)](COMPONENT_PROJECT_PATH,_0x3a33ee),'content':_0x5daa8d,'changeType':ChangeType['CREATE']});}}async[a0_0x149e33(0x244)](_0x49c9a1){const _0xc7595c=a0_0x149e33,_0x96a214=this[_0xc7595c(0x1cd)]['get'](_0x49c9a1['type']+'_'+_0x49c9a1['name']),_0x173136=[];if(!_0x96a214)throw new Error(_0xc7595c(0x2d0)+_0x49c9a1[_0xc7595c(0x25a)]+_0xc7595c(0x1e0)+_0x49c9a1['type']+'\x20not\x20found');for(const _0x4ca8e2 of _0x96a214[_0xc7595c(0x1bd)]){await this[_0xc7595c(0x21c)]({'path':_0x4ca8e2,'changeType':ChangeType['DELETE']});}for(const {path:_0x43f16f,content:_0x40bdcc}of _0x49c9a1[_0xc7595c(0x177)]){const _0x2d8d48=node_path[_0xc7595c(0x19f)](COMPONENT_PROJECT_PATH,_0x43f16f);await this['addFileChange']({'path':_0x2d8d48,'content':_0x40bdcc,'changeType':ChangeType['CREATE']}),_0x173136[_0xc7595c(0x200)](_0x2d8d48);}_0x96a214[_0xc7595c(0x2d8)]=_0x49c9a1[_0xc7595c(0x2d8)],_0x96a214[_0xc7595c(0x1bd)]=_0x173136;}async['deleteComponent'](_0x55d90b){const _0x5065b2=a0_0x149e33,_0x3a164a=_0x55d90b[_0x5065b2(0x26d)]+'_'+_0x55d90b['name'],_0x53fdc6=this[_0x5065b2(0x1cd)][_0x5065b2(0x1f7)](_0x3a164a);if(!_0x53fdc6)throw new Error(_0x5065b2(0x176)+_0x55d90b[_0x5065b2(0x25a)]+_0x5065b2(0x1e0)+_0x55d90b[_0x5065b2(0x26d)]+_0x5065b2(0x250));for(const _0x3b5b60 of _0x53fdc6[_0x5065b2(0x1bd)]){await this[_0x5065b2(0x21c)]({'path':_0x3b5b60,'changeType':ChangeType[_0x5065b2(0x2e6)]});}this['_componentsState'][_0x5065b2(0x16f)](_0x3a164a);}async[a0_0x149e33(0x21c)]({path:_0x4033ba,content:_0x409091,changeType:_0x54a796}){const _0xb52663=a0_0x149e33;if(_0x54a796!==ChangeType[_0xb52663(0x2e6)]){if(!_0x409091)throw new Error(_0xb52663(0x1e4));const _0x1d44ed=node_path[_0xb52663(0x19f)](this['stagePath'],_0x4033ba);await promises[_0xb52663(0x1ea)](node_path[_0xb52663(0x2e4)](_0x1d44ed),{'recursive':!![]}),await promises[_0xb52663(0x218)](_0x1d44ed,_0x409091);}this[_0xb52663(0x18b)][_0xb52663(0x200)]({'path':_0x4033ba,'changeType':_0x54a796});}async['updateComponentState'](_0x37a368){const _0x8c3753=a0_0x149e33,_0x5270d7=new UpdateComponentStateAction({'stage':this,..._0x37a368});return _0x5270d7[_0x8c3753(0x2ec)]();}async[a0_0x149e33(0x28e)](){}[a0_0x149e33(0x2a2)]({path:_0x3f4849,changeType:_0x24d7bf}){const _0x4fa672=a0_0x149e33;this['fileChanges'][_0x4fa672(0x200)]({'path':_0x3f4849,'changeType':_0x24d7bf});}async[a0_0x149e33(0x1e1)](){const _0x3402bf=a0_0x149e33,_0x1da0cb=await FileUtils[_0x3402bf(0x2fb)](this['stagePath']);if(!_0x1da0cb)throw Error(_0x3402bf(0x1a7));await this[_0x3402bf(0x25b)](),await this[_0x3402bf(0x237)](),await promises['rm'](this[_0x3402bf(0x24d)],{'recursive':!![]});const _0x1037dd=node_path[_0x3402bf(0x19f)](this[_0x3402bf(0x2d1)],COMPONENT_PROJECT_PATH),_0x548570=await FileUtils['isDirectoryExists'](_0x1037dd);_0x548570?await FileUtils[_0x3402bf(0x17b)](_0x1037dd,![]):await promises[_0x3402bf(0x1ea)](_0x1037dd,{'recursive':!![]});}async[a0_0x149e33(0x255)](){const _0x4b50b6=a0_0x149e33;await promises['rm'](this[_0x4b50b6(0x24d)],{'recursive':!![],'force':!![]});}async['applyFileChanges'](){const _0x2ae24e=a0_0x149e33;for(const {path:_0xd33feb,changeType:_0x2da1db}of this[_0x2ae24e(0x18b)]){switch(_0x2da1db){case ChangeType['CREATE']:case ChangeType['UPDATE']:await this[_0x2ae24e(0x2d7)](_0xd33feb);break;case ChangeType[_0x2ae24e(0x2e6)]:await this[_0x2ae24e(0x1cb)](_0xd33feb);break;}}}async[a0_0x149e33(0x2d7)](_0x2352d2){const _0x3cf7a7=a0_0x149e33,_0x14200b=node_path[_0x3cf7a7(0x19f)](this[_0x3cf7a7(0x267)],_0x2352d2),_0x31e429=node_path[_0x3cf7a7(0x19f)](this[_0x3cf7a7(0x2d1)],_0x2352d2);await promises[_0x3cf7a7(0x1ea)](node_path[_0x3cf7a7(0x2e4)](_0x31e429),{'recursive':!![]}),await promises[_0x3cf7a7(0x20d)](_0x14200b,_0x31e429);}async[a0_0x149e33(0x1cb)](_0x1c4191){const _0x62d41f=a0_0x149e33;await promises['rm'](node_path[_0x62d41f(0x19f)](this[_0x62d41f(0x2d1)],_0x1c4191),{'recursive':!![]});}async['updateSystemFiles'](){const _0x420910=a0_0x149e33;await promises['writeFile'](node_path[_0x420910(0x19f)](this[_0x420910(0x2ee)],SYSTEM_FOLDER,CONFIG_FILE_NAME),JSON[_0x420910(0x242)](this[_0x420910(0x1ec)])),this['_isUpdateStageTimestamp']&&(this['branchState'][_0x420910(0x272)]=Date[_0x420910(0x2e7)]()),await promises[_0x420910(0x218)](node_path[_0x420910(0x19f)](this[_0x420910(0x2ee)],SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),JSON[_0x420910(0x242)](this[_0x420910(0x2fe)])),await promises[_0x420910(0x218)](node_path['join'](this[_0x420910(0x2ee)],SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),JSON[_0x420910(0x242)](Array[_0x420910(0x20a)](this[_0x420910(0x1cd)][_0x420910(0x2bb)]())));}}class ProjectManager{static ['instance'];[a0_0x149e33(0x25f)];get[a0_0x149e33(0x1c5)](){const _0x471c7a=a0_0x149e33;if(!this['_stage'])throw new Error(_0x471c7a(0x22f));return this['_stage'];}constructor(){}static[a0_0x149e33(0x1be)](){const _0x2161ec=a0_0x149e33;return!ProjectManager[_0x2161ec(0x21b)]&&(ProjectManager[_0x2161ec(0x21b)]=new ProjectManager()),ProjectManager[_0x2161ec(0x21b)];}async[a0_0x149e33(0x2e9)](_0x36ddc1){const _0x14374a=a0_0x149e33,_0x55f712=node_path['join'](_0x36ddc1,SYSTEM_FOLDER,STAGE_FOLDER_NAME);await promises['rm'](_0x55f712,{'recursive':!![],'force':!![]}),await promises[_0x14374a(0x1ea)](_0x55f712,{'recursive':!![]});const _0x32de5f=await this['readConfig'](_0x36ddc1),_0x2e1112=await this[_0x14374a(0x1b1)](_0x36ddc1),_0x246e11=await this[_0x14374a(0x1f3)](_0x36ddc1);this[_0x14374a(0x25f)]=new Stage({'projectPath':_0x36ddc1,'stagePath':_0x55f712,'config':_0x32de5f,'branchState':_0x2e1112,'componentsState':_0x246e11});}async[a0_0x149e33(0x2f2)](){const _0x86d7c1=a0_0x149e33;await this[_0x86d7c1(0x1c5)]['apply']();}async[a0_0x149e33(0x2eb)](){const _0x3fca57=a0_0x149e33;await this[_0x3fca57(0x1c5)][_0x3fca57(0x255)]();}async[a0_0x149e33(0x2fc)]({config:_0x2dfbb8}){const _0x23c7bd=a0_0x149e33,_0x51fedc=new InitProjectAction({'stage':this[_0x23c7bd(0x1c5)],'config':_0x2dfbb8});await _0x51fedc[_0x23c7bd(0x2ec)]();}[a0_0x149e33(0x280)](_0x4dd9bc){const _0x1b058f=a0_0x149e33;this['stage'][_0x1b058f(0x18f)](_0x4dd9bc);}async['saveComponent'](_0x524eb3){const _0x5240cf=a0_0x149e33,_0x3d8283=new SaveComponentAction({'stage':this[_0x5240cf(0x1c5)]});await _0x3d8283[_0x5240cf(0x2ec)](_0x524eb3);}async[a0_0x149e33(0x29b)](){const _0x55fe3d=a0_0x149e33,_0x5bd2bd=new FindChangesAction({'stage':this['stage']});return _0x5bd2bd[_0x55fe3d(0x2ec)]();}async['compareWithRemoteBranch'](_0x5df033){const _0x3dc7c2=a0_0x149e33,_0x3d7833=new CompareWithRemoteBranchAction({..._0x5df033,'stage':this[_0x3dc7c2(0x1c5)]});return _0x3d7833['execute']();}async[a0_0x149e33(0x2ab)](_0x290e4f){const _0x572eeb=a0_0x149e33,_0x2c44f0=node_path[_0x572eeb(0x19f)](_0x290e4f,SYSTEM_FOLDER,CONFIG_FILE_NAME),_0x3a8380=await FileUtils[_0x572eeb(0x298)](_0x2c44f0);if(!_0x3a8380)return INITIAL_CONFIG;const _0x518714=await promises['readFile'](_0x2c44f0);return JSON[_0x572eeb(0x2bd)](_0x518714[_0x572eeb(0x20c)]());}async['readBranchState'](_0x5d7188){const _0x10df88=a0_0x149e33,_0x4a33b5=node_path[_0x10df88(0x19f)](_0x5d7188,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),_0x700894=await FileUtils['isFileExists'](_0x4a33b5);if(!_0x700894)return INITIAL_BRANCH_STATE;const _0x18a68c=await promises[_0x10df88(0x18c)](_0x4a33b5);return JSON[_0x10df88(0x2bd)](_0x18a68c[_0x10df88(0x20c)]());}async['readComponentsState'](_0x2096a0){const _0x1e892b=a0_0x149e33,_0x1814c8=node_path[_0x1e892b(0x19f)](_0x2096a0,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),_0x408136=await FileUtils['isFileExists'](_0x1814c8);if(!_0x408136)return[];const _0x2dce3e=await promises[_0x1e892b(0x18c)](_0x1814c8);return JSON['parse'](_0x2dce3e['toString']());}async[a0_0x149e33(0x2b0)](_0x276867){const _0x358f67=a0_0x149e33,_0x1cab74=[node_path[_0x358f67(0x19f)](_0x276867,SYSTEM_FOLDER,CONFIG_FILE_NAME),node_path[_0x358f67(0x19f)](_0x276867,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),node_path[_0x358f67(0x19f)](_0x276867,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),node_path[_0x358f67(0x19f)](_0x276867,SFDX_PROJECT_FILE_NAME)];for(const _0x20f0db of _0x1cab74){const _0x6a2a66=await FileUtils[_0x358f67(0x298)](_0x20f0db);if(!_0x6a2a66)return![];}return!![];}async[a0_0x149e33(0x181)](_0x1bd874,_0x2d4850){const _0x584e23=a0_0x149e33,_0x21dd8f=new ConfigSetAction({'stage':this[_0x584e23(0x1c5)]});await _0x21dd8f[_0x584e23(0x2ec)]({'name':_0x1bd874,'value':_0x2d4850});}async['unsetConfig'](_0x13dd6d){const _0x4189ac=a0_0x149e33;this['stage'][_0x4189ac(0x297)](_0x13dd6d);}[a0_0x149e33(0x2b9)](_0x5841b0){const _0x2301a8=a0_0x149e33;return this[_0x2301a8(0x1c5)][_0x2301a8(0x2b9)](_0x5841b0);}async[a0_0x149e33(0x21c)](_0x1c5f33){const _0x5e2890=a0_0x149e33;await this['stage'][_0x5e2890(0x21c)](_0x1c5f33);}[a0_0x149e33(0x285)](_0x1ce5b3){const _0x113b69=a0_0x149e33;this[_0x113b69(0x1c5)][_0x113b69(0x300)]=_0x1ce5b3;}}class ReadlineUtils{static async[a0_0x149e33(0x260)](_0x136aab){const _0x400892=a0_0x149e33,_0x104235=readline[_0x400892(0x229)]({'input':process[_0x400892(0x197)],'output':process[_0x400892(0x1e3)]}),_0x336076=await _0x104235[_0x400892(0x25e)](_0x136aab);return _0x104235[_0x400892(0x228)](),_0x336076;}}const INFO_COLOR_INDEX='4',WARN_COLOR_INDEX='3',ERROR_COLOR_INDEX='1';class Logger{[a0_0x149e33(0x235)];[a0_0x149e33(0x1c0)];[a0_0x149e33(0x269)];[a0_0x149e33(0x2c3)];constructor({isJson:_0x4a07c4}){const _0x31c2b1=a0_0x149e33;this['isJson']=_0x4a07c4,debug[_0x31c2b1(0x171)]=console[_0x31c2b1(0x171)][_0x31c2b1(0x2a0)](console),debug[_0x31c2b1(0x186)](ROOT_NAME+':*'),this[_0x31c2b1(0x1c0)]=debug(ROOT_NAME+_0x31c2b1(0x2ff)),this[_0x31c2b1(0x1c0)]['color']=INFO_COLOR_INDEX,this[_0x31c2b1(0x269)]=debug(ROOT_NAME+_0x31c2b1(0x254)),this[_0x31c2b1(0x269)][_0x31c2b1(0x27f)]=WARN_COLOR_INDEX,this[_0x31c2b1(0x2c3)]=debug(ROOT_NAME+_0x31c2b1(0x22d)),this[_0x31c2b1(0x2c3)][_0x31c2b1(0x27f)]=ERROR_COLOR_INDEX;}['info'](_0x2eccb2){const _0x48c5f5=a0_0x149e33;!this[_0x48c5f5(0x235)]&&this[_0x48c5f5(0x1c0)](_0x2eccb2);}[a0_0x149e33(0x2dd)](_0x22c9f1){const _0x3fb5f6=a0_0x149e33;!this['isJson']&&this[_0x3fb5f6(0x269)](_0x22c9f1);}['error'](_0x4757c9){const _0x7cbc3a=a0_0x149e33;!this[_0x7cbc3a(0x235)]&&this['errorDebug'](_0x4757c9);}}class BaseCommand{[a0_0x149e33(0x173)];get['logger'](){const _0x496b88=a0_0x149e33;if(!this[_0x496b88(0x173)])throw new Error(_0x496b88(0x1c9));return this[_0x496b88(0x173)];}[a0_0x149e33(0x22e)](_0x2de1f9){const _0x3b230a=a0_0x149e33,_0x5d12d4=new commander[(_0x3b230a(0x2ce))]()[_0x3b230a(0x25a)](this['commandName'])[_0x3b230a(0x29f)](this[_0x3b230a(0x29f)]);for(const {name:_0x51c113,description:_0x3d18e5,defaultValue:_0x26a3a3}of this['arguments']){_0x5d12d4[_0x3b230a(0x1d3)](_0x51c113,_0x3d18e5,_0x26a3a3);}for(const {flags:_0x14dde0,description:_0x71126f,defaultValue:_0x423907}of this[_0x3b230a(0x2a8)]){_0x5d12d4[_0x3b230a(0x185)](_0x14dde0,_0x71126f,_0x423907);}_0x5d12d4['action'](async(..._0x4ff265)=>{const _0x2ee995=_0x3b230a,_0x55e455=this['isJson'](_0x4ff265);this[_0x2ee995(0x173)]=new Logger({'isJson':_0x55e455});try{const _0x2c96e6=await this['execute'](_0x4ff265);_0x2c96e6[_0x2ee995(0x166)](_0x55e455);}catch(_0x4216bd){_0x4216bd instanceof Error&&this[_0x2ee995(0x17c)][_0x2ee995(0x230)](_0x4216bd['message']||INTERNAL_ERROR);}}),_0x2de1f9[_0x3b230a(0x2b3)](_0x5d12d4);}}class BaseReporter{[a0_0x149e33(0x189)];get['success'](){const _0x452e69=a0_0x149e33;return this[_0x452e69(0x189)];}constructor(_0x251f67){const _0x5efa8=a0_0x149e33;this[_0x5efa8(0x189)]=_0x251f67[_0x5efa8(0x180)];}[a0_0x149e33(0x166)](_0x669903){const _0x32dd4e=a0_0x149e33,_0x3a2b14=this[_0x32dd4e(0x1f2)]();_0x669903?this[_0x32dd4e(0x19b)](_0x3a2b14):this[_0x32dd4e(0x278)](_0x3a2b14);}[a0_0x149e33(0x19b)](_0x24fabb){const _0x402ef2=a0_0x149e33,_0x1f078b=JSON['stringify'](_0x24fabb,null,0x2);console[_0x402ef2(0x171)](_0x1f078b);}}class FailReporter extends BaseReporter{[a0_0x149e33(0x198)];constructor({failMessage:_0x574a88}){const _0x129750=a0_0x149e33;super({'success':![]}),this[_0x129750(0x198)]=_0x574a88;}[a0_0x149e33(0x1f2)](){const _0x416313=a0_0x149e33;return{'success':this['success'],'failMessage':this[_0x416313(0x198)]};}['print'](_0x5462fe){const _0xa9b838=a0_0x149e33,_0x35237b=[[_0xa9b838(0x1a5)],[_0x5462fe[_0xa9b838(0x198)]]];console[_0xa9b838(0x171)](table[_0xa9b838(0x1e6)](_0x35237b,{'columns':[{'width':0x64}]}));}}class CheckoutReporter extends BaseReporter{[a0_0x149e33(0x19d)];[a0_0x149e33(0x2ae)];constructor({currentBranch:_0x394912,changes:_0x40134e}){const _0x54fccf=a0_0x149e33;super({'success':!![]}),this['currentBranch']=_0x394912,this[_0x54fccf(0x2ae)]=_0x40134e;}[a0_0x149e33(0x1f2)](){const _0x23a2ba=a0_0x149e33;return{'success':this[_0x23a2ba(0x180)],'targetBranch':this[_0x23a2ba(0x19d)],'changes':this['changes']};}[a0_0x149e33(0x278)](_0x11848f){const _0x4e2193=a0_0x149e33;console[_0x4e2193(0x171)]('Current\x20Branch:\x20'+this['currentBranch'][_0x4e2193(0x25a)]+'\x0a'),console[_0x4e2193(0x171)]('Project\x20Updates:');const _0x14b3de=[[_0x4e2193(0x17f),_0x4e2193(0x1d7),_0x4e2193(0x216),'Files']];for(const {changeType:_0x36dfa4,name:_0x639d2,type:_0x396f97,paths:_0x5ae2e5}of _0x11848f[_0x4e2193(0x2ae)]){_0x14b3de['push']([_0x36dfa4,_0x639d2,_0x396f97,_0x5ae2e5?.[_0x4e2193(0x19f)]('\x0a')||'']);}console[_0x4e2193(0x171)](table['table'](_0x14b3de,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class BaseHandler{}class TargetBranchExistHandler extends BaseHandler{['manager'];[a0_0x149e33(0x1b5)];[a0_0x149e33(0x23d)];['logger'];[a0_0x149e33(0x19e)]=[];constructor(_0x4ae26e){const _0x95b34d=a0_0x149e33;super(),this['manager']=_0x4ae26e[_0x95b34d(0x294)],this['credentials']=_0x4ae26e[_0x95b34d(0x1b5)],this[_0x95b34d(0x23d)]=_0x4ae26e[_0x95b34d(0x23d)],this['logger']=_0x4ae26e[_0x95b34d(0x17c)];}async[a0_0x149e33(0x1f6)](){const _0x30e299=a0_0x149e33,_0x3cd8da=await this[_0x30e299(0x26a)]();if(_0x3cd8da)return new FailReporter({'failMessage':'Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed'});return this['logger'][_0x30e299(0x1a6)](_0x30e299(0x1fb)),this['logger']['info']('Retrieve\x20components\x20started'),await this['retrieveDifference'](),this['logger'][_0x30e299(0x1a6)](_0x30e299(0x2cf)),new CheckoutReporter({'currentBranch':{'id':this['targetBranch']['id'],'name':this[_0x30e299(0x23d)]['name'],'headCommitId':this[_0x30e299(0x23d)]['headCommitId']},'changes':this['componentChanges']});}async[a0_0x149e33(0x26a)](){const _0x375cb0=a0_0x149e33,_0x38dc1b=await this[_0x375cb0(0x294)]['findChanges']();return!!_0x38dc1b[_0x375cb0(0x27e)];}async[a0_0x149e33(0x289)](){const _0x4dcfc2=a0_0x149e33,{devopsUrl:_0x30dbe2,accessToken:_0x2239a8}=this['credentials'],_0x344e32=await this[_0x4dcfc2(0x294)]['compareWithRemoteBranch']({'devopsUrl':_0x30dbe2,'accessToken':_0x2239a8,'targetBranchId':this[_0x4dcfc2(0x23d)]['id'],'targetCommitId':this[_0x4dcfc2(0x23d)][_0x4dcfc2(0x27c)]});for(const {id:_0x34dd23,name:_0x47a1eb,type:_0xc7c020,changeType:_0x241538}of _0x344e32){if(!_0x34dd23){if(_0x241538!==ChangeType[_0x4dcfc2(0x2e6)])throw new Error(_0x4dcfc2(0x2c9));await this[_0x4dcfc2(0x294)]['saveComponent']({'name':_0x47a1eb,'type':_0xc7c020,'changeType':_0x241538}),this[_0x4dcfc2(0x19e)]['push']({'changeType':_0x241538,'name':_0x47a1eb,'type':_0xc7c020});continue;}const _0x43e78b=await ApiService[_0x4dcfc2(0x238)]({'devopsUrl':_0x30dbe2,'accessToken':_0x2239a8,'componentId':_0x34dd23});if(!_0x43e78b['fHash'])throw new Error('fHash\x20for\x20component\x20\x22'+_0x43e78b[_0x4dcfc2(0x25a)]+'\x22\x20of\x20type\x20\x22'+_0x43e78b[_0x4dcfc2(0x26d)]+_0x4dcfc2(0x1db));await this[_0x4dcfc2(0x294)][_0x4dcfc2(0x2fa)]({'name':_0x47a1eb,'type':_0xc7c020,'changeType':_0x241538,'component':{..._0x43e78b,'fHash':_0x43e78b['fHash']}}),this[_0x4dcfc2(0x19e)]['push']({'changeType':_0x241538,'name':_0x47a1eb,'type':_0xc7c020,'paths':_0x43e78b[_0x4dcfc2(0x177)][_0x4dcfc2(0x1c8)](_0x440dcd=>_0x440dcd['path'])});}this[_0x4dcfc2(0x294)]['saveBranchState'](this['targetBranch']);}}class TargetBranchNotFoundHandler extends BaseHandler{[a0_0x149e33(0x2ee)];[a0_0x149e33(0x294)];['credentials'];[a0_0x149e33(0x1a3)];[a0_0x149e33(0x17c)];constructor(_0x109cfc){const _0x542cb2=a0_0x149e33;super(),this[_0x542cb2(0x2ee)]=_0x109cfc[_0x542cb2(0x2ee)],this[_0x542cb2(0x294)]=_0x109cfc[_0x542cb2(0x294)],this['credentials']=_0x109cfc['credentials'],this[_0x542cb2(0x1a3)]=_0x109cfc['targetBranchName'],this[_0x542cb2(0x17c)]=_0x109cfc[_0x542cb2(0x17c)];}async[a0_0x149e33(0x1f6)](){const _0x28e36e=a0_0x149e33;this[_0x28e36e(0x17c)][_0x28e36e(0x1a6)]('Creation\x20new\x20branch\x20started');const {id:_0x42f932}=await this[_0x28e36e(0x294)]['readBranchState'](this['projectPath']);if(!_0x42f932)return new FailReporter({'failMessage':_0x28e36e(0x21e)});const _0x2c9771=await ApiService[_0x28e36e(0x274)]({'accessToken':this[_0x28e36e(0x1b5)][_0x28e36e(0x2d9)],'devopsUrl':this[_0x28e36e(0x1b5)][_0x28e36e(0x245)],'name':this[_0x28e36e(0x1a3)],'parentId':_0x42f932});return this[_0x28e36e(0x294)][_0x28e36e(0x280)](_0x2c9771),this[_0x28e36e(0x294)]['setIsUpdateStageTimestamp'](![]),this[_0x28e36e(0x17c)]['info'](_0x28e36e(0x23a)),new CheckoutReporter({'currentBranch':_0x2c9771,'changes':[]});}}class HandlerFactory{static[a0_0x149e33(0x2ef)](_0x4fb004){const _0x13bc3d=a0_0x149e33;if(_0x4fb004[_0x13bc3d(0x23d)])return new TargetBranchExistHandler({..._0x4fb004,'targetBranch':_0x4fb004['targetBranch']});if(!_0x4fb004[_0x13bc3d(0x23d)])return new TargetBranchNotFoundHandler(_0x4fb004);throw new Error('Checkout\x20handler\x20not\x20found');}}class CheckoutCommand extends BaseCommand{['commandName']=a0_0x149e33(0x281);[a0_0x149e33(0x29f)]=a0_0x149e33(0x1b8);[a0_0x149e33(0x1a1)]=[];[a0_0x149e33(0x2a8)]=[{'flags':a0_0x149e33(0x241),'description':a0_0x149e33(0x203)},{'flags':a0_0x149e33(0x309),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x149e33(0x2ee)]=process[a0_0x149e33(0x169)]();[a0_0x149e33(0x294)]=ProjectManager['getInstance']();async[a0_0x149e33(0x2ec)]([{branch:_0x4f98ff}]){const _0x34cd42=a0_0x149e33,_0x2703d8=await this['getBranchName'](_0x4f98ff);this['logger'][_0x34cd42(0x1a6)]('Checkout\x20on\x20\x22'+_0x2703d8+_0x34cd42(0x26e));const _0x3f955=await this[_0x34cd42(0x294)][_0x34cd42(0x2b0)](this[_0x34cd42(0x2ee)]);if(!_0x3f955)return this['logger'][_0x34cd42(0x2dd)](_0x34cd42(0x2a4)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0x18e473=await this[_0x34cd42(0x1d2)](),_0x432292=await ApiService['getCredentials'](_0x18e473);await this[_0x34cd42(0x294)]['initStage'](this[_0x34cd42(0x2ee)]);try{const _0x3fcea8=await ApiService[_0x34cd42(0x1fe)]({'devopsUrl':_0x432292[_0x34cd42(0x245)],'accessToken':_0x432292['accessToken'],'branchName':_0x2703d8}),_0x5a4b10=HandlerFactory['create']({'projectPath':this['projectPath'],'manager':this['manager'],'credentials':_0x432292,'targetBranch':_0x3fcea8,'targetBranchName':_0x2703d8,'logger':this[_0x34cd42(0x17c)]}),_0x5d26dc=await _0x5a4b10['handle']();return _0x5d26dc['success']?(await this[_0x34cd42(0x294)][_0x34cd42(0x2f2)](),this['logger']['info']('Checkout\x20on\x20\x22'+_0x2703d8+_0x34cd42(0x1da))):await this['manager'][_0x34cd42(0x2eb)](),_0x5d26dc;}catch(_0x59389d){await this[_0x34cd42(0x294)][_0x34cd42(0x2eb)]();throw _0x59389d;}}[a0_0x149e33(0x235)]([{json:_0x1d5191}]){return _0x1d5191;}async[a0_0x149e33(0x1f1)](_0x2f2708){const _0x3cf47f=a0_0x149e33;if(_0x2f2708)return _0x2f2708;return ReadlineUtils[_0x3cf47f(0x260)](_0x3cf47f(0x223));}async['getCredentialsAlias'](){const _0x3ea3e3=a0_0x149e33,{credentialsAlias:_0x11dd00}=await this['manager']['readConfig'](this[_0x3ea3e3(0x2ee)]);if(!_0x11dd00)throw new Error(_0x3ea3e3(0x1f8));if(typeof _0x11dd00!==_0x3ea3e3(0x30b))throw new Error(_0x3ea3e3(0x1fa));return _0x11dd00;}}class CloneReporter extends BaseReporter{['projectPath'];[a0_0x149e33(0x308)];constructor({projectPath:_0x424fb4,components:_0x493599}){const _0x4a9ad7=a0_0x149e33;super({'success':!![]}),this[_0x4a9ad7(0x2ee)]=_0x424fb4,this[_0x4a9ad7(0x308)]=_0x493599;}[a0_0x149e33(0x1f2)](){const _0x1322c7=a0_0x149e33;return{'success':this[_0x1322c7(0x180)],'projectPath':this['projectPath'],'components':this[_0x1322c7(0x308)]};}[a0_0x149e33(0x278)](_0xdd8de2){const _0x52b849=a0_0x149e33;console[_0x52b849(0x171)](_0x52b849(0x182));const _0x132345=[[_0x52b849(0x265)],[_0xdd8de2[_0x52b849(0x2ee)]]];console[_0x52b849(0x171)](table[_0x52b849(0x1e6)](_0x132345,{'columns':[{'width':0x28}]})),console[_0x52b849(0x171)](_0x52b849(0x1bb));const _0x4db00d=[[_0x52b849(0x1d7),_0x52b849(0x216),'Files']];for(const {name:_0x4bb11a,type:_0x1929a4,paths:_0x2ad6b7}of _0xdd8de2[_0x52b849(0x308)]){_0x4db00d[_0x52b849(0x200)]([_0x4bb11a,_0x1929a4,_0x2ad6b7[_0x52b849(0x19f)]('\x0a')]);}console['log'](table['table'](_0x4db00d,{'columns':[{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CloneCommand extends BaseCommand{['commandName']='clone';[a0_0x149e33(0x29f)]=a0_0x149e33(0x2c7);[a0_0x149e33(0x1a1)]=[];[a0_0x149e33(0x2a8)]=[{'flags':a0_0x149e33(0x276),'description':a0_0x149e33(0x277)},{'flags':'-a,\x20--alias\x20<string>','description':'Alias\x20of\x20credentials\x20which\x20will\x20be\x20used\x20to\x20retrieve\x20your\x20components\x20from\x20devops.','defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x149e33(0x309),'description':a0_0x149e33(0x1fd),'defaultValue':![]}];['manager']=ProjectManager[a0_0x149e33(0x1be)]();[a0_0x149e33(0x1e9)]=[];['_credentials'];get[a0_0x149e33(0x1b5)](){const _0x2e9258=a0_0x149e33;if(!this['_credentials'])throw new Error(_0x2e9258(0x256));return this['_credentials'];}async['execute']([_0x2db1b1]){const _0x1aa4ce=a0_0x149e33;this[_0x1aa4ce(0x17c)][_0x1aa4ce(0x1a6)](_0x1aa4ce(0x1a2)),this['_credentials']=await ApiService[_0x1aa4ce(0x275)](_0x2db1b1['alias']);const _0x2184e7=await this[_0x1aa4ce(0x194)](_0x2db1b1[_0x1aa4ce(0x25a)]);this[_0x1aa4ce(0x17c)][_0x1aa4ce(0x1a6)](_0x1aa4ce(0x306));const _0x1a84f2=await this[_0x1aa4ce(0x294)][_0x1aa4ce(0x2b0)](_0x2184e7);if(_0x1a84f2)return this[_0x1aa4ce(0x17c)]['warn'](_0x1aa4ce(0x1d1)),new FailReporter({'failMessage':_0x1aa4ce(0x1d1)});await this['manager'][_0x1aa4ce(0x2e9)](_0x2184e7);try{return await this['manager'][_0x1aa4ce(0x2fc)]({'config':{'credentialsAlias':_0x2db1b1[_0x1aa4ce(0x1c1)]}}),this['logger'][_0x1aa4ce(0x1a6)](_0x1aa4ce(0x240)),await this[_0x1aa4ce(0x1c6)](),await this['manager'][_0x1aa4ce(0x2f2)](),this[_0x1aa4ce(0x17c)]['info'](_0x1aa4ce(0x2a3)),new CloneReporter({'projectPath':_0x2184e7,'components':this[_0x1aa4ce(0x1e9)]});}catch(_0x2748c9){await this[_0x1aa4ce(0x294)][_0x1aa4ce(0x2eb)]();throw _0x2748c9;}}[a0_0x149e33(0x235)]([{json:_0x3a14e8}]){return _0x3a14e8;}async['retrieve'](){const _0x8920d9=a0_0x149e33;this['logger'][_0x8920d9(0x1a6)](_0x8920d9(0x2c2));const {accessToken:_0xc2e47d,devopsUrl:_0x1f2e17}=this['credentials'],_0x28fe2f=await ApiService[_0x8920d9(0x2a9)]({'devopsUrl':_0x1f2e17,'accessToken':_0xc2e47d});this[_0x8920d9(0x294)][_0x8920d9(0x280)](_0x28fe2f);for await(const _0x33130e of ApiService[_0x8920d9(0x239)]({'devopsUrl':_0x1f2e17,'accessToken':_0xc2e47d,'branchId':_0x28fe2f['id'],'commitId':_0x28fe2f[_0x8920d9(0x27c)]})){if(!_0x33130e[_0x8920d9(0x2d8)])throw new Error(_0x33130e[_0x8920d9(0x25a)]+_0x8920d9(0x1e0)+_0x33130e[_0x8920d9(0x26d)]+_0x8920d9(0x2be));await this[_0x8920d9(0x294)][_0x8920d9(0x2fa)]({'name':_0x33130e[_0x8920d9(0x25a)],'type':_0x33130e[_0x8920d9(0x26d)],'changeType':ChangeType['CREATE'],'component':{..._0x33130e,'fHash':_0x33130e['fHash']}}),this[_0x8920d9(0x1e9)][_0x8920d9(0x200)]({'name':_0x33130e['name'],'type':_0x33130e[_0x8920d9(0x26d)],'paths':_0x33130e[_0x8920d9(0x177)]['map'](_0x4ada2e=>_0x4ada2e[_0x8920d9(0x2e5)])});}this[_0x8920d9(0x17c)][_0x8920d9(0x1a6)](_0x8920d9(0x2cf));}async[a0_0x149e33(0x194)](_0x35366b){const _0x5d28ee=a0_0x149e33;if(_0x35366b)return node_path[_0x5d28ee(0x19f)](process[_0x5d28ee(0x169)](),_0x35366b);const _0x2358e6=await ReadlineUtils['askString'](_0x5d28ee(0x303));return node_path[_0x5d28ee(0x19f)](process['cwd'](),_0x2358e6);}}class CommitReporter extends BaseReporter{[a0_0x149e33(0x2ae)];constructor({changes:_0x5c5f1a}){const _0x36de79=a0_0x149e33;super({'success':!![]}),this[_0x36de79(0x2ae)]=_0x5c5f1a;}[a0_0x149e33(0x1f2)](){const _0x5d7235=a0_0x149e33;return{'success':this[_0x5d7235(0x180)],'changes':this[_0x5d7235(0x2ae)]};}['print'](_0x27d825){const _0x77536c=a0_0x149e33;console[_0x77536c(0x171)](_0x77536c(0x195));const _0x55bcfb=[[_0x77536c(0x17f),'Name',_0x77536c(0x216),_0x77536c(0x26f)]];for(const {changeType:_0x3f719d,name:_0x33644c,type:_0x157ef6,paths:_0xf9523e}of _0x27d825[_0x77536c(0x2ae)]){_0x55bcfb[_0x77536c(0x200)]([_0x3f719d,_0x33644c,_0x157ef6,_0xf9523e?.[_0x77536c(0x19f)]('\x0a')||'']);}console['log'](table[_0x77536c(0x1e6)](_0x55bcfb,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}function a0_0x5dda(){const _0x3d93cc=['componentsForRetrieve','commandName','R_OK','applyCreateUpdate','fHash','accessToken','createHash','List\x20all\x20remote\x20branches.','List\x20credentials\x20started','warn','axios','Update:\x20Component\x20not\x20found','targetCommitId','userName','interceptors','Local\x20and\x20remote\x20head\x20commits\x20don\x27t\x20match.\x20Use\x20\x22flosum\x20devops\x20pull\x22\x20to\x20retrieve\x20latest\x20updates\x20from\x20devops','dirname','path','DELETE','now','-m,\x20--message\x20<string>','initStage','indexes','abortStage','execute','No\x20Local\x20Changes','projectPath','create','find','Roll\x20back\x20your\x20branch\x20state\x20to\x20last\x20committed\x20one.','applyStage','list','CLI\x20for\x20work\x20with\x20','-a,\x20--alias\x20<string>','node:readline/promises','response','Return\x20all\x20local\x20not\x20committed\x20changes.','Rollback\x20completed','saveComponent','isDirectoryExists','initProject','firstName','branchState',':INFO','isUpdateStageTimestamp','convertToLocalComponent','listComponents','Enter\x20project\x20name:\x20','then','Devops\x20Url','Project\x20initialization\x20started','rollbackTypes','components','--json','@flosum/salesforce','string','isFile','getMe','CreateProjectSfCommand','Config\x20value','report','scan','Branch\x20id\x20not\x20found','cwd','\x20components\x20will\x20be\x20committed','use','CLI','has','Deleted','delete','2888360yZpScV','log','Value','_logger','handleFileChange','size','Component\x20','files','<value>','lastName','value','cleanUpEmptyFolders','logger','catch','Create\x20salesforce\x20project\x20and\x20cli\x20system\x20files.','Change\x20Type','success','setConfig','Init\x20Result:','node:os','fit/file-versions/','option','enable','convertToCommit','getMessage','_success','deleteComponent','fileChanges','readFile','isDirectory','main','updateBranchState','post','Local\x20head\x20commit\x20id\x20not\x20found','indexOf','.stage','buildProjectPath','Committed\x20Components:','1220502UKqKHx','stdin','failMessage','12CRmwrt','Login\x20successfully\x20completed.\x20You\x20credentials\x20are\x20saved\x20with\x20alias\x20\x22','printJson','debug','currentBranch','componentChanges','join','No\x20changes\x20for\x20rollback','arguments','Cloning\x20started','targetBranchName','content','Fail\x20Message','info','Stage\x20folder\x20not\x20found','constructor','SALESFORCE','Pulling\x20latest\x20updates\x20started','Head\x20commit\x20id\x20not\x20found','commitId','_credentials','compareWithRemoteBranch','createComponent','component','readBranchState','Display\x20all\x20authorized\x20credentials.','Component\x20Updates:','findIndex','credentials','status','pendingChanges','Checkout\x20on\x20another\x20branch.\x20Checkout\x20command\x20retrieves\x20components\x20missing\x20locally.','search','init','Retrieve\x20Result:','getAllCredentials','paths','getInstance','Credentials\x20with\x20alias\x20\x22','infoDebug','alias','\x20services.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','branchName','_localHeadCommit','stage','retrieve','calculateComponentHash','map','Logger\x20not\x20found','targetBranchId','applyDelete','node_modules','_componentsState','rollback','Detecting\x20changes\x20completed.\x20','changeType','Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.','getCredentialsAlias','argument','base64','42JFUihj','(string)','Name','components-state.json','/api/v1/links','\x22\x20completed','\x22\x20not\x20found','update','localHeadCommit','Not\x20Found','Devops\x20url\x20not\x20found','\x20of\x20type\x20','apply','Config\x20set\x20completed','stdout','Missing\x20content\x20for\x20not\x20Delete\x20change\x20type','auth/me','table','node:path','entries','retrievedComponents','mkdir','fit/branches','config','CREDENTIALS_ALIAS','componentsState','Enter\x20commit\x20message:\x20','flat','getBranchName','buildReport','readComponentsState','isAxiosError','devops','handle','get','Credentials\x20alias\x20is\x20not\x20configured','Commit\x20message.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','Invalid\x20credentials\x20type','Checking\x20manual\x20changes\x20completed','Config\x20set\x20started','Applies\x20json\x20formatted\x20result.','getBranch','logout','push','config.json','basename','A\x20branch\x20name\x20which\x20you\x20checkout\x20on.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','Looking\x20for\x20changes\x20started','_branchState','Login\x20started','59900sJNgHp','Detecting\x20changes\x20started','DevOps','from','Delete\x20saved\x20credentials.','toString','copyFile','Changes\x20not\x20found','credentials.json','constants','Pending\x20Changes:','version','getAccessToken','findDeletedAndUpdated','Looking\x20for\x20changes\x20completed.\x20','Type','_branchId','writeFile','477ruQHfD','label','instance','addFileChange','_headCommitId','To\x20create\x20a\x20new\x20branch\x20a\x20branch\x20should\x20be\x20selected.\x20Checkout\x20on\x20any\x20existing\x20branch','Status\x20calculation\x20started','cause','Logout\x20completed','PATH','Enter\x20a\x20branch\x20name:\x20','reject','defineRollbackTypes','Rolling\x20back\x20to\x20last\x20committed\x20state\x20completed','Logout\x20started','close','createInterface','getBranchById','182136CbuPFM','commitDate',':ERROR','register','Stage\x20not\x20found','error','filesChanges','includes','getFolderFilePaths','/commits','isJson','config-set','updateSystemFiles','retrieveComponentById','retrieveComponents','Creation\x20new\x20branch\x20completed','/commits/','getBranchState','targetBranch','Alias\x20which\x20saved\x20credentials\x20will\x20be\x20accessed\x20with.','branches','Project\x20initialization\x20completed','-b,\x20--branch\x20<string>','stringify','Update','updateComponent','devopsUrl','utf-8','File','A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first','message','splice','98MdGpub','api','stagePath','access','fit/branches/','\x20not\x20found','branchId','10157uOCNmg','commit',':WARN','abort','Credentials\x20not\x20found','Branch\x20Name','sep','homedir','name','applyFileChanges','Rollback\x20started','token','question','_stage','askString','File\x20\x22','11773553MdInJJ','node:crypto','fHash\x20for\x20component\x20\x22','Project\x20Path','Pulling\x20latest\x20updates\x20completed','_stagePath','split','warnDebug','areChanges','list-branches','stat','type','\x22\x20started','Files','Status\x20calculation\x20completed','areRemoteChanges','lastStageTimestamp','force-app','createBranch','getCredentials','-n,\x20--name\x20<string>','A\x20name\x20of\x20a\x20folder\x20where\x20a\x20project\x20will\x20be\x20stored.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','print','Token\x20','Config\x20Name','Config\x20name.\x20Allowed\x20values:\x20','headCommitId','Pull\x20latest\x20branch\x20commit\x20from\x20devops.','length','color','saveBranchState','checkout','errors','(((.+)+)+)+$','filter','setIsUpdateStageTimestamp','Salesforce','set','Listing\x20remote\x20branches\x20completed','retrieveDifference','UPDATE','branch-state.json','all','W_OK','changeFile','trunc','applicationUrl','readdir','Create','login','manager','Commit\x20started','Saved\x20credentials\x20alias.','unsetConfig','isFileExists','listBranches','Commit\x20completed','findChanges','findAndCommitChanges','ECONNREFUSED','_changes','description','bind','Set\x20project\x20config.','registerFileChange','Cloning\x20completed','Project\x20is\x20not\x20initialized','\x20services','globalSettingsUrl','Unknown\x20config\x20name:\x20','options','getDefaultBranch','statusText','readConfig','code','getUpdatedComponentChanges','changes','listComponentsGenerator','isInitialized','handleRestore','_isUpdateStageTimestamp','addCommand','Global\x20Settings\x20Url','pull','Rolling\x20back\x20to\x20last\x20committed\x20state\x20started','data','flosum','updateComponentState','PATH\x20env\x20not\x20found','values','NULL','parse','\x20was\x20deleted','<config-name>','configName','Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed','Retrieve\x20components\x20started','errorDebug','list-credentials','/components','commander','Initialize\x20salesforce\x20project\x20and\x20retrieve\x20\x22main\x22\x20branch\x20from\x20registered\x20devops\x20tenant.','credentialsAlias','Component\x20id\x20not\x20found\x20after\x20comparison','Enter\x20api\x20token:\x20','686355OgiMUI','Alias','-t,\x20--token\x20<string>','Command','Retrieve\x20components\x20completed','Update:\x20Component\x20','_projectPath','rows','CREATE'];a0_0x5dda=function(){return _0x3d93cc;};return a0_0x5dda();}class CommitCommand extends BaseCommand{['commandName']=a0_0x149e33(0x253);['description']='Commit\x20local\x20changes\x20to\x20a\x20remote\x20branch\x20on\x20devops.';[a0_0x149e33(0x1a1)]=[];[a0_0x149e33(0x2a8)]=[{'flags':a0_0x149e33(0x2e8),'description':a0_0x149e33(0x1f9)},{'flags':a0_0x149e33(0x309),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x149e33(0x2ee)]=process[a0_0x149e33(0x169)]();[a0_0x149e33(0x294)]=ProjectManager['getInstance']();[a0_0x149e33(0x19e)]=[];[a0_0x149e33(0x1ad)];[a0_0x149e33(0x217)];['_localHeadCommit'];[a0_0x149e33(0x29e)];get[a0_0x149e33(0x1b5)](){const _0x447746=a0_0x149e33;if(!this['_credentials'])throw new Error('Credentials\x20not\x20found');return this[_0x447746(0x1ad)];}get['branchId'](){const _0x4eb521=a0_0x149e33;if(!this['_branchId'])throw new Error(_0x4eb521(0x168));return this[_0x4eb521(0x217)];}get[a0_0x149e33(0x1dd)](){const _0x24dc62=a0_0x149e33;if(!this['_localHeadCommit'])throw new Error(_0x24dc62(0x191));return this[_0x24dc62(0x1c4)];}get[a0_0x149e33(0x2ae)](){const _0x4850df=a0_0x149e33;if(!this[_0x4850df(0x29e)])throw new Error(_0x4850df(0x20e));return this[_0x4850df(0x29e)];}async[a0_0x149e33(0x2ec)]([_0x138ccb]){const _0x194af0=a0_0x149e33;this['logger'][_0x194af0(0x1a6)](_0x194af0(0x295));const _0x5f01b8=await this[_0x194af0(0x294)][_0x194af0(0x2b0)](this[_0x194af0(0x2ee)]);if(!_0x5f01b8)return this[_0x194af0(0x17c)][_0x194af0(0x2dd)]('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':_0x194af0(0x2a4)});const _0x29aaa8=await this[_0x194af0(0x188)](_0x138ccb[_0x194af0(0x249)]);await this[_0x194af0(0x23c)](),await this[_0x194af0(0x275)]();const _0x3f94ab=await this[_0x194af0(0x271)]();if(_0x3f94ab)return this[_0x194af0(0x17c)]['warn'](_0x194af0(0x2e3)),new FailReporter({'failMessage':_0x194af0(0x2e3)});await this[_0x194af0(0x294)][_0x194af0(0x2e9)](this[_0x194af0(0x2ee)]);try{this[_0x194af0(0x29e)]=await this[_0x194af0(0x294)][_0x194af0(0x29b)]();if(!this[_0x194af0(0x2ae)][_0x194af0(0x27e)])return this[_0x194af0(0x17c)]['warn'](_0x194af0(0x2ed)),new FailReporter({'failMessage':_0x194af0(0x2ed)});return await this[_0x194af0(0x29c)](_0x29aaa8),await this['manager'][_0x194af0(0x2f2)](),this[_0x194af0(0x17c)][_0x194af0(0x1a6)](_0x194af0(0x29a)),new CommitReporter({'changes':this[_0x194af0(0x19e)]});}catch(_0x1519d5){await this[_0x194af0(0x294)][_0x194af0(0x2eb)]();throw _0x1519d5;}}[a0_0x149e33(0x235)]([{json:_0xc3dff8}]){return _0xc3dff8;}async[a0_0x149e33(0x188)](_0xa974b9){const _0x385392=a0_0x149e33;if(_0xa974b9)return _0xa974b9;const _0x4dd0a9=await ReadlineUtils[_0x385392(0x260)](_0x385392(0x1ef));return _0x4dd0a9;}async[a0_0x149e33(0x275)](){const _0x5e3c22=a0_0x149e33,{credentialsAlias:_0x2dc8cd}=await this['manager']['readConfig'](this[_0x5e3c22(0x2ee)]);if(!_0x2dc8cd)throw new Error(_0x5e3c22(0x1f8));if(typeof _0x2dc8cd!==_0x5e3c22(0x30b))throw new Error(_0x5e3c22(0x1fa));this['_credentials']=await ApiService[_0x5e3c22(0x275)](_0x2dc8cd);}async[a0_0x149e33(0x23c)](){const _0x265149=a0_0x149e33,{id:_0x1cf4e9,headCommitId:_0x3a88a6}=await this[_0x265149(0x294)][_0x265149(0x1b1)](this[_0x265149(0x2ee)]);this[_0x265149(0x217)]=_0x1cf4e9||void 0x0,this['_localHeadCommit']=_0x3a88a6||void 0x0;}async[a0_0x149e33(0x271)](){const _0x48a567=a0_0x149e33,{headCommitId:_0x387cc2}=await ApiService[_0x48a567(0x22a)]({'accessToken':this[_0x48a567(0x1b5)]['accessToken'],'devopsUrl':this[_0x48a567(0x1b5)][_0x48a567(0x245)],'branchId':this[_0x48a567(0x251)]});return this[_0x48a567(0x1dd)]!==_0x387cc2;}async[a0_0x149e33(0x29c)](_0x277bfe){const _0x48239d=a0_0x149e33;this[_0x48239d(0x17c)][_0x48239d(0x1a6)](_0x48239d(0x208));const _0x513068=await ApiService[_0x48239d(0x163)]({'accessToken':this[_0x48239d(0x1b5)][_0x48239d(0x2d9)],'devopsUrl':this['credentials'][_0x48239d(0x245)]}),_0x428aa7={'accessToken':this[_0x48239d(0x1b5)][_0x48239d(0x2d9)],'devopsUrl':this['credentials'][_0x48239d(0x245)],'message':_0x277bfe,'branchId':this[_0x48239d(0x251)],'components':[],'userName':_0x513068[_0x48239d(0x2fd)]+'\x20'+_0x513068[_0x48239d(0x179)]};for(const _0x1d80bf of this[_0x48239d(0x2ae)]){const _0x2a5b33=await this['manager'][_0x48239d(0x2b9)](_0x1d80bf),_0x5620eb=_0x2a5b33[_0x48239d(0x1d0)]===ChangeType[_0x48239d(0x2d3)]?_0x2a5b33[_0x48239d(0x25a)]:void 0x0,_0x1b7e2c=this['convertToLocalComponent'](_0x2a5b33[_0x48239d(0x25a)],_0x5620eb,_0x2a5b33[_0x48239d(0x26d)],_0x2a5b33?.['paths']||[]);_0x428aa7['components'][_0x48239d(0x200)](_0x1b7e2c),this[_0x48239d(0x19e)][_0x48239d(0x200)](_0x2a5b33);}this[_0x48239d(0x17c)][_0x48239d(0x1a6)](_0x48239d(0x1cf)+this[_0x48239d(0x2ae)][_0x48239d(0x27e)]+_0x48239d(0x16a)),await ApiService[_0x48239d(0x253)](_0x428aa7);const _0x28e7ae=await ApiService[_0x48239d(0x22a)]({'accessToken':this[_0x48239d(0x1b5)][_0x48239d(0x2d9)],'devopsUrl':this[_0x48239d(0x1b5)]['devopsUrl'],'branchId':this[_0x48239d(0x251)]});this[_0x48239d(0x294)][_0x48239d(0x280)](_0x28e7ae);}[a0_0x149e33(0x301)](_0x253857,_0x4502ea,_0x4d77c3,_0x3bdea0){const _0x78c36a=a0_0x149e33,_0x1f5ac5={'name':_0x253857,'label':_0x4502ea,'type':_0x4d77c3,'files':[]};for(const _0x437bd5 of _0x3bdea0){const _0x121f24=_0x437bd5['split'](node_path[_0x78c36a(0x258)])['slice'](0x3)[_0x78c36a(0x19f)]('/'),_0x4cbbf9=node_path[_0x78c36a(0x19f)](this[_0x78c36a(0x2ee)],_0x437bd5);_0x1f5ac5['files']['push']({'path':_0x121f24,'localPath':_0x4cbbf9});}return _0x1f5ac5;}}class ConfigSetReporter extends BaseReporter{[a0_0x149e33(0x2c0)];[a0_0x149e33(0x17a)];constructor({configName:_0x4a66d7,value:_0x5114bd}){const _0x385adb=a0_0x149e33;super({'success':!![]}),this[_0x385adb(0x2c0)]=_0x4a66d7,this[_0x385adb(0x17a)]=_0x5114bd;}[a0_0x149e33(0x1f2)](){const _0x20c1c0=a0_0x149e33;return{'success':this[_0x20c1c0(0x180)],'configName':this[_0x20c1c0(0x2c0)],'value':this[_0x20c1c0(0x17a)]};}['print'](_0x312802){const _0x390b61=a0_0x149e33,_0x348611=[[_0x390b61(0x27a),_0x390b61(0x172)],[_0x312802['configName'],_0x312802['value']]];console['log'](table[_0x390b61(0x1e6)](_0x348611));}}const ALLOWED_VALUES=[ConfigName[a0_0x149e33(0x1ed)]+a0_0x149e33(0x1d6)];class ConfigSetCommand extends BaseCommand{['commandName']=a0_0x149e33(0x236);[a0_0x149e33(0x29f)]=a0_0x149e33(0x2a1);['arguments']=[{'name':a0_0x149e33(0x2bf),'description':'Config\x20name.\x20Allowed\x20values:\x20'+ALLOWED_VALUES['join'](',\x20')+'.'},{'name':a0_0x149e33(0x178),'description':a0_0x149e33(0x165)}];[a0_0x149e33(0x2a8)]=[{'flags':a0_0x149e33(0x309),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x149e33(0x294)]=ProjectManager[a0_0x149e33(0x1be)]();async[a0_0x149e33(0x2ec)]([_0x44be60,_0x5d707e]){const _0x4e53a9=a0_0x149e33;this[_0x4e53a9(0x17c)][_0x4e53a9(0x1a6)](_0x4e53a9(0x1fc));const _0x10ea3c=process[_0x4e53a9(0x169)](),_0x3cd3f3=await this['manager'][_0x4e53a9(0x2b0)](_0x10ea3c);if(!_0x3cd3f3)return this[_0x4e53a9(0x17c)][_0x4e53a9(0x2dd)](_0x4e53a9(0x2a4)),new FailReporter({'failMessage':_0x4e53a9(0x2a4)});await this[_0x4e53a9(0x294)][_0x4e53a9(0x2e9)](_0x10ea3c);try{return await this['manager'][_0x4e53a9(0x181)](_0x44be60,_0x5d707e),await this[_0x4e53a9(0x294)][_0x4e53a9(0x2f2)](),this[_0x4e53a9(0x17c)][_0x4e53a9(0x1a6)](_0x4e53a9(0x1e2)),new ConfigSetReporter({'configName':_0x44be60,'value':_0x5d707e});}catch(_0x25ec0e){await this[_0x4e53a9(0x294)][_0x4e53a9(0x2eb)]();throw _0x25ec0e;}}['isJson']([,,{json:_0x2d5bb9}]){return _0x2d5bb9;}}class ConfigUnsetReporter extends BaseReporter{[a0_0x149e33(0x2c0)];constructor(_0xf0a6dc){const _0x1396d5=a0_0x149e33;super({'success':!![]}),this['configName']=_0xf0a6dc[_0x1396d5(0x2c0)];}[a0_0x149e33(0x1f2)](){const _0xb06694=a0_0x149e33;return{'success':!![],'configName':this[_0xb06694(0x2c0)],'value':null};}[a0_0x149e33(0x278)](_0x39c22c){const _0x489c07=a0_0x149e33,_0x38025b=[[_0x489c07(0x27a),_0x489c07(0x172)],[_0x39c22c[_0x489c07(0x2c0)],_0x39c22c['value']||_0x489c07(0x2bc)]];console['log'](table[_0x489c07(0x1e6)](_0x38025b));}}class ConfigUnset extends BaseCommand{[a0_0x149e33(0x2d5)]='config-unset';[a0_0x149e33(0x29f)]='Clear\x20project\x20config\x20property.';[a0_0x149e33(0x1a1)]=[{'name':a0_0x149e33(0x2bf),'description':a0_0x149e33(0x27b)+Object['values'](ConfigName)[a0_0x149e33(0x19f)](',\x20')+'.'}];[a0_0x149e33(0x2a8)]=[{'flags':'--json','description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x149e33(0x2ee)]=process[a0_0x149e33(0x169)]();[a0_0x149e33(0x294)]=ProjectManager[a0_0x149e33(0x1be)]();async[a0_0x149e33(0x2ec)]([_0x4110b4]){const _0x1896f3=a0_0x149e33;this[_0x1896f3(0x17c)][_0x1896f3(0x1a6)](_0x1896f3(0x1fc));const _0x7d3060=await this[_0x1896f3(0x294)][_0x1896f3(0x2b0)](this[_0x1896f3(0x2ee)]);if(!_0x7d3060)return this[_0x1896f3(0x17c)][_0x1896f3(0x2dd)](_0x1896f3(0x2a4)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});await this['manager'][_0x1896f3(0x2e9)](this[_0x1896f3(0x2ee)]);try{return await this[_0x1896f3(0x294)][_0x1896f3(0x297)](_0x4110b4),await this[_0x1896f3(0x294)][_0x1896f3(0x2f2)](),this[_0x1896f3(0x17c)][_0x1896f3(0x1a6)]('Config\x20set\x20completed'),new ConfigUnsetReporter({'configName':_0x4110b4});}catch(_0xdbfadd){await this['manager'][_0x1896f3(0x2eb)]();throw _0xdbfadd;}}[a0_0x149e33(0x235)]([,{json:_0x18dc7d}]){return _0x18dc7d;}}class InitReporter extends BaseReporter{[a0_0x149e33(0x2ee)];constructor({projectPath:_0x37aaae}){const _0x9882b0=a0_0x149e33;super({'success':!![]}),this[_0x9882b0(0x2ee)]=_0x37aaae;}[a0_0x149e33(0x1f2)](){return{'success':this['success'],'projectPath':this['projectPath']};}['print'](_0x253be2){const _0x59ff45=a0_0x149e33,_0x52662d=[[_0x59ff45(0x265)],[_0x253be2[_0x59ff45(0x2ee)]]];console['log'](table[_0x59ff45(0x1e6)](_0x52662d,{'columns':[{'width':0x28}]}));}}class InitCommand extends BaseCommand{[a0_0x149e33(0x2d5)]=a0_0x149e33(0x1ba);[a0_0x149e33(0x29f)]=a0_0x149e33(0x17e);[a0_0x149e33(0x1a1)]=[];[a0_0x149e33(0x2a8)]=[{'flags':'-n,\x20--name\x20<string>','description':'A\x20name\x20of\x20a\x20folder\x20where\x20a\x20project\x20will\x20be\x20stored.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.'},{'flags':a0_0x149e33(0x309),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x149e33(0x294)]=ProjectManager['getInstance']();async[a0_0x149e33(0x2ec)]([_0x48ebac]){const _0x28f766=a0_0x149e33;this[_0x28f766(0x17c)][_0x28f766(0x1a6)](_0x28f766(0x306));const _0x30fe71=await this[_0x28f766(0x194)](_0x48ebac[_0x28f766(0x25a)]),_0x4751b5=await this[_0x28f766(0x294)]['isInitialized'](_0x30fe71);if(_0x4751b5)return this[_0x28f766(0x17c)][_0x28f766(0x2dd)](_0x28f766(0x1d1)),new FailReporter({'failMessage':_0x28f766(0x1d1)});await this[_0x28f766(0x294)][_0x28f766(0x2e9)](_0x30fe71);try{return await this[_0x28f766(0x294)][_0x28f766(0x2fc)]({}),await this['manager'][_0x28f766(0x2f2)](),this[_0x28f766(0x17c)][_0x28f766(0x1a6)](_0x28f766(0x240)),new InitReporter({'projectPath':_0x30fe71});}catch(_0x2bec1a){await this[_0x28f766(0x294)][_0x28f766(0x2eb)]();throw _0x2bec1a;}}[a0_0x149e33(0x235)]([{json:_0x59a51d}]){return _0x59a51d;}async['buildProjectPath'](_0x1bc237){const _0xe1f3d4=a0_0x149e33;if(_0x1bc237)return node_path[_0xe1f3d4(0x19f)](process[_0xe1f3d4(0x169)](),_0x1bc237);const _0x1de4b8=await ReadlineUtils[_0xe1f3d4(0x260)](_0xe1f3d4(0x303));return node_path[_0xe1f3d4(0x19f)](process[_0xe1f3d4(0x169)](),_0x1de4b8);}}class ListBranchesReporter extends BaseReporter{[a0_0x149e33(0x23f)];constructor(_0x4701b6){const _0x421d5a=a0_0x149e33;super({'success':!![]}),this['branches']=_0x4701b6[_0x421d5a(0x23f)];}[a0_0x149e33(0x1f2)](){const _0x3dbe95=a0_0x149e33;return{'success':this[_0x3dbe95(0x180)],'branches':this[_0x3dbe95(0x23f)]};}[a0_0x149e33(0x278)](_0x18ee99){const _0x14b6e0=a0_0x149e33,_0xb70641=[[_0x14b6e0(0x257)]];for(const _0x7a747e of _0x18ee99[_0x14b6e0(0x23f)]){_0xb70641[_0x14b6e0(0x200)]([_0x7a747e]);}console[_0x14b6e0(0x171)](table[_0x14b6e0(0x1e6)](_0xb70641,{'columns':[{'width':0x1e}]}));}}class ListBranchesCommand extends BaseCommand{[a0_0x149e33(0x2d5)]=a0_0x149e33(0x26b);['description']=a0_0x149e33(0x2db);[a0_0x149e33(0x1a1)]=[];[a0_0x149e33(0x2a8)]=[{'flags':a0_0x149e33(0x309),'description':a0_0x149e33(0x1fd),'defaultValue':![]}];[a0_0x149e33(0x2ee)]=process[a0_0x149e33(0x169)]();['manager']=ProjectManager[a0_0x149e33(0x1be)]();async['execute'](){const _0x184d5d=a0_0x149e33;this[_0x184d5d(0x17c)][_0x184d5d(0x1a6)]('Listing\x20remote\x20branches\x20started');const _0x1a0c18=await this[_0x184d5d(0x294)]['isInitialized'](this['projectPath']);if(!_0x1a0c18)return this[_0x184d5d(0x17c)][_0x184d5d(0x2dd)](_0x184d5d(0x2a4)),new FailReporter({'failMessage':_0x184d5d(0x2a4)});const _0xf7a849=await this[_0x184d5d(0x1d2)](),{accessToken:_0x425077,devopsUrl:_0x54b4b3}=await ApiService[_0x184d5d(0x275)](_0xf7a849),_0xe27956=await ApiService['listBranches']({'accessToken':_0x425077,'devopsUrl':_0x54b4b3});return this['logger'][_0x184d5d(0x1a6)](_0x184d5d(0x288)),new ListBranchesReporter({'branches':_0xe27956[_0x184d5d(0x1c8)](_0x13f021=>_0x13f021['name'])});}['isJson']([{json:_0x26a790}]){return _0x26a790;}async[a0_0x149e33(0x1d2)](){const _0x4593b8=a0_0x149e33,{credentialsAlias:_0x471863}=await this[_0x4593b8(0x294)]['readConfig'](this['projectPath']);if(!_0x471863)throw new Error('Credentials\x20alias\x20is\x20not\x20configured');if(typeof _0x471863!=='string')throw new Error(_0x4593b8(0x1fa));return _0x471863;}}class ListCredentialsReporter extends BaseReporter{[a0_0x149e33(0x1b5)];constructor(_0x3dee5a){const _0x1496f6=a0_0x149e33;super({'success':!![]}),this['credentials']=_0x3dee5a[_0x1496f6(0x1b5)];}[a0_0x149e33(0x1f2)](){const _0xe198a3=a0_0x149e33;return{'success':this[_0xe198a3(0x180)],'credentials':this[_0xe198a3(0x1b5)]};}['print'](_0x1da8c2){const _0x285eb0=a0_0x149e33,_0x137e09=[['Alias',_0x285eb0(0x2b4),_0x285eb0(0x305)]];for(const {alias:_0x52dedb,globalSettingsUrl:_0x1d493c,devopsUrl:_0x617599}of _0x1da8c2[_0x285eb0(0x1b5)]){_0x137e09[_0x285eb0(0x200)]([_0x52dedb,_0x1d493c,_0x617599||_0x285eb0(0x1de)]);}console[_0x285eb0(0x171)](table[_0x285eb0(0x1e6)](_0x137e09));}}class ListCredentialsCommand extends BaseCommand{[a0_0x149e33(0x2d5)]=a0_0x149e33(0x2c4);[a0_0x149e33(0x29f)]=a0_0x149e33(0x1b2);[a0_0x149e33(0x1a1)]=[];['options']=[{'flags':a0_0x149e33(0x309),'description':a0_0x149e33(0x1fd),'defaultValue':![]}];async['execute'](){const _0x9365a=a0_0x149e33;this[_0x9365a(0x17c)][_0x9365a(0x1a6)](_0x9365a(0x2dc));const _0x54849f=await CredentialsManager[_0x9365a(0x2f3)]();return this[_0x9365a(0x17c)]['info']('List\x20credentials\x20completed'),new ListCredentialsReporter({'credentials':_0x54849f[_0x9365a(0x1c8)](({alias:_0x7780bd,globalSettingsUrl:_0x3e6ebf,devopsUrl:_0xc02c4d})=>({'alias':_0x7780bd,'globalSettingsUrl':_0x3e6ebf,'devopsUrl':_0xc02c4d}))});}[a0_0x149e33(0x235)]([{json:_0x1ea497}]){return _0x1ea497;}}class LoginAction{constructor(_0x3f1599){const _0x46dbaa=a0_0x149e33;this[_0x46dbaa(0x2d9)]=_0x3f1599;}async[a0_0x149e33(0x2ec)](){const _0x173407=a0_0x149e33;try{const _0x2ae963=JSON[_0x173407(0x2bd)](Buffer['from'](this[_0x173407(0x2d9)],_0x173407(0x1d4))['toString'](_0x173407(0x246))),_0x2362bc=await axios['get'](_0x173407(0x1d9),{'headers':{'authorization':_0x173407(0x279)+this['accessToken']},'baseURL':_0x2ae963['applicationUrl']})['then'](({data:_0x5f56a2})=>new Map(_0x5f56a2[_0x173407(0x1c8)](_0x13f7d5=>[_0x13f7d5[_0x173407(0x25a)],_0x13f7d5[_0x173407(0x24c)]]))),_0xfe8cfd={'globalSettingsUrl':_0x2ae963[_0x173407(0x290)]};for(const [_0x3b017b,_0x2fefeb]of _0x2362bc[_0x173407(0x1e8)]()){_0x3b017b===_0x173407(0x209)&&(_0xfe8cfd['devopsUrl']=_0x2fefeb);}return _0xfe8cfd;}catch(_0x589cca){if(axios[_0x173407(0x1f4)](_0x589cca))throw Error(_0x589cca[_0x173407(0x2f7)]?.[_0x173407(0x2b7)][_0x173407(0x249)]||_0x589cca[_0x173407(0x2f7)]?.[_0x173407(0x2aa)]||_0x589cca[_0x173407(0x249)],{'cause':_0x589cca});throw _0x589cca;}}}class GlobalSettingsService{static async[a0_0x149e33(0x293)]({accessToken:_0x26fd7e}){const _0x2b38dc=a0_0x149e33,_0x3505ae=new LoginAction(_0x26fd7e);return _0x3505ae[_0x2b38dc(0x2ec)]();}}class LoginReporter extends BaseReporter{[a0_0x149e33(0x1c1)];[a0_0x149e33(0x2a6)];[a0_0x149e33(0x245)];constructor({alias:_0x245140,globalSettingsUrl:_0x5e313b,devopsUrl:_0x30ca4b}){const _0x2fd86b=a0_0x149e33;super({'success':!![]}),this[_0x2fd86b(0x1c1)]=_0x245140,this[_0x2fd86b(0x2a6)]=_0x5e313b,this['devopsUrl']=_0x30ca4b;}[a0_0x149e33(0x1f2)](){const _0x24a773=a0_0x149e33;return{'success':this[_0x24a773(0x180)],'alias':this[_0x24a773(0x1c1)],'globalSettingsUrl':this[_0x24a773(0x2a6)],'devopsUrl':this[_0x24a773(0x245)]};}[a0_0x149e33(0x278)](_0x21ae13){const _0x37d509=a0_0x149e33,_0x13936c=[[_0x37d509(0x2cc),_0x37d509(0x2b4),_0x37d509(0x305)],[_0x21ae13['alias'],_0x21ae13['globalSettingsUrl'],_0x21ae13['devopsUrl']||_0x37d509(0x1de)]];console[_0x37d509(0x171)](table['table'](_0x13936c));}}class LoginCommand extends BaseCommand{['commandName']=a0_0x149e33(0x293);[a0_0x149e33(0x29f)]='Login\x20into\x20global\x20settings\x20and\x20retrieve\x20data\x20about\x20related\x20services.';[a0_0x149e33(0x1a1)]=[];[a0_0x149e33(0x2a8)]=[{'flags':a0_0x149e33(0x2f5),'description':a0_0x149e33(0x23e),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x149e33(0x2cd),'description':'Token\x20for\x20getting\x20access\x20to\x20'+ROOT_NAME+a0_0x149e33(0x1c2)},{'flags':a0_0x149e33(0x309),'description':a0_0x149e33(0x1fd),'defaultValue':![]}];async[a0_0x149e33(0x2ec)]([_0x3471c4]){const _0x2c7556=a0_0x149e33;this[_0x2c7556(0x17c)][_0x2c7556(0x1a6)](_0x2c7556(0x206));const _0x259ecb=await this[_0x2c7556(0x213)](_0x3471c4[_0x2c7556(0x25d)]),_0x1f8098=await GlobalSettingsService['login']({'accessToken':_0x259ecb});return await CredentialsManager['save']({'alias':_0x3471c4[_0x2c7556(0x1c1)],'accessToken':_0x259ecb,'globalSettingsUrl':_0x1f8098[_0x2c7556(0x2a6)],'devopsUrl':_0x1f8098[_0x2c7556(0x245)]}),this['logger'][_0x2c7556(0x1a6)](_0x2c7556(0x19a)+_0x3471c4[_0x2c7556(0x1c1)]+'\x22'),new LoginReporter({'alias':_0x3471c4[_0x2c7556(0x1c1)],'globalSettingsUrl':_0x1f8098['globalSettingsUrl'],'devopsUrl':_0x1f8098[_0x2c7556(0x245)]});}[a0_0x149e33(0x235)]([{json:_0x2b2b52}]){return _0x2b2b52;}async['getAccessToken'](_0x522ca6){const _0xc66024=a0_0x149e33;if(_0x522ca6)return _0x522ca6;const _0x440980=await ReadlineUtils[_0xc66024(0x260)](_0xc66024(0x2ca));return _0x440980;}}const DELETED_STATUS=a0_0x149e33(0x16e);class LogoutReporter extends BaseReporter{['alias'];constructor({alias:_0x234767}){const _0x38d80f=a0_0x149e33;super({'success':!![]}),this[_0x38d80f(0x1c1)]=_0x234767;}[a0_0x149e33(0x1f2)](){const _0x3978ef=a0_0x149e33;return{'success':this[_0x3978ef(0x180)],'alias':this[_0x3978ef(0x1c1)],'status':DELETED_STATUS};}[a0_0x149e33(0x278)](_0x3c63fe){const _0x586b2e=a0_0x149e33,_0x513931=[[_0x586b2e(0x2cc),'Status'],[_0x3c63fe[_0x586b2e(0x1c1)],_0x3c63fe['status']]];console[_0x586b2e(0x171)](table[_0x586b2e(0x1e6)](_0x513931));}}class LogoutCommand extends BaseCommand{[a0_0x149e33(0x2d5)]=a0_0x149e33(0x1ff);['description']=a0_0x149e33(0x20b);[a0_0x149e33(0x1a1)]=[];['options']=[{'flags':a0_0x149e33(0x2f5),'description':a0_0x149e33(0x296),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x149e33(0x309),'description':a0_0x149e33(0x1fd),'defaultValue':![]}];async[a0_0x149e33(0x2ec)]([_0x229f36]){const _0x571b5b=a0_0x149e33;return this[_0x571b5b(0x17c)][_0x571b5b(0x1a6)](_0x571b5b(0x227)),await CredentialsManager[_0x571b5b(0x16f)]({'alias':_0x229f36[_0x571b5b(0x1c1)]}),this[_0x571b5b(0x17c)][_0x571b5b(0x1a6)](_0x571b5b(0x221)),new LogoutReporter({'alias':_0x229f36['alias']});}['isJson']([{json:_0x452385}]){return _0x452385;}}class PullReporter extends BaseReporter{[a0_0x149e33(0x2ae)];constructor({changes:_0x1b91a3}){const _0x275f61=a0_0x149e33;super({'success':!![]}),this[_0x275f61(0x2ae)]=_0x1b91a3;}[a0_0x149e33(0x1f2)](){const _0x411fec=a0_0x149e33;return{'success':this[_0x411fec(0x180)],'changes':this['changes']};}[a0_0x149e33(0x278)](_0x4e99e0){const _0x5a9b1c=a0_0x149e33;console[_0x5a9b1c(0x171)](_0x5a9b1c(0x1b3));const _0x3935d8=[[_0x5a9b1c(0x17f),_0x5a9b1c(0x1d7),_0x5a9b1c(0x216),_0x5a9b1c(0x26f)]];for(const {changeType:_0x1d4ce9,name:_0x3c8fea,type:_0x206ff7,paths:_0x29d060}of _0x4e99e0[_0x5a9b1c(0x2ae)]){_0x3935d8['push']([_0x1d4ce9,_0x3c8fea,_0x206ff7,_0x29d060?.[_0x5a9b1c(0x19f)]('\x0a')||'']);}console[_0x5a9b1c(0x171)](table[_0x5a9b1c(0x1e6)](_0x3935d8,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class PullCommand extends BaseCommand{[a0_0x149e33(0x2d5)]=a0_0x149e33(0x2b5);[a0_0x149e33(0x29f)]=a0_0x149e33(0x27d);[a0_0x149e33(0x1a1)]=[];[a0_0x149e33(0x2a8)]=[{'flags':a0_0x149e33(0x309),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x149e33(0x2ee)]=process[a0_0x149e33(0x169)]();[a0_0x149e33(0x294)]=ProjectManager[a0_0x149e33(0x1be)]();[a0_0x149e33(0x19e)]=[];[a0_0x149e33(0x1ad)];get[a0_0x149e33(0x1b5)](){const _0x278991=a0_0x149e33;if(!this[_0x278991(0x1ad)])throw new Error(_0x278991(0x256));return this[_0x278991(0x1ad)];}async[a0_0x149e33(0x2ec)](){const _0x5cf3ac=a0_0x149e33;this[_0x5cf3ac(0x17c)][_0x5cf3ac(0x1a6)](_0x5cf3ac(0x1aa));const _0x45dd2c=await this[_0x5cf3ac(0x294)]['isInitialized'](this[_0x5cf3ac(0x2ee)]);if(!_0x45dd2c)return this[_0x5cf3ac(0x17c)][_0x5cf3ac(0x2dd)](_0x5cf3ac(0x2a4)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0x18ae8b=await this[_0x5cf3ac(0x1d2)]();this[_0x5cf3ac(0x1ad)]=await ApiService[_0x5cf3ac(0x275)](_0x18ae8b);const {id:_0x383b02,headCommitId:_0x4d5145}=await this[_0x5cf3ac(0x294)][_0x5cf3ac(0x1b1)](this[_0x5cf3ac(0x2ee)]);if(!_0x383b02)return this['logger'][_0x5cf3ac(0x2dd)](_0x5cf3ac(0x248)),new FailReporter({'failMessage':'A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first'});const _0x3d6549=await ApiService['getBranchById']({'accessToken':this[_0x5cf3ac(0x1b5)][_0x5cf3ac(0x2d9)],'devopsUrl':this[_0x5cf3ac(0x1b5)]['devopsUrl'],'branchId':_0x383b02});if(_0x4d5145===_0x3d6549[_0x5cf3ac(0x27c)])return new PullReporter({'changes':this['componentChanges']});await this[_0x5cf3ac(0x294)][_0x5cf3ac(0x2e9)](this[_0x5cf3ac(0x2ee)]);try{this[_0x5cf3ac(0x17c)][_0x5cf3ac(0x1a6)]('Checking\x20manual\x20changes\x20started');const _0xe67f9a=await this['areChanges']();if(_0xe67f9a)return this[_0x5cf3ac(0x17c)][_0x5cf3ac(0x2dd)]('Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed'),await this[_0x5cf3ac(0x294)][_0x5cf3ac(0x2eb)](),new FailReporter({'failMessage':_0x5cf3ac(0x2c1)});return this[_0x5cf3ac(0x17c)][_0x5cf3ac(0x1a6)](_0x5cf3ac(0x1fb)),this[_0x5cf3ac(0x17c)]['info'](_0x5cf3ac(0x2c2)),await this['retrieveDifference'](_0x3d6549),this[_0x5cf3ac(0x17c)][_0x5cf3ac(0x1a6)](_0x5cf3ac(0x2cf)),await this[_0x5cf3ac(0x294)][_0x5cf3ac(0x2f2)](),this[_0x5cf3ac(0x17c)][_0x5cf3ac(0x1a6)](_0x5cf3ac(0x266)),new PullReporter({'changes':this[_0x5cf3ac(0x19e)]});}catch(_0x593aa8){await this[_0x5cf3ac(0x294)][_0x5cf3ac(0x2eb)]();throw _0x593aa8;}}[a0_0x149e33(0x235)]([{json:_0x1416a6}]){return _0x1416a6;}async[a0_0x149e33(0x1d2)](){const _0x2935fc=a0_0x149e33,{credentialsAlias:_0x5b4821}=await this[_0x2935fc(0x294)][_0x2935fc(0x2ab)](this[_0x2935fc(0x2ee)]);if(!_0x5b4821)throw new Error(_0x2935fc(0x1f8));if(typeof _0x5b4821!==_0x2935fc(0x30b))throw new Error('Invalid\x20credentials\x20type');return _0x5b4821;}async[a0_0x149e33(0x26a)](){const _0x4829d3=a0_0x149e33,_0x4d3cb9=await this[_0x4829d3(0x294)]['findChanges']();return!!_0x4d3cb9['length'];}async[a0_0x149e33(0x289)](_0x132e1f){const _0x160eb4=a0_0x149e33,{devopsUrl:_0x3d6865,accessToken:_0x4e39b2}=this['credentials'],_0x286228=await this[_0x160eb4(0x294)][_0x160eb4(0x1ae)]({'devopsUrl':_0x3d6865,'accessToken':_0x4e39b2,'targetBranchId':_0x132e1f['id'],'targetCommitId':_0x132e1f['headCommitId']});for(const {id:_0x262b75,name:_0x507f99,type:_0xe37785,changeType:_0x470890}of _0x286228){if(!_0x262b75){if(_0x470890!==ChangeType[_0x160eb4(0x2e6)])throw new Error(_0x160eb4(0x2c9));await this[_0x160eb4(0x294)][_0x160eb4(0x2fa)]({'name':_0x507f99,'type':_0xe37785,'changeType':_0x470890}),this[_0x160eb4(0x19e)][_0x160eb4(0x200)]({'changeType':_0x470890,'name':_0x507f99,'type':_0xe37785});continue;}const _0x5a3eb4=await ApiService['retrieveComponentById']({'devopsUrl':_0x3d6865,'accessToken':_0x4e39b2,'componentId':_0x262b75});if(!_0x5a3eb4[_0x160eb4(0x2d8)])throw new Error(_0x160eb4(0x264)+_0x5a3eb4[_0x160eb4(0x25a)]+'\x22\x20of\x20type\x20\x22'+_0x5a3eb4[_0x160eb4(0x26d)]+_0x160eb4(0x1db));await this[_0x160eb4(0x294)][_0x160eb4(0x2fa)]({'name':_0x507f99,'type':_0xe37785,'changeType':_0x470890,'component':{..._0x5a3eb4,'fHash':_0x5a3eb4[_0x160eb4(0x2d8)]}}),this[_0x160eb4(0x19e)]['push']({'changeType':_0x470890,'name':_0x507f99,'type':_0xe37785,'paths':_0x5a3eb4['files'][_0x160eb4(0x1c8)](_0x2e94c3=>_0x2e94c3[_0x160eb4(0x2e5)])});}await this[_0x160eb4(0x294)]['saveBranchState'](_0x132e1f);}}function a0_0x2850(_0x311c01,_0x392e9a){const _0x198fa8=a0_0x5dda();return a0_0x2850=function(_0x4d58f7,_0x34ec59){_0x4d58f7=_0x4d58f7-0x162;let _0x5ddaa5=_0x198fa8[_0x4d58f7];return _0x5ddaa5;},a0_0x2850(_0x311c01,_0x392e9a);}class RollbackReporter extends BaseReporter{[a0_0x149e33(0x18b)];constructor({fileChanges:_0x45f5ed}){super({'success':!![]}),this['fileChanges']=_0x45f5ed;}[a0_0x149e33(0x1f2)](){const _0x4108e5=a0_0x149e33;return{'success':this[_0x4108e5(0x180)],'fileChanges':this[_0x4108e5(0x18b)]};}[a0_0x149e33(0x278)](_0x56f5b0){const _0x1969bc=a0_0x149e33;console[_0x1969bc(0x171)]('Rolled\x20Back\x20Changes:');const _0x2397d7=[[_0x1969bc(0x17f),_0x1969bc(0x247)]];for(const {changeType:_0x4c70ef,path:_0x5420a8}of _0x56f5b0[_0x1969bc(0x18b)]){_0x2397d7[_0x1969bc(0x200)]([_0x4c70ef,_0x5420a8]);}console[_0x1969bc(0x171)](table[_0x1969bc(0x1e6)](_0x2397d7,{'columns':[{},{'width':0x28}]}));}}class RollbackCommand extends BaseCommand{['commandName']='rollback';[a0_0x149e33(0x29f)]=a0_0x149e33(0x2f1);[a0_0x149e33(0x1a1)]=[];[a0_0x149e33(0x2a8)]=[{'flags':'--json','description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x149e33(0x2ee)]=process[a0_0x149e33(0x169)]();[a0_0x149e33(0x294)]=ProjectManager[a0_0x149e33(0x1be)]();[a0_0x149e33(0x307)]=new Map();[a0_0x149e33(0x2d4)]=[];[a0_0x149e33(0x231)]=[];[a0_0x149e33(0x1ad)];[a0_0x149e33(0x217)];[a0_0x149e33(0x21d)];get[a0_0x149e33(0x1b5)](){const _0x4cfe9b=a0_0x149e33;if(!this[_0x4cfe9b(0x1ad)])throw new Error(_0x4cfe9b(0x256));return this[_0x4cfe9b(0x1ad)];}get[a0_0x149e33(0x251)](){const _0x291865=a0_0x149e33;if(!this[_0x291865(0x217)])throw new Error(_0x291865(0x168));return this[_0x291865(0x217)];}get[a0_0x149e33(0x27c)](){const _0x4aeec2=a0_0x149e33;if(!this['_headCommitId'])throw new Error(_0x4aeec2(0x1ab));return this[_0x4aeec2(0x21d)];}async[a0_0x149e33(0x2ec)](){const _0x5dbff4=a0_0x149e33;this[_0x5dbff4(0x17c)][_0x5dbff4(0x1a6)](_0x5dbff4(0x2b6));const _0x3ca353=await this['manager'][_0x5dbff4(0x2b0)](this[_0x5dbff4(0x2ee)]);if(!_0x3ca353)return this[_0x5dbff4(0x17c)][_0x5dbff4(0x2dd)](_0x5dbff4(0x2a4)),new FailReporter({'failMessage':_0x5dbff4(0x2a4)});const _0x14b484=await this[_0x5dbff4(0x1d2)]();this['_credentials']=await ApiService[_0x5dbff4(0x275)](_0x14b484),await this['getBranchState'](),await this[_0x5dbff4(0x294)]['initStage'](this[_0x5dbff4(0x2ee)]);try{this[_0x5dbff4(0x17c)][_0x5dbff4(0x1a6)](_0x5dbff4(0x204)),await this['defineRollbackTypes']();if(!this['rollbackTypes'][_0x5dbff4(0x175)])return this[_0x5dbff4(0x17c)][_0x5dbff4(0x1a6)](_0x5dbff4(0x1a0)),new RollbackReporter({'fileChanges':this[_0x5dbff4(0x231)]});return this[_0x5dbff4(0x17c)]['info'](_0x5dbff4(0x215)+this['rollbackTypes'][_0x5dbff4(0x175)]+'\x20files\x20will\x20be\x20rolled\x20back'),this[_0x5dbff4(0x17c)][_0x5dbff4(0x1a6)](_0x5dbff4(0x25c)),await this[_0x5dbff4(0x1ce)](),this[_0x5dbff4(0x17c)]['info'](_0x5dbff4(0x2f9)),await this[_0x5dbff4(0x294)][_0x5dbff4(0x2f2)](),this['logger'][_0x5dbff4(0x1a6)](_0x5dbff4(0x226)),new RollbackReporter({'fileChanges':this[_0x5dbff4(0x231)]});}catch(_0x5a667a){await this[_0x5dbff4(0x294)][_0x5dbff4(0x2eb)]();throw _0x5a667a;}}[a0_0x149e33(0x235)]([{json:_0x109830}]){return _0x109830;}async[a0_0x149e33(0x1d2)](){const _0x3ab903=a0_0x149e33,{credentialsAlias:_0x446422}=await this['manager']['readConfig'](this[_0x3ab903(0x2ee)]);if(!_0x446422)throw new Error('Credentials\x20alias\x20is\x20not\x20configured');if(typeof _0x446422!=='string')throw new Error(_0x3ab903(0x1fa));return _0x446422;}async['getBranchState'](){const _0x356fa6=a0_0x149e33,{id:_0x30184d,headCommitId:_0x565047}=await this['manager'][_0x356fa6(0x1b1)](this[_0x356fa6(0x2ee)]);if(!_0x30184d||!_0x565047)throw new Error(_0x356fa6(0x248));this['_branchId']=_0x30184d||void 0x0,this['_headCommitId']=_0x565047||void 0x0;}async[a0_0x149e33(0x1ce)](){const _0x3f8adb=a0_0x149e33;if(this['componentsForRetrieve'][_0x3f8adb(0x27e)])for await(const {files:_0x2c0f84}of ApiService[_0x3f8adb(0x239)]({'devopsUrl':this['credentials'][_0x3f8adb(0x245)],'accessToken':this[_0x3f8adb(0x1b5)][_0x3f8adb(0x2d9)],'branchId':this[_0x3f8adb(0x251)],'commitId':this[_0x3f8adb(0x27c)],'components':this[_0x3f8adb(0x2d4)]})){await this[_0x3f8adb(0x2b1)](_0x2c0f84);}for(const [_0x5d255d,_0x28bbbd]of this[_0x3f8adb(0x307)][_0x3f8adb(0x1e8)]()){if(_0x28bbbd!==ChangeType['DELETE'])throw new Error(_0x3f8adb(0x261)+_0x5d255d+'\x22\x20wasn\x27t\x20restored');await this[_0x3f8adb(0x294)][_0x3f8adb(0x21c)]({'path':_0x5d255d,'changeType':_0x28bbbd});}return{'success':!![]};}async[a0_0x149e33(0x225)](){const _0x1c38b4=a0_0x149e33,_0x3dc0b5=await this['manager'][_0x1c38b4(0x29b)]();for(const {name:_0x5e41db,type:_0x320bf4,changes:_0x1728b0}of _0x3dc0b5){let _0x480a70=![];for(const {path:_0x22afcb,changeType:_0x4e5352}of _0x1728b0){let _0x581823;_0x4e5352===ChangeType[_0x1c38b4(0x2d3)]?_0x581823=ChangeType['DELETE']:(_0x581823=_0x4e5352===ChangeType['DELETE']?ChangeType[_0x1c38b4(0x2d3)]:ChangeType[_0x1c38b4(0x28a)],_0x480a70=!![]),this[_0x1c38b4(0x307)][_0x1c38b4(0x287)](_0x22afcb,_0x581823),this['filesChanges'][_0x1c38b4(0x200)]({'changeType':_0x581823,'path':_0x22afcb});}_0x480a70&&this[_0x1c38b4(0x2d4)][_0x1c38b4(0x200)]({'name':_0x5e41db,'type':_0x320bf4});}}async[a0_0x149e33(0x2b1)](_0x1d8e69){const _0x5b5af6=a0_0x149e33;for(const {path:_0x3dee8b,content:_0x232ddf}of _0x1d8e69){const _0x588604=node_path[_0x5b5af6(0x19f)](COMPONENT_PROJECT_PATH,_0x3dee8b),_0x8121d5=this[_0x5b5af6(0x307)]['get'](_0x588604);if(!_0x8121d5)continue;await this[_0x5b5af6(0x294)][_0x5b5af6(0x21c)]({'path':_0x588604,'content':_0x232ddf,'changeType':_0x8121d5}),this[_0x5b5af6(0x307)][_0x5b5af6(0x16f)](_0x588604);}}}class StatusReporter extends BaseReporter{['pendingChanges'];constructor({pendingChanges:_0x28399d}){const _0x2bfc54=a0_0x149e33;super({'success':!![]}),this[_0x2bfc54(0x1b7)]=_0x28399d;}[a0_0x149e33(0x1f2)](){const _0xb5737b=a0_0x149e33;return{'success':this[_0xb5737b(0x180)],'pendingChanges':this['pendingChanges']};}[a0_0x149e33(0x278)](_0x86e81c){const _0x163e05=a0_0x149e33;console[_0x163e05(0x171)](_0x163e05(0x211));const _0x16c493=[[_0x163e05(0x17f),_0x163e05(0x247)]];for(const {changeType:_0x4ccbab,path:_0x186d2c}of _0x86e81c[_0x163e05(0x1b7)]){_0x16c493['push']([_0x4ccbab,_0x186d2c]);}console[_0x163e05(0x171)](table[_0x163e05(0x1e6)](_0x16c493,{'columns':[{},{'width':0x28}]}));}}class StatusCommand extends BaseCommand{['commandName']=a0_0x149e33(0x1b6);[a0_0x149e33(0x29f)]=a0_0x149e33(0x2f8);[a0_0x149e33(0x1a1)]=[];[a0_0x149e33(0x2a8)]=[{'flags':a0_0x149e33(0x309),'description':a0_0x149e33(0x1fd),'defaultValue':![]}];[a0_0x149e33(0x2ee)]=process[a0_0x149e33(0x169)]();[a0_0x149e33(0x294)]=ProjectManager[a0_0x149e33(0x1be)]();[a0_0x149e33(0x1b7)]=[];async[a0_0x149e33(0x2ec)](){const _0x40a505=a0_0x149e33;this['logger'][_0x40a505(0x1a6)](_0x40a505(0x21f));const _0x32bbce=await this[_0x40a505(0x294)][_0x40a505(0x2b0)](this[_0x40a505(0x2ee)]);if(!_0x32bbce)return this[_0x40a505(0x17c)][_0x40a505(0x2dd)](_0x40a505(0x2a4)),new FailReporter({'failMessage':_0x40a505(0x2a4)});await this[_0x40a505(0x294)][_0x40a505(0x2e9)](this[_0x40a505(0x2ee)]);const _0x436586=await this[_0x40a505(0x294)][_0x40a505(0x29b)]();for(const {changes:_0x398c49}of _0x436586){for(const {changeType:_0x2b3f26,path:_0x25fb3e}of _0x398c49){this[_0x40a505(0x1b7)]['push']({'changeType':_0x2b3f26,'path':_0x25fb3e});}}return await this['manager'][_0x40a505(0x2eb)](),this[_0x40a505(0x17c)][_0x40a505(0x1a6)](_0x40a505(0x270)),new StatusReporter({'pendingChanges':this[_0x40a505(0x1b7)]});}[a0_0x149e33(0x235)]([{json:_0x5e3e44}]){return _0x5e3e44;}}const ECONN_REFUSED=a0_0x149e33(0x29d);function setupAxiosInterceptors(){const _0x9206aa=a0_0x149e33;axios[_0x9206aa(0x2e2)]['response'][_0x9206aa(0x16b)](_0x36ee5b=>_0x36ee5b,async _0x510120=>{const _0x40662d=_0x9206aa;if(_0x510120[_0x40662d(0x2ac)]!==ECONN_REFUSED)return Promise[_0x40662d(0x224)](_0x510120);if(_0x510120[_0x40662d(0x220)]instanceof AggregateError){const _0x80d894=_0x510120[_0x40662d(0x220)][_0x40662d(0x282)][_0x40662d(0x1c8)](({message:_0x2aa509})=>_0x2aa509);return Promise['reject'](new Error(_0x80d894[_0x40662d(0x19f)](',\x20')));}return Promise['reject'](new Error('Connection\x20refused'));});}configurePathEnv(),setupAxiosInterceptors();const ROOT_COMMANDS=[LoginCommand,LogoutCommand,ListCredentialsCommand],DEVOPS_COMMANDS=[InitCommand,CloneCommand,CheckoutCommand,ConfigSetCommand,ConfigUnset,PullCommand,CommitCommand,RollbackCommand,StatusCommand,ListBranchesCommand],root=new commander[(a0_0x149e33(0x2ce))]()['name'](ROOT_NAME)[a0_0x149e33(0x29f)](a0_0x149e33(0x2f4)+ROOT_NAME+a0_0x149e33(0x2a5))[a0_0x149e33(0x212)](config[a0_0x149e33(0x212)]);for(const command of ROOT_COMMANDS){new command()[a0_0x149e33(0x22e)](root);}const devops=new commander[(a0_0x149e33(0x2ce))]()[a0_0x149e33(0x25a)](a0_0x149e33(0x1f5))[a0_0x149e33(0x29f)]('Devops\x20commands');for(const command of DEVOPS_COMMANDS){new command()[a0_0x149e33(0x22e)](devops);}root[a0_0x149e33(0x2b3)](devops),root['parse']();function configurePathEnv(){const _0x1aea8e=a0_0x149e33,_0x1e8fc7=process['env'][_0x1aea8e(0x222)]?.[_0x1aea8e(0x268)](node_path['delimiter']);if(!_0x1e8fc7)throw new Error(_0x1aea8e(0x2ba));const _0x357596=node_path[_0x1aea8e(0x19f)](node_path[_0x1aea8e(0x2e4)](__dirname),_0x1aea8e(0x1cc),'.bin');_0x1e8fc7[_0x1aea8e(0x200)](_0x357596),process['env'][_0x1aea8e(0x222)]=_0x1e8fc7[_0x1aea8e(0x19f)](node_path['delimiter']);}exports['DEVOPS_COMMANDS']=DEVOPS_COMMANDS,exports['ROOT_COMMANDS']=ROOT_COMMANDS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flosum/cli",
3
- "version": "0.0.1",
3
+ "version": "0.0.2-beta.0",
4
4
  "author": "Flosum",
5
5
  "license": "ISC",
6
6
  "description": "Devops cli",