mirror of
https://gitee.com/dcren/cloud-native-app-initializer.git
synced 2025-07-17 01:46:19 +08:00
2 lines
63 KiB
JavaScript
2 lines
63 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{233:function(e,t,n){"use strict";e.exports=n(234)},234:function(e,t,n){"use strict";n.r(t),n.d(t,"HotKeys",(function(){return Ze})),n.d(t,"GlobalHotKeys",(function(){return tt})),n.d(t,"IgnoreKeys",(function(){return ot})),n.d(t,"ObserveKeys",(function(){return rt})),n.d(t,"withHotKeys",(function(){return Xe})),n.d(t,"withIgnoreKeys",(function(){return st})),n.d(t,"withObserveKeys",(function(){return at})),n.d(t,"configure",(function(){return ut})),n.d(t,"getApplicationKeyMap",(function(){return ct})),n.d(t,"recordKeyCombination",(function(){return lt}));var i=n(1),o=n.n(i),r=n(0),s=n.n(r);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(){return(y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){h(e,t,n[t])}))}return e}function v(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function _(e,t,n){return(_=g()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&f(o,n.prototype),o}).apply(null,arguments)}function k(e){var t="function"==typeof Map?new Map:void 0;return(k=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return _(e,arguments,p(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),f(i,e)})(e)}function m(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?b(e):t}function C(e,t,n){return(C="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function E(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function I(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return e.reduce((function(e,n){return e[n]=t||{value:n},e}),{})}var S={logLevel:"warn",defaultKeyEvent:"keydown",defaultComponent:"div",defaultTabIndex:"-1",ignoreTags:["input","select","textarea"],enableHardSequences:!1,ignoreKeymapAndHandlerChangesByDefault:!0,ignoreEventsCondition:function(e){var t=e.target;if(t&&t.tagName){var n=t.tagName.toLowerCase();return w.option("_ignoreTagsDict")[n]||t.isContentEditable}return!1},ignoreRepeatedEventsWhenKeyHeldDown:!0,simulateMissingKeyPressEvents:!0,stopEventPropagationAfterHandling:!0,stopEventPropagationAfterIgnoring:!0,allowCombinationSubmatches:!1,customKeyCodes:{}},P=d({},S);P._ignoreTagsDict=I(P.ignoreTags,!0);var w=function(){function e(){u(this,e)}return l(e,null,[{key:"init",value:function(e){var t=this,n=e.ignoreTags,i=e.customKeyCodes;n&&(e._ignoreTagsDict=I(e.ignoreTags)),i&&(e._customKeyNamesDict=I(Object.values(e.customKeyCodes))),-1!==["verbose","debug","info"].indexOf(e.logLevel)&&console.warn("React HotKeys: You have requested log level '".concat(e.logLevel,"' but for performance reasons, logging below severity level 'warning' is disabled in production. Please use the development build for complete logs.")),Object.keys(e).forEach((function(n){t.set(n,e[n])}))}},{key:"set",value:function(e,t){P[e]=t}},{key:"reset",value:function(e){P[e]=S[e]}},{key:"option",value:function(e){return P[e]}}]),e}(),H=function(){function e(){var t=this,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"warn";u(this,e),h(this,"verbose",this.noop),h(this,"debug",this.noop),h(this,"info",this.noop),h(this,"warn",this.noop),h(this,"error",this.noop),this.logLevel=this.constructor.levels[n],this.logLevel>=this.constructor.levels.error&&(this.error=console.error,this.logLevel>=this.constructor.levels.warn&&(this.warn=console.warn,["info","debug","verbose"].some((function(e){return!(t.logLevel>=t.constructor.levels[e]&&(t[e]=console.log,1))}))))}return l(e,[{key:"noop",value:function(){}}]),e}();h(H,"logIcons",["📕","📗","📘","📙"]),h(H,"componentIcons",["🔺","⭐️","🔷","🔶","⬛️"]),h(H,"eventIcons",["❤️","💚","💙","💛","💜","🧡"]),h(H,"levels",{none:0,error:1,warn:2,info:3,debug:4,verbose:5});var M={keydown:0,keypress:1,keyup:2},T={Shift:["shiftKey"],Meta:["metaKey"],Control:["ctrlKey"],Alt:["altKey"]},O={"`":["~"],1:["!"],2:["@",'"'],3:["#","£"],4:["$"],5:["%"],6:["^"],7:["&"],8:["*"],9:["("],0:[")"],"-":["_"],"=":["plus"],";":[":"],"'":['"',"@"],",":["<"],".":[">"],"/":["?"],"\\":["|"],"[":["{"],"]":["}"],"#":["~"]};function L(e){return O[e]||[1===e.length?e.toUpperCase():e]}function A(e,t){return e.hasOwnProperty(t)}function x(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(n,i){var o=e[i];return o.forEach((function(e){A(n,e)||(n[e]=[]),n[e].push(i)})),t.includeOriginal&&(!A(n,i)&&(n[i]=[]),n[i]=[].concat(E(n[i]),E(o))),n}),{})}var D=x(O);function q(e){return D[e]||[1===e.length?e.toLowerCase():e]}var F=x({},{includeOriginal:!0});function j(e){return"string"==typeof e}function R(e){return j(e)?e.trim().replace(/\s+/g," "):e}var N={tab:"Tab",capslock:"CapsLock",shift:"Shift",meta:"Meta",alt:"Alt",ctrl:"Control",space:" ",spacebar:" ",escape:"Escape",esc:"Escape",left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown",return:"Enter",del:"Delete",command:"Meta",option:"Alt",enter:"Enter",backspace:"Backspace",ins:"Insert",pageup:"PageUp",pagedown:"PageDown",end:"End",home:"Home",contextmenu:"ContextMenu",numlock:"Clear"},U={cmd:"Meta"};function B(e){var t=e.toLowerCase();return N[t]||U[t]||(e.match(/^f\d+$/)?e.toUpperCase():e)}var G={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},z=I(Object.values(G),!0);function W(e){return!!z[e]}function J(e){return W(e)||String.fromCharCode(e.charCodeAt(0))===e||function(e){return w.option("_customKeyNamesDict")[e]}(e)}var V=function(e){function t(){var e,n;u(this,t);for(var i=arguments.length,o=Array(i),r=0;r<i;r++)o[r]=arguments[r];return h(b(b(n=K(this,(e=p(t)).call.apply(e,[this].concat(o))))),"name","InvalidKeyNameError"),n}return v(t,e),t}(k(Error));function $(e){return e.sort().join("+")}var Y=function(){function e(){u(this,e)}return l(e,null,[{key:"parse",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=R(e),i=n.split(" ");try{var o=i.slice(0,i.length-1),r=i[i.length-1],s=o.map((function(e){var n=Q(e,t);return $(Object.keys(n))})).join(" "),a=Q(r,t),u=$(Object.keys(a)),c={id:u,keyDictionary:a,keyEventType:t.keyEventType,size:Object.keys(a).length};return{sequence:{prefix:s,size:o.length+1},combination:c}}catch(e){return{sequence:null,combination:null}}}}]),e}();function Q(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return e.replace(/^\+|(\s|[^+]\+)\+/,"$1plus").split("+").reduce((function(e,n){var i=B(n);if(t.ensureValidKeys&&!J(i))throw new V;return e[i]=!0,e}),{})}var X={"`":["`"],1:["¡"],2:["™"],3:["£"],4:["¢"],5:["∞"],6:["§"],7:["¶"],8:["•"],9:["ª"],0:["º"],"-":["–"],"=":["≠"],a:["å"],b:["∫"],c:["ç"],d:["∂"],e:["´"],f:["ƒ"],g:["©"],h:["˙"],i:["ˆ"],j:["∆"],k:["˚"],l:["¬"],m:["µ"],n:["˜"],o:["ø"],p:["π"],q:["œ"],r:["®"],s:["ß"],t:["†"],u:["¨"],v:["√"],w:["∑"],x:["≈"],y:["¥"],z:["Ω"],"[":["“"],"]":["‘"],"\\":["«"],"'":["æ"],";":["…"],",":["≤"],".":["≥"],"/":["÷"]},Z=x(X);function ee(e){return Z[e]||[e]}function te(e){return X[e]||[e]}var ne={"`":["`"],1:["⁄"],2:["€"],3:["‹"],4:["›"],5:["fi"],6:["fl"],7:["‡"],8:["°"],9:["·"],0:["‚"],"-":["—"],"=":["±"],a:["Å"],b:["ı"],c:["Ç"],d:["Î"],e:["´"],f:["Ï"],g:["˝"],h:["Ó"],i:["ˆ"],j:["Ô"],k:[""],l:["Ò"],m:["Â"],n:["˜"],o:["Ø"],p:["π"],q:["Œ"],r:["‰"],s:["Í"],t:["Î"],u:["¨"],v:["◊"],w:["„"],x:["˛"],y:["Á"],z:["¸"],"[":["”"],"]":["’"],"\\":["»"],"'":["Æ"],";":["Ú"],",":["¯"],".":["˘"]},ie=x(ne);function oe(e){return ie[e]||q(e)}function re(e){return ne[e]||[e]}var se=function(){function e(){u(this,e)}return l(e,null,[{key:"serialize",value:function(e){var t=e.Shift,n=e.Alt,i={};return Object.keys(e).sort().forEach((function(e){var o=[];if(t)if(n){var r=oe(e),s=re(e);o=[].concat(E(o),[e],E(r),E(s))}else{var a=q(e),u=L(e);o=[].concat(E(o),[e],E(a),E(u))}else if(n){var c=ee(e),l=te(e);o=[].concat(E(o),[e],E(c),E(l))}else{o.push(e);var y=F[e];y&&(o=[].concat(E(o),E(y)))}var v=Object.keys(i);0<v.length?v.forEach((function(e){o.forEach((function(t){i[e+"+".concat(t)]=d({},i[e],h({},t,!0))})),delete i[e]})):o.forEach((function(e){i[e]=h({},e,!0)}))})),Object.values(i).map((function(e){return Object.keys(e).sort().join("+")}))}},{key:"isValidKeySerialization",value:function(e){return!!(0<e.length)&&!!Y.parse(e,{ensureValidKeys:!0}).combination}}]),e}(),ae=0,ue=1;function ce(e){return void 0===e}var le=0,he=1,ye=2,de=function(){function e(){u(this,e)}return l(e,null,[{key:"newRecord",value:function(e,t){var n=[le,le,le];if(!ce(e))for(var i=0;i<=e;i++)n[i]=t;return n}},{key:"setBit",value:function(e,t,n){return e[t]=n,e}},{key:"clone",value:function(e){for(var t=this.newRecord(),n=0;n<e.length;n++)t[n]=e[n];return t}}]),e}();function ve(e){return!Array.isArray(e)&&"object"===a(e)&&null!==e}function pe(e){return ve(e)?0===Object.keys(e).length:!e||0===e.length}function fe(e){return ve(e)?Object.keys(e).length:e.length}var ge=function(){function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};u(this,e),this._keys=t,this._includesKeyUp=!1,this._update()}return l(e,[{key:"getIds",value:function(){return this._ids}},{key:"getKeyAliases",value:function(){return this._keyAliases}},{key:"getNormalizedKeyName",value:function(e){if(this._keys[e])return e;var t=this._keyAliases[e];return t||e}},{key:"getNumberOfKeys",value:function(){return fe(this._keys)}},{key:"any",value:function(){return 0<Object.keys(this._getKeyStates()).length}},{key:"isEnding",value:function(){return this._includesKeyUp}},{key:"hasEnded",value:function(){return pe(this.keysStillPressedDict())}},{key:"addKey",value:function(e,t){this._setKeyState(e,[de.newRecord(),de.newRecord(M.keydown,t)])}},{key:"setKeyState",value:function(e,t,n){var i=this._getKeyState(e);if(this.isKeyIncluded(e)){var o=de.clone(i[1]),r=de.clone(o);de.setBit(r,t,n),this._setKeyState(e,[o,r])}else this.addKey(e,n);t===M.keyup&&(this._includesKeyUp=!0)}},{key:"forEachKey",value:function(e){return Object.keys(this._keys).forEach(e)}},{key:"some",value:function(e){return Object.keys(this._keys).some(e)}},{key:"getKeyDictionary",value:function(){return I(Object.keys(this._getKeyStates()),!0)}},{key:"keysStillPressedDict",value:function(){var e=this;return Object.keys(this._keys).reduce((function(t,n){return e.isKeyStillPressed(n)&&(t[n]=e._getKeyState(n)),t}),{})}},{key:"isKeyIncluded",value:function(e){return!!this._getKeyState(e)}},{key:"isKeyStillPressed",value:function(e){return this.isEventTriggered(e,M.keypress)&&!this.isKeyReleased(e)}},{key:"isKeyReleased",value:function(e){return this.isEventTriggered(e,M.keyup)}},{key:"isEventTriggered",value:function(e,t){return this._getKeyStateType(e,ue,t)}},{key:"wasEventPreviouslyTriggered",value:function(e,t){return this._getKeyStateType(e,ae,t)}},{key:"isKeyPressSimulated",value:function(e){return this._isKeyEventSimulated(e,M.keypress)}},{key:"isKeyUpSimulated",value:function(e){return this._isKeyEventSimulated(e,M.keyup)}},{key:"describe",value:function(){return this.getIds()[0]}},{key:"toJSON",value:function(){return{keys:this._getKeyStates(),ids:this.getIds(),keyAliases:this.getKeyAliases()}}},{key:"_getKeyStateType",value:function(e,t,n){var i=this._getKeyState(e);return i&&i[t][n]}},{key:"_update",value:function(){this._ids=se.serialize(this._keys),this._keyAliases=function(e){return Object.keys(e).reduce((function(t,n){return function(e){return F[e]||[e]}(n).forEach((function(i){(function(e){if(e.Shift)return e.Alt?[re,oe]:[L,q];if(e.Alt)return[te,ee];var t=function(e){return[e]};return[t,t]})(e).forEach((function(e){e(i).forEach((function(e){(e!==n||n!==i)&&(t[e]=n)}))}))})),t}),{})}(this._keys)}},{key:"_isKeyEventSimulated",value:function(e,t){return this.isEventTriggered(e,t)===ye}},{key:"_getKeyStates",value:function(){return this._keys}},{key:"_getKeyState",value:function(e){var t=this._keys[e];if(t)return t;var n=this._keyAliases[e];return n?this._keys[n]:void 0}},{key:"_setKeyState",value:function(e,t){var n=this.getNormalizedKeyName(e);this._keys[n]=t,this._update()}}]),e}();var _e=function(){function e(t){var n=t.maxLength,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;u(this,e),this._records=[],this._maxLength=n,i?this._push(i):this._push(new ge)}return l(e,[{key:"getMostRecentCombinations",value:function(e){return this._records.slice(-e,-1)}},{key:"any",value:function(){return this._records.some((function(e){return e.any()}))}},{key:"getLength",value:function(){return this._records.length}},{key:"getCurrentCombination",value:function(){return this._records[this.getLength()-1]}},{key:"addKeyToCurrentCombination",value:function(e,t,n){this._ensureInitialKeyCombination(),this.getCurrentCombination().setKeyState(e,t,n)}},{key:"setMaxLength",value:function(e){this._maxLength=e,this._trimHistory()}},{key:"startNewKeyCombination",value:function(e,t){this._ensureInitialKeyCombination();var n=new ge(this.getCurrentCombination().keysStillPressedDict());n.addKey(e,t),this._push(n)}},{key:"toJSON",value:function(){return this._records.map((function(e){return e.toJSON()}))}},{key:"_ensureInitialKeyCombination",value:function(){0===this.getLength()&&this._push(new ge)}},{key:"_push",value:function(e){this._trimHistory(),this._records.push(e)}},{key:"_trimHistory",value:function(){for(;this.getLength()>this._maxLength;)this._shift()}},{key:"_shift",value:function(){this._records.shift()}}]),e}();function ke(e){return Array.isArray(e)?e:e?[e]:[]}var me=function(e){function t(){return u(this,t),K(this,p(t).apply(this,arguments))}return v(t,e),l(t,[{key:"add",value:function(e,n){C(p(t.prototype),"set",this).call(this,e,{childIds:[],parentId:null,keyMap:n})}},{key:"update",value:function(e,n){var i=C(p(t.prototype),"get",this).call(this,e);C(p(t.prototype),"set",this).call(this,e,d({},i,{keyMap:n}))}},{key:"setParent",value:function(e,t){this.get(e).parentId=t,this._addChildId(t,e)}},{key:"remove",value:function(e){var n=this._getParentId(e);this._removeChildId(n,e),C(p(t.prototype),"remove",this).call(this,e)}},{key:"_getParentId",value:function(e){var t=this.get(e);return t&&t.parentId}},{key:"_addChildId",value:function(e,t){this.get(e).childIds.push(t)}},{key:"_removeChildId",value:function(e,t){var n=this.get(e);n&&(n.childIds=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=I(ke(t));return Array.isArray(e)?e.reduce((function(e,t){return i[t]&&(n.stringifyFirst||i[t].value===t)||e.push(t),e}),[]):ve(e)?Object.keys(e).reduce((function(t,n){return i[n]||(t[n]=e[n]),t}),{}):e}(n.childIds,t))}}]),t}(function(){function e(){u(this,e),this._registry={}}return l(e,[{key:"get",value:function(e){return this._registry[e]}},{key:"set",value:function(e,t){this._registry[e]=t}},{key:"remove",value:function(e){delete this._registry[e]}},{key:"toJSON",value:function(){return this._registry}}]),e}());var be=function(){function e(t){u(this,e),this._list=t,this._position=-1}return l(e,[{key:"getPosition",value:function(){return this._position}},{key:"getComponent",value:function(){return this._list.getAtPosition(this.getPosition())}},{key:"next",value:function(){return this.getPosition()+1<this._list.getLength()?(this._position++,this.getComponent()):null}}]),e}(),Ke=function(){function e(){u(this,e),this._list=[],this._idToIndex={},this._longestSequence=1,this._longestSequenceComponentId=null,this._keyMapEventRecord=de.newRecord()}return l(e,[{key:"getNewIterator",value:function(){return new be(this)}},{key:"add",value:function(e,t,n,i){if(this.containsId(e))return this.update(e,t,n,i);var o=this._build(e,t,n,i);this._list.push(o);var r=this._getLastIndex();return this._idToIndex[e]=r}},{key:"containsId",value:function(e){return!!this.get(e)}},{key:"get",value:function(e){return this.getAtPosition(this.getIndexById(e))}},{key:"getIndexById",value:function(e){return this._idToIndex[e]}},{key:"update",value:function(e,t,n,i){var o=this._isUpdatingComponentWithLongestSequence(e),r=this.getLongestSequence(),s=this._build(e,t,n,i);o&&s.sequenceLength!==r&&(s.sequenceLength>r?this._longestSequence=s.sequenceLength:this._recalculateLongestSequence()),this._list[this.getIndexById(e)]=s}},{key:"remove",value:function(e){var t=this._isUpdatingComponentWithLongestSequence(e);this.removeAtPosition(this.getIndexById(e)),t&&this._recalculateLongestSequence()}},{key:"any",value:function(){return 0!==this.getLength()}},{key:"isRoot",value:function(e){return this.getIndexById(e)>=this.getLength()-1}},{key:"getLongestSequence",value:function(){return this._longestSequence}},{key:"anyActionsForEventType",value:function(e){return!!this._keyMapEventRecord[e]}},{key:"getLength",value:function(){return this._list.length}},{key:"getAtPosition",value:function(e){return this._list[e]}},{key:"removeAtPosition",value:function(e){this._list=function(e,t){return[].concat(E(e.slice(0,t)),E(e.slice(t+1)))}(this._list,e);for(var t=e;t<this.getLength();)this._idToIndex[this.getAtPosition(t).componentId]=t,t++}},{key:"toJSON",value:function(){return this._list}},{key:"_getLastIndex",value:function(){return this.getLength()-1}},{key:"_build",value:function(e,t,n,i){var o=this._applyHardSequences(t,n),r=o.keyMap,s=o.handlers;return{actions:this._buildActionDictionary(d({},t,r),i,e),handlers:s,componentId:e,options:i}}},{key:"_isUpdatingComponentWithLongestSequence",value:function(e){return e===this._getLongestSequenceComponentId()}},{key:"_getLongestSequenceComponentId",value:function(){return this._longestSequenceComponentId}},{key:"_recalculateLongestSequence",value:function(){for(var e=this.getNewIterator();e.next();){var t=e.getComponent(),n=t.longestSequence,i=t.componentId;n>this.getLongestSequence()&&(this._longestSequenceComponentId=i,this._longestSequence=n)}}},{key:"_applyHardSequences",value:function(e,t){return w.option("enableHardSequences")?Object.keys(t).reduce((function(n,i){return!!!e[i]&&se.isValidKeySerialization(i)&&(n.keyMap[i]=i),n.handlers[i]=t[i],n}),{keyMap:{},handlers:{}}):{keyMap:e,handlers:t}}},{key:"_buildActionDictionary",value:function(e,t,n){var i=this;return Object.keys(e).reduce((function(o,r){var s=e[r];return(ve(s)&&A(s,"sequences")?ke(s.sequences):ke(s)).forEach((function(e){var s=function(e,t){if(ve(e)){var n=e.sequence,i=e.action;return{keySequence:n,keyEventType:ce(i)?M[t.defaultKeyEvent]:M[i]}}return{keySequence:e,keyEventType:M[t.defaultKeyEvent]}}(e,t),a=s.keySequence,u=s.keyEventType;i._addActionOptions(o,n,r,a,u)})),o}),{})}},{key:"_addActionOptions",value:function(e,t,n,i,o){var r=Y.parse(i,{keyEventType:o}),s=r.sequence,a=r.combination;s.size>this.getLongestSequence()&&(this._longestSequence=s.size,this._longestSequenceComponentId=t),this._keyMapEventRecord[o]=he,e[n]||(e[n]=[]),e[n].push(d({prefix:s.prefix,actionName:n,sequenceLength:s.size},a))}}]),e}();function Ce(e,t){return e[e.length-(t+1)]}for(var Ee={Enter:!0,Backspace:!0,ArrowRight:!0,ArrowLeft:!0,ArrowUp:!0,ArrowDown:!0,CapsLock:!0},Ie=1;13>Ie;Ie++)Ee["F".concat(Ie)]=!0;function Se(e){return 1===e.length||A(Ee,e)}var Pe=function(){function e(){u(this,e),this._actionConfigs={},this._order=null}return l(e,[{key:"addMatch",value:function(e,t){if(this._includesMatcherForCombination(e.id)){var n=e.keyEventType,i=e.actionName,o=e.id;this._addHandlerToActionConfig(o,{keyEventType:n,actionName:i,handler:t})}else this._addNewActionConfig(e,t)}},{key:"findMatch",value:function(e,t,n){this._order||this._setOrder();var i=!0,o=!1,r=void 0;try{for(var s,a=this._order[Symbol.iterator]();!(i=(s=a.next()).done);i=!0){var u=s.value,c=this._actionConfigs[u];if(this._matchesActionConfig(e,t,n,c))return c}}catch(e){o=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(o)throw r}}return null}},{key:"toJSON",value:function(){return{actionConfigs:this._actionConfigs,order:this._order}}},{key:"_matchesActionConfig",value:function(e,t,n,i){if(!function(e,t){var n=fe(t.keyDictionary);return w.option("allowCombinationSubmatches")||function(e){return!!e.isKeyStillPressed("Meta")&&e.some((function(e){return Se(e)}))}(e)?e.getNumberOfKeys()>=n:e.getNumberOfKeys()===n}(e,i))return!1;if(!i.events[n])return!1;var o=!1;return Object.keys(i.keyDictionary).every((function(i){return!!e.isEventTriggered(i,n)&&(t&&t===e.getNormalizedKeyName(i)&&(o=!e.wasEventPreviouslyTriggered(i,n)),!0)}))&&o}},{key:"_setOrder",value:function(){var e=Object.values(this._actionConfigs).reduce((function(e,t){var n=t.id,i=t.size;return e[i]||(e[i]=[]),e[i].push(n),e}),{});this._order=Object.keys(e).sort((function(e,t){return t-e})).reduce((function(t,n){return t.concat(e[n])}),[])}},{key:"_addNewActionConfig",value:function(e,t){var n=e.prefix,i=e.sequenceLength,o=e.id,r=e.keyDictionary,s=e.size,a=e.keyEventType,u=e.actionName;this._setCombinationMatcher(o,{prefix:n,sequenceLength:i,id:o,keyDictionary:r,size:s,events:{}}),this._addHandlerToActionConfig(o,{keyEventType:a,actionName:u,handler:t})}},{key:"_addHandlerToActionConfig",value:function(e,t){var n=t.keyEventType,i=t.actionName,o=t.handler,r=this._getCombinationMatcher(e);this._setCombinationMatcher(e,d({},r,{events:d({},r.events,h({},n,{actionName:i,handler:o}))}))}},{key:"_setCombinationMatcher",value:function(e,t){this._actionConfigs[e]=t}},{key:"_getCombinationMatcher",value:function(e){return this._actionConfigs[e]}},{key:"_includesMatcherForCombination",value:function(e){return!!this._getCombinationMatcher(e)}}]),e}();var we=function(){function e(){u(this,e),this._combinationMatchers={},this._eventRecord=de.newRecord()}return l(e,[{key:"addMatch",value:function(e,t){this._getOrCreateCombinationMatcher(e.prefix).addMatch(e,t),de.setBit(this._eventRecord,e.keyEventType,he),(!this._longestSequence||this._longestSequence<e.sequenceLength)&&(this._longestSequence=e.sequenceLength)}},{key:"findMatch",value:function(e,t,n){var i=this._findCombinationMatcher(e);return i?i.findMatch(e.getCurrentCombination(),e.getCurrentCombination().getNormalizedKeyName(t),n):null}},{key:"hasMatchesForEventType",value:function(e){return!!this._eventRecord[e]}},{key:"getLongestSequence",value:function(){return this._longestSequence}},{key:"toJSON",value:function(){var e=this;return Object.keys(this._combinationMatchers).reduce((function(t,n){var i=e._combinationMatchers[n];return t[n]=i.toJSON(),t}),{})}},{key:"_getOrCreateCombinationMatcher",value:function(e){return this._combinationMatchers[e]||(this._combinationMatchers[e]=new Pe),this._combinationMatchers[e]}},{key:"_findCombinationMatcher",value:function(e){var t=e.getMostRecentCombinations(this.getLongestSequence());if(0===t.length)return this._combinationMatchers[""];for(var n=t.map((function(e){return e.getIds()})),i=n.map((function(e){return e.length})),o=Array(n.length).fill(0),r=!1;!r;){var s=o.map((function(e,t){return n[t][e]})).join(" ");if(this._combinationMatchers[s])return this._combinationMatchers[s];for(var a=0,u=!0;u&&a<o.length;){var c=(Ce(o,a)+1)%(Ce(i,a)||1);o[o.length-(a+1)]=c,(u=0==c)&&a++}r=a===o.length}}}]),e}(),He=function(){function e(t){u(this,e),this._keyMapMatchers=[],this._unmatchedHandlerStatus=[],this._handlersDictionary={},this._keySequencesDictionary={};for(var n=t.getNewIterator();n.next();){var i=n.getComponent().handlers;this._unmatchedHandlerStatus.push([Object.keys(i).length,{}]),this._keyMapMatchers.push(new we)}this._componentList=t,this._componentListIterator=t.getNewIterator()}return l(e,[{key:"getKeyHistoryMatcher",value:function(e){if(this._componentHasUnmatchedHandlers(e))for(;this._componentListIterator.next();)this._addHandlersFromComponent(),this._addActionsFromComponent();return this._getKeyHistoryMatcher(e)}},{key:"componentHasActionsBoundToEventType",value:function(e,t){return this.getKeyHistoryMatcher(e).hasMatchesForEventType(t)}},{key:"findMatchingKeySequenceInComponent",value:function(e,t,n,i){return this.componentHasActionsBoundToEventType(e,i)?this.getKeyHistoryMatcher(e).findMatch(t,n,i):null}},{key:"_getKeyHistoryMatcher",value:function(e){return this._keyMapMatchers[e]}},{key:"_addActionsFromComponent",value:function(){var e=this,t=this._componentListIterator.getComponent().actions;Object.keys(t).forEach((function(n){var i=e._getHandlers(n);if(i){var o=i[0],r=e._componentList.getAtPosition(o).handlers[n],s=e._getKeyHistoryMatcher(o);t[n].forEach((function(t){var n=[t.prefix,t.id].join(" ");e._isClosestHandlerFound(n,t)||(s.addMatch(t,r),e._addKeySequence(n,[o,t.keyEventType]))})),i.forEach((function(t){var i=e._getUnmatchedHandlerStatus(t);i[1][n]||(i[1][n]=!0,i[0]--)}))}}))}},{key:"_getHandlers",value:function(e){return this._handlersDictionary[e]}},{key:"_addHandlersFromComponent",value:function(){var e=this,t=this._componentListIterator.getComponent().handlers;Object.keys(t).forEach((function(t){e._addHandler(t)}))}},{key:"_addHandler",value:function(e){this._handlersDictionary[e]||(this._handlersDictionary[e]=[]),this._handlersDictionary[e].push(this._componentListIterator.getPosition())}},{key:"_addKeySequence",value:function(e,t){this._keySequencesDictionary[e]||(this._keySequencesDictionary[e]=[]),this._keySequencesDictionary[e].push(t)}},{key:"_componentHasUnmatchedHandlers",value:function(e){return 0<this._getUnmatchedHandlerStatus(e)[0]}},{key:"_getUnmatchedHandlerStatus",value:function(e){return this._unmatchedHandlerStatus[e]}},{key:"_isClosestHandlerFound",value:function(e,t){return this._keySequencesDictionary[e]&&this._keySequencesDictionary[e].some((function(e){return e[1]===t.keyEventType}))}}]),e}();function Me(e,t,n){return n.forEach((function(n){A(e,n)&&(t[n]=e[n])})),t}function Te(e){switch(parseInt(e,10)){case 0:return"keydown";case 1:return"keypress";default:return"keyup"}}function Oe(e){return e.simulated?ye:he}var Le=["sequence","action"],Ae=["name","description","group"],xe=function(){function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=1<arguments.length?arguments[1]:void 0;u(this,e),this.logger=t.logger||new H("warn"),this.componentId=-1,this.keyEventManager=n,this._componentTree=new me,this.rootComponentId=null,this._reset(),this.resetKeyHistory()}return l(e,[{key:"_reset",value:function(){this.componentList=new Ke,this._initHandlerResolutionState()}},{key:"_newKeyHistory",value:function(){return new _e({maxLength:this.componentList.getLongestSequence()})}},{key:"getKeyHistory",value:function(){return this._keyHistory||(this._keyHistory=this._newKeyHistory()),this._keyHistory}},{key:"_initHandlerResolutionState",value:function(){this._actionResolver=null}},{key:"resetKeyHistory",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.keypressEventsToSimulate=[],this.keyupEventsToSimulate=[],this._keyHistory=this.getKeyHistory().any()&&!e.force?new _e({maxLength:this.componentList.getLongestSequence()},new ge(this.getCurrentCombination().keysStillPressedDict())):this._newKeyHistory()}},{key:"getApplicationKeyMap",value:function(){return null===this.rootComponentId?{}:this._buildApplicationKeyMap([this.rootComponentId],{})}},{key:"_buildApplicationKeyMap",value:function(e,t){var n=this;return e.forEach((function(e){var i=n._componentTree.get(e),o=i.childIds,r=i.keyMap;r&&Object.keys(r).forEach((function(e){var i=r[e];t[e]={},ve(i)?A(i,"sequences")?(Me(i,t[e],Ae),t[e].sequences=n._createSequenceFromConfig(i.sequences)):(Me(i,t[e],Ae),t[e].sequences=[Me(i,{},Le)]):t[e].sequences=n._createSequenceFromConfig(i)})),n._buildApplicationKeyMap(o,t)})),t}},{key:"_createSequenceFromConfig",value:function(e){return ke(e).map((function(e){return ve(e)?Me(e,{},Le):{sequence:e}}))}},{key:"registerKeyMap",value:function(e){return this.componentId+=1,this._componentTree.add(this.componentId,e),this.componentId}},{key:"reregisterKeyMap",value:function(e,t){this._componentTree.update(e,t)}},{key:"registerComponentMount",value:function(e,t){ce(t)?this.rootComponentId=e:this._componentTree.setParent(e,t)}},{key:"deregisterKeyMap",value:function(e){this._componentTree.remove(e),e===this.rootComponentId&&(this.rootComponentId=null)}},{key:"_addComponent",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=3<arguments.length?arguments[3]:void 0;this.componentList.add(e,t,n,i),this.getKeyHistory().setMaxLength(this.componentList.getLongestSequence())}},{key:"_allKeysAreReleased",value:function(){return this.getCurrentCombination().hasEnded()}},{key:"getCurrentCombination",value:function(){return this.getKeyHistory().getCurrentCombination()}},{key:"_shouldSimulate",value:function(e,t){var n=function(e){return!W(e)}(t),i=this.getCurrentCombination();return e===M.keypress?!n||n&&i.isKeyStillPressed("Meta"):e===M.keyup&&Se(t)&&i.isKeyReleased("Meta")}},{key:"_cloneAndMergeEvent",value:function(e,t){return d({},Object.keys(T).reduce((function(t,n){return t[n]=e[n],t}),{}),t)}},{key:"_callClosestMatchingHandler",value:function(e,t,n,i,o){for(this._actionResolver||(this._actionResolver=new He(this.componentList));o<=i;){this._actionResolver.getKeyHistoryMatcher(o);var r=this._actionResolver.findMatchingKeySequenceInComponent(o,this.getKeyHistory(),t,n);this.getCurrentCombination();if(r){var s=r.events[n];if(w.option("allowCombinationSubmatches"))se.serialize(r.keyDictionary);return s.handler(e),this._stopEventPropagationAfterHandlingIfEnabled(e,o),!0}this._actionResolver.componentHasActionsBoundToEventType(o,n),o++}}},{key:"_stopEventPropagationAfterHandlingIfEnabled",value:function(e,t){return!!w.option("stopEventPropagationAfterHandling")&&(this._stopEventPropagation(e,t),!0)}},{key:"_stopEventPropagation",value:function(){throw new Error("_stopEventPropagation must be overridden by a subclass")}},{key:"_checkForModifierFlagDiscrepancies",value:function(e,t,n){var i=this;Object.keys(T).forEach((function(o){if(t!==o||n!==M.keyup){var r=i.getCurrentCombination(),s=r.isKeyStillPressed(o);T[o].forEach((function(t){!1===e[t]&&s&&r.setKeyState(o,M.keyup,Oe(e))}))}}))}},{key:"_logPrefix",value:function(){}}]),e}(),De=function(){function e(){u(this,e)}return l(e,null,[{key:"getId",value:function(){return ce(this._id)&&(this._id=0),this._id}},{key:"incrementId",value:function(){this._id=this.getId()+1}}]),e}();var qe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"};function Fe(e){var t=function(){var t=w.option("customKeyCodes"),n=e.keyCode||e.charCode;return A(t,n)?t[n]:e.nativeEvent?e.key:function(e){if(e.key){var t=qe[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=function(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,10===t&&(t=13),32<=t||13===t?t:0}(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?G[e.keyCode]||"Unidentified":""}(e)}();return"+"===t?"plus":t}function je(e){return"Meta"===e}var Re=0,Ne=1,Ue=2,Be=4,Ge=function(){function e(t,n){var i=n.logger,o=n.logPrefix;u(this,e),this._componentList=t,this._previousPropagation=null,this.logger=i,this._logPrefix=o,this._reset()}return l(e,[{key:"_reset",value:function(){this._previousPosition=-1,this._position=-1,this._actionHandled=!1,this._ignoreEvent=!1,this._observeIgnoredEvents=!1,this._stopping=!1,this._componentId=null,this._key=null,this._type=null}},{key:"isFirstPropagationStep",value:function(){var e=this.getPreviousPosition();return-1===e||e>=this._position}},{key:"isForKey",value:function(e){return this._key===e}},{key:"isForEventType",value:function(e){return this._type===e}},{key:"startNewPropagationStep",value:function(e,t,n,i){return this._position=this._componentList.getIndexById(e),this._componentId=e,this.isFirstPropagationStep()&&(De.incrementId(),this._key=t.key,this._type=i),!(t.repeat&&w.option("ignoreRepeatedEventsWhenKeyHeldDown")&&(this.ignoreEvent(t),1))}},{key:"finishPropagationStep",value:function(){this.isStopped()||this._componentList.isRoot(this._componentId)?(this._previousPropagation=this._clone(),this._reset()):this._previousPosition=this._position}},{key:"getPreviousPropagation",value:function(){return this._previousPropagation||(this._previousPropagation=this._clone({copyState:!1})),this._previousPropagation}},{key:"getPreviousPosition",value:function(){return this._previousPosition}},{key:"observeIgnoredEvents",value:function(){this._observeIgnoredEvents=!0}},{key:"ignoreEvent",value:function(e){return this.setIgnoreEvent(!0),!(!this.isIgnoringEvent()||!w.option("stopEventPropagationAfterIgnoring")||(this.stop(e),this.finishPropagationStep(),0))}},{key:"setIgnoreEvent",value:function(e){this._ignoreEvent=e}},{key:"isIgnoringEvent",value:function(){return!this._observeIgnoredEvents&&this._ignoreEvent}},{key:"isStopped",value:function(){return this._stopping}},{key:"stop",value:function(e){return!this.isStopped()&&(this._stopping=!0,e.simulated||e.stopPropagation(),!0)}},{key:"isPendingPropagation",value:function(){var e=this.getPreviousPosition();return-1!==e&&e+1<this._position}},{key:"isHandled",value:function(){return this._actionHandled}},{key:"setHandled",value:function(){this._actionHandled=!0}},{key:"_clone",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=t.copyState,i=new e(this._componentList,{logger:this.logger,logPrefix:this._logPrefix});return(void 0===n||n)&&Object.assign(i,this),i}}]),e}(),ze=function(e){function t(){var e,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=1<arguments.length?arguments[1]:void 0;return u(this,t),(e=K(this,p(t).call(this,n,i))).focusTreeId=0,e}return v(t,e),l(t,[{key:"_reset",value:function(){C(p(t.prototype),"_reset",this).call(this),this.keypressEventsToSimulate=[],this.focusTreeId+=1,this.eventPropagator=new Ge(this.componentList,{logger:this.logger,logPrefix:this._logPrefix.bind(this)})}},{key:"enableHotKeys",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=3<arguments.length?arguments[3]:void 0;if(this.resetOnNextFocus&&(this._reset(),this.resetOnNextFocus=!1),!this.componentList.containsId(e))return this._addComponent(e,t,n,i),this.focusTreeId}},{key:"updateEnabledHotKeys",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},o=4<arguments.length?arguments[4]:void 0;e===this.focusTreeId&&this.componentList.containsId(t)&&(this.componentList.update(t,n,i,o),this.getKeyHistory().setMaxLength(this.componentList.getLongestSequence()),this._initHandlerResolutionState())}},{key:"disableHotKeys",value:function(e,t){return this.resetOnNextFocus||(this.resetOnNextFocus=!0),this.eventPropagator.isPendingPropagation()}},{key:"handleKeydown",value:function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},o=Fe(e);if(t!==this.focusTreeId)return this.eventPropagator.ignoreEvent(e),!0;var r=this.eventPropagator.startNewPropagationStep(n,e,o,M.keydown);if(r){var s=this._howToHandleKeyEvent(e,t,n,o,i,M.keydown);if(s===Be){var a=Oe(e),u=this.getCurrentCombination();u.isKeyIncluded(o)||u.isEnding()?this._startAndLogNewKeyCombination(o,t,n,a):this._addToAndLogCurrentKeyCombination(o,M.keydown,t,n,a),this._callHandlerIfActionNotHandled(e,o,M.keydown,n,t)}return this._simulateKeyPressForNonPrintableKeys(e,o,t,n,i),this.eventPropagator.finishPropagationStep(),!1}}},{key:"_howToHandleKeyEvent",value:function(e,t,n,i,o,r){if(this.eventPropagator.isFirstPropagationStep()){if(o.ignoreEventsCondition(e)&&this.eventPropagator.ignoreEvent(e))return this._eventIsToBeIgnored(e,n,i,r);this._checkForModifierFlagDiscrepancies(e,i,r)}else if(this.eventPropagator.isIgnoringEvent())return this._eventIsToBeIgnored(e,n,i,r);return Be}},{key:"_eventIsToBeIgnored",value:function(e,t,n,i){return Ne}},{key:"handleKeyPress",value:function(e,t,n,i){var o=Fe(e),r=this.getCurrentCombination();if(r.isKeyPressSimulated(o))return this.eventPropagator.ignoreEvent(e),!0;if(this.eventPropagator.startNewPropagationStep(n,e,o,M.keypress)){var s=t!==this.focusTreeId,a=this._howToHandleKeyEvent(e,t,n,o,i,M.keypress);return this.eventPropagator.isFirstPropagationStep(n)&&r.isKeyIncluded(o)&&this._addToAndLogCurrentKeyCombination(o,M.keypress,t,n,Oe(e)),a===Be&&this._callHandlerIfActionNotHandled(e,o,M.keypress,n,t),this.eventPropagator.finishPropagationStep(),s}}},{key:"handleKeyUp",value:function(e,t,n,i){var o=Fe(e),r=this.getCurrentCombination();if(r.isKeyUpSimulated(o))return this.eventPropagator.ignoreEvent(e),!0;if(this.eventPropagator.startNewPropagationStep(n,e,o,M.keyup)){var s=t!==this.focusTreeId,a=this._howToHandleKeyEvent(e,t,n,o,i,M.keyup);return this.eventPropagator.isFirstPropagationStep(n)&&r.isKeyIncluded(o)&&this._addToAndLogCurrentKeyCombination(o,M.keyup,t,n,Oe(e)),a===Be&&this._callHandlerIfActionNotHandled(e,o,M.keyup,n,t),this._simulateKeyUpEventsHiddenByCmd(e,o,t,n,i),this.eventPropagator.finishPropagationStep(),s}}},{key:"closeHangingKeyCombination",value:function(e,t){var n=this.getCurrentCombination();n.isKeyIncluded(e)&&!n.isEventTriggered(e,t)&&n.setKeyState(e,t,ye)}},{key:"_simulateKeyPressForNonPrintableKeys",value:function(e,t,n,i,o){this._handleEventSimulation("keypressEventsToSimulate","simulatePendingKeyPressEvents",this._shouldSimulate(M.keypress,t),{event:e,key:t,focusTreeId:n,componentId:i,options:o})}},{key:"_simulateKeyUpEventsHiddenByCmd",value:function(e,t,n,i,o){var r=this;je(t)&&this.getCurrentCombination().forEachKey((function(t){je(t)||r._handleEventSimulation("keyupEventsToSimulate","simulatePendingKeyUpEvents",r._shouldSimulate(M.keyup,t),{event:e,key:t,focusTreeId:n,componentId:i,options:o})}))}},{key:"_stopEventPropagation",value:function(e,t){this.eventPropagator.stop(e)}},{key:"getEventPropagator",value:function(){return this.eventPropagator}},{key:"_startAndLogNewKeyCombination",value:function(e,t,n,i){this.getKeyHistory().startNewKeyCombination(e,i)}},{key:"_addToAndLogCurrentKeyCombination",value:function(e,t,n,i,o){this.getKeyHistory().addKeyToCurrentCombination(e,t,o)}},{key:"_handleEventSimulation",value:function(e,t,n,i){var o=i.event,r=i.key,s=i.focusTreeId,a=i.componentId,u=i.options;if(n&&w.option("simulateMissingKeyPressEvents")){var c=this._cloneAndMergeEvent(o,{key:r,simulated:!0});this[e].push({event:c,focusTreeId:s,componentId:a,options:u})}(this.componentList.isRoot(a)||this.eventPropagator.isStopped())&&!this.keyEventManager.isGlobalListenersBound()&&this[t]()}},{key:"simulatePendingKeyPressEvents",value:function(){this._simulatePendingKeyEvents("keypressEventsToSimulate","handleKeyPress")}},{key:"simulatePendingKeyUpEvents",value:function(){this._simulatePendingKeyEvents("keyupEventsToSimulate","handleKeyUp")}},{key:"_simulatePendingKeyEvents",value:function(e,t){var n=this;0<this[e].length&&De.incrementId(),this[e].forEach((function(e){var i=e.event,o=e.focusTreeId,r=e.componentId,s=e.options;n[t](i,o,r,s)})),this[e]=[]}},{key:"_callHandlerIfActionNotHandled",value:function(e,t,n,i,o){this.getCurrentCombination().describe();if(this.componentList.anyActionsForEventType(n))if(this.eventPropagator.isHandled());else{var r=this.eventPropagator.getPreviousPosition(),s=this.componentList.getIndexById(i);this._callClosestMatchingHandler(e,t,n,s,-1===r?0:r)&&this.eventPropagator.setHandled()}}},{key:"_logPrefix",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=H.logIcons,i=H.eventIcons,o=H.componentIcons,r="HotKeys (";if(!1!==t.focusTreeId){var s=ce(t.focusTreeId)?this.focusTreeId:t.focusTreeId;r+="F".concat(s).concat(n[s%n.length],"-")}if(!1!==t.eventId){var a=ce(t.eventId)?De.getId():t.eventId;r+="E".concat(a).concat(i[a%i.length],"-")}r+="C".concat(e).concat(o[e%o.length]);var u=this.componentList.getIndexById(e);return ce(u)||(r+="-P".concat(u).concat(o[u%o.length],":")),"".concat(r,")")}}]),t}(xe);function We(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return Array.isArray(e)||j(e)?n.stringifyFirst?!ce(e.find((function(e){return e.toString()===t.toString()}))):-1!==e.indexOf(t):ve(e)?A(e,t):n.stringifyFirst?e.toString()===t.toString():e===t}function Je(e){return e.replace(/\b\w/g,(function(e){return e.toUpperCase()}))}var Ve=function(e){function t(){var e,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=1<arguments.length?arguments[1]:void 0;return u(this,t),(e=K(this,p(t).call(this,n,i))).listenersBound=!1,e.eventOptions={ignoreEventsCondition:w.option("ignoreEventsCondition")},e.listeners={},e}return v(t,e),l(t,[{key:"enableHotKeys",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=3<arguments.length?arguments[3]:void 0,o=4<arguments.length?arguments[4]:void 0;this.eventOptions=o,this._addComponent(e,t,n,i),this._updateDocumentHandlers(),this._initHandlerResolutionState()}},{key:"updateEnabledHotKeys",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=3<arguments.length?arguments[3]:void 0,o=4<arguments.length?arguments[4]:void 0;this.eventOptions=o,this.componentList.update(e,t,n,i),this.getKeyHistory().setMaxLength(this.componentList.getLongestSequence()),this._updateDocumentHandlers(),this._initHandlerResolutionState()}},{key:"disableHotKeys",value:function(e){this.componentList.remove(e),this.getKeyHistory().setMaxLength(this.componentList.getLongestSequence()),this._updateDocumentHandlers(),this._initHandlerResolutionState()}},{key:"_updateDocumentHandlers",value:function(){var e=this,t=this._listenersShouldBeBound();!this.listenersBound&&t?(Object.values(M).forEach((function(t){var n=Te(t);document["on".concat(n)]=function(t){e.keyEventManager["handleGlobal".concat(function(e){return"".concat(Je(e.slice(0,3))).concat(Je(e.slice(3)))}(n))](t)}})),this.listenersBound=!0):this.listenersBound&&!t&&(Object.values(M).forEach((function(e){var t=Te(e);delete document["on".concat(t)]})),this.listenersBound=!1)}},{key:"_listenersShouldBeBound",value:function(){return this.componentList.any()||this.listeners.keyCombination}},{key:"handleKeydown",value:function(e){var t=Fe(e);if(e.repeat&&w.option("ignoreRepeatedEventsWhenKeyHeldDown"))return!0;this._checkForModifierFlagDiscrepancies(e,t,M.keydown);var n=this._howReactAppRespondedTo(e,t,M.keydown);if(n!==Re||!this.eventOptions.ignoreEventsCondition(e)){if(n!==Ne){var i=Oe(e),o=this.getCurrentCombination();o.isKeyIncluded(t)||o.isEnding()?this._startAndLogNewKeyCombination(t,i):this._addToAndLogCurrentKeyCombination(t,M.keydown,i)}We([Ne,Be],n)||this._callHandlerIfExists(e,t,M.keydown),this._simulateKeyPressForNonPrintableKeys(e,t)}}},{key:"_howReactAppRespondedTo",value:function(e,t,n){var i=this.keyEventManager.reactAppHistoryWithEvent(t,n);return i===Be||i===Ne||i===Ue||De.incrementId(),i}},{key:"handleKeyPress",value:function(e){var t=Fe(e);if(e.repeat&&w.option("ignoreRepeatedEventsWhenKeyHeldDown"))return!0;var n=this.getCurrentCombination();if(n.isKeyPressSimulated(t))return!0;var i=this._howReactAppRespondedTo(e,t,M.keypress);return n.isKeyIncluded(t)&&this._addToAndLogCurrentKeyCombination(t,M.keypress,Oe(e)),i===Re&&(this.keyEventManager.closeHangingKeyCombination(t,M.keypress),this.eventOptions.ignoreEventsCondition(e))?void 0:void(!We([Ne,Be],i)&&this._callHandlerIfExists(e,t,M.keypress))}},{key:"handleKeyUp",value:function(e){var t=Fe(e),n=this.getCurrentCombination();if(n.isKeyUpSimulated(t))return!0;var i=this._howReactAppRespondedTo(e,t,M.keyup);n.isKeyIncluded(t)&&this._addToAndLogCurrentKeyCombination(t,M.keyup,Oe(e)),i===Re?(this.keyEventManager.closeHangingKeyCombination(t,M.keyup),this.eventOptions.ignoreEventsCondition(e)||!We([Ne,Be],i)&&this._callHandlerIfExists(e,t,M.keyup)):!We([Ne,Be],i)&&this._callHandlerIfExists(e,t,M.keyup),this._simulateKeyUpEventsHiddenByCmd(e,t),this.listeners.keyCombination&&this._allKeysAreReleased()&&this.listeners.keyCombination({keys:n.getKeyDictionary(),id:n.describe()})}},{key:"_simulateKeyPressForNonPrintableKeys",value:function(e,t){this.keyEventManager.simulatePendingKeyPressEvents(),this._handleEventSimulation("handleKeyPress",this._shouldSimulate(M.keypress,t),{event:e,key:t})}},{key:"_simulateKeyUpEventsHiddenByCmd",value:function(e,t){var n=this;je(t)&&(this.keyEventManager.simulatePendingKeyUpEvents(),this.getCurrentCombination().forEachKey((function(t){je(t)||n._handleEventSimulation("handleKeyUp",n._shouldSimulate(M.keyup,t),{event:e,key:t})})))}},{key:"_startAndLogNewKeyCombination",value:function(e,t){this.getKeyHistory().startNewKeyCombination(e,t)}},{key:"_addToAndLogCurrentKeyCombination",value:function(e,t,n){this.getKeyHistory().addKeyToCurrentCombination(e,t,n)}},{key:"_handleEventSimulation",value:function(e,t,n){var i=n.event,o=n.key;if(t&&w.option("simulateMissingKeyPressEvents")){var r=this._cloneAndMergeEvent(i,{key:o,simulated:!0});this[e](r)}}},{key:"_callHandlerIfExists",value:function(e,t,n){this.getCurrentCombination().describe();return this.componentList.anyActionsForEventType(n)?void this._callClosestMatchingHandler(e,t,n):void 0}},{key:"_callClosestMatchingHandler",value:function(e,n,i){for(var o=this.componentList.getNewIterator();o.next();)if(C(p(t.prototype),"_callClosestMatchingHandler",this).call(this,e,n,i,o.getPosition(),0))return}},{key:"_stopEventPropagation",value:function(e,t){e.simulated||e.stopPropagation()}},{key:"addKeyCombinationListener",value:function(e){var t=this,n=function(){delete t.listeners.keyCombination};return this.listeners.keyCombination=function(t){e(t),n()},this._updateDocumentHandlers(),n}},{key:"_logPrefix",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=H.eventIcons,i=H.componentIcons,o="HotKeys (GLOBAL";if(!1!==t.eventId){var r=ce(t.eventId)?De.getId():t.eventId;o="".concat(o,"-E").concat(r).concat(n[r%n.length])}return ce(e)?"".concat(o,"):"):"".concat(o,"-C").concat(e).concat(i[e%i.length],"):")}}]),t}(xe);function $e(e){return!ce(e)}var Ye=function(){function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};u(this,e),this.logger=t.logger||new H(w.option("logLevel")),this._focusOnlyEventStrategy=new ze({configuration:t,logger:this.logger},this),this._globalEventStrategy=new Ve({configuration:t,logger:this.logger},this),this.mountedComponentsCount=0}return l(e,null,[{key:"getInstance",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.instance||(this.instance=new e(t)),this.instance}},{key:"clear",value:function(){delete this.instance}}]),l(e,[{key:"getApplicationKeyMap",value:function(){return Object.assign(this._globalEventStrategy.getApplicationKeyMap(),this._focusOnlyEventStrategy.getApplicationKeyMap())}},{key:"registerKeyMap",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this._focusOnlyEventStrategy.registerKeyMap(e)}},{key:"reregisterKeyMap",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this._focusOnlyEventStrategy.reregisterKeyMap(e,t)}},{key:"deregisterKeyMap",value:function(e){this._focusOnlyEventStrategy.deregisterKeyMap(e)}},{key:"registerComponentMount",value:function(e,t){return this._incrementComponentCount(),this._focusOnlyEventStrategy.registerComponentMount(e,t)}},{key:"registerComponentUnmount",value:function(){this._decrementComponentCount()}},{key:"_incrementComponentCount",value:function(){var e=this,t=this.mountedComponentsCount;this.mountedComponentsCount+=1,0===t&&1===this.mountedComponentsCount&&(window.onblur=function(){return e._clearKeyHistory()})}},{key:"_decrementComponentCount",value:function(){var e=this.mountedComponentsCount;this.mountedComponentsCount-=1,1===e&&0===this.mountedComponentsCount&&delete window.onblur}},{key:"_clearKeyHistory",value:function(){this._focusOnlyEventStrategy.resetKeyHistory({force:!0}),this._globalEventStrategy.resetKeyHistory({force:!0})}},{key:"registerGlobalKeyMap",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this._globalEventStrategy.registerKeyMap(e)}},{key:"registerGlobalComponentUnmount",value:function(){this._decrementComponentCount()}},{key:"registerGlobalComponentMount",value:function(e,t){return this._incrementComponentCount(),this._globalEventStrategy.registerComponentMount(e,t)}},{key:"reregisterGlobalKeyMap",value:function(e,t){this._globalEventStrategy.reregisterKeyMap(e,t)}},{key:"deregisterGlobalKeyMap",value:function(e){this._globalEventStrategy.deregisterKeyMap(e)}},{key:"addKeyCombinationListener",value:function(e){return this._globalEventStrategy.addKeyCombinationListener(e)}},{key:"enableHotKeys",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=3<arguments.length?arguments[3]:void 0;return this._focusOnlyEventStrategy.enableHotKeys(e,t,n,i)}},{key:"updateEnabledHotKeys",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},o=4<arguments.length?arguments[4]:void 0;return this._focusOnlyEventStrategy.updateEnabledHotKeys(e,t,n,i,o)}},{key:"disableHotKeys",value:function(e,t){return this._focusOnlyEventStrategy.disableHotKeys(e,t)}},{key:"handleKeydown",value:function(e,t,n,i){if($e(t))return this._focusOnlyEventStrategy.handleKeydown(e,t,n,i)}},{key:"handleKeyPress",value:function(e,t,n,i){if($e(t))return this._focusOnlyEventStrategy.handleKeyPress(e,t,n,i)}},{key:"handleKeyUp",value:function(e,t,n,i){if($e(t))return this._focusOnlyEventStrategy.handleKeyUp(e,t,n,i)}},{key:"enableGlobalHotKeys",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=3<arguments.length?arguments[3]:void 0,o=4<arguments.length?arguments[4]:void 0;return this._globalEventStrategy.enableHotKeys(e,t,n,i,o)}},{key:"updateEnabledGlobalHotKeys",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=3<arguments.length?arguments[3]:void 0,o=4<arguments.length?arguments[4]:void 0;return this._globalEventStrategy.updateEnabledHotKeys(e,t,n,i,o)}},{key:"disableGlobalHotKeys",value:function(e){return this._globalEventStrategy.disableHotKeys(e)}},{key:"handleGlobalKeyDown",value:function(e){return this._globalEventStrategy.handleKeydown(e)}},{key:"handleGlobalKeyPress",value:function(e){return this._globalEventStrategy.handleKeyPress(e)}},{key:"handleGlobalKeyUp",value:function(e){return this._globalEventStrategy.handleKeyUp(e)}},{key:"ignoreEvent",value:function(e){this._focusOnlyEventStrategy.getEventPropagator().ignoreEvent(e)}},{key:"observeIgnoredEvents",value:function(e){this._focusOnlyEventStrategy.getEventPropagator().observeIgnoredEvents(e)}},{key:"closeHangingKeyCombination",value:function(e,t){this._focusOnlyEventStrategy.closeHangingKeyCombination(e,t)}},{key:"reactAppHistoryWithEvent",value:function(e,t){var n=this._focusOnlyEventStrategy.eventPropagator.getPreviousPropagation();return n.isForKey(e)&&n.isForEventType(t)?n.isHandled()?Be:n.isIgnoringEvent()?Ne:Ue:Re}},{key:"simulatePendingKeyPressEvents",value:function(){this._focusOnlyEventStrategy.simulatePendingKeyPressEvents()}},{key:"simulatePendingKeyUpEvents",value:function(){this._focusOnlyEventStrategy.simulatePendingKeyUpEvents()}},{key:"isGlobalListenersBound",value:function(){return this._globalEventStrategy.listenersBound}}]),e}();function Qe(e,t){var n=t.deprecatedAPI,i=n.contextTypes,o=n.childContextTypes,r=t.newAPI.contextType;if(void 0===s.a.createContext)e.contextTypes=i,e.childContextTypes=o,e.prototype.getChildContext=function(){return this._childContext};else{var a=s.a.createContext(r);e.contextType=a,e.prototype._originalRender=e.prototype.render,e.prototype.render=function(){var e=this._originalRender();return e?s.a.createElement(a.Provider,{value:this._childContext},e):null}}return e}function Xe(e){function t(e,t){return d({},a[e]||{},t[e]||{})}function n(e){return t("handlers",e)}function i(e){return t("keyMap",e)}var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=function(t){function o(e){var t;return u(this,o),(t=K(this,p(o).call(this,e)))._handleFocus=t._handleFocus.bind(b(b(t))),t._handleBlur=t._handleBlur.bind(b(b(t))),t._handleKeyDown=t._handleKeyDown.bind(b(b(t))),t._handleKeyPress=t._handleKeyPress.bind(b(b(t))),t._handleKeyUp=t._handleKeyUp.bind(b(b(t))),t._componentIsFocused=t._componentIsFocused.bind(b(b(t))),t._id=Ye.getInstance().registerKeyMap(e.keyMap),t._childContext={hotKeysParentId:t._id},t}return v(o,t),l(o,[{key:"render",value:function(){var t=this.props,n=(t.keyMap,t.handlers,t.allowChanges,t.root,m(t,["keyMap","handlers","allowChanges","root"])),i={onFocus:this._wrapFunction("onFocus",this._handleFocus),onBlur:this._wrapFunction("onBlur",this._handleBlur),tabIndex:w.option("defaultTabIndex")};return this._shouldBindKeyListeners()&&(i.onKeyDown=this._handleKeyDown,i.onKeyPress=this._handleKeyPress,i.onKeyUp=this._handleKeyUp),s.a.createElement(e,y({hotKeys:i},n))}},{key:"_shouldBindKeyListeners",value:function(){var e=i(this.props);return!pe(e)||this.props.root||w.option("enableHardSequences")&&this._handlersIncludeHardSequences(e,n(this.props))}},{key:"_handlersIncludeHardSequences",value:function(e,t){return Object.keys(t).some((function(t){return!e[t]&&se.isValidKeySerialization(t)}))}},{key:"_wrapFunction",value:function(e,t){var n=this;return"function"==typeof this.props[e]?function(i){n.props[e](i),t(i)}:t}},{key:"_focusTreeIdsPush",value:function(e){this._focusTreeIds||(this._focusTreeIds=[]),this._focusTreeIds.push(e)}},{key:"_focusTreeIdsShift",value:function(){this._focusTreeIds&&this._focusTreeIds.shift()}},{key:"_getFocusTreeId",value:function(){if(this._focusTreeIds)return this._focusTreeIds[0]}},{key:"componentDidUpdate",value:function(){var e=Ye.getInstance();if(e.reregisterKeyMap(this._id,this.props.keyMap),this._componentIsFocused()&&(this.props.allowChanges||!w.option("ignoreKeymapAndHandlerChangesByDefault"))){var t=this.props,n=t.keyMap,i=t.handlers;e.updateEnabledHotKeys(this._getFocusTreeId(),this._id,n,i,this._getComponentOptions())}}},{key:"_componentIsFocused",value:function(){return!0===this._focused}},{key:"componentDidMount",value:function(){var e=Ye.getInstance(),t=this.context.hotKeysParentId;e.registerComponentMount(this._id,t)}},{key:"_handleFocus",value:function(){var e;this.props.onFocus&&(e=this.props).onFocus.apply(e,arguments);var t=Ye.getInstance().enableHotKeys(this._id,i(this.props),n(this.props),this._getComponentOptions());ce(t)||this._focusTreeIdsPush(t),this._focused=!0}},{key:"componentWillUnmount",value:function(){var e=Ye.getInstance();e.deregisterKeyMap(this._id),e.registerComponentUnmount(),this._handleBlur()}},{key:"_handleBlur",value:function(){var e;this.props.onBlur&&(e=this.props).onBlur.apply(e,arguments);var t=Ye.getInstance().disableHotKeys(this._getFocusTreeId(),this._id);t||this._focusTreeIdsShift(),this._focused=!1}},{key:"_handleKeyDown",value:function(e){Ye.getInstance().handleKeydown(e,this._getFocusTreeId(),this._id,this._getEventOptions())&&this._focusTreeIdsShift()}},{key:"_handleKeyPress",value:function(e){Ye.getInstance().handleKeyPress(e,this._getFocusTreeId(),this._id,this._getEventOptions())&&this._focusTreeIdsShift()}},{key:"_handleKeyUp",value:function(e){Ye.getInstance().handleKeyUp(e,this._getFocusTreeId(),this._id,this._getEventOptions())&&this._focusTreeIdsShift()}},{key:"_getComponentOptions",value:function(){return{defaultKeyEvent:w.option("defaultKeyEvent")}}},{key:"_getEventOptions",value:function(){return{ignoreEventsCondition:w.option("ignoreEventsCondition")}}}]),o}(r.PureComponent);return h(c,"propTypes",{keyMap:o.a.object,handlers:o.a.object,onFocus:o.a.func,onBlur:o.a.func,allowChanges:o.a.bool,root:o.a.bool}),Qe(c,{deprecatedAPI:{contextTypes:{hotKeysParentId:o.a.number},childContextTypes:{hotKeysParentId:o.a.number}},newAPI:{contextType:{hotKeysParentId:void 0}}})}var Ze=Xe(function(e){function t(){return u(this,t),K(this,p(t).apply(this,arguments))}return v(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.hotKeys,n=e.innerRef,i=e.component,o=m(e,["hotKeys","innerRef","component"]),r=i||w.option("defaultComponent");return s.a.createElement(r,d({},t,{ref:n},o))}}]),t}(r.Component));Ze.propTypes={innerRef:o.a.oneOfType([o.a.object,o.a.func])};var et=function(e){function t(e){var n;return u(this,t),(n=K(this,p(t).call(this,e)))._id=Ye.getInstance().registerGlobalKeyMap(e.keyMap),n._childContext={globalHotKeysParentId:n._id},n}return v(t,e),l(t,[{key:"render",value:function(){return this.props.children||null}},{key:"componentDidUpdate",value:function(){var e=Ye.getInstance();if(e.reregisterGlobalKeyMap(this._id,this.props.keyMap),this.props.allowChanges||!w.option("ignoreKeymapAndHandlerChangesByDefault")){var t=this.props,n=t.keyMap,i=t.handlers;e.updateEnabledGlobalHotKeys(this._id,n,i,this._getComponentOptions(),this._getEventOptions())}}},{key:"componentDidMount",value:function(){var e=this.props,t=e.keyMap,n=e.handlers,i=this.context.globalHotKeysParentId,o=Ye.getInstance();o.registerGlobalComponentMount(this._id,i),o.enableGlobalHotKeys(this._id,t,n,this._getComponentOptions(),this._getEventOptions())}},{key:"componentWillUnmount",value:function(){var e=Ye.getInstance();e.deregisterGlobalKeyMap(this._id),e.disableGlobalHotKeys(this._id),e.registerGlobalComponentUnmount()}},{key:"_getComponentOptions",value:function(){return{defaultKeyEvent:w.option("defaultKeyEvent")}}},{key:"_getEventOptions",value:function(){return{ignoreEventsCondition:w.option("ignoreEventsCondition")}}}]),t}(r.Component);h(et,"propTypes",{keyMap:o.a.object,handlers:o.a.object,allowChanges:o.a.bool});var tt=Qe(et,{deprecatedAPI:{contextTypes:{globalHotKeysParentId:o.a.number},childContextTypes:{globalHotKeysParentId:o.a.number}},newAPI:{contextType:{globalHotKeysParentId:void 0}}});function nt(e){var t,n,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{only:[],except:[]},a=2<arguments.length?arguments[2]:void 0;return n=t=function(t){function n(e){var t;return u(this,n),(t=K(this,p(n).call(this,e)))._handleKeyEvent=t._handleKeyEvent.bind(b(b(t))),t._reloadDictionaries=t._reloadDictionaries.bind(b(b(t))),t}return v(n,t),l(n,[{key:"render",value:function(){var t=this.props,n=(t.only,t.except,m(t,["only","except"])),i={onKeyDown:this._handleKeyEvent,onKeyPress:this._handleKeyEvent,onKeyUp:this._handleKeyEvent,onFocus:this._reloadDictionaries};return s.a.createElement(e,y({hotKeys:i},n))}},{key:"_reloadDictionaries",value:function(){var e=this.props,t=e.only,n=e.except;this._onlyDict=it(t),this._exceptDict=it(n)}},{key:"_shouldIgnoreEvent",value:function(e){var t=e.key;return pe(this._onlyDict)?!!pe(this._exceptDict)||!A(this._exceptDict,t):pe(this._exceptDict)?A(this._onlyDict,t):A(this._onlyDict,t)&&!A(this._exceptDict,t)}},{key:"_handleKeyEvent",value:function(e){this._shouldIgnoreEvent(e)&&Ye.getInstance()[a](e)}}]),n}(r.PureComponent),h(t,"propTypes",{only:o.a.oneOfType([o.a.string,o.a.arrayOf(o.a.string)]),except:o.a.oneOfType([o.a.string,o.a.arrayOf(o.a.string)])}),h(t,"defaultProps",i),n}function it(e){return ke(e).reduce((function(e,t){var n=B(t);if(!J(n))throw new V(t);return[re,oe,L,q,te,ee].forEach((function(t){e[t(n)]=!0})),e}),{})}var ot=nt(function(e){function t(){return u(this,t),K(this,p(t).apply(this,arguments))}return v(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.hotKeys,n=m(e,["hotKeys"]),i=n.component||w.option("defaultComponent");return s.a.createElement(i,d({},t,n))}}]),t}(r.Component),{},"ignoreEvent"),rt=nt(function(e){function t(){return u(this,t),K(this,p(t).apply(this,arguments))}return v(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.hotKeys,n=m(e,["hotKeys"]),i=n.component||w.option("defaultComponent");return s.a.createElement(i,d({},t,n))}}]),t}(r.Component),{},"observeIgnoredEvents");function st(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{only:[],except:[]};return nt(e,t,"ignoreEvent")}function at(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{only:[],except:[]};return nt(e,t,"observeIgnoredEvents")}function ut(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};w.init(e)}function ct(){return Ye.getInstance().getApplicationKeyMap()}function lt(e){return Ye.getInstance().addKeyCombinationListener(e)}}}]);
|
||
//# sourceMappingURL=chunk-75467681fad20cdfd7e8.js.map
|