@vohongtho.infotech/code-intel 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,352 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function T(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return T(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function O(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function k(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+O(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ne,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+O(a,u),c+=A(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+O(a,u++),c+=A(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return A(k(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function j(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},N={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=N,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return T(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return T(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,M)}catch(e){M(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&O(x,t.startTime-e)}}var S=!1,C=-1,w=5,ee=-1;function T(){return g?!0:!(e.unstable_now()-ee<w)}function E(){if(g=!1,S){var t=e.unstable_now();ee=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&T());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&O(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=E,D=function(){ne.postMessage(null)}}else D=function(){_(E,0)};function O(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,O(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),ne=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case ee:return`Suspense`;case T:return`SuspenseList`;case te:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var re=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},ie=[],F=-1;function ae(e){return{current:e}}function I(e){0>F||(e.current=ie[F],ie[F]=null,F--)}function L(e,t){F++,ie[F]=e.current,e.current=t}var oe=ae(null),R=ae(null),z=ae(null),B=ae(null);function se(e,t){switch(L(z,t),L(R,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(oe),L(oe,e)}function V(){I(oe),I(R),I(z)}function H(e){e.memoizedState!==null&&L(B,e);var t=oe.current,n=Hd(t,e.type);t!==n&&(L(R,e),L(oe,n))}function U(e){R.current===e&&(I(oe),I(R)),B.current===e&&(I(B),Qf._currentValue=P)}var ce,le;function ue(e){if(ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ce=t&&t[1]||``,le=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+ce+e+le}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
- `),l=s.split(`
5
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{de=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ue(n):``}function pe(e,t){switch(e.tag){case 26:case 27:case 5:return ue(e.type);case 16:return ue(`Lazy`);case 13:return e.child!==t&&t!==null?ue(`Suspense Fallback`):ue(`Suspense`);case 19:return ue(`SuspenseList`);case 0:case 15:return fe(e.type,!1);case 11:return fe(e.type.render,!1);case 1:return fe(e.type,!0);case 31:return ue(`Activity`);default:return``}}function me(e){try{var t=``,n=null;do t+=pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var he=Object.prototype.hasOwnProperty,ge=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,ve=t.unstable_shouldYield,ye=t.unstable_requestPaint,be=t.unstable_now,xe=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,we=t.unstable_NormalPriority,Te=t.unstable_LowPriority,Ee=t.unstable_IdlePriority,De=t.log,Oe=t.unstable_setDisableYieldValue,ke=null,Ae=null;function je(e){if(typeof De==`function`&&Oe(e),Ae&&typeof Ae.setStrictMode==`function`)try{Ae.setStrictMode(ke,e)}catch{}}var Me=Math.clz32?Math.clz32:Fe,Ne=Math.log,Pe=Math.LN2;function Fe(e){return e>>>=0,e===0?32:31-(Ne(e)/Pe|0)|0}var Ie=256,Le=262144,Re=4194304;function ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Be(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ze(n))):i=ze(o):i=ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ze(n))):i=ze(o)):i=ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ve(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function He(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(){var e=Re;return Re<<=1,!(Re&62914560)&&(Re=4194304),e}function We(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ge(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ke(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Me(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Me(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Je(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Me(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ye(e,t){var n=t&-t;return n=n&42?1:Xe(n),(n&(e.suspendedLanes|t))===0?n:0}function Xe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ze(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Qe(){var e=N.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function $e(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var et=Math.random().toString(36).slice(2),tt=`__reactFiber$`+et,nt=`__reactProps$`+et,rt=`__reactContainer$`+et,it=`__reactEvents$`+et,at=`__reactListeners$`+et,ot=`__reactHandles$`+et,st=`__reactResources$`+et,ct=`__reactMarker$`+et;function lt(e){delete e[tt],delete e[nt],delete e[it],delete e[at],delete e[ot]}function ut(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rt]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[tt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function dt(e){if(e=e[tt]||e[rt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function pt(e){var t=e[st];return t||=e[st]={hoistableStyles:new Map,hoistableScripts:new Map},t}function mt(e){e[ct]=!0}var ht=new Set,gt={};function _t(e,t){vt(e,t),vt(e+`Capture`,t)}function vt(e,t){for(gt[e]=t,e=0;e<t.length;e++)ht.add(t[e])}var yt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),bt={},xt={};function St(e){return he.call(xt,e)?!0:he.call(bt,e)?!1:yt.test(e)?xt[e]=!0:(bt[e]=!0,!1)}function Ct(e,t,n){if(St(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function wt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Tt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Et(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Dt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ot(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kt(e){if(!e._valueTracker){var t=Dt(e)?`checked`:`value`;e._valueTracker=Ot(e,t,``+e[t])}}function At(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Dt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function jt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Mt=/[\n"\\]/g;function W(e){return e.replace(Mt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Nt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Et(t)):e.value!==``+Et(t)&&(e.value=``+Et(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ft(e,o,Et(n)):Ft(e,o,Et(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Et(s):e.removeAttribute(`name`)}function Pt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){kt(e);return}n=n==null?``:``+Et(n),t=t==null?n:``+Et(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),kt(e)}function Ft(e,t,n){t===`number`&&jt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function It(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Et(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Lt(e,t,n){if(t!=null&&(t=``+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Et(n)}function Rt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(re(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Et(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),kt(e)}function zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Vt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Bt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ht(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Vt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Vt(e,o,t[o])}function Ut(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Wt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Gt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Kt(e){return Gt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function qt(){}var Jt=null;function Yt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xt=null,Zt=null;function Qt(e){var t=dt(e);if(t&&(e=t.stateNode)){var n=e[nt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Nt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+W(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[nt]||null;if(!a)throw Error(i(90));Nt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&At(r)}break a;case`textarea`:Lt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&It(e,!!n.multiple,t,!1)}}}var $t=!1;function en(e,t,n){if($t)return e(t,n);$t=!0;try{return e(t)}finally{if($t=!1,(Xt!==null||Zt!==null)&&(yu(),Xt&&(t=Xt,e=Zt,Zt=Xt=null,Qt(t),e)))for(t=0;t<e.length;t++)Qt(e[t])}}function tn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[nt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var nn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),rn=!1;if(nn)try{var an={};Object.defineProperty(an,`passive`,{get:function(){rn=!0}}),window.addEventListener(`test`,an,an),window.removeEventListener(`test`,an,an)}catch{rn=!1}var on=null,sn=null,cn=null;function ln(){if(cn)return cn;var e,t=sn,n=t.length,r,i=`value`in on?on.value:on.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return cn=i.slice(e,1<r?1-r:void 0)}function un(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function dn(){return!0}function fn(){return!1}function pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?dn:fn,this.isPropagationStopped=fn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=dn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=dn)},persist:function(){},isPersistent:dn}),t}var mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hn=pn(mn),gn=h({},mn,{view:0,detail:0}),_n=pn(gn),vn,G,yn,K=h({},gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:An,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==yn&&(yn&&e.type===`mousemove`?(vn=e.screenX-yn.screenX,G=e.screenY-yn.screenY):G=vn=0,yn=e),vn)},movementY:function(e){return`movementY`in e?e.movementY:G}}),bn=pn(K),xn=pn(h({},K,{dataTransfer:0})),Sn=pn(h({},gn,{relatedTarget:0})),Cn=pn(h({},mn,{animationName:0,elapsedTime:0,pseudoElement:0})),wn=pn(h({},mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Tn=pn(h({},mn,{data:0})),En={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Dn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},On={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function kn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=On[e])?!!t[e]:!1}function An(){return kn}var jn=pn(h({},gn,{key:function(e){if(e.key){var t=En[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=un(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Dn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:An,charCode:function(e){return e.type===`keypress`?un(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?un(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Mn=pn(h({},K,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Nn=pn(h({},gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:An})),Pn=pn(h({},mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Fn=pn(h({},K,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),In=pn(h({},mn,{newState:0,oldState:0})),Ln=[9,13,27,32],Rn=nn&&`CompositionEvent`in window,zn=null;nn&&`documentMode`in document&&(zn=document.documentMode);var Bn=nn&&`TextEvent`in window&&!zn,Vn=nn&&(!Rn||zn&&8<zn&&11>=zn),Hn=` `,Un=!1;function Wn(e,t){switch(e){case`keyup`:return Ln.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Gn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Kn=!1;function qn(e,t){switch(e){case`compositionend`:return Gn(t);case`keypress`:return t.which===32?(Un=!0,Hn):null;case`textInput`:return e=t.data,e===Hn&&Un?null:e;default:return null}}function Jn(e,t){if(Kn)return e===`compositionend`||!Rn&&Wn(e,t)?(e=ln(),cn=sn=on=null,Kn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Vn&&t.locale!==`ko`?null:t.data;default:return null}}var Yn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Yn[e.type]:t===`textarea`}function Zn(e,t,n,r){Xt?Zt?Zt.push(r):Zt=[r]:Xt=r,t=Td(t,`onChange`),0<t.length&&(n=new hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Qn=null,$n=null;function er(e){vd(e,0)}function tr(e){if(At(ft(e)))return e}function nr(e,t){if(e===`change`)return t}var rr=!1;if(nn){var ir;if(nn){var ar=`oninput`in document;if(!ar){var or=document.createElement(`div`);or.setAttribute(`oninput`,`return;`),ar=typeof or.oninput==`function`}ir=ar}else ir=!1;rr=ir&&(!document.documentMode||9<document.documentMode)}function sr(){Qn&&(Qn.detachEvent(`onpropertychange`,cr),$n=Qn=null)}function cr(e){if(e.propertyName===`value`&&tr($n)){var t=[];Zn(t,$n,e,Yt(e)),en(er,t)}}function lr(e,t,n){e===`focusin`?(sr(),Qn=t,$n=n,Qn.attachEvent(`onpropertychange`,cr)):e===`focusout`&&sr()}function ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return tr($n)}function dr(e,t){if(e===`click`)return tr(t)}function fr(e,t){if(e===`input`||e===`change`)return tr(t)}function pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var mr=typeof Object.is==`function`?Object.is:pr;function hr(e,t){if(mr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!he.call(t,i)||!mr(e[i],t[i]))return!1}return!0}function gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _r(e,t){var n=gr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=gr(n)}}function vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=jt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=jt(e.document)}return t}function br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var xr=nn&&`documentMode`in document&&11>=document.documentMode,Sr=null,Cr=null,wr=null,Tr=!1;function Er(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tr||Sr==null||Sr!==jt(r)||(r=Sr,`selectionStart`in r&&br(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wr&&hr(wr,r)||(wr=r,r=Td(Cr,`onSelect`),0<r.length&&(t=new hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Sr)))}function Dr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Or={animationend:Dr(`Animation`,`AnimationEnd`),animationiteration:Dr(`Animation`,`AnimationIteration`),animationstart:Dr(`Animation`,`AnimationStart`),transitionrun:Dr(`Transition`,`TransitionRun`),transitionstart:Dr(`Transition`,`TransitionStart`),transitioncancel:Dr(`Transition`,`TransitionCancel`),transitionend:Dr(`Transition`,`TransitionEnd`)},kr={},Ar={};nn&&(Ar=document.createElement(`div`).style,`AnimationEvent`in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),`TransitionEvent`in window||delete Or.transitionend.transition);function jr(e){if(kr[e])return kr[e];if(!Or[e])return e;var t=Or[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ar)return kr[e]=t[n];return e}var Mr=jr(`animationend`),Nr=jr(`animationiteration`),Pr=jr(`animationstart`),Fr=jr(`transitionrun`),Ir=jr(`transitionstart`),Lr=jr(`transitioncancel`),Rr=jr(`transitionend`),zr=new Map,Br=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Br.push(`scrollEnd`);function Vr(e,t){zr.set(e,t),_t(t,[e])}var Hr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Ur=[],Wr=0,Gr=0;function Kr(){for(var e=Wr,t=Gr=Wr=0;t<e;){var n=Ur[t];Ur[t++]=null;var r=Ur[t];Ur[t++]=null;var i=Ur[t];Ur[t++]=null;var a=Ur[t];if(Ur[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Xr(n,i,a)}}function qr(e,t,n,r){Ur[Wr++]=e,Ur[Wr++]=t,Ur[Wr++]=n,Ur[Wr++]=r,Gr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Jr(e,t,n,r){return qr(e,t,n,r),Zr(e)}function Yr(e,t){return qr(e,null,null,t),Zr(e)}function Xr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Me(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Zr(e){if(50<uu)throw uu=0,du=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qr={};function $r(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ei(e,t,n,r){return new $r(e,t,n,r)}function ti(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ni(e,t){var n=e.alternate;return n===null?(n=ei(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ri(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ii(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ti(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,oe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case te:return e=ei(31,n,t,a),e.elementType=te,e.lanes=o,e;case y:return ai(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ei(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case ee:return e=ei(13,n,t,a),e.elementType=ee,e.lanes=o,e;case T:return e=ei(19,n,t,a),e.elementType=T,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ai(e,t,n,r){return e=ei(7,e,r,t),e.lanes=n,e}function oi(e,t,n){return e=ei(6,e,null,t),e.lanes=n,e}function si(e){var t=ei(18,null,null,0);return t.stateNode=e,t}function ci(e,t,n){return t=ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var li=new WeakMap;function ui(e,t){if(typeof e==`object`&&e){var n=li.get(e);return n===void 0?(t={value:e,source:t,stack:me(t)},li.set(e,t),t):n}return{value:e,source:t,stack:me(t)}}var di=[],fi=0,pi=null,mi=0,hi=[],gi=0,_i=null,vi=1,yi=``;function bi(e,t){di[fi++]=mi,di[fi++]=pi,pi=e,mi=t}function xi(e,t,n){hi[gi++]=vi,hi[gi++]=yi,hi[gi++]=_i,_i=e;var r=vi;e=yi;var i=32-Me(r)-1;r&=~(1<<i),n+=1;var a=32-Me(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,vi=1<<32-Me(t)+i|n<<i|r,yi=a+e}else vi=1<<a|n<<i|r,yi=e}function Si(e){e.return!==null&&(bi(e,1),xi(e,1,0))}function Ci(e){for(;e===pi;)pi=di[--fi],di[fi]=null,mi=di[--fi],di[fi]=null;for(;e===_i;)_i=hi[--gi],hi[gi]=null,yi=hi[--gi],hi[gi]=null,vi=hi[--gi],hi[gi]=null}function wi(e,t){hi[gi++]=vi,hi[gi++]=yi,hi[gi++]=_i,vi=t.id,yi=t.overflow,_i=e}var Ti=null,Ei=null,q=!1,Di=null,Oi=!1,ki=Error(i(519));function Ai(e){throw Ii(ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ki}function ji(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[tt]=e,t[nt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Pt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Rt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=qt),t=!0):t=!1,t||Ai(e,!0)}function Mi(e){for(Ti=e.return;Ti;)switch(Ti.tag){case 5:case 31:case 13:Oi=!1;return;case 27:case 3:Oi=!0;return;default:Ti=Ti.return}}function Ni(e){if(e!==Ti)return!1;if(!q)return Mi(e),q=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&Ei&&Ai(e),Mi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=uf(e)}else t===27?(t=Ei,Zd(e.type)?(e=lf,lf=null,Ei=e):Ei=t):Ei=Ti?cf(e.stateNode.nextSibling):null;return!0}function Pi(){Ei=Ti=null,q=!1}function Fi(){var e=Di;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),Di=null),e}function Ii(e){Di===null?Di=[e]:Di.push(e)}var Li=ae(null),Ri=null,zi=null;function Bi(e,t,n){L(Li,t._currentValue),t._currentValue=n}function Vi(e){e._currentValue=Li.current,I(Li)}function Hi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ui(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Hi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Hi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Wi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;mr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===B.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Ui(t,e,n,r),t.flags|=262144}function Gi(e){for(e=e.firstContext;e!==null;){if(!mr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ki(e){Ri=e,zi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qi(e){return Yi(Ri,e)}function Ji(e,t){return Ri===null&&Ki(e),Yi(e,t)}function Yi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},zi===null){if(e===null)throw Error(i(308));zi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zi=zi.next=t;return n}var Xi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Zi=t.unstable_scheduleCallback,Qi=t.unstable_NormalPriority,$i={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ea(){return{controller:new Xi,data:new Map,refCount:0}}function ta(e){e.refCount--,e.refCount===0&&Zi(Qi,function(){e.controller.abort()})}var na=null,ra=0,ia=0,aa=null;function oa(e,t){if(na===null){var n=na=[];ra=0,ia=ud(),aa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ra++,t.then(sa,sa),t}function sa(){if(--ra===0&&na!==null){aa!==null&&(aa.status=`fulfilled`);var e=na;na=null,ia=0,aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ca(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var la=M.S;M.S=function(e,t){$l=be(),typeof t==`object`&&t&&typeof t.then==`function`&&oa(e,t),la!==null&&la(e,t)};var ua=ae(null);function da(){var e=ua.current;return e===null?Il.pooledCache:e}function fa(e,t){t===null?L(ua,ua.current):L(ua,t.pool)}function pa(){var e=da();return e===null?null:{parent:$i._currentValue,pool:e}}var ma=Error(i(460)),ha=Error(i(474)),ga=Error(i(542)),_a={then:function(){}};function va(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(qt,qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ca(e),e;default:if(typeof t.status==`string`)t.then(qt,qt);else{if(e=Il,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ca(e),e}throw xa=t,ma}}function ba(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(xa=e,ma):e}}var xa=null;function Sa(){if(xa===null)throw Error(i(459));var e=xa;return xa=null,e}function Ca(e){if(e===ma||e===ga)throw Error(i(483))}var wa=null,Ta=0;function Ea(e){var t=Ta;return Ta+=1,wa===null&&(wa=[]),ya(wa,e,t)}function Da(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Oa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ka(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ni(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=oi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&ba(i)===t.type)?(t=a(t,n.props),Da(t,n),t.return=e,t):(t=ii(n.type,n.key,n.props,null,e.mode,r),Da(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ci(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ai(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=oi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ii(t.type,t.key,t.props,null,e.mode,n),Da(n,t),n.return=e,n;case v:return t=ci(t,e.mode,n),t.return=e,t;case D:return t=ba(t),f(e,t,n)}if(re(t)||k(t))return t=ai(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ea(t),n);if(t.$$typeof===C)return f(e,Ji(e,t),n);Oa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case D:return n=ba(n),p(e,t,n,r)}if(re(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ea(n),r);if(n.$$typeof===C)return p(e,t,Ji(e,n),r);Oa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=ba(r),m(e,t,n,r,i)}if(re(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ea(r),i);if(r.$$typeof===C)return m(e,t,n,Ji(t,r),i);Oa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),q&&bi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return q&&bi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),q&&bi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),q&&bi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return q&&bi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),q&&bi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&ba(l)===r.type){n(e,r.sibling),c=a(r,o.props),Da(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ai(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ii(o.type,o.key,o.props,null,e.mode,c),Da(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=ci(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=ba(o),b(e,r,o,c)}if(re(o))return h(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ea(o),c);if(o.$$typeof===C)return b(e,r,Ji(e,o),c);Oa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=oi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ta=0;var i=b(e,t,n,r);return wa=null,i}catch(t){if(t===ma||t===ga)throw t;var a=ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Aa=ka(!0),ja=ka(!1),Ma=!1;function Na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Fa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ia(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Y&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Zr(e),Xr(e,null,n),t}return qr(e,r,t,n),Zr(e)}function La(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}function Ra(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var za=!1;function Ba(){if(za){var e=aa;if(e!==null)throw e}}function Va(e,t,n,r){za=!1;var i=e.updateQueue;Ma=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===ia&&(za=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ma=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Wl|=o,e.lanes=o,e.memoizedState=d}}function Ha(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ua(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ha(n[e],t)}var Wa=ae(null),Ga=ae(0);function Ka(e,t){e=Hl,L(Ga,e),L(Wa,t),Hl=e|t.baseLanes}function qa(){L(Ga,Hl),L(Wa,Wa.current)}function Ja(){Hl=Ga.current,I(Wa),I(Ga)}var Ya=ae(null),Xa=null;function Za(e){var t=e.alternate;L(no,no.current&1),L(Ya,e),Xa===null&&(t===null||Wa.current!==null||t.memoizedState!==null)&&(Xa=e)}function Qa(e){L(no,no.current),L(Ya,e),Xa===null&&(Xa=e)}function $a(e){e.tag===22?(L(no,no.current),L(Ya,e),Xa===null&&(Xa=e)):eo(e)}function eo(){L(no,no.current),L(Ya,Ya.current)}function to(e){I(Ya),Xa===e&&(Xa=null),I(no)}var no=ae(0);function ro(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var io=0,J=null,ao=null,oo=null,so=!1,co=!1,lo=!1,uo=0,fo=0,po=null,mo=0;function ho(){throw Error(i(321))}function go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mr(e[n],t[n]))return!1;return!0}function _o(e,t,n,r,i,a){return io=a,J=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Ps:Fs,lo=!1,a=n(r,i),lo=!1,co&&(a=yo(t,n,r,i)),vo(e),a}function vo(e){M.H=Ns;var t=ao!==null&&ao.next!==null;if(io=0,oo=ao=J=null,so=!1,fo=0,po=null,t)throw Error(i(300));e===null||Qs||(e=e.dependencies,e!==null&&Gi(e)&&(Qs=!0))}function yo(e,t,n,r){J=e;var a=0;do{if(co&&(po=null),fo=0,co=!1,25<=a)throw Error(i(301));if(a+=1,oo=ao=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=Is,o=t(n,r)}while(co);return o}function bo(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?Do(t):t,e=e.useState()[0],(ao===null?null:ao.memoizedState)!==e&&(J.flags|=1024),t}function xo(){var e=uo!==0;return uo=0,e}function So(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Co(e){if(so){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}so=!1}io=0,oo=ao=J=null,co=!1,fo=uo=0,po=null}function wo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oo===null?J.memoizedState=oo=e:oo=oo.next=e,oo}function To(){if(ao===null){var e=J.alternate;e=e===null?null:e.memoizedState}else e=ao.next;var t=oo===null?J.memoizedState:oo.next;if(t!==null)oo=t,ao=e;else{if(e===null)throw J.alternate===null?Error(i(467)):Error(i(310));ao=e,e={memoizedState:ao.memoizedState,baseState:ao.baseState,baseQueue:ao.baseQueue,queue:ao.queue,next:null},oo===null?J.memoizedState=oo=e:oo=oo.next=e}return oo}function Eo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(e){var t=fo;return fo+=1,po===null&&(po=[]),e=ya(po,e,t),t=J,(oo===null?t.memoizedState:oo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Ps:Fs),e}function Oo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Do(e);if(e.$$typeof===C)return qi(e)}throw Error(i(438,String(e)))}function ko(e){var t=null,n=J.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=J.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Eo(),J.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ne;return t.index++,n}function Ao(e,t){return typeof t==`function`?t(e):t}function jo(e){return Mo(To(),ao,e)}function Mo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(io&f)===f:(Z&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ia&&(d=!0);else if((io&p)===p){u=u.next,p===ia&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,J.lanes|=p,Wl|=p;f=u.action,lo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,J.lanes|=f,Wl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!mr(o,e.memoizedState)&&(Qs=!0,d&&(n=aa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function No(e){var t=To(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);mr(o,t.memoizedState)||(Qs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Po(e,t,n){var r=J,a=To(),o=q;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!mr((ao||a).memoizedState,n);if(s&&(a.memoizedState=n,Qs=!0),a=a.queue,as(Lo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||oo!==null&&oo.memoizedState.tag&1){if(r.flags|=2048,es(9,{destroy:void 0},Io.bind(null,r,a,n,t),null),Il===null)throw Error(i(349));o||io&127||Fo(r,t,n)}return n}function Fo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=J.updateQueue,t===null?(t=Eo(),J.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Io(e,t,n,r){t.value=n,t.getSnapshot=r,Ro(t)&&zo(e)}function Lo(e,t,n){return n(function(){Ro(t)&&zo(e)})}function Ro(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mr(e,n)}catch{return!0}}function zo(e){var t=Yr(e,2);t!==null&&mu(t,e,2)}function Bo(e){var t=wo();if(typeof e==`function`){var n=e;if(e=n(),lo){je(!0);try{n()}finally{je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:e},t}function Vo(e,t,n,r){return e.baseState=n,Mo(e,ao,typeof r==`function`?r:Ao)}function Ho(e,t,n,r,a){if(As(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Uo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Uo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Wo(e,t,s)}catch(n){Ko(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Wo(e,t,a)}catch(n){Ko(e,t,n)}}function Wo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Go(e,t,n)},function(n){return Ko(e,t,n)}):Go(e,t,n)}function Go(e,t,n){t.status=`fulfilled`,t.value=n,qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Uo(e,n)))}function Ko(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,qo(t),t=t.next;while(t!==r)}e.action=null}function qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Jo(e,t){return t}function Yo(e,t){if(q){var n=Il.formState;if(n!==null){a:{var r=J;if(q){if(Ei){b:{for(var i=Ei,a=Oi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ei=cf(i.nextSibling),r=i.data===`F!`;break a}}Ai(r)}r=!1}r&&(t=n[0])}}return n=wo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jo,lastRenderedState:t},n.queue=r,n=Ds.bind(null,J,r),r.dispatch=n,r=Bo(!1),a=ks.bind(null,J,!1,r.queue),r=wo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ho.bind(null,J,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Xo(e){return Zo(To(),ao,e)}function Zo(e,t,n){if(t=Mo(e,t,Jo)[0],e=jo(Ao)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Do(t)}catch(e){throw e===ma?ga:e}else r=t;t=To();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(J.flags|=2048,es(9,{destroy:void 0},Qo.bind(null,i,n),null)),[r,a,e]}function Qo(e,t){e.action=t}function $o(e){var t=To(),n=ao;if(n!==null)return Zo(t,n,e);To(),t=t.memoizedState,n=To();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function es(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=J.updateQueue,t===null&&(t=Eo(),J.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ts(){return To().memoizedState}function ns(e,t,n,r){var i=wo();J.flags|=e,i.memoizedState=es(1|t,{destroy:void 0},n,r===void 0?null:r)}function rs(e,t,n,r){var i=To();r=r===void 0?null:r;var a=i.memoizedState.inst;ao!==null&&r!==null&&go(r,ao.memoizedState.deps)?i.memoizedState=es(t,a,n,r):(J.flags|=e,i.memoizedState=es(1|t,a,n,r))}function is(e,t){ns(8390656,8,e,t)}function as(e,t){rs(2048,8,e,t)}function os(e){J.flags|=4;var t=J.updateQueue;if(t===null)t=Eo(),J.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ss(e){var t=To().memoizedState;return os({ref:t,nextImpl:e}),function(){if(Y&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function cs(e,t){return rs(4,2,e,t)}function ls(e,t){return rs(4,4,e,t)}function us(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ds(e,t,n){n=n==null?null:n.concat([e]),rs(4,4,us.bind(null,t,e),n)}function fs(){}function ps(e,t){var n=To();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ms(e,t){var n=To();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&go(t,r[1]))return r[0];if(r=e(),lo){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r}function hs(e,t,n){return n===void 0||io&1073741824&&!(Z&261930)?e.memoizedState=t:(e.memoizedState=n,e=pu(),J.lanes|=e,Wl|=e,n)}function gs(e,t,n,r){return mr(n,t)?n:Wa.current===null?!(io&42)||io&1073741824&&!(Z&261930)?(Qs=!0,e.memoizedState=n):(e=pu(),J.lanes|=e,Wl|=e,t):(e=hs(e,n,r),mr(e,t)||(Qs=!0),e)}function _s(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};M.T=s,ks(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Os(e,t,ca(c,r),fu(e)):Os(e,t,r,fu(e))}catch(n){Os(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function vs(){}function ys(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=bs(e).queue;_s(e,a,t,P,n===null?vs:function(){return xs(e),n(r)})}function bs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:P},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xs(e){var t=bs(e);t.next===null&&(t=e.alternate.memoizedState),Os(e,t.next.queue,{},fu())}function Ss(){return qi(Qf)}function Cs(){return To().memoizedState}function ws(){return To().memoizedState}function Ts(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Fa(n);var r=Ia(t,e,n);r!==null&&(mu(r,t,n),La(r,t,n)),t={cache:ea()},e.payload=t;return}t=t.return}}function Es(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},As(e)?js(t,n):(n=Jr(e,t,n,r),n!==null&&(mu(n,e,r),Ms(n,t,r)))}function Ds(e,t,n){Os(e,t,n,fu())}function Os(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(As(e))js(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,mr(s,o))return qr(e,t,i,0),Il===null&&Kr(),!1}catch{}if(n=Jr(e,t,i,r),n!==null)return mu(n,e,r),Ms(n,t,r),!0}return!1}function ks(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},As(e)){if(t)throw Error(i(479))}else t=Jr(e,n,r,2),t!==null&&mu(t,e,2)}function As(e){var t=e.alternate;return e===J||t!==null&&t===J}function js(e,t){co=so=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ms(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}var Ns={readContext:qi,use:Oo,useCallback:ho,useContext:ho,useEffect:ho,useImperativeHandle:ho,useLayoutEffect:ho,useInsertionEffect:ho,useMemo:ho,useReducer:ho,useRef:ho,useState:ho,useDebugValue:ho,useDeferredValue:ho,useTransition:ho,useSyncExternalStore:ho,useId:ho,useHostTransitionStatus:ho,useFormState:ho,useActionState:ho,useOptimistic:ho,useMemoCache:ho,useCacheRefresh:ho};Ns.useEffectEvent=ho;var Ps={readContext:qi,use:Oo,useCallback:function(e,t){return wo().memoizedState=[e,t===void 0?null:t],e},useContext:qi,useEffect:is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ns(4194308,4,us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ns(4194308,4,e,t)},useInsertionEffect:function(e,t){ns(4,2,e,t)},useMemo:function(e,t){var n=wo();t=t===void 0?null:t;var r=e();if(lo){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=wo();if(n!==void 0){var i=n(t);if(lo){je(!0);try{n(t)}finally{je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Es.bind(null,J,e),[r.memoizedState,e]},useRef:function(e){var t=wo();return e={current:e},t.memoizedState=e},useState:function(e){e=Bo(e);var t=e.queue,n=Ds.bind(null,J,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:fs,useDeferredValue:function(e,t){return hs(wo(),e,t)},useTransition:function(){var e=Bo(!1);return e=_s.bind(null,J,e.queue,!0,!1),wo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=J,a=wo();if(q){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Il===null)throw Error(i(349));Z&127||Fo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,is(Lo.bind(null,r,o,e),[e]),r.flags|=2048,es(9,{destroy:void 0},Io.bind(null,r,o,n,t),null),n},useId:function(){var e=wo(),t=Il.identifierPrefix;if(q){var n=yi,r=vi;n=(r&~(1<<32-Me(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=mo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ss,useFormState:Yo,useActionState:Yo,useOptimistic:function(e){var t=wo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ks.bind(null,J,!0,n),n.dispatch=t,[e,t]},useMemoCache:ko,useCacheRefresh:function(){return wo().memoizedState=Ts.bind(null,J)},useEffectEvent:function(e){var t=wo(),n={impl:e};return t.memoizedState=n,function(){if(Y&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Fs={readContext:qi,use:Oo,useCallback:ps,useContext:qi,useEffect:as,useImperativeHandle:ds,useInsertionEffect:cs,useLayoutEffect:ls,useMemo:ms,useReducer:jo,useRef:ts,useState:function(){return jo(Ao)},useDebugValue:fs,useDeferredValue:function(e,t){return gs(To(),ao.memoizedState,e,t)},useTransition:function(){var e=jo(Ao)[0],t=To().memoizedState;return[typeof e==`boolean`?e:Do(e),t]},useSyncExternalStore:Po,useId:Cs,useHostTransitionStatus:Ss,useFormState:Xo,useActionState:Xo,useOptimistic:function(e,t){return Vo(To(),ao,e,t)},useMemoCache:ko,useCacheRefresh:ws};Fs.useEffectEvent=ss;var Is={readContext:qi,use:Oo,useCallback:ps,useContext:qi,useEffect:as,useImperativeHandle:ds,useInsertionEffect:cs,useLayoutEffect:ls,useMemo:ms,useReducer:No,useRef:ts,useState:function(){return No(Ao)},useDebugValue:fs,useDeferredValue:function(e,t){var n=To();return ao===null?hs(n,e,t):gs(n,ao.memoizedState,e,t)},useTransition:function(){var e=No(Ao)[0],t=To().memoizedState;return[typeof e==`boolean`?e:Do(e),t]},useSyncExternalStore:Po,useId:Cs,useHostTransitionStatus:Ss,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){var n=To();return ao===null?(n.baseState=e,[e,n.queue.dispatch]):Vo(n,ao,e,t)},useMemoCache:ko,useCacheRefresh:ws};Is.useEffectEvent=ss;function Ls(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Fa(r);i.payload=t,n!=null&&(i.callback=n),t=Ia(e,i,r),t!==null&&(mu(t,e,r),La(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Fa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ia(e,i,r),t!==null&&(mu(t,e,r),La(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fu(),r=Fa(n);r.tag=2,t!=null&&(r.callback=t),t=Ia(e,r,n),t!==null&&(mu(t,e,n),La(t,e,n))}};function zs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!hr(n,r)||!hr(i,a):!0}function Bs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Rs.enqueueReplaceState(t,t.state,null)}function Vs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Hs(e){Hr(e)}function Us(e){console.error(e)}function Ws(e){Hr(e)}function Gs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ks(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){return n=Fa(n),n.tag=3,n.payload={element:null},n.callback=function(){Gs(e,t)},n}function Js(e){return e=Fa(e),e.tag=3,e}function Ys(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ks(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ks(t,n,r),typeof i!=`function`&&(nu===null?nu=new Set([this]):nu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Xs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Wi(t,n,a,!0),n=Ya.current,n!==null){switch(n.tag){case 31:case 13:return Xa===null?Eu():n.alternate===null&&Ul===0&&(Ul=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===_a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===_a?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Eu(),!1}if(q)return t=Ya.current,t===null?(r!==ki&&(t=Error(i(423),{cause:r}),Ii(ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ui(r,n),a=qs(e.stateNode,r,a),Ra(e,a),Ul!==4&&(Ul=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ki&&(e=Error(i(422),{cause:r}),Ii(ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ui(o,n),Yl===null?Yl=[o]:Yl.push(o),Ul!==4&&(Ul=2),t===null)return!0;r=ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=qs(n.stateNode,r,e),Ra(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(nu===null||!nu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Js(a),Ys(a,e,n,r),Ra(n,a),!1}n=n.return}while(n!==null);return!1}var Zs=Error(i(461)),Qs=!1;function $s(e,t,n,r){t.child=e===null?ja(t,null,n,r):Aa(t,e.child,n,r)}function ec(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ki(t),r=_o(e,t,n,o,a,i),s=xo(),e!==null&&!Qs?(So(e,t,i),wc(e,t,i)):(q&&s&&Si(t),t.flags|=1,$s(e,t,r,i),t.child)}function tc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ti(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,nc(e,t,a,r,i)):(e=ii(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Tc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?hr:n,n(o,r)&&e.ref===t.ref)return wc(e,t,i)}return t.flags|=1,e=ni(a,r),e.ref=t.ref,e.return=t,t.child=e}function nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(hr(a,r)&&e.ref===t.ref)if(Qs=!1,t.pendingProps=r=a,Tc(e,i))e.flags&131072&&(Qs=!0);else return t.lanes=e.lanes,wc(e,t,i)}return uc(e,t,n,r,i)}function rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ac(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&fa(t,a===null?null:a.cachePool),a===null?qa():Ka(t,a),$a(t);else return r=t.lanes=536870912,ac(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&fa(t,null),qa(),eo(t)):(fa(t,a.cachePool),Ka(t,a),eo(t),t.memoizedState=null);return $s(e,t,i,n),t.child}function ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ac(e,t,n,r,i){var a=da();return a=a===null?null:{parent:$i._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&fa(t,null),qa(),$a(t),e!==null&&Wi(e,t,r,!0),t.childLanes=i,null}function oc(e,t){return t=yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sc(e,t,n){return Aa(t,e.child,null,n),e=oc(t,t.pendingProps),e.flags|=2,to(t),t.memoizedState=null,e}function cc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(q){if(r.mode===`hidden`)return e=oc(t,r),t.lanes=536870912,ic(null,e);if(Qa(t),(e=Ei)?(e=rf(e,Oi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i===null?null:{id:vi,overflow:yi},retryLane:536870912,hydrationErrors:null},n=si(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw Ai(t);return t.lanes=536870912,null}return oc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Qa(t),a)if(t.flags&256)t.flags&=-257,t=sc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Qs||Wi(e,t,n,!1),a=(n&e.childLanes)!==0,Qs||a){if(r=Il,r!==null&&(s=Ye(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Yr(e,s),mu(r,e,s),Zs;Eu(),t=sc(e,t,n)}else e=o.treeContext,Ei=cf(s.nextSibling),Ti=t,q=!0,Di=null,Oi=!1,e!==null&&wi(t,e),t=oc(t,r),t.flags|=4096;return t}return e=ni(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function uc(e,t,n,r,i){return Ki(t),n=_o(e,t,n,r,void 0,i),r=xo(),e!==null&&!Qs?(So(e,t,i),wc(e,t,i)):(q&&r&&Si(t),t.flags|=1,$s(e,t,n,i),t.child)}function dc(e,t,n,r,i,a){return Ki(t),t.updateQueue=null,n=yo(t,r,n,i),vo(e),r=xo(),e!==null&&!Qs?(So(e,t,a),wc(e,t,a)):(q&&r&&Si(t),t.flags|=1,$s(e,t,n,a),t.child)}function fc(e,t,n,r,i){if(Ki(t),t.stateNode===null){var a=Qr,o=n.contextType;typeof o==`object`&&o&&(a=qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Rs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Na(t),o=n.contextType,a.context=typeof o==`object`&&o?qi(o):Qr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ls(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Rs.enqueueReplaceState(a,a.state,null),Va(t,r,a,i),Ba(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Vs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Qr,typeof u==`object`&&u&&(o=qi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Bs(t,a,r,o),Ma=!1;var f=t.memoizedState;a.state=f,Va(t,r,a,i),Ba(),l=t.memoizedState,s||f!==l||Ma?(typeof d==`function`&&(Ls(t,n,d,r),l=t.memoizedState),(c=Ma||zs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Pa(e,t),o=t.memoizedProps,u=Vs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Qr,typeof l==`object`&&l&&(c=qi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Bs(t,a,r,c),Ma=!1,f=t.memoizedState,a.state=f,Va(t,r,a,i),Ba();var p=t.memoizedState;o!==d||f!==p||Ma||e!==null&&e.dependencies!==null&&Gi(e.dependencies)?(typeof s==`function`&&(Ls(t,n,s,r),p=t.memoizedState),(u=Ma||zs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Gi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,lc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Aa(t,e.child,null,i),t.child=Aa(t,null,n,i)):$s(e,t,n,i),t.memoizedState=a.state,e=t.child):e=wc(e,t,i),e}function pc(e,t,n,r){return Pi(),t.flags|=256,$s(e,t,n,r),t.child}var mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hc(e){return{baseLanes:e,cachePool:pa()}}function gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function _c(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(no.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(q){if(a?Za(t):eo(t),(e=Ei)?(e=rf(e,Oi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i===null?null:{id:vi,overflow:yi},retryLane:536870912,hydrationErrors:null},n=si(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw Ai(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(eo(t),a=t.mode,c=yc({mode:`hidden`,children:c},a),r=ai(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(null,r)):(Za(t),vc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Za(t),t.flags&=-257,t=bc(e,t,n)):t.memoizedState===null?(eo(t),c=r.fallback,a=t.mode,r=yc({mode:`visible`,children:r.children},a),c=ai(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Aa(t,e.child,null,n),r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,t=ic(null,r)):(eo(t),t.child=e.child,t.flags|=128,t=null);else if(Za(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ii({value:r,source:null,stack:null}),t=bc(e,t,n)}else if(Qs||Wi(e,t,n,!1),s=(n&e.childLanes)!==0,Qs||s){if(s=Il,s!==null&&(r=Ye(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Yr(e,r),mu(s,e,r),Zs;af(c)||Eu(),t=bc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ei=cf(c.nextSibling),Ti=t,q=!0,Di=null,Oi=!1,e!==null&&wi(t,e),t=vc(t,r.children),t.flags|=4096);return t}return a?(eo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ni(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ai(c,a,n,null),c.flags|=2):c=ni(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ic(null,r),r=t.child,c=e.child.memoizedState,c===null?c=hc(n):(a=c.cachePool,a===null?a=pa():(l=$i._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(e.child,r)):(Za(t),n=e.child,e=n.sibling,n=ni(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function vc(e,t){return t=yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function yc(e,t){return e=ei(22,e,null,t),e.lanes=0,e}function bc(e,t,n){return Aa(t,e.child,null,n),e=vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Hi(e.return,t,n)}function Sc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Cc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=no.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,L(no,o),$s(e,t,r,n),r=q?mi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xc(e,n,t);else if(e.tag===19)xc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ro(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sc(t,!0,n,null,a,r);break;case`together`:Sc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function wc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Wi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Gi(e))):!0}function Ec(e,t,n){switch(t.tag){case 3:se(t,t.stateNode.containerInfo),Bi(t,$i,e.memoizedState.cache),Pi();break;case 27:case 5:H(t);break;case 4:se(t,t.stateNode.containerInfo);break;case 10:Bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qa(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Za(t),e=wc(e,t,n),e===null?null:e.sibling):_c(e,t,n):(Za(t),t.flags|=128,null);Za(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Wi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Cc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),L(no,no.current),r)break;return null;case 22:return t.lanes=0,rc(e,t,n,t.pendingProps);case 24:Bi(t,$i,e.memoizedState.cache)}return wc(e,t,n)}function Dc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qs=!0;else{if(!Tc(e,n)&&!(t.flags&128))return Qs=!1,Ec(e,t,n);Qs=!!(e.flags&131072)}else Qs=!1,q&&t.flags&1048576&&xi(t,mi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ba(t.elementType),t.type=e,typeof e==`function`)ti(e)?(r=Vs(e,r),t.tag=1,t=fc(null,t,e,r,n)):(t.tag=0,t=uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ec(null,t,e,r,n);break a}else if(a===E){t.tag=14,t=tc(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Vs(r,t.pendingProps),fc(e,t,r,a,n);case 3:a:{if(se(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Pa(e,t),Va(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Bi(t,$i,r),r!==o.cache&&Ui(t,[$i],n,!0),Ba(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=pc(e,t,r,n);break a}else if(r!==a){a=ui(Error(i(424)),t),Ii(a),t=pc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ei=cf(e.firstChild),Ti=t,q=!0,Di=null,Oi=!0,n=ja(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pi(),r===a){t=wc(e,t,n);break a}$s(e,t,r,n)}t=t.child}return t;case 26:return lc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:q||(n=t.type,e=t.pendingProps,r=Bd(z.current).createElement(n),r[tt]=t,r[nt]=e,Pd(r,n,e),mt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return H(t),e===null&&q&&(r=t.stateNode=ff(t.type,t.pendingProps,z.current),Ti=t,Oi=!0,a=Ei,Zd(t.type)?(lf=a,Ei=cf(r.firstChild)):Ei=a),$s(e,t,t.pendingProps.children,n),lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&q&&((a=r=Ei)&&(r=tf(r,t.type,t.pendingProps,Oi),r===null?a=!1:(t.stateNode=r,Ti=t,Ei=cf(r.firstChild),Oi=!1,a=!0)),a||Ai(t)),H(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=_o(e,t,bo,null,null,n),Qf._currentValue=a),lc(e,t),$s(e,t,r,n),t.child;case 6:return e===null&&q&&((e=n=Ei)&&(n=nf(n,t.pendingProps,Oi),n===null?e=!1:(t.stateNode=n,Ti=t,Ei=null,e=!0)),e||Ai(t)),null;case 13:return _c(e,t,n);case 4:return se(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Aa(t,null,r,n):$s(e,t,r,n),t.child;case 11:return ec(e,t,t.type,t.pendingProps,n);case 7:return $s(e,t,t.pendingProps,n),t.child;case 8:return $s(e,t,t.pendingProps.children,n),t.child;case 12:return $s(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Bi(t,t.type,r.value),$s(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ki(t),a=qi(a),r=r(a),t.flags|=1,$s(e,t,r,n),t.child;case 14:return tc(e,t,t.type,t.pendingProps,n);case 15:return nc(e,t,t.type,t.pendingProps,n);case 19:return Cc(e,t,n);case 31:return cc(e,t,n);case 22:return rc(e,t,n,t.pendingProps);case 24:return Ki(t),r=qi($i),e===null?(a=da(),a===null&&(a=Il,o=ea(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Na(t),Bi(t,$i,a)):((e.lanes&n)!==0&&(Pa(e,t),Va(t,null,null,n),Ba()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Bi(t,$i,r),r!==a.cache&&Ui(t,[$i],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Bi(t,$i,r))),$s(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Oc(e){e.flags|=4}function kc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Cu())e.flags|=8192;else throw xa=_a,ha}else e.flags&=-16777217}function Ac(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Cu())e.flags|=8192;else throw xa=_a,ha}function jc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ue(),e.lanes|=t,Jl|=t)}function Mc(e,t){if(!q)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Nc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Pc(e,t,n){var r=t.pendingProps;switch(Ci(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nc(t),null;case 1:return Nc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Vi($i),V(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ni(t)?Oc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Fi())),Nc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Oc(t),o===null?(Nc(t),kc(t,a,null,r,n)):(Nc(t),Ac(t,o))):o?o===e.memoizedState?(Nc(t),t.flags&=-16777217):(Oc(t),Nc(t),Ac(t,o)):(e=e.memoizedProps,e!==r&&Oc(t),Nc(t),kc(t,a,e,r,n)),null;case 27:if(U(t),n=z.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Nc(t),null}e=oe.current,Ni(t)?ji(t,e):(e=ff(a,r,n),t.stateNode=e,Oc(t))}return Nc(t),null;case 5:if(U(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Nc(t),null}if(o=oe.current,Ni(t))ji(t,o);else{var s=Bd(z.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[tt]=t,o[nt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Oc(t)}}return Nc(t),kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=z.current,Ni(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ti,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Ai(t,!0)}else e=Bd(e).createTextNode(r),e[tt]=t,t.stateNode=e}return Nc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ni(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[tt]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),e=!1}else n=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(to(t),t):(to(t),null);if(t.flags&128)throw Error(i(558))}return Nc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ni(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[tt]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),a=!1}else a=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(to(t),t):(to(t),null)}return to(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),jc(t,t.updateQueue),Nc(t),null);case 4:return V(),e===null&&xd(t.stateNode.containerInfo),Nc(t),null;case 10:return Vi(t.type),Nc(t),null;case 19:if(I(no),r=t.memoizedState,r===null)return Nc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Mc(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ro(e),o!==null){for(t.flags|=128,Mc(r,!1),e=o.updateQueue,t.updateQueue=e,jc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ri(n,e),n=n.sibling;return L(no,no.current&1|2),q&&bi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&be()>eu&&(t.flags|=128,a=!0,Mc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ro(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,jc(t,e),Mc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!q)return Nc(t),null}else 2*be()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,Mc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Nc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=be(),e.sibling=null,n=no.current,L(no,a?n&1|2:n&1),q&&bi(t,r.treeForkCount),e);case 22:case 23:return to(t),Ja(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Nc(t),t.subtreeFlags&6&&(t.flags|=8192)):Nc(t),n=t.updateQueue,n!==null&&jc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(ua),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Vi($i),Nc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Fc(e,t){switch(Ci(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vi($i),V(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return U(t),null;case 31:if(t.memoizedState!==null){if(to(t),t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(to(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(no),null;case 4:return V(),null;case 10:return Vi(t.type),null;case 22:case 23:return to(t),Ja(),e!==null&&I(ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vi($i),null;case 25:return null;default:return null}}function Ic(e,t){switch(Ci(t),t.tag){case 3:Vi($i),V();break;case 26:case 27:case 5:U(t);break;case 4:V();break;case 31:t.memoizedState!==null&&to(t);break;case 13:to(t);break;case 19:I(no);break;case 10:Vi(t.type);break;case 22:case 23:to(t),Ja(),e!==null&&I(ua);break;case 24:Vi($i)}}function Lc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Q(t,t.return,e)}}function Rc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Q(t,t.return,e)}}function zc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ua(t,n)}catch(t){Q(e,e.return,t)}}}function Bc(e,t,n){n.props=Vs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function Vc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Q(e,t,n)}}function Hc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Q(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Q(e,t,n)}else n.current=null}function Uc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Q(e,e.return,t)}}function Wc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[nt]=t}catch(t){Q(e,e.return,t)}}function Gc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Kc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Gc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=qt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[tt]=e,t[nt]=n}catch(t){Q(e,e.return,t)}}var Xc=!1,Zc=!1,Qc=!1,$c=typeof WeakSet==`function`?WeakSet:Set,el=null;function tl(e,t){if(e=e.containerInfo,Rd=sp,e=yr(e),br(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,el=t;el!==null;)if(t=el,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,el=e;else for(;el!==null;){switch(t=el,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Vs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Q(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,el=e;break}el=t.return}}function nl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:_l(e,n),r&4&&Lc(5,n);break;case 1:if(_l(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Q(n,n.return,e)}else{var i=Vs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Q(n,n.return,e)}}r&64&&zc(n),r&512&&Vc(n,n.return);break;case 3:if(_l(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ua(e,t)}catch(e){Q(n,n.return,e)}}break;case 27:t===null&&r&4&&Yc(n);case 26:case 5:_l(e,n),t===null&&r&4&&Uc(n),r&512&&Vc(n,n.return);break;case 12:_l(e,n);break;case 31:_l(e,n),r&4&&cl(e,n);break;case 13:_l(e,n),r&4&&ll(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Xc,!r){t=t!==null&&t.memoizedState!==null||Zc,i=Xc;var a=Zc;Xc=r,(Zc=t)&&!a?yl(e,n,(n.subtreeFlags&8772)!=0):_l(e,n),Xc=i,Zc=a}break;case 30:break;default:_l(e,n)}}function rl(e){var t=e.alternate;t!==null&&(e.alternate=null,rl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var il=null,al=!1;function ol(e,t,n){for(n=n.child;n!==null;)sl(e,t,n),n=n.sibling}function sl(e,t,n){if(Ae&&typeof Ae.onCommitFiberUnmount==`function`)try{Ae.onCommitFiberUnmount(ke,n)}catch{}switch(n.tag){case 26:Zc||Hc(n,t),ol(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Zc||Hc(n,t);var r=il,i=al;Zd(n.type)&&(il=n.stateNode,al=!1),ol(e,t,n),pf(n.stateNode),il=r,al=i;break;case 5:Zc||Hc(n,t);case 6:if(r=il,i=al,il=null,ol(e,t,n),il=r,al=i,il!==null)if(al)try{(il.nodeType===9?il.body:il.nodeName===`HTML`?il.ownerDocument.body:il).removeChild(n.stateNode)}catch(e){Q(n,t,e)}else try{il.removeChild(n.stateNode)}catch(e){Q(n,t,e)}break;case 18:il!==null&&(al?(e=il,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(il,n.stateNode));break;case 4:r=il,i=al,il=n.stateNode.containerInfo,al=!0,ol(e,t,n),il=r,al=i;break;case 0:case 11:case 14:case 15:Rc(2,n,t),Zc||Rc(4,n,t),ol(e,t,n);break;case 1:Zc||(Hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Bc(n,t,r)),ol(e,t,n);break;case 21:ol(e,t,n);break;case 22:Zc=(r=Zc)||n.memoizedState!==null,ol(e,t,n),Zc=r;break;default:ol(e,t,n)}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Q(t,t.return,e)}}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Q(t,t.return,e)}}function ul(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $c),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $c),t;default:throw Error(i(435,e.tag))}}function dl(e,t){var n=ul(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function fl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){il=c.stateNode,al=!1;break a}break;case 5:il=c.stateNode,al=!1;break a;case 3:case 4:il=c.stateNode.containerInfo,al=!0;break a}c=c.return}if(il===null)throw Error(i(160));sl(o,s,a),il=null,al=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ml(t,e),t=t.sibling}var pl=null;function ml(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fl(t,e),hl(e),r&4&&(Rc(3,e,e.return),Lc(3,e),Rc(5,e,e.return));break;case 1:fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),r&64&&Xc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=pl;if(fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ct]||o[tt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[tt]=e,mt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[tt]=e,mt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Wc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),n!==null&&r&4&&Wc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),e.flags&32){a=e.stateNode;try{zt(a,``)}catch(t){Q(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Wc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Qc=!0);break;case 6:if(fl(t,e),hl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Q(e,e.return,t)}}break;case 3:if(Bf=null,a=pl,pl=gf(t.containerInfo),fl(t,e),pl=a,hl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Q(e,e.return,t)}Qc&&(Qc=!1,gl(e));break;case 4:r=pl,pl=gf(e.stateNode.containerInfo),fl(t,e),hl(e),pl=r;break;case 12:fl(t,e),hl(e);break;case 31:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 13:fl(t,e),hl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ql=be()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Xc,d=Zc;if(Xc=u||a,Zc=d||l,fl(t,e),Zc=d,Xc=u,hl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Xc||Zc||vl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Q(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Q(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Q(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,dl(e,n))));break;case 19:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 30:break;case 21:break;default:fl(t,e),hl(e)}}function hl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Gc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Jc(e,Kc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(zt(o,``),n.flags&=-33),Jc(e,Kc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;qc(e,Kc(e),s);break;default:throw Error(i(161))}}catch(t){Q(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _l(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nl(e,t.alternate,t),t=t.sibling}function vl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Rc(4,t,t.return),vl(t);break;case 1:Hc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Bc(t,t.return,n),vl(t);break;case 27:pf(t.stateNode);case 26:case 5:Hc(t,t.return),vl(t);break;case 22:t.memoizedState===null&&vl(t);break;case 30:vl(t);break;default:vl(t)}e=e.sibling}}function yl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:yl(i,a,n),Lc(4,a);break;case 1:if(yl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Q(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ha(c[i],s)}catch(e){Q(r,r.return,e)}}n&&o&64&&zc(a),Vc(a,a.return);break;case 27:Yc(a);case 26:case 5:yl(i,a,n),n&&r===null&&o&4&&Uc(a),Vc(a,a.return);break;case 12:yl(i,a,n);break;case 31:yl(i,a,n),n&&o&4&&cl(i,a);break;case 13:yl(i,a,n),n&&o&4&&ll(i,a);break;case 22:a.memoizedState===null&&yl(i,a,n),Vc(a,a.return);break;case 30:break;default:yl(i,a,n)}t=t.sibling}}function bl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ta(n))}function xl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e))}function Sl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Cl(e,t,n,r),t=t.sibling}function Cl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Sl(e,t,n,r),i&2048&&Lc(9,t);break;case 1:Sl(e,t,n,r);break;case 3:Sl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e)));break;case 12:if(i&2048){Sl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Q(t,t.return,e)}}else Sl(e,t,n,r);break;case 31:Sl(e,t,n,r);break;case 13:Sl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Sl(e,t,n,r):(a._visibility|=2,wl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Sl(e,t,n,r):Tl(e,t),i&2048&&bl(o,t);break;case 24:Sl(e,t,n,r),i&2048&&xl(t.alternate,t);break;default:Sl(e,t,n,r)}}function wl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:wl(a,o,s,c,i),Lc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,wl(a,o,s,c,i)):u._visibility&2?wl(a,o,s,c,i):Tl(a,o),i&&l&2048&&bl(o.alternate,o);break;case 24:wl(a,o,s,c,i),i&&l&2048&&xl(o.alternate,o);break;default:wl(a,o,s,c,i)}t=t.sibling}}function Tl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Tl(n,r),i&2048&&bl(r.alternate,r);break;case 24:Tl(n,r),i&2048&&xl(r.alternate,r);break;default:Tl(n,r)}t=t.sibling}}var El=8192;function Dl(e,t,n){if(e.subtreeFlags&El)for(e=e.child;e!==null;)Ol(e,t,n),e=e.sibling}function Ol(e,t,n){switch(e.tag){case 26:Dl(e,t,n),e.flags&El&&e.memoizedState!==null&&Gf(n,pl,e.memoizedState,e.memoizedProps);break;case 5:Dl(e,t,n);break;case 3:case 4:var r=pl;pl=gf(e.stateNode.containerInfo),Dl(e,t,n),pl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=El,El=16777216,Dl(e,t,n),El=r):Dl(e,t,n));break;default:Dl(e,t,n)}}function kl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];el=r,Nl(r,e)}kl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jl(e),e=e.sibling}function jl(e){switch(e.tag){case 0:case 11:case 15:Al(e),e.flags&2048&&Rc(9,e,e.return);break;case 3:Al(e);break;case 12:Al(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ml(e)):Al(e);break;default:Al(e)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];el=r,Nl(r,e)}kl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Rc(8,t,t.return),Ml(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ml(t));break;default:Ml(t)}e=e.sibling}}function Nl(e,t){for(;el!==null;){var n=el;switch(n.tag){case 0:case 11:case 15:Rc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ta(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,el=r;else a:for(n=e;el!==null;){r=el;var i=r.sibling,a=r.return;if(rl(r),r===n){el=null;break a}if(i!==null){i.return=a,el=i;break a}el=a}}}var Pl={getCacheForType:function(e){var t=qi($i),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return qi($i).controller.signal}},Fl=typeof WeakMap==`function`?WeakMap:Map,Y=0,Il=null,X=null,Z=0,Ll=0,Rl=null,zl=!1,Bl=!1,Vl=!1,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,$l=0,eu=1/0,tu=null,nu=null,ru=0,iu=null,au=null,ou=0,su=0,cu=null,lu=null,uu=0,du=null;function fu(){return Y&2&&Z!==0?Z&-Z:M.T===null?Qe():ud()}function pu(){if(ql===0)if(!(Z&536870912)||q){var e=Le;Le<<=1,!(Le&3932160)&&(Le=262144),ql=e}else ql=536870912;return e=Ya.current,e!==null&&(e.flags|=32),ql}function mu(e,t,n){(e===Il&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)&&(xu(e,0),vu(e,Z,ql,!1)),Ge(e,n),(!(Y&2)||e!==Il)&&(e===Il&&(!(Y&2)&&(Gl|=n),Ul===4&&vu(e,Z,ql,!1)),nd(e))}function hu(e,t,n){if(Y&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ve(e,t),a=r?ku(e,t):Du(e,t,!0),o=r;do{if(a===0){Bl&&!r&&vu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!_u(n)){a=Du(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Yl;var l=c.current.memoizedState.isDehydrated;if(l&&(xu(c,s).flags|=256),s=Du(c,s,!1),s!==2){if(Vl&&!l){c.errorRecoveryDisabledLanes|=o,Gl|=o,a=4;break a}o=Xl,Xl=a,o!==null&&(Xl===null?Xl=o:Xl.push.apply(Xl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){xu(e,0),vu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:vu(r,t,ql,!zl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ql+300-be(),10<a)){if(vu(r,t,ql,!zl),Be(r,0,!0)!==0)break a;ou=t,r.timeoutHandle=Kd(gu.bind(null,r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,`Throttled`,-0,0),a);break a}gu(r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,null,-0,0)}}break}while(1);nd(e)}function gu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qt},Ol(t,a,d);var m=(a&62914560)===a?Ql-be():(a&4194048)===a?$l-be():0;if(m=qf(d,m),m!==null){ou=a,e.cancelPendingCommit=m(Iu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),vu(e,a,o,!l);return}}Iu(e,t,a,n,r,i,o,s,c)}function _u(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!mr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vu(e,t,n,r){t&=~Kl,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Me(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&qe(e,n,t)}function yu(){return Y&6?!0:(rd(0,!1),!1)}function bu(){if(X!==null){if(Ll===0)var e=X.return;else e=X,zi=Ri=null,Co(e),wa=null,Ta=0,e=X;for(;e!==null;)Ic(e.alternate,e),e=e.return;X=null}}function xu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ou=0,bu(),Il=e,X=n=ni(e.current,null),Z=t,Ll=0,Rl=null,zl=!1,Bl=Ve(e,t),Vl=!1,Jl=ql=Kl=Gl=Wl=Ul=0,Xl=Yl=null,Zl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Me(r),a=1<<i;t|=e[i],r&=~a}return Hl=t,Kr(),n}function Su(e,t){J=null,M.H=Ns,t===ma||t===ga?(t=Sa(),Ll=3):t===ha?(t=Sa(),Ll=4):Ll=t===Zs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Rl=t,X===null&&(Ul=1,Gs(e,ui(t,e.current)))}function Cu(){var e=Ya.current;return e===null?!0:(Z&4194048)===Z?Xa===null:(Z&62914560)===Z||Z&536870912?e===Xa:!1}function wu(){var e=M.H;return M.H=Ns,e===null?Ns:e}function Tu(){var e=M.A;return M.A=Pl,e}function Eu(){Ul=4,zl||(Z&4194048)!==Z&&Ya.current!==null||(Bl=!0),!(Wl&134217727)&&!(Gl&134217727)||Il===null||vu(Il,Z,ql,!1)}function Du(e,t,n){var r=Y;Y|=2;var i=wu(),a=Tu();(Il!==e||Z!==t)&&(tu=null,xu(e,t)),t=!1;var o=Ul;a:do try{if(Ll!==0&&X!==null){var s=X,c=Rl;switch(Ll){case 8:bu(),o=6;break a;case 3:case 2:case 9:case 6:Ya.current===null&&(t=!0);var l=Ll;if(Ll=0,Rl=null,Nu(e,s,c,l),n&&Bl){o=0;break a}break;default:l=Ll,Ll=0,Rl=null,Nu(e,s,c,l)}}Ou(),o=Ul;break}catch(t){Su(e,t)}while(1);return t&&e.shellSuspendCounter++,zi=Ri=null,Y=r,M.H=i,M.A=a,X===null&&(Il=null,Z=0,Kr()),o}function Ou(){for(;X!==null;)ju(X)}function ku(e,t){var n=Y;Y|=2;var r=wu(),a=Tu();Il!==e||Z!==t?(tu=null,eu=be()+500,xu(e,t)):Bl=Ve(e,t);a:do try{if(Ll!==0&&X!==null){t=X;var o=Rl;b:switch(Ll){case 1:Ll=0,Rl=null,Nu(e,t,o,1);break;case 2:case 9:if(va(o)){Ll=0,Rl=null,Mu(t);break}t=function(){Ll!==2&&Ll!==9||Il!==e||(Ll=7),nd(e)},o.then(t,t);break a;case 3:Ll=7;break a;case 4:Ll=5;break a;case 7:va(o)?(Ll=0,Rl=null,Mu(t)):(Ll=0,Rl=null,Nu(e,t,o,7));break;case 5:var s=null;switch(X.tag){case 26:s=X.memoizedState;case 5:case 27:var c=X;if(s?Wf(s):c.stateNode.complete){Ll=0,Rl=null;var l=c.sibling;if(l!==null)X=l;else{var u=c.return;u===null?X=null:(X=u,Pu(u))}break b}}Ll=0,Rl=null,Nu(e,t,o,5);break;case 6:Ll=0,Rl=null,Nu(e,t,o,6);break;case 8:bu(),Ul=6;break a;default:throw Error(i(462))}}Au();break}catch(t){Su(e,t)}while(1);return zi=Ri=null,M.H=r,M.A=a,Y=n,X===null?(Il=null,Z=0,Kr(),Ul):0}function Au(){for(;X!==null&&!ve();)ju(X)}function ju(e){var t=Dc(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Pu(e):X=t}function Mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dc(n,t,t.pendingProps,t.type,void 0,Z);break;case 11:t=dc(n,t,t.pendingProps,t.type.render,t.ref,Z);break;case 5:Co(t);default:Ic(n,t),t=X=ri(t,Hl),t=Dc(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Pu(e):X=t}function Nu(e,t,n,r){zi=Ri=null,Co(t),wa=null,Ta=0;var i=t.return;try{if(Xs(e,i,t,n,Z)){Ul=1,Gs(e,ui(n,e.current)),X=null;return}}catch(t){if(i!==null)throw X=i,t;Ul=1,Gs(e,ui(n,e.current)),X=null;return}t.flags&32768?(q||r===1?e=!0:Bl||Z&536870912?e=!1:(zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ya.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fu(t,e)):Pu(t)}function Pu(e){var t=e;do{if(t.flags&32768){Fu(t,zl);return}e=t.return;var n=Pc(t.alternate,t,Hl);if(n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);Ul===0&&(Ul=5)}function Fu(e,t){do{var n=Fc(e.alternate,e);if(n!==null){n.flags&=32767,X=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){X=e;return}X=e=n}while(e!==null);Ul=6,X=null}function Iu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Vu();while(ru!==0);if(Y&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Gr,Ke(e,n,o,s,c,l),e===Il&&(X=Il=null,Z=0),au=t,iu=e,ou=n,su=o,cu=a,lu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(we,function(){return Hu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=M.T,M.T=null,a=N.p,N.p=2,s=Y,Y|=4;try{tl(e,t,n)}finally{Y=s,N.p=a,M.T=r}}ru=1,Lu(),Ru(),zu()}}function Lu(){if(ru===1){ru=0;var e=iu,t=au,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=Y;Y|=4;try{ml(t,e);var a=zd,o=yr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&vr(s.ownerDocument.documentElement,s)){if(c!==null&&br(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=_r(s,h),v=_r(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{Y=i,N.p=r,M.T=n}}e.current=t,ru=2}}function Ru(){if(ru===2){ru=0;var e=iu,t=au,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=Y;Y|=4;try{nl(e,t.alternate,t)}finally{Y=i,N.p=r,M.T=n}}ru=3}}function zu(){if(ru===4||ru===3){ru=0,ye();var e=iu,t=au,n=ou,r=lu;t.subtreeFlags&10256||t.flags&10256?ru=5:(ru=0,au=iu=null,Bu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(nu=null),Ze(n),t=t.stateNode,Ae&&typeof Ae.onCommitFiberRoot==`function`)try{Ae.onCommitFiberRoot(ke,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=M.T,i=N.p,N.p=2,M.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{M.T=t,N.p=i}}ou&3&&Vu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===du?uu++:(uu=0,du=e):uu=0,rd(0,!1)}}function Bu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ta(t)))}function Vu(){return Lu(),Ru(),zu(),Hu()}function Hu(){if(ru!==5)return!1;var e=iu,t=su;su=0;var n=Ze(ou),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,Y&6)throw Error(i(331));var c=Y;if(Y|=4,jl(o.current),Cl(o,o.current,s,n),Y=c,rd(0,!1),Ae&&typeof Ae.onPostCommitFiberRoot==`function`)try{Ae.onPostCommitFiberRoot(ke,o)}catch{}return!0}finally{N.p=a,M.T=r,Bu(e,t)}}function Uu(e,t,n){t=ui(n,t),t=qs(e.stateNode,t,2),e=Ia(e,t,2),e!==null&&(Ge(e,2),nd(e))}function Q(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=ui(n,e),n=Js(2),r=Ia(t,n,2),r!==null&&(Ys(n,r,t,e),Ge(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Fl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Vl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Z&n)===n&&(Ul===4||Ul===3&&(Z&62914560)===Z&&300>be()-Ql?!(Y&2)&&xu(e,0):Kl|=n,Jl===Z&&(Jl=0)),nd(e)}function Ku(e,t){t===0&&(t=Ue()),e=Yr(e,t),e!==null&&(Ge(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return ge(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Me(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Z,a=Be(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ve(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=be(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}ru!==0&&ru!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Me(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=He(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Il,n=Z,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&_e(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ve(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&_e(r),Ze(n)){case 2:case 8:n=Ce;break;case 32:n=we;break;case 268435456:n=Ee;break;default:n=we}return r=sd.bind(null,e),n=ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&_e(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(ru!==0&&ru!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var r=Z;return r=Be(e,e===Il?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hu(e,r,t),od(e,be()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Vu())return null;hu(e,t,!0)}function ld(){Yd(function(){Y&6?ge(Se,id):ad()})}function ud(){if(td===0){var e=ia;e===0&&(e=Ie,Ie<<=1,!(Ie&261888)&&(Ie=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Kt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[nt]||null).action),o=r.submitter;o&&(t=(t=o[nt]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);ys(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),ys(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Br.length;md++){var hd=Br[md];Vr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Vr(Mr,`onAnimationEnd`),Vr(Nr,`onAnimationIteration`),Vr(Pr,`onAnimationStart`),Vr(`dblclick`,`onDoubleClick`),Vr(`focusin`,`onFocus`),Vr(`focusout`,`onBlur`),Vr(Fr,`onTransitionRun`),Vr(Ir,`onTransitionStart`),Vr(Lr,`onTransitionCancel`),Vr(Rr,`onTransitionEnd`),vt(`onMouseEnter`,[`mouseout`,`mouseover`]),vt(`onMouseLeave`,[`mouseout`,`mouseover`]),vt(`onPointerEnter`,[`pointerout`,`pointerover`]),vt(`onPointerLeave`,[`pointerout`,`pointerover`]),_t(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),_t(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),_t(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),_t(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Hr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Hr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[it];n===void 0&&(n=t[it]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,ht.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!rn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ut(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}en(function(){var r=a,i=Yt(n),s=[];a:{var c=zr.get(e);if(c!==void 0){var l=hn,u=e;switch(e){case`keypress`:if(un(n)===0)break a;case`keydown`:case`keyup`:l=jn;break;case`focusin`:u=`focus`,l=Sn;break;case`focusout`:u=`blur`,l=Sn;break;case`beforeblur`:case`afterblur`:l=Sn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=bn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Nn;break;case Mr:case Nr:case Pr:l=Cn;break;case Rr:l=Pn;break;case`scroll`:case`scrollend`:l=_n;break;case`wheel`:l=Fn;break;case`copy`:case`cut`:case`paste`:l=wn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Mn;break;case`toggle`:case`beforetoggle`:l=In}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=tn(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Jt&&(u=n.relatedTarget||n.fromElement)&&(ut(u)||u[rt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ut(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=bn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Mn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ft(l),h=u==null?c:ft(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ut(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=nr;else if(Xn(c))if(rr)v=fr;else{v=ur;var y=lr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ut(r.elementType)&&(v=nr):v=dr;if(v&&=v(e,r)){Zn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ft(c,`number`,c.value)}switch(y=r?ft(r):window,e){case`focusin`:(Xn(y)||y.contentEditable===`true`)&&(Sr=y,Cr=r,wr=null);break;case`focusout`:wr=Cr=Sr=null;break;case`mousedown`:Tr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Tr=!1,Er(s,n,i);break;case`selectionchange`:if(xr)break;case`keydown`:case`keyup`:Er(s,n,i)}var b;if(Rn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Kn?Wn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Vn&&n.locale!==`ko`&&(Kn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Kn&&(b=ln()):(on=i,sn=`value`in on?on.value:on.textContent,Kn=!0)),y=Td(r,x),0<y.length&&(x=new Tn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Gn(n),b!==null&&(x.data=b)))),(b=Bn?qn(e,n):Jn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new Tn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=tn(e,n),i!=null&&r.unshift(wd(e,i,a)),i=tn(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=tn(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=tn(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
9
- `).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&zt(e,``+r);break;case`className`:wt(e,`class`,r);break;case`tabIndex`:wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:wt(e,n,r);break;case`style`:Ht(e,r,o);break;case`data`:if(t!==`object`){wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Kt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Ct(e,`popover`,r);break;case`xlinkActuate`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ct(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Wt.get(n)||n,Ct(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Ht(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&zt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!gt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[nt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ct(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Md(e,t,r,d,n,null)}}Pt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&It(e,!!r,n,!0):It(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Md(e,t,s,c,n,null)}Rt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Ut(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}Nt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?It(e,!!n,n?[]:``,!1):It(e,!!n,t,!0)):It(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Md(e,t,s,a,r,o)}Lt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Ut(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),lt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=N.d;N.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=yu();return e||t}function yf(e){var t=dt(e);t!==null&&t.tag===5&&t.type===`form`?xs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=W(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+W(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+W(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+W(n.imageSizes)+`"]`)):i+=`[href="`+W(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+W(r)+`"][href="`+W(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),mt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=pt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);mt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=pt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),mt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=pt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),mt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=z.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=pt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=pt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=pt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+W(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),mt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+W(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+W(n.href)+`"]`);if(r)return t.instance=r,mt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),mt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,mt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,mt(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),mt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ct]||a[tt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,mt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=We(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=We(0),this.hiddenUpdates=We(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ei(3,null,null,t),e.current=a,a.stateNode=e,t=ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Na(a),e}function tp(e){return e?(e=Qr,e):Qr}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Fa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ia(e,r,t),n!==null&&(mu(n,e,t),La(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Yr(e,67108864);t!==null&&mu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=fu();t=Xe(t);var n=Yr(e,t);n!==null&&mu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,up(e,t,n,r)}finally{N.p=a,M.T=i}}function lp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,up(e,t,n,r)}finally{N.p=a,M.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Me(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Y&6)&&(eu=be()+500,rd(0,!1))}}break;case 31:case 13:s=Yr(a,2),s!==null&&mu(s,a,2),yu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Yt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ut(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(xe()){case Se:return 2;case Ce:return 8;case we:case Te:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=dt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ut(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,$e(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,$e(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Jt=r,n.target.dispatchEvent(r),Jt=null}else return t=dt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=dt(n);a!==null&&(e.splice(t,3),t-=3,ys(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[nt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[nt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,fu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),yu(),t[rt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.5`)throw Error(i(527,Lp,`19.2.5`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{ke=zp.inject(Rp),Ae=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Hs,s=Us,c=Ws;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[rt]=t.current,xd(e),new Fp(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),v=o(((e,t)=>{t.exports=_()})),y=c(g(),1),b=c(u(),1),x=v(),S={view:`login`,serverUrl:`http://localhost:4747`,connected:!1,graphLoad:null,currentUser:null,repoName:``,nodes:[],edges:[],selectedNode:null,hoveredNodeId:null,filters:{hiddenNodeKinds:new Set([`cluster`,`flow`,`directory`]),hiddenEdgeKinds:new Set,focusDepth:`all`},search:{query:``,results:[]},chat:{messages:[],loading:!1},mode:`repo`,groupName:``,groupMembers:[],groupContracts:[],groupLinks:[],groupSyncedAt:null};function C(e,t){switch(t.type){case`SET_VIEW`:return{...e,view:t.view};case`SET_SERVER_URL`:return{...e,serverUrl:t.url};case`SET_CONNECTED`:return{...e,connected:t.connected};case`SET_CURRENT_USER`:return{...e,currentUser:t.user};case`SET_REPO_NAME`:return{...e,repoName:t.name};case`SET_GRAPH`:return{...e,nodes:t.nodes,edges:t.edges};case`SELECT_NODE`:return{...e,selectedNode:t.node};case`HOVER_NODE`:return{...e,hoveredNodeId:t.nodeId};case`SET_SEARCH`:return{...e,search:{query:t.query,results:t.results}};case`ADD_CHAT_MESSAGE`:return{...e,chat:{...e.chat,messages:[...e.chat.messages,t.message]}};case`UPDATE_LAST_CHAT_MESSAGE`:{let n=e.chat.messages.slice();return n.length===0?e:(n[n.length-1]={...n[n.length-1],...t.message},{...e,chat:{...e.chat,messages:n}})}case`SET_CHAT_LOADING`:return{...e,chat:{...e.chat,loading:t.loading}};case`CLEAR_CHAT`:return{...e,chat:{messages:[],loading:!1}};case`TOGGLE_NODE_KIND`:{let n=new Set(e.filters.hiddenNodeKinds);return n.has(t.kind)?n.delete(t.kind):n.add(t.kind),{...e,filters:{...e.filters,hiddenNodeKinds:n}}}case`TOGGLE_EDGE_KIND`:{let n=new Set(e.filters.hiddenEdgeKinds);return n.has(t.kind)?n.delete(t.kind):n.add(t.kind),{...e,filters:{...e.filters,hiddenEdgeKinds:n}}}case`SET_FOCUS_DEPTH`:return{...e,filters:{...e.filters,focusDepth:t.depth}};case`RESET_FILTERS`:return{...e,filters:S.filters};case`SET_MODE`:return{...e,mode:t.mode};case`SET_GROUP_NAME`:return{...e,groupName:t.name};case`SET_GROUP_MEMBERS`:return{...e,groupMembers:t.members};case`SET_GROUP_CONTRACTS`:return{...e,groupContracts:t.contracts,groupLinks:t.links,groupSyncedAt:t.syncedAt};case`SET_GRAPH_LOAD`:return{...e,graphLoad:t.progress};default:return e}}var w=(0,b.createContext)({state:S,dispatch:()=>{}});function ee({children:e}){let[t,n]=(0,b.useReducer)(C,S);return(0,x.jsx)(w.Provider,{value:{state:t,dispatch:n},children:e})}function T(){return(0,b.useContext)(w)}var E=class{constructor(e){this.baseUrl=e}csrfToken=null;async getCsrfToken(){if(this.csrfToken)return this.csrfToken;let e=await(await fetch(`${this.baseUrl}/auth/csrf-token`,{credentials:`include`})).json();return this.csrfToken=e.csrfToken,this.csrfToken}async bootstrapStatus(){let e=await fetch(`${this.baseUrl}/auth/bootstrap-status`,{credentials:`include`});return e.ok?e.json():{needsBootstrap:!1}}async bootstrap(e,t){let n=await this.getCsrfToken(),r=await fetch(`${this.baseUrl}/auth/bootstrap`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":n},credentials:`include`,body:JSON.stringify({username:e,password:t})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e?.error?.message??`Bootstrap failed`)}return r.json()}async login(e,t){let n=await this.getCsrfToken(),r=await fetch(`${this.baseUrl}/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":n},credentials:`include`,body:JSON.stringify({username:e,password:t})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e?.error?.message??`Login failed`)}return r.json()}async logout(){let e=await this.getCsrfToken();await fetch(`${this.baseUrl}/auth/logout`,{method:`POST`,headers:{"X-CSRF-Token":e},credentials:`include`}),this.csrfToken=null}async authStatus(){let e=await fetch(`${this.baseUrl}/auth/status`,{credentials:`include`});return e.ok?e.json():{authenticated:!1}}async fetchGraph(e){let t=await fetch(`${this.baseUrl}/api/v1/graph/${e}`,{credentials:`include`});if(!t.ok)throw Error(`Failed to fetch graph: ${t.statusText}`);return t.json()}async fetchGraphNodes(e,t,n){let r=`${this.baseUrl}/api/v1/graph/${encodeURIComponent(e)}/nodes?limit=${n}&offset=${t}`,i=await fetch(r,{credentials:`include`});if(!i.ok)throw Error(`Failed to fetch graph nodes: ${i.statusText}`);return i.json()}async search(e,t=20){let n=await this.getCsrfToken(),r=await fetch(`${this.baseUrl}/api/v1/search`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":n},credentials:`include`,body:JSON.stringify({query:e,limit:t})});if(!r.ok)throw Error(`Search failed: ${r.statusText}`);return r.json()}async vectorSearch(e,t=10){let n=await this.getCsrfToken(),r=await fetch(`${this.baseUrl}/api/v1/vector-search`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":n},credentials:`include`,body:JSON.stringify({query:e,limit:t})});if(!r.ok)throw Error(`Vector search failed: ${r.statusText}`);return r.json()}async vectorStatus(){let e=await fetch(`${this.baseUrl}/api/v1/vector-status`,{credentials:`include`});return e.ok?e.json():{ready:!1,building:!1}}async listRepos(){let e=await fetch(`${this.baseUrl}/api/v1/repos`,{credentials:`include`});if(!e.ok)throw Error(`Failed to list repos: ${e.statusText}`);return e.json()}async readFile(e){let t=await this.getCsrfToken(),n=await fetch(`${this.baseUrl}/api/v1/files/read`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":t},credentials:`include`,body:JSON.stringify({file_path:e})});if(!n.ok)throw Error(`Failed to read file: ${n.statusText}`);return n.json()}async inspectNode(e,t){let n=`${this.baseUrl}/api/v1/nodes/${encodeURIComponent(e)}${t?`?repo=${encodeURIComponent(t)}`:``}`,r=await fetch(n,{credentials:`include`});if(!r.ok)throw Error(`Inspect failed: ${r.statusText}`);return r.json()}async blastRadius(e,t=`both`,n=3,r){let i=await this.getCsrfToken(),a=await fetch(`${this.baseUrl}/api/v1/blast-radius`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":i},credentials:`include`,body:JSON.stringify({target:e,direction:t,max_hops:n,repo:r})});if(!a.ok)throw Error(`Blast radius failed: ${a.statusText}`);return a.json()}async grep(e){let t=await this.getCsrfToken(),n=await fetch(`${this.baseUrl}/api/v1/grep`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":t},credentials:`include`,body:JSON.stringify({pattern:e})});if(!n.ok)throw Error(`Grep failed: ${n.statusText}`);return n.json()}async listFlows(){let e=await fetch(`${this.baseUrl}/api/v1/flows`,{credentials:`include`});if(!e.ok)throw Error(`List flows failed: ${e.statusText}`);return e.json()}async listGroups(){let e=await fetch(`${this.baseUrl}/api/v1/groups`,{credentials:`include`});if(!e.ok)throw Error(`Failed to list groups: ${e.statusText}`);return e.json()}async getGroup(e){let t=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}`,{credentials:`include`});if(!t.ok)throw Error(`Group not found: ${t.statusText}`);return t.json()}async getGroupContracts(e){let t=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/contracts`,{credentials:`include`});if(t.status===404)return null;if(!t.ok)throw Error(`Failed to get contracts: ${t.statusText}`);return t.json()}async syncGroup(e){let t=await this.getCsrfToken(),n=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/sync`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":t},credentials:`include`});if(!n.ok)throw Error(`Sync failed: ${n.statusText}`);return n.json()}async searchGroup(e,t,n=20){let r=await this.getCsrfToken(),i=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/search`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":r},credentials:`include`,body:JSON.stringify({q:t,limit:n})});if(!i.ok)throw Error(`Group search failed: ${i.statusText}`);return i.json()}async fetchGroupGraph(e){let t=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/graph`,{credentials:`include`});if(!t.ok)throw Error(`Failed to fetch group graph: ${t.statusText}`);return t.json()}async sourcePreview(e,t,n,r){let i=new URLSearchParams({file:e});t!==void 0&&i.set(`startLine`,String(t)),n!==void 0&&i.set(`endLine`,String(n)),r&&i.set(`repo`,r);let a=await fetch(`${this.baseUrl}/api/v1/source?${i.toString()}`,{credentials:`include`});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(e?.error?.message??`Source preview failed: ${a.statusText}`)}return a.json()}async getGroupTopology(e){let t=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/topology`,{credentials:`include`});if(!t.ok)throw Error(`Failed to get topology: ${t.statusText}`);return t.json()}async queryGQL(e){let t=await this.getCsrfToken(),n=await fetch(`${this.baseUrl}/api/v1/query`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":t},credentials:`include`,body:JSON.stringify({gql:e})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e?.error?.message??`Query failed: ${n.statusText}`)}return n.json()}};function D(){let{state:e,dispatch:t}=T(),n=window.location.port===`5173`||window.location.port===`5174`?`http://localhost:4747`:window.location.origin,[r,i]=(0,b.useState)(n),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)(``),[d,f]=(0,b.useState)(``),[p,m]=(0,b.useState)(!1),[h,g]=(0,b.useState)(!0),[_,v]=(0,b.useState)(!1);(0,b.useEffect)(()=>{let r=new E(e.serverUrl||n);(async()=>{try{let{needsBootstrap:i}=await r.bootstrapStatus();if(i){v(!0),g(!1);return}let a=await r.authStatus();a.authenticated&&a.user&&(t({type:`SET_SERVER_URL`,url:e.serverUrl||n}),t({type:`SET_CURRENT_USER`,user:a.user}),t({type:`SET_VIEW`,view:`connect`}))}catch{}g(!1)})()},[]);let y=async e=>{if(e.preventDefault(),!a.trim()||!s.trim()){f(`Username and password are required`);return}f(``),m(!0);try{let{user:e}=await new E(r).login(a.trim(),s);t({type:`SET_SERVER_URL`,url:r}),t({type:`SET_CURRENT_USER`,user:e}),t({type:`SET_VIEW`,view:`connect`})}catch(e){f(e instanceof Error?e.message:`Login failed`)}finally{m(!1)}},S=async e=>{if(e.preventDefault(),!a.trim()||!s.trim()){f(`Username and password are required`);return}if(s.length<8){f(`Password must be at least 8 characters`);return}if(s!==l){f(`Passwords do not match`);return}f(``),m(!0);try{let{user:e}=await new E(r).bootstrap(a.trim(),s);t({type:`SET_SERVER_URL`,url:r}),t({type:`SET_CURRENT_USER`,user:e}),t({type:`SET_VIEW`,view:`connect`})}catch(e){f(e instanceof Error?e.message:`Setup failed`)}finally{m(!1)}};if(h)return(0,x.jsx)(`div`,{className:`flex items-center justify-center min-h-screen bg-void`,children:(0,x.jsxs)(`div`,{className:`flex items-center gap-3 text-text-muted`,children:[(0,x.jsx)(k,{className:`w-5 h-5 text-accent`}),(0,x.jsx)(`span`,{className:`text-sm`,children:`Checking session…`})]})});let C=`w-full bg-elevated text-text-primary rounded-lg px-4 py-2.5 border border-border-default focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent/30 placeholder-text-muted transition disabled:opacity-50 text-sm`,w=`block text-xs font-medium text-text-secondary uppercase tracking-widest mb-1.5`;return _?(0,x.jsx)(`div`,{className:`flex items-center justify-center min-h-screen bg-void`,children:(0,x.jsxs)(`div`,{className:`bg-deep border border-border-subtle rounded-2xl shadow-2xl w-full max-w-sm p-10`,children:[(0,x.jsx)(te,{subtitle:`First-time Setup`}),(0,x.jsx)(`div`,{className:`mb-4 rounded-lg bg-accent/10 border border-accent/30 px-4 py-3`,children:(0,x.jsx)(`p`,{className:`text-text-secondary text-sm leading-snug`,children:`No admin account found. Create one to get started.`})}),(0,x.jsxs)(`form`,{onSubmit:S,className:`space-y-4`,children:[(0,x.jsx)(ne,{label:`Server URL`,labelClass:w,children:(0,x.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),disabled:p,className:C,placeholder:`http://localhost:4747`,autoComplete:`off`})}),(0,x.jsx)(ne,{label:`Admin Username`,labelClass:w,children:(0,x.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),disabled:p,autoComplete:`username`,className:C,placeholder:`admin`})}),(0,x.jsx)(ne,{label:`Password`,labelClass:w,children:(0,x.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),disabled:p,autoComplete:`new-password`,className:C,placeholder:`••••••••`})}),(0,x.jsx)(ne,{label:`Confirm Password`,labelClass:w,children:(0,x.jsx)(`input`,{type:`password`,value:l,onChange:e=>u(e.target.value),disabled:p,autoComplete:`new-password`,className:C,placeholder:`••••••••`})}),d&&(0,x.jsx)(O,{message:d}),(0,x.jsx)(`button`,{type:`submit`,disabled:p,className:`w-full bg-gradient-to-r from-accent to-accent-dim hover:opacity-90 text-white font-semibold rounded-lg py-2.5 transition flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed mt-2 shadow-glow`,children:p?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(k,{className:`w-4 h-4`}),` Creating account…`]}):`Create Admin Account`})]})]})}):(0,x.jsx)(`div`,{className:`flex items-center justify-center min-h-screen bg-void`,children:(0,x.jsxs)(`div`,{className:`bg-deep border border-border-subtle rounded-2xl shadow-2xl w-full max-w-sm p-10`,children:[(0,x.jsx)(te,{subtitle:`Sign in to your account`}),(0,x.jsxs)(`form`,{onSubmit:y,className:`space-y-4`,children:[(0,x.jsx)(ne,{label:`Server URL`,labelClass:w,children:(0,x.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),disabled:p,className:C,placeholder:`http://localhost:4747`,autoComplete:`off`})}),(0,x.jsx)(ne,{label:`Username`,labelClass:w,children:(0,x.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),disabled:p,autoComplete:`username`,className:C,placeholder:`admin`})}),(0,x.jsx)(ne,{label:`Password`,labelClass:w,children:(0,x.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),disabled:p,autoComplete:`current-password`,className:C,placeholder:`••••••••`})}),d&&(0,x.jsx)(O,{message:d}),(0,x.jsx)(`button`,{type:`submit`,disabled:p,className:`w-full bg-gradient-to-r from-accent to-accent-dim hover:opacity-90 text-white font-semibold rounded-lg py-2.5 transition flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed mt-2 shadow-glow`,children:p?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(k,{className:`w-4 h-4`}),` Signing in…`]}):`Sign in`})]}),(0,x.jsxs)(`div`,{className:`mt-6 pt-5 border-t border-border-subtle`,children:[(0,x.jsxs)(`p`,{className:`text-center text-xs text-text-muted`,children:[`No account?`,` `,(0,x.jsx)(`span`,{className:`font-mono text-text-secondary`,children:`code-intel user create admin --role admin`})]}),(0,x.jsxs)(`p`,{className:`text-center text-xs text-text-muted/60 mt-1.5`,children:[`Or use a Bearer token via`,` `,(0,x.jsx)(`span`,{className:`font-mono`,children:`Authorization: Bearer <token>`})]})]})]})})}function te({subtitle:e}){return(0,x.jsxs)(`div`,{className:`flex flex-col items-center mb-8`,children:[(0,x.jsx)(`div`,{className:`w-14 h-14 rounded-xl bg-gradient-to-br from-accent to-accent-dim flex items-center justify-center text-white text-3xl font-bold shadow-glow mb-4 select-none`,children:`◈`}),(0,x.jsx)(`h1`,{className:`text-2xl font-bold text-text-primary tracking-tight`,children:`Code Intel`}),(0,x.jsx)(`p`,{className:`text-text-muted text-sm mt-1`,children:e}),(0,x.jsxs)(`span`,{className:`mt-1.5 text-[10px] font-mono text-text-muted/50 select-none`,children:[`v`,`1.0.0`]})]})}function ne({label:e,labelClass:t,children:n}){return(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`label`,{className:t,children:e}),n]})}function O({message:e}){return(0,x.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg bg-red-950/40 border border-red-800/50 px-4 py-3`,children:[(0,x.jsx)(`svg`,{className:`w-4 h-4 text-red-400 mt-0.5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z`})}),(0,x.jsx)(`p`,{className:`text-red-400 text-sm leading-snug`,children:e})]})}function k({className:e=``}){return(0,x.jsxs)(`svg`,{className:`animate-spin ${e}`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,x.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,x.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z`})]})}function A(){let{dispatch:e}=T(),t=window.location.port===`5173`||window.location.port===`5174`?`http://localhost:4747`:window.location.origin,[n,r]=(0,b.useState)(t),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(`repo`),[u,d]=(0,b.useState)([]),[f,p]=(0,b.useState)([]),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(null);(0,b.useEffect)(()=>{v(t)},[]);let v=async e=>{try{d(await new E(e).listRepos()),a(``)}catch{d([])}};(0,b.useEffect)(()=>{c===`group`&&y()},[c,n]);let y=async()=>{h(!0);try{p(await new E(n).listGroups())}catch{p([])}finally{h(!1)}},S=async t=>{a(``),s(!0);try{let r=new E(n);e({type:`SET_SERVER_URL`,url:n}),e({type:`SET_MODE`,mode:`repo`}),e({type:`SET_REPO_NAME`,name:t}),e({type:`SET_VIEW`,view:`loading`}),e({type:`SET_GRAPH_LOAD`,progress:{loaded:0,total:0,phase:`edges`}});let[i,a]=await Promise.all([r.fetchGraph(t),r.fetchGraphNodes(t,0,200)]),o=a.total,s=[...a.nodes],c=new Set(s.map(e=>e.id));if(e({type:`SET_GRAPH_LOAD`,progress:{loaded:s.length,total:o,phase:`nodes`}}),a.hasMore){let n=[];for(let e=200;e<o;e+=200)n.push(e);for(let i=0;i<n.length;i+=8){let a=n.slice(i,i+8),l=await Promise.all(a.map(e=>r.fetchGraphNodes(t,e,200).catch(()=>null)));for(let e of l)if(e)for(let t of e.nodes)c.has(t.id)||(c.add(t.id),s.push(t));e({type:`SET_GRAPH_LOAD`,progress:{loaded:s.length,total:o,phase:`nodes`}})}}e({type:`SET_GRAPH_LOAD`,progress:null}),e({type:`SET_GRAPH`,nodes:s,edges:i.edges}),e({type:`SET_CONNECTED`,connected:!0}),e({type:`SET_VIEW`,view:`exploring`})}catch(t){a(t instanceof Error?t.message:`Connection failed`),e({type:`SET_GRAPH_LOAD`,progress:null}),e({type:`SET_VIEW`,view:`connect`}),s(!1)}},C=async t=>{a(``),_(t);try{let r=new E(n);e({type:`SET_SERVER_URL`,url:n}),e({type:`SET_VIEW`,view:`loading`});let[i,a]=await Promise.all([r.getGroup(t),r.fetchGroupGraph(t)]);e({type:`SET_MODE`,mode:`group`}),e({type:`SET_GROUP_NAME`,name:t}),e({type:`SET_GROUP_MEMBERS`,members:i.members}),e({type:`SET_REPO_NAME`,name:t}),e({type:`SET_GRAPH`,nodes:a.nodes,edges:a.edges}),e({type:`SET_CONNECTED`,connected:!0}),e({type:`SET_VIEW`,view:`exploring`}),r.getGroupContracts(t).then(t=>{t&&e({type:`SET_GROUP_CONTRACTS`,contracts:t.contracts,links:t.links,syncedAt:t.syncedAt})}).catch(()=>{})}catch(t){a(t instanceof Error?t.message:`Failed to load group`),e({type:`SET_VIEW`,view:`connect`})}finally{_(null)}};return(0,x.jsx)(`div`,{className:`flex items-center justify-center min-h-screen bg-void`,children:(0,x.jsxs)(`div`,{className:`bg-deep border border-border-subtle rounded-2xl shadow-2xl w-full max-w-md p-10`,children:[(0,x.jsxs)(`div`,{className:`flex flex-col items-center mb-8`,children:[(0,x.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-gradient-to-br from-accent to-accent-dim flex items-center justify-center text-white text-2xl font-bold shadow-glow mb-4 select-none`,children:`◈`}),(0,x.jsx)(`h1`,{className:`text-2xl font-bold text-text-primary tracking-tight`,children:`Code Intel`}),(0,x.jsx)(`p`,{className:`text-text-muted text-sm mt-1`,children:`Knowledge Graph Explorer`})]}),(0,x.jsx)(`div`,{className:`flex bg-surface rounded-lg p-1 mb-6 border border-border-subtle`,children:[`repo`,`group`].map(e=>(0,x.jsx)(`button`,{onClick:()=>l(e),className:`flex-1 py-1.5 rounded-md text-sm font-medium transition ${c===e?`bg-gradient-to-r from-accent to-accent-dim text-white shadow`:`text-text-muted hover:text-text-secondary`}`,children:e===`repo`?`⬡ Repository`:`⬢ Group`},e))}),(0,x.jsxs)(`div`,{className:`space-y-4`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`label`,{className:`block text-xs font-medium text-text-secondary uppercase tracking-widest mb-2`,children:`Server URL`}),(0,x.jsx)(`input`,{type:`text`,value:n,onChange:e=>{r(e.target.value),v(e.target.value)},disabled:o||g!==null,className:`w-full bg-elevated text-text-primary rounded-lg px-4 py-2.5 border border-border-default focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent/30 placeholder-text-muted transition disabled:opacity-50 text-sm`,placeholder:`http://localhost:4747`})]}),i&&(0,x.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg bg-red-950/40 border border-red-800/50 px-4 py-3`,children:[(0,x.jsx)(`svg`,{className:`w-4 h-4 text-red-400 mt-0.5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z`})}),(0,x.jsx)(`p`,{className:`text-red-400 text-sm leading-snug`,children:i})]}),c===`repo`&&(0,x.jsx)(`div`,{children:u.length>0?(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(`p`,{className:`text-xs text-text-muted uppercase tracking-widest font-medium`,children:`Indexed repositories`}),u.map(e=>(0,x.jsxs)(`button`,{onClick:()=>S(e.name),disabled:o,className:`w-full flex items-center justify-between bg-surface hover:bg-hover border rounded-xl px-4 py-3 transition group disabled:opacity-50 disabled:cursor-not-allowed text-left ${e.active?`border-accent/40 hover:border-accent/60`:`border-border-subtle hover:border-border-default`}`,children:[(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-node-function animate-pulse shrink-0`}),(0,x.jsx)(`div`,{className:`text-sm font-semibold text-text-primary truncate`,children:e.name}),e.active&&(0,x.jsx)(`span`,{className:`text-[9px] bg-accent/20 text-accent border border-accent/30 px-1.5 py-0.5 rounded-full font-medium shrink-0`,children:`active`})]}),(0,x.jsxs)(`div`,{className:`text-xs text-text-muted mt-0.5 pl-3.5`,children:[e.nodes.toLocaleString(),` nodes · `,e.edges.toLocaleString(),` edges`]}),e.path&&(0,x.jsx)(`div`,{className:`text-[10px] text-text-muted/50 font-mono truncate mt-0.5 pl-3.5`,children:e.path})]}),o?(0,x.jsx)(j,{className:`w-4 h-4 text-accent ml-2 shrink-0`}):(0,x.jsx)(`span`,{className:`text-text-muted group-hover:text-accent transition text-lg ml-2 shrink-0`,children:`→`})]},e.name))]}):(0,x.jsxs)(`div`,{className:`bg-surface border border-border-subtle rounded-xl px-4 py-6 text-center`,children:[(0,x.jsx)(`p`,{className:`text-text-muted text-sm mb-2`,children:`No repositories found at this URL.`}),(0,x.jsx)(`p`,{className:`text-text-muted/60 text-xs font-mono`,children:`code-intel analyze`})]})}),c===`group`&&(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium text-text-secondary uppercase tracking-widest`,children:`Available Groups`}),(0,x.jsx)(`button`,{onClick:y,disabled:m,className:`text-xs text-accent hover:text-accent/80 transition disabled:opacity-50`,children:`↻ Refresh`})]}),m?(0,x.jsxs)(`div`,{className:`flex items-center justify-center py-8 text-text-muted text-sm gap-2`,children:[(0,x.jsx)(j,{className:`w-4 h-4`}),`Loading groups…`]}):f.length===0?(0,x.jsxs)(`div`,{className:`bg-surface border border-border-subtle rounded-xl px-4 py-6 text-center`,children:[(0,x.jsx)(`p`,{className:`text-text-muted text-sm mb-2`,children:`No groups found.`}),(0,x.jsx)(`p`,{className:`text-text-muted/60 text-xs font-mono`,children:`code-intel group create <name>`})]}):(0,x.jsx)(`div`,{className:`space-y-2 max-h-64 overflow-y-auto pr-1 scrollbar-thin`,children:f.map(e=>(0,x.jsxs)(`button`,{onClick:()=>C(e.name),disabled:g!==null,className:`w-full flex items-center justify-between bg-surface hover:bg-hover border border-border-subtle hover:border-border-default rounded-xl px-4 py-3 transition group disabled:opacity-50 disabled:cursor-not-allowed text-left`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(`span`,{className:`text-accent font-semibold text-sm`,children:[`⬢ `,e.name]}),g===e.name&&(0,x.jsx)(j,{className:`w-3 h-3 text-accent`})]}),(0,x.jsxs)(`div`,{className:`text-text-muted text-xs mt-0.5`,children:[e.memberCount,` repo`,e.memberCount===1?``:`s`,e.lastSync?` · synced ${new Date(e.lastSync).toLocaleDateString()}`:` · not synced`]})]}),(0,x.jsx)(`span`,{className:`text-text-muted group-hover:text-accent transition text-lg`,children:`→`})]},e.name))}),(0,x.jsxs)(`p`,{className:`text-[10px] text-text-muted/50 mt-3 text-center`,children:[`Create groups with `,(0,x.jsx)(`span`,{className:`font-mono text-text-muted`,children:`code-intel group create <name>`})]})]})]})]})})}function j({className:e=``}){return(0,x.jsxs)(`svg`,{className:`animate-spin ${e}`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,x.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,x.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z`})]})}function re(){let{state:e}=T(),t=e.graphLoad,n=t&&t.total>0?Math.min(100,Math.round(t.loaded/t.total*100)):null;return(0,x.jsxs)(`div`,{className:`flex items-center justify-center min-h-screen bg-void`,children:[(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-8 w-full max-w-sm px-8`,children:[(0,x.jsxs)(`div`,{className:`relative flex items-center justify-center`,children:[(0,x.jsx)(`span`,{className:`absolute inline-flex h-20 w-20 rounded-2xl bg-accent/20 animate-ping`}),(0,x.jsx)(`div`,{className:`relative w-16 h-16 rounded-2xl bg-gradient-to-br from-accent to-accent-dim flex items-center justify-center text-white text-3xl font-bold shadow-glow select-none`,children:`◈`})]}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,x.jsx)(`p`,{className:`text-text-primary text-lg font-semibold tracking-tight`,children:t?.phase===`edges`?`Fetching graph structure…`:t?`Loading nodes…`:`Building knowledge graph…`}),t?.phase===`nodes`&&t.total>0?(0,x.jsxs)(`p`,{className:`text-text-muted text-sm font-mono tabular-nums`,children:[t.loaded.toLocaleString(),` / `,t.total.toLocaleString(),` nodes`]}):(0,x.jsx)(`p`,{className:`text-text-muted text-sm`,children:e.repoName||`Preparing…`})]}),(0,x.jsxs)(`div`,{className:`w-full`,children:[(0,x.jsx)(`div`,{className:`h-1.5 w-full bg-elevated rounded-full overflow-hidden border border-border-subtle`,children:n===null?(0,x.jsx)(`div`,{className:`h-full rounded-full bg-gradient-to-r from-accent to-accent-dim animate-[shimmer_1.5s_ease-in-out_infinite]`,style:{width:`40%`,animation:`shimmer 1.5s ease-in-out infinite`}}):(0,x.jsx)(`div`,{className:`h-full rounded-full bg-gradient-to-r from-accent to-accent-dim transition-all duration-300`,style:{width:`${n}%`}})}),n!==null&&(0,x.jsxs)(`div`,{className:`flex justify-between mt-1.5 text-[10px] text-text-muted font-mono`,children:[(0,x.jsxs)(`span`,{children:[n,`%`]}),(0,x.jsxs)(`span`,{children:[t.total.toLocaleString(),` total`]})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-accent animate-bounce [animation-delay:-0.3s]`}),(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-accent animate-bounce [animation-delay:-0.15s]`}),(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-accent animate-bounce`})]})]}),(0,x.jsx)(`style`,{children:`
10
- @keyframes shimmer {
11
- 0% { transform: translateX(-100%); }
12
- 100% { transform: translateX(300%); }
13
- }
14
- `})]})}var M=o(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,`defaultMaxListeners`,{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}}))();function N(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(let n in arguments[t])e[n]=arguments[t][n];return e}var P=N;typeof Object.assign==`function`&&(P=Object.assign);function ie(e,t,n,r){let i=e._nodes.get(t),a=null;return i&&(a=r===`mixed`?i.out&&i.out[n]||i.undirected&&i.undirected[n]:r===`directed`?i.out&&i.out[n]:i.undirected&&i.undirected[n]),a}function F(e){return typeof e==`object`&&!!e}function ae(e){let t;for(t in e)return!1;return!0}function I(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function L(e,t,n){let r={enumerable:!0,configurable:!0};typeof n==`function`?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function oe(e){return!(!F(e)||e.attributes&&!Array.isArray(e.attributes))}function R(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function z(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function B(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var se=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},V=class e extends se{constructor(t){super(t),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},H=class e extends se{constructor(t){super(t),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},U=class e extends se{constructor(t){super(t),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}};function ce(e,t){this.key=e,this.attributes=t,this.clear()}ce.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function le(e,t){this.key=e,this.attributes=t,this.clear()}le.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function ue(e,t){this.key=e,this.attributes=t,this.clear()}ue.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function de(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}de.prototype.attach=function(){let e=`out`,t=`in`;this.undirected&&(e=t=`undirected`);let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)},de.prototype.attachMulti=function(){let e=`out`,t=`in`,n=this.source.key,r=this.target.key;this.undirected&&(e=t=`undirected`);let i=this.source[e],a=i[r];if(a===void 0){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}a.previous=this,this.next=a,i[r]=this,this.target[t][n]=this},de.prototype.detach=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),delete this.source[n][t],delete this.target[r][e]},de.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};var fe=0,pe=1,me=2,he=3;function ge(e,t,n,r,i,a,o){let s,c,l,u;if(r=``+r,n===fe){if(s=e._nodes.get(r),!s)throw new H(`Graph.${t}: could not find the "${r}" node in the graph.`);l=i,u=a}else if(n===he){if(i=``+i,c=e._edges.get(i),!c)throw new H(`Graph.${t}: could not find the "${i}" edge in the graph.`);let n=c.source.key,d=c.target.key;if(r===n)s=c.target;else if(r===d)s=c.source;else throw new H(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${n}, ${d}).`);l=a,u=o}else{if(c=e._edges.get(r),!c)throw new H(`Graph.${t}: could not find the "${r}" edge in the graph.`);s=n===pe?c.source:c.target,l=i,u=a}return[s,l,u]}function _e(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=ge(this,t,n,e,r,i);return a.attributes[o]}}function ve(e,t,n){e.prototype[t]=function(e,r){let[i]=ge(this,t,n,e,r);return i.attributes}}function ye(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=ge(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function be(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=ge(this,t,n,e,r,i,a);return o.attributes[s]=c,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function xe(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=ge(this,t,n,e,r,i,a);if(typeof c!=`function`)throw new V(`Graph.${t}: updater should be a function.`);let l=o.attributes;return l[s]=c(l[s]),this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function Se(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=ge(this,t,n,e,r,i);return delete a.attributes[o],this.emit(`nodeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:o}),this}}function Ce(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=ge(this,t,n,e,r,i);if(!F(o))throw new V(`Graph.${t}: provided attributes are not a plain object.`);return a.attributes=o,this.emit(`nodeAttributesUpdated`,{key:a.key,type:`replace`,attributes:a.attributes}),this}}function we(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=ge(this,t,n,e,r,i);if(!F(o))throw new V(`Graph.${t}: provided attributes are not a plain object.`);return P(a.attributes,o),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`merge`,attributes:a.attributes,data:o}),this}}function Te(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=ge(this,t,n,e,r,i);if(typeof o!=`function`)throw new V(`Graph.${t}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`update`,attributes:a.attributes}),this}}var Ee=[{name:e=>`get${e}Attribute`,attacher:_e},{name:e=>`get${e}Attributes`,attacher:ve},{name:e=>`has${e}Attribute`,attacher:ye},{name:e=>`set${e}Attribute`,attacher:be},{name:e=>`update${e}Attribute`,attacher:xe},{name:e=>`remove${e}Attribute`,attacher:Se},{name:e=>`replace${e}Attributes`,attacher:Ce},{name:e=>`merge${e}Attributes`,attacher:we},{name:e=>`update${e}Attributes`,attacher:Te}];function De(e){Ee.forEach(function({name:t,attacher:n}){n(e,t(`Node`),fe),n(e,t(`Source`),pe),n(e,t(`Target`),me),n(e,t(`Opposite`),he)})}function Oe(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new U(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new U(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ie(this,a,o,n),!i)throw new H(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new U(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new H(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes[r]}}function ke(e,t,n){e.prototype[t]=function(e){let r;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new U(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new U(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let i=``+e,a=``+arguments[1];if(r=ie(this,i,a,n),!r)throw new H(`Graph.${t}: could not find an edge for the given path ("${i}" - "${a}").`)}else{if(n!==`mixed`)throw new U(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,r=this._edges.get(e),!r)throw new H(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function Ae(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new U(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new U(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ie(this,a,o,n),!i)throw new H(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new U(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new H(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes.hasOwnProperty(r)}}function je(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new U(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new U(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=ie(this,o,s,n),!a)throw new H(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new U(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new H(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]=i,this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function Me(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new U(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new U(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=ie(this,o,s,n),!a)throw new H(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new U(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new H(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof i!=`function`)throw new V(`Graph.${t}: updater should be a function.`);return a.attributes[r]=i(a.attributes[r]),this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function Ne(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new U(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new U(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ie(this,a,o,n),!i)throw new H(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new U(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new H(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return delete i.attributes[r],this.emit(`edgeAttributesUpdated`,{key:i.key,type:`remove`,attributes:i.attributes,name:r}),this}}function Pe(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new U(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new U(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ie(this,a,o,n),!i)throw new H(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new U(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new H(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!F(r))throw new V(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=r,this.emit(`edgeAttributesUpdated`,{key:i.key,type:`replace`,attributes:i.attributes}),this}}function Fe(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new U(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new U(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ie(this,a,o,n),!i)throw new H(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new U(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new H(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!F(r))throw new V(`Graph.${t}: provided attributes are not a plain object.`);return P(i.attributes,r),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`merge`,attributes:i.attributes,data:r}),this}}function Ie(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new U(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new U(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ie(this,a,o,n),!i)throw new H(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new U(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new H(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof r!=`function`)throw new V(`Graph.${t}: provided updater is not a function.`);return i.attributes=r(i.attributes),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`update`,attributes:i.attributes}),this}}var Le=[{name:e=>`get${e}Attribute`,attacher:Oe},{name:e=>`get${e}Attributes`,attacher:ke},{name:e=>`has${e}Attribute`,attacher:Ae},{name:e=>`set${e}Attribute`,attacher:je},{name:e=>`update${e}Attribute`,attacher:Me},{name:e=>`remove${e}Attribute`,attacher:Ne},{name:e=>`replace${e}Attributes`,attacher:Pe},{name:e=>`merge${e}Attributes`,attacher:Fe},{name:e=>`update${e}Attributes`,attacher:Ie}];function Re(e){Le.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}var ze=[{name:`edges`,type:`mixed`},{name:`inEdges`,type:`directed`,direction:`in`},{name:`outEdges`,type:`directed`,direction:`out`},{name:`inboundEdges`,type:`mixed`,direction:`in`},{name:`outboundEdges`,type:`mixed`,direction:`out`},{name:`directedEdges`,type:`directed`},{name:`undirectedEdges`,type:`undirected`}];function Be(e,t,n,r){let i=!1;for(let a in t){if(a===r)continue;let o=t[a];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function Ve(e,t,n,r){let i,a,o,s=!1;for(let c in t)if(c!==r){i=t[c];do{if(a=i.source,o=i.target,s=n(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}}function He(e,t){let n=Object.keys(e),r=n.length,i,a=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(a>=r)return{done:!0};let o=n[a++];if(o===t){i=void 0;continue}i=e[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function Ue(e,t,n,r){let i=t[n];if(!i)return;let a=i.source,o=i.target;if(r(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected)&&e)return i.key}function We(e,t,n,r){let i=t[n];if(!i)return;let a=!1;do{if(a=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}function Ge(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function Ke(e,t){if(e.size===0)return[];if(t===`mixed`||t===e.type)return Array.from(e._edges.keys());let n=t===`undirected`?e.undirectedSize:e.directedSize,r=Array(n),i=t===`undirected`,a=e._edges.values(),o=0,s,c;for(;s=a.next(),s.done!==!0;)c=s.value,c.undirected===i&&(r[o++]=c.key);return r}function qe(e,t,n,r){if(t.size===0)return;let i=n!==`mixed`&&n!==t.type,a=n===`undirected`,o,s,c=!1,l=t._edges.values();for(;o=l.next(),o.done!==!0;){if(s=o.value,i&&s.undirected!==a)continue;let{key:t,attributes:n,source:l,target:u}=s;if(c=r(t,n,l.key,u.key,l.attributes,u.attributes,s.undirected),e&&c)return t}}function Je(e,t){if(e.size===0)return B();let n=t!==`mixed`&&t!==e.type,r=t===`undirected`,i=e._edges.values();return{[Symbol.iterator](){return this},next(){let e,t;for(;;){if(e=i.next(),e.done)return e;if(t=e.value,!(n&&t.undirected!==r))break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}}}function Ye(e,t,n,r,i,a){let o=t?Ve:Be,s;if(n!==`undirected`&&(r!==`out`&&(s=o(e,i.in,a),e&&s)||r!==`in`&&(s=o(e,i.out,a,r?void 0:i.key),e&&s))||n!==`directed`&&(s=o(e,i.undirected,a),e&&s))return s}function Xe(e,t,n,r){let i=[];return Ye(!1,e,t,n,r,function(e){i.push(e)}),i}function Ze(e,t,n){let r=B();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=z(r,He(n.in))),t!==`in`&&n.out!==void 0&&(r=z(r,He(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=z(r,He(n.undirected))),r}function Qe(e,t,n,r,i,a,o){let s=n?We:Ue,c;if(t!==`undirected`&&(i.in!==void 0&&r!==`out`&&(c=s(e,i.in,a,o),e&&c)||i.out!==void 0&&r!==`in`&&(r||i.key!==a)&&(c=s(e,i.out,a,o),e&&c))||t!==`directed`&&i.undirected!==void 0&&(c=s(e,i.undirected,a,o),e&&c))return c}function $e(e,t,n,r,i){let a=[];return Qe(!1,e,t,n,r,i,function(e){a.push(e)}),a}function et(e,t,n,r){let i=B();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=z(i,Ge(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=z(i,Ge(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=z(i,Ge(n.undirected,r))),i}function tt(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];if(!arguments.length)return Ke(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new H(`Graph.${n}: could not find the "${e}" node in the graph.`);return Xe(this.multi,r===`mixed`?this.type:r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let a=this._nodes.get(e);if(!a)throw new H(`Graph.${n}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new H(`Graph.${n}: could not find the "${t}" target node in the graph.`);return $e(r,this.multi,i,a,t)}throw new V(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function nt(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(!(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)){if(arguments.length===1)return n=e,qe(!1,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new H(`Graph.${a}: could not find the "${e}" node in the graph.`);return Ye(!1,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new H(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new H(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Qe(!1,r,this.multi,i,o,t,n)}throw new V(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n;if(e.length===0){let i=0;r!==`directed`&&(i+=this.undirectedSize),r!==`undirected`&&(i+=this.directedSize),n=Array(i);let a=0;e.push((e,r,i,o,s,c,l)=>{n[a++]=t(e,r,i,o,s,c,l)})}else n=[],e.push((e,r,i,a,o,s,c)=>{n.push(t(e,r,i,a,o,s,c))});return this[a].apply(this,e),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((e,r,i,a,o,s,c)=>{t(e,r,i,a,o,s,c)&&n.push(e)}),this[a].apply(this,e),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments);if(e.length<2||e.length>4)throw new V(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${e.length}).`);if(typeof e[e.length-1]==`function`&&typeof e[e.length-2]!=`function`)throw new V(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let t,n;e.length===2?(t=e[0],n=e[1],e=[]):e.length===3?(t=e[1],n=e[2],e=[e[0]]):e.length===4&&(t=e[2],n=e[3],e=[e[0],e[1]]);let r=n;return e.push((e,n,i,a,o,s,c)=>{r=t(r,e,n,i,a,o,s,c)}),this[a].apply(this,e),r}}function rt(e,t){let{name:n,type:r,direction:i}=t,a=`find`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return!1;if(arguments.length===1)return n=e,qe(!0,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new H(`Graph.${a}: could not find the "${e}" node in the graph.`);return Ye(!0,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new H(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new H(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Qe(!0,r,this.multi,i,o,t,n)}throw new V(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o=`some`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>t(e,n,r,i,a,o,s)),!!this[a].apply(this,e)};let s=`every`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>!t(e,n,r,i,a,o,s)),!this[a].apply(this,e)}}function it(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return B();if(!arguments.length)return Je(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.${a}: could not find the "${e}" node in the graph.`);return Ze(r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new H(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new H(`Graph.${a}: could not find the "${t}" target node in the graph.`);return et(r,i,n,t)}throw new V(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function at(e){ze.forEach(t=>{tt(e,t),nt(e,t),rt(e,t),it(e,t)})}var ot=[{name:`neighbors`,type:`mixed`},{name:`inNeighbors`,type:`directed`,direction:`in`},{name:`outNeighbors`,type:`directed`,direction:`out`},{name:`inboundNeighbors`,type:`mixed`,direction:`in`},{name:`outboundNeighbors`,type:`mixed`,direction:`out`},{name:`directedNeighbors`,type:`directed`},{name:`undirectedNeighbors`,type:`undirected`}];function st(){this.A=null,this.B=null}st.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},st.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function ct(e,t,n,r,i){for(let a in r){let o=r[a],s=o.source,c=o.target,l=s===n?c:s;if(t&&t.has(l.key))continue;let u=i(l.key,l.attributes);if(e&&u)return l.key}}function lt(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return ct(e,null,r,r.undirected,i);if(typeof n==`string`)return ct(e,null,r,r[n],i)}let a=new st,o;if(t!==`undirected`){if(n!==`out`){if(o=ct(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=ct(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=ct(e,a,r,r.undirected,i),e&&o))return o}function ut(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Object.keys(n.undirected);if(typeof t==`string`)return Object.keys(n[t])}let r=[];return lt(!1,e,t,n,function(e){r.push(e)}),r}function dt(e,t,n){let r=Object.keys(n),i=r.length,a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=i)return e&&e.wrap(n),{done:!0};let s=n[r[a++]],c=s.source,l=s.target;if(o=c===t?l:c,e&&e.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function ft(e,t,n){if(e!==`mixed`){if(e===`undirected`)return dt(null,n,n.undirected);if(typeof t==`string`)return dt(null,n,n[t])}let r=B(),i=new st;return e!==`undirected`&&(t!==`out`&&(r=z(r,dt(i,n,n.in))),t!==`in`&&(r=z(r,dt(i,n,n.out)))),e!==`directed`&&(r=z(r,dt(i,n,n.undirected))),r}function pt(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new H(`Graph.${n}: could not find the "${e}" node in the graph.`);return ut(r===`mixed`?this.type:r,i,t)}}function mt(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new H(`Graph.${a}: could not find the "${e}" node in the graph.`);lt(!1,r===`mixed`?this.type:r,i,n,t)};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(e,t){let n=[];return this[a](e,(e,r)=>{n.push(t(e,r))}),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(e,t){let n=[];return this[a](e,(e,r)=>{t(e,r)&&n.push(e)}),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new V(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let r=n;return this[a](e,(e,n)=>{r=t(r,e,n)}),r}}function ht(e,t){let{name:n,type:r,direction:i}=t,a=n[0].toUpperCase()+n.slice(1,-1),o=`find`+a;e.prototype[o]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new H(`Graph.${o}: could not find the "${e}" node in the graph.`);return lt(!0,r===`mixed`?this.type:r,i,n,t)};let s=`some`+a;e.prototype[s]=function(e,t){return!!this[o](e,t)};let c=`every`+a;e.prototype[c]=function(e,t){return!this[o](e,(e,n)=>!t(e,n))}}function gt(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return B();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new H(`Graph.${a}: could not find the "${e}" node in the graph.`);return ft(r===`mixed`?this.type:r,i,t)}}function _t(e){ot.forEach(t=>{pt(e,t),mt(e,t),ht(e,t),gt(e,t)})}function vt(e,t,n,r,i){let a=r._nodes.values(),o=r.type,s,c,l,u,d,f,p;for(;s=a.next(),s.done!==!0;){let r=!1;if(c=s.value,o!==`undirected`)for(l in u=c.out,u){d=u[l];do{if(f=d.target,r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}if(o!==`directed`){for(l in u=c.undirected,u)if(!(t&&c.key>l)){d=u[l];do{if(f=d.target,f.key!==l&&(f=d.source),r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}}if(n&&!r&&(p=i(c.key,null,c.attributes,null,null,null,null),e&&p))return null}}function yt(e,t){let n={key:e};return ae(t.attributes)||(n.attributes=P({},t.attributes)),n}function bt(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return ae(n.attributes)||(r.attributes=P({},n.attributes)),e===`mixed`&&n.undirected&&(r.undirected=!0),r}function xt(e){if(!F(e))throw new V(`Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.`);if(!(`key`in e))throw new V(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!F(e.attributes)||e.attributes===null))throw new V(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function St(e){if(!F(e))throw new V(`Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.`);if(!(`source`in e))throw new V(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new V(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!F(e.attributes)||e.attributes===null))throw new V(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new V(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}var Ct=R(),wt=new Set([`directed`,`undirected`,`mixed`]),Tt=new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),Et=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:`directed`},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:`undirected`},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:`directed`},{name:e=>`${e}UndirectedEdgeWithKey`,type:`undirected`}],Dt={allowSelfLoops:!0,multi:!1,type:`mixed`};function Ot(e,t,n){if(n&&!F(n))throw new V(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=``+t,n||={},e._nodes.has(t))throw new U(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function kt(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function At(e,t,n,r,i,a,o,s){if(!r&&e.type===`undirected`)throw new U(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new U(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!F(s))throw new V(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`);if(a=``+a,o=``+o,s||={},!e.allowSelfLoops&&a===o)throw new U(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let c=e._nodes.get(a),l=e._nodes.get(o);if(!c)throw new H(`Graph.${t}: source node "${a}" not found.`);if(!l)throw new H(`Graph.${t}: target node "${o}" not found.`);let u={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new U(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?c.undirected[o]!==void 0:c.out[o]!==void 0))throw new U(`Graph.${t}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let d=new de(r,i,c,l,s);e._edges.set(i,d);let f=a===o;return r?(c.undirectedDegree++,l.undirectedDegree++,f&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,l.inDegree++,f&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?d.attachMulti():d.attach(),r?e._undirectedSize++:e._directedSize++,u.key=i,e.emit(`edgeAdded`,u),i}function jt(e,t,n,r,i,a,o,s,c){if(!r&&e.type===`undirected`)throw new U(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new U(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(c){if(typeof s!=`function`)throw new V(`Graph.${t}: invalid updater function. Expecting a function but got "${s}"`)}else if(!F(s))throw new V(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`)}a=``+a,o=``+o;let l;if(c&&(l=s,s=void 0),!e.allowSelfLoops&&a===o)throw new U(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=e._nodes.get(a),d=e._nodes.get(o),f,p;if(!n&&(f=e._edges.get(i),f)){if((f.source.key!==a||f.target.key!==o)&&(!r||f.source.key!==o||f.target.key!==a))throw new U(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);p=f}if(!p&&!e.multi&&u&&(p=r?u.undirected[o]:u.out[o]),p){let t=[p.key,!1,!1,!1];if(c?!l:!s)return t;if(c){let t=p.attributes;p.attributes=l(t),e.emit(`edgeAttributesUpdated`,{type:`replace`,key:p.key,attributes:p.attributes})}else P(p.attributes,s),e.emit(`edgeAttributesUpdated`,{type:`merge`,key:p.key,attributes:p.attributes,data:s});return t}s||={},c&&l&&(s=l(s));let m={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new U(`Graph.${t}: the "${i}" edge already exists in the graph.`);let h=!1,g=!1;u||(u=kt(e,a,{}),h=!0,a===o&&(d=u,g=!0)),d||(d=kt(e,o,{}),g=!0),f=new de(r,i,u,d,s),e._edges.set(i,f);let _=a===o;return r?(u.undirectedDegree++,d.undirectedDegree++,_&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,_&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?f.attachMulti():f.attach(),r?e._undirectedSize++:e._directedSize++,m.key=i,e.emit(`edgeAdded`,m),[i,!0,h,g]}function Mt(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,a=t.undirected,o=n===r;a?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),a?e._undirectedSize--:e._directedSize--,e.emit(`edgeDropped`,{key:t.key,attributes:i,source:n.key,target:r.key,undirected:a})}var W=class e extends M.EventEmitter{constructor(e){if(super(),e=P({},Dt,e),typeof e.multi!=`boolean`)throw new V(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!wt.has(e.type))throw new V(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new V(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type===`mixed`?ce:e.type===`directed`?le:ue;I(this,`NodeDataClass`,t);let n=`geid_`+Ct()+`_`,r=0;I(this,`_attributes`,{}),I(this,`_nodes`,new Map),I(this,`_edges`,new Map),I(this,`_directedSize`,0),I(this,`_undirectedSize`,0),I(this,`_directedSelfLoopCount`,0),I(this,`_undirectedSelfLoopCount`,0),I(this,`_edgeKeyGenerator`,()=>{let e;do e=n+ r++;while(this._edges.has(e));return e}),I(this,`_options`,e),Tt.forEach(e=>I(this,e,this[e])),L(this,`order`,()=>this._nodes.size),L(this,`size`,()=>this._edges.size),L(this,`directedSize`,()=>this._directedSize),L(this,`undirectedSize`,()=>this._undirectedSize),L(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),L(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),L(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),L(this,`multi`,this._options.multi),L(this,`type`,this._options.type),L(this,`allowSelfLoops`,this._options.allowSelfLoops),L(this,`implementation`,()=>`graphology`)}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(``+e)}hasDirectedEdge(e,t){if(this.type===`undirected`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&!n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new V(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type===`directed`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new V(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let t=``+e;return this._edges.has(t)}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out!==void 0&&n.out.hasOwnProperty(t)||n.undirected!==void 0&&n.undirected.hasOwnProperty(t):!1}throw new V(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type===`undirected`)return;if(e=``+e,t=``+t,this.multi)throw new U(`Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new H(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new H(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type===`directed`)return;if(e=``+e,t=``+t,this.multi)throw new U(`Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new H(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new H(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new U(`Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.`);e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new H(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new H(`Graph.edge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new H(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new H(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.out}areInNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new H(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in}areUndirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new H(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`directed`?!1:t in n.undirected}areNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new H(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&(t in n.in||t in n.out)||this.type!==`directed`&&t in n.undirected}areInboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new H(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in||this.type!==`directed`&&t in n.undirected}areOutboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new H(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out||this.type!==`directed`&&t in n.undirected}inDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree}outDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree}directedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree}undirectedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree}inboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree),n}outboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.outDegree),n}degree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=``+e;let t=this._edges.get(e);if(!t)throw new H(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=``+e;let t=this._edges.get(e);if(!t)throw new H(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=``+e;let t=this._edges.get(e);if(!t)throw new H(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=``+e,t=``+t;let n=this._edges.get(t);if(!n)throw new H(`Graph.opposite: could not find the "${t}" edge in the graph.`);let r=n.source.key,i=n.target.key;if(e===r)return i;if(e===i)return r;throw new H(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${i}).`)}hasExtremity(e,t){e=``+e,t=``+t;let n=this._edges.get(e);if(!n)throw new H(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new H(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new H(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=``+e;let t=this._edges.get(e);if(!t)throw new H(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return Ot(this,e,t).key}mergeNode(e,t){if(t&&!F(t))throw new V(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=``+e,t||={};let n=this._nodes.get(e);return n?(t&&(P(n.attributes,t),this.emit(`nodeAttributesUpdated`,{type:`merge`,key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!=`function`)throw new V(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=``+e;let n=this._nodes.get(e);if(n){if(t){let r=n.attributes;n.attributes=t(r),this.emit(`nodeAttributesUpdated`,{type:`replace`,key:e,attributes:n.attributes})}return[e,!1]}let r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:r}),[e,!0]}dropNode(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new H(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!==`undirected`){for(let e in t.out){n=t.out[e];do Mt(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do Mt(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do Mt(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit(`nodeDropped`,{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let e=``+arguments[0],n=``+arguments[1];if(t=ie(this,e,n,this.type),!t)throw new H(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new H(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return Mt(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new U(`Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new U(`Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);e=``+e,t=``+t;let n=ie(this,e,t,`directed`);if(!n)throw new H(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Mt(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new U(`Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new U(`Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);let n=ie(this,e,t,`undirected`);if(!n)throw new H(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Mt(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit(`cleared`)}clearEdges(){let e=this._nodes.values(),t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit(`edgesCleared`)}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=`function`)throw new V(`Graph.updateAttribute: updater should be a function.`);let n=this._attributes[e];return this._attributes[e]=t(n),this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit(`attributesUpdated`,{type:`remove`,attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!F(e))throw new V(`Graph.replaceAttributes: provided attributes are not a plain object.`);return this._attributes=e,this.emit(`attributesUpdated`,{type:`replace`,attributes:this._attributes}),this}mergeAttributes(e){if(!F(e))throw new V(`Graph.mergeAttributes: provided attributes are not a plain object.`);return P(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new V(`Graph.updateAttributes: provided updater is not a function.`);return this._attributes=e(this._attributes),this.emit(`attributesUpdated`,{type:`update`,attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=`function`)throw new V(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!oe(t))throw new V(`Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,i.attributes=e(i.key,i.attributes);this.emit(`eachNodeAttributesUpdated`,{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!=`function`)throw new V(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!oe(t))throw new V(`Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._edges.values(),r,i,a,o;for(;r=n.next(),r.done!==!0;)i=r.value,a=i.source,o=i.target,i.attributes=e(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected);this.emit(`eachEdgeAttributesUpdated`,{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!=`function`)throw new V(`Graph.forEachAdjacencyEntry: expecting a callback.`);vt(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new V(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);vt(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new V(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);vt(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new V(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);vt(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new V(`Graph.forEachNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!=`function`)throw new V(`Graph.findNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!=`function`)throw new V(`Graph.mapNode: expecting a callback.`);let t=this._nodes.values(),n,r,i=Array(this.order),a=0;for(;n=t.next(),n.done!==!0;)r=n.value,i[a++]=e(r.key,r.attributes);return i}someNode(e){if(typeof e!=`function`)throw new V(`Graph.someNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!=`function`)throw new V(`Graph.everyNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!=`function`)throw new V(`Graph.filterNodes: expecting a callback.`);let t=this._nodes.values(),n,r,i=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&i.push(r.key);return i}reduceNodes(e,t){if(typeof e!=`function`)throw new V(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new V(`Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let n=t,r=this._nodes.values(),i,a;for(;i=r.next(),i.done!==!0;)a=i.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((n,r)=>{e[t++]=yt(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=bt(this.type,r,e)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(t,n=!1){if(t instanceof e)return t.forEachNode((e,t)=>{n?this.mergeNode(e,t):this.addNode(e,t)}),t.forEachEdge((e,t,r,i,a,o,s)=>{n?s?this.mergeUndirectedEdgeWithKey(e,r,i,t):this.mergeDirectedEdgeWithKey(e,r,i,t):s?this.addUndirectedEdgeWithKey(e,r,i,t):this.addDirectedEdgeWithKey(e,r,i,t)}),this;if(!F(t))throw new V(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(t.attributes){if(!F(t.attributes))throw new V(`Graph.import: invalid attributes. Expecting a plain object.`);n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,a,o,s;if(t.nodes){if(a=t.nodes,!Array.isArray(a))throw new V(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=a.length;r<i;r++){o=a[r],xt(o);let{key:e,attributes:t}=o;n?this.mergeNode(e,t):this.addNode(e,t)}}if(t.edges){let e=!1;if(this.type===`undirected`&&(e=!0),a=t.edges,!Array.isArray(a))throw new V(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=a.length;r<i;r++){s=a[r],St(s);let{source:t,target:i,attributes:o,undirected:c=e}=s,l;`key`in s?(l=n?c?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:c?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,l.call(this,s.key,t,i,o)):(l=n?c?this.mergeUndirectedEdge:this.mergeDirectedEdge:c?this.addUndirectedEdge:this.addDirectedEdge,l.call(this,t,i,o))}}return this}nullCopy(t){let n=new e(P({},this._options,t));return n.replaceAttributes(P({},this.getAttributes())),n}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((e,n)=>{let r=P({},e.attributes);e=new t.NodeDataClass(n,r),t._nodes.set(n,e)}),t}copy(e){if(e||={},typeof e.type==`string`&&e.type!==this.type&&e.type!==`mixed`)throw new U(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==`boolean`&&e.multi!==this.multi&&e.multi!==!0)throw new U(`Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.`);if(typeof e.allowSelfLoops==`boolean`&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new U(`Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.`);let t=this.emptyCopy(e),n=this._edges.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,At(t,`copy`,!1,i.undirected,i.key,i.source.key,i.target.key,P({},i.attributes));return t}toJSON(){return this.export()}toString(){return`[object Graph]`}inspect(){let e={};this._nodes.forEach((t,n)=>{e[n]=t.attributes});let t={},n={};this._edges.forEach((e,r)=>{let i=e.undirected?`--`:`->`,a=``,o=e.source.key,s=e.target.key,c;e.undirected&&o>s&&(c=o,o=s,s=c);let l=`(${o})${i}(${s})`;r.startsWith(`geid_`)?this.multi&&(n[l]===void 0?n[l]=0:n[l]++,a+=`${n[l]}. `):a+=`[${r}]: `,a+=l,t[a]=e.attributes});let r={};for(let e in this)this.hasOwnProperty(e)&&!Tt.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,I(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(W.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=W.prototype.inspect),Et.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?At:jt;e.generateKey?W.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:W.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),De(W),Re(W),at(W),_t(W);var Nt=class extends W{constructor(e){let t=P({type:`directed`},e);if(`multi`in t&&t.multi!==!1)throw new V(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`directed`)throw new V(`DirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},Pt=class extends W{constructor(e){let t=P({type:`undirected`},e);if(`multi`in t&&t.multi!==!1)throw new V(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`undirected`)throw new V(`UndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},Ft=class extends W{constructor(e){let t=P({multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new V(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(t)}},It=class extends W{constructor(e){let t=P({type:`directed`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new V(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`directed`)throw new V(`MultiDirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},Lt=class extends W{constructor(e){let t=P({type:`undirected`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new V(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`undirected`)throw new V(`MultiUndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}};function Rt(e){e.from=function(t,n){let r=new e(P({},t.options,n));return r.import(t),r}}Rt(W),Rt(Nt),Rt(Pt),Rt(Ft),Rt(It),Rt(Lt),W.Graph=W,W.DirectedGraph=Nt,W.UndirectedGraph=Pt,W.MultiGraph=Ft,W.MultiDirectedGraph=It,W.MultiUndirectedGraph=Lt,W.InvalidArgumentsGraphError=V,W.NotFoundGraphError=H,W.UsageGraphError=U;function zt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Bt(e){var t=zt(e,`string`);return typeof t==`symbol`?t:t+``}function Vt(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Ht(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Bt(r.key),r)}}function Ut(e,t,n){return t&&Ht(e.prototype,t),n&&Ht(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Wt(e){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wt(e)}function Gt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gt=function(){return!!e})()}function Kt(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function qt(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Kt(e)}function Jt(e,t,n){return t=Wt(t),qt(e,Gt()?Reflect.construct(t,n||[],Wt(e).constructor):t.apply(e,n))}function Yt(e,t){return Yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yt(e,t)}function Xt(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&Yt(e,t)}function Zt(e){if(Array.isArray(e))return e}function Qt(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function $t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function en(e,t){if(e){if(typeof e==`string`)return $t(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$t(e,t):void 0}}function tn(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
15
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nn(e,t){return Zt(e)||Qt(e,t)||en(e,t)||tn()}var rn={black:`#000000`,silver:`#C0C0C0`,gray:`#808080`,grey:`#808080`,white:`#FFFFFF`,maroon:`#800000`,red:`#FF0000`,purple:`#800080`,fuchsia:`#FF00FF`,green:`#008000`,lime:`#00FF00`,olive:`#808000`,yellow:`#FFFF00`,navy:`#000080`,blue:`#0000FF`,teal:`#008080`,aqua:`#00FFFF`,darkblue:`#00008B`,mediumblue:`#0000CD`,darkgreen:`#006400`,darkcyan:`#008B8B`,deepskyblue:`#00BFFF`,darkturquoise:`#00CED1`,mediumspringgreen:`#00FA9A`,springgreen:`#00FF7F`,cyan:`#00FFFF`,midnightblue:`#191970`,dodgerblue:`#1E90FF`,lightseagreen:`#20B2AA`,forestgreen:`#228B22`,seagreen:`#2E8B57`,darkslategray:`#2F4F4F`,darkslategrey:`#2F4F4F`,limegreen:`#32CD32`,mediumseagreen:`#3CB371`,turquoise:`#40E0D0`,royalblue:`#4169E1`,steelblue:`#4682B4`,darkslateblue:`#483D8B`,mediumturquoise:`#48D1CC`,indigo:`#4B0082`,darkolivegreen:`#556B2F`,cadetblue:`#5F9EA0`,cornflowerblue:`#6495ED`,rebeccapurple:`#663399`,mediumaquamarine:`#66CDAA`,dimgray:`#696969`,dimgrey:`#696969`,slateblue:`#6A5ACD`,olivedrab:`#6B8E23`,slategray:`#708090`,slategrey:`#708090`,lightslategray:`#778899`,lightslategrey:`#778899`,mediumslateblue:`#7B68EE`,lawngreen:`#7CFC00`,chartreuse:`#7FFF00`,aquamarine:`#7FFFD4`,skyblue:`#87CEEB`,lightskyblue:`#87CEFA`,blueviolet:`#8A2BE2`,darkred:`#8B0000`,darkmagenta:`#8B008B`,saddlebrown:`#8B4513`,darkseagreen:`#8FBC8F`,lightgreen:`#90EE90`,mediumpurple:`#9370DB`,darkviolet:`#9400D3`,palegreen:`#98FB98`,darkorchid:`#9932CC`,yellowgreen:`#9ACD32`,sienna:`#A0522D`,brown:`#A52A2A`,darkgray:`#A9A9A9`,darkgrey:`#A9A9A9`,lightblue:`#ADD8E6`,greenyellow:`#ADFF2F`,paleturquoise:`#AFEEEE`,lightsteelblue:`#B0C4DE`,powderblue:`#B0E0E6`,firebrick:`#B22222`,darkgoldenrod:`#B8860B`,mediumorchid:`#BA55D3`,rosybrown:`#BC8F8F`,darkkhaki:`#BDB76B`,mediumvioletred:`#C71585`,indianred:`#CD5C5C`,peru:`#CD853F`,chocolate:`#D2691E`,tan:`#D2B48C`,lightgray:`#D3D3D3`,lightgrey:`#D3D3D3`,thistle:`#D8BFD8`,orchid:`#DA70D6`,goldenrod:`#DAA520`,palevioletred:`#DB7093`,crimson:`#DC143C`,gainsboro:`#DCDCDC`,plum:`#DDA0DD`,burlywood:`#DEB887`,lightcyan:`#E0FFFF`,lavender:`#E6E6FA`,darksalmon:`#E9967A`,violet:`#EE82EE`,palegoldenrod:`#EEE8AA`,lightcoral:`#F08080`,khaki:`#F0E68C`,aliceblue:`#F0F8FF`,honeydew:`#F0FFF0`,azure:`#F0FFFF`,sandybrown:`#F4A460`,wheat:`#F5DEB3`,beige:`#F5F5DC`,whitesmoke:`#F5F5F5`,mintcream:`#F5FFFA`,ghostwhite:`#F8F8FF`,salmon:`#FA8072`,antiquewhite:`#FAEBD7`,linen:`#FAF0E6`,lightgoldenrodyellow:`#FAFAD2`,oldlace:`#FDF5E6`,magenta:`#FF00FF`,deeppink:`#FF1493`,orangered:`#FF4500`,tomato:`#FF6347`,hotpink:`#FF69B4`,coral:`#FF7F50`,darkorange:`#FF8C00`,lightsalmon:`#FFA07A`,orange:`#FFA500`,lightpink:`#FFB6C1`,pink:`#FFC0CB`,gold:`#FFD700`,peachpuff:`#FFDAB9`,navajowhite:`#FFDEAD`,moccasin:`#FFE4B5`,bisque:`#FFE4C4`,mistyrose:`#FFE4E1`,blanchedalmond:`#FFEBCD`,papayawhip:`#FFEFD5`,lavenderblush:`#FFF0F5`,seashell:`#FFF5EE`,cornsilk:`#FFF8DC`,lemonchiffon:`#FFFACD`,floralwhite:`#FFFAF0`,snow:`#FFFAFA`,lightyellow:`#FFFFE0`,ivory:`#FFFFF0`},an=new Int8Array(4),on=new Int32Array(an.buffer,0,1),sn=new Float32Array(an.buffer,0,1),cn=/^\s*rgba?\s*\(/,ln=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function un(e){var t=0,n=0,r=0,i=1;if(e[0]===`#`)e.length===4?(t=parseInt(e.charAt(1)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(2),16),r=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(4),16),r=parseInt(e.charAt(5)+e.charAt(6),16)),e.length===9&&(i=parseInt(e.charAt(7)+e.charAt(8),16)/255);else if(cn.test(e)){var a=e.match(ln);a&&(t=+a[1],n=+a[2],r=+a[3],a[4]&&(i=+a[4]))}return{r:t,g:n,b:r,a:i}}var dn={};for(var fn in rn)dn[fn]=mn(rn[fn]),dn[rn[fn]]=dn[fn];function pn(e,t,n,r,i){return on[0]=r<<24|n<<16|t<<8|e,i&&(on[0]&=4278190079),sn[0]}function mn(e){if(e=e.toLowerCase(),dn[e]!==void 0)return dn[e];var t=un(e),n=t.r,r=t.g,i=t.b,a=t.a;a=a*255|0;var o=pn(n,r,i,a,!0);return dn[e]=o,o}var hn={};function gn(e){if(hn[e]!==void 0)return hn[e];var t=pn((e&16711680)>>>16,(e&65280)>>>8,e&255,255,!0);return hn[e]=t,t}function _n(e,t,n,r){return n+(t<<8)+(e<<16)}function vn(e,t,n,r,i,a){var o=Math.floor(n/a*i),s=Math.floor(e.drawingBufferHeight/a-r/a*i),c=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(o,s,1,1,e.RGBA,e.UNSIGNED_BYTE,c);var l=nn(c,4);return[l[0],l[1],l[2],l[3]]}function G(e,t,n){return(t=Bt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yn(Object(n),!0).forEach(function(t){G(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bn(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Wt(e))!==null;);return e}function xn(){return xn=typeof Reflect<`u`&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=bn(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},xn.apply(null,arguments)}function Sn(e,t,n,r){var i=xn(Wt(1&r?e.prototype:e),t,n);return 2&r&&typeof i==`function`?function(e){return i.apply(n,e)}:i}function Cn(e){return e.normalized?1:e.size}function wn(e){var t=0;return e.forEach(function(e){return t+=Cn(e)}),t}function Tn(e,t,n){var r=e===`VERTEX`?t.VERTEX_SHADER:t.FRAGMENT_SHADER,i=t.createShader(r);if(i===null)throw Error(`loadShader: error while creating the shader`);if(t.shaderSource(i,n),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS)){var a=t.getShaderInfoLog(i);throw t.deleteShader(i),Error(`loadShader: error while compiling the shader:
16
- ${a}
17
- ${n}`)}return i}function En(e,t){return Tn(`VERTEX`,e,t)}function Dn(e,t){return Tn(`FRAGMENT`,e,t)}function On(e,t){var n=e.createProgram();if(n===null)throw Error(`loadProgram: error while creating the program.`);var r,i;for(r=0,i=t.length;r<i;r++)e.attachShader(n,t[r]);if(e.linkProgram(n),!e.getProgramParameter(n,e.LINK_STATUS)){var a=e.getProgramInfoLog(n);throw e.deleteProgram(n),Error(`loadProgram: error while linking the program: ${a}`)}return n}function kn(e){var t=e.gl,n=e.buffer,r=e.program,i=e.vertexShader,a=e.fragmentShader;t.deleteShader(i),t.deleteShader(a),t.deleteProgram(r),t.deleteBuffer(n)}var An=`#define PICKING_MODE
18
- `,jn=G(G(G(G(G(G(G(G({},WebGL2RenderingContext.BOOL,1),WebGL2RenderingContext.BYTE,1),WebGL2RenderingContext.UNSIGNED_BYTE,1),WebGL2RenderingContext.SHORT,2),WebGL2RenderingContext.UNSIGNED_SHORT,2),WebGL2RenderingContext.INT,4),WebGL2RenderingContext.UNSIGNED_INT,4),WebGL2RenderingContext.FLOAT,4),Mn=function(){function e(t,n,r){Vt(this,e),G(this,`array`,new Float32Array),G(this,`constantArray`,new Float32Array),G(this,`capacity`,0),G(this,`verticesCount`,0);var i=this.getDefinition();if(this.VERTICES=i.VERTICES,this.VERTEX_SHADER_SOURCE=i.VERTEX_SHADER_SOURCE,this.FRAGMENT_SHADER_SOURCE=i.FRAGMENT_SHADER_SOURCE,this.UNIFORMS=i.UNIFORMS,this.ATTRIBUTES=i.ATTRIBUTES,this.METHOD=i.METHOD,this.CONSTANT_ATTRIBUTES=`CONSTANT_ATTRIBUTES`in i?i.CONSTANT_ATTRIBUTES:[],this.CONSTANT_DATA=`CONSTANT_DATA`in i?i.CONSTANT_DATA:[],this.isInstanced=`CONSTANT_ATTRIBUTES`in i,this.ATTRIBUTES_ITEMS_COUNT=wn(this.ATTRIBUTES),this.STRIDE=this.VERTICES*this.ATTRIBUTES_ITEMS_COUNT,this.renderer=r,this.normalProgram=this.getProgramInfo(`normal`,t,i.VERTEX_SHADER_SOURCE,i.FRAGMENT_SHADER_SOURCE,null),this.pickProgram=n?this.getProgramInfo(`pick`,t,An+i.VERTEX_SHADER_SOURCE,An+i.FRAGMENT_SHADER_SOURCE,n):null,this.isInstanced){var a=wn(this.CONSTANT_ATTRIBUTES);if(this.CONSTANT_DATA.length!==this.VERTICES)throw Error(`Program: error while getting constant data (expected ${this.VERTICES} items, received ${this.CONSTANT_DATA.length} instead)`);this.constantArray=new Float32Array(this.CONSTANT_DATA.length*a);for(var o=0;o<this.CONSTANT_DATA.length;o++){var s=this.CONSTANT_DATA[o];if(s.length!==a)throw Error(`Program: error while getting constant data (one vector has ${s.length} items instead of ${a})`);for(var c=0;c<s.length;c++)this.constantArray[o*a+c]=s[c]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return Ut(e,[{key:`kill`,value:function(){kn(this.normalProgram),this.pickProgram&&=(kn(this.pickProgram),null)}},{key:`getProgramInfo`,value:function(e,t,n,r,i){var a=this.getDefinition(),o=t.createBuffer();if(o===null)throw Error(`Program: error while creating the WebGL buffer.`);var s=En(t,n),c=Dn(t,r),l=On(t,[s,c]),u={};a.UNIFORMS.forEach(function(e){var n=t.getUniformLocation(l,e);n&&(u[e]=n)});var d={};a.ATTRIBUTES.forEach(function(e){d[e.name]=t.getAttribLocation(l,e.name)});var f;if(`CONSTANT_ATTRIBUTES`in a&&(a.CONSTANT_ATTRIBUTES.forEach(function(e){d[e.name]=t.getAttribLocation(l,e.name)}),f=t.createBuffer(),f===null))throw Error(`Program: error while creating the WebGL constant buffer.`);return{name:e,program:l,gl:t,frameBuffer:i,buffer:o,constantBuffer:f||{},uniformLocations:u,attributeLocations:d,isPicking:e===`pick`,vertexShader:s,fragmentShader:c}}},{key:`bindProgram`,value:function(e){var t=this,n=0,r=e.gl,i=e.buffer;this.isInstanced?(r.bindBuffer(r.ARRAY_BUFFER,e.constantBuffer),n=0,this.CONSTANT_ATTRIBUTES.forEach(function(r){return n+=t.bindAttribute(r,e,n,!1)}),r.bufferData(r.ARRAY_BUFFER,this.constantArray,r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,e.buffer),n=0,this.ATTRIBUTES.forEach(function(r){return n+=t.bindAttribute(r,e,n,!0)}),r.bufferData(r.ARRAY_BUFFER,this.array,r.DYNAMIC_DRAW)):(r.bindBuffer(r.ARRAY_BUFFER,i),n=0,this.ATTRIBUTES.forEach(function(r){return n+=t.bindAttribute(r,e,n)}),r.bufferData(r.ARRAY_BUFFER,this.array,r.DYNAMIC_DRAW)),r.bindBuffer(r.ARRAY_BUFFER,null)}},{key:`unbindProgram`,value:function(e){var t=this;this.isInstanced?(this.CONSTANT_ATTRIBUTES.forEach(function(n){return t.unbindAttribute(n,e,!1)}),this.ATTRIBUTES.forEach(function(n){return t.unbindAttribute(n,e,!0)})):this.ATTRIBUTES.forEach(function(n){return t.unbindAttribute(n,e)})}},{key:`bindAttribute`,value:function(e,t,n,r){var i=jn[e.type];if(typeof i!=`number`)throw Error(`Program.bind: yet unsupported attribute type "${e.type}"`);var a=t.attributeLocations[e.name],o=t.gl;if(a!==-1){o.enableVertexAttribArray(a);var s=this.isInstanced?(r?this.ATTRIBUTES_ITEMS_COUNT:wn(this.CONSTANT_ATTRIBUTES))*Float32Array.BYTES_PER_ELEMENT:this.ATTRIBUTES_ITEMS_COUNT*Float32Array.BYTES_PER_ELEMENT;if(o.vertexAttribPointer(a,e.size,e.type,e.normalized||!1,s,n),this.isInstanced&&r)if(o instanceof WebGL2RenderingContext)o.vertexAttribDivisor(a,1);else{var c=o.getExtension(`ANGLE_instanced_arrays`);c&&c.vertexAttribDivisorANGLE(a,1)}}return e.size*i}},{key:`unbindAttribute`,value:function(e,t,n){var r=t.attributeLocations[e.name],i=t.gl;if(r!==-1&&(i.disableVertexAttribArray(r),this.isInstanced&&n))if(i instanceof WebGL2RenderingContext)i.vertexAttribDivisor(r,0);else{var a=i.getExtension(`ANGLE_instanced_arrays`);a&&a.vertexAttribDivisorANGLE(r,0)}}},{key:`reallocate`,value:function(e){e!==this.capacity&&(this.capacity=e,this.verticesCount=this.VERTICES*e,this.array=new Float32Array(this.isInstanced?this.capacity*this.ATTRIBUTES_ITEMS_COUNT:this.verticesCount*this.ATTRIBUTES_ITEMS_COUNT))}},{key:`hasNothingToRender`,value:function(){return this.verticesCount===0}},{key:`renderProgram`,value:function(e,t){var n=t.gl,r=t.program;n.enable(n.BLEND),n.useProgram(r),this.setUniforms(e,t),this.drawWebGL(this.METHOD,t)}},{key:`render`,value:function(e){this.hasNothingToRender()||(this.pickProgram&&(this.pickProgram.gl.viewport(0,0,e.width*e.pixelRatio/e.downSizingRatio,e.height*e.pixelRatio/e.downSizingRatio),this.bindProgram(this.pickProgram),this.renderProgram(K(K({},e),{},{pixelRatio:e.pixelRatio/e.downSizingRatio}),this.pickProgram),this.unbindProgram(this.pickProgram)),this.normalProgram.gl.viewport(0,0,e.width*e.pixelRatio,e.height*e.pixelRatio),this.bindProgram(this.normalProgram),this.renderProgram(e,this.normalProgram),this.unbindProgram(this.normalProgram))}},{key:`drawWebGL`,value:function(e,t){var n=t.gl,r=t.frameBuffer;if(n.bindFramebuffer(n.FRAMEBUFFER,r),!this.isInstanced)n.drawArrays(e,0,this.verticesCount);else if(n instanceof WebGL2RenderingContext)n.drawArraysInstanced(e,0,this.VERTICES,this.capacity);else{var i=n.getExtension(`ANGLE_instanced_arrays`);i&&i.drawArraysInstancedANGLE(e,0,this.VERTICES,this.capacity)}}}])}(),Nn=function(e){function t(){return Vt(this,t),Jt(this,t,arguments)}return Xt(t,e),Ut(t,[{key:`kill`,value:function(){Sn(t,`kill`,this,3)([])}},{key:`process`,value:function(e,t,n){var r=t*this.STRIDE;if(n.hidden){for(var i=r+this.STRIDE;r<i;r++)this.array[r]=0;return}return this.processVisibleItem(gn(e),r,n)}}])}(Mn),Pn=function(e){function t(){var e;Vt(this,t);var n=[...arguments];return e=Jt(this,t,[].concat(n)),G(e,`drawLabel`,void 0),e}return Xt(t,e),Ut(t,[{key:`kill`,value:function(){Sn(t,`kill`,this,3)([])}},{key:`process`,value:function(e,t,n,r,i){var a=t*this.STRIDE;if(i.hidden||n.hidden||r.hidden){for(var o=a+this.STRIDE;a<o;a++)this.array[a]=0;return}return this.processVisibleItem(gn(e),a,n,r,i)}}])}(Mn);function Fn(e,t){return function(){function n(r,i,a){Vt(this,n),G(this,`drawLabel`,t),this.programs=e.map(function(e){return new e(r,i,a)})}return Ut(n,[{key:`reallocate`,value:function(e){this.programs.forEach(function(t){return t.reallocate(e)})}},{key:`process`,value:function(e,t,n,r,i){this.programs.forEach(function(a){return a.process(e,t,n,r,i)})}},{key:`render`,value:function(e){this.programs.forEach(function(t){return t.render(e)})}},{key:`kill`,value:function(){this.programs.forEach(function(e){return e.kill()})}}])}()}function In(e,t,n,r,i){var a=i.edgeLabelSize,o=i.edgeLabelFont,s=i.edgeLabelWeight,c=i.edgeLabelColor.attribute?t[i.edgeLabelColor.attribute]||i.edgeLabelColor.color||`#000`:i.edgeLabelColor.color,l=t.label;if(l){e.fillStyle=c,e.font=`${s} ${a}px ${o}`;var u=n.size,d=r.size,f=n.x,p=n.y,m=r.x,h=r.y,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=Math.sqrt(v*v+y*y);if(!(b<u+d)){f+=v*u/b,p+=y*u/b,m-=v*d/b,h-=y*d/b,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=Math.sqrt(v*v+y*y);var x=e.measureText(l).width;if(x>b){var S=`…`;for(l+=S,x=e.measureText(l).width;x>b&&l.length>1;)l=l.slice(0,-2)+S,x=e.measureText(l).width;if(l.length<4)return}var C=v>0?y>0?Math.acos(v/b):Math.asin(y/b):y>0?Math.acos(v/b)+Math.PI:Math.asin(v/b)+Math.PI/2;e.save(),e.translate(g,_),e.rotate(C),e.fillText(l,-x/2,t.size/2+a),e.restore()}}}function Ln(e,t,n){if(t.label){var r=n.labelSize,i=n.labelFont,a=n.labelWeight;e.fillStyle=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||`#000`:n.labelColor.color,e.font=`${a} ${r}px ${i}`,e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function Rn(e,t,n){var r=n.labelSize,i=n.labelFont;e.font=`${n.labelWeight} ${r}px ${i}`,e.fillStyle=`#FFF`,e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor=`#000`;var a=2;if(typeof t.label==`string`){var o=e.measureText(t.label).width,s=Math.round(o+5),c=Math.round(r+2*a),l=Math.max(t.size,r/2)+a,u=Math.asin(c/2/l),d=Math.sqrt(Math.abs(l**2-(c/2)**2));e.beginPath(),e.moveTo(t.x+d,t.y+c/2),e.lineTo(t.x+l+s,t.y+c/2),e.lineTo(t.x+l+s,t.y-c/2),e.lineTo(t.x+d,t.y-c/2),e.arc(t.x,t.y,l,u,-u),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+a,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,Ln(e,t,n)}var zn=`
19
- precision highp float;
20
-
21
- varying vec4 v_color;
22
- varying vec2 v_diffVector;
23
- varying float v_radius;
24
-
25
- uniform float u_correctionRatio;
26
-
27
- const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
28
-
29
- void main(void) {
30
- float border = u_correctionRatio * 2.0;
31
- float dist = length(v_diffVector) - v_radius + border;
32
-
33
- // No antialiasing for picking mode:
34
- #ifdef PICKING_MODE
35
- if (dist > border)
36
- gl_FragColor = transparent;
37
- else
38
- gl_FragColor = v_color;
39
-
40
- #else
41
- float t = 0.0;
42
- if (dist > border)
43
- t = 1.0;
44
- else if (dist > 0.0)
45
- t = dist / border;
46
-
47
- gl_FragColor = mix(v_color, transparent, t);
48
- #endif
49
- }
50
- `,Bn=`
51
- attribute vec4 a_id;
52
- attribute vec4 a_color;
53
- attribute vec2 a_position;
54
- attribute float a_size;
55
- attribute float a_angle;
56
-
57
- uniform mat3 u_matrix;
58
- uniform float u_sizeRatio;
59
- uniform float u_correctionRatio;
60
-
61
- varying vec4 v_color;
62
- varying vec2 v_diffVector;
63
- varying float v_radius;
64
- varying float v_border;
65
-
66
- const float bias = 255.0 / 254.0;
67
-
68
- void main() {
69
- float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;
70
- vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));
71
- vec2 position = a_position + diffVector;
72
- gl_Position = vec4(
73
- (u_matrix * vec3(position, 1)).xy,
74
- 0,
75
- 1
76
- );
77
-
78
- v_diffVector = diffVector;
79
- v_radius = size / 2.0;
80
-
81
- #ifdef PICKING_MODE
82
- // For picking mode, we use the ID as the color:
83
- v_color = a_id;
84
- #else
85
- // For normal mode, we use the color:
86
- v_color = a_color;
87
- #endif
88
-
89
- v_color.a *= bias;
90
- }
91
- `,Vn=WebGLRenderingContext,Hn=Vn.UNSIGNED_BYTE,Un=Vn.FLOAT,Wn=[`u_sizeRatio`,`u_correctionRatio`,`u_matrix`],Gn=function(e){function t(){return Vt(this,t),Jt(this,t,arguments)}return Xt(t,e),Ut(t,[{key:`getDefinition`,value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:Bn,FRAGMENT_SHADER_SOURCE:zn,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:Wn,ATTRIBUTES:[{name:`a_position`,size:2,type:Un},{name:`a_size`,size:1,type:Un},{name:`a_color`,size:4,type:Hn,normalized:!0},{name:`a_id`,size:4,type:Hn,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:`a_angle`,size:1,type:Un}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:`processVisibleItem`,value:function(e,t,n){var r=this.array,i=mn(n.color);r[t++]=n.x,r[t++]=n.y,r[t++]=n.size,r[t++]=i,r[t++]=e}},{key:`setUniforms`,value:function(e,t){var n=t.gl,r=t.uniformLocations,i=r.u_sizeRatio,a=r.u_correctionRatio,o=r.u_matrix;n.uniform1f(a,e.correctionRatio),n.uniform1f(i,e.sizeRatio),n.uniformMatrix3fv(o,!1,e.matrix)}}])}(Nn);G(Gn,`ANGLE_1`,0),G(Gn,`ANGLE_2`,2*Math.PI/3),G(Gn,`ANGLE_3`,4*Math.PI/3);var Kn=`
92
- precision mediump float;
93
-
94
- varying vec4 v_color;
95
-
96
- void main(void) {
97
- gl_FragColor = v_color;
98
- }
99
- `,qn=`
100
- attribute vec2 a_position;
101
- attribute vec2 a_normal;
102
- attribute float a_radius;
103
- attribute vec3 a_barycentric;
104
-
105
- #ifdef PICKING_MODE
106
- attribute vec4 a_id;
107
- #else
108
- attribute vec4 a_color;
109
- #endif
110
-
111
- uniform mat3 u_matrix;
112
- uniform float u_sizeRatio;
113
- uniform float u_correctionRatio;
114
- uniform float u_minEdgeThickness;
115
- uniform float u_lengthToThicknessRatio;
116
- uniform float u_widenessToThicknessRatio;
117
-
118
- varying vec4 v_color;
119
-
120
- const float bias = 255.0 / 254.0;
121
-
122
- void main() {
123
- float minThickness = u_minEdgeThickness;
124
-
125
- float normalLength = length(a_normal);
126
- vec2 unitNormal = a_normal / normalLength;
127
-
128
- // These first computations are taken from edge.vert.glsl and
129
- // edge.clamped.vert.glsl. Please read it to get better comments on what's
130
- // happening:
131
- float pixelsThickness = max(normalLength / u_sizeRatio, minThickness);
132
- float webGLThickness = pixelsThickness * u_correctionRatio;
133
- float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio;
134
- float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
135
- float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio;
136
-
137
- float da = a_barycentric.x;
138
- float db = a_barycentric.y;
139
- float dc = a_barycentric.z;
140
-
141
- vec2 delta = vec2(
142
- da * (webGLNodeRadius * unitNormal.y)
143
- + db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x)
144
- + dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x),
145
-
146
- da * (-webGLNodeRadius * unitNormal.x)
147
- + db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y)
148
- + dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y)
149
- );
150
-
151
- vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;
152
-
153
- gl_Position = vec4(position, 0, 1);
154
-
155
- #ifdef PICKING_MODE
156
- // For picking mode, we use the ID as the color:
157
- v_color = a_id;
158
- #else
159
- // For normal mode, we use the color:
160
- v_color = a_color;
161
- #endif
162
-
163
- v_color.a *= bias;
164
- }
165
- `,Jn=WebGLRenderingContext,Yn=Jn.UNSIGNED_BYTE,Xn=Jn.FLOAT,Zn=[`u_matrix`,`u_sizeRatio`,`u_correctionRatio`,`u_minEdgeThickness`,`u_lengthToThicknessRatio`,`u_widenessToThicknessRatio`],Qn={extremity:`target`,lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function $n(e){var t=K(K({},Qn),e||{});return function(e){function n(){return Vt(this,n),Jt(this,n,arguments)}return Xt(n,e),Ut(n,[{key:`getDefinition`,value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:qn,FRAGMENT_SHADER_SOURCE:Kn,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:Zn,ATTRIBUTES:[{name:`a_position`,size:2,type:Xn},{name:`a_normal`,size:2,type:Xn},{name:`a_radius`,size:1,type:Xn},{name:`a_color`,size:4,type:Yn,normalized:!0},{name:`a_id`,size:4,type:Yn,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:`a_barycentric`,size:3,type:Xn}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:`processVisibleItem`,value:function(e,n,r,i,a){if(t.extremity===`source`){var o=[i,r];r=o[0],i=o[1]}var s=a.size||1,c=i.size||1,l=r.x,u=r.y,d=i.x,f=i.y,p=mn(a.color),m=d-l,h=f-u,g=m*m+h*h,_=0,v=0;g&&(g=1/Math.sqrt(g),_=-h*g*s,v=m*g*s);var y=this.array;y[n++]=d,y[n++]=f,y[n++]=-_,y[n++]=-v,y[n++]=c,y[n++]=p,y[n++]=e}},{key:`setUniforms`,value:function(e,n){var r=n.gl,i=n.uniformLocations,a=i.u_matrix,o=i.u_sizeRatio,s=i.u_correctionRatio,c=i.u_minEdgeThickness,l=i.u_lengthToThicknessRatio,u=i.u_widenessToThicknessRatio;r.uniformMatrix3fv(a,!1,e.matrix),r.uniform1f(o,e.sizeRatio),r.uniform1f(s,e.correctionRatio),r.uniform1f(c,e.minEdgeThickness),r.uniform1f(l,t.lengthToThicknessRatio),r.uniform1f(u,t.widenessToThicknessRatio)}}])}(Pn)}$n();var er=`
166
- precision mediump float;
167
-
168
- varying vec4 v_color;
169
- varying vec2 v_normal;
170
- varying float v_thickness;
171
- varying float v_feather;
172
-
173
- const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
174
-
175
- void main(void) {
176
- // We only handle antialiasing for normal mode:
177
- #ifdef PICKING_MODE
178
- gl_FragColor = v_color;
179
- #else
180
- float dist = length(v_normal) * v_thickness;
181
-
182
- float t = smoothstep(
183
- v_thickness - v_feather,
184
- v_thickness,
185
- dist
186
- );
187
-
188
- gl_FragColor = mix(v_color, transparent, t);
189
- #endif
190
- }
191
- `,tr=`
192
- attribute vec4 a_id;
193
- attribute vec4 a_color;
194
- attribute vec2 a_normal;
195
- attribute float a_normalCoef;
196
- attribute vec2 a_positionStart;
197
- attribute vec2 a_positionEnd;
198
- attribute float a_positionCoef;
199
- attribute float a_radius;
200
- attribute float a_radiusCoef;
201
-
202
- uniform mat3 u_matrix;
203
- uniform float u_zoomRatio;
204
- uniform float u_sizeRatio;
205
- uniform float u_pixelRatio;
206
- uniform float u_correctionRatio;
207
- uniform float u_minEdgeThickness;
208
- uniform float u_lengthToThicknessRatio;
209
- uniform float u_feather;
210
-
211
- varying vec4 v_color;
212
- varying vec2 v_normal;
213
- varying float v_thickness;
214
- varying float v_feather;
215
-
216
- const float bias = 255.0 / 254.0;
217
-
218
- void main() {
219
- float minThickness = u_minEdgeThickness;
220
-
221
- float radius = a_radius * a_radiusCoef;
222
- vec2 normal = a_normal * a_normalCoef;
223
- vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
224
-
225
- float normalLength = length(normal);
226
- vec2 unitNormal = normal / normalLength;
227
-
228
- // These first computations are taken from edge.vert.glsl. Please read it to
229
- // get better comments on what's happening:
230
- float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
231
- float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
232
-
233
- // Here, we move the point to leave space for the arrow head:
234
- float direction = sign(radius);
235
- float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio;
236
- float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
237
-
238
- vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength);
239
-
240
- // Here is the proper position of the vertex
241
- gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1);
242
-
243
- v_thickness = webGLThickness / u_zoomRatio;
244
-
245
- v_normal = unitNormal;
246
-
247
- v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
248
-
249
- #ifdef PICKING_MODE
250
- // For picking mode, we use the ID as the color:
251
- v_color = a_id;
252
- #else
253
- // For normal mode, we use the color:
254
- v_color = a_color;
255
- #endif
256
-
257
- v_color.a *= bias;
258
- }
259
- `,nr=WebGLRenderingContext,rr=nr.UNSIGNED_BYTE,ir=nr.FLOAT,ar=[`u_matrix`,`u_zoomRatio`,`u_sizeRatio`,`u_correctionRatio`,`u_pixelRatio`,`u_feather`,`u_minEdgeThickness`,`u_lengthToThicknessRatio`],or={lengthToThicknessRatio:Qn.lengthToThicknessRatio};function sr(e){var t=K(K({},or),e||{});return function(e){function n(){return Vt(this,n),Jt(this,n,arguments)}return Xt(n,e),Ut(n,[{key:`getDefinition`,value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:tr,FRAGMENT_SHADER_SOURCE:er,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:ar,ATTRIBUTES:[{name:`a_positionStart`,size:2,type:ir},{name:`a_positionEnd`,size:2,type:ir},{name:`a_normal`,size:2,type:ir},{name:`a_color`,size:4,type:rr,normalized:!0},{name:`a_id`,size:4,type:rr,normalized:!0},{name:`a_radius`,size:1,type:ir}],CONSTANT_ATTRIBUTES:[{name:`a_positionCoef`,size:1,type:ir},{name:`a_normalCoef`,size:1,type:ir},{name:`a_radiusCoef`,size:1,type:ir}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:`processVisibleItem`,value:function(e,t,n,r,i){var a=i.size||1,o=n.x,s=n.y,c=r.x,l=r.y,u=mn(i.color),d=c-o,f=l-s,p=r.size||1,m=d*d+f*f,h=0,g=0;m&&(m=1/Math.sqrt(m),h=-f*m*a,g=d*m*a);var _=this.array;_[t++]=o,_[t++]=s,_[t++]=c,_[t++]=l,_[t++]=h,_[t++]=g,_[t++]=u,_[t++]=e,_[t++]=p}},{key:`setUniforms`,value:function(e,n){var r=n.gl,i=n.uniformLocations,a=i.u_matrix,o=i.u_zoomRatio,s=i.u_feather,c=i.u_pixelRatio,l=i.u_correctionRatio,u=i.u_sizeRatio,d=i.u_minEdgeThickness,f=i.u_lengthToThicknessRatio;r.uniformMatrix3fv(a,!1,e.matrix),r.uniform1f(o,e.zoomRatio),r.uniform1f(u,e.sizeRatio),r.uniform1f(l,e.correctionRatio),r.uniform1f(c,e.pixelRatio),r.uniform1f(s,e.antiAliasingFeather),r.uniform1f(d,e.minEdgeThickness),r.uniform1f(f,t.lengthToThicknessRatio)}}])}(Pn)}sr();function cr(e){return Fn([sr(e),$n(e)])}var lr=cr(),ur=`
260
- attribute vec4 a_id;
261
- attribute vec4 a_color;
262
- attribute vec2 a_normal;
263
- attribute float a_normalCoef;
264
- attribute vec2 a_positionStart;
265
- attribute vec2 a_positionEnd;
266
- attribute float a_positionCoef;
267
-
268
- uniform mat3 u_matrix;
269
- uniform float u_sizeRatio;
270
- uniform float u_zoomRatio;
271
- uniform float u_pixelRatio;
272
- uniform float u_correctionRatio;
273
- uniform float u_minEdgeThickness;
274
- uniform float u_feather;
275
-
276
- varying vec4 v_color;
277
- varying vec2 v_normal;
278
- varying float v_thickness;
279
- varying float v_feather;
280
-
281
- const float bias = 255.0 / 254.0;
282
-
283
- void main() {
284
- float minThickness = u_minEdgeThickness;
285
-
286
- vec2 normal = a_normal * a_normalCoef;
287
- vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
288
-
289
- float normalLength = length(normal);
290
- vec2 unitNormal = normal / normalLength;
291
-
292
- // We require edges to be at least "minThickness" pixels thick *on screen*
293
- // (so we need to compensate the size ratio):
294
- float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
295
-
296
- // Then, we need to retrieve the normalized thickness of the edge in the WebGL
297
- // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction
298
- // ratio:
299
- float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
300
-
301
- // Here is the proper position of the vertex
302
- gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1);
303
-
304
- // For the fragment shader though, we need a thickness that takes the "magic"
305
- // correction ratio into account (as in webGLThickness), but so that the
306
- // antialiasing effect does not depend on the zoom level. So here's yet
307
- // another thickness version:
308
- v_thickness = webGLThickness / u_zoomRatio;
309
-
310
- v_normal = unitNormal;
311
-
312
- v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
313
-
314
- #ifdef PICKING_MODE
315
- // For picking mode, we use the ID as the color:
316
- v_color = a_id;
317
- #else
318
- // For normal mode, we use the color:
319
- v_color = a_color;
320
- #endif
321
-
322
- v_color.a *= bias;
323
- }
324
- `,dr=WebGLRenderingContext,fr=dr.UNSIGNED_BYTE,pr=dr.FLOAT,mr=[`u_matrix`,`u_zoomRatio`,`u_sizeRatio`,`u_correctionRatio`,`u_pixelRatio`,`u_feather`,`u_minEdgeThickness`],hr=function(e){function t(){return Vt(this,t),Jt(this,t,arguments)}return Xt(t,e),Ut(t,[{key:`getDefinition`,value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:ur,FRAGMENT_SHADER_SOURCE:er,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mr,ATTRIBUTES:[{name:`a_positionStart`,size:2,type:pr},{name:`a_positionEnd`,size:2,type:pr},{name:`a_normal`,size:2,type:pr},{name:`a_color`,size:4,type:fr,normalized:!0},{name:`a_id`,size:4,type:fr,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:`a_positionCoef`,size:1,type:pr},{name:`a_normalCoef`,size:1,type:pr}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:`processVisibleItem`,value:function(e,t,n,r,i){var a=i.size||1,o=n.x,s=n.y,c=r.x,l=r.y,u=mn(i.color),d=c-o,f=l-s,p=d*d+f*f,m=0,h=0;p&&(p=1/Math.sqrt(p),m=-f*p*a,h=d*p*a);var g=this.array;g[t++]=o,g[t++]=s,g[t++]=c,g[t++]=l,g[t++]=m,g[t++]=h,g[t++]=u,g[t++]=e}},{key:`setUniforms`,value:function(e,t){var n=t.gl,r=t.uniformLocations,i=r.u_matrix,a=r.u_zoomRatio,o=r.u_feather,s=r.u_pixelRatio,c=r.u_correctionRatio,l=r.u_sizeRatio,u=r.u_minEdgeThickness;n.uniformMatrix3fv(i,!1,e.matrix),n.uniform1f(a,e.zoomRatio),n.uniform1f(l,e.sizeRatio),n.uniform1f(c,e.correctionRatio),n.uniform1f(s,e.pixelRatio),n.uniform1f(o,e.antiAliasingFeather),n.uniform1f(u,e.minEdgeThickness)}}])}(Pn),gr=function(e){function t(){var e;return Vt(this,t),e=Jt(this,t),e.rawEmitter=e,e}return Xt(t,e),Ut(t)}(M.EventEmitter),_r=o(((e,t)=>{t.exports=function(e){return typeof e==`object`&&!!e&&typeof e.addUndirectedEdgeWithKey==`function`&&typeof e.dropNode==`function`&&typeof e.multi==`boolean`}})),vr=c(_r()),yr={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},br={easing:`quadraticInOut`,duration:150};function xr(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Sr(e,t,n){return e[0]=t,e[4]=typeof n==`number`?n:t,e}function Cr(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function wr(e,t,n){return e[6]=t,e[7]=n,e}function Tr(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=t[0],f=t[1],p=t[2],m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8];return e[0]=d*n+f*a+p*c,e[1]=d*r+f*o+p*l,e[2]=d*i+f*s+p*u,e[3]=m*n+h*a+g*c,e[4]=m*r+h*o+g*l,e[5]=m*i+h*s+g*u,e[6]=_*n+v*a+y*c,e[7]=_*r+v*o+y*l,e[8]=_*i+v*s+y*u,e}function Er(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],i=e[1],a=e[3],o=e[4],s=e[6],c=e[7],l=t.x,u=t.y;return{x:l*r+u*a+s*n,y:l*i+u*o+c*n}}function Dr(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Or(e,t,n,r,i){var a=e.angle,o=e.ratio,s=e.x,c=e.y,l=t.width,u=t.height,d=xr(),f=Math.min(l,u)-2*r,p=Dr(t,n);return i?(Tr(d,wr(xr(),s,c)),Tr(d,Sr(xr(),o)),Tr(d,Cr(xr(),a)),Tr(d,Sr(xr(),l/f/2/p,u/f/2/p))):(Tr(d,Sr(xr(),f/l*2*p,f/u*2*p)),Tr(d,Cr(xr(),-a)),Tr(d,Sr(xr(),1/o)),Tr(d,wr(xr(),-s,-c))),d}function kr(e,t,n){var r=Er(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),i=r.x,a=r.y;return 1/Math.sqrt(i**2+a**2)/n.width}function Ar(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,i=-1/0;return e.forEachNode(function(e,a){var o=a.x,s=a.y;o<t&&(t=o),o>n&&(n=o),s<r&&(r=s),s>i&&(i=s)}),{x:[t,n],y:[r,i]}}function jr(e){if(!(0,vr.default)(e))throw Error(`Sigma: invalid graph instance.`);e.forEachNode(function(e,t){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))throw Error(`Sigma: Coordinates of node ${e} are invalid. A node must have a numeric 'x' and 'y' attribute.`)})}function Mr(e,t,n){var r=document.createElement(e);if(t)for(var i in t)r.style[i]=t[i];if(n)for(var a in n)r.setAttribute(a,n[a]);return r}function Nr(){return window.devicePixelRatio===void 0?1:window.devicePixelRatio}function Pr(e,t,n){return n.sort(function(e,n){var r=t(e)||0,i=t(n)||0;return r<i?-1:+(r>i)})}function Fr(e){var t=nn(e.x,2),n=t[0],r=t[1],i=nn(e.y,2),a=i[0],o=i[1],s=Math.max(r-n,o-a),c=(r+n)/2,l=(o+a)/2;(s===0||Math.abs(s)===1/0||isNaN(s))&&(s=1),isNaN(c)&&(c=0),isNaN(l)&&(l=0);var u=function(e){return{x:.5+(e.x-c)/s,y:.5+(e.y-l)/s}};return u.applyTo=function(e){e.x=.5+(e.x-c)/s,e.y=.5+(e.y-l)/s},u.inverse=function(e){return{x:c+s*(e.x-.5),y:l+s*(e.y-.5)}},u.ratio=s,u}function Ir(e){"@babel/helpers - typeof";return Ir=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ir(e)}function Lr(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var i=0;t.forEach(function(t){e[r+i]=t,i++})}}function Rr(e){e||={};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t<n;t++){var r=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];r&&Object.assign(e,r)}return e}var zr={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!1,enableEdgeEvents:!1,defaultNodeColor:`#999`,defaultNodeType:`circle`,defaultEdgeColor:`#ccc`,defaultEdgeType:`line`,labelFont:`Arial`,labelSize:14,labelWeight:`normal`,labelColor:{color:`#000`},edgeLabelFont:`Arial`,edgeLabelSize:14,edgeLabelWeight:`normal`,edgeLabelColor:{attribute:`color`},stagePadding:30,defaultDrawEdgeLabel:In,defaultDrawNodeLabel:Ln,defaultDrawNodeHover:Rn,minEdgeThickness:1.7,antiAliasingFeather:1,dragTimeout:100,draggedEventsTolerance:3,inertiaDuration:200,inertiaRatio:3,zoomDuration:250,zoomingRatio:1.7,doubleClickTimeout:300,doubleClickZoomingRatio:2.2,doubleClickZoomingDuration:200,tapMoveTolerance:10,zoomToSizeRatioFunction:Math.sqrt,itemSizesReference:`screen`,autoRescale:!0,autoCenter:!0,labelDensity:1,labelGridCellSize:100,labelRenderedSizeThreshold:6,nodeReducer:null,edgeReducer:null,zIndex:!1,minCameraRatio:null,maxCameraRatio:null,enableCameraZooming:!0,enableCameraPanning:!0,enableCameraRotation:!0,cameraPanBoundaries:null,allowInvalidContainer:!1,nodeProgramClasses:{},nodeHoverProgramClasses:{},edgeProgramClasses:{}},Br={circle:Gn},Vr={arrow:lr,line:hr};function Hr(e){if(typeof e.labelDensity!=`number`||e.labelDensity<0)throw Error("Settings: invalid `labelDensity`. Expecting a positive number.");var t=e.minCameraRatio,n=e.maxCameraRatio;if(typeof t==`number`&&typeof n==`number`&&n<t)throw Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")}function Ur(e){var t=Rr({},zr,e);return t.nodeProgramClasses=Rr({},Br,t.nodeProgramClasses),t.edgeProgramClasses=Rr({},Vr,t.edgeProgramClasses),t}var Wr=1.5,Gr=function(e){function t(){var e;return Vt(this,t),e=Jt(this,t),G(e,`x`,.5),G(e,`y`,.5),G(e,`angle`,0),G(e,`ratio`,1),G(e,`minRatio`,null),G(e,`maxRatio`,null),G(e,`enabledZooming`,!0),G(e,`enabledPanning`,!0),G(e,`enabledRotation`,!0),G(e,`clean`,null),G(e,`nextFrame`,null),G(e,`previousState`,null),G(e,`enabled`,!0),e.previousState=e.getState(),e}return Xt(t,e),Ut(t,[{key:`enable`,value:function(){return this.enabled=!0,this}},{key:`disable`,value:function(){return this.enabled=!1,this}},{key:`getState`,value:function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}}},{key:`hasState`,value:function(e){return this.x===e.x&&this.y===e.y&&this.ratio===e.ratio&&this.angle===e.angle}},{key:`getPreviousState`,value:function(){var e=this.previousState;return e?{x:e.x,y:e.y,angle:e.angle,ratio:e.ratio}:null}},{key:`getBoundedRatio`,value:function(e){var t=e;return typeof this.minRatio==`number`&&(t=Math.max(t,this.minRatio)),typeof this.maxRatio==`number`&&(t=Math.min(t,this.maxRatio)),t}},{key:`validateState`,value:function(e){var t={};return this.enabledPanning&&typeof e.x==`number`&&(t.x=e.x),this.enabledPanning&&typeof e.y==`number`&&(t.y=e.y),this.enabledZooming&&typeof e.ratio==`number`&&(t.ratio=this.getBoundedRatio(e.ratio)),this.enabledRotation&&typeof e.angle==`number`&&(t.angle=e.angle),this.clean?this.clean(K(K({},this.getState()),t)):t}},{key:`isAnimated`,value:function(){return!!this.nextFrame}},{key:`setState`,value:function(e){if(!this.enabled)return this;this.previousState=this.getState();var t=this.validateState(e);return typeof t.x==`number`&&(this.x=t.x),typeof t.y==`number`&&(this.y=t.y),typeof t.ratio==`number`&&(this.ratio=t.ratio),typeof t.angle==`number`&&(this.angle=t.angle),this.hasState(this.previousState)||this.emit(`updated`,this.getState()),this}},{key:`updateState`,value:function(e){return this.setState(e(this.getState())),this}},{key:`animate`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!r)return new Promise(function(r){return t.animate(e,n,r)});if(this.enabled){var i=K(K({},br),n),a=this.validateState(e),o=typeof i.easing==`function`?i.easing:yr[i.easing],s=Date.now(),c=this.getState(),l=function(){var e=(Date.now()-s)/i.duration;if(e>=1){t.nextFrame=null,t.setState(a),t.animationCallback&&=(t.animationCallback.call(null),void 0);return}var n=o(e),r={};typeof a.x==`number`&&(r.x=c.x+(a.x-c.x)*n),typeof a.y==`number`&&(r.y=c.y+(a.y-c.y)*n),t.enabledRotation&&typeof a.angle==`number`&&(r.angle=c.angle+(a.angle-c.angle)*n),typeof a.ratio==`number`&&(r.ratio=c.ratio+(a.ratio-c.ratio)*n),t.setState(r),t.nextFrame=requestAnimationFrame(l)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(l)):l(),this.animationCallback=r}}},{key:`animatedZoom`,value:function(e){return e?typeof e==`number`?this.animate({ratio:this.ratio/e}):this.animate({ratio:this.ratio/(e.factor||Wr)},e):this.animate({ratio:this.ratio/Wr})}},{key:`animatedUnzoom`,value:function(e){return e?typeof e==`number`?this.animate({ratio:this.ratio*e}):this.animate({ratio:this.ratio*(e.factor||Wr)},e):this.animate({ratio:this.ratio*Wr})}},{key:`animatedReset`,value:function(e){return this.animate({x:.5,y:.5,ratio:1,angle:0},e)}},{key:`copy`,value:function(){return t.from(this.getState())}}],[{key:`from`,value:function(e){return new t().setState(e)}}])}(gr);function Kr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function qr(e,t){var n=K(K({},Kr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Jr(e){var t=`x`in e?e:K(K({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function Yr(e,t){return K(K({},qr(e,t)),{},{delta:$r(e)})}var Xr=2;function Zr(e){for(var t=[],n=0,r=Math.min(e.length,Xr);n<r;n++)t.push(e[n]);return t}function Qr(e,t,n){var r={touches:Zr(e.touches).map(function(e){return Kr(e,n)}),previousTouches:t.map(function(e){return Kr(e,n)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){r.sigmaDefaultPrevented=!0},original:e};return r}function $r(e){if(e.deltaY!==void 0)return e.deltaY*-3/360;if(e.detail!==void 0)return e.detail/-9;throw Error(`Captor: could not extract delta from event.`)}var ei=function(e){function t(e,n){var r;return Vt(this,t),r=Jt(this,t),r.container=e,r.renderer=n,r}return Xt(t,e),Ut(t)}(gr),ti=[`doubleClickTimeout`,`doubleClickZoomingDuration`,`doubleClickZoomingRatio`,`dragTimeout`,`draggedEventsTolerance`,`inertiaDuration`,`inertiaRatio`,`zoomDuration`,`zoomingRatio`].reduce(function(e,t){return K(K({},e),{},G({},t,zr[t]))},{}),ni=function(e){function t(e,n){var r;return Vt(this,t),r=Jt(this,t,[e,n]),G(r,`enabled`,!0),G(r,`draggedEvents`,0),G(r,`downStartTime`,null),G(r,`lastMouseX`,null),G(r,`lastMouseY`,null),G(r,`isMouseDown`,!1),G(r,`isMoving`,!1),G(r,`movingTimeout`,null),G(r,`startCameraState`,null),G(r,`clicks`,0),G(r,`doubleClickTimeout`,null),G(r,`currentWheelDirection`,0),G(r,`settings`,ti),r.handleClick=r.handleClick.bind(r),r.handleRightClick=r.handleRightClick.bind(r),r.handleDown=r.handleDown.bind(r),r.handleUp=r.handleUp.bind(r),r.handleMove=r.handleMove.bind(r),r.handleWheel=r.handleWheel.bind(r),r.handleLeave=r.handleLeave.bind(r),r.handleEnter=r.handleEnter.bind(r),e.addEventListener(`click`,r.handleClick,{capture:!1}),e.addEventListener(`contextmenu`,r.handleRightClick,{capture:!1}),e.addEventListener(`mousedown`,r.handleDown,{capture:!1}),e.addEventListener(`wheel`,r.handleWheel,{capture:!1}),e.addEventListener(`mouseleave`,r.handleLeave,{capture:!1}),e.addEventListener(`mouseenter`,r.handleEnter,{capture:!1}),document.addEventListener(`mousemove`,r.handleMove,{capture:!1}),document.addEventListener(`mouseup`,r.handleUp,{capture:!1}),r}return Xt(t,e),Ut(t,[{key:`kill`,value:function(){var e=this.container;e.removeEventListener(`click`,this.handleClick),e.removeEventListener(`contextmenu`,this.handleRightClick),e.removeEventListener(`mousedown`,this.handleDown),e.removeEventListener(`wheel`,this.handleWheel),e.removeEventListener(`mouseleave`,this.handleLeave),e.removeEventListener(`mouseenter`,this.handleEnter),document.removeEventListener(`mousemove`,this.handleMove),document.removeEventListener(`mouseup`,this.handleUp)}},{key:`handleClick`,value:function(e){var t=this;if(this.enabled){if(this.clicks++,this.clicks===2)return this.clicks=0,typeof this.doubleClickTimeout==`number`&&(clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null),this.handleDoubleClick(e);setTimeout(function(){t.clicks=0,t.doubleClickTimeout=null},this.settings.doubleClickTimeout),this.draggedEvents<this.settings.draggedEventsTolerance&&this.emit(`click`,qr(e,this.container))}}},{key:`handleRightClick`,value:function(e){this.enabled&&this.emit(`rightClick`,qr(e,this.container))}},{key:`handleDoubleClick`,value:function(e){if(this.enabled){e.preventDefault(),e.stopPropagation();var t=qr(e,this.container);if(this.emit(`doubleClick`,t),!t.sigmaDefaultPrevented){var n=this.renderer.getCamera(),r=n.getBoundedRatio(n.getState().ratio/this.settings.doubleClickZoomingRatio);n.animate(this.renderer.getViewportZoomedState(Kr(e,this.container),r),{easing:`quadraticInOut`,duration:this.settings.doubleClickZoomingDuration})}}}},{key:`handleDown`,value:function(e){if(this.enabled){if(e.button===0){this.startCameraState=this.renderer.getCamera().getState();var t=Kr(e,this.container),n=t.x,r=t.y;this.lastMouseX=n,this.lastMouseY=r,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit(`mousedown`,qr(e,this.container))}}},{key:`handleUp`,value:function(e){var t=this;if(!(!this.enabled||!this.isMouseDown)){var n=this.renderer.getCamera();this.isMouseDown=!1,typeof this.movingTimeout==`number`&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var r=Kr(e,this.container),i=r.x,a=r.y,o=n.getState(),s=n.getPreviousState()||{x:0,y:0};this.isMoving?n.animate({x:o.x+this.settings.inertiaRatio*(o.x-s.x),y:o.y+this.settings.inertiaRatio*(o.y-s.y)},{duration:this.settings.inertiaDuration,easing:`quadraticOut`}):(this.lastMouseX!==i||this.lastMouseY!==a)&&n.setState({x:o.x,y:o.y}),this.isMoving=!1,setTimeout(function(){var e=t.draggedEvents>0;t.draggedEvents=0,e&&t.renderer.getSetting(`hideEdgesOnMove`)&&t.renderer.refresh()},0),this.emit(`mouseup`,qr(e,this.container))}}},{key:`handleMove`,value:function(e){var t=this;if(this.enabled){var n=qr(e,this.container);if(this.emit(`mousemovebody`,n),(e.target===this.container||e.composedPath()[0]===this.container)&&this.emit(`mousemove`,n),!n.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout==`number`&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){t.movingTimeout=null,t.isMoving=!1},this.settings.dragTimeout);var r=this.renderer.getCamera(),i=Kr(e,this.container),a=i.x,o=i.y,s=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),c=this.renderer.viewportToFramedGraph({x:a,y:o}),l=s.x-c.x,u=s.y-c.y,d=r.getState(),f=d.x+l,p=d.y+u;r.setState({x:f,y:p}),this.lastMouseX=a,this.lastMouseY=o,e.preventDefault(),e.stopPropagation()}}}},{key:`handleLeave`,value:function(e){this.emit(`mouseleave`,qr(e,this.container))}},{key:`handleEnter`,value:function(e){this.emit(`mouseenter`,qr(e,this.container))}},{key:`handleWheel`,value:function(e){var t=this,n=this.renderer.getCamera();if(!(!this.enabled||!n.enabledZooming)){var r=$r(e);if(r){var i=Yr(e,this.container);if(this.emit(`wheel`,i),i.sigmaDefaultPrevented){e.preventDefault(),e.stopPropagation();return}var a=n.getState().ratio,o=r>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,s=n.getBoundedRatio(a*o),c=r>0?1:-1,l=Date.now();a!==s&&(e.preventDefault(),e.stopPropagation(),!(this.currentWheelDirection===c&&this.lastWheelTriggerTime&&l-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(n.animate(this.renderer.getViewportZoomedState(Kr(e,this.container),s),{easing:`quadraticOut`,duration:this.settings.zoomDuration},function(){t.currentWheelDirection=0}),this.currentWheelDirection=c,this.lastWheelTriggerTime=l))}}}},{key:`setSettings`,value:function(e){this.settings=e}}])}(ei),ri=[`dragTimeout`,`inertiaDuration`,`inertiaRatio`,`doubleClickTimeout`,`doubleClickZoomingRatio`,`doubleClickZoomingDuration`,`tapMoveTolerance`].reduce(function(e,t){return K(K({},e),{},G({},t,zr[t]))},{}),ii=function(e){function t(e,n){var r;return Vt(this,t),r=Jt(this,t,[e,n]),G(r,`enabled`,!0),G(r,`isMoving`,!1),G(r,`hasMoved`,!1),G(r,`touchMode`,0),G(r,`startTouchesPositions`,[]),G(r,`lastTouches`,[]),G(r,`lastTap`,null),G(r,`settings`,ri),r.handleStart=r.handleStart.bind(r),r.handleLeave=r.handleLeave.bind(r),r.handleMove=r.handleMove.bind(r),e.addEventListener(`touchstart`,r.handleStart,{capture:!1}),e.addEventListener(`touchcancel`,r.handleLeave,{capture:!1}),document.addEventListener(`touchend`,r.handleLeave,{capture:!1,passive:!1}),document.addEventListener(`touchmove`,r.handleMove,{capture:!1,passive:!1}),r}return Xt(t,e),Ut(t,[{key:`kill`,value:function(){var e=this.container;e.removeEventListener(`touchstart`,this.handleStart),e.removeEventListener(`touchcancel`,this.handleLeave),document.removeEventListener(`touchend`,this.handleLeave),document.removeEventListener(`touchmove`,this.handleMove)}},{key:`getDimensions`,value:function(){return{width:this.container.offsetWidth,height:this.container.offsetHeight}}},{key:`handleStart`,value:function(e){var t=this;if(this.enabled){e.preventDefault();var n=Zr(e.touches);if(this.touchMode=n.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=n.map(function(e){return Kr(e,t.container)}),this.touchMode===2){var r=nn(this.startTouchesPositions,2),i=r[0],a=i.x,o=i.y,s=r[1],c=s.x,l=s.y;this.startTouchesAngle=Math.atan2(l-o,c-a),this.startTouchesDistance=Math.sqrt((c-a)**2+(l-o)**2)}this.emit(`touchdown`,Qr(e,this.lastTouches,this.container)),this.lastTouches=n,this.lastTouchesPositions=this.startTouchesPositions}}},{key:`handleLeave`,value:function(e){if(!(!this.enabled||!this.startTouchesPositions.length)){switch(e.cancelable&&e.preventDefault(),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(e.touches.length===1){this.handleStart(e),e.preventDefault();break}case 1:if(this.isMoving){var t=this.renderer.getCamera(),n=t.getState(),r=t.getPreviousState()||{x:0,y:0};t.animate({x:n.x+this.settings.inertiaRatio*(n.x-r.x),y:n.y+this.settings.inertiaRatio*(n.y-r.y)},{duration:this.settings.inertiaDuration,easing:`quadraticOut`})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit(`touchup`,Qr(e,this.lastTouches,this.container)),!e.touches.length){var i=Kr(this.lastTouches[0],this.container),a=this.startTouchesPositions[0],o=(i.x-a.x)**2+(i.y-a.y)**2;if(!e.touches.length&&o<this.settings.tapMoveTolerance**2)if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var s=Qr(e,this.lastTouches,this.container);if(this.emit(`doubletap`,s),this.lastTap=null,!s.sigmaDefaultPrevented){var c=this.renderer.getCamera(),l=c.getBoundedRatio(c.getState().ratio/this.settings.doubleClickZoomingRatio);c.animate(this.renderer.getViewportZoomedState(i,l),{easing:`quadraticInOut`,duration:this.settings.doubleClickZoomingDuration})}}else{var u=Qr(e,this.lastTouches,this.container);this.emit(`tap`,u),this.lastTap={time:Date.now(),position:u.touches[0]||u.previousTouches[0]}}}this.lastTouches=Zr(e.touches),this.startTouchesPositions=[]}}},{key:`handleMove`,value:function(e){var t=this;if(!(!this.enabled||!this.startTouchesPositions.length)){e.preventDefault();var n=Zr(e.touches),r=n.map(function(e){return Kr(e,t.container)}),i=this.lastTouches;this.lastTouches=n,this.lastTouchesPositions=r;var a=Qr(e,i,this.container);if(this.emit(`touchmove`,a),!a.sigmaDefaultPrevented&&(this.hasMoved||=r.some(function(e,n){var r=t.startTouchesPositions[n];return r&&(e.x!==r.x||e.y!==r.y)}),this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){t.isMoving=!1},this.settings.dragTimeout);var o=this.renderer.getCamera(),s=this.startCameraState,c=this.renderer.getSetting(`stagePadding`);switch(this.touchMode){case 1:var l=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),u=l.x,d=l.y,f=this.renderer.viewportToFramedGraph(r[0]),p=f.x,m=f.y;o.setState({x:s.x+u-p,y:s.y+d-m});break;case 2:var h={x:.5,y:.5,angle:0,ratio:1},g=r[0],_=g.x,v=g.y,y=r[1],b=y.x,x=y.y,S=Math.atan2(x-v,b-_)-this.startTouchesAngle,C=Math.hypot(x-v,b-_)/this.startTouchesDistance,w=o.getBoundedRatio(s.ratio/C);h.ratio=w,h.angle=s.angle+S;var ee=this.getDimensions(),T=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:s}),E=Math.min(ee.width,ee.height)-2*c,D=E/ee.width,te=E/ee.height,ne=w/E,O=_-E/2/D,k=v-E/2/te,A=[O*Math.cos(-h.angle)-k*Math.sin(-h.angle),k*Math.cos(-h.angle)+O*Math.sin(-h.angle)];O=A[0],k=A[1],h.x=T.x-O*ne,h.y=T.y+k*ne,o.setState(h);break}}}}},{key:`setSettings`,value:function(e){this.settings=e}}])}(ei);function ai(e){if(Array.isArray(e))return $t(e)}function oi(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function si(){throw TypeError(`Invalid attempt to spread non-iterable instance.
325
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ci(e){return ai(e)||oi(e)||en(e)||si()}function li(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ui(e,t){if(e==null)return{};var n,r,i=li(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var di=function(){function e(t,n){Vt(this,e),this.key=t,this.size=n}return Ut(e,null,[{key:`compare`,value:function(e,t){return e.size>t.size?-1:e.size<t.size||e.key>t.key?1:-1}}])}(),fi=function(){function e(){Vt(this,e),G(this,`width`,0),G(this,`height`,0),G(this,`cellSize`,0),G(this,`columns`,0),G(this,`rows`,0),G(this,`cells`,{})}return Ut(e,[{key:`resizeAndClear`,value:function(e,t){this.width=e.width,this.height=e.height,this.cellSize=t,this.columns=Math.ceil(e.width/t),this.rows=Math.ceil(e.height/t),this.cells={}}},{key:`getIndex`,value:function(e){var t=Math.floor(e.x/this.cellSize);return Math.floor(e.y/this.cellSize)*this.columns+t}},{key:`add`,value:function(e,t,n){var r=new di(e,t),i=this.getIndex(n),a=this.cells[i];a||(a=[],this.cells[i]=a),a.push(r)}},{key:`organize`,value:function(){for(var e in this.cells)this.cells[e].sort(di.compare)}},{key:`getLabelsToDisplay`,value:function(e,t){var n=this.cellSize*this.cellSize,r=n/e/e*t/n,i=Math.ceil(r),a=[];for(var o in this.cells)for(var s=this.cells[o],c=0;c<Math.min(i,s.length);c++)a.push(s[c].key);return a}}])}();function pi(e){var t=e.graph,n=e.hoveredNode,r=e.highlightedNodes,i=e.displayedNodeLabels,a=[];return t.forEachEdge(function(e,t,o,s){(o===n||s===n||r.has(o)||r.has(s)||i.has(o)&&i.has(s))&&a.push(e)}),a}var mi=150,hi=50,gi=Object.prototype.hasOwnProperty;function _i(e,t,n){if(!gi.call(n,`x`)||!gi.call(n,`y`))throw Error(`Sigma: could not find a valid position (x, y) for node "${t}". All your nodes must have a number "x" and "y". Maybe your forgot to apply a layout or your "nodeReducer" is not returning the correct data?`);return n.color||=e.defaultNodeColor,!n.label&&n.label!==``&&(n.label=null),n.label!==void 0&&n.label!==null?n.label=``+n.label:n.label=null,n.size||=2,gi.call(n,`hidden`)||(n.hidden=!1),gi.call(n,`highlighted`)||(n.highlighted=!1),gi.call(n,`forceLabel`)||(n.forceLabel=!1),(!n.type||n.type===``)&&(n.type=e.defaultNodeType),n.zIndex||=0,n}function vi(e,t,n){return n.color||=e.defaultEdgeColor,n.label||=``,n.size||=.5,gi.call(n,`hidden`)||(n.hidden=!1),gi.call(n,`forceLabel`)||(n.forceLabel=!1),(!n.type||n.type===``)&&(n.type=e.defaultEdgeType),n.zIndex||=0,n}var yi=function(e){function t(e,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(Vt(this,t),r=Jt(this,t),G(r,`elements`,{}),G(r,`canvasContexts`,{}),G(r,`webGLContexts`,{}),G(r,`pickingLayers`,new Set),G(r,`textures`,{}),G(r,`frameBuffers`,{}),G(r,`activeListeners`,{}),G(r,`labelGrid`,new fi),G(r,`nodeDataCache`,{}),G(r,`edgeDataCache`,{}),G(r,`nodeProgramIndex`,{}),G(r,`edgeProgramIndex`,{}),G(r,`nodesWithForcedLabels`,new Set),G(r,`edgesWithForcedLabels`,new Set),G(r,`nodeExtent`,{x:[0,1],y:[0,1]}),G(r,`nodeZExtent`,[1/0,-1/0]),G(r,`edgeZExtent`,[1/0,-1/0]),G(r,`matrix`,xr()),G(r,`invMatrix`,xr()),G(r,`correctionRatio`,1),G(r,`customBBox`,null),G(r,`normalizationFunction`,Fr({x:[0,1],y:[0,1]})),G(r,`graphToViewportRatio`,1),G(r,`itemIDsIndex`,{}),G(r,`nodeIndices`,{}),G(r,`edgeIndices`,{}),G(r,`width`,0),G(r,`height`,0),G(r,`pixelRatio`,Nr()),G(r,`pickingDownSizingRatio`,2*r.pixelRatio),G(r,`displayedNodeLabels`,new Set),G(r,`displayedEdgeLabels`,new Set),G(r,`highlightedNodes`,new Set),G(r,`hoveredNode`,null),G(r,`hoveredEdge`,null),G(r,`renderFrame`,null),G(r,`renderHighlightedNodesFrame`,null),G(r,`needToProcess`,!1),G(r,`checkEdgesEventsFrame`,null),G(r,`nodePrograms`,{}),G(r,`nodeHoverPrograms`,{}),G(r,`edgePrograms`,{}),r.settings=Ur(i),Hr(r.settings),jr(e),!(n instanceof HTMLElement))throw Error(`Sigma: container should be an html element.`);for(var a in r.graph=e,r.container=n,r.createWebGLContext(`edges`,{picking:i.enableEdgeEvents}),r.createCanvasContext(`edgeLabels`),r.createWebGLContext(`nodes`,{picking:!0}),r.createCanvasContext(`labels`),r.createCanvasContext(`hovers`),r.createWebGLContext(`hoverNodes`),r.createCanvasContext(`mouse`,{style:{touchAction:`none`,userSelect:`none`}}),r.resize(),r.settings.nodeProgramClasses)r.registerNodeProgram(a,r.settings.nodeProgramClasses[a],r.settings.nodeHoverProgramClasses[a]);for(var o in r.settings.edgeProgramClasses)r.registerEdgeProgram(o,r.settings.edgeProgramClasses[o]);return r.camera=new Gr,r.bindCameraHandlers(),r.mouseCaptor=new ni(r.elements.mouse,r),r.mouseCaptor.setSettings(r.settings),r.touchCaptor=new ii(r.elements.mouse,r),r.touchCaptor.setSettings(r.settings),r.bindEventHandlers(),r.bindGraphHandlers(),r.handleSettingsUpdate(),r.refresh(),r}return Xt(t,e),Ut(t,[{key:`registerNodeProgram`,value:function(e,t,n){return this.nodePrograms[e]&&this.nodePrograms[e].kill(),this.nodeHoverPrograms[e]&&this.nodeHoverPrograms[e].kill(),this.nodePrograms[e]=new t(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[e]=new(n||t)(this.webGLContexts.hoverNodes,null,this),this}},{key:`registerEdgeProgram`,value:function(e,t){return this.edgePrograms[e]&&this.edgePrograms[e].kill(),this.edgePrograms[e]=new t(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:`unregisterNodeProgram`,value:function(e){if(this.nodePrograms[e]){var t=this.nodePrograms,n=t[e],r=ui(t,[e].map(Bt));n.kill(),this.nodePrograms=r}if(this.nodeHoverPrograms[e]){var i=this.nodeHoverPrograms,a=i[e],o=ui(i,[e].map(Bt));a.kill(),this.nodePrograms=o}return this}},{key:`unregisterEdgeProgram`,value:function(e){if(this.edgePrograms[e]){var t=this.edgePrograms,n=t[e],r=ui(t,[e].map(Bt));n.kill(),this.edgePrograms=r}return this}},{key:`resetWebGLTexture`,value:function(e){var t=this.webGLContexts[e],n=this.frameBuffers[e],r=this.textures[e];r&&t.deleteTexture(r);var i=t.createTexture();return t.bindFramebuffer(t.FRAMEBUFFER,n),t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0),this.textures[e]=i,this}},{key:`bindCameraHandlers`,value:function(){var e=this;return this.activeListeners.camera=function(){e.scheduleRender()},this.camera.on(`updated`,this.activeListeners.camera),this}},{key:`unbindCameraHandlers`,value:function(){return this.camera.removeListener(`updated`,this.activeListeners.camera),this}},{key:`getNodeAtPosition`,value:function(e){var t=e.x,n=e.y,r=vn(this.webGLContexts.nodes,this.frameBuffers.nodes,t,n,this.pixelRatio,this.pickingDownSizingRatio),i=_n.apply(void 0,ci(r)),a=this.itemIDsIndex[i];return a&&a.type===`node`?a.id:null}},{key:`bindEventHandlers`,value:function(){var e=this;this.activeListeners.handleResize=function(){e.scheduleRefresh()},window.addEventListener(`resize`,this.activeListeners.handleResize),this.activeListeners.handleMove=function(t){var n=Jr(t),r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}},i=e.getNodeAtPosition(n);if(i&&e.hoveredNode!==i&&!e.nodeDataCache[i].hidden){e.hoveredNode&&e.emit(`leaveNode`,K(K({},r),{},{node:e.hoveredNode})),e.hoveredNode=i,e.emit(`enterNode`,K(K({},r),{},{node:i})),e.scheduleHighlightedNodesRender();return}if(e.hoveredNode&&e.getNodeAtPosition(n)!==e.hoveredNode){var a=e.hoveredNode;e.hoveredNode=null,e.emit(`leaveNode`,K(K({},r),{},{node:a})),e.scheduleHighlightedNodesRender();return}if(e.settings.enableEdgeEvents){var o=e.hoveredNode?null:e.getEdgeAtPoint(r.event.x,r.event.y);o!==e.hoveredEdge&&(e.hoveredEdge&&e.emit(`leaveEdge`,K(K({},r),{},{edge:e.hoveredEdge})),o&&e.emit(`enterEdge`,K(K({},r),{},{edge:o})),e.hoveredEdge=o)}},this.activeListeners.handleMoveBody=function(t){var n=Jr(t);e.emit(`moveBody`,{event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(t){var n=Jr(t),r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}};e.hoveredNode&&(e.emit(`leaveNode`,K(K({},r),{},{node:e.hoveredNode})),e.scheduleHighlightedNodesRender()),e.settings.enableEdgeEvents&&e.hoveredEdge&&(e.emit(`leaveEdge`,K(K({},r),{},{edge:e.hoveredEdge})),e.scheduleHighlightedNodesRender()),e.emit(`leaveStage`,K({},r))},this.activeListeners.handleEnter=function(t){var n=Jr(t),r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}};e.emit(`enterStage`,K({},r))};var t=function(t){return function(n){var r=Jr(n),i={event:r,preventSigmaDefault:function(){r.preventSigmaDefault()}},a=e.getNodeAtPosition(r);if(a)return e.emit(`${t}Node`,K(K({},i),{},{node:a}));if(e.settings.enableEdgeEvents){var o=e.getEdgeAtPoint(r.x,r.y);if(o)return e.emit(`${t}Edge`,K(K({},i),{},{edge:o}))}return e.emit(`${t}Stage`,i)}};return this.activeListeners.handleClick=t(`click`),this.activeListeners.handleRightClick=t(`rightClick`),this.activeListeners.handleDoubleClick=t(`doubleClick`),this.activeListeners.handleWheel=t(`wheel`),this.activeListeners.handleDown=t(`down`),this.activeListeners.handleUp=t(`up`),this.mouseCaptor.on(`mousemove`,this.activeListeners.handleMove),this.mouseCaptor.on(`mousemovebody`,this.activeListeners.handleMoveBody),this.mouseCaptor.on(`click`,this.activeListeners.handleClick),this.mouseCaptor.on(`rightClick`,this.activeListeners.handleRightClick),this.mouseCaptor.on(`doubleClick`,this.activeListeners.handleDoubleClick),this.mouseCaptor.on(`wheel`,this.activeListeners.handleWheel),this.mouseCaptor.on(`mousedown`,this.activeListeners.handleDown),this.mouseCaptor.on(`mouseup`,this.activeListeners.handleUp),this.mouseCaptor.on(`mouseleave`,this.activeListeners.handleLeave),this.mouseCaptor.on(`mouseenter`,this.activeListeners.handleEnter),this.touchCaptor.on(`touchdown`,this.activeListeners.handleDown),this.touchCaptor.on(`touchdown`,this.activeListeners.handleMove),this.touchCaptor.on(`touchup`,this.activeListeners.handleUp),this.touchCaptor.on(`touchmove`,this.activeListeners.handleMove),this.touchCaptor.on(`tap`,this.activeListeners.handleClick),this.touchCaptor.on(`doubletap`,this.activeListeners.handleDoubleClick),this.touchCaptor.on(`touchmove`,this.activeListeners.handleMoveBody),this}},{key:`bindGraphHandlers`,value:function(){var e=this,t=this.graph,n=new Set([`x`,`y`,`zIndex`,`type`]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(r){var i=r.hints?.attributes;e.graph.forEachNode(function(t){return e.updateNode(t)});var a=!i||i.some(function(e){return n.has(e)});e.refresh({partialGraph:{nodes:t.nodes()},skipIndexation:!a,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(n){var r=n.hints?.attributes;e.graph.forEachEdge(function(t){return e.updateEdge(t)});var i=r&&[`zIndex`,`type`].some(function(e){return r?.includes(e)});e.refresh({partialGraph:{edges:t.edges()},skipIndexation:!i,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(t){var n=t.key;e.addNode(n),e.refresh({partialGraph:{nodes:[n]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(t){var n=t.key;e.refresh({partialGraph:{nodes:[n]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(t){var n=t.key;e.removeNode(n),e.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(t){var n=t.key;e.addEdge(n),e.refresh({partialGraph:{edges:[n]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(t){var n=t.key;e.refresh({partialGraph:{edges:[n]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(t){var n=t.key;e.removeEdge(n),e.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){e.clearEdgeState(),e.clearEdgeIndices(),e.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){e.clearEdgeState(),e.clearNodeState(),e.clearEdgeIndices(),e.clearNodeIndices(),e.refresh({schedule:!0})},t.on(`nodeAdded`,this.activeListeners.addNodeGraphUpdate),t.on(`nodeDropped`,this.activeListeners.dropNodeGraphUpdate),t.on(`nodeAttributesUpdated`,this.activeListeners.updateNodeGraphUpdate),t.on(`eachNodeAttributesUpdated`,this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),t.on(`edgeAdded`,this.activeListeners.addEdgeGraphUpdate),t.on(`edgeDropped`,this.activeListeners.dropEdgeGraphUpdate),t.on(`edgeAttributesUpdated`,this.activeListeners.updateEdgeGraphUpdate),t.on(`eachEdgeAttributesUpdated`,this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),t.on(`edgesCleared`,this.activeListeners.clearEdgesGraphUpdate),t.on(`cleared`,this.activeListeners.clearGraphUpdate),this}},{key:`unbindGraphHandlers`,value:function(){var e=this.graph;e.removeListener(`nodeAdded`,this.activeListeners.addNodeGraphUpdate),e.removeListener(`nodeDropped`,this.activeListeners.dropNodeGraphUpdate),e.removeListener(`nodeAttributesUpdated`,this.activeListeners.updateNodeGraphUpdate),e.removeListener(`eachNodeAttributesUpdated`,this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),e.removeListener(`edgeAdded`,this.activeListeners.addEdgeGraphUpdate),e.removeListener(`edgeDropped`,this.activeListeners.dropEdgeGraphUpdate),e.removeListener(`edgeAttributesUpdated`,this.activeListeners.updateEdgeGraphUpdate),e.removeListener(`eachEdgeAttributesUpdated`,this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),e.removeListener(`edgesCleared`,this.activeListeners.clearEdgesGraphUpdate),e.removeListener(`cleared`,this.activeListeners.clearGraphUpdate)}},{key:`getEdgeAtPoint`,value:function(e,t){var n=vn(this.webGLContexts.edges,this.frameBuffers.edges,e,t,this.pixelRatio,this.pickingDownSizingRatio),r=_n.apply(void 0,ci(n)),i=this.itemIDsIndex[r];return i&&i.type===`edge`?i.id:null}},{key:`process`,value:function(){var e=this;this.emit(`beforeProcess`);var t=this.graph,n=this.settings,r=this.getDimensions();if(this.nodeExtent=Ar(this.graph),!this.settings.autoRescale){var i=r.width,a=r.height,o=this.nodeExtent,s=o.x,c=o.y;this.nodeExtent={x:[(s[0]+s[1])/2-i/2,(s[0]+s[1])/2+i/2],y:[(c[0]+c[1])/2-a/2,(c[0]+c[1])/2+a/2]}}this.normalizationFunction=Fr(this.customBBox||this.nodeExtent);var l=Or(new Gr().getState(),r,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(r,n.labelGridCellSize);for(var u={},d={},f={},p={},m=1,h=t.nodes(),g=0,_=h.length;g<_;g++){var v=h[g],y=this.nodeDataCache[v],b=t.getNodeAttributes(v);y.x=b.x,y.y=b.y,this.normalizationFunction.applyTo(y),typeof y.label==`string`&&!y.hidden&&this.labelGrid.add(v,y.size,this.framedGraphToViewport(y,{matrix:l})),u[y.type]=(u[y.type]||0)+1}for(var x in this.labelGrid.organize(),this.nodePrograms){if(!gi.call(this.nodePrograms,x))throw Error(`Sigma: could not find a suitable program for node type "${x}"!`);this.nodePrograms[x].reallocate(u[x]||0),u[x]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(h=Pr(this.nodeZExtent,function(t){return e.nodeDataCache[t].zIndex},h));for(var S=0,C=h.length;S<C;S++){var w=h[S];d[w]=m,p[d[w]]={type:`node`,id:w},m++;var ee=this.nodeDataCache[w];this.addNodeToProgram(w,d[w],u[ee.type]++)}for(var T={},E=t.edges(),D=0,te=E.length;D<te;D++){var ne=E[D],O=this.edgeDataCache[ne];T[O.type]=(T[O.type]||0)+1}for(var k in this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(E=Pr(this.edgeZExtent,function(t){return e.edgeDataCache[t].zIndex},E)),this.edgePrograms){if(!gi.call(this.edgePrograms,k))throw Error(`Sigma: could not find a suitable program for edge type "${k}"!`);this.edgePrograms[k].reallocate(T[k]||0),T[k]=0}for(var A=0,j=E.length;A<j;A++){var re=E[A];f[re]=m,p[f[re]]={type:`edge`,id:re},m++;var M=this.edgeDataCache[re];this.addEdgeToProgram(re,f[re],T[M.type]++)}return this.itemIDsIndex=p,this.nodeIndices=d,this.edgeIndices=f,this.emit(`afterProcess`),this}},{key:`handleSettingsUpdate`,value:function(e){var t=this,n=this.settings;if(this.camera.minRatio=n.minCameraRatio,this.camera.maxRatio=n.maxCameraRatio,this.camera.enabledZooming=n.enableCameraZooming,this.camera.enabledPanning=n.enableCameraPanning,this.camera.enabledRotation=n.enableCameraRotation,n.cameraPanBoundaries?this.camera.clean=function(e){return t.cleanCameraState(e,n.cameraPanBoundaries&&Ir(n.cameraPanBoundaries)===`object`?n.cameraPanBoundaries:{})}:this.camera.clean=null,this.camera.setState(this.camera.validateState(this.camera.getState())),e){if(e.edgeProgramClasses!==n.edgeProgramClasses){for(var r in n.edgeProgramClasses)n.edgeProgramClasses[r]!==e.edgeProgramClasses[r]&&this.registerEdgeProgram(r,n.edgeProgramClasses[r]);for(var i in e.edgeProgramClasses)n.edgeProgramClasses[i]||this.unregisterEdgeProgram(i)}if(e.nodeProgramClasses!==n.nodeProgramClasses||e.nodeHoverProgramClasses!==n.nodeHoverProgramClasses){for(var a in n.nodeProgramClasses)(n.nodeProgramClasses[a]!==e.nodeProgramClasses[a]||n.nodeHoverProgramClasses[a]!==e.nodeHoverProgramClasses[a])&&this.registerNodeProgram(a,n.nodeProgramClasses[a],n.nodeHoverProgramClasses[a]);for(var o in e.nodeProgramClasses)n.nodeProgramClasses[o]||this.unregisterNodeProgram(o)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:`cleanCameraState`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.tolerance,r=n===void 0?0:n,i=t.boundaries,a=K({},e),o=i||this.nodeExtent,s=nn(o.x,2),c=s[0],l=s[1],u=nn(o.y,2),d=u[0],f=u[1],p=[this.graphToViewport({x:c,y:d},{cameraState:e}),this.graphToViewport({x:l,y:d},{cameraState:e}),this.graphToViewport({x:c,y:f},{cameraState:e}),this.graphToViewport({x:l,y:f},{cameraState:e})],m=1/0,h=-1/0,g=1/0,_=-1/0;p.forEach(function(e){var t=e.x,n=e.y;m=Math.min(m,t),h=Math.max(h,t),g=Math.min(g,n),_=Math.max(_,n)});var v=h-m,y=_-g,b=this.getDimensions(),x=b.width,S=b.height,C=0,w=0;if(v>=x?h<x-r?C=h-(x-r):m>r&&(C=m-r):h>x+r?C=h-(x+r):m<-r&&(C=m+r),y>=S?_<S-r?w=_-(S-r):g>r&&(w=g-r):_>S+r?w=_-(S+r):g<-r&&(w=g+r),C||w){var ee=this.viewportToFramedGraph({x:0,y:0},{cameraState:e}),T=this.viewportToFramedGraph({x:C,y:w},{cameraState:e});C=T.x-ee.x,w=T.y-ee.y,a.x+=C,a.y+=w}return a}},{key:`renderLabels`,value:function(){if(!this.settings.renderLabels)return this;var e=this.camera.getState(),t=this.labelGrid.getLabelsToDisplay(e.ratio,this.settings.labelDensity);Lr(t,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var n=this.canvasContexts.labels,r=0,i=t.length;r<i;r++){var a=t[r],o=this.nodeDataCache[a];if(!this.displayedNodeLabels.has(a)&&!o.hidden){var s=this.framedGraphToViewport(o),c=s.x,l=s.y,u=this.scaleSize(o.size);if(!(!o.forceLabel&&u<this.settings.labelRenderedSizeThreshold)&&!(c<-mi||c>this.width+mi||l<-hi||l>this.height+hi)){this.displayedNodeLabels.add(a);var d=this.settings.defaultDrawNodeLabel;(this.nodePrograms[o.type]?.drawLabel||d)(n,K(K({key:a},o),{},{size:u,x:c,y:l}),this.settings)}}}return this}},{key:`renderEdgeLabels`,value:function(){if(!this.settings.renderEdgeLabels)return this;var e=this.canvasContexts.edgeLabels;e.clearRect(0,0,this.width,this.height);var t=pi({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});Lr(t,this.edgesWithForcedLabels);for(var n=new Set,r=0,i=t.length;r<i;r++){var a=t[r],o=this.graph.extremities(a),s=this.nodeDataCache[o[0]],c=this.nodeDataCache[o[1]],l=this.edgeDataCache[a];if(!n.has(a)&&!(l.hidden||s.hidden||c.hidden)){var u=this.settings.defaultDrawEdgeLabel;(this.edgePrograms[l.type]?.drawLabel||u)(e,K(K({key:a},l),{},{size:this.scaleSize(l.size)}),K(K(K({key:o[0]},s),this.framedGraphToViewport(s)),{},{size:this.scaleSize(s.size)}),K(K(K({key:o[1]},c),this.framedGraphToViewport(c)),{},{size:this.scaleSize(c.size)}),this.settings),n.add(a)}}return this.displayedEdgeLabels=n,this}},{key:`renderHighlightedNodes`,value:function(){var e=this,t=this.canvasContexts.hovers;t.clearRect(0,0,this.width,this.height);var n=function(n){var r=e.nodeDataCache[n],i=e.framedGraphToViewport(r),a=i.x,o=i.y,s=e.scaleSize(r.size),c=e.settings.defaultDrawNodeHover;(e.nodePrograms[r.type]?.drawHover||c)(t,K(K({key:n},r),{},{size:s,x:a,y:o}),e.settings)},r=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&r.push(this.hoveredNode),this.highlightedNodes.forEach(function(t){t!==e.hoveredNode&&r.push(t)}),r.forEach(function(e){return n(e)});var i={};for(var a in r.forEach(function(t){var n=e.nodeDataCache[t].type;i[n]=(i[n]||0)+1}),this.nodeHoverPrograms)this.nodeHoverPrograms[a].reallocate(i[a]||0),i[a]=0;r.forEach(function(t){var n=e.nodeDataCache[t];e.nodeHoverPrograms[n.type].process(0,i[n.type]++,n)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var o=this.getRenderParams();for(var s in this.nodeHoverPrograms)this.nodeHoverPrograms[s].render(o)}},{key:`scheduleHighlightedNodesRender`,value:function(){var e=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=requestAnimationFrame(function(){e.renderHighlightedNodesFrame=null,e.renderHighlightedNodes(),e.renderEdgeLabels()}))}},{key:`render`,value:function(){var e=this;this.emit(`beforeRender`);var t=function(){return e.emit(`afterRender`),e};if(this.renderFrame&&=(cancelAnimationFrame(this.renderFrame),null),this.resize(),this.needToProcess&&this.process(),this.needToProcess=!1,this.clear(),this.pickingLayers.forEach(function(t){return e.resetWebGLTexture(t)}),!this.graph.order)return t();var n=this.mouseCaptor,r=this.camera.isAnimated()||n.isMoving||n.draggedEvents||n.currentWheelDirection,i=this.camera.getState(),a=this.getDimensions(),o=this.getGraphDimensions(),s=this.getStagePadding();this.matrix=Or(i,a,o,s),this.invMatrix=Or(i,a,o,s,!0),this.correctionRatio=kr(this.matrix,i,a),this.graphToViewportRatio=this.getGraphToViewportRatio();var c=this.getRenderParams();for(var l in this.nodePrograms)this.nodePrograms[l].render(c);if(!this.settings.hideEdgesOnMove||!r)for(var u in this.edgePrograms)this.edgePrograms[u].render(c);return this.settings.hideLabelsOnMove&&r?t():(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes(),t())}},{key:`addNode`,value:function(e){var t=Object.assign({},this.graph.getNodeAttributes(e));this.settings.nodeReducer&&(t=this.settings.nodeReducer(e,t));var n=_i(this.settings,e,t);this.nodeDataCache[e]=n,this.nodesWithForcedLabels.delete(e),n.forceLabel&&!n.hidden&&this.nodesWithForcedLabels.add(e),this.highlightedNodes.delete(e),n.highlighted&&!n.hidden&&this.highlightedNodes.add(e),this.settings.zIndex&&(n.zIndex<this.nodeZExtent[0]&&(this.nodeZExtent[0]=n.zIndex),n.zIndex>this.nodeZExtent[1]&&(this.nodeZExtent[1]=n.zIndex))}},{key:`updateNode`,value:function(e){this.addNode(e);var t=this.nodeDataCache[e];this.normalizationFunction.applyTo(t)}},{key:`removeNode`,value:function(e){delete this.nodeDataCache[e],delete this.nodeProgramIndex[e],this.highlightedNodes.delete(e),this.hoveredNode===e&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(e)}},{key:`addEdge`,value:function(e){var t=Object.assign({},this.graph.getEdgeAttributes(e));this.settings.edgeReducer&&(t=this.settings.edgeReducer(e,t));var n=vi(this.settings,e,t);this.edgeDataCache[e]=n,this.edgesWithForcedLabels.delete(e),n.forceLabel&&!n.hidden&&this.edgesWithForcedLabels.add(e),this.settings.zIndex&&(n.zIndex<this.edgeZExtent[0]&&(this.edgeZExtent[0]=n.zIndex),n.zIndex>this.edgeZExtent[1]&&(this.edgeZExtent[1]=n.zIndex))}},{key:`updateEdge`,value:function(e){this.addEdge(e)}},{key:`removeEdge`,value:function(e){delete this.edgeDataCache[e],delete this.edgeProgramIndex[e],this.hoveredEdge===e&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(e)}},{key:`clearNodeIndices`,value:function(){this.labelGrid=new fi,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0],this.highlightedNodes=new Set}},{key:`clearEdgeIndices`,value:function(){this.edgeDataCache={},this.edgeProgramIndex={},this.edgesWithForcedLabels=new Set,this.edgeZExtent=[1/0,-1/0]}},{key:`clearIndices`,value:function(){this.clearEdgeIndices(),this.clearNodeIndices()}},{key:`clearNodeState`,value:function(){this.displayedNodeLabels=new Set,this.highlightedNodes=new Set,this.hoveredNode=null}},{key:`clearEdgeState`,value:function(){this.displayedEdgeLabels=new Set,this.highlightedNodes=new Set,this.hoveredEdge=null}},{key:`clearState`,value:function(){this.clearEdgeState(),this.clearNodeState()}},{key:`addNodeToProgram`,value:function(e,t,n){var r=this.nodeDataCache[e],i=this.nodePrograms[r.type];if(!i)throw Error(`Sigma: could not find a suitable program for node type "${r.type}"!`);i.process(t,n,r),this.nodeProgramIndex[e]=n}},{key:`addEdgeToProgram`,value:function(e,t,n){var r=this.edgeDataCache[e],i=this.edgePrograms[r.type];if(!i)throw Error(`Sigma: could not find a suitable program for edge type "${r.type}"!`);var a=this.graph.extremities(e),o=this.nodeDataCache[a[0]],s=this.nodeDataCache[a[1]];i.process(t,n,o,s,r),this.edgeProgramIndex[e]=n}},{key:`getRenderParams`,value:function(){return{matrix:this.matrix,invMatrix:this.invMatrix,width:this.width,height:this.height,pixelRatio:this.pixelRatio,zoomRatio:this.camera.ratio,cameraAngle:this.camera.angle,sizeRatio:1/this.scaleSize(),correctionRatio:this.correctionRatio,downSizingRatio:this.pickingDownSizingRatio,minEdgeThickness:this.settings.minEdgeThickness,antiAliasingFeather:this.settings.antiAliasingFeather}}},{key:`getStagePadding`,value:function(){var e=this.settings,t=e.stagePadding;return e.autoRescale&&t||0}},{key:`createLayer`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[e])throw Error(`Sigma: a layer named "${e}" already exists`);var r=Mr(t,{position:`absolute`},{class:`sigma-${e}`});return n.style&&Object.assign(r.style,n.style),this.elements[e]=r,`beforeLayer`in n&&n.beforeLayer?this.elements[n.beforeLayer].before(r):`afterLayer`in n&&n.afterLayer?this.elements[n.afterLayer].after(r):this.container.appendChild(r),r}},{key:`createCanvas`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(e,`canvas`,t)}},{key:`createCanvasContext`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.createCanvas(e,t),r={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[e]=n.getContext(`2d`,r),this}},{key:`createWebGLContext`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t?.canvas||this.createCanvas(e,t);t.hidden&&n.remove();var r=K({preserveDrawingBuffer:!1,antialias:!1},t),i=n.getContext(`webgl2`,r);i||=n.getContext(`webgl`,r),i||=n.getContext(`experimental-webgl`,r);var a=i;if(this.webGLContexts[e]=a,a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),t.picking){this.pickingLayers.add(e);var o=a.createFramebuffer();if(!o)throw Error(`Sigma: cannot create a new frame buffer for layer ${e}`);this.frameBuffers[e]=o}return a}},{key:`killLayer`,value:function(e){var t=this.elements[e];if(!t)throw Error(`Sigma: cannot kill layer ${e}, which does not exist`);if(this.webGLContexts[e]){var n;(n=this.webGLContexts[e].getExtension(`WEBGL_lose_context`))==null||n.loseContext(),delete this.webGLContexts[e]}else this.canvasContexts[e]&&delete this.canvasContexts[e];return t.remove(),delete this.elements[e],this}},{key:`getCamera`,value:function(){return this.camera}},{key:`setCamera`,value:function(e){this.unbindCameraHandlers(),this.camera=e,this.bindCameraHandlers()}},{key:`getContainer`,value:function(){return this.container}},{key:`getGraph`,value:function(){return this.graph}},{key:`setGraph`,value:function(e){e!==this.graph&&(this.hoveredNode&&!e.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!e.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=e,this.bindGraphHandlers(),this.refresh())}},{key:`getMouseCaptor`,value:function(){return this.mouseCaptor}},{key:`getTouchCaptor`,value:function(){return this.touchCaptor}},{key:`getDimensions`,value:function(){return{width:this.width,height:this.height}}},{key:`getGraphDimensions`,value:function(){var e=this.customBBox||this.nodeExtent;return{width:e.x[1]-e.x[0]||1,height:e.y[1]-e.y[0]||1}}},{key:`getNodeDisplayData`,value:function(e){var t=this.nodeDataCache[e];return t?Object.assign({},t):void 0}},{key:`getEdgeDisplayData`,value:function(e){var t=this.edgeDataCache[e];return t?Object.assign({},t):void 0}},{key:`getNodeDisplayedLabels`,value:function(){return new Set(this.displayedNodeLabels)}},{key:`getEdgeDisplayedLabels`,value:function(){return new Set(this.displayedEdgeLabels)}},{key:`getSettings`,value:function(){return K({},this.settings)}},{key:`getSetting`,value:function(e){return this.settings[e]}},{key:`setSetting`,value:function(e,t){var n=K({},this.settings);return this.settings[e]=t,Hr(this.settings),this.handleSettingsUpdate(n),this.scheduleRefresh(),this}},{key:`updateSetting`,value:function(e,t){return this.setSetting(e,t(this.settings[e])),this}},{key:`setSettings`,value:function(e){var t=K({},this.settings);return this.settings=K(K({},this.settings),e),Hr(this.settings),this.handleSettingsUpdate(t),this.scheduleRefresh(),this}},{key:`resize`,value:function(e){var t=this.width,n=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=Nr(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw Error(`Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.`);if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw Error(`Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.`);if(!e&&t===this.width&&n===this.height)return this;for(var r in this.elements){var i=this.elements[r];i.style.width=this.width+`px`,i.style.height=this.height+`px`}for(var a in this.canvasContexts)this.elements[a].setAttribute(`width`,this.width*this.pixelRatio+`px`),this.elements[a].setAttribute(`height`,this.height*this.pixelRatio+`px`),this.pixelRatio!==1&&this.canvasContexts[a].scale(this.pixelRatio,this.pixelRatio);for(var o in this.webGLContexts){this.elements[o].setAttribute(`width`,this.width*this.pixelRatio+`px`),this.elements[o].setAttribute(`height`,this.height*this.pixelRatio+`px`);var s=this.webGLContexts[o];if(s.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(o)){var c=this.textures[o];c&&s.deleteTexture(c)}}return this.emit(`resize`),this}},{key:`clear`,value:function(){return this.emit(`beforeClear`),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit(`afterClear`),this}},{key:`refresh`,value:function(e){var t=this,n=e?.skipIndexation===void 0?!1:e?.skipIndexation,r=e?.schedule===void 0?!1:e.schedule,i=!e||!e.partialGraph;if(i)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(e){return t.addNode(e)}),this.graph.forEachEdge(function(e){return t.addEdge(e)});else{for(var a,o=e.partialGraph?.nodes||[],s=0,c=o?.length||0;s<c;s++){var l=o[s];if(this.updateNode(l),n){var u=this.nodeProgramIndex[l];if(u===void 0)throw Error(`Sigma: node "${l}" can't be repaint`);this.addNodeToProgram(l,this.nodeIndices[l],u)}}for(var d=(e==null||(a=e.partialGraph)==null?void 0:a.edges)||[],f=0,p=d.length;f<p;f++){var m=d[f];if(this.updateEdge(m),n){var h=this.edgeProgramIndex[m];if(h===void 0)throw Error(`Sigma: edge "${m}" can't be repaint`);this.addEdgeToProgram(m,this.edgeIndices[m],h)}}}return(i||!n)&&(this.needToProcess=!0),r?this.scheduleRender():this.render(),this}},{key:`scheduleRender`,value:function(){var e=this;return this.renderFrame||=requestAnimationFrame(function(){e.render()}),this}},{key:`scheduleRefresh`,value:function(e){return this.refresh(K(K({},e),{},{schedule:!0}))}},{key:`getViewportZoomedState`,value:function(e,t){var n=this.camera.getState(),r=n.ratio,i=n.angle,a=n.x,o=n.y,s=this.settings,c=s.minCameraRatio,l=s.maxCameraRatio;typeof l==`number`&&(t=Math.min(t,l)),typeof c==`number`&&(t=Math.max(t,c));var u=t/r,d={x:this.width/2,y:this.height/2},f=this.viewportToFramedGraph(e),p=this.viewportToFramedGraph(d);return{angle:i,x:(f.x-p.x)*(1-u)+a,y:(f.y-p.y)*(1-u)+o,ratio:t}}},{key:`viewRectangle`,value:function(){var e=this.viewportToFramedGraph({x:0,y:0}),t=this.viewportToFramedGraph({x:this.width,y:0}),n=this.viewportToFramedGraph({x:0,y:this.height});return{x1:e.x,y1:e.y,x2:t.x,y2:t.y,height:t.y-n.y}}},{key:`framedGraphToViewport`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=!!t.cameraState||!!t.viewportDimensions||!!t.graphDimensions,r=Er(t.matrix?t.matrix:n?Or(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding()):this.matrix,e);return{x:(1+r.x)*this.width/2,y:(1-r.y)*this.height/2}}},{key:`viewportToFramedGraph`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=!!t.cameraState||!!t.viewportDimensions||!t.graphDimensions,r=Er(t.matrix?t.matrix:n?Or(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding(),!0):this.invMatrix,{x:e.x/this.width*2-1,y:1-e.y/this.height*2});return isNaN(r.x)&&(r.x=0),isNaN(r.y)&&(r.y=0),r}},{key:`viewportToGraph`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(e,t))}},{key:`graphToViewport`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(e),t)}},{key:`getGraphToViewportRatio`,value:function(){var e={x:0,y:0},t={x:1,y:1},n=Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),r=this.graphToViewport(e),i=this.graphToViewport(t);return Math.sqrt((r.x-i.x)**2+(r.y-i.y)**2)/n}},{key:`getBBox`,value:function(){return this.nodeExtent}},{key:`getCustomBBox`,value:function(){return this.customBBox}},{key:`setCustomBBox`,value:function(e){return this.customBBox=e,this.scheduleRender(),this}},{key:`kill`,value:function(){this.emit(`kill`),this.removeAllListeners(),this.unbindCameraHandlers(),window.removeEventListener(`resize`,this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.clearIndices(),this.clearState(),this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes.clear(),this.renderFrame&&=(cancelAnimationFrame(this.renderFrame),null),this.renderHighlightedNodesFrame&&=(cancelAnimationFrame(this.renderHighlightedNodesFrame),null);for(var e=this.container;e.firstChild;)e.removeChild(e.firstChild);for(var t in this.nodePrograms)this.nodePrograms[t].kill();for(var n in this.nodeHoverPrograms)this.nodeHoverPrograms[n].kill();for(var r in this.edgePrograms)this.edgePrograms[r].kill();for(var i in this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={},this.elements)this.killLayer(i);this.canvasContexts={},this.webGLContexts={},this.elements={}}},{key:`scaleSize`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return e/this.settings.zoomToSizeRatioFunction(t)*(this.getSetting(`itemSizesReference`)===`positions`?t*this.graphToViewportRatio:1)}},{key:`getCanvases`,value:function(){var e={};for(var t in this.elements)this.elements[t]instanceof HTMLCanvasElement&&(e[t]=this.elements[t]);return e}}])}(gr),bi=o((e=>{function t(e){return typeof e!=`number`||isNaN(e)?1:e}function n(e,t){var n={},r=function(e){return e===void 0?t:e};typeof t==`function`&&(r=t);var i=function(t){return r(t[e])},a=function(){return r(void 0)};return typeof e==`string`?(n.fromAttributes=i,n.fromGraph=function(e,t){return i(e.getNodeAttributes(t))},n.fromEntry=function(e,t){return i(t)}):typeof e==`function`?(n.fromAttributes=function(){throw Error(`graphology-utils/getters/createNodeValueGetter: irrelevant usage.`)},n.fromGraph=function(t,n){return r(e(n,t.getNodeAttributes(n)))},n.fromEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=a,n.fromGraph=a,n.fromEntry=a),n}function r(e,t){var n={},r=function(e){return e===void 0?t:e};typeof t==`function`&&(r=t);var i=function(t){return r(t[e])},a=function(){return r(void 0)};return typeof e==`string`?(n.fromAttributes=i,n.fromGraph=function(e,t){return i(e.getEdgeAttributes(t))},n.fromEntry=function(e,t){return i(t)},n.fromPartialEntry=n.fromEntry,n.fromMinimalEntry=n.fromEntry):typeof e==`function`?(n.fromAttributes=function(){throw Error(`graphology-utils/getters/createEdgeValueGetter: irrelevant usage.`)},n.fromGraph=function(t,n){var i=t.extremities(n);return r(e(n,t.getEdgeAttributes(n),i[0],i[1],t.getNodeAttributes(i[0]),t.getNodeAttributes(i[1]),t.isUndirected(n)))},n.fromEntry=function(t,n,i,a,o,s,c){return r(e(t,n,i,a,o,s,c))},n.fromPartialEntry=function(t,n,i,a){return r(e(t,n,i,a))},n.fromMinimalEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=a,n.fromGraph=a,n.fromEntry=a,n.fromMinimalEntry=a),n}e.createNodeValueGetter=n,e.createEdgeValueGetter=r,e.createEdgeWeightGetter=function(e){return r(e,t)}})),xi=o(((e,t)=>{var n=0,r=1,i=2,a=3,o=4,s=5,c=6,l=7,u=8,d=9,f=0,p=1,m=2,h=0,g=1,_=2,v=3,y=4,b=5,x=6,S=7,C=8,w=3,ee=10,T=3,E=9,D=10;t.exports=function(e,t,te){var ne,O,k,A,j,re,M,N,P,ie,F=t.length,ae=te.length,I=e.adjustSizes,L=e.barnesHutTheta*e.barnesHutTheta,oe,R,z,B,se,V,H,U=[];for(k=0;k<F;k+=ee)t[k+o]=t[k+i],t[k+s]=t[k+a],t[k+i]=0,t[k+a]=0;if(e.outboundAttractionDistribution){for(oe=0,k=0;k<F;k+=ee)oe+=t[k+c];oe/=F/ee}if(e.barnesHutOptimize){var ce=1/0,le=-1/0,ue=1/0,de=-1/0,fe,pe,me;for(k=0;k<F;k+=ee)ce=Math.min(ce,t[k+n]),le=Math.max(le,t[k+n]),ue=Math.min(ue,t[k+r]),de=Math.max(de,t[k+r]);var he=le-ce,ge=de-ue;for(he>ge?(ue-=(he-ge)/2,de=ue+he):(ce-=(ge-he)/2,le=ce+ge),U[0+h]=-1,U[0+g]=(ce+le)/2,U[0+_]=(ue+de)/2,U[0+v]=Math.max(le-ce,de-ue),U[0+y]=-1,U[0+b]=-1,U[0+x]=0,U[0+S]=0,U[0+C]=0,ne=1,k=0;k<F;k+=ee)for(O=0,me=w;;)if(U[O+b]>=0){fe=t[k+n]<U[O+g]?t[k+r]<U[O+_]?U[O+b]:U[O+b]+E:t[k+r]<U[O+_]?U[O+b]+E*2:U[O+b]+E*3,U[O+S]=(U[O+S]*U[O+x]+t[k+n]*t[k+c])/(U[O+x]+t[k+c]),U[O+C]=(U[O+C]*U[O+x]+t[k+r]*t[k+c])/(U[O+x]+t[k+c]),U[O+x]+=t[k+c],O=fe;continue}else if(U[O+h]<0){U[O+h]=k;break}else{if(U[O+b]=ne*E,N=U[O+v]/2,P=U[O+b],U[P+h]=-1,U[P+g]=U[O+g]-N,U[P+_]=U[O+_]-N,U[P+v]=N,U[P+y]=P+E,U[P+b]=-1,U[P+x]=0,U[P+S]=0,U[P+C]=0,P+=E,U[P+h]=-1,U[P+g]=U[O+g]-N,U[P+_]=U[O+_]+N,U[P+v]=N,U[P+y]=P+E,U[P+b]=-1,U[P+x]=0,U[P+S]=0,U[P+C]=0,P+=E,U[P+h]=-1,U[P+g]=U[O+g]+N,U[P+_]=U[O+_]-N,U[P+v]=N,U[P+y]=P+E,U[P+b]=-1,U[P+x]=0,U[P+S]=0,U[P+C]=0,P+=E,U[P+h]=-1,U[P+g]=U[O+g]+N,U[P+_]=U[O+_]+N,U[P+v]=N,U[P+y]=U[O+y],U[P+b]=-1,U[P+x]=0,U[P+S]=0,U[P+C]=0,ne+=4,fe=t[U[O+h]+n]<U[O+g]?t[U[O+h]+r]<U[O+_]?U[O+b]:U[O+b]+E:t[U[O+h]+r]<U[O+_]?U[O+b]+E*2:U[O+b]+E*3,U[O+x]=t[U[O+h]+c],U[O+S]=t[U[O+h]+n],U[O+C]=t[U[O+h]+r],U[fe+h]=U[O+h],U[O+h]=-1,pe=t[k+n]<U[O+g]?t[k+r]<U[O+_]?U[O+b]:U[O+b]+E:t[k+r]<U[O+_]?U[O+b]+E*2:U[O+b]+E*3,fe===pe)if(me--){O=fe;continue}else{me=w;break}U[pe+h]=k;break}}if(e.barnesHutOptimize)for(R=e.scalingRatio,k=0;k<F;k+=ee)for(O=0;;)if(U[O+b]>=0)if(V=(t[k+n]-U[O+S])**2+(t[k+r]-U[O+C])**2,ie=U[O+v],4*ie*ie/V<L){if(z=t[k+n]-U[O+S],B=t[k+r]-U[O+C],I===!0?V>0?(H=R*t[k+c]*U[O+x]/V,t[k+i]+=z*H,t[k+a]+=B*H):V<0&&(H=-R*t[k+c]*U[O+x]/Math.sqrt(V),t[k+i]+=z*H,t[k+a]+=B*H):V>0&&(H=R*t[k+c]*U[O+x]/V,t[k+i]+=z*H,t[k+a]+=B*H),O=U[O+y],O<0)break;continue}else{O=U[O+b];continue}else{if(re=U[O+h],re>=0&&re!==k&&(z=t[k+n]-t[re+n],B=t[k+r]-t[re+r],V=z*z+B*B,I===!0?V>0?(H=R*t[k+c]*t[re+c]/V,t[k+i]+=z*H,t[k+a]+=B*H):V<0&&(H=-R*t[k+c]*t[re+c]/Math.sqrt(V),t[k+i]+=z*H,t[k+a]+=B*H):V>0&&(H=R*t[k+c]*t[re+c]/V,t[k+i]+=z*H,t[k+a]+=B*H)),O=U[O+y],O<0)break;continue}else for(R=e.scalingRatio,A=0;A<F;A+=ee)for(j=0;j<A;j+=ee)z=t[A+n]-t[j+n],B=t[A+r]-t[j+r],I===!0?(V=Math.sqrt(z*z+B*B)-t[A+u]-t[j+u],V>0?(H=R*t[A+c]*t[j+c]/V/V,t[A+i]+=z*H,t[A+a]+=B*H,t[j+i]-=z*H,t[j+a]-=B*H):V<0&&(H=100*R*t[A+c]*t[j+c],t[A+i]+=z*H,t[A+a]+=B*H,t[j+i]-=z*H,t[j+a]-=B*H)):(V=Math.sqrt(z*z+B*B),V>0&&(H=R*t[A+c]*t[j+c]/V/V,t[A+i]+=z*H,t[A+a]+=B*H,t[j+i]-=z*H,t[j+a]-=B*H));for(P=e.gravity/e.scalingRatio,R=e.scalingRatio,k=0;k<F;k+=ee)H=0,z=t[k+n],B=t[k+r],V=Math.sqrt(z**2+B**2),e.strongGravityMode?V>0&&(H=R*t[k+c]*P):V>0&&(H=R*t[k+c]*P/V),t[k+i]-=z*H,t[k+a]-=B*H;for(R=1*(e.outboundAttractionDistribution?oe:1),M=0;M<ae;M+=T)A=te[M+f],j=te[M+p],N=te[M+m],se=N**+e.edgeWeightInfluence,z=t[A+n]-t[j+n],B=t[A+r]-t[j+r],I===!0?(V=Math.sqrt(z*z+B*B)-t[A+u]-t[j+u],e.linLogMode?e.outboundAttractionDistribution?V>0&&(H=-R*se*Math.log(1+V)/V/t[A+c]):V>0&&(H=-R*se*Math.log(1+V)/V):e.outboundAttractionDistribution?V>0&&(H=-R*se/t[A+c]):V>0&&(H=-R*se)):(V=Math.sqrt(z**2+B**2),e.linLogMode?e.outboundAttractionDistribution?V>0&&(H=-R*se*Math.log(1+V)/V/t[A+c]):V>0&&(H=-R*se*Math.log(1+V)/V):e.outboundAttractionDistribution?(V=1,H=-R*se/t[A+c]):(V=1,H=-R*se)),V>0&&(t[A+i]+=z*H,t[A+a]+=B*H,t[j+i]-=z*H,t[j+a]-=B*H);var _e,ve,ye,be,xe,Se;if(I===!0)for(k=0;k<F;k+=ee)t[k+d]!==1&&(_e=Math.sqrt(t[k+i]**2+t[k+a]**2),_e>D&&(t[k+i]=t[k+i]*D/_e,t[k+a]=t[k+a]*D/_e),ve=t[k+c]*Math.sqrt((t[k+o]-t[k+i])*(t[k+o]-t[k+i])+(t[k+s]-t[k+a])*(t[k+s]-t[k+a])),ye=Math.sqrt((t[k+o]+t[k+i])*(t[k+o]+t[k+i])+(t[k+s]+t[k+a])*(t[k+s]+t[k+a]))/2,be=.1*Math.log(1+ye)/(1+Math.sqrt(ve)),xe=t[k+n]+t[k+i]*(be/e.slowDown),t[k+n]=xe,Se=t[k+r]+t[k+a]*(be/e.slowDown),t[k+r]=Se);else for(k=0;k<F;k+=ee)t[k+d]!==1&&(ve=t[k+c]*Math.sqrt((t[k+o]-t[k+i])*(t[k+o]-t[k+i])+(t[k+s]-t[k+a])*(t[k+s]-t[k+a])),ye=Math.sqrt((t[k+o]+t[k+i])*(t[k+o]+t[k+i])+(t[k+s]+t[k+a])*(t[k+s]+t[k+a]))/2,be=t[k+l]*Math.log(1+ye)/(1+Math.sqrt(ve)),t[k+l]=Math.min(1,Math.sqrt(be*(t[k+i]**2+t[k+a]**2)/(1+Math.sqrt(ve)))),xe=t[k+n]+t[k+i]*(be/e.slowDown),t[k+n]=xe,Se=t[k+r]+t[k+a]*(be/e.slowDown),t[k+r]=Se);return{}}})),Si=o((e=>{var t=10,n=3;e.assign=function(e){e||={};var t=Array.prototype.slice.call(arguments).slice(1),n,r,i;for(n=0,i=t.length;n<i;n++)if(t[n])for(r in t[n])e[r]=t[n][r];return e},e.validateSettings=function(e){return`linLogMode`in e&&typeof e.linLogMode!=`boolean`?{message:"the `linLogMode` setting should be a boolean."}:`outboundAttractionDistribution`in e&&typeof e.outboundAttractionDistribution!=`boolean`?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:`adjustSizes`in e&&typeof e.adjustSizes!=`boolean`?{message:"the `adjustSizes` setting should be a boolean."}:`edgeWeightInfluence`in e&&typeof e.edgeWeightInfluence!=`number`?{message:"the `edgeWeightInfluence` setting should be a number."}:`scalingRatio`in e&&!(typeof e.scalingRatio==`number`&&e.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:`strongGravityMode`in e&&typeof e.strongGravityMode!=`boolean`?{message:"the `strongGravityMode` setting should be a boolean."}:`gravity`in e&&!(typeof e.gravity==`number`&&e.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:`slowDown`in e&&!(typeof e.slowDown==`number`||e.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:`barnesHutOptimize`in e&&typeof e.barnesHutOptimize!=`boolean`?{message:"the `barnesHutOptimize` setting should be a boolean."}:`barnesHutTheta`in e&&!(typeof e.barnesHutTheta==`number`&&e.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},e.graphToByteArrays=function(e,r){var i=e.order,a=e.size,o={},s,c=new Float32Array(i*t),l=new Float32Array(a*n);return s=0,e.forEachNode(function(e,n){o[e]=s,c[s]=n.x,c[s+1]=n.y,c[s+2]=0,c[s+3]=0,c[s+4]=0,c[s+5]=0,c[s+6]=1,c[s+7]=1,c[s+8]=n.size||1,c[s+9]=+!!n.fixed,s+=t}),s=0,e.forEachEdge(function(e,t,i,a,u,d,f){var p=o[i],m=o[a],h=r(e,t,i,a,u,d,f);c[p+6]+=h,c[m+6]+=h,l[s]=p,l[s+1]=m,l[s+2]=h,s+=n}),{nodes:c,edges:l}},e.assignLayoutChanges=function(e,n,r){var i=0;e.updateEachNodeAttributes(function(e,a){return a.x=n[i],a.y=n[i+1],i+=t,r?r(e,a):a})},e.readGraphPositions=function(e,n){var r=0;e.forEachNode(function(e,i){n[r]=i.x,n[r+1]=i.y,r+=t})},e.collectLayoutChanges=function(e,n,r){for(var i=e.nodes(),a={},o=0,s=0,c=n.length;o<c;o+=t){if(r){var l=Object.assign({},e.getNodeAttributes(i[s]));l.x=n[o],l.y=n[o+1],l=r(i[s],l),a[i[s]]={x:l.x,y:l.y}}else a[i[s]]={x:n[o],y:n[o+1]};s++}return a},e.createWorker=function(e){var t=window.URL||window.webkitURL,n=e.toString(),r=t.createObjectURL(new Blob([`(`+n+`).call(this);`],{type:`text/javascript`})),i=new Worker(r);return t.revokeObjectURL(r),i}})),Ci=o(((e,t)=>{t.exports={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}})),wi=o(((e,t)=>{var n=_r(),r=bi().createEdgeWeightGetter,i=xi(),a=Si(),o=Ci();function s(e,t,s){if(!n(t))throw Error(`graphology-layout-forceatlas2: the given graph is not a valid graphology instance.`);typeof s==`number`&&(s={iterations:s});var c=s.iterations;if(typeof c!=`number`)throw Error(`graphology-layout-forceatlas2: invalid number of iterations.`);if(c<=0)throw Error(`graphology-layout-forceatlas2: you should provide a positive number of iterations.`);var l=r(`getEdgeWeight`in s?s.getEdgeWeight:`weight`).fromEntry,u=typeof s.outputReducer==`function`?s.outputReducer:null,d=a.assign({},o,s.settings),f=a.validateSettings(d);if(f)throw Error(`graphology-layout-forceatlas2: `+f.message);var p=a.graphToByteArrays(t,l),m;for(m=0;m<c;m++)i(d,p.nodes,p.edges);if(e){a.assignLayoutChanges(t,p.nodes,u);return}return a.collectLayoutChanges(t,p.nodes)}function c(e){var t=typeof e==`number`?e:e.order;return{barnesHutOptimize:t>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(t)}}var l=s.bind(null,!1);l.assign=s.bind(null,!0),l.inferSettings=c,t.exports=l})),Ti=o(((e,t)=>{t.exports=function(){var e,t,n={};(function(){var e=0,t=1,r=2,i=3,a=4,o=5,s=6,c=7,l=8,u=9,d=0,f=1,p=2,m=0,h=1,g=2,_=3,v=4,y=5,b=6,x=7,S=8,C=3,w=10,ee=3,T=9,E=10;n.exports=function(n,D,te){var ne,O,k,A,j,re,M,N,P,ie,F=D.length,ae=te.length,I=n.adjustSizes,L=n.barnesHutTheta*n.barnesHutTheta,oe,R,z,B,se,V,H,U=[];for(k=0;k<F;k+=w)D[k+a]=D[k+r],D[k+o]=D[k+i],D[k+r]=0,D[k+i]=0;if(n.outboundAttractionDistribution){for(oe=0,k=0;k<F;k+=w)oe+=D[k+s];oe/=F/w}if(n.barnesHutOptimize){var ce=1/0,le=-1/0,ue=1/0,de=-1/0,fe,pe,me;for(k=0;k<F;k+=w)ce=Math.min(ce,D[k+e]),le=Math.max(le,D[k+e]),ue=Math.min(ue,D[k+t]),de=Math.max(de,D[k+t]);var he=le-ce,ge=de-ue;for(he>ge?(ue-=(he-ge)/2,de=ue+he):(ce-=(ge-he)/2,le=ce+ge),U[0+m]=-1,U[0+h]=(ce+le)/2,U[0+g]=(ue+de)/2,U[0+_]=Math.max(le-ce,de-ue),U[0+v]=-1,U[0+y]=-1,U[0+b]=0,U[0+x]=0,U[0+S]=0,ne=1,k=0;k<F;k+=w)for(O=0,me=C;;)if(U[O+y]>=0){fe=D[k+e]<U[O+h]?D[k+t]<U[O+g]?U[O+y]:U[O+y]+T:D[k+t]<U[O+g]?U[O+y]+T*2:U[O+y]+T*3,U[O+x]=(U[O+x]*U[O+b]+D[k+e]*D[k+s])/(U[O+b]+D[k+s]),U[O+S]=(U[O+S]*U[O+b]+D[k+t]*D[k+s])/(U[O+b]+D[k+s]),U[O+b]+=D[k+s],O=fe;continue}else if(U[O+m]<0){U[O+m]=k;break}else{if(U[O+y]=ne*T,N=U[O+_]/2,P=U[O+y],U[P+m]=-1,U[P+h]=U[O+h]-N,U[P+g]=U[O+g]-N,U[P+_]=N,U[P+v]=P+T,U[P+y]=-1,U[P+b]=0,U[P+x]=0,U[P+S]=0,P+=T,U[P+m]=-1,U[P+h]=U[O+h]-N,U[P+g]=U[O+g]+N,U[P+_]=N,U[P+v]=P+T,U[P+y]=-1,U[P+b]=0,U[P+x]=0,U[P+S]=0,P+=T,U[P+m]=-1,U[P+h]=U[O+h]+N,U[P+g]=U[O+g]-N,U[P+_]=N,U[P+v]=P+T,U[P+y]=-1,U[P+b]=0,U[P+x]=0,U[P+S]=0,P+=T,U[P+m]=-1,U[P+h]=U[O+h]+N,U[P+g]=U[O+g]+N,U[P+_]=N,U[P+v]=U[O+v],U[P+y]=-1,U[P+b]=0,U[P+x]=0,U[P+S]=0,ne+=4,fe=D[U[O+m]+e]<U[O+h]?D[U[O+m]+t]<U[O+g]?U[O+y]:U[O+y]+T:D[U[O+m]+t]<U[O+g]?U[O+y]+T*2:U[O+y]+T*3,U[O+b]=D[U[O+m]+s],U[O+x]=D[U[O+m]+e],U[O+S]=D[U[O+m]+t],U[fe+m]=U[O+m],U[O+m]=-1,pe=D[k+e]<U[O+h]?D[k+t]<U[O+g]?U[O+y]:U[O+y]+T:D[k+t]<U[O+g]?U[O+y]+T*2:U[O+y]+T*3,fe===pe)if(me--){O=fe;continue}else{me=C;break}U[pe+m]=k;break}}if(n.barnesHutOptimize)for(R=n.scalingRatio,k=0;k<F;k+=w)for(O=0;;)if(U[O+y]>=0)if(V=(D[k+e]-U[O+x])**2+(D[k+t]-U[O+S])**2,ie=U[O+_],4*ie*ie/V<L){if(z=D[k+e]-U[O+x],B=D[k+t]-U[O+S],I===!0?V>0?(H=R*D[k+s]*U[O+b]/V,D[k+r]+=z*H,D[k+i]+=B*H):V<0&&(H=-R*D[k+s]*U[O+b]/Math.sqrt(V),D[k+r]+=z*H,D[k+i]+=B*H):V>0&&(H=R*D[k+s]*U[O+b]/V,D[k+r]+=z*H,D[k+i]+=B*H),O=U[O+v],O<0)break;continue}else{O=U[O+y];continue}else{if(re=U[O+m],re>=0&&re!==k&&(z=D[k+e]-D[re+e],B=D[k+t]-D[re+t],V=z*z+B*B,I===!0?V>0?(H=R*D[k+s]*D[re+s]/V,D[k+r]+=z*H,D[k+i]+=B*H):V<0&&(H=-R*D[k+s]*D[re+s]/Math.sqrt(V),D[k+r]+=z*H,D[k+i]+=B*H):V>0&&(H=R*D[k+s]*D[re+s]/V,D[k+r]+=z*H,D[k+i]+=B*H)),O=U[O+v],O<0)break;continue}else for(R=n.scalingRatio,A=0;A<F;A+=w)for(j=0;j<A;j+=w)z=D[A+e]-D[j+e],B=D[A+t]-D[j+t],I===!0?(V=Math.sqrt(z*z+B*B)-D[A+l]-D[j+l],V>0?(H=R*D[A+s]*D[j+s]/V/V,D[A+r]+=z*H,D[A+i]+=B*H,D[j+r]-=z*H,D[j+i]-=B*H):V<0&&(H=100*R*D[A+s]*D[j+s],D[A+r]+=z*H,D[A+i]+=B*H,D[j+r]-=z*H,D[j+i]-=B*H)):(V=Math.sqrt(z*z+B*B),V>0&&(H=R*D[A+s]*D[j+s]/V/V,D[A+r]+=z*H,D[A+i]+=B*H,D[j+r]-=z*H,D[j+i]-=B*H));for(P=n.gravity/n.scalingRatio,R=n.scalingRatio,k=0;k<F;k+=w)H=0,z=D[k+e],B=D[k+t],V=Math.sqrt(z**2+B**2),n.strongGravityMode?V>0&&(H=R*D[k+s]*P):V>0&&(H=R*D[k+s]*P/V),D[k+r]-=z*H,D[k+i]-=B*H;for(R=1*(n.outboundAttractionDistribution?oe:1),M=0;M<ae;M+=ee)A=te[M+d],j=te[M+f],N=te[M+p],se=N**+n.edgeWeightInfluence,z=D[A+e]-D[j+e],B=D[A+t]-D[j+t],I===!0?(V=Math.sqrt(z*z+B*B)-D[A+l]-D[j+l],n.linLogMode?n.outboundAttractionDistribution?V>0&&(H=-R*se*Math.log(1+V)/V/D[A+s]):V>0&&(H=-R*se*Math.log(1+V)/V):n.outboundAttractionDistribution?V>0&&(H=-R*se/D[A+s]):V>0&&(H=-R*se)):(V=Math.sqrt(z**2+B**2),n.linLogMode?n.outboundAttractionDistribution?V>0&&(H=-R*se*Math.log(1+V)/V/D[A+s]):V>0&&(H=-R*se*Math.log(1+V)/V):n.outboundAttractionDistribution?(V=1,H=-R*se/D[A+s]):(V=1,H=-R*se)),V>0&&(D[A+r]+=z*H,D[A+i]+=B*H,D[j+r]-=z*H,D[j+i]-=B*H);var _e,ve,ye,be,xe,Se;if(I===!0)for(k=0;k<F;k+=w)D[k+u]!==1&&(_e=Math.sqrt(D[k+r]**2+D[k+i]**2),_e>E&&(D[k+r]=D[k+r]*E/_e,D[k+i]=D[k+i]*E/_e),ve=D[k+s]*Math.sqrt((D[k+a]-D[k+r])*(D[k+a]-D[k+r])+(D[k+o]-D[k+i])*(D[k+o]-D[k+i])),ye=Math.sqrt((D[k+a]+D[k+r])*(D[k+a]+D[k+r])+(D[k+o]+D[k+i])*(D[k+o]+D[k+i]))/2,be=.1*Math.log(1+ye)/(1+Math.sqrt(ve)),xe=D[k+e]+D[k+r]*(be/n.slowDown),D[k+e]=xe,Se=D[k+t]+D[k+i]*(be/n.slowDown),D[k+t]=Se);else for(k=0;k<F;k+=w)D[k+u]!==1&&(ve=D[k+s]*Math.sqrt((D[k+a]-D[k+r])*(D[k+a]-D[k+r])+(D[k+o]-D[k+i])*(D[k+o]-D[k+i])),ye=Math.sqrt((D[k+a]+D[k+r])*(D[k+a]+D[k+r])+(D[k+o]+D[k+i])*(D[k+o]+D[k+i]))/2,be=D[k+c]*Math.log(1+ye)/(1+Math.sqrt(ve)),D[k+c]=Math.min(1,Math.sqrt(be*(D[k+r]**2+D[k+i]**2)/(1+Math.sqrt(ve)))),xe=D[k+e]+D[k+r]*(be/n.slowDown),D[k+e]=xe,Se=D[k+t]+D[k+i]*(be/n.slowDown),D[k+t]=Se);return{}}})();var r=n.exports;self.addEventListener(`message`,function(n){var i=n.data;e=new Float32Array(i.nodes),i.edges&&(t=new Float32Array(i.edges)),r(i.settings,e,t),self.postMessage({nodes:e.buffer},[e.buffer])})}})),Ei=o(((e,t)=>{var n=Ti(),r=_r(),i=bi().createEdgeWeightGetter,a=Si(),o=Ci();function s(e,t){if(t||={},!r(e))throw Error(`graphology-layout-forceatlas2/worker: the given graph is not a valid graphology instance.`);var n=i(`getEdgeWeight`in t?t.getEdgeWeight:`weight`).fromEntry,s=a.assign({},o,t.settings),c=a.validateSettings(s);if(c)throw Error(`graphology-layout-forceatlas2/worker: `+c.message);this.worker=null,this.graph=e,this.settings=s,this.getEdgeWeight=n,this.matrices=null,this.running=!1,this.killed=!1,this.outputReducer=typeof t.outputReducer==`function`?t.outputReducer:null,this.handleMessage=this.handleMessage.bind(this);var l=void 0,u=this;this.handleGraphUpdate=function(){u.worker&&u.worker.terminate(),l&&clearTimeout(l),l=setTimeout(function(){l=void 0,u.spawnWorker()},0)},e.on(`nodeAdded`,this.handleGraphUpdate),e.on(`edgeAdded`,this.handleGraphUpdate),e.on(`nodeDropped`,this.handleGraphUpdate),e.on(`edgeDropped`,this.handleGraphUpdate),this.spawnWorker()}s.prototype.isRunning=function(){return this.running},s.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=a.createWorker(n),this.worker.addEventListener(`message`,this.handleMessage),this.running&&(this.running=!1,this.start())},s.prototype.handleMessage=function(e){if(this.running){var t=new Float32Array(e.data.nodes);a.assignLayoutChanges(this.graph,t,this.outputReducer),this.outputReducer&&a.readGraphPositions(this.graph,t),this.matrices.nodes=t,this.askForIterations()}},s.prototype.askForIterations=function(e){var t=this.matrices,n={settings:this.settings,nodes:t.nodes.buffer},r=[t.nodes.buffer];return e&&(n.edges=t.edges.buffer,r.push(t.edges.buffer)),this.worker.postMessage(n,r),this},s.prototype.start=function(){if(this.killed)throw Error(`graphology-layout-forceatlas2/worker.start: layout was killed.`);return this.running?this:(this.matrices=a.graphToByteArrays(this.graph,this.getEdgeWeight),this.running=!0,this.askForIterations(!0),this)},s.prototype.stop=function(){return this.running=!1,this},s.prototype.kill=function(){if(this.killed)return this;this.running=!1,this.killed=!0,this.matrices=null,this.worker.terminate(),this.graph.removeListener(`nodeAdded`,this.handleGraphUpdate),this.graph.removeListener(`edgeAdded`,this.handleGraphUpdate),this.graph.removeListener(`nodeDropped`,this.handleGraphUpdate),this.graph.removeListener(`edgeDropped`,this.handleGraphUpdate)},t.exports=s})),q=c(wi(),1),Di=c(Ei(),1),Oi={function:`#22D3EE`,file:`#FB923C`,class:`#4ADE80`,interface:`#A78BFA`,enum:`#6366F1`,constant:`#FACC15`,type_alias:`#FB7185`,flow:`#14B8A6`,method:`#38BDF8`,constructor:`#06B6D4`,struct:`#86EFAC`,trait:`#C4B5FD`,variable:`#FDE68A`,property:`#FCA5A5`,namespace:`#818CF8`,module:`#E879F9`,route:`#F87171`,cluster:`#64748B`,directory:`#475569`},ki={contains:`#334155`,calls:`#38bdf8`,imports:`#64748b`,extends:`#4ade80`,implements:`#f97316`,has_member:`#facc15`,accesses:`#06b6d4`,overrides:`#ef4444`,belongs_to:`#475569`,step_of:`#fb923c`,handles:`#fb7185`},Ai={contains:.08,calls:.55,imports:.25,extends:.5,implements:.45,has_member:.18,accesses:.3,overrides:.45,belongs_to:.1,step_of:.35,handles:.4};function ji(e,t){return`${e}${Math.round(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,`0`)}`}function Mi(e,t){let n=new Set([e]);for(let r of t)r.source===e?n.add(r.target):r.target===e&&n.add(r.source);return n}function Ni(e,t,n){let r=t.label;if(!r)return;let i=n.labelSize??11,a=n.labelFont??`Outfit, system-ui, sans-serif`;e.font=`${n.labelWeight??`600`} ${i}px ${a}`;let o=e.measureText(r).width,s=t.size??8,c=t.x,l=t.y-s-10,u=i+10,d=o+16;e.fillStyle=`#0a0a10`,e.shadowOffsetX=0,e.shadowOffsetY=2,e.shadowBlur=12,e.shadowColor=`rgba(0,0,0,0.9)`,e.beginPath(),e.roundRect(c-d/2,l-u/2,d,u,4),e.fill(),e.shadowBlur=0,e.strokeStyle=t.color??`#7c3aed`,e.lineWidth=1.5,e.stroke(),e.fillStyle=`#f5f5f7`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(r,c,l),e.beginPath(),e.arc(t.x,t.y,s+4,0,Math.PI*2),e.strokeStyle=t.color??`#7c3aed`,e.lineWidth=2,e.globalAlpha=.5,e.stroke(),e.globalAlpha=1,e.shadowBlur=0}function Pi(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:{r:100,g:100,b:100}}function Fi(e,t,n){return`#`+[e,t,n].map(e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`)).join(``)}function Ii(e,t){let n=Pi(e),r={r:10,g:10,b:16};return Fi(r.r+(n.r-r.r)*t,r.g+(n.g-r.g)*t,r.b+(n.b-r.b)*t)}var Li=e=>({gravity:e<500?.8:e<2e3?.5:.3,scalingRatio:e<500?15:e<2e3?30:60,slowDown:e<500?1:e<2e3?2:3,barnesHutOptimize:e>200,barnesHutTheta:e>=2e3?.8:.6,strongGravityMode:!1,outboundAttractionDistribution:!0,linLogMode:!1,adjustSizes:!0,edgeWeightInfluence:1}),Ri=e=>e>1e4?45e3:e>5e3?35e3:e>2e3?3e4:e>1e3?25e3:2e4;function zi(e,t){let n=new Map,r=new Map;for(let e of t)(e.kind===`contains`||e.kind===`has_member`||e.kind===`belongs_to`)&&(n.set(e.target,e.source),r.has(e.source)||r.set(e.source,[]),r.get(e.source).push(e.target));let i=e.length,a=new Set([`file`,`module`,`namespace`,`class`,`struct`,`cluster`,`directory`]),o=e.filter(e=>a.has(e.kind)),s=e.filter(e=>!a.has(e.kind)),c=Math.sqrt(i)*40,l=Math.sqrt(i)*3,u=Math.PI*(3-Math.sqrt(5)),d=new Map;o.forEach((e,t)=>{let n=t*u,r=c*Math.sqrt((t+1)/Math.max(o.length,1)),i=c*.15;d.set(e.id,{x:r*Math.cos(n)+(Math.random()-.5)*i,y:r*Math.sin(n)+(Math.random()-.5)*i})});let f=e=>{if(d.has(e))return;let t=d.get(n.get(e)??``);t?d.set(e,{x:t.x+(Math.random()-.5)*l,y:t.y+(Math.random()-.5)*l}):d.set(e,{x:(Math.random()-.5)*c*.5,y:(Math.random()-.5)*c*.5})},p=o.map(e=>e.id),m=new Set(p);for(;p.length>0;){let e=p.shift();for(let t of r.get(e)??[])m.has(t)||(m.add(t),f(t),p.push(t))}for(let e of s)f(e.id);for(let t of e)f(t.id);return d}function Bi(e){return{cluster:12,directory:10,module:10,namespace:10,file:7,class:8,struct:8,interface:7,trait:7,function:4,enum:5,route:5,method:3,constructor:3,type_alias:3,flow:3,constant:2,variable:2,property:2}[e]??3}function Vi(e){return{cluster:50,directory:20,module:20,namespace:15,file:10,class:8,struct:8,interface:6,trait:6,function:2,method:2,enum:3,route:3,constructor:1,type_alias:1,constant:1,variable:1,property:1}[e]??1}function Hi(){let{state:e,dispatch:t}=T(),n=(0,b.useRef)(e);n.current=e;let r=(0,b.useRef)(t);r.current=t;let i=(0,b.useRef)(new W({multi:!1,type:`directed`})),a=(0,b.useRef)(null),o=(0,b.useRef)(null),s=(0,b.useRef)(null),c=(0,b.useRef)(null),l=(0,b.useRef)(null),[u,d]=(0,b.useState)({nodes:0,edges:0}),[f,p]=(0,b.useState)(!1),m=(0,b.useRef)({nodeCount:-1,edgeCount:-1}),h=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(cancelAnimationFrame(l.current),null),s.current&&=(s.current.stop(),null),p(!1)},g=e=>{if(h(),e.order===0)return;let t=new Di.default(e,{settings:{...q.default.inferSettings(e),...Li(e.order)}});s.current=t,t.start(),p(!0);let n=()=>{s.current&&(a.current?.refresh(),l.current=requestAnimationFrame(n))};l.current=requestAnimationFrame(n),c.current=setTimeout(()=>{t.stop(),s.current=null,l.current&&=(cancelAnimationFrame(l.current),null),p(!1),a.current?.refresh()},Ri(e.order))};return(0,b.useEffect)(()=>{if(e.nodes.length===0||m.current.nodeCount===e.nodes.length&&m.current.edgeCount===e.edges.length)return;m.current={nodeCount:e.nodes.length,edgeCount:e.edges.length};let t=i.current;h(),t.clear();let r=zi(e.nodes,e.edges);for(let n of e.nodes){let e=r.get(n.id)??{x:(Math.random()-.5)*500,y:(Math.random()-.5)*500};try{t.addNode(n.id,{label:n.name,baseLabel:n.name,x:e.x,y:e.y,size:Bi(n.kind),color:Oi[n.kind]??`#6b7280`,nodeKind:n.kind,mass:Vi(n.kind)})}catch{}}for(let n of e.edges)if(!(!t.hasNode(n.source)||!t.hasNode(n.target)||n.source===n.target))try{let e=ji(ki[n.kind]??`#4b5563`,Ai[n.kind]??.25);t.addEdge(n.source,n.target,{color:e,baseColor:e,size:n.kind===`calls`?.8:n.kind===`imports`?.5:.4,type:`arrow`,edgeKind:n.kind})}catch{}let o=new Map;t.forEachNode(e=>o.set(e,t.degree(e)));let s=[...o.values()].sort((e,t)=>t-e);if(t._degreeMap=o,t._topNThreshold=s[Math.min(30,s.length-1)]??0,a.current){Ui(a.current,t,n.current,null,null),a.current.refresh(),a.current.getCamera().animatedReset({duration:500});let e=0,r=0;t.forEachNode((t,n)=>{n.hidden||e++}),t.forEachEdge((e,t)=>{t.hidden||r++}),d({nodes:e,edges:r})}g(t)},[e.nodes,e.edges]),(0,b.useEffect)(()=>{if(!o.current||a.current)return;let e=i.current,t=new yi(e,o.current,{allowInvalidContainer:!0,renderEdgeLabels:!1,defaultEdgeType:`arrow`,labelRenderedSizeThreshold:4,labelFont:`"Outfit", "Inter", system-ui, sans-serif`,labelColor:{color:`#e4e4ed`},labelSize:11,labelWeight:`600`,labelDensity:.15,labelGridCellSize:80,defaultDrawNodeHover:Ni,hideEdgesOnMove:!0,zIndex:!0,minCameraRatio:.002,maxCameraRatio:50});a.current=t,Ui(t,e,n.current,null,null),t.refresh(),o.current&&(o.current.style.cursor=`grab`);let u=!1;t.on(`clickNode`,({node:e})=>{u=!0;let t=n.current.nodes.find(t=>t.id===e);t&&r.current({type:`SELECT_NODE`,node:t}),setTimeout(()=>{u=!1},50)}),t.on(`clickStage`,()=>{u||r.current({type:`SELECT_NODE`,node:null})}),t.on(`enterNode`,({node:e})=>{r.current({type:`HOVER_NODE`,nodeId:e}),o.current&&(o.current.style.cursor=`pointer`)}),t.on(`leaveNode`,()=>{r.current({type:`HOVER_NODE`,nodeId:null}),o.current&&(o.current.style.cursor=`grab`)});let d=e=>{let n=e.detail,r=t.getCamera();n===0?r.animatedReset():r.animate({ratio:r.getState().ratio*n},{duration:200})};return window.addEventListener(`graph-zoom`,d),()=>{window.removeEventListener(`graph-zoom`,d),c.current&&=(clearTimeout(c.current),null),l.current&&=(cancelAnimationFrame(l.current),null),s.current&&=(s.current.stop(),null),t.kill(),a.current=null}},[]),(0,b.useEffect)(()=>{let t=a.current;if(!t)return;Ui(t,i.current,e,e.hoveredNodeId,e.selectedNode?.id??null),t.refresh();let n=0,r=0;i.current.forEachNode((e,t)=>{t.hidden||n++}),i.current.forEachEdge((e,t)=>{t.hidden||r++}),d({nodes:n,edges:r})},[e.filters,e.hoveredNodeId,e.selectedNode]),(0,b.useEffect)(()=>{let t=a.current;if(!t||!e.selectedNode)return;let n=t.getNodeDisplayData(e.selectedNode.id);n&&t.getCamera().animate({x:n.x,y:n.y,ratio:Math.min(t.getCamera().getState().ratio,.5)},{duration:400,easing:`quadraticInOut`})},[e.selectedNode?.id]),(0,x.jsxs)(`div`,{className:`relative w-full h-full bg-void`,children:[(0,x.jsx)(`div`,{className:`pointer-events-none absolute inset-0`,style:{background:`radial-gradient(circle at 50% 50%, rgba(124,58,237,0.04) 0%, transparent 70%)`}}),(0,x.jsx)(`div`,{ref:o,className:`absolute inset-0`}),(0,x.jsxs)(`div`,{className:`absolute top-3 left-3 flex items-center gap-2 bg-deep/90 backdrop-blur border border-border-subtle rounded-lg px-3 py-1.5 text-[10px] text-text-muted font-mono pointer-events-none shadow-lg`,children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-node-function animate-pulse`}),(0,x.jsx)(`span`,{className:`text-text-secondary`,children:u.nodes}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:`nodes`}),(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),(0,x.jsx)(`span`,{className:`text-text-secondary`,children:u.edges}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:`edges`})]}),f&&(0,x.jsxs)(`div`,{className:`absolute bottom-14 left-1/2 -translate-x-1/2 z-10 flex items-center gap-2 bg-accent/20 border border-accent/30 rounded-full px-3 py-1.5 backdrop-blur-sm pointer-events-none animate-fade-in`,children:[(0,x.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-accent animate-ping`}),(0,x.jsx)(`span`,{className:`text-xs font-medium text-accent`,children:`Layout optimizing…`})]}),(0,x.jsx)(Gi,{}),(0,x.jsx)(Ki,{isLayoutRunning:f,onToggleLayout:()=>{f?h():g(i.current)}})]})}function Ui(e,t,n,r,i){let a=t._topNThreshold??0,o=t._degreeMap??new Map,s=r??i,c=s?Mi(s,n.edges):null,l=n.filters.hiddenNodeKinds,u=n.filters.hiddenEdgeKinds,d=null;i&&n.filters.focusDepth!==`all`&&typeof n.filters.focusDepth==`number`&&(d=Wi(i,n.edges,n.filters.focusDepth)),e.setSetting(`nodeReducer`,(e,t)=>{let n=t.nodeKind;if(l.has(n)||d&&!d.has(e))return{...t,hidden:!0};let r=Oi[n]??t.color,i=(o.get(e)??0)>=a?t.baseLabel??t.label:``;return c?c.has(e)?{...t,hidden:!1,color:r,label:t.baseLabel??t.label,zIndex:2,size:e===s?(t.size??5)*1.8:(t.size??5)*1.1,highlighted:e===s}:{...t,hidden:!1,color:Ii(r,.12),label:``,zIndex:0,size:(t.size??3)*.5}:{...t,hidden:!1,color:r,label:i}}),e.setSetting(`edgeReducer`,(n,r)=>{let i=r.edgeKind,a=e.getGraph().extremities(n),o=t.getNodeAttribute(a[0],`nodeKind`),s=t.getNodeAttribute(a[1],`nodeKind`);return u.has(i)||l.has(o)||l.has(s)||d&&(!d.has(a[0])||!d.has(a[1]))?{...r,hidden:!0}:c?c.has(a[0])&&c.has(a[1])?{...r,hidden:!1,color:ji(ki[i]??`#9ca3af`,.95),size:1.5,zIndex:1}:{...r,hidden:!1,color:`#1e1e2a40`,size:.3,zIndex:0}:{...r,hidden:!1,color:r.baseColor??r.color}})}function Wi(e,t,n){let r=new Set([e]),i=new Map;for(let e of t)(i.get(e.source)??(i.set(e.source,[]),i.get(e.source))).push(e.target),(i.get(e.target)??(i.set(e.target,[]),i.get(e.target))).push(e.source);let a=[{id:e,depth:0}];for(;a.length>0;){let{id:e,depth:t}=a.shift();if(!(t>=n))for(let n of i.get(e)??[])r.has(n)||(r.add(n),a.push({id:n,depth:t+1}))}return r}function Gi(){let[e,t]=b.useState(!0);return(0,x.jsxs)(`div`,{className:`absolute bottom-3 right-14 bg-deep/90 backdrop-blur border border-border-subtle rounded-lg shadow-xl overflow-hidden`,children:[(0,x.jsxs)(`button`,{onClick:()=>t(e=>!e),className:`flex items-center gap-2 px-3 py-1.5 text-[10px] text-text-muted hover:text-text-secondary w-full transition`,children:[(0,x.jsx)(`span`,{children:`◉`}),(0,x.jsx)(`span`,{className:`font-medium`,children:`Legend`}),(0,x.jsx)(`span`,{className:`ml-auto`,children:e?`▸`:`▾`})]}),!e&&(0,x.jsxs)(`div`,{className:`px-3 pb-2.5 space-y-1`,children:[[`function`,`class`,`interface`,`file`,`method`,`enum`].map(e=>(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-text-muted`,children:[(0,x.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:Oi[e]}}),(0,x.jsx)(`span`,{className:`capitalize`,children:e})]},e)),(0,x.jsx)(`div`,{className:`border-t border-border-subtle mt-1 pt-1 space-y-1`,children:[`calls`,`imports`,`extends`].map(e=>(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-text-muted`,children:[(0,x.jsx)(`span`,{className:`w-4 h-px flex-shrink-0`,style:{backgroundColor:ki[e]}}),(0,x.jsx)(`span`,{children:e})]},e))})]})]})}function Ki({isLayoutRunning:e,onToggleLayout:t}){let n=e=>window.dispatchEvent(new CustomEvent(`graph-zoom`,{detail:e}));return(0,x.jsxs)(`div`,{className:`absolute bottom-3 right-3 flex flex-col gap-1 bg-deep/90 backdrop-blur border border-border-subtle rounded-lg p-1 shadow-lg`,children:[(0,x.jsx)(`button`,{className:`w-8 h-8 flex items-center justify-center text-text-secondary hover:bg-hover hover:text-text-primary rounded text-sm font-bold transition`,onClick:()=>n(.7),title:`Zoom in`,children:`+`}),(0,x.jsx)(`button`,{className:`w-8 h-8 flex items-center justify-center text-text-secondary hover:bg-hover hover:text-text-primary rounded text-sm font-bold transition`,onClick:()=>n(1.4),title:`Zoom out`,children:`−`}),(0,x.jsx)(`div`,{className:`h-px bg-border-subtle mx-1`}),(0,x.jsx)(`button`,{className:`w-8 h-8 flex items-center justify-center text-text-muted hover:bg-hover hover:text-text-primary rounded text-xs transition`,onClick:()=>n(0),title:`Fit to view`,children:`⌖`}),(0,x.jsx)(`div`,{className:`h-px bg-border-subtle mx-1`}),(0,x.jsx)(`button`,{className:`w-8 h-8 flex items-center justify-center rounded text-xs transition ${e?`text-accent bg-accent/10 border border-accent/40 animate-pulse`:`text-text-muted hover:bg-hover hover:text-text-primary border border-transparent`}`,onClick:t,title:e?`Stop layout`:`Restart layout`,children:e?`⏸`:`⏵`})]})}function qi({node:e,onClose:t}){let{state:n,dispatch:r}=T(),[i,a]=(0,b.useState)(null),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(!1),[f,p]=(0,b.useState)(`overview`);(0,b.useEffect)(()=>{let t=!1;return a(null),s(null),l(!0),new E(n.serverUrl).inspectNode(e.id,n.repoName||void 0).then(e=>{t||a(e)}).catch(()=>void 0).finally(()=>{t||l(!1)}),()=>{t=!0}},[e.id,n.serverUrl]);let m=async()=>{if(!(o||u)){d(!0);try{s(await new E(n.serverUrl).blastRadius(e.id,`both`,3,n.repoName||void 0))}catch{}finally{d(!1)}}};(0,b.useEffect)(()=>{f===`impact`&&m()},[f]);let h=e=>{if(!e)return;let t=n.nodes.find(t=>t.id===e);t&&r({type:`SELECT_NODE`,node:t})},g=({kind:e,name:t,id:n,depth:r})=>(0,x.jsxs)(`button`,{onClick:()=>h(n),className:`inline-flex items-center gap-1.5 border rounded px-2 py-0.5 text-xs text-text-secondary max-w-full truncate hover:brightness-125 transition ${r===1?`border-red-700/50 bg-red-900/20`:r===2?`border-amber-700/50 bg-amber-900/20`:`border-border-default bg-elevated`}`,title:n,children:[e&&(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0`,style:{backgroundColor:Oi[e]??`#666`}}),(0,x.jsx)(`span`,{className:`truncate`,children:t??`(unknown)`}),r!=null&&(0,x.jsxs)(`span`,{className:`text-[9px] text-text-muted ml-0.5`,children:[`d`,r]})]}),_=[`overview`,`connections`,`impact`,`source`],v=i?i.callers.length+i.callees.length+i.imports.length:0,y=o?.affectedCount??0;return(0,x.jsxs)(`div`,{className:`h-72 bg-deep border-t border-border-subtle flex flex-col overflow-hidden shadow-2xl shrink-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-b border-border-subtle bg-surface`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,x.jsx)(`span`,{className:`w-3 h-3 rounded-full flex-shrink-0 ring-2 ring-offset-1 ring-offset-surface`,style:{backgroundColor:Oi[e.kind]??`#666`}}),(0,x.jsx)(`h3`,{className:`font-semibold text-text-primary truncate`,children:e.name}),(0,x.jsx)(`span`,{className:`text-[10px] uppercase bg-elevated text-text-muted px-1.5 py-0.5 rounded font-mono border border-border-subtle`,children:e.kind}),e.exported&&(0,x.jsx)(`span`,{className:`text-[10px] bg-node-function/10 text-node-function px-1.5 py-0.5 rounded border border-node-function/30`,children:`exported`}),i?.callers&&i.callers.length===0&&[`function`,`method`].includes(e.kind)&&(0,x.jsx)(`span`,{className:`text-[10px] bg-accent/10 text-accent px-1.5 py-0.5 rounded border border-accent/30`,children:`entry point`})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted font-mono mr-2`,children:e.filePath?.split(`/`).slice(-2).join(`/`)}),(0,x.jsx)(`button`,{onClick:t,className:`text-text-muted hover:text-text-primary text-lg px-2 transition leading-none`,children:`×`})]})]}),(0,x.jsx)(`div`,{className:`flex border-b border-border-subtle px-2 bg-deep`,children:_.map(e=>(0,x.jsxs)(`button`,{onClick:()=>p(e),className:`px-3 py-1.5 text-xs capitalize font-medium transition relative ${f===e?`text-accent border-b-2 border-accent bg-accent/5`:`text-text-muted hover:text-text-secondary`}`,children:[e,e===`connections`&&v>0&&(0,x.jsx)(`span`,{className:`ml-1 text-[9px] text-text-muted bg-elevated px-1 rounded-full`,children:v}),e===`impact`&&y>0&&(0,x.jsx)(`span`,{className:`ml-1 text-[9px] px-1 rounded-full ${y>10?`text-red-300 bg-red-900/40`:`text-amber-300 bg-amber-900/30`}`,children:y})]},e))}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto scrollbar-thin px-4 py-3 text-sm`,children:[f===`overview`&&(0,x.jsxs)(`div`,{className:`space-y-3`,children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-2 text-xs`,children:[(0,x.jsx)(Ji,{label:`File`,value:e.filePath??`—`,mono:!0}),(0,x.jsx)(Ji,{label:`Lines`,value:e.startLine?`${e.startLine}${e.endLine?`–${e.endLine}`:``}`:`—`}),i?.cluster&&(0,x.jsx)(Ji,{label:`Cluster`,value:i.cluster}),(0,x.jsx)(Ji,{label:`ID`,value:e.id,mono:!0,tiny:!0})]}),i&&(0,x.jsxs)(`div`,{className:`flex gap-2 flex-wrap`,children:[[{label:`Callers`,count:i.callers.length,color:`text-red-400`,bg:`bg-red-900/20 border-red-800/40`},{label:`Callees`,count:i.callees.length,color:`text-accent`,bg:`bg-accent/10 border-accent/30`},{label:`Imports`,count:i.imports.length,color:`text-node-interface`,bg:`bg-node-interface/10 border-node-interface/30`},{label:`Members`,count:i.members.length,color:`text-node-function`,bg:`bg-node-function/10 border-node-function/30`}].filter(e=>e.count>0).map(e=>(0,x.jsxs)(`button`,{onClick:()=>p(`connections`),className:`flex items-center gap-1.5 text-[11px] border rounded px-2 py-1 ${e.bg} transition hover:brightness-125`,children:[(0,x.jsx)(`span`,{className:`font-bold ${e.color}`,children:e.count}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:e.label})]},e.label)),(0,x.jsxs)(`button`,{onClick:()=>p(`impact`),className:`flex items-center gap-1.5 text-[11px] border rounded px-2 py-1 bg-amber-900/20 border-amber-800/40 transition hover:brightness-125`,children:[(0,x.jsx)(`span`,{className:`font-bold text-amber-400`,children:`⚡`}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Impact`})]})]}),!!e.metadata?.signature&&(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{className:`text-text-muted text-[10px] uppercase mb-1`,children:`Signature`}),(0,x.jsx)(`pre`,{className:`text-xs text-accent bg-void rounded p-2 overflow-x-auto border border-border-subtle`,children:String(e.metadata?.signature)})]})]}),f===`connections`&&(0,x.jsxs)(`div`,{className:`space-y-3`,children:[c&&(0,x.jsx)(`p`,{className:`text-text-muted text-xs animate-pulse`,children:`Loading connections…`}),i&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Yi,{label:`Callers`,hint:`Functions that call this`,accent:`text-red-400`,items:i.callers.map(e=>({id:e.id,name:e.name,kind:`function`})),Pill:g}),(0,x.jsx)(Yi,{label:`Callees`,hint:`Functions called by this`,accent:`text-accent`,items:i.callees.map(e=>({id:e.id,name:e.name,kind:`function`})),Pill:g}),(0,x.jsx)(Yi,{label:`Imports`,items:i.imports.map(e=>({id:e.id,name:e.name,kind:`module`})),Pill:g}),(0,x.jsx)(Yi,{label:`Imported By`,items:i.importedBy.map(e=>({id:e.id,name:e.name,kind:`module`})),Pill:g}),(0,x.jsx)(Yi,{label:`Extends`,items:i.extends.map(e=>({id:e.id,name:e.name,kind:`class`})),Pill:g}),(0,x.jsx)(Yi,{label:`Implements`,items:i.implementsEdges.map(e=>({id:e.id,name:e.name,kind:`interface`})),Pill:g}),(0,x.jsx)(Yi,{label:`Members`,items:i.members.map(e=>({id:e.id,name:e.name,kind:e.kind})),Pill:g})]}),i&&v===0&&(0,x.jsx)(`p`,{className:`text-text-muted text-xs italic`,children:`No connections recorded.`})]}),f===`impact`&&(0,x.jsxs)(`div`,{className:`space-y-3`,children:[u&&(0,x.jsx)(`p`,{className:`text-text-muted text-xs animate-pulse`,children:`Calculating blast radius…`}),!u&&!o&&(0,x.jsx)(`p`,{className:`text-text-muted text-xs italic`,children:`No impact data.`}),o&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,x.jsx)(`div`,{className:`text-2xl font-bold font-mono ${o.affectedCount>10?`text-red-400`:o.affectedCount>5?`text-amber-400`:`text-node-function`}`,children:o.affectedCount}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{className:`text-xs text-text-secondary`,children:`affected symbols`}),(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted`,children:o.affectedCount>10?`⚠ HIGH blast radius`:o.affectedCount>5?`⚡ MEDIUM blast radius`:`✓ LOW blast radius`})]})]}),[1,2,3].map(e=>{let t=o.affected.filter(t=>t.depth===e);return t.length===0?null:(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,x.jsxs)(`span`,{className:`text-[10px] font-bold uppercase tracking-wider ${e===1?`text-red-400`:e===2?`text-amber-400`:`text-text-muted`}`,children:[`d=`,e,` `,e===1?`· WILL BREAK`:e===2?`· LIKELY AFFECTED`:`· MAY NEED TESTING`]}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted`,children:t.length})]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[t.slice(0,20).map((t,n)=>(0,x.jsx)(g,{id:t.id,name:t.name,kind:t.kind,depth:e},`${t.id}-${n}`)),t.length>20&&(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted self-center`,children:[`+`,t.length-20]})]})]},e)})]})]}),f===`source`&&(0,x.jsx)(`div`,{children:e.content?(0,x.jsx)(`pre`,{className:`text-xs text-text-secondary bg-void rounded p-3 overflow-x-auto border border-border-subtle leading-relaxed`,children:(0,x.jsx)(`code`,{children:e.content})}):(0,x.jsx)(`p`,{className:`text-text-muted text-xs italic`,children:`No source preview available.`})})]})]})}function Ji({label:e,value:t,mono:n,tiny:r}){return(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`p`,{className:`text-text-muted text-[10px] uppercase mb-0.5`,children:e}),(0,x.jsx)(`p`,{className:`text-text-secondary truncate ${n?`font-mono`:``} ${r?`text-[10px]`:`text-xs`}`,title:t,children:t})]})}function Yi({label:e,hint:t,accent:n=`text-text-muted`,items:r,Pill:i}){return r.length===0?null:(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex items-baseline gap-2 mb-1.5`,children:[(0,x.jsx)(`h4`,{className:`text-[10px] font-bold uppercase tracking-wider ${n}`,children:e}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted bg-elevated px-1 rounded-full`,children:r.length}),t&&(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted/50`,children:[`— `,t]})]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[r.slice(0,50).map((e,t)=>(0,x.jsx)(i,{...e},`${e.id}-${t}`)),r.length>50&&(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted self-center`,children:[`+`,r.length-50,` more`]})]})]})}var Xi=`modulepreload`,Zi=function(e){return`/`+e},Qi={},$i=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Zi(t,n),t in Qi)return;Qi[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Xi,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ea=null;async function ta(){if(ea)return ea;try{return ea=(await $i(()=>import(`./es-DIfCC5I3.js`),[])).default,ea}catch{return null}}var na=`code-intel:source-panel-size`,ra=420;function ia({file:e,startLine:t,endLine:n,repo:r,onClose:i}){let{state:a}=T(),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)(null),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(()=>{try{let e=localStorage.getItem(na);return e?parseInt(e,10):ra}catch{return ra}}),v=(0,b.useRef)(!1),y=(0,b.useRef)(0),S=(0,b.useRef)(0),C=e=>{v.current=!0,y.current=e.clientY,S.current=g,e.preventDefault()};(0,b.useEffect)(()=>{let e=e=>{if(!v.current)return;let t=y.current-e.clientY;_(Math.max(180,Math.min(800,S.current+t)))},t=()=>{if(v.current){v.current=!1;try{localStorage.setItem(na,String(g))}catch{}}};return window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,t)}},[g]),(0,b.useEffect)(()=>{let i=!1;return s(null),p(null),d(null),l(!0),new E(a.serverUrl).sourcePreview(e,t,n,r).then(async e=>{if(i)return;s(e);let t=await ta();if(!i&&t)try{let n=t.getLanguage(e.language)?e.language:`plaintext`;p(t.highlight(e.content,{language:n}).value)}catch{p(null)}}).catch(e=>{i||d(e instanceof Error?e.message:`Failed to load source`)}).finally(()=>{i||l(!1)}),()=>{i=!0}},[e,t,n,a.serverUrl]);let w=(0,b.useCallback)(async()=>{try{await navigator.clipboard.writeText(`${e}:${t}`),h(!0),setTimeout(()=>h(!1),2e3)}catch{}},[e,t]),ee=e.split(`/`).slice(-3).join(`/`);return(0,x.jsxs)(`div`,{className:`bg-deep border-t border-border-subtle flex flex-col overflow-hidden shadow-2xl shrink-0`,style:{height:g},children:[(0,x.jsx)(`div`,{className:`h-1 cursor-row-resize bg-border-subtle hover:bg-accent/50 transition-colors flex-shrink-0`,onMouseDown:C,title:`Drag to resize`}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-b border-border-subtle bg-surface flex-shrink-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,x.jsx)(`span`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase`,children:`Source`}),(0,x.jsx)(`span`,{className:`text-xs text-text-secondary font-mono truncate`,title:e,children:ee}),(o||c)&&(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted font-mono`,children:[`:`,t,n===t?``:`–${n}`]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[(0,x.jsx)(`a`,{href:`vscode://file/${e}:${t}`,className:`text-[10px] text-text-muted hover:text-text-primary border border-border-subtle hover:border-border-default rounded px-2 py-0.5 transition font-mono`,title:`Open in VS Code`,children:`⎈ VS Code`}),(0,x.jsx)(`button`,{onClick:w,className:`text-[10px] border rounded px-2 py-0.5 transition font-mono ${m?`text-node-function border-node-function/30 bg-node-function/10`:`text-text-muted hover:text-text-primary border-border-subtle hover:border-border-default`}`,title:`Copy ${e}:${t} to clipboard`,children:m?`✓ copied`:`⎘ copy`}),(0,x.jsx)(`button`,{onClick:i,className:`text-text-muted hover:text-text-primary text-lg px-2 transition leading-none ml-1`,children:`×`})]})]}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-auto scrollbar-thin`,children:[c&&(0,x.jsx)(aa,{}),u&&(0,x.jsx)(`div`,{className:`p-4`,children:(0,x.jsxs)(`div`,{className:`flex items-center gap-2 bg-red-900/20 border border-red-800/40 rounded-lg px-3 py-2`,children:[(0,x.jsx)(`span`,{className:`text-red-400 text-sm`,children:`⚠`}),(0,x.jsx)(`span`,{className:`text-red-300 text-xs`,children:u})]})}),o&&!c&&(0,x.jsx)(oa,{data:o,highlightedHtml:f,focusStartLine:t,focusEndLine:n})]})]})}function aa(){return(0,x.jsx)(`div`,{className:`p-4 space-y-1.5 animate-pulse`,children:Array.from({length:12}).map((e,t)=>(0,x.jsxs)(`div`,{className:`flex gap-4`,children:[(0,x.jsx)(`div`,{className:`w-8 h-3 bg-elevated rounded flex-shrink-0`}),(0,x.jsx)(`div`,{className:`h-3 bg-elevated rounded`,style:{width:`${40+Math.random()*50}%`}})]},t))})}function oa({data:e,highlightedHtml:t,focusStartLine:n,focusEndLine:r}){let i=e.content.split(`
326
- `),a=t?t.split(`
327
- `):null;return(0,x.jsxs)(`div`,{className:`relative`,children:[(0,x.jsx)(ca,{}),(0,x.jsx)(`table`,{className:`w-full text-xs font-mono border-collapse`,children:(0,x.jsx)(`tbody`,{children:i.map((t,i)=>{let o=e.startLine+i,s=o>=n&&o<=r,c=a?a[i]??``:null;return(0,x.jsxs)(`tr`,{className:s?`bg-accent/10`:`hover:bg-elevated/50`,children:[(0,x.jsx)(`td`,{className:`select-none w-10 text-right pr-3 pl-2 py-0.5 border-r text-[10px] align-top flex-shrink-0 ${s?`text-accent border-accent/30 bg-accent/15`:`text-text-muted/40 border-border-subtle`}`,style:{userSelect:`none`,minWidth:`2.5rem`},children:o}),(0,x.jsx)(`td`,{className:`pl-4 pr-4 py-0.5 whitespace-pre align-top leading-5`,style:{color:s&&!c?`#a78bfa`:void 0},children:c===null?(0,x.jsx)(`span`,{className:s?`text-node-interface`:`text-text-secondary`,children:t||` `}):(0,x.jsx)(`span`,{dangerouslySetInnerHTML:{__html:c||` `}})})]},o)})})})]})}var sa=!1;function ca(){return(0,b.useEffect)(()=>{if(sa)return;sa=!0;let e=document.createElement(`style`);e.textContent=`
328
- .hljs { color: #e4e4ed; }
329
- .hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-literal, .hljs-type { color: #a78bfa; }
330
- .hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string { color: #4ade80; }
331
- .hljs-comment, .hljs-quote { color: #5a5a70; font-style: italic; }
332
- .hljs-number, .hljs-bullet, .hljs-link, .hljs-meta { color: #fbbf24; }
333
- .hljs-title, .hljs-class .hljs-title, .hljs-function .hljs-title { color: #22d3ee; }
334
- .hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-tag, .hljs-name,
335
- .hljs-selector-id, .hljs-selector-class, .hljs-regexp, .hljs-deletion { color: #f87171; }
336
- .hljs-params { color: #e4e4ed; }
337
- .hljs-emphasis { font-style: italic; }
338
- .hljs-strong { font-weight: bold; }
339
- `,document.head.appendChild(e)},[]),null}function la(e){let t=e.toLowerCase().trim();if(/(overview|architecture|describe.*(code|repo|project)|high.?level|summary of)/.test(t))return{kind:`overview`};let n=t.match(/(impact|blast.?radius|what.*depends.*on|breaks if|affected by)\s+(\w[\w./_-]*)/);if(n)return{kind:`impact`,target:n[2]};let r=t.match(/(who calls|callers of|invocations of)\s+(\w[\w./_-]*)/);if(r)return{kind:`callers`,target:r[2]};let i=t.match(/(callees of|what does\s+\w[\w./_-]*\s+call|methods called by)\s+(\w[\w./_-]*)/);if(i)return{kind:`callees`,target:i[2]};let a=t.match(/(explain|describe|inspect|tell me about)\s+(\w[\w./_-]*)/);if(a)return{kind:`inspect`,target:a[2]};let o=t.match(/^(grep|search text|find string)\s+(.+)$/);return o?{kind:`grep`,target:o[2]}:{kind:`find`}}function ua(e){return{filePath:e.filePath,startLine:e.startLine,endLine:e.endLine,nodeId:e.id}}function da(e){let t=e.startLine?`:${e.startLine}${e.endLine&&e.endLine!==e.startLine?`-${e.endLine}`:``}`:``;return`[[${e.filePath}${t}]]`}async function fa(e,t,n){let r=la(e),i=[],a=async(e,n)=>{try{if((await t.vectorStatus()).ready){let r=await t.vectorSearch(e,n);if(r.results.length>0)return r.results}}catch{}return(await t.search(e,n)).results};if(r.kind===`overview`){let e={tool:`codebase_map`,input:{},status:`running`};n({type:`tool-start`,toolCall:e});let t=[`main`,`init`,`class`,`app`,`index`,`config`,`server`],r=new Map;for(let e of t)try{let t=await a(e,6);for(let e of t)r.has(e.nodeId)||r.set(e.nodeId,e)}catch{}let o=[...r.values()].slice(0,12);n({type:`tool-end`,toolCall:{...e,status:`done`,resultSummary:`${o.length} key symbols probed`}});let s=`## Codebase Overview
340
-
341
- I sampled key entry points across the graph. Below are the most prominent symbols, grouped by kind:
342
-
343
- `,c=new Map;for(let e of o){let t=c.get(e.kind)??[];t.push(e),c.set(e.kind,t)}for(let[e,t]of c){s+=`**${e.toUpperCase()}**\n`;for(let e of t){let t={filePath:e.filePath,nodeId:e.nodeId};i.push(t),s+=`- \`${e.name}\` ${da(t)}\n`}s+=`
344
- `}s+=`
345
- _Use **inspect <symbol>** to dive deeper, or **impact <symbol>** to see blast radius._`,n({type:`final`,text:s,citations:i});return}let o=r.target??e,s={tool:`find_code`,input:{query:o,limit:5},status:`running`};n({type:`tool-start`,toolCall:s});let c=await a(o,5);if(n({type:`tool-end`,toolCall:{...s,status:`done`,resultSummary:`${c.length} matches`}}),c.length===0){if(r.kind===`grep`){let e={tool:`grep_files`,input:{pattern:o},status:`running`};n({type:`tool-start`,toolCall:e});let{results:r}=await t.grep(o);n({type:`tool-end`,toolCall:{...e,status:`done`,resultSummary:`${r.length} hits`}});let a=`Grep for \`${o}\` returned ${r.length} hits.\n\n`;for(let e of r.slice(0,15)){let t={filePath:e.file,startLine:e.line};i.push(t),a+=`- ${da(t)} \`${e.text.slice(0,80)}\`\n`}n({type:`final`,text:a,citations:i});return}n({type:`final`,text:`No symbols matched \`${o}\` in the knowledge graph. Try a different name or use **grep <pattern>** for raw text search.`,citations:[]});return}let l=c[0];if(r.kind===`find`){let e=`Found ${c.length} candidate(s) for \`${o}\`:\n\n`;for(let t of c){let n={filePath:t.filePath,nodeId:t.nodeId};i.push(n),e+=`- **${t.name}** _(${t.kind})_ ${da(n)}\n`}e+=`\n_Click a citation to focus that node, or ask me to **inspect ${l.name}** for details._`,n({type:`final`,text:e,citations:i});return}let u={tool:`deep_dive`,input:{symbol_name:l.name},status:`running`};n({type:`tool-start`,toolCall:u});let d;try{d=await t.inspectNode(l.nodeId)}catch(e){n({type:`tool-end`,toolCall:{...u,status:`error`,resultSummary:String(e)}}),n({type:`final`,text:`Failed to inspect \`${l.name}\`.`,citations:i});return}n({type:`tool-end`,toolCall:{...u,status:`done`,resultSummary:`${d.callers.length} callers, ${d.callees.length} callees`}});let f=ua(d.node);if(i.push(f),r.kind===`callers`){let e=`### Callers of \`${d.node.name}\` ${da(f)}\n\n${d.callers.length} call site(s):\n\n`;for(let t of d.callers.slice(0,30))e+=`- \`${t.name??t.id}\`${t.weight?` _(weight ${t.weight})_`:``}\n`;n({type:`final`,text:e,citations:i});return}if(r.kind===`callees`){let e=`### \`${d.node.name}\` calls ${d.callees.length} symbol(s) ${da(f)}\n\n`;for(let t of d.callees.slice(0,30))e+=`- \`${t.name??t.id}\`\n`;n({type:`final`,text:e,citations:i});return}if(r.kind===`impact`){let e={tool:`check_impact`,input:{target:l.name},status:`running`};n({type:`tool-start`,toolCall:e});let r;try{r=await t.blastRadius(l.name,`callers`,4)}catch(t){n({type:`tool-end`,toolCall:{...e,status:`error`,resultSummary:String(t)}}),n({type:`final`,text:`Failed to compute blast radius.`,citations:i});return}n({type:`tool-end`,toolCall:{...e,status:`done`,resultSummary:`${r.affectedCount} affected symbols`}});let a=new Map;for(let e of r.affected){let t=a.get(e.depth)??[];t.push(e),a.set(e.depth,t)}let o=`### Blast radius of \`${r.target}\` ${da(f)}\n\n`;o+=`Changing this symbol may affect **${r.affectedCount}** symbol(s):\n\n`;for(let[e,t]of[...a.entries()].sort((e,t)=>e[0]-t[0]))if(e!==0){o+=`**Hop ${e}** _(${t.length})_\n`;for(let e of t.slice(0,12))o+=`- \`${e.name}\` _(${e.kind})_\n`;t.length>12&&(o+=`- _… and ${t.length-12} more_\n`),o+=`
346
- `}n({type:`final`,text:o,citations:i});return}let p=`### \`${d.node.name}\` _(${d.node.kind})_ ${da(f)}\n\n`;if(d.cluster&&(p+=`**Cluster:** \`${d.cluster}\`\n\n`),p+=`**Connections:** ${d.callers.length} caller(s) · ${d.callees.length} callee(s) · ${d.imports.length} import(s)\n\n`,d.callers.length){p+=`**Callers:**
347
- `;for(let e of d.callers.slice(0,8))p+=`- \`${e.name??e.id}\`\n`;p+=`
348
- `}if(d.callees.length){p+=`**Calls:**
349
- `;for(let e of d.callees.slice(0,8))p+=`- \`${e.name??e.id}\`\n`;p+=`
350
- `}d.extends.length&&(p+=`**Extends:** ${d.extends.map(e=>`\`${e.name}\``).join(`, `)}\n\n`),d.implementsEdges.length&&(p+=`**Implements:** ${d.implementsEdges.map(e=>`\`${e.name}\``).join(`, `)}\n\n`),d.members.length&&(p+=`**Members:** ${d.members.length} (${[...new Set(d.members.map(e=>e.kind))].join(`, `)})\n`),n({type:`final`,text:p,citations:i})}var pa=[{label:`Architecture`,items:[`Explain the project architecture`,`What are the main modules?`]},{label:`Search`,items:[`Find code about HTTP server`,`Who calls runPipeline`]},{label:`Inspect`,items:[`Inspect KnowledgeGraph`,`Impact of textSearch`]}];function ma(){let{state:e,dispatch:t}=T(),[n,r]=(0,b.useState)(``),i=(0,b.useRef)(null);(0,b.useEffect)(()=>{i.current?.scrollTo({top:i.current.scrollHeight,behavior:`smooth`})},[e.chat.messages]);let a=async n=>{let i=n.trim();if(!i||e.chat.loading)return;r(``),t({type:`ADD_CHAT_MESSAGE`,message:{role:`user`,content:i,timestamp:Date.now()}}),t({type:`SET_CHAT_LOADING`,loading:!0}),t({type:`ADD_CHAT_MESSAGE`,message:{role:`assistant`,content:``,timestamp:Date.now(),toolCalls:[],citations:[]}});let a=new E(e.serverUrl),o=[];try{await fa(i,a,e=>{if(e.type===`tool-start`&&e.toolCall)o.push(e.toolCall),t({type:`UPDATE_LAST_CHAT_MESSAGE`,message:{toolCalls:[...o]}});else if(e.type===`tool-end`&&e.toolCall){let n=o.findIndex(t=>t.tool===e.toolCall.tool&&t.status===`running`);n>=0?o[n]=e.toolCall:o.push(e.toolCall),t({type:`UPDATE_LAST_CHAT_MESSAGE`,message:{toolCalls:[...o]}})}else e.type===`final`&&t({type:`UPDATE_LAST_CHAT_MESSAGE`,message:{content:e.text??``,citations:e.citations??[]}})})}catch(e){t({type:`UPDATE_LAST_CHAT_MESSAGE`,message:{content:`Error: ${e instanceof Error?e.message:`unknown`}`}})}finally{t({type:`SET_CHAT_LOADING`,loading:!1})}},o=n=>{if(n.nodeId){let r=e.nodes.find(e=>e.id===n.nodeId);if(r){t({type:`SELECT_NODE`,node:r});return}}let r=e.nodes.find(e=>e.kind===`file`&&e.filePath===n.filePath);r&&t({type:`SELECT_NODE`,node:r})};return(0,x.jsxs)(`div`,{className:`flex flex-col h-full bg-deep`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2.5 border-b border-border-subtle bg-surface`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`text-accent`,children:`✦`}),(0,x.jsx)(`h3`,{className:`text-sm font-semibold text-text-primary`,children:`Code AI`}),(0,x.jsx)(`span`,{className:`text-[10px] bg-accent/20 text-accent px-1.5 py-0.5 rounded-full border border-accent/30`,children:`Grounded`})]}),(0,x.jsx)(`button`,{onClick:()=>t({type:`CLEAR_CHAT`}),className:`text-[10px] text-text-muted hover:text-text-secondary px-2 py-1 rounded hover:bg-hover transition`,children:`Clear`})]}),(0,x.jsxs)(`div`,{ref:i,className:`flex-1 overflow-y-auto scrollbar-thin p-3 space-y-3`,children:[e.chat.messages.length===0&&(0,x.jsxs)(`div`,{className:`mt-4 px-2`,children:[(0,x.jsx)(`p`,{className:`text-text-muted text-xs mb-3 leading-relaxed text-center`,children:`Ask grounded questions. Every answer cites source files.`}),(0,x.jsx)(`div`,{className:`space-y-3`,children:pa.map(({label:e,items:t})=>(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-1 px-1`,children:e}),(0,x.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>(0,x.jsx)(`button`,{onClick:()=>a(e),className:`block w-full text-left px-2.5 py-1.5 text-xs bg-elevated hover:bg-hover text-text-secondary hover:text-text-primary rounded-lg border border-border-subtle hover:border-border-default transition`,children:e},e))})]},e))})]}),e.chat.messages.map((e,t)=>(0,x.jsx)(ha,{message:e,onCitationClick:o},t)),e.chat.loading&&(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-text-muted text-xs`,children:[(0,x.jsx)(`div`,{className:`animate-spin w-3 h-3 border-2 border-border-default border-t-accent rounded-full`}),`Thinking…`]})]}),(0,x.jsx)(`div`,{className:`p-2 border-t border-border-subtle bg-surface`,children:(0,x.jsxs)(`div`,{className:`flex gap-2`,children:[(0,x.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===`Enter`&&a(n),disabled:e.chat.loading,className:`flex-1 bg-elevated border border-border-subtle rounded-lg px-3 py-1.5 text-sm text-text-primary placeholder-text-muted focus:border-accent focus:ring-1 focus:ring-accent/20 focus:outline-none disabled:opacity-50 transition`,placeholder:`Ask about the codebase…`}),(0,x.jsx)(`button`,{onClick:()=>a(n),disabled:e.chat.loading||!n.trim(),className:`bg-gradient-to-r from-accent to-accent-dim hover:opacity-90 disabled:opacity-40 rounded-lg px-3 py-1.5 text-sm text-white transition`,children:`➤`})]})})]})}function ha({message:e,onCitationClick:t}){return e.role===`user`?(0,x.jsx)(`div`,{className:`flex justify-end`,children:(0,x.jsx)(`div`,{className:`max-w-[90%] bg-accent/15 border border-accent/30 text-text-primary rounded-lg px-3 py-1.5 text-sm`,children:e.content})}):(0,x.jsxs)(`div`,{className:`space-y-2`,children:[e.toolCalls&&e.toolCalls.length>0&&(0,x.jsx)(`div`,{className:`space-y-1`,children:e.toolCalls.map((e,t)=>(0,x.jsx)(ga,{tc:e},t))}),e.content&&(0,x.jsx)(`div`,{className:`bg-elevated/60 border border-border-subtle rounded-lg p-3 text-sm text-text-secondary`,children:(0,x.jsx)(_a,{text:e.content,onCitationClick:t})})]})}function ga({tc:e}){return(0,x.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1 rounded border bg-surface text-xs ${e.status===`done`?`border-node-function/40 text-node-function`:e.status===`error`?`border-red-700/40 text-red-400`:`border-border-default text-text-muted animate-pulse`}`,children:[(0,x.jsx)(`span`,{className:`font-mono`,children:`⚙`}),(0,x.jsx)(`span`,{className:`font-mono font-medium`,children:e.tool}),(0,x.jsx)(`span`,{className:`text-text-muted truncate flex-1`,children:e.resultSummary??Object.values(e.input).slice(0,1).join(` `)}),(0,x.jsx)(`span`,{className:`text-[10px]`,children:e.status===`running`?`…`:e.status===`done`?`✓`:`✗`})]})}function _a({text:e,onCitationClick:t}){return(0,x.jsx)(x.Fragment,{children:e.split(`
351
- `).map((e,n)=>(0,x.jsx)(`div`,{className:`leading-relaxed`,children:Sa(e,t)},n))})}var va=/\[\[([^\]]+)\]\]/g,ya=/^(#{1,4})\s+(.*)$/,ba=/\*\*([^*]+)\*\*/g,xa=/`([^`]+)`/g;function Sa(e,t){let n=e.match(ya);if(n){let e=n[1].length,r=n[2];return(0,x.jsx)(`h${Math.min(4,e+1)}`,{className:e<=2?`text-base font-bold text-text-primary mt-2`:e===3?`text-sm font-semibold text-text-secondary mt-2`:`text-xs font-semibold text-text-muted mt-1`,children:Ca(r,t)})}return e.startsWith(`- `)?(0,x.jsxs)(`div`,{className:`ml-3`,children:[`• `,Ca(e.slice(2),t)]}):e.trim()===``?(0,x.jsx)(`div`,{className:`h-1`}):(0,x.jsx)(`span`,{children:Ca(e,t)})}function Ca(e,t){let n=[],r=0;va.lastIndex=0;let i;for(;(i=va.exec(e))!==null;){i.index>r&&n.push((0,x.jsx)(b.Fragment,{children:Ea(e.slice(r,i.index))},`t-${r}`));let a=i[1],o=wa(a);n.push((0,x.jsxs)(`button`,{onClick:()=>t(o),className:`inline-flex items-center gap-0.5 mx-0.5 px-1.5 py-0.5 text-[10px] font-mono bg-accent/20 hover:bg-accent/30 text-accent rounded border border-accent/30 align-baseline transition`,title:o.filePath,children:[Ta(o.filePath),o.startLine?`:${o.startLine}`:``]},`c-${i.index}`)),r=i.index+i[0].length}return r<e.length&&n.push((0,x.jsx)(b.Fragment,{children:Ea(e.slice(r))},`t-${r}`)),n}function wa(e){let t=e.lastIndexOf(`:`);if(t>0&&/^\d/.test(e.slice(t+1))){let n=e.slice(0,t),[r,i]=e.slice(t+1).split(`-`).map(e=>parseInt(e,10));return{filePath:n,startLine:r,endLine:i}}return{filePath:e}}function Ta(e){let t=e.split(`/`);return t.length<=2?e:`…/${t.slice(-2).join(`/`)}`}function Ea(e){let t=[],n=0;for(;n<e.length;){ba.lastIndex=n,xa.lastIndex=n;let r=ba.exec(e),i=xa.exec(e),a=null;if(r&&i?a=r.index<i.index?{match:r,type:`b`}:{match:i,type:`c`}:r?a={match:r,type:`b`}:i&&(a={match:i,type:`c`}),!a){t.push(e.slice(n));break}a.match.index>n&&t.push(e.slice(n,a.match.index)),a.type===`b`?t.push((0,x.jsx)(`strong`,{className:`text-text-primary`,children:a.match[1]},`b-${a.match.index}`)):t.push((0,x.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-void text-accent font-mono text-[11px]`,children:a.match[1]},`c-${a.match.index}`)),n=a.match.index+a.match[0].length}return(0,x.jsx)(x.Fragment,{children:t})}function Da(e){let t={name:``,path:``,children:new Map,files:[]};for(let n of e){let e=n.split(`/`),r=t;for(let t=0;t<e.length-1;t++){let n=e[t];r.children.has(n)||r.children.set(n,{name:n,path:e.slice(0,t+1).join(`/`),children:new Map,files:[]}),r=r.children.get(n)}r.files.push(n)}return t}function Oa(e){let t=e.files.length;for(let n of e.children.values())t+=Oa(n);return t}function ka({node:e,depth:t,onFileClick:n,selectedPath:r}){let i=[...e.children.entries()].sort((e,t)=>e[0].localeCompare(t[0])),a=[...e.files].sort(),o=Oa(e),s=t*12,[c,l]=(0,b.useState)(t<=1||e.children.size===1);return t===0?(0,x.jsxs)(x.Fragment,{children:[i.map(([,e])=>(0,x.jsx)(ka,{node:e,depth:t+1,onFileClick:n,selectedPath:r},e.path)),a.map(e=>(0,x.jsx)(Aa,{fp:e,indent:s,selected:e===r,onClick:()=>n(e)},e))]}):(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1 py-0.5 pr-2 cursor-pointer hover:bg-hover rounded-sm group transition select-none`,style:{paddingLeft:`${s+6}px`},onClick:()=>l(e=>!e),children:[(0,x.jsx)(`span`,{className:`text-text-muted text-[10px] w-3 flex-shrink-0 text-center`,children:i.length>0||a.length>0?c?`▾`:`▸`:` `}),(0,x.jsx)(`span`,{className:`text-[13px] mr-1`,children:c?`📂`:`📁`}),(0,x.jsx)(`span`,{className:`text-xs text-text-secondary font-medium truncate flex-1 group-hover:text-text-primary`,children:e.name}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted/50 font-mono ml-1 flex-shrink-0`,children:o})]}),c&&(0,x.jsxs)(`div`,{children:[i.map(([,e])=>(0,x.jsx)(ka,{node:e,depth:t+1,onFileClick:n,selectedPath:r},e.path)),a.map(e=>(0,x.jsx)(Aa,{fp:e,indent:s+16,selected:e===r,onClick:()=>n(e)},e))]})]})}function Aa({fp:e,indent:t,selected:n,onClick:r}){let i=e.split(`/`).pop(),a=ja[i.split(`.`).pop()??``]??`📄`;return(0,x.jsxs)(`div`,{className:`flex items-center gap-1 py-0.5 pr-2 cursor-pointer rounded-sm transition select-none ${n?`bg-accent/15 text-accent`:`hover:bg-hover text-text-muted hover:text-text-secondary`}`,style:{paddingLeft:`${t+6}px`},onClick:r,title:e,children:[(0,x.jsx)(`span`,{className:`text-[11px] mr-1 flex-shrink-0`,children:a}),(0,x.jsx)(`span`,{className:`text-xs truncate`,children:i})]})}var ja={ts:`🔷`,tsx:`⚛️`,js:`🟨`,jsx:`⚛️`,json:`📋`,md:`📝`,py:`🐍`,go:`🐹`,rs:`🦀`,java:`☕`,cs:`🔵`,css:`🎨`,html:`🌐`,yaml:`⚙️`,yml:`⚙️`,toml:`⚙️`,sh:`🐚`,txt:`📄`,gitignore:`🚫`};function Ma(){let{state:e,dispatch:t}=T(),[n,r]=(0,b.useState)(``),i=(0,b.useMemo)(()=>e.nodes.filter(e=>e.kind===`file`).map(e=>e.filePath).sort(),[e.nodes]),a=(0,b.useMemo)(()=>{if(!n.trim())return i;let e=n.toLowerCase();return i.filter(t=>t.toLowerCase().includes(e))},[i,n]),o=(0,b.useMemo)(()=>Da(a),[a]),s=e.selectedNode?.kind===`file`?e.selectedNode.filePath:void 0;return(0,x.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,x.jsx)(`div`,{className:`p-2 border-b border-border-subtle`,children:(0,x.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:`Filter files…`,className:`w-full bg-elevated border border-border-subtle rounded-md px-2.5 py-1.5 text-xs text-text-primary placeholder-text-muted focus:border-accent focus:ring-1 focus:ring-accent/20 focus:outline-none transition`})}),(0,x.jsx)(`div`,{className:`flex-1 overflow-y-auto scrollbar-thin py-1 text-sm`,children:a.length===0?(0,x.jsx)(`p`,{className:`text-center text-text-muted text-xs mt-4`,children:`No files match`}):(0,x.jsx)(ka,{node:o,depth:0,onFileClick:n=>{let r=e.nodes.find(e=>e.filePath===n&&e.kind===`file`);r&&t({type:`SELECT_NODE`,node:r})},selectedPath:s})}),(0,x.jsxs)(`div`,{className:`px-3 py-1.5 border-t border-border-subtle text-[10px] text-text-muted font-mono`,children:[a.length,` file`,a.length===1?``:`s`]})]})}var Na={directory:`Folder`,file:`File`,class:`Class`,function:`Function`,method:`Method`,variable:`Variable`,interface:`Interface`,module:`Module`,struct:`Struct`,enum:`Enum`,trait:`Trait`,namespace:`Namespace`,type_alias:`Type Alias`,constant:`Constant`,property:`Property`,constructor:`Constructor`,route:`Route`,cluster:`Cluster`,flow:`Flow`},Pa={contains:`Contains`,calls:`Calls`,imports:`Imports`,extends:`Extends`,implements:`Implements`,has_member:`Has Member`,accesses:`Accesses`,overrides:`Overrides`,belongs_to:`Belongs To`,step_of:`Step Of`,handles:`Handles`},Fa=[`all`,1,2,3,5];function Ia(){let{state:e,dispatch:t}=T(),{nodeKindCounts:n,edgeKindCounts:r}=(0,b.useMemo)(()=>{let t=new Map,n=new Map;for(let n of e.nodes)t.set(n.kind,(t.get(n.kind)??0)+1);for(let t of e.edges)n.set(t.kind,(n.get(t.kind)??0)+1);return{nodeKindCounts:t,edgeKindCounts:n}},[e.nodes,e.edges]),i=[...n.entries()].sort((e,t)=>t[1]-e[1]),a=[...r.entries()].sort((e,t)=>t[1]-e[1]);return(0,x.jsxs)(`div`,{className:`overflow-y-auto scrollbar-thin h-full text-sm`,children:[(0,x.jsx)(La,{title:`Node Types`,subtitle:`Toggle visibility in the graph`,children:(0,x.jsx)(`div`,{className:`space-y-0.5`,children:i.map(([n,r])=>{let i=e.filters.hiddenNodeKinds.has(n);return(0,x.jsxs)(`button`,{onClick:()=>t({type:`TOGGLE_NODE_KIND`,kind:n}),className:`w-full flex items-center gap-2 px-2 py-1 rounded hover:bg-hover text-left transition`,children:[(0,x.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 transition-opacity`,style:{backgroundColor:Oi[n]??`#6b7280`,opacity:i?.2:1}}),(0,x.jsx)(`span`,{className:`flex-1 text-xs ${i?`text-text-muted line-through`:`text-text-secondary`}`,children:Na[n]??n}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted font-mono`,children:r}),(0,x.jsx)(`span`,{className:`w-4 h-4 rounded flex items-center justify-center text-[10px] ${i?`bg-elevated text-text-muted`:`bg-accent/20 text-accent`}`,children:i?`+`:`✓`})]},n)})})}),(0,x.jsx)(La,{title:`Edge Types`,subtitle:`Toggle visibility of relationships`,children:(0,x.jsx)(`div`,{className:`space-y-0.5`,children:a.map(([n,r])=>{let i=e.filters.hiddenEdgeKinds.has(n);return(0,x.jsxs)(`button`,{onClick:()=>t({type:`TOGGLE_EDGE_KIND`,kind:n}),className:`w-full flex items-center gap-2 px-2 py-1 rounded hover:bg-hover text-left transition`,children:[(0,x.jsx)(`span`,{className:`w-4 h-0.5 flex-shrink-0 transition-opacity`,style:{backgroundColor:ki[n]??`#6b7280`,opacity:i?.2:1}}),(0,x.jsx)(`span`,{className:`flex-1 text-xs ${i?`text-text-muted line-through`:`text-text-secondary`}`,children:Pa[n]??n}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted font-mono`,children:r}),(0,x.jsx)(`span`,{className:`w-4 h-4 rounded flex items-center justify-center text-[10px] ${i?`bg-elevated text-text-muted`:`bg-accent/20 text-accent`}`,children:i?`+`:`✓`})]},n)})})}),(0,x.jsxs)(La,{title:`Focus Depth`,subtitle:`Show nodes within N hops of selection`,children:[(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Fa.map(n=>(0,x.jsx)(`button`,{onClick:()=>t({type:`SET_FOCUS_DEPTH`,depth:n}),className:`px-2.5 py-1 rounded text-xs font-medium transition ${e.filters.focusDepth===n?`bg-accent text-white shadow-glow`:`bg-elevated text-text-muted hover:bg-hover hover:text-text-secondary`}`,children:n===`all`?`All`:`${n} hop${n===1?``:`s`}`},String(n)))}),!e.selectedNode&&e.filters.focusDepth!==`all`&&(0,x.jsx)(`p`,{className:`text-[10px] text-amber-400 mt-2`,children:`Select a node to apply focus depth.`})]}),(0,x.jsx)(`div`,{className:`px-3 pb-4`,children:(0,x.jsx)(`button`,{onClick:()=>t({type:`RESET_FILTERS`}),className:`w-full px-2 py-1.5 text-xs bg-elevated hover:bg-hover text-text-secondary rounded transition`,children:`Reset filters`})})]})}function La({title:e,subtitle:t,children:n}){return(0,x.jsxs)(`div`,{className:`px-3 py-3 border-b border-border-subtle`,children:[(0,x.jsx)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-0.5`,children:e}),t&&(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted/60 mb-2`,children:t}),n]})}var Ra=`code-intel:query-history`,za=20,Ba=[`FIND function WHERE name CONTAINS "auth"`,`FIND * WHERE kind IN [function, method] LIMIT 20`,`TRAVERSE CALLS FROM "main" DEPTH 3`,`COUNT function GROUP BY cluster`,`FIND function WHERE exported = true LIMIT 30`],Va=/\b(FIND|TRAVERSE|PATH|COUNT|WHERE|FROM|TO|DEPTH|LIMIT|OFFSET|GROUP|BY|AND|IN|CONTAINS|STARTS_WITH)\b/g;function Ha(){try{return JSON.parse(localStorage.getItem(Ra)??`[]`)}catch{return[]}}function Ua(e){localStorage.setItem(Ra,JSON.stringify(e.slice(0,za)))}function Wa(e){let t=Ha().filter(t=>t!==e);t.unshift(e),Ua(t)}function Ga(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Ka(e){return Ga(e).replace(Va,`<span style="color:#7c3aed;font-weight:600">$1</span>`)}function qa({nodes:e,onSelectNode:t}){let[n,r]=(0,b.useState)({column:`name`,direction:`asc`}),i=e=>r(t=>t.column===e?{column:e,direction:t.direction===`asc`?`desc`:`asc`}:{column:e,direction:`asc`}),a=[...e].sort((e,t)=>{let r=String(e[n.column]??``),i=String(t[n.column]??``);return n.direction===`asc`?r.localeCompare(i):i.localeCompare(r)}),o=[{key:`name`,label:`Name`},{key:`kind`,label:`Kind`},{key:`filePath`,label:`File`}],s=e=>n.column===e?(0,x.jsx)(`span`,{className:`text-accent ml-1`,children:n.direction===`asc`?`↑`:`↓`}):(0,x.jsx)(`span`,{className:`text-text-muted ml-1`,children:`↕`});return(0,x.jsx)(`div`,{className:`overflow-auto max-h-64 rounded-md border border-border-subtle`,children:(0,x.jsxs)(`table`,{className:`w-full text-[11px] font-mono border-collapse`,children:[(0,x.jsx)(`thead`,{className:`sticky top-0 bg-deep z-10`,children:(0,x.jsx)(`tr`,{children:o.map(e=>(0,x.jsxs)(`th`,{onClick:()=>i(e.key),className:`px-2 py-1.5 text-left text-text-muted font-semibold cursor-pointer hover:text-text-secondary select-none border-b border-border-subtle whitespace-nowrap`,children:[e.label,s(e.key)]},e.key))})}),(0,x.jsx)(`tbody`,{children:a.map((e,n)=>(0,x.jsxs)(`tr`,{onClick:()=>t(e),className:`cursor-pointer hover:bg-accent/10 transition-colors`,children:[(0,x.jsx)(`td`,{className:`px-2 py-1 text-accent truncate max-w-[120px]`,title:e.name,children:e.name}),(0,x.jsx)(`td`,{className:`px-2 py-1 text-node-interface`,children:e.kind}),(0,x.jsx)(`td`,{className:`px-2 py-1 text-text-muted truncate max-w-[180px]`,title:e.filePath??``,children:e.filePath??`—`})]},e.id??n))})]})})}function Ja({groups:e}){let t=[...e].sort((e,t)=>t.count-e.count);return(0,x.jsx)(`div`,{className:`overflow-auto max-h-48 rounded-md border border-border-subtle`,children:(0,x.jsxs)(`table`,{className:`w-full text-[11px] font-mono border-collapse`,children:[(0,x.jsx)(`thead`,{className:`sticky top-0 bg-deep z-10`,children:(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`th`,{className:`px-2 py-1.5 text-left text-text-muted font-semibold border-b border-border-subtle`,children:`Group`}),(0,x.jsx)(`th`,{className:`px-2 py-1.5 text-left text-text-muted font-semibold border-b border-border-subtle`,children:`Count`})]})}),(0,x.jsx)(`tbody`,{children:t.map(({key:e,count:t})=>(0,x.jsxs)(`tr`,{className:`hover:bg-hover transition-colors`,children:[(0,x.jsx)(`td`,{className:`px-2 py-1 text-accent`,children:e}),(0,x.jsx)(`td`,{className:`px-2 py-1 text-text-primary font-bold`,children:t})]},e))})]})})}function Ya(){let{state:e,dispatch:t}=T(),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(null),[u,d]=(0,b.useState)(()=>Ha()),f=(0,b.useRef)(null),p=(0,b.useRef)(null);(0,b.useEffect)(()=>{p.current&&(p.current.innerHTML=Ka(n)+`
352
- `)},[n]);let m=(0,b.useCallback)(()=>{f.current&&p.current&&(p.current.scrollTop=f.current.scrollTop,p.current.scrollLeft=f.current.scrollLeft)},[]),h=(0,b.useCallback)(async()=>{let t=n.trim();if(!(!t||i)){a(!0),l(null),s(null);try{s(await new E(e.serverUrl).queryGQL(t)),Wa(t),d(Ha())}catch(e){l(e instanceof Error?e.message:String(e))}finally{a(!1)}}},[n,i,e.serverUrl]),g=(0,b.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&(e.preventDefault(),h())},[h]),_=(0,b.useCallback)(e=>t({type:`SELECT_NODE`,node:e}),[t]),v=o&&o.nodes.length>0,y=o&&o.groups&&o.groups.length>0,S=`w-full bg-deep border border-border-subtle rounded text-[11px] text-text-secondary px-2 py-1 focus:outline-none focus:border-accent cursor-pointer`;return(0,x.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden text-sm`,children:[(0,x.jsx)(`div`,{className:`px-3 py-2 border-b border-border-subtle flex-shrink-0`,children:(0,x.jsx)(`h3`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase`,children:`GQL Query Console`})}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto scrollbar-thin px-3 py-2 space-y-2`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`label`,{className:`block text-[10px] text-text-muted mb-1 font-semibold uppercase tracking-wider`,children:`Examples`}),(0,x.jsxs)(`select`,{onChange:e=>{e.target.value&&(r(e.target.value),e.target.value=``)},defaultValue:``,className:S,children:[(0,x.jsx)(`option`,{value:``,disabled:!0,children:`— pick an example —`}),Ba.map(e=>(0,x.jsx)(`option`,{value:e,children:e},e))]})]}),u.length>0&&(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`label`,{className:`block text-[10px] text-text-muted mb-1 font-semibold uppercase tracking-wider`,children:`History`}),(0,x.jsxs)(`select`,{onChange:e=>{e.target.value&&(r(e.target.value),e.target.value=``)},defaultValue:``,className:S,children:[(0,x.jsx)(`option`,{value:``,disabled:!0,children:`— recent queries —`}),u.map((e,t)=>(0,x.jsx)(`option`,{value:e,children:e.length>60?e.slice(0,57)+`…`:e},t))]})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`label`,{className:`block text-[10px] text-text-muted mb-1 font-semibold uppercase tracking-wider`,children:[`Query `,(0,x.jsx)(`span`,{className:`text-text-muted/50 normal-case font-normal`,children:`(Ctrl+Enter to run)`})]}),(0,x.jsxs)(`div`,{className:`relative`,style:{height:`100px`},children:[(0,x.jsx)(`div`,{ref:p,"aria-hidden":`true`,className:`absolute inset-0 overflow-hidden whitespace-pre-wrap break-words pointer-events-none rounded-md border border-transparent`,style:{fontFamily:`ui-monospace, "Cascadia Code", "Fira Code", monospace`,fontSize:`11px`,lineHeight:`1.5`,padding:`6px 8px`,color:`transparent`,background:`#0a0a10`,wordBreak:`break-word`,zIndex:0}}),(0,x.jsx)(`textarea`,{ref:f,value:n,onChange:e=>r(e.target.value),onKeyDown:g,onScroll:m,spellCheck:!1,placeholder:`FIND function WHERE name CONTAINS "auth"`,className:`absolute inset-0 w-full h-full resize-none rounded-md border border-border-subtle focus:outline-none focus:border-accent`,style:{fontFamily:`ui-monospace, "Cascadia Code", "Fira Code", monospace`,fontSize:`11px`,lineHeight:`1.5`,padding:`6px 8px`,background:`transparent`,color:`#e4e4ed`,caretColor:`#e4e4ed`,zIndex:1}})]})]}),(0,x.jsx)(`button`,{onClick:()=>void h(),disabled:i||!n.trim(),className:`w-full py-1.5 rounded-md text-xs font-semibold tracking-wide transition flex items-center justify-center gap-2 bg-accent hover:opacity-90 text-white disabled:opacity-40 disabled:cursor-not-allowed`,children:i?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`svg`,{className:`animate-spin h-3.5 w-3.5`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,x.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,x.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`})]}),`Running…`]}):(0,x.jsx)(x.Fragment,{children:`▶ Run`})}),c&&(0,x.jsxs)(`div`,{className:`rounded-md border border-red-700/60 bg-red-900/20 px-3 py-2`,children:[(0,x.jsx)(`p`,{className:`text-[10px] font-bold text-red-400 uppercase tracking-wider mb-0.5`,children:`Error`}),(0,x.jsx)(`p`,{className:`text-[11px] text-red-300 font-mono break-words`,children:c})]}),o&&(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-text-muted`,children:[(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`span`,{className:`text-text-primary font-semibold`,children:o.totalCount}),` result`,o.totalCount===1?``:`s`]}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`span`,{className:`text-text-primary font-semibold`,children:o.executionTimeMs}),` ms`]}),o.truncated&&(0,x.jsx)(`span`,{className:`text-amber-400 font-semibold`,children:`⚠ truncated`})]}),v&&(0,x.jsx)(qa,{nodes:o.nodes,onSelectNode:_}),y&&o.groups&&(0,x.jsx)(Ja,{groups:o.groups}),o.edges&&o.edges.length>0&&(0,x.jsxs)(`p`,{className:`text-[10px] text-text-muted`,children:[`+ `,(0,x.jsx)(`span`,{className:`text-text-primary`,children:o.edges.length}),` edge`,o.edges.length===1?``:`s`,` in result`]}),!v&&!y&&(0,x.jsx)(`p`,{className:`text-[11px] text-text-muted italic`,children:`No results.`})]})]})]})}function Xa(e){return e>=.8?`#4ade80`:e>=.5?`#fbbf24`:`#f87171`}function Za(e){return e>=.8?`border-node-class/60`:e>=.5?`border-amber-500/60`:`border-red-500/60`}function Qa(){let{state:e}=T(),[t,n]=(0,b.useState)([]),[r,i]=(0,b.useState)(!1),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(null),[l,u]=(0,b.useState)(null),[d,f]=(0,b.useState)(!1),[p,m]=(0,b.useState)(null),[h,g]=(0,b.useState)(null);(0,b.useEffect)(()=>{let t=new E(e.serverUrl);i(!0),o(``),t.listGroups().then(n).catch(e=>o(e instanceof Error?e.message:`Failed to load groups`)).finally(()=>i(!1))},[e.serverUrl]);let _=async t=>{let n=new E(e.serverUrl);f(!0),m(t),u(null),g(null);try{u(await n.getGroupTopology(t))}catch{u({repos:[],edges:[]})}finally{f(!1)}};return r?(0,x.jsx)(`div`,{className:`p-4 text-sm text-text-muted`,children:`Loading groups…`}):a?(0,x.jsx)(`div`,{className:`p-4 text-sm text-red-400`,children:a}):t.length===0?(0,x.jsxs)(`div`,{className:`p-4 text-sm text-text-muted`,children:[(0,x.jsx)(`p`,{children:`No groups configured.`}),(0,x.jsxs)(`p`,{className:`mt-1`,children:[`Use `,(0,x.jsx)(`span`,{className:`font-mono text-text-secondary`,children:`code-intel group create <name>`}),` to create one.`]})]}):(0,x.jsxs)(`div`,{className:`overflow-y-auto scrollbar-thin h-full text-sm`,children:[(0,x.jsx)(`div`,{className:`p-3 border-b border-border-subtle`,children:(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase mb-1`,children:[`⬡ Groups (`,t.length,`)`]})}),(0,x.jsx)(`div`,{className:`space-y-0`,children:t.map(e=>(0,x.jsxs)(`div`,{className:`border-b border-border-subtle/50`,children:[(0,x.jsxs)(`div`,{className:`px-3 py-2 flex items-center justify-between`,children:[(0,x.jsxs)(`button`,{className:`flex items-center gap-1.5 text-left flex-1 min-w-0`,onClick:()=>c(s===e.name?null:e.name),children:[(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted shrink-0`,children:s===e.name?`▾`:`▸`}),(0,x.jsx)(`span`,{className:`text-xs font-semibold text-accent truncate`,children:e.name}),(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted shrink-0`,children:[`(`,e.memberCount,`)`]})]}),(0,x.jsx)(`button`,{onClick:()=>_(e.name),className:`text-[10px] text-accent hover:text-accent/80 border border-accent/30 hover:border-accent/60 rounded px-1.5 py-0.5 transition ml-2 shrink-0`,children:`topology`})]}),e.lastSync&&(0,x.jsx)(`div`,{className:`px-3 pb-1`,children:(0,x.jsxs)(`p`,{className:`text-[9px] text-text-muted/50`,children:[`Synced: `,new Date(e.lastSync).toLocaleString()]})})]},e.name))}),p&&(0,x.jsxs)(`div`,{className:`border-t border-border-subtle mt-2`,children:[(0,x.jsxs)(`div`,{className:`px-3 py-2 flex items-center justify-between`,children:[(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase`,children:[`Topology: `,p]}),(0,x.jsx)(`button`,{onClick:()=>{m(null),u(null),g(null)},className:`text-[10px] text-text-muted hover:text-text-secondary`,children:`✕`})]}),d&&(0,x.jsx)(`div`,{className:`px-3 py-2 text-[10px] text-text-muted`,children:`Loading topology…`}),l&&!d&&(0,x.jsxs)(`div`,{className:`px-3 pb-3`,children:[(0,x.jsx)(`div`,{className:`flex flex-wrap gap-2 mb-3`,children:l.repos.map(e=>{let t=l.edges.filter(t=>t.source===e.name||t.target===e.name),n=t.reduce((e,t)=>Math.max(e,t.confidence),0);return(0,x.jsxs)(`div`,{className:`border rounded-md px-2 py-1.5 bg-surface cursor-pointer hover:bg-hover transition ${t.length>0?Za(n):`border-border-default`}`,title:`${e.groupPath}\n${e.nodeCount} nodes · ${e.edgeCount} edges`,children:[(0,x.jsx)(`div`,{className:`text-[10px] font-semibold text-text-primary truncate max-w-[120px]`,children:e.name}),(0,x.jsxs)(`div`,{className:`text-[9px] text-text-muted font-mono`,children:[e.nodeCount,`n · `,e.edgeCount,`e`]})]},e.name)})}),l.edges.length>0&&(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`h4`,{className:`text-[9px] font-bold tracking-wider text-text-muted uppercase mb-1`,children:[`Cross-repo edges (`,l.edges.length,`)`]}),(0,x.jsx)(`div`,{className:`space-y-0.5 max-h-48 overflow-y-auto scrollbar-thin`,children:l.edges.map((e,t)=>(0,x.jsxs)(`button`,{className:`w-full text-left flex items-center gap-1.5 px-2 py-1 rounded hover:bg-hover transition`,onClick:()=>g(h?.edge===e?null:{edge:e}),children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0`,style:{backgroundColor:Xa(e.confidence)}}),(0,x.jsx)(`span`,{className:`text-[10px] text-node-function font-mono truncate`,children:e.source}),(0,x.jsx)(`span`,{className:`text-[9px] text-text-muted`,children:`→`}),(0,x.jsx)(`span`,{className:`text-[10px] text-accent font-mono truncate`,children:e.target}),(0,x.jsxs)(`span`,{className:`text-[9px] text-text-muted ml-auto shrink-0`,children:[(e.confidence*100).toFixed(0),`%`]})]},t))})]}),l.edges.length===0&&(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted/60`,children:`No cross-repo edges. Run group sync first.`})]})]}),h&&(0,x.jsxs)(`div`,{className:`mx-3 mb-3 bg-surface border border-border-subtle rounded-md p-2`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,x.jsx)(`h4`,{className:`text-[9px] font-bold tracking-wider text-text-muted uppercase`,children:`Edge Detail`}),(0,x.jsx)(`button`,{onClick:()=>g(null),className:`text-[10px] text-text-muted hover:text-text-secondary`,children:`✕`})]}),(0,x.jsxs)(`div`,{className:`space-y-0.5 text-[10px]`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Contract:`}),` `,(0,x.jsx)(`span`,{className:`text-text-primary font-mono`,children:h.edge.contractName})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Provider:`}),` `,(0,x.jsx)(`span`,{className:`text-node-function font-mono`,children:h.edge.source})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Consumer:`}),` `,(0,x.jsx)(`span`,{className:`text-accent font-mono`,children:h.edge.target})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Confidence:`}),` `,(0,x.jsxs)(`span`,{style:{color:Xa(h.edge.confidence)},className:`font-mono`,children:[(h.edge.confidence*100).toFixed(1),`%`]})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Kind:`}),` `,(0,x.jsx)(`span`,{className:`text-text-secondary`,children:h.edge.kind})]})]})]})]})}function $a(){let{state:e}=T(),[t,n]=(0,b.useState)(`unknown`),[r,i]=(0,b.useState)(!1),a=(0,b.useRef)(null),[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(null),u=(0,b.useRef)(null),d=e=>{l(e),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>l(null),4e3)};(0,b.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]),(0,b.useEffect)(()=>{if(!e.connected||!e.currentUser)return;let t=e.serverUrl.replace(/^http/,`ws`)+`/ws`,n=null,r=null,i=!1;function a(){if(!i)try{n=new WebSocket(t),n.onopen=()=>s(!0),n.onclose=()=>{s(!1),i||(r=setTimeout(a,3e3+Math.random()*500))},n.onerror=()=>{},n.onmessage=e=>{try{let t=JSON.parse(e.data);if(t.type===`graph:updated`){let e=t.changedFiles?.length??0;d(`Graph updated — ${e} file${e===1?``:`s`} changed`)}}catch{}}}catch{}}return a(),()=>{i=!0,r&&clearTimeout(r),n?.close(),s(!1)}},[e.connected,e.currentUser,e.serverUrl]);let f=(0,b.useCallback)(async()=>{if(!e.connected)return;let t=new E(e.serverUrl);try{let e=await t.vectorStatus();if(e.ready){n(`ready`),i(!1),a.current&&clearTimeout(a.current);return}e.building?(n(`building`),i(!0)):(n(`unknown`),i(!1))}catch{n(`unknown`),i(!1)}a.current=setTimeout(()=>void f(),5e3)},[e.connected,e.serverUrl]);(0,b.useEffect)(()=>(a.current&&clearTimeout(a.current),n(`unknown`),i(!1),e.connected&&f(),()=>{a.current&&clearTimeout(a.current)}),[e.connected,e.serverUrl]);let p=e.connected?`bg-node-function`:`bg-text-muted`,m;m=t===`building`?(0,x.jsxs)(`span`,{className:`flex items-center gap-1 text-amber-400`,children:[(0,x.jsx)(`span`,{className:`inline-block`,style:{animation:r?`spin 1s linear infinite`:`none`},children:`⟳`}),(0,x.jsx)(`span`,{children:`vec building…`})]}):t===`ready`?(0,x.jsx)(`span`,{className:`text-node-function`,children:`⚡ vec ready`}):(0,x.jsx)(`span`,{className:`text-text-muted/50`,children:`vec –`});let h=e.selectedNode;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`style`,{children:`@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }`}),c&&(0,x.jsxs)(`div`,{className:`fixed bottom-10 left-1/2 -translate-x-1/2 z-50 bg-accent/90 border border-accent/50 text-white text-xs px-4 py-2 rounded-lg shadow-lg flex items-center gap-2 pointer-events-none animate-fade-in`,children:[(0,x.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-white/60 animate-pulse`}),c]}),(0,x.jsxs)(`footer`,{className:`h-7 bg-deep border-t border-border-subtle flex items-center px-3 text-xs text-text-muted shrink-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,x.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`w-2 h-2 rounded-full ${p}`}),(0,x.jsx)(`span`,{className:e.connected?`text-text-secondary`:`text-text-muted/60`,children:e.connected?e.serverUrl:`Disconnected`})]}),e.connected&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),(0,x.jsxs)(`span`,{className:`flex items-center gap-1`,title:o?`Live updates active`:`Live updates disconnected`,children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${o?`bg-node-function`:`bg-text-muted/40`}`}),(0,x.jsx)(`span`,{className:o?`text-node-function`:`text-text-muted/40`,children:`live`})]})]}),(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),m,e.nodes.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),(0,x.jsxs)(`span`,{children:[e.nodes.length.toLocaleString(),` nodes  / `,e.edges.length.toLocaleString(),` edges`]})]})]}),(0,x.jsx)(`div`,{className:`flex-1`}),h&&(0,x.jsx)(`span`,{className:`max-w-[30ch] truncate px-2 py-0.5 rounded-full bg-elevated text-text-secondary border border-border-subtle font-mono mr-3`,title:h.name,children:h.name}),(0,x.jsxs)(`span`,{className:`font-mono text-text-muted/50 text-[10px] select-none`,children:[`v`,`1.0.0`]})]})]})}var eo={admin:`text-red-400 border-red-700/50 bg-red-900/20`,analyst:`text-accent border-accent/30 bg-accent/10`,viewer:`text-text-muted border-border-default bg-elevated`,"repo-owner":`text-node-interface border-node-interface/30 bg-node-interface/10`};function to({onToggleAI:e,aiOpen:t}){let{state:n,dispatch:r}=T(),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)(!1),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(!1),v=(0,b.useRef)(null),y=(0,b.useRef)(null);(0,b.useEffect)(()=>{if(!n.connected)return;let e=async()=>{try{let t=await new E(n.serverUrl).vectorStatus();d(t.ready),!t.ready&&t.building&&setTimeout(e,3e3)}catch{}};e()},[n.connected,n.serverUrl]),(0,b.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),v.current?.focus(),s(!0)),e.key===`Escape`&&(s(!1),h(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,b.useEffect)(()=>{let e=e=>{y.current&&!y.current.contains(e.target)&&h(!1)};return m&&document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);let S=async e=>{if(!e.trim()){s(!1);return}p(!0);try{let t=new E(n.serverUrl);if(c&&u){let{results:n,source:i}=await t.vectorSearch(e,12);r({type:`SET_SEARCH`,query:e,results:n}),console.log(`[search] vector source:`,i)}else{let{results:n}=await t.search(e,12);r({type:`SET_SEARCH`,query:e,results:n})}s(!0)}catch(e){console.error(e)}finally{p(!1)}},C=async()=>{_(!0);try{await new E(n.serverUrl).logout()}catch{}finally{r({type:`SET_CURRENT_USER`,user:null}),r({type:`SET_CONNECTED`,connected:!1}),r({type:`SET_GRAPH`,nodes:[],edges:[]}),r({type:`SET_VIEW`,view:`login`}),_(!1),h(!1)}},w=n.currentUser;return(0,x.jsxs)(`header`,{className:`flex items-center justify-between border-b border-border-subtle bg-deep px-4 py-0 h-12 gap-4 relative z-30 shrink-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2.5 shrink-0`,children:[(0,x.jsx)(`div`,{className:`flex h-7 w-7 items-center justify-center rounded-md bg-gradient-to-br from-accent to-accent-dim text-sm font-bold text-white shadow-glow`,children:`◈`}),(0,x.jsx)(`span`,{className:`text-[15px] font-semibold tracking-tight text-text-primary`,children:`Code Intel`}),n.repoName&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),n.mode===`group`?(0,x.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`text-xs bg-accent/20 text-accent border border-accent/30 rounded px-1.5 py-0.5 font-mono`,children:`group`}),(0,x.jsx)(`span`,{className:`text-accent text-sm font-mono`,children:n.repoName})]}):(0,x.jsx)(`span`,{className:`text-accent text-sm font-mono`,children:n.repoName})]})]}),(0,x.jsxs)(`div`,{className:`flex-1 max-w-2xl mx-auto relative`,children:[(0,x.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,x.jsx)(`span`,{className:`absolute left-3 top-1/2 -translate-y-1/2 text-text-muted text-sm z-10 pointer-events-none`,children:f?(0,x.jsx)(`span`,{className:`animate-spin inline-block`,children:`⟳`}):`⌕`}),(0,x.jsx)(`input`,{ref:v,type:`text`,value:i,onChange:e=>a(e.target.value),onFocus:()=>s(n.search.results.length>0||i.length>0),onBlur:()=>setTimeout(()=>s(!1),150),onKeyDown:e=>{e.key===`Enter`&&S(i),e.key===`Escape`&&(s(!1),v.current?.blur())},placeholder:c&&u?`Semantic search…`:`Search nodes…`,className:`w-full bg-surface border border-border-subtle rounded-lg pl-9 pr-28 py-1.5 text-sm text-text-primary placeholder-text-muted focus:border-accent focus:ring-2 focus:ring-accent/20 focus:outline-none transition`}),(0,x.jsx)(`button`,{onClick:()=>l(e=>!e),title:u?c?`Switch to keyword search`:`Switch to semantic search`:`Vector index building…`,className:`absolute right-14 top-1/2 -translate-y-1/2 text-[10px] px-1.5 py-0.5 rounded border font-mono transition-all ${u===null?`text-text-muted border-border-subtle`:u&&c?`text-accent border-accent/40 bg-accent/10`:u?`text-text-muted border-border-subtle hover:border-accent/40 hover:text-accent`:`text-amber-400 border-amber-700/50 animate-pulse`}`,children:u===null?`…`:u?c?`⚡ vec`:`vec`:`⟳ vec`}),(0,x.jsx)(`kbd`,{className:`absolute right-3 top-1/2 -translate-y-1/2 rounded border border-border-subtle bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-text-muted`,children:`⌘K`})]}),o&&n.search.results.length>0&&(0,x.jsx)(`div`,{className:`absolute top-full left-0 right-0 mt-1 bg-surface border border-border-subtle rounded-xl shadow-xl max-h-96 overflow-y-auto scrollbar-thin z-50`,children:n.search.results.map(e=>(0,x.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-2 hover:bg-hover cursor-pointer border-b border-border-subtle/50 last:border-0 transition`,onMouseDown:t=>{t.preventDefault();let i=n.nodes.find(t=>t.id===e.nodeId);i&&(r({type:`SELECT_NODE`,node:i}),s(!1))},children:[(0,x.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:Oi[e.kind]??`#666`}}),(0,x.jsx)(`span`,{className:`text-sm text-text-primary font-medium truncate`,children:e.name}),(0,x.jsx)(`span`,{className:`text-xs text-text-muted ml-auto truncate max-w-xs font-mono`,children:e.filePath})]},e.nodeId))})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[n.nodes.length>0&&(0,x.jsxs)(`div`,{className:`hidden md:flex items-center gap-2 text-xs text-text-muted font-mono`,children:[(0,x.jsxs)(`span`,{children:[n.nodes.length.toLocaleString(),` nodes`]}),(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),(0,x.jsxs)(`span`,{children:[n.edges.length.toLocaleString(),` edges`]})]}),(0,x.jsxs)(`button`,{onClick:e,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition ${t?`bg-gradient-to-r from-accent to-accent-dim text-white shadow-glow`:`bg-surface hover:bg-hover text-text-secondary border border-border-subtle`}`,children:[(0,x.jsx)(`span`,{children:`✦`}),(0,x.jsx)(`span`,{children:`Code AI`})]}),w&&(0,x.jsxs)(`div`,{className:`relative`,ref:y,children:[(0,x.jsxs)(`button`,{onClick:()=>h(e=>!e),className:`flex items-center gap-2 px-2.5 py-1.5 rounded-lg hover:bg-hover border border-border-subtle transition`,children:[(0,x.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-gradient-to-br from-accent to-accent-dim flex items-center justify-center text-white text-xs font-bold select-none`,children:w.username.charAt(0).toUpperCase()}),(0,x.jsx)(`span`,{className:`text-sm text-text-secondary max-w-[80px] truncate`,children:w.username}),(0,x.jsx)(`span`,{className:`text-[9px] px-1.5 py-0.5 rounded border font-mono ${eo[w.role]??eo.viewer}`,children:w.role}),(0,x.jsx)(`svg`,{className:`w-3 h-3 text-text-muted transition-transform ${m?`rotate-180`:``}`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})]}),m&&(0,x.jsxs)(`div`,{className:`absolute right-0 top-full mt-1 w-52 bg-surface border border-border-subtle rounded-xl shadow-2xl py-1 z-50 animate-slide-up`,children:[(0,x.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-border-subtle`,children:[(0,x.jsx)(`p`,{className:`text-sm text-text-primary font-semibold`,children:w.username}),(0,x.jsx)(`p`,{className:`text-xs text-text-muted mt-0.5 capitalize`,children:w.role})]}),(0,x.jsxs)(`button`,{onClick:()=>{h(!1),r({type:`SET_CONNECTED`,connected:!1}),r({type:`SET_VIEW`,view:`connect`})},className:`w-full text-left px-4 py-2 text-sm text-text-secondary hover:bg-hover hover:text-text-primary transition flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`⬡`}),`Switch Repository`]}),(0,x.jsxs)(`button`,{onClick:C,disabled:g,className:`w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-red-950/30 hover:text-red-300 transition flex items-center gap-2 disabled:opacity-50`,children:[g?(0,x.jsx)(`span`,{className:`animate-spin inline-block text-xs`,children:`⟳`}):(0,x.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1`})}),g?`Signing out…`:`Sign out`]})]})]})]})]})}var no=[{title:`Navigation`,shortcuts:[{keys:[`Esc`],description:`Close panel / Deselect node`},{keys:[`Tab`],description:`Cycle through NodeDetail tabs`},{keys:[`←`,`→`],description:`Navigate search results`}]},{title:`Search`,shortcuts:[{keys:[`⌘K`,`Ctrl+K`],description:`Focus search`},{keys:[`?`],description:`Toggle shortcuts panel`}]},{title:`Graph`,shortcuts:[{keys:[`F`],description:`Fit graph to view`},{keys:[`G`],description:`Jump to graph`}]}];function ro({open:e,onClose:t}){let n=(0,b.useRef)(null);return(0,b.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,x.jsx)(`div`,{ref:n,onClick:e=>{e.target===n.current&&t()},className:`fixed inset-0 z-50 flex items-center justify-center bg-void/70 backdrop-blur-sm`,children:(0,x.jsxs)(`div`,{className:`w-full max-w-sm bg-deep border border-border-subtle rounded-xl shadow-2xl overflow-hidden animate-fade-in`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border-subtle`,children:[(0,x.jsx)(`h2`,{className:`text-sm font-semibold text-text-primary tracking-wide`,children:`Keyboard Shortcuts`}),(0,x.jsx)(`button`,{onClick:t,className:`text-text-muted hover:text-text-primary transition text-base leading-none`,"aria-label":`Close shortcuts panel`,children:`×`})]}),(0,x.jsx)(`div`,{className:`p-4 space-y-5`,children:no.map(e=>(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{className:`text-[10px] font-bold tracking-widest text-accent/70 uppercase mb-2`,children:e.title}),(0,x.jsx)(`div`,{className:`space-y-2`,children:e.shortcuts.map(e=>(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,x.jsx)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:e.keys.map(e=>(0,x.jsx)(`span`,{className:`bg-elevated border border-border-default text-text-secondary font-mono text-xs rounded px-1.5 py-0.5`,children:e},e))}),(0,x.jsx)(`span`,{className:`text-text-muted text-xs text-right`,children:e.description})]},e.description))})]},e.title))})]})}):null}function io(){let{state:e,dispatch:t}=T(),[n,r]=(0,b.useState)(`explorer`),[i,a]=(0,b.useState)(!0),[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(!1);(0,b.useEffect)(()=>{function e(e){let t=e.target,n=t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable;e.key===`?`&&!n&&s(e=>!e)}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,b.useEffect)(()=>{e.selectedNode&&e.selectedNode.filePath&&e.selectedNode.startLine?l(!0):l(!1)},[e.selectedNode?.id]);let u=[`explorer`,`filters`,`files`,`query`,...e.mode===`group`?[`group`]:[],`groups`];return(0,x.jsxs)(`div`,{className:`flex flex-col h-screen bg-void text-text-primary`,children:[(0,x.jsx)(to,{onToggleAI:()=>a(e=>!e),aiOpen:i}),(0,x.jsx)(ro,{open:o,onClose:()=>s(!1)}),(0,x.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,x.jsxs)(`div`,{className:`w-72 bg-deep border-r border-border-subtle flex flex-col shrink-0`,children:[(0,x.jsx)(`div`,{className:`flex border-b border-border-subtle overflow-x-auto scrollbar-none`,children:u.map(e=>(0,x.jsx)(`button`,{onClick:()=>r(e),className:`shrink-0 px-2.5 py-2.5 text-xs font-semibold capitalize tracking-wide transition whitespace-nowrap ${n===e?`text-accent border-b-2 border-accent bg-accent/5`:`text-text-muted hover:text-text-secondary hover:bg-hover`}`,children:e===`group`?`⬢ group`:e===`groups`?`⬡ groups`:e},e))}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-hidden`,children:[n===`explorer`&&(0,x.jsx)(J,{}),n===`filters`&&(0,x.jsx)(Ia,{}),n===`files`&&(0,x.jsx)(Ma,{}),n===`query`&&(0,x.jsx)(Ya,{}),n===`group`&&e.mode===`group`&&(0,x.jsx)(ao,{}),n===`groups`&&(0,x.jsx)(Qa,{})]})]}),(0,x.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,x.jsx)(`div`,{className:`flex-1 relative`,children:(0,x.jsx)(Hi,{})}),e.selectedNode&&(0,x.jsx)(qi,{node:e.selectedNode,onClose:()=>t({type:`SELECT_NODE`,node:null})}),c&&e.selectedNode?.filePath&&e.selectedNode?.startLine&&(0,x.jsx)(ia,{file:e.selectedNode.filePath,startLine:e.selectedNode.startLine,endLine:e.selectedNode.endLine??e.selectedNode.startLine,repo:e.repoName||void 0,onClose:()=>l(!1)})]}),i&&(0,x.jsx)(`div`,{className:`w-96 border-l border-border-subtle flex flex-col shrink-0`,children:(0,x.jsx)(ma,{})})]}),(0,x.jsx)($a,{})]})}function J(){let{state:e,dispatch:t}=T(),n=new Map;for(let t of e.nodes)n.set(t.kind,(n.get(t.kind)??0)+1);let r=[...n.entries()].sort((e,t)=>t[1]-e[1]).slice(0,10),i=r[0]?.[1]??1;return(0,x.jsxs)(`div`,{className:`overflow-y-auto scrollbar-thin h-full text-sm`,children:[e.search.results.length>0&&(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,x.jsx)(`h3`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase`,children:`Search Results`}),(0,x.jsx)(`span`,{className:`text-[10px] bg-accent/20 text-accent px-1.5 py-0.5 rounded-full font-mono`,children:e.search.results.length})]}),(0,x.jsxs)(`p`,{className:`text-[10px] text-text-muted mb-2 truncate`,children:[`"`,e.search.query,`"`]}),(0,x.jsx)(`div`,{className:`space-y-0.5`,children:e.search.results.map(n=>(0,x.jsxs)(`button`,{onClick:()=>{let r=e.nodes.find(e=>e.id===n.nodeId);r&&t({type:`SELECT_NODE`,node:r})},className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-hover text-left group transition`,children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0`,style:{backgroundColor:Oi[n.kind]??`#6b7280`}}),(0,x.jsx)(`span`,{className:`text-xs text-text-secondary font-medium truncate flex-1 group-hover:text-text-primary`,children:n.name}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted font-mono`,children:n.kind})]},n.nodeId))})]}),(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsx)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-3`,children:`Graph Composition`}),(0,x.jsx)(`div`,{className:`space-y-2`,children:r.map(([e,t])=>{let n=Oi[e]??`#6b7280`,r=t/i*100;return(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] mb-0.5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0`,style:{backgroundColor:n}}),(0,x.jsx)(`span`,{className:`text-text-secondary`,children:e})]}),(0,x.jsx)(`span`,{className:`text-text-muted font-mono tabular-nums`,children:t})]}),(0,x.jsx)(`div`,{className:`h-1 bg-elevated rounded-full overflow-hidden`,children:(0,x.jsx)(`div`,{className:`h-full rounded-full transition-all duration-500`,style:{width:`${r}%`,backgroundColor:n,opacity:.7}})})]},e)})})]}),(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsx)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-2`,children:`Overview`}),(0,x.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:[{label:`Nodes`,value:e.nodes.length,color:`text-accent`},{label:`Edges`,value:e.edges.length,color:`text-node-interface`},{label:`Files`,value:n.get(`file`)??0,color:`text-node-file`},{label:`Functions`,value:n.get(`function`)??0,color:`text-node-function`}].map(({label:e,value:t,color:n})=>(0,x.jsxs)(`div`,{className:`bg-surface rounded-lg p-2 border border-border-subtle`,children:[(0,x.jsx)(`p`,{className:`text-base font-bold font-mono ${n}`,children:t}),(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted`,children:e})]},e))})]}),(0,x.jsx)(`div`,{className:`p-3`,children:(0,x.jsxs)(`p`,{className:`text-[10px] text-text-muted leading-relaxed`,children:[(0,x.jsx)(`span`,{className:`text-text-secondary font-mono`,children:`⌘K`}),` to search. Click nodes to inspect. Use `,(0,x.jsx)(`span`,{className:`text-text-secondary`,children:`Filters`}),` to show/hide node types. Press `,(0,x.jsx)(`span`,{className:`text-text-secondary font-mono`,children:`?`}),` for shortcuts.`]})})]})}function ao(){let{state:e,dispatch:t}=T(),[n,r]=(0,b.useState)(!1),[i,a]=(0,b.useState)(``);return(0,x.jsxs)(`div`,{className:`overflow-y-auto scrollbar-thin h-full text-sm`,children:[(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase`,children:[`⬢ `,e.groupName]}),(0,x.jsx)(`button`,{onClick:async()=>{r(!0),a(``);try{let n=await new E(e.serverUrl).syncGroup(e.groupName);t({type:`SET_GROUP_CONTRACTS`,contracts:n.contracts,links:n.links,syncedAt:n.syncedAt})}catch(e){a(e instanceof Error?e.message:`Sync failed`)}finally{r(!1)}},disabled:n,className:`text-[10px] text-accent hover:text-accent/80 border border-accent/30 hover:border-accent/60 rounded px-1.5 py-0.5 transition disabled:opacity-50`,children:n?`⟳ syncing…`:`↻ sync`})]}),i&&(0,x.jsx)(`p`,{className:`text-red-400 text-[10px] mt-1`,children:i}),e.groupSyncedAt&&(0,x.jsxs)(`p`,{className:`text-[10px] text-text-muted`,children:[`Last sync: `,new Date(e.groupSyncedAt).toLocaleString()]})]}),(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-2`,children:[`Members (`,e.groupMembers.length,`)`]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:e.groupMembers.map(e=>(0,x.jsxs)(`div`,{className:`bg-surface rounded-md px-2 py-1.5 border border-border-subtle`,children:[(0,x.jsx)(`div`,{className:`text-[10px] text-text-muted font-mono truncate`,children:e.groupPath}),(0,x.jsx)(`div`,{className:`text-xs text-accent font-medium truncate`,children:e.registryName})]},e.groupPath))})]}),e.groupContracts.length>0&&(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-2`,children:[`Contracts (`,e.groupContracts.length,`)`]}),(0,x.jsx)(`div`,{className:`space-y-0.5 max-h-40 overflow-y-auto scrollbar-thin`,children:e.groupContracts.slice(0,30).map((e,t)=>(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 py-0.5`,children:[(0,x.jsx)(`span`,{className:`text-[9px] px-1 rounded font-mono ${e.kind===`export`?`bg-accent/20 text-accent`:e.kind===`route`?`bg-node-function/20 text-node-function`:e.kind===`event`?`bg-node-interface/20 text-node-interface`:`bg-elevated text-text-muted`}`,children:e.kind}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-secondary truncate`,children:e.name}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted ml-auto shrink-0`,children:e.repoName})]},t))})]}),e.groupLinks.length>0&&(0,x.jsxs)(`div`,{className:`p-3`,children:[(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-2`,children:[`Cross-repo Links (`,e.groupLinks.length,`)`]}),(0,x.jsx)(`div`,{className:`space-y-1 max-h-48 overflow-y-auto scrollbar-thin`,children:e.groupLinks.filter(e=>e.confidence>=.7).slice(0,20).map((e,t)=>(0,x.jsxs)(`div`,{className:`bg-surface rounded-md px-2 py-1.5 border border-border-subtle text-[10px]`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1 mb-0.5`,children:[(0,x.jsx)(`span`,{className:`text-node-function font-mono`,children:e.providerRepo}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:`∷`}),(0,x.jsx)(`span`,{className:`text-text-primary truncate`,children:e.providerContract})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(`span`,{className:`text-text-muted pl-3`,children:`↔`}),(0,x.jsx)(`span`,{className:`text-accent font-mono`,children:e.consumerRepo}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:`∷`}),(0,x.jsx)(`span`,{className:`text-text-primary truncate`,children:e.consumerContract}),(0,x.jsxs)(`span`,{className:`ml-auto text-text-muted`,children:[(e.confidence*100).toFixed(0),`%`]})]})]},t))})]}),e.groupContracts.length===0&&e.groupMembers.length>0&&(0,x.jsxs)(`div`,{className:`p-3 text-center`,children:[(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted`,children:`No contract data yet.`}),(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted mt-1`,children:`Click ↻ sync to extract contracts.`})]})]})}function oo(){let{state:e}=T();switch(e.view){case`login`:return(0,x.jsx)(D,{});case`connect`:return(0,x.jsx)(A,{});case`loading`:return(0,x.jsx)(re,{});case`exploring`:return(0,x.jsx)(io,{})}}function so(){return(0,x.jsx)(ee,{children:(0,x.jsx)(oo,{})})}y.createRoot(document.getElementById(`root`)).render((0,x.jsx)(b.StrictMode,{children:(0,x.jsx)(so,{})}));export{c as n,o as t};