import{fireRouterEvent as t,isFunction as e}from"../utils.js";function vaadinRouterGlobalPopstateHandler(e){if("vaadin-router-ignore"===e.state)return;const{pathname:a,search:n,hash:o}=window.location;t("go",{pathname:a,search:n,hash:o})}/Trident/.test(navigator.userAgent)&&!e(window.PopStateEvent)&&(window.PopStateEvent=function(t,e){e=e||{};var a=document.createEvent("Event");return a.initEvent(t,Boolean(e.bubbles),Boolean(e.cancelable)),a.state=e.state||null,a},window.PopStateEvent.prototype=window.Event.prototype);const a={activate(){window.addEventListener("popstate",vaadinRouterGlobalPopstateHandler)},inactivate(){window.removeEventListener("popstate",vaadinRouterGlobalPopstateHandler)}};export default a;