export const NotificationManager={'isSupported'(){return'Notification'in window;},'isEnabled'(){if(!this['isSupported']())return![];return localStorage['getItem']('notifications-enabled')==='true';},'setEnabled'(_0x592380){localStorage['setItem']('notifications-enabled',_0x592380?'true':'false');},'getPermission'(){if(!this['isSupported']())return'unsupported';return Notification['permission'];},async 'requestPermission'(){if(!this['isSupported']())return'unsupported';if(Notification['permission']==='granted')return'granted';if(Notification['permission']==='denied')return'denied';try{const _0x5143d6=await Notification['requestPermission']();return _0x5143d6;}catch(_0x188c42){return console['error']('Failed\x20to\x20request\x20notification\x20permission:',_0x188c42),'denied';}},async 'show'(_0x2a8e96,_0x2d4f49={}){if(!this['isEnabled']())return null;if(!this['isSupported']())return console['warn']('Notifications\x20are\x20not\x20supported\x20in\x20this\x20browser'),null;if(Notification['permission']!=='granted')return console['warn']('Notification\x20permission\x20not\x20granted'),null;try{const _0xbb67a7=new Notification(_0x2a8e96,{'icon':_0x2d4f49['icon']||'/favicon.ico','badge':_0x2d4f49['badge']||'/favicon.ico','body':_0x2d4f49['body']||'','tag':_0x2d4f49['tag']||'','requireInteraction':_0x2d4f49['requireInteraction']||![],'silent':_0x2d4f49['silent']||![],'data':_0x2d4f49['data']||{}});_0x2d4f49['onClick']&&(_0xbb67a7['onclick']=_0x522be6=>{_0x522be6['preventDefault'](),window['focus'](),_0x2d4f49['onClick'](_0x522be6,_0xbb67a7),_0xbb67a7['close']();});if(!_0x2d4f49['requireInteraction']){const _0x4ddd41=_0x2d4f49['duration']||0x1388;setTimeout(()=>{_0xbb67a7['close']();},_0x4ddd41);}return _0xbb67a7;}catch(_0x14a340){return console['error']('Failed\x20to\x20show\x20notification:',_0x14a340),null;}},async 'notifyTaskComplete'(_0x1dee56){const _0x4297c2=_0x1dee56['exitCode']!==undefined?_0x1dee56['exitCode']:_0x1dee56['exit_code'],_0x30a107=_0x1dee56['status']==='completed'&&_0x4297c2===0x0,_0x29f349=_0x1dee56['status']==='interrupted',_0x504f06=_0x30a107?'✅\x20Task\x20Completed\x20Successfully':_0x29f349?'⏹️\x20Task\x20Interrupted':'❌\x20Task\x20Failed';let _0xa7d7d0;if(_0x1dee56['taskType']==='test'){const _0x42d6e4=_0x1dee56['testName']||'Test',_0x340701=_0x1dee56['testDescription']||_0x1dee56['description']||'';if(_0x340701&&_0x340701['length']>0x0){let _0x46d2fd=_0x340701;_0x340701['length']>0x50&&(_0x46d2fd=_0x340701['substring'](0x0,0x4d)+'...'),_0xa7d7d0='Test:\x20'+_0x42d6e4+'\x20-\x20'+_0x46d2fd;}else _0xa7d7d0='Test:\x20'+_0x42d6e4;}else{if(_0x1dee56['taskType']==='deploy'){const _0x53671b=_0x1dee56['deployProfile']||'Deploy',_0x58b280=_0x1dee56['deployDescription']||_0x1dee56['description']||'';if(_0x58b280&&_0x58b280['length']>0x0){let _0x2c65ad=_0x58b280;_0x58b280['length']>0x50&&(_0x2c65ad=_0x58b280['substring'](0x0,0x4d)+'...'),_0xa7d7d0='Deploy:\x20'+_0x53671b+'\x20-\x20'+_0x2c65ad;}else _0xa7d7d0='Deploy:\x20'+_0x53671b;}else{const _0x24e70b=_0x1dee56['name']?_0x1dee56['name']['trim']():null,_0x1067f3=_0x1dee56['envVars']?.['CODER_AGENT']||_0x1dee56['envVars']?.['default_agent']||'Unknown',_0xf3bb24=_0x1067f3['charAt'](0x0)['toUpperCase']()+_0x1067f3['slice'](0x1);let _0x3805d3,_0x17fe8d=![];if(_0x1dee56['followUpHistory']&&Array['isArray'](_0x1dee56['followUpHistory'])&&_0x1dee56['followUpHistory']['length']>0x0){const _0x1a1efb=_0x1dee56['followUpHistory'][_0x1dee56['followUpHistory']['length']-0x1];_0x3805d3=_0x1a1efb['instructions'],_0x17fe8d=!![];}else _0x3805d3=_0x1dee56['description']||_0x1dee56['instructions']||_0x1dee56['taskId'];_0x3805d3['length']>0x64&&(_0x3805d3=_0x3805d3['substring'](0x0,0x61)+'...');const _0x88c1c2=_0x17fe8d?'[Follow-up]\x20':'';_0x24e70b?_0xa7d7d0=_0x24e70b+'\x0a'+_0xf3bb24+':\x20'+_0x88c1c2+_0x3805d3:_0xa7d7d0=_0xf3bb24+':\x20'+_0x88c1c2+_0x3805d3;}}return this['show'](_0x504f06,{'body':_0xa7d7d0,'tag':'task-'+_0x1dee56['taskId'],'requireInteraction':![],'duration':0x1f40,'data':{'taskId':_0x1dee56['taskId']},'onClick':(_0x2141f9,_0x5b59e8)=>{window['open']('task.html?id='+_0x1dee56['taskId'],'_blank');}});},'shouldNotify'(_0x3bf722,_0x170d33){if(!this['isEnabled']())return![];if(_0x3bf722['status']!=='completed'&&_0x3bf722['status']!=='failed'&&_0x3bf722['status']!=='interrupted')return![];if(!_0x170d33['has'](_0x3bf722['taskId']))return![];const _0xa3553b='notified-'+_0x3bf722['taskId'];if(sessionStorage['getItem'](_0xa3553b)==='true')return![];return!![];},'markNotified'(_0x4dc6fa){sessionStorage['setItem']('notified-'+_0x4dc6fa,'true');},'clearNotificationHistory'(){const _0x452253=[];for(let _0x70bcbb=0x0;_0x70bcbb<sessionStorage['length'];_0x70bcbb++){const _0x3e7736=sessionStorage['key'](_0x70bcbb);_0x3e7736['startsWith']('notified-')&&_0x452253['push'](_0x3e7736);}_0x452253['forEach'](_0x42f5f2=>sessionStorage['removeItem'](_0x42f5f2));}};