@vohongtho.infotech/code-intel 1.0.1 → 1.0.2
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.
- package/README.md +24 -3
- package/dist/cli/hook.js +348 -0
- package/dist/cli/hook.js.map +1 -0
- package/dist/cli/main.js +1039 -46
- package/dist/cli/main.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +229 -112
- package/dist/index.js.map +1 -1
- package/dist/web/assets/{es-Bu8iwdFw.js → es-DiINqj58.js} +1 -1
- package/dist/web/assets/index-CzWucUxe.js +354 -0
- package/dist/web/assets/index-D3zJQH9-.css +2 -0
- package/dist/web/index.html +2 -2
- package/package.json +3 -2
- package/dist/web/assets/index-C9M6YLlS.css +0 -2
- package/dist/web/assets/index-CKc3HEpe.js +0 -354
|
@@ -1,354 +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},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function k(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function A(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 j(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,j(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+k(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+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+k(a,u),c+=j(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+k(a,u++),c+=j(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return j(A(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 M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(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 N=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)},P={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,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)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},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,N)}catch(e){N(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,O());else{var t=n(l);t!==null&&k(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=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&&E());){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&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function k(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,k(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,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`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?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 T:return`Suspense`;case E:return`SuspenseList`;case ee: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 D:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var ne=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},re=[],I=-1;function ie(e){return{current:e}}function L(e){0>I||(e.current=re[I],re[I]=null,I--)}function R(e,t){I++,re[I]=e.current,e.current=t}var ae=ie(null),z=ie(null),B=ie(null),V=ie(null);function oe(e,t){switch(R(B,t),R(z,e),R(ae,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}}L(ae),R(ae,e)}function H(){L(ae),L(z),L(B)}function U(e){e.memoizedState!==null&&R(V,e);var t=ae.current,n=Hd(t,e.type);t!==n&&(R(z,e),R(ae,n))}function W(e){z.current===e&&(L(ae),L(z)),V.current===e&&(L(V),Qf._currentValue=F)}var se,ce;function le(e){if(se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);se=t&&t[1]||``,ce=-1<e.stack.indexOf(`
|
|
2
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+se+e+ce}var ue=!1;function de(e,t){if(!e||ue)return``;ue=!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{ue=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?le(n):``}function fe(e,t){switch(e.tag){case 26:case 27:case 5:return le(e.type);case 16:return le(`Lazy`);case 13:return e.child!==t&&t!==null?le(`Suspense Fallback`):le(`Suspense`);case 19:return le(`SuspenseList`);case 0:case 15:return de(e.type,!1);case 11:return de(e.type.render,!1);case 1:return de(e.type,!0);case 31:return le(`Activity`);default:return``}}function pe(e){try{var t=``,n=null;do t+=fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var me=Object.prototype.hasOwnProperty,he=t.unstable_scheduleCallback,ge=t.unstable_cancelCallback,_e=t.unstable_shouldYield,ve=t.unstable_requestPaint,ye=t.unstable_now,be=t.unstable_getCurrentPriorityLevel,xe=t.unstable_ImmediatePriority,Se=t.unstable_UserBlockingPriority,Ce=t.unstable_NormalPriority,we=t.unstable_LowPriority,Te=t.unstable_IdlePriority,Ee=t.log,De=t.unstable_setDisableYieldValue,Oe=null,ke=null;function Ae(e){if(typeof Ee==`function`&&De(e),ke&&typeof ke.setStrictMode==`function`)try{ke.setStrictMode(Oe,e)}catch{}}var je=Math.clz32?Math.clz32:Pe,Me=Math.log,Ne=Math.LN2;function Pe(e){return e>>>=0,e===0?32:31-(Me(e)/Ne|0)|0}var Fe=256,Ie=262144,Le=4194304;function Re(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 ze(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=Re(n))):i=Re(o):i=Re(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Re(n))):i=Re(o)):i=Re(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 Be(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ve(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 He(){var e=Le;return Le<<=1,!(Le&62914560)&&(Le=4194304),e}function Ue(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function We(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ge(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-je(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&&Ke(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ke(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Je(e,t){var n=t&-t;return n=n&42?1:Ye(n),(n&(e.suspendedLanes|t))===0?n:0}function Ye(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 Xe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ze(){var e=P.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function Qe(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var $e=Math.random().toString(36).slice(2),et=`__reactFiber$`+$e,tt=`__reactProps$`+$e,nt=`__reactContainer$`+$e,rt=`__reactEvents$`+$e,it=`__reactListeners$`+$e,at=`__reactHandles$`+$e,ot=`__reactResources$`+$e,st=`__reactMarker$`+$e;function ct(e){delete e[et],delete e[tt],delete e[rt],delete e[it],delete e[at]}function lt(e){var t=e[et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nt]||n[et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[et])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function ut(e){if(e=e[et]||e[nt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ft(e){var t=e[ot];return t||=e[ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function pt(e){e[st]=!0}var mt=new Set,ht={};function gt(e,t){_t(e,t),_t(e+`Capture`,t)}function _t(e,t){for(ht[e]=t,e=0;e<t.length;e++)mt.add(t[e])}var vt=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]*$`),yt={},bt={};function xt(e){return me.call(bt,e)?!0:me.call(yt,e)?!1:vt.test(e)?bt[e]=!0:(yt[e]=!0,!1)}function St(e,t,n){if(xt(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 Ct(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 wt(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 Tt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Et(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Dt(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 Ot(e){if(!e._valueTracker){var t=Et(e)?`checked`:`value`;e._valueTracker=Dt(e,t,``+e[t])}}function kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Et(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function At(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 jt=/[\n"\\]/g;function G(e){return e.replace(jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Mt(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=``+Tt(t)):e.value!==``+Tt(t)&&(e.value=``+Tt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Pt(e,o,Tt(n)):Pt(e,o,Tt(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=``+Tt(s):e.removeAttribute(`name`)}function Nt(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)){Ot(e);return}n=n==null?``:``+Tt(n),t=t==null?n:``+Tt(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),Ot(e)}function Pt(e,t,n){t===`number`&&At(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ft(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=``+Tt(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 It(e,t,n){if(t!=null&&(t=``+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Tt(n)}function Lt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Tt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ot(e)}function Rt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zt=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 Bt(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||zt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Vt(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&&Bt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Bt(e,o,t[o])}function Ht(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 Ut=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`]]),Wt=/^[\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 Gt(e){return Wt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Kt(){}var qt=null;function Jt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yt=null,Xt=null;function Zt(e){var t=ut(e);if(t&&(e=t.stateNode)){var n=e[tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Mt(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="`+G(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[tt]||null;if(!a)throw Error(i(90));Mt(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&&kt(r)}break a;case`textarea`:It(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ft(e,!!n.multiple,t,!1)}}}var Qt=!1;function $t(e,t,n){if(Qt)return e(t,n);Qt=!0;try{return e(t)}finally{if(Qt=!1,(Yt!==null||Xt!==null)&&(vu(),Yt&&(t=Yt,e=Xt,Xt=Yt=null,Zt(t),e)))for(t=0;t<e.length;t++)Zt(e[t])}}function en(e,t){var n=e.stateNode;if(n===null)return null;var r=n[tt]||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 tn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),nn=!1;if(tn)try{var rn={};Object.defineProperty(rn,`passive`,{get:function(){nn=!0}}),window.addEventListener(`test`,rn,rn),window.removeEventListener(`test`,rn,rn)}catch{nn=!1}var an=null,on=null,sn=null;function cn(){if(sn)return sn;var e,t=on,n=t.length,r,i=`value`in an?an.value:an.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 sn=i.slice(e,1<r?1-r:void 0)}function ln(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 un(){return!0}function dn(){return!1}function fn(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)?un:dn,this.isPropagationStopped=dn,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=un)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=un)},persist:function(){},isPersistent:un}),t}var pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mn=fn(pn),hn=h({},pn,{view:0,detail:0}),gn=fn(hn),_n,K,vn,q=h({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kn,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!==vn&&(vn&&e.type===`mousemove`?(_n=e.screenX-vn.screenX,K=e.screenY-vn.screenY):K=_n=0,vn=e),_n)},movementY:function(e){return`movementY`in e?e.movementY:K}}),yn=fn(q),bn=fn(h({},q,{dataTransfer:0})),xn=fn(h({},hn,{relatedTarget:0})),Sn=fn(h({},pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Cn=fn(h({},pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),wn=fn(h({},pn,{data:0})),Tn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},En={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`},Dn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function On(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dn[e])?!!t[e]:!1}function kn(){return On}var An=fn(h({},hn,{key:function(e){if(e.key){var t=Tn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?En[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kn,charCode:function(e){return e.type===`keypress`?ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),jn=fn(h({},q,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Mn=fn(h({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kn})),Nn=fn(h({},pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Pn=fn(h({},q,{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})),Fn=fn(h({},pn,{newState:0,oldState:0})),In=[9,13,27,32],Ln=tn&&`CompositionEvent`in window,Rn=null;tn&&`documentMode`in document&&(Rn=document.documentMode);var zn=tn&&`TextEvent`in window&&!Rn,Bn=tn&&(!Ln||Rn&&8<Rn&&11>=Rn),Vn=` `,Hn=!1;function Un(e,t){switch(e){case`keyup`:return In.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Wn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Gn=!1;function Kn(e,t){switch(e){case`compositionend`:return Wn(t);case`keypress`:return t.which===32?(Hn=!0,Vn):null;case`textInput`:return e=t.data,e===Vn&&Hn?null:e;default:return null}}function qn(e,t){if(Gn)return e===`compositionend`||!Ln&&Un(e,t)?(e=cn(),sn=on=an=null,Gn=!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 Bn&&t.locale!==`ko`?null:t.data;default:return null}}var Jn={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 Yn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Jn[e.type]:t===`textarea`}function Xn(e,t,n,r){Yt?Xt?Xt.push(r):Xt=[r]:Yt=r,t=Td(t,`onChange`),0<t.length&&(n=new mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Zn=null,Qn=null;function $n(e){vd(e,0)}function er(e){if(kt(dt(e)))return e}function tr(e,t){if(e===`change`)return t}var nr=!1;if(tn){var rr;if(tn){var ir=`oninput`in document;if(!ir){var ar=document.createElement(`div`);ar.setAttribute(`oninput`,`return;`),ir=typeof ar.oninput==`function`}rr=ir}else rr=!1;nr=rr&&(!document.documentMode||9<document.documentMode)}function or(){Zn&&(Zn.detachEvent(`onpropertychange`,sr),Qn=Zn=null)}function sr(e){if(e.propertyName===`value`&&er(Qn)){var t=[];Xn(t,Qn,e,Jt(e)),$t($n,t)}}function cr(e,t,n){e===`focusin`?(or(),Zn=t,Qn=n,Zn.attachEvent(`onpropertychange`,sr)):e===`focusout`&&or()}function lr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return er(Qn)}function ur(e,t){if(e===`click`)return er(t)}function dr(e,t){if(e===`input`||e===`change`)return er(t)}function fr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var pr=typeof Object.is==`function`?Object.is:fr;function mr(e,t){if(pr(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(!me.call(t,i)||!pr(e[i],t[i]))return!1}return!0}function hr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gr(e,t){var n=hr(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=hr(n)}}function _r(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_r(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=At(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=At(e.document)}return t}function yr(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 br=tn&&`documentMode`in document&&11>=document.documentMode,xr=null,Sr=null,Cr=null,wr=!1;function Tr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wr||xr==null||xr!==At(r)||(r=xr,`selectionStart`in r&&yr(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}),Cr&&mr(Cr,r)||(Cr=r,r=Td(Sr,`onSelect`),0<r.length&&(t=new mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=xr)))}function Er(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Dr={animationend:Er(`Animation`,`AnimationEnd`),animationiteration:Er(`Animation`,`AnimationIteration`),animationstart:Er(`Animation`,`AnimationStart`),transitionrun:Er(`Transition`,`TransitionRun`),transitionstart:Er(`Transition`,`TransitionStart`),transitioncancel:Er(`Transition`,`TransitionCancel`),transitionend:Er(`Transition`,`TransitionEnd`)},Or={},kr={};tn&&(kr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Dr.animationend.animation,delete Dr.animationiteration.animation,delete Dr.animationstart.animation),`TransitionEvent`in window||delete Dr.transitionend.transition);function Ar(e){if(Or[e])return Or[e];if(!Dr[e])return e;var t=Dr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in kr)return Or[e]=t[n];return e}var jr=Ar(`animationend`),Mr=Ar(`animationiteration`),Nr=Ar(`animationstart`),Pr=Ar(`transitionrun`),Fr=Ar(`transitionstart`),Ir=Ar(`transitioncancel`),Lr=Ar(`transitionend`),Rr=new Map,zr=`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(` `);zr.push(`scrollEnd`);function Br(e,t){Rr.set(e,t),gt(t,[e])}var Vr=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)},Hr=[],Ur=0,Wr=0;function Gr(){for(var e=Ur,t=Wr=Ur=0;t<e;){var n=Hr[t];Hr[t++]=null;var r=Hr[t];Hr[t++]=null;var i=Hr[t];Hr[t++]=null;var a=Hr[t];if(Hr[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&&Yr(n,i,a)}}function Kr(e,t,n,r){Hr[Ur++]=e,Hr[Ur++]=t,Hr[Ur++]=n,Hr[Ur++]=r,Wr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function qr(e,t,n,r){return Kr(e,t,n,r),Xr(e)}function Jr(e,t){return Kr(e,null,null,t),Xr(e)}function Yr(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-je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Xr(e){if(50<lu)throw lu=0,uu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zr={};function Qr(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 $r(e,t,n,r){return new Qr(e,t,n,r)}function ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ti(e,t){var n=e.alternate;return n===null?(n=$r(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 ni(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 ri(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ei(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ae.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=$r(31,n,t,a),e.elementType=ee,e.lanes=o,e;case y:return ii(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=$r(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=$r(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=$r(19,n,t,a),e.elementType=E,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 D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=$r(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ii(e,t,n,r){return e=$r(7,e,r,t),e.lanes=n,e}function ai(e,t,n){return e=$r(6,e,null,t),e.lanes=n,e}function oi(e){var t=$r(18,null,null,0);return t.stateNode=e,t}function si(e,t,n){return t=$r(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ci=new WeakMap;function li(e,t){if(typeof e==`object`&&e){var n=ci.get(e);return n===void 0?(t={value:e,source:t,stack:pe(t)},ci.set(e,t),t):n}return{value:e,source:t,stack:pe(t)}}var ui=[],di=0,fi=null,pi=0,mi=[],hi=0,gi=null,_i=1,vi=``;function yi(e,t){ui[di++]=pi,ui[di++]=fi,fi=e,pi=t}function bi(e,t,n){mi[hi++]=_i,mi[hi++]=vi,mi[hi++]=gi,gi=e;var r=_i;e=vi;var i=32-je(r)-1;r&=~(1<<i),n+=1;var a=32-je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,_i=1<<32-je(t)+i|n<<i|r,vi=a+e}else _i=1<<a|n<<i|r,vi=e}function xi(e){e.return!==null&&(yi(e,1),bi(e,1,0))}function Si(e){for(;e===fi;)fi=ui[--di],ui[di]=null,pi=ui[--di],ui[di]=null;for(;e===gi;)gi=mi[--hi],mi[hi]=null,vi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null}function Ci(e,t){mi[hi++]=_i,mi[hi++]=vi,mi[hi++]=gi,_i=t.id,vi=t.overflow,gi=e}var wi=null,Ti=null,J=!1,Ei=null,Di=!1,Oi=Error(i(519));function ki(e){throw Fi(li(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Oi}function Ai(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[et]=e,t[tt]=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),Nt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Lt(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=Kt),t=!0):t=!1,t||ki(e,!0)}function ji(e){for(wi=e.return;wi;)switch(wi.tag){case 5:case 31:case 13:Di=!1;return;case 27:case 3:Di=!0;return;default:wi=wi.return}}function Mi(e){if(e!==wi)return!1;if(!J)return ji(e),J=!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&&Ti&&ki(e),ji(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ti=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ti=uf(e)}else t===27?(t=Ti,Zd(e.type)?(e=lf,lf=null,Ti=e):Ti=t):Ti=wi?cf(e.stateNode.nextSibling):null;return!0}function Ni(){Ti=wi=null,J=!1}function Pi(){var e=Ei;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),Ei=null),e}function Fi(e){Ei===null?Ei=[e]:Ei.push(e)}var Ii=ie(null),Li=null,Ri=null;function zi(e,t,n){R(Ii,t._currentValue),t._currentValue=n}function Bi(e){e._currentValue=Ii.current,L(Ii)}function Vi(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 Hi(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),Vi(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),Vi(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 Ui(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;pr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===V.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&&Hi(t,e,n,r),t.flags|=262144}function Wi(e){for(e=e.firstContext;e!==null;){if(!pr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Gi(e){Li=e,Ri=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ki(e){return Ji(Li,e)}function qi(e,t){return Li===null&&Gi(e),Ji(e,t)}function Ji(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ri===null){if(e===null)throw Error(i(308));Ri=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ri=Ri.next=t;return n}var Yi=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()})}},Xi=t.unstable_scheduleCallback,Zi=t.unstable_NormalPriority,Qi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $i(){return{controller:new Yi,data:new Map,refCount:0}}function ea(e){e.refCount--,e.refCount===0&&Xi(Zi,function(){e.controller.abort()})}var ta=null,na=0,ra=0,ia=null;function aa(e,t){if(ta===null){var n=ta=[];na=0,ra=ud(),ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return na++,t.then(oa,oa),t}function oa(){if(--na===0&&ta!==null){ia!==null&&(ia.status=`fulfilled`);var e=ta;ta=null,ra=0,ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sa(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 ca=N.S;N.S=function(e,t){Ql=ye(),typeof t==`object`&&t&&typeof t.then==`function`&&aa(e,t),ca!==null&&ca(e,t)};var la=ie(null);function ua(){var e=la.current;return e===null?Fl.pooledCache:e}function da(e,t){t===null?R(la,la.current):R(la,t.pool)}function fa(){var e=ua();return e===null?null:{parent:Qi._currentValue,pool:e}}var pa=Error(i(460)),ma=Error(i(474)),ha=Error(i(542)),ga={then:function(){}};function _a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function va(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Kt,Kt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Sa(e),e;default:if(typeof t.status==`string`)t.then(Kt,Kt);else{if(e=Fl,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,Sa(e),e}throw ba=t,pa}}function ya(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ba=e,pa):e}}var ba=null;function xa(){if(ba===null)throw Error(i(459));var e=ba;return ba=null,e}function Sa(e){if(e===pa||e===ha)throw Error(i(483))}var Ca=null,wa=0;function Ta(e){var t=wa;return wa+=1,Ca===null&&(Ca=[]),va(Ca,e,t)}function Ea(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Da(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 Oa(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=ti(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=ai(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===O&&ya(i)===t.type)?(t=a(t,n.props),Ea(t,n),t.return=e,t):(t=ri(n.type,n.key,n.props,null,e.mode,r),Ea(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=si(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=ii(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=ai(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ri(t.type,t.key,t.props,null,e.mode,n),Ea(n,t),n.return=e,n;case v:return t=si(t,e.mode,n),t.return=e,t;case O:return t=ya(t),f(e,t,n)}if(ne(t)||A(t))return t=ii(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ta(t),n);if(t.$$typeof===C)return f(e,qi(e,t),n);Da(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 O:return n=ya(n),p(e,t,n,r)}if(ne(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ta(n),r);if(n.$$typeof===C)return p(e,t,qi(e,n),r);Da(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 O:return r=ya(r),m(e,t,n,r,i)}if(ne(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ta(r),i);if(r.$$typeof===C)return m(e,t,n,qi(t,r),i);Da(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),J&&yi(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 J&&yi(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)}),J&&yi(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),J&&yi(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 J&&yi(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)}),J&&yi(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===O&&ya(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ea(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ii(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ri(o.type,o.key,o.props,null,e.mode,c),Ea(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=si(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=ya(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(A(o)){if(l=A(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,Ta(o),c);if(o.$$typeof===C)return b(e,r,qi(e,o),c);Da(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=ai(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{wa=0;var i=b(e,t,n,r);return Ca=null,i}catch(t){if(t===pa||t===ha)throw t;var a=$r(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ka=Oa(!0),Aa=Oa(!1),ja=!1;function Ma(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Na(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 Pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Fa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Xr(e),Yr(e,null,n),t}return Kr(e,r,t,n),Xr(e)}function Ia(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,qe(e,n)}}function La(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 Ra=!1;function za(){if(Ra){var e=ia;if(e!==null)throw e}}function Ba(e,t,n,r){Ra=!1;var i=e.updateQueue;ja=!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?(Q&f)===f:(r&f)===f){f!==0&&f===ra&&(Ra=!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:ja=!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),Ul|=o,e.lanes=o,e.memoizedState=d}}function Va(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ha(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Va(n[e],t)}var Ua=ie(null),Wa=ie(0);function Ga(e,t){e=Vl,R(Wa,e),R(Ua,t),Vl=e|t.baseLanes}function Ka(){R(Wa,Vl),R(Ua,Ua.current)}function qa(){Vl=Wa.current,L(Ua),L(Wa)}var Ja=ie(null),Ya=null;function Xa(e){var t=e.alternate;R(to,to.current&1),R(Ja,e),Ya===null&&(t===null||Ua.current!==null||t.memoizedState!==null)&&(Ya=e)}function Za(e){R(to,to.current),R(Ja,e),Ya===null&&(Ya=e)}function Qa(e){e.tag===22?(R(to,to.current),R(Ja,e),Ya===null&&(Ya=e)):$a(e)}function $a(){R(to,to.current),R(Ja,Ja.current)}function eo(e){L(Ja),Ya===e&&(Ya=null),L(to)}var to=ie(0);function no(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 ro=0,Y=null,io=null,ao=null,oo=!1,so=!1,co=!1,lo=0,uo=0,fo=null,po=0;function mo(){throw Error(i(321))}function ho(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!pr(e[n],t[n]))return!1;return!0}function go(e,t,n,r,i,a){return ro=a,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ns:Ps,co=!1,a=n(r,i),co=!1,so&&(a=vo(t,n,r,i)),_o(e),a}function _o(e){N.H=Ms;var t=io!==null&&io.next!==null;if(ro=0,ao=io=Y=null,oo=!1,uo=0,fo=null,t)throw Error(i(300));e===null||Zs||(e=e.dependencies,e!==null&&Wi(e)&&(Zs=!0))}function vo(e,t,n,r){Y=e;var a=0;do{if(so&&(fo=null),uo=0,so=!1,25<=a)throw Error(i(301));if(a+=1,ao=io=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Fs,o=t(n,r)}while(so);return o}function yo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Eo(t):t,e=e.useState()[0],(io===null?null:io.memoizedState)!==e&&(Y.flags|=1024),t}function bo(){var e=lo!==0;return lo=0,e}function xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function So(e){if(oo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}oo=!1}ro=0,ao=io=Y=null,so=!1,uo=lo=0,fo=null}function Co(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ao===null?Y.memoizedState=ao=e:ao=ao.next=e,ao}function wo(){if(io===null){var e=Y.alternate;e=e===null?null:e.memoizedState}else e=io.next;var t=ao===null?Y.memoizedState:ao.next;if(t!==null)ao=t,io=e;else{if(e===null)throw Y.alternate===null?Error(i(467)):Error(i(310));io=e,e={memoizedState:io.memoizedState,baseState:io.baseState,baseQueue:io.baseQueue,queue:io.queue,next:null},ao===null?Y.memoizedState=ao=e:ao=ao.next=e}return ao}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var t=uo;return uo+=1,fo===null&&(fo=[]),e=va(fo,e,t),t=Y,(ao===null?t.memoizedState:ao.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ns:Ps),e}function Do(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Eo(e);if(e.$$typeof===C)return Ki(e)}throw Error(i(438,String(e)))}function Oo(e){var t=null,n=Y.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Y.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=To(),Y.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]=te;return t.index++,n}function ko(e,t){return typeof t==`function`?t(e):t}function Ao(e){return jo(wo(),io,e)}function jo(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?(ro&f)===f:(Q&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===ra&&(d=!0);else if((ro&p)===p){u=u.next,p===ra&&(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,Y.lanes|=p,Ul|=p;f=u.action,co&&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,Y.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!pr(o,e.memoizedState)&&(Zs=!0,d&&(n=ia,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 Mo(e){var t=wo(),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);pr(o,t.memoizedState)||(Zs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function No(e,t,n){var r=Y,a=wo(),o=J;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!pr((io||a).memoizedState,n);if(s&&(a.memoizedState=n,Zs=!0),a=a.queue,is(Io.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ao!==null&&ao.memoizedState.tag&1){if(r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||ro&127||Po(r,t,n)}return n}function Po(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Y.updateQueue,t===null?(t=To(),Y.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Fo(e,t,n,r){t.value=n,t.getSnapshot=r,Lo(t)&&Ro(e)}function Io(e,t,n){return n(function(){Lo(t)&&Ro(e)})}function Lo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pr(e,n)}catch{return!0}}function Ro(e){var t=Jr(e,2);t!==null&&pu(t,e,2)}function zo(e){var t=Co();if(typeof e==`function`){var n=e;if(e=n(),co){Ae(!0);try{n()}finally{Ae(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:e},t}function Bo(e,t,n,r){return e.baseState=n,jo(e,io,typeof r==`function`?r:ko)}function Vo(e,t,n,r,a){if(ks(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)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ho(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ho(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Uo(e,t,s)}catch(n){Go(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Uo(e,t,a)}catch(n){Go(e,t,n)}}function Uo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Wo(e,t,n)},function(n){return Go(e,t,n)}):Wo(e,t,n)}function Wo(e,t,n){t.status=`fulfilled`,t.value=n,Ko(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ho(e,n)))}function Go(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ko(t),t=t.next;while(t!==r)}e.action=null}function Ko(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qo(e,t){return t}function Jo(e,t){if(J){var n=Fl.formState;if(n!==null){a:{var r=Y;if(J){if(Ti){b:{for(var i=Ti,a=Di;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){Ti=cf(i.nextSibling),r=i.data===`F!`;break a}}ki(r)}r=!1}r&&(t=n[0])}}return n=Co(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:t},n.queue=r,n=Es.bind(null,Y,r),r.dispatch=n,r=zo(!1),a=Os.bind(null,Y,!1,r.queue),r=Co(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Vo.bind(null,Y,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Yo(e){return Xo(wo(),io,e)}function Xo(e,t,n){if(t=jo(e,t,qo)[0],e=Ao(ko)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Eo(t)}catch(e){throw e===pa?ha:e}else r=t;t=wo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Y.flags|=2048,$o(9,{destroy:void 0},Zo.bind(null,i,n),null)),[r,a,e]}function Zo(e,t){e.action=t}function Qo(e){var t=wo(),n=io;if(n!==null)return Xo(t,n,e);wo(),t=t.memoizedState,n=wo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function $o(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Y.updateQueue,t===null&&(t=To(),Y.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 es(){return wo().memoizedState}function ts(e,t,n,r){var i=Co();Y.flags|=e,i.memoizedState=$o(1|t,{destroy:void 0},n,r===void 0?null:r)}function ns(e,t,n,r){var i=wo();r=r===void 0?null:r;var a=i.memoizedState.inst;io!==null&&r!==null&&ho(r,io.memoizedState.deps)?i.memoizedState=$o(t,a,n,r):(Y.flags|=e,i.memoizedState=$o(1|t,a,n,r))}function rs(e,t){ts(8390656,8,e,t)}function is(e,t){ns(2048,8,e,t)}function as(e){Y.flags|=4;var t=Y.updateQueue;if(t===null)t=To(),Y.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function os(e){var t=wo().memoizedState;return as({ref:t,nextImpl:e}),function(){if(X&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ss(e,t){return ns(4,2,e,t)}function cs(e,t){return ns(4,4,e,t)}function ls(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 us(e,t,n){n=n==null?null:n.concat([e]),ns(4,4,ls.bind(null,t,e),n)}function ds(){}function fs(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ho(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ps(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ho(t,r[1]))return r[0];if(r=e(),co){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[r,t],r}function ms(e,t,n){return n===void 0||ro&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),Y.lanes|=e,Ul|=e,n)}function hs(e,t,n,r){return pr(n,t)?n:Ua.current===null?!(ro&42)||ro&1073741824&&!(Q&261930)?(Zs=!0,e.memoizedState=n):(e=fu(),Y.lanes|=e,Ul|=e,t):(e=ms(e,n,r),pr(e,t)||(Zs=!0),e)}function gs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Os(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ds(e,t,sa(c,r),du(e)):Ds(e,t,r,du(e))}catch(n){Ds(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function _s(){}function vs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ys(e).queue;gs(e,a,t,F,n===null?_s:function(){return bs(e),n(r)})}function ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bs(e){var t=ys(e);t.next===null&&(t=e.alternate.memoizedState),Ds(e,t.next.queue,{},du())}function xs(){return Ki(Qf)}function Ss(){return wo().memoizedState}function Cs(){return wo().memoizedState}function ws(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Pa(n);var r=Fa(t,e,n);r!==null&&(pu(r,t,n),Ia(r,t,n)),t={cache:$i()},e.payload=t;return}t=t.return}}function Ts(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ks(e)?As(t,n):(n=qr(e,t,n,r),n!==null&&(pu(n,e,r),js(n,t,r)))}function Es(e,t,n){Ds(e,t,n,du())}function Ds(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ks(e))As(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,pr(s,o))return Kr(e,t,i,0),Fl===null&&Gr(),!1}catch{}if(n=qr(e,t,i,r),n!==null)return pu(n,e,r),js(n,t,r),!0}return!1}function Os(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ks(e)){if(t)throw Error(i(479))}else t=qr(e,n,r,2),t!==null&&pu(t,e,2)}function ks(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function As(e,t){so=oo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function js(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}var Ms={readContext:Ki,use:Do,useCallback:mo,useContext:mo,useEffect:mo,useImperativeHandle:mo,useLayoutEffect:mo,useInsertionEffect:mo,useMemo:mo,useReducer:mo,useRef:mo,useState:mo,useDebugValue:mo,useDeferredValue:mo,useTransition:mo,useSyncExternalStore:mo,useId:mo,useHostTransitionStatus:mo,useFormState:mo,useActionState:mo,useOptimistic:mo,useMemoCache:mo,useCacheRefresh:mo};Ms.useEffectEvent=mo;var Ns={readContext:Ki,use:Do,useCallback:function(e,t){return Co().memoizedState=[e,t===void 0?null:t],e},useContext:Ki,useEffect:rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ts(4194308,4,ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){ts(4,2,e,t)},useMemo:function(e,t){var n=Co();t=t===void 0?null:t;var r=e();if(co){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Co();if(n!==void 0){var i=n(t);if(co){Ae(!0);try{n(t)}finally{Ae(!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=Ts.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=Co();return e={current:e},t.memoizedState=e},useState:function(e){e=zo(e);var t=e.queue,n=Es.bind(null,Y,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ds,useDeferredValue:function(e,t){return ms(Co(),e,t)},useTransition:function(){var e=zo(!1);return e=gs.bind(null,Y,e.queue,!0,!1),Co().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Y,a=Co();if(J){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Q&127||Po(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,rs(Io.bind(null,r,o,e),[e]),r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,o,n,t),null),n},useId:function(){var e=Co(),t=Fl.identifierPrefix;if(J){var n=vi,r=_i;n=(r&~(1<<32-je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=lo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=po++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:xs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e){var t=Co();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Os.bind(null,Y,!0,n),n.dispatch=t,[e,t]},useMemoCache:Oo,useCacheRefresh:function(){return Co().memoizedState=ws.bind(null,Y)},useEffectEvent:function(e){var t=Co(),n={impl:e};return t.memoizedState=n,function(){if(X&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ps={readContext:Ki,use:Do,useCallback:fs,useContext:Ki,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Ao,useRef:es,useState:function(){return Ao(ko)},useDebugValue:ds,useDeferredValue:function(e,t){return hs(wo(),io.memoizedState,e,t)},useTransition:function(){var e=Ao(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Yo,useActionState:Yo,useOptimistic:function(e,t){return Bo(wo(),io,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Ps.useEffectEvent=os;var Fs={readContext:Ki,use:Do,useCallback:fs,useContext:Ki,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Mo,useRef:es,useState:function(){return Mo(ko)},useDebugValue:ds,useDeferredValue:function(e,t){var n=wo();return io===null?ms(n,e,t):hs(n,io.memoizedState,e,t)},useTransition:function(){var e=Mo(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){var n=wo();return io===null?(n.baseState=e,[e,n.queue.dispatch]):Bo(n,io,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Fs.useEffectEvent=os;function Is(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 Ls={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Pa(r);i.payload=t,n!=null&&(i.callback=n),t=Fa(e,i,r),t!==null&&(pu(t,e,r),Ia(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Pa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Fa(e,i,r),t!==null&&(pu(t,e,r),Ia(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Pa(n);r.tag=2,t!=null&&(r.callback=t),t=Fa(e,r,n),t!==null&&(pu(t,e,n),Ia(t,e,n))}};function Rs(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?!mr(n,r)||!mr(i,a):!0}function zs(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&&Ls.enqueueReplaceState(t,t.state,null)}function Bs(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 Vs(e){Vr(e)}function Hs(e){console.error(e)}function Us(e){Vr(e)}function Ws(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Gs(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 Ks(e,t,n){return n=Pa(n),n.tag=3,n.payload={element:null},n.callback=function(){Ws(e,t)},n}function qs(e){return e=Pa(e),e.tag=3,e}function Js(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(){Gs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Gs(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ys(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ui(t,n,a,!0),n=Ja.current,n!==null){switch(n.tag){case 31:case 13:return Ya===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ga?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===ga?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),Tu(),!1}if(J)return t=Ja.current,t===null?(r!==Oi&&(t=Error(i(423),{cause:r}),Fi(li(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=li(r,n),a=Ks(e.stateNode,r,a),La(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Oi&&(e=Error(i(422),{cause:r}),Fi(li(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=li(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ks(n.stateNode,r,e),La(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`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=qs(a),Js(a,e,n,r),La(n,a),!1}n=n.return}while(n!==null);return!1}var Xs=Error(i(461)),Zs=!1;function Qs(e,t,n,r){t.child=e===null?Aa(t,null,n,r):ka(t,e.child,n,r)}function $s(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 Gi(t),r=go(e,t,n,o,a,i),s=bo(),e!==null&&!Zs?(xo(e,t,i),Cc(e,t,i)):(J&&s&&xi(t),t.flags|=1,Qs(e,t,r,i),t.child)}function ec(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ei(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,tc(e,t,a,r,i)):(e=ri(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!wc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?mr:n,n(o,r)&&e.ref===t.ref)return Cc(e,t,i)}return t.flags|=1,e=ti(a,r),e.ref=t.ref,e.return=t,t.child=e}function tc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(mr(a,r)&&e.ref===t.ref)if(Zs=!1,t.pendingProps=r=a,wc(e,i))e.flags&131072&&(Zs=!0);else return t.lanes=e.lanes,Cc(e,t,i)}return lc(e,t,n,r,i)}function nc(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 ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&da(t,a===null?null:a.cachePool),a===null?Ka():Ga(t,a),Qa(t);else return r=t.lanes=536870912,ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&da(t,null),Ka(),$a(t)):(da(t,a.cachePool),Ga(t,a),$a(t),t.memoizedState=null);return Qs(e,t,i,n),t.child}function rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ic(e,t,n,r,i){var a=ua();return a=a===null?null:{parent:Qi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&da(t,null),Ka(),Qa(t),e!==null&&Ui(e,t,r,!0),t.childLanes=i,null}function ac(e,t){return t=vc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function oc(e,t,n){return ka(t,e.child,null,n),e=ac(t,t.pendingProps),e.flags|=2,eo(t),t.memoizedState=null,e}function sc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(J){if(r.mode===`hidden`)return e=ac(t,r),t.lanes=536870912,rc(null,e);if(Za(t),(e=Ti)?(e=rf(e,Di),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gi===null?null:{id:_i,overflow:vi},retryLane:536870912,hydrationErrors:null},n=oi(e),n.return=t,t.child=n,wi=t,Ti=null)):e=null,e===null)throw ki(t);return t.lanes=536870912,null}return ac(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Za(t),a)if(t.flags&256)t.flags&=-257,t=oc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Zs||Ui(e,t,n,!1),a=(n&e.childLanes)!==0,Zs||a){if(r=Fl,r!==null&&(s=Je(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Jr(e,s),pu(r,e,s),Xs;Tu(),t=oc(e,t,n)}else e=o.treeContext,Ti=cf(s.nextSibling),wi=t,J=!0,Ei=null,Di=!1,e!==null&&Ci(t,e),t=ac(t,r),t.flags|=4096;return t}return e=ti(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function cc(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 lc(e,t,n,r,i){return Gi(t),n=go(e,t,n,r,void 0,i),r=bo(),e!==null&&!Zs?(xo(e,t,i),Cc(e,t,i)):(J&&r&&xi(t),t.flags|=1,Qs(e,t,n,i),t.child)}function uc(e,t,n,r,i,a){return Gi(t),t.updateQueue=null,n=vo(t,r,n,i),_o(e),r=bo(),e!==null&&!Zs?(xo(e,t,a),Cc(e,t,a)):(J&&r&&xi(t),t.flags|=1,Qs(e,t,n,a),t.child)}function dc(e,t,n,r,i){if(Gi(t),t.stateNode===null){var a=Zr,o=n.contextType;typeof o==`object`&&o&&(a=Ki(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ls,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ma(t),o=n.contextType,a.context=typeof o==`object`&&o?Ki(o):Zr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Is(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&&Ls.enqueueReplaceState(a,a.state,null),Ba(t,r,a,i),za(),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=Bs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Zr,typeof u==`object`&&u&&(o=Ki(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)&&zs(t,a,r,o),ja=!1;var f=t.memoizedState;a.state=f,Ba(t,r,a,i),za(),l=t.memoizedState,s||f!==l||ja?(typeof d==`function`&&(Is(t,n,d,r),l=t.memoizedState),(c=ja||Rs(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,Na(e,t),o=t.memoizedProps,u=Bs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Zr,typeof l==`object`&&l&&(c=Ki(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)&&zs(t,a,r,c),ja=!1,f=t.memoizedState,a.state=f,Ba(t,r,a,i),za();var p=t.memoizedState;o!==d||f!==p||ja||e!==null&&e.dependencies!==null&&Wi(e.dependencies)?(typeof s==`function`&&(Is(t,n,s,r),p=t.memoizedState),(u=ja||Rs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Wi(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,cc(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=ka(t,e.child,null,i),t.child=ka(t,null,n,i)):Qs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Cc(e,t,i),e}function fc(e,t,n,r){return Ni(),t.flags|=256,Qs(e,t,n,r),t.child}var pc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mc(e){return{baseLanes:e,cachePool:fa()}}function hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function gc(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:(to.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(J){if(a?Xa(t):$a(t),(e=Ti)?(e=rf(e,Di),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gi===null?null:{id:_i,overflow:vi},retryLane:536870912,hydrationErrors:null},n=oi(e),n.return=t,t.child=n,wi=t,Ti=null)):e=null,e===null)throw ki(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?($a(t),a=t.mode,c=vc({mode:`hidden`,children:c},a),r=ii(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(null,r)):(Xa(t),_c(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Xa(t),t.flags&=-257,t=yc(e,t,n)):t.memoizedState===null?($a(t),c=r.fallback,a=t.mode,r=vc({mode:`visible`,children:r.children},a),c=ii(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ka(t,e.child,null,n),r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,t=rc(null,r)):($a(t),t.child=e.child,t.flags|=128,t=null);else if(Xa(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,Fi({value:r,source:null,stack:null}),t=yc(e,t,n)}else if(Zs||Ui(e,t,n,!1),s=(n&e.childLanes)!==0,Zs||s){if(s=Fl,s!==null&&(r=Je(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Jr(e,r),pu(s,e,r),Xs;af(c)||Tu(),t=yc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ti=cf(c.nextSibling),wi=t,J=!0,Ei=null,Di=!1,e!==null&&Ci(t,e),t=_c(t,r.children),t.flags|=4096);return t}return a?($a(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ti(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ii(c,a,n,null),c.flags|=2):c=ti(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,rc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=mc(n):(a=c.cachePool,a===null?a=fa():(l=Qi._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(e.child,r)):(Xa(t),n=e.child,e=n.sibling,n=ti(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 _c(e,t){return t=vc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function vc(e,t){return e=$r(22,e,null,t),e.lanes=0,e}function yc(e,t,n){return ka(t,e.child,null,n),e=_c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Vi(e.return,t,n)}function xc(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 Sc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=to.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,R(to,o),Qs(e,t,r,n),r=J?pi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bc(e,n,t);else if(e.tag===19)bc(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&&no(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),xc(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&&no(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}xc(t,!0,n,null,a,r);break;case`together`:xc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ui(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=ti(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ti(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function wc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Wi(e))):!0}function Tc(e,t,n){switch(t.tag){case 3:oe(t,t.stateNode.containerInfo),zi(t,Qi,e.memoizedState.cache),Ni();break;case 27:case 5:U(t);break;case 4:oe(t,t.stateNode.containerInfo);break;case 10:zi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Za(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Xa(t),e=Cc(e,t,n),e===null?null:e.sibling):gc(e,t,n):(Xa(t),t.flags|=128,null);Xa(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ui(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Sc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),R(to,to.current),r)break;return null;case 22:return t.lanes=0,nc(e,t,n,t.pendingProps);case 24:zi(t,Qi,e.memoizedState.cache)}return Cc(e,t,n)}function Ec(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Zs=!0;else{if(!wc(e,n)&&!(t.flags&128))return Zs=!1,Tc(e,t,n);Zs=!!(e.flags&131072)}else Zs=!1,J&&t.flags&1048576&&bi(t,pi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ya(t.elementType),t.type=e,typeof e==`function`)ei(e)?(r=Bs(e,r),t.tag=1,t=dc(null,t,e,r,n)):(t.tag=0,t=lc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=$s(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=ec(null,t,e,r,n);break a}}throw t=M(e)||e,Error(i(306,t,``))}}return t;case 0:return lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Bs(r,t.pendingProps),dc(e,t,r,a,n);case 3:a:{if(oe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Na(e,t),Ba(t,r,null,n);var s=t.memoizedState;if(r=s.cache,zi(t,Qi,r),r!==o.cache&&Hi(t,[Qi],n,!0),za(),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=fc(e,t,r,n);break a}else if(r!==a){a=li(Error(i(424)),t),Fi(a),t=fc(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(Ti=cf(e.firstChild),wi=t,J=!0,Ei=null,Di=!0,n=Aa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ni(),r===a){t=Cc(e,t,n);break a}Qs(e,t,r,n)}t=t.child}return t;case 26:return cc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:J||(n=t.type,e=t.pendingProps,r=Bd(B.current).createElement(n),r[et]=t,r[tt]=e,Pd(r,n,e),pt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return U(t),e===null&&J&&(r=t.stateNode=ff(t.type,t.pendingProps,B.current),wi=t,Di=!0,a=Ti,Zd(t.type)?(lf=a,Ti=cf(r.firstChild)):Ti=a),Qs(e,t,t.pendingProps.children,n),cc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&J&&((a=r=Ti)&&(r=tf(r,t.type,t.pendingProps,Di),r===null?a=!1:(t.stateNode=r,wi=t,Ti=cf(r.firstChild),Di=!1,a=!0)),a||ki(t)),U(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=go(e,t,yo,null,null,n),Qf._currentValue=a),cc(e,t),Qs(e,t,r,n),t.child;case 6:return e===null&&J&&((e=n=Ti)&&(n=nf(n,t.pendingProps,Di),n===null?e=!1:(t.stateNode=n,wi=t,Ti=null,e=!0)),e||ki(t)),null;case 13:return gc(e,t,n);case 4:return oe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ka(t,null,r,n):Qs(e,t,r,n),t.child;case 11:return $s(e,t,t.type,t.pendingProps,n);case 7:return Qs(e,t,t.pendingProps,n),t.child;case 8:return Qs(e,t,t.pendingProps.children,n),t.child;case 12:return Qs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,zi(t,t.type,r.value),Qs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Gi(t),a=Ki(a),r=r(a),t.flags|=1,Qs(e,t,r,n),t.child;case 14:return ec(e,t,t.type,t.pendingProps,n);case 15:return tc(e,t,t.type,t.pendingProps,n);case 19:return Sc(e,t,n);case 31:return sc(e,t,n);case 22:return nc(e,t,n,t.pendingProps);case 24:return Gi(t),r=Ki(Qi),e===null?(a=ua(),a===null&&(a=Fl,o=$i(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ma(t),zi(t,Qi,a)):((e.lanes&n)!==0&&(Na(e,t),Ba(t,null,null,n),za()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,zi(t,Qi,r),r!==a.cache&&Hi(t,[Qi],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),zi(t,Qi,r))),Qs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Dc(e){e.flags|=4}function Oc(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(Su())e.flags|=8192;else throw ba=ga,ma}else e.flags&=-16777217}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw ba=ga,ma}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:He(),e.lanes|=t,ql|=t)}function jc(e,t){if(!J)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 Mc(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 Nc(e,t,n){var r=t.pendingProps;switch(Si(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Bi(Qi),H(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Mi(t)?Dc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pi())),Mc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Dc(t),o===null?(Mc(t),Oc(t,a,null,r,n)):(Mc(t),kc(t,o))):o?o===e.memoizedState?(Mc(t),t.flags&=-16777217):(Dc(t),Mc(t),kc(t,o)):(e=e.memoizedProps,e!==r&&Dc(t),Mc(t),Oc(t,a,e,r,n)),null;case 27:if(W(t),n=B.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}e=ae.current,Mi(t)?Ai(t,e):(e=ff(a,r,n),t.stateNode=e,Dc(t))}return Mc(t),null;case 5:if(W(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}if(o=ae.current,Mi(t))Ai(t,o);else{var s=Bd(B.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[et]=t,o[tt]=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&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=B.current,Mi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=wi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||ki(t,!0)}else e=Bd(e).createTextNode(r),e[et]=t,t.stateNode=e}return Mc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Mi(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[et]=t}else Ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),e=!1}else n=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(eo(t),t):(eo(t),null);if(t.flags&128)throw Error(i(558))}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Mi(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[et]=t}else Ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),a=!1}else a=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(eo(t),t):(eo(t),null)}return eo(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),Ac(t,t.updateQueue),Mc(t),null);case 4:return H(),e===null&&xd(t.stateNode.containerInfo),Mc(t),null;case 10:return Bi(t.type),Mc(t),null;case 19:if(L(to),r=t.memoizedState,r===null)return Mc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)jc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=no(e),o!==null){for(t.flags|=128,jc(r,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ni(n,e),n=n.sibling;return R(to,to.current&1|2),J&&yi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ye()>$l&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304)}else{if(!a)if(e=no(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!J)return Mc(t),null}else 2*ye()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,jc(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?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ye(),e.sibling=null,n=to.current,R(to,a?n&1|2:n&1),J&&yi(t,r.treeForkCount),e);case 22:case 23:return eo(t),qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(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&&L(la),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Bi(Qi),Mc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Pc(e,t){switch(Si(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bi(Qi),H(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return W(t),null;case 31:if(t.memoizedState!==null){if(eo(t),t.alternate===null)throw Error(i(340));Ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(eo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(to),null;case 4:return H(),null;case 10:return Bi(t.type),null;case 22:case 23:return eo(t),qa(),e!==null&&L(la),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Bi(Qi),null;case 25:return null;default:return null}}function Fc(e,t){switch(Si(t),t.tag){case 3:Bi(Qi),H();break;case 26:case 27:case 5:W(t);break;case 4:H();break;case 31:t.memoizedState!==null&&eo(t);break;case 13:eo(t);break;case 19:L(to);break;case 10:Bi(t.type);break;case 22:case 23:eo(t),qa(),e!==null&&L(la);break;case 24:Bi(Qi)}}function Ic(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){Uu(t,t.return,e)}}function Lc(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){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ha(t,n)}catch(t){Uu(e,e.return,t)}}}function zc(e,t,n){n.props=Bs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Bc(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){Uu(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(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){Uu(e,t,n)}else n.current=null}function Hc(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){Uu(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[tt]=t}catch(t){Uu(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(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 Kc(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=Kt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(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(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(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[et]=e,t[tt]=n}catch(t){Uu(e,e.return,t)}}var Yc=!1,Xc=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Rd=sp,e=vr(e),yr(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,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,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=Bs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(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,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:gl(e,n),r&4&&Ic(5,n);break;case 1:if(gl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Bs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Rc(n),r&512&&Bc(n,n.return);break;case 3:if(gl(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{Ha(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Jc(n);case 26:case 5:gl(e,n),t===null&&r&4&&Hc(n),r&512&&Bc(n,n.return);break;case 12:gl(e,n);break;case 31:gl(e,n),r&4&&sl(e,n);break;case 13:gl(e,n),r&4&&cl(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||Yc,!r){t=t!==null&&t.memoizedState!==null||Xc,i=Yc;var a=Xc;Yc=r,(Xc=t)&&!a?vl(e,n,(n.subtreeFlags&8772)!=0):gl(e,n),Yc=i,Xc=a}break;case 30:break;default:gl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ct(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 rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(ke&&typeof ke.onCommitFiberUnmount==`function`)try{ke.onCommitFiberUnmount(Oe,n)}catch{}switch(n.tag){case 26:Xc||Vc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xc||Vc(n,t);var r=rl,i=il;Zd(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),pf(n.stateNode),rl=r,il=i;break;case 5:Xc||Vc(n,t);case 6:if(r=rl,i=il,rl=null,al(e,t,n),rl=r,il=i,rl!==null)if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:rl!==null&&(il?(e=rl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(rl,n.stateNode));break;case 4:r=rl,i=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=i;break;case 0:case 11:case 14:case 15:Lc(2,n,t),Xc||Lc(4,n,t),al(e,t,n);break;case 1:Xc||(Vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&zc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Xc=(r=Xc)||n.memoizedState!==null,al(e,t,n),Xc=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function cl(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){Uu(t,t.return,e)}}function ll(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(i(435,e.tag))}}function ul(e,t){var n=ll(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function dl(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)){rl=c.stateNode,il=!1;break a}break;case 5:rl=c.stateNode,il=!1;break a;case 3:case 4:rl=c.stateNode.containerInfo,il=!0;break a}c=c.return}if(rl===null)throw Error(i(160));ol(o,s,a),rl=null,il=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pl(t,e),t=t.sibling}var fl=null;function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dl(t,e),ml(e),r&4&&(Lc(3,e,e.return),Ic(3,e),Lc(5,e,e.return));break;case 1:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&64&&Yc&&(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=fl;if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(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[st]||o[et]||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[et]=e,pt(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[et]=e,pt(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&&Uc(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:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),n!==null&&r&4&&Uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),e.flags&32){a=e.stateNode;try{Rt(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Uc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(dl(t,e),ml(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=fl,fl=gf(t.containerInfo),dl(t,e),fl=a,ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Zc&&(Zc=!1,hl(e));break;case 4:r=fl,fl=gf(e.stateNode.containerInfo),dl(t,e),ml(e),fl=r;break;case 12:dl(t,e),ml(e);break;case 31:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 13:dl(t,e),ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=ye()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Yc,d=Xc;if(Yc=u||a,Xc=d||l,dl(t,e),Xc=d,Yc=u,ml(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Yc||Xc||_l(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){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(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){Uu(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,ul(e,n))));break;case 19:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 30:break;case 21:break;default:dl(t,e),ml(e)}}function ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;qc(e,Gc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Rt(o,``),n.flags&=-33),qc(e,Gc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Kc(e,Gc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Lc(4,t,t.return),_l(t);break;case 1:Vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&zc(t,t.return,n),_l(t);break;case 27:pf(t.stateNode);case 26:case 5:Vc(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function vl(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:vl(i,a,n),Ic(4,a);break;case 1:if(vl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(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++)Va(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Rc(a),Bc(a,a.return);break;case 27:Jc(a);case 26:case 5:vl(i,a,n),n&&r===null&&o&4&&Hc(a),Bc(a,a.return);break;case 12:vl(i,a,n);break;case 31:vl(i,a,n),n&&o&4&&sl(i,a);break;case 13:vl(i,a,n),n&&o&4&&cl(i,a);break;case 22:a.memoizedState===null&&vl(i,a,n),Bc(a,a.return);break;case 30:break;default:vl(i,a,n)}t=t.sibling}}function yl(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&&ea(n))}function bl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ea(e))}function xl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sl(e,t,n,r),t=t.sibling}function Sl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,r),i&2048&&Ic(9,t);break;case 1:xl(e,t,n,r);break;case 3:xl(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&&ea(e)));break;case 12:if(i&2048){xl(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){Uu(t,t.return,e)}}else xl(e,t,n,r);break;case 31:xl(e,t,n,r);break;case 13:xl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?xl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?xl(e,t,n,r):wl(e,t),i&2048&&yl(o,t);break;case 24:xl(e,t,n,r),i&2048&&bl(t.alternate,t);break;default:xl(e,t,n,r)}}function Cl(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:Cl(a,o,s,c,i),Ic(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&yl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&bl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(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:wl(n,r),i&2048&&yl(r.alternate,r);break;case 24:wl(n,r),i&2048&&bl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Gf(n,fl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=fl;fl=gf(e.stateNode.containerInfo),El(e,t,n),fl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(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 kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Lc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Lc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Lc(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:ea(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var i=r.sibling,a=r.return;if(nl(r),r===n){$c=null;break a}if(i!==null){i.return=a,$c=i;break a}$c=a}}}var Nl={getCacheForType:function(e){var t=Ki(Qi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ki(Qi).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,X=0,Fl=null,Z=null,Q=0,Il=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return X&2&&Q!==0?Q&-Q:N.T===null?Ze():ud()}function fu(){if(Kl===0)if(!(Q&536870912)||J){var e=Ie;Ie<<=1,!(Ie&3932160)&&(Ie=262144),Kl=e}else Kl=536870912;return e=Ja.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Fl&&(Il===2||Il===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Q,Kl,!1)),We(e,n),(!(X&2)||e!==Fl)&&(e===Fl&&(!(X&2)&&(Wl|=n),Hl===4&&_u(e,Q,Kl,!1)),nd(e))}function mu(e,t,n){if(X&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Be(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){zl&&!r&&_u(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!gu(n)){a=Eu(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=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,a=4;break a}o=Yl,Yl=a,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(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:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Zl+300-ye(),10<a)){if(_u(r,t,Kl,!Rl),ze(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),a);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}}break}while(1);nd(e)}function hu(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:Kt},Dl(t,a,d);var m=(a&62914560)===a?Zl-ye():(a&4194048)===a?Ql-ye():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(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(!pr(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 _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ke(e,n,t)}function vu(){return X&6?!0:(rd(0,!1),!1)}function yu(){if(Z!==null){if(Il===0)var e=Z.return;else e=Z,Ri=Li=null,So(e),Ca=null,wa=0,e=Z;for(;e!==null;)Fc(e.alternate,e),e=e.return;Z=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Fl=e,Z=n=ti(e.current,null),Q=t,Il=0,Ll=null,Rl=!1,zl=Be(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-je(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Gr(),n}function xu(e,t){Y=null,N.H=Ms,t===pa||t===ha?(t=xa(),Il=3):t===ma?(t=xa(),Il=4):Il=t===Xs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Z===null&&(Hl=1,Ws(e,li(t,e.current)))}function Su(){var e=Ja.current;return e===null?!0:(Q&4194048)===Q?Ya===null:(Q&62914560)===Q||Q&536870912?e===Ya:!1}function Cu(){var e=N.H;return N.H=Ms,e===null?Ms:e}function wu(){var e=N.A;return N.A=Nl,e}function Tu(){Hl=4,Rl||(Q&4194048)!==Q&&Ja.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Fl===null||_u(Fl,Q,Kl,!1)}function Eu(e,t,n){var r=X;X|=2;var i=Cu(),a=wu();(Fl!==e||Q!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Il!==0&&Z!==null){var s=Z,c=Ll;switch(Il){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:Ja.current===null&&(t=!0);var l=Il;if(Il=0,Ll=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Il,Il=0,Ll=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ri=Li=null,X=r,N.H=i,N.A=a,Z===null&&(Fl=null,Q=0,Gr()),o}function Du(){for(;Z!==null;)Au(Z)}function Ou(e,t){var n=X;X|=2;var r=Cu(),a=wu();Fl!==e||Q!==t?(eu=null,$l=ye()+500,bu(e,t)):zl=Be(e,t);a:do try{if(Il!==0&&Z!==null){t=Z;var o=Ll;b:switch(Il){case 1:Il=0,Ll=null,Mu(e,t,o,1);break;case 2:case 9:if(_a(o)){Il=0,Ll=null,ju(t);break}t=function(){Il!==2&&Il!==9||Fl!==e||(Il=7),nd(e)},o.then(t,t);break a;case 3:Il=7;break a;case 4:Il=5;break a;case 7:_a(o)?(Il=0,Ll=null,ju(t)):(Il=0,Ll=null,Mu(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Wf(s):c.stateNode.complete){Il=0,Ll=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Nu(u))}break b}}Il=0,Ll=null,Mu(e,t,o,5);break;case 6:Il=0,Ll=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return Ri=Li=null,N.H=r,N.A=a,X=n,Z===null?(Fl=null,Q=0,Gr(),Hl):0}function ku(){for(;Z!==null&&!_e();)Au(Z)}function Au(e){var t=Ec(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=uc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=uc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:So(t);default:Fc(n,t),t=Z=ni(t,Vl),t=Ec(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function Mu(e,t,n,r){Ri=Li=null,So(t),Ca=null,wa=0;var i=t.return;try{if(Ys(e,i,t,n,Q)){Hl=1,Ws(e,li(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Hl=1,Ws(e,li(n,e.current)),Z=null;return}t.flags&32768?(J||r===1?e=!0:zl||Q&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ja.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Nc(t.alternate,t,Vl);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Pc(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);Hl=6,Z=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(X&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Wr,Ge(e,n,o,s,c,l),e===Fl&&(Z=Fl=null,Q=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(Ce,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=X,X|=4;try{el(e,t,n)}finally{X=s,P.p=a,N.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=X;X|=4;try{pl(t,e);var a=zd,o=vr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&_r(s.ownerDocument.documentElement,s)){if(c!==null&&yr(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 _=gr(s,h),v=gr(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{X=i,P.p=r,N.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=X;X|=4;try{tl(e,t.alternate,t)}finally{X=i,P.p=r,N.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,ve();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),Xe(n),t=t.stateNode,ke&&typeof ke.onCommitFiberRoot==`function`)try{ke.onCommitFiberRoot(Oe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.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{N.T=t,P.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ea(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=Xe(au),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,X&6)throw Error(i(331));var c=X;if(X|=4,Al(o.current),Sl(o,o.current,s,n),X=c,rd(0,!1),ke&&typeof ke.onPostCommitFiberRoot==`function`)try{ke.onPostCommitFiberRoot(Oe,o)}catch{}return!0}finally{P.p=a,N.T=r,zu(e,t)}}function Hu(e,t,n){t=li(n,t),t=Ks(e.stateNode,t,2),e=Fa(e,t,2),e!==null&&(We(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=li(n,e),n=qs(2),r=Fa(t,n,2),r!==null&&(Js(n,r,t,e),We(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;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)||(Bl=!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,Fl===e&&(Q&n)===n&&(Hl===4||Hl===3&&(Q&62914560)===Q&&300>ye()-Zl?!(X&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=He()),e=Jr(e,t),e!==null&&(We(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 he(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-je(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=Q,a=ze(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Be(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=ye(),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}nu!==0&&nu!==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-je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ve(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Q,n=ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Il===2||Il===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ge(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Be(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ge(r),Xe(n)){case 2:case 8:n=Se;break;case 32:n=Ce;break;case 268435456:n=Te;break;default:n=Ce}return r=sd.bind(null,e),n=he(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ge(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Q;return r=ze(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,ye()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){X&6?he(xe,id):ad()})}function ud(){if(td===0){var e=ra;e===0&&(e=Fe,Fe<<=1,!(Fe&261888)&&(Fe=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Gt(``+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[tt]||null).action),o=r.submitter;o&&(t=(t=o[tt]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new mn(`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);vs(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),vs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<zr.length;md++){var hd=zr[md];Br(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Br(jr,`onAnimationEnd`),Br(Mr,`onAnimationIteration`),Br(Nr,`onAnimationStart`),Br(`dblclick`,`onDoubleClick`),Br(`focusin`,`onFocus`),Br(`focusout`,`onBlur`),Br(Pr,`onTransitionRun`),Br(Fr,`onTransitionStart`),Br(Ir,`onTransitionCancel`),Br(Lr,`onTransitionEnd`),_t(`onMouseEnter`,[`mouseout`,`mouseover`]),_t(`onMouseLeave`,[`mouseout`,`mouseover`]),_t(`onPointerEnter`,[`pointerout`,`pointerover`]),_t(`onPointerLeave`,[`pointerout`,`pointerover`]),gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),gt(`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){Vr(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){Vr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[rt];n===void 0&&(n=t[rt]=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,mt.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,!nn||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=lt(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}$t(function(){var r=a,i=Jt(n),s=[];a:{var c=Rr.get(e);if(c!==void 0){var l=mn,u=e;switch(e){case`keypress`:if(ln(n)===0)break a;case`keydown`:case`keyup`:l=An;break;case`focusin`:u=`focus`,l=xn;break;case`focusout`:u=`blur`,l=xn;break;case`beforeblur`:case`afterblur`:l=xn;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=yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=bn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Mn;break;case jr:case Mr:case Nr:l=Sn;break;case Lr:l=Nn;break;case`scroll`:case`scrollend`:l=gn;break;case`wheel`:l=Pn;break;case`copy`:case`cut`:case`paste`:l=Cn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=jn;break;case`toggle`:case`beforetoggle`:l=Fn}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=en(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!==qt&&(u=n.relatedTarget||n.fromElement)&&(lt(u)||u[nt]))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?lt(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=yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=jn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:dt(l),h=u==null?c:dt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,lt(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?dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=tr;else if(Yn(c))if(nr)v=dr;else{v=lr;var y=cr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ht(r.elementType)&&(v=tr):v=ur;if(v&&=v(e,r)){Xn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Pt(c,`number`,c.value)}switch(y=r?dt(r):window,e){case`focusin`:(Yn(y)||y.contentEditable===`true`)&&(xr=y,Sr=r,Cr=null);break;case`focusout`:Cr=Sr=xr=null;break;case`mousedown`:wr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:wr=!1,Tr(s,n,i);break;case`selectionchange`:if(br)break;case`keydown`:case`keyup`:Tr(s,n,i)}var b;if(Ln)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 Gn?Un(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Bn&&n.locale!==`ko`&&(Gn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Gn&&(b=cn()):(an=i,on=`value`in an?an.value:an.textContent,Gn=!0)),y=Td(r,x),0<y.length&&(x=new wn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Wn(n),b!==null&&(x.data=b)))),(b=zn?Kn(e,n):qn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new wn(`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=en(e,n),i!=null&&r.unshift(wd(e,i,a)),i=en(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=en(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=en(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===``||Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Rt(e,``+r);break;case`className`:Ct(e,`class`,r);break;case`tabIndex`:Ct(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ct(e,n,r);break;case`style`:Vt(e,r,o);break;case`data`:if(t!==`object`){Ct(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=Gt(``+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=Gt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Kt);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=Gt(``+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),St(e,`popover`,r);break;case`xlinkActuate`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:St(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=Ut.get(n)||n,St(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Vt(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`?Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Rt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Kt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ht.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[tt]||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,``):St(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)}}Nt(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&&Ft(e,!!r,n,!0):Ft(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)}Lt(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(Ht(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)}}Mt(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?Ft(e,!!n,n?[]:``,!1):Ft(e,!!n,t,!0)):Ft(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)}It(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(Ht(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[st]||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),ct(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[st])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]);ct(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=P.d;P.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=vu();return e||t}function yf(e){var t=ut(e);t!==null&&t.tag===5&&t.type===`form`?bs(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=G(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),pt(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="`+G(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+G(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+G(n.imageSizes)+`"]`)):i+=`[href="`+G(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),pt(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="`+G(r)+`"][href="`+G(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),pt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=ft(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`);pt(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=ft(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`),pt(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=ft(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`),pt(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=B.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=ft(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=ft(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=ft(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="`+G(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),pt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+G(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~="`+G(n.href)+`"]`);if(r)return t.instance=r,pt(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`),pt(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,pt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(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,pt(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(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[st]||a[et]||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,pt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),pt(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:F,_currentValue2:F,_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=Ue(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ue(0),this.hiddenUpdates=Ue(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=$r(3,null,null,t),e.current=a,a.stateNode=e,t=$i(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ma(a),e}function tp(e){return e?(e=Zr,e):Zr}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Pa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Fa(e,r,t),n!==null&&(pu(n,e,t),Ia(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=Jr(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=Ye(t);var n=Jr(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,up(e,t,n,r)}finally{P.p=a,N.T=i}}function lp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,up(e,t,n,r)}finally{P.p=a,N.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=ut(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Re(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-je(o);s.entanglements[1]|=c,o&=~c}nd(a),!(X&6)&&($l=ye()+500,rd(0,!1))}}break;case 31:case 13:s=Jr(a,2),s!==null&&pu(s,a,2),vu(),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=Jt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=lt(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(be()){case xe:return 2;case Se:return 8;case Ce:case we:return 32;case Te: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=ut(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=lt(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,Qe(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Qe(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);qt=r,n.target.dispatchEvent(r),qt=null}else return t=ut(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=ut(n);a!==null&&(e.splice(t,3),t-=3,vs(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[tt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[tt]||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,du(),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),vu(),t[nt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ze();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`));P.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:N,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Oe=zp.inject(Rp),ke=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Vs,s=Hs,c=Us;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[nt]=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 T({children:e}){let[t,n]=(0,b.useReducer)(C,S);return(0,x.jsx)(w.Provider,{value:{state:t,dispatch:n},children:e})}function E(){return(0,b.useContext)(w)}var D=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,n=!1){let r=await this.getCsrfToken(),i=await fetch(`${this.baseUrl}/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":r},credentials:`include`,body:JSON.stringify({username:e,password:t,rememberMe:n})});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e?.error?.message??`Login failed`)}return i.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,n){let r=await this.getCsrfToken(),i=await fetch(`${this.baseUrl}/api/v1/search`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":r},credentials:`include`,body:JSON.stringify({query:e,limit:t,...n})});if(!i.ok)throw Error(`Search failed: ${i.statusText}`);return i.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 O(){let{state:e,dispatch:t}=E(),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)(!1),[p,m]=(0,b.useState)(``),[h,g]=(0,b.useState)(!1),[_,v]=(0,b.useState)(!0),[y,S]=(0,b.useState)(!1);(0,b.useEffect)(()=>{let r=new D(e.serverUrl||n);(async()=>{try{let{needsBootstrap:i}=await r.bootstrapStatus();if(i){S(!0),v(!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{}v(!1)})()},[]);let C=async e=>{if(e.preventDefault(),!a.trim()||!s.trim()){m(`Username and password are required`);return}m(``),g(!0);try{let{user:e}=await new D(r).login(a.trim(),s,d);t({type:`SET_SERVER_URL`,url:r}),t({type:`SET_CURRENT_USER`,user:e}),t({type:`SET_VIEW`,view:`connect`})}catch(e){m(e instanceof Error?e.message:`Login failed`)}finally{g(!1)}},w=async e=>{if(e.preventDefault(),!a.trim()||!s.trim()){m(`Username and password are required`);return}if(s.length<8){m(`Password must be at least 8 characters`);return}if(s!==l){m(`Passwords do not match`);return}m(``),g(!0);try{let{user:e}=await new D(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){m(e instanceof Error?e.message:`Setup failed`)}finally{g(!1)}};if(_)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)(A,{className:`w-5 h-5 text-accent`}),(0,x.jsx)(`span`,{className:`text-sm`,children:`Checking session…`})]})});let T=`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`,O=`block text-xs font-medium text-text-secondary uppercase tracking-widest mb-1.5`;return y?(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)(ee,{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:w,className:`space-y-4`,children:[(0,x.jsx)(te,{label:`Server URL`,labelClass:O,children:(0,x.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),disabled:h,className:T,placeholder:`http://localhost:4747`,autoComplete:`off`})}),(0,x.jsx)(te,{label:`Admin Username`,labelClass:O,children:(0,x.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),disabled:h,autoComplete:`username`,className:T,placeholder:`admin`})}),(0,x.jsx)(te,{label:`Password`,labelClass:O,children:(0,x.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),disabled:h,autoComplete:`new-password`,className:T,placeholder:`••••••••`})}),(0,x.jsx)(te,{label:`Confirm Password`,labelClass:O,children:(0,x.jsx)(`input`,{type:`password`,value:l,onChange:e=>u(e.target.value),disabled:h,autoComplete:`new-password`,className:T,placeholder:`••••••••`})}),p&&(0,x.jsx)(k,{message:p}),(0,x.jsx)(`button`,{type:`submit`,disabled:h,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:h?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(A,{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)(ee,{subtitle:`Sign in to your account`}),(0,x.jsxs)(`form`,{onSubmit:C,className:`space-y-4`,children:[(0,x.jsx)(te,{label:`Server URL`,labelClass:O,children:(0,x.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),disabled:h,className:T,placeholder:`http://localhost:4747`,autoComplete:`off`})}),(0,x.jsx)(te,{label:`Username`,labelClass:O,children:(0,x.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),disabled:h,autoComplete:`username`,className:T,placeholder:`admin`})}),(0,x.jsx)(te,{label:`Password`,labelClass:O,children:(0,x.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),disabled:h,autoComplete:`current-password`,className:T,placeholder:`••••••••`})}),(0,x.jsxs)(`label`,{className:`flex items-center gap-2.5 cursor-pointer select-none group`,children:[(0,x.jsx)(`div`,{onClick:()=>!h&&f(e=>!e),className:`w-4 h-4 rounded border flex items-center justify-center shrink-0 transition
|
|
10
|
-
${d?`bg-accent border-accent`:`bg-elevated border-border-default group-hover:border-accent/60`}
|
|
11
|
-
${h?`opacity-40 cursor-not-allowed`:``}`,children:d&&(0,x.jsx)(`svg`,{className:`w-2.5 h-2.5 text-white`,fill:`none`,viewBox:`0 0 12 12`,stroke:`currentColor`,strokeWidth:2.5,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M2 6l3 3 5-5`})})}),(0,x.jsxs)(`span`,{className:`text-sm text-text-secondary`,children:[`Remember me `,(0,x.jsx)(`span`,{className:`text-text-muted text-xs`,children:`(stay signed in for 12 h)`})]})]}),p&&(0,x.jsx)(k,{message:p}),(0,x.jsx)(`button`,{type:`submit`,disabled:h,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:h?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(A,{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 ee({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.1`]})]})}function te({label:e,labelClass:t,children:n}){return(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`label`,{className:t,children:e}),n]})}function k({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 A({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 j(){let{dispatch:e}=E(),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 D(e).listRepos()),a(``)}catch{d([])}};(0,b.useEffect)(()=>{c===`group`&&y()},[c,n]);let y=async()=>{h(!0);try{p(await new D(n).listGroups())}catch{p([])}finally{h(!1)}},S=async t=>{a(``),s(!0);try{let r=new D(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 D(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)(M,{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)(M,{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)(M,{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 M({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 ne(){let{state:e}=E(),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:`
|
|
12
|
-
@keyframes shimmer {
|
|
13
|
-
0% { transform: translateX(-100%); }
|
|
14
|
-
100% { transform: translateX(300%); }
|
|
15
|
-
}
|
|
16
|
-
`})]})}var N=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 P(){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 F=P;typeof Object.assign==`function`&&(F=Object.assign);function re(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 I(e){return typeof e==`object`&&!!e}function ie(e){let t;for(t in e)return!1;return!0}function L(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function R(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 ae(e){return!(!I(e)||e.attributes&&!Array.isArray(e.attributes))}function z(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function B(){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 V(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var oe=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},H=class e extends oe{constructor(t){super(t),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},U=class e extends oe{constructor(t){super(t),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},W=class e extends oe{constructor(t){super(t),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}};function se(e,t){this.key=e,this.attributes=t,this.clear()}se.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 ce(e,t){this.key=e,this.attributes=t,this.clear()}ce.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function le(e,t){this.key=e,this.attributes=t,this.clear()}le.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function ue(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}ue.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)},ue.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},ue.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]},ue.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 de=0,fe=1,pe=2,me=3;function he(e,t,n,r,i,a,o){let s,c,l,u;if(r=``+r,n===de){if(s=e._nodes.get(r),!s)throw new U(`Graph.${t}: could not find the "${r}" node in the graph.`);l=i,u=a}else if(n===me){if(i=``+i,c=e._edges.get(i),!c)throw new U(`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 U(`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 U(`Graph.${t}: could not find the "${r}" edge in the graph.`);s=n===fe?c.source:c.target,l=i,u=a}return[s,l,u]}function ge(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=he(this,t,n,e,r,i);return a.attributes[o]}}function _e(e,t,n){e.prototype[t]=function(e,r){let[i]=he(this,t,n,e,r);return i.attributes}}function ve(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=he(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function ye(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=he(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 be(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=he(this,t,n,e,r,i,a);if(typeof c!=`function`)throw new H(`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 xe(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=he(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 Se(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=he(this,t,n,e,r,i);if(!I(o))throw new H(`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 Ce(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=he(this,t,n,e,r,i);if(!I(o))throw new H(`Graph.${t}: provided attributes are not a plain object.`);return F(a.attributes,o),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`merge`,attributes:a.attributes,data:o}),this}}function we(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=he(this,t,n,e,r,i);if(typeof o!=`function`)throw new H(`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 Te=[{name:e=>`get${e}Attribute`,attacher:ge},{name:e=>`get${e}Attributes`,attacher:_e},{name:e=>`has${e}Attribute`,attacher:ve},{name:e=>`set${e}Attribute`,attacher:ye},{name:e=>`update${e}Attribute`,attacher:be},{name:e=>`remove${e}Attribute`,attacher:xe},{name:e=>`replace${e}Attributes`,attacher:Se},{name:e=>`merge${e}Attributes`,attacher:Ce},{name:e=>`update${e}Attributes`,attacher:we}];function Ee(e){Te.forEach(function({name:t,attacher:n}){n(e,t(`Node`),de),n(e,t(`Source`),fe),n(e,t(`Target`),pe),n(e,t(`Opposite`),me)})}function De(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new W(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new W(`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=re(this,a,o,n),!i)throw new U(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new W(`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 U(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes[r]}}function Oe(e,t,n){e.prototype[t]=function(e){let r;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new W(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new W(`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=re(this,i,a,n),!r)throw new U(`Graph.${t}: could not find an edge for the given path ("${i}" - "${a}").`)}else{if(n!==`mixed`)throw new W(`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 U(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function ke(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new W(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new W(`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=re(this,a,o,n),!i)throw new U(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new W(`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 U(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes.hasOwnProperty(r)}}function Ae(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new W(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new W(`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=re(this,o,s,n),!a)throw new U(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new W(`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 U(`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 je(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new W(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new W(`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=re(this,o,s,n),!a)throw new U(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new W(`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 U(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof i!=`function`)throw new H(`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 Me(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new W(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new W(`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=re(this,a,o,n),!i)throw new U(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new W(`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 U(`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 Ne(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new W(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new W(`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=re(this,a,o,n),!i)throw new U(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new W(`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 U(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!I(r))throw new H(`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 Pe(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new W(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new W(`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=re(this,a,o,n),!i)throw new U(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new W(`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 U(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!I(r))throw new H(`Graph.${t}: provided attributes are not a plain object.`);return F(i.attributes,r),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`merge`,attributes:i.attributes,data:r}),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 W(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new W(`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=re(this,a,o,n),!i)throw new U(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new W(`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 U(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof r!=`function`)throw new H(`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 Ie=[{name:e=>`get${e}Attribute`,attacher:De},{name:e=>`get${e}Attributes`,attacher:Oe},{name:e=>`has${e}Attribute`,attacher:ke},{name:e=>`set${e}Attribute`,attacher:Ae},{name:e=>`update${e}Attribute`,attacher:je},{name:e=>`remove${e}Attribute`,attacher:Me},{name:e=>`replace${e}Attributes`,attacher:Ne},{name:e=>`merge${e}Attributes`,attacher:Pe},{name:e=>`update${e}Attributes`,attacher:Fe}];function Le(e){Ie.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}var Re=[{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 ze(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 Be(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 Ve(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 He(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 Ue(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 We(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 Ge(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 Ke(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 qe(e,t){if(e.size===0)return V();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 Je(e,t,n,r,i,a){let o=t?Be:ze,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 Ye(e,t,n,r){let i=[];return Je(!1,e,t,n,r,function(e){i.push(e)}),i}function Xe(e,t,n){let r=V();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=B(r,Ve(n.in))),t!==`in`&&n.out!==void 0&&(r=B(r,Ve(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=B(r,Ve(n.undirected))),r}function Ze(e,t,n,r,i,a,o){let s=n?Ue:He,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 Qe(e,t,n,r,i){let a=[];return Ze(!1,e,t,n,r,i,function(e){a.push(e)}),a}function $e(e,t,n,r){let i=V();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=B(i,We(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=B(i,We(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=B(i,We(n.undirected,r))),i}function et(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 Ge(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new U(`Graph.${n}: could not find the "${e}" node in the graph.`);return Ye(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 U(`Graph.${n}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new U(`Graph.${n}: could not find the "${t}" target node in the graph.`);return Qe(r,this.multi,i,a,t)}throw new H(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function tt(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,Ke(!1,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new U(`Graph.${a}: could not find the "${e}" node in the graph.`);return Je(!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 U(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new U(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Ze(!1,r,this.multi,i,o,t,n)}throw new H(`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 H(`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 H(`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 nt(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,Ke(!0,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new U(`Graph.${a}: could not find the "${e}" node in the graph.`);return Je(!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 U(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new U(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Ze(!0,r,this.multi,i,o,t,n)}throw new H(`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 rt(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 V();if(!arguments.length)return qe(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new U(`Graph.${a}: could not find the "${e}" node in the graph.`);return Xe(r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new U(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new U(`Graph.${a}: could not find the "${t}" target node in the graph.`);return $e(r,i,n,t)}throw new H(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function it(e){Re.forEach(t=>{et(e,t),tt(e,t),nt(e,t),rt(e,t)})}var at=[{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 ot(){this.A=null,this.B=null}ot.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},ot.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function st(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 ct(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return st(e,null,r,r.undirected,i);if(typeof n==`string`)return st(e,null,r,r[n],i)}let a=new ot,o;if(t!==`undirected`){if(n!==`out`){if(o=st(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=st(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=st(e,a,r,r.undirected,i),e&&o))return o}function lt(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 ct(!1,e,t,n,function(e){r.push(e)}),r}function ut(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 dt(e,t,n){if(e!==`mixed`){if(e===`undirected`)return ut(null,n,n.undirected);if(typeof t==`string`)return ut(null,n,n[t])}let r=V(),i=new ot;return e!==`undirected`&&(t!==`out`&&(r=B(r,ut(i,n,n.in))),t!==`in`&&(r=B(r,ut(i,n,n.out)))),e!==`directed`&&(r=B(r,ut(i,n,n.undirected))),r}function ft(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 U(`Graph.${n}: could not find the "${e}" node in the graph.`);return lt(r===`mixed`?this.type:r,i,t)}}function pt(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 U(`Graph.${a}: could not find the "${e}" node in the graph.`);ct(!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 H(`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 mt(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 U(`Graph.${o}: could not find the "${e}" node in the graph.`);return ct(!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 ht(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 V();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new U(`Graph.${a}: could not find the "${e}" node in the graph.`);return dt(r===`mixed`?this.type:r,i,t)}}function gt(e){at.forEach(t=>{ft(e,t),pt(e,t),mt(e,t),ht(e,t)})}function _t(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 vt(e,t){let n={key:e};return ie(t.attributes)||(n.attributes=F({},t.attributes)),n}function yt(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return ie(n.attributes)||(r.attributes=F({},n.attributes)),e===`mixed`&&n.undirected&&(r.undirected=!0),r}function bt(e){if(!I(e))throw new H(`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 H(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!I(e.attributes)||e.attributes===null))throw new H(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function xt(e){if(!I(e))throw new H(`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 H(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new H(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!I(e.attributes)||e.attributes===null))throw new H(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new H(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}var St=z(),Ct=new Set([`directed`,`undirected`,`mixed`]),wt=new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),Tt=[{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`}],Et={allowSelfLoops:!0,multi:!1,type:`mixed`};function Dt(e,t,n){if(n&&!I(n))throw new H(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=``+t,n||={},e._nodes.has(t))throw new W(`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 Ot(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 kt(e,t,n,r,i,a,o,s){if(!r&&e.type===`undirected`)throw new W(`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 W(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!I(s))throw new H(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`);if(a=``+a,o=``+o,s||={},!e.allowSelfLoops&&a===o)throw new W(`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 U(`Graph.${t}: source node "${a}" not found.`);if(!l)throw new U(`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 W(`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 W(`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 ue(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 At(e,t,n,r,i,a,o,s,c){if(!r&&e.type===`undirected`)throw new W(`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 W(`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 H(`Graph.${t}: invalid updater function. Expecting a function but got "${s}"`)}else if(!I(s))throw new H(`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 W(`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 W(`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 F(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 W(`Graph.${t}: the "${i}" edge already exists in the graph.`);let h=!1,g=!1;u||(u=Ot(e,a,{}),h=!0,a===o&&(d=u,g=!0)),d||(d=Ot(e,o,{}),g=!0),f=new ue(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 jt(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 G=class e extends N.EventEmitter{constructor(e){if(super(),e=F({},Et,e),typeof e.multi!=`boolean`)throw new H(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!Ct.has(e.type))throw new H(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new H(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type===`mixed`?se:e.type===`directed`?ce:le;L(this,`NodeDataClass`,t);let n=`geid_`+St()+`_`,r=0;L(this,`_attributes`,{}),L(this,`_nodes`,new Map),L(this,`_edges`,new Map),L(this,`_directedSize`,0),L(this,`_undirectedSize`,0),L(this,`_directedSelfLoopCount`,0),L(this,`_undirectedSelfLoopCount`,0),L(this,`_edgeKeyGenerator`,()=>{let e;do e=n+ r++;while(this._edges.has(e));return e}),L(this,`_options`,e),wt.forEach(e=>L(this,e,this[e])),R(this,`order`,()=>this._nodes.size),R(this,`size`,()=>this._edges.size),R(this,`directedSize`,()=>this._directedSize),R(this,`undirectedSize`,()=>this._undirectedSize),R(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),R(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),R(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),R(this,`multi`,this._options.multi),R(this,`type`,this._options.type),R(this,`allowSelfLoops`,this._options.allowSelfLoops),R(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 H(`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 H(`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 H(`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 W(`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 U(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new U(`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 W(`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 U(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new U(`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 W(`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 U(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`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 U(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return Dt(this,e,t).key}mergeNode(e,t){if(t&&!I(t))throw new H(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=``+e,t||={};let n=this._nodes.get(e);return n?(t&&(F(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 H(`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 U(`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 jt(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do jt(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do jt(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=re(this,e,n,this.type),!t)throw new U(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new U(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return jt(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new W(`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 W(`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=re(this,e,t,`directed`);if(!n)throw new U(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return jt(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new W(`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 W(`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=re(this,e,t,`undirected`);if(!n)throw new U(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return jt(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 H(`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(!I(e))throw new H(`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(!I(e))throw new H(`Graph.mergeAttributes: provided attributes are not a plain object.`);return F(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new H(`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 H(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!ae(t))throw new H(`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 H(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!ae(t))throw new H(`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 H(`Graph.forEachAdjacencyEntry: expecting a callback.`);_t(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new H(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);_t(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new H(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);_t(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new H(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);_t(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new H(`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 H(`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 H(`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 H(`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 H(`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 H(`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 H(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new H(`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++]=vt(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=yt(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(!I(t))throw new H(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(t.attributes){if(!I(t.attributes))throw new H(`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 H(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=a.length;r<i;r++){o=a[r],bt(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 H(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=a.length;r<i;r++){s=a[r],xt(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(F({},this._options,t));return n.replaceAttributes(F({},this.getAttributes())),n}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((e,n)=>{let r=F({},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 W(`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 W(`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 W(`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,kt(t,`copy`,!1,i.undirected,i.key,i.source.key,i.target.key,F({},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)&&!wt.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,L(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(G.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=G.prototype.inspect),Tt.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?kt:At;e.generateKey?G.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:G.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),Ee(G),Le(G),it(G),gt(G);var Mt=class extends G{constructor(e){let t=F({type:`directed`},e);if(`multi`in t&&t.multi!==!1)throw new H(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`directed`)throw new H(`DirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},Nt=class extends G{constructor(e){let t=F({type:`undirected`},e);if(`multi`in t&&t.multi!==!1)throw new H(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`undirected`)throw new H(`UndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},Pt=class extends G{constructor(e){let t=F({multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new H(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(t)}},Ft=class extends G{constructor(e){let t=F({type:`directed`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new H(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`directed`)throw new H(`MultiDirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},It=class extends G{constructor(e){let t=F({type:`undirected`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new H(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`undirected`)throw new H(`MultiUndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}};function Lt(e){e.from=function(t,n){let r=new e(F({},t.options,n));return r.import(t),r}}Lt(G),Lt(Mt),Lt(Nt),Lt(Pt),Lt(Ft),Lt(It),G.Graph=G,G.DirectedGraph=Mt,G.UndirectedGraph=Nt,G.MultiGraph=Pt,G.MultiDirectedGraph=Ft,G.MultiUndirectedGraph=It,G.InvalidArgumentsGraphError=H,G.NotFoundGraphError=U,G.UsageGraphError=W;function Rt(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 zt(e){var t=Rt(e,`string`);return typeof t==`symbol`?t:t+``}function Bt(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Vt(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,zt(r.key),r)}}function Ht(e,t,n){return t&&Vt(e.prototype,t),n&&Vt(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Ut(e){return Ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ut(e)}function Wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wt=function(){return!!e})()}function Gt(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Kt(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 Gt(e)}function qt(e,t,n){return t=Ut(t),Kt(e,Wt()?Reflect.construct(t,n||[],Ut(e).constructor):t.apply(e,n))}function Jt(e,t){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jt(e,t)}function Yt(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&&Jt(e,t)}function Xt(e){if(Array.isArray(e))return e}function Zt(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 Qt(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 $t(e,t){if(e){if(typeof e==`string`)return Qt(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)?Qt(e,t):void 0}}function en(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
17
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tn(e,t){return Xt(e)||Zt(e,t)||$t(e,t)||en()}var nn={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`},rn=new Int8Array(4),an=new Int32Array(rn.buffer,0,1),on=new Float32Array(rn.buffer,0,1),sn=/^\s*rgba?\s*\(/,cn=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function ln(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(sn.test(e)){var a=e.match(cn);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 un={};for(var dn in nn)un[dn]=pn(nn[dn]),un[nn[dn]]=un[dn];function fn(e,t,n,r,i){return an[0]=r<<24|n<<16|t<<8|e,i&&(an[0]&=4278190079),on[0]}function pn(e){if(e=e.toLowerCase(),un[e]!==void 0)return un[e];var t=ln(e),n=t.r,r=t.g,i=t.b,a=t.a;a=a*255|0;var o=fn(n,r,i,a,!0);return un[e]=o,o}var mn={};function hn(e){if(mn[e]!==void 0)return mn[e];var t=fn((e&16711680)>>>16,(e&65280)>>>8,e&255,255,!0);return mn[e]=t,t}function gn(e,t,n,r){return n+(t<<8)+(e<<16)}function _n(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=tn(c,4);return[l[0],l[1],l[2],l[3]]}function K(e,t,n){return(t=zt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vn(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 q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vn(Object(n),!0).forEach(function(t){K(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yn(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Ut(e))!==null;);return e}function bn(){return bn=typeof Reflect<`u`&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=yn(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},bn.apply(null,arguments)}function xn(e,t,n,r){var i=bn(Ut(1&r?e.prototype:e),t,n);return 2&r&&typeof i==`function`?function(e){return i.apply(n,e)}:i}function Sn(e){return e.normalized?1:e.size}function Cn(e){var t=0;return e.forEach(function(e){return t+=Sn(e)}),t}function wn(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:
|
|
18
|
-
${a}
|
|
19
|
-
${n}`)}return i}function Tn(e,t){return wn(`VERTEX`,e,t)}function En(e,t){return wn(`FRAGMENT`,e,t)}function Dn(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 On(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 kn=`#define PICKING_MODE
|
|
20
|
-
`,An=K(K(K(K(K(K(K(K({},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),jn=function(){function e(t,n,r){Bt(this,e),K(this,`array`,new Float32Array),K(this,`constantArray`,new Float32Array),K(this,`capacity`,0),K(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=Cn(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,kn+i.VERTEX_SHADER_SOURCE,kn+i.FRAGMENT_SHADER_SOURCE,n):null,this.isInstanced){var a=Cn(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 Ht(e,[{key:`kill`,value:function(){On(this.normalProgram),this.pickProgram&&=(On(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=Tn(t,n),c=En(t,r),l=Dn(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=An[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:Cn(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(q(q({},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)}}}])}(),Mn=function(e){function t(){return Bt(this,t),qt(this,t,arguments)}return Yt(t,e),Ht(t,[{key:`kill`,value:function(){xn(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(hn(e),r,n)}}])}(jn),Nn=function(e){function t(){var e;Bt(this,t);var n=[...arguments];return e=qt(this,t,[].concat(n)),K(e,`drawLabel`,void 0),e}return Yt(t,e),Ht(t,[{key:`kill`,value:function(){xn(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(hn(e),a,n,r,i)}}])}(jn);function Pn(e,t){return function(){function n(r,i,a){Bt(this,n),K(this,`drawLabel`,t),this.programs=e.map(function(e){return new e(r,i,a)})}return Ht(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 Fn(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 In(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 Ln(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,In(e,t,n)}var Rn=`
|
|
21
|
-
precision highp float;
|
|
22
|
-
|
|
23
|
-
varying vec4 v_color;
|
|
24
|
-
varying vec2 v_diffVector;
|
|
25
|
-
varying float v_radius;
|
|
26
|
-
|
|
27
|
-
uniform float u_correctionRatio;
|
|
28
|
-
|
|
29
|
-
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
|
|
30
|
-
|
|
31
|
-
void main(void) {
|
|
32
|
-
float border = u_correctionRatio * 2.0;
|
|
33
|
-
float dist = length(v_diffVector) - v_radius + border;
|
|
34
|
-
|
|
35
|
-
// No antialiasing for picking mode:
|
|
36
|
-
#ifdef PICKING_MODE
|
|
37
|
-
if (dist > border)
|
|
38
|
-
gl_FragColor = transparent;
|
|
39
|
-
else
|
|
40
|
-
gl_FragColor = v_color;
|
|
41
|
-
|
|
42
|
-
#else
|
|
43
|
-
float t = 0.0;
|
|
44
|
-
if (dist > border)
|
|
45
|
-
t = 1.0;
|
|
46
|
-
else if (dist > 0.0)
|
|
47
|
-
t = dist / border;
|
|
48
|
-
|
|
49
|
-
gl_FragColor = mix(v_color, transparent, t);
|
|
50
|
-
#endif
|
|
51
|
-
}
|
|
52
|
-
`,zn=`
|
|
53
|
-
attribute vec4 a_id;
|
|
54
|
-
attribute vec4 a_color;
|
|
55
|
-
attribute vec2 a_position;
|
|
56
|
-
attribute float a_size;
|
|
57
|
-
attribute float a_angle;
|
|
58
|
-
|
|
59
|
-
uniform mat3 u_matrix;
|
|
60
|
-
uniform float u_sizeRatio;
|
|
61
|
-
uniform float u_correctionRatio;
|
|
62
|
-
|
|
63
|
-
varying vec4 v_color;
|
|
64
|
-
varying vec2 v_diffVector;
|
|
65
|
-
varying float v_radius;
|
|
66
|
-
varying float v_border;
|
|
67
|
-
|
|
68
|
-
const float bias = 255.0 / 254.0;
|
|
69
|
-
|
|
70
|
-
void main() {
|
|
71
|
-
float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;
|
|
72
|
-
vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));
|
|
73
|
-
vec2 position = a_position + diffVector;
|
|
74
|
-
gl_Position = vec4(
|
|
75
|
-
(u_matrix * vec3(position, 1)).xy,
|
|
76
|
-
0,
|
|
77
|
-
1
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
v_diffVector = diffVector;
|
|
81
|
-
v_radius = size / 2.0;
|
|
82
|
-
|
|
83
|
-
#ifdef PICKING_MODE
|
|
84
|
-
// For picking mode, we use the ID as the color:
|
|
85
|
-
v_color = a_id;
|
|
86
|
-
#else
|
|
87
|
-
// For normal mode, we use the color:
|
|
88
|
-
v_color = a_color;
|
|
89
|
-
#endif
|
|
90
|
-
|
|
91
|
-
v_color.a *= bias;
|
|
92
|
-
}
|
|
93
|
-
`,Bn=WebGLRenderingContext,Vn=Bn.UNSIGNED_BYTE,Hn=Bn.FLOAT,Un=[`u_sizeRatio`,`u_correctionRatio`,`u_matrix`],Wn=function(e){function t(){return Bt(this,t),qt(this,t,arguments)}return Yt(t,e),Ht(t,[{key:`getDefinition`,value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:zn,FRAGMENT_SHADER_SOURCE:Rn,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:Un,ATTRIBUTES:[{name:`a_position`,size:2,type:Hn},{name:`a_size`,size:1,type:Hn},{name:`a_color`,size:4,type:Vn,normalized:!0},{name:`a_id`,size:4,type:Vn,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:`a_angle`,size:1,type:Hn}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:`processVisibleItem`,value:function(e,t,n){var r=this.array,i=pn(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)}}])}(Mn);K(Wn,`ANGLE_1`,0),K(Wn,`ANGLE_2`,2*Math.PI/3),K(Wn,`ANGLE_3`,4*Math.PI/3);var Gn=`
|
|
94
|
-
precision mediump float;
|
|
95
|
-
|
|
96
|
-
varying vec4 v_color;
|
|
97
|
-
|
|
98
|
-
void main(void) {
|
|
99
|
-
gl_FragColor = v_color;
|
|
100
|
-
}
|
|
101
|
-
`,Kn=`
|
|
102
|
-
attribute vec2 a_position;
|
|
103
|
-
attribute vec2 a_normal;
|
|
104
|
-
attribute float a_radius;
|
|
105
|
-
attribute vec3 a_barycentric;
|
|
106
|
-
|
|
107
|
-
#ifdef PICKING_MODE
|
|
108
|
-
attribute vec4 a_id;
|
|
109
|
-
#else
|
|
110
|
-
attribute vec4 a_color;
|
|
111
|
-
#endif
|
|
112
|
-
|
|
113
|
-
uniform mat3 u_matrix;
|
|
114
|
-
uniform float u_sizeRatio;
|
|
115
|
-
uniform float u_correctionRatio;
|
|
116
|
-
uniform float u_minEdgeThickness;
|
|
117
|
-
uniform float u_lengthToThicknessRatio;
|
|
118
|
-
uniform float u_widenessToThicknessRatio;
|
|
119
|
-
|
|
120
|
-
varying vec4 v_color;
|
|
121
|
-
|
|
122
|
-
const float bias = 255.0 / 254.0;
|
|
123
|
-
|
|
124
|
-
void main() {
|
|
125
|
-
float minThickness = u_minEdgeThickness;
|
|
126
|
-
|
|
127
|
-
float normalLength = length(a_normal);
|
|
128
|
-
vec2 unitNormal = a_normal / normalLength;
|
|
129
|
-
|
|
130
|
-
// These first computations are taken from edge.vert.glsl and
|
|
131
|
-
// edge.clamped.vert.glsl. Please read it to get better comments on what's
|
|
132
|
-
// happening:
|
|
133
|
-
float pixelsThickness = max(normalLength / u_sizeRatio, minThickness);
|
|
134
|
-
float webGLThickness = pixelsThickness * u_correctionRatio;
|
|
135
|
-
float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio;
|
|
136
|
-
float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
|
|
137
|
-
float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio;
|
|
138
|
-
|
|
139
|
-
float da = a_barycentric.x;
|
|
140
|
-
float db = a_barycentric.y;
|
|
141
|
-
float dc = a_barycentric.z;
|
|
142
|
-
|
|
143
|
-
vec2 delta = vec2(
|
|
144
|
-
da * (webGLNodeRadius * unitNormal.y)
|
|
145
|
-
+ db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x)
|
|
146
|
-
+ dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x),
|
|
147
|
-
|
|
148
|
-
da * (-webGLNodeRadius * unitNormal.x)
|
|
149
|
-
+ db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y)
|
|
150
|
-
+ dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y)
|
|
151
|
-
);
|
|
152
|
-
|
|
153
|
-
vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;
|
|
154
|
-
|
|
155
|
-
gl_Position = vec4(position, 0, 1);
|
|
156
|
-
|
|
157
|
-
#ifdef PICKING_MODE
|
|
158
|
-
// For picking mode, we use the ID as the color:
|
|
159
|
-
v_color = a_id;
|
|
160
|
-
#else
|
|
161
|
-
// For normal mode, we use the color:
|
|
162
|
-
v_color = a_color;
|
|
163
|
-
#endif
|
|
164
|
-
|
|
165
|
-
v_color.a *= bias;
|
|
166
|
-
}
|
|
167
|
-
`,qn=WebGLRenderingContext,Jn=qn.UNSIGNED_BYTE,Yn=qn.FLOAT,Xn=[`u_matrix`,`u_sizeRatio`,`u_correctionRatio`,`u_minEdgeThickness`,`u_lengthToThicknessRatio`,`u_widenessToThicknessRatio`],Zn={extremity:`target`,lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Qn(e){var t=q(q({},Zn),e||{});return function(e){function n(){return Bt(this,n),qt(this,n,arguments)}return Yt(n,e),Ht(n,[{key:`getDefinition`,value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:Kn,FRAGMENT_SHADER_SOURCE:Gn,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:Xn,ATTRIBUTES:[{name:`a_position`,size:2,type:Yn},{name:`a_normal`,size:2,type:Yn},{name:`a_radius`,size:1,type:Yn},{name:`a_color`,size:4,type:Jn,normalized:!0},{name:`a_id`,size:4,type:Jn,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:`a_barycentric`,size:3,type:Yn}],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=pn(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)}}])}(Nn)}Qn();var $n=`
|
|
168
|
-
precision mediump float;
|
|
169
|
-
|
|
170
|
-
varying vec4 v_color;
|
|
171
|
-
varying vec2 v_normal;
|
|
172
|
-
varying float v_thickness;
|
|
173
|
-
varying float v_feather;
|
|
174
|
-
|
|
175
|
-
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
|
|
176
|
-
|
|
177
|
-
void main(void) {
|
|
178
|
-
// We only handle antialiasing for normal mode:
|
|
179
|
-
#ifdef PICKING_MODE
|
|
180
|
-
gl_FragColor = v_color;
|
|
181
|
-
#else
|
|
182
|
-
float dist = length(v_normal) * v_thickness;
|
|
183
|
-
|
|
184
|
-
float t = smoothstep(
|
|
185
|
-
v_thickness - v_feather,
|
|
186
|
-
v_thickness,
|
|
187
|
-
dist
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
gl_FragColor = mix(v_color, transparent, t);
|
|
191
|
-
#endif
|
|
192
|
-
}
|
|
193
|
-
`,er=`
|
|
194
|
-
attribute vec4 a_id;
|
|
195
|
-
attribute vec4 a_color;
|
|
196
|
-
attribute vec2 a_normal;
|
|
197
|
-
attribute float a_normalCoef;
|
|
198
|
-
attribute vec2 a_positionStart;
|
|
199
|
-
attribute vec2 a_positionEnd;
|
|
200
|
-
attribute float a_positionCoef;
|
|
201
|
-
attribute float a_radius;
|
|
202
|
-
attribute float a_radiusCoef;
|
|
203
|
-
|
|
204
|
-
uniform mat3 u_matrix;
|
|
205
|
-
uniform float u_zoomRatio;
|
|
206
|
-
uniform float u_sizeRatio;
|
|
207
|
-
uniform float u_pixelRatio;
|
|
208
|
-
uniform float u_correctionRatio;
|
|
209
|
-
uniform float u_minEdgeThickness;
|
|
210
|
-
uniform float u_lengthToThicknessRatio;
|
|
211
|
-
uniform float u_feather;
|
|
212
|
-
|
|
213
|
-
varying vec4 v_color;
|
|
214
|
-
varying vec2 v_normal;
|
|
215
|
-
varying float v_thickness;
|
|
216
|
-
varying float v_feather;
|
|
217
|
-
|
|
218
|
-
const float bias = 255.0 / 254.0;
|
|
219
|
-
|
|
220
|
-
void main() {
|
|
221
|
-
float minThickness = u_minEdgeThickness;
|
|
222
|
-
|
|
223
|
-
float radius = a_radius * a_radiusCoef;
|
|
224
|
-
vec2 normal = a_normal * a_normalCoef;
|
|
225
|
-
vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
|
|
226
|
-
|
|
227
|
-
float normalLength = length(normal);
|
|
228
|
-
vec2 unitNormal = normal / normalLength;
|
|
229
|
-
|
|
230
|
-
// These first computations are taken from edge.vert.glsl. Please read it to
|
|
231
|
-
// get better comments on what's happening:
|
|
232
|
-
float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
|
|
233
|
-
float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
|
|
234
|
-
|
|
235
|
-
// Here, we move the point to leave space for the arrow head:
|
|
236
|
-
float direction = sign(radius);
|
|
237
|
-
float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio;
|
|
238
|
-
float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
|
|
239
|
-
|
|
240
|
-
vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength);
|
|
241
|
-
|
|
242
|
-
// Here is the proper position of the vertex
|
|
243
|
-
gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1);
|
|
244
|
-
|
|
245
|
-
v_thickness = webGLThickness / u_zoomRatio;
|
|
246
|
-
|
|
247
|
-
v_normal = unitNormal;
|
|
248
|
-
|
|
249
|
-
v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
|
|
250
|
-
|
|
251
|
-
#ifdef PICKING_MODE
|
|
252
|
-
// For picking mode, we use the ID as the color:
|
|
253
|
-
v_color = a_id;
|
|
254
|
-
#else
|
|
255
|
-
// For normal mode, we use the color:
|
|
256
|
-
v_color = a_color;
|
|
257
|
-
#endif
|
|
258
|
-
|
|
259
|
-
v_color.a *= bias;
|
|
260
|
-
}
|
|
261
|
-
`,tr=WebGLRenderingContext,nr=tr.UNSIGNED_BYTE,rr=tr.FLOAT,ir=[`u_matrix`,`u_zoomRatio`,`u_sizeRatio`,`u_correctionRatio`,`u_pixelRatio`,`u_feather`,`u_minEdgeThickness`,`u_lengthToThicknessRatio`],ar={lengthToThicknessRatio:Zn.lengthToThicknessRatio};function or(e){var t=q(q({},ar),e||{});return function(e){function n(){return Bt(this,n),qt(this,n,arguments)}return Yt(n,e),Ht(n,[{key:`getDefinition`,value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:er,FRAGMENT_SHADER_SOURCE:$n,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:ir,ATTRIBUTES:[{name:`a_positionStart`,size:2,type:rr},{name:`a_positionEnd`,size:2,type:rr},{name:`a_normal`,size:2,type:rr},{name:`a_color`,size:4,type:nr,normalized:!0},{name:`a_id`,size:4,type:nr,normalized:!0},{name:`a_radius`,size:1,type:rr}],CONSTANT_ATTRIBUTES:[{name:`a_positionCoef`,size:1,type:rr},{name:`a_normalCoef`,size:1,type:rr},{name:`a_radiusCoef`,size:1,type:rr}],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=pn(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)}}])}(Nn)}or();function sr(e){return Pn([or(e),Qn(e)])}var cr=sr(),lr=`
|
|
262
|
-
attribute vec4 a_id;
|
|
263
|
-
attribute vec4 a_color;
|
|
264
|
-
attribute vec2 a_normal;
|
|
265
|
-
attribute float a_normalCoef;
|
|
266
|
-
attribute vec2 a_positionStart;
|
|
267
|
-
attribute vec2 a_positionEnd;
|
|
268
|
-
attribute float a_positionCoef;
|
|
269
|
-
|
|
270
|
-
uniform mat3 u_matrix;
|
|
271
|
-
uniform float u_sizeRatio;
|
|
272
|
-
uniform float u_zoomRatio;
|
|
273
|
-
uniform float u_pixelRatio;
|
|
274
|
-
uniform float u_correctionRatio;
|
|
275
|
-
uniform float u_minEdgeThickness;
|
|
276
|
-
uniform float u_feather;
|
|
277
|
-
|
|
278
|
-
varying vec4 v_color;
|
|
279
|
-
varying vec2 v_normal;
|
|
280
|
-
varying float v_thickness;
|
|
281
|
-
varying float v_feather;
|
|
282
|
-
|
|
283
|
-
const float bias = 255.0 / 254.0;
|
|
284
|
-
|
|
285
|
-
void main() {
|
|
286
|
-
float minThickness = u_minEdgeThickness;
|
|
287
|
-
|
|
288
|
-
vec2 normal = a_normal * a_normalCoef;
|
|
289
|
-
vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
|
|
290
|
-
|
|
291
|
-
float normalLength = length(normal);
|
|
292
|
-
vec2 unitNormal = normal / normalLength;
|
|
293
|
-
|
|
294
|
-
// We require edges to be at least "minThickness" pixels thick *on screen*
|
|
295
|
-
// (so we need to compensate the size ratio):
|
|
296
|
-
float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
|
|
297
|
-
|
|
298
|
-
// Then, we need to retrieve the normalized thickness of the edge in the WebGL
|
|
299
|
-
// referential (in a ([0, 1], [0, 1]) space), using our "magic" correction
|
|
300
|
-
// ratio:
|
|
301
|
-
float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
|
|
302
|
-
|
|
303
|
-
// Here is the proper position of the vertex
|
|
304
|
-
gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1);
|
|
305
|
-
|
|
306
|
-
// For the fragment shader though, we need a thickness that takes the "magic"
|
|
307
|
-
// correction ratio into account (as in webGLThickness), but so that the
|
|
308
|
-
// antialiasing effect does not depend on the zoom level. So here's yet
|
|
309
|
-
// another thickness version:
|
|
310
|
-
v_thickness = webGLThickness / u_zoomRatio;
|
|
311
|
-
|
|
312
|
-
v_normal = unitNormal;
|
|
313
|
-
|
|
314
|
-
v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
|
|
315
|
-
|
|
316
|
-
#ifdef PICKING_MODE
|
|
317
|
-
// For picking mode, we use the ID as the color:
|
|
318
|
-
v_color = a_id;
|
|
319
|
-
#else
|
|
320
|
-
// For normal mode, we use the color:
|
|
321
|
-
v_color = a_color;
|
|
322
|
-
#endif
|
|
323
|
-
|
|
324
|
-
v_color.a *= bias;
|
|
325
|
-
}
|
|
326
|
-
`,ur=WebGLRenderingContext,dr=ur.UNSIGNED_BYTE,fr=ur.FLOAT,pr=[`u_matrix`,`u_zoomRatio`,`u_sizeRatio`,`u_correctionRatio`,`u_pixelRatio`,`u_feather`,`u_minEdgeThickness`],mr=function(e){function t(){return Bt(this,t),qt(this,t,arguments)}return Yt(t,e),Ht(t,[{key:`getDefinition`,value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:lr,FRAGMENT_SHADER_SOURCE:$n,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:pr,ATTRIBUTES:[{name:`a_positionStart`,size:2,type:fr},{name:`a_positionEnd`,size:2,type:fr},{name:`a_normal`,size:2,type:fr},{name:`a_color`,size:4,type:dr,normalized:!0},{name:`a_id`,size:4,type:dr,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:`a_positionCoef`,size:1,type:fr},{name:`a_normalCoef`,size:1,type:fr}],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=pn(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)}}])}(Nn),hr=function(e){function t(){var e;return Bt(this,t),e=qt(this,t),e.rawEmitter=e,e}return Yt(t,e),Ht(t)}(N.EventEmitter),gr=o(((e,t)=>{t.exports=function(e){return typeof e==`object`&&!!e&&typeof e.addUndirectedEdgeWithKey==`function`&&typeof e.dropNode==`function`&&typeof e.multi==`boolean`}})),_r=c(gr()),vr={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)}},yr={easing:`quadraticInOut`,duration:150};function br(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function xr(e,t,n){return e[0]=t,e[4]=typeof n==`number`?n:t,e}function Sr(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 Cr(e,t,n){return e[6]=t,e[7]=n,e}function wr(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 Tr(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 Er(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 Dr(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=br(),f=Math.min(l,u)-2*r,p=Er(t,n);return i?(wr(d,Cr(br(),s,c)),wr(d,xr(br(),o)),wr(d,Sr(br(),a)),wr(d,xr(br(),l/f/2/p,u/f/2/p))):(wr(d,xr(br(),f/l*2*p,f/u*2*p)),wr(d,Sr(br(),-a)),wr(d,xr(br(),1/o)),wr(d,Cr(br(),-s,-c))),d}function Or(e,t,n){var r=Tr(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 kr(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 Ar(e){if(!(0,_r.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 jr(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 Mr(){return window.devicePixelRatio===void 0?1:window.devicePixelRatio}function Nr(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 Pr(e){var t=tn(e.x,2),n=t[0],r=t[1],i=tn(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 Fr(e){"@babel/helpers - typeof";return Fr=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},Fr(e)}function Ir(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 Lr(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 Rr={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:Fn,defaultDrawNodeLabel:In,defaultDrawNodeHover:Ln,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:{}},zr={circle:Wn},Br={arrow:cr,line:mr};function Vr(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 Hr(e){var t=Lr({},Rr,e);return t.nodeProgramClasses=Lr({},zr,t.nodeProgramClasses),t.edgeProgramClasses=Lr({},Br,t.edgeProgramClasses),t}var Ur=1.5,Wr=function(e){function t(){var e;return Bt(this,t),e=qt(this,t),K(e,`x`,.5),K(e,`y`,.5),K(e,`angle`,0),K(e,`ratio`,1),K(e,`minRatio`,null),K(e,`maxRatio`,null),K(e,`enabledZooming`,!0),K(e,`enabledPanning`,!0),K(e,`enabledRotation`,!0),K(e,`clean`,null),K(e,`nextFrame`,null),K(e,`previousState`,null),K(e,`enabled`,!0),e.previousState=e.getState(),e}return Yt(t,e),Ht(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(q(q({},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=q(q({},yr),n),a=this.validateState(e),o=typeof i.easing==`function`?i.easing:vr[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||Ur)},e):this.animate({ratio:this.ratio/Ur})}},{key:`animatedUnzoom`,value:function(e){return e?typeof e==`number`?this.animate({ratio:this.ratio*e}):this.animate({ratio:this.ratio*(e.factor||Ur)},e):this.animate({ratio:this.ratio*Ur})}},{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)}}])}(hr);function Gr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Kr(e,t){var n=q(q({},Gr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function qr(e){var t=`x`in e?e:q(q({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function Jr(e,t){return q(q({},Kr(e,t)),{},{delta:Qr(e)})}var Yr=2;function Xr(e){for(var t=[],n=0,r=Math.min(e.length,Yr);n<r;n++)t.push(e[n]);return t}function Zr(e,t,n){var r={touches:Xr(e.touches).map(function(e){return Gr(e,n)}),previousTouches:t.map(function(e){return Gr(e,n)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){r.sigmaDefaultPrevented=!0},original:e};return r}function Qr(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 $r=function(e){function t(e,n){var r;return Bt(this,t),r=qt(this,t),r.container=e,r.renderer=n,r}return Yt(t,e),Ht(t)}(hr),ei=[`doubleClickTimeout`,`doubleClickZoomingDuration`,`doubleClickZoomingRatio`,`dragTimeout`,`draggedEventsTolerance`,`inertiaDuration`,`inertiaRatio`,`zoomDuration`,`zoomingRatio`].reduce(function(e,t){return q(q({},e),{},K({},t,Rr[t]))},{}),ti=function(e){function t(e,n){var r;return Bt(this,t),r=qt(this,t,[e,n]),K(r,`enabled`,!0),K(r,`draggedEvents`,0),K(r,`downStartTime`,null),K(r,`lastMouseX`,null),K(r,`lastMouseY`,null),K(r,`isMouseDown`,!1),K(r,`isMoving`,!1),K(r,`movingTimeout`,null),K(r,`startCameraState`,null),K(r,`clicks`,0),K(r,`doubleClickTimeout`,null),K(r,`currentWheelDirection`,0),K(r,`settings`,ei),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 Yt(t,e),Ht(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`,Kr(e,this.container))}}},{key:`handleRightClick`,value:function(e){this.enabled&&this.emit(`rightClick`,Kr(e,this.container))}},{key:`handleDoubleClick`,value:function(e){if(this.enabled){e.preventDefault(),e.stopPropagation();var t=Kr(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(Gr(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=Gr(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`,Kr(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=Gr(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`,Kr(e,this.container))}}},{key:`handleMove`,value:function(e){var t=this;if(this.enabled){var n=Kr(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=Gr(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`,Kr(e,this.container))}},{key:`handleEnter`,value:function(e){this.emit(`mouseenter`,Kr(e,this.container))}},{key:`handleWheel`,value:function(e){var t=this,n=this.renderer.getCamera();if(!(!this.enabled||!n.enabledZooming)){var r=Qr(e);if(r){var i=Jr(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(Gr(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}}])}($r),ni=[`dragTimeout`,`inertiaDuration`,`inertiaRatio`,`doubleClickTimeout`,`doubleClickZoomingRatio`,`doubleClickZoomingDuration`,`tapMoveTolerance`].reduce(function(e,t){return q(q({},e),{},K({},t,Rr[t]))},{}),ri=function(e){function t(e,n){var r;return Bt(this,t),r=qt(this,t,[e,n]),K(r,`enabled`,!0),K(r,`isMoving`,!1),K(r,`hasMoved`,!1),K(r,`touchMode`,0),K(r,`startTouchesPositions`,[]),K(r,`lastTouches`,[]),K(r,`lastTap`,null),K(r,`settings`,ni),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 Yt(t,e),Ht(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=Xr(e.touches);if(this.touchMode=n.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=n.map(function(e){return Gr(e,t.container)}),this.touchMode===2){var r=tn(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`,Zr(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`,Zr(e,this.lastTouches,this.container)),!e.touches.length){var i=Gr(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=Zr(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=Zr(e,this.lastTouches,this.container);this.emit(`tap`,u),this.lastTap={time:Date.now(),position:u.touches[0]||u.previousTouches[0]}}}this.lastTouches=Xr(e.touches),this.startTouchesPositions=[]}}},{key:`handleMove`,value:function(e){var t=this;if(!(!this.enabled||!this.startTouchesPositions.length)){e.preventDefault();var n=Xr(e.touches),r=n.map(function(e){return Gr(e,t.container)}),i=this.lastTouches;this.lastTouches=n,this.lastTouchesPositions=r;var a=Zr(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 T=this.getDimensions(),E=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:s}),D=Math.min(T.width,T.height)-2*c,O=D/T.width,ee=D/T.height,te=w/D,k=_-D/2/O,A=v-D/2/ee,j=[k*Math.cos(-h.angle)-A*Math.sin(-h.angle),A*Math.cos(-h.angle)+k*Math.sin(-h.angle)];k=j[0],A=j[1],h.x=E.x-k*te,h.y=E.y+A*te,o.setState(h);break}}}}},{key:`setSettings`,value:function(e){this.settings=e}}])}($r);function ii(e){if(Array.isArray(e))return Qt(e)}function ai(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function oi(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
327
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function si(e){return ii(e)||ai(e)||$t(e)||oi()}function ci(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 li(e,t){if(e==null)return{};var n,r,i=ci(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 ui=function(){function e(t,n){Bt(this,e),this.key=t,this.size=n}return Ht(e,null,[{key:`compare`,value:function(e,t){return e.size>t.size?-1:e.size<t.size||e.key>t.key?1:-1}}])}(),di=function(){function e(){Bt(this,e),K(this,`width`,0),K(this,`height`,0),K(this,`cellSize`,0),K(this,`columns`,0),K(this,`rows`,0),K(this,`cells`,{})}return Ht(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 ui(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(ui.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 fi(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 pi=150,mi=50,hi=Object.prototype.hasOwnProperty;function gi(e,t,n){if(!hi.call(n,`x`)||!hi.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,hi.call(n,`hidden`)||(n.hidden=!1),hi.call(n,`highlighted`)||(n.highlighted=!1),hi.call(n,`forceLabel`)||(n.forceLabel=!1),(!n.type||n.type===``)&&(n.type=e.defaultNodeType),n.zIndex||=0,n}function _i(e,t,n){return n.color||=e.defaultEdgeColor,n.label||=``,n.size||=.5,hi.call(n,`hidden`)||(n.hidden=!1),hi.call(n,`forceLabel`)||(n.forceLabel=!1),(!n.type||n.type===``)&&(n.type=e.defaultEdgeType),n.zIndex||=0,n}var vi=function(e){function t(e,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(Bt(this,t),r=qt(this,t),K(r,`elements`,{}),K(r,`canvasContexts`,{}),K(r,`webGLContexts`,{}),K(r,`pickingLayers`,new Set),K(r,`textures`,{}),K(r,`frameBuffers`,{}),K(r,`activeListeners`,{}),K(r,`labelGrid`,new di),K(r,`nodeDataCache`,{}),K(r,`edgeDataCache`,{}),K(r,`nodeProgramIndex`,{}),K(r,`edgeProgramIndex`,{}),K(r,`nodesWithForcedLabels`,new Set),K(r,`edgesWithForcedLabels`,new Set),K(r,`nodeExtent`,{x:[0,1],y:[0,1]}),K(r,`nodeZExtent`,[1/0,-1/0]),K(r,`edgeZExtent`,[1/0,-1/0]),K(r,`matrix`,br()),K(r,`invMatrix`,br()),K(r,`correctionRatio`,1),K(r,`customBBox`,null),K(r,`normalizationFunction`,Pr({x:[0,1],y:[0,1]})),K(r,`graphToViewportRatio`,1),K(r,`itemIDsIndex`,{}),K(r,`nodeIndices`,{}),K(r,`edgeIndices`,{}),K(r,`width`,0),K(r,`height`,0),K(r,`pixelRatio`,Mr()),K(r,`pickingDownSizingRatio`,2*r.pixelRatio),K(r,`displayedNodeLabels`,new Set),K(r,`displayedEdgeLabels`,new Set),K(r,`highlightedNodes`,new Set),K(r,`hoveredNode`,null),K(r,`hoveredEdge`,null),K(r,`renderFrame`,null),K(r,`renderHighlightedNodesFrame`,null),K(r,`needToProcess`,!1),K(r,`checkEdgesEventsFrame`,null),K(r,`nodePrograms`,{}),K(r,`nodeHoverPrograms`,{}),K(r,`edgePrograms`,{}),r.settings=Hr(i),Vr(r.settings),Ar(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 Wr,r.bindCameraHandlers(),r.mouseCaptor=new ti(r.elements.mouse,r),r.mouseCaptor.setSettings(r.settings),r.touchCaptor=new ri(r.elements.mouse,r),r.touchCaptor.setSettings(r.settings),r.bindEventHandlers(),r.bindGraphHandlers(),r.handleSettingsUpdate(),r.refresh(),r}return Yt(t,e),Ht(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=li(t,[e].map(zt));n.kill(),this.nodePrograms=r}if(this.nodeHoverPrograms[e]){var i=this.nodeHoverPrograms,a=i[e],o=li(i,[e].map(zt));a.kill(),this.nodePrograms=o}return this}},{key:`unregisterEdgeProgram`,value:function(e){if(this.edgePrograms[e]){var t=this.edgePrograms,n=t[e],r=li(t,[e].map(zt));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=_n(this.webGLContexts.nodes,this.frameBuffers.nodes,t,n,this.pixelRatio,this.pickingDownSizingRatio),i=gn.apply(void 0,si(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=qr(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`,q(q({},r),{},{node:e.hoveredNode})),e.hoveredNode=i,e.emit(`enterNode`,q(q({},r),{},{node:i})),e.scheduleHighlightedNodesRender();return}if(e.hoveredNode&&e.getNodeAtPosition(n)!==e.hoveredNode){var a=e.hoveredNode;e.hoveredNode=null,e.emit(`leaveNode`,q(q({},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`,q(q({},r),{},{edge:e.hoveredEdge})),o&&e.emit(`enterEdge`,q(q({},r),{},{edge:o})),e.hoveredEdge=o)}},this.activeListeners.handleMoveBody=function(t){var n=qr(t);e.emit(`moveBody`,{event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(t){var n=qr(t),r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}};e.hoveredNode&&(e.emit(`leaveNode`,q(q({},r),{},{node:e.hoveredNode})),e.scheduleHighlightedNodesRender()),e.settings.enableEdgeEvents&&e.hoveredEdge&&(e.emit(`leaveEdge`,q(q({},r),{},{edge:e.hoveredEdge})),e.scheduleHighlightedNodesRender()),e.emit(`leaveStage`,q({},r))},this.activeListeners.handleEnter=function(t){var n=qr(t),r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}};e.emit(`enterStage`,q({},r))};var t=function(t){return function(n){var r=qr(n),i={event:r,preventSigmaDefault:function(){r.preventSigmaDefault()}},a=e.getNodeAtPosition(r);if(a)return e.emit(`${t}Node`,q(q({},i),{},{node:a}));if(e.settings.enableEdgeEvents){var o=e.getEdgeAtPoint(r.x,r.y);if(o)return e.emit(`${t}Edge`,q(q({},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=_n(this.webGLContexts.edges,this.frameBuffers.edges,e,t,this.pixelRatio,this.pickingDownSizingRatio),r=gn.apply(void 0,si(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=kr(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=Pr(this.customBBox||this.nodeExtent);var l=Dr(new Wr().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(!hi.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=Nr(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 T=this.nodeDataCache[w];this.addNodeToProgram(w,d[w],u[T.type]++)}for(var E={},D=t.edges(),O=0,ee=D.length;O<ee;O++){var te=D[O],k=this.edgeDataCache[te];E[k.type]=(E[k.type]||0)+1}for(var A in this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(D=Nr(this.edgeZExtent,function(t){return e.edgeDataCache[t].zIndex},D)),this.edgePrograms){if(!hi.call(this.edgePrograms,A))throw Error(`Sigma: could not find a suitable program for edge type "${A}"!`);this.edgePrograms[A].reallocate(E[A]||0),E[A]=0}for(var j=0,M=D.length;j<M;j++){var ne=D[j];f[ne]=m,p[f[ne]]={type:`edge`,id:ne},m++;var N=this.edgeDataCache[ne];this.addEdgeToProgram(ne,f[ne],E[N.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&&Fr(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=q({},e),o=i||this.nodeExtent,s=tn(o.x,2),c=s[0],l=s[1],u=tn(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 T=this.viewportToFramedGraph({x:0,y:0},{cameraState:e}),E=this.viewportToFramedGraph({x:C,y:w},{cameraState:e});C=E.x-T.x,w=E.y-T.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);Ir(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<-pi||c>this.width+pi||l<-mi||l>this.height+mi)){this.displayedNodeLabels.add(a);var d=this.settings.defaultDrawNodeLabel;(this.nodePrograms[o.type]?.drawLabel||d)(n,q(q({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=fi({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});Ir(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,q(q({key:a},l),{},{size:this.scaleSize(l.size)}),q(q(q({key:o[0]},s),this.framedGraphToViewport(s)),{},{size:this.scaleSize(s.size)}),q(q(q({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,q(q({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=Dr(i,a,o,s),this.invMatrix=Dr(i,a,o,s,!0),this.correctionRatio=Or(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=gi(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=_i(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 di,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=jr(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=q({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 q({},this.settings)}},{key:`getSetting`,value:function(e){return this.settings[e]}},{key:`setSetting`,value:function(e,t){var n=q({},this.settings);return this.settings[e]=t,Vr(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=q({},this.settings);return this.settings=q(q({},this.settings),e),Vr(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=Mr(),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(q(q({},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=Tr(t.matrix?t.matrix:n?Dr(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=Tr(t.matrix?t.matrix:n?Dr(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}}])}(hr),yi=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)}})),bi=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,T=10,E=3,D=9,O=10;t.exports=function(e,t,ee){var te,k,A,j,M,ne,N,P,F,re,I=t.length,ie=ee.length,L=e.adjustSizes,R=e.barnesHutTheta*e.barnesHutTheta,ae,z,B,V,oe,H,U,W=[];for(A=0;A<I;A+=T)t[A+o]=t[A+i],t[A+s]=t[A+a],t[A+i]=0,t[A+a]=0;if(e.outboundAttractionDistribution){for(ae=0,A=0;A<I;A+=T)ae+=t[A+c];ae/=I/T}if(e.barnesHutOptimize){var se=1/0,ce=-1/0,le=1/0,ue=-1/0,de,fe,pe;for(A=0;A<I;A+=T)se=Math.min(se,t[A+n]),ce=Math.max(ce,t[A+n]),le=Math.min(le,t[A+r]),ue=Math.max(ue,t[A+r]);var me=ce-se,he=ue-le;for(me>he?(le-=(me-he)/2,ue=le+me):(se-=(he-me)/2,ce=se+he),W[0+h]=-1,W[0+g]=(se+ce)/2,W[0+_]=(le+ue)/2,W[0+v]=Math.max(ce-se,ue-le),W[0+y]=-1,W[0+b]=-1,W[0+x]=0,W[0+S]=0,W[0+C]=0,te=1,A=0;A<I;A+=T)for(k=0,pe=w;;)if(W[k+b]>=0){de=t[A+n]<W[k+g]?t[A+r]<W[k+_]?W[k+b]:W[k+b]+D:t[A+r]<W[k+_]?W[k+b]+D*2:W[k+b]+D*3,W[k+S]=(W[k+S]*W[k+x]+t[A+n]*t[A+c])/(W[k+x]+t[A+c]),W[k+C]=(W[k+C]*W[k+x]+t[A+r]*t[A+c])/(W[k+x]+t[A+c]),W[k+x]+=t[A+c],k=de;continue}else if(W[k+h]<0){W[k+h]=A;break}else{if(W[k+b]=te*D,P=W[k+v]/2,F=W[k+b],W[F+h]=-1,W[F+g]=W[k+g]-P,W[F+_]=W[k+_]-P,W[F+v]=P,W[F+y]=F+D,W[F+b]=-1,W[F+x]=0,W[F+S]=0,W[F+C]=0,F+=D,W[F+h]=-1,W[F+g]=W[k+g]-P,W[F+_]=W[k+_]+P,W[F+v]=P,W[F+y]=F+D,W[F+b]=-1,W[F+x]=0,W[F+S]=0,W[F+C]=0,F+=D,W[F+h]=-1,W[F+g]=W[k+g]+P,W[F+_]=W[k+_]-P,W[F+v]=P,W[F+y]=F+D,W[F+b]=-1,W[F+x]=0,W[F+S]=0,W[F+C]=0,F+=D,W[F+h]=-1,W[F+g]=W[k+g]+P,W[F+_]=W[k+_]+P,W[F+v]=P,W[F+y]=W[k+y],W[F+b]=-1,W[F+x]=0,W[F+S]=0,W[F+C]=0,te+=4,de=t[W[k+h]+n]<W[k+g]?t[W[k+h]+r]<W[k+_]?W[k+b]:W[k+b]+D:t[W[k+h]+r]<W[k+_]?W[k+b]+D*2:W[k+b]+D*3,W[k+x]=t[W[k+h]+c],W[k+S]=t[W[k+h]+n],W[k+C]=t[W[k+h]+r],W[de+h]=W[k+h],W[k+h]=-1,fe=t[A+n]<W[k+g]?t[A+r]<W[k+_]?W[k+b]:W[k+b]+D:t[A+r]<W[k+_]?W[k+b]+D*2:W[k+b]+D*3,de===fe)if(pe--){k=de;continue}else{pe=w;break}W[fe+h]=A;break}}if(e.barnesHutOptimize)for(z=e.scalingRatio,A=0;A<I;A+=T)for(k=0;;)if(W[k+b]>=0)if(H=(t[A+n]-W[k+S])**2+(t[A+r]-W[k+C])**2,re=W[k+v],4*re*re/H<R){if(B=t[A+n]-W[k+S],V=t[A+r]-W[k+C],L===!0?H>0?(U=z*t[A+c]*W[k+x]/H,t[A+i]+=B*U,t[A+a]+=V*U):H<0&&(U=-z*t[A+c]*W[k+x]/Math.sqrt(H),t[A+i]+=B*U,t[A+a]+=V*U):H>0&&(U=z*t[A+c]*W[k+x]/H,t[A+i]+=B*U,t[A+a]+=V*U),k=W[k+y],k<0)break;continue}else{k=W[k+b];continue}else{if(ne=W[k+h],ne>=0&&ne!==A&&(B=t[A+n]-t[ne+n],V=t[A+r]-t[ne+r],H=B*B+V*V,L===!0?H>0?(U=z*t[A+c]*t[ne+c]/H,t[A+i]+=B*U,t[A+a]+=V*U):H<0&&(U=-z*t[A+c]*t[ne+c]/Math.sqrt(H),t[A+i]+=B*U,t[A+a]+=V*U):H>0&&(U=z*t[A+c]*t[ne+c]/H,t[A+i]+=B*U,t[A+a]+=V*U)),k=W[k+y],k<0)break;continue}else for(z=e.scalingRatio,j=0;j<I;j+=T)for(M=0;M<j;M+=T)B=t[j+n]-t[M+n],V=t[j+r]-t[M+r],L===!0?(H=Math.sqrt(B*B+V*V)-t[j+u]-t[M+u],H>0?(U=z*t[j+c]*t[M+c]/H/H,t[j+i]+=B*U,t[j+a]+=V*U,t[M+i]-=B*U,t[M+a]-=V*U):H<0&&(U=100*z*t[j+c]*t[M+c],t[j+i]+=B*U,t[j+a]+=V*U,t[M+i]-=B*U,t[M+a]-=V*U)):(H=Math.sqrt(B*B+V*V),H>0&&(U=z*t[j+c]*t[M+c]/H/H,t[j+i]+=B*U,t[j+a]+=V*U,t[M+i]-=B*U,t[M+a]-=V*U));for(F=e.gravity/e.scalingRatio,z=e.scalingRatio,A=0;A<I;A+=T)U=0,B=t[A+n],V=t[A+r],H=Math.sqrt(B**2+V**2),e.strongGravityMode?H>0&&(U=z*t[A+c]*F):H>0&&(U=z*t[A+c]*F/H),t[A+i]-=B*U,t[A+a]-=V*U;for(z=1*(e.outboundAttractionDistribution?ae:1),N=0;N<ie;N+=E)j=ee[N+f],M=ee[N+p],P=ee[N+m],oe=P**+e.edgeWeightInfluence,B=t[j+n]-t[M+n],V=t[j+r]-t[M+r],L===!0?(H=Math.sqrt(B*B+V*V)-t[j+u]-t[M+u],e.linLogMode?e.outboundAttractionDistribution?H>0&&(U=-z*oe*Math.log(1+H)/H/t[j+c]):H>0&&(U=-z*oe*Math.log(1+H)/H):e.outboundAttractionDistribution?H>0&&(U=-z*oe/t[j+c]):H>0&&(U=-z*oe)):(H=Math.sqrt(B**2+V**2),e.linLogMode?e.outboundAttractionDistribution?H>0&&(U=-z*oe*Math.log(1+H)/H/t[j+c]):H>0&&(U=-z*oe*Math.log(1+H)/H):e.outboundAttractionDistribution?(H=1,U=-z*oe/t[j+c]):(H=1,U=-z*oe)),H>0&&(t[j+i]+=B*U,t[j+a]+=V*U,t[M+i]-=B*U,t[M+a]-=V*U);var ge,_e,ve,ye,be,xe;if(L===!0)for(A=0;A<I;A+=T)t[A+d]!==1&&(ge=Math.sqrt(t[A+i]**2+t[A+a]**2),ge>O&&(t[A+i]=t[A+i]*O/ge,t[A+a]=t[A+a]*O/ge),_e=t[A+c]*Math.sqrt((t[A+o]-t[A+i])*(t[A+o]-t[A+i])+(t[A+s]-t[A+a])*(t[A+s]-t[A+a])),ve=Math.sqrt((t[A+o]+t[A+i])*(t[A+o]+t[A+i])+(t[A+s]+t[A+a])*(t[A+s]+t[A+a]))/2,ye=.1*Math.log(1+ve)/(1+Math.sqrt(_e)),be=t[A+n]+t[A+i]*(ye/e.slowDown),t[A+n]=be,xe=t[A+r]+t[A+a]*(ye/e.slowDown),t[A+r]=xe);else for(A=0;A<I;A+=T)t[A+d]!==1&&(_e=t[A+c]*Math.sqrt((t[A+o]-t[A+i])*(t[A+o]-t[A+i])+(t[A+s]-t[A+a])*(t[A+s]-t[A+a])),ve=Math.sqrt((t[A+o]+t[A+i])*(t[A+o]+t[A+i])+(t[A+s]+t[A+a])*(t[A+s]+t[A+a]))/2,ye=t[A+l]*Math.log(1+ve)/(1+Math.sqrt(_e)),t[A+l]=Math.min(1,Math.sqrt(ye*(t[A+i]**2+t[A+a]**2)/(1+Math.sqrt(_e)))),be=t[A+n]+t[A+i]*(ye/e.slowDown),t[A+n]=be,xe=t[A+r]+t[A+a]*(ye/e.slowDown),t[A+r]=xe);return{}}})),xi=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}})),Si=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}})),Ci=o(((e,t)=>{var n=gr(),r=yi().createEdgeWeightGetter,i=bi(),a=xi(),o=Si();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})),wi=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,T=3,E=9,D=10;n.exports=function(n,O,ee){var te,k,A,j,M,ne,N,P,F,re,I=O.length,ie=ee.length,L=n.adjustSizes,R=n.barnesHutTheta*n.barnesHutTheta,ae,z,B,V,oe,H,U,W=[];for(A=0;A<I;A+=w)O[A+a]=O[A+r],O[A+o]=O[A+i],O[A+r]=0,O[A+i]=0;if(n.outboundAttractionDistribution){for(ae=0,A=0;A<I;A+=w)ae+=O[A+s];ae/=I/w}if(n.barnesHutOptimize){var se=1/0,ce=-1/0,le=1/0,ue=-1/0,de,fe,pe;for(A=0;A<I;A+=w)se=Math.min(se,O[A+e]),ce=Math.max(ce,O[A+e]),le=Math.min(le,O[A+t]),ue=Math.max(ue,O[A+t]);var me=ce-se,he=ue-le;for(me>he?(le-=(me-he)/2,ue=le+me):(se-=(he-me)/2,ce=se+he),W[0+m]=-1,W[0+h]=(se+ce)/2,W[0+g]=(le+ue)/2,W[0+_]=Math.max(ce-se,ue-le),W[0+v]=-1,W[0+y]=-1,W[0+b]=0,W[0+x]=0,W[0+S]=0,te=1,A=0;A<I;A+=w)for(k=0,pe=C;;)if(W[k+y]>=0){de=O[A+e]<W[k+h]?O[A+t]<W[k+g]?W[k+y]:W[k+y]+E:O[A+t]<W[k+g]?W[k+y]+E*2:W[k+y]+E*3,W[k+x]=(W[k+x]*W[k+b]+O[A+e]*O[A+s])/(W[k+b]+O[A+s]),W[k+S]=(W[k+S]*W[k+b]+O[A+t]*O[A+s])/(W[k+b]+O[A+s]),W[k+b]+=O[A+s],k=de;continue}else if(W[k+m]<0){W[k+m]=A;break}else{if(W[k+y]=te*E,P=W[k+_]/2,F=W[k+y],W[F+m]=-1,W[F+h]=W[k+h]-P,W[F+g]=W[k+g]-P,W[F+_]=P,W[F+v]=F+E,W[F+y]=-1,W[F+b]=0,W[F+x]=0,W[F+S]=0,F+=E,W[F+m]=-1,W[F+h]=W[k+h]-P,W[F+g]=W[k+g]+P,W[F+_]=P,W[F+v]=F+E,W[F+y]=-1,W[F+b]=0,W[F+x]=0,W[F+S]=0,F+=E,W[F+m]=-1,W[F+h]=W[k+h]+P,W[F+g]=W[k+g]-P,W[F+_]=P,W[F+v]=F+E,W[F+y]=-1,W[F+b]=0,W[F+x]=0,W[F+S]=0,F+=E,W[F+m]=-1,W[F+h]=W[k+h]+P,W[F+g]=W[k+g]+P,W[F+_]=P,W[F+v]=W[k+v],W[F+y]=-1,W[F+b]=0,W[F+x]=0,W[F+S]=0,te+=4,de=O[W[k+m]+e]<W[k+h]?O[W[k+m]+t]<W[k+g]?W[k+y]:W[k+y]+E:O[W[k+m]+t]<W[k+g]?W[k+y]+E*2:W[k+y]+E*3,W[k+b]=O[W[k+m]+s],W[k+x]=O[W[k+m]+e],W[k+S]=O[W[k+m]+t],W[de+m]=W[k+m],W[k+m]=-1,fe=O[A+e]<W[k+h]?O[A+t]<W[k+g]?W[k+y]:W[k+y]+E:O[A+t]<W[k+g]?W[k+y]+E*2:W[k+y]+E*3,de===fe)if(pe--){k=de;continue}else{pe=C;break}W[fe+m]=A;break}}if(n.barnesHutOptimize)for(z=n.scalingRatio,A=0;A<I;A+=w)for(k=0;;)if(W[k+y]>=0)if(H=(O[A+e]-W[k+x])**2+(O[A+t]-W[k+S])**2,re=W[k+_],4*re*re/H<R){if(B=O[A+e]-W[k+x],V=O[A+t]-W[k+S],L===!0?H>0?(U=z*O[A+s]*W[k+b]/H,O[A+r]+=B*U,O[A+i]+=V*U):H<0&&(U=-z*O[A+s]*W[k+b]/Math.sqrt(H),O[A+r]+=B*U,O[A+i]+=V*U):H>0&&(U=z*O[A+s]*W[k+b]/H,O[A+r]+=B*U,O[A+i]+=V*U),k=W[k+v],k<0)break;continue}else{k=W[k+y];continue}else{if(ne=W[k+m],ne>=0&&ne!==A&&(B=O[A+e]-O[ne+e],V=O[A+t]-O[ne+t],H=B*B+V*V,L===!0?H>0?(U=z*O[A+s]*O[ne+s]/H,O[A+r]+=B*U,O[A+i]+=V*U):H<0&&(U=-z*O[A+s]*O[ne+s]/Math.sqrt(H),O[A+r]+=B*U,O[A+i]+=V*U):H>0&&(U=z*O[A+s]*O[ne+s]/H,O[A+r]+=B*U,O[A+i]+=V*U)),k=W[k+v],k<0)break;continue}else for(z=n.scalingRatio,j=0;j<I;j+=w)for(M=0;M<j;M+=w)B=O[j+e]-O[M+e],V=O[j+t]-O[M+t],L===!0?(H=Math.sqrt(B*B+V*V)-O[j+l]-O[M+l],H>0?(U=z*O[j+s]*O[M+s]/H/H,O[j+r]+=B*U,O[j+i]+=V*U,O[M+r]-=B*U,O[M+i]-=V*U):H<0&&(U=100*z*O[j+s]*O[M+s],O[j+r]+=B*U,O[j+i]+=V*U,O[M+r]-=B*U,O[M+i]-=V*U)):(H=Math.sqrt(B*B+V*V),H>0&&(U=z*O[j+s]*O[M+s]/H/H,O[j+r]+=B*U,O[j+i]+=V*U,O[M+r]-=B*U,O[M+i]-=V*U));for(F=n.gravity/n.scalingRatio,z=n.scalingRatio,A=0;A<I;A+=w)U=0,B=O[A+e],V=O[A+t],H=Math.sqrt(B**2+V**2),n.strongGravityMode?H>0&&(U=z*O[A+s]*F):H>0&&(U=z*O[A+s]*F/H),O[A+r]-=B*U,O[A+i]-=V*U;for(z=1*(n.outboundAttractionDistribution?ae:1),N=0;N<ie;N+=T)j=ee[N+d],M=ee[N+f],P=ee[N+p],oe=P**+n.edgeWeightInfluence,B=O[j+e]-O[M+e],V=O[j+t]-O[M+t],L===!0?(H=Math.sqrt(B*B+V*V)-O[j+l]-O[M+l],n.linLogMode?n.outboundAttractionDistribution?H>0&&(U=-z*oe*Math.log(1+H)/H/O[j+s]):H>0&&(U=-z*oe*Math.log(1+H)/H):n.outboundAttractionDistribution?H>0&&(U=-z*oe/O[j+s]):H>0&&(U=-z*oe)):(H=Math.sqrt(B**2+V**2),n.linLogMode?n.outboundAttractionDistribution?H>0&&(U=-z*oe*Math.log(1+H)/H/O[j+s]):H>0&&(U=-z*oe*Math.log(1+H)/H):n.outboundAttractionDistribution?(H=1,U=-z*oe/O[j+s]):(H=1,U=-z*oe)),H>0&&(O[j+r]+=B*U,O[j+i]+=V*U,O[M+r]-=B*U,O[M+i]-=V*U);var ge,_e,ve,ye,be,xe;if(L===!0)for(A=0;A<I;A+=w)O[A+u]!==1&&(ge=Math.sqrt(O[A+r]**2+O[A+i]**2),ge>D&&(O[A+r]=O[A+r]*D/ge,O[A+i]=O[A+i]*D/ge),_e=O[A+s]*Math.sqrt((O[A+a]-O[A+r])*(O[A+a]-O[A+r])+(O[A+o]-O[A+i])*(O[A+o]-O[A+i])),ve=Math.sqrt((O[A+a]+O[A+r])*(O[A+a]+O[A+r])+(O[A+o]+O[A+i])*(O[A+o]+O[A+i]))/2,ye=.1*Math.log(1+ve)/(1+Math.sqrt(_e)),be=O[A+e]+O[A+r]*(ye/n.slowDown),O[A+e]=be,xe=O[A+t]+O[A+i]*(ye/n.slowDown),O[A+t]=xe);else for(A=0;A<I;A+=w)O[A+u]!==1&&(_e=O[A+s]*Math.sqrt((O[A+a]-O[A+r])*(O[A+a]-O[A+r])+(O[A+o]-O[A+i])*(O[A+o]-O[A+i])),ve=Math.sqrt((O[A+a]+O[A+r])*(O[A+a]+O[A+r])+(O[A+o]+O[A+i])*(O[A+o]+O[A+i]))/2,ye=O[A+c]*Math.log(1+ve)/(1+Math.sqrt(_e)),O[A+c]=Math.min(1,Math.sqrt(ye*(O[A+r]**2+O[A+i]**2)/(1+Math.sqrt(_e)))),be=O[A+e]+O[A+r]*(ye/n.slowDown),O[A+e]=be,xe=O[A+t]+O[A+i]*(ye/n.slowDown),O[A+t]=xe);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])})}})),Ti=o(((e,t)=>{var n=wi(),r=gr(),i=yi().createEdgeWeightGetter,a=xi(),o=Si();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})),J=c(Ci(),1),Ei=c(Ti(),1),Di={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`},Oi={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`},ki={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 Ai(e,t){return`${e}${Math.round(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,`0`)}`}function ji(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 Mi(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 Ni(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 Pi(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 Fi(e,t){let n=Ni(e),r={r:10,g:10,b:16};return Pi(r.r+(n.r-r.r)*t,r.g+(n.g-r.g)*t,r.b+(n.b-r.b)*t)}var Ii=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}),Li=e=>e>1e4?45e3:e>5e3?35e3:e>2e3?3e4:e>1e3?25e3:2e4;function Ri(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 zi(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 Bi(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 Vi(){let{state:e,dispatch:t}=E(),n=(0,b.useRef)(e);n.current=e;let r=(0,b.useRef)(t);r.current=t;let i=(0,b.useRef)(new G({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 Ei.default(e,{settings:{...J.default.inferSettings(e),...Ii(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()},Li(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=Ri(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:zi(n.kind),color:Di[n.kind]??`#6b7280`,nodeKind:n.kind,mass:Bi(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=Ai(Oi[n.kind]??`#4b5563`,ki[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){Hi(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 vi(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:Mi,hideEdgesOnMove:!0,zIndex:!0,minCameraRatio:.002,maxCameraRatio:50});a.current=t,Hi(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;Hi(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)(Wi,{}),(0,x.jsx)(Gi,{isLayoutRunning:f,onToggleLayout:()=>{f?h():g(i.current)}})]})}function Hi(e,t,n,r,i){let a=t._topNThreshold??0,o=t._degreeMap??new Map,s=r??i,c=s?ji(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=Ui(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=Di[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:Fi(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:Ai(Oi[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 Ui(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 Wi(){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:Di[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:Oi[e]}}),(0,x.jsx)(`span`,{children:e})]},e))})]})]})}function Gi({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 Ki({node:e,onClose:t}){let{state:n,dispatch:r}=E(),[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 D(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 D(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:Di[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:Di[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)(qi,{label:`File`,value:e.filePath??`—`,mono:!0}),(0,x.jsx)(qi,{label:`Lines`,value:e.startLine?`${e.startLine}${e.endLine?`–${e.endLine}`:``}`:`—`}),i?.cluster&&(0,x.jsx)(qi,{label:`Cluster`,value:i.cluster}),(0,x.jsx)(qi,{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)(Ji,{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)(Ji,{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)(Ji,{label:`Imports`,items:i.imports.map(e=>({id:e.id,name:e.name,kind:`module`})),Pill:g}),(0,x.jsx)(Ji,{label:`Imported By`,items:i.importedBy.map(e=>({id:e.id,name:e.name,kind:`module`})),Pill:g}),(0,x.jsx)(Ji,{label:`Extends`,items:i.extends.map(e=>({id:e.id,name:e.name,kind:`class`})),Pill:g}),(0,x.jsx)(Ji,{label:`Implements`,items:i.implementsEdges.map(e=>({id:e.id,name:e.name,kind:`interface`})),Pill:g}),(0,x.jsx)(Ji,{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 qi({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 Ji({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 Yi=`modulepreload`,Xi=function(e){return`/`+e},Zi={},Qi=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=Xi(t,n),t in Zi)return;Zi[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`:Yi,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)})},$i=null;async function ea(){if($i)return $i;try{return $i=(await Qi(()=>import(`./es-Bu8iwdFw.js`),[])).default,$i}catch{return null}}var ta=`code-intel:source-panel-size`,na=420;function ra({file:e,startLine:t,endLine:n,repo:r,onClose:i}){let{state:a}=E(),[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(ta);return e?parseInt(e,10):na}catch{return na}}),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(ta,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 D(a.serverUrl).sourcePreview(e,t,n,r).then(async e=>{if(i)return;s(e);let t=await ea();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]),T=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:T}),(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)(ia,{}),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)(aa,{data:o,highlightedHtml:f,focusStartLine:t,focusEndLine:n})]})]})}function ia(){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 aa({data:e,highlightedHtml:t,focusStartLine:n,focusEndLine:r}){let i=e.content.split(`
|
|
328
|
-
`),a=t?t.split(`
|
|
329
|
-
`):null;return(0,x.jsxs)(`div`,{className:`relative`,children:[(0,x.jsx)(sa,{}),(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 oa=!1;function sa(){return(0,b.useEffect)(()=>{if(oa)return;oa=!0;let e=document.createElement(`style`);e.textContent=`
|
|
330
|
-
.hljs { color: #e4e4ed; }
|
|
331
|
-
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-literal, .hljs-type { color: #a78bfa; }
|
|
332
|
-
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string { color: #4ade80; }
|
|
333
|
-
.hljs-comment, .hljs-quote { color: #5a5a70; font-style: italic; }
|
|
334
|
-
.hljs-number, .hljs-bullet, .hljs-link, .hljs-meta { color: #fbbf24; }
|
|
335
|
-
.hljs-title, .hljs-class .hljs-title, .hljs-function .hljs-title { color: #22d3ee; }
|
|
336
|
-
.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-tag, .hljs-name,
|
|
337
|
-
.hljs-selector-id, .hljs-selector-class, .hljs-regexp, .hljs-deletion { color: #f87171; }
|
|
338
|
-
.hljs-params { color: #e4e4ed; }
|
|
339
|
-
.hljs-emphasis { font-style: italic; }
|
|
340
|
-
.hljs-strong { font-weight: bold; }
|
|
341
|
-
`,document.head.appendChild(e)},[]),null}function ca(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 la(e){return{filePath:e.filePath,startLine:e.startLine,endLine:e.endLine,nodeId:e.id}}function ua(e){let t=e.startLine?`:${e.startLine}${e.endLine&&e.endLine!==e.startLine?`-${e.endLine}`:``}`:``;return`[[${e.filePath}${t}]]`}async function da(e,t,n){let r=ca(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
|
|
342
|
-
|
|
343
|
-
I sampled key entry points across the graph. Below are the most prominent symbols, grouped by kind:
|
|
344
|
-
|
|
345
|
-
`,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}\` ${ua(t)}\n`}s+=`
|
|
346
|
-
`}s+=`
|
|
347
|
-
_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+=`- ${ua(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})_ ${ua(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=la(d.node);if(i.push(f),r.kind===`callers`){let e=`### Callers of \`${d.node.name}\` ${ua(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) ${ua(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}\` ${ua(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+=`
|
|
348
|
-
`}n({type:`final`,text:o,citations:i});return}let p=`### \`${d.node.name}\` _(${d.node.kind})_ ${ua(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:**
|
|
349
|
-
`;for(let e of d.callers.slice(0,8))p+=`- \`${e.name??e.id}\`\n`;p+=`
|
|
350
|
-
`}if(d.callees.length){p+=`**Calls:**
|
|
351
|
-
`;for(let e of d.callees.slice(0,8))p+=`- \`${e.name??e.id}\`\n`;p+=`
|
|
352
|
-
`}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 fa=[{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 pa(){let{state:e,dispatch:t}=E(),[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 D(e.serverUrl),o=[];try{await da(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:fa.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)(ma,{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 ma({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)(ha,{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)(ga,{text:e.content,onCitationClick:t})})]})}function ha({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 ga({text:e,onCitationClick:t}){return(0,x.jsx)(x.Fragment,{children:e.split(`
|
|
353
|
-
`).map((e,n)=>(0,x.jsx)(`div`,{className:`leading-relaxed`,children:xa(e,t)},n))})}var _a=/\[\[([^\]]+)\]\]/g,va=/^(#{1,4})\s+(.*)$/,ya=/\*\*([^*]+)\*\*/g,ba=/`([^`]+)`/g;function xa(e,t){let n=e.match(va);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:Sa(r,t)})}return e.startsWith(`- `)?(0,x.jsxs)(`div`,{className:`ml-3`,children:[`• `,Sa(e.slice(2),t)]}):e.trim()===``?(0,x.jsx)(`div`,{className:`h-1`}):(0,x.jsx)(`span`,{children:Sa(e,t)})}function Sa(e,t){let n=[],r=0;_a.lastIndex=0;let i;for(;(i=_a.exec(e))!==null;){i.index>r&&n.push((0,x.jsx)(b.Fragment,{children:Ta(e.slice(r,i.index))},`t-${r}`));let a=i[1],o=Ca(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:[wa(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:Ta(e.slice(r))},`t-${r}`)),n}function Ca(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 wa(e){let t=e.split(`/`);return t.length<=2?e:`…/${t.slice(-2).join(`/`)}`}function Ta(e){let t=[],n=0;for(;n<e.length;){ya.lastIndex=n,ba.lastIndex=n;let r=ya.exec(e),i=ba.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 Ea(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 Da(e){let t=e.files.length;for(let n of e.children.values())t+=Da(n);return t}function Oa({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=Da(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)(Oa,{node:e,depth:t+1,onFileClick:n,selectedPath:r},e.path)),a.map(e=>(0,x.jsx)(ka,{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)(Oa,{node:e,depth:t+1,onFileClick:n,selectedPath:r},e.path)),a.map(e=>(0,x.jsx)(ka,{fp:e,indent:s+16,selected:e===r,onClick:()=>n(e)},e))]})]})}function ka({fp:e,indent:t,selected:n,onClick:r}){let i=e.split(`/`).pop(),a=Aa[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 Aa={ts:`🔷`,tsx:`⚛️`,js:`🟨`,jsx:`⚛️`,json:`📋`,md:`📝`,py:`🐍`,go:`🐹`,rs:`🦀`,java:`☕`,cs:`🔵`,css:`🎨`,html:`🌐`,yaml:`⚙️`,yml:`⚙️`,toml:`⚙️`,sh:`🐚`,txt:`📄`,gitignore:`🚫`};function ja(){let{state:e,dispatch:t}=E(),[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)(()=>Ea(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)(Oa,{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 Ma={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`},Na={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`},Pa=[`all`,1,2,3,5];function Fa(){let{state:e,dispatch:t}=E(),{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)(Ia,{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:Di[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:Ma[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)(Ia,{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: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.jsxs)(Ia,{title:`Focus Depth`,subtitle:`Show nodes within N hops of selection`,children:[(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Pa.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 Ia({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 La=`code-intel:query-history`,Ra=20,za=[`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`],Ba=/\b(FIND|TRAVERSE|PATH|COUNT|WHERE|FROM|TO|DEPTH|LIMIT|OFFSET|GROUP|BY|AND|IN|CONTAINS|STARTS_WITH)\b/g;function Va(){try{return JSON.parse(localStorage.getItem(La)??`[]`)}catch{return[]}}function Ha(e){localStorage.setItem(La,JSON.stringify(e.slice(0,Ra)))}function Ua(e){let t=Va().filter(t=>t!==e);t.unshift(e),Ha(t)}function Wa(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function Ga(e){return Wa(e).replace(Ba,`<span style="color:#7c3aed;font-weight:600">$1</span>`)}function Ka({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 qa({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 Ja(){let{state:e,dispatch:t}=E(),[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)(()=>Va()),f=(0,b.useRef)(null),p=(0,b.useRef)(null);(0,b.useEffect)(()=>{p.current&&(p.current.innerHTML=Ga(n)+`
|
|
354
|
-
`)},[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 D(e.serverUrl).queryGQL(t)),Ua(t),d(Va())}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 —`}),za.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)(Ka,{nodes:o.nodes,onSelectNode:_}),y&&o.groups&&(0,x.jsx)(qa,{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 Ya(e){return e>=.8?`#4ade80`:e>=.5?`#fbbf24`:`#f87171`}function Xa(e){return e>=.8?`border-node-class/60`:e>=.5?`border-amber-500/60`:`border-red-500/60`}function Za(){let{state:e}=E(),[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 D(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 D(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?Xa(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:Ya(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:Ya(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 Qa(){let{state:e}=E(),[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 D(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.1`]})]})]})}var $a={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 eo({onToggleAI:e,aiOpen:t}){let{state:n,dispatch:r}=E(),[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 D(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 D(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 D(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:Di[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 ${$a[w.role]??$a.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 to=[{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 no({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:to.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 ro(){let{state:e,dispatch:t}=E(),[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)(eo,{onToggleAI:()=>a(e=>!e),aiOpen:i}),(0,x.jsx)(no,{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)(Y,{}),n===`filters`&&(0,x.jsx)(Fa,{}),n===`files`&&(0,x.jsx)(ja,{}),n===`query`&&(0,x.jsx)(Ja,{}),n===`group`&&e.mode===`group`&&(0,x.jsx)(io,{}),n===`groups`&&(0,x.jsx)(Za,{})]})]}),(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)(Vi,{})}),e.selectedNode&&(0,x.jsx)(Ki,{node:e.selectedNode,onClose:()=>t({type:`SELECT_NODE`,node:null})}),c&&e.selectedNode?.filePath&&e.selectedNode?.startLine&&(0,x.jsx)(ra,{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)(pa,{})})]}),(0,x.jsx)(Qa,{})]})}function Y(){let{state:e,dispatch:t}=E(),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:Di[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=Di[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 io(){let{state:e,dispatch:t}=E(),[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 D(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 ao(){let{state:e}=E();switch(e.view){case`login`:return(0,x.jsx)(O,{});case`connect`:return(0,x.jsx)(j,{});case`loading`:return(0,x.jsx)(ne,{});case`exploring`:return(0,x.jsx)(ro,{})}}function oo(){return(0,x.jsx)(T,{children:(0,x.jsx)(ao,{})})}y.createRoot(document.getElementById(`root`)).render((0,x.jsx)(b.StrictMode,{children:(0,x.jsx)(oo,{})}));export{c as n,o as t};
|