define(["exports"],function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0;var tempDiv=document.createElement("div");function htmlEncode(value){return tempDiv.textContent=value,tempDiv.innerHTML}var windowSize,windowSizeEventsBound,_animationEvent,_transitionEvent,supportsCaptureOption=!1;try{var opts=Object.defineProperty({},"capture",{get:function(){supportsCaptureOption=!0}});window.addEventListener("test",null,opts)}catch(e){}function addEventListenerWithOptions(target,type,handler,options){var optionsOrCapture=supportsCaptureOption?options:options.capture;target.addEventListener(type,handler,optionsOrCapture)}function clearWindowSize(){windowSize=null}function whichAnimationEvent(){if(_animationEvent)return _animationEvent;var el=document.createElement("div"),animations={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(var t in animations)if(void 0!==el.style[t])return _animationEvent=animations[t];return _animationEvent="animationend"}function stripScriptsWithDom(s){var div=document.createElement("div");div.innerHTML=s;for(var scripts=div.getElementsByTagName("script"),i=scripts.length;i--;)scripts[i].parentNode.removeChild(scripts[i]);for(var elems=div.getElementsByTagName("*"),i=0,length=elems.length;i<length;i++){var elem=elems[i];!function(elem){for(var whitelist=[],attributes=elem.attributes,i=attributes.length;i--;){var attr=attributes[i];-1===whitelist.indexOf(attr.name)&&elem.removeAttributeNode(attr)}}(elem),"A"===elem.tagName&&0===elem.href.indexOf("javascript")&&elem.setAttribute("href","#")}return div.innerHTML}var _default={addEventListener:addEventListenerWithOptions,removeEventListener:function(target,type,handler,options){var optionsOrCapture=supportsCaptureOption?options:options.capture;target.removeEventListener(type,handler,optionsOrCapture)},getWindowSize:function(){var win;return windowSize||(win=window,windowSize={innerHeight:win.innerHeight,innerWidth:win.innerWidth},windowSizeEventsBound||(addEventListenerWithOptions(window,"orientationchange",clearWindowSize,{passive:windowSizeEventsBound=!0}),addEventListenerWithOptions(window,"resize",clearWindowSize,{passive:!0}))),windowSize},whichTransitionEvent:function(){if(_transitionEvent)return _transitionEvent;var el=document.createElement("div"),transitions={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(var t in transitions)if(void 0!==el.style[t])return _transitionEvent=transitions[t];return _transitionEvent="transitionend"},whichAnimationEvent:whichAnimationEvent,whichAnimationCancelEvent:function(){return whichAnimationEvent().replace("animationend","animationcancel").replace("AnimationEnd","AnimationCancel")},htmlEncode:htmlEncode,supportsEventListenerOnce:function(){return supportsCaptureOption},stripScripts:function(s){try{return stripScriptsWithDom(s)}catch(err){return htmlEncode(s)}}};_exports.default=_default});