import{t as e}from"./keyboard-layout-map-CtWtIpu3.js";var t=new Set([`Meta`,`Control`,`Alt`,`AltGraph`,`Shift`]),n=1,r=2,i=new Map([[`Escape`,`Esc`],[`ArrowUp`,`Up`],[`ArrowDown`,`Down`],[`ArrowLeft`,`Left`],[`ArrowRight`,`Right`]]);function a(e){let t=l(e);if(t==null)return null;let n=[];return e.ctrlKey&&n.push(`Ctrl`),e.metaKey&&n.push(`Command`),e.altKey&&n.push(`Alt`),e.shiftKey&&n.push(`Shift`),n.push(t),n.join(`+`)}function o(e){return c(e,`pressed`)}function s(e){return c(e,`released`)}function c(e,t){if(e.key.toLowerCase()===`fn`)return`Fn`;let i=e.location===n?`Left`:e.location===r?`Right`:null;if(i==null)return null;switch(e.key){case`Alt`:return t===`released`||e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey?`${i}Option`:null;case`Meta`:return t===`released`||e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey?`${i}Command`:null;case`Control`:return i===`Left`&&(t===`released`||e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey)?`LeftControl`:null;default:return null}}function l(n){let r=e(n);return t.has(r)?null:r===` `?`Space`:r===`+`?`Plus`:i.get(r)??(/^f\d{1,2}$/i.test(r)?r.toUpperCase():r.toLowerCase()===`fn`?`Fn`:r.length===1?r.toUpperCase():u(n.code)??r)}function u(e){return e==null?null:/^Key[A-Z]$/.test(e)?e.slice(3):/^Digit[0-9]$/.test(e)?e.slice(5):e===`Space`?`Space`:null}export{o as n,s as r,a as t};
//# sourceMappingURL=keyboard-event-accelerator-C11drJng.js.map