text: "use strict";
  /*------------------------------------------------------------------------------
   *  Copyright (c) 2019 Sagar Gurtu
   *  Licensed under the MIT License.
   *  See License in the project root for license information.
   *----------------------------------------------------------------------------*/
  
  const { app } = require('electron');
  
  
  /*
  exports.buildMenuTemplate = function (win) {
      return [
          {
              label: 'File',
              submenu: [
                  {
                      label: 'Open...',
                      id: 'file-open',
                      accelerator: 'CmdOrCtrl+O',
                      click() {
                          dialog.showOpenDialog(win, {
                              properties: ['openFile'],
                              filters: [
                                  { name: 'PDF Files', extensions: ['pdf'] }
                              ]
                          }, (filename) => {
                              if (filename) {
                                  win.webContents.send('file-open',
                                      filename.toString())
                              }
                          })
                      }
                  },
                  {
                      label: 'Print...',
                      id: 'file-print',
                      accelerator: 'CmdOrCtrl+P',
                      enabled: false,
                      click() {
                          win.webContents.send('file-print')
                      }
                  },
                  {
                      type: 'separator'
                  },
                  {
                      label: 'Properties...',
                      id: 'file-properties',
                      enabled: false,
                      click() {
                          win.webContents.send('file-properties')
                      }
                  },
                  {
                      type: 'separator'
                  },
                  {
                      label: 'Close',
                      id: 'file-close',
                      enabled: false,
                      click() {
                          win.webContents.send('file-close')
                      }
                  },
                  {
                      label: 'Exit',
                      click() {
                          app.quit()
                      }
                  }
              ]
          },
          {
              label: 'View',
              submenu: [
                  {
                      label: 'Toggle Full Screen',
                      id: 'view-fullscreen',
                      enabled: false,
                      accelerator: 'F11',
                      click() {
                          win.webContents.send('view-fullscreen')
                      }
                  }
              ]
          },
          {
              label: 'Help',
              submenu: [
                  {
                      label: 'About',
                      id: 'about'
                  }
              ]
          }
  
      ];
  };
  */
  
  const isMac = process.platform === 'darwin'
  
  exports.menuTemplate = [
      // { role: 'appMenu' }
      ...(isMac ? [{
        label: app.name,
        submenu: [
          { role: 'about' },
          { type: 'separator' },
          { role: 'services' },
          { type: 'separator' },
          { role: 'hide' },
          { role: 'hideothers' },
          { role: 'unhide' },
          { type: 'separator' },
          { role: 'quit' }
        ]
      }] : []),
      // { role: 'fileMenu' }
      {
        label: 'File',
        submenu: [
          {label: 'Open...', id: 'file-open', accelerator: 'CmdOrCtrl+O'},
          {label: 'Print', id:'file-print', accelerator: 'CmdOrCtrl+P', enabled: false},
        ]
      },
      // { role: 'editMenu' }
      {
        label: 'Edit',
        submenu: [
          { role: 'undo' },
          { role: 'redo' },
          { type: 'separator' },
          { role: 'cut' },
          { role: 'copy' },
          { role: 'paste' },
          ...(isMac ? [
            { role: 'pasteAndMatchStyle' },
            { role: 'delete' },
            { role: 'selectAll' },
            { type: 'separator' },
            {
              label: 'Speech',
              submenu: [
                { role: 'startspeaking' },
                { role: 'stopspeaking' }
              ]
            }
          ] : [
            { role: 'delete' },
            { type: 'separator' },
            { role: 'selectAll' }
          ])
        ]
      },
      // { role: 'viewMenu' }
      {
        label: 'View',
        submenu: [
          { role: 'resetzoom' },
          { role: 'zoomin' },
          { role: 'zoomout' },
          { type: 'separator' },
          { role: 'togglefullscreen' }
        ]
      },
      // { role: 'windowMenu' }
      {
        label: 'Window',
        submenu: [
          { role: 'minimize' },
          { role: 'maximize' }
        ]
      },
      {
        role: 'help',
        submenu: [
          {
            label: 'Learn More',
            click: async () => {
              const { shell } = require('electron')
              await shell.openExternal('https://elesoft.io/#nightpdf')
            }
          }
        ]
      }
    ]