"use strict";var a=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(i,o)=>a(i,"name",{value:o,configurable:true});var w=(i,o)=>{for(var n in o)a(i,n,{get:o[n],enumerable:true})};var b=(i,o,n,s)=>{if(o&&typeof o==="object"||typeof o==="function"){for(let r of p(o))if(!u.call(i,r)&&r!==n)a(i,r,{get:()=>o[r],enumerable:!(s=I(o,r))||s.enumerable})}return i};var W=i=>b(a({},"__esModule",{value:true}),i);var O={};w(O,{default:()=>k});module.exports=W(O);var l=require("node:path");var e=require("electron");var m=require("mobx");var t=require("../../environment");const f="taskbar";const T=t.isWindows?"ico":"png";let d;const y=c((i,o)=>{return(0,l.join)(__dirname,"..","..","assets","images",i,process.platform,`${o}.${T}`)},"getAsset");var k=c(i=>{(0,m.autorun)(()=>{d=i.settings.app.get("enableSystemTray");if(!d){i.trayIcon.hide()}else if(d){i.trayIcon.show()}});e.ipcMain.on("updateAppIndicator",(o,n)=>{if(!i.mainWindow.isFocused()&&i.settings.app.get("notifyTaskBarOnMessage")){if(t.isWindows){i.mainWindow.flashFrame(true);i.mainWindow.once("focus",()=>i.mainWindow.flashFrame(false))}else if(t.isMac){e.app.dock?.bounce("informational")}}if(t.isMac&&typeof n.indicator==="string"){e.app.dock?.setBadge(n.indicator)}if((t.isMac||t.isLinux)&&typeof n.indicator==="number"){e.app.badgeCount=n.indicator}if(t.isWindows){if(typeof n.indicator==="number"&&n.indicator!==0){i.mainWindow.setOverlayIcon(y("taskbar",`${f}-${n.indicator>=10?10:n.indicator}`),"")}else if(typeof n.indicator==="string"){i.mainWindow.setOverlayIcon(y("taskbar",`${f}-alert`),"")}else{i.mainWindow.setOverlayIcon(null,"")}}i.trayIcon.setIndicator(n.indicator)})},"default");
