!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require,exports):"function"==typeof define&&define.amd&&define(["require","exports"],e)}(function(e,t){"use strict";function n(t){if(null===t)t=document.documentElement;else if(!function(e){switch((e=getComputedStyle(e)).overflowX){case"auto":case"scroll":return 1}switch(e.overflowY){case"auto":case"scroll":return 1}}(t))return;return{scrollIntoView:function(e){e.right>t.scrollLeft+t.clientWidth&&(t.scrollLeft=e.right-t.clientWidth),e.left<t.scrollLeft&&(t.scrollLeft=e.left),e.bottom>t.scrollTop+t.clientHeight&&(t.scrollTop=e.bottom-t.clientHeight),e.top<t.scrollTop&&(t.scrollTop=e.top)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.applyFocusBehavior=function(e){var t;null===e.onmousedown&&(t=!1,e.onmousedown=function(){t=!0},e.onmouseup=function(){t=!1},e.onfocus=function(){var e;t?this.select():(e=this.value.length,this.setSelectionRange(e,e))})},t.setClass=function(e,t,o){var n,i;void 0!==e.classList?o?e.classList.add(t):e.classList.remove(t):(i=(n=e.className.split(" ")).indexOf(t),o?i<0?n.push(t):n=void 0:i<0?n=void 0:n.splice(i,1),void 0!==n&&(e.className=n.join(" ")))},t.scrollIntoView=function(e){for(;e instanceof HTMLElement;){var t=function(e,t){if(void 0===t)return{left:e.offsetLeft,top:e.offsetTop,right:e.offsetLeft+e.offsetWidth+e.scrollWidth-e.clientWidth,bottom:e.offsetTop+e.offsetHeight+e.scrollHeight-e.clientHeight};var o=e.offsetLeft+e.clientLeft,e=e.offsetTop+e.clientTop;return{left:o+t.left,top:e+t.top,right:o+t.right,bottom:e+t.bottom}}(e,t),o=n(e.offsetParent);if(void 0!==o){o.scrollIntoView(t);break}e=e.offsetParent}},t.captureMouseEvents=function(o){var n=!1;function i(e){return o(e),n=!0,e.stopPropagation(),e.preventDefault(),!1}addEventListener("mousemove",i,!0),addEventListener("mouseup",function e(t){if(removeEventListener("mousemove",i,!0),removeEventListener("mouseup",e,!0),n)return o(void 0),t.stopPropagation(),t.preventDefault(),!1},!0)}});