drill.init(async e=>{let t,a,c,s=(await e("common/data")).project;const n=e=>$("o-frame").$btns.que("#designBtn").class.contains("active");let l=[{sc:"ckey+z",async f(){n()&&(t||(t=await e("task/undoAndRedo")),t.undo())}},{sc:"ckey+y",async f(){n()&&(t||(t=await e("task/undoAndRedo")),t.redo())}},{toid:"tuceng",name:"图层（在图层页）",group:[{sc:"ckey+c",label:"复制图层",notReg:0,f(){if(!n())return;let e=s.seek("[selected=1]");a=e&&e[0].object,clearTimeout(c),c=setTimeout(()=>{a=null},6e4)}},{sc:"ckey+v",label:"粘贴图层",notReg:0,f(){if(n()&&a){let e=s.seek("[selected=1]")[0];e&&(e.selected=0,"p-page"==a.tag?("p-page"==e.tag?e.after(a):e.parent.after(a),s.mainPage.forEach((e,t)=>{e.pname="page"+(t+1)})):"p-page"==e.tag?e.push(a):e.after(a))}}},{sc:"delete",label:"删除图层",menusetsc:"delete / Backspace",f(){if(!n())return;let e=s.seek("[selected=1]")[0];if(e){let t=e.prev||e.next||e.parent;e.remove(),t.selected=1,s.mainPage.forEach((e,t)=>{e.pname="page"+(t+1)})}}},{sc:"Backspace",is:"delete"},{sc:"Delete",is:"delete"}]},{toid:"shitu",name:"视图（按住空格可拖动视图）",group:[{sc:"Alt+0",label:"100%",f(){n()&&($("#mainViewcon").addAnime(),$("#mainViewcon").zoom=1)}},{sc:"Alt+º",is:"Alt+0"},{sc:"Alt+-",label:"缩小",f(){n()&&($("#mainViewcon").zoom-=.08)}},{sc:"Alt+–",is:"Alt+-"},{sc:"Alt++",menusetsc:"Alt+Plus",label:"放大",f(){n()&&($("#mainViewcon").zoom+=.08)}},{sc:"Alt+≠",is:"Alt++"},{sc:"Alt+=",is:"Alt++"},{sc:"ckey+Alt+0",label:"按屏幕大小缩放",f(){if(!n())return;let e=$("#mainViewcon");e.toCenter({anime:1}),e.toCoverSize({anime:1})}},{sc:"ckey+Alt+º",is:"ckey+Alt+0"}]}],i=new Map;l.forEach(e=>{e.sc?i.set(e.sc,e):e.group&&e.group.forEach(e=>{i.set(e.sc,e)})});const o=navigator.userAgent.search("Mac OS")>-1;return window.addEventListener("keydown",e=>{if(e.target!==document.body)return;try{if("designBtn"!==$("o-frame").$btns.que(".active").attr("id"))return}catch(e){console.error("error",e)}let{metaKey:t,ctrlKey:a,shiftKey:c,altKey:s}=e,n=!1;(o&&t||!o&&a)&&(n=!0);let l="";n&&(l+="ckey+"),c&&(l+="Shift+"),s&&(l+="Alt+"),l+=e.key;let r=i.get(l);r&&!r.f&&r.is&&(r=i.get(r.is)),r&&(r.f(),e.preventDefault())}),[l,i]});