0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.15.225.188


Current Path : /var/www/egov/build/static/js/
Upload File :
Current File : /var/www/egov/build/static/js/11.5f88ca22.chunk.js

(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{627:function(e,t,n){"use strict";e.exports=n(974)},974:function(e,t,n){"use strict";n.r(t),n.d(t,"HotKeys",function(){return Ye}),n.d(t,"GlobalHotKeys",function(){return Xe}),n.d(t,"IgnoreKeys",function(){return tt}),n.d(t,"ObserveKeys",function(){return nt}),n.d(t,"withHotKeys",function(){return $e}),n.d(t,"withIgnoreKeys",function(){return it}),n.d(t,"withObserveKeys",function(){return ot}),n.d(t,"configure",function(){return rt}),n.d(t,"getApplicationKeyMap",function(){return st}),n.d(t,"recordKeyCombination",function(){return at});var i=n(4),o=n.n(i),r=n(1),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(e,t,n){return(g=function(){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}}()?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 _(e){var t="function"===typeof Map?new Map:void 0;return(_=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("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return g(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 k(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 m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t){return!t||"object"!==typeof t&&"function"!==typeof t?m(e):t}function K(e,t,n){return(K="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 C(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 E(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 I={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 P.option("_ignoreTagsDict")[n]||t.isContentEditable}return!1},ignoreRepeatedEventsWhenKeyHeldDown:!0,simulateMissingKeyPressEvents:!0,stopEventPropagationAfterHandling:!0,stopEventPropagationAfterIgnoring:!0,allowCombinationSubmatches:!1,customKeyCodes:{}},S=d({},I);S._ignoreTagsDict=E(S.ignoreTags,!0);var P=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=E(e.ignoreTags)),i&&(e._customKeyNamesDict=E(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){S[e]=t}},{key:"reset",value:function(e){S[e]=I[e]}},{key:"option",value:function(e){return S[e]}}]),e}(),w=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(w,"logIcons",["\ud83d\udcd5","\ud83d\udcd7","\ud83d\udcd8","\ud83d\udcd9"]),h(w,"componentIcons",["\ud83d\udd3a","\u2b50\ufe0f","\ud83d\udd37","\ud83d\udd36","\u2b1b\ufe0f"]),h(w,"eventIcons",["\u2764\ufe0f","\ud83d\udc9a","\ud83d\udc99","\ud83d\udc9b","\ud83d\udc9c","\ud83e\udde1"]),h(w,"levels",{none:0,error:1,warn:2,info:3,debug:4,verbose:5});var H={keydown:0,keypress:1,keyup:2},M={Shift:["shiftKey"],Meta:["metaKey"],Control:["ctrlKey"],Alt:["altKey"]},T={"`":["~"],1:["!"],2:["@",'"'],3:["#","\xa3"],4:["$"],5:["%"],6:["^"],7:["&"],8:["*"],9:["("],0:[")"],"-":["_"],"=":["plus"],";":[":"],"'":['"',"@"],",":["<"],".":[">"],"/":["?"],"\\":["|"],"[":["{"],"]":["}"],"#":["~"]};function O(e){return T[e]||[1===e.length?e.toUpperCase():e]}function L(e,t){return e.hasOwnProperty(t)}function A(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){L(n,e)||(n[e]=[]),n[e].push(i)}),t.includeOriginal&&(!L(n,i)&&(n[i]=[]),n[i]=[].concat(C(n[i]),C(o))),n},{})}var x=A(T);function D(e){return x[e]||[1===e.length?e.toLowerCase():e]}var q=A({},{includeOriginal:!0});function F(e){return"string"==typeof e}var j={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"},R={cmd:"Meta"};function N(e){var t=e.toLowerCase();return j[t]||R[t]||(e.match(/^f\d+$/)?e.toUpperCase():e)}var U={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"},B=E(Object.values(U),!0);function G(e){return!!B[e]}function z(e){return G(e)||String.fromCharCode(e.charCodeAt(0))===e||function(e){return P.option("_customKeyNamesDict")[e]}(e)}var W=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(m(m(n=b(this,(e=p(t)).call.apply(e,[this].concat(o))))),"name","InvalidKeyNameError"),n}return v(t,_(Error)),t}();function J(e){return e.sort().join("+")}var V=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=function(e){return F(e)?e.trim().replace(/\s+/g," "):e}(e).split(" ");try{var i=n.slice(0,n.length-1),o=n[n.length-1],r=i.map(function(e){var n=$(e,t);return J(Object.keys(n))}).join(" "),s=$(o,t),a={id:J(Object.keys(s)),keyDictionary:s,keyEventType:t.keyEventType,size:Object.keys(s).length};return{sequence:{prefix:r,size:i.length+1},combination:a}}catch(e){return{sequence:null,combination:null}}}}]),e}();function $(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return e.replace(/^\+|(\s|[^+]\+)\+/,"$1plus").split("+").reduce(function(e,n){var i=N(n);if(t.ensureValidKeys&&!z(i))throw new W;return e[i]=!0,e},{})}var Y={"`":["`"],1:["\xa1"],2:["\u2122"],3:["\xa3"],4:["\xa2"],5:["\u221e"],6:["\xa7"],7:["\xb6"],8:["\u2022"],9:["\xaa"],0:["\xba"],"-":["\u2013"],"=":["\u2260"],a:["\xe5"],b:["\u222b"],c:["\xe7"],d:["\u2202"],e:["\xb4"],f:["\u0192"],g:["\xa9"],h:["\u02d9"],i:["\u02c6"],j:["\u2206"],k:["\u02da"],l:["\xac"],m:["\xb5"],n:["\u02dc"],o:["\xf8"],p:["\u03c0"],q:["\u0153"],r:["\xae"],s:["\xdf"],t:["\u2020"],u:["\xa8"],v:["\u221a"],w:["\u2211"],x:["\u2248"],y:["\xa5"],z:["\u03a9"],"[":["\u201c"],"]":["\u2018"],"\\":["\xab"],"'":["\xe6"],";":["\u2026"],",":["\u2264"],".":["\u2265"],"/":["\xf7"]},Q=A(Y);function X(e){return Q[e]||[e]}function Z(e){return Y[e]||[e]}var ee={"`":["`"],1:["\u2044"],2:["\u20ac"],3:["\u2039"],4:["\u203a"],5:["\ufb01"],6:["\ufb02"],7:["\u2021"],8:["\xb0"],9:["\xb7"],0:["\u201a"],"-":["\u2014"],"=":["\xb1"],a:["\xc5"],b:["\u0131"],c:["\xc7"],d:["\xce"],e:["\xb4"],f:["\xcf"],g:["\u02dd"],h:["\xd3"],i:["\u02c6"],j:["\xd4"],k:["\uf8ff"],l:["\xd2"],m:["\xc2"],n:["\u02dc"],o:["\xd8"],p:["\u03c0"],q:["\u0152"],r:["\u2030"],s:["\xcd"],t:["\xce"],u:["\xa8"],v:["\u25ca"],w:["\u201e"],x:["\u02db"],y:["\xc1"],z:["\xb8"],"[":["\u201d"],"]":["\u2019"],"\\":["\xbb"],"'":["\xc6"],";":["\xda"],",":["\xaf"],".":["\u02d8"]},te=A(ee);function ne(e){return te[e]||D(e)}function ie(e){return ee[e]||[e]}var oe=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=ne(e),s=ie(e);o=[].concat(C(o),[e],C(r),C(s))}else{var a=D(e),u=O(e);o=[].concat(C(o),[e],C(a),C(u))}else if(n){var c=X(e),l=Z(e);o=[].concat(C(o),[e],C(c),C(l))}else{o.push(e);var y=q[e];y&&(o=[].concat(C(o),C(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)&&!!V.parse(e,{ensureValidKeys:!0}).combination}}]),e}(),re=0,se=1;function ae(e){return"undefined"==typeof e}var ue={unseen:0,seen:1,simulated:2},ce=function(){function e(){u(this,e)}return l(e,null,[{key:"newRecord",value:function(e,t){var n=[ue.unseen,ue.unseen,ue.unseen];if(!ae(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 le(e){return!Array.isArray(e)&&"object"===a(e)&&null!==e}function he(e){return le(e)?0===Object.keys(e).length:!e||0===e.length}function ye(e){return le(e)?Object.keys(e).length:e.length}var de=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 ye(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 he(this.keysStillPressedDict())}},{key:"addKey",value:function(e,t){this._setKeyState(e,[ce.newRecord(),ce.newRecord(H.keydown,t)])}},{key:"setKeyState",value:function(e,t,n){var i=this._getKeyState(e);if(this.isKeyIncluded(e)){var o=ce.clone(i[1]),r=ce.clone(o);ce.setBit(r,t,n),this._setKeyState(e,[o,r])}else this.addKey(e,n);t===H.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 E(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,H.keypress)&&!this.isKeyReleased(e)}},{key:"isKeyReleased",value:function(e){return this.isEventTriggered(e,H.keyup)}},{key:"isEventTriggered",value:function(e,t){return this._getKeyStateType(e,se,t)}},{key:"wasEventPreviouslyTriggered",value:function(e,t){return this._getKeyStateType(e,re,t)}},{key:"isKeyPressSimulated",value:function(e){return this._isKeyEventSimulated(e,H.keypress)}},{key:"isKeyUpSimulated",value:function(e){return this._isKeyEventSimulated(e,H.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=oe.serialize(this._keys),this._keyAliases=function(e){return Object.keys(e).reduce(function(t,n){return function(e){return q[e]||[e]}(n).forEach(function(i){(function(e){if(e.Shift)return e.Alt?[ie,ne]:[O,D];if(e.Alt)return[Z,X];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)===ue.simulated}},{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 ve=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 de)}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 de(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 de)}},{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}(),pe=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}();function fe(e){return Array.isArray(e)?e:e?[e]:[]}var ge=function(e){function t(){return u(this,t),b(this,p(t).apply(this,arguments))}return v(t,pe),l(t,[{key:"add",value:function(e,n){K(p(t.prototype),"set",this).call(this,e,{childIds:[],parentId:null,keyMap:n})}},{key:"update",value:function(e,n){var i=K(p(t.prototype),"get",this).call(this,e);K(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),K(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=E(fe(t));return Array.isArray(e)?e.reduce(function(e,t){return i[t]&&(n.stringifyFirst||i[t].value===t)||e.push(t),e},[]):le(e)?Object.keys(e).reduce(function(t,n){return i[n]||(t[n]=e[n]),t},{}):e}(n.childIds,t))}}]),t}();var _e=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=ce.newRecord()}return l(e,[{key:"getNewIterator",value:function(){return new _e(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(C(e.slice(0,t)),C(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 P.option("enableHardSequences")?Object.keys(t).reduce(function(n,i){return!!!e[i]&&oe.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(le(s)&&L(s,"sequences")?fe(s.sequences):fe(s)).forEach(function(e){var s=function(e,t){if(le(e)){var n=e.sequence,i=e.action;return{keySequence:n,keyEventType:ae(i)?H[t.defaultKeyEvent]:H[i]}}return{keySequence:e,keyEventType:H[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=V.parse(i,{keyEventType:o}),s=r.sequence,a=r.combination;s.size>this.getLongestSequence()&&(this._longestSequence=s.size,this._longestSequenceComponentId=t),this._keyMapEventRecord[o]=ue.seen,e[n]||(e[n]=[]),e[n].push(d({prefix:s.prefix,actionName:n,sequenceLength:s.size},a))}}]),e}();function me(e,t){return e[e.length-(t+1)]}for(var be={Enter:!0,Backspace:!0,ArrowRight:!0,ArrowLeft:!0,ArrowUp:!0,ArrowDown:!0,CapsLock:!0},Ke=1;13>Ke;Ke++)be["F".concat(Ke)]=!0;function Ce(e){return 1===e.length||L(be,e)}var Ee=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=ye(t.keyDictionary);return P.option("allowCombinationSubmatches")||function(e){return!!e.isKeyStillPressed("Meta")&&e.some(function(e){return Ce(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 Ie=function(){function e(){u(this,e),this._combinationMatchers={},this._eventRecord=ce.newRecord()}return l(e,[{key:"addMatch",value:function(e,t){this._getOrCreateCombinationMatcher(e.prefix).addMatch(e,t),ce.setBit(this._eventRecord,e.keyEventType,ue.seen),(!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 Ee),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=(me(o,a)+1)%(me(i,a)||1);o[o.length-(a+1)]=c,(u=0==c)&&a++}r=a===o.length}}}]),e}(),Se=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 Ie)}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 Pe(e,t,n){return n.forEach(function(n){L(e,n)&&(t[n]=e[n])}),t}function we(e){switch(parseInt(e,10)){case 0:return"keydown";case 1:return"keypress";default:return"keyup"}}function He(e){return e.simulated?ue.simulated:ue.seen}var Me=["sequence","action"],Te=["name","description","group"],Oe=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 w("warn"),this.componentId=-1,this.keyEventManager=n,this._componentTree=new ge,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 ve({maxLength:this.componentList.getLongestSequence()})}},{key:"getKeyHistory",value:function(){return this._keyHistory?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 ve({maxLength:this.componentList.getLongestSequence()},new de(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]={},le(i)?L(i,"sequences")?(Pe(i,t[e],Te),t[e].sequences=n._createSequenceFromConfig(i.sequences)):(Pe(i,t[e],Te),t[e].sequences=[Pe(i,{},Me)]):t[e].sequences=n._createSequenceFromConfig(i)}),n._buildApplicationKeyMap(o,t)}),t}},{key:"_createSequenceFromConfig",value:function(e){return fe(e).map(function(e){return le(e)?Pe(e,{},Me):{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){ae(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!G(e)}(t),i=this.getCurrentCombination();return e===H.keypress?!n||n&&i.isKeyStillPressed("Meta"):e===H.keyup&&Ce(t)&&i.isKeyReleased("Meta")}},{key:"_cloneAndMergeEvent",value:function(e,t){return d({},Object.keys(M).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 Se(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(P.option("allowCombinationSubmatches"))oe.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!!P.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(M).forEach(function(o){if(t!==o||n!==H.keyup){var r=i.getCurrentCombination(),s=r.isKeyStillPressed(o);M[o].forEach(function(t){!1===e[t]&&s&&r.setKeyState(o,H.keyup,He(e))})}})}},{key:"_logPrefix",value:function(){}}]),e}(),Le=function(){function e(){u(this,e)}return l(e,null,[{key:"getId",value:function(){return ae(this._id)&&(this._id=0),this._id}},{key:"incrementId",value:function(){this._id=this.getId()+1}}]),e}();var Ae={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"};function xe(e){var t=function(){var t=P.option("customKeyCodes"),n=e.keyCode||e.charCode;return L(t,n)?t[n]:e.nativeEvent?e.key:function(e){if(e.key){var t=Ae[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?U[e.keyCode]||"Unidentified":""}(e)}();return"+"===t?"plus":t}function De(e){return"Meta"===e}var qe=0,Fe=1,je=2,Re=4,Ne=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()&&(Le.incrementId(),this._key=t.key,this._type=i),!(t.repeat&&P.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()||!P.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]:{}).copyState,n=new e(this._componentList,{logger:this.logger,logPrefix:this._logPrefix});return(void 0===t||t)&&Object.assign(n,this),n}}]),e}(),Ue=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=b(this,p(t).call(this,n,i))).focusTreeId=0,e}return v(t,Oe),l(t,[{key:"_reset",value:function(){K(p(t.prototype),"_reset",this).call(this),this.keypressEventsToSimulate=[],this.focusTreeId+=1,this.eventPropagator=new Ne(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=xe(e);if(t!==this.focusTreeId)return this.eventPropagator.ignoreEvent(e),!0;if(this.eventPropagator.startNewPropagationStep(n,e,o,H.keydown)){if(this._howToHandleKeyEvent(e,t,n,o,i,H.keydown)===Re){var r=He(e),s=this.getCurrentCombination();s.isKeyIncluded(o)||s.isEnding()?this._startAndLogNewKeyCombination(o,t,n,r):this._addToAndLogCurrentKeyCombination(o,H.keydown,t,n,r),this._callHandlerIfActionNotHandled(e,o,H.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 Re}},{key:"_eventIsToBeIgnored",value:function(e,t,n,i){return Fe}},{key:"handleKeyPress",value:function(e,t,n,i){var o=xe(e),r=this.getCurrentCombination();if(r.isKeyPressSimulated(o))return this.eventPropagator.ignoreEvent(e),!0;if(this.eventPropagator.startNewPropagationStep(n,e,o,H.keypress)){var s=t!==this.focusTreeId,a=this._howToHandleKeyEvent(e,t,n,o,i,H.keypress);return this.eventPropagator.isFirstPropagationStep(n)&&r.isKeyIncluded(o)&&this._addToAndLogCurrentKeyCombination(o,H.keypress,t,n,He(e)),a===Re&&this._callHandlerIfActionNotHandled(e,o,H.keypress,n,t),this.eventPropagator.finishPropagationStep(),s}}},{key:"handleKeyUp",value:function(e,t,n,i){var o=xe(e),r=this.getCurrentCombination();if(r.isKeyUpSimulated(o))return this.eventPropagator.ignoreEvent(e),!0;if(this.eventPropagator.startNewPropagationStep(n,e,o,H.keyup)){var s=t!==this.focusTreeId,a=this._howToHandleKeyEvent(e,t,n,o,i,H.keyup);return this.eventPropagator.isFirstPropagationStep(n)&&r.isKeyIncluded(o)&&this._addToAndLogCurrentKeyCombination(o,H.keyup,t,n,He(e)),a===Re&&this._callHandlerIfActionNotHandled(e,o,H.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,ue.simulated)}},{key:"_simulateKeyPressForNonPrintableKeys",value:function(e,t,n,i,o){this._handleEventSimulation("keypressEventsToSimulate","simulatePendingKeyPressEvents",this._shouldSimulate(H.keypress,t),{event:e,key:t,focusTreeId:n,componentId:i,options:o})}},{key:"_simulateKeyUpEventsHiddenByCmd",value:function(e,t,n,i,o){var r=this;De(t)&&this.getCurrentCombination().forEachKey(function(t){De(t)||r._handleEventSimulation("keyupEventsToSimulate","simulatePendingKeyUpEvents",r._shouldSimulate(H.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&&P.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&&Le.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=w.logIcons,i=w.eventIcons,o=w.componentIcons,r="HotKeys (";if(!1!==t.focusTreeId){var s=ae(t.focusTreeId)?this.focusTreeId:t.focusTreeId;r+="F".concat(s).concat(n[s%n.length],"-")}if(!1!==t.eventId){var a=ae(t.eventId)?Le.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 ae(u)||(r+="-P".concat(u).concat(o[u%o.length],":")),"".concat(r,")")}}]),t}();function Be(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return Array.isArray(e)||F(e)?n.stringifyFirst?!ae(e.find(function(e){return e.toString()===t.toString()})):-1!==e.indexOf(t):le(e)?L(e,t):n.stringifyFirst?e.toString()===t.toString():e===t}function Ge(e){return e.replace(/\b\w/g,function(e){return e.toUpperCase()})}var 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=b(this,p(t).call(this,n,i))).listenersBound=!1,e.eventOptions={ignoreEventsCondition:P.option("ignoreEventsCondition")},e.listeners={},e}return v(t,Oe),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(H).forEach(function(t){var n=we(t);document["on".concat(n)]=function(t){e.keyEventManager["handleGlobal".concat(function(e){return"".concat(Ge(e.slice(0,3))).concat(Ge(e.slice(3)))}(n))](t)}}),this.listenersBound=!0):this.listenersBound&&!t&&(Object.values(H).forEach(function(e){var t=we(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=xe(e);if(e.repeat&&P.option("ignoreRepeatedEventsWhenKeyHeldDown"))return!0;this._checkForModifierFlagDiscrepancies(e,t,H.keydown);var n=this._howReactAppRespondedTo(e,t,H.keydown);if(n!==qe||!this.eventOptions.ignoreEventsCondition(e)){if(n!==Fe){var i=He(e),o=this.getCurrentCombination();o.isKeyIncluded(t)||o.isEnding()?this._startAndLogNewKeyCombination(t,i):this._addToAndLogCurrentKeyCombination(t,H.keydown,i)}Be([Fe,Re],n)||this._callHandlerIfExists(e,t,H.keydown),this._simulateKeyPressForNonPrintableKeys(e,t)}}},{key:"_howReactAppRespondedTo",value:function(e,t,n){var i=this.keyEventManager.reactAppHistoryWithEvent(t,n);return i===Re||(i===Fe||(i===je||Le.incrementId())),i}},{key:"handleKeyPress",value:function(e){var t=xe(e);if(e.repeat&&P.option("ignoreRepeatedEventsWhenKeyHeldDown"))return!0;var n=this.getCurrentCombination();if(n.isKeyPressSimulated(t))return!0;var i=this._howReactAppRespondedTo(e,t,H.keypress);return n.isKeyIncluded(t)&&this._addToAndLogCurrentKeyCombination(t,H.keypress,He(e)),i===qe&&(this.keyEventManager.closeHangingKeyCombination(t,H.keypress),this.eventOptions.ignoreEventsCondition(e))?void 0:void(!Be([Fe,Re],i)&&this._callHandlerIfExists(e,t,H.keypress))}},{key:"handleKeyUp",value:function(e){var t=xe(e),n=this.getCurrentCombination();if(n.isKeyUpSimulated(t))return!0;var i=this._howReactAppRespondedTo(e,t,H.keyup);n.isKeyIncluded(t)&&this._addToAndLogCurrentKeyCombination(t,H.keyup,He(e)),i===qe?(this.keyEventManager.closeHangingKeyCombination(t,H.keyup),this.eventOptions.ignoreEventsCondition(e)||!Be([Fe,Re],i)&&this._callHandlerIfExists(e,t,H.keyup)):!Be([Fe,Re],i)&&this._callHandlerIfExists(e,t,H.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(H.keypress,t),{event:e,key:t})}},{key:"_simulateKeyUpEventsHiddenByCmd",value:function(e,t){var n=this;De(t)&&(this.keyEventManager.simulatePendingKeyUpEvents(),this.getCurrentCombination().forEachKey(function(t){De(t)||n._handleEventSimulation("handleKeyUp",n._shouldSimulate(H.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&&P.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(K(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=w.eventIcons,i=w.componentIcons,o="HotKeys (GLOBAL";if(!1!==t.eventId){var r=ae(t.eventId)?Le.getId():t.eventId;o="".concat(o,"-E").concat(r).concat(n[r%n.length])}return ae(e)?"".concat(o,"):"):"".concat(o,"-C").concat(e).concat(i[e%i.length],"):")}}]),t}();function We(e){return!ae(e)}var Je=function(){function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};u(this,e),this.logger=t.logger||new w(P.option("logLevel")),this._focusOnlyEventStrategy=new Ue({configuration:t,logger:this.logger},this),this._globalEventStrategy=new ze({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(We(t))return this._focusOnlyEventStrategy.handleKeydown(e,t,n,i)}},{key:"handleKeyPress",value:function(e,t,n,i){if(We(t))return this._focusOnlyEventStrategy.handleKeyPress(e,t,n,i)}},{key:"handleKeyUp",value:function(e,t,n,i){if(We(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()?Re:n.isIgnoringEvent()?Fe:je:qe}},{key:"simulatePendingKeyPressEvents",value:function(){this._focusOnlyEventStrategy.simulatePendingKeyPressEvents()}},{key:"simulatePendingKeyUpEvents",value:function(){this._focusOnlyEventStrategy.simulatePendingKeyUpEvents()}},{key:"isGlobalListenersBound",value:function(){return this._globalEventStrategy.listenersBound}}]),e}();function Ve(e,t){var n=t.deprecatedAPI,i=n.contextTypes,o=n.childContextTypes,r=t.newAPI.contextType;if("undefined"==typeof 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 $e(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=b(this,p(o).call(this,e)))._handleFocus=t._handleFocus.bind(m(m(t))),t._handleBlur=t._handleBlur.bind(m(m(t))),t._handleKeyDown=t._handleKeyDown.bind(m(m(t))),t._handleKeyPress=t._handleKeyPress.bind(m(m(t))),t._handleKeyUp=t._handleKeyUp.bind(m(m(t))),t._componentIsFocused=t._componentIsFocused.bind(m(m(t))),t._id=Je.getInstance().registerKeyMap(e.keyMap),t._childContext={hotKeysParentId:t._id},t}return v(o,r["PureComponent"]),l(o,[{key:"render",value:function(){var t=this.props,n=(t.keyMap,t.handlers,t.allowChanges,t.root,k(t,["keyMap","handlers","allowChanges","root"])),i={onFocus:this._wrapFunction("onFocus",this._handleFocus),onBlur:this._wrapFunction("onBlur",this._handleBlur),tabIndex:P.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!he(e)||this.props.root||P.option("enableHardSequences")&&this._handlersIncludeHardSequences(e,n(this.props))}},{key:"_handlersIncludeHardSequences",value:function(e,t){return Object.keys(t).some(function(t){return!e[t]&&oe.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=Je.getInstance();if(e.reregisterKeyMap(this._id,this.props.keyMap),this._componentIsFocused()&&(this.props.allowChanges||!P.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=Je.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=Je.getInstance().enableHotKeys(this._id,i(this.props),n(this.props),this._getComponentOptions());ae(t)||this._focusTreeIdsPush(t),this._focused=!0}},{key:"componentWillUnmount",value:function(){var e=Je.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);Je.getInstance().disableHotKeys(this._getFocusTreeId(),this._id)||this._focusTreeIdsShift(),this._focused=!1}},{key:"_handleKeyDown",value:function(e){Je.getInstance().handleKeydown(e,this._getFocusTreeId(),this._id,this._getEventOptions())&&this._focusTreeIdsShift()}},{key:"_handleKeyPress",value:function(e){Je.getInstance().handleKeyPress(e,this._getFocusTreeId(),this._id,this._getEventOptions())&&this._focusTreeIdsShift()}},{key:"_handleKeyUp",value:function(e){Je.getInstance().handleKeyUp(e,this._getFocusTreeId(),this._id,this._getEventOptions())&&this._focusTreeIdsShift()}},{key:"_getComponentOptions",value:function(){return{defaultKeyEvent:P.option("defaultKeyEvent")}}},{key:"_getEventOptions",value:function(){return{ignoreEventsCondition:P.option("ignoreEventsCondition")}}}]),o}();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}),Ve(c,{deprecatedAPI:{contextTypes:{hotKeysParentId:o.a.number},childContextTypes:{hotKeysParentId:o.a.number}},newAPI:{contextType:{hotKeysParentId:void 0}}})}var Ye=$e(function(e){function t(){return u(this,t),b(this,p(t).apply(this,arguments))}return v(t,r["Component"]),l(t,[{key:"render",value:function(){var e=this.props,t=e.hotKeys,n=e.innerRef,i=e.component,o=k(e,["hotKeys","innerRef","component"]),r=i||P.option("defaultComponent");return s.a.createElement(r,d({},t,{ref:n},o))}}]),t}());Ye.propTypes={innerRef:o.a.oneOfType([o.a.object,o.a.func])};var Qe=function(e){function t(e){var n;return u(this,t),(n=b(this,p(t).call(this,e)))._id=Je.getInstance().registerGlobalKeyMap(e.keyMap),n._childContext={globalHotKeysParentId:n._id},n}return v(t,r["Component"]),l(t,[{key:"render",value:function(){return this.props.children||null}},{key:"componentDidUpdate",value:function(){var e=Je.getInstance();if(e.reregisterGlobalKeyMap(this._id,this.props.keyMap),this.props.allowChanges||!P.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=Je.getInstance();o.registerGlobalComponentMount(this._id,i),o.enableGlobalHotKeys(this._id,t,n,this._getComponentOptions(),this._getEventOptions())}},{key:"componentWillUnmount",value:function(){var e=Je.getInstance();e.deregisterGlobalKeyMap(this._id),e.disableGlobalHotKeys(this._id),e.registerGlobalComponentUnmount()}},{key:"_getComponentOptions",value:function(){return{defaultKeyEvent:P.option("defaultKeyEvent")}}},{key:"_getEventOptions",value:function(){return{ignoreEventsCondition:P.option("ignoreEventsCondition")}}}]),t}();h(Qe,"propTypes",{keyMap:o.a.object,handlers:o.a.object,allowChanges:o.a.bool});var Xe=Ve(Qe,{deprecatedAPI:{contextTypes:{globalHotKeysParentId:o.a.number},childContextTypes:{globalHotKeysParentId:o.a.number}},newAPI:{contextType:{globalHotKeysParentId:void 0}}});function Ze(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=b(this,p(n).call(this,e)))._handleKeyEvent=t._handleKeyEvent.bind(m(m(t))),t._reloadDictionaries=t._reloadDictionaries.bind(m(m(t))),t}return v(n,r["PureComponent"]),l(n,[{key:"render",value:function(){var t=this.props,n=(t.only,t.except,k(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=et(t),this._exceptDict=et(n)}},{key:"_shouldIgnoreEvent",value:function(e){var t=e.key;return he(this._onlyDict)?!!he(this._exceptDict)||!L(this._exceptDict,t):he(this._exceptDict)?L(this._onlyDict,t):L(this._onlyDict,t)&&!L(this._exceptDict,t)}},{key:"_handleKeyEvent",value:function(e){this._shouldIgnoreEvent(e)&&Je.getInstance()[a](e)}}]),n}(),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 et(e){return fe(e).reduce(function(e,t){var n=N(t);if(!z(n))throw new W(t);return[ie,ne,O,D,Z,X].forEach(function(t){e[t(n)]=!0}),e},{})}var tt=Ze(function(e){function t(){return u(this,t),b(this,p(t).apply(this,arguments))}return v(t,r["Component"]),l(t,[{key:"render",value:function(){var e=this.props,t=e.hotKeys,n=k(e,["hotKeys"]),i=n.component||P.option("defaultComponent");return s.a.createElement(i,d({},t,n))}}]),t}(),{},"ignoreEvent"),nt=Ze(function(e){function t(){return u(this,t),b(this,p(t).apply(this,arguments))}return v(t,r["Component"]),l(t,[{key:"render",value:function(){var e=this.props,t=e.hotKeys,n=k(e,["hotKeys"]),i=n.component||P.option("defaultComponent");return s.a.createElement(i,d({},t,n))}}]),t}(),{},"observeIgnoredEvents");function it(e){return Ze(e,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{only:[],except:[]},"ignoreEvent")}function ot(e){return Ze(e,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{only:[],except:[]},"observeIgnoredEvents")}function rt(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};P.init(e)}function st(){return Je.getInstance().getApplicationKeyMap()}function at(e){return Je.getInstance().addKeyCombinationListener(e)}}}]);
//# sourceMappingURL=11.5f88ca22.chunk.js.map