(()=>{const{remote:e}=require("electron"),{Menu:l}=e;let o=e.getCurrentWindow();drill.init(async e=>{let a=await e("common/data"),r=[{label:"文件",submenu:[{label:"打开项目",click(){$("#openBtn").ele.click()}},{label:"新建项目",click(){$("#addBtn").ele.click()}},{label:"最近打开",submenu:a.history.page.map(e=>({label:e.dirpath,click(){$(`[dirpath="${e.dirpath}"]`).$dirName.ele.click()}}))}]},{label:"编辑",submenu:[{role:"undo",label:"撤销"},{role:"redo",label:"重做"},{type:"separator"},{role:"cut",label:"剪切"},{role:"copy",label:"复制"},{role:"paste",label:"粘贴"},{role:"selectall",label:"全选"}]},{label:"视图",submenu:[{role:"reload",label:"刷新"},{role:"forcereload",label:"强制刷新"},{role:"toggledevtools",label:"开发者工具"},{type:"separator"},{role:"resetzoom"},{role:"zoomin"},{role:"zoomout"},{type:"separator"}]},{role:"window",label:"窗口",submenu:[{role:"close",label:"关闭"},{role:"minimize",label:"最小化"},{role:"zoom",label:"放大"}]}];"darwin"===process.platform&&r.unshift({label:"Page Creator",submenu:[{role:"hide",label:"隐藏"},{role:"hideothers",label:"隐藏其它"},{role:"unhide",label:"取消隐藏"},{type:"separator"},{role:"quit",label:"退出"}]});const t=()=>{let e=l.buildFromTemplate(r);l.setApplicationMenu(e)};t(),o.on("focus",e=>{t()})})})();