1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2612],{8714:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=i(17523);function o(e,t){let i=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=i.current;e&&(i.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(i.current=r(e,n)),t&&(o.current=r(t,n))},[e,t])}function r(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let i=e(t);return"function"==typeof i?i:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},16225:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{formatUrl:function(){return r},formatWithValidation:function(){return l},urlObjectKeys:function(){return s}});let n=i(64612)._(i(43839)),o=/https?|ftp|gopher|file/;function r(e){let{auth:t,hostname:i}=e,r=e.protocol||"",s=e.pathname||"",l=e.hash||"",a=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:i&&(c=t+(~i.indexOf(":")?"["+i+"]":i),e.port&&(c+=":"+e.port)),a&&"object"==typeof a&&(a=String(n.urlQueryToSearchParams(a)));let u=e.search||a&&"?"+a||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||o.test(r))&&!1!==c?(c="//"+(c||""),s&&"/"!==s[0]&&(s="/"+s)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),""+r+c+(s=s.replace(/[?#]/g,encodeURIComponent))+(u=u.replace("#","%23"))+l}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return r(e)}},30752:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"errorOnce",{enumerable:!0,get:function(){return i}});let i=e=>{}},41508:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return r}});let n=i(55515),o=i(35626);function r(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),i=new URL(e,t);return i.origin===t&&(0,o.hasBasePath)(i.pathname)}catch(e){return!1}}},43839:(e,t)=>{function i(e){let t={};for(let[i,n]of e.entries()){let e=t[i];void 0===e?t[i]=n:Array.isArray(e)?e.push(n):t[i]=[e,n]}return t}function n(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[i,o]of Object.entries(e))if(Array.isArray(o))for(let e of o)t.append(i,n(e));else t.set(i,n(o));return t}function r(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];for(let t of i){for(let i of t.keys())e.delete(i);for(let[i,n]of t.entries())e.append(i,n)}return e}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{assign:function(){return r},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return o}})},55515:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{DecodeError:function(){return g},MiddlewareNotFoundError:function(){return v},MissingStaticPage:function(){return m},NormalizeError:function(){return b},PageNotFoundError:function(){return p},SP:function(){return d},ST:function(){return f},WEB_VITALS:function(){return i},execOnce:function(){return n},getDisplayName:function(){return a},getLocationOrigin:function(){return s},getURL:function(){return l},isAbsoluteUrl:function(){return r},isResSent:function(){return c},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return u},stringifyError:function(){return y}});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,i=!1;return function(){for(var n=arguments.length,o=Array(n),r=0;r<n;r++)o[r]=arguments[r];
1return i||(i=!0,t=e(...o)),t}}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,r=e=>o.test(e);function s(){let{protocol:e,hostname:t,port:i}=window.location;return e+"//"+t+(i?":"+i:"")}function l(){let{href:e}=window.location,t=s();return e.substring(t.length)}function a(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function c(e){return e.finished||e.headersSent}function u(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function h(e,t){let i=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(i&&c(i))return n;if(!n)throw Object.defineProperty(Error('"'+a(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.'),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let d="undefined"!=typeof performance,f=d&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class b extends Error{}
1class p extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class m extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class v extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function y(e){return JSON.stringify({message:e.message,stack:e.stack})}},66454:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{default:function(){return p},useLinkStatus:function(){return v}});let n=i(64612),o=i(99795),r=n._(i(17523)),s=i(16225),l=i(97815),a=i(14590),c=i(8714),u=i(55515),h=i(62421);i(83642);let d=i(52726),f=i(41508),g=i(98318);function b(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function p(e){let t,i,n,[s,p]=(0,r.useOptimistic)(d.IDLE_LINK_STATUS),v=(0,r.useRef)(null),{href:y,as:S,children:P,prefetch:C=null,passHref:w,replace:k,shallow:E,scroll:T,onClick:O,onMouseEnter:R,onTouchStart:I,legacyBehavior:D=!1,onNavigate:M,ref:L,unstable_dynamicOnHover:x,..._}=e;t=P,D&&("string"==typeof t||"number"==typeof t)&&(t=(0,o.jsx)("a",{children:t}));let A=r.default.useContext(l.AppRouterContext),N=!1!==C,B=null===C||"auto"===C?a.PrefetchKind.AUTO:a.PrefetchKind.FULL,{href:j,as:z}=r.default.useMemo(()=>{let e=b(y);return{href:e,as:S?b(S):e}},[y,S]);D&&(i=r.default.Children.only(t));let H=D?i&&"object"==typeof i&&i.ref:L,F=r.default.useCallback(e=>(null!==A&&(v.current=(0,d.mountLinkInstance)(e,j,A,B,N,p)),()=>{v.current&&((0,d.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,d.unmountPrefetchableInstance)(e)}),[N,j,A,B,p]),V={ref:(0,c.useMergedRef)(F,H),onClick(e){D||"function"!=typeof O||O(e),D&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(e),A&&(e.defaultPrevented||function(e,t,i,n,o,s,l){let{nodeName:a}=e.currentTarget;if(!("A"===a.toUpperCase()&&function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||e.currentTarget.hasAttribute("download"))){if(!(0,f.isLocalURL)(t)){o&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}r.default.startTransition(()=>{(0,g.dispatchNavigateAction)(i||t,o?"replace":"push",null==s||s,n.current)})}}(e,j,z,v,k,T,M))},onMouseEnter(e){D||"function"!=typeof R||R(e),D&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),A&&N&&(0,d.onNavigationIntent)(e.currentTarget,!0===x)},onTouchStart:function(e){D||"function"!=typeof I||I(e),D&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),A&&N&&(0,d.onNavigationIntent)(e.currentTarget,!0===x)}};return(0,u.isAbsoluteUrl)(z)?V.href=z:D&&!w&&("a"!==i.type||"href"in i.props)||(V.href=(0,h.addBasePath)(z)),n=D?r.default.cloneElement(i,V):(0,o.jsx)("a",{..._,...V,children:t}),(0,o.jsx)(m.Provider,{value:s,children:n})}i(30752);let m=(0,r.createContext)(d.IDLE_LINK_STATUS),v=()=>(0,r.useContext)(m);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82817:(e,t,i)=>{i.d(t,{X:()=>et});var n='input:not([inert]),select:not([inert]),textarea:not([inert]),a[href]:not([inert]),button:not([inert]),[tabindex]:not(slot):not([inert]),audio[controls]:not([inert]),video[controls]:not([inert]),[contenteditable]:not([contenteditable="false"]):not([inert]),details>summary:first-of-type:not([inert]),details:not([inert])',o="undefined"==typeof Element,r=o?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,s=!o&&Element.prototype.getRootNode?function(e){var t;return null==e||null==(t=e.getRootNode)?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},l=function(e,t){void 0===t&&(t=!0);var i,n=null==e||null==(i=e.getAttribute)?void 0:i.call(e,"inert");return""===n||"true"===n||t&&e&&l(e.parentNode)},a=function(e){var t,i=null==e||null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return""===i||"true"===i},c=function(e,t,i){if(l(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(n));return t&&r.call(e,n)&&o.unshift(e),o=o.filter(i)},u=function(e,t,i){for(var o=[],s=Array.from(e);s.length;){var a=s.shift();if(!l(a,!1))if("SLOT"===a.tagName){var c=a.assignedElements(),h=u(c.length?c:a.children,!0,i);i.flatten?o.push.apply(o,h):o.push({scopeParent:a,candidates:h})}else{r.call(a,n)&&i.filter(a)&&(t||!e.includes(a))&&o.push(a);var d=a.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(a),f=!l(d,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(a));if(d&&f){var g=u(!0===d?a.children:d.children,!0,i);i.flatten?o.push.apply(o,g):o.push({scopeParent:a,candidates:g})}else s.unshift.apply(s,a.children)}}return o},h=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},d=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||a(e))&&!h(e)?0:e.tabIndex},f=function(e,t){var i=d(e);return i<0&&t&&!h(e)?0:i},g=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},b=function(e){return"INPUT"===e.tagName},p=function(e,t){for(var i=0;i<e.length;i++)if(e[i].checked&&e[i].form===t)return e[i]},m=function(e){if(!e.name)return!0;var t,i=e.form||s(e),n=function(e){return i.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=n(window.CSS.escape(e.name));else try{t=n(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=p(t,e.form);return!o||o===e},v=function(e){return b(e)&&"radio"===e.type&&!m(e)},y=function(e){var t,i,n,o,r,l,a,c=e&&s(e),u=null==(t=c)?void 0:t.host,h=!1;if(c&&c!==e)for(h=!!(null!=(i=u)&&null!=(n=i.ownerDocument)&&n.c
1ontains(u)||null!=e&&null!=(o=e.ownerDocument)&&o.contains(e));!h&&u;)h=!!(null!=(l=u=null==(r=c=s(u))?void 0:r.host)&&null!=(a=l.ownerDocument)&&a.contains(u));return h},S=function(e){var t=e.getBoundingClientRect(),i=t.width,n=t.height;return 0===i&&0===n},P=function(e,t){var i=t.displayCheck,n=t.getShadowRoot;if("full-native"===i&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=r.call(e,"details>summary:first-of-type")?e.parentElement:e;if(r.call(o,"details:not([open]) *"))return!0;if(i&&"full"!==i&&"full-native"!==i&&"legacy-full"!==i){if("non-zero-area"===i)return S(e)}else{if("function"==typeof n){for(var l=e;e;){var a=e.parentElement,c=s(e);if(a&&!a.shadowRoot&&!0===n(a))return S(e);e=e.assignedSlot?e.assignedSlot:a||c===e.ownerDocument?a:c.host}e=l}if(y(e))return!e.getClientRects().length;if("legacy-full"!==i)return!0}return!1},C=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var i=0;i<t.children.length;i++){var n=t.children.item(i);if("LEGEND"===n.tagName)return!!r.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1},w=function(e,t){return!(t.disabled||l(t)||b(t)&&"hidden"===t.type||P(t,e)||"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some(function(e){return"SUMMARY"===e.tagName})||C(t))},k=function(e,t){return!(v(t)||0>d(t))&&!!w(e,t)},E=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!isNaN(t)||!!(t>=0)},T=function(e){var t=[],i=[];return e.forEach(function(e,n){var o=!!e.scopeParent,r=o?e.scopeParent:e,s=f(r,o),l=o?T(e.candidates):r;0===s?o?t.push.apply(t,l):t.push(r):i.push({documentOrder:n,tabIndex:s,item:e,isScope:o,content:l})}),i.sort(g).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},O=function(e,t){return T((t=t||{}).getShadowRoot?u([e],t.includeContainer,{filter:k.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:E}):c(e,t.includeContainer,k.bind(null,t)))},R=class{static intersect(e,t){let i=Math.max(e.left,t.left),n=Math.min(e.right,t.right),o=Math.max(e.top,t.top),r=Math.min(e.bottom,t.bottom),s=Math.max(0,n-i),l=Math.max(0,r-o);return new DOMRect(i,o,s,l)}static clip(e,t){let i={...e.toJSON(),top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right};return i.width=i.right-i.left,i.height=i.bottom-i.top,new DOMRect(i.left,i.top,i.width,i.height)}static clipOffsets(e,t){return{top:t.top-e.top,left:t.left-e.left,bottom:e.bottom-t.bottom,right:e.right-t.right}}static equals(e,t){return null==e||null==t?e===t:e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}static sizeEqual(e,t){return Math.round(e.width)===Math.round(t.width)&&Math.round(e.height)===Math.round(t.height)}},I=[...Array.from({length:1e3},(e,t)=>t/1e3),1],D=class{constructor(e,t,i){this.#e=t,this.#t=i,this.#i=i.clientRect,this.#n(e)}#e;#o=void 0;#t;#i;#r=void 0;get visibleRect(){let e=this.#t.clip;return e?R.clip(this.#i,e):this.#i}get isIntersecting(){let{width:e,height:t}=this.visibleRect;return e>0&&t>0}#n(e){let{root:t,rootBounds:i}=this.#t,{visibleRect:n}=this;this.#o?.disconnect(),this.#o=new IntersectionObserver(this.#s,{root:t,rootMargin:function(e,t){let i=Math.max(e.width,3),n=Math.max(e.height,3),o=e.top-t.top- -1,r=e.left-t.left- -1,s=t.right-e.left-i- -1,l=t.bottom-e.top-n- -1;return`${-Math.round(o)}px ${-Math.round(s)}px ${-Math.round(l)}px ${-Math.round(r)}px`}(n,i),threshold:I}),this.#o.observe(e)}#s=e=>{if(!this.#o)return;let t=e[e.length-1];if(t){let{intersectionRatio:e,boundingClientRect:i}=t,n=this.#i;this.#i=i;let o=this.#r,r=!R.equals(i,n);if(e!==this.#r||r){let n=this.#t.rootBounds,s=R.intersect(i,n),l=s.width>0&&s.height>0;if(!l)return;this.#r=e,(null!=o||r)&&(this.#e(new M(t.target,i,t.intersectionRect,l,n),this),this.#n(t.target))}}};disconnect(){this.#o?.disconnect()}},M=class{constructor(e,t,i,n,o){this.target=e,this.boundingClientRect=t,this.intersectionRect=i,this.isIntersecting=n,this.rootBounds=o}},L=class{constructor(e,t){let i=function(e){return e&&e.nodeType!==Node.DOCUMENT_NODE?e:e?.defaultView??window}(e);if(function(e){return _(e)&&e.nodeType===Node.ELEMENT_NODE}(i)){let e=i.ownerDocument??document;
1this.rootBounds=i.getBoundingClientRect(),this.#l=new ResizeObserver(e=>{for(let i of e){let[{inlineSize:e,blockSize:n}]=i.borderBoxSize;if(R.sizeEqual(this.rootBounds,{width:e,height:n}))continue;let o=i.target.getBoundingClientRect();this.rootBounds=o,t(o,this)}}),this.#l.observe(i),e.addEventListener("scroll",e=>{e.target&&e.target!==i&&_(e.target)&&e.target.contains(i)&&(this.rootBounds=i.getBoundingClientRect(),t(this.rootBounds,this))},{capture:!0,passive:!0,signal:this.#a.signal})}else{let e=i.visualViewport??i;this.rootBounds=x(i);let n=()=>{let e=x(i);R.equals(this.rootBounds,e)||(this.rootBounds=e,t(e,this))};e.addEventListener("resize",n,{signal:this.#a.signal})}}#l;#a=new AbortController;rootBounds;disconnect(){this.#l?.disconnect(),this.#a.abort()}};function x(e){return new DOMRect(0,0,e.visualViewport?.width??e.innerWidth,e.visualViewport?.height??e.innerHeight)}function _(e){return"nodeType"in e}var A=class{constructor(e,t){this.#t=t,this.#e=t=>{let i=[];for(let e of t){let t=this.intersections.get(e.target);this.intersections.set(e.target,e),t?.isIntersecting===e.isIntersecting&&R.equals(t?.intersectionRect,e.intersectionRect)||i.push(e)}i.length>0&&e(i,this)}}#e;#c=new Map;#t;intersections=new WeakMap;observe(e){let t=e.ownerDocument;if(!t)return;let i=this.#c.get(t);i||(i=new IntersectionObserver(this.#e,{...this.#t,threshold:I}),this.#c.set(t,i)),i.observe(e)}unobserve(e){let t=e.ownerDocument;if(!t)return;let i=this.#c.get(t);i&&(i.unobserve(e),this.intersections.delete(e))}disconnect(){for(let e of this.#c.values())e.disconnect();this.#c.clear()}},N=class{constructor(e,t){this.#e=e,this.#t=t,this.#u=new L(t?.root,this.#h),this.#d=new A(this.#f,t),this.#l=new ResizeObserver(this.#g)}#e;#t;#b=new Map;#l;#p=new WeakMap;#u;#d;observe(e){this.#d.observe(e)}unobserve(e){e?(this.#b.get(e)?.disconnect(),this.#d.unobserve(e),this.#p.delete(e)):this.disconnect()}disconnect(){for(let e of this.#b.values())e.disconnect();this.#b.clear(),this.#l.disconnect(),this.#u.disconnect(),this.#d.disconnect()}#m(e){let t=[];for(let o of e){var i,n;let{target:e}=o;i=o,null!=(n=this.#p.get(e))&&i.target===n.target&&i.isIntersecting===n.isIntersecting&&R.equals(i.boundingClientRect,n.boundingClientRect)&&R.equals(i.intersectionRect,n.intersectionRect)||(this.#p.set(e,o),t.push(o))}t.length>0&&this.#e(t)}#h=e=>{let t=[];for(let[i]of this.#b){let n=i.getBoundingClientRect(),o=this.#v(i,n);t.push(new B(i,n,o.visibleRect,o.isIntersecting,e))}this.#m(t)};#v(e,t){let i=this.#d;this.#b.get(e)?.disconnect();let n=new D(e,this.#y,{clientRect:t,root:this.#t?.root,rootBounds:this.#u.rootBounds,get clip(){let t=i.intersections.get(e);if(!t)return;let{intersectionRect:n,boundingClientRect:o}=t;return R.clipOffsets(o,n)}});return this.#b.set(e,n),n}#f=e=>{let t=[];for(let i of e){let{target:e,isIntersecting:n,boundingClientRect:o}=i;n?(this.#v(e,o),this.#l.observe(e)):(this.#b.get(e)?.disconnect(),this.#b.delete(e),this.#l.unobserve(e));let r=this.#b.get(e);t.push(new B(e,o,r?.visibleRect??i.intersectionRect,n,this.#u.rootBounds))}this.#m(t)};#y=(e,t)=>{this.#m([new B(e.target,e.boundingClientRect,t.visibleRect,e.isIntersecting,this.#u.rootBounds)])};#g=e=>{let t=[];for(let i of e){let{target:e,borderBoxSize:n}=i,o=this.#p.get(e);if(o){let[{inlineSize:e,blockSize:t}]=n;if(R.sizeEqual(o.boundingClientRect,{width:e,height:t}))continue}let r=e.getBoundingClientRect(),s=this.#v(e,r);t.push(new B(e,r,s.visibleRect,this.#d.intersections.get(e)?.isIntersecting??!1,this.#u.rootBounds))}this.#m(t)}},B=class{constructor(e,t,i,n,o){this.target=e,this.boundingClientRect=t,this.intersectionRect=i,this.isIntersecting=n,this.rootBounds=o}};function j(e,t,i,n){return e<t?console.warn(`ForesightJS: "${n}" value ${e} is below minimum bound ${t}, clamping to ${t}`):e>i&&console.warn(`ForesightJS: "${n}" value ${e} is above maximum bound ${i}, clamping to ${i}`),Math.min(Math.max(e,t),i)}function z(e){if("number"==typeof e){let t=j(e,0,2e3,"hitslop");return{top:t,left:t,right:t,bottom:t}}return{top:j(e.top,0,2e3,"hitslop - top"),left:j(e.left,0,2e3,"hitslop - left"),right:j(e.right,0,2e3,"hitslop - right"),bottom:j(e.bottom,0,2e3,"hitslop - bottom")}}function H(e,t){return{left:e.left-t.left,right:e.right+t.right,top:e.top-t.top,bottom:e.bottom+t.bottom}}function F(e,t){return e&&t?e.left===t.left&&e.right===t.right&&e.top===t.top&&e.bottom===t.bottom:e===t}function V(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}function U(){return!(typeof window>"u"||typeof navigator>"u")&&window.matchMedia("(pointer: coarse)").matches&&navigator.maxTouchPoints>0}function $(e,t){return void 0!==e&&t!==e}var K=class{constructor(e){this._isConnected=!1,this.elements=e.elements,this.callCallback=e.callCallback,this.emit=e.emit,this.settings=e.settings}get isConnected(){return this._isConnected}disconnect(){this.isConnected&&(this.devLog(`Disconnecting ${this.moduleName}...`),this.abortController?.abort(`${this.moduleName} module disconnected`),this.onDisconnect(),this._isConnected=!1)}connect(){this.devLog(`Connecting ${this.moduleName}...`),this.onConnect(),this._isConnected=!0}devLog(e){if(this.settings.enableManagerLogging){let t=this.moduleName.includes("Predictor")?"#ea580c":"#2563eb";console.log(`%c\u{1F6E0}\uFE0F ${this.moduleName}: ${e}`,`color: ${t}; font-weight: bold;`)}}createAbortController(){this.abortController&&!this.abortController.signal.aborted||(this.abortController=new AbortController,this.devLog(`Created new AbortController for ${this.moduleName}`))}};function W(e,t,i){let n=0,o=1,r=t.x-e.x,s=t.y-e.y,l=(e,t)=>
1{if(0===e){if(t<0)return!1}else{let i=t/e;if(e<0){if(i>o)return!1;i>n&&(n=i)}else{if(i<n)return!1;i<o&&(o=i)}}return!0};return!!l(-r,e.x-i.left)&&!!l(r,i.right-e.x)&&!!l(-s,e.y-i.top)&&!!l(s,i.bottom-e.y)&&n<=o}var q=class extends K{constructor(e){super(e.dependencies),this.moduleName="MousePredictor",this.trajectoryPositions=e.trajectoryPositions}updatePointerState(e){let t={x:e.clientX,y:e.clientY};this.trajectoryPositions.currentPoint=t,this.settings.enableMousePrediction?this.trajectoryPositions.predictedPoint=function(e,t,i){let n=performance.now(),{x:o,y:r}=e;if(t.add({point:e,time:n}),t.length<2)return{x:o,y:r};let[s,l]=t.getFirstLast();if(!s||!l)return{x:o,y:r};let a=(l.time-s.time)*.001;if(0===a)return{x:o,y:r};let c=l.point.x-s.point.x,u=l.point.y-s.point.y,h=.001*i;return{x:o+c/a*h,y:r+u/a*h}}(t,this.trajectoryPositions.positions,this.settings.trajectoryPredictionTime):this.trajectoryPositions.predictedPoint=t}processMouseMovement(e){this.updatePointerState(e);let t=this.settings.enableMousePrediction,i=this.trajectoryPositions.currentPoint;for(let e of this.elements.values()){if(!e.isIntersectingWithViewport||!e.callbackInfo.isCallbackActive||e.callbackInfo.isRunningCallback)continue;let n=e.elementBounds.expandedRect;if(t)W(i,this.trajectoryPositions.predictedPoint,n)&&this.callCallback(e,{kind:"mouse",subType:"trajectory"});else if(V(i,n))return void this.callCallback(e,{kind:"mouse",subType:"hover"})}this.emit({type:"mouseTrajectoryUpdate",predictionEnabled:t,trajectoryPositions:this.trajectoryPositions})}onDisconnect(){}onConnect(){}},G=class extends K{constructor(e){super(e.dependencies),this.moduleName="ScrollPredictor",this.predictedScrollPoint=null,this.scrollDirection=null,this.onDisconnect=()=>this.resetScrollProps(),this.trajectoryPositions=e.trajectoryPositions}resetScrollProps(){this.scrollDirection=null,this.predictedScrollPoint=null}handleScrollPrefetch(e,t){var i;let n,o;e.isIntersectingWithViewport&&!e.callbackInfo.isRunningCallback&&e.callbackInfo.isCallbackActive&&(this.scrollDirection=this.scrollDirection??(i=e.elementBounds.originalRect,n=t.top-i.top,o=t.left-i.left,n<-1?"down":n>1?"up":o<-1?"right":o>1?"left":"none"),"none"!==this.scrollDirection&&(this.predictedScrollPoint=this.predictedScrollPoint??function(e,t,i){let{x:n,y:o}=e,r={x:n,y:o};switch(t){case"down":r.y+=i;break;case"up":r.y-=i;break;case"left":r.x-=i;break;case"right":r.x+=i}return r}(this.trajectoryPositions.currentPoint,this.scrollDirection,this.settings.scrollMargin),W(this.trajectoryPositions.currentPoint,this.predictedScrollPoint,e.elementBounds.expandedRect)&&this.callCallback(e,{kind:"scroll",subType:this.scrollDirection}),this.emit({type:"scrollTrajectoryUpdate",currentPoint:this.trajectoryPositions.currentPoint,predictedPoint:this.predictedScrollPoint,scrollDirection:this.scrollDirection})))}onConnect(){}},J=class extends K{constructor(e){super(e),this.moduleName="TabPredictor",this.lastKeyDown=null,this.tabbableElementsCache=[],this.lastFocusedIndex=null,this.handleKeyDown=e=>{"Tab"===e.key&&(this.lastKeyDown=e)},this.handleFocusIn=e=>{if(!this.lastKeyDown)return;let t=e.target;if(!(t instanceof HTMLElement))return;this.tabbableElementsCache.length&&-1!==this.lastFocusedIndex||(this.devLog("Caching tabbable elements"),this.tabbableElementsCache=O(document.documentElement));let i=this.lastKeyDown.shiftKey,n=function(e,t,i,n){if(null!==t&&t>-1){let o=e?t-1:t+1;if(o>=0&&o<i.length&&i[o]===n)return o}return i.findIndex(e=>e===n)}(i,this.lastFocusedIndex,this.tabbableElementsCache,t);this.lastFocusedIndex=n,this.lastKeyDown=null;let o=[],r=this.settings.tabOffset,s=this.elements;for(let e=0;e<=r;e++){let t=i?n-e:n+e,r=this.tabbableElementsCache[t];r&&r instanceof Element&&s.has(r)&&o.push(r)}for(let e of o){let t=s.get(e);t&&!t.callbackInfo.isRunningCallback&&t.callbackInfo.isCallbackActive&&this.callCallback(t,{kind:"tab",subType:i?"reverse":"forwards"})}}}invalidateCache(){this.tabbableElementsCache.length&&this.devLog("Invalidating tabbable elements cache"),this.tabbableElementsCache=[],this.lastFocusedIndex=null}onConnect(){typeof document>"u"||(this.createAbortController(),document.addEventListener("keydown",this.handleKeyDown,{signal:this.abortController?.signal,passive:!0}),document.addEventListener("focusin",this.handleFocusIn,{signal:this.abortController?.signal,passive:!0}))}onDisconnect(){this.tabbableElementsCache=[],this.lastFocusedIndex=null,this.lastKeyDown=null}},X=class{constructor(e){if(this.head=0,this.count=0,e<=0)throw Error("CircularBuffer capacity must be greater than 0");this.capacity=e,this.buffer=Array(e)}add(e){this.buffer[this.head]=e,this.head=(this.head+1)%this.capacity,this.count<this.capacity&&this.count++}getFirst(){if(0!==this.count)return this.count<this.capacity?this.buffer[0]:this.buffer[this.head]}getLast(){if(0!==this.count){if(this.count<this.capacity)return this.buffer[this.count-1];{let e=(this.head-1+this.capacity)%this.capacity;return this.buffer[e]}}}getFirstLast(){if(0===this.count)return[void 0,void 0];if(1===this.count){let e=this.count<this.capacity?this.buffer[0]:this.buffer[this.head];return[e,e]}return[this.getFirst(),this.getLast()]}resize(e){if(e<=0)throw Error("CircularBuffer capacity must be greater than 0");if(e===this.capacity)return;let t=this.getAllItems();if(this.capacity=e,this.buffer=Array(e),this.head=0,this.count=0,t.length>e)for(let i of t.slice(-e))this.add(i);else for(let e of t)this.add(e)}getAllItems(){if(0===this.count)return[];let e=Array(this.count);if(this.count<this.capacity)for(let t=0;t<this.count;t++)e[t]=this.buffer[t];else{let t=this.head;for(let i=0;i<this.capacity;i++){let n=(t+i)%this.capacity;e[i]=this.buffer[n]}}return e}clear(){this.head=0,this.count=0}get length(){return this.count}get size(){return this.capacity}get isFull(){return this.count===this.capacity}get isEmpty(){return 0===this.count}},Z=class extends K{constructor(e){super(e),this.moduleName="DesktopHandler",this.positionObserver=null,this.trajectoryPositions={positions:new X(8),currentPoint:{x:0,y:0},predictedPoint:{x:0,y:0}},this.handlePositionChange=e=>{let t=this.settings.enableScrollPrediction;for(let i of e){let e=this.elements.get(i.target);e&&(t?this.scrollPredictor?.handleScrollPrefetch(e,i.boundingClientRect):this.checkForMouseHover(e),this.handlePositionChangeDataUpdates(e,i))}t&&this.scrollPredictor?.resetScrollProps()},this.checkForMouseHover=e=>{V(this.trajectoryPositions.currentPoint,e.elementBounds.expandedRect)&&this.callCallback(e,{kind:"mouse",subType:"hover"})},this.handlePositionChangeDataUpdates=(e,t)=>{let i=[],n=t.isIntersecting;e.isIntersectingWithViewport!==n&&(i.push("visibility"),e.isIntersectingWithViewport=n),n&&(i.push("bounds"),e.elementBounds={hitSlop:e.elementBounds.hitSlop,originalRect:t.boundingClientRect,expandedRect:H(t.boundingClientRect,e.elementBounds.hitSlop)}
1),i.length&&this.emit({type:"elementDataUpdated",elementData:e,updatedProps:i})},this.processMouseMovement=e=>this.mousePredictor.processMouseMovement(e),this.invalidateTabCache=()=>this.tabPredictor?.invalidateCache(),this.observeElement=e=>this.positionObserver?.observe(e),this.unobserveElement=e=>this.positionObserver?.unobserve(e),this.connectTabPredictor=()=>this.tabPredictor.connect(),this.connectScrollPredictor=()=>this.scrollPredictor.connect(),this.connectMousePredictor=()=>this.mousePredictor.connect(),this.disconnectTabPredictor=()=>this.tabPredictor.disconnect(),this.disconnectScrollPredictor=()=>this.scrollPredictor.disconnect(),this.disconnectMousePredictor=()=>this.mousePredictor.disconnect(),this.tabPredictor=new J(e),this.scrollPredictor=new G({dependencies:e,trajectoryPositions:this.trajectoryPositions}),this.mousePredictor=new q({dependencies:e,trajectoryPositions:this.trajectoryPositions})}onConnect(){this.settings.enableTabPrediction&&this.connectTabPredictor(),this.settings.enableScrollPrediction&&this.connectScrollPredictor(),this.connectMousePredictor(),this.positionObserver=new N(this.handlePositionChange);let e=["mouse"];for(let t of(this.settings.enableTabPrediction&&e.push("tab"),this.settings.enableScrollPrediction&&e.push("scroll"),this.devLog(`Connected predictors: [${e.join(", ")}] and PositionObserver`),this.elements.keys()))this.positionObserver.observe(t)}onDisconnect(){this.disconnectMousePredictor(),this.disconnectTabPredictor(),this.disconnectScrollPredictor(),this.positionObserver?.disconnect(),this.positionObserver=null}},Q=class extends K{constructor(e){super(e),this.moduleName="ViewportPredictor",this.intersectionObserver=null,this.onConnect=()=>this.intersectionObserver=new IntersectionObserver(this.handleViewportEnter),this.observeElement=e=>this.intersectionObserver?.observe(e),this.unobserveElement=e=>this.intersectionObserver?.unobserve(e),this.handleViewportEnter=e=>{for(let t of e){if(!t.isIntersecting)continue;let e=this.elements.get(t.target);e&&(this.callCallback(e,{kind:"viewport"}),this.unobserveElement(t.target))}}}onDisconnect(){this.intersectionObserver?.disconnect(),this.intersectionObserver=null}},Y=class extends K{constructor(e){super(e),this.moduleName="TouchStartPredictor",this.onConnect=()=>this.createAbortController(),this.onDisconnect=()=>{},this.handleTouchStart=e=>{let t=e.currentTarget,i=this.elements.get(t);i&&(this.callCallback(i,{kind:"touch"}),this.unobserveElement(t))}}observeElement(e){e instanceof HTMLElement&&e.addEventListener("pointerdown",this.handleTouchStart,{signal:this.abortController?.signal})}unobserveElement(e){e instanceof HTMLElement&&e.removeEventListener("pointerdown",this.handleTouchStart)}},ee=class extends K{constructor(e){super(e),this.moduleName="TouchDeviceHandler",this.predictor=null,this.onDisconnect=()=>{this.devLog("Disconnecting touch predictor"),this.predictor?.disconnect()},this.onConnect=()=>this.setTouchPredictor(),this.observeElement=e=>this.predictor?.observeElement(e),this.unobserveElement=e=>this.predictor?.unobserveElement(e),this.viewportPredictor=new Q(e),this.touchStartPredictor=new Y(e),this.predictor=this.viewportPredictor}setTouchPredictor(){switch(this.predictor?.disconnect(),this.settings.touchDeviceStrategy){case"viewport":this.predictor=this.viewportPredictor,this.devLog("Connected touch strategy: viewport (ViewportPredictor)");break;case"onTouchStart":this.predictor=this.touchStartPredictor,this.devLog("Connected touch strategy: onTouchStart (TouchStartPredictor)");break;case"none":this.predictor=null,this.devLog('Touch strategy set to "none" - no predictor connected');return;default:this.settings.touchDeviceStrategy}for(let e of(this.predictor?.connect(),this.elements.keys()))this.predictor?.observeElement(e)}},et=class e{constructor(e){this.elements=new Map,this.idCounter=0,this.activeElementCount=0,this.isSetup=!1,this._globalCallbackHits={mouse:{hover:0,trajectory:0},tab:{forwards:0,reverse:0},scroll:{down:0,left:0,right:0,up:0},touch:0,viewport:0,total:0},this._globalSettings={debug:!1,enableManagerLogging:!1,enableMousePrediction:!0,enableScrollPrediction:!0,positionHistorySize:8,trajectoryPredictionTime:120,scrollMargin:150,defaultHitSlop:{top:0,left:0,right:0,bottom:0},enableTabPrediction:!0,tabOffset:2,touchDeviceStrategy:"onTouchStart",minimumConnectionType:"3g"},this.pendingPointerEvent=null,this.rafId=null,this.domObserver=null,this.eventListeners=new Map,this.currentDeviceStrategy=U()?"touch":"mouse",this.handlePointerMove=e=>{this.pendingPointerEvent=e,e.pointerType!=this.currentDeviceStrategy&&(this.emit
1({type:"deviceStrategyChanged",timestamp:Date.now(),newStrategy:e.pointerType,oldStrategy:this.currentDeviceStrategy}),this.setDeviceStrategy(this.currentDeviceStrategy=e.pointerType)),this.rafId||(this.rafId=requestAnimationFrame(()=>{if(this.handler instanceof ee){this.rafId=null;return}this.pendingPointerEvent&&this.handler.processMouseMovement(this.pendingPointerEvent),this.rafId=null}))},this.handleDomMutations=e=>{if(!e.length)return;this.desktopHandler?.invalidateTabCache();let t=!1;for(let i=0;i<e.length;i++){let n=e[i];if("childList"===n.type&&n.removedNodes.length>0){t=!0;break}}if(t)for(let e of this.elements.keys())e.isConnected||this.unregister(e,"disconnected")},void 0!==e&&this.initializeManagerSettings(e);let t={elements:this.elements,callCallback:this.callCallback.bind(this),emit:this.emit.bind(this),settings:this._globalSettings};this.desktopHandler=new Z(t),this.touchDeviceHandler=new ee(t),this.handler="mouse"===this.currentDeviceStrategy?this.desktopHandler:this.touchDeviceHandler,this.devLog(`ForesightManager initialized with device strategy: ${this.currentDeviceStrategy}`),this.initializeGlobalListeners()}generateId(){return`foresight-${++this.idCounter}`}static initialize(t){return this.isInitiated||(e.manager=new e(t)),e.manager}addEventListener(e,t,i){if(i?.signal?.aborted)return()=>{};let n=this.eventListeners.get(e)??[];n.push(t),this.eventListeners.set(e,n),i?.signal?.addEventListener("abort",()=>this.removeEventListener(e,t))}removeEventListener(e,t){let i=this.eventListeners.get(e);if(!i)return;let n=i.indexOf(t);n>-1&&i.splice(n,1)}emit(e){let t=this.eventListeners.get(e.type)?.slice();if(t)for(let i=0;i<t.length;i++)try{t[i](e)}catch(t){console.error(`Error in ForesightManager event listener ${i} for ${e.type}:`,t)}}get getManagerData(){return{registeredElements:this.elements,globalSettings:this._globalSettings,globalCallbackHits:this._globalCallbackHits,eventListeners:this.eventListeners,currentDeviceStrategy:this.currentDeviceStrategy,activeElementCount:this.activeElementCount}}static get isInitiated(){return!!e.manager}static get instance(){return this.initialize()}get registeredElements(){return this.elements}register({element:e,callback:t,hitSlop:i,name:n,meta:o,reactivateAfter:r}){let s,{isTouchDevice:l,isLimitedConnection:a,shouldRegister:c}={isTouchDevice:U(),isLimitedConnection:s=function(){let e=navigator.connection;if(!e)return!1;let t=et.instance.getManagerData.globalSettings.minimumConnectionType,i=["slow-2g","2g","3g","4g"];return i.indexOf(e.effectiveType)<i.indexOf(t)||e.saveData}(),shouldRegister:!s};if(!c)return{isLimitedConnection:a,isTouchDevice:l,isRegistered:!1,unregister:()=>{}};let u=this.elements.get(e);if(u)return u.registerCount++,{isLimitedConnection:a,isTouchDevice:l,isRegistered:!1,unregister:()=>{}};this.isSetup||this.initializeGlobalListeners();let h=e.getBoundingClientRect(),d=i?z(i):this._globalSettings.defaultHitSlop,f={id:this.generateId(),element:e,callback:t,elementBounds:{originalRect:h,expandedRect:H(h,d),hitSlop:d},name:n||e.id||"unnamed",isIntersectingWithViewport:function(e){if(typeof window>"u"||typeof document>"u")return!1;let t=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return e.top<i&&e.bottom>0&&e.left<t&&e.right>0}(h),registerCount:1,meta:o??{},callbackInfo:{callbackFiredCount:0,lastCallbackInvokedAt:void 0,lastCallbackCompletedAt:void 0,lastCallbackRuntime:void 0,lastCallbackStatus:void 0,lastCallbackErrorMessage:void 0,reactivateAfter:r??1/0,isCallbackActive:!0,isRunningCallback:!1,reactivateTimeoutId:void 0}};return this.elements.set(e,f),this.activeElementCount++,this.handler.observeElement(e),this.emit({type:"elementRegistered",timestamp:Date.now(),elementData:f}),{isTouchDevice:l,isLimitedConnection:a,isRegistered:!0,unregister:()=>{this.unregister(e)}}}unregister(e,t){let i=this.elements.get(e);if(!i)return;this.clearReactivateTimeout(i),this.handler.unobserveElement(e),this.elements.delete(e),i.callbackInfo.isCallbackActive&&this.activeElementCount--;let n=0===this.elements.size&&this.isSetup;n&&(this.devLog("All elements unregistered, removing global listeners"),this.removeGlobalListeners()),i&&this.emit
1({type:"elementUnregistered",elementData:i,timestamp:Date.now(),unregisterReason:t??"by user",wasLastRegisteredElement:n})}updateHitCounters(e){switch(e.kind){case"mouse":this._globalCallbackHits.mouse[e.subType]++;break;case"tab":this._globalCallbackHits.tab[e.subType]++;break;case"scroll":this._globalCallbackHits.scroll[e.subType]++;break;case"touch":this._globalCallbackHits.touch++;break;case"viewport":this._globalCallbackHits.viewport++}this._globalCallbackHits.total++}reactivate(e){let t=this.elements.get(e);t&&(this.isSetup||this.initializeGlobalListeners(),this.clearReactivateTimeout(t),t.callbackInfo.isRunningCallback||(t.callbackInfo.isCallbackActive=!0,this.activeElementCount++,this.handler.observeElement(e),this.emit({type:"elementReactivated",elementData:t,timestamp:Date.now()})))}clearReactivateTimeout(e){clearTimeout(e.callbackInfo.reactivateTimeoutId),e.callbackInfo.reactivateTimeoutId=void 0}makeElementUnactive(e){e.callbackInfo.callbackFiredCount++,e.callbackInfo.lastCallbackInvokedAt=Date.now(),e.callbackInfo.isRunningCallback=!0,this.clearReactivateTimeout(e)}callCallback(e,t){!e.callbackInfo.isRunningCallback&&e.callbackInfo.isCallbackActive&&(this.makeElementUnactive(e),(async()=>{this.updateHitCounters(t),this.emit({type:"callbackInvoked",timestamp:Date.now(),elementData:e,hitType:t});let i=performance.now(),n,o=null;try{await e.callback(),n="success"}catch(t){o=t instanceof Error?t.message:String(t),n="error",console.error(`Error in callback for element ${e.name}:`,t)}e.callbackInfo.lastCallbackCompletedAt=Date.now(),e.callbackInfo.isRunningCallback=!1,e.callbackInfo.isCallbackActive=!1,this.activeElementCount--,this.handler.unobserveElement(e.element),e.callbackInfo.reactivateAfter!==1/0&&(e.callbackInfo.reactivateTimeoutId=setTimeout(()=>{this.reactivate(e.element)},e.callbackInfo.reactivateAfter));let r=0===this.activeElementCount;r&&(this.devLog("All elements unactivated, removing global listeners"),this.removeGlobalListeners()),this.emit({type:"callbackCompleted",timestamp:Date.now(),elementData:e,hitType:t,elapsed:e.callbackInfo.lastCallbackRuntime=performance.now()-i,status:e.callbackInfo.lastCallbackStatus=n,errorMessage:e.callbackInfo.lastCallbackErrorMessage=o,wasLastActiveElement:r})})())}setDeviceStrategy(e){let t=this.handler instanceof Z?"mouse":"touch";t!==e&&this.devLog(`Switching device strategy from ${t} to ${e}`),this.handler.disconnect(),this.handler="mouse"===e?this.desktopHandler:this.touchDeviceHandler,this.handler.connect()}initializeGlobalListeners(){this.isSetup||typeof document>"u"||(this.devLog("Initializing global listeners (pointermove, MutationObserver)"),this.setDeviceStrategy(this.currentDeviceStrategy),document.addEventListener("pointermove",this.handlePointerMove),this.domObserver=new MutationObserver(this.handleDomMutations),this.domObserver.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1}),this.isSetup=!0)}removeGlobalListeners(){typeof document>"u"||(this.isSetup=!1,this.domObserver?.disconnect(),this.domObserver=null,document.removeEventListener("pointermove",this.handlePointerMove),this.handler.disconnect(),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.pendingPointerEvent=null)}forceUpdateAllElementBounds(){for(let[,e]of this.elements)e.isIntersectingWithViewport&&this.forceUpdateElementBounds(e)}forceUpdateElementBounds(e){let t=e.element.getBoundingClientRect(),i=H(t,e.elementBounds.hitSlop);if(!F(i,e.elementBounds.expandedRect)){let n={...e,elementBounds:{...e.elementBounds,originalRect:t,expandedRect:i}};this.elements.set(e.element,n),this.emit({type:"elementDataUpdated",elementData:n,updatedProps:["bounds"]})}}initializeManagerSettings(e){this.updateNumericSettings(e.trajectoryPredictionTime,"trajectoryPredictionTime",10,200),this.updateNumericSettings(e.positionHistorySize,"positionHistorySize",2,30),this.updateNumericSettings(e.scrollMargin,"scrollMargin",30,300),this.updateNumericSettings(e.tabOffset,"tabOffset",0,20),this.updateBooleanSetting(e.enableMousePrediction,"enableMousePrediction"),this.updateBooleanSetting(e.enableScrollPrediction,"enableScrollPrediction"),this.updateBooleanSetting(e.enableTabPrediction,"enableTabPrediction"),this.updateBooleanSetting(e.enableManagerLogging,"enableManagerLogging"),void 0!==e.defaultHitSlop&&(this._globalSettings.defaultHitSlop=z(e.defaultHitSlop)),void 0!==e.touchDeviceStrategy&&(this._globalSettings.touchDeviceStrategy=e.touchDeviceStrategy),void 0!==e.minimumConnectionType&&(this._globalSettings.minimumConnectionType=e.minimumConnectionType),void 0!==e.debug&&(this._globalSettings.debug=e.debug)}updateNumericSettings(e,t,i,n){return!!$(e,this._globalSettings[t])&&(this._globalSettings[t]=j(e,i,n,t),!0)}updateBooleanSetting(e,t){return!!$(e,this._globalSettings[t])&&(this._globalSettings[t]=e,!0)}alterGlobalSettings(e){let t=[],i=this._globalSettings.trajectoryPredictionTime;this.updateNumericSettings(e?.trajectoryPredictionTime,"trajectoryPredictionTime",10,200)&&t.push({setting:"trajectoryPredictionTime",oldValue:i,newValue:this._globalSettings.trajectoryPredictionTime});let n=this._globalSettings.positionHistorySize;this.updateNumericSettings(e?.positionHistorySize,"positionHistorySize",2,30)&&(t.push({setting:"positionHistorySize",oldValue:n,newValue:this._globalSettings.positionHistorySize}),this.desktopHandler.trajectoryPositions.positions.resize(this._globalSettings.positionHistorySize));let o=this._globalSettings.scrollMargin;if(this.updateNumericSettings(e?.scrollMargin,"scrollMargin",30,300)){let e=this._globalSettings.scrollMargin;t.push({setting:"scrollMargin",oldValue:o,newValue:e})}let r=this._globalSettings.tabOffset;this.updateNumericSettings(e?.tabOffset,"tabOffset",0,20)&&(this._globalSettings.tabOffset=j(e.tabOffset,0,20,"tabOffset"),t.push({setting:"tabOffset",oldValue:r,newValue:this._globalSettings.tabOffset}));let s=this._globalSettings.enableMousePrediction;this.updateBooleanSetting(e?.enableMousePrediction,"enableMousePrediction")&&t.push({setting:"enableMousePrediction",oldValue:s,newValue:this._globalSettings.enableMousePrediction});let l=this._globalSettings.enableScrollPrediction;this.updateBooleanSetting(e?.enableScrollPrediction,"enableScrollPrediction")&&(this.handler instanceof Z&&(this._globalSettings.enableScrollPrediction?this.handler.connectScrollPredictor():this.handler.disconnectScrollPredictor()),t.push({setting:"enableScrollPrediction",oldValue:l,newValue:this._globalSettings.enableScrollPrediction}));let a=this._globalSettings.enableTabPrediction;if(this.updateBooleanSetting(e?.enableTabPrediction,"enableTabPrediction")&&(this.handler instanceof Z&&(this._globalSettings.enableTabPrediction?this.handler.connectTabPredictor():this.handler.disconnectTabPredictor()),t.push({setting:"enableTabPrediction",oldValue:a,newValue:this._globalSettings.enableTabPrediction})),e?.defaultHitSlop!==void 0){let i=this._globalSettings.defaultHitSlop,n=z(e.defaultHitSlop);
1F(i,n)||(this._globalSettings.defaultHitSlop=n,t.push({setting:"defaultHitSlop",oldValue:i,newValue:n}),this.forceUpdateAllElementBounds())}if(e?.touchDeviceStrategy!==void 0){let i=this._globalSettings.touchDeviceStrategy,n=e.touchDeviceStrategy;this._globalSettings.touchDeviceStrategy=n,t.push({setting:"touchDeviceStrategy",oldValue:i,newValue:n}),this.handler instanceof ee&&this.handler.setTouchPredictor()}if(e?.minimumConnectionType!==void 0){let i=this._globalSettings.minimumConnectionType;this._globalSettings.minimumConnectionType=e.minimumConnectionType,t.push({setting:"minimumConnectionType",oldValue:i,newValue:this._globalSettings.minimumConnectionType})}t.length>0&&this.emit({type:"managerSettingsChanged",timestamp:Date.now(),managerData:this.getManagerData,updatedSettings:t})}devLog(e){this._globalSettings.enableManagerLogging&&console.log(`%c\u{1F6E0}\uFE0F ForesightManager: ${e}`,"color: #16a34a; font-weight: bold;")}}},83351:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(17523);let o=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,i)=>i?i.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},r=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.filter((e,t,i)=>!!e&&""!==e.trim()&&i.indexOf(e)===t).join(" ").trim()};var s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,n.forwardRef)((e,t)=>{let{color:i="currentColor",size:o=24,strokeWidth:l=2,absoluteStrokeWidth:a,className:c="",children:u,iconNode:h,...d}=e;return(0,n.createElement)("svg",{ref:t,...s,width:o,height:o,stroke:i,strokeWidth:a?24*Number(l)/Number(o):l,className:r("lucide",c),...!u&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(d)&&{"aria-hidden":"true"},...d},[...h.map(e=>{let[t,i]=e;return(0,n.createElement)(t,i)}),...Array.isArray(u)?u:[u]])}),a=(e,t)=>{let i=(0,n.forwardRef)((i,s)=>{let{className:a,...c}=i;return(0,n.createElement)(l,{ref:s,iconNode:t,className:r("lucide-".concat(o(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),a),...c})});return i.displayName=o(e),i}},90971:(e,t,i)=>{var n=i(88163);i.o(n,"usePathname")&&i.d(t,{usePathname:function(){return n.usePathname}}),i.o(n,"useRouter")&&i.d(t,{useRouter:function(){return n.useRouter}}),i.o(n,"useSearchParams")&&i.d(t,{useSearchParams:function(){return n.useSearchParams}})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.