class UserBrollFootage{static ['DEFAULT_SA'+'VE_FILENAM'+'E']='user_broll'+'_footage.j'+'son';constructor(){this['init'](),this['footages']=[],this['version']=-0x801+0x7f*-0x2b+0x1d57;}['init'](){const Y={'sxdeS':'UserBrollF'+'ootage\x20ini'+'t'};console['log'](Y['sxdeS']);}['load'](Y){const Q={'jpUvv':'utf8'};if(!fs['existsSync'](Y)){console['log']('No\x20user\x20br'+'oll\x20footag'+'e\x20data\x20fou'+'nd\x20at\x20'+Y);return;}try{const g=JSON['parse'](fs['readFileSy'+'nc'](Y,Q['jpUvv']));this['footages']=g['footages'],this['version']=g['version'];}catch(N){console['error']('Error\x20read'+'ing\x20user\x20b'+'roll\x20foota'+'ge\x20data\x20fr'+'om\x20'+Y,N);}}async['analyzeFoo'+'tage'](Y){const Q=await editai_api['tagVideo'](Y['images']);Y['tags']=Q['tags'],Y['descriptio'+'n']=Q['descriptio'+'n'];}['renderTabl'+'e'](Y=![]){const Q={'imlJP':function(g,N){return g(N);},'UFmXO':'#broll-use'+'r-broll-de'+'tect-tags-'+'usage'};renderUserBrollFootageTable(this['footages'],Y),Q['imlJP']($,Q['UFmXO'])['text']('Monthly\x20au'+'to-detecti'+'on\x20usage:\x20'+g_user_broll_analysis_count+'/'+g_user_broll_analysis_limit+'\x20videos');}async['ingestFoot'+'age'](Y,Q){const g={'wLZUV':'pending','fBntb':function(L,C){return L>C;},'OfiEH':function(L,C){return L>C;},'LapUj':'analyzing','JJOGQ':function(L,C,c){return L(C,c);},'qcHMd':'Uploading\x20'+'user\x20broll'+'\x20footage\x20d'+'ata\x20after\x20'+'ingestion'},N=this['footages']['map'](L=>L['path']),V=[];let h=!![];ingestUserBrollFootagePaths(Y,N,Q,L=>{Q&&(L['analysisSt'+'atus']=g['wLZUV'],V['unshift'](L)),this['footages']['unshift'](L),this['save'](),this['renderTabl'+'e'](!![]);})['then'](()=>{h=![];});while(h||g['fBntb'](V['length'],-0xc56+-0x66b*-0x3+0xb*-0xa1)){if(g['OfiEH'](V['length'],-0x2095+0x28b+0x301*0xa)){const L=V['pop']();L['analysisSt'+'atus']===g['wLZUV']&&(L['analysisSt'+'atus']=g['LapUj'],this['renderTabl'+'e'](!![]),await g['JJOGQ'](footageAnalysis,L,![]),this['save']());}else await new Promise(C=>setTimeout(C,-0x139f+-0x2040+0x37c7));}this['renderTabl'+'e'](![]),this['save']();try{editai_api['uploadFile'+'_v2'](path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E']),g['qcHMd']);}catch(C){console['error'](C,g['qcHMd']);}}['removeFoot'+'ages'](Y){const Q={'zaTzb':function(N,V){return N<V;}},g=[];for(let N=-0x2319+0x1*0x2173+-0x2*-0xd3;Q['zaTzb'](N,this['footages']['length']);N++){if(Y['includes'](N))continue;g['push'](this['footages'][N]);}this['footages']=g,this['save'](),this['renderTabl'+'e'](![]);}['save'](){const Y={'iUMbP':'Saving\x20use'+'r\x20broll\x20fo'+'otage','VWVdE':'utf8'};console['log'](Y['iUMbP']);const Q=path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E']),g=this['getSaveDat'+'a']();fs['writeFileS'+'ync'](Q,g,Y['VWVdE']),console['log']('Saved\x20capt'+'ions\x20data\x20'+'as\x20'+Q);}['getSaveDat'+'a'](){const Y=JSON['parse'](JSON['stringify'](this['footages']))['map'](Q=>{return delete Q['images'],delete Q['analysisSt'+'atus'],Q;});return JSON['stringify']({'footages':Y,'version':0x1});}['getSearchR'+'esultsFrom'+'PickedFoot'+'age'](Y,Q){const g={'TAdqE':function(L,C){return L===C;},'oJeSh':function(L,C){return L===C;},'phHzb':function(L,C){return L!==C;},'SExeY':function(L,C){return L<C;},'yPBRq':'broll_id','dLDrP':function(L,C){return L===C;}},N=Y[g['yPBRq']],V=this['footages']['find'](L=>L['id']===N);if(!V)return console['error']('Footage\x20wi'+'th\x20ID\x20'+N+'\x20not\x20found'),null;if(!V['tags']||g['dLDrP'](V['tags']['length'],0x1*0xd0d+0xf*-0x85+-0x542))return{'hits':[V]};const h=this['footages']['filter'](L=>{if(g['TAdqE'](L,V)||!L['tags']||g['oJeSh'](L['tags']['length'],0x3*0xb27+-0xbf+-0x20b6))return![];if(g['phHzb'](L['orientatio'+'n'],V['orientatio'+'n'])&&Q)return![];const C=L['tags']['map'](c=>c['value']['toLowerCas'+'e']());for(let c=-0x1d5b+-0x1*0x24a6+-0x3d*-0x115;g['SExeY'](c,V['tags']['length']);c++){if(C['includes'](V['tags'][c]['value']['toLowerCas'+'e']()))return!![];}return![];});return{'hits':[V,...h]};}['getFootage'+'ForApi'](Y=[]){return g_user_broll_footage['footages']['filter'](Q=>Q['descriptio'+'n']!=undefined)['filter'](Q=>!Y['includes'](Q['id']))['map'](Q=>{return{...Q,'images':[]};});}['filterExis'+'tingFiles'](Y){const Q=this['footages']['map'](g=>path['resolve'](g['path']));return Y['map'](g=>path['resolve'](g))['filter'](g=>!Q['includes'](g));}}var g_user_broll_footage=new UserBrollFootage(),g_user_broll_analysis_count=0x2*0x6b6+-0x394+-0x9d8,g_user_broll_analysis_limit=-0xa7b+-0xb9c*0x1+0x167b,g_user_broll_ingest_limit=-0x55*-0x33+0x4fd*-0x6+0xd63;new Promise(()=>{const Y={'ujGTY':function(Q){return Q();}};g_user_broll_footage['load'](path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E'])),Y['ujGTY'](setUserBrollFootageListeners);});