/*! hotkeys-js v3.13.7 | MIT © 2024 kenny wong https://jaywcjlove.github.io/hotkeys-js */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).hotkeys=t()}(this,function(){"use strict";var e="undefined"!=typeof navigator&&0o[e.toLowerCase()]||k[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function l(e){t=e||"all"}function K(){return t||"all"}function x(n){if(void 0===n)Object.keys(v).forEach(e=>{Array.isArray(v[e])&&v[e].forEach(e=>s(e)),delete v[e]}),c(null);else if(Array.isArray(n))n.forEach(e=>{e.key&&s(e)});else if("object"==typeof n)n.key&&s(n);else if("string"==typeof n){for(var o=arguments.length,r=Array(1{let{key:t,scope:i,method:l,splitKey:s="+"}=e;m(t).forEach(e=>{var e=e.split(s),t=e.length,n=e[t-1],n="*"===n?"*":E(n);if(v[n]){i=i||K();const o=1{var t=(!l||e.method===l)&&e.scope===i&&function(e,t){var n=e.lengthc(e))}})};function j(t,n,o,e){if(n.element===e){let e;if(n.scope===o||"all"===n.scope){e=0{var t=p[e];n[e]&&!~w.indexOf(t)?w.push(t):!n[e]&&~w.indexOf(t)?w.splice(w.indexOf(t),1):"metaKey"!==e||!n[e]||3!==w.length||n.ctrlKey||n.shiftKey||n.altKey||(w=w.slice(w.indexOf(t)))}),e in g){g[e]=!0;for(const d in k)k[d]===e&&(L[d]=!0);if(!o)return}for(const u in g)Object.prototype.hasOwnProperty.call(g,u)&&(g[u]=n[p[u]]);n.getModifierState&&(!n.altKey||n.ctrlKey)&&n.getModifierState("AltGraph")&&(~w.indexOf(17)||w.push(17),~w.indexOf(18)||w.push(18),g[17]=!0,g[18]=!0);var r=K();if(o)for(let e=0;e{w=[]},O={listener:t,capture:u},y(window,"focus",t,u)))}function c(t){var e,n,o,r=Object.values(v).flat();r.findIndex(e=>{e=e.element;return e===t})<0&&({keydownListener:o,keyupListenr:n,capture:e}=b.get(t)||{},o)&&n&&(i(t,"keyup",n,e),i(t,"keydown",o,e),b.delete(t)),0{var{keydownListener:t,keyupListenr:n,capture:o}=b.get(e)||{};t&&n&&(i(e,"keyup",n,o),i(e,"keydown",t,o),b.delete(e))}),b.clear(),Object.keys(v).forEach(e=>delete v[e]),O&&({listener:n,capture:o}=O,i(window,"focus",n,o),O=null))}var n={getPressedKeyString:function(){return w.map(e=>{return n=e,Object.keys(o).find(e=>o[e]===n)||(t=e,Object.keys(k).find(e=>k[e]===t))||String.fromCharCode(e);var t,n})},setScope:l,getScope:K,deleteScope:function(e,t){var n;let o;e=e||K();for(const r in v)if(Object.prototype.hasOwnProperty.call(v,r))for(n=v[r],o=0;o{e=e.element;return c(e)}):o++;K()===e&&l(t||"all")},getPressedKeyCodes:function(){return w.slice(0)},getAllKeyCodes:function(){const r=[];return Object.keys(v).forEach(e=>{v[e].forEach(e=>{var{key:e,scope:t,mods:n,shortcut:o}=e;r.push({scope:t,shortcut:o,mods:n,keys:e.split("+").map(e=>E(e))})})}),r},isPressed:function(e){return"string"==typeof e&&(e=E(e)),!!~w.indexOf(e)},filter:function(e){var t=(e=e.target||e.srcElement)["tagName"];let n=!0;var o="INPUT"===t&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(e.type);return n=!e.isContentEditable&&(!o&&"TEXTAREA"!==t&&"SELECT"!==t||e.readOnly)?n:!1},trigger:function(t){let n=1{v[e].filter(e=>e.scope===n&&e.shortcut===t).forEach(e=>{e&&e.method&&e.method()})})},unbind:x,keyMap:o,modifier:k,modifierMap:p};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(L[r]=n[r]);if("undefined"!=typeof window){const a=window.hotkeys;L.noConflict=e=>(e&&window.hotkeys===L&&(window.hotkeys=a),L),window.hotkeys=L}return L});