{"version":3,"file":"push-notifications.mjs","names":[],"sources":["../../src/main/push-notifications/index.ts"],"sourcesContent":["/**\n * Main process handlers for pushNotifications module (macOS only)\n * Includes RPC method registration and event forwarding to renderer\n */\n\nimport { pushNotifications } from \"electron\";\nimport type { RpcServer } from \"electron-json-rpc/main\";\n\nconst RPC_METHOD_PREFIX = \"pushNotifications\";\n\n/**\n * Register for Apple Push Notification service (APNS) notifications\n * Returns the APNS device token on successful registration\n */\nexport async function registerForAPNSNotificationsHandler(): Promise<string> {\n  return pushNotifications.registerForAPNSNotifications();\n}\n\n/**\n * Unregister from APNS notifications\n */\nexport async function unregisterForAPNSNotificationsHandler(): Promise<void> {\n  return pushNotifications.unregisterForAPNSNotifications();\n}\n\n/**\n * Register all pushNotifications module RPC handlers and set up event forwarding\n */\nexport function registerPushNotificationsModule(rpc: RpcServer): void {\n  rpc.register(\n    `${RPC_METHOD_PREFIX}.registerForAPNSNotifications`,\n    registerForAPNSNotificationsHandler,\n  );\n  rpc.register(\n    `${RPC_METHOD_PREFIX}.unregisterForAPNSNotifications`,\n    unregisterForAPNSNotificationsHandler,\n  );\n\n  // Forward APNS notifications to renderer\n  pushNotifications.on(\"received-apns-notification\", (_event, userInfo) => {\n    rpc.publish(\"pushNotifications.received-apns-notification\", userInfo);\n  });\n}\n"],"mappings":";;;;;;;AAQA,MAAM,oBAAoB;;;;;AAM1B,eAAsB,sCAAuD;AAC3E,QAAO,kBAAkB,8BAA8B;;;;;AAMzD,eAAsB,wCAAuD;AAC3E,QAAO,kBAAkB,gCAAgC;;;;;AAM3D,SAAgB,gCAAgC,KAAsB;AACpE,KAAI,SACF,GAAG,kBAAkB,gCACrB,oCACD;AACD,KAAI,SACF,GAAG,kBAAkB,kCACrB,sCACD;AAGD,mBAAkB,GAAG,+BAA+B,QAAQ,aAAa;AACvE,MAAI,QAAQ,gDAAgD,SAAS;GACrE"}