@flosum/cli 0.0.2-beta.0 → 0.0.3
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.
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
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;
|
|
2
|
+
const a0_0xef8a28=a0_0x3d88;(function(_0x362824,_0x4722bd){const _0x40d0e0=a0_0x3d88,_0x5d862a=_0x362824();while(!![]){try{const _0x3fbbae=-parseInt(_0x40d0e0(0xb5))/0x1*(-parseInt(_0x40d0e0(0x1c9))/0x2)+-parseInt(_0x40d0e0(0x8a))/0x3+parseInt(_0x40d0e0(0x21b))/0x4+parseInt(_0x40d0e0(0x150))/0x5*(parseInt(_0x40d0e0(0x1ce))/0x6)+parseInt(_0x40d0e0(0x1ed))/0x7*(parseInt(_0x40d0e0(0xa8))/0x8)+parseInt(_0x40d0e0(0xa1))/0x9+parseInt(_0x40d0e0(0x157))/0xa*(-parseInt(_0x40d0e0(0xcf))/0xb);if(_0x3fbbae===_0x4722bd)break;else _0x5d862a['push'](_0x5d862a['shift']());}catch(_0x388db3){_0x5d862a['push'](_0x5d862a['shift']());}}}(a0_0x5cd1,0x62226));const a0_0x3ebc69=(function(){let _0x3e02a5=!![];return function(_0x53aafb,_0xff5798){const _0x250093=_0x3e02a5?function(){const _0x1f89a6=a0_0x3d88;if(_0xff5798){const _0x14aa61=_0xff5798[_0x1f89a6(0x90)](_0x53aafb,arguments);return _0xff5798=null,_0x14aa61;}}:function(){};return _0x3e02a5=![],_0x250093;};}()),a0_0x66e7eb=a0_0x3ebc69(this,function(){const _0x30d4e3=a0_0x3d88;return a0_0x66e7eb[_0x30d4e3(0x17d)]()[_0x30d4e3(0x1aa)](_0x30d4e3(0xd7))[_0x30d4e3(0x17d)]()['constructor'](a0_0x66e7eb)[_0x30d4e3(0x1aa)](_0x30d4e3(0xd7));});a0_0x66e7eb();'use strict';var node_path=require(a0_0xef8a28(0xaf)),commander=require(a0_0xef8a28(0xea)),promises=require(a0_0xef8a28(0x166)),node_os=require(a0_0xef8a28(0x17b)),axios=require(a0_0xef8a28(0x131)),salesforce=require(a0_0xef8a28(0xf6)),node_crypto=require(a0_0xef8a28(0x1d1)),readline=require('node:readline/promises'),debug=require(a0_0xef8a28(0x1e2)),table=require(a0_0xef8a28(0x125)),version=a0_0xef8a28(0x1cc),config={'version':version};const ROOT_NAME='flosum',DEFAULT_ALIAS_NAME=a0_0xef8a28(0x1d8),INTERNAL_ERROR=a0_0xef8a28(0x1b5);class FileUtils{static async[a0_0xef8a28(0x1db)](_0x3c14a3){const _0x4b569a=a0_0xef8a28,_0xd4ee18=await promises[_0x4b569a(0x10c)](_0x3c14a3,{'withFileTypes':!![]}),_0x487a9c=[];for(const _0x50734e of _0xd4ee18){const _0xb009e3=node_path[_0x4b569a(0x13f)](_0x3c14a3,_0x50734e[_0x4b569a(0x113)]);if(_0x50734e[_0x4b569a(0x1e6)]()){const _0x5008d9=await FileUtils['getFolderFilePaths'](_0xb009e3);_0x487a9c[_0x4b569a(0x1f9)](_0x5008d9);continue;}_0x487a9c[_0x4b569a(0x1f9)](_0xb009e3);}return _0x487a9c[_0x4b569a(0xaa)]();}static async['cleanUpEmptyFolders'](_0x134abe,_0x29b4f4=!![]){const _0x264591=a0_0xef8a28,_0x14ce74=await promises['readdir'](_0x134abe,{'withFileTypes':!![]});let _0x54892e=!![];for(const _0xd52e01 of _0x14ce74){const _0x35aa26=node_path[_0x264591(0x13f)](_0x134abe,_0xd52e01[_0x264591(0x113)]);if(_0xd52e01[_0x264591(0x1e6)]()){const _0x22a08e=await FileUtils[_0x264591(0x11b)](_0x35aa26);!_0x22a08e&&(_0x54892e=![]);}else _0x54892e=![];}return _0x29b4f4&&_0x54892e&&await promises[_0x264591(0x11f)](_0x134abe),_0x54892e;}static async['isDirectoryExists'](_0x3ccdf4){const _0x4a30c3=a0_0xef8a28;return promises['stat'](_0x3ccdf4)['then'](async _0x48c802=>{const _0x4b8df6=a0_0x3d88;return await promises[_0x4b8df6(0xba)](_0x3ccdf4,promises[_0x4b8df6(0xa6)][_0x4b8df6(0x14c)]|promises[_0x4b8df6(0xa6)][_0x4b8df6(0x15f)]),_0x48c802[_0x4b8df6(0x1e6)]();})[_0x4a30c3(0x1cf)](()=>![]);}static async[a0_0xef8a28(0x99)](_0x26d4ab){const _0x4436b5=a0_0xef8a28;return promises[_0x4436b5(0x96)](_0x26d4ab)[_0x4436b5(0x1af)](async _0x5d99d6=>{const _0x564ae0=_0x4436b5;return await promises[_0x564ae0(0xba)](_0x26d4ab,promises['constants']['R_OK']|promises[_0x564ae0(0xa6)][_0x564ae0(0x15f)]),_0x5d99d6['isFile']();})[_0x4436b5(0x1cf)](()=>![]);}}const SYSTEM_FOLDER$1='.'+ROOT_NAME,CREDENTIALS_FILE_NAME='credentials.json';class CredentialsManager{static async['save'](_0x2a405a){const _0x449747=a0_0xef8a28,_0x28f140=node_path[_0x449747(0x13f)](node_os['homedir'](),SYSTEM_FOLDER$1);await promises[_0x449747(0x16f)](_0x28f140,{'recursive':!![]});const _0x346b01=node_path['join'](_0x28f140,CREDENTIALS_FILE_NAME),_0x2f831f=await CredentialsManager['getAllCredentials'](_0x346b01),_0x4c54d6=_0x2f831f['find'](({alias:_0x598c0d})=>_0x598c0d===_0x2a405a[_0x449747(0x145)]);!_0x4c54d6?_0x2f831f[_0x449747(0x1f9)](_0x2a405a):(_0x4c54d6[_0x449747(0xe4)]=_0x2a405a[_0x449747(0xe4)],_0x4c54d6[_0x449747(0x15e)]=_0x2a405a[_0x449747(0x15e)],_0x4c54d6[_0x449747(0x214)]=_0x2a405a[_0x449747(0x214)]),await promises[_0x449747(0xe9)](_0x346b01,Buffer[_0x449747(0x7f)](JSON[_0x449747(0x92)](_0x2f831f)));}static async[a0_0xef8a28(0x174)]({alias:_0x539bf5}){const _0x5c216b=a0_0xef8a28,_0x28a710=node_path[_0x5c216b(0x13f)](node_os[_0x5c216b(0x1dd)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x293502=await CredentialsManager[_0x5c216b(0x18f)](_0x28a710),_0x501c00=_0x293502[_0x5c216b(0x18c)](_0x387c61=>_0x387c61['alias']===_0x539bf5);if(!_0x501c00)throw new Error(_0x5c216b(0x218)+_0x539bf5+'\x22\x20not\x20found');return _0x501c00;}static async['list'](){const _0x379438=a0_0xef8a28,_0x4a3f60=node_path[_0x379438(0x13f)](node_os['homedir'](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x33500e=await CredentialsManager[_0x379438(0x18f)](_0x4a3f60);return _0x33500e;}static async['getAllCredentials'](_0x48f10c){const _0x2a935a=a0_0xef8a28,_0x5b152b=await FileUtils[_0x2a935a(0x99)](_0x48f10c);if(_0x5b152b){const _0x513192=await promises[_0x2a935a(0x1f3)](_0x48f10c);return JSON['parse'](_0x513192[_0x2a935a(0x17d)]());}return[];}static async[a0_0xef8a28(0x111)]({alias:_0x57e985}){const _0x5dacfe=a0_0xef8a28,_0x4c8ef0=node_path[_0x5dacfe(0x13f)](node_os[_0x5dacfe(0x1dd)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x4ea13d=await CredentialsManager[_0x5dacfe(0x18f)](_0x4c8ef0),_0x190a62=_0x4ea13d[_0x5dacfe(0xf3)](_0x606a29=>_0x606a29[_0x5dacfe(0x145)]===_0x57e985);if(_0x190a62<0x0)throw new Error(_0x5dacfe(0x218)+_0x57e985+_0x5dacfe(0x1d3));_0x4ea13d[_0x5dacfe(0x11d)](_0x190a62,0x1),await promises[_0x5dacfe(0xe9)](_0x4c8ef0,Buffer['from'](JSON[_0x5dacfe(0x92)](_0x4ea13d)));}}var ManagementType=(_0xf76ee1=>{const _0x1620c6=a0_0xef8a28;return _0xf76ee1['SALESFORCE']=_0x1620c6(0x163),_0xf76ee1[_0x1620c6(0xeb)]=_0x1620c6(0x79),_0xf76ee1;})(ManagementType||{});class CommitAction{[a0_0xef8a28(0xe4)];[a0_0xef8a28(0x214)];[a0_0xef8a28(0x139)];[a0_0xef8a28(0x135)];['components'];['userName'];['commitDate']=new Date();constructor(_0x15b36c){const _0x653ac5=a0_0xef8a28;this[_0x653ac5(0xe4)]=_0x15b36c[_0x653ac5(0xe4)],this[_0x653ac5(0x214)]=_0x15b36c[_0x653ac5(0x214)],this['message']=_0x15b36c['message'],this[_0x653ac5(0x135)]=_0x15b36c[_0x653ac5(0x135)],this[_0x653ac5(0x21d)]=_0x15b36c[_0x653ac5(0x21d)],this[_0x653ac5(0x1a8)]=_0x15b36c[_0x653ac5(0x1a8)];}async[a0_0xef8a28(0x12b)](){const _0x957ce8=a0_0xef8a28;try{const _0x2cbe6b=await Promise[_0x957ce8(0xcd)](this[_0x957ce8(0x21d)][_0x957ce8(0xdc)](async _0x4bd0e9=>await this[_0x957ce8(0xa2)](_0x4bd0e9))),{data:_0x43d901}=await axios[_0x957ce8(0x1ca)](_0x957ce8(0xe0)+this[_0x957ce8(0x135)]+'/commits',{'message':this[_0x957ce8(0x139)],'components':_0x2cbe6b},{'headers':{'authorization':''+this[_0x957ce8(0xe4)]},'baseURL':this[_0x957ce8(0x214)]});return _0x43d901;}catch(_0x1f223e){if(axios['isAxiosError'](_0x1f223e))throw Error(_0x1f223e[_0x957ce8(0x124)]?.[_0x957ce8(0x1d7)]['message']||_0x1f223e[_0x957ce8(0x124)]?.[_0x957ce8(0x216)]||_0x1f223e['message'],{'cause':_0x1f223e});throw _0x1f223e;}}async['convertToCommit'](_0xc78fb0){const _0x224c90=a0_0xef8a28,_0x53c180=[];for(const {path:_0x577425,localPath:_0x1279ce}of _0xc78fb0[_0x224c90(0x126)]){_0x53c180[_0x224c90(0x1f9)](promises['readFile'](_0x1279ce)[_0x224c90(0x1af)](_0x30f13e=>({'path':_0x577425,'content':_0x30f13e[_0x224c90(0x17d)]('base64')})));}const _0x4f0912=await Promise['all'](_0x53c180);return{'name':_0xc78fb0[_0x224c90(0x113)],'label':_0xc78fb0[_0x224c90(0x120)],'type':_0xc78fb0[_0x224c90(0xb4)],'sourceName':_0x224c90(0xe8),'sourceType':_0x224c90(0xe8),'externalUpdatedAt':this[_0x224c90(0xf8)],'externalUpdatedBy':this[_0x224c90(0x1a8)],'files':_0x4f0912,'managementType':ManagementType[_0x224c90(0x201)]};}}class CreateBranchAction{[a0_0xef8a28(0xe4)];[a0_0xef8a28(0x214)];constructor(_0x160c06){const _0x2a051d=a0_0xef8a28;this[_0x2a051d(0xe4)]=_0x160c06['accessToken'],this[_0x2a051d(0x214)]=_0x160c06[_0x2a051d(0x214)];}async[a0_0xef8a28(0x12b)](_0x56b3ca){const _0x594916=a0_0xef8a28;try{const {data:_0x5cff4c}=await axios['post'](_0x594916(0x191),{..._0x56b3ca},{'headers':{'authorization':''+this[_0x594916(0xe4)]},'baseURL':this['devopsUrl']});return _0x5cff4c;}catch(_0x250f31){if(axios[_0x594916(0x210)](_0x250f31))throw Error(_0x250f31[_0x594916(0x124)]?.['data'][_0x594916(0x139)]||_0x250f31[_0x594916(0x124)]?.[_0x594916(0x216)]||_0x250f31[_0x594916(0x139)],{'cause':_0x250f31});throw _0x250f31;}}}class GetBranchAction{[a0_0xef8a28(0xe4)];[a0_0xef8a28(0x214)];constructor(_0x549778){const _0x4a8c97=a0_0xef8a28;this[_0x4a8c97(0xe4)]=_0x549778[_0x4a8c97(0xe4)],this[_0x4a8c97(0x214)]=_0x549778[_0x4a8c97(0x214)];}async[a0_0xef8a28(0x12b)](_0x5b8abb){const _0x455ab0=a0_0xef8a28;try{const {data:_0x29533f}=await axios[_0x455ab0(0x174)]('fit/branches/'+_0x5b8abb[_0x455ab0(0x135)],{'headers':{'authorization':''+this[_0x455ab0(0xe4)]},'baseURL':this['devopsUrl']});return _0x29533f;}catch(_0x41ce9d){if(axios[_0x455ab0(0x210)](_0x41ce9d))throw Error(_0x41ce9d[_0x455ab0(0x124)]?.[_0x455ab0(0x1d7)][_0x455ab0(0x139)]||_0x41ce9d[_0x455ab0(0x124)]?.[_0x455ab0(0x216)]||_0x41ce9d['message'],{'cause':_0x41ce9d});throw _0x41ce9d;}}}class GetDefaultBranchAction{[a0_0xef8a28(0x214)];[a0_0xef8a28(0xe4)];constructor(_0x1dd233){const _0x162dd4=a0_0xef8a28;this[_0x162dd4(0x214)]=_0x1dd233['devopsUrl'],this[_0x162dd4(0xe4)]=_0x1dd233[_0x162dd4(0xe4)];}async[a0_0xef8a28(0x12b)](){const _0x55a524=a0_0xef8a28;try{const {data:_0x19f036}=await axios[_0x55a524(0x174)]('fit/branches/default',{'headers':{'authorization':''+this[_0x55a524(0xe4)]},'baseURL':this['devopsUrl']});return _0x19f036;}catch(_0x127e9d){if(axios[_0x55a524(0x210)](_0x127e9d))throw Error(_0x127e9d[_0x55a524(0x124)]?.[_0x55a524(0x1d7)][_0x55a524(0x139)]||_0x127e9d[_0x55a524(0x124)]?.[_0x55a524(0x216)]||_0x127e9d['message'],{'cause':_0x127e9d});throw _0x127e9d;}}}function a0_0x3d88(_0x5ee367,_0x461ed3){const _0x374a81=a0_0x5cd1();return a0_0x3d88=function(_0x66e7eb,_0x3ebc69){_0x66e7eb=_0x66e7eb-0x79;let _0x5cd1eb=_0x374a81[_0x66e7eb];return _0x5cd1eb;},a0_0x3d88(_0x5ee367,_0x461ed3);}class GetMeAction{[a0_0xef8a28(0xe4)];[a0_0xef8a28(0x214)];constructor(_0x3c4a11){const _0x517c1f=a0_0xef8a28;this[_0x517c1f(0xe4)]=_0x3c4a11[_0x517c1f(0xe4)],this[_0x517c1f(0x214)]=_0x3c4a11[_0x517c1f(0x214)];}async[a0_0xef8a28(0x12b)](){const _0x276d5d=a0_0xef8a28;try{const {data:_0xb81be6}=await axios[_0x276d5d(0x174)](_0x276d5d(0x171),{'headers':{'authorization':''+this['accessToken']},'baseURL':this[_0x276d5d(0x214)]});return _0xb81be6;}catch(_0x1fbdd6){if(axios[_0x276d5d(0x210)](_0x1fbdd6))throw Error(_0x1fbdd6[_0x276d5d(0x124)]?.[_0x276d5d(0x1d7)][_0x276d5d(0x139)]||_0x1fbdd6[_0x276d5d(0x124)]?.[_0x276d5d(0x216)]||_0x1fbdd6['message'],{'cause':_0x1fbdd6});throw _0x1fbdd6;}}}class ListBranchesAction{[a0_0xef8a28(0x214)];[a0_0xef8a28(0xe4)];['search'];constructor(_0x14151a){const _0x26e0b2=a0_0xef8a28;this[_0x26e0b2(0x214)]=_0x14151a[_0x26e0b2(0x214)],this['accessToken']=_0x14151a[_0x26e0b2(0xe4)],this[_0x26e0b2(0x1aa)]=_0x14151a['search'];}async['execute'](){const _0x39e46f=a0_0xef8a28;try{const _0x2ad512=[];let _0x205b5e=0x0,_0x5c4fdc=0x0;do{const {data:_0x2a82b0}=await axios[_0x39e46f(0x174)](_0x39e46f(0x191),{'headers':{'authorization':''+this[_0x39e46f(0xe4)]},'params':{'search':this['search'],'offset':_0x205b5e,'limit':0x64},'baseURL':this[_0x39e46f(0x214)]});_0x2ad512[_0x39e46f(0x1f9)](..._0x2a82b0['rows']),_0x205b5e+=_0x2a82b0['rows'][_0x39e46f(0x10f)],_0x5c4fdc=_0x2a82b0['total'];}while(_0x205b5e<_0x5c4fdc);return _0x2ad512;}catch(_0x1c83f3){if(axios[_0x39e46f(0x210)](_0x1c83f3))throw Error(_0x1c83f3[_0x39e46f(0x124)]?.[_0x39e46f(0x1d7)][_0x39e46f(0x139)]||_0x1c83f3['response']?.[_0x39e46f(0x216)]||_0x1c83f3[_0x39e46f(0x139)],{'cause':_0x1c83f3});throw _0x1c83f3;}}}class ListComponentsAction{[a0_0xef8a28(0x214)];[a0_0xef8a28(0xe4)];[a0_0xef8a28(0x135)];[a0_0xef8a28(0xf1)];['indexes'];constructor(_0xe96bbb){const _0xc5b033=a0_0xef8a28;this['devopsUrl']=_0xe96bbb[_0xc5b033(0x214)],this[_0xc5b033(0xe4)]=_0xe96bbb[_0xc5b033(0xe4)],this[_0xc5b033(0x135)]=_0xe96bbb[_0xc5b033(0x135)],this[_0xc5b033(0xf1)]=_0xe96bbb['commitId'],_0xe96bbb[_0xc5b033(0x21d)]&&(this[_0xc5b033(0x8e)]=new Set(_0xe96bbb[_0xc5b033(0x21d)][_0xc5b033(0xdc)](({name:_0xc52630,type:_0x35bc9d})=>_0x35bc9d+'_'+_0xc52630)));}async*[a0_0xef8a28(0x12b)](){const _0x40dd7a=a0_0xef8a28;try{let _0x2e2f28=0x0,_0x245319=0x0;do{const {data:_0x3910de}=await axios[_0x40dd7a(0x174)](_0x40dd7a(0xe0)+this[_0x40dd7a(0x135)]+_0x40dd7a(0x189)+this[_0x40dd7a(0xf1)]+_0x40dd7a(0x19a),{'headers':{'authorization':''+this['accessToken']},'params':{'offset':_0x2e2f28,'limit':0x64,'managementType':ManagementType[_0x40dd7a(0x201)]},'baseURL':this['devopsUrl']});_0x2e2f28+=_0x3910de[_0x40dd7a(0xbd)]['length'],_0x245319=_0x3910de[_0x40dd7a(0x12d)];let _0x56c81d=_0x3910de['rows'];this[_0x40dd7a(0x8e)]&&(_0x56c81d=_0x3910de['rows'][_0x40dd7a(0x164)](({name:_0x236cb4,type:_0x4a893b})=>this[_0x40dd7a(0x8e)]?.['has'](_0x4a893b+'_'+_0x236cb4))),yield*_0x56c81d;}while(_0x2e2f28<_0x245319);}catch(_0x5deb00){if(axios[_0x40dd7a(0x210)](_0x5deb00))throw Error(_0x5deb00['response']?.[_0x40dd7a(0x1d7)][_0x40dd7a(0x139)]||_0x5deb00['response']?.['statusText']||_0x5deb00[_0x40dd7a(0x139)],{'cause':_0x5deb00});throw _0x5deb00;}}}class RetrieveComponentAction{['devopsUrl'];[a0_0xef8a28(0xe4)];constructor(_0x40b651){const _0x4fb8e5=a0_0xef8a28;this['devopsUrl']=_0x40b651[_0x4fb8e5(0x214)],this[_0x4fb8e5(0xe4)]=_0x40b651[_0x4fb8e5(0xe4)];}async[a0_0xef8a28(0x12b)](_0x4ccbf5){const _0x14bc5d=a0_0xef8a28;try{const {data:{id:_0xa6d709,name:_0x188963,type:_0x263de2,fHash:_0x5b4a8c,files:_0x170c42}}=await axios['get'](_0x14bc5d(0x187)+_0x4ccbf5,{'headers':{'authorization':''+this['accessToken']},'baseURL':this[_0x14bc5d(0x214)]}),_0x46510a=_0x170c42['map'](_0x24b6f3=>({'path':_0x24b6f3[_0x14bc5d(0x119)],'content':Buffer[_0x14bc5d(0x7f)](_0x24b6f3[_0x14bc5d(0x1c4)],'base64')[_0x14bc5d(0x17d)](_0x14bc5d(0xcb))}));return{'id':_0xa6d709,'name':_0x188963,'type':_0x263de2,'fHash':_0x5b4a8c,'files':_0x46510a};}catch(_0x14d19b){if(axios['isAxiosError'](_0x14d19b))throw Error(_0x14d19b[_0x14bc5d(0x124)]?.[_0x14bc5d(0x1d7)][_0x14bc5d(0x139)]||_0x14d19b[_0x14bc5d(0x124)]?.['statusText']||_0x14d19b[_0x14bc5d(0x139)],{'cause':_0x14d19b});throw _0x14d19b;}}}const RETRIEVE_COMPONENT_CHUNK_SIZE=0xa;class ApiService{static async[a0_0xef8a28(0x11c)](_0x134eda){const _0x534395=a0_0xef8a28,_0x406418=new ListBranchesAction(_0x134eda);return _0x406418[_0x534395(0x12b)]();}static async[a0_0xef8a28(0x1fe)](_0x355238){const _0x403d66=a0_0xef8a28,_0xba0f38=new GetDefaultBranchAction(_0x355238);return _0xba0f38[_0x403d66(0x12b)]();}static async[a0_0xef8a28(0x1e0)](_0x176518){const _0x8a05bc=a0_0xef8a28,_0x537bea=await ApiService[_0x8a05bc(0x11c)]({'devopsUrl':_0x176518[_0x8a05bc(0x214)],'accessToken':_0x176518['accessToken'],'search':_0x176518[_0x8a05bc(0x207)]});return _0x537bea[_0x8a05bc(0x18c)](({name:_0x655e5b})=>_0x655e5b===_0x176518[_0x8a05bc(0x207)])||null;}static async[a0_0xef8a28(0x12f)](_0x580316){const _0x3019ec=a0_0xef8a28,_0x5c3225=new GetBranchAction({'accessToken':_0x580316[_0x3019ec(0xe4)],'devopsUrl':_0x580316[_0x3019ec(0x214)]});return _0x5c3225['execute']({'branchId':_0x580316[_0x3019ec(0x135)]});}static[a0_0xef8a28(0x16b)](_0x49c860){const _0x243ace=a0_0xef8a28,_0x5bdf41=new ListComponentsAction(_0x49c860);return _0x5bdf41[_0x243ace(0x12b)]();}static async['listComponents'](_0x311078){const _0xb7c30a=a0_0xef8a28,_0x3851a6=[];for await(const _0x14db33 of ApiService[_0xb7c30a(0x16b)](_0x311078)){_0x3851a6[_0xb7c30a(0x1f9)](_0x14db33);}return _0x3851a6;}static async*[a0_0xef8a28(0x173)](_0x458736){const _0x1e0f0c=a0_0xef8a28,_0x5d0f32=new RetrieveComponentAction({'devopsUrl':_0x458736[_0x1e0f0c(0x214)],'accessToken':_0x458736[_0x1e0f0c(0xe4)]});let _0x379f99=[];for await(const _0x583122 of ApiService['listComponentsGenerator']({'devopsUrl':_0x458736[_0x1e0f0c(0x214)],'accessToken':_0x458736[_0x1e0f0c(0xe4)],'branchId':_0x458736['branchId'],'commitId':_0x458736[_0x1e0f0c(0xf1)],'components':_0x458736[_0x1e0f0c(0x21d)]})){_0x379f99['push'](_0x5d0f32[_0x1e0f0c(0x12b)](_0x583122['id'])),_0x379f99[_0x1e0f0c(0x10f)]>=RETRIEVE_COMPONENT_CHUNK_SIZE&&(yield*await Promise['all'](_0x379f99),_0x379f99=[]);}_0x379f99[_0x1e0f0c(0x10f)]&&(yield*await Promise['all'](_0x379f99));}static async[a0_0xef8a28(0x209)]({devopsUrl:_0x41c06c,accessToken:_0x4478b2,componentId:_0x24db6d}){const _0x528eb6=a0_0xef8a28,_0x1a17fd=new RetrieveComponentAction({'devopsUrl':_0x41c06c,'accessToken':_0x4478b2});return _0x1a17fd[_0x528eb6(0x12b)](_0x24db6d);}static async[a0_0xef8a28(0x86)](_0x13c917){const _0x220c4f=a0_0xef8a28,{accessToken:_0x204290,devopsUrl:_0x56d1c0}=await CredentialsManager['get']({'alias':_0x13c917});if(!_0x56d1c0)throw new Error(_0x220c4f(0x1c7));return{'accessToken':_0x204290,'devopsUrl':_0x56d1c0};}static async[a0_0xef8a28(0x104)](_0x19bf6e){const _0x13ed2e=a0_0xef8a28,_0x196914=new GetMeAction(_0x19bf6e);return _0x196914[_0x13ed2e(0x12b)]();}static async[a0_0xef8a28(0x1a4)](_0x2047ed){const _0x107d9f=a0_0xef8a28,_0x3f0a9a=new CommitAction(_0x2047ed);await _0x3f0a9a[_0x107d9f(0x12b)]();}static async['createBranch'](_0x19febd){const _0x62436f=a0_0xef8a28,_0x51628c=new CreateBranchAction({'accessToken':_0x19febd['accessToken'],'devopsUrl':_0x19febd[_0x62436f(0x214)]});return _0x51628c[_0x62436f(0x12b)]({'name':_0x19febd['name'],'parentId':_0x19febd[_0x62436f(0xfd)]});}}var ConfigName=(_0xd4ab3c=>{const _0x1e6180=a0_0xef8a28;return _0xd4ab3c[_0x1e6180(0x13c)]=_0x1e6180(0xca),_0xd4ab3c;})(ConfigName||{}),ChangeType=(_0x5d48d9=>{const _0x209683=a0_0xef8a28;return _0x5d48d9[_0x209683(0xf4)]=_0x209683(0x1e8),_0x5d48d9[_0x209683(0x121)]=_0x209683(0x203),_0x5d48d9[_0x209683(0xf0)]='Delete',_0x5d48d9;})(ChangeType||{});class CompareWithRemoteBranchAction{[a0_0xef8a28(0x214)];['accessToken'];[a0_0xef8a28(0x1d2)];[a0_0xef8a28(0x19d)];[a0_0xef8a28(0x137)];constructor(_0x2c9e18){const _0x3382c6=a0_0xef8a28;this[_0x3382c6(0x214)]=_0x2c9e18['devopsUrl'],this[_0x3382c6(0xe4)]=_0x2c9e18['accessToken'],this[_0x3382c6(0x1d2)]=_0x2c9e18['targetBranchId'],this[_0x3382c6(0x19d)]=_0x2c9e18[_0x3382c6(0x19d)],this[_0x3382c6(0x137)]=_0x2c9e18[_0x3382c6(0x137)];}async[a0_0xef8a28(0x12b)](){const _0x51f666=a0_0xef8a28,_0x291dce=await ApiService[_0x51f666(0x1cd)]({'devopsUrl':this[_0x51f666(0x214)],'accessToken':this['accessToken'],'branchId':this[_0x51f666(0x1d2)],'commitId':this[_0x51f666(0x19d)]}),_0x29b076=new Map(_0x291dce[_0x51f666(0xdc)](_0x3af819=>[_0x3af819[_0x51f666(0xb4)]+'_'+_0x3af819[_0x51f666(0x113)],_0x3af819])),_0x394b01=[];for(const _0x42bbc9 of this['findDeletedAndUpdated'](_0x29b076)){_0x394b01[_0x51f666(0x1f9)](_0x42bbc9),_0x29b076['delete'](_0x42bbc9[_0x51f666(0xb4)]+'_'+_0x42bbc9['name']);}for(const [_0x4304bd,_0x1545f1]of _0x29b076[_0x51f666(0x1d6)]()){const _0x3a36bf=this[_0x51f666(0x137)]['componentsState'][_0x51f666(0x174)](_0x4304bd);!_0x3a36bf&&_0x394b01['push']({'id':_0x1545f1['id'],'name':_0x1545f1[_0x51f666(0x113)],'type':_0x1545f1[_0x51f666(0xb4)],'fHash':_0x1545f1[_0x51f666(0xee)],'changeType':ChangeType[_0x51f666(0xf4)]});}return _0x394b01;}*[a0_0xef8a28(0xc2)](_0x292706){const _0x9272ab=a0_0xef8a28;for(const [_0x7f14b1,_0x4222fa]of this[_0x9272ab(0x137)][_0x9272ab(0x81)][_0x9272ab(0x1d6)]()){const _0x13eb8f=_0x292706[_0x9272ab(0x174)](_0x7f14b1);!_0x13eb8f&&(yield{'name':_0x4222fa[_0x9272ab(0x113)],'type':_0x4222fa['type'],'changeType':ChangeType[_0x9272ab(0xf0)]}),_0x13eb8f&&_0x13eb8f['fHash']!==_0x4222fa[_0x9272ab(0xee)]&&(yield{'id':_0x13eb8f['id'],'name':_0x13eb8f[_0x9272ab(0x113)],'type':_0x13eb8f[_0x9272ab(0xb4)],'fHash':_0x13eb8f[_0x9272ab(0xee)],'changeType':ChangeType['UPDATE']});}}}class ConfigSetAction{[a0_0xef8a28(0x137)];constructor({stage:_0x23c5b2}){const _0x14d85f=a0_0xef8a28;this[_0x14d85f(0x137)]=_0x23c5b2;}async[a0_0xef8a28(0x12b)]({name:_0x1a95b7,value:_0x5cb22e}){const _0x5d66e9=a0_0xef8a28;switch(_0x1a95b7){case ConfigName['CREDENTIALS_ALIAS']:await CredentialsManager[_0x5d66e9(0x174)]({'alias':_0x5cb22e}),this[_0x5d66e9(0x137)][_0x5d66e9(0x1de)](_0x1a95b7,_0x5cb22e);break;default:throw new Error('Unknown\x20config\x20name:\x20'+_0x1a95b7);}}}class FindChangesAction{['stage'];constructor(_0x51fc50){const _0x1759fd=a0_0xef8a28;this[_0x1759fd(0x137)]=_0x51fc50[_0x1759fd(0x137)];}async[a0_0xef8a28(0x12b)](){const _0x1e6536=a0_0xef8a28,_0x17d590=new Map(this[_0x1e6536(0x137)]['componentsState']),_0x393cad=[];for await(const {componentName:_0x112180,componentType:_0x2a3d81,filePaths:_0x3494c2}of salesforce[_0x1e6536(0x14d)][_0x1e6536(0x21f)](this[_0x1e6536(0x137)][_0x1e6536(0x202)])){const _0x2d559c=_0x2a3d81+'_'+_0x112180,_0x30b44b=_0x17d590[_0x1e6536(0x174)](_0x2d559c),_0x529413=_0x3494c2[_0x1e6536(0xdc)](_0x4e2f0b=>_0x4e2f0b[_0x1e6536(0xda)](this[_0x1e6536(0x137)][_0x1e6536(0x202)]+'/',''));if(!_0x30b44b){_0x393cad[_0x1e6536(0x1f9)]({'type':_0x2a3d81,'name':_0x112180,'changes':_0x529413[_0x1e6536(0xdc)](_0x14dcfc=>({'path':_0x14dcfc,'changeType':ChangeType[_0x1e6536(0xf4)]}))});continue;}_0x17d590[_0x1e6536(0x111)](_0x2d559c);const _0x17d3c6=await this[_0x1e6536(0x1d9)](_0x529413,_0x30b44b[_0x1e6536(0xb1)]);_0x17d3c6['length']&&_0x393cad[_0x1e6536(0x1f9)]({'type':_0x2a3d81,'name':_0x112180,'changes':_0x17d3c6});}for(const [,_0x2b3bfc]of _0x17d590[_0x1e6536(0x1d6)]()){_0x393cad[_0x1e6536(0x1f9)]({'type':_0x2b3bfc['type'],'name':_0x2b3bfc['name'],'changes':_0x2b3bfc[_0x1e6536(0xb1)][_0x1e6536(0xdc)](_0x3d27bc=>({'path':_0x3d27bc,'changeType':ChangeType[_0x1e6536(0xf0)]}))});}return _0x393cad;}async['getUpdatedComponentChanges'](_0x7b510a,_0x261d33){const _0x44f4ed=a0_0xef8a28,{lastStageTimestamp:_0x4d35cc}=this[_0x44f4ed(0x137)]['branchState'],_0x21d6b0=[];for(const _0x2abfbe of _0x7b510a){const _0x2243f4=_0x261d33[_0x44f4ed(0x136)](_0x2abfbe);if(!_0x2243f4){_0x21d6b0[_0x44f4ed(0x1f9)]({'path':_0x2abfbe,'changeType':ChangeType['CREATE']});continue;}const {ctimeMs:_0x30f753,mtimeMs:_0x36a5db}=await promises['stat'](_0x2abfbe);(!_0x4d35cc||Math[_0x44f4ed(0x1be)](_0x36a5db)>_0x4d35cc||Math['trunc'](_0x30f753)>_0x4d35cc)&&_0x21d6b0[_0x44f4ed(0x1f9)]({'path':_0x2abfbe,'changeType':ChangeType[_0x44f4ed(0x121)]});}for(const _0x35dd7f of _0x261d33){const _0x2fb6f9=!_0x7b510a[_0x44f4ed(0x136)](_0x35dd7f);_0x2fb6f9&&_0x21d6b0[_0x44f4ed(0x1f9)]({'path':_0x35dd7f,'changeType':ChangeType['DELETE']});}return _0x21d6b0;}}const STAGE_FOLDER_NAME='.stage',SYSTEM_FOLDER='.'+ROOT_NAME,CONFIG_FILE_NAME=a0_0xef8a28(0x20a),BRANCH_STATE_FILE_NAME=a0_0xef8a28(0x1fa),COMPONENTS_STATE_FILE_NAME=a0_0xef8a28(0x21e),COMPONENT_PROJECT_PATH=node_path[a0_0xef8a28(0x13f)](a0_0xef8a28(0x13e),'main',a0_0xef8a28(0x1d8)),SFDX_PROJECT_FILE_NAME=a0_0xef8a28(0x8f),INITIAL_BRANCH_STATE={'id':null,'name':null,'headCommitId':null,'lastStageTimestamp':null},INITIAL_CONFIG={'credentialsAlias':null};class InitProjectAction{[a0_0xef8a28(0x137)];['config'];constructor({stage:_0x18cdda,config:_0x88305b}){const _0x2e0284=a0_0xef8a28;this['stage']=_0x18cdda,this[_0x2e0284(0x170)]=_0x88305b;}async[a0_0xef8a28(0x12b)](){const _0x3aa6b0=a0_0xef8a28,_0x4d6684=new salesforce['CreateProjectSfCommand']({'cwd':node_path[_0x3aa6b0(0x18e)](this[_0x3aa6b0(0x137)][_0x3aa6b0(0x19f)]),'projectName':node_path[_0x3aa6b0(0xf7)](this[_0x3aa6b0(0x137)][_0x3aa6b0(0x19f)])});await _0x4d6684['run']();const _0x5dc1c2=await FileUtils['getFolderFilePaths'](this['stage'][_0x3aa6b0(0x19f)]);for(const _0x9ce421 of _0x5dc1c2){const _0x544ce1=_0x9ce421[_0x3aa6b0(0x188)](STAGE_FOLDER_NAME)[0x1];this[_0x3aa6b0(0x137)][_0x3aa6b0(0xe3)]({'path':_0x544ce1,'changeType':ChangeType['CREATE']});}if(this[_0x3aa6b0(0x170)])for(const _0x44bafe of Object['values'](ConfigName)){this[_0x3aa6b0(0x137)][_0x3aa6b0(0x1de)](_0x44bafe,this['config'][_0x44bafe]);}}}class SaveComponentAction{['stage'];constructor(_0x574586){const _0x1598eb=a0_0xef8a28;this[_0x1598eb(0x137)]=_0x574586['stage'];}async[a0_0xef8a28(0x12b)](_0x53f3c2){const _0x5f5cae=a0_0xef8a28;switch(_0x53f3c2[_0x5f5cae(0x1c3)]){case ChangeType[_0x5f5cae(0xf4)]:{if(!_0x53f3c2[_0x5f5cae(0xa4)])throw new Error(_0x5f5cae(0xe2));await this[_0x5f5cae(0x137)][_0x5f5cae(0x183)](_0x53f3c2[_0x5f5cae(0xa4)]);break;}case ChangeType['UPDATE']:if(!_0x53f3c2['component'])throw new Error(_0x5f5cae(0x221));await this[_0x5f5cae(0x137)][_0x5f5cae(0x20c)](_0x53f3c2['component']);break;case ChangeType[_0x5f5cae(0xf0)]:await this['stage']['deleteComponent']({'name':_0x53f3c2['name'],'type':_0x53f3c2[_0x5f5cae(0xb4)]});break;}}}class UpdateComponentStateAction{[a0_0xef8a28(0x137)];[a0_0xef8a28(0x113)];[a0_0xef8a28(0xb4)];[a0_0xef8a28(0x190)];constructor(_0x24e98f){const _0x2e4c90=a0_0xef8a28;this[_0x2e4c90(0x137)]=_0x24e98f['stage'],this[_0x2e4c90(0x113)]=_0x24e98f['name'],this[_0x2e4c90(0xb4)]=_0x24e98f[_0x2e4c90(0xb4)],this[_0x2e4c90(0x190)]=_0x24e98f['changes'];}async[a0_0xef8a28(0x12b)](){const _0x177be8=a0_0xef8a28,_0x1f8207=this[_0x177be8(0xb4)]+'_'+this[_0x177be8(0x113)];let _0x324828=this[_0x177be8(0x137)][_0x177be8(0x81)][_0x177be8(0x174)](_0x1f8207),_0x419e71=ChangeType[_0x177be8(0x121)];!_0x324828&&(_0x324828={'name':this[_0x177be8(0x113)],'type':this['type'],'fHash':'','paths':[]},this[_0x177be8(0x137)][_0x177be8(0x81)][_0x177be8(0x123)](_0x1f8207,_0x324828),_0x419e71=ChangeType[_0x177be8(0xf4)]);for(const _0x54813a of this[_0x177be8(0x190)]){this[_0x177be8(0xed)](_0x324828,_0x54813a);}if(!_0x324828[_0x177be8(0xb1)][_0x177be8(0x10f)])return this[_0x177be8(0x137)][_0x177be8(0x81)][_0x177be8(0x111)](_0x1f8207),{'name':_0x324828[_0x177be8(0x113)],'type':_0x324828[_0x177be8(0xb4)],'changeType':ChangeType[_0x177be8(0xf0)]};return _0x324828[_0x177be8(0xee)]=await this[_0x177be8(0x8d)](_0x324828[_0x177be8(0xb1)]),{..._0x324828,'changeType':_0x419e71};}['handleFileChange'](_0x2bcc92,{path:_0x4bd1c0,changeType:_0xfcb0b6}){const _0x342d59=a0_0xef8a28;if(_0xfcb0b6===ChangeType[_0x342d59(0xf4)]){if(_0x2bcc92[_0x342d59(0xb1)][_0x342d59(0x136)](_0x4bd1c0))throw new Error('File\x20\x22'+_0x4bd1c0+_0x342d59(0xf2));_0x2bcc92[_0x342d59(0xb1)][_0x342d59(0x1f9)](_0x4bd1c0);}if(_0xfcb0b6===ChangeType[_0x342d59(0xf0)]){const _0xdf07fa=_0x2bcc92[_0x342d59(0xb1)][_0x342d59(0x1d5)](_0x4bd1c0);if(_0xdf07fa<0x0)throw new Error(_0x342d59(0x97)+_0x4bd1c0+_0x342d59(0x1d3));_0x2bcc92[_0x342d59(0xb1)][_0x342d59(0x11d)](_0xdf07fa,0x1);}}async[a0_0xef8a28(0x8d)](_0x5dbb79){const _0x4822c7=a0_0xef8a28,_0x784a6d=node_crypto[_0x4822c7(0x91)](_0x4822c7(0x108));for(const _0x3b6912 of _0x5dbb79){const _0x3f2cf0=await promises[_0x4822c7(0x1f3)](node_path['join'](this[_0x4822c7(0x137)][_0x4822c7(0x202)],_0x3b6912),{'encoding':_0x4822c7(0xcb)}),_0x360ea3=_0x3b6912[_0x4822c7(0x188)](node_path[_0x4822c7(0xfe)])[_0x4822c7(0x16e)](0x3)[_0x4822c7(0x13f)]('/');_0x784a6d[_0x4822c7(0x94)](_0x360ea3),_0x784a6d[_0x4822c7(0x94)](_0x3f2cf0);}const _0x538965=_0x784a6d[_0x4822c7(0xb6)](_0x4822c7(0x151));return _0x538965;}}class Stage{['_projectPath'];['_stagePath'];[a0_0xef8a28(0x170)];['_branchState'];[a0_0xef8a28(0x9d)];[a0_0xef8a28(0x12a)]=[];[a0_0xef8a28(0x7a)]=!![];set[a0_0xef8a28(0xbe)](_0x396c23){this['_isUpdateStageTimestamp']=_0x396c23;}get['projectPath'](){return this['_projectPath'];}get[a0_0xef8a28(0x19f)](){return this['_stagePath'];}get['branchState'](){const _0x377b9c=a0_0xef8a28;return this[_0x377b9c(0x1ff)];}get[a0_0xef8a28(0x81)](){const _0x4f34f6=a0_0xef8a28;return this[_0x4f34f6(0x9d)];}constructor(_0x37939a){const _0x9d9527=a0_0xef8a28;this['_projectPath']=_0x37939a[_0x9d9527(0x202)],this[_0x9d9527(0x160)]=_0x37939a[_0x9d9527(0x19f)],this['config']=_0x37939a[_0x9d9527(0x170)],this[_0x9d9527(0x1ff)]=_0x37939a[_0x9d9527(0x100)],this['_componentsState']=_0x37939a['componentsState']?new Map(_0x37939a[_0x9d9527(0x81)][_0x9d9527(0xdc)](_0x1f7ec0=>[_0x1f7ec0[_0x9d9527(0xb4)]+'_'+_0x1f7ec0['name'],_0x1f7ec0])):new Map();}[a0_0xef8a28(0x1de)](_0xd09599,_0xfec21c){const _0x31b93c=a0_0xef8a28;this[_0x31b93c(0x170)][_0xd09599]=_0xfec21c;}[a0_0xef8a28(0x1e9)](_0x34a547){const _0x3de635=a0_0xef8a28;this[_0x3de635(0x170)][_0x34a547]=null;}[a0_0xef8a28(0x95)](_0x336a67){const _0x3a9d5c=a0_0xef8a28;this[_0x3a9d5c(0x100)]['id']=_0x336a67['id'],this[_0x3a9d5c(0x100)][_0x3a9d5c(0x113)]=_0x336a67['name'],this[_0x3a9d5c(0x100)]['headCommitId']=_0x336a67[_0x3a9d5c(0x1dc)];}async[a0_0xef8a28(0x183)](_0x2d711f){const _0xc028bd=a0_0xef8a28,_0x3fcc9e={'name':_0x2d711f[_0xc028bd(0x113)],'type':_0x2d711f[_0xc028bd(0xb4)],'fHash':_0x2d711f['fHash'],'paths':_0x2d711f[_0xc028bd(0x126)][_0xc028bd(0xdc)](({path:_0x2757c0})=>node_path[_0xc028bd(0x13f)](COMPONENT_PROJECT_PATH,_0x2757c0))};this['_componentsState'][_0xc028bd(0x123)](_0x2d711f[_0xc028bd(0xb4)]+'_'+_0x2d711f['name'],_0x3fcc9e);for(const {path:_0x2f206b,content:_0x5b75ea}of _0x2d711f[_0xc028bd(0x126)]){await this['addFileChange']({'path':node_path['join'](COMPONENT_PROJECT_PATH,_0x2f206b),'content':_0x5b75ea,'changeType':ChangeType[_0xc028bd(0xf4)]});}}async[a0_0xef8a28(0x20c)](_0x564615){const _0x2e2527=a0_0xef8a28,_0x1a452c=this[_0x2e2527(0x9d)][_0x2e2527(0x174)](_0x564615['type']+'_'+_0x564615[_0x2e2527(0x113)]),_0x4e0558=[];if(!_0x1a452c)throw new Error('Update:\x20Component\x20'+_0x564615[_0x2e2527(0x113)]+_0x2e2527(0x1b0)+_0x564615[_0x2e2527(0xb4)]+_0x2e2527(0x158));for(const _0x1bf695 of _0x1a452c[_0x2e2527(0xb1)]){await this[_0x2e2527(0x16a)]({'path':_0x1bf695,'changeType':ChangeType['DELETE']});}for(const {path:_0xaa3ed4,content:_0x81d307}of _0x564615[_0x2e2527(0x126)]){const _0x2cfff=node_path[_0x2e2527(0x13f)](COMPONENT_PROJECT_PATH,_0xaa3ed4);await this[_0x2e2527(0x16a)]({'path':_0x2cfff,'content':_0x81d307,'changeType':ChangeType[_0x2e2527(0xf4)]}),_0x4e0558[_0x2e2527(0x1f9)](_0x2cfff);}_0x1a452c[_0x2e2527(0xee)]=_0x564615[_0x2e2527(0xee)],_0x1a452c[_0x2e2527(0xb1)]=_0x4e0558;}async[a0_0xef8a28(0x213)](_0x322b4b){const _0xca389e=a0_0xef8a28,_0x4646aa=_0x322b4b['type']+'_'+_0x322b4b[_0xca389e(0x113)],_0x2bbd9c=this[_0xca389e(0x9d)][_0xca389e(0x174)](_0x4646aa);if(!_0x2bbd9c)throw new Error(_0xca389e(0x1ad)+_0x322b4b[_0xca389e(0x113)]+'\x20of\x20type\x20'+_0x322b4b[_0xca389e(0xb4)]+_0xca389e(0x158));for(const _0x1d5714 of _0x2bbd9c[_0xca389e(0xb1)]){await this['addFileChange']({'path':_0x1d5714,'changeType':ChangeType[_0xca389e(0xf0)]});}this[_0xca389e(0x9d)]['delete'](_0x4646aa);}async[a0_0xef8a28(0x16a)]({path:_0x4cfb07,content:_0x4f5651,changeType:_0x224f27}){const _0x1d81e9=a0_0xef8a28;if(_0x224f27!==ChangeType[_0x1d81e9(0xf0)]){if(!_0x4f5651)throw new Error(_0x1d81e9(0x103));const _0x402cef=node_path[_0x1d81e9(0x13f)](this[_0x1d81e9(0x19f)],_0x4cfb07);await promises[_0x1d81e9(0x16f)](node_path[_0x1d81e9(0x18e)](_0x402cef),{'recursive':!![]}),await promises[_0x1d81e9(0xe9)](_0x402cef,_0x4f5651);}this['fileChanges'][_0x1d81e9(0x1f9)]({'path':_0x4cfb07,'changeType':_0x224f27});}async[a0_0xef8a28(0x88)](_0xc1f7f7){const _0x59c6d6=a0_0xef8a28,_0x53f78b=new UpdateComponentStateAction({'stage':this,..._0xc1f7f7});return _0x53f78b[_0x59c6d6(0x12b)]();}async[a0_0xef8a28(0x85)](){}[a0_0xef8a28(0xe3)]({path:_0x1ce8f2,changeType:_0x15d676}){const _0x394d16=a0_0xef8a28;this[_0x394d16(0x12a)][_0x394d16(0x1f9)]({'path':_0x1ce8f2,'changeType':_0x15d676});}async[a0_0xef8a28(0x90)](){const _0x59d213=a0_0xef8a28,_0xf01fcb=await FileUtils['isDirectoryExists'](this[_0x59d213(0x19f)]);if(!_0xf01fcb)throw Error(_0x59d213(0xb2));await this[_0x59d213(0xc8)](),await this[_0x59d213(0x101)](),await promises['rm'](this[_0x59d213(0x19f)],{'recursive':!![]});const _0x387da0=node_path[_0x59d213(0x13f)](this[_0x59d213(0x20e)],COMPONENT_PROJECT_PATH),_0x33d057=await FileUtils[_0x59d213(0x199)](_0x387da0);_0x33d057?await FileUtils[_0x59d213(0x11b)](_0x387da0,![]):await promises[_0x59d213(0x16f)](_0x387da0,{'recursive':!![]});}async[a0_0xef8a28(0x7d)](){const _0x346324=a0_0xef8a28;await promises['rm'](this[_0x346324(0x19f)],{'recursive':!![],'force':!![]});}async['applyFileChanges'](){const _0x3edcae=a0_0xef8a28;for(const {path:_0x4e4e01,changeType:_0x27d3f9}of this['fileChanges']){switch(_0x27d3f9){case ChangeType[_0x3edcae(0xf4)]:case ChangeType[_0x3edcae(0x121)]:await this['applyCreateUpdate'](_0x4e4e01);break;case ChangeType[_0x3edcae(0xf0)]:await this[_0x3edcae(0x212)](_0x4e4e01);break;}}}async[a0_0xef8a28(0x19c)](_0x5bb7ee){const _0x38992f=a0_0xef8a28,_0x5df60c=node_path[_0x38992f(0x13f)](this[_0x38992f(0x160)],_0x5bb7ee),_0x527b87=node_path[_0x38992f(0x13f)](this['_projectPath'],_0x5bb7ee);await promises['mkdir'](node_path['dirname'](_0x527b87),{'recursive':!![]}),await promises[_0x38992f(0x1c0)](_0x5df60c,_0x527b87);}async[a0_0xef8a28(0x212)](_0x440fd4){const _0x5ae61d=a0_0xef8a28;await promises['rm'](node_path[_0x5ae61d(0x13f)](this['_projectPath'],_0x440fd4),{'recursive':!![]});}async[a0_0xef8a28(0x101)](){const _0x5150c9=a0_0xef8a28;await promises[_0x5150c9(0xe9)](node_path['join'](this['projectPath'],SYSTEM_FOLDER,CONFIG_FILE_NAME),JSON[_0x5150c9(0x92)](this[_0x5150c9(0x170)])),this[_0x5150c9(0x7a)]&&(this[_0x5150c9(0x100)]['lastStageTimestamp']=Date[_0x5150c9(0xac)]()),await promises[_0x5150c9(0xe9)](node_path[_0x5150c9(0x13f)](this['projectPath'],SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),JSON[_0x5150c9(0x92)](this[_0x5150c9(0x100)])),await promises[_0x5150c9(0xe9)](node_path[_0x5150c9(0x13f)](this[_0x5150c9(0x202)],SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),JSON[_0x5150c9(0x92)](Array[_0x5150c9(0x7f)](this[_0x5150c9(0x9d)][_0x5150c9(0xe6)]())));}}class ProjectManager{static [a0_0xef8a28(0x149)];['_stage'];get[a0_0xef8a28(0x137)](){const _0x44ca19=a0_0xef8a28;if(!this[_0x44ca19(0x122)])throw new Error('Stage\x20not\x20found');return this[_0x44ca19(0x122)];}constructor(){}static[a0_0xef8a28(0x219)](){const _0x130b3b=a0_0xef8a28;return!ProjectManager['instance']&&(ProjectManager[_0x130b3b(0x149)]=new ProjectManager()),ProjectManager[_0x130b3b(0x149)];}async[a0_0xef8a28(0x1ef)](_0x47e710){const _0x19d301=a0_0xef8a28,_0x5c4395=node_path['join'](_0x47e710,SYSTEM_FOLDER,STAGE_FOLDER_NAME);await promises['rm'](_0x5c4395,{'recursive':!![],'force':!![]}),await promises[_0x19d301(0x16f)](_0x5c4395,{'recursive':!![]});const _0x4e5449=await this['readConfig'](_0x47e710),_0x29b6d4=await this[_0x19d301(0x114)](_0x47e710),_0x5ed5c5=await this[_0x19d301(0x192)](_0x47e710);this[_0x19d301(0x122)]=new Stage({'projectPath':_0x47e710,'stagePath':_0x5c4395,'config':_0x4e5449,'branchState':_0x29b6d4,'componentsState':_0x5ed5c5});}async['applyStage'](){const _0x5eca22=a0_0xef8a28;await this[_0x5eca22(0x137)][_0x5eca22(0x90)]();}async[a0_0xef8a28(0x1a7)](){const _0x32378b=a0_0xef8a28;await this[_0x32378b(0x137)][_0x32378b(0x7d)]();}async['initProject']({config:_0x43261d}){const _0x24599d=a0_0xef8a28,_0x4cfda3=new InitProjectAction({'stage':this[_0x24599d(0x137)],'config':_0x43261d});await _0x4cfda3[_0x24599d(0x12b)]();}[a0_0xef8a28(0xd2)](_0x2d469d){const _0x308d67=a0_0xef8a28;this[_0x308d67(0x137)][_0x308d67(0x95)](_0x2d469d);}async[a0_0xef8a28(0x205)](_0x269ec5){const _0x706bf4=a0_0xef8a28,_0x51aa82=new SaveComponentAction({'stage':this[_0x706bf4(0x137)]});await _0x51aa82[_0x706bf4(0x12b)](_0x269ec5);}async[a0_0xef8a28(0x161)](){const _0x36dced=a0_0xef8a28,_0x51bc55=new FindChangesAction({'stage':this[_0x36dced(0x137)]});return _0x51bc55['execute']();}async['compareWithRemoteBranch'](_0x29ae60){const _0x2a4e98=a0_0xef8a28,_0x22a60b=new CompareWithRemoteBranchAction({..._0x29ae60,'stage':this['stage']});return _0x22a60b[_0x2a4e98(0x12b)]();}async['readConfig'](_0x5973a2){const _0x492fdb=a0_0xef8a28,_0x5b5e9d=node_path[_0x492fdb(0x13f)](_0x5973a2,SYSTEM_FOLDER,CONFIG_FILE_NAME),_0x295e69=await FileUtils[_0x492fdb(0x99)](_0x5b5e9d);if(!_0x295e69)return INITIAL_CONFIG;const _0x596273=await promises['readFile'](_0x5b5e9d);return JSON[_0x492fdb(0x10b)](_0x596273['toString']());}async['readBranchState'](_0xc0299b){const _0xac13a8=a0_0xef8a28,_0x255768=node_path[_0xac13a8(0x13f)](_0xc0299b,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),_0xcefa83=await FileUtils[_0xac13a8(0x99)](_0x255768);if(!_0xcefa83)return INITIAL_BRANCH_STATE;const _0x182e59=await promises[_0xac13a8(0x1f3)](_0x255768);return JSON[_0xac13a8(0x10b)](_0x182e59[_0xac13a8(0x17d)]());}async['readComponentsState'](_0x5941c8){const _0x15a8d1=a0_0xef8a28,_0x2c80d1=node_path[_0x15a8d1(0x13f)](_0x5941c8,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),_0x342149=await FileUtils[_0x15a8d1(0x99)](_0x2c80d1);if(!_0x342149)return[];const _0x526d24=await promises['readFile'](_0x2c80d1);return JSON[_0x15a8d1(0x10b)](_0x526d24[_0x15a8d1(0x17d)]());}async[a0_0xef8a28(0x193)](_0x3fc9cf){const _0x579b17=a0_0xef8a28,_0x22ebba=[node_path[_0x579b17(0x13f)](_0x3fc9cf,SYSTEM_FOLDER,CONFIG_FILE_NAME),node_path[_0x579b17(0x13f)](_0x3fc9cf,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),node_path[_0x579b17(0x13f)](_0x3fc9cf,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),node_path['join'](_0x3fc9cf,SFDX_PROJECT_FILE_NAME)];for(const _0x33a99c of _0x22ebba){const _0x39c3dc=await FileUtils[_0x579b17(0x99)](_0x33a99c);if(!_0x39c3dc)return![];}return!![];}async['setConfig'](_0x831a37,_0x4752ea){const _0x400f52=a0_0xef8a28,_0x275fd9=new ConfigSetAction({'stage':this[_0x400f52(0x137)]});await _0x275fd9[_0x400f52(0x12b)]({'name':_0x831a37,'value':_0x4752ea});}async[a0_0xef8a28(0x1e9)](_0x1a7660){const _0x294407=a0_0xef8a28;this[_0x294407(0x137)][_0x294407(0x1e9)](_0x1a7660);}[a0_0xef8a28(0x88)](_0x35caa7){const _0x594c31=a0_0xef8a28;return this[_0x594c31(0x137)][_0x594c31(0x88)](_0x35caa7);}async[a0_0xef8a28(0x16a)](_0x96f002){const _0x14e415=a0_0xef8a28;await this[_0x14e415(0x137)][_0x14e415(0x16a)](_0x96f002);}[a0_0xef8a28(0x9a)](_0x40aa89){const _0x327b99=a0_0xef8a28;this[_0x327b99(0x137)][_0x327b99(0xbe)]=_0x40aa89;}}class ReadlineUtils{static async[a0_0xef8a28(0x168)](_0x5d473c){const _0x3580c5=a0_0xef8a28,_0x4f4c20=readline['createInterface']({'input':process[_0x3580c5(0x128)],'output':process[_0x3580c5(0x181)]}),_0x3fdb4f=await _0x4f4c20[_0x3580c5(0x1a1)](_0x5d473c);return _0x4f4c20[_0x3580c5(0xd8)](),_0x3fdb4f;}}const INFO_COLOR_INDEX='4',WARN_COLOR_INDEX='3',ERROR_COLOR_INDEX='1';class Logger{[a0_0xef8a28(0x19e)];['infoDebug'];[a0_0xef8a28(0x1b3)];['errorDebug'];constructor({isJson:_0x11c359}){const _0x4221dd=a0_0xef8a28;this[_0x4221dd(0x19e)]=_0x11c359,debug[_0x4221dd(0xb3)]=console[_0x4221dd(0xb3)][_0x4221dd(0x1f8)](console),debug[_0x4221dd(0x1b9)](ROOT_NAME+':*'),this['infoDebug']=debug(ROOT_NAME+_0x4221dd(0x8c)),this[_0x4221dd(0x20f)]['color']=INFO_COLOR_INDEX,this[_0x4221dd(0x1b3)]=debug(ROOT_NAME+_0x4221dd(0x116)),this[_0x4221dd(0x1b3)][_0x4221dd(0x13b)]=WARN_COLOR_INDEX,this[_0x4221dd(0x14e)]=debug(ROOT_NAME+_0x4221dd(0xdf)),this['errorDebug']['color']=ERROR_COLOR_INDEX;}[a0_0xef8a28(0x1a5)](_0x42a422){const _0x433c5d=a0_0xef8a28;!this[_0x433c5d(0x19e)]&&this['infoDebug'](_0x42a422);}['warn'](_0x1aaa33){const _0x334894=a0_0xef8a28;!this[_0x334894(0x19e)]&&this[_0x334894(0x1b3)](_0x1aaa33);}[a0_0xef8a28(0x152)](_0x51d7d3){const _0x49a5e0=a0_0xef8a28;!this[_0x49a5e0(0x19e)]&&this[_0x49a5e0(0x14e)](_0x51d7d3);}}class BaseCommand{['_logger'];get[a0_0xef8a28(0x1fd)](){const _0x2cdfda=a0_0xef8a28;if(!this[_0x2cdfda(0x127)])throw new Error(_0x2cdfda(0x185));return this[_0x2cdfda(0x127)];}[a0_0xef8a28(0x215)](_0x49a00d){const _0x221161=a0_0xef8a28,_0x51bff4=new commander[(_0x221161(0xad))]()[_0x221161(0x113)](this[_0x221161(0x204)])[_0x221161(0xc9)](this[_0x221161(0xc9)]);for(const {name:_0x1d72b2,description:_0x9f3936,defaultValue:_0xdb4e6f}of this['arguments']){_0x51bff4[_0x221161(0x1f2)](_0x1d72b2,_0x9f3936,_0xdb4e6f);}for(const {flags:_0x5530a9,description:_0x57e483,defaultValue:_0x4c21d2}of this[_0x221161(0x83)]){_0x51bff4[_0x221161(0xcc)](_0x5530a9,_0x57e483,_0x4c21d2);}_0x51bff4['action'](async(..._0x5d3400)=>{const _0x254d6b=_0x221161,_0x57dbc9=this['isJson'](_0x5d3400);this[_0x254d6b(0x127)]=new Logger({'isJson':_0x57dbc9});try{const _0x1b4664=await this[_0x254d6b(0x12b)](_0x5d3400);_0x1b4664[_0x254d6b(0x80)](_0x57dbc9);}catch(_0x3c6a98){_0x3c6a98 instanceof Error&&this[_0x254d6b(0x1fd)]['error'](_0x3c6a98[_0x254d6b(0x139)]||INTERNAL_ERROR);}}),_0x49a00d[_0x221161(0xc1)](_0x51bff4);}}class BaseReporter{[a0_0xef8a28(0x10a)];get['success'](){return this['_success'];}constructor(_0x55d8fa){const _0x1ebe35=a0_0xef8a28;this[_0x1ebe35(0x10a)]=_0x55d8fa[_0x1ebe35(0x11a)];}[a0_0xef8a28(0x80)](_0x39b6b3){const _0x1acd14=a0_0xef8a28,_0x2db9da=this[_0x1acd14(0xa5)]();_0x39b6b3?this[_0x1acd14(0x1d0)](_0x2db9da):this['print'](_0x2db9da);}[a0_0xef8a28(0x1d0)](_0x143a82){const _0x24dccc=a0_0xef8a28,_0x4c8821=JSON['stringify'](_0x143a82,null,0x2);console[_0x24dccc(0xb3)](_0x4c8821);}}class FailReporter extends BaseReporter{['failMessage'];constructor({failMessage:_0x3f203b}){const _0x42c02e=a0_0xef8a28;super({'success':![]}),this[_0x42c02e(0x16d)]=_0x3f203b;}[a0_0xef8a28(0xa5)](){const _0x27b5ed=a0_0xef8a28;return{'success':this[_0x27b5ed(0x11a)],'failMessage':this[_0x27b5ed(0x16d)]};}[a0_0xef8a28(0xff)](_0x558fba){const _0x34ec78=a0_0xef8a28,_0xe8fb71=[['Fail\x20Message'],[_0x558fba[_0x34ec78(0x16d)]]];console[_0x34ec78(0xb3)](table[_0x34ec78(0x125)](_0xe8fb71,{'columns':[{'width':0x64}]}));}}class CheckoutReporter extends BaseReporter{['currentBranch'];[a0_0xef8a28(0x190)];constructor({currentBranch:_0x2d05fe,changes:_0x1fc403}){const _0x4e0d54=a0_0xef8a28;super({'success':!![]}),this['currentBranch']=_0x2d05fe,this[_0x4e0d54(0x190)]=_0x1fc403;}[a0_0xef8a28(0xa5)](){return{'success':this['success'],'targetBranch':this['currentBranch'],'changes':this['changes']};}[a0_0xef8a28(0xff)](_0x2c69fe){const _0x991649=a0_0xef8a28;console[_0x991649(0xb3)](_0x991649(0x15c)+this['currentBranch'][_0x991649(0x113)]+'\x0a'),console[_0x991649(0xb3)](_0x991649(0x93));const _0x166687=[[_0x991649(0x194),_0x991649(0x1a2),_0x991649(0x148),_0x991649(0x155)]];for(const {changeType:_0x36f292,name:_0x57bbc3,type:_0xcb83f6,paths:_0x30b62f}of _0x2c69fe[_0x991649(0x190)]){_0x166687[_0x991649(0x1f9)]([_0x36f292,_0x57bbc3,_0xcb83f6,_0x30b62f?.[_0x991649(0x13f)]('\x0a')||'']);}console[_0x991649(0xb3)](table['table'](_0x166687,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class BaseHandler{}class TargetBranchExistHandler extends BaseHandler{['manager'];[a0_0xef8a28(0x146)];[a0_0xef8a28(0x184)];[a0_0xef8a28(0x1fd)];[a0_0xef8a28(0x18b)]=[];constructor(_0x306f98){const _0x107b14=a0_0xef8a28;super(),this[_0x107b14(0x1a9)]=_0x306f98[_0x107b14(0x1a9)],this[_0x107b14(0x146)]=_0x306f98['credentials'],this[_0x107b14(0x184)]=_0x306f98[_0x107b14(0x184)],this[_0x107b14(0x1fd)]=_0x306f98[_0x107b14(0x1fd)];}async[a0_0xef8a28(0x1e3)](){const _0x1c1f13=a0_0xef8a28,_0x2bf600=await this[_0x1c1f13(0x1c2)]();if(_0x2bf600)return new FailReporter({'failMessage':_0x1c1f13(0x19b)});return this[_0x1c1f13(0x1fd)][_0x1c1f13(0x1a5)](_0x1c1f13(0xb8)),this[_0x1c1f13(0x1fd)]['info'](_0x1c1f13(0x20b)),await this['retrieveDifference'](),this[_0x1c1f13(0x1fd)][_0x1c1f13(0x1a5)](_0x1c1f13(0x98)),new CheckoutReporter({'currentBranch':{'id':this[_0x1c1f13(0x184)]['id'],'name':this[_0x1c1f13(0x184)]['name'],'headCommitId':this['targetBranch'][_0x1c1f13(0x1dc)]},'changes':this[_0x1c1f13(0x18b)]});}async[a0_0xef8a28(0x1c2)](){const _0x144f4e=a0_0xef8a28,_0x981a74=await this[_0x144f4e(0x1a9)][_0x144f4e(0x161)]();return!!_0x981a74[_0x144f4e(0x10f)];}async[a0_0xef8a28(0xa7)](){const _0x4e4c0e=a0_0xef8a28,{devopsUrl:_0x41a151,accessToken:_0x1f1ec1}=this['credentials'],_0x1c695d=await this[_0x4e4c0e(0x1a9)][_0x4e4c0e(0x206)]({'devopsUrl':_0x41a151,'accessToken':_0x1f1ec1,'targetBranchId':this[_0x4e4c0e(0x184)]['id'],'targetCommitId':this[_0x4e4c0e(0x184)]['headCommitId']});for(const {id:_0x5ee2b8,name:_0x1ac77a,type:_0xe6e5e6,changeType:_0x4955df}of _0x1c695d){if(!_0x5ee2b8){if(_0x4955df!==ChangeType[_0x4e4c0e(0xf0)])throw new Error(_0x4e4c0e(0x84));await this['manager'][_0x4e4c0e(0x205)]({'name':_0x1ac77a,'type':_0xe6e5e6,'changeType':_0x4955df}),this['componentChanges'][_0x4e4c0e(0x1f9)]({'changeType':_0x4955df,'name':_0x1ac77a,'type':_0xe6e5e6});continue;}const _0x73e8d=await ApiService[_0x4e4c0e(0x209)]({'devopsUrl':_0x41a151,'accessToken':_0x1f1ec1,'componentId':_0x5ee2b8});if(!_0x73e8d[_0x4e4c0e(0xee)])throw new Error('fHash\x20for\x20component\x20\x22'+_0x73e8d[_0x4e4c0e(0x113)]+_0x4e4c0e(0x1f1)+_0x73e8d[_0x4e4c0e(0xb4)]+'\x22\x20not\x20found');await this[_0x4e4c0e(0x1a9)]['saveComponent']({'name':_0x1ac77a,'type':_0xe6e5e6,'changeType':_0x4955df,'component':{..._0x73e8d,'fHash':_0x73e8d[_0x4e4c0e(0xee)]}}),this[_0x4e4c0e(0x18b)]['push']({'changeType':_0x4955df,'name':_0x1ac77a,'type':_0xe6e5e6,'paths':_0x73e8d[_0x4e4c0e(0x126)][_0x4e4c0e(0xdc)](_0x1b1a3a=>_0x1b1a3a['path'])});}this[_0x4e4c0e(0x1a9)]['saveBranchState'](this[_0x4e4c0e(0x184)]);}}class TargetBranchNotFoundHandler extends BaseHandler{[a0_0xef8a28(0x202)];['manager'];[a0_0xef8a28(0x146)];['targetBranchName'];['logger'];constructor(_0x43fcc5){const _0x1d2e79=a0_0xef8a28;super(),this['projectPath']=_0x43fcc5[_0x1d2e79(0x202)],this['manager']=_0x43fcc5[_0x1d2e79(0x1a9)],this[_0x1d2e79(0x146)]=_0x43fcc5['credentials'],this[_0x1d2e79(0x197)]=_0x43fcc5[_0x1d2e79(0x197)],this[_0x1d2e79(0x1fd)]=_0x43fcc5[_0x1d2e79(0x1fd)];}async[a0_0xef8a28(0x1e3)](){const _0x4c7d73=a0_0xef8a28;this[_0x4c7d73(0x1fd)]['info'](_0x4c7d73(0x1da));const {id:_0x2fddf6}=await this[_0x4c7d73(0x1a9)][_0x4c7d73(0x114)](this['projectPath']);if(!_0x2fddf6)return new FailReporter({'failMessage':_0x4c7d73(0x1e1)});const _0x3baf93=await ApiService[_0x4c7d73(0x159)]({'accessToken':this[_0x4c7d73(0x146)][_0x4c7d73(0xe4)],'devopsUrl':this[_0x4c7d73(0x146)]['devopsUrl'],'name':this[_0x4c7d73(0x197)],'parentId':_0x2fddf6});return this[_0x4c7d73(0x1a9)][_0x4c7d73(0xd2)](_0x3baf93),this['manager'][_0x4c7d73(0x9a)](![]),this['logger'][_0x4c7d73(0x1a5)](_0x4c7d73(0x20d)),new CheckoutReporter({'currentBranch':_0x3baf93,'changes':[]});}}class HandlerFactory{static[a0_0xef8a28(0x21a)](_0x5743d1){const _0x5b9594=a0_0xef8a28;if(_0x5743d1['targetBranch'])return new TargetBranchExistHandler({..._0x5743d1,'targetBranch':_0x5743d1[_0x5b9594(0x184)]});if(!_0x5743d1['targetBranch'])return new TargetBranchNotFoundHandler(_0x5743d1);throw new Error(_0x5b9594(0x118));}}class CheckoutCommand extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0x15d);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x102);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0xae),'description':'A\x20branch\x20name\x20which\x20you\x20checkout\x20on.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.'},{'flags':a0_0xef8a28(0x196),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();async[a0_0xef8a28(0x12b)]([{branch:_0x317133}]){const _0x214bd7=a0_0xef8a28,_0x304a50=await this[_0x214bd7(0x1bd)](_0x317133);this[_0x214bd7(0x1fd)][_0x214bd7(0x1a5)](_0x214bd7(0xd3)+_0x304a50+_0x214bd7(0x156));const _0x43d287=await this['manager'][_0x214bd7(0x193)](this['projectPath']);if(!_0x43d287)return this[_0x214bd7(0x1fd)][_0x214bd7(0x1eb)](_0x214bd7(0x1bf)),new FailReporter({'failMessage':_0x214bd7(0x1bf)});const _0x2479bb=await this[_0x214bd7(0xfa)](),_0x2d134a=await ApiService[_0x214bd7(0x86)](_0x2479bb);await this[_0x214bd7(0x1a9)]['initStage'](this[_0x214bd7(0x202)]);try{const _0x3c7f8d=await ApiService[_0x214bd7(0x1e0)]({'devopsUrl':_0x2d134a[_0x214bd7(0x214)],'accessToken':_0x2d134a[_0x214bd7(0xe4)],'branchName':_0x304a50}),_0x47c206=HandlerFactory['create']({'projectPath':this[_0x214bd7(0x202)],'manager':this[_0x214bd7(0x1a9)],'credentials':_0x2d134a,'targetBranch':_0x3c7f8d,'targetBranchName':_0x304a50,'logger':this[_0x214bd7(0x1fd)]}),_0x2376ad=await _0x47c206[_0x214bd7(0x1e3)]();return _0x2376ad[_0x214bd7(0x11a)]?(await this[_0x214bd7(0x1a9)][_0x214bd7(0x129)](),this[_0x214bd7(0x1fd)][_0x214bd7(0x1a5)](_0x214bd7(0xd3)+_0x304a50+_0x214bd7(0x105))):await this[_0x214bd7(0x1a9)][_0x214bd7(0x1a7)](),_0x2376ad;}catch(_0x2f73df){await this[_0x214bd7(0x1a9)][_0x214bd7(0x1a7)]();throw _0x2f73df;}}[a0_0xef8a28(0x19e)]([{json:_0x2308c4}]){return _0x2308c4;}async[a0_0xef8a28(0x1bd)](_0x3b396b){const _0x58ffce=a0_0xef8a28;if(_0x3b396b)return _0x3b396b;return ReadlineUtils[_0x58ffce(0x168)](_0x58ffce(0x9c));}async['getCredentialsAlias'](){const _0x1c915b=a0_0xef8a28,{credentialsAlias:_0x177873}=await this[_0x1c915b(0x1a9)][_0x1c915b(0xf9)](this[_0x1c915b(0x202)]);if(!_0x177873)throw new Error(_0x1c915b(0x1ac));if(typeof _0x177873!==_0x1c915b(0xd9))throw new Error(_0x1c915b(0xbb));return _0x177873;}}class CloneReporter extends BaseReporter{[a0_0xef8a28(0x202)];[a0_0xef8a28(0x21d)];constructor({projectPath:_0x58a2cc,components:_0x4f2733}){const _0x104ac4=a0_0xef8a28;super({'success':!![]}),this[_0x104ac4(0x202)]=_0x58a2cc,this[_0x104ac4(0x21d)]=_0x4f2733;}[a0_0xef8a28(0xa5)](){const _0x55de56=a0_0xef8a28;return{'success':this['success'],'projectPath':this[_0x55de56(0x202)],'components':this['components']};}[a0_0xef8a28(0xff)](_0x379841){const _0x4aa42c=a0_0xef8a28;console['log'](_0x4aa42c(0x162));const _0x1e9036=[[_0x4aa42c(0x147)],[_0x379841[_0x4aa42c(0x202)]]];console[_0x4aa42c(0xb3)](table['table'](_0x1e9036,{'columns':[{'width':0x28}]})),console[_0x4aa42c(0xb3)](_0x4aa42c(0x217));const _0xb35053=[[_0x4aa42c(0x1a2),'Type',_0x4aa42c(0x155)]];for(const {name:_0x1704c8,type:_0x3cdf85,paths:_0x27c4de}of _0x379841[_0x4aa42c(0x21d)]){_0xb35053[_0x4aa42c(0x1f9)]([_0x1704c8,_0x3cdf85,_0x27c4de[_0x4aa42c(0x13f)]('\x0a')]);}console[_0x4aa42c(0xb3)](table['table'](_0xb35053,{'columns':[{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CloneCommand extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0x1fc);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x1e4);['arguments']=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0xc4),'description':a0_0xef8a28(0x17e)},{'flags':a0_0xef8a28(0x21c),'description':a0_0xef8a28(0xa9),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':'--json','description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();['retrievedComponents']=[];[a0_0xef8a28(0x154)];get[a0_0xef8a28(0x146)](){const _0x403a93=a0_0xef8a28;if(!this[_0x403a93(0x154)])throw new Error(_0x403a93(0x178));return this[_0x403a93(0x154)];}async[a0_0xef8a28(0x12b)]([_0x50eb96]){const _0x12380b=a0_0xef8a28;this[_0x12380b(0x1fd)][_0x12380b(0x1a5)]('Cloning\x20started'),this[_0x12380b(0x154)]=await ApiService[_0x12380b(0x86)](_0x50eb96[_0x12380b(0x145)]);const _0x517af3=await this['buildProjectPath'](_0x50eb96[_0x12380b(0x113)]);this[_0x12380b(0x1fd)][_0x12380b(0x1a5)](_0x12380b(0x112));const _0x2291bf=await this[_0x12380b(0x1a9)][_0x12380b(0x193)](_0x517af3);if(_0x2291bf)return this[_0x12380b(0x1fd)]['warn']('Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.'),new FailReporter({'failMessage':_0x12380b(0x175)});await this[_0x12380b(0x1a9)][_0x12380b(0x1ef)](_0x517af3);try{return await this['manager'][_0x12380b(0x133)]({'config':{'credentialsAlias':_0x50eb96['alias']}}),this[_0x12380b(0x1fd)]['info'](_0x12380b(0x1b1)),await this['retrieve'](),await this['manager']['applyStage'](),this[_0x12380b(0x1fd)][_0x12380b(0x1a5)]('Cloning\x20completed'),new CloneReporter({'projectPath':_0x517af3,'components':this[_0x12380b(0xdb)]});}catch(_0x5ab8c9){await this[_0x12380b(0x1a9)][_0x12380b(0x1a7)]();throw _0x5ab8c9;}}[a0_0xef8a28(0x19e)]([{json:_0x439342}]){return _0x439342;}async['retrieve'](){const _0x5ac487=a0_0xef8a28;this[_0x5ac487(0x1fd)][_0x5ac487(0x1a5)]('Retrieve\x20components\x20started');const {accessToken:_0x581b7f,devopsUrl:_0x1a9c5c}=this[_0x5ac487(0x146)],_0x1dfdd5=await ApiService['getDefaultBranch']({'devopsUrl':_0x1a9c5c,'accessToken':_0x581b7f});this[_0x5ac487(0x1a9)][_0x5ac487(0xd2)](_0x1dfdd5);for await(const _0x343c42 of ApiService[_0x5ac487(0x173)]({'devopsUrl':_0x1a9c5c,'accessToken':_0x581b7f,'branchId':_0x1dfdd5['id'],'commitId':_0x1dfdd5['headCommitId']})){if(!_0x343c42[_0x5ac487(0xee)])throw new Error(_0x343c42[_0x5ac487(0x113)]+'\x20of\x20type\x20'+_0x343c42[_0x5ac487(0xb4)]+'\x20was\x20deleted');await this[_0x5ac487(0x1a9)][_0x5ac487(0x205)]({'name':_0x343c42[_0x5ac487(0x113)],'type':_0x343c42[_0x5ac487(0xb4)],'changeType':ChangeType['CREATE'],'component':{..._0x343c42,'fHash':_0x343c42[_0x5ac487(0xee)]}}),this['retrievedComponents'][_0x5ac487(0x1f9)]({'name':_0x343c42[_0x5ac487(0x113)],'type':_0x343c42[_0x5ac487(0xb4)],'paths':_0x343c42[_0x5ac487(0x126)][_0x5ac487(0xdc)](_0x4f71f5=>_0x4f71f5[_0x5ac487(0x119)])});}this['logger']['info'](_0x5ac487(0x98));}async[a0_0xef8a28(0x1ba)](_0x1850fe){const _0x272e3f=a0_0xef8a28;if(_0x1850fe)return node_path[_0x272e3f(0x13f)](process[_0x272e3f(0x141)](),_0x1850fe);const _0x5b7b77=await ReadlineUtils[_0x272e3f(0x168)](_0x272e3f(0x7e));return node_path['join'](process[_0x272e3f(0x141)](),_0x5b7b77);}}class CommitReporter extends BaseReporter{[a0_0xef8a28(0x190)];constructor({changes:_0xef84ca}){const _0x1d43cc=a0_0xef8a28;super({'success':!![]}),this[_0x1d43cc(0x190)]=_0xef84ca;}[a0_0xef8a28(0xa5)](){const _0x128f38=a0_0xef8a28;return{'success':this[_0x128f38(0x11a)],'changes':this[_0x128f38(0x190)]};}[a0_0xef8a28(0xff)](_0x3251f3){const _0x1c6c9d=a0_0xef8a28;console[_0x1c6c9d(0xb3)](_0x1c6c9d(0x1ec));const _0x521d99=[[_0x1c6c9d(0x194),_0x1c6c9d(0x1a2),'Type',_0x1c6c9d(0x155)]];for(const {changeType:_0x5493a6,name:_0x533f97,type:_0xe53c6c,paths:_0x273115}of _0x3251f3[_0x1c6c9d(0x190)]){_0x521d99['push']([_0x5493a6,_0x533f97,_0xe53c6c,_0x273115?.[_0x1c6c9d(0x13f)]('\x0a')||'']);}console['log'](table[_0x1c6c9d(0x125)](_0x521d99,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CommitCommand extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0x1a4);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x198);['arguments']=[];['options']=[{'flags':a0_0xef8a28(0x17f),'description':a0_0xef8a28(0x153)},{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();['componentChanges']=[];[a0_0xef8a28(0x154)];[a0_0xef8a28(0x9f)];[a0_0xef8a28(0x9b)];['_changes'];get[a0_0xef8a28(0x146)](){const _0x2872ea=a0_0xef8a28;if(!this['_credentials'])throw new Error('Credentials\x20not\x20found');return this[_0x2872ea(0x154)];}get[a0_0xef8a28(0x135)](){const _0x3ec03e=a0_0xef8a28;if(!this['_branchId'])throw new Error(_0x3ec03e(0xbc));return this[_0x3ec03e(0x9f)];}get[a0_0xef8a28(0xc7)](){const _0x14baeb=a0_0xef8a28;if(!this[_0x14baeb(0x9b)])throw new Error(_0x14baeb(0x115));return this[_0x14baeb(0x9b)];}get[a0_0xef8a28(0x190)](){const _0xe5dd68=a0_0xef8a28;if(!this[_0xe5dd68(0xc0)])throw new Error(_0xe5dd68(0x200));return this[_0xe5dd68(0xc0)];}async['execute']([_0x34720c]){const _0x5a336b=a0_0xef8a28;this[_0x5a336b(0x1fd)]['info'](_0x5a336b(0x1c6));const _0x40b2f1=await this[_0x5a336b(0x1a9)]['isInitialized'](this[_0x5a336b(0x202)]);if(!_0x40b2f1)return this[_0x5a336b(0x1fd)][_0x5a336b(0x1eb)](_0x5a336b(0x1bf)),new FailReporter({'failMessage':_0x5a336b(0x1bf)});const _0x32a6ca=await this[_0x5a336b(0xd6)](_0x34720c[_0x5a336b(0x139)]);await this[_0x5a336b(0x172)](),await this[_0x5a336b(0x86)]();const _0xb3ab53=await this[_0x5a336b(0x165)]();if(_0xb3ab53)return this['logger'][_0x5a336b(0x1eb)]('Local\x20and\x20remote\x20head\x20commits\x20don\x27t\x20match.\x20Use\x20\x22flosum\x20devops\x20pull\x22\x20to\x20retrieve\x20latest\x20updates\x20from\x20devops'),new FailReporter({'failMessage':_0x5a336b(0xab)});await this['manager'][_0x5a336b(0x1ef)](this[_0x5a336b(0x202)]);try{this[_0x5a336b(0xc0)]=await this['manager'][_0x5a336b(0x161)]();if(!this[_0x5a336b(0x190)][_0x5a336b(0x10f)])return this[_0x5a336b(0x1fd)]['warn']('No\x20Local\x20Changes'),new FailReporter({'failMessage':'No\x20Local\x20Changes'});return await this[_0x5a336b(0x134)](_0x32a6ca),await this[_0x5a336b(0x1a9)]['applyStage'](),this[_0x5a336b(0x1fd)][_0x5a336b(0x1a5)](_0x5a336b(0x1a0)),new CommitReporter({'changes':this[_0x5a336b(0x18b)]});}catch(_0x548f74){await this['manager']['abortStage']();throw _0x548f74;}}['isJson']([{json:_0x55b93a}]){return _0x55b93a;}async[a0_0xef8a28(0xd6)](_0x572052){const _0x15948f=a0_0xef8a28;if(_0x572052)return _0x572052;const _0x27b023=await ReadlineUtils[_0x15948f(0x168)](_0x15948f(0x10d));return _0x27b023;}async['getCredentials'](){const _0x5efd7a=a0_0xef8a28,{credentialsAlias:_0x1ef509}=await this[_0x5efd7a(0x1a9)][_0x5efd7a(0xf9)](this[_0x5efd7a(0x202)]);if(!_0x1ef509)throw new Error(_0x5efd7a(0x1ac));if(typeof _0x1ef509!==_0x5efd7a(0xd9))throw new Error(_0x5efd7a(0xbb));this['_credentials']=await ApiService[_0x5efd7a(0x86)](_0x1ef509);}async[a0_0xef8a28(0x172)](){const _0x24dc4e=a0_0xef8a28,{id:_0x1777bb,headCommitId:_0x5740e4}=await this[_0x24dc4e(0x1a9)][_0x24dc4e(0x114)](this[_0x24dc4e(0x202)]);this[_0x24dc4e(0x9f)]=_0x1777bb||void 0x0,this[_0x24dc4e(0x9b)]=_0x5740e4||void 0x0;}async[a0_0xef8a28(0x165)](){const _0x359704=a0_0xef8a28,{headCommitId:_0x2bff7f}=await ApiService[_0x359704(0x12f)]({'accessToken':this[_0x359704(0x146)][_0x359704(0xe4)],'devopsUrl':this[_0x359704(0x146)][_0x359704(0x214)],'branchId':this[_0x359704(0x135)]});return this[_0x359704(0xc7)]!==_0x2bff7f;}async[a0_0xef8a28(0x134)](_0x3393a5){const _0x262760=a0_0xef8a28;this[_0x262760(0x1fd)]['info'](_0x262760(0x1b2));const _0x9c1a33=await ApiService[_0x262760(0x104)]({'accessToken':this[_0x262760(0x146)][_0x262760(0xe4)],'devopsUrl':this[_0x262760(0x146)][_0x262760(0x214)]}),_0x316492={'accessToken':this[_0x262760(0x146)][_0x262760(0xe4)],'devopsUrl':this['credentials'][_0x262760(0x214)],'message':_0x3393a5,'branchId':this[_0x262760(0x135)],'components':[],'userName':_0x9c1a33[_0x262760(0x11e)]+'\x20'+_0x9c1a33['lastName']};for(const _0x121e90 of this['changes']){const _0x283c72=await this['manager']['updateComponentState'](_0x121e90),_0x1985a3=_0x283c72[_0x262760(0x1c3)]===ChangeType[_0x262760(0xf4)]?_0x283c72[_0x262760(0x113)]:void 0x0,_0x589179=this[_0x262760(0x12e)](_0x283c72[_0x262760(0x113)],_0x1985a3,_0x283c72[_0x262760(0xb4)],_0x283c72?.['paths']||[]);_0x316492[_0x262760(0x21d)][_0x262760(0x1f9)](_0x589179),this['componentChanges'][_0x262760(0x1f9)](_0x283c72);}this[_0x262760(0x1fd)][_0x262760(0x1a5)](_0x262760(0x1ee)+this[_0x262760(0x190)][_0x262760(0x10f)]+_0x262760(0x13a)),await ApiService[_0x262760(0x1a4)](_0x316492);const _0x31ef8e=await ApiService[_0x262760(0x12f)]({'accessToken':this[_0x262760(0x146)][_0x262760(0xe4)],'devopsUrl':this[_0x262760(0x146)][_0x262760(0x214)],'branchId':this['branchId']});this[_0x262760(0x1a9)][_0x262760(0xd2)](_0x31ef8e);}[a0_0xef8a28(0x12e)](_0x12da9a,_0xe9c7c4,_0xbee3b9,_0x156708){const _0x5d09ee=a0_0xef8a28,_0x10d205={'name':_0x12da9a,'label':_0xe9c7c4,'type':_0xbee3b9,'files':[]};for(const _0x519001 of _0x156708){const _0x15ceae=_0x519001[_0x5d09ee(0x188)](node_path[_0x5d09ee(0xfe)])['slice'](0x3)[_0x5d09ee(0x13f)]('/'),_0x5c29c3=node_path[_0x5d09ee(0x13f)](this['projectPath'],_0x519001);_0x10d205['files'][_0x5d09ee(0x1f9)]({'path':_0x15ceae,'localPath':_0x5c29c3});}return _0x10d205;}}class ConfigSetReporter extends BaseReporter{[a0_0xef8a28(0xfb)];[a0_0xef8a28(0x109)];constructor({configName:_0x1c5df1,value:_0x47f626}){const _0x2785fb=a0_0xef8a28;super({'success':!![]}),this[_0x2785fb(0xfb)]=_0x1c5df1,this[_0x2785fb(0x109)]=_0x47f626;}[a0_0xef8a28(0xa5)](){const _0x86a587=a0_0xef8a28;return{'success':this['success'],'configName':this[_0x86a587(0xfb)],'value':this[_0x86a587(0x109)]};}[a0_0xef8a28(0xff)](_0x5edda6){const _0x5c960f=a0_0xef8a28,_0x1c615d=[[_0x5c960f(0x1ea),_0x5c960f(0x1b7)],[_0x5edda6[_0x5c960f(0xfb)],_0x5edda6[_0x5c960f(0x109)]]];console[_0x5c960f(0xb3)](table[_0x5c960f(0x125)](_0x1c615d));}}function a0_0x5cd1(){const _0x19044c=['retrieveDifference','1194808yeGBTQ','Alias\x20of\x20credentials\x20which\x20will\x20be\x20used\x20to\x20retrieve\x20your\x20components\x20from\x20devops.','flat','Local\x20and\x20remote\x20head\x20commits\x20don\x27t\x20match.\x20Use\x20\x22flosum\x20devops\x20pull\x22\x20to\x20retrieve\x20latest\x20updates\x20from\x20devops','now','Command','-b,\x20--branch\x20<string>','node:path','fHash\x20for\x20component\x20\x22','paths','Stage\x20folder\x20not\x20found','log','type','1jgBpCP','digest','interceptors','Checking\x20manual\x20changes\x20completed','pendingChanges','access','Invalid\x20credentials\x20type','Branch\x20id\x20not\x20found','rows','isUpdateStageTimestamp','list','_changes','addCommand','findDeletedAndUpdated','Config\x20value','-n,\x20--name\x20<string>','Rollback\x20started','save','localHeadCommit','applyFileChanges','description','credentialsAlias','utf-8','option','all','List\x20all\x20remote\x20branches.','228426AmesGI','status','Rolled\x20Back\x20Changes:','saveBranchState','Checkout\x20on\x20\x22','Pull\x20latest\x20branch\x20commit\x20from\x20devops.','list-branches','getMessage','(((.+)+)+)+$','close','string','replace','retrievedComponents','map','Logout\x20completed','Looking\x20for\x20changes\x20started',':ERROR','fit/branches/','PATH\x20env\x20not\x20found','Create:\x20Component\x20not\x20found','registerFileChange','accessToken','reject','values','<value>','CLI','writeFile','commander','VLOCITY','Enter\x20api\x20token:\x20','handleFileChange','fHash','use','DELETE','commitId','\x22\x20already\x20exists','findIndex','CREATE','Status\x20calculation\x20started','@flosum/salesforce','basename','commitDate','readConfig','getCredentialsAlias','configName','Config\x20set\x20started','parentId','sep','print','branchState','updateSystemFiles','Checkout\x20on\x20another\x20branch.\x20Checkout\x20command\x20retrieves\x20components\x20missing\x20locally.','Missing\x20content\x20for\x20not\x20Delete\x20change\x20type','getMe','\x22\x20completed','login','Status','sha1','value','_success','parse','readdir','Enter\x20commit\x20message:\x20','Logout\x20started','length','fk_','delete','Project\x20initialization\x20started','name','readBranchState','Local\x20head\x20commit\x20id\x20not\x20found',':WARN','Rollback\x20completed','Checkout\x20handler\x20not\x20found','path','success','cleanUpEmptyFolders','listBranches','splice','firstName','rmdir','label','UPDATE','_stage','set','response','table','files','_logger','stdin','applyStage','fileChanges','execute','<config-name>','count','convertToLocalComponent','getBranchById','cause','axios','branches','initProject','findAndCommitChanges','branchId','includes','stage','\x20services','message','\x20components\x20will\x20be\x20committed','color','CREDENTIALS_ALIAS','Pulling\x20latest\x20updates\x20completed','force-app','join','List\x20credentials\x20started','cwd','CLI\x20for\x20work\x20with\x20','\x20services.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','Pulling\x20latest\x20updates\x20started','alias','credentials','Project\x20Path','Type','instance','File','logout','R_OK','SfProjectScanner','errorDebug','-t,\x20--token\x20<string>','12010iEnNBT','hex','error','Commit\x20message.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','_credentials','Files','\x22\x20started','1090dPUjuL','\x20not\x20found','createBranch','Saved\x20credentials\x20alias.','PATH','Current\x20Branch:\x20','checkout','globalSettingsUrl','W_OK','_stagePath','findChanges','Init\x20Result:','Salesforce','filter','areRemoteChanges','node:fs/promises','Alias','askString','Applies\x20json\x20formatted\x20result.','addFileChange','listComponentsGenerator','Devops\x20commands','failMessage','slice','mkdir','config','auth/me','getBranchState','retrieveComponents','get','Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.','Login\x20into\x20global\x20settings\x20and\x20retrieve\x20data\x20about\x20related\x20services.','Global\x20Settings\x20Url','Credentials\x20not\x20found','componentsForRetrieve','Config\x20name.\x20Allowed\x20values:\x20','node:os','size','toString','A\x20name\x20of\x20a\x20folder\x20where\x20a\x20project\x20will\x20be\x20stored.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','-m,\x20--message\x20<string>','Pending\x20Changes:','stdout','ECONNREFUSED','createComponent','targetBranch','Logger\x20not\x20found','\x22\x20wasn\x27t\x20restored','fit/file-versions/','split','/commits/','version','componentChanges','find','Listing\x20remote\x20branches\x20completed','dirname','getAllCredentials','changes','fit/branches','readComponentsState','isInitialized','Change\x20Type','rollback','--json','targetBranchName','Commit\x20local\x20changes\x20to\x20a\x20remote\x20branch\x20on\x20devops.','isDirectoryExists','/components','Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed','applyCreateUpdate','targetCommitId','isJson','stagePath','Commit\x20completed','question','Name','handleRestore','commit','info','A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first','abortStage','userName','manager','search','filesChanges','Credentials\x20alias\x20is\x20not\x20configured','Component\x20','Rolling\x20back\x20to\x20last\x20committed\x20state\x20completed','then','\x20of\x20type\x20','Project\x20initialization\x20completed','Detecting\x20changes\x20started','warnDebug','No\x20changes\x20for\x20rollback','INTERNAL\x20ERROR','Not\x20Found','Value','_headCommitId','enable','buildProjectPath','Branch\x20Name','DEVOPS_COMMANDS','getBranchName','trunc','Project\x20is\x20not\x20initialized','copyFile','base64','areChanges','changeType','content','arguments','Commit\x20started','Devops\x20url\x20not\x20found','code','1451122cFImrD','post','Roll\x20back\x20your\x20branch\x20state\x20to\x20last\x20committed\x20one.','0.0.3','listComponents','1716fkllMA','catch','printJson','node:crypto','targetBranchId','\x22\x20not\x20found','ROOT_COMMANDS','indexOf','entries','data','default','getUpdatedComponentChanges','Creation\x20new\x20branch\x20started','getFolderFilePaths','headCommitId','homedir','setConfig','delimiter','getBranch','To\x20create\x20a\x20new\x20branch\x20a\x20branch\x20should\x20be\x20selected.\x20Checkout\x20on\x20any\x20existing\x20branch','debug','handle','Initialize\x20salesforce\x20project\x20and\x20retrieve\x20\x22main\x22\x20branch\x20from\x20registered\x20devops\x20tenant.','Delete\x20saved\x20credentials.','isDirectory','Alias\x20which\x20saved\x20credentials\x20will\x20be\x20accessed\x20with.','Create','unsetConfig','Config\x20Name','warn','Committed\x20Components:','14AikKNO','Detecting\x20changes\x20completed.\x20','initStage','Head\x20commit\x20id\x20not\x20found','\x22\x20of\x20type\x20\x22','argument','readFile','rollbackTypes','DevOps','config-unset','env','bind','push','branch-state.json','Connection\x20refused','clone','logger','getDefaultBranch','_branchState','Changes\x20not\x20found','SALESFORCE','projectPath','Update','commandName','saveComponent','compareWithRemoteBranch','branchName','Devops\x20Url','retrieveComponentById','config.json','Retrieve\x20components\x20started','updateComponent','Creation\x20new\x20branch\x20completed','_projectPath','infoDebug','isAxiosError','Return\x20all\x20local\x20not\x20committed\x20changes.','applyDelete','deleteComponent','devopsUrl','register','statusText','Retrieve\x20Result:','Credentials\x20with\x20alias\x20\x22','getInstance','create','1673108tZApBQ','-a,\x20--alias\x20<string>','components','components-state.json','scan','(string)','Update:\x20Component\x20not\x20found','Vlocity','_isUpdateStageTimestamp','.bin','Create\x20salesforce\x20project\x20and\x20cli\x20system\x20files.','abort','Enter\x20project\x20name:\x20','from','report','componentsState','NULL','options','Component\x20id\x20not\x20found\x20after\x20comparison','changeFile','getCredentials','Display\x20all\x20authorized\x20credentials.','updateComponentState','Set\x20project\x20config.','156324JuUBie','Config\x20set\x20completed',':INFO','calculateComponentHash','indexes','sfdx-project.json','apply','createHash','stringify','Project\x20Updates:','update','updateBranchState','stat','File\x20\x22','Retrieve\x20components\x20completed','isFileExists','setIsUpdateStageTimestamp','_localHeadCommit','Enter\x20a\x20branch\x20name:\x20','_componentsState','List\x20credentials\x20completed','_branchId','\x20files\x20will\x20be\x20rolled\x20back','5292432sMFYuS','convertToCommit','defineRollbackTypes','component','buildReport','constants'];a0_0x5cd1=function(){return _0x19044c;};return a0_0x5cd1();}const ALLOWED_VALUES=[ConfigName['CREDENTIALS_ALIAS']+a0_0xef8a28(0x220)];class ConfigSetCommand extends BaseCommand{['commandName']='config-set';[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x89);['arguments']=[{'name':'<config-name>','description':a0_0xef8a28(0x17a)+ALLOWED_VALUES[a0_0xef8a28(0x13f)](',\x20')+'.'},{'name':a0_0xef8a28(0xe7),'description':a0_0xef8a28(0xc3)}];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();async['execute']([_0x5dd16e,_0x38db79]){const _0x5a6c44=a0_0xef8a28;this['logger']['info']('Config\x20set\x20started');const _0x292962=process[_0x5a6c44(0x141)](),_0x212187=await this[_0x5a6c44(0x1a9)][_0x5a6c44(0x193)](_0x292962);if(!_0x212187)return this[_0x5a6c44(0x1fd)][_0x5a6c44(0x1eb)](_0x5a6c44(0x1bf)),new FailReporter({'failMessage':_0x5a6c44(0x1bf)});await this['manager'][_0x5a6c44(0x1ef)](_0x292962);try{return await this[_0x5a6c44(0x1a9)][_0x5a6c44(0x1de)](_0x5dd16e,_0x38db79),await this[_0x5a6c44(0x1a9)][_0x5a6c44(0x129)](),this[_0x5a6c44(0x1fd)][_0x5a6c44(0x1a5)]('Config\x20set\x20completed'),new ConfigSetReporter({'configName':_0x5dd16e,'value':_0x38db79});}catch(_0x3e006e){await this['manager'][_0x5a6c44(0x1a7)]();throw _0x3e006e;}}[a0_0xef8a28(0x19e)]([,,{json:_0x31bc2c}]){return _0x31bc2c;}}class ConfigUnsetReporter extends BaseReporter{[a0_0xef8a28(0xfb)];constructor(_0x16128d){const _0x46dd4a=a0_0xef8a28;super({'success':!![]}),this[_0x46dd4a(0xfb)]=_0x16128d['configName'];}['buildReport'](){const _0x2f6216=a0_0xef8a28;return{'success':!![],'configName':this[_0x2f6216(0xfb)],'value':null};}[a0_0xef8a28(0xff)](_0xbc86a7){const _0x1d1a05=a0_0xef8a28,_0x31a0f9=[['Config\x20Name','Value'],[_0xbc86a7[_0x1d1a05(0xfb)],_0xbc86a7[_0x1d1a05(0x109)]||_0x1d1a05(0x82)]];console[_0x1d1a05(0xb3)](table[_0x1d1a05(0x125)](_0x31a0f9));}}class ConfigUnset extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0x1f6);['description']='Clear\x20project\x20config\x20property.';[a0_0xef8a28(0x1c5)]=[{'name':a0_0xef8a28(0x12c),'description':a0_0xef8a28(0x17a)+Object[a0_0xef8a28(0xe6)](ConfigName)[a0_0xef8a28(0x13f)](',\x20')+'.'}];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();async['execute']([_0x39e5a0]){const _0xf48039=a0_0xef8a28;this[_0xf48039(0x1fd)][_0xf48039(0x1a5)](_0xf48039(0xfc));const _0x15287e=await this[_0xf48039(0x1a9)][_0xf48039(0x193)](this[_0xf48039(0x202)]);if(!_0x15287e)return this[_0xf48039(0x1fd)]['warn'](_0xf48039(0x1bf)),new FailReporter({'failMessage':_0xf48039(0x1bf)});await this[_0xf48039(0x1a9)][_0xf48039(0x1ef)](this[_0xf48039(0x202)]);try{return await this[_0xf48039(0x1a9)][_0xf48039(0x1e9)](_0x39e5a0),await this[_0xf48039(0x1a9)][_0xf48039(0x129)](),this[_0xf48039(0x1fd)][_0xf48039(0x1a5)](_0xf48039(0x8b)),new ConfigUnsetReporter({'configName':_0x39e5a0});}catch(_0x433454){await this[_0xf48039(0x1a9)][_0xf48039(0x1a7)]();throw _0x433454;}}[a0_0xef8a28(0x19e)]([,{json:_0x474421}]){return _0x474421;}}class InitReporter extends BaseReporter{[a0_0xef8a28(0x202)];constructor({projectPath:_0x39d2bf}){super({'success':!![]}),this['projectPath']=_0x39d2bf;}[a0_0xef8a28(0xa5)](){const _0x1ea157=a0_0xef8a28;return{'success':this[_0x1ea157(0x11a)],'projectPath':this[_0x1ea157(0x202)]};}[a0_0xef8a28(0xff)](_0x3a0304){const _0x4d6635=a0_0xef8a28,_0x2644b9=[[_0x4d6635(0x147)],[_0x3a0304[_0x4d6635(0x202)]]];console['log'](table['table'](_0x2644b9,{'columns':[{'width':0x28}]}));}}class InitCommand extends BaseCommand{[a0_0xef8a28(0x204)]='init';['description']=a0_0xef8a28(0x7c);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':'-n,\x20--name\x20<string>','description':a0_0xef8a28(0x17e)},{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x1a9)]=ProjectManager['getInstance']();async[a0_0xef8a28(0x12b)]([_0x53b5f7]){const _0x1fc84d=a0_0xef8a28;this[_0x1fc84d(0x1fd)][_0x1fc84d(0x1a5)]('Project\x20initialization\x20started');const _0xb02dfd=await this[_0x1fc84d(0x1ba)](_0x53b5f7[_0x1fc84d(0x113)]),_0x2ecd88=await this[_0x1fc84d(0x1a9)][_0x1fc84d(0x193)](_0xb02dfd);if(_0x2ecd88)return this[_0x1fc84d(0x1fd)][_0x1fc84d(0x1eb)](_0x1fc84d(0x175)),new FailReporter({'failMessage':_0x1fc84d(0x175)});await this['manager'][_0x1fc84d(0x1ef)](_0xb02dfd);try{return await this[_0x1fc84d(0x1a9)][_0x1fc84d(0x133)]({}),await this[_0x1fc84d(0x1a9)][_0x1fc84d(0x129)](),this['logger']['info'](_0x1fc84d(0x1b1)),new InitReporter({'projectPath':_0xb02dfd});}catch(_0x4c6a80){await this['manager']['abortStage']();throw _0x4c6a80;}}[a0_0xef8a28(0x19e)]([{json:_0x20f8ca}]){return _0x20f8ca;}async[a0_0xef8a28(0x1ba)](_0x1d96ff){const _0x14a0ea=a0_0xef8a28;if(_0x1d96ff)return node_path[_0x14a0ea(0x13f)](process[_0x14a0ea(0x141)](),_0x1d96ff);const _0x5adeef=await ReadlineUtils['askString']('Enter\x20project\x20name:\x20');return node_path[_0x14a0ea(0x13f)](process[_0x14a0ea(0x141)](),_0x5adeef);}}class ListBranchesReporter extends BaseReporter{[a0_0xef8a28(0x132)];constructor(_0xa36f93){const _0x55e560=a0_0xef8a28;super({'success':!![]}),this[_0x55e560(0x132)]=_0xa36f93[_0x55e560(0x132)];}['buildReport'](){const _0x581341=a0_0xef8a28;return{'success':this[_0x581341(0x11a)],'branches':this['branches']};}['print'](_0x4e1400){const _0x2799ca=a0_0xef8a28,_0x28870c=[[_0x2799ca(0x1bb)]];for(const _0xaac820 of _0x4e1400[_0x2799ca(0x132)]){_0x28870c[_0x2799ca(0x1f9)]([_0xaac820]);}console[_0x2799ca(0xb3)](table[_0x2799ca(0x125)](_0x28870c,{'columns':[{'width':0x1e}]}));}}class ListBranchesCommand extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0xd5);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0xce);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();async['execute'](){const _0x2f3da1=a0_0xef8a28;this[_0x2f3da1(0x1fd)]['info']('Listing\x20remote\x20branches\x20started');const _0x42a86e=await this[_0x2f3da1(0x1a9)]['isInitialized'](this[_0x2f3da1(0x202)]);if(!_0x42a86e)return this[_0x2f3da1(0x1fd)][_0x2f3da1(0x1eb)]('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0x5dcd56=await this[_0x2f3da1(0xfa)](),{accessToken:_0x14b7ef,devopsUrl:_0x2f5a47}=await ApiService[_0x2f3da1(0x86)](_0x5dcd56),_0x34d61f=await ApiService['listBranches']({'accessToken':_0x14b7ef,'devopsUrl':_0x2f5a47});return this[_0x2f3da1(0x1fd)][_0x2f3da1(0x1a5)](_0x2f3da1(0x18d)),new ListBranchesReporter({'branches':_0x34d61f['map'](_0x469b6d=>_0x469b6d[_0x2f3da1(0x113)])});}[a0_0xef8a28(0x19e)]([{json:_0x10e4b3}]){return _0x10e4b3;}async[a0_0xef8a28(0xfa)](){const _0x411506=a0_0xef8a28,{credentialsAlias:_0x427419}=await this['manager'][_0x411506(0xf9)](this[_0x411506(0x202)]);if(!_0x427419)throw new Error(_0x411506(0x1ac));if(typeof _0x427419!==_0x411506(0xd9))throw new Error('Invalid\x20credentials\x20type');return _0x427419;}}class ListCredentialsReporter extends BaseReporter{[a0_0xef8a28(0x146)];constructor(_0x4b4fff){const _0x36236a=a0_0xef8a28;super({'success':!![]}),this[_0x36236a(0x146)]=_0x4b4fff[_0x36236a(0x146)];}[a0_0xef8a28(0xa5)](){const _0x3cabb4=a0_0xef8a28;return{'success':this[_0x3cabb4(0x11a)],'credentials':this[_0x3cabb4(0x146)]};}[a0_0xef8a28(0xff)](_0x2ba494){const _0x1d1734=a0_0xef8a28,_0x515090=[[_0x1d1734(0x167),_0x1d1734(0x177),_0x1d1734(0x208)]];for(const {alias:_0x43de45,globalSettingsUrl:_0x521eb8,devopsUrl:_0x25696d}of _0x2ba494[_0x1d1734(0x146)]){_0x515090['push']([_0x43de45,_0x521eb8,_0x25696d||_0x1d1734(0x1b6)]);}console[_0x1d1734(0xb3)](table['table'](_0x515090));}}class ListCredentialsCommand extends BaseCommand{[a0_0xef8a28(0x204)]='list-credentials';[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x87);[a0_0xef8a28(0x1c5)]=[];['options']=[{'flags':'--json','description':a0_0xef8a28(0x169),'defaultValue':![]}];async[a0_0xef8a28(0x12b)](){const _0x322066=a0_0xef8a28;this[_0x322066(0x1fd)][_0x322066(0x1a5)](_0x322066(0x140));const _0x37987a=await CredentialsManager[_0x322066(0xbf)]();return this[_0x322066(0x1fd)]['info'](_0x322066(0x9e)),new ListCredentialsReporter({'credentials':_0x37987a[_0x322066(0xdc)](({alias:_0x6c027b,globalSettingsUrl:_0x115657,devopsUrl:_0x3e9dfe})=>({'alias':_0x6c027b,'globalSettingsUrl':_0x115657,'devopsUrl':_0x3e9dfe}))});}['isJson']([{json:_0x29aaa1}]){return _0x29aaa1;}}const TOKEN_PREFIX=a0_0xef8a28(0x110);class LoginAction{constructor(_0xfa99c2){this['accessToken']=_0xfa99c2;}async[a0_0xef8a28(0x12b)](){const _0x26adaa=a0_0xef8a28;try{const _0x3d5c70=this[_0x26adaa(0xe4)][_0x26adaa(0x188)](TOKEN_PREFIX)[0x1],_0x33aeee=JSON[_0x26adaa(0x10b)](Buffer['from'](_0x3d5c70,_0x26adaa(0x1c1))['toString']('utf-8')),_0x143c01=await axios['get']('/api/v1/links',{'headers':{'authorization':''+this[_0x26adaa(0xe4)]},'baseURL':_0x33aeee['applicationUrl']})[_0x26adaa(0x1af)](({data:_0xd6ef91})=>new Map(_0xd6ef91[_0x26adaa(0xdc)](_0x4b2432=>[_0x4b2432['name'],_0x4b2432['api']]))),_0x5d5cd6={'globalSettingsUrl':_0x33aeee['applicationUrl']};for(const [_0x5e3d4f,_0x49de54]of _0x143c01['entries']()){_0x5e3d4f===_0x26adaa(0x1f5)&&(_0x5d5cd6[_0x26adaa(0x214)]=_0x49de54);}return _0x5d5cd6;}catch(_0x45ec4d){if(axios[_0x26adaa(0x210)](_0x45ec4d))throw Error(_0x45ec4d[_0x26adaa(0x124)]?.[_0x26adaa(0x1d7)]['message']||_0x45ec4d[_0x26adaa(0x124)]?.[_0x26adaa(0x216)]||_0x45ec4d[_0x26adaa(0x139)],{'cause':_0x45ec4d});throw _0x45ec4d;}}}class GlobalSettingsService{static async[a0_0xef8a28(0x106)]({accessToken:_0xca09be}){const _0x52643c=new LoginAction(_0xca09be);return _0x52643c['execute']();}}class LoginReporter extends BaseReporter{[a0_0xef8a28(0x145)];[a0_0xef8a28(0x15e)];[a0_0xef8a28(0x214)];constructor({alias:_0x486eec,globalSettingsUrl:_0x48512d,devopsUrl:_0xd80d56}){const _0x1640db=a0_0xef8a28;super({'success':!![]}),this[_0x1640db(0x145)]=_0x486eec,this[_0x1640db(0x15e)]=_0x48512d,this[_0x1640db(0x214)]=_0xd80d56;}[a0_0xef8a28(0xa5)](){const _0x5704da=a0_0xef8a28;return{'success':this[_0x5704da(0x11a)],'alias':this['alias'],'globalSettingsUrl':this[_0x5704da(0x15e)],'devopsUrl':this[_0x5704da(0x214)]};}[a0_0xef8a28(0xff)](_0xaa4f6c){const _0x263445=a0_0xef8a28,_0x145222=[[_0x263445(0x167),_0x263445(0x177),'Devops\x20Url'],[_0xaa4f6c[_0x263445(0x145)],_0xaa4f6c[_0x263445(0x15e)],_0xaa4f6c[_0x263445(0x214)]||'Not\x20Found']];console[_0x263445(0xb3)](table[_0x263445(0x125)](_0x145222));}}class LoginCommand extends BaseCommand{['commandName']=a0_0xef8a28(0x106);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x176);[a0_0xef8a28(0x1c5)]=[];['options']=[{'flags':a0_0xef8a28(0x21c),'description':a0_0xef8a28(0x1e7),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0xef8a28(0x14f),'description':'Token\x20for\x20getting\x20access\x20to\x20'+ROOT_NAME+a0_0xef8a28(0x143)},{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];async['execute']([_0x2c47ce]){const _0x256182=a0_0xef8a28;this[_0x256182(0x1fd)][_0x256182(0x1a5)]('Login\x20started');const _0x420993=await this['getAccessToken'](_0x2c47ce['token']),_0x2bc022=await GlobalSettingsService['login']({'accessToken':_0x420993});return await CredentialsManager[_0x256182(0xc6)]({'alias':_0x2c47ce[_0x256182(0x145)],'accessToken':_0x420993,'globalSettingsUrl':_0x2bc022[_0x256182(0x15e)],'devopsUrl':_0x2bc022[_0x256182(0x214)]}),this['logger'][_0x256182(0x1a5)]('Login\x20successfully\x20completed.\x20You\x20credentials\x20are\x20saved\x20with\x20alias\x20\x22'+_0x2c47ce['alias']+'\x22'),new LoginReporter({'alias':_0x2c47ce[_0x256182(0x145)],'globalSettingsUrl':_0x2bc022[_0x256182(0x15e)],'devopsUrl':_0x2bc022['devopsUrl']});}[a0_0xef8a28(0x19e)]([{json:_0x475825}]){return _0x475825;}async['getAccessToken'](_0xde454b){const _0x2496b4=a0_0xef8a28;if(_0xde454b)return _0xde454b;const _0x1f0976=await ReadlineUtils[_0x2496b4(0x168)](_0x2496b4(0xec));return _0x1f0976;}}const DELETED_STATUS='Deleted';class LogoutReporter extends BaseReporter{[a0_0xef8a28(0x145)];constructor({alias:_0x52ef36}){super({'success':!![]}),this['alias']=_0x52ef36;}[a0_0xef8a28(0xa5)](){const _0x251cf5=a0_0xef8a28;return{'success':this[_0x251cf5(0x11a)],'alias':this[_0x251cf5(0x145)],'status':DELETED_STATUS};}[a0_0xef8a28(0xff)](_0x1fe32e){const _0x4ee218=a0_0xef8a28,_0x179bf2=[[_0x4ee218(0x167),_0x4ee218(0x107)],[_0x1fe32e['alias'],_0x1fe32e[_0x4ee218(0xd0)]]];console[_0x4ee218(0xb3)](table[_0x4ee218(0x125)](_0x179bf2));}}class LogoutCommand extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0x14b);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x1e5);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x21c),'description':a0_0xef8a28(0x15a),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];async[a0_0xef8a28(0x12b)]([_0x5581e3]){const _0x137e68=a0_0xef8a28;return this[_0x137e68(0x1fd)][_0x137e68(0x1a5)](_0x137e68(0x10e)),await CredentialsManager[_0x137e68(0x111)]({'alias':_0x5581e3['alias']}),this[_0x137e68(0x1fd)]['info'](_0x137e68(0xdd)),new LogoutReporter({'alias':_0x5581e3[_0x137e68(0x145)]});}['isJson']([{json:_0x1903a4}]){return _0x1903a4;}}class PullReporter extends BaseReporter{['changes'];constructor({changes:_0x4e2254}){const _0x30dbd1=a0_0xef8a28;super({'success':!![]}),this[_0x30dbd1(0x190)]=_0x4e2254;}[a0_0xef8a28(0xa5)](){const _0x494231=a0_0xef8a28;return{'success':this['success'],'changes':this[_0x494231(0x190)]};}[a0_0xef8a28(0xff)](_0x4b70c3){const _0xc74b30=a0_0xef8a28;console[_0xc74b30(0xb3)]('Component\x20Updates:');const _0x58551b=[['Change\x20Type',_0xc74b30(0x1a2),_0xc74b30(0x148),_0xc74b30(0x155)]];for(const {changeType:_0x106ebd,name:_0x3718ee,type:_0x47810b,paths:_0x154337}of _0x4b70c3[_0xc74b30(0x190)]){_0x58551b[_0xc74b30(0x1f9)]([_0x106ebd,_0x3718ee,_0x47810b,_0x154337?.[_0xc74b30(0x13f)]('\x0a')||'']);}console['log'](table[_0xc74b30(0x125)](_0x58551b,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class PullCommand extends BaseCommand{[a0_0xef8a28(0x204)]='pull';[a0_0xef8a28(0xc9)]=a0_0xef8a28(0xd4);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();['manager']=ProjectManager['getInstance']();[a0_0xef8a28(0x18b)]=[];[a0_0xef8a28(0x154)];get[a0_0xef8a28(0x146)](){const _0x29f28c=a0_0xef8a28;if(!this[_0x29f28c(0x154)])throw new Error(_0x29f28c(0x178));return this[_0x29f28c(0x154)];}async[a0_0xef8a28(0x12b)](){const _0xabe976=a0_0xef8a28;this[_0xabe976(0x1fd)][_0xabe976(0x1a5)](_0xabe976(0x144));const _0x18494a=await this[_0xabe976(0x1a9)][_0xabe976(0x193)](this[_0xabe976(0x202)]);if(!_0x18494a)return this[_0xabe976(0x1fd)][_0xabe976(0x1eb)](_0xabe976(0x1bf)),new FailReporter({'failMessage':_0xabe976(0x1bf)});const _0x579529=await this['getCredentialsAlias']();this['_credentials']=await ApiService[_0xabe976(0x86)](_0x579529);const {id:_0x1d5443,headCommitId:_0x55861b}=await this[_0xabe976(0x1a9)][_0xabe976(0x114)](this[_0xabe976(0x202)]);if(!_0x1d5443)return this[_0xabe976(0x1fd)]['warn'](_0xabe976(0x1a6)),new FailReporter({'failMessage':_0xabe976(0x1a6)});const _0x23c2a7=await ApiService[_0xabe976(0x12f)]({'accessToken':this[_0xabe976(0x146)][_0xabe976(0xe4)],'devopsUrl':this[_0xabe976(0x146)][_0xabe976(0x214)],'branchId':_0x1d5443});if(_0x55861b===_0x23c2a7[_0xabe976(0x1dc)])return new PullReporter({'changes':this[_0xabe976(0x18b)]});await this['manager'][_0xabe976(0x1ef)](this[_0xabe976(0x202)]);try{this[_0xabe976(0x1fd)][_0xabe976(0x1a5)]('Checking\x20manual\x20changes\x20started');const _0x2e2850=await this[_0xabe976(0x1c2)]();if(_0x2e2850)return this[_0xabe976(0x1fd)][_0xabe976(0x1eb)](_0xabe976(0x19b)),await this[_0xabe976(0x1a9)][_0xabe976(0x1a7)](),new FailReporter({'failMessage':_0xabe976(0x19b)});return this[_0xabe976(0x1fd)]['info'](_0xabe976(0xb8)),this[_0xabe976(0x1fd)][_0xabe976(0x1a5)](_0xabe976(0x20b)),await this[_0xabe976(0xa7)](_0x23c2a7),this['logger'][_0xabe976(0x1a5)](_0xabe976(0x98)),await this[_0xabe976(0x1a9)]['applyStage'](),this[_0xabe976(0x1fd)]['info'](_0xabe976(0x13d)),new PullReporter({'changes':this['componentChanges']});}catch(_0x320a9f){await this[_0xabe976(0x1a9)][_0xabe976(0x1a7)]();throw _0x320a9f;}}['isJson']([{json:_0xb0ddfd}]){return _0xb0ddfd;}async[a0_0xef8a28(0xfa)](){const _0x421af5=a0_0xef8a28,{credentialsAlias:_0x47f6c5}=await this[_0x421af5(0x1a9)]['readConfig'](this['projectPath']);if(!_0x47f6c5)throw new Error(_0x421af5(0x1ac));if(typeof _0x47f6c5!==_0x421af5(0xd9))throw new Error(_0x421af5(0xbb));return _0x47f6c5;}async['areChanges'](){const _0xa79f6f=a0_0xef8a28,_0x2c6ad5=await this[_0xa79f6f(0x1a9)][_0xa79f6f(0x161)]();return!!_0x2c6ad5['length'];}async[a0_0xef8a28(0xa7)](_0xac25f0){const _0xaaef63=a0_0xef8a28,{devopsUrl:_0x269d1b,accessToken:_0x2d82d9}=this[_0xaaef63(0x146)],_0x290ae8=await this[_0xaaef63(0x1a9)][_0xaaef63(0x206)]({'devopsUrl':_0x269d1b,'accessToken':_0x2d82d9,'targetBranchId':_0xac25f0['id'],'targetCommitId':_0xac25f0[_0xaaef63(0x1dc)]});for(const {id:_0x185830,name:_0x1bda6f,type:_0x1d38dc,changeType:_0x2d6e71}of _0x290ae8){if(!_0x185830){if(_0x2d6e71!==ChangeType[_0xaaef63(0xf0)])throw new Error(_0xaaef63(0x84));await this[_0xaaef63(0x1a9)]['saveComponent']({'name':_0x1bda6f,'type':_0x1d38dc,'changeType':_0x2d6e71}),this[_0xaaef63(0x18b)][_0xaaef63(0x1f9)]({'changeType':_0x2d6e71,'name':_0x1bda6f,'type':_0x1d38dc});continue;}const _0x253fe2=await ApiService[_0xaaef63(0x209)]({'devopsUrl':_0x269d1b,'accessToken':_0x2d82d9,'componentId':_0x185830});if(!_0x253fe2['fHash'])throw new Error(_0xaaef63(0xb0)+_0x253fe2[_0xaaef63(0x113)]+'\x22\x20of\x20type\x20\x22'+_0x253fe2[_0xaaef63(0xb4)]+_0xaaef63(0x1d3));await this[_0xaaef63(0x1a9)][_0xaaef63(0x205)]({'name':_0x1bda6f,'type':_0x1d38dc,'changeType':_0x2d6e71,'component':{..._0x253fe2,'fHash':_0x253fe2[_0xaaef63(0xee)]}}),this[_0xaaef63(0x18b)]['push']({'changeType':_0x2d6e71,'name':_0x1bda6f,'type':_0x1d38dc,'paths':_0x253fe2[_0xaaef63(0x126)][_0xaaef63(0xdc)](_0x57fc56=>_0x57fc56[_0xaaef63(0x119)])});}await this['manager'][_0xaaef63(0xd2)](_0xac25f0);}}class RollbackReporter extends BaseReporter{[a0_0xef8a28(0x12a)];constructor({fileChanges:_0x394984}){const _0x4ebafe=a0_0xef8a28;super({'success':!![]}),this[_0x4ebafe(0x12a)]=_0x394984;}[a0_0xef8a28(0xa5)](){const _0x4f9ad7=a0_0xef8a28;return{'success':this[_0x4f9ad7(0x11a)],'fileChanges':this[_0x4f9ad7(0x12a)]};}[a0_0xef8a28(0xff)](_0xa8bc89){const _0x4d4e4a=a0_0xef8a28;console['log'](_0x4d4e4a(0xd1));const _0x5458cc=[[_0x4d4e4a(0x194),_0x4d4e4a(0x14a)]];for(const {changeType:_0x2ce912,path:_0x588206}of _0xa8bc89['fileChanges']){_0x5458cc[_0x4d4e4a(0x1f9)]([_0x2ce912,_0x588206]);}console[_0x4d4e4a(0xb3)](table[_0x4d4e4a(0x125)](_0x5458cc,{'columns':[{},{'width':0x28}]}));}}class RollbackCommand extends BaseCommand{['commandName']=a0_0xef8a28(0x195);['description']=a0_0xef8a28(0x1cb);['arguments']=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();['manager']=ProjectManager['getInstance']();[a0_0xef8a28(0x1f4)]=new Map();[a0_0xef8a28(0x179)]=[];[a0_0xef8a28(0x1ab)]=[];[a0_0xef8a28(0x154)];[a0_0xef8a28(0x9f)];['_headCommitId'];get[a0_0xef8a28(0x146)](){const _0x3dcc99=a0_0xef8a28;if(!this['_credentials'])throw new Error(_0x3dcc99(0x178));return this['_credentials'];}get[a0_0xef8a28(0x135)](){const _0x3bba47=a0_0xef8a28;if(!this['_branchId'])throw new Error('Branch\x20id\x20not\x20found');return this[_0x3bba47(0x9f)];}get[a0_0xef8a28(0x1dc)](){const _0x5caf84=a0_0xef8a28;if(!this[_0x5caf84(0x1b8)])throw new Error(_0x5caf84(0x1f0));return this[_0x5caf84(0x1b8)];}async[a0_0xef8a28(0x12b)](){const _0x2493b7=a0_0xef8a28;this[_0x2493b7(0x1fd)][_0x2493b7(0x1a5)]('Rolling\x20back\x20to\x20last\x20committed\x20state\x20started');const _0x1cb923=await this[_0x2493b7(0x1a9)][_0x2493b7(0x193)](this[_0x2493b7(0x202)]);if(!_0x1cb923)return this[_0x2493b7(0x1fd)][_0x2493b7(0x1eb)](_0x2493b7(0x1bf)),new FailReporter({'failMessage':_0x2493b7(0x1bf)});const _0x1a7aaf=await this[_0x2493b7(0xfa)]();this[_0x2493b7(0x154)]=await ApiService[_0x2493b7(0x86)](_0x1a7aaf),await this[_0x2493b7(0x172)](),await this[_0x2493b7(0x1a9)][_0x2493b7(0x1ef)](this[_0x2493b7(0x202)]);try{this[_0x2493b7(0x1fd)][_0x2493b7(0x1a5)](_0x2493b7(0xde)),await this[_0x2493b7(0xa3)]();if(!this[_0x2493b7(0x1f4)][_0x2493b7(0x17c)])return this[_0x2493b7(0x1fd)][_0x2493b7(0x1a5)](_0x2493b7(0x1b4)),new RollbackReporter({'fileChanges':this[_0x2493b7(0x1ab)]});return this[_0x2493b7(0x1fd)][_0x2493b7(0x1a5)]('Looking\x20for\x20changes\x20completed.\x20'+this[_0x2493b7(0x1f4)][_0x2493b7(0x17c)]+_0x2493b7(0xa0)),this['logger'][_0x2493b7(0x1a5)](_0x2493b7(0xc5)),await this[_0x2493b7(0x195)](),this['logger']['info'](_0x2493b7(0x117)),await this['manager']['applyStage'](),this[_0x2493b7(0x1fd)][_0x2493b7(0x1a5)](_0x2493b7(0x1ae)),new RollbackReporter({'fileChanges':this[_0x2493b7(0x1ab)]});}catch(_0x3c2588){await this[_0x2493b7(0x1a9)][_0x2493b7(0x1a7)]();throw _0x3c2588;}}[a0_0xef8a28(0x19e)]([{json:_0x110ec7}]){return _0x110ec7;}async[a0_0xef8a28(0xfa)](){const _0x3b1dc2=a0_0xef8a28,{credentialsAlias:_0x28b618}=await this[_0x3b1dc2(0x1a9)]['readConfig'](this[_0x3b1dc2(0x202)]);if(!_0x28b618)throw new Error(_0x3b1dc2(0x1ac));if(typeof _0x28b618!==_0x3b1dc2(0xd9))throw new Error(_0x3b1dc2(0xbb));return _0x28b618;}async[a0_0xef8a28(0x172)](){const _0x43d295=a0_0xef8a28,{id:_0x65ba19,headCommitId:_0xad3d79}=await this['manager'][_0x43d295(0x114)](this[_0x43d295(0x202)]);if(!_0x65ba19||!_0xad3d79)throw new Error(_0x43d295(0x1a6));this[_0x43d295(0x9f)]=_0x65ba19||void 0x0,this[_0x43d295(0x1b8)]=_0xad3d79||void 0x0;}async[a0_0xef8a28(0x195)](){const _0x4236cc=a0_0xef8a28;if(this[_0x4236cc(0x179)][_0x4236cc(0x10f)])for await(const {files:_0x4d90a5}of ApiService[_0x4236cc(0x173)]({'devopsUrl':this[_0x4236cc(0x146)][_0x4236cc(0x214)],'accessToken':this[_0x4236cc(0x146)][_0x4236cc(0xe4)],'branchId':this['branchId'],'commitId':this[_0x4236cc(0x1dc)],'components':this[_0x4236cc(0x179)]})){await this[_0x4236cc(0x1a3)](_0x4d90a5);}for(const [_0x2a84e8,_0x2af85f]of this[_0x4236cc(0x1f4)][_0x4236cc(0x1d6)]()){if(_0x2af85f!==ChangeType[_0x4236cc(0xf0)])throw new Error(_0x4236cc(0x97)+_0x2a84e8+_0x4236cc(0x186));await this[_0x4236cc(0x1a9)][_0x4236cc(0x16a)]({'path':_0x2a84e8,'changeType':_0x2af85f});}return{'success':!![]};}async['defineRollbackTypes'](){const _0x129a32=a0_0xef8a28,_0x445874=await this[_0x129a32(0x1a9)]['findChanges']();for(const {name:_0x3c8cf0,type:_0x26bda0,changes:_0xed1175}of _0x445874){let _0x5c7fd5=![];for(const {path:_0x102ab7,changeType:_0x19fe5a}of _0xed1175){let _0x2db36d;_0x19fe5a===ChangeType['CREATE']?_0x2db36d=ChangeType[_0x129a32(0xf0)]:(_0x2db36d=_0x19fe5a===ChangeType['DELETE']?ChangeType[_0x129a32(0xf4)]:ChangeType[_0x129a32(0x121)],_0x5c7fd5=!![]),this[_0x129a32(0x1f4)][_0x129a32(0x123)](_0x102ab7,_0x2db36d),this[_0x129a32(0x1ab)][_0x129a32(0x1f9)]({'changeType':_0x2db36d,'path':_0x102ab7});}_0x5c7fd5&&this[_0x129a32(0x179)][_0x129a32(0x1f9)]({'name':_0x3c8cf0,'type':_0x26bda0});}}async['handleRestore'](_0x5d5884){const _0x4df58e=a0_0xef8a28;for(const {path:_0x2ceb01,content:_0x6e4e2d}of _0x5d5884){const _0x20f490=node_path['join'](COMPONENT_PROJECT_PATH,_0x2ceb01),_0x407f4f=this[_0x4df58e(0x1f4)][_0x4df58e(0x174)](_0x20f490);if(!_0x407f4f)continue;await this[_0x4df58e(0x1a9)][_0x4df58e(0x16a)]({'path':_0x20f490,'content':_0x6e4e2d,'changeType':_0x407f4f}),this[_0x4df58e(0x1f4)][_0x4df58e(0x111)](_0x20f490);}}}class StatusReporter extends BaseReporter{[a0_0xef8a28(0xb9)];constructor({pendingChanges:_0x4b7ab5}){const _0x2d5dac=a0_0xef8a28;super({'success':!![]}),this[_0x2d5dac(0xb9)]=_0x4b7ab5;}['buildReport'](){const _0x53615d=a0_0xef8a28;return{'success':this[_0x53615d(0x11a)],'pendingChanges':this['pendingChanges']};}[a0_0xef8a28(0xff)](_0x26f437){const _0x400f9a=a0_0xef8a28;console[_0x400f9a(0xb3)](_0x400f9a(0x180));const _0x23005e=[[_0x400f9a(0x194),_0x400f9a(0x14a)]];for(const {changeType:_0x36aafa,path:_0x141ece}of _0x26f437['pendingChanges']){_0x23005e['push']([_0x36aafa,_0x141ece]);}console[_0x400f9a(0xb3)](table[_0x400f9a(0x125)](_0x23005e,{'columns':[{},{'width':0x28}]}));}}class StatusCommand extends BaseCommand{['commandName']=a0_0xef8a28(0xd0);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x211);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':'--json','description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();[a0_0xef8a28(0x1a9)]=ProjectManager['getInstance']();[a0_0xef8a28(0xb9)]=[];async[a0_0xef8a28(0x12b)](){const _0x18f09e=a0_0xef8a28;this[_0x18f09e(0x1fd)]['info'](_0x18f09e(0xf5));const _0xffd8da=await this[_0x18f09e(0x1a9)][_0x18f09e(0x193)](this[_0x18f09e(0x202)]);if(!_0xffd8da)return this[_0x18f09e(0x1fd)][_0x18f09e(0x1eb)]('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':_0x18f09e(0x1bf)});await this[_0x18f09e(0x1a9)]['initStage'](this['projectPath']);const _0x4a3ac6=await this[_0x18f09e(0x1a9)]['findChanges']();for(const {changes:_0x197d35}of _0x4a3ac6){for(const {changeType:_0x59b621,path:_0x626466}of _0x197d35){this['pendingChanges'][_0x18f09e(0x1f9)]({'changeType':_0x59b621,'path':_0x626466});}}return await this['manager'][_0x18f09e(0x1a7)](),this['logger']['info']('Status\x20calculation\x20completed'),new StatusReporter({'pendingChanges':this[_0x18f09e(0xb9)]});}['isJson']([{json:_0x33778a}]){return _0x33778a;}}const ECONN_REFUSED=a0_0xef8a28(0x182);function setupAxiosInterceptors(){const _0x37da51=a0_0xef8a28;axios[_0x37da51(0xb7)]['response'][_0x37da51(0xef)](_0x533f22=>_0x533f22,async _0x8a463c=>{const _0x55b873=_0x37da51;if(_0x8a463c[_0x55b873(0x1c8)]!==ECONN_REFUSED)return Promise[_0x55b873(0xe5)](_0x8a463c);if(_0x8a463c[_0x55b873(0x130)]instanceof AggregateError){const _0x25dff2=_0x8a463c[_0x55b873(0x130)]['errors'][_0x55b873(0xdc)](({message:_0x4e5c64})=>_0x4e5c64);return Promise[_0x55b873(0xe5)](new Error(_0x25dff2['join'](',\x20')));}return Promise['reject'](new Error(_0x55b873(0x1fb)));});}configurePathEnv(),setupAxiosInterceptors();const ROOT_COMMANDS=[LoginCommand,LogoutCommand,ListCredentialsCommand],DEVOPS_COMMANDS=[InitCommand,CloneCommand,CheckoutCommand,ConfigSetCommand,ConfigUnset,PullCommand,CommitCommand,RollbackCommand,StatusCommand,ListBranchesCommand],root=new commander[(a0_0xef8a28(0xad))]()[a0_0xef8a28(0x113)](ROOT_NAME)['description'](a0_0xef8a28(0x142)+ROOT_NAME+a0_0xef8a28(0x138))['version'](config[a0_0xef8a28(0x18a)]);for(const command of ROOT_COMMANDS){new command()[a0_0xef8a28(0x215)](root);}const devops=new commander[(a0_0xef8a28(0xad))]()[a0_0xef8a28(0x113)]('devops')['description'](a0_0xef8a28(0x16c));for(const command of DEVOPS_COMMANDS){new command()[a0_0xef8a28(0x215)](devops);}root['addCommand'](devops),root[a0_0xef8a28(0x10b)]();function configurePathEnv(){const _0x29d842=a0_0xef8a28,_0x15024a=process[_0x29d842(0x1f7)][_0x29d842(0x15b)]?.[_0x29d842(0x188)](node_path[_0x29d842(0x1df)]);if(!_0x15024a)throw new Error(_0x29d842(0xe1));const _0x15cac1=node_path[_0x29d842(0x13f)](node_path['dirname'](__dirname),'node_modules',_0x29d842(0x7b));_0x15024a[_0x29d842(0x1f9)](_0x15cac1),process[_0x29d842(0x1f7)][_0x29d842(0x15b)]=_0x15024a[_0x29d842(0x13f)](node_path[_0x29d842(0x1df)]);}exports[a0_0xef8a28(0x1bc)]=DEVOPS_COMMANDS,exports[a0_0xef8a28(0x1d4)]=ROOT_COMMANDS;
|