define(["exports","../utils.js"],(function(e,t){"use strict";function vaadinRouterGlobalClickHandler(e){if(e.defaultPrevented)return;if(0!==e.button)return;if(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;let a=e.target;const o=e.composedPath?e.composedPath():e.path||[];for(let t=0;t<o.length;t++){const e=o[t];if(e.nodeName&&"a"===e.nodeName.toLowerCase()){a=e;break}}for(;a&&"a"!==a.nodeName.toLowerCase();)a=a.parentNode;if(!a||"a"!==a.nodeName.toLowerCase())return;if(a.target&&"_self"!==a.target.toLowerCase())return;if(a.hasAttribute("download"))return;if(a.hasAttribute("router-ignore"))return;if(a.pathname===window.location.pathname&&""!==a.hash)return;if((a.origin||function getAnchorOrigin(e){const t=e.port,a=e.protocol;return`${a}//${"http:"===a&&"80"===t||"https:"===a&&"443"===t?e.hostname:e.host}`}(a))!==window.location.origin)return;const{pathname:r,search:n,hash:i}=a;(0,t.fireRouterEvent)("go",{pathname:r,search:n,hash:i})&&e.preventDefault()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a={activate(){window.document.addEventListener("click",vaadinRouterGlobalClickHandler)},inactivate(){window.document.removeEventListener("click",vaadinRouterGlobalClickHandler)}};e.default=a}));