@flosum/cli 0.0.2-beta.0 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +1 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a0_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_0x216d83=a0_0x3826;(function(_0x524d71,_0x458f6c){const _0x2d72c6=a0_0x3826,_0x539e1f=_0x524d71();while(!![]){try{const _0x37dd41=-parseInt(_0x2d72c6(0x317))/0x1*(-parseInt(_0x2d72c6(0x2fb))/0x2)+-parseInt(_0x2d72c6(0x2c0))/0x3+parseInt(_0x2d72c6(0x2fc))/0x4+parseInt(_0x2d72c6(0x285))/0x5+-parseInt(_0x2d72c6(0x31b))/0x6*(-parseInt(_0x2d72c6(0x20e))/0x7)+-parseInt(_0x2d72c6(0x1ef))/0x8*(parseInt(_0x2d72c6(0x27b))/0x9)+parseInt(_0x2d72c6(0x2a5))/0xa;if(_0x37dd41===_0x458f6c)break;else _0x539e1f['push'](_0x539e1f['shift']());}catch(_0x121916){_0x539e1f['push'](_0x539e1f['shift']());}}}(a0_0x5404,0x7fc16));const a0_0x3c45d3=(function(){let _0x4bb14c=!![];return function(_0x97cfa9,_0x3a62e7){const _0x473194=_0x4bb14c?function(){const _0x522076=a0_0x3826;if(_0x3a62e7){const _0x282f3d=_0x3a62e7[_0x522076(0x336)](_0x97cfa9,arguments);return _0x3a62e7=null,_0x282f3d;}}:function(){};return _0x4bb14c=![],_0x473194;};}()),a0_0x25e96e=a0_0x3c45d3(this,function(){const _0x35bd58=a0_0x3826;return a0_0x25e96e['toString']()[_0x35bd58(0x270)](_0x35bd58(0x1da))[_0x35bd58(0x249)]()[_0x35bd58(0x28a)](a0_0x25e96e)[_0x35bd58(0x270)](_0x35bd58(0x1da));});a0_0x25e96e();'use strict';var node_path=require(a0_0x216d83(0x2cb)),commander=require(a0_0x216d83(0x288)),promises=require('node:fs/promises'),node_os=require(a0_0x216d83(0x29e)),axios=require('axios'),salesforce=require('@flosum/salesforce'),node_crypto=require('node:crypto'),readline=require(a0_0x216d83(0x207)),debug=require(a0_0x216d83(0x292)),table=require(a0_0x216d83(0x242)),path=require(a0_0x216d83(0x1f6)),version=a0_0x216d83(0x320),config={'version':version};const ROOT_NAME=a0_0x216d83(0x23f),DEFAULT_ALIAS_NAME='default';class FileUtils{static async[a0_0x216d83(0x20f)](_0x230ca7){const _0x4e1f2d=a0_0x216d83,_0x49324f=await promises[_0x4e1f2d(0x334)](_0x230ca7,{'withFileTypes':!![]}),_0x4d0651=[];for(const _0x3a27da of _0x49324f){const _0x47f267=node_path['join'](_0x230ca7,_0x3a27da['name']);if(_0x3a27da[_0x4e1f2d(0x2be)]()){const _0x40d98e=await FileUtils[_0x4e1f2d(0x20f)](_0x47f267);_0x4d0651['push'](_0x40d98e);continue;}_0x4d0651[_0x4e1f2d(0x212)](_0x47f267);}return _0x4d0651[_0x4e1f2d(0x220)]();}static async[a0_0x216d83(0x2d1)](_0x50dfc0,_0x50cdb5=!![]){const _0x4a286d=a0_0x216d83,_0x34350c=await promises[_0x4a286d(0x334)](_0x50dfc0,{'withFileTypes':!![]});let _0xb76d28=!![];for(const _0x1d1576 of _0x34350c){const _0x2efdb4=node_path[_0x4a286d(0x1e5)](_0x50dfc0,_0x1d1576[_0x4a286d(0x24f)]);if(_0x1d1576[_0x4a286d(0x2be)]()){const _0x33d52d=await FileUtils[_0x4a286d(0x2d1)](_0x2efdb4);!_0x33d52d&&(_0xb76d28=![]);}else _0xb76d28=![];}return _0x50cdb5&&_0xb76d28&&await promises[_0x4a286d(0x302)](_0x50dfc0),_0xb76d28;}static async[a0_0x216d83(0x24c)](_0x3bdc99){const _0x220188=a0_0x216d83;return promises['stat'](_0x3bdc99)[_0x220188(0x311)](async _0x413fd3=>{const _0x5b8339=_0x220188;return await promises[_0x5b8339(0x25a)](_0x3bdc99,promises['constants']['R_OK']|promises['constants'][_0x5b8339(0x2f6)]),_0x413fd3[_0x5b8339(0x2be)]();})[_0x220188(0x2ac)](()=>![]);}static async[a0_0x216d83(0x266)](_0xcc45ba){const _0x5ef9e9=a0_0x216d83;return promises[_0x5ef9e9(0x21e)](_0xcc45ba)['then'](async _0x4abde0=>{const _0x3fafdf=_0x5ef9e9;return await promises[_0x3fafdf(0x25a)](_0xcc45ba,promises['constants']['R_OK']|promises[_0x3fafdf(0x280)][_0x3fafdf(0x2f6)]),_0x4abde0['isFile']();})['catch'](()=>![]);}}const SYSTEM_FOLDER$1='.'+ROOT_NAME,CREDENTIALS_FILE_NAME=a0_0x216d83(0x1d6);class CredentialsManager{static async[a0_0x216d83(0x29c)](_0x207449){const _0x31efc4=a0_0x216d83,_0xf6f3bd=node_path[_0x31efc4(0x1e5)](node_os[_0x31efc4(0x1e1)](),SYSTEM_FOLDER$1);await promises[_0x31efc4(0x33b)](_0xf6f3bd,{'recursive':!![]});const _0x15bce7=node_path['join'](_0xf6f3bd,CREDENTIALS_FILE_NAME),_0x2b7dd7=await CredentialsManager[_0x31efc4(0x2ca)](_0x15bce7),_0xba5c7a=_0x2b7dd7[_0x31efc4(0x1d1)](({alias:_0x431be5})=>_0x431be5===_0x207449[_0x31efc4(0x27e)]);!_0xba5c7a?_0x2b7dd7[_0x31efc4(0x212)](_0x207449):(_0xba5c7a[_0x31efc4(0x1db)]=_0x207449['accessToken'],_0xba5c7a[_0x31efc4(0x294)]=_0x207449[_0x31efc4(0x294)],_0xba5c7a[_0x31efc4(0x1f0)]=_0x207449[_0x31efc4(0x1f0)]),await promises[_0x31efc4(0x313)](_0x15bce7,Buffer[_0x31efc4(0x267)](JSON[_0x31efc4(0x21f)](_0x2b7dd7)));}static async['get']({alias:_0x96ff83}){const _0x4afc10=a0_0x216d83,_0x13f7e6=node_path[_0x4afc10(0x1e5)](node_os[_0x4afc10(0x1e1)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0xa2134f=await CredentialsManager[_0x4afc10(0x2ca)](_0x13f7e6),_0x18a4d6=_0xa2134f['find'](_0x232e1a=>_0x232e1a['alias']===_0x96ff83);if(!_0x18a4d6)throw new Error(_0x4afc10(0x22b)+_0x96ff83+'\x22\x20not\x20found');return _0x18a4d6;}static async['list'](){const _0x21cb33=a0_0x216d83,_0x1a9057=node_path[_0x21cb33(0x1e5)](node_os[_0x21cb33(0x1e1)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x16cd47=await CredentialsManager[_0x21cb33(0x2ca)](_0x1a9057);return _0x16cd47;}static async['getAllCredentials'](_0x53e634){const _0x5f404c=a0_0x216d83,_0x57028c=await FileUtils['isFileExists'](_0x53e634);if(_0x57028c){const _0x5b3a57=await promises[_0x5f404c(0x297)](_0x53e634);return JSON[_0x5f404c(0x304)](_0x5b3a57[_0x5f404c(0x249)]());}return[];}static async[a0_0x216d83(0x1cf)]({alias:_0x4ca4f4}){const _0x2ed15b=a0_0x216d83,_0x2f6605=node_path[_0x2ed15b(0x1e5)](node_os[_0x2ed15b(0x1e1)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x27bb69=await CredentialsManager[_0x2ed15b(0x2ca)](_0x2f6605),_0x4e4bed=_0x27bb69[_0x2ed15b(0x2df)](_0x42ca94=>_0x42ca94[_0x2ed15b(0x27e)]===_0x4ca4f4);if(_0x4e4bed<0x0)throw new Error(_0x2ed15b(0x22b)+_0x4ca4f4+_0x2ed15b(0x2f2));_0x27bb69['splice'](_0x4e4bed,0x1),await promises[_0x2ed15b(0x313)](_0x2f6605,Buffer[_0x2ed15b(0x267)](JSON[_0x2ed15b(0x21f)](_0x27bb69)));}}var ManagementType=(_0x3e0a74=>{const _0x30f2e5=a0_0x216d83;return _0x3e0a74[_0x30f2e5(0x27c)]='Salesforce',_0x3e0a74[_0x30f2e5(0x319)]='Vlocity',_0x3e0a74;})(ManagementType||{});class CommitAction{[a0_0x216d83(0x1db)];[a0_0x216d83(0x1f0)];['message'];[a0_0x216d83(0x343)];[a0_0x216d83(0x2b4)];[a0_0x216d83(0x2f5)];[a0_0x216d83(0x283)]=new Date();constructor(_0x4bdfb5){const _0x4b9288=a0_0x216d83;this[_0x4b9288(0x1db)]=_0x4bdfb5[_0x4b9288(0x1db)],this[_0x4b9288(0x1f0)]=_0x4bdfb5[_0x4b9288(0x1f0)],this[_0x4b9288(0x300)]=_0x4bdfb5['message'],this[_0x4b9288(0x343)]=_0x4bdfb5[_0x4b9288(0x343)],this[_0x4b9288(0x2b4)]=_0x4bdfb5[_0x4b9288(0x2b4)],this[_0x4b9288(0x2f5)]=_0x4bdfb5[_0x4b9288(0x2f5)];}async['execute'](){const _0x24e55d=a0_0x216d83;try{const _0x171715=await Promise[_0x24e55d(0x2c4)](this[_0x24e55d(0x2b4)][_0x24e55d(0x1d8)](async _0x1996b5=>await this[_0x24e55d(0x281)](_0x1996b5))),{data:_0x28a0ec}=await axios['post'](_0x24e55d(0x228)+this[_0x24e55d(0x343)]+_0x24e55d(0x2e9),{'message':this[_0x24e55d(0x300)],'components':_0x171715},{'headers':{'authorization':''+this[_0x24e55d(0x1db)]},'baseURL':this[_0x24e55d(0x1f0)]});return _0x28a0ec;}catch(_0x5a5652){if(axios[_0x24e55d(0x2d2)](_0x5a5652))throw Error(_0x5a5652[_0x24e55d(0x227)]?.[_0x24e55d(0x307)][_0x24e55d(0x300)]||_0x5a5652['response']?.[_0x24e55d(0x28c)]||_0x5a5652[_0x24e55d(0x300)],{'cause':_0x5a5652});throw _0x5a5652;}}async[a0_0x216d83(0x281)](_0x4501c5){const _0x318124=a0_0x216d83,_0x29afe6=[];for(const {path:_0x45a269,localPath:_0xb9fcd0}of _0x4501c5[_0x318124(0x1c1)]){_0x29afe6[_0x318124(0x212)](promises[_0x318124(0x297)](_0xb9fcd0)[_0x318124(0x311)](_0x3a19b2=>({'path':_0x45a269,'content':_0x3a19b2[_0x318124(0x249)]('base64')})));}const _0x76bc10=await Promise[_0x318124(0x2c4)](_0x29afe6);return{'name':_0x4501c5['name'],'label':_0x4501c5[_0x318124(0x2ed)],'type':_0x4501c5[_0x318124(0x30f)],'sourceName':'CLI','sourceType':_0x318124(0x1ec),'externalUpdatedAt':this[_0x318124(0x283)],'externalUpdatedBy':this[_0x318124(0x2f5)],'files':_0x76bc10,'managementType':ManagementType[_0x318124(0x27c)]};}}class CreateBranchAction{[a0_0x216d83(0x1db)];['devopsUrl'];constructor(_0x2020e0){const _0x542ef8=a0_0x216d83;this[_0x542ef8(0x1db)]=_0x2020e0[_0x542ef8(0x1db)],this[_0x542ef8(0x1f0)]=_0x2020e0[_0x542ef8(0x1f0)];}async[a0_0x216d83(0x31a)](_0xe7982c){const _0x128f96=a0_0x216d83;try{const {data:_0x40e1e2}=await axios[_0x128f96(0x209)](_0x128f96(0x330),{..._0xe7982c},{'headers':{'authorization':''+this[_0x128f96(0x1db)]},'baseURL':this['devopsUrl']});return _0x40e1e2;}catch(_0x343b21){if(axios['isAxiosError'](_0x343b21))throw Error(_0x343b21[_0x128f96(0x227)]?.[_0x128f96(0x307)][_0x128f96(0x300)]||_0x343b21['response']?.['statusText']||_0x343b21['message'],{'cause':_0x343b21});throw _0x343b21;}}}class GetBranchAction{[a0_0x216d83(0x1db)];['devopsUrl'];constructor(_0xea5c18){const _0x4cf4a9=a0_0x216d83;this[_0x4cf4a9(0x1db)]=_0xea5c18[_0x4cf4a9(0x1db)],this['devopsUrl']=_0xea5c18[_0x4cf4a9(0x1f0)];}async[a0_0x216d83(0x31a)](_0x3fa371){const _0x262080=a0_0x216d83;try{const {data:_0x5ef3aa}=await axios[_0x262080(0x2e5)](_0x262080(0x228)+_0x3fa371[_0x262080(0x343)],{'headers':{'authorization':''+this[_0x262080(0x1db)]},'baseURL':this[_0x262080(0x1f0)]});return _0x5ef3aa;}catch(_0x28b8ba){if(axios[_0x262080(0x2d2)](_0x28b8ba))throw Error(_0x28b8ba[_0x262080(0x227)]?.['data'][_0x262080(0x300)]||_0x28b8ba[_0x262080(0x227)]?.[_0x262080(0x28c)]||_0x28b8ba['message'],{'cause':_0x28b8ba});throw _0x28b8ba;}}}class GetDefaultBranchAction{[a0_0x216d83(0x1f0)];[a0_0x216d83(0x1db)];constructor(_0x529c22){const _0x5aadf9=a0_0x216d83;this[_0x5aadf9(0x1f0)]=_0x529c22[_0x5aadf9(0x1f0)],this['accessToken']=_0x529c22['accessToken'];}async[a0_0x216d83(0x31a)](){const _0x319b29=a0_0x216d83;try{const {data:_0x303b67}=await axios[_0x319b29(0x2e5)]('fit/branches/default',{'headers':{'authorization':''+this['accessToken']},'baseURL':this[_0x319b29(0x1f0)]});return _0x303b67;}catch(_0x284c80){if(axios[_0x319b29(0x2d2)](_0x284c80))throw Error(_0x284c80[_0x319b29(0x227)]?.[_0x319b29(0x307)][_0x319b29(0x300)]||_0x284c80[_0x319b29(0x227)]?.[_0x319b29(0x28c)]||_0x284c80[_0x319b29(0x300)],{'cause':_0x284c80});throw _0x284c80;}}}class GetMeAction{[a0_0x216d83(0x1db)];[a0_0x216d83(0x1f0)];constructor(_0x38f881){const _0xe2868a=a0_0x216d83;this['accessToken']=_0x38f881[_0xe2868a(0x1db)],this[_0xe2868a(0x1f0)]=_0x38f881[_0xe2868a(0x1f0)];}async[a0_0x216d83(0x31a)](){const _0x30ffac=a0_0x216d83;try{const {data:_0x412ce6}=await axios[_0x30ffac(0x2e5)](_0x30ffac(0x284),{'headers':{'authorization':''+this[_0x30ffac(0x1db)]},'baseURL':this[_0x30ffac(0x1f0)]});return _0x412ce6;}catch(_0x536fe5){if(axios[_0x30ffac(0x2d2)](_0x536fe5))throw Error(_0x536fe5[_0x30ffac(0x227)]?.[_0x30ffac(0x307)]['message']||_0x536fe5[_0x30ffac(0x227)]?.[_0x30ffac(0x28c)]||_0x536fe5[_0x30ffac(0x300)],{'cause':_0x536fe5});throw _0x536fe5;}}}class ListBranchesAction{[a0_0x216d83(0x1f0)];['accessToken'];[a0_0x216d83(0x270)];constructor(_0x4254b7){const _0x3ad4ff=a0_0x216d83;this[_0x3ad4ff(0x1f0)]=_0x4254b7['devopsUrl'],this[_0x3ad4ff(0x1db)]=_0x4254b7[_0x3ad4ff(0x1db)],this[_0x3ad4ff(0x270)]=_0x4254b7[_0x3ad4ff(0x270)];}async[a0_0x216d83(0x31a)](){const _0x1a2ad0=a0_0x216d83;try{const _0x219b0c=[];let _0x59041d=0x0,_0x4fcd61=0x0;do{const {data:_0x1b60d2}=await axios[_0x1a2ad0(0x2e5)](_0x1a2ad0(0x330),{'headers':{'authorization':''+this[_0x1a2ad0(0x1db)]},'params':{'search':this['search'],'offset':_0x59041d,'limit':0x64},'baseURL':this[_0x1a2ad0(0x1f0)]});_0x219b0c[_0x1a2ad0(0x212)](..._0x1b60d2[_0x1a2ad0(0x1d7)]),_0x59041d+=_0x1b60d2[_0x1a2ad0(0x1d7)]['length'],_0x4fcd61=_0x1b60d2[_0x1a2ad0(0x206)];}while(_0x59041d<_0x4fcd61);return _0x219b0c;}catch(_0x45f13d){if(axios['isAxiosError'](_0x45f13d))throw Error(_0x45f13d[_0x1a2ad0(0x227)]?.[_0x1a2ad0(0x307)][_0x1a2ad0(0x300)]||_0x45f13d[_0x1a2ad0(0x227)]?.[_0x1a2ad0(0x28c)]||_0x45f13d[_0x1a2ad0(0x300)],{'cause':_0x45f13d});throw _0x45f13d;}}}class ListComponentsAction{['devopsUrl'];[a0_0x216d83(0x1db)];['branchId'];['commitId'];[a0_0x216d83(0x2e7)];constructor(_0x14ea87){const _0x10406e=a0_0x216d83;this[_0x10406e(0x1f0)]=_0x14ea87[_0x10406e(0x1f0)],this[_0x10406e(0x1db)]=_0x14ea87[_0x10406e(0x1db)],this['branchId']=_0x14ea87[_0x10406e(0x343)],this['commitId']=_0x14ea87['commitId'],_0x14ea87[_0x10406e(0x2b4)]&&(this[_0x10406e(0x2e7)]=new Set(_0x14ea87[_0x10406e(0x2b4)]['map'](({name:_0x1fcc97,type:_0x26146a})=>_0x26146a+'_'+_0x1fcc97)));}async*[a0_0x216d83(0x31a)](){const _0x1aa1c3=a0_0x216d83;try{let _0x492b56=0x0,_0x5f1ad0=0x0;do{const {data:_0x3e15f0}=await axios[_0x1aa1c3(0x2e5)](_0x1aa1c3(0x228)+this['branchId']+'/commits/'+this[_0x1aa1c3(0x219)]+'/components',{'headers':{'authorization':''+this[_0x1aa1c3(0x1db)]},'params':{'offset':_0x492b56,'limit':0x64,'managementType':ManagementType[_0x1aa1c3(0x27c)]},'baseURL':this[_0x1aa1c3(0x1f0)]});_0x492b56+=_0x3e15f0[_0x1aa1c3(0x1d7)][_0x1aa1c3(0x200)],_0x5f1ad0=_0x3e15f0[_0x1aa1c3(0x232)];let _0x5dfbcb=_0x3e15f0[_0x1aa1c3(0x1d7)];this[_0x1aa1c3(0x2e7)]&&(_0x5dfbcb=_0x3e15f0[_0x1aa1c3(0x1d7)]['filter'](({name:_0x25da66,type:_0x86d777})=>this['indexes']?.[_0x1aa1c3(0x210)](_0x86d777+'_'+_0x25da66))),yield*_0x5dfbcb;}while(_0x492b56<_0x5f1ad0);}catch(_0x5073e4){if(axios['isAxiosError'](_0x5073e4))throw Error(_0x5073e4[_0x1aa1c3(0x227)]?.[_0x1aa1c3(0x307)][_0x1aa1c3(0x300)]||_0x5073e4[_0x1aa1c3(0x227)]?.[_0x1aa1c3(0x28c)]||_0x5073e4[_0x1aa1c3(0x300)],{'cause':_0x5073e4});throw _0x5073e4;}}}class RetrieveComponentAction{['devopsUrl'];[a0_0x216d83(0x1db)];constructor(_0x4a391e){const _0x129cdf=a0_0x216d83;this[_0x129cdf(0x1f0)]=_0x4a391e[_0x129cdf(0x1f0)],this['accessToken']=_0x4a391e[_0x129cdf(0x1db)];}async[a0_0x216d83(0x31a)](_0x3370c3){const _0x242880=a0_0x216d83;try{const {data:{id:_0x279b10,name:_0x5c9754,type:_0x571ec6,fHash:_0x37b7ed,files:_0x105206}}=await axios[_0x242880(0x2e5)](_0x242880(0x1df)+_0x3370c3,{'headers':{'authorization':''+this[_0x242880(0x1db)]},'baseURL':this['devopsUrl']}),_0x4ecb5b=_0x105206[_0x242880(0x1d8)](_0x5126db=>({'path':_0x5126db[_0x242880(0x1f6)],'content':Buffer[_0x242880(0x267)](_0x5126db['content'],'base64')['toString'](_0x242880(0x2a4))}));return{'id':_0x279b10,'name':_0x5c9754,'type':_0x571ec6,'fHash':_0x37b7ed,'files':_0x4ecb5b};}catch(_0x2e0b15){if(axios[_0x242880(0x2d2)](_0x2e0b15))throw Error(_0x2e0b15[_0x242880(0x227)]?.[_0x242880(0x307)]['message']||_0x2e0b15['response']?.[_0x242880(0x28c)]||_0x2e0b15['message'],{'cause':_0x2e0b15});throw _0x2e0b15;}}}const RETRIEVE_COMPONENT_CHUNK_SIZE=0xa;class ApiService{static async[a0_0x216d83(0x1d4)](_0x5a5646){const _0x87be4d=a0_0x216d83,_0x1782fc=new ListBranchesAction(_0x5a5646);return _0x1782fc[_0x87be4d(0x31a)]();}static async[a0_0x216d83(0x1be)](_0x187e90){const _0x1e8643=a0_0x216d83,_0x42b9c8=new GetDefaultBranchAction(_0x187e90);return _0x42b9c8[_0x1e8643(0x31a)]();}static async['getBranch'](_0xc09520){const _0x5a9e90=a0_0x216d83,_0x37cc7f=await ApiService[_0x5a9e90(0x1d4)]({'devopsUrl':_0xc09520[_0x5a9e90(0x1f0)],'accessToken':_0xc09520[_0x5a9e90(0x1db)],'search':_0xc09520[_0x5a9e90(0x2c6)]});return _0x37cc7f['find'](({name:_0x21a69e})=>_0x21a69e===_0xc09520['branchName'])||null;}static async['getBranchById'](_0x5cf6ce){const _0x5ea484=a0_0x216d83,_0x1de5c2=new GetBranchAction({'accessToken':_0x5cf6ce['accessToken'],'devopsUrl':_0x5cf6ce['devopsUrl']});return _0x1de5c2['execute']({'branchId':_0x5cf6ce[_0x5ea484(0x343)]});}static[a0_0x216d83(0x262)](_0x3cb2ec){const _0x2e7739=a0_0x216d83,_0x1061fb=new ListComponentsAction(_0x3cb2ec);return _0x1061fb[_0x2e7739(0x31a)]();}static async[a0_0x216d83(0x22d)](_0x4dde18){const _0x6460e=a0_0x216d83,_0x1917e0=[];for await(const _0xf20753 of ApiService['listComponentsGenerator'](_0x4dde18)){_0x1917e0[_0x6460e(0x212)](_0xf20753);}return _0x1917e0;}static async*[a0_0x216d83(0x2f9)](_0x93296f){const _0x2e9520=a0_0x216d83,_0x21fab9=new RetrieveComponentAction({'devopsUrl':_0x93296f[_0x2e9520(0x1f0)],'accessToken':_0x93296f[_0x2e9520(0x1db)]});let _0x543c25=[];for await(const _0x3a031c of ApiService[_0x2e9520(0x262)]({'devopsUrl':_0x93296f[_0x2e9520(0x1f0)],'accessToken':_0x93296f[_0x2e9520(0x1db)],'branchId':_0x93296f['branchId'],'commitId':_0x93296f[_0x2e9520(0x219)],'components':_0x93296f['components']})){_0x543c25[_0x2e9520(0x212)](_0x21fab9['execute'](_0x3a031c['id'])),_0x543c25['length']>=RETRIEVE_COMPONENT_CHUNK_SIZE&&(yield*await Promise[_0x2e9520(0x2c4)](_0x543c25),_0x543c25=[]);}_0x543c25['length']&&(yield*await Promise[_0x2e9520(0x2c4)](_0x543c25));}static async[a0_0x216d83(0x274)]({devopsUrl:_0x52596f,accessToken:_0x2fe68b,componentId:_0x542545}){const _0x2d6111=a0_0x216d83,_0x3819f9=new RetrieveComponentAction({'devopsUrl':_0x52596f,'accessToken':_0x2fe68b});return _0x3819f9[_0x2d6111(0x31a)](_0x542545);}static async[a0_0x216d83(0x2cc)](_0x1a5ec8){const _0xb0d20=a0_0x216d83,{accessToken:_0x3b96e6,devopsUrl:_0x6f3187}=await CredentialsManager[_0xb0d20(0x2e5)]({'alias':_0x1a5ec8});if(!_0x6f3187)throw new Error(_0xb0d20(0x2a1));return{'accessToken':_0x3b96e6,'devopsUrl':_0x6f3187};}static async[a0_0x216d83(0x1f5)](_0x5659f7){const _0x353312=a0_0x216d83,_0x5e4801=new GetMeAction(_0x5659f7);return _0x5e4801[_0x353312(0x31a)]();}static async['commit'](_0x5c405d){const _0x1a644c=a0_0x216d83,_0x4b083e=new CommitAction(_0x5c405d);await _0x4b083e[_0x1a644c(0x31a)]();}static async[a0_0x216d83(0x216)](_0x1922fb){const _0x9be88=a0_0x216d83,_0x2bd512=new CreateBranchAction({'accessToken':_0x1922fb['accessToken'],'devopsUrl':_0x1922fb['devopsUrl']});return _0x2bd512[_0x9be88(0x31a)]({'name':_0x1922fb[_0x9be88(0x24f)],'parentId':_0x1922fb[_0x9be88(0x1e3)]});}}var ConfigName=(_0x292205=>{const _0x159c10=a0_0x216d83;return _0x292205[_0x159c10(0x2a6)]=_0x159c10(0x268),_0x292205;})(ConfigName||{}),ChangeType=(_0x1f25c2=>{const _0x1ddfa3=a0_0x216d83;return _0x1f25c2[_0x1ddfa3(0x1bf)]='Create',_0x1f25c2[_0x1ddfa3(0x28d)]=_0x1ddfa3(0x211),_0x1f25c2[_0x1ddfa3(0x2f8)]=_0x1ddfa3(0x2ff),_0x1f25c2;})(ChangeType||{});class CompareWithRemoteBranchAction{[a0_0x216d83(0x1f0)];[a0_0x216d83(0x1db)];[a0_0x216d83(0x252)];[a0_0x216d83(0x338)];[a0_0x216d83(0x2db)];constructor(_0xdf2592){const _0x1dd9ed=a0_0x216d83;this[_0x1dd9ed(0x1f0)]=_0xdf2592[_0x1dd9ed(0x1f0)],this['accessToken']=_0xdf2592[_0x1dd9ed(0x1db)],this[_0x1dd9ed(0x252)]=_0xdf2592['targetBranchId'],this[_0x1dd9ed(0x338)]=_0xdf2592[_0x1dd9ed(0x338)],this[_0x1dd9ed(0x2db)]=_0xdf2592['stage'];}async['execute'](){const _0x4c088a=a0_0x216d83,_0xa6e946=await ApiService[_0x4c088a(0x22d)]({'devopsUrl':this['devopsUrl'],'accessToken':this[_0x4c088a(0x1db)],'branchId':this['targetBranchId'],'commitId':this[_0x4c088a(0x338)]}),_0x22b5da=new Map(_0xa6e946['map'](_0x5e1789=>[_0x5e1789[_0x4c088a(0x30f)]+'_'+_0x5e1789[_0x4c088a(0x24f)],_0x5e1789])),_0x25facb=[];for(const _0x4e371e of this['findDeletedAndUpdated'](_0x22b5da)){_0x25facb[_0x4c088a(0x212)](_0x4e371e),_0x22b5da[_0x4c088a(0x1cf)](_0x4e371e[_0x4c088a(0x30f)]+'_'+_0x4e371e[_0x4c088a(0x24f)]);}for(const [_0x534d58,_0x550816]of _0x22b5da[_0x4c088a(0x2aa)]()){const _0x355871=this[_0x4c088a(0x2db)][_0x4c088a(0x31c)]['get'](_0x534d58);!_0x355871&&_0x25facb['push']({'id':_0x550816['id'],'name':_0x550816[_0x4c088a(0x24f)],'type':_0x550816[_0x4c088a(0x30f)],'fHash':_0x550816[_0x4c088a(0x257)],'changeType':ChangeType[_0x4c088a(0x1bf)]});}return _0x25facb;}*[a0_0x216d83(0x269)](_0x29cae2){const _0x21e752=a0_0x216d83;for(const [_0x19867c,_0x2e819b]of this[_0x21e752(0x2db)][_0x21e752(0x31c)][_0x21e752(0x2aa)]()){const _0x14f9f2=_0x29cae2[_0x21e752(0x2e5)](_0x19867c);!_0x14f9f2&&(yield{'name':_0x2e819b['name'],'type':_0x2e819b[_0x21e752(0x30f)],'changeType':ChangeType['DELETE']}),_0x14f9f2&&_0x14f9f2[_0x21e752(0x257)]!==_0x2e819b[_0x21e752(0x257)]&&(yield{'id':_0x14f9f2['id'],'name':_0x14f9f2[_0x21e752(0x24f)],'type':_0x14f9f2[_0x21e752(0x30f)],'fHash':_0x14f9f2[_0x21e752(0x257)],'changeType':ChangeType[_0x21e752(0x28d)]});}}}class ConfigSetAction{[a0_0x216d83(0x2db)];constructor({stage:_0x5985ba}){const _0x49b00d=a0_0x216d83;this[_0x49b00d(0x2db)]=_0x5985ba;}async[a0_0x216d83(0x31a)]({name:_0x1c4cf6,value:_0x5d7600}){const _0x236057=a0_0x216d83;switch(_0x1c4cf6){case ConfigName[_0x236057(0x2a6)]:await CredentialsManager[_0x236057(0x2e5)]({'alias':_0x5d7600}),this[_0x236057(0x2db)][_0x236057(0x2da)](_0x1c4cf6,_0x5d7600);break;default:throw new Error(_0x236057(0x2dc)+_0x1c4cf6);}}}class FindChangesAction{['stage'];constructor(_0x443312){const _0x227b11=a0_0x216d83;this[_0x227b11(0x2db)]=_0x443312[_0x227b11(0x2db)];}async[a0_0x216d83(0x31a)](){const _0x594c29=a0_0x216d83,_0x37ebf1=new Map(this[_0x594c29(0x2db)]['componentsState']),_0x218470=[];for await(const {componentName:_0x2b6a9c,componentType:_0x302387,filePaths:_0x528430}of salesforce[_0x594c29(0x2a3)][_0x594c29(0x32d)](this[_0x594c29(0x2db)]['projectPath'])){const _0x464b52=_0x302387+'_'+_0x2b6a9c,_0x302479=_0x37ebf1[_0x594c29(0x2e5)](_0x464b52),_0x1022c1=_0x528430[_0x594c29(0x1d8)](_0x218aea=>_0x218aea['replace'](this[_0x594c29(0x2db)][_0x594c29(0x2bf)]+'/',''));if(!_0x302479){_0x218470[_0x594c29(0x212)]({'type':_0x302387,'name':_0x2b6a9c,'changes':_0x1022c1[_0x594c29(0x1d8)](_0x3cf0c6=>({'path':_0x3cf0c6,'changeType':ChangeType[_0x594c29(0x1bf)]}))});continue;}_0x37ebf1[_0x594c29(0x1cf)](_0x464b52);const _0x433a54=await this['getUpdatedComponentChanges'](_0x1022c1,_0x302479['paths']);_0x433a54[_0x594c29(0x200)]&&_0x218470[_0x594c29(0x212)]({'type':_0x302387,'name':_0x2b6a9c,'changes':_0x433a54});}for(const [,_0x11d75e]of _0x37ebf1[_0x594c29(0x2aa)]()){_0x218470[_0x594c29(0x212)]({'type':_0x11d75e[_0x594c29(0x30f)],'name':_0x11d75e[_0x594c29(0x24f)],'changes':_0x11d75e['paths'][_0x594c29(0x1d8)](_0x5bbb84=>({'path':_0x5bbb84,'changeType':ChangeType[_0x594c29(0x2f8)]}))});}return _0x218470;}async[a0_0x216d83(0x2e8)](_0x579937,_0x4b662d){const _0x12e093=a0_0x216d83,{lastStageTimestamp:_0xa61c5}=this[_0x12e093(0x2db)][_0x12e093(0x22f)],_0x501f72=[];for(const _0x4db854 of _0x579937){const _0x105d94=_0x4b662d[_0x12e093(0x289)](_0x4db854);if(!_0x105d94){_0x501f72[_0x12e093(0x212)]({'path':_0x4db854,'changeType':ChangeType['CREATE']});continue;}const {ctimeMs:_0x30ba2f,mtimeMs:_0x44084b}=await promises[_0x12e093(0x21e)](_0x4db854);(!_0xa61c5||Math[_0x12e093(0x1f8)](_0x44084b)>_0xa61c5||Math['trunc'](_0x30ba2f)>_0xa61c5)&&_0x501f72[_0x12e093(0x212)]({'path':_0x4db854,'changeType':ChangeType[_0x12e093(0x28d)]});}for(const _0x3777c1 of _0x4b662d){const _0x394094=!_0x579937['includes'](_0x3777c1);_0x394094&&_0x501f72['push']({'path':_0x3777c1,'changeType':ChangeType[_0x12e093(0x2f8)]});}return _0x501f72;}}const STAGE_FOLDER_NAME=a0_0x216d83(0x1e6),SYSTEM_FOLDER='.'+ROOT_NAME,CONFIG_FILE_NAME=a0_0x216d83(0x32c),BRANCH_STATE_FILE_NAME=a0_0x216d83(0x2b1),COMPONENTS_STATE_FILE_NAME='components-state.json',COMPONENT_PROJECT_PATH=node_path['join']('force-app','main',a0_0x216d83(0x24d)),SFDX_PROJECT_FILE_NAME=a0_0x216d83(0x1c7),INITIAL_BRANCH_STATE={'id':null,'name':null,'headCommitId':null,'lastStageTimestamp':null},INITIAL_CONFIG={'credentialsAlias':null};function a0_0x5404(){const _0x115836=['getFolderFilePaths','has','Update','push','_branchId','split','Config\x20name.\x20Allowed\x20values:\x20','createBranch','Login\x20started','init','commitId','Delete\x20saved\x20credentials.','Display\x20all\x20authorized\x20credentials.','<config-name>','Commit\x20started','stat','stringify','flat','readComponentsState','Stage\x20not\x20found','update','_branchState','\x22\x20wasn\x27t\x20restored','handleRestore','response','fit/branches/','calculateComponentHash','updateBranchState','Credentials\x20with\x20alias\x20\x22','Detecting\x20changes\x20started','listComponents','list-credentials','branchState','updateComponent','isJson','count','env','Retrieve\x20components\x20started','pull','checkout','instance','List\x20credentials\x20completed','Listing\x20remote\x20branches\x20started','createComponent','set','Fail\x20Message','-n,\x20--name\x20<string>','No\x20changes\x20for\x20rollback','flosum','warnDebug','slice','table','indexOf','Alias\x20of\x20credentials\x20which\x20will\x20be\x20used\x20to\x20retrieve\x20your\x20components\x20from\x20devops.','failMessage','createInterface','Status\x20calculation\x20started','Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed','toString','Checkout\x20on\x20another\x20branch.\x20Checkout\x20command\x20retrieves\x20components\x20missing\x20locally.','Value','isDirectoryExists','default','rollback','name','infoDebug','Enter\x20commit\x20message:\x20','targetBranchId','credentials','List\x20credentials\x20started','Committed\x20Components:','manager','fHash','description',':ERROR','access','Logout\x20started','A\x20branch\x20name\x20which\x20you\x20checkout\x20on.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','configName','\x20services','cwd','Project\x20initialization\x20completed','Checking\x20manual\x20changes\x20started','listComponentsGenerator','create','File\x20\x22','areChanges','isFileExists','from','credentialsAlias','findDeletedAndUpdated','Clear\x20project\x20config\x20property.','login','Update:\x20Component\x20not\x20found','errorDebug','addCommand','Return\x20all\x20local\x20not\x20committed\x20changes.','search','Commit\x20message.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','config','value','retrieveComponentById','componentChanges','Not\x20Found','Checking\x20manual\x20changes\x20completed','headCommitId','findChanges','Saved\x20credentials\x20alias.','1503ufMMrI','SALESFORCE','logout','alias','string','constants','convertToCommit','/api/v1/links','commitDate','auth/me','928495qfpHJP','firstName','color','commander','includes','constructor','Config\x20set\x20completed','statusText','UPDATE','register','convertToLocalComponent','rollbackTypes','splice','debug','Rolling\x20back\x20to\x20last\x20committed\x20state\x20completed','globalSettingsUrl','lastStageTimestamp','-a,\x20--alias\x20<string>','readFile','paths','askString','Logger\x20not\x20found','Token\x20for\x20getting\x20access\x20to\x20','save','Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.','node:os','DEVOPS_COMMANDS','applyDelete','Devops\x20url\x20not\x20found','getBranchName','SfProjectScanner','utf-8','5087050fCvHXs','CREDENTIALS_ALIAS','Applies\x20json\x20formatted\x20result.','log','Creation\x20new\x20branch\x20started','entries','commit','catch','enable','.bin','Project\x20initialization\x20started','Name','branch-state.json','Rolled\x20Back\x20Changes:','Global\x20Settings\x20Url','components','error','Config\x20set\x20started','PATH\x20env\x20not\x20found','saveComponent','fHash\x20for\x20component\x20\x22','pendingChanges','stdout','_stagePath','warn','isDirectory','projectPath','2256150KSVOlp','_isUpdateStageTimestamp','Config\x20Name','defineRollbackTypes','all','filesChanges','branchName','Create:\x20Component\x20not\x20found','Changes\x20not\x20found','config-set','getAllCredentials','node:path','getCredentials','api','Local\x20head\x20commit\x20id\x20not\x20found','Set\x20project\x20config.','-t,\x20--token\x20<string>','cleanUpEmptyFolders','isAxiosError','dirname','getBranchById','saveBranchState','buildProjectPath','bind','_componentsState','fileChanges','setConfig','stage','Unknown\x20config\x20name:\x20','Looking\x20for\x20changes\x20started','componentsForRetrieve','findIndex','run','lastName','\x20was\x20deleted','_changes','currentBranch','get','Branch\x20Name','indexes','getUpdatedComponentChanges','/commits','version',':INFO','Invalid\x20credentials\x20type','label','applicationUrl','readBranchState','deleteComponent','A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first','\x22\x20not\x20found','now','\x22\x20completed','userName','W_OK','hex','DELETE','retrieveComponents','readConfig','878uMZEuU','653460HETAut','registerFileChange','_logger','Delete','message','argument','rmdir','logger','parse','buildReport','retrieve','data','targetBranchName','Stage\x20folder\x20not\x20found','abort','_localHeadCommit','Login\x20successfully\x20completed.\x20You\x20credentials\x20are\x20saved\x20with\x20alias\x20\x22','addFileChange','--json','type','Enter\x20api\x20token:\x20','then','branches','writeFile','Change\x20Type','Local\x20and\x20remote\x20head\x20commits\x20don\x27t\x20match.\x20Use\x20\x22flosum\x20devops\x20pull\x22\x20to\x20retrieve\x20latest\x20updates\x20from\x20devops','<value>','1112Thnkee','Missing\x20content\x20for\x20not\x20Delete\x20change\x20type','VLOCITY','execute','2397906faGKqi','componentsState','print','Credentials\x20alias\x20is\x20not\x20configured','localHeadCommit','0.0.2','status','node_modules','Credentials\x20not\x20found','Cloning\x20completed','Rollback\x20started','initProject','Alias','Project\x20is\x20not\x20initialized','getBranchState','abortStage','initStage','config.json','scan','handle','isInitialized','fit/branches','CreateProjectSfCommand','findAndCommitChanges','Component\x20id\x20not\x20found\x20after\x20comparison','readdir','Retrieve\x20components\x20completed','apply','NULL','targetCommitId','No\x20Local\x20Changes','report','mkdir','Status','Creation\x20new\x20branch\x20completed','Deleted','devops','Checkout\x20handler\x20not\x20found','Files','_success','branchId','unsetConfig','\x20of\x20type\x20','component','_credentials','applyCreateUpdate','stagePath','_stage','printJson','arguments','updateComponentState','success','Status\x20calculation\x20completed','Type','compareWithRemoteBranch','getDefaultBranch','CREATE','Roll\x20back\x20your\x20branch\x20state\x20to\x20last\x20committed\x20one.','files','updateSystemFiles','Project\x20Path','Pending\x20Changes:','info','Command','sfdx-project.json','Create\x20salesforce\x20project\x20and\x20cli\x20system\x20files.','Login\x20into\x20global\x20settings\x20and\x20retrieve\x20data\x20about\x20related\x20services.','Devops\x20Url','option','getMessage','targetBranch','getAccessToken','delete','DevOps','find','changeType','Enter\x20project\x20name:\x20','listBranches','sep','credentials.json','rows','map','clone','(((.+)+)+)+$','accessToken','Component\x20','applyFileChanges','Cloning\x20started','fit/file-versions/','File','homedir','digest','parentId','\x22\x20started','join','.stage','ROOT_COMMANDS','\x20components\x20will\x20be\x20committed','Project\x20Updates:','retrievedComponents','Rollback\x20completed','CLI','options','commandName','41672nMVStm','devopsUrl','Branch\x20id\x20not\x20found','changes','size','Retrieve\x20Result:','getMe','path','applyStage','trunc','base64','getCredentialsAlias','Alias\x20which\x20saved\x20credentials\x20will\x20be\x20accessed\x20with.','\x22\x20already\x20exists','\x20files\x20will\x20be\x20rolled\x20back','question','Logout\x20completed','length','Commit\x20local\x20changes\x20to\x20a\x20remote\x20branch\x20on\x20devops.','PATH','values','setIsUpdateStageTimestamp','_projectPath','total','node:readline/promises','retrieveDifference','post','_headCommitId','Checkout\x20on\x20\x22','getInstance','basename','14pxcoLG'];a0_0x5404=function(){return _0x115836;};return a0_0x5404();}class InitProjectAction{[a0_0x216d83(0x2db)];[a0_0x216d83(0x272)];constructor({stage:_0x3772ff,config:_0x45c00f}){const _0x498b95=a0_0x216d83;this[_0x498b95(0x2db)]=_0x3772ff,this['config']=_0x45c00f;}async['execute'](){const _0x30c701=a0_0x216d83,_0x3efee7=new salesforce[(_0x30c701(0x331))]({'cwd':node_path[_0x30c701(0x2d3)](this[_0x30c701(0x2db)][_0x30c701(0x1b5)]),'projectName':node_path[_0x30c701(0x20d)](this[_0x30c701(0x2db)][_0x30c701(0x1b5)])});await _0x3efee7[_0x30c701(0x2e0)]();const _0x48d632=await FileUtils['getFolderFilePaths'](this[_0x30c701(0x2db)][_0x30c701(0x1b5)]);for(const _0x1ce283 of _0x48d632){const _0x46609e=_0x1ce283[_0x30c701(0x214)](STAGE_FOLDER_NAME)[0x1];this[_0x30c701(0x2db)][_0x30c701(0x2fd)]({'path':_0x46609e,'changeType':ChangeType[_0x30c701(0x1bf)]});}if(this[_0x30c701(0x272)])for(const _0x51e911 of Object['values'](ConfigName)){this[_0x30c701(0x2db)]['setConfig'](_0x51e911,this['config'][_0x51e911]);}}}class SaveComponentAction{[a0_0x216d83(0x2db)];constructor(_0x4553f3){const _0x5c90ef=a0_0x216d83;this['stage']=_0x4553f3[_0x5c90ef(0x2db)];}async[a0_0x216d83(0x31a)](_0x39cb99){const _0x2f4a22=a0_0x216d83;switch(_0x39cb99[_0x2f4a22(0x1d2)]){case ChangeType[_0x2f4a22(0x1bf)]:{if(!_0x39cb99['component'])throw new Error(_0x2f4a22(0x2c7));await this['stage'][_0x2f4a22(0x23a)](_0x39cb99[_0x2f4a22(0x1b2)]);break;}case ChangeType[_0x2f4a22(0x28d)]:if(!_0x39cb99['component'])throw new Error(_0x2f4a22(0x26c));await this['stage'][_0x2f4a22(0x230)](_0x39cb99['component']);break;case ChangeType['DELETE']:await this[_0x2f4a22(0x2db)]['deleteComponent']({'name':_0x39cb99[_0x2f4a22(0x24f)],'type':_0x39cb99[_0x2f4a22(0x30f)]});break;}}}class UpdateComponentStateAction{['stage'];[a0_0x216d83(0x24f)];['type'];[a0_0x216d83(0x1f2)];constructor(_0x172a6f){const _0x524047=a0_0x216d83;this[_0x524047(0x2db)]=_0x172a6f[_0x524047(0x2db)],this[_0x524047(0x24f)]=_0x172a6f[_0x524047(0x24f)],this['type']=_0x172a6f[_0x524047(0x30f)],this['changes']=_0x172a6f['changes'];}async[a0_0x216d83(0x31a)](){const _0x314245=a0_0x216d83,_0x274911=this[_0x314245(0x30f)]+'_'+this['name'];let _0x340fc2=this[_0x314245(0x2db)][_0x314245(0x31c)]['get'](_0x274911),_0x5acef8=ChangeType[_0x314245(0x28d)];!_0x340fc2&&(_0x340fc2={'name':this['name'],'type':this['type'],'fHash':'','paths':[]},this[_0x314245(0x2db)]['componentsState'][_0x314245(0x23b)](_0x274911,_0x340fc2),_0x5acef8=ChangeType['CREATE']);for(const _0x3aba62 of this['changes']){this['handleFileChange'](_0x340fc2,_0x3aba62);}if(!_0x340fc2['paths'][_0x314245(0x200)])return this[_0x314245(0x2db)]['componentsState'][_0x314245(0x1cf)](_0x274911),{'name':_0x340fc2[_0x314245(0x24f)],'type':_0x340fc2[_0x314245(0x30f)],'changeType':ChangeType[_0x314245(0x2f8)]};return _0x340fc2[_0x314245(0x257)]=await this[_0x314245(0x229)](_0x340fc2[_0x314245(0x298)]),{..._0x340fc2,'changeType':_0x5acef8};}['handleFileChange'](_0x445dac,{path:_0x424ca2,changeType:_0x20509c}){const _0x58eae9=a0_0x216d83;if(_0x20509c===ChangeType[_0x58eae9(0x1bf)]){if(_0x445dac['paths'][_0x58eae9(0x289)](_0x424ca2))throw new Error(_0x58eae9(0x264)+_0x424ca2+_0x58eae9(0x1fc));_0x445dac['paths'][_0x58eae9(0x212)](_0x424ca2);}if(_0x20509c===ChangeType['DELETE']){const _0x56eac2=_0x445dac['paths'][_0x58eae9(0x243)](_0x424ca2);if(_0x56eac2<0x0)throw new Error('File\x20\x22'+_0x424ca2+_0x58eae9(0x2f2));_0x445dac[_0x58eae9(0x298)][_0x58eae9(0x291)](_0x56eac2,0x1);}}async['calculateComponentHash'](_0x45086a){const _0x3407d4=a0_0x216d83,_0x206639=node_crypto['createHash']('sha1');for(const _0x3752f4 of _0x45086a){const _0x21a5b9=await promises[_0x3407d4(0x297)](node_path[_0x3407d4(0x1e5)](this[_0x3407d4(0x2db)][_0x3407d4(0x2bf)],_0x3752f4),{'encoding':_0x3407d4(0x2a4)}),_0x26c3cf=_0x3752f4[_0x3407d4(0x214)](node_path[_0x3407d4(0x1d5)])[_0x3407d4(0x241)](0x3)['join']('/');_0x206639[_0x3407d4(0x223)](_0x26c3cf),_0x206639[_0x3407d4(0x223)](_0x21a5b9);}const _0x29c21d=_0x206639[_0x3407d4(0x1e2)](_0x3407d4(0x2f7));return _0x29c21d;}}class Stage{[a0_0x216d83(0x205)];[a0_0x216d83(0x2bc)];[a0_0x216d83(0x272)];[a0_0x216d83(0x224)];[a0_0x216d83(0x2d8)];[a0_0x216d83(0x2d9)]=[];[a0_0x216d83(0x2c1)]=!![];set['isUpdateStageTimestamp'](_0x4a1e25){this['_isUpdateStageTimestamp']=_0x4a1e25;}get['projectPath'](){return this['_projectPath'];}get['stagePath'](){const _0x32e4db=a0_0x216d83;return this[_0x32e4db(0x2bc)];}get['branchState'](){return this['_branchState'];}get[a0_0x216d83(0x31c)](){return this['_componentsState'];}constructor(_0x320be0){const _0x38780b=a0_0x216d83;this[_0x38780b(0x205)]=_0x320be0[_0x38780b(0x2bf)],this['_stagePath']=_0x320be0['stagePath'],this['config']=_0x320be0[_0x38780b(0x272)],this['_branchState']=_0x320be0[_0x38780b(0x22f)],this[_0x38780b(0x2d8)]=_0x320be0[_0x38780b(0x31c)]?new Map(_0x320be0[_0x38780b(0x31c)]['map'](_0x36fe4f=>[_0x36fe4f[_0x38780b(0x30f)]+'_'+_0x36fe4f['name'],_0x36fe4f])):new Map();}[a0_0x216d83(0x2da)](_0x47de24,_0x13de21){const _0x3fd0fc=a0_0x216d83;this[_0x3fd0fc(0x272)][_0x47de24]=_0x13de21;}[a0_0x216d83(0x344)](_0x512f08){const _0x3b2c87=a0_0x216d83;this[_0x3b2c87(0x272)][_0x512f08]=null;}[a0_0x216d83(0x22a)](_0x216c74){const _0x2d6e69=a0_0x216d83;this[_0x2d6e69(0x22f)]['id']=_0x216c74['id'],this[_0x2d6e69(0x22f)][_0x2d6e69(0x24f)]=_0x216c74[_0x2d6e69(0x24f)],this[_0x2d6e69(0x22f)][_0x2d6e69(0x278)]=_0x216c74[_0x2d6e69(0x278)];}async['createComponent'](_0x4e09c6){const _0x1f37b8=a0_0x216d83,_0x20502b={'name':_0x4e09c6[_0x1f37b8(0x24f)],'type':_0x4e09c6[_0x1f37b8(0x30f)],'fHash':_0x4e09c6[_0x1f37b8(0x257)],'paths':_0x4e09c6[_0x1f37b8(0x1c1)][_0x1f37b8(0x1d8)](({path:_0x1f516a})=>node_path['join'](COMPONENT_PROJECT_PATH,_0x1f516a))};this[_0x1f37b8(0x2d8)]['set'](_0x4e09c6['type']+'_'+_0x4e09c6['name'],_0x20502b);for(const {path:_0x105302,content:_0x4a0ae4}of _0x4e09c6[_0x1f37b8(0x1c1)]){await this['addFileChange']({'path':node_path[_0x1f37b8(0x1e5)](COMPONENT_PROJECT_PATH,_0x105302),'content':_0x4a0ae4,'changeType':ChangeType[_0x1f37b8(0x1bf)]});}}async[a0_0x216d83(0x230)](_0x1a42d6){const _0x149b99=a0_0x216d83,_0x168633=this[_0x149b99(0x2d8)]['get'](_0x1a42d6[_0x149b99(0x30f)]+'_'+_0x1a42d6['name']),_0x5d5775=[];if(!_0x168633)throw new Error('Update:\x20Component\x20'+_0x1a42d6['name']+_0x149b99(0x1b1)+_0x1a42d6[_0x149b99(0x30f)]+'\x20not\x20found');for(const _0x6b7b6a of _0x168633[_0x149b99(0x298)]){await this[_0x149b99(0x30d)]({'path':_0x6b7b6a,'changeType':ChangeType[_0x149b99(0x2f8)]});}for(const {path:_0x1e3ac7,content:_0x16b6ba}of _0x1a42d6[_0x149b99(0x1c1)]){const _0x403575=node_path['join'](COMPONENT_PROJECT_PATH,_0x1e3ac7);await this[_0x149b99(0x30d)]({'path':_0x403575,'content':_0x16b6ba,'changeType':ChangeType[_0x149b99(0x1bf)]}),_0x5d5775['push'](_0x403575);}_0x168633[_0x149b99(0x257)]=_0x1a42d6['fHash'],_0x168633[_0x149b99(0x298)]=_0x5d5775;}async[a0_0x216d83(0x2f0)](_0x3a5d19){const _0x4a29f2=a0_0x216d83,_0x2f6ef1=_0x3a5d19['type']+'_'+_0x3a5d19[_0x4a29f2(0x24f)],_0x12be14=this['_componentsState'][_0x4a29f2(0x2e5)](_0x2f6ef1);if(!_0x12be14)throw new Error(_0x4a29f2(0x1dc)+_0x3a5d19['name']+'\x20of\x20type\x20'+_0x3a5d19[_0x4a29f2(0x30f)]+'\x20not\x20found');for(const _0x2088c4 of _0x12be14[_0x4a29f2(0x298)]){await this[_0x4a29f2(0x30d)]({'path':_0x2088c4,'changeType':ChangeType['DELETE']});}this[_0x4a29f2(0x2d8)][_0x4a29f2(0x1cf)](_0x2f6ef1);}async[a0_0x216d83(0x30d)]({path:_0x8e15ee,content:_0x5eb6b8,changeType:_0x5c14e5}){const _0x1bb3f=a0_0x216d83;if(_0x5c14e5!==ChangeType[_0x1bb3f(0x2f8)]){if(!_0x5eb6b8)throw new Error(_0x1bb3f(0x318));const _0x40f1a6=node_path[_0x1bb3f(0x1e5)](this[_0x1bb3f(0x1b5)],_0x8e15ee);await promises[_0x1bb3f(0x33b)](node_path[_0x1bb3f(0x2d3)](_0x40f1a6),{'recursive':!![]}),await promises['writeFile'](_0x40f1a6,_0x5eb6b8);}this['fileChanges'][_0x1bb3f(0x212)]({'path':_0x8e15ee,'changeType':_0x5c14e5});}async[a0_0x216d83(0x1b9)](_0x5988c0){const _0x5540e7=new UpdateComponentStateAction({'stage':this,..._0x5988c0});return _0x5540e7['execute']();}async['changeFile'](){}[a0_0x216d83(0x2fd)]({path:_0xfb1a86,changeType:_0x4f48b7}){const _0x500c5f=a0_0x216d83;this['fileChanges'][_0x500c5f(0x212)]({'path':_0xfb1a86,'changeType':_0x4f48b7});}async[a0_0x216d83(0x336)](){const _0x43a8a4=a0_0x216d83,_0x58717a=await FileUtils[_0x43a8a4(0x24c)](this[_0x43a8a4(0x1b5)]);if(!_0x58717a)throw Error(_0x43a8a4(0x309));await this[_0x43a8a4(0x1dd)](),await this[_0x43a8a4(0x1c2)](),await promises['rm'](this[_0x43a8a4(0x1b5)],{'recursive':!![]});const _0x2cd07e=node_path[_0x43a8a4(0x1e5)](this[_0x43a8a4(0x205)],COMPONENT_PROJECT_PATH),_0x1b4fb9=await FileUtils[_0x43a8a4(0x24c)](_0x2cd07e);_0x1b4fb9?await FileUtils[_0x43a8a4(0x2d1)](_0x2cd07e,![]):await promises[_0x43a8a4(0x33b)](_0x2cd07e,{'recursive':!![]});}async[a0_0x216d83(0x30a)](){const _0x1803d2=a0_0x216d83;await promises['rm'](this[_0x1803d2(0x1b5)],{'recursive':!![],'force':!![]});}async[a0_0x216d83(0x1dd)](){const _0x263888=a0_0x216d83;for(const {path:_0x382151,changeType:_0xd8e9a3}of this['fileChanges']){switch(_0xd8e9a3){case ChangeType['CREATE']:case ChangeType[_0x263888(0x28d)]:await this[_0x263888(0x1b4)](_0x382151);break;case ChangeType['DELETE']:await this[_0x263888(0x2a0)](_0x382151);break;}}}async[a0_0x216d83(0x1b4)](_0x53999f){const _0x23bd33=a0_0x216d83,_0x42a6cc=node_path[_0x23bd33(0x1e5)](this[_0x23bd33(0x2bc)],_0x53999f),_0x51bc33=node_path[_0x23bd33(0x1e5)](this[_0x23bd33(0x205)],_0x53999f);await promises['mkdir'](node_path[_0x23bd33(0x2d3)](_0x51bc33),{'recursive':!![]}),await promises['copyFile'](_0x42a6cc,_0x51bc33);}async[a0_0x216d83(0x2a0)](_0x2139c6){const _0x4f5e19=a0_0x216d83;await promises['rm'](node_path[_0x4f5e19(0x1e5)](this[_0x4f5e19(0x205)],_0x2139c6),{'recursive':!![]});}async['updateSystemFiles'](){const _0x2a3d08=a0_0x216d83;await promises[_0x2a3d08(0x313)](node_path['join'](this[_0x2a3d08(0x2bf)],SYSTEM_FOLDER,CONFIG_FILE_NAME),JSON[_0x2a3d08(0x21f)](this['config'])),this[_0x2a3d08(0x2c1)]&&(this['branchState'][_0x2a3d08(0x295)]=Date[_0x2a3d08(0x2f3)]()),await promises[_0x2a3d08(0x313)](node_path[_0x2a3d08(0x1e5)](this[_0x2a3d08(0x2bf)],SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),JSON[_0x2a3d08(0x21f)](this['branchState'])),await promises[_0x2a3d08(0x313)](node_path[_0x2a3d08(0x1e5)](this[_0x2a3d08(0x2bf)],SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),JSON[_0x2a3d08(0x21f)](Array[_0x2a3d08(0x267)](this['_componentsState'][_0x2a3d08(0x203)]())));}}class ProjectManager{static [a0_0x216d83(0x237)];['_stage'];get['stage'](){const _0x5aeeef=a0_0x216d83;if(!this[_0x5aeeef(0x1b6)])throw new Error(_0x5aeeef(0x222));return this[_0x5aeeef(0x1b6)];}constructor(){}static[a0_0x216d83(0x20c)](){const _0x2fe35d=a0_0x216d83;return!ProjectManager['instance']&&(ProjectManager['instance']=new ProjectManager()),ProjectManager[_0x2fe35d(0x237)];}async[a0_0x216d83(0x32b)](_0x107f8d){const _0x3c9420=a0_0x216d83,_0x5816ec=node_path[_0x3c9420(0x1e5)](_0x107f8d,SYSTEM_FOLDER,STAGE_FOLDER_NAME);await promises['rm'](_0x5816ec,{'recursive':!![],'force':!![]}),await promises[_0x3c9420(0x33b)](_0x5816ec,{'recursive':!![]});const _0x1c6ced=await this[_0x3c9420(0x2fa)](_0x107f8d),_0x2ef134=await this[_0x3c9420(0x2ef)](_0x107f8d),_0x286339=await this['readComponentsState'](_0x107f8d);this[_0x3c9420(0x1b6)]=new Stage({'projectPath':_0x107f8d,'stagePath':_0x5816ec,'config':_0x1c6ced,'branchState':_0x2ef134,'componentsState':_0x286339});}async[a0_0x216d83(0x1f7)](){const _0x522ff9=a0_0x216d83;await this[_0x522ff9(0x2db)]['apply']();}async[a0_0x216d83(0x32a)](){const _0x469e6a=a0_0x216d83;await this[_0x469e6a(0x2db)][_0x469e6a(0x30a)]();}async['initProject']({config:_0x5d1ac9}){const _0x8ddf08=a0_0x216d83,_0x180708=new InitProjectAction({'stage':this[_0x8ddf08(0x2db)],'config':_0x5d1ac9});await _0x180708['execute']();}['saveBranchState'](_0x5ee405){const _0x226d2c=a0_0x216d83;this['stage'][_0x226d2c(0x22a)](_0x5ee405);}async[a0_0x216d83(0x2b8)](_0x54752f){const _0x817235=a0_0x216d83,_0x17e2bb=new SaveComponentAction({'stage':this[_0x817235(0x2db)]});await _0x17e2bb['execute'](_0x54752f);}async[a0_0x216d83(0x279)](){const _0xd0b1d1=new FindChangesAction({'stage':this['stage']});return _0xd0b1d1['execute']();}async[a0_0x216d83(0x1bd)](_0x168049){const _0x2c69f0=a0_0x216d83,_0x40ec78=new CompareWithRemoteBranchAction({..._0x168049,'stage':this[_0x2c69f0(0x2db)]});return _0x40ec78['execute']();}async[a0_0x216d83(0x2fa)](_0x447d82){const _0x3a203d=a0_0x216d83,_0x57c361=node_path[_0x3a203d(0x1e5)](_0x447d82,SYSTEM_FOLDER,CONFIG_FILE_NAME),_0x15f9f4=await FileUtils[_0x3a203d(0x266)](_0x57c361);if(!_0x15f9f4)return INITIAL_CONFIG;const _0x188cee=await promises[_0x3a203d(0x297)](_0x57c361);return JSON[_0x3a203d(0x304)](_0x188cee[_0x3a203d(0x249)]());}async[a0_0x216d83(0x2ef)](_0x26db23){const _0x4d44b1=a0_0x216d83,_0x542919=node_path[_0x4d44b1(0x1e5)](_0x26db23,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),_0x16edf8=await FileUtils[_0x4d44b1(0x266)](_0x542919);if(!_0x16edf8)return INITIAL_BRANCH_STATE;const _0x3b3e75=await promises['readFile'](_0x542919);return JSON['parse'](_0x3b3e75[_0x4d44b1(0x249)]());}async[a0_0x216d83(0x221)](_0x130216){const _0x4dbd9c=a0_0x216d83,_0x11e7a0=node_path[_0x4dbd9c(0x1e5)](_0x130216,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),_0x3de487=await FileUtils[_0x4dbd9c(0x266)](_0x11e7a0);if(!_0x3de487)return[];const _0x5ca20a=await promises['readFile'](_0x11e7a0);return JSON[_0x4dbd9c(0x304)](_0x5ca20a[_0x4dbd9c(0x249)]());}async[a0_0x216d83(0x32f)](_0x40164f){const _0x5d98ac=a0_0x216d83,_0x4677b7=[node_path['join'](_0x40164f,SYSTEM_FOLDER,CONFIG_FILE_NAME),node_path['join'](_0x40164f,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),node_path[_0x5d98ac(0x1e5)](_0x40164f,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),node_path['join'](_0x40164f,SFDX_PROJECT_FILE_NAME)];for(const _0x1c87d0 of _0x4677b7){const _0xcc0000=await FileUtils[_0x5d98ac(0x266)](_0x1c87d0);if(!_0xcc0000)return![];}return!![];}async[a0_0x216d83(0x2da)](_0x1f51fd,_0x38900d){const _0x412a2d=a0_0x216d83,_0xc2fdd9=new ConfigSetAction({'stage':this[_0x412a2d(0x2db)]});await _0xc2fdd9['execute']({'name':_0x1f51fd,'value':_0x38900d});}async[a0_0x216d83(0x344)](_0x5db4ec){const _0x33193d=a0_0x216d83;this['stage'][_0x33193d(0x344)](_0x5db4ec);}[a0_0x216d83(0x1b9)](_0x180d8b){const _0x3fedf3=a0_0x216d83;return this[_0x3fedf3(0x2db)]['updateComponentState'](_0x180d8b);}async[a0_0x216d83(0x30d)](_0x219ef0){const _0x262123=a0_0x216d83;await this[_0x262123(0x2db)]['addFileChange'](_0x219ef0);}[a0_0x216d83(0x204)](_0x11044d){const _0x43bbbf=a0_0x216d83;this[_0x43bbbf(0x2db)]['isUpdateStageTimestamp']=_0x11044d;}}class ReadlineUtils{static async['askString'](_0x23b1ef){const _0xe73aa5=a0_0x216d83,_0x4ed7c2=readline[_0xe73aa5(0x246)]({'input':process['stdin'],'output':process[_0xe73aa5(0x2bb)]}),_0x26c252=await _0x4ed7c2[_0xe73aa5(0x1fe)](_0x23b1ef);return _0x4ed7c2['close'](),_0x26c252;}}const INFO_COLOR_INDEX='4',WARN_COLOR_INDEX='3',ERROR_COLOR_INDEX='1';class Logger{[a0_0x216d83(0x231)];[a0_0x216d83(0x250)];[a0_0x216d83(0x240)];[a0_0x216d83(0x26d)];constructor({isJson:_0x300283}){const _0x5b28d3=a0_0x216d83;this[_0x5b28d3(0x231)]=_0x300283,debug[_0x5b28d3(0x2a8)]=console['log'][_0x5b28d3(0x2d7)](console),debug[_0x5b28d3(0x2ad)](ROOT_NAME+':*'),this[_0x5b28d3(0x250)]=debug(ROOT_NAME+_0x5b28d3(0x2eb)),this[_0x5b28d3(0x250)][_0x5b28d3(0x287)]=INFO_COLOR_INDEX,this[_0x5b28d3(0x240)]=debug(ROOT_NAME+':WARN'),this['warnDebug'][_0x5b28d3(0x287)]=WARN_COLOR_INDEX,this[_0x5b28d3(0x26d)]=debug(ROOT_NAME+_0x5b28d3(0x259)),this['errorDebug'][_0x5b28d3(0x287)]=ERROR_COLOR_INDEX;}['info'](_0x4de0bf){const _0x40f890=a0_0x216d83;!this[_0x40f890(0x231)]&&this[_0x40f890(0x250)](_0x4de0bf);}['warn'](_0x23e1f7){const _0x2c1e44=a0_0x216d83;!this['isJson']&&this[_0x2c1e44(0x240)](_0x23e1f7);}[a0_0x216d83(0x2b5)](_0x55e3f3){const _0x536a7b=a0_0x216d83;!this[_0x536a7b(0x231)]&&this[_0x536a7b(0x26d)](_0x55e3f3);}}class BaseCommand{[a0_0x216d83(0x2fe)];get['logger'](){const _0xe9e3bf=a0_0x216d83;if(!this[_0xe9e3bf(0x2fe)])throw new Error(_0xe9e3bf(0x29a));return this[_0xe9e3bf(0x2fe)];}[a0_0x216d83(0x28e)](_0x5cdacb){const _0xfb352=a0_0x216d83,_0x70499b=new commander[(_0xfb352(0x1c6))]()[_0xfb352(0x24f)](this['commandName'])['description'](this['description']);for(const {name:_0x4e8e8f,description:_0x4a9b62,defaultValue:_0x3fa5a0}of this['arguments']){_0x70499b[_0xfb352(0x301)](_0x4e8e8f,_0x4a9b62,_0x3fa5a0);}for(const {flags:_0x22e306,description:_0x545b0f,defaultValue:_0x3e5f76}of this[_0xfb352(0x1ed)]){_0x70499b[_0xfb352(0x1cb)](_0x22e306,_0x545b0f,_0x3e5f76);}_0x70499b['action'](async(..._0x522032)=>{const _0x4f7e23=_0xfb352,_0x1b1df5=this[_0x4f7e23(0x231)](_0x522032);this[_0x4f7e23(0x2fe)]=new Logger({'isJson':_0x1b1df5});try{const _0x4be382=await this[_0x4f7e23(0x31a)](_0x522032);_0x4be382[_0x4f7e23(0x33a)](_0x1b1df5);}catch(_0x4d02bc){_0x4d02bc instanceof Error&&this[_0x4f7e23(0x303)][_0x4f7e23(0x2b5)](_0x4d02bc[_0x4f7e23(0x300)]);throw _0x4d02bc;}}),_0x5cdacb[_0xfb352(0x26e)](_0x70499b);}}class BaseReporter{[a0_0x216d83(0x342)];get[a0_0x216d83(0x1ba)](){const _0x3f8e93=a0_0x216d83;return this[_0x3f8e93(0x342)];}constructor(_0x2d5532){const _0x3ca4a0=a0_0x216d83;this[_0x3ca4a0(0x342)]=_0x2d5532[_0x3ca4a0(0x1ba)];}[a0_0x216d83(0x33a)](_0x114f27){const _0x16a86a=a0_0x216d83,_0x3f263d=this[_0x16a86a(0x305)]();_0x114f27?this[_0x16a86a(0x1b7)](_0x3f263d):this[_0x16a86a(0x31d)](_0x3f263d);}[a0_0x216d83(0x1b7)](_0x285a7e){const _0x120b76=a0_0x216d83,_0x13584c=JSON['stringify'](_0x285a7e,null,0x2);console[_0x120b76(0x2a8)](_0x13584c);}}class FailReporter extends BaseReporter{[a0_0x216d83(0x245)];constructor({failMessage:_0x48c7b1}){super({'success':![]}),this['failMessage']=_0x48c7b1;}[a0_0x216d83(0x305)](){const _0x18f54b=a0_0x216d83;return{'success':this[_0x18f54b(0x1ba)],'failMessage':this[_0x18f54b(0x245)]};}[a0_0x216d83(0x31d)](_0x4502e2){const _0x149332=a0_0x216d83,_0x11e6f4=[[_0x149332(0x23c)],[_0x4502e2[_0x149332(0x245)]]];console[_0x149332(0x2a8)](table['table'](_0x11e6f4,{'columns':[{'width':0x64}]}));}}class CheckoutReporter extends BaseReporter{[a0_0x216d83(0x2e4)];[a0_0x216d83(0x1f2)];constructor({currentBranch:_0xb9b43e,changes:_0x4949db}){const _0x25d4ee=a0_0x216d83;super({'success':!![]}),this[_0x25d4ee(0x2e4)]=_0xb9b43e,this[_0x25d4ee(0x1f2)]=_0x4949db;}[a0_0x216d83(0x305)](){const _0x22e016=a0_0x216d83;return{'success':this[_0x22e016(0x1ba)],'targetBranch':this[_0x22e016(0x2e4)],'changes':this['changes']};}[a0_0x216d83(0x31d)](_0x292e04){const _0x1891f4=a0_0x216d83;console[_0x1891f4(0x2a8)]('Current\x20Branch:\x20'+this[_0x1891f4(0x2e4)][_0x1891f4(0x24f)]+'\x0a'),console[_0x1891f4(0x2a8)](_0x1891f4(0x1e9));const _0x2144dd=[[_0x1891f4(0x314),_0x1891f4(0x2b0),_0x1891f4(0x1bc),_0x1891f4(0x341)]];for(const {changeType:_0x2ae43a,name:_0x58363c,type:_0x4b4d66,paths:_0x2d7839}of _0x292e04['changes']){_0x2144dd['push']([_0x2ae43a,_0x58363c,_0x4b4d66,_0x2d7839?.['join']('\x0a')||'']);}console[_0x1891f4(0x2a8)](table['table'](_0x2144dd,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class BaseHandler{}class TargetBranchExistHandler extends BaseHandler{[a0_0x216d83(0x256)];[a0_0x216d83(0x253)];[a0_0x216d83(0x1cd)];[a0_0x216d83(0x303)];[a0_0x216d83(0x275)]=[];constructor(_0x335d8b){const _0x307bd1=a0_0x216d83;super(),this['manager']=_0x335d8b[_0x307bd1(0x256)],this[_0x307bd1(0x253)]=_0x335d8b[_0x307bd1(0x253)],this[_0x307bd1(0x1cd)]=_0x335d8b['targetBranch'],this[_0x307bd1(0x303)]=_0x335d8b[_0x307bd1(0x303)];}async[a0_0x216d83(0x32e)](){const _0x439e3e=a0_0x216d83,_0x2c7ea2=await this[_0x439e3e(0x265)]();if(_0x2c7ea2)return new FailReporter({'failMessage':'Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed'});return this[_0x439e3e(0x303)][_0x439e3e(0x1c5)]('Checking\x20manual\x20changes\x20completed'),this['logger'][_0x439e3e(0x1c5)](_0x439e3e(0x234)),await this[_0x439e3e(0x208)](),this[_0x439e3e(0x303)][_0x439e3e(0x1c5)](_0x439e3e(0x335)),new CheckoutReporter({'currentBranch':{'id':this[_0x439e3e(0x1cd)]['id'],'name':this['targetBranch'][_0x439e3e(0x24f)],'headCommitId':this[_0x439e3e(0x1cd)][_0x439e3e(0x278)]},'changes':this[_0x439e3e(0x275)]});}async[a0_0x216d83(0x265)](){const _0x2f7e59=a0_0x216d83,_0x4597d5=await this[_0x2f7e59(0x256)][_0x2f7e59(0x279)]();return!!_0x4597d5[_0x2f7e59(0x200)];}async['retrieveDifference'](){const _0x2004ab=a0_0x216d83,{devopsUrl:_0x5a8440,accessToken:_0x805465}=this[_0x2004ab(0x253)],_0x526d6d=await this[_0x2004ab(0x256)][_0x2004ab(0x1bd)]({'devopsUrl':_0x5a8440,'accessToken':_0x805465,'targetBranchId':this[_0x2004ab(0x1cd)]['id'],'targetCommitId':this['targetBranch'][_0x2004ab(0x278)]});for(const {id:_0x5c6b67,name:_0x48e8f9,type:_0x31a8c6,changeType:_0x592b81}of _0x526d6d){if(!_0x5c6b67){if(_0x592b81!==ChangeType[_0x2004ab(0x2f8)])throw new Error('Component\x20id\x20not\x20found\x20after\x20comparison');await this[_0x2004ab(0x256)]['saveComponent']({'name':_0x48e8f9,'type':_0x31a8c6,'changeType':_0x592b81}),this[_0x2004ab(0x275)][_0x2004ab(0x212)]({'changeType':_0x592b81,'name':_0x48e8f9,'type':_0x31a8c6});continue;}const _0x55d2c8=await ApiService['retrieveComponentById']({'devopsUrl':_0x5a8440,'accessToken':_0x805465,'componentId':_0x5c6b67});if(!_0x55d2c8['fHash'])throw new Error(_0x2004ab(0x2b9)+_0x55d2c8['name']+'\x22\x20of\x20type\x20\x22'+_0x55d2c8[_0x2004ab(0x30f)]+'\x22\x20not\x20found');await this[_0x2004ab(0x256)][_0x2004ab(0x2b8)]({'name':_0x48e8f9,'type':_0x31a8c6,'changeType':_0x592b81,'component':{..._0x55d2c8,'fHash':_0x55d2c8[_0x2004ab(0x257)]}}),this[_0x2004ab(0x275)]['push']({'changeType':_0x592b81,'name':_0x48e8f9,'type':_0x31a8c6,'paths':_0x55d2c8[_0x2004ab(0x1c1)][_0x2004ab(0x1d8)](_0x57d072=>_0x57d072[_0x2004ab(0x1f6)])});}this[_0x2004ab(0x256)]['saveBranchState'](this[_0x2004ab(0x1cd)]);}}class TargetBranchNotFoundHandler extends BaseHandler{[a0_0x216d83(0x2bf)];[a0_0x216d83(0x256)];[a0_0x216d83(0x253)];[a0_0x216d83(0x308)];['logger'];constructor(_0x21477d){const _0x663cee=a0_0x216d83;super(),this[_0x663cee(0x2bf)]=_0x21477d[_0x663cee(0x2bf)],this[_0x663cee(0x256)]=_0x21477d[_0x663cee(0x256)],this[_0x663cee(0x253)]=_0x21477d[_0x663cee(0x253)],this[_0x663cee(0x308)]=_0x21477d[_0x663cee(0x308)],this[_0x663cee(0x303)]=_0x21477d[_0x663cee(0x303)];}async[a0_0x216d83(0x32e)](){const _0x59e832=a0_0x216d83;this[_0x59e832(0x303)][_0x59e832(0x1c5)](_0x59e832(0x2a9));const {id:_0x2ad6b6}=await this[_0x59e832(0x256)][_0x59e832(0x2ef)](this[_0x59e832(0x2bf)]);if(!_0x2ad6b6)return new FailReporter({'failMessage':'To\x20create\x20a\x20new\x20branch\x20a\x20branch\x20should\x20be\x20selected.\x20Checkout\x20on\x20any\x20existing\x20branch'});const _0x60c267=await ApiService[_0x59e832(0x216)]({'accessToken':this[_0x59e832(0x253)]['accessToken'],'devopsUrl':this['credentials']['devopsUrl'],'name':this[_0x59e832(0x308)],'parentId':_0x2ad6b6});return this['manager'][_0x59e832(0x2d5)](_0x60c267),this[_0x59e832(0x256)][_0x59e832(0x204)](![]),this[_0x59e832(0x303)][_0x59e832(0x1c5)](_0x59e832(0x33d)),new CheckoutReporter({'currentBranch':_0x60c267,'changes':[]});}}class HandlerFactory{static[a0_0x216d83(0x263)](_0x4235ac){const _0x440e7a=a0_0x216d83;if(_0x4235ac[_0x440e7a(0x1cd)])return new TargetBranchExistHandler({..._0x4235ac,'targetBranch':_0x4235ac[_0x440e7a(0x1cd)]});if(!_0x4235ac[_0x440e7a(0x1cd)])return new TargetBranchNotFoundHandler(_0x4235ac);throw new Error(_0x440e7a(0x340));}}class CheckoutCommand extends BaseCommand{['commandName']=a0_0x216d83(0x236);['description']=a0_0x216d83(0x24a);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':'-b,\x20--branch\x20<string>','description':a0_0x216d83(0x25c)},{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];['projectPath']=process['cwd']();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async[a0_0x216d83(0x31a)]([{branch:_0x309286}]){const _0x459ddc=a0_0x216d83,_0x4ad3ce=await this[_0x459ddc(0x2a2)](_0x309286);this[_0x459ddc(0x303)]['info'](_0x459ddc(0x20b)+_0x4ad3ce+_0x459ddc(0x1e4));const _0x5c460f=await this[_0x459ddc(0x256)][_0x459ddc(0x32f)](this['projectPath']);if(!_0x5c460f)return this[_0x459ddc(0x303)]['warn']('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':_0x459ddc(0x328)});const _0x4993d0=await this['getCredentialsAlias'](),_0x5b65d4=await ApiService[_0x459ddc(0x2cc)](_0x4993d0);await this['manager'][_0x459ddc(0x32b)](this[_0x459ddc(0x2bf)]);try{const _0x2ca0ee=await ApiService['getBranch']({'devopsUrl':_0x5b65d4[_0x459ddc(0x1f0)],'accessToken':_0x5b65d4['accessToken'],'branchName':_0x4ad3ce}),_0x4cf20a=HandlerFactory['create']({'projectPath':this[_0x459ddc(0x2bf)],'manager':this[_0x459ddc(0x256)],'credentials':_0x5b65d4,'targetBranch':_0x2ca0ee,'targetBranchName':_0x4ad3ce,'logger':this[_0x459ddc(0x303)]}),_0x3eefc9=await _0x4cf20a[_0x459ddc(0x32e)]();return _0x3eefc9[_0x459ddc(0x1ba)]?(await this[_0x459ddc(0x256)][_0x459ddc(0x1f7)](),this[_0x459ddc(0x303)]['info'](_0x459ddc(0x20b)+_0x4ad3ce+_0x459ddc(0x2f4))):await this[_0x459ddc(0x256)][_0x459ddc(0x32a)](),_0x3eefc9;}catch(_0x53a10f){await this[_0x459ddc(0x256)][_0x459ddc(0x32a)]();throw _0x53a10f;}}[a0_0x216d83(0x231)]([{json:_0x1a68f2}]){return _0x1a68f2;}async[a0_0x216d83(0x2a2)](_0x5e6c66){if(_0x5e6c66)return _0x5e6c66;return ReadlineUtils['askString']('Enter\x20a\x20branch\x20name:\x20');}async[a0_0x216d83(0x1fa)](){const _0x4a9a62=a0_0x216d83,{credentialsAlias:_0x680a7f}=await this[_0x4a9a62(0x256)][_0x4a9a62(0x2fa)](this[_0x4a9a62(0x2bf)]);if(!_0x680a7f)throw new Error('Credentials\x20alias\x20is\x20not\x20configured');if(typeof _0x680a7f!==_0x4a9a62(0x27f))throw new Error('Invalid\x20credentials\x20type');return _0x680a7f;}}class CloneReporter extends BaseReporter{[a0_0x216d83(0x2bf)];[a0_0x216d83(0x2b4)];constructor({projectPath:_0x38f597,components:_0x60112b}){const _0x54eaa1=a0_0x216d83;super({'success':!![]}),this[_0x54eaa1(0x2bf)]=_0x38f597,this['components']=_0x60112b;}[a0_0x216d83(0x305)](){const _0x4dc84f=a0_0x216d83;return{'success':this[_0x4dc84f(0x1ba)],'projectPath':this['projectPath'],'components':this[_0x4dc84f(0x2b4)]};}[a0_0x216d83(0x31d)](_0x53861b){const _0x4b728b=a0_0x216d83;console[_0x4b728b(0x2a8)]('Init\x20Result:');const _0x41a4a8=[[_0x4b728b(0x1c3)],[_0x53861b[_0x4b728b(0x2bf)]]];console[_0x4b728b(0x2a8)](table['table'](_0x41a4a8,{'columns':[{'width':0x28}]})),console[_0x4b728b(0x2a8)](_0x4b728b(0x1f4));const _0x51932f=[[_0x4b728b(0x2b0),_0x4b728b(0x1bc),_0x4b728b(0x341)]];for(const {name:_0x481ed5,type:_0xf0f33e,paths:_0xad4ab9}of _0x53861b[_0x4b728b(0x2b4)]){_0x51932f[_0x4b728b(0x212)]([_0x481ed5,_0xf0f33e,_0xad4ab9[_0x4b728b(0x1e5)]('\x0a')]);}console[_0x4b728b(0x2a8)](table[_0x4b728b(0x242)](_0x51932f,{'columns':[{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CloneCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x1d9);[a0_0x216d83(0x258)]='Initialize\x20salesforce\x20project\x20and\x20retrieve\x20\x22main\x22\x20branch\x20from\x20registered\x20devops\x20tenant.';[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x23d),'description':'A\x20name\x20of\x20a\x20folder\x20where\x20a\x20project\x20will\x20be\x20stored.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.'},{'flags':a0_0x216d83(0x296),'description':a0_0x216d83(0x244),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':'--json','description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];['manager']=ProjectManager['getInstance']();['retrievedComponents']=[];['_credentials'];get['credentials'](){const _0x8398c0=a0_0x216d83;if(!this[_0x8398c0(0x1b3)])throw new Error(_0x8398c0(0x323));return this[_0x8398c0(0x1b3)];}async['execute']([_0x347d46]){const _0x38566d=a0_0x216d83;this[_0x38566d(0x303)]['info'](_0x38566d(0x1de)),this['_credentials']=await ApiService[_0x38566d(0x2cc)](_0x347d46['alias']);const _0x34525b=await this[_0x38566d(0x2d6)](_0x347d46[_0x38566d(0x24f)]);this[_0x38566d(0x303)][_0x38566d(0x1c5)](_0x38566d(0x2af));const _0x11962c=await this[_0x38566d(0x256)][_0x38566d(0x32f)](_0x34525b);if(_0x11962c)return this['logger'][_0x38566d(0x2bd)](_0x38566d(0x29d)),new FailReporter({'failMessage':'Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.'});await this['manager'][_0x38566d(0x32b)](_0x34525b);try{return await this[_0x38566d(0x256)][_0x38566d(0x326)]({'config':{'credentialsAlias':_0x347d46['alias']}}),this[_0x38566d(0x303)]['info'](_0x38566d(0x260)),await this[_0x38566d(0x306)](),await this[_0x38566d(0x256)][_0x38566d(0x1f7)](),this['logger'][_0x38566d(0x1c5)](_0x38566d(0x324)),new CloneReporter({'projectPath':_0x34525b,'components':this[_0x38566d(0x1ea)]});}catch(_0x45cd61){await this[_0x38566d(0x256)]['abortStage']();throw _0x45cd61;}}[a0_0x216d83(0x231)]([{json:_0x50e4c1}]){return _0x50e4c1;}async['retrieve'](){const _0x385d45=a0_0x216d83;this[_0x385d45(0x303)][_0x385d45(0x1c5)](_0x385d45(0x234));const {accessToken:_0x550201,devopsUrl:_0x82d75}=this[_0x385d45(0x253)],_0x2de2dd=await ApiService[_0x385d45(0x1be)]({'devopsUrl':_0x82d75,'accessToken':_0x550201});this[_0x385d45(0x256)]['saveBranchState'](_0x2de2dd);for await(const _0x7ea521 of ApiService[_0x385d45(0x2f9)]({'devopsUrl':_0x82d75,'accessToken':_0x550201,'branchId':_0x2de2dd['id'],'commitId':_0x2de2dd[_0x385d45(0x278)]})){if(!_0x7ea521[_0x385d45(0x257)])throw new Error(_0x7ea521[_0x385d45(0x24f)]+_0x385d45(0x1b1)+_0x7ea521[_0x385d45(0x30f)]+_0x385d45(0x2e2));await this['manager'][_0x385d45(0x2b8)]({'name':_0x7ea521['name'],'type':_0x7ea521[_0x385d45(0x30f)],'changeType':ChangeType[_0x385d45(0x1bf)],'component':{..._0x7ea521,'fHash':_0x7ea521[_0x385d45(0x257)]}}),this[_0x385d45(0x1ea)]['push']({'name':_0x7ea521[_0x385d45(0x24f)],'type':_0x7ea521[_0x385d45(0x30f)],'paths':_0x7ea521['files']['map'](_0x9bb436=>_0x9bb436['path'])});}this[_0x385d45(0x303)][_0x385d45(0x1c5)](_0x385d45(0x335));}async['buildProjectPath'](_0x542b7f){const _0x8e8c8f=a0_0x216d83;if(_0x542b7f)return node_path[_0x8e8c8f(0x1e5)](process['cwd'](),_0x542b7f);const _0x6e6a3a=await ReadlineUtils[_0x8e8c8f(0x299)](_0x8e8c8f(0x1d3));return node_path[_0x8e8c8f(0x1e5)](process[_0x8e8c8f(0x25f)](),_0x6e6a3a);}}class CommitReporter extends BaseReporter{[a0_0x216d83(0x1f2)];constructor({changes:_0x3ae09a}){const _0x5981cd=a0_0x216d83;super({'success':!![]}),this[_0x5981cd(0x1f2)]=_0x3ae09a;}[a0_0x216d83(0x305)](){const _0x4dc18e=a0_0x216d83;return{'success':this[_0x4dc18e(0x1ba)],'changes':this[_0x4dc18e(0x1f2)]};}[a0_0x216d83(0x31d)](_0x47c14c){const _0x4f3aac=a0_0x216d83;console['log'](_0x4f3aac(0x255));const _0xdc8fcb=[[_0x4f3aac(0x314),_0x4f3aac(0x2b0),_0x4f3aac(0x1bc),'Files']];for(const {changeType:_0x10f9e9,name:_0x479139,type:_0x4d7607,paths:_0xfa473c}of _0x47c14c['changes']){_0xdc8fcb['push']([_0x10f9e9,_0x479139,_0x4d7607,_0xfa473c?.[_0x4f3aac(0x1e5)]('\x0a')||'']);}console[_0x4f3aac(0x2a8)](table['table'](_0xdc8fcb,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CommitCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x2ab);['description']=a0_0x216d83(0x201);['arguments']=[];[a0_0x216d83(0x1ed)]=[{'flags':'-m,\x20--message\x20<string>','description':a0_0x216d83(0x271)},{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();[a0_0x216d83(0x275)]=[];['_credentials'];[a0_0x216d83(0x213)];[a0_0x216d83(0x30b)];[a0_0x216d83(0x2e3)];get[a0_0x216d83(0x253)](){const _0x788553=a0_0x216d83;if(!this[_0x788553(0x1b3)])throw new Error(_0x788553(0x323));return this[_0x788553(0x1b3)];}get[a0_0x216d83(0x343)](){const _0x3034d9=a0_0x216d83;if(!this['_branchId'])throw new Error(_0x3034d9(0x1f1));return this[_0x3034d9(0x213)];}get[a0_0x216d83(0x31f)](){const _0x5daa20=a0_0x216d83;if(!this[_0x5daa20(0x30b)])throw new Error(_0x5daa20(0x2ce));return this[_0x5daa20(0x30b)];}get[a0_0x216d83(0x1f2)](){const _0xd2e8b3=a0_0x216d83;if(!this[_0xd2e8b3(0x2e3)])throw new Error(_0xd2e8b3(0x2c8));return this['_changes'];}async[a0_0x216d83(0x31a)]([_0x23ed6a]){const _0x412f8b=a0_0x216d83;this['logger'][_0x412f8b(0x1c5)](_0x412f8b(0x21d));const _0x32dc23=await this[_0x412f8b(0x256)][_0x412f8b(0x32f)](this[_0x412f8b(0x2bf)]);if(!_0x32dc23)return this['logger'][_0x412f8b(0x2bd)](_0x412f8b(0x328)),new FailReporter({'failMessage':_0x412f8b(0x328)});const _0x13e8b0=await this[_0x412f8b(0x1cc)](_0x23ed6a[_0x412f8b(0x300)]);await this[_0x412f8b(0x329)](),await this[_0x412f8b(0x2cc)]();const _0x18eb1a=await this['areRemoteChanges']();if(_0x18eb1a)return this[_0x412f8b(0x303)]['warn'](_0x412f8b(0x315)),new FailReporter({'failMessage':_0x412f8b(0x315)});await this[_0x412f8b(0x256)]['initStage'](this['projectPath']);try{this[_0x412f8b(0x2e3)]=await this[_0x412f8b(0x256)][_0x412f8b(0x279)]();if(!this[_0x412f8b(0x1f2)][_0x412f8b(0x200)])return this[_0x412f8b(0x303)][_0x412f8b(0x2bd)](_0x412f8b(0x339)),new FailReporter({'failMessage':_0x412f8b(0x339)});return await this[_0x412f8b(0x332)](_0x13e8b0),await this[_0x412f8b(0x256)]['applyStage'](),this[_0x412f8b(0x303)][_0x412f8b(0x1c5)]('Commit\x20completed'),new CommitReporter({'changes':this[_0x412f8b(0x275)]});}catch(_0x3198ac){await this[_0x412f8b(0x256)][_0x412f8b(0x32a)]();throw _0x3198ac;}}[a0_0x216d83(0x231)]([{json:_0x29fa52}]){return _0x29fa52;}async['getMessage'](_0x5a1e41){const _0x208b6f=a0_0x216d83;if(_0x5a1e41)return _0x5a1e41;const _0x4a2027=await ReadlineUtils[_0x208b6f(0x299)](_0x208b6f(0x251));return _0x4a2027;}async[a0_0x216d83(0x2cc)](){const _0x502851=a0_0x216d83,{credentialsAlias:_0x4361b3}=await this['manager']['readConfig'](this[_0x502851(0x2bf)]);if(!_0x4361b3)throw new Error('Credentials\x20alias\x20is\x20not\x20configured');if(typeof _0x4361b3!=='string')throw new Error('Invalid\x20credentials\x20type');this['_credentials']=await ApiService['getCredentials'](_0x4361b3);}async[a0_0x216d83(0x329)](){const _0x4fb6bc=a0_0x216d83,{id:_0x1c66b1,headCommitId:_0x363440}=await this[_0x4fb6bc(0x256)]['readBranchState'](this['projectPath']);this[_0x4fb6bc(0x213)]=_0x1c66b1||void 0x0,this[_0x4fb6bc(0x30b)]=_0x363440||void 0x0;}async['areRemoteChanges'](){const _0xa0edef=a0_0x216d83,{headCommitId:_0x11d5f7}=await ApiService['getBranchById']({'accessToken':this['credentials'][_0xa0edef(0x1db)],'devopsUrl':this[_0xa0edef(0x253)][_0xa0edef(0x1f0)],'branchId':this[_0xa0edef(0x343)]});return this['localHeadCommit']!==_0x11d5f7;}async['findAndCommitChanges'](_0xcec274){const _0x4bef49=a0_0x216d83;this['logger']['info'](_0x4bef49(0x22c));const _0x3ccf3b=await ApiService[_0x4bef49(0x1f5)]({'accessToken':this['credentials'][_0x4bef49(0x1db)],'devopsUrl':this['credentials']['devopsUrl']}),_0x48a254={'accessToken':this[_0x4bef49(0x253)][_0x4bef49(0x1db)],'devopsUrl':this['credentials']['devopsUrl'],'message':_0xcec274,'branchId':this[_0x4bef49(0x343)],'components':[],'userName':_0x3ccf3b[_0x4bef49(0x286)]+'\x20'+_0x3ccf3b[_0x4bef49(0x2e1)]};for(const _0x160d30 of this[_0x4bef49(0x1f2)]){const _0x2743a3=await this[_0x4bef49(0x256)][_0x4bef49(0x1b9)](_0x160d30),_0x1556ea=_0x2743a3['changeType']===ChangeType['CREATE']?_0x2743a3[_0x4bef49(0x24f)]:void 0x0,_0x29ee48=this['convertToLocalComponent'](_0x2743a3[_0x4bef49(0x24f)],_0x1556ea,_0x2743a3['type'],_0x2743a3?.[_0x4bef49(0x298)]||[]);_0x48a254[_0x4bef49(0x2b4)]['push'](_0x29ee48),this[_0x4bef49(0x275)][_0x4bef49(0x212)](_0x2743a3);}this[_0x4bef49(0x303)]['info']('Detecting\x20changes\x20completed.\x20'+this['changes'][_0x4bef49(0x200)]+_0x4bef49(0x1e8)),await ApiService['commit'](_0x48a254);const _0x3057d9=await ApiService[_0x4bef49(0x2d4)]({'accessToken':this[_0x4bef49(0x253)][_0x4bef49(0x1db)],'devopsUrl':this[_0x4bef49(0x253)][_0x4bef49(0x1f0)],'branchId':this['branchId']});this[_0x4bef49(0x256)][_0x4bef49(0x2d5)](_0x3057d9);}[a0_0x216d83(0x28f)](_0x15d30f,_0x126998,_0x41a0f9,_0x306b1c){const _0x31e2e4=a0_0x216d83,_0x53c231={'name':_0x15d30f,'label':_0x126998,'type':_0x41a0f9,'files':[]};for(const _0x1e20d6 of _0x306b1c){const _0x3745cd=_0x1e20d6[_0x31e2e4(0x214)](path[_0x31e2e4(0x1d5)])[_0x31e2e4(0x241)](0x3)[_0x31e2e4(0x1e5)]('/'),_0x11f2c6=path[_0x31e2e4(0x1e5)](this[_0x31e2e4(0x2bf)],_0x1e20d6);_0x53c231[_0x31e2e4(0x1c1)][_0x31e2e4(0x212)]({'path':_0x3745cd,'localPath':_0x11f2c6});}return _0x53c231;}}class ConfigSetReporter extends BaseReporter{[a0_0x216d83(0x25d)];[a0_0x216d83(0x273)];constructor({configName:_0x50409d,value:_0x48240a}){const _0xf91692=a0_0x216d83;super({'success':!![]}),this[_0xf91692(0x25d)]=_0x50409d,this[_0xf91692(0x273)]=_0x48240a;}[a0_0x216d83(0x305)](){const _0x489ca5=a0_0x216d83;return{'success':this[_0x489ca5(0x1ba)],'configName':this[_0x489ca5(0x25d)],'value':this[_0x489ca5(0x273)]};}[a0_0x216d83(0x31d)](_0x510797){const _0x170e29=a0_0x216d83,_0xe3bf0e=[['Config\x20Name','Value'],[_0x510797['configName'],_0x510797[_0x170e29(0x273)]]];console[_0x170e29(0x2a8)](table['table'](_0xe3bf0e));}}const ALLOWED_VALUES=[ConfigName[a0_0x216d83(0x2a6)]+'(string)'];class ConfigSetCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x2c9);[a0_0x216d83(0x258)]=a0_0x216d83(0x2cf);['arguments']=[{'name':a0_0x216d83(0x21c),'description':a0_0x216d83(0x215)+ALLOWED_VALUES['join'](',\x20')+'.'},{'name':a0_0x216d83(0x316),'description':'Config\x20value'}];['options']=[{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async['execute']([_0xd35398,_0x13a265]){const _0x1f762c=a0_0x216d83;this[_0x1f762c(0x303)][_0x1f762c(0x1c5)](_0x1f762c(0x2b6));const _0x2e4ff4=process['cwd'](),_0x20ca9a=await this['manager'][_0x1f762c(0x32f)](_0x2e4ff4);if(!_0x20ca9a)return this['logger'][_0x1f762c(0x2bd)]('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});await this['manager'][_0x1f762c(0x32b)](_0x2e4ff4);try{return await this['manager'][_0x1f762c(0x2da)](_0xd35398,_0x13a265),await this[_0x1f762c(0x256)][_0x1f762c(0x1f7)](),this[_0x1f762c(0x303)][_0x1f762c(0x1c5)](_0x1f762c(0x28b)),new ConfigSetReporter({'configName':_0xd35398,'value':_0x13a265});}catch(_0xcd82b6){await this[_0x1f762c(0x256)][_0x1f762c(0x32a)]();throw _0xcd82b6;}}[a0_0x216d83(0x231)]([,,{json:_0x2baca}]){return _0x2baca;}}class ConfigUnsetReporter extends BaseReporter{[a0_0x216d83(0x25d)];constructor(_0x2ade3e){const _0x3e9890=a0_0x216d83;super({'success':!![]}),this[_0x3e9890(0x25d)]=_0x2ade3e[_0x3e9890(0x25d)];}[a0_0x216d83(0x305)](){const _0x41c82e=a0_0x216d83;return{'success':!![],'configName':this[_0x41c82e(0x25d)],'value':null};}[a0_0x216d83(0x31d)](_0x27449f){const _0x8ed8a5=a0_0x216d83,_0xf59e9d=[[_0x8ed8a5(0x2c2),_0x8ed8a5(0x24b)],[_0x27449f[_0x8ed8a5(0x25d)],_0x27449f[_0x8ed8a5(0x273)]||_0x8ed8a5(0x337)]];console[_0x8ed8a5(0x2a8)](table['table'](_0xf59e9d));}}function a0_0x3826(_0x956c4,_0x52e9f4){const _0x34b2dd=a0_0x5404();return a0_0x3826=function(_0x25e96e,_0x3c45d3){_0x25e96e=_0x25e96e-0x1b1;let _0x5404a5=_0x34b2dd[_0x25e96e];return _0x5404a5;},a0_0x3826(_0x956c4,_0x52e9f4);}class ConfigUnset extends BaseCommand{[a0_0x216d83(0x1ee)]='config-unset';['description']=a0_0x216d83(0x26a);[a0_0x216d83(0x1b8)]=[{'name':a0_0x216d83(0x21c),'description':a0_0x216d83(0x215)+Object[a0_0x216d83(0x203)](ConfigName)[a0_0x216d83(0x1e5)](',\x20')+'.'}];[a0_0x216d83(0x1ed)]=[{'flags':'--json','description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async['execute']([_0x13a9f8]){const _0xc37e96=a0_0x216d83;this['logger'][_0xc37e96(0x1c5)](_0xc37e96(0x2b6));const _0x1f774a=await this[_0xc37e96(0x256)][_0xc37e96(0x32f)](this['projectPath']);if(!_0x1f774a)return this[_0xc37e96(0x303)]['warn'](_0xc37e96(0x328)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});await this[_0xc37e96(0x256)][_0xc37e96(0x32b)](this[_0xc37e96(0x2bf)]);try{return await this[_0xc37e96(0x256)][_0xc37e96(0x344)](_0x13a9f8),await this[_0xc37e96(0x256)][_0xc37e96(0x1f7)](),this[_0xc37e96(0x303)][_0xc37e96(0x1c5)](_0xc37e96(0x28b)),new ConfigUnsetReporter({'configName':_0x13a9f8});}catch(_0x4e9cb6){await this[_0xc37e96(0x256)][_0xc37e96(0x32a)]();throw _0x4e9cb6;}}['isJson']([,{json:_0x274fef}]){return _0x274fef;}}class InitReporter extends BaseReporter{[a0_0x216d83(0x2bf)];constructor({projectPath:_0x3d8fec}){const _0x15e1dc=a0_0x216d83;super({'success':!![]}),this[_0x15e1dc(0x2bf)]=_0x3d8fec;}['buildReport'](){const _0x1a9640=a0_0x216d83;return{'success':this[_0x1a9640(0x1ba)],'projectPath':this[_0x1a9640(0x2bf)]};}[a0_0x216d83(0x31d)](_0x1146b0){const _0x109581=a0_0x216d83,_0x2ea836=[[_0x109581(0x1c3)],[_0x1146b0['projectPath']]];console[_0x109581(0x2a8)](table[_0x109581(0x242)](_0x2ea836,{'columns':[{'width':0x28}]}));}}class InitCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x218);[a0_0x216d83(0x258)]=a0_0x216d83(0x1c8);[a0_0x216d83(0x1b8)]=[];['options']=[{'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_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async[a0_0x216d83(0x31a)]([_0x137ba8]){const _0x4c9d6b=a0_0x216d83;this['logger'][_0x4c9d6b(0x1c5)](_0x4c9d6b(0x2af));const _0x3d3f7c=await this['buildProjectPath'](_0x137ba8[_0x4c9d6b(0x24f)]),_0x19cee1=await this[_0x4c9d6b(0x256)][_0x4c9d6b(0x32f)](_0x3d3f7c);if(_0x19cee1)return this['logger'][_0x4c9d6b(0x2bd)](_0x4c9d6b(0x29d)),new FailReporter({'failMessage':'Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.'});await this[_0x4c9d6b(0x256)][_0x4c9d6b(0x32b)](_0x3d3f7c);try{return await this[_0x4c9d6b(0x256)]['initProject']({}),await this['manager'][_0x4c9d6b(0x1f7)](),this['logger'][_0x4c9d6b(0x1c5)](_0x4c9d6b(0x260)),new InitReporter({'projectPath':_0x3d3f7c});}catch(_0x25b51c){await this['manager'][_0x4c9d6b(0x32a)]();throw _0x25b51c;}}['isJson']([{json:_0x374578}]){return _0x374578;}async['buildProjectPath'](_0x5e19f1){const _0x1a5011=a0_0x216d83;if(_0x5e19f1)return node_path[_0x1a5011(0x1e5)](process[_0x1a5011(0x25f)](),_0x5e19f1);const _0x316dad=await ReadlineUtils[_0x1a5011(0x299)]('Enter\x20project\x20name:\x20');return node_path[_0x1a5011(0x1e5)](process[_0x1a5011(0x25f)](),_0x316dad);}}class ListBranchesReporter extends BaseReporter{[a0_0x216d83(0x312)];constructor(_0x11c243){const _0x3f9f25=a0_0x216d83;super({'success':!![]}),this[_0x3f9f25(0x312)]=_0x11c243[_0x3f9f25(0x312)];}[a0_0x216d83(0x305)](){const _0x2bf476=a0_0x216d83;return{'success':this[_0x2bf476(0x1ba)],'branches':this['branches']};}['print'](_0x5d8590){const _0x3c53f3=a0_0x216d83,_0x209bd9=[[_0x3c53f3(0x2e6)]];for(const _0x440310 of _0x5d8590[_0x3c53f3(0x312)]){_0x209bd9['push']([_0x440310]);}console[_0x3c53f3(0x2a8)](table[_0x3c53f3(0x242)](_0x209bd9,{'columns':[{'width':0x1e}]}));}}class ListBranchesCommand extends BaseCommand{[a0_0x216d83(0x1ee)]='list-branches';[a0_0x216d83(0x258)]='List\x20all\x20remote\x20branches.';[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager['getInstance']();async[a0_0x216d83(0x31a)](){const _0x4f308e=a0_0x216d83;this[_0x4f308e(0x303)][_0x4f308e(0x1c5)](_0x4f308e(0x239));const _0x4c0665=await this[_0x4f308e(0x256)][_0x4f308e(0x32f)](this['projectPath']);if(!_0x4c0665)return this[_0x4f308e(0x303)]['warn'](_0x4f308e(0x328)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0xdedb2d=await this[_0x4f308e(0x1fa)](),{accessToken:_0x51c5e4,devopsUrl:_0x40bab4}=await ApiService[_0x4f308e(0x2cc)](_0xdedb2d),_0x496aff=await ApiService[_0x4f308e(0x1d4)]({'accessToken':_0x51c5e4,'devopsUrl':_0x40bab4});return this['logger'][_0x4f308e(0x1c5)]('Listing\x20remote\x20branches\x20completed'),new ListBranchesReporter({'branches':_0x496aff[_0x4f308e(0x1d8)](_0x1de642=>_0x1de642[_0x4f308e(0x24f)])});}[a0_0x216d83(0x231)]([{json:_0x268be9}]){return _0x268be9;}async['getCredentialsAlias'](){const _0x33bc9c=a0_0x216d83,{credentialsAlias:_0x322014}=await this[_0x33bc9c(0x256)][_0x33bc9c(0x2fa)](this[_0x33bc9c(0x2bf)]);if(!_0x322014)throw new Error(_0x33bc9c(0x31e));if(typeof _0x322014!==_0x33bc9c(0x27f))throw new Error(_0x33bc9c(0x2ec));return _0x322014;}}class ListCredentialsReporter extends BaseReporter{[a0_0x216d83(0x253)];constructor(_0x40450d){const _0xd7300f=a0_0x216d83;super({'success':!![]}),this[_0xd7300f(0x253)]=_0x40450d[_0xd7300f(0x253)];}['buildReport'](){const _0xae387a=a0_0x216d83;return{'success':this[_0xae387a(0x1ba)],'credentials':this[_0xae387a(0x253)]};}['print'](_0x1759ea){const _0x2a9707=a0_0x216d83,_0x349348=[[_0x2a9707(0x327),'Global\x20Settings\x20Url',_0x2a9707(0x1ca)]];for(const {alias:_0x1b1e56,globalSettingsUrl:_0x33380c,devopsUrl:_0x44a342}of _0x1759ea['credentials']){_0x349348['push']([_0x1b1e56,_0x33380c,_0x44a342||_0x2a9707(0x276)]);}console[_0x2a9707(0x2a8)](table[_0x2a9707(0x242)](_0x349348));}}class ListCredentialsCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x22e);[a0_0x216d83(0x258)]=a0_0x216d83(0x21b);[a0_0x216d83(0x1b8)]=[];['options']=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];async[a0_0x216d83(0x31a)](){const _0x5814cc=a0_0x216d83;this['logger'][_0x5814cc(0x1c5)](_0x5814cc(0x254));const _0xc50d2b=await CredentialsManager['list']();return this[_0x5814cc(0x303)][_0x5814cc(0x1c5)](_0x5814cc(0x238)),new ListCredentialsReporter({'credentials':_0xc50d2b[_0x5814cc(0x1d8)](({alias:_0x374abb,globalSettingsUrl:_0x5af898,devopsUrl:_0x245add})=>({'alias':_0x374abb,'globalSettingsUrl':_0x5af898,'devopsUrl':_0x245add}))});}[a0_0x216d83(0x231)]([{json:_0x715d29}]){return _0x715d29;}}const TOKEN_PREFIX='fk_';class LoginAction{constructor(_0x2ab2f2){this['accessToken']=_0x2ab2f2;}async[a0_0x216d83(0x31a)](){const _0x175241=a0_0x216d83;try{const _0x3035a7=this['accessToken']['split'](TOKEN_PREFIX)[0x1],_0x3f1643=JSON[_0x175241(0x304)](Buffer[_0x175241(0x267)](_0x3035a7,_0x175241(0x1f9))[_0x175241(0x249)](_0x175241(0x2a4))),_0x12b80a=await axios[_0x175241(0x2e5)](_0x175241(0x282),{'headers':{'authorization':''+this[_0x175241(0x1db)]},'baseURL':_0x3f1643[_0x175241(0x2ee)]})[_0x175241(0x311)](({data:_0xb2aef3})=>new Map(_0xb2aef3[_0x175241(0x1d8)](_0x156139=>[_0x156139[_0x175241(0x24f)],_0x156139[_0x175241(0x2cd)]]))),_0x5dbd9e={'globalSettingsUrl':_0x3f1643[_0x175241(0x2ee)]};for(const [_0x2906bb,_0x303d9e]of _0x12b80a[_0x175241(0x2aa)]()){_0x2906bb===_0x175241(0x1d0)&&(_0x5dbd9e['devopsUrl']=_0x303d9e);}return _0x5dbd9e;}catch(_0x49fc33){if(axios['isAxiosError'](_0x49fc33))throw Error(_0x49fc33[_0x175241(0x227)]?.[_0x175241(0x307)][_0x175241(0x300)]||_0x49fc33[_0x175241(0x227)]?.[_0x175241(0x28c)]||_0x49fc33[_0x175241(0x300)],{'cause':_0x49fc33});throw _0x49fc33;}}}class GlobalSettingsService{static async['login']({accessToken:_0x4a415d}){const _0x4462b9=a0_0x216d83,_0xe83d63=new LoginAction(_0x4a415d);return _0xe83d63[_0x4462b9(0x31a)]();}}class LoginReporter extends BaseReporter{[a0_0x216d83(0x27e)];[a0_0x216d83(0x294)];[a0_0x216d83(0x1f0)];constructor({alias:_0x5c5dd9,globalSettingsUrl:_0x5aa501,devopsUrl:_0x4ca812}){const _0x97783a=a0_0x216d83;super({'success':!![]}),this[_0x97783a(0x27e)]=_0x5c5dd9,this[_0x97783a(0x294)]=_0x5aa501,this['devopsUrl']=_0x4ca812;}[a0_0x216d83(0x305)](){const _0x488aa1=a0_0x216d83;return{'success':this['success'],'alias':this[_0x488aa1(0x27e)],'globalSettingsUrl':this['globalSettingsUrl'],'devopsUrl':this['devopsUrl']};}[a0_0x216d83(0x31d)](_0x40362c){const _0xb558b4=a0_0x216d83,_0x3bcf53=[['Alias',_0xb558b4(0x2b3),_0xb558b4(0x1ca)],[_0x40362c[_0xb558b4(0x27e)],_0x40362c[_0xb558b4(0x294)],_0x40362c[_0xb558b4(0x1f0)]||_0xb558b4(0x276)]];console[_0xb558b4(0x2a8)](table[_0xb558b4(0x242)](_0x3bcf53));}}class LoginCommand extends BaseCommand{['commandName']=a0_0x216d83(0x26b);[a0_0x216d83(0x258)]=a0_0x216d83(0x1c9);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':'-a,\x20--alias\x20<string>','description':a0_0x216d83(0x1fb),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x216d83(0x2d0),'description':a0_0x216d83(0x29b)+ROOT_NAME+'\x20services.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.'},{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];async['execute']([_0x51ba89]){const _0x7581bc=a0_0x216d83;this[_0x7581bc(0x303)][_0x7581bc(0x1c5)](_0x7581bc(0x217));const _0xb99166=await this[_0x7581bc(0x1ce)](_0x51ba89['token']),_0x11dce6=await GlobalSettingsService[_0x7581bc(0x26b)]({'accessToken':_0xb99166});return await CredentialsManager[_0x7581bc(0x29c)]({'alias':_0x51ba89['alias'],'accessToken':_0xb99166,'globalSettingsUrl':_0x11dce6[_0x7581bc(0x294)],'devopsUrl':_0x11dce6[_0x7581bc(0x1f0)]}),this['logger'][_0x7581bc(0x1c5)](_0x7581bc(0x30c)+_0x51ba89[_0x7581bc(0x27e)]+'\x22'),new LoginReporter({'alias':_0x51ba89[_0x7581bc(0x27e)],'globalSettingsUrl':_0x11dce6['globalSettingsUrl'],'devopsUrl':_0x11dce6['devopsUrl']});}[a0_0x216d83(0x231)]([{json:_0x27fc7e}]){return _0x27fc7e;}async[a0_0x216d83(0x1ce)](_0x3495d8){const _0x197adc=a0_0x216d83;if(_0x3495d8)return _0x3495d8;const _0x1760d4=await ReadlineUtils['askString'](_0x197adc(0x310));return _0x1760d4;}}const DELETED_STATUS=a0_0x216d83(0x33e);class LogoutReporter extends BaseReporter{[a0_0x216d83(0x27e)];constructor({alias:_0x1ce063}){super({'success':!![]}),this['alias']=_0x1ce063;}[a0_0x216d83(0x305)](){return{'success':this['success'],'alias':this['alias'],'status':DELETED_STATUS};}[a0_0x216d83(0x31d)](_0x20d1a2){const _0x5058eb=a0_0x216d83,_0xbb4ed4=[[_0x5058eb(0x327),_0x5058eb(0x33c)],[_0x20d1a2[_0x5058eb(0x27e)],_0x20d1a2[_0x5058eb(0x321)]]];console[_0x5058eb(0x2a8)](table['table'](_0xbb4ed4));}}class LogoutCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x27d);[a0_0x216d83(0x258)]=a0_0x216d83(0x21a);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':'-a,\x20--alias\x20<string>','description':a0_0x216d83(0x27a),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];async['execute']([_0x18afc5]){const _0x3524a4=a0_0x216d83;return this['logger'][_0x3524a4(0x1c5)](_0x3524a4(0x25b)),await CredentialsManager[_0x3524a4(0x1cf)]({'alias':_0x18afc5[_0x3524a4(0x27e)]}),this[_0x3524a4(0x303)][_0x3524a4(0x1c5)](_0x3524a4(0x1ff)),new LogoutReporter({'alias':_0x18afc5[_0x3524a4(0x27e)]});}[a0_0x216d83(0x231)]([{json:_0x1d6376}]){return _0x1d6376;}}class PullReporter extends BaseReporter{[a0_0x216d83(0x1f2)];constructor({changes:_0x14a127}){const _0x35d540=a0_0x216d83;super({'success':!![]}),this[_0x35d540(0x1f2)]=_0x14a127;}['buildReport'](){const _0x5bb244=a0_0x216d83;return{'success':this[_0x5bb244(0x1ba)],'changes':this['changes']};}['print'](_0x511f53){const _0x31bff8=a0_0x216d83;console[_0x31bff8(0x2a8)]('Component\x20Updates:');const _0x3caf79=[[_0x31bff8(0x314),_0x31bff8(0x2b0),'Type',_0x31bff8(0x341)]];for(const {changeType:_0x1fbfda,name:_0x563cdf,type:_0x2cd3b0,paths:_0xf96c06}of _0x511f53[_0x31bff8(0x1f2)]){_0x3caf79[_0x31bff8(0x212)]([_0x1fbfda,_0x563cdf,_0x2cd3b0,_0xf96c06?.['join']('\x0a')||'']);}console[_0x31bff8(0x2a8)](table[_0x31bff8(0x242)](_0x3caf79,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class PullCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x235);[a0_0x216d83(0x258)]='Pull\x20latest\x20branch\x20commit\x20from\x20devops.';[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];['projectPath']=process['cwd']();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();[a0_0x216d83(0x275)]=[];[a0_0x216d83(0x1b3)];get[a0_0x216d83(0x253)](){const _0x47f153=a0_0x216d83;if(!this['_credentials'])throw new Error('Credentials\x20not\x20found');return this[_0x47f153(0x1b3)];}async[a0_0x216d83(0x31a)](){const _0x46a2b9=a0_0x216d83;this['logger']['info']('Pulling\x20latest\x20updates\x20started');const _0x59d7f6=await this[_0x46a2b9(0x256)]['isInitialized'](this[_0x46a2b9(0x2bf)]);if(!_0x59d7f6)return this[_0x46a2b9(0x303)][_0x46a2b9(0x2bd)](_0x46a2b9(0x328)),new FailReporter({'failMessage':_0x46a2b9(0x328)});const _0x1286d0=await this['getCredentialsAlias']();this[_0x46a2b9(0x1b3)]=await ApiService[_0x46a2b9(0x2cc)](_0x1286d0);const {id:_0x4777bd,headCommitId:_0x3cd6cf}=await this[_0x46a2b9(0x256)][_0x46a2b9(0x2ef)](this[_0x46a2b9(0x2bf)]);if(!_0x4777bd)return this[_0x46a2b9(0x303)][_0x46a2b9(0x2bd)](_0x46a2b9(0x2f1)),new FailReporter({'failMessage':_0x46a2b9(0x2f1)});const _0x15aa60=await ApiService['getBranchById']({'accessToken':this[_0x46a2b9(0x253)][_0x46a2b9(0x1db)],'devopsUrl':this[_0x46a2b9(0x253)][_0x46a2b9(0x1f0)],'branchId':_0x4777bd});if(_0x3cd6cf===_0x15aa60[_0x46a2b9(0x278)])return new PullReporter({'changes':this[_0x46a2b9(0x275)]});await this[_0x46a2b9(0x256)][_0x46a2b9(0x32b)](this[_0x46a2b9(0x2bf)]);try{this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)](_0x46a2b9(0x261));const _0x44edb8=await this[_0x46a2b9(0x265)]();if(_0x44edb8)return this[_0x46a2b9(0x303)][_0x46a2b9(0x2bd)](_0x46a2b9(0x248)),await this[_0x46a2b9(0x256)][_0x46a2b9(0x32a)](),new FailReporter({'failMessage':_0x46a2b9(0x248)});return this['logger']['info'](_0x46a2b9(0x277)),this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)](_0x46a2b9(0x234)),await this['retrieveDifference'](_0x15aa60),this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)](_0x46a2b9(0x335)),await this[_0x46a2b9(0x256)]['applyStage'](),this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)]('Pulling\x20latest\x20updates\x20completed'),new PullReporter({'changes':this[_0x46a2b9(0x275)]});}catch(_0x2069f3){await this[_0x46a2b9(0x256)]['abortStage']();throw _0x2069f3;}}[a0_0x216d83(0x231)]([{json:_0x4a76e0}]){return _0x4a76e0;}async[a0_0x216d83(0x1fa)](){const _0x26df41=a0_0x216d83,{credentialsAlias:_0x119059}=await this[_0x26df41(0x256)][_0x26df41(0x2fa)](this[_0x26df41(0x2bf)]);if(!_0x119059)throw new Error(_0x26df41(0x31e));if(typeof _0x119059!==_0x26df41(0x27f))throw new Error(_0x26df41(0x2ec));return _0x119059;}async[a0_0x216d83(0x265)](){const _0x42175c=a0_0x216d83,_0x267b77=await this[_0x42175c(0x256)][_0x42175c(0x279)]();return!!_0x267b77[_0x42175c(0x200)];}async[a0_0x216d83(0x208)](_0x4f2fad){const _0x3e3c55=a0_0x216d83,{devopsUrl:_0x8bbdb2,accessToken:_0x285ae7}=this[_0x3e3c55(0x253)],_0x136be1=await this['manager'][_0x3e3c55(0x1bd)]({'devopsUrl':_0x8bbdb2,'accessToken':_0x285ae7,'targetBranchId':_0x4f2fad['id'],'targetCommitId':_0x4f2fad[_0x3e3c55(0x278)]});for(const {id:_0x2f2c52,name:_0x3728c6,type:_0x17b79f,changeType:_0x5d9595}of _0x136be1){if(!_0x2f2c52){if(_0x5d9595!==ChangeType[_0x3e3c55(0x2f8)])throw new Error(_0x3e3c55(0x333));await this[_0x3e3c55(0x256)][_0x3e3c55(0x2b8)]({'name':_0x3728c6,'type':_0x17b79f,'changeType':_0x5d9595}),this['componentChanges'][_0x3e3c55(0x212)]({'changeType':_0x5d9595,'name':_0x3728c6,'type':_0x17b79f});continue;}const _0x37468d=await ApiService[_0x3e3c55(0x274)]({'devopsUrl':_0x8bbdb2,'accessToken':_0x285ae7,'componentId':_0x2f2c52});if(!_0x37468d[_0x3e3c55(0x257)])throw new Error(_0x3e3c55(0x2b9)+_0x37468d[_0x3e3c55(0x24f)]+'\x22\x20of\x20type\x20\x22'+_0x37468d[_0x3e3c55(0x30f)]+_0x3e3c55(0x2f2));await this[_0x3e3c55(0x256)]['saveComponent']({'name':_0x3728c6,'type':_0x17b79f,'changeType':_0x5d9595,'component':{..._0x37468d,'fHash':_0x37468d[_0x3e3c55(0x257)]}}),this[_0x3e3c55(0x275)][_0x3e3c55(0x212)]({'changeType':_0x5d9595,'name':_0x3728c6,'type':_0x17b79f,'paths':_0x37468d[_0x3e3c55(0x1c1)][_0x3e3c55(0x1d8)](_0x32d1eb=>_0x32d1eb['path'])});}await this[_0x3e3c55(0x256)]['saveBranchState'](_0x4f2fad);}}class RollbackReporter extends BaseReporter{[a0_0x216d83(0x2d9)];constructor({fileChanges:_0x2335b9}){const _0x4ae3b5=a0_0x216d83;super({'success':!![]}),this[_0x4ae3b5(0x2d9)]=_0x2335b9;}[a0_0x216d83(0x305)](){const _0x1c630d=a0_0x216d83;return{'success':this['success'],'fileChanges':this[_0x1c630d(0x2d9)]};}['print'](_0x3f5298){const _0x5f1de0=a0_0x216d83;console[_0x5f1de0(0x2a8)](_0x5f1de0(0x2b2));const _0x24524f=[[_0x5f1de0(0x314),_0x5f1de0(0x1e0)]];for(const {changeType:_0x207aee,path:_0x1909eb}of _0x3f5298[_0x5f1de0(0x2d9)]){_0x24524f[_0x5f1de0(0x212)]([_0x207aee,_0x1909eb]);}console[_0x5f1de0(0x2a8)](table[_0x5f1de0(0x242)](_0x24524f,{'columns':[{},{'width':0x28}]}));}}class RollbackCommand extends BaseCommand{[a0_0x216d83(0x1ee)]='rollback';[a0_0x216d83(0x258)]=a0_0x216d83(0x1c0);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager['getInstance']();['rollbackTypes']=new Map();[a0_0x216d83(0x2de)]=[];[a0_0x216d83(0x2c5)]=[];[a0_0x216d83(0x1b3)];[a0_0x216d83(0x213)];[a0_0x216d83(0x20a)];get[a0_0x216d83(0x253)](){const _0x49dc3a=a0_0x216d83;if(!this[_0x49dc3a(0x1b3)])throw new Error(_0x49dc3a(0x323));return this[_0x49dc3a(0x1b3)];}get['branchId'](){const _0x15e277=a0_0x216d83;if(!this['_branchId'])throw new Error(_0x15e277(0x1f1));return this[_0x15e277(0x213)];}get['headCommitId'](){const _0x413e44=a0_0x216d83;if(!this[_0x413e44(0x20a)])throw new Error('Head\x20commit\x20id\x20not\x20found');return this[_0x413e44(0x20a)];}async[a0_0x216d83(0x31a)](){const _0x35e666=a0_0x216d83;this[_0x35e666(0x303)][_0x35e666(0x1c5)]('Rolling\x20back\x20to\x20last\x20committed\x20state\x20started');const _0x570a81=await this[_0x35e666(0x256)][_0x35e666(0x32f)](this[_0x35e666(0x2bf)]);if(!_0x570a81)return this[_0x35e666(0x303)][_0x35e666(0x2bd)](_0x35e666(0x328)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0x50fd49=await this['getCredentialsAlias']();this[_0x35e666(0x1b3)]=await ApiService[_0x35e666(0x2cc)](_0x50fd49),await this[_0x35e666(0x329)](),await this[_0x35e666(0x256)][_0x35e666(0x32b)](this[_0x35e666(0x2bf)]);try{this['logger'][_0x35e666(0x1c5)](_0x35e666(0x2dd)),await this[_0x35e666(0x2c3)]();if(!this[_0x35e666(0x290)]['size'])return this[_0x35e666(0x303)][_0x35e666(0x1c5)](_0x35e666(0x23e)),new RollbackReporter({'fileChanges':this[_0x35e666(0x2c5)]});return this['logger'][_0x35e666(0x1c5)]('Looking\x20for\x20changes\x20completed.\x20'+this['rollbackTypes'][_0x35e666(0x1f3)]+_0x35e666(0x1fd)),this[_0x35e666(0x303)]['info'](_0x35e666(0x325)),await this[_0x35e666(0x24e)](),this[_0x35e666(0x303)][_0x35e666(0x1c5)](_0x35e666(0x1eb)),await this[_0x35e666(0x256)][_0x35e666(0x1f7)](),this[_0x35e666(0x303)][_0x35e666(0x1c5)](_0x35e666(0x293)),new RollbackReporter({'fileChanges':this[_0x35e666(0x2c5)]});}catch(_0x1ec3e4){await this[_0x35e666(0x256)][_0x35e666(0x32a)]();throw _0x1ec3e4;}}[a0_0x216d83(0x231)]([{json:_0x4483d9}]){return _0x4483d9;}async[a0_0x216d83(0x1fa)](){const _0x108a9e=a0_0x216d83,{credentialsAlias:_0xae21f8}=await this[_0x108a9e(0x256)][_0x108a9e(0x2fa)](this[_0x108a9e(0x2bf)]);if(!_0xae21f8)throw new Error(_0x108a9e(0x31e));if(typeof _0xae21f8!==_0x108a9e(0x27f))throw new Error(_0x108a9e(0x2ec));return _0xae21f8;}async[a0_0x216d83(0x329)](){const _0x212cfe=a0_0x216d83,{id:_0x2a7b7e,headCommitId:_0x50c4a2}=await this[_0x212cfe(0x256)][_0x212cfe(0x2ef)](this[_0x212cfe(0x2bf)]);if(!_0x2a7b7e||!_0x50c4a2)throw new Error('A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first');this[_0x212cfe(0x213)]=_0x2a7b7e||void 0x0,this[_0x212cfe(0x20a)]=_0x50c4a2||void 0x0;}async[a0_0x216d83(0x24e)](){const _0x4d6e20=a0_0x216d83;if(this['componentsForRetrieve']['length'])for await(const {files:_0x965fb}of ApiService[_0x4d6e20(0x2f9)]({'devopsUrl':this[_0x4d6e20(0x253)][_0x4d6e20(0x1f0)],'accessToken':this['credentials'][_0x4d6e20(0x1db)],'branchId':this[_0x4d6e20(0x343)],'commitId':this[_0x4d6e20(0x278)],'components':this[_0x4d6e20(0x2de)]})){await this[_0x4d6e20(0x226)](_0x965fb);}for(const [_0x17a8a7,_0x36d6a0]of this[_0x4d6e20(0x290)][_0x4d6e20(0x2aa)]()){if(_0x36d6a0!==ChangeType['DELETE'])throw new Error('File\x20\x22'+_0x17a8a7+_0x4d6e20(0x225));await this[_0x4d6e20(0x256)]['addFileChange']({'path':_0x17a8a7,'changeType':_0x36d6a0});}return{'success':!![]};}async[a0_0x216d83(0x2c3)](){const _0x273056=a0_0x216d83,_0x31bdfe=await this['manager'][_0x273056(0x279)]();for(const {name:_0x365f4f,type:_0x391e1b,changes:_0x1e45f8}of _0x31bdfe){let _0x15f607=![];for(const {path:_0x4df9cc,changeType:_0x41ae10}of _0x1e45f8){let _0x2a2b50;_0x41ae10===ChangeType[_0x273056(0x1bf)]?_0x2a2b50=ChangeType[_0x273056(0x2f8)]:(_0x2a2b50=_0x41ae10===ChangeType[_0x273056(0x2f8)]?ChangeType['CREATE']:ChangeType[_0x273056(0x28d)],_0x15f607=!![]),this[_0x273056(0x290)][_0x273056(0x23b)](_0x4df9cc,_0x2a2b50),this[_0x273056(0x2c5)][_0x273056(0x212)]({'changeType':_0x2a2b50,'path':_0x4df9cc});}_0x15f607&&this[_0x273056(0x2de)]['push']({'name':_0x365f4f,'type':_0x391e1b});}}async[a0_0x216d83(0x226)](_0x3c21fe){const _0x29ffe7=a0_0x216d83;for(const {path:_0x41d37b,content:_0x354f70}of _0x3c21fe){const _0x24515f=path['join'](COMPONENT_PROJECT_PATH,_0x41d37b),_0x1c9622=this[_0x29ffe7(0x290)][_0x29ffe7(0x2e5)](_0x24515f);if(!_0x1c9622)continue;await this[_0x29ffe7(0x256)][_0x29ffe7(0x30d)]({'path':_0x24515f,'content':_0x354f70,'changeType':_0x1c9622}),this[_0x29ffe7(0x290)][_0x29ffe7(0x1cf)](_0x24515f);}}}class StatusReporter extends BaseReporter{[a0_0x216d83(0x2ba)];constructor({pendingChanges:_0x5a7833}){super({'success':!![]}),this['pendingChanges']=_0x5a7833;}['buildReport'](){const _0x1b794e=a0_0x216d83;return{'success':this[_0x1b794e(0x1ba)],'pendingChanges':this[_0x1b794e(0x2ba)]};}[a0_0x216d83(0x31d)](_0x475bd9){const _0x5d603b=a0_0x216d83;console[_0x5d603b(0x2a8)](_0x5d603b(0x1c4));const _0x3d2a71=[[_0x5d603b(0x314),_0x5d603b(0x1e0)]];for(const {changeType:_0x40bba9,path:_0x47263e}of _0x475bd9[_0x5d603b(0x2ba)]){_0x3d2a71[_0x5d603b(0x212)]([_0x40bba9,_0x47263e]);}console[_0x5d603b(0x2a8)](table[_0x5d603b(0x242)](_0x3d2a71,{'columns':[{},{'width':0x28}]}));}}class StatusCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x321);[a0_0x216d83(0x258)]=a0_0x216d83(0x26f);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();[a0_0x216d83(0x2ba)]=[];async['execute'](){const _0x59aa21=a0_0x216d83;this['logger'][_0x59aa21(0x1c5)](_0x59aa21(0x247));const _0xd86cd4=await this['manager'][_0x59aa21(0x32f)](this['projectPath']);if(!_0xd86cd4)return this['logger'][_0x59aa21(0x2bd)](_0x59aa21(0x328)),new FailReporter({'failMessage':_0x59aa21(0x328)});await this[_0x59aa21(0x256)][_0x59aa21(0x32b)](this[_0x59aa21(0x2bf)]);const _0x311e7c=await this[_0x59aa21(0x256)][_0x59aa21(0x279)]();for(const {changes:_0x1cf4c5}of _0x311e7c){for(const {changeType:_0x3f3dfa,path:_0x11f468}of _0x1cf4c5){this[_0x59aa21(0x2ba)][_0x59aa21(0x212)]({'changeType':_0x3f3dfa,'path':_0x11f468});}}return await this['manager'][_0x59aa21(0x32a)](),this[_0x59aa21(0x303)][_0x59aa21(0x1c5)](_0x59aa21(0x1bb)),new StatusReporter({'pendingChanges':this[_0x59aa21(0x2ba)]});}['isJson']([{json:_0x1b4f8f}]){return _0x1b4f8f;}}configurePathEnv();const ROOT_COMMANDS=[LoginCommand,LogoutCommand,ListCredentialsCommand],DEVOPS_COMMANDS=[InitCommand,CloneCommand,CheckoutCommand,ConfigSetCommand,ConfigUnset,PullCommand,CommitCommand,RollbackCommand,StatusCommand,ListBranchesCommand],root=new commander['Command']()['name'](ROOT_NAME)['description']('CLI\x20for\x20work\x20with\x20'+ROOT_NAME+a0_0x216d83(0x25e))['version'](config[a0_0x216d83(0x2ea)]);for(const command of ROOT_COMMANDS){new command()[a0_0x216d83(0x28e)](root);}const devops=new commander[(a0_0x216d83(0x1c6))]()[a0_0x216d83(0x24f)](a0_0x216d83(0x33f))[a0_0x216d83(0x258)]('Devops\x20commands');for(const command of DEVOPS_COMMANDS){new command()[a0_0x216d83(0x28e)](devops);}root[a0_0x216d83(0x26e)](devops),root['parse']();function configurePathEnv(){const _0x56e6e4=a0_0x216d83,_0x4783c2=process['env'][_0x56e6e4(0x202)]?.['split'](node_path['delimiter']);if(!_0x4783c2)throw new Error(_0x56e6e4(0x2b7));const _0x530346=node_path['join'](node_path[_0x56e6e4(0x2d3)](__dirname),_0x56e6e4(0x322),_0x56e6e4(0x2ae));_0x4783c2[_0x56e6e4(0x212)](_0x530346),process[_0x56e6e4(0x233)][_0x56e6e4(0x202)]=_0x4783c2[_0x56e6e4(0x1e5)](node_path['delimiter']);}exports[a0_0x216d83(0x29f)]=DEVOPS_COMMANDS,exports[a0_0x216d83(0x1e7)]=ROOT_COMMANDS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flosum/cli",
3
- "version": "0.0.2-beta.0",
3
+ "version": "0.0.2",
4
4
  "author": "Flosum",
5
5
  "license": "ISC",
6
6
  "description": "Devops cli",