export const NotificationManager={'isSupported'(){return'Notification'in window;},'isEnabled'(){if(!this['isSupported']())return![];return localStorage['getItem']('notifications-enabled')==='true';},'setEnabled'(_0x528c7c){localStorage['setItem']('notifications-enabled',_0x528c7c?'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 _0x181e09=await Notification['requestPermission']();return _0x181e09;}catch(_0x12a60d){return console['error']('Failed\x20to\x20request\x20notification\x20permission:',_0x12a60d),'denied';}},async 'show'(_0x2cab4a,_0x9624dd={}){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 _0x21355d=new Notification(_0x2cab4a,{'icon':_0x9624dd['icon']||'/favicon.ico','badge':_0x9624dd['badge']||'/favicon.ico','body':_0x9624dd['body']||'','tag':_0x9624dd['tag']||'','requireInteraction':_0x9624dd['requireInteraction']||![],'silent':_0x9624dd['silent']||![],'data':_0x9624dd['data']||{}});_0x9624dd['onClick']&&(_0x21355d['onclick']=_0x460939=>{_0x460939['preventDefault'](),window['focus'](),_0x9624dd['onClick'](_0x460939,_0x21355d),_0x21355d['close']();});if(!_0x9624dd['requireInteraction']){const _0x52d3f8=_0x9624dd['duration']||0x1388;setTimeout(()=>{_0x21355d['close']();},_0x52d3f8);}return _0x21355d;}catch(_0x5ca5e6){return console['error']('Failed\x20to\x20show\x20notification:',_0x5ca5e6),null;}},async 'notifyTaskComplete'(_0x5f4a3f){const _0x5cea23=_0x5f4a3f['exitCode']!==undefined?_0x5f4a3f['exitCode']:_0x5f4a3f['exit_code'],_0x641666=_0x5f4a3f['status']==='completed'&&_0x5cea23===0x0,_0x410468=_0x5f4a3f['status']==='interrupted',_0x1e7151=_0x641666?'✅\x20Task\x20Completed\x20Successfully':_0x410468?'⏹️\x20Task\x20Interrupted':'❌\x20Task\x20Failed';let _0x4b8f77;if(_0x5f4a3f['taskType']==='test'){const _0xea34d7=_0x5f4a3f['testName']||'Test',_0x8fb403=_0x5f4a3f['testDescription']||_0x5f4a3f['description']||'';if(_0x8fb403&&_0x8fb403['length']>0x0){let _0x4bae98=_0x8fb403;_0x8fb403['length']>0x50&&(_0x4bae98=_0x8fb403['substring'](0x0,0x4d)+'...'),_0x4b8f77='Test:\x20'+_0xea34d7+'\x20-\x20'+_0x4bae98;}else _0x4b8f77='Test:\x20'+_0xea34d7;}else{if(_0x5f4a3f['taskType']==='deploy'){const _0x4a72f6=_0x5f4a3f['deployProfile']||'Deploy',_0x15554c=_0x5f4a3f['deployDescription']||_0x5f4a3f['description']||'';if(_0x15554c&&_0x15554c['length']>0x0){let _0xc9ff2f=_0x15554c;_0x15554c['length']>0x50&&(_0xc9ff2f=_0x15554c['substring'](0x0,0x4d)+'...'),_0x4b8f77='Deploy:\x20'+_0x4a72f6+'\x20-\x20'+_0xc9ff2f;}else _0x4b8f77='Deploy:\x20'+_0x4a72f6;}else{const _0x315df8=_0x5f4a3f['name']?_0x5f4a3f['name']['trim']():null,_0x463dc1=_0x5f4a3f['envVars']?.['CODER_AGENT']||_0x5f4a3f['envVars']?.['default_agent']||'Unknown',_0x5c8b25=_0x463dc1['charAt'](0x0)['toUpperCase']()+_0x463dc1['slice'](0x1);let _0x578935,_0x442833=![];if(_0x5f4a3f['followUpHistory']&&Array['isArray'](_0x5f4a3f['followUpHistory'])&&_0x5f4a3f['followUpHistory']['length']>0x0){const _0x9a3b32=_0x5f4a3f['followUpHistory'][_0x5f4a3f['followUpHistory']['length']-0x1];_0x578935=_0x9a3b32['instructions'],_0x442833=!![];}else _0x578935=_0x5f4a3f['description']||_0x5f4a3f['instructions']||_0x5f4a3f['taskId'];_0x578935['length']>0x64&&(_0x578935=_0x578935['substring'](0x0,0x61)+'...');const _0x4c8eb5=_0x442833?'[Follow-up]\x20':'';_0x315df8?_0x4b8f77=_0x315df8+'\x0a'+_0x5c8b25+':\x20'+_0x4c8eb5+_0x578935:_0x4b8f77=_0x5c8b25+':\x20'+_0x4c8eb5+_0x578935;}}return this['show'](_0x1e7151,{'body':_0x4b8f77,'tag':'task-'+_0x5f4a3f['taskId'],'requireInteraction':![],'duration':0x1f40,'data':{'taskId':_0x5f4a3f['taskId']},'onClick':(_0x59ddd1,_0x1449c3)=>{window['open']('task.html?id='+_0x5f4a3f['taskId'],'_blank');}});},'shouldNotify'(_0x3d9b39,_0xf00a2){if(!this['isEnabled']())return![];if(_0x3d9b39['status']!=='completed'&&_0x3d9b39['status']!=='failed'&&_0x3d9b39['status']!=='interrupted')return![];if(!_0xf00a2['has'](_0x3d9b39['taskId']))return![];const _0x41de80='notified-'+_0x3d9b39['taskId'];if(sessionStorage['getItem'](_0x41de80)==='true')return![];return!![];},'markNotified'(_0x2020be){sessionStorage['setItem']('notified-'+_0x2020be,'true');},'clearNotificationHistory'(){const _0x35f655=[];for(let _0x2a619b=0x0;_0x2a619b<sessionStorage['length'];_0x2a619b++){const _0xb835fb=sessionStorage['key'](_0x2a619b);_0xb835fb['startsWith']('notified-')&&_0x35f655['push'](_0xb835fb);}_0x35f655['forEach'](_0x64b8fe=>sessionStorage['removeItem'](_0x64b8fe));}};