LightRAG/lightrag/api/webui/assets/index-BMB0OroL.js
ArnoChen dfd7f702dc new build
fix api alert
2025-02-17 02:08:55 +08:00

1065 lines
812 KiB
JavaScript

var gD=Object.defineProperty;var vD=(e,t,n)=>t in e?gD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xr=(e,t,n)=>vD(e,typeof t!="symbol"?t+"":t,n);function yD(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(a,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>a[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bD(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function a(){return this instanceof a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),n}var Mh={exports:{}},qs={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Vx;function xD(){if(Vx)return qs;Vx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:e,type:a,key:c,ref:o!==void 0?o:null,props:s}}return qs.Fragment=t,qs.jsx=n,qs.jsxs=n,qs}var qx;function wD(){return qx||(qx=1,Mh.exports=xD()),Mh.exports}var x=wD(),Ph={exports:{}},Ke={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Yx;function ED(){if(Yx)return Ke;Yx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function y(G){return G===null||typeof G!="object"?null:(G=g&&G[g]||G["@@iterator"],typeof G=="function"?G:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function _(G,H,O){this.props=G,this.context=H,this.refs=E,this.updater=O||b}_.prototype.isReactComponent={},_.prototype.setState=function(G,H){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,H,"setState")},_.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function N(){}N.prototype=_.prototype;function C(G,H,O){this.props=G,this.context=H,this.refs=E,this.updater=O||b}var A=C.prototype=new N;A.constructor=C,S(A,_.prototype),A.isPureReactComponent=!0;var k=Array.isArray,D={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function R(G,H,O,$,W,re){return O=re.ref,{$$typeof:e,type:G,key:H,ref:O!==void 0?O:null,props:re}}function U(G,H){return R(G.type,H,void 0,void 0,void 0,G.props)}function L(G){return typeof G=="object"&&G!==null&&G.$$typeof===e}function I(G){var H={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(O){return H[O]})}var q=/\/+/g;function Y(G,H){return typeof G=="object"&&G!==null&&G.key!=null?I(""+G.key):H.toString(36)}function B(){}function X(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(B,B):(G.status="pending",G.then(function(H){G.status==="pending"&&(G.status="fulfilled",G.value=H)},function(H){G.status==="pending"&&(G.status="rejected",G.reason=H)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function ne(G,H,O,$,W){var re=typeof G;(re==="undefined"||re==="boolean")&&(G=null);var de=!1;if(G===null)de=!0;else switch(re){case"bigint":case"string":case"number":de=!0;break;case"object":switch(G.$$typeof){case e:case t:de=!0;break;case m:return de=G._init,ne(de(G._payload),H,O,$,W)}}if(de)return W=W(G),de=$===""?"."+Y(G,0):$,k(W)?(O="",de!=null&&(O=de.replace(q,"$&/")+"/"),ne(W,H,O,"",function(Ce){return Ce})):W!=null&&(L(W)&&(W=U(W,O+(W.key==null||G&&G.key===W.key?"":(""+W.key).replace(q,"$&/")+"/")+de)),H.push(W)),1;de=0;var ie=$===""?".":$+":";if(k(G))for(var oe=0;oe<G.length;oe++)$=G[oe],re=ie+Y($,oe),de+=ne($,H,O,re,W);else if(oe=y(G),typeof oe=="function")for(G=oe.call(G),oe=0;!($=G.next()).done;)$=$.value,re=ie+Y($,oe++),de+=ne($,H,O,re,W);else if(re==="object"){if(typeof G.then=="function")return ne(X(G),H,O,$,W);throw H=String(G),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return de}function F(G,H,O){if(G==null)return G;var $=[],W=0;return ne(G,$,"","",function(re){return H.call(O,re,W++)}),$}function z(G){if(G._status===-1){var H=G._result;H=H(),H.then(function(O){(G._status===0||G._status===-1)&&(G._status=1,G._result=O)},function(O){(G._status===0||G._status===-1)&&(G._status=2,G._result=O)}),G._status===-1&&(G._status=0,G._result=H)}if(G._status===1)return G._result.default;throw G._result}var j=typeof reportError=="function"?reportError:function(G){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof G=="object"&&G!==null&&typeof G.message=="string"?String(G.message):String(G),error:G});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",G);return}console.error(G)};function K(){}return Ke.Children={map:F,forEach:function(G,H,O){F(G,function(){H.apply(this,arguments)},O)},count:function(G){var H=0;return F(G,function(){H++}),H},toArray:function(G){return F(G,function(H){return H})||[]},only:function(G){if(!L(G))throw Error("React.Children.only expected to receive a single React element child.");return G}},Ke.Component=_,Ke.Fragment=n,Ke.Profiler=o,Ke.PureComponent=C,Ke.StrictMode=a,Ke.Suspense=f,Ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ke.act=function(){throw Error("act(...) is not supported in production builds of React.")},Ke.cache=function(G){return function(){return G.apply(null,arguments)}},Ke.cloneElement=function(G,H,O){if(G==null)throw Error("The argument must be a React element, but you passed "+G+".");var $=S({},G.props),W=G.key,re=void 0;if(H!=null)for(de in H.ref!==void 0&&(re=void 0),H.key!==void 0&&(W=""+H.key),H)!M.call(H,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&H.ref===void 0||($[de]=H[de]);var de=arguments.length-2;if(de===1)$.children=O;else if(1<de){for(var ie=Array(de),oe=0;oe<de;oe++)ie[oe]=arguments[oe+2];$.children=ie}return R(G.type,W,void 0,void 0,re,$)},Ke.createContext=function(G){return G={$$typeof:c,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null},G.Provider=G,G.Consumer={$$typeof:s,_context:G},G},Ke.createElement=function(G,H,O){var $,W={},re=null;if(H!=null)for($ in H.key!==void 0&&(re=""+H.key),H)M.call(H,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(W[$]=H[$]);var de=arguments.length-2;if(de===1)W.children=O;else if(1<de){for(var ie=Array(de),oe=0;oe<de;oe++)ie[oe]=arguments[oe+2];W.children=ie}if(G&&G.defaultProps)for($ in de=G.defaultProps,de)W[$]===void 0&&(W[$]=de[$]);return R(G,re,void 0,void 0,null,W)},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(G){return{$$typeof:u,render:G}},Ke.isValidElement=L,Ke.lazy=function(G){return{$$typeof:m,_payload:{_status:-1,_result:G},_init:z}},Ke.memo=function(G,H){return{$$typeof:h,type:G,compare:H===void 0?null:H}},Ke.startTransition=function(G){var H=D.T,O={};D.T=O;try{var $=G(),W=D.S;W!==null&&W(O,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(K,j)}catch(re){j(re)}finally{D.T=H}},Ke.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ke.use=function(G){return D.H.use(G)},Ke.useActionState=function(G,H,O){return D.H.useActionState(G,H,O)},Ke.useCallback=function(G,H){return D.H.useCallback(G,H)},Ke.useContext=function(G){return D.H.useContext(G)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(G,H){return D.H.useDeferredValue(G,H)},Ke.useEffect=function(G,H){return D.H.useEffect(G,H)},Ke.useId=function(){return D.H.useId()},Ke.useImperativeHandle=function(G,H,O){return D.H.useImperativeHandle(G,H,O)},Ke.useInsertionEffect=function(G,H){return D.H.useInsertionEffect(G,H)},Ke.useLayoutEffect=function(G,H){return D.H.useLayoutEffect(G,H)},Ke.useMemo=function(G,H){return D.H.useMemo(G,H)},Ke.useOptimistic=function(G,H){return D.H.useOptimistic(G,H)},Ke.useReducer=function(G,H,O){return D.H.useReducer(G,H,O)},Ke.useRef=function(G){return D.H.useRef(G)},Ke.useState=function(G){return D.H.useState(G)},Ke.useSyncExternalStore=function(G,H,O){return D.H.useSyncExternalStore(G,H,O)},Ke.useTransition=function(){return D.H.useTransition()},Ke.version="19.0.0",Ke}var Wx;function Yu(){return Wx||(Wx=1,Ph.exports=ED()),Ph.exports}var w=Yu();const ve=dn(w),SD=yD({__proto__:null,default:ve},[w]);var Gh={exports:{}},Ys={},Fh={exports:{}},Uh={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Xx;function _D(){return Xx||(Xx=1,function(e){function t(F,z){var j=F.length;F.push(z);e:for(;0<j;){var K=j-1>>>1,G=F[K];if(0<o(G,z))F[K]=z,F[j]=G,j=K;else break e}}function n(F){return F.length===0?null:F[0]}function a(F){if(F.length===0)return null;var z=F[0],j=F.pop();if(j!==z){F[0]=j;e:for(var K=0,G=F.length,H=G>>>1;K<H;){var O=2*(K+1)-1,$=F[O],W=O+1,re=F[W];if(0>o($,j))W<G&&0>o(re,$)?(F[K]=re,F[W]=j,K=W):(F[K]=$,F[O]=j,K=O);else if(W<G&&0>o(re,j))F[K]=re,F[W]=j,K=W;else break e}}return z}function o(F,z){var j=F.sortIndex-z.sortIndex;return j!==0?j:F.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],h=[],m=1,g=null,y=3,b=!1,S=!1,E=!1,_=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(F){for(var z=n(h);z!==null;){if(z.callback===null)a(h);else if(z.startTime<=F)a(h),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(h)}}function k(F){if(E=!1,A(F),!S)if(n(f)!==null)S=!0,X();else{var z=n(h);z!==null&&ne(k,z.startTime-F)}}var D=!1,M=-1,R=5,U=-1;function L(){return!(e.unstable_now()-U<R)}function I(){if(D){var F=e.unstable_now();U=F;var z=!0;try{e:{S=!1,E&&(E=!1,N(M),M=-1),b=!0;var j=y;try{t:{for(A(F),g=n(f);g!==null&&!(g.expirationTime>F&&L());){var K=g.callback;if(typeof K=="function"){g.callback=null,y=g.priorityLevel;var G=K(g.expirationTime<=F);if(F=e.unstable_now(),typeof G=="function"){g.callback=G,A(F),z=!0;break t}g===n(f)&&a(f),A(F)}else a(f);g=n(f)}if(g!==null)z=!0;else{var H=n(h);H!==null&&ne(k,H.startTime-F),z=!1}}break e}finally{g=null,y=j,b=!1}z=void 0}}finally{z?q():D=!1}}}var q;if(typeof C=="function")q=function(){C(I)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,B=Y.port2;Y.port1.onmessage=I,q=function(){B.postMessage(null)}}else q=function(){_(I,0)};function X(){D||(D=!0,q())}function ne(F,z){M=_(function(){F(e.unstable_now())},z)}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(F){F.callback=null},e.unstable_continueExecution=function(){S||b||(S=!0,X())},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(F){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var j=y;y=z;try{return F()}finally{y=j}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,z){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var j=y;y=F;try{return z()}finally{y=j}},e.unstable_scheduleCallback=function(F,z,j){var K=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?K+j:K):j=K,F){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=j+G,F={id:m++,callback:z,priorityLevel:F,startTime:j,expirationTime:G,sortIndex:-1},j>K?(F.sortIndex=j,t(h,F),n(f)===null&&F===n(h)&&(E?(N(M),M=-1):E=!0,ne(k,j-K))):(F.sortIndex=G,t(f,F),S||b||(S=!0,X())),F},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(F){var z=y;return function(){var j=y;y=z;try{return F.apply(this,arguments)}finally{y=j}}}}(Uh)),Uh}var Kx;function CD(){return Kx||(Kx=1,Fh.exports=_D()),Fh.exports}var Bh={exports:{}},nn={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Zx;function TD(){if(Zx)return nn;Zx=1;var e=Yu();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(f,h,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:f,containerInfo:h,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,nn.createPortal=function(f,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return s(f,h,null,m)},nn.flushSync=function(f){var h=c.T,m=a.p;try{if(c.T=null,a.p=2,f)return f()}finally{c.T=h,a.p=m,a.d.f()}},nn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(f,h))},nn.prefetchDNS=function(f){typeof f=="string"&&a.d.D(f)},nn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,g=u(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?a.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:b}):m==="script"&&a.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},nn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=u(h.as,h.crossOrigin);a.d.M(f,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(f)},nn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,g=u(m,h.crossOrigin);a.d.L(f,m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},nn.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=u(h.as,h.crossOrigin);a.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(f)},nn.requestFormReset=function(f){a.d.r(f)},nn.unstable_batchedUpdates=function(f,h){return f(h)},nn.useFormState=function(f,h,m){return c.H.useFormState(f,h,m)},nn.useFormStatus=function(){return c.H.useHostTransitionStatus()},nn.version="19.0.0",nn}var Qx;function Y1(){if(Qx)return Bh.exports;Qx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Bh.exports=TD(),Bh.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Jx;function RD(){if(Jx)return Ys;Jx=1;var e=CD(),t=Yu(),n=Y1();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}var s=Symbol.for("react.element"),c=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),y=Symbol.for("react.consumer"),b=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),k=Symbol.for("react.memo_cache_sentinel"),D=Symbol.iterator;function M(r){return r===null||typeof r!="object"?null:(r=D&&r[D]||r["@@iterator"],typeof r=="function"?r:null)}var R=Symbol.for("react.client.reference");function U(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===R?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case f:return"Fragment";case u:return"Portal";case m:return"Profiler";case h:return"StrictMode";case E:return"Suspense";case _:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case b:return(r.displayName||"Context")+".Provider";case y:return(r._context.displayName||"Context")+".Consumer";case S:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case N:return i=r.displayName||null,i!==null?i:U(r.type)||"Memo";case C:i=r._payload,r=r._init;try{return U(r(i))}catch{}}return null}var L=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.assign,q,Y;function B(r){if(q===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);q=i&&i[1]||"",Y=-1<l.stack.indexOf(`
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+q+r+Y}var X=!1;function ne(r,i){if(!r||X)return"";X=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(ue){var se=ue}Reflect.construct(r,[],xe)}else{try{xe.call()}catch(ue){se=ue}r.call(xe.prototype)}}else{try{throw Error()}catch(ue){se=ue}(xe=r())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(ue){if(ue&&se&&typeof ue.stack=="string")return[ue.stack,se.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),T=v[0],P=v[1];if(T&&P){var V=T.split(`
`),Q=P.split(`
`);for(p=d=0;d<V.length&&!V[d].includes("DetermineComponentFrameRoot");)d++;for(;p<Q.length&&!Q[p].includes("DetermineComponentFrameRoot");)p++;if(d===V.length||p===Q.length)for(d=V.length-1,p=Q.length-1;1<=d&&0<=p&&V[d]!==Q[p];)p--;for(;1<=d&&0<=p;d--,p--)if(V[d]!==Q[p]){if(d!==1||p!==1)do if(d--,p--,0>p||V[d]!==Q[p]){var fe=`
`+V[d].replace(" at new "," at ");return r.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",r.displayName)),fe}while(1<=d&&0<=p);break}}}finally{X=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?B(l):""}function F(r){switch(r.tag){case 26:case 27:case 5:return B(r.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 15:return r=ne(r.type,!1),r;case 11:return r=ne(r.type.render,!1),r;case 1:return r=ne(r.type,!0),r;default:return""}}function z(r){try{var i="";do i+=F(r),r=r.return;while(r);return i}catch(l){return`
Error generating stack: `+l.message+`
`+l.stack}}function j(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,i.flags&4098&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function K(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function G(r){if(j(r)!==r)throw Error(a(188))}function H(r){var i=r.alternate;if(!i){if(i=j(r),i===null)throw Error(a(188));return i!==r?null:r}for(var l=r,d=i;;){var p=l.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===l)return G(p),r;if(v===d)return G(p),i;v=v.sibling}throw Error(a(188))}if(l.return!==d.return)l=p,d=v;else{for(var T=!1,P=p.child;P;){if(P===l){T=!0,l=p,d=v;break}if(P===d){T=!0,d=p,l=v;break}P=P.sibling}if(!T){for(P=v.child;P;){if(P===l){T=!0,l=v,d=p;break}if(P===d){T=!0,d=v,l=p;break}P=P.sibling}if(!T)throw Error(a(189))}}if(l.alternate!==d)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:i}function O(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=O(r),i!==null)return i;r=r.sibling}return null}var $=Array.isArray,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},de=[],ie=-1;function oe(r){return{current:r}}function Ce(r){0>ie||(r.current=de[ie],de[ie]=null,ie--)}function he(r,i){ie++,de[ie]=r.current,r.current=i}var Se=oe(null),be=oe(null),Le=oe(null),Te=oe(null);function ye(r,i){switch(he(Le,i),he(be,r),he(Se,null),r=i.nodeType,r){case 9:case 11:i=(i=i.documentElement)&&(i=i.namespaceURI)?xx(i):0;break;default:if(r=r===8?i.parentNode:i,i=r.tagName,r=r.namespaceURI)r=xx(r),i=wx(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Ce(Se),he(Se,i)}function J(){Ce(Se),Ce(be),Ce(Le)}function le(r){r.memoizedState!==null&&he(Te,r);var i=Se.current,l=wx(i,r.type);i!==l&&(he(be,r),he(Se,l))}function _e(r){be.current===r&&(Ce(Se),Ce(be)),Te.current===r&&(Ce(Te),Bs._currentValue=re)}var pe=Object.prototype.hasOwnProperty,Ee=e.unstable_scheduleCallback,te=e.unstable_cancelCallback,Fe=e.unstable_shouldYield,Pe=e.unstable_requestPaint,me=e.unstable_now,Ae=e.unstable_getCurrentPriorityLevel,je=e.unstable_ImmediatePriority,He=e.unstable_UserBlockingPriority,it=e.unstable_NormalPriority,Ct=e.unstable_LowPriority,bt=e.unstable_IdlePriority,qt=e.log,fn=e.unstable_setDisableYieldValue,Gt=null,at=null;function Tn(r){if(at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Gt,r,void 0,(r.current.flags&128)===128)}catch{}}function xt(r){if(typeof qt=="function"&&fn(r),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(Gt,r)}catch{}}var Lt=Math.clz32?Math.clz32:Ol,Wa=Math.log,ji=Math.LN2;function Ol(r){return r>>>=0,r===0?32:31-(Wa(r)/ji|0)|0}var Li=128,ca=4194304;function Jt(r){var i=r&42;if(i!==0)return i;switch(r&-r){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: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 r&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function zi(r,i){var l=r.pendingLanes;if(l===0)return 0;var d=0,p=r.suspendedLanes,v=r.pingedLanes,T=r.warmLanes;r=r.finishedLanes!==0;var P=l&134217727;return P!==0?(l=P&~p,l!==0?d=Jt(l):(v&=P,v!==0?d=Jt(v):r||(T=P&~T,T!==0&&(d=Jt(T))))):(P=l&~p,P!==0?d=Jt(P):v!==0?d=Jt(v):r||(T=l&~T,T!==0&&(d=Jt(T)))),d===0?0:i!==0&&i!==d&&!(i&p)&&(p=d&-d,T=i&-i,p>=T||p===32&&(T&4194176)!==0)?i:d}function qe(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function lt(r,i){switch(r){case 1:case 2:case 4:case 8:return i+250;case 16:case 32:case 64: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 i+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 pt(){var r=Li;return Li<<=1,!(Li&4194176)&&(Li=128),r}function hn(){var r=ca;return ca<<=1,!(ca&62914560)&&(ca=4194304),r}function ln(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function pn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Nr(r,i,l,d,p,v){var T=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var P=r.entanglements,V=r.expirationTimes,Q=r.hiddenUpdates;for(l=T&~l;0<l;){var fe=31-Lt(l),xe=1<<fe;P[fe]=0,V[fe]=-1;var se=Q[fe];if(se!==null)for(Q[fe]=null,fe=0;fe<se.length;fe++){var ue=se[fe];ue!==null&&(ue.lane&=-536870913)}l&=~xe}d!==0&&mn(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(T&~i))}function mn(r,i,l){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-Lt(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|l&4194218}function Jn(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var d=31-Lt(l),p=1<<d;p&i|r[d]&i&&(r[d]|=i),l&=~p}}function gv(r){return r&=-r,2<r?8<r?r&134217727?32:268435456:8:2}function vv(){var r=W.p;return r!==0?r:(r=window.event,r===void 0?32:Fx(r.type))}function oA(r,i){var l=W.p;try{return W.p=r,i()}finally{W.p=l}}var ua=Math.random().toString(36).slice(2),en="__reactFiber$"+ua,gn="__reactProps$"+ua,Mi="__reactContainer$"+ua,Nd="__reactEvents$"+ua,sA="__reactListeners$"+ua,lA="__reactHandles$"+ua,yv="__reactResources$"+ua,Jo="__reactMarker$"+ua;function Od(r){delete r[en],delete r[gn],delete r[Nd],delete r[sA],delete r[lA]}function Xa(r){var i=r[en];if(i)return i;for(var l=r.parentNode;l;){if(i=l[Mi]||l[en]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=_x(r);r!==null;){if(l=r[en])return l;r=_x(r)}return i}r=l,l=r.parentNode}return null}function Pi(r){if(r=r[en]||r[Mi]){var i=r.tag;if(i===5||i===6||i===13||i===26||i===27||i===3)return r}return null}function es(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Gi(r){var i=r[yv];return i||(i=r[yv]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Ft(r){r[Jo]=!0}var bv=new Set,xv={};function Ka(r,i){Fi(r,i),Fi(r+"Capture",i)}function Fi(r,i){for(xv[r]=i,r=0;r<i.length;r++)bv.add(i[r])}var Or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cA=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]*$"),wv={},Ev={};function uA(r){return pe.call(Ev,r)?!0:pe.call(wv,r)?!1:cA.test(r)?Ev[r]=!0:(wv[r]=!0,!1)}function jl(r,i,l){if(uA(i))if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+l)}}function Ll(r,i,l){if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+l)}}function jr(r,i,l,d){if(d===null)r.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(i,l,""+d)}}function Mn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Sv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function dA(r){var i=Sv(r)?"checked":"value",l=Object.getOwnPropertyDescriptor(r.constructor.prototype,i),d=""+r[i];if(!r.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,v=l.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(T){d=""+T,v.call(this,T)}}),Object.defineProperty(r,i,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(T){d=""+T},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function zl(r){r._valueTracker||(r._valueTracker=dA(r))}function _v(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return r&&(d=Sv(r)?r.checked?"true":"false":r.value),r=d,r!==l?(i.setValue(r),!0):!1}function Ml(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var fA=/[\n"\\]/g;function Pn(r){return r.replace(fA,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function jd(r,i,l,d,p,v,T,P){r.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?r.type=T:r.removeAttribute("type"),i!=null?T==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Mn(i)):r.value!==""+Mn(i)&&(r.value=""+Mn(i)):T!=="submit"&&T!=="reset"||r.removeAttribute("value"),i!=null?Ld(r,T,Mn(i)):l!=null?Ld(r,T,Mn(l)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?r.name=""+Mn(P):r.removeAttribute("name")}function Cv(r,i,l,d,p,v,T,P){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||i!=null))return;l=l!=null?""+Mn(l):"",i=i!=null?""+Mn(i):l,P||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=P?r.checked:!!d,r.defaultChecked=!!d,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(r.name=T)}function Ld(r,i,l){i==="number"&&Ml(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Ui(r,i,l,d){if(r=r.options,i){i={};for(var p=0;p<l.length;p++)i["$"+l[p]]=!0;for(l=0;l<r.length;l++)p=i.hasOwnProperty("$"+r[l].value),r[l].selected!==p&&(r[l].selected=p),p&&d&&(r[l].defaultSelected=!0)}else{for(l=""+Mn(l),i=null,p=0;p<r.length;p++){if(r[p].value===l){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function Tv(r,i,l){if(i!=null&&(i=""+Mn(i),i!==r.value&&(r.value=i),l==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=l!=null?""+Mn(l):""}function Rv(r,i,l,d){if(i==null){if(d!=null){if(l!=null)throw Error(a(92));if($(d)){if(1<d.length)throw Error(a(93));d=d[0]}l=d}l==null&&(l=""),i=l}l=Mn(i),r.defaultValue=l,d=r.textContent,d===l&&d!==""&&d!==null&&(r.value=d)}function Bi(r,i){if(i){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=i;return}}r.textContent=i}var hA=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 Av(r,i,l){var d=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,l):typeof l!="number"||l===0||hA.has(i)?i==="float"?r.cssFloat=l:r[i]=(""+l).trim():r[i]=l+"px"}function Dv(r,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&l[p]!==d&&Av(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&Av(r,v,i[v])}function zd(r){if(r.indexOf("-")===-1)return!1;switch(r){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 pA=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"]]),mA=/^[\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 Pl(r){return mA.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}var Md=null;function Pd(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ii=null,Hi=null;function kv(r){var i=Pi(r);if(i&&(r=i.stateNode)){var l=r[gn]||null;e:switch(r=i.stateNode,i.type){case"input":if(jd(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Pn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==r&&d.form===r.form){var p=d[gn]||null;if(!p)throw Error(a(90));jd(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<l.length;i++)d=l[i],d.form===r.form&&_v(d)}break e;case"textarea":Tv(r,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Ui(r,!!l.multiple,i,!1)}}}var Gd=!1;function Nv(r,i,l){if(Gd)return r(i,l);Gd=!0;try{var d=r(i);return d}finally{if(Gd=!1,(Ii!==null||Hi!==null)&&(xc(),Ii&&(i=Ii,r=Hi,Hi=Ii=null,kv(i),r)))for(i=0;i<r.length;i++)kv(r[i])}}function ts(r,i){var l=r.stateNode;if(l===null)return null;var d=l[gn]||null;if(d===null)return null;l=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var Fd=!1;if(Or)try{var ns={};Object.defineProperty(ns,"passive",{get:function(){Fd=!0}}),window.addEventListener("test",ns,ns),window.removeEventListener("test",ns,ns)}catch{Fd=!1}var da=null,Ud=null,Gl=null;function Ov(){if(Gl)return Gl;var r,i=Ud,l=i.length,d,p="value"in da?da.value:da.textContent,v=p.length;for(r=0;r<l&&i[r]===p[r];r++);var T=l-r;for(d=1;d<=T&&i[l-d]===p[v-d];d++);return Gl=p.slice(r,1<d?1-d:void 0)}function Fl(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function Ul(){return!0}function jv(){return!1}function vn(r){function i(l,d,p,v,T){this._reactName=l,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=T,this.currentTarget=null;for(var P in r)r.hasOwnProperty(P)&&(l=r[P],this[P]=l?l(v):v[P]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Ul:jv,this.isPropagationStopped=jv,this}return I(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ul)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ul)},persist:function(){},isPersistent:Ul}),i}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bl=vn(Za),rs=I({},Za,{view:0,detail:0}),gA=vn(rs),Bd,Id,as,Il=I({},rs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$d,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==as&&(as&&r.type==="mousemove"?(Bd=r.screenX-as.screenX,Id=r.screenY-as.screenY):Id=Bd=0,as=r),Bd)},movementY:function(r){return"movementY"in r?r.movementY:Id}}),Lv=vn(Il),vA=I({},Il,{dataTransfer:0}),yA=vn(vA),bA=I({},rs,{relatedTarget:0}),Hd=vn(bA),xA=I({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),wA=vn(xA),EA=I({},Za,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),SA=vn(EA),_A=I({},Za,{data:0}),zv=vn(_A),CA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TA={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"},RA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AA(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=RA[r])?!!i[r]:!1}function $d(){return AA}var DA=I({},rs,{key:function(r){if(r.key){var i=CA[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Fl(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?TA[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$d,charCode:function(r){return r.type==="keypress"?Fl(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Fl(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),kA=vn(DA),NA=I({},Il,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mv=vn(NA),OA=I({},rs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$d}),jA=vn(OA),LA=I({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),zA=vn(LA),MA=I({},Il,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),PA=vn(MA),GA=I({},Za,{newState:0,oldState:0}),FA=vn(GA),UA=[9,13,27,32],Vd=Or&&"CompositionEvent"in window,is=null;Or&&"documentMode"in document&&(is=document.documentMode);var BA=Or&&"TextEvent"in window&&!is,Pv=Or&&(!Vd||is&&8<is&&11>=is),Gv=" ",Fv=!1;function Uv(r,i){switch(r){case"keyup":return UA.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var $i=!1;function IA(r,i){switch(r){case"compositionend":return Bv(i);case"keypress":return i.which!==32?null:(Fv=!0,Gv);case"textInput":return r=i.data,r===Gv&&Fv?null:r;default:return null}}function HA(r,i){if($i)return r==="compositionend"||!Vd&&Uv(r,i)?(r=Ov(),Gl=Ud=da=null,$i=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Pv&&i.locale!=="ko"?null:i.data;default:return null}}var $A={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 Iv(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!$A[r.type]:i==="textarea"}function Hv(r,i,l,d){Ii?Hi?Hi.push(d):Hi=[d]:Ii=d,i=Cc(i,"onChange"),0<i.length&&(l=new Bl("onChange","change",null,l,d),r.push({event:l,listeners:i}))}var os=null,ss=null;function VA(r){mx(r,0)}function Hl(r){var i=es(r);if(_v(i))return r}function $v(r,i){if(r==="change")return i}var Vv=!1;if(Or){var qd;if(Or){var Yd="oninput"in document;if(!Yd){var qv=document.createElement("div");qv.setAttribute("oninput","return;"),Yd=typeof qv.oninput=="function"}qd=Yd}else qd=!1;Vv=qd&&(!document.documentMode||9<document.documentMode)}function Yv(){os&&(os.detachEvent("onpropertychange",Wv),ss=os=null)}function Wv(r){if(r.propertyName==="value"&&Hl(ss)){var i=[];Hv(i,ss,r,Pd(r)),Nv(VA,i)}}function qA(r,i,l){r==="focusin"?(Yv(),os=i,ss=l,os.attachEvent("onpropertychange",Wv)):r==="focusout"&&Yv()}function YA(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Hl(ss)}function WA(r,i){if(r==="click")return Hl(i)}function XA(r,i){if(r==="input"||r==="change")return Hl(i)}function KA(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Rn=typeof Object.is=="function"?Object.is:KA;function ls(r,i){if(Rn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var l=Object.keys(r),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var p=l[d];if(!pe.call(i,p)||!Rn(r[p],i[p]))return!1}return!0}function Xv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Kv(r,i){var l=Xv(r);r=0;for(var d;l;){if(l.nodeType===3){if(d=r+l.textContent.length,r<=i&&d>=i)return{node:l,offset:i-r};r=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Xv(l)}}function Zv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Zv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Qv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Ml(r.document);i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=Ml(r.document)}return i}function Wd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}function ZA(r,i){var l=Qv(i);i=r.focusedElem;var d=r.selectionRange;if(l!==i&&i&&i.ownerDocument&&Zv(i.ownerDocument.documentElement,i)){if(d!==null&&Wd(i)){if(r=d.start,l=d.end,l===void 0&&(l=r),"selectionStart"in i)i.selectionStart=r,i.selectionEnd=Math.min(l,i.value.length);else if(l=(r=i.ownerDocument||document)&&r.defaultView||window,l.getSelection){l=l.getSelection();var p=i.textContent.length,v=Math.min(d.start,p);d=d.end===void 0?v:Math.min(d.end,p),!l.extend&&v>d&&(p=d,d=v,v=p),p=Kv(i,v);var T=Kv(i,d);p&&T&&(l.rangeCount!==1||l.anchorNode!==p.node||l.anchorOffset!==p.offset||l.focusNode!==T.node||l.focusOffset!==T.offset)&&(r=r.createRange(),r.setStart(p.node,p.offset),l.removeAllRanges(),v>d?(l.addRange(r),l.extend(T.node,T.offset)):(r.setEnd(T.node,T.offset),l.addRange(r)))}}for(r=[],l=i;l=l.parentNode;)l.nodeType===1&&r.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<r.length;i++)l=r[i],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var QA=Or&&"documentMode"in document&&11>=document.documentMode,Vi=null,Xd=null,cs=null,Kd=!1;function Jv(r,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Kd||Vi==null||Vi!==Ml(d)||(d=Vi,"selectionStart"in d&&Wd(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),cs&&ls(cs,d)||(cs=d,d=Cc(Xd,"onSelect"),0<d.length&&(i=new Bl("onSelect","select",null,i,l),r.push({event:i,listeners:d}),i.target=Vi)))}function Qa(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var qi={animationend:Qa("Animation","AnimationEnd"),animationiteration:Qa("Animation","AnimationIteration"),animationstart:Qa("Animation","AnimationStart"),transitionrun:Qa("Transition","TransitionRun"),transitionstart:Qa("Transition","TransitionStart"),transitioncancel:Qa("Transition","TransitionCancel"),transitionend:Qa("Transition","TransitionEnd")},Zd={},ey={};Or&&(ey=document.createElement("div").style,"AnimationEvent"in window||(delete qi.animationend.animation,delete qi.animationiteration.animation,delete qi.animationstart.animation),"TransitionEvent"in window||delete qi.transitionend.transition);function Ja(r){if(Zd[r])return Zd[r];if(!qi[r])return r;var i=qi[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in ey)return Zd[r]=i[l];return r}var ty=Ja("animationend"),ny=Ja("animationiteration"),ry=Ja("animationstart"),JA=Ja("transitionrun"),e2=Ja("transitionstart"),t2=Ja("transitioncancel"),ay=Ja("transitionend"),iy=new Map,oy="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 scrollEnd toggle touchMove waiting wheel".split(" ");function er(r,i){iy.set(r,i),Ka(i,[r])}var Gn=[],Yi=0,Qd=0;function $l(){for(var r=Yi,i=Qd=Yi=0;i<r;){var l=Gn[i];Gn[i++]=null;var d=Gn[i];Gn[i++]=null;var p=Gn[i];Gn[i++]=null;var v=Gn[i];if(Gn[i++]=null,d!==null&&p!==null){var T=d.pending;T===null?p.next=p:(p.next=T.next,T.next=p),d.pending=p}v!==0&&sy(l,p,v)}}function Vl(r,i,l,d){Gn[Yi++]=r,Gn[Yi++]=i,Gn[Yi++]=l,Gn[Yi++]=d,Qd|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function Jd(r,i,l,d){return Vl(r,i,l,d),ql(r)}function fa(r,i){return Vl(r,null,null,i),ql(r)}function sy(r,i,l){r.lanes|=l;var d=r.alternate;d!==null&&(d.lanes|=l);for(var p=!1,v=r.return;v!==null;)v.childLanes|=l,d=v.alternate,d!==null&&(d.childLanes|=l),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;p&&i!==null&&r.tag===3&&(v=r.stateNode,p=31-Lt(l),v=v.hiddenUpdates,r=v[p],r===null?v[p]=[i]:r.push(i),i.lane=l|536870912)}function ql(r){if(50<Ls)throw Ls=0,oh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Wi={},ly=new WeakMap;function Fn(r,i){if(typeof r=="object"&&r!==null){var l=ly.get(r);return l!==void 0?l:(i={value:r,source:i,stack:z(i)},ly.set(r,i),i)}return{value:r,source:i,stack:z(i)}}var Xi=[],Ki=0,Yl=null,Wl=0,Un=[],Bn=0,ei=null,Lr=1,zr="";function ti(r,i){Xi[Ki++]=Wl,Xi[Ki++]=Yl,Yl=r,Wl=i}function cy(r,i,l){Un[Bn++]=Lr,Un[Bn++]=zr,Un[Bn++]=ei,ei=r;var d=Lr;r=zr;var p=32-Lt(d)-1;d&=~(1<<p),l+=1;var v=32-Lt(i)+p;if(30<v){var T=p-p%5;v=(d&(1<<T)-1).toString(32),d>>=T,p-=T,Lr=1<<32-Lt(i)+p|l<<p|d,zr=v+r}else Lr=1<<v|l<<p|d,zr=r}function ef(r){r.return!==null&&(ti(r,1),cy(r,1,0))}function tf(r){for(;r===Yl;)Yl=Xi[--Ki],Xi[Ki]=null,Wl=Xi[--Ki],Xi[Ki]=null;for(;r===ei;)ei=Un[--Bn],Un[Bn]=null,zr=Un[--Bn],Un[Bn]=null,Lr=Un[--Bn],Un[Bn]=null}var cn=null,Yt=null,ot=!1,tr=null,pr=!1,nf=Error(a(519));function ni(r){var i=Error(a(418,""));throw fs(Fn(i,r)),nf}function uy(r){var i=r.stateNode,l=r.type,d=r.memoizedProps;switch(i[en]=r,i[gn]=d,l){case"dialog":tt("cancel",i),tt("close",i);break;case"iframe":case"object":case"embed":tt("load",i);break;case"video":case"audio":for(l=0;l<Ms.length;l++)tt(Ms[l],i);break;case"source":tt("error",i);break;case"img":case"image":case"link":tt("error",i),tt("load",i);break;case"details":tt("toggle",i);break;case"input":tt("invalid",i),Cv(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0),zl(i);break;case"select":tt("invalid",i);break;case"textarea":tt("invalid",i),Rv(i,d.value,d.defaultValue,d.children),zl(i)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||d.suppressHydrationWarning===!0||bx(i.textContent,l)?(d.popover!=null&&(tt("beforetoggle",i),tt("toggle",i)),d.onScroll!=null&&tt("scroll",i),d.onScrollEnd!=null&&tt("scrollend",i),d.onClick!=null&&(i.onclick=Tc),i=!0):i=!1,i||ni(r)}function dy(r){for(cn=r.return;cn;)switch(cn.tag){case 3:case 27:pr=!0;return;case 5:case 13:pr=!1;return;default:cn=cn.return}}function us(r){if(r!==cn)return!1;if(!ot)return dy(r),ot=!0,!1;var i=!1,l;if((l=r.tag!==3&&r.tag!==27)&&((l=r.tag===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||Sh(r.type,r.memoizedProps)),l=!l),l&&(i=!0),i&&Yt&&ni(r),dy(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));e:{for(r=r.nextSibling,i=0;r;){if(r.nodeType===8)if(l=r.data,l==="/$"){if(i===0){Yt=rr(r.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++;r=r.nextSibling}Yt=null}}else Yt=cn?rr(r.stateNode.nextSibling):null;return!0}function ds(){Yt=cn=null,ot=!1}function fs(r){tr===null?tr=[r]:tr.push(r)}var hs=Error(a(460)),fy=Error(a(474)),rf={then:function(){}};function hy(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Xl(){}function py(r,i,l){switch(l=r[l],l===void 0?r.push(i):l!==i&&(i.then(Xl,Xl),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,r===hs?Error(a(483)):r;default:if(typeof i.status=="string")i.then(Xl,Xl);else{if(r=vt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,r===hs?Error(a(483)):r}throw ps=i,hs}}var ps=null;function my(){if(ps===null)throw Error(a(459));var r=ps;return ps=null,r}var Zi=null,ms=0;function Kl(r){var i=ms;return ms+=1,Zi===null&&(Zi=[]),py(Zi,r,i)}function gs(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Zl(r,i){throw i.$$typeof===s?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function gy(r){var i=r._init;return i(r._payload)}function vy(r){function i(ee,Z){if(r){var ae=ee.deletions;ae===null?(ee.deletions=[Z],ee.flags|=16):ae.push(Z)}}function l(ee,Z){if(!r)return null;for(;Z!==null;)i(ee,Z),Z=Z.sibling;return null}function d(ee){for(var Z=new Map;ee!==null;)ee.key!==null?Z.set(ee.key,ee):Z.set(ee.index,ee),ee=ee.sibling;return Z}function p(ee,Z){return ee=_a(ee,Z),ee.index=0,ee.sibling=null,ee}function v(ee,Z,ae){return ee.index=ae,r?(ae=ee.alternate,ae!==null?(ae=ae.index,ae<Z?(ee.flags|=33554434,Z):ae):(ee.flags|=33554434,Z)):(ee.flags|=1048576,Z)}function T(ee){return r&&ee.alternate===null&&(ee.flags|=33554434),ee}function P(ee,Z,ae,ge){return Z===null||Z.tag!==6?(Z=Qf(ae,ee.mode,ge),Z.return=ee,Z):(Z=p(Z,ae),Z.return=ee,Z)}function V(ee,Z,ae,ge){var Me=ae.type;return Me===f?fe(ee,Z,ae.props.children,ge,ae.key):Z!==null&&(Z.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===C&&gy(Me)===Z.type)?(Z=p(Z,ae.props),gs(Z,ae),Z.return=ee,Z):(Z=mc(ae.type,ae.key,ae.props,null,ee.mode,ge),gs(Z,ae),Z.return=ee,Z)}function Q(ee,Z,ae,ge){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ae.containerInfo||Z.stateNode.implementation!==ae.implementation?(Z=Jf(ae,ee.mode,ge),Z.return=ee,Z):(Z=p(Z,ae.children||[]),Z.return=ee,Z)}function fe(ee,Z,ae,ge,Me){return Z===null||Z.tag!==7?(Z=fi(ae,ee.mode,ge,Me),Z.return=ee,Z):(Z=p(Z,ae),Z.return=ee,Z)}function xe(ee,Z,ae){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Qf(""+Z,ee.mode,ae),Z.return=ee,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case c:return ae=mc(Z.type,Z.key,Z.props,null,ee.mode,ae),gs(ae,Z),ae.return=ee,ae;case u:return Z=Jf(Z,ee.mode,ae),Z.return=ee,Z;case C:var ge=Z._init;return Z=ge(Z._payload),xe(ee,Z,ae)}if($(Z)||M(Z))return Z=fi(Z,ee.mode,ae,null),Z.return=ee,Z;if(typeof Z.then=="function")return xe(ee,Kl(Z),ae);if(Z.$$typeof===b)return xe(ee,fc(ee,Z),ae);Zl(ee,Z)}return null}function se(ee,Z,ae,ge){var Me=Z!==null?Z.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Me!==null?null:P(ee,Z,""+ae,ge);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case c:return ae.key===Me?V(ee,Z,ae,ge):null;case u:return ae.key===Me?Q(ee,Z,ae,ge):null;case C:return Me=ae._init,ae=Me(ae._payload),se(ee,Z,ae,ge)}if($(ae)||M(ae))return Me!==null?null:fe(ee,Z,ae,ge,null);if(typeof ae.then=="function")return se(ee,Z,Kl(ae),ge);if(ae.$$typeof===b)return se(ee,Z,fc(ee,ae),ge);Zl(ee,ae)}return null}function ue(ee,Z,ae,ge,Me){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ee=ee.get(ae)||null,P(Z,ee,""+ge,Me);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case c:return ee=ee.get(ge.key===null?ae:ge.key)||null,V(Z,ee,ge,Me);case u:return ee=ee.get(ge.key===null?ae:ge.key)||null,Q(Z,ee,ge,Me);case C:var Qe=ge._init;return ge=Qe(ge._payload),ue(ee,Z,ae,ge,Me)}if($(ge)||M(ge))return ee=ee.get(ae)||null,fe(Z,ee,ge,Me,null);if(typeof ge.then=="function")return ue(ee,Z,ae,Kl(ge),Me);if(ge.$$typeof===b)return ue(ee,Z,ae,fc(Z,ge),Me);Zl(Z,ge)}return null}function Ge(ee,Z,ae,ge){for(var Me=null,Qe=null,Ue=Z,Ve=Z=0,It=null;Ue!==null&&Ve<ae.length;Ve++){Ue.index>Ve?(It=Ue,Ue=null):It=Ue.sibling;var st=se(ee,Ue,ae[Ve],ge);if(st===null){Ue===null&&(Ue=It);break}r&&Ue&&st.alternate===null&&i(ee,Ue),Z=v(st,Z,Ve),Qe===null?Me=st:Qe.sibling=st,Qe=st,Ue=It}if(Ve===ae.length)return l(ee,Ue),ot&&ti(ee,Ve),Me;if(Ue===null){for(;Ve<ae.length;Ve++)Ue=xe(ee,ae[Ve],ge),Ue!==null&&(Z=v(Ue,Z,Ve),Qe===null?Me=Ue:Qe.sibling=Ue,Qe=Ue);return ot&&ti(ee,Ve),Me}for(Ue=d(Ue);Ve<ae.length;Ve++)It=ue(Ue,ee,Ve,ae[Ve],ge),It!==null&&(r&&It.alternate!==null&&Ue.delete(It.key===null?Ve:It.key),Z=v(It,Z,Ve),Qe===null?Me=It:Qe.sibling=It,Qe=It);return r&&Ue.forEach(function(Na){return i(ee,Na)}),ot&&ti(ee,Ve),Me}function We(ee,Z,ae,ge){if(ae==null)throw Error(a(151));for(var Me=null,Qe=null,Ue=Z,Ve=Z=0,It=null,st=ae.next();Ue!==null&&!st.done;Ve++,st=ae.next()){Ue.index>Ve?(It=Ue,Ue=null):It=Ue.sibling;var Na=se(ee,Ue,st.value,ge);if(Na===null){Ue===null&&(Ue=It);break}r&&Ue&&Na.alternate===null&&i(ee,Ue),Z=v(Na,Z,Ve),Qe===null?Me=Na:Qe.sibling=Na,Qe=Na,Ue=It}if(st.done)return l(ee,Ue),ot&&ti(ee,Ve),Me;if(Ue===null){for(;!st.done;Ve++,st=ae.next())st=xe(ee,st.value,ge),st!==null&&(Z=v(st,Z,Ve),Qe===null?Me=st:Qe.sibling=st,Qe=st);return ot&&ti(ee,Ve),Me}for(Ue=d(Ue);!st.done;Ve++,st=ae.next())st=ue(Ue,ee,Ve,st.value,ge),st!==null&&(r&&st.alternate!==null&&Ue.delete(st.key===null?Ve:st.key),Z=v(st,Z,Ve),Qe===null?Me=st:Qe.sibling=st,Qe=st);return r&&Ue.forEach(function(mD){return i(ee,mD)}),ot&&ti(ee,Ve),Me}function At(ee,Z,ae,ge){if(typeof ae=="object"&&ae!==null&&ae.type===f&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case c:e:{for(var Me=ae.key;Z!==null;){if(Z.key===Me){if(Me=ae.type,Me===f){if(Z.tag===7){l(ee,Z.sibling),ge=p(Z,ae.props.children),ge.return=ee,ee=ge;break e}}else if(Z.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===C&&gy(Me)===Z.type){l(ee,Z.sibling),ge=p(Z,ae.props),gs(ge,ae),ge.return=ee,ee=ge;break e}l(ee,Z);break}else i(ee,Z);Z=Z.sibling}ae.type===f?(ge=fi(ae.props.children,ee.mode,ge,ae.key),ge.return=ee,ee=ge):(ge=mc(ae.type,ae.key,ae.props,null,ee.mode,ge),gs(ge,ae),ge.return=ee,ee=ge)}return T(ee);case u:e:{for(Me=ae.key;Z!==null;){if(Z.key===Me)if(Z.tag===4&&Z.stateNode.containerInfo===ae.containerInfo&&Z.stateNode.implementation===ae.implementation){l(ee,Z.sibling),ge=p(Z,ae.children||[]),ge.return=ee,ee=ge;break e}else{l(ee,Z);break}else i(ee,Z);Z=Z.sibling}ge=Jf(ae,ee.mode,ge),ge.return=ee,ee=ge}return T(ee);case C:return Me=ae._init,ae=Me(ae._payload),At(ee,Z,ae,ge)}if($(ae))return Ge(ee,Z,ae,ge);if(M(ae)){if(Me=M(ae),typeof Me!="function")throw Error(a(150));return ae=Me.call(ae),We(ee,Z,ae,ge)}if(typeof ae.then=="function")return At(ee,Z,Kl(ae),ge);if(ae.$$typeof===b)return At(ee,Z,fc(ee,ae),ge);Zl(ee,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,Z!==null&&Z.tag===6?(l(ee,Z.sibling),ge=p(Z,ae),ge.return=ee,ee=ge):(l(ee,Z),ge=Qf(ae,ee.mode,ge),ge.return=ee,ee=ge),T(ee)):l(ee,Z)}return function(ee,Z,ae,ge){try{ms=0;var Me=At(ee,Z,ae,ge);return Zi=null,Me}catch(Ue){if(Ue===hs)throw Ue;var Qe=Vn(29,Ue,null,ee.mode);return Qe.lanes=ge,Qe.return=ee,Qe}finally{}}}var ri=vy(!0),yy=vy(!1),Qi=oe(null),Ql=oe(0);function by(r,i){r=qr,he(Ql,r),he(Qi,i),qr=r|i.baseLanes}function af(){he(Ql,qr),he(Qi,Qi.current)}function of(){qr=Ql.current,Ce(Qi),Ce(Ql)}var In=oe(null),mr=null;function ha(r){var i=r.alternate;he(zt,zt.current&1),he(In,r),mr===null&&(i===null||Qi.current!==null||i.memoizedState!==null)&&(mr=r)}function xy(r){if(r.tag===22){if(he(zt,zt.current),he(In,r),mr===null){var i=r.alternate;i!==null&&i.memoizedState!==null&&(mr=r)}}else pa()}function pa(){he(zt,zt.current),he(In,In.current)}function Mr(r){Ce(In),mr===r&&(mr=null),Ce(zt)}var zt=oe(0);function Jl(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if(i.flags&128)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var n2=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(l,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(l){return l()})}},r2=e.unstable_scheduleCallback,a2=e.unstable_NormalPriority,Mt={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sf(){return{controller:new n2,data:new Map,refCount:0}}function vs(r){r.refCount--,r.refCount===0&&r2(a2,function(){r.controller.abort()})}var ys=null,lf=0,Ji=0,eo=null;function i2(r,i){if(ys===null){var l=ys=[];lf=0,Ji=ph(),eo={status:"pending",value:void 0,then:function(d){l.push(d)}}}return lf++,i.then(wy,wy),i}function wy(){if(--lf===0&&ys!==null){eo!==null&&(eo.status="fulfilled");var r=ys;ys=null,Ji=0,eo=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function o2(r,i){var l=[],d={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<l.length;p++)(0,l[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),d}var Ey=L.S;L.S=function(r,i){typeof i=="object"&&i!==null&&typeof i.then=="function"&&i2(r,i),Ey!==null&&Ey(r,i)};var ai=oe(null);function cf(){var r=ai.current;return r!==null?r:vt.pooledCache}function ec(r,i){i===null?he(ai,ai.current):he(ai,i.pool)}function Sy(){var r=cf();return r===null?null:{parent:Mt._currentValue,pool:r}}var ma=0,Ze=null,ut=null,Nt=null,tc=!1,to=!1,ii=!1,nc=0,bs=0,no=null,s2=0;function Dt(){throw Error(a(321))}function uf(r,i){if(i===null)return!1;for(var l=0;l<i.length&&l<r.length;l++)if(!Rn(r[l],i[l]))return!1;return!0}function df(r,i,l,d,p,v){return ma=v,Ze=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,L.H=r===null||r.memoizedState===null?oi:ga,ii=!1,v=l(d,p),ii=!1,to&&(v=Cy(i,l,d,p)),_y(r),v}function _y(r){L.H=gr;var i=ut!==null&&ut.next!==null;if(ma=0,Nt=ut=Ze=null,tc=!1,bs=0,no=null,i)throw Error(a(300));r===null||Ut||(r=r.dependencies,r!==null&&dc(r)&&(Ut=!0))}function Cy(r,i,l,d){Ze=r;var p=0;do{if(to&&(no=null),bs=0,to=!1,25<=p)throw Error(a(301));if(p+=1,Nt=ut=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}L.H=si,v=i(l,d)}while(to);return v}function l2(){var r=L.H,i=r.useState()[0];return i=typeof i.then=="function"?xs(i):i,r=r.useState()[0],(ut!==null?ut.memoizedState:null)!==r&&(Ze.flags|=1024),i}function ff(){var r=nc!==0;return nc=0,r}function hf(r,i,l){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~l}function pf(r){if(tc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}tc=!1}ma=0,Nt=ut=Ze=null,to=!1,bs=nc=0,no=null}function yn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?Ze.memoizedState=Nt=r:Nt=Nt.next=r,Nt}function Ot(){if(ut===null){var r=Ze.alternate;r=r!==null?r.memoizedState:null}else r=ut.next;var i=Nt===null?Ze.memoizedState:Nt.next;if(i!==null)Nt=i,ut=r;else{if(r===null)throw Ze.alternate===null?Error(a(467)):Error(a(310));ut=r,r={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},Nt===null?Ze.memoizedState=Nt=r:Nt=Nt.next=r}return Nt}var rc;rc=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function xs(r){var i=bs;return bs+=1,no===null&&(no=[]),r=py(no,r,i),i=Ze,(Nt===null?i.memoizedState:Nt.next)===null&&(i=i.alternate,L.H=i===null||i.memoizedState===null?oi:ga),r}function ac(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return xs(r);if(r.$$typeof===b)return tn(r)}throw Error(a(438,String(r)))}function mf(r){var i=null,l=Ze.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var d=Ze.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=rc(),Ze.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(r),d=0;d<r;d++)l[d]=k;return i.index++,l}function Pr(r,i){return typeof i=="function"?i(r):i}function ic(r){var i=Ot();return gf(i,ut,r)}function gf(r,i,l){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=l;var p=r.baseQueue,v=d.pending;if(v!==null){if(p!==null){var T=p.next;p.next=v.next,v.next=T}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var P=T=null,V=null,Q=i,fe=!1;do{var xe=Q.lane&-536870913;if(xe!==Q.lane?(rt&xe)===xe:(ma&xe)===xe){var se=Q.revertLane;if(se===0)V!==null&&(V=V.next={lane:0,revertLane:0,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),xe===Ji&&(fe=!0);else if((ma&se)===se){Q=Q.next,se===Ji&&(fe=!0);continue}else xe={lane:0,revertLane:Q.revertLane,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},V===null?(P=V=xe,T=v):V=V.next=xe,Ze.lanes|=se,Ca|=se;xe=Q.action,ii&&l(v,xe),v=Q.hasEagerState?Q.eagerState:l(v,xe)}else se={lane:xe,revertLane:Q.revertLane,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},V===null?(P=V=se,T=v):V=V.next=se,Ze.lanes|=xe,Ca|=xe;Q=Q.next}while(Q!==null&&Q!==i);if(V===null?T=v:V.next=P,!Rn(v,r.memoizedState)&&(Ut=!0,fe&&(l=eo,l!==null)))throw l;r.memoizedState=v,r.baseState=T,r.baseQueue=V,d.lastRenderedState=v}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function vf(r){var i=Ot(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=r;var d=l.dispatch,p=l.pending,v=i.memoizedState;if(p!==null){l.pending=null;var T=p=p.next;do v=r(v,T.action),T=T.next;while(T!==p);Rn(v,i.memoizedState)||(Ut=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),l.lastRenderedState=v}return[v,d]}function Ty(r,i,l){var d=Ze,p=Ot(),v=ot;if(v){if(l===void 0)throw Error(a(407));l=l()}else l=i();var T=!Rn((ut||p).memoizedState,l);if(T&&(p.memoizedState=l,Ut=!0),p=p.queue,xf(Dy.bind(null,d,p,r),[r]),p.getSnapshot!==i||T||Nt!==null&&Nt.memoizedState.tag&1){if(d.flags|=2048,ro(9,Ay.bind(null,d,p,l,i),{destroy:void 0},null),vt===null)throw Error(a(349));v||ma&60||Ry(d,i,l)}return l}function Ry(r,i,l){r.flags|=16384,r={getSnapshot:i,value:l},i=Ze.updateQueue,i===null?(i=rc(),Ze.updateQueue=i,i.stores=[r]):(l=i.stores,l===null?i.stores=[r]:l.push(r))}function Ay(r,i,l,d){i.value=l,i.getSnapshot=d,ky(i)&&Ny(r)}function Dy(r,i,l){return l(function(){ky(i)&&Ny(r)})}function ky(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!Rn(r,l)}catch{return!0}}function Ny(r){var i=fa(r,2);i!==null&&un(i,r,2)}function yf(r){var i=yn();if(typeof r=="function"){var l=r;if(r=l(),ii){xt(!0);try{l()}finally{xt(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:r},i}function Oy(r,i,l,d){return r.baseState=l,gf(r,ut,typeof d=="function"?d:Pr)}function c2(r,i,l,d,p){if(lc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){v.listeners.push(T)}};L.T!==null?l(!0):v.isTransition=!1,d(v),l=i.pending,l===null?(v.next=i.pending=v,jy(i,v)):(v.next=l.next,i.pending=l.next=v)}}function jy(r,i){var l=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=L.T,T={};L.T=T;try{var P=l(p,d),V=L.S;V!==null&&V(T,P),Ly(r,i,P)}catch(Q){bf(r,i,Q)}finally{L.T=v}}else try{v=l(p,d),Ly(r,i,v)}catch(Q){bf(r,i,Q)}}function Ly(r,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){zy(r,i,d)},function(d){return bf(r,i,d)}):zy(r,i,l)}function zy(r,i,l){i.status="fulfilled",i.value=l,My(i),r.state=l,i=r.pending,i!==null&&(l=i.next,l===i?r.pending=null:(l=l.next,i.next=l,jy(r,l)))}function bf(r,i,l){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=l,My(i),i=i.next;while(i!==d)}r.action=null}function My(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Py(r,i){return i}function Gy(r,i){if(ot){var l=vt.formState;if(l!==null){e:{var d=Ze;if(ot){if(Yt){t:{for(var p=Yt,v=pr;p.nodeType!==8;){if(!v){p=null;break t}if(p=rr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Yt=rr(p.nextSibling),d=p.data==="F!";break e}}ni(d)}d=!1}d&&(i=l[0])}}return l=yn(),l.memoizedState=l.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Py,lastRenderedState:i},l.queue=d,l=nb.bind(null,Ze,d),d.dispatch=l,d=yf(!1),v=Cf.bind(null,Ze,!1,d.queue),d=yn(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,l=c2.bind(null,Ze,p,v,l),p.dispatch=l,d.memoizedState=r,[i,l,!1]}function Fy(r){var i=Ot();return Uy(i,ut,r)}function Uy(r,i,l){i=gf(r,i,Py)[0],r=ic(Pr)[0],i=typeof i=="object"&&i!==null&&typeof i.then=="function"?xs(i):i;var d=Ot(),p=d.queue,v=p.dispatch;return l!==d.memoizedState&&(Ze.flags|=2048,ro(9,u2.bind(null,p,l),{destroy:void 0},null)),[i,v,r]}function u2(r,i){r.action=i}function By(r){var i=Ot(),l=ut;if(l!==null)return Uy(i,l,r);Ot(),i=i.memoizedState,l=Ot();var d=l.queue.dispatch;return l.memoizedState=r,[i,d,!1]}function ro(r,i,l,d){return r={tag:r,create:i,inst:l,deps:d,next:null},i=Ze.updateQueue,i===null&&(i=rc(),Ze.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=r.next=r:(d=l.next,l.next=r,r.next=d,i.lastEffect=r),r}function Iy(){return Ot().memoizedState}function oc(r,i,l,d){var p=yn();Ze.flags|=r,p.memoizedState=ro(1|i,l,{destroy:void 0},d===void 0?null:d)}function sc(r,i,l,d){var p=Ot();d=d===void 0?null:d;var v=p.memoizedState.inst;ut!==null&&d!==null&&uf(d,ut.memoizedState.deps)?p.memoizedState=ro(i,l,v,d):(Ze.flags|=r,p.memoizedState=ro(1|i,l,v,d))}function Hy(r,i){oc(8390656,8,r,i)}function xf(r,i){sc(2048,8,r,i)}function $y(r,i){return sc(4,2,r,i)}function Vy(r,i){return sc(4,4,r,i)}function qy(r,i){if(typeof i=="function"){r=r();var l=i(r);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Yy(r,i,l){l=l!=null?l.concat([r]):null,sc(4,4,qy.bind(null,i,r),l)}function wf(){}function Wy(r,i){var l=Ot();i=i===void 0?null:i;var d=l.memoizedState;return i!==null&&uf(i,d[1])?d[0]:(l.memoizedState=[r,i],r)}function Xy(r,i){var l=Ot();i=i===void 0?null:i;var d=l.memoizedState;if(i!==null&&uf(i,d[1]))return d[0];if(d=r(),ii){xt(!0);try{r()}finally{xt(!1)}}return l.memoizedState=[d,i],d}function Ef(r,i,l){return l===void 0||ma&1073741824?r.memoizedState=i:(r.memoizedState=l,r=Zb(),Ze.lanes|=r,Ca|=r,l)}function Ky(r,i,l,d){return Rn(l,i)?l:Qi.current!==null?(r=Ef(r,l,d),Rn(r,i)||(Ut=!0),r):ma&42?(r=Zb(),Ze.lanes|=r,Ca|=r,i):(Ut=!0,r.memoizedState=l)}function Zy(r,i,l,d,p){var v=W.p;W.p=v!==0&&8>v?v:8;var T=L.T,P={};L.T=P,Cf(r,!1,i,l);try{var V=p(),Q=L.S;if(Q!==null&&Q(P,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var fe=o2(V,d);ws(r,i,fe,Nn(r))}else ws(r,i,d,Nn(r))}catch(xe){ws(r,i,{then:function(){},status:"rejected",reason:xe},Nn())}finally{W.p=v,L.T=T}}function d2(){}function Sf(r,i,l,d){if(r.tag!==5)throw Error(a(476));var p=Qy(r).queue;Zy(r,p,i,re,l===null?d2:function(){return Jy(r),l(d)})}function Qy(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:re},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:l},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Jy(r){var i=Qy(r).next.queue;ws(r,i,{},Nn())}function _f(){return tn(Bs)}function eb(){return Ot().memoizedState}function tb(){return Ot().memoizedState}function f2(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var l=Nn();r=ba(l);var d=xa(i,r,l);d!==null&&(un(d,i,l),_s(d,i,l)),i={cache:sf()},r.payload=i;return}i=i.return}}function h2(r,i,l){var d=Nn();l={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null},lc(r)?rb(i,l):(l=Jd(r,i,l,d),l!==null&&(un(l,r,d),ab(l,i,d)))}function nb(r,i,l){var d=Nn();ws(r,i,l,d)}function ws(r,i,l,d){var p={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null};if(lc(r))rb(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var T=i.lastRenderedState,P=v(T,l);if(p.hasEagerState=!0,p.eagerState=P,Rn(P,T))return Vl(r,i,p,0),vt===null&&$l(),!1}catch{}finally{}if(l=Jd(r,i,p,d),l!==null)return un(l,r,d),ab(l,i,d),!0}return!1}function Cf(r,i,l,d){if(d={lane:2,revertLane:ph(),action:d,hasEagerState:!1,eagerState:null,next:null},lc(r)){if(i)throw Error(a(479))}else i=Jd(r,l,d,2),i!==null&&un(i,r,2)}function lc(r){var i=r.alternate;return r===Ze||i!==null&&i===Ze}function rb(r,i){to=tc=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function ab(r,i,l){if(l&4194176){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,Jn(r,l)}}var gr={readContext:tn,use:ac,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useLayoutEffect:Dt,useInsertionEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useSyncExternalStore:Dt,useId:Dt};gr.useCacheRefresh=Dt,gr.useMemoCache=Dt,gr.useHostTransitionStatus=Dt,gr.useFormState=Dt,gr.useActionState=Dt,gr.useOptimistic=Dt;var oi={readContext:tn,use:ac,useCallback:function(r,i){return yn().memoizedState=[r,i===void 0?null:i],r},useContext:tn,useEffect:Hy,useImperativeHandle:function(r,i,l){l=l!=null?l.concat([r]):null,oc(4194308,4,qy.bind(null,i,r),l)},useLayoutEffect:function(r,i){return oc(4194308,4,r,i)},useInsertionEffect:function(r,i){oc(4,2,r,i)},useMemo:function(r,i){var l=yn();i=i===void 0?null:i;var d=r();if(ii){xt(!0);try{r()}finally{xt(!1)}}return l.memoizedState=[d,i],d},useReducer:function(r,i,l){var d=yn();if(l!==void 0){var p=l(i);if(ii){xt(!0);try{l(i)}finally{xt(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=h2.bind(null,Ze,r),[d.memoizedState,r]},useRef:function(r){var i=yn();return r={current:r},i.memoizedState=r},useState:function(r){r=yf(r);var i=r.queue,l=nb.bind(null,Ze,i);return i.dispatch=l,[r.memoizedState,l]},useDebugValue:wf,useDeferredValue:function(r,i){var l=yn();return Ef(l,r,i)},useTransition:function(){var r=yf(!1);return r=Zy.bind(null,Ze,r.queue,!0,!1),yn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,l){var d=Ze,p=yn();if(ot){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),vt===null)throw Error(a(349));rt&60||Ry(d,i,l)}p.memoizedState=l;var v={value:l,getSnapshot:i};return p.queue=v,Hy(Dy.bind(null,d,v,r),[r]),d.flags|=2048,ro(9,Ay.bind(null,d,v,l,i),{destroy:void 0},null),l},useId:function(){var r=yn(),i=vt.identifierPrefix;if(ot){var l=zr,d=Lr;l=(d&~(1<<32-Lt(d)-1)).toString(32)+l,i=":"+i+"R"+l,l=nc++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=s2++,i=":"+i+"r"+l.toString(32)+":";return r.memoizedState=i},useCacheRefresh:function(){return yn().memoizedState=f2.bind(null,Ze)}};oi.useMemoCache=mf,oi.useHostTransitionStatus=_f,oi.useFormState=Gy,oi.useActionState=Gy,oi.useOptimistic=function(r){var i=yn();i.memoizedState=i.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Cf.bind(null,Ze,!0,l),l.dispatch=i,[r,i]};var ga={readContext:tn,use:ac,useCallback:Wy,useContext:tn,useEffect:xf,useImperativeHandle:Yy,useInsertionEffect:$y,useLayoutEffect:Vy,useMemo:Xy,useReducer:ic,useRef:Iy,useState:function(){return ic(Pr)},useDebugValue:wf,useDeferredValue:function(r,i){var l=Ot();return Ky(l,ut.memoizedState,r,i)},useTransition:function(){var r=ic(Pr)[0],i=Ot().memoizedState;return[typeof r=="boolean"?r:xs(r),i]},useSyncExternalStore:Ty,useId:eb};ga.useCacheRefresh=tb,ga.useMemoCache=mf,ga.useHostTransitionStatus=_f,ga.useFormState=Fy,ga.useActionState=Fy,ga.useOptimistic=function(r,i){var l=Ot();return Oy(l,ut,r,i)};var si={readContext:tn,use:ac,useCallback:Wy,useContext:tn,useEffect:xf,useImperativeHandle:Yy,useInsertionEffect:$y,useLayoutEffect:Vy,useMemo:Xy,useReducer:vf,useRef:Iy,useState:function(){return vf(Pr)},useDebugValue:wf,useDeferredValue:function(r,i){var l=Ot();return ut===null?Ef(l,r,i):Ky(l,ut.memoizedState,r,i)},useTransition:function(){var r=vf(Pr)[0],i=Ot().memoizedState;return[typeof r=="boolean"?r:xs(r),i]},useSyncExternalStore:Ty,useId:eb};si.useCacheRefresh=tb,si.useMemoCache=mf,si.useHostTransitionStatus=_f,si.useFormState=By,si.useActionState=By,si.useOptimistic=function(r,i){var l=Ot();return ut!==null?Oy(l,ut,r,i):(l.baseState=r,[r,l.queue.dispatch])};function Tf(r,i,l,d){i=r.memoizedState,l=l(d,i),l=l==null?i:I({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var Rf={isMounted:function(r){return(r=r._reactInternals)?j(r)===r:!1},enqueueSetState:function(r,i,l){r=r._reactInternals;var d=Nn(),p=ba(d);p.payload=i,l!=null&&(p.callback=l),i=xa(r,p,d),i!==null&&(un(i,r,d),_s(i,r,d))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var d=Nn(),p=ba(d);p.tag=1,p.payload=i,l!=null&&(p.callback=l),i=xa(r,p,d),i!==null&&(un(i,r,d),_s(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=Nn(),d=ba(l);d.tag=2,i!=null&&(d.callback=i),i=xa(r,d,l),i!==null&&(un(i,r,l),_s(i,r,l))}};function ib(r,i,l,d,p,v,T){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,T):i.prototype&&i.prototype.isPureReactComponent?!ls(l,d)||!ls(p,v):!0}function ob(r,i,l,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==r&&Rf.enqueueReplaceState(i,i.state,null)}function li(r,i){var l=i;if("ref"in i){l={};for(var d in i)d!=="ref"&&(l[d]=i[d])}if(r=r.defaultProps){l===i&&(l=I({},l));for(var p in r)l[p]===void 0&&(l[p]=r[p])}return l}var cc=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)};function sb(r){cc(r)}function lb(r){console.error(r)}function cb(r){cc(r)}function uc(r,i){try{var l=r.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function ub(r,i,l){try{var d=r.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Af(r,i,l){return l=ba(l),l.tag=3,l.payload={element:null},l.callback=function(){uc(r,i)},l}function db(r){return r=ba(r),r.tag=3,r}function fb(r,i,l,d){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var v=d.value;r.payload=function(){return p(v)},r.callback=function(){ub(i,l,d)}}var T=l.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(r.callback=function(){ub(i,l,d),typeof p!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var P=d.stack;this.componentDidCatch(d.value,{componentStack:P!==null?P:""})})}function p2(r,i,l,d,p){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=l.alternate,i!==null&&Ss(i,l,p,!0),l=In.current,l!==null){switch(l.tag){case 13:return mr===null?ch():l.alternate===null&&Rt===0&&(Rt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,d===rf?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([d]):i.add(d),dh(r,d,p)),!1;case 22:return l.flags|=65536,d===rf?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([d]):l.add(d)),dh(r,d,p)),!1}throw Error(a(435,l.tag))}return dh(r,d,p),ch(),!1}if(ot)return i=In.current,i!==null?(!(i.flags&65536)&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==nf&&(r=Error(a(422),{cause:d}),fs(Fn(r,l)))):(d!==nf&&(i=Error(a(423),{cause:d}),fs(Fn(i,l))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=Fn(d,l),p=Af(r.stateNode,d,p),Hf(r,p),Rt!==4&&(Rt=2)),!1;var v=Error(a(520),{cause:d});if(v=Fn(v,l),Os===null?Os=[v]:Os.push(v),Rt!==4&&(Rt=2),i===null)return!0;d=Fn(d,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,r=p&-p,l.lanes|=r,r=Af(l.stateNode,d,r),Hf(l,r),!1;case 1:if(i=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ta===null||!Ta.has(v))))return l.flags|=65536,p&=-p,l.lanes|=p,p=db(p),fb(p,r,l,d),Hf(l,p),!1}l=l.return}while(l!==null);return!1}var hb=Error(a(461)),Ut=!1;function Wt(r,i,l,d){i.child=r===null?yy(i,null,l,d):ri(i,r.child,l,d)}function pb(r,i,l,d,p){l=l.render;var v=i.ref;if("ref"in d){var T={};for(var P in d)P!=="ref"&&(T[P]=d[P])}else T=d;return ui(i),d=df(r,i,l,T,v,p),P=ff(),r!==null&&!Ut?(hf(r,i,p),Gr(r,i,p)):(ot&&P&&ef(i),i.flags|=1,Wt(r,i,d,p),i.child)}function mb(r,i,l,d,p){if(r===null){var v=l.type;return typeof v=="function"&&!Zf(v)&&v.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=v,gb(r,i,v,d,p)):(r=mc(l.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!Pf(r,p)){var T=v.memoizedProps;if(l=l.compare,l=l!==null?l:ls,l(T,d)&&r.ref===i.ref)return Gr(r,i,p)}return i.flags|=1,r=_a(v,d),r.ref=i.ref,r.return=i,i.child=r}function gb(r,i,l,d,p){if(r!==null){var v=r.memoizedProps;if(ls(v,d)&&r.ref===i.ref)if(Ut=!1,i.pendingProps=d=v,Pf(r,p))r.flags&131072&&(Ut=!0);else return i.lanes=r.lanes,Gr(r,i,p)}return Df(r,i,l,d,p)}function vb(r,i,l){var d=i.pendingProps,p=d.children,v=(i.stateNode._pendingVisibility&2)!==0,T=r!==null?r.memoizedState:null;if(Es(r,i),d.mode==="hidden"||v){if(i.flags&128){if(d=T!==null?T.baseLanes|l:l,r!==null){for(p=i.child=r.child,v=0;p!==null;)v=v|p.lanes|p.childLanes,p=p.sibling;i.childLanes=v&~d}else i.childLanes=0,i.child=null;return yb(r,i,d,l)}if(l&536870912)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&ec(i,T!==null?T.cachePool:null),T!==null?by(i,T):af(),xy(i);else return i.lanes=i.childLanes=536870912,yb(r,i,T!==null?T.baseLanes|l:l,l)}else T!==null?(ec(i,T.cachePool),by(i,T),pa(),i.memoizedState=null):(r!==null&&ec(i,null),af(),pa());return Wt(r,i,p,l),i.child}function yb(r,i,l,d){var p=cf();return p=p===null?null:{parent:Mt._currentValue,pool:p},i.memoizedState={baseLanes:l,cachePool:p},r!==null&&ec(i,null),af(),xy(i),r!==null&&Ss(r,i,d,!0),null}function Es(r,i){var l=i.ref;if(l===null)r!==null&&r.ref!==null&&(i.flags|=2097664);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(r===null||r.ref!==l)&&(i.flags|=2097664)}}function Df(r,i,l,d,p){return ui(i),l=df(r,i,l,d,void 0,p),d=ff(),r!==null&&!Ut?(hf(r,i,p),Gr(r,i,p)):(ot&&d&&ef(i),i.flags|=1,Wt(r,i,l,p),i.child)}function bb(r,i,l,d,p,v){return ui(i),i.updateQueue=null,l=Cy(i,d,l,p),_y(r),d=ff(),r!==null&&!Ut?(hf(r,i,v),Gr(r,i,v)):(ot&&d&&ef(i),i.flags|=1,Wt(r,i,l,v),i.child)}function xb(r,i,l,d,p){if(ui(i),i.stateNode===null){var v=Wi,T=l.contextType;typeof T=="object"&&T!==null&&(v=tn(T)),v=new l(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Rf,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},Bf(i),T=l.contextType,v.context=typeof T=="object"&&T!==null?tn(T):Wi,v.state=i.memoizedState,T=l.getDerivedStateFromProps,typeof T=="function"&&(Tf(i,l,T,d),v.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(T=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),T!==v.state&&Rf.enqueueReplaceState(v,v.state,null),Ts(i,d,v,p),Cs(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var P=i.memoizedProps,V=li(l,P);v.props=V;var Q=v.context,fe=l.contextType;T=Wi,typeof fe=="object"&&fe!==null&&(T=tn(fe));var xe=l.getDerivedStateFromProps;fe=typeof xe=="function"||typeof v.getSnapshotBeforeUpdate=="function",P=i.pendingProps!==P,fe||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(P||Q!==T)&&ob(i,v,d,T),ya=!1;var se=i.memoizedState;v.state=se,Ts(i,d,v,p),Cs(),Q=i.memoizedState,P||se!==Q||ya?(typeof xe=="function"&&(Tf(i,l,xe,d),Q=i.memoizedState),(V=ya||ib(i,l,V,d,se,Q,T))?(fe||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=Q),v.props=d,v.state=Q,v.context=T,d=V):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,If(r,i),T=i.memoizedProps,fe=li(l,T),v.props=fe,xe=i.pendingProps,se=v.context,Q=l.contextType,V=Wi,typeof Q=="object"&&Q!==null&&(V=tn(Q)),P=l.getDerivedStateFromProps,(Q=typeof P=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T!==xe||se!==V)&&ob(i,v,d,V),ya=!1,se=i.memoizedState,v.state=se,Ts(i,d,v,p),Cs();var ue=i.memoizedState;T!==xe||se!==ue||ya||r!==null&&r.dependencies!==null&&dc(r.dependencies)?(typeof P=="function"&&(Tf(i,l,P,d),ue=i.memoizedState),(fe=ya||ib(i,l,fe,d,se,ue,V)||r!==null&&r.dependencies!==null&&dc(r.dependencies))?(Q||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,ue,V),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,ue,V)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||T===r.memoizedProps&&se===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&se===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=ue),v.props=d,v.state=ue,v.context=V,d=fe):(typeof v.componentDidUpdate!="function"||T===r.memoizedProps&&se===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&se===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,Es(r,i),d=(i.flags&128)!==0,v||d?(v=i.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&d?(i.child=ri(i,r.child,null,p),i.child=ri(i,null,l,p)):Wt(r,i,l,p),i.memoizedState=v.state,r=i.child):r=Gr(r,i,p),r}function wb(r,i,l,d){return ds(),i.flags|=256,Wt(r,i,l,d),i.child}var kf={dehydrated:null,treeContext:null,retryLane:0};function Nf(r){return{baseLanes:r,cachePool:Sy()}}function Of(r,i,l){return r=r!==null?r.childLanes&~l:0,i&&(r|=qn),r}function Eb(r,i,l){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,T;if((T=v)||(T=r!==null&&r.memoizedState===null?!1:(zt.current&2)!==0),T&&(p=!0,i.flags&=-129),T=(i.flags&32)!==0,i.flags&=-33,r===null){if(ot){if(p?ha(i):pa(),ot){var P=Yt,V;if(V=P){e:{for(V=P,P=pr;V.nodeType!==8;){if(!P){P=null;break e}if(V=rr(V.nextSibling),V===null){P=null;break e}}P=V}P!==null?(i.memoizedState={dehydrated:P,treeContext:ei!==null?{id:Lr,overflow:zr}:null,retryLane:536870912},V=Vn(18,null,null,0),V.stateNode=P,V.return=i,i.child=V,cn=i,Yt=null,V=!0):V=!1}V||ni(i)}if(P=i.memoizedState,P!==null&&(P=P.dehydrated,P!==null))return P.data==="$!"?i.lanes=16:i.lanes=536870912,null;Mr(i)}return P=d.children,d=d.fallback,p?(pa(),p=i.mode,P=Lf({mode:"hidden",children:P},p),d=fi(d,p,l,null),P.return=i,d.return=i,P.sibling=d,i.child=P,p=i.child,p.memoizedState=Nf(l),p.childLanes=Of(r,T,l),i.memoizedState=kf,d):(ha(i),jf(i,P))}if(V=r.memoizedState,V!==null&&(P=V.dehydrated,P!==null)){if(v)i.flags&256?(ha(i),i.flags&=-257,i=zf(r,i,l)):i.memoizedState!==null?(pa(),i.child=r.child,i.flags|=128,i=null):(pa(),p=d.fallback,P=i.mode,d=Lf({mode:"visible",children:d.children},P),p=fi(p,P,l,null),p.flags|=2,d.return=i,p.return=i,d.sibling=p,i.child=d,ri(i,r.child,null,l),d=i.child,d.memoizedState=Nf(l),d.childLanes=Of(r,T,l),i.memoizedState=kf,i=p);else if(ha(i),P.data==="$!"){if(T=P.nextSibling&&P.nextSibling.dataset,T)var Q=T.dgst;T=Q,d=Error(a(419)),d.stack="",d.digest=T,fs({value:d,source:null,stack:null}),i=zf(r,i,l)}else if(Ut||Ss(r,i,l,!1),T=(l&r.childLanes)!==0,Ut||T){if(T=vt,T!==null){if(d=l&-l,d&42)d=1;else switch(d){case 2:d=1;break;case 8:d=4;break;case 32:d=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:d=64;break;case 268435456:d=134217728;break;default:d=0}if(d=d&(T.suspendedLanes|l)?0:d,d!==0&&d!==V.retryLane)throw V.retryLane=d,fa(r,d),un(T,r,d),hb}P.data==="$?"||ch(),i=zf(r,i,l)}else P.data==="$?"?(i.flags|=128,i.child=r.child,i=D2.bind(null,r),P._reactRetry=i,i=null):(r=V.treeContext,Yt=rr(P.nextSibling),cn=i,ot=!0,tr=null,pr=!1,r!==null&&(Un[Bn++]=Lr,Un[Bn++]=zr,Un[Bn++]=ei,Lr=r.id,zr=r.overflow,ei=i),i=jf(i,d.children),i.flags|=4096);return i}return p?(pa(),p=d.fallback,P=i.mode,V=r.child,Q=V.sibling,d=_a(V,{mode:"hidden",children:d.children}),d.subtreeFlags=V.subtreeFlags&31457280,Q!==null?p=_a(Q,p):(p=fi(p,P,l,null),p.flags|=2),p.return=i,d.return=i,d.sibling=p,i.child=d,d=p,p=i.child,P=r.child.memoizedState,P===null?P=Nf(l):(V=P.cachePool,V!==null?(Q=Mt._currentValue,V=V.parent!==Q?{parent:Q,pool:Q}:V):V=Sy(),P={baseLanes:P.baseLanes|l,cachePool:V}),p.memoizedState=P,p.childLanes=Of(r,T,l),i.memoizedState=kf,d):(ha(i),l=r.child,r=l.sibling,l=_a(l,{mode:"visible",children:d.children}),l.return=i,l.sibling=null,r!==null&&(T=i.deletions,T===null?(i.deletions=[r],i.flags|=16):T.push(r)),i.child=l,i.memoizedState=null,l)}function jf(r,i){return i=Lf({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Lf(r,i){return Wb(r,i,0,null)}function zf(r,i,l){return ri(i,r.child,null,l),r=jf(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Sb(r,i,l){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),Ff(r.return,i,l)}function Mf(r,i,l,d,p){var v=r.memoizedState;v===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:p}:(v.isBackwards=i,v.rendering=null,v.renderingStartTime=0,v.last=d,v.tail=l,v.tailMode=p)}function _b(r,i,l){var d=i.pendingProps,p=d.revealOrder,v=d.tail;if(Wt(r,i,d.children,l),d=zt.current,d&2)d=d&1|2,i.flags|=128;else{if(r!==null&&r.flags&128)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Sb(r,l,i);else if(r.tag===19)Sb(r,l,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}d&=1}switch(he(zt,d),p){case"forwards":for(l=i.child,p=null;l!==null;)r=l.alternate,r!==null&&Jl(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=i.child,i.child=null):(p=l.sibling,l.sibling=null),Mf(i,!1,p,l,v);break;case"backwards":for(l=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&Jl(r)===null){i.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}Mf(i,!0,l,null,v);break;case"together":Mf(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Gr(r,i,l){if(r!==null&&(i.dependencies=r.dependencies),Ca|=i.lanes,!(l&i.childLanes))if(r!==null){if(Ss(r,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,l=_a(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=_a(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function Pf(r,i){return r.lanes&i?!0:(r=r.dependencies,!!(r!==null&&dc(r)))}function m2(r,i,l){switch(i.tag){case 3:ye(i,i.stateNode.containerInfo),va(i,Mt,r.memoizedState.cache),ds();break;case 27:case 5:le(i);break;case 4:ye(i,i.stateNode.containerInfo);break;case 10:va(i,i.type,i.memoizedProps.value);break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(ha(i),i.flags|=128,null):l&i.child.childLanes?Eb(r,i,l):(ha(i),r=Gr(r,i,l),r!==null?r.sibling:null);ha(i);break;case 19:var p=(r.flags&128)!==0;if(d=(l&i.childLanes)!==0,d||(Ss(r,i,l,!1),d=(l&i.childLanes)!==0),p){if(d)return _b(r,i,l);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),he(zt,zt.current),d)break;return null;case 22:case 23:return i.lanes=0,vb(r,i,l);case 24:va(i,Mt,r.memoizedState.cache)}return Gr(r,i,l)}function Cb(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps)Ut=!0;else{if(!Pf(r,l)&&!(i.flags&128))return Ut=!1,m2(r,i,l);Ut=!!(r.flags&131072)}else Ut=!1,ot&&i.flags&1048576&&cy(i,Wl,i.index);switch(i.lanes=0,i.tag){case 16:e:{r=i.pendingProps;var d=i.elementType,p=d._init;if(d=p(d._payload),i.type=d,typeof d=="function")Zf(d)?(r=li(d,r),i.tag=1,i=xb(null,i,d,r,l)):(i.tag=0,i=Df(null,i,d,r,l));else{if(d!=null){if(p=d.$$typeof,p===S){i.tag=11,i=pb(null,i,d,r,l);break e}else if(p===N){i.tag=14,i=mb(null,i,d,r,l);break e}}throw i=U(d)||d,Error(a(306,i,""))}}return i;case 0:return Df(r,i,i.type,i.pendingProps,l);case 1:return d=i.type,p=li(d,i.pendingProps),xb(r,i,d,p,l);case 3:e:{if(ye(i,i.stateNode.containerInfo),r===null)throw Error(a(387));var v=i.pendingProps;p=i.memoizedState,d=p.element,If(r,i),Ts(i,v,null,l);var T=i.memoizedState;if(v=T.cache,va(i,Mt,v),v!==p.cache&&Uf(i,[Mt],l,!0),Cs(),v=T.element,p.isDehydrated)if(p={element:v,isDehydrated:!1,cache:T.cache},i.updateQueue.baseState=p,i.memoizedState=p,i.flags&256){i=wb(r,i,v,l);break e}else if(v!==d){d=Fn(Error(a(424)),i),fs(d),i=wb(r,i,v,l);break e}else for(Yt=rr(i.stateNode.containerInfo.firstChild),cn=i,ot=!0,tr=null,pr=!0,l=yy(i,null,v,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(ds(),v===d){i=Gr(r,i,l);break e}Wt(r,i,v,l)}i=i.child}return i;case 26:return Es(r,i),r===null?(l=Ax(i.type,null,i.pendingProps,null))?i.memoizedState=l:ot||(l=i.type,r=i.pendingProps,d=Rc(Le.current).createElement(l),d[en]=i,d[gn]=r,Xt(d,l,r),Ft(d),i.stateNode=d):i.memoizedState=Ax(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return le(i),r===null&&ot&&(d=i.stateNode=Cx(i.type,i.pendingProps,Le.current),cn=i,pr=!0,Yt=rr(d.firstChild)),d=i.pendingProps.children,r!==null||ot?Wt(r,i,d,l):i.child=ri(i,null,d,l),Es(r,i),i.child;case 5:return r===null&&ot&&((p=d=Yt)&&(d=V2(d,i.type,i.pendingProps,pr),d!==null?(i.stateNode=d,cn=i,Yt=rr(d.firstChild),pr=!1,p=!0):p=!1),p||ni(i)),le(i),p=i.type,v=i.pendingProps,T=r!==null?r.memoizedProps:null,d=v.children,Sh(p,v)?d=null:T!==null&&Sh(p,T)&&(i.flags|=32),i.memoizedState!==null&&(p=df(r,i,l2,null,null,l),Bs._currentValue=p),Es(r,i),Wt(r,i,d,l),i.child;case 6:return r===null&&ot&&((r=l=Yt)&&(l=q2(l,i.pendingProps,pr),l!==null?(i.stateNode=l,cn=i,Yt=null,r=!0):r=!1),r||ni(i)),null;case 13:return Eb(r,i,l);case 4:return ye(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=ri(i,null,d,l):Wt(r,i,d,l),i.child;case 11:return pb(r,i,i.type,i.pendingProps,l);case 7:return Wt(r,i,i.pendingProps,l),i.child;case 8:return Wt(r,i,i.pendingProps.children,l),i.child;case 12:return Wt(r,i,i.pendingProps.children,l),i.child;case 10:return d=i.pendingProps,va(i,i.type,d.value),Wt(r,i,d.children,l),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,ui(i),p=tn(p),d=d(p),i.flags|=1,Wt(r,i,d,l),i.child;case 14:return mb(r,i,i.type,i.pendingProps,l);case 15:return gb(r,i,i.type,i.pendingProps,l);case 19:return _b(r,i,l);case 22:return vb(r,i,l);case 24:return ui(i),d=tn(Mt),r===null?(p=cf(),p===null&&(p=vt,v=sf(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=l),p=v),i.memoizedState={parent:d,cache:p},Bf(i),va(i,Mt,p)):(r.lanes&l&&(If(r,i),Ts(i,null,null,l),Cs()),p=r.memoizedState,v=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),va(i,Mt,d)):(d=v.cache,va(i,Mt,d),d!==p.cache&&Uf(i,[Mt],l,!0))),Wt(r,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}var Gf=oe(null),ci=null,Fr=null;function va(r,i,l){he(Gf,i._currentValue),i._currentValue=l}function Ur(r){r._currentValue=Gf.current,Ce(Gf)}function Ff(r,i,l){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===l)break;r=r.return}}function Uf(r,i,l,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var T=p.child;v=v.firstContext;e:for(;v!==null;){var P=v;v=p;for(var V=0;V<i.length;V++)if(P.context===i[V]){v.lanes|=l,P=v.alternate,P!==null&&(P.lanes|=l),Ff(v.return,l,r),d||(T=null);break e}v=P.next}}else if(p.tag===18){if(T=p.return,T===null)throw Error(a(341));T.lanes|=l,v=T.alternate,v!==null&&(v.lanes|=l),Ff(T,l,r),T=null}else T=p.child;if(T!==null)T.return=p;else for(T=p;T!==null;){if(T===r){T=null;break}if(p=T.sibling,p!==null){p.return=T.return,T=p;break}T=T.return}p=T}}function Ss(r,i,l,d){r=null;for(var p=i,v=!1;p!==null;){if(!v){if(p.flags&524288)v=!0;else if(p.flags&262144)break}if(p.tag===10){var T=p.alternate;if(T===null)throw Error(a(387));if(T=T.memoizedProps,T!==null){var P=p.type;Rn(p.pendingProps.value,T.value)||(r!==null?r.push(P):r=[P])}}else if(p===Te.current){if(T=p.alternate,T===null)throw Error(a(387));T.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Bs):r=[Bs])}p=p.return}r!==null&&Uf(i,r,l,d),i.flags|=262144}function dc(r){for(r=r.firstContext;r!==null;){if(!Rn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function ui(r){ci=r,Fr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function tn(r){return Tb(ci,r)}function fc(r,i){return ci===null&&ui(r),Tb(r,i)}function Tb(r,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Fr===null){if(r===null)throw Error(a(308));Fr=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Fr=Fr.next=i;return l}var ya=!1;function Bf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function If(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function ba(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function xa(r,i,l){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,St&2){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=ql(r),sy(r,null,l),i}return Vl(r,d,i,l),ql(r)}function _s(r,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194176)!==0)){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,Jn(r,l)}}function Hf(r,i){var l=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var p=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var T={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?p=v=T:v=v.next=T,l=l.next}while(l!==null);v===null?p=v=i:v=v.next=i}else p=v=i;l={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=i:r.next=i,l.lastBaseUpdate=i}var $f=!1;function Cs(){if($f){var r=eo;if(r!==null)throw r}}function Ts(r,i,l,d){$f=!1;var p=r.updateQueue;ya=!1;var v=p.firstBaseUpdate,T=p.lastBaseUpdate,P=p.shared.pending;if(P!==null){p.shared.pending=null;var V=P,Q=V.next;V.next=null,T===null?v=Q:T.next=Q,T=V;var fe=r.alternate;fe!==null&&(fe=fe.updateQueue,P=fe.lastBaseUpdate,P!==T&&(P===null?fe.firstBaseUpdate=Q:P.next=Q,fe.lastBaseUpdate=V))}if(v!==null){var xe=p.baseState;T=0,fe=Q=V=null,P=v;do{var se=P.lane&-536870913,ue=se!==P.lane;if(ue?(rt&se)===se:(d&se)===se){se!==0&&se===Ji&&($f=!0),fe!==null&&(fe=fe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ge=r,We=P;se=i;var At=l;switch(We.tag){case 1:if(Ge=We.payload,typeof Ge=="function"){xe=Ge.call(At,xe,se);break e}xe=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=We.payload,se=typeof Ge=="function"?Ge.call(At,xe,se):Ge,se==null)break e;xe=I({},xe,se);break e;case 2:ya=!0}}se=P.callback,se!==null&&(r.flags|=64,ue&&(r.flags|=8192),ue=p.callbacks,ue===null?p.callbacks=[se]:ue.push(se))}else ue={lane:se,tag:P.tag,payload:P.payload,callback:P.callback,next:null},fe===null?(Q=fe=ue,V=xe):fe=fe.next=ue,T|=se;if(P=P.next,P===null){if(P=p.shared.pending,P===null)break;ue=P,P=ue.next,ue.next=null,p.lastBaseUpdate=ue,p.shared.pending=null}}while(!0);fe===null&&(V=xe),p.baseState=V,p.firstBaseUpdate=Q,p.lastBaseUpdate=fe,v===null&&(p.shared.lanes=0),Ca|=T,r.lanes=T,r.memoizedState=xe}}function Rb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Ab(r,i){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)Rb(l[r],i)}function Rs(r,i){try{var l=i.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var p=d.next;l=p;do{if((l.tag&r)===r){d=void 0;var v=l.create,T=l.inst;d=v(),T.destroy=d}l=l.next}while(l!==p)}}catch(P){mt(i,i.return,P)}}function wa(r,i,l){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var v=p.next;d=v;do{if((d.tag&r)===r){var T=d.inst,P=T.destroy;if(P!==void 0){T.destroy=void 0,p=i;var V=l;try{P()}catch(Q){mt(p,V,Q)}}}d=d.next}while(d!==v)}}catch(Q){mt(i,i.return,Q)}}function Db(r){var i=r.updateQueue;if(i!==null){var l=r.stateNode;try{Ab(i,l)}catch(d){mt(r,r.return,d)}}}function kb(r,i,l){l.props=li(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(d){mt(r,i,d)}}function di(r,i){try{var l=r.ref;if(l!==null){var d=r.stateNode;switch(r.tag){case 26:case 27:case 5:var p=d;break;default:p=d}typeof l=="function"?r.refCleanup=l(p):l.current=p}}catch(v){mt(r,i,v)}}function An(r,i){var l=r.ref,d=r.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(p){mt(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){mt(r,i,p)}else l.current=null}function Nb(r){var i=r.type,l=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(p){mt(r,r.return,p)}}function Ob(r,i,l){try{var d=r.stateNode;U2(d,r.type,l,i),d[gn]=i}catch(p){mt(r,r.return,p)}}function jb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27||r.tag===4}function Vf(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||jb(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==27&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function qf(r,i,l){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(r,i):l.insertBefore(r,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(r,l)):(i=l,i.appendChild(r)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=Tc));else if(d!==4&&d!==27&&(r=r.child,r!==null))for(qf(r,i,l),r=r.sibling;r!==null;)qf(r,i,l),r=r.sibling}function hc(r,i,l){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?l.insertBefore(r,i):l.appendChild(r);else if(d!==4&&d!==27&&(r=r.child,r!==null))for(hc(r,i,l),r=r.sibling;r!==null;)hc(r,i,l),r=r.sibling}var Br=!1,Tt=!1,Yf=!1,Lb=typeof WeakSet=="function"?WeakSet:Set,Bt=null,zb=!1;function g2(r,i){if(r=r.containerInfo,wh=jc,r=Qv(r),Wd(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var p=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var T=0,P=-1,V=-1,Q=0,fe=0,xe=r,se=null;t:for(;;){for(var ue;xe!==l||p!==0&&xe.nodeType!==3||(P=T+p),xe!==v||d!==0&&xe.nodeType!==3||(V=T+d),xe.nodeType===3&&(T+=xe.nodeValue.length),(ue=xe.firstChild)!==null;)se=xe,xe=ue;for(;;){if(xe===r)break t;if(se===l&&++Q===p&&(P=T),se===v&&++fe===d&&(V=T),(ue=xe.nextSibling)!==null)break;xe=se,se=xe.parentNode}xe=ue}l=P===-1||V===-1?null:{start:P,end:V}}else l=null}l=l||{start:0,end:0}}else l=null;for(Eh={focusedElem:r,selectionRange:l},jc=!1,Bt=i;Bt!==null;)if(i=Bt,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Bt=r;else for(;Bt!==null;){switch(i=Bt,v=i.alternate,r=i.flags,i.tag){case 0:break;case 11:case 15:break;case 1:if(r&1024&&v!==null){r=void 0,l=i,p=v.memoizedProps,v=v.memoizedState,d=l.stateNode;try{var Ge=li(l.type,p,l.elementType===l.type);r=d.getSnapshotBeforeUpdate(Ge,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(We){mt(l,l.return,We)}}break;case 3:if(r&1024){if(r=i.stateNode.containerInfo,l=r.nodeType,l===9)Th(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Th(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(r&1024)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,Bt=r;break}Bt=i.return}return Ge=zb,zb=!1,Ge}function Mb(r,i,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:Hr(r,l),d&4&&Rs(5,l);break;case 1:if(Hr(r,l),d&4)if(r=l.stateNode,i===null)try{r.componentDidMount()}catch(P){mt(l,l.return,P)}else{var p=li(l.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(P){mt(l,l.return,P)}}d&64&&Db(l),d&512&&di(l,l.return);break;case 3:if(Hr(r,l),d&64&&(d=l.updateQueue,d!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{Ab(d,r)}catch(P){mt(l,l.return,P)}}break;case 26:Hr(r,l),d&512&&di(l,l.return);break;case 27:case 5:Hr(r,l),i===null&&d&4&&Nb(l),d&512&&di(l,l.return);break;case 12:Hr(r,l);break;case 13:Hr(r,l),d&4&&Fb(r,l);break;case 22:if(p=l.memoizedState!==null||Br,!p){i=i!==null&&i.memoizedState!==null||Tt;var v=Br,T=Tt;Br=p,(Tt=i)&&!T?Ea(r,l,(l.subtreeFlags&8772)!==0):Hr(r,l),Br=v,Tt=T}d&512&&(l.memoizedProps.mode==="manual"?di(l,l.return):An(l,l.return));break;default:Hr(r,l)}}function Pb(r){var i=r.alternate;i!==null&&(r.alternate=null,Pb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Od(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var jt=null,Dn=!1;function Ir(r,i,l){for(l=l.child;l!==null;)Gb(r,i,l),l=l.sibling}function Gb(r,i,l){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Gt,l)}catch{}switch(l.tag){case 26:Tt||An(l,i),Ir(r,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Tt||An(l,i);var d=jt,p=Dn;for(jt=l.stateNode,Ir(r,i,l),l=l.stateNode,i=l.attributes;i.length;)l.removeAttributeNode(i[0]);Od(l),jt=d,Dn=p;break;case 5:Tt||An(l,i);case 6:p=jt;var v=Dn;if(jt=null,Ir(r,i,l),jt=p,Dn=v,jt!==null)if(Dn)try{r=jt,d=l.stateNode,r.nodeType===8?r.parentNode.removeChild(d):r.removeChild(d)}catch(T){mt(l,i,T)}else try{jt.removeChild(l.stateNode)}catch(T){mt(l,i,T)}break;case 18:jt!==null&&(Dn?(i=jt,l=l.stateNode,i.nodeType===8?Ch(i.parentNode,l):i.nodeType===1&&Ch(i,l),Vs(i)):Ch(jt,l.stateNode));break;case 4:d=jt,p=Dn,jt=l.stateNode.containerInfo,Dn=!0,Ir(r,i,l),jt=d,Dn=p;break;case 0:case 11:case 14:case 15:Tt||wa(2,l,i),Tt||wa(4,l,i),Ir(r,i,l);break;case 1:Tt||(An(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"&&kb(l,i,d)),Ir(r,i,l);break;case 21:Ir(r,i,l);break;case 22:Tt||An(l,i),Tt=(d=Tt)||l.memoizedState!==null,Ir(r,i,l),Tt=d;break;default:Ir(r,i,l)}}function Fb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Vs(r)}catch(l){mt(i,i.return,l)}}function v2(r){switch(r.tag){case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Lb),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Lb),i;default:throw Error(a(435,r.tag))}}function Wf(r,i){var l=v2(r);i.forEach(function(d){var p=k2.bind(null,r,d);l.has(d)||(l.add(d),d.then(p,p))})}function Hn(r,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var p=l[d],v=r,T=i,P=T;e:for(;P!==null;){switch(P.tag){case 27:case 5:jt=P.stateNode,Dn=!1;break e;case 3:jt=P.stateNode.containerInfo,Dn=!0;break e;case 4:jt=P.stateNode.containerInfo,Dn=!0;break e}P=P.return}if(jt===null)throw Error(a(160));Gb(v,T,p),jt=null,Dn=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13878)for(i=i.child;i!==null;)Ub(i,r),i=i.sibling}var nr=null;function Ub(r,i){var l=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Hn(i,r),$n(r),d&4&&(wa(3,r,r.return),Rs(3,r),wa(5,r,r.return));break;case 1:Hn(i,r),$n(r),d&512&&(Tt||l===null||An(l,l.return)),d&64&&Br&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var p=nr;if(Hn(i,r),$n(r),d&512&&(Tt||l===null||An(l,l.return)),d&4){var v=l!==null?l.memoizedState:null;if(d=r.memoizedState,l===null)if(d===null)if(r.stateNode===null){e:{d=r.type,l=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Jo]||v[en]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),Xt(v,d,l),v[en]=r,Ft(v),d=v;break e;case"link":var T=Nx("link","href",p).get(d+(l.href||""));if(T){for(var P=0;P<T.length;P++)if(v=T[P],v.getAttribute("href")===(l.href==null?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){T.splice(P,1);break t}}v=p.createElement(d),Xt(v,d,l),p.head.appendChild(v);break;case"meta":if(T=Nx("meta","content",p).get(d+(l.content||""))){for(P=0;P<T.length;P++)if(v=T[P],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){T.splice(P,1);break t}}v=p.createElement(d),Xt(v,d,l),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[en]=r,Ft(v),d=v}r.stateNode=d}else Ox(p,r.type,r.stateNode);else r.stateNode=kx(p,d,r.memoizedProps);else v!==d?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,d===null?Ox(p,r.type,r.stateNode):kx(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&Ob(r,r.memoizedProps,l.memoizedProps)}break;case 27:if(d&4&&r.alternate===null){p=r.stateNode,v=r.memoizedProps;try{for(var V=p.firstChild;V;){var Q=V.nextSibling,fe=V.nodeName;V[Jo]||fe==="HEAD"||fe==="BODY"||fe==="SCRIPT"||fe==="STYLE"||fe==="LINK"&&V.rel.toLowerCase()==="stylesheet"||p.removeChild(V),V=Q}for(var xe=r.type,se=p.attributes;se.length;)p.removeAttributeNode(se[0]);Xt(p,xe,v),p[en]=r,p[gn]=v}catch(Ge){mt(r,r.return,Ge)}}case 5:if(Hn(i,r),$n(r),d&512&&(Tt||l===null||An(l,l.return)),r.flags&32){p=r.stateNode;try{Bi(p,"")}catch(Ge){mt(r,r.return,Ge)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,Ob(r,p,l!==null?l.memoizedProps:p)),d&1024&&(Yf=!0);break;case 6:if(Hn(i,r),$n(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,l=r.stateNode;try{l.nodeValue=d}catch(Ge){mt(r,r.return,Ge)}}break;case 3:if(kc=null,p=nr,nr=Ac(i.containerInfo),Hn(i,r),nr=p,$n(r),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Vs(i.containerInfo)}catch(Ge){mt(r,r.return,Ge)}Yf&&(Yf=!1,Bb(r));break;case 4:d=nr,nr=Ac(r.stateNode.containerInfo),Hn(i,r),$n(r),nr=d;break;case 12:Hn(i,r),$n(r);break;case 13:Hn(i,r),$n(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(rh=me()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Wf(r,d)));break;case 22:if(d&512&&(Tt||l===null||An(l,l.return)),V=r.memoizedState!==null,Q=l!==null&&l.memoizedState!==null,fe=Br,xe=Tt,Br=fe||V,Tt=xe||Q,Hn(i,r),Tt=xe,Br=fe,$n(r),i=r.stateNode,i._current=r,i._visibility&=-3,i._visibility|=i._pendingVisibility&2,d&8192&&(i._visibility=V?i._visibility&-2:i._visibility|1,V&&(i=Br||Tt,l===null||Q||i||ao(r)),r.memoizedProps===null||r.memoizedProps.mode!=="manual"))e:for(l=null,i=r;;){if(i.tag===5||i.tag===26||i.tag===27){if(l===null){Q=l=i;try{if(p=Q.stateNode,V)v=p.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{T=Q.stateNode,P=Q.memoizedProps.style;var ue=P!=null&&P.hasOwnProperty("display")?P.display:null;T.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Ge){mt(Q,Q.return,Ge)}}}else if(i.tag===6){if(l===null){Q=i;try{Q.stateNode.nodeValue=V?"":Q.memoizedProps}catch(Ge){mt(Q,Q.return,Ge)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,Wf(r,l))));break;case 19:Hn(i,r),$n(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Wf(r,d)));break;case 21:break;default:Hn(i,r),$n(r)}}function $n(r){var i=r.flags;if(i&2){try{if(r.tag!==27){e:{for(var l=r.return;l!==null;){if(jb(l)){var d=l;break e}l=l.return}throw Error(a(160))}switch(d.tag){case 27:var p=d.stateNode,v=Vf(r);hc(r,v,p);break;case 5:var T=d.stateNode;d.flags&32&&(Bi(T,""),d.flags&=-33);var P=Vf(r);hc(r,P,T);break;case 3:case 4:var V=d.stateNode.containerInfo,Q=Vf(r);qf(r,Q,V);break;default:throw Error(a(161))}}}catch(fe){mt(r,r.return,fe)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Bb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Bb(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Hr(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Mb(r,i.alternate,i),i=i.sibling}function ao(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:wa(4,i,i.return),ao(i);break;case 1:An(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&kb(i,i.return,l),ao(i);break;case 26:case 27:case 5:An(i,i.return),ao(i);break;case 22:An(i,i.return),i.memoizedState===null&&ao(i);break;default:ao(i)}r=r.sibling}}function Ea(r,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,v=i,T=v.flags;switch(v.tag){case 0:case 11:case 15:Ea(p,v,l),Rs(4,v);break;case 1:if(Ea(p,v,l),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(Q){mt(d,d.return,Q)}if(d=v,p=d.updateQueue,p!==null){var P=d.stateNode;try{var V=p.shared.hiddenCallbacks;if(V!==null)for(p.shared.hiddenCallbacks=null,p=0;p<V.length;p++)Rb(V[p],P)}catch(Q){mt(d,d.return,Q)}}l&&T&64&&Db(v),di(v,v.return);break;case 26:case 27:case 5:Ea(p,v,l),l&&d===null&&T&4&&Nb(v),di(v,v.return);break;case 12:Ea(p,v,l);break;case 13:Ea(p,v,l),l&&T&4&&Fb(p,v);break;case 22:v.memoizedState===null&&Ea(p,v,l),di(v,v.return);break;default:Ea(p,v,l)}i=i.sibling}}function Xf(r,i){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&vs(l))}function Kf(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&vs(r))}function Sa(r,i,l,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ib(r,i,l,d),i=i.sibling}function Ib(r,i,l,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Sa(r,i,l,d),p&2048&&Rs(9,i);break;case 3:Sa(r,i,l,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&vs(r)));break;case 12:if(p&2048){Sa(r,i,l,d),r=i.stateNode;try{var v=i.memoizedProps,T=v.id,P=v.onPostCommit;typeof P=="function"&&P(T,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(V){mt(i,i.return,V)}}else Sa(r,i,l,d);break;case 23:break;case 22:v=i.stateNode,i.memoizedState!==null?v._visibility&4?Sa(r,i,l,d):As(r,i):v._visibility&4?Sa(r,i,l,d):(v._visibility|=4,io(r,i,l,d,(i.subtreeFlags&10256)!==0)),p&2048&&Xf(i.alternate,i);break;case 24:Sa(r,i,l,d),p&2048&&Kf(i.alternate,i);break;default:Sa(r,i,l,d)}}function io(r,i,l,d,p){for(p=p&&(i.subtreeFlags&10256)!==0,i=i.child;i!==null;){var v=r,T=i,P=l,V=d,Q=T.flags;switch(T.tag){case 0:case 11:case 15:io(v,T,P,V,p),Rs(8,T);break;case 23:break;case 22:var fe=T.stateNode;T.memoizedState!==null?fe._visibility&4?io(v,T,P,V,p):As(v,T):(fe._visibility|=4,io(v,T,P,V,p)),p&&Q&2048&&Xf(T.alternate,T);break;case 24:io(v,T,P,V,p),p&&Q&2048&&Kf(T.alternate,T);break;default:io(v,T,P,V,p)}i=i.sibling}}function As(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=r,d=i,p=d.flags;switch(d.tag){case 22:As(l,d),p&2048&&Xf(d.alternate,d);break;case 24:As(l,d),p&2048&&Kf(d.alternate,d);break;default:As(l,d)}i=i.sibling}}var Ds=8192;function oo(r){if(r.subtreeFlags&Ds)for(r=r.child;r!==null;)Hb(r),r=r.sibling}function Hb(r){switch(r.tag){case 26:oo(r),r.flags&Ds&&r.memoizedState!==null&&iD(nr,r.memoizedState,r.memoizedProps);break;case 5:oo(r);break;case 3:case 4:var i=nr;nr=Ac(r.stateNode.containerInfo),oo(r),nr=i;break;case 22:r.memoizedState===null&&(i=r.alternate,i!==null&&i.memoizedState!==null?(i=Ds,Ds=16777216,oo(r),Ds=i):oo(r));break;default:oo(r)}}function $b(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function ks(r){var i=r.deletions;if(r.flags&16){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Bt=d,qb(d,r)}$b(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Vb(r),r=r.sibling}function Vb(r){switch(r.tag){case 0:case 11:case 15:ks(r),r.flags&2048&&wa(9,r,r.return);break;case 3:ks(r);break;case 12:ks(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&4&&(r.return===null||r.return.tag!==13)?(i._visibility&=-5,pc(r)):ks(r);break;default:ks(r)}}function pc(r){var i=r.deletions;if(r.flags&16){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Bt=d,qb(d,r)}$b(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:wa(8,i,i.return),pc(i);break;case 22:l=i.stateNode,l._visibility&4&&(l._visibility&=-5,pc(i));break;default:pc(i)}r=r.sibling}}function qb(r,i){for(;Bt!==null;){var l=Bt;switch(l.tag){case 0:case 11:case 15:wa(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:vs(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,Bt=d;else e:for(l=r;Bt!==null;){d=Bt;var p=d.sibling,v=d.return;if(Pb(d),d===l){Bt=null;break e}if(p!==null){p.return=v,Bt=p;break e}Bt=v}}}function y2(r,i,l,d){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vn(r,i,l,d){return new y2(r,i,l,d)}function Zf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function _a(r,i){var l=r.alternate;return l===null?(l=Vn(r.tag,i,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=i,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&31457280,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,i=r.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function Yb(r,i){r.flags&=31457282;var l=r.alternate;return l===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,i=l.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function mc(r,i,l,d,p,v){var T=0;if(d=r,typeof r=="function")Zf(r)&&(T=1);else if(typeof r=="string")T=rD(r,l,Se.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case f:return fi(l.children,p,v,i);case h:T=8,p|=24;break;case m:return r=Vn(12,l,i,p|2),r.elementType=m,r.lanes=v,r;case E:return r=Vn(13,l,i,p),r.elementType=E,r.lanes=v,r;case _:return r=Vn(19,l,i,p),r.elementType=_,r.lanes=v,r;case A:return Wb(l,p,v,i);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case g:case b:T=10;break e;case y:T=9;break e;case S:T=11;break e;case N:T=14;break e;case C:T=16,d=null;break e}T=29,l=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Vn(T,l,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function fi(r,i,l,d){return r=Vn(7,r,d,i),r.lanes=l,r}function Wb(r,i,l,d){r=Vn(22,r,d,i),r.elementType=A,r.lanes=l;var p={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var v=p._current;if(v===null)throw Error(a(456));if(!(p._pendingVisibility&2)){var T=fa(v,2);T!==null&&(p._pendingVisibility|=2,un(T,v,2))}},attach:function(){var v=p._current;if(v===null)throw Error(a(456));if(p._pendingVisibility&2){var T=fa(v,2);T!==null&&(p._pendingVisibility&=-3,un(T,v,2))}}};return r.stateNode=p,r}function Qf(r,i,l){return r=Vn(6,r,null,i),r.lanes=l,r}function Jf(r,i,l){return i=Vn(4,r.children!==null?r.children:[],r.key,i),i.lanes=l,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}function $r(r){r.flags|=4}function Xb(r,i){if(i.type!=="stylesheet"||i.state.loading&4)r.flags&=-16777217;else if(r.flags|=16777216,!jx(i)){if(i=In.current,i!==null&&((rt&4194176)===rt?mr!==null:(rt&62914560)!==rt&&!(rt&536870912)||i!==mr))throw ps=rf,fy;r.flags|=8192}}function gc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?hn():536870912,r.lanes|=i,lo|=i)}function Ns(r,i){if(!ot)switch(r.tailMode){case"hidden":i=r.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function Et(r){var i=r.alternate!==null&&r.alternate.child===r.child,l=0,d=0;if(i)for(var p=r.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags&31457280,d|=p.flags&31457280,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=l,i}function b2(r,i,l){var d=i.pendingProps;switch(tf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(i),null;case 1:return Et(i),null;case 3:return l=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Ur(Mt),J(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(us(i)?$r(i):r===null||r.memoizedState.isDehydrated&&!(i.flags&256)||(i.flags|=1024,tr!==null&&(sh(tr),tr=null))),Et(i),null;case 26:return l=i.memoizedState,r===null?($r(i),l!==null?(Et(i),Xb(i,l)):(Et(i),i.flags&=-16777217)):l?l!==r.memoizedState?($r(i),Et(i),Xb(i,l)):(Et(i),i.flags&=-16777217):(r.memoizedProps!==d&&$r(i),Et(i),i.flags&=-16777217),null;case 27:_e(i),l=Le.current;var p=i.type;if(r!==null&&i.stateNode!=null)r.memoizedProps!==d&&$r(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Et(i),null}r=Se.current,us(i)?uy(i):(r=Cx(p,d,l),i.stateNode=r,$r(i))}return Et(i),null;case 5:if(_e(i),l=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&$r(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Et(i),null}if(r=Se.current,us(i))uy(i);else{switch(p=Rc(Le.current),r){case 1:r=p.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:r=p.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":r=p.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":r=p.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":r=p.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof d.is=="string"?p.createElement("select",{is:d.is}):p.createElement("select"),d.multiple?r.multiple=!0:d.size&&(r.size=d.size);break;default:r=typeof d.is=="string"?p.createElement(l,{is:d.is}):p.createElement(l)}}r[en]=i,r[gn]=d;e:for(p=i.child;p!==null;){if(p.tag===5||p.tag===6)r.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===i)break e;for(;p.sibling===null;){if(p.return===null||p.return===i)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}i.stateNode=r;e:switch(Xt(r,l,d),l){case"button":case"input":case"select":case"textarea":r=!!d.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&$r(i)}}return Et(i),i.flags&=-16777217,null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&$r(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=Le.current,us(i)){if(r=i.stateNode,l=i.memoizedProps,d=null,p=cn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[en]=i,r=!!(r.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||bx(r.nodeValue,l)),r||ni(i)}else r=Rc(r).createTextNode(d),r[en]=i,i.stateNode=r}return Et(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=us(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[en]=i}else ds(),!(i.flags&128)&&(i.memoizedState=null),i.flags|=4;Et(i),p=!1}else tr!==null&&(sh(tr),tr=null),p=!0;if(!p)return i.flags&256?(Mr(i),i):(Mr(i),null)}if(Mr(i),i.flags&128)return i.lanes=l,i;if(l=d!==null,r=r!==null&&r.memoizedState!==null,l){d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool);var v=null;d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048)}return l!==r&&l&&(i.child.flags|=8192),gc(i,i.updateQueue),Et(i),null;case 4:return J(),r===null&&yh(i.stateNode.containerInfo),Et(i),null;case 10:return Ur(i.type),Et(i),null;case 19:if(Ce(zt),p=i.memoizedState,p===null)return Et(i),null;if(d=(i.flags&128)!==0,v=p.rendering,v===null)if(d)Ns(p,!1);else{if(Rt!==0||r!==null&&r.flags&128)for(r=i.child;r!==null;){if(v=Jl(r),v!==null){for(i.flags|=128,Ns(p,!1),r=v.updateQueue,i.updateQueue=r,gc(i,r),i.subtreeFlags=0,r=l,l=i.child;l!==null;)Yb(l,r),l=l.sibling;return he(zt,zt.current&1|2),i.child}r=r.sibling}p.tail!==null&&me()>vc&&(i.flags|=128,d=!0,Ns(p,!1),i.lanes=4194304)}else{if(!d)if(r=Jl(v),r!==null){if(i.flags|=128,d=!0,r=r.updateQueue,i.updateQueue=r,gc(i,r),Ns(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!ot)return Et(i),null}else 2*me()-p.renderingStartTime>vc&&l!==536870912&&(i.flags|=128,d=!0,Ns(p,!1),i.lanes=4194304);p.isBackwards?(v.sibling=i.child,i.child=v):(r=p.last,r!==null?r.sibling=v:i.child=v,p.last=v)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=me(),i.sibling=null,r=zt.current,he(zt,d?r&1|2:r&1),i):(Et(i),null);case 22:case 23:return Mr(i),of(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?l&536870912&&!(i.flags&128)&&(Et(i),i.subtreeFlags&6&&(i.flags|=8192)):Et(i),l=i.updateQueue,l!==null&&gc(i,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048),r!==null&&Ce(ai),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ur(Mt),Et(i),null;case 25:return null}throw Error(a(156,i.tag))}function x2(r,i){switch(tf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ur(Mt),J(),r=i.flags,r&65536&&!(r&128)?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return _e(i),null;case 13:if(Mr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));ds()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return Ce(zt),null;case 4:return J(),null;case 10:return Ur(i.type),null;case 22:case 23:return Mr(i),of(),r!==null&&Ce(ai),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ur(Mt),null;case 25:return null;default:return null}}function Kb(r,i){switch(tf(i),i.tag){case 3:Ur(Mt),J();break;case 26:case 27:case 5:_e(i);break;case 4:J();break;case 13:Mr(i);break;case 19:Ce(zt);break;case 10:Ur(i.type);break;case 22:case 23:Mr(i),of(),r!==null&&Ce(ai);break;case 24:Ur(Mt)}}var w2={getCacheForType:function(r){var i=tn(Mt),l=i.data.get(r);return l===void 0&&(l=r(),i.data.set(r,l)),l}},E2=typeof WeakMap=="function"?WeakMap:Map,St=0,vt=null,Je=null,rt=0,yt=0,kn=null,Vr=!1,so=!1,eh=!1,qr=0,Rt=0,Ca=0,hi=0,th=0,qn=0,lo=0,Os=null,vr=null,nh=!1,rh=0,vc=1/0,yc=null,Ta=null,bc=!1,pi=null,js=0,ah=0,ih=null,Ls=0,oh=null;function Nn(){if(St&2&&rt!==0)return rt&-rt;if(L.T!==null){var r=Ji;return r!==0?r:ph()}return vv()}function Zb(){qn===0&&(qn=!(rt&536870912)||ot?pt():536870912);var r=In.current;return r!==null&&(r.flags|=32),qn}function un(r,i,l){(r===vt&&yt===2||r.cancelPendingCommit!==null)&&(co(r,0),Yr(r,rt,qn,!1)),pn(r,l),(!(St&2)||r!==vt)&&(r===vt&&(!(St&2)&&(hi|=l),Rt===4&&Yr(r,rt,qn,!1)),yr(r))}function Qb(r,i,l){if(St&6)throw Error(a(327));var d=!l&&(i&60)===0&&(i&r.expiredLanes)===0||qe(r,i),p=d?C2(r,i):uh(r,i,!0),v=d;do{if(p===0){so&&!d&&Yr(r,i,0,!1);break}else if(p===6)Yr(r,i,0,!Vr);else{if(l=r.current.alternate,v&&!S2(l)){p=uh(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var T=0;else T=r.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){i=T;e:{var P=r;p=Os;var V=P.current.memoizedState.isDehydrated;if(V&&(co(P,T).flags|=256),T=uh(P,T,!1),T!==2){if(eh&&!V){P.errorRecoveryDisabledLanes|=v,hi|=v,p=4;break e}v=vr,vr=p,v!==null&&sh(v)}p=T}if(v=!1,p!==2)continue}}if(p===1){co(r,0),Yr(r,i,0,!0);break}e:{switch(d=r,p){case 0:case 1:throw Error(a(345));case 4:if((i&4194176)===i){Yr(d,i,qn,!Vr);break e}break;case 2:vr=null;break;case 3:case 5:break;default:throw Error(a(329))}if(d.finishedWork=l,d.finishedLanes=i,(i&62914560)===i&&(v=rh+300-me(),10<v)){if(Yr(d,i,qn,!Vr),zi(d,0)!==0)break e;d.timeoutHandle=Ex(Jb.bind(null,d,l,vr,yc,nh,i,qn,hi,lo,Vr,2,-0,0),v);break e}Jb(d,l,vr,yc,nh,i,qn,hi,lo,Vr,0,-0,0)}}break}while(!0);yr(r)}function sh(r){vr===null?vr=r:vr.push.apply(vr,r)}function Jb(r,i,l,d,p,v,T,P,V,Q,fe,xe,se){var ue=i.subtreeFlags;if((ue&8192||(ue&16785408)===16785408)&&(Us={stylesheets:null,count:0,unsuspend:aD},Hb(i),i=oD(),i!==null)){r.cancelPendingCommit=i(ox.bind(null,r,l,d,p,T,P,V,1,xe,se)),Yr(r,v,T,!Q);return}ox(r,l,d,p,T,P,V,fe,xe,se)}function S2(r){for(var i=r;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var p=l[d],v=p.getSnapshot;p=p.value;try{if(!Rn(v(),p))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Yr(r,i,l,d){i&=~th,i&=~hi,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-Lt(p),T=1<<v;d[v]=-1,p&=~T}l!==0&&mn(r,l,i)}function xc(){return St&6?!0:(zs(0),!1)}function lh(){if(Je!==null){if(yt===0)var r=Je.return;else r=Je,Fr=ci=null,pf(r),Zi=null,ms=0,r=Je;for(;r!==null;)Kb(r.alternate,r),r=r.return;Je=null}}function co(r,i){r.finishedWork=null,r.finishedLanes=0;var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,I2(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),lh(),vt=r,Je=l=_a(r.current,null),rt=i,yt=0,kn=null,Vr=!1,so=qe(r,i),eh=!1,lo=qn=th=hi=Ca=Rt=0,vr=Os=null,nh=!1,i&8&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-Lt(d),v=1<<p;i|=r[p],d&=~v}return qr=i,$l(),l}function ex(r,i){Ze=null,L.H=gr,i===hs?(i=my(),yt=3):i===fy?(i=my(),yt=4):yt=i===hb?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,kn=i,Je===null&&(Rt=1,uc(r,Fn(i,r.current)))}function tx(){var r=L.H;return L.H=gr,r===null?gr:r}function nx(){var r=L.A;return L.A=w2,r}function ch(){Rt=4,Vr||(rt&4194176)!==rt&&In.current!==null||(so=!0),!(Ca&134217727)&&!(hi&134217727)||vt===null||Yr(vt,rt,qn,!1)}function uh(r,i,l){var d=St;St|=2;var p=tx(),v=nx();(vt!==r||rt!==i)&&(yc=null,co(r,i)),i=!1;var T=Rt;e:do try{if(yt!==0&&Je!==null){var P=Je,V=kn;switch(yt){case 8:lh(),T=6;break e;case 3:case 2:case 6:In.current===null&&(i=!0);var Q=yt;if(yt=0,kn=null,uo(r,P,V,Q),l&&so){T=0;break e}break;default:Q=yt,yt=0,kn=null,uo(r,P,V,Q)}}_2(),T=Rt;break}catch(fe){ex(r,fe)}while(!0);return i&&r.shellSuspendCounter++,Fr=ci=null,St=d,L.H=p,L.A=v,Je===null&&(vt=null,rt=0,$l()),T}function _2(){for(;Je!==null;)rx(Je)}function C2(r,i){var l=St;St|=2;var d=tx(),p=nx();vt!==r||rt!==i?(yc=null,vc=me()+500,co(r,i)):so=qe(r,i);e:do try{if(yt!==0&&Je!==null){i=Je;var v=kn;t:switch(yt){case 1:yt=0,kn=null,uo(r,i,v,1);break;case 2:if(hy(v)){yt=0,kn=null,ax(i);break}i=function(){yt===2&&vt===r&&(yt=7),yr(r)},v.then(i,i);break e;case 3:yt=7;break e;case 4:yt=5;break e;case 7:hy(v)?(yt=0,kn=null,ax(i)):(yt=0,kn=null,uo(r,i,v,7));break;case 5:var T=null;switch(Je.tag){case 26:T=Je.memoizedState;case 5:case 27:var P=Je;if(!T||jx(T)){yt=0,kn=null;var V=P.sibling;if(V!==null)Je=V;else{var Q=P.return;Q!==null?(Je=Q,wc(Q)):Je=null}break t}}yt=0,kn=null,uo(r,i,v,5);break;case 6:yt=0,kn=null,uo(r,i,v,6);break;case 8:lh(),Rt=6;break e;default:throw Error(a(462))}}T2();break}catch(fe){ex(r,fe)}while(!0);return Fr=ci=null,L.H=d,L.A=p,St=l,Je!==null?0:(vt=null,rt=0,$l(),Rt)}function T2(){for(;Je!==null&&!Fe();)rx(Je)}function rx(r){var i=Cb(r.alternate,r,qr);r.memoizedProps=r.pendingProps,i===null?wc(r):Je=i}function ax(r){var i=r,l=i.alternate;switch(i.tag){case 15:case 0:i=bb(l,i,i.pendingProps,i.type,void 0,rt);break;case 11:i=bb(l,i,i.pendingProps,i.type.render,i.ref,rt);break;case 5:pf(i);default:Kb(l,i),i=Je=Yb(i,qr),i=Cb(l,i,qr)}r.memoizedProps=r.pendingProps,i===null?wc(r):Je=i}function uo(r,i,l,d){Fr=ci=null,pf(i),Zi=null,ms=0;var p=i.return;try{if(p2(r,p,i,l,rt)){Rt=1,uc(r,Fn(l,r.current)),Je=null;return}}catch(v){if(p!==null)throw Je=p,v;Rt=1,uc(r,Fn(l,r.current)),Je=null;return}i.flags&32768?(ot||d===1?r=!0:so||rt&536870912?r=!1:(Vr=r=!0,(d===2||d===3||d===6)&&(d=In.current,d!==null&&d.tag===13&&(d.flags|=16384))),ix(i,r)):wc(i)}function wc(r){var i=r;do{if(i.flags&32768){ix(i,Vr);return}r=i.return;var l=b2(i.alternate,i,qr);if(l!==null){Je=l;return}if(i=i.sibling,i!==null){Je=i;return}Je=i=r}while(i!==null);Rt===0&&(Rt=5)}function ix(r,i){do{var l=x2(r.alternate,r);if(l!==null){l.flags&=32767,Je=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(r=r.sibling,r!==null)){Je=r;return}Je=r=l}while(r!==null);Rt=6,Je=null}function ox(r,i,l,d,p,v,T,P,V,Q){var fe=L.T,xe=W.p;try{W.p=2,L.T=null,R2(r,i,l,d,xe,p,v,T,P,V,Q)}finally{L.T=fe,W.p=xe}}function R2(r,i,l,d,p,v,T,P){do fo();while(pi!==null);if(St&6)throw Error(a(327));var V=r.finishedWork;if(d=r.finishedLanes,V===null)return null;if(r.finishedWork=null,r.finishedLanes=0,V===r.current)throw Error(a(177));r.callbackNode=null,r.callbackPriority=0,r.cancelPendingCommit=null;var Q=V.lanes|V.childLanes;if(Q|=Qd,Nr(r,d,Q,v,T,P),r===vt&&(Je=vt=null,rt=0),!(V.subtreeFlags&10256)&&!(V.flags&10256)||bc||(bc=!0,ah=Q,ih=l,N2(it,function(){return fo(),null})),l=(V.flags&15990)!==0,V.subtreeFlags&15990||l?(l=L.T,L.T=null,v=W.p,W.p=2,T=St,St|=4,g2(r,V),Ub(V,r),ZA(Eh,r.containerInfo),jc=!!wh,Eh=wh=null,r.current=V,Mb(r,V.alternate,V),Pe(),St=T,W.p=v,L.T=l):r.current=V,bc?(bc=!1,pi=r,js=d):sx(r,Q),Q=r.pendingLanes,Q===0&&(Ta=null),Tn(V.stateNode),yr(r),i!==null)for(p=r.onRecoverableError,V=0;V<i.length;V++)Q=i[V],p(Q.value,{componentStack:Q.stack});return js&3&&fo(),Q=r.pendingLanes,d&4194218&&Q&42?r===oh?Ls++:(Ls=0,oh=r):Ls=0,zs(0),null}function sx(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,vs(i)))}function fo(){if(pi!==null){var r=pi,i=ah;ah=0;var l=gv(js),d=L.T,p=W.p;try{if(W.p=32>l?32:l,L.T=null,pi===null)var v=!1;else{l=ih,ih=null;var T=pi,P=js;if(pi=null,js=0,St&6)throw Error(a(331));var V=St;if(St|=4,Vb(T.current),Ib(T,T.current,P,l),St=V,zs(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Gt,T)}catch{}v=!0}return v}finally{W.p=p,L.T=d,sx(r,i)}}return!1}function lx(r,i,l){i=Fn(l,i),i=Af(r.stateNode,i,2),r=xa(r,i,2),r!==null&&(pn(r,2),yr(r))}function mt(r,i,l){if(r.tag===3)lx(r,r,l);else for(;i!==null;){if(i.tag===3){lx(i,r,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ta===null||!Ta.has(d))){r=Fn(l,r),l=db(2),d=xa(i,l,2),d!==null&&(fb(l,d,i,r),pn(d,2),yr(d));break}}i=i.return}}function dh(r,i,l){var d=r.pingCache;if(d===null){d=r.pingCache=new E2;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(l)||(eh=!0,p.add(l),r=A2.bind(null,r,i,l),i.then(r,r))}function A2(r,i,l){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,vt===r&&(rt&l)===l&&(Rt===4||Rt===3&&(rt&62914560)===rt&&300>me()-rh?!(St&2)&&co(r,0):th|=l,lo===rt&&(lo=0)),yr(r)}function cx(r,i){i===0&&(i=hn()),r=fa(r,i),r!==null&&(pn(r,i),yr(r))}function D2(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),cx(r,l)}function k2(r,i){var l=0;switch(r.tag){case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),cx(r,l)}function N2(r,i){return Ee(r,i)}var Ec=null,ho=null,fh=!1,Sc=!1,hh=!1,mi=0;function yr(r){r!==ho&&r.next===null&&(ho===null?Ec=ho=r:ho=ho.next=r),Sc=!0,fh||(fh=!0,j2(O2))}function zs(r,i){if(!hh&&Sc){hh=!0;do for(var l=!1,d=Ec;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var T=d.suspendedLanes,P=d.pingedLanes;v=(1<<31-Lt(42|r)+1)-1,v&=p&~(T&~P),v=v&201326677?v&201326677|1:v?v|2:0}v!==0&&(l=!0,fx(d,v))}else v=rt,v=zi(d,d===vt?v:0),!(v&3)||qe(d,v)||(l=!0,fx(d,v));d=d.next}while(l);hh=!1}}function O2(){Sc=fh=!1;var r=0;mi!==0&&(B2()&&(r=mi),mi=0);for(var i=me(),l=null,d=Ec;d!==null;){var p=d.next,v=ux(d,i);v===0?(d.next=null,l===null?Ec=p:l.next=p,p===null&&(ho=l)):(l=d,(r!==0||v&3)&&(Sc=!0)),d=p}zs(r)}function ux(r,i){for(var l=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var T=31-Lt(v),P=1<<T,V=p[T];V===-1?(!(P&l)||P&d)&&(p[T]=lt(P,i)):V<=i&&(r.expiredLanes|=P),v&=~P}if(i=vt,l=rt,l=zi(r,r===i?l:0),d=r.callbackNode,l===0||r===i&&yt===2||r.cancelPendingCommit!==null)return d!==null&&d!==null&&te(d),r.callbackNode=null,r.callbackPriority=0;if(!(l&3)||qe(r,l)){if(i=l&-l,i===r.callbackPriority)return i;switch(d!==null&&te(d),gv(l)){case 2:case 8:l=He;break;case 32:l=it;break;case 268435456:l=bt;break;default:l=it}return d=dx.bind(null,r),l=Ee(l,d),r.callbackPriority=i,r.callbackNode=l,i}return d!==null&&d!==null&&te(d),r.callbackPriority=2,r.callbackNode=null,2}function dx(r,i){var l=r.callbackNode;if(fo()&&r.callbackNode!==l)return null;var d=rt;return d=zi(r,r===vt?d:0),d===0?null:(Qb(r,d,i),ux(r,me()),r.callbackNode!=null&&r.callbackNode===l?dx.bind(null,r):null)}function fx(r,i){if(fo())return null;Qb(r,i,!0)}function j2(r){H2(function(){St&6?Ee(je,r):r()})}function ph(){return mi===0&&(mi=pt()),mi}function hx(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Pl(""+r)}function px(r,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,r.id&&l.setAttribute("form",r.id),i.parentNode.insertBefore(l,i),r=new FormData(r),l.parentNode.removeChild(l),r}function L2(r,i,l,d,p){if(i==="submit"&&l&&l.stateNode===p){var v=hx((p[gn]||null).action),T=d.submitter;T&&(i=(i=T[gn]||null)?hx(i.formAction):T.getAttribute("formAction"),i!==null&&(v=i,T=null));var P=new Bl("action","action",null,d,p);r.push({event:P,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(mi!==0){var V=T?px(p,T):new FormData(p);Sf(l,{pending:!0,data:V,method:p.method,action:v},null,V)}}else typeof v=="function"&&(P.preventDefault(),V=T?px(p,T):new FormData(p),Sf(l,{pending:!0,data:V,method:p.method,action:v},v,V))},currentTarget:p}]})}}for(var mh=0;mh<oy.length;mh++){var gh=oy[mh],z2=gh.toLowerCase(),M2=gh[0].toUpperCase()+gh.slice(1);er(z2,"on"+M2)}er(ty,"onAnimationEnd"),er(ny,"onAnimationIteration"),er(ry,"onAnimationStart"),er("dblclick","onDoubleClick"),er("focusin","onFocus"),er("focusout","onBlur"),er(JA,"onTransitionRun"),er(e2,"onTransitionStart"),er(t2,"onTransitionCancel"),er(ay,"onTransitionEnd"),Fi("onMouseEnter",["mouseout","mouseover"]),Fi("onMouseLeave",["mouseout","mouseover"]),Fi("onPointerEnter",["pointerout","pointerover"]),Fi("onPointerLeave",["pointerout","pointerover"]),Ka("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ka("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ka("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ka("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ka("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ka("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ms="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(" "),P2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ms));function mx(r,i){i=(i&4)!==0;for(var l=0;l<r.length;l++){var d=r[l],p=d.event;d=d.listeners;e:{var v=void 0;if(i)for(var T=d.length-1;0<=T;T--){var P=d[T],V=P.instance,Q=P.currentTarget;if(P=P.listener,V!==v&&p.isPropagationStopped())break e;v=P,p.currentTarget=Q;try{v(p)}catch(fe){cc(fe)}p.currentTarget=null,v=V}else for(T=0;T<d.length;T++){if(P=d[T],V=P.instance,Q=P.currentTarget,P=P.listener,V!==v&&p.isPropagationStopped())break e;v=P,p.currentTarget=Q;try{v(p)}catch(fe){cc(fe)}p.currentTarget=null,v=V}}}}function tt(r,i){var l=i[Nd];l===void 0&&(l=i[Nd]=new Set);var d=r+"__bubble";l.has(d)||(gx(i,r,2,!1),l.add(d))}function vh(r,i,l){var d=0;i&&(d|=4),gx(l,r,d,i)}var _c="_reactListening"+Math.random().toString(36).slice(2);function yh(r){if(!r[_c]){r[_c]=!0,bv.forEach(function(l){l!=="selectionchange"&&(P2.has(l)||vh(l,!1,r),vh(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[_c]||(i[_c]=!0,vh("selectionchange",!1,i))}}function gx(r,i,l,d){switch(Fx(i)){case 2:var p=cD;break;case 8:p=uD;break;default:p=Nh}l=p.bind(null,i,l,r),p=void 0,!Fd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,l,{capture:!0,passive:p}):r.addEventListener(i,l,!0):p!==void 0?r.addEventListener(i,l,{passive:p}):r.addEventListener(i,l,!1)}function bh(r,i,l,d,p){var v=d;if(!(i&1)&&!(i&2)&&d!==null)e:for(;;){if(d===null)return;var T=d.tag;if(T===3||T===4){var P=d.stateNode.containerInfo;if(P===p||P.nodeType===8&&P.parentNode===p)break;if(T===4)for(T=d.return;T!==null;){var V=T.tag;if((V===3||V===4)&&(V=T.stateNode.containerInfo,V===p||V.nodeType===8&&V.parentNode===p))return;T=T.return}for(;P!==null;){if(T=Xa(P),T===null)return;if(V=T.tag,V===5||V===6||V===26||V===27){d=v=T;continue e}P=P.parentNode}}d=d.return}Nv(function(){var Q=v,fe=Pd(l),xe=[];e:{var se=iy.get(r);if(se!==void 0){var ue=Bl,Ge=r;switch(r){case"keypress":if(Fl(l)===0)break e;case"keydown":case"keyup":ue=kA;break;case"focusin":Ge="focus",ue=Hd;break;case"focusout":Ge="blur",ue=Hd;break;case"beforeblur":case"afterblur":ue=Hd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=Lv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=yA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=jA;break;case ty:case ny:case ry:ue=wA;break;case ay:ue=zA;break;case"scroll":case"scrollend":ue=gA;break;case"wheel":ue=PA;break;case"copy":case"cut":case"paste":ue=SA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Mv;break;case"toggle":case"beforetoggle":ue=FA}var We=(i&4)!==0,At=!We&&(r==="scroll"||r==="scrollend"),ee=We?se!==null?se+"Capture":null:se;We=[];for(var Z=Q,ae;Z!==null;){var ge=Z;if(ae=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||ae===null||ee===null||(ge=ts(Z,ee),ge!=null&&We.push(Ps(Z,ge,ae))),At)break;Z=Z.return}0<We.length&&(se=new ue(se,Ge,null,l,fe),xe.push({event:se,listeners:We}))}}if(!(i&7)){e:{if(se=r==="mouseover"||r==="pointerover",ue=r==="mouseout"||r==="pointerout",se&&l!==Md&&(Ge=l.relatedTarget||l.fromElement)&&(Xa(Ge)||Ge[Mi]))break e;if((ue||se)&&(se=fe.window===fe?fe:(se=fe.ownerDocument)?se.defaultView||se.parentWindow:window,ue?(Ge=l.relatedTarget||l.toElement,ue=Q,Ge=Ge?Xa(Ge):null,Ge!==null&&(At=j(Ge),We=Ge.tag,Ge!==At||We!==5&&We!==27&&We!==6)&&(Ge=null)):(ue=null,Ge=Q),ue!==Ge)){if(We=Lv,ge="onMouseLeave",ee="onMouseEnter",Z="mouse",(r==="pointerout"||r==="pointerover")&&(We=Mv,ge="onPointerLeave",ee="onPointerEnter",Z="pointer"),At=ue==null?se:es(ue),ae=Ge==null?se:es(Ge),se=new We(ge,Z+"leave",ue,l,fe),se.target=At,se.relatedTarget=ae,ge=null,Xa(fe)===Q&&(We=new We(ee,Z+"enter",Ge,l,fe),We.target=ae,We.relatedTarget=At,ge=We),At=ge,ue&&Ge)t:{for(We=ue,ee=Ge,Z=0,ae=We;ae;ae=po(ae))Z++;for(ae=0,ge=ee;ge;ge=po(ge))ae++;for(;0<Z-ae;)We=po(We),Z--;for(;0<ae-Z;)ee=po(ee),ae--;for(;Z--;){if(We===ee||ee!==null&&We===ee.alternate)break t;We=po(We),ee=po(ee)}We=null}else We=null;ue!==null&&vx(xe,se,ue,We,!1),Ge!==null&&At!==null&&vx(xe,At,Ge,We,!0)}}e:{if(se=Q?es(Q):window,ue=se.nodeName&&se.nodeName.toLowerCase(),ue==="select"||ue==="input"&&se.type==="file")var Me=$v;else if(Iv(se))if(Vv)Me=XA;else{Me=YA;var Qe=qA}else ue=se.nodeName,!ue||ue.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?Q&&zd(Q.elementType)&&(Me=$v):Me=WA;if(Me&&(Me=Me(r,Q))){Hv(xe,Me,l,fe);break e}Qe&&Qe(r,se,Q),r==="focusout"&&Q&&se.type==="number"&&Q.memoizedProps.value!=null&&Ld(se,"number",se.value)}switch(Qe=Q?es(Q):window,r){case"focusin":(Iv(Qe)||Qe.contentEditable==="true")&&(Vi=Qe,Xd=Q,cs=null);break;case"focusout":cs=Xd=Vi=null;break;case"mousedown":Kd=!0;break;case"contextmenu":case"mouseup":case"dragend":Kd=!1,Jv(xe,l,fe);break;case"selectionchange":if(QA)break;case"keydown":case"keyup":Jv(xe,l,fe)}var Ue;if(Vd)e:{switch(r){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else $i?Uv(r,l)&&(Ve="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Ve="onCompositionStart");Ve&&(Pv&&l.locale!=="ko"&&($i||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&$i&&(Ue=Ov()):(da=fe,Ud="value"in da?da.value:da.textContent,$i=!0)),Qe=Cc(Q,Ve),0<Qe.length&&(Ve=new zv(Ve,r,null,l,fe),xe.push({event:Ve,listeners:Qe}),Ue?Ve.data=Ue:(Ue=Bv(l),Ue!==null&&(Ve.data=Ue)))),(Ue=BA?IA(r,l):HA(r,l))&&(Ve=Cc(Q,"onBeforeInput"),0<Ve.length&&(Qe=new zv("onBeforeInput","beforeinput",null,l,fe),xe.push({event:Qe,listeners:Ve}),Qe.data=Ue)),L2(xe,r,Q,l,fe)}mx(xe,i)})}function Ps(r,i,l){return{instance:r,listener:i,currentTarget:l}}function Cc(r,i){for(var l=i+"Capture",d=[];r!==null;){var p=r,v=p.stateNode;p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=ts(r,l),p!=null&&d.unshift(Ps(r,p,v)),p=ts(r,i),p!=null&&d.push(Ps(r,p,v))),r=r.return}return d}function po(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function vx(r,i,l,d,p){for(var v=i._reactName,T=[];l!==null&&l!==d;){var P=l,V=P.alternate,Q=P.stateNode;if(P=P.tag,V!==null&&V===d)break;P!==5&&P!==26&&P!==27||Q===null||(V=Q,p?(Q=ts(l,v),Q!=null&&T.unshift(Ps(l,Q,V))):p||(Q=ts(l,v),Q!=null&&T.push(Ps(l,Q,V)))),l=l.return}T.length!==0&&r.push({event:i,listeners:T})}var G2=/\r\n?/g,F2=/\u0000|\uFFFD/g;function yx(r){return(typeof r=="string"?r:""+r).replace(G2,`
`).replace(F2,"")}function bx(r,i){return i=yx(i),yx(r)===i}function Tc(){}function dt(r,i,l,d,p,v){switch(l){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Bi(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Bi(r,""+d);break;case"className":Ll(r,"class",d);break;case"tabIndex":Ll(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Ll(r,l,d);break;case"style":Dv(r,d,v);break;case"data":if(i!=="object"){Ll(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||l!=="href")){r.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(l);break}d=Pl(""+d),r.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(l,"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 v=="function"&&(l==="formAction"?(i!=="input"&&dt(r,i,"name",p.name,p,null),dt(r,i,"formEncType",p.formEncType,p,null),dt(r,i,"formMethod",p.formMethod,p,null),dt(r,i,"formTarget",p.formTarget,p,null)):(dt(r,i,"encType",p.encType,p,null),dt(r,i,"method",p.method,p,null),dt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(l);break}d=Pl(""+d),r.setAttribute(l,d);break;case"onClick":d!=null&&(r.onclick=Tc);break;case"onScroll":d!=null&&tt("scroll",r);break;case"onScrollEnd":d!=null&&tt("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}l=Pl(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,""+d):r.removeAttribute(l);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":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":d===!0?r.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,d):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(l,d):r.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(l):r.setAttribute(l,d);break;case"popover":tt("beforetoggle",r),tt("toggle",r),jl(r,"popover",d);break;case"xlinkActuate":jr(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":jr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":jr(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":jr(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":jr(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":jr(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":jr(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":jr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":jr(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":jl(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=pA.get(l)||l,jl(r,l,d))}}function xh(r,i,l,d,p,v){switch(l){case"style":Dv(r,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"children":typeof d=="string"?Bi(r,d):(typeof d=="number"||typeof d=="bigint")&&Bi(r,""+d);break;case"onScroll":d!=null&&tt("scroll",r);break;case"onScrollEnd":d!=null&&tt("scrollend",r);break;case"onClick":d!=null&&(r.onclick=Tc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xv.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),i=l.slice(2,p?l.length-7:void 0),v=r[gn]||null,v=v!=null?v[l]:null,typeof v=="function"&&r.removeEventListener(i,v,p),typeof d=="function")){typeof v!="function"&&v!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(i,d,p);break e}l in r?r[l]=d:d===!0?r.setAttribute(l,""):jl(r,l,d)}}}function Xt(r,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",r),tt("load",r);var d=!1,p=!1,v;for(v in l)if(l.hasOwnProperty(v)){var T=l[v];if(T!=null)switch(v){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:dt(r,i,v,T,l,null)}}p&&dt(r,i,"srcSet",l.srcSet,l,null),d&&dt(r,i,"src",l.src,l,null);return;case"input":tt("invalid",r);var P=v=T=p=null,V=null,Q=null;for(d in l)if(l.hasOwnProperty(d)){var fe=l[d];if(fe!=null)switch(d){case"name":p=fe;break;case"type":T=fe;break;case"checked":V=fe;break;case"defaultChecked":Q=fe;break;case"value":v=fe;break;case"defaultValue":P=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(a(137,i));break;default:dt(r,i,d,fe,l,null)}}Cv(r,v,P,V,Q,T,p,!1),zl(r);return;case"select":tt("invalid",r),d=T=v=null;for(p in l)if(l.hasOwnProperty(p)&&(P=l[p],P!=null))switch(p){case"value":v=P;break;case"defaultValue":T=P;break;case"multiple":d=P;default:dt(r,i,p,P,l,null)}i=v,l=T,r.multiple=!!d,i!=null?Ui(r,!!d,i,!1):l!=null&&Ui(r,!!d,l,!0);return;case"textarea":tt("invalid",r),v=p=d=null;for(T in l)if(l.hasOwnProperty(T)&&(P=l[T],P!=null))switch(T){case"value":d=P;break;case"defaultValue":p=P;break;case"children":v=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(91));break;default:dt(r,i,T,P,l,null)}Rv(r,d,p,v),zl(r);return;case"option":for(V in l)if(l.hasOwnProperty(V)&&(d=l[V],d!=null))switch(V){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:dt(r,i,V,d,l,null)}return;case"dialog":tt("cancel",r),tt("close",r);break;case"iframe":case"object":tt("load",r);break;case"video":case"audio":for(d=0;d<Ms.length;d++)tt(Ms[d],r);break;case"image":tt("error",r),tt("load",r);break;case"details":tt("toggle",r);break;case"embed":case"source":case"link":tt("error",r),tt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in l)if(l.hasOwnProperty(Q)&&(d=l[Q],d!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:dt(r,i,Q,d,l,null)}return;default:if(zd(i)){for(fe in l)l.hasOwnProperty(fe)&&(d=l[fe],d!==void 0&&xh(r,i,fe,d,l,void 0));return}}for(P in l)l.hasOwnProperty(P)&&(d=l[P],d!=null&&dt(r,i,P,d,l,null))}function U2(r,i,l,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,T=null,P=null,V=null,Q=null,fe=null;for(ue in l){var xe=l[ue];if(l.hasOwnProperty(ue)&&xe!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":V=xe;default:d.hasOwnProperty(ue)||dt(r,i,ue,null,d,xe)}}for(var se in d){var ue=d[se];if(xe=l[se],d.hasOwnProperty(se)&&(ue!=null||xe!=null))switch(se){case"type":v=ue;break;case"name":p=ue;break;case"checked":Q=ue;break;case"defaultChecked":fe=ue;break;case"value":T=ue;break;case"defaultValue":P=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:ue!==xe&&dt(r,i,se,ue,d,xe)}}jd(r,T,P,V,Q,fe,v,p);return;case"select":ue=T=P=se=null;for(v in l)if(V=l[v],l.hasOwnProperty(v)&&V!=null)switch(v){case"value":break;case"multiple":ue=V;default:d.hasOwnProperty(v)||dt(r,i,v,null,d,V)}for(p in d)if(v=d[p],V=l[p],d.hasOwnProperty(p)&&(v!=null||V!=null))switch(p){case"value":se=v;break;case"defaultValue":P=v;break;case"multiple":T=v;default:v!==V&&dt(r,i,p,v,d,V)}i=P,l=T,d=ue,se!=null?Ui(r,!!l,se,!1):!!d!=!!l&&(i!=null?Ui(r,!!l,i,!0):Ui(r,!!l,l?[]:"",!1));return;case"textarea":ue=se=null;for(P in l)if(p=l[P],l.hasOwnProperty(P)&&p!=null&&!d.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:dt(r,i,P,null,d,p)}for(T in d)if(p=d[T],v=l[T],d.hasOwnProperty(T)&&(p!=null||v!=null))switch(T){case"value":se=p;break;case"defaultValue":ue=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&dt(r,i,T,p,d,v)}Tv(r,se,ue);return;case"option":for(var Ge in l)if(se=l[Ge],l.hasOwnProperty(Ge)&&se!=null&&!d.hasOwnProperty(Ge))switch(Ge){case"selected":r.selected=!1;break;default:dt(r,i,Ge,null,d,se)}for(V in d)if(se=d[V],ue=l[V],d.hasOwnProperty(V)&&se!==ue&&(se!=null||ue!=null))switch(V){case"selected":r.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:dt(r,i,V,se,d,ue)}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 We in l)se=l[We],l.hasOwnProperty(We)&&se!=null&&!d.hasOwnProperty(We)&&dt(r,i,We,null,d,se);for(Q in d)if(se=d[Q],ue=l[Q],d.hasOwnProperty(Q)&&se!==ue&&(se!=null||ue!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(a(137,i));break;default:dt(r,i,Q,se,d,ue)}return;default:if(zd(i)){for(var At in l)se=l[At],l.hasOwnProperty(At)&&se!==void 0&&!d.hasOwnProperty(At)&&xh(r,i,At,void 0,d,se);for(fe in d)se=d[fe],ue=l[fe],!d.hasOwnProperty(fe)||se===ue||se===void 0&&ue===void 0||xh(r,i,fe,se,d,ue);return}}for(var ee in l)se=l[ee],l.hasOwnProperty(ee)&&se!=null&&!d.hasOwnProperty(ee)&&dt(r,i,ee,null,d,se);for(xe in d)se=d[xe],ue=l[xe],!d.hasOwnProperty(xe)||se===ue||se==null&&ue==null||dt(r,i,xe,se,d,ue)}var wh=null,Eh=null;function Rc(r){return r.nodeType===9?r:r.ownerDocument}function xx(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function wx(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function Sh(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var _h=null;function B2(){var r=window.event;return r&&r.type==="popstate"?r===_h?!1:(_h=r,!0):(_h=null,!1)}var Ex=typeof setTimeout=="function"?setTimeout:void 0,I2=typeof clearTimeout=="function"?clearTimeout:void 0,Sx=typeof Promise=="function"?Promise:void 0,H2=typeof queueMicrotask=="function"?queueMicrotask:typeof Sx<"u"?function(r){return Sx.resolve(null).then(r).catch($2)}:Ex;function $2(r){setTimeout(function(){throw r})}function Ch(r,i){var l=i,d=0;do{var p=l.nextSibling;if(r.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"){if(d===0){r.removeChild(p),Vs(i);return}d--}else l!=="$"&&l!=="$?"&&l!=="$!"||d++;l=p}while(l);Vs(i)}function Th(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Th(l),Od(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function V2(r,i,l,d){for(;r.nodeType===1;){var p=l;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[Jo])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=rr(r.nextSibling),r===null)break}return null}function q2(r,i,l){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=rr(r.nextSibling),r===null))return null;return r}function rr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="F!"||i==="F")break;if(i==="/$")return null}}return r}function _x(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return r;i--}else l==="/$"&&i++}r=r.previousSibling}return null}function Cx(r,i,l){switch(i=Rc(l),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}var Yn=new Map,Tx=new Set;function Ac(r){return typeof r.getRootNode=="function"?r.getRootNode():r.ownerDocument}var Wr=W.d;W.d={f:Y2,r:W2,D:X2,C:K2,L:Z2,m:Q2,X:eD,S:J2,M:tD};function Y2(){var r=Wr.f(),i=xc();return r||i}function W2(r){var i=Pi(r);i!==null&&i.tag===5&&i.type==="form"?Jy(i):Wr.r(r)}var mo=typeof document>"u"?null:document;function Rx(r,i,l){var d=mo;if(d&&typeof i=="string"&&i){var p=Pn(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),Tx.has(p)||(Tx.add(p),r={rel:r,crossOrigin:l,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),Xt(i,"link",r),Ft(i),d.head.appendChild(i)))}}function X2(r){Wr.D(r),Rx("dns-prefetch",r,null)}function K2(r,i){Wr.C(r,i),Rx("preconnect",r,i)}function Z2(r,i,l){Wr.L(r,i,l);var d=mo;if(d&&r&&i){var p='link[rel="preload"][as="'+Pn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Pn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Pn(l.imageSizes)+'"]')):p+='[href="'+Pn(r)+'"]';var v=p;switch(i){case"style":v=go(r);break;case"script":v=vo(r)}Yn.has(v)||(r=I({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:r,as:i},l),Yn.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Gs(v))||i==="script"&&d.querySelector(Fs(v))||(i=d.createElement("link"),Xt(i,"link",r),Ft(i),d.head.appendChild(i)))}}function Q2(r,i){Wr.m(r,i);var l=mo;if(l&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Pn(d)+'"][href="'+Pn(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=vo(r)}if(!Yn.has(v)&&(r=I({rel:"modulepreload",href:r},i),Yn.set(v,r),l.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Fs(v)))return}d=l.createElement("link"),Xt(d,"link",r),Ft(d),l.head.appendChild(d)}}}function J2(r,i,l){Wr.S(r,i,l);var d=mo;if(d&&r){var p=Gi(d).hoistableStyles,v=go(r);i=i||"default";var T=p.get(v);if(!T){var P={loading:0,preload:null};if(T=d.querySelector(Gs(v)))P.loading=5;else{r=I({rel:"stylesheet",href:r,"data-precedence":i},l),(l=Yn.get(v))&&Rh(r,l);var V=T=d.createElement("link");Ft(V),Xt(V,"link",r),V._p=new Promise(function(Q,fe){V.onload=Q,V.onerror=fe}),V.addEventListener("load",function(){P.loading|=1}),V.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Dc(T,i,d)}T={type:"stylesheet",instance:T,count:1,state:P},p.set(v,T)}}}function eD(r,i){Wr.X(r,i);var l=mo;if(l&&r){var d=Gi(l).hoistableScripts,p=vo(r),v=d.get(p);v||(v=l.querySelector(Fs(p)),v||(r=I({src:r,async:!0},i),(i=Yn.get(p))&&Ah(r,i),v=l.createElement("script"),Ft(v),Xt(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function tD(r,i){Wr.M(r,i);var l=mo;if(l&&r){var d=Gi(l).hoistableScripts,p=vo(r),v=d.get(p);v||(v=l.querySelector(Fs(p)),v||(r=I({src:r,async:!0,type:"module"},i),(i=Yn.get(p))&&Ah(r,i),v=l.createElement("script"),Ft(v),Xt(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function Ax(r,i,l,d){var p=(p=Le.current)?Ac(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=go(l.href),l=Gi(p).hoistableStyles,d=l.get(i),d||(d={type:"style",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=go(l.href);var v=Gi(p).hoistableStyles,T=v.get(r);if(T||(p=p.ownerDocument||p,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,T),(v=p.querySelector(Gs(r)))&&!v._p&&(T.instance=v,T.state.loading=5),Yn.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Yn.set(r,l),v||nD(p,r,l,T.state))),i&&d===null)throw Error(a(528,""));return T}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=vo(l),l=Gi(p).hoistableScripts,d=l.get(i),d||(d={type:"script",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function go(r){return'href="'+Pn(r)+'"'}function Gs(r){return'link[rel="stylesheet"]['+r+"]"}function Dx(r){return I({},r,{"data-precedence":r.precedence,precedence:null})}function nD(r,i,l,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Xt(i,"link",l),Ft(i),r.head.appendChild(i))}function vo(r){return'[src="'+Pn(r)+'"]'}function Fs(r){return"script[async]"+r}function kx(r,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+Pn(l.href)+'"]');if(d)return i.instance=d,Ft(d),d;var p=I({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),Ft(d),Xt(d,"style",p),Dc(d,l.precedence,r),i.instance=d;case"stylesheet":p=go(l.href);var v=r.querySelector(Gs(p));if(v)return i.state.loading|=4,i.instance=v,Ft(v),v;d=Dx(l),(p=Yn.get(p))&&Rh(d,p),v=(r.ownerDocument||r).createElement("link"),Ft(v);var T=v;return T._p=new Promise(function(P,V){T.onload=P,T.onerror=V}),Xt(v,"link",d),i.state.loading|=4,Dc(v,l.precedence,r),i.instance=v;case"script":return v=vo(l.src),(p=r.querySelector(Fs(v)))?(i.instance=p,Ft(p),p):(d=l,(p=Yn.get(v))&&(d=I({},l),Ah(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),Ft(p),Xt(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&!(i.state.loading&4)&&(d=i.instance,i.state.loading|=4,Dc(d,l.precedence,r));return i.instance}function Dc(r,i,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,T=0;T<d.length;T++){var P=d[T];if(P.dataset.precedence===i)v=P;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(r,i.firstChild))}function Rh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Ah(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var kc=null;function Nx(r,i,l){if(kc===null){var d=new Map,p=kc=new Map;p.set(l,d)}else p=kc,d=p.get(l),d||(d=new Map,p.set(l,d));if(d.has(r))return d;for(d.set(r,null),l=l.getElementsByTagName(r),p=0;p<l.length;p++){var v=l[p];if(!(v[Jo]||v[en]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var T=v.getAttribute(i)||"";T=r+T;var P=d.get(T);P?P.push(v):d.set(T,[v])}}return d}function Ox(r,i,l){r=r.ownerDocument||r,r.head.insertBefore(l,i==="title"?r.querySelector("head > title"):null)}function rD(r,i,l){if(l===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function jx(r){return!(r.type==="stylesheet"&&!(r.state.loading&3))}var Us=null;function aD(){}function iD(r,i,l){if(Us===null)throw Error(a(475));var d=Us;if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(i.state.loading&4)){if(i.instance===null){var p=go(l.href),v=r.querySelector(Gs(p));if(v){r=v._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(d.count++,d=Nc.bind(d),r.then(d,d)),i.state.loading|=4,i.instance=v,Ft(v);return}v=r.ownerDocument||r,l=Dx(l),(p=Yn.get(p))&&Rh(l,p),v=v.createElement("link"),Ft(v);var T=v;T._p=new Promise(function(P,V){T.onload=P,T.onerror=V}),Xt(v,"link",l),i.instance=v}d.stylesheets===null&&(d.stylesheets=new Map),d.stylesheets.set(i,r),(r=i.state.preload)&&!(i.state.loading&3)&&(d.count++,i=Nc.bind(d),r.addEventListener("load",i),r.addEventListener("error",i))}}function oD(){if(Us===null)throw Error(a(475));var r=Us;return r.stylesheets&&r.count===0&&Dh(r,r.stylesheets),0<r.count?function(i){var l=setTimeout(function(){if(r.stylesheets&&Dh(r,r.stylesheets),r.unsuspend){var d=r.unsuspend;r.unsuspend=null,d()}},6e4);return r.unsuspend=i,function(){r.unsuspend=null,clearTimeout(l)}}:null}function Nc(){if(this.count--,this.count===0){if(this.stylesheets)Dh(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Oc=null;function Dh(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Oc=new Map,i.forEach(sD,r),Oc=null,Nc.call(r))}function sD(r,i){if(!(i.state.loading&4)){var l=Oc.get(r);if(l)var d=l.get(null);else{l=new Map,Oc.set(r,l);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var T=p[v];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(l.set(T.dataset.precedence,T),d=T)}d&&l.set(null,d)}p=i.instance,T=p.getAttribute("data-precedence"),v=l.get(T)||d,v===d&&l.set(null,p),l.set(T,p),this.count++,d=Nc.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Bs={$$typeof:b,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function lD(r,i,l,d,p,v,T,P){this.tag=1,this.containerInfo=r,this.finishedWork=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=ln(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ln(0),this.hiddenUpdates=ln(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=P,this.incompleteTransitions=new Map}function Lx(r,i,l,d,p,v,T,P,V,Q,fe,xe){return r=new lD(r,i,l,T,P,V,Q,xe),i=1,v===!0&&(i|=24),v=Vn(3,null,null,i),r.current=v,v.stateNode=r,i=sf(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:l,cache:i},Bf(v),r}function zx(r){return r?(r=Wi,r):Wi}function Mx(r,i,l,d,p,v){p=zx(p),d.context===null?d.context=p:d.pendingContext=p,d=ba(i),d.payload={element:l},v=v===void 0?null:v,v!==null&&(d.callback=v),l=xa(r,d,i),l!==null&&(un(l,r,i),_s(l,r,i))}function Px(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function kh(r,i){Px(r,i),(r=r.alternate)&&Px(r,i)}function Gx(r){if(r.tag===13){var i=fa(r,67108864);i!==null&&un(i,r,67108864),kh(r,67108864)}}var jc=!0;function cD(r,i,l,d){var p=L.T;L.T=null;var v=W.p;try{W.p=2,Nh(r,i,l,d)}finally{W.p=v,L.T=p}}function uD(r,i,l,d){var p=L.T;L.T=null;var v=W.p;try{W.p=8,Nh(r,i,l,d)}finally{W.p=v,L.T=p}}function Nh(r,i,l,d){if(jc){var p=Oh(d);if(p===null)bh(r,i,d,Lc,l),Ux(r,d);else if(fD(p,r,i,l,d))d.stopPropagation();else if(Ux(r,d),i&4&&-1<dD.indexOf(r)){for(;p!==null;){var v=Pi(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var T=Jt(v.pendingLanes);if(T!==0){var P=v;for(P.pendingLanes|=2,P.entangledLanes|=2;T;){var V=1<<31-Lt(T);P.entanglements[1]|=V,T&=~V}yr(v),!(St&6)&&(vc=me()+500,zs(0))}}break;case 13:P=fa(v,2),P!==null&&un(P,v,2),xc(),kh(v,2)}if(v=Oh(d),v===null&&bh(r,i,d,Lc,l),v===p)break;p=v}p!==null&&d.stopPropagation()}else bh(r,i,d,null,l)}}function Oh(r){return r=Pd(r),jh(r)}var Lc=null;function jh(r){if(Lc=null,r=Xa(r),r!==null){var i=j(r);if(i===null)r=null;else{var l=i.tag;if(l===13){if(r=K(i),r!==null)return r;r=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return Lc=r,null}function Fx(r){switch(r){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(Ae()){case je:return 2;case He:return 8;case it:case Ct:return 32;case bt:return 268435456;default:return 32}default:return 32}}var Lh=!1,Ra=null,Aa=null,Da=null,Is=new Map,Hs=new Map,ka=[],dD="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 Ux(r,i){switch(r){case"focusin":case"focusout":Ra=null;break;case"dragenter":case"dragleave":Aa=null;break;case"mouseover":case"mouseout":Da=null;break;case"pointerover":case"pointerout":Is.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hs.delete(i.pointerId)}}function $s(r,i,l,d,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:v,targetContainers:[p]},i!==null&&(i=Pi(i),i!==null&&Gx(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function fD(r,i,l,d,p){switch(i){case"focusin":return Ra=$s(Ra,r,i,l,d,p),!0;case"dragenter":return Aa=$s(Aa,r,i,l,d,p),!0;case"mouseover":return Da=$s(Da,r,i,l,d,p),!0;case"pointerover":var v=p.pointerId;return Is.set(v,$s(Is.get(v)||null,r,i,l,d,p)),!0;case"gotpointercapture":return v=p.pointerId,Hs.set(v,$s(Hs.get(v)||null,r,i,l,d,p)),!0}return!1}function Bx(r){var i=Xa(r.target);if(i!==null){var l=j(i);if(l!==null){if(i=l.tag,i===13){if(i=K(l),i!==null){r.blockedOn=i,oA(r.priority,function(){if(l.tag===13){var d=Nn(),p=fa(l,d);p!==null&&un(p,l,d),kh(l,d)}});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function zc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=Oh(r.nativeEvent);if(l===null){l=r.nativeEvent;var d=new l.constructor(l.type,l);Md=d,l.target.dispatchEvent(d),Md=null}else return i=Pi(l),i!==null&&Gx(i),r.blockedOn=l,!1;i.shift()}return!0}function Ix(r,i,l){zc(r)&&l.delete(i)}function hD(){Lh=!1,Ra!==null&&zc(Ra)&&(Ra=null),Aa!==null&&zc(Aa)&&(Aa=null),Da!==null&&zc(Da)&&(Da=null),Is.forEach(Ix),Hs.forEach(Ix)}function Mc(r,i){r.blockedOn===i&&(r.blockedOn=null,Lh||(Lh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,hD)))}var Pc=null;function Hx(r){Pc!==r&&(Pc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Pc===r&&(Pc=null);for(var i=0;i<r.length;i+=3){var l=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(jh(d||l)===null)continue;break}var v=Pi(l);v!==null&&(r.splice(i,3),i-=3,Sf(v,{pending:!0,data:p,method:l.method,action:d},d,p))}}))}function Vs(r){function i(V){return Mc(V,r)}Ra!==null&&Mc(Ra,r),Aa!==null&&Mc(Aa,r),Da!==null&&Mc(Da,r),Is.forEach(i),Hs.forEach(i);for(var l=0;l<ka.length;l++){var d=ka[l];d.blockedOn===r&&(d.blockedOn=null)}for(;0<ka.length&&(l=ka[0],l.blockedOn===null);)Bx(l),l.blockedOn===null&&ka.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var p=l[d],v=l[d+1],T=p[gn]||null;if(typeof v=="function")T||Hx(l);else if(T){var P=null;if(v&&v.hasAttribute("formAction")){if(p=v,T=v[gn]||null)P=T.formAction;else if(jh(p)!==null)continue}else P=T.action;typeof P=="function"?l[d+1]=P:(l.splice(d,3),d-=3),Hx(l)}}}function zh(r){this._internalRoot=r}Gc.prototype.render=zh.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,d=Nn();Mx(l,d,r,i,null,null)},Gc.prototype.unmount=zh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;r.tag===0&&fo(),Mx(r.current,2,null,r,null,null),xc(),i[Mi]=null}};function Gc(r){this._internalRoot=r}Gc.prototype.unstable_scheduleHydration=function(r){if(r){var i=vv();r={blockedOn:null,target:r,priority:i};for(var l=0;l<ka.length&&i!==0&&i<ka[l].priority;l++);ka.splice(l,0,r),l===0&&Bx(r)}};var $x=t.version;if($x!=="19.0.0")throw Error(a(527,$x,"19.0.0"));W.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=H(i),r=r!==null?O(r):null,r=r===null?null:r.stateNode,r};var pD={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:L,findFiberByHostInstance:Xa,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fc.isDisabled&&Fc.supportsFiber)try{Gt=Fc.inject(pD),at=Fc}catch{}}return Ys.createRoot=function(r,i){if(!o(r))throw Error(a(299));var l=!1,d="",p=sb,v=lb,T=cb,P=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(T=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(P=i.unstable_transitionCallbacks)),i=Lx(r,1,!1,null,null,l,d,p,v,T,P,null),r[Mi]=i.current,yh(r.nodeType===8?r.parentNode:r),new zh(i)},Ys.hydrateRoot=function(r,i,l){if(!o(r))throw Error(a(299));var d=!1,p="",v=sb,T=lb,P=cb,V=null,Q=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(T=l.onCaughtError),l.onRecoverableError!==void 0&&(P=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(V=l.unstable_transitionCallbacks),l.formState!==void 0&&(Q=l.formState)),i=Lx(r,1,!0,i,l??null,d,p,v,T,P,V,Q),i.context=zx(null),l=i.current,d=Nn(),p=ba(d),p.callback=null,xa(l,p,d),i.current.lanes=d,pn(i,d),yr(i),r[Mi]=i.current,yh(r),new Gc(i)},Ys.version="19.0.0",Ys}var e0;function AD(){if(e0)return Gh.exports;e0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gh.exports=RD(),Gh.exports}var DD=AD();const t0=e=>{let t;const n=new Set,a=(h,m)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const y=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,y))}},o=()=>t,u={setState:a,getState:o,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h))},f=t=e(a,o,u);return u},kD=e=>e?t0(e):t0,ND=e=>e;function OD(e,t=ND){const n=ve.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ve.useDebugValue(n),n}const jD=e=>{const t=kD(e),n=a=>OD(t,a);return Object.assign(n,t),n},Qm=e=>jD;function W1(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var s;const c=f=>f===null?null:JSON.parse(f,void 0),u=(s=n.getItem(o))!=null?s:null;return u instanceof Promise?u.then(c):c(u)},setItem:(o,s)=>n.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>n.removeItem(o)}}const em=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(a){return em(a)(n)},catch(a){return this}}}catch(n){return{then(a){return this},catch(a){return em(a)(n)}}}},LD=(e,t)=>(n,a,o)=>{let s={storage:W1(()=>localStorage),partialize:E=>E,version:0,merge:(E,_)=>({..._,...E}),...t},c=!1;const u=new Set,f=new Set;let h=s.storage;if(!h)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...E)},a,o);const m=()=>{const E=s.partialize({...a()});return h.setItem(s.name,{state:E,version:s.version})},g=o.setState;o.setState=(E,_)=>{g(E,_),m()};const y=e((...E)=>{n(...E),m()},a,o);o.getInitialState=()=>y;let b;const S=()=>{var E,_;if(!h)return;c=!1,u.forEach(C=>{var A;return C((A=a())!=null?A:y)});const N=((_=s.onRehydrateStorage)==null?void 0:_.call(s,(E=a())!=null?E:y))||void 0;return em(h.getItem.bind(h))(s.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==s.version){if(s.migrate){const A=s.migrate(C.state,C.version);return A instanceof Promise?A.then(k=>[!0,k]):[!0,A]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var A;const[k,D]=C;if(b=s.merge(D,(A=a())!=null?A:y),n(b,!0),k)return m()}).then(()=>{N==null||N(b,void 0),b=a(),c=!0,f.forEach(C=>C(b))}).catch(C=>{N==null||N(void 0,C)})};return o.persist={setOptions:E=>{s={...s,...E},E.storage&&(h=E.storage)},clearStorage:()=>{h==null||h.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>S(),hasHydrated:()=>c,onHydrate:E=>(u.add(E),()=>{u.delete(E)}),onFinishHydration:E=>(f.add(E),()=>{f.delete(E)})},s.skipHydration||S(),b||y},zD=LD;function X1(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=X1(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function K1(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=X1(e))&&(a&&(a+=" "),a+=t);return a}const Jm="-",MD=e=>{const t=GD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{const u=c.split(Jm);return u[0]===""&&u.length!==1&&u.shift(),Z1(u,t)||PD(c)},getConflictingClassGroupIds:(c,u)=>{const f=n[c]||[];return u&&a[c]?[...f,...a[c]]:f}}},Z1=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),o=a?Z1(e.slice(1),a):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Jm);return(c=t.validators.find(({validator:u})=>u(s)))==null?void 0:c.classGroupId},n0=/^\[(.+)\]$/,PD=e=>{if(n0.test(e)){const t=n0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},GD=e=>{const{theme:t,classGroups:n}=e,a={nextPart:new Map,validators:[]};for(const o in n)tm(n[o],a,o,t);return a},tm=(e,t,n,a)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:r0(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(FD(o)){tm(o(a),t,n,a);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,c])=>{tm(c,r0(t,s),n,a)})})},r0=(e,t)=>{let n=e;return t.split(Jm).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},FD=e=>e.isThemeGetter,UD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,a=new Map;const o=(s,c)=>{n.set(s,c),t++,t>e&&(t=0,a=n,n=new Map)};return{get(s){let c=n.get(s);if(c!==void 0)return c;if((c=a.get(s))!==void 0)return o(s,c),c},set(s,c){n.has(s)?n.set(s,c):o(s,c)}}},nm="!",rm=":",BD=rm.length,ID=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const s=[];let c=0,u=0,f=0,h;for(let S=0;S<o.length;S++){let E=o[S];if(c===0&&u===0){if(E===rm){s.push(o.slice(f,S)),f=S+BD;continue}if(E==="/"){h=S;continue}}E==="["?c++:E==="]"?c--:E==="("?u++:E===")"&&u--}const m=s.length===0?o:o.substring(f),g=HD(m),y=g!==m,b=h&&h>f?h-f:void 0;return{modifiers:s,hasImportantModifier:y,baseClassName:g,maybePostfixModifierPosition:b}};if(t){const o=t+rm,s=a;a=c=>c.startsWith(o)?s(c.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},HD=e=>e.endsWith(nm)?e.substring(0,e.length-1):e.startsWith(nm)?e.substring(1):e,$D=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const o=[];let s=[];return a.forEach(c=>{c[0]==="["||t[c]?(o.push(...s.sort(),c),s=[]):s.push(c)}),o.push(...s.sort()),o}},VD=e=>({cache:UD(e.cacheSize),parseClassName:ID(e),sortModifiers:$D(e),...MD(e)}),qD=/\s+/,YD=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s}=t,c=[],u=e.trim().split(qD);let f="";for(let h=u.length-1;h>=0;h-=1){const m=u[h],{isExternal:g,modifiers:y,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:E}=n(m);if(g){f=m+(f.length>0?" "+f:f);continue}let _=!!E,N=a(_?S.substring(0,E):S);if(!N){if(!_){f=m+(f.length>0?" "+f:f);continue}if(N=a(S),!N){f=m+(f.length>0?" "+f:f);continue}_=!1}const C=s(y).join(":"),A=b?C+nm:C,k=A+N;if(c.includes(k))continue;c.push(k);const D=o(N,_);for(let M=0;M<D.length;++M){const R=D[M];c.push(A+R)}f=m+(f.length>0?" "+f:f)}return f};function WD(){let e=0,t,n,a="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Q1(t))&&(a&&(a+=" "),a+=n);return a}const Q1=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Q1(e[a]))&&(n&&(n+=" "),n+=t);return n};function XD(e,...t){let n,a,o,s=c;function c(f){const h=t.reduce((m,g)=>g(m),e());return n=VD(h),a=n.cache.get,o=n.cache.set,s=u,u(f)}function u(f){const h=a(f);if(h)return h;const m=YD(f,n);return o(f,m),m}return function(){return s(WD.apply(null,arguments))}}const Ht=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},J1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,KD=/^\d+\/\d+$/,ZD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,JD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ek=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yo=e=>KD.test(e),et=e=>!!e&&!Number.isNaN(Number(e)),gi=e=>!!e&&Number.isInteger(Number(e)),a0=e=>e.endsWith("%")&&et(e.slice(0,-1)),Oa=e=>ZD.test(e),nk=()=>!0,rk=e=>QD.test(e)&&!JD.test(e),eg=()=>!1,ak=e=>ek.test(e),ik=e=>tk.test(e),ok=e=>!ke(e)&&!Ne(e),sk=e=>Fo(e,rE,eg),ke=e=>J1.test(e),vi=e=>Fo(e,aE,rk),Ih=e=>Fo(e,yk,et),lk=e=>Fo(e,tE,eg),ck=e=>Fo(e,nE,ik),uk=e=>Fo(e,eg,ak),Ne=e=>eE.test(e),Uc=e=>Uo(e,aE),dk=e=>Uo(e,bk),fk=e=>Uo(e,tE),hk=e=>Uo(e,rE),pk=e=>Uo(e,nE),mk=e=>Uo(e,xk,!0),Fo=(e,t,n)=>{const a=J1.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Uo=(e,t,n=!1)=>{const a=eE.exec(e);return a?a[1]?t(a[1]):n:!1},tE=e=>e==="position",gk=new Set(["image","url"]),nE=e=>gk.has(e),vk=new Set(["length","size","percentage"]),rE=e=>vk.has(e),aE=e=>e==="length",yk=e=>e==="number",bk=e=>e==="family-name",xk=e=>e==="shadow",wk=()=>{const e=Ht("color"),t=Ht("font"),n=Ht("text"),a=Ht("font-weight"),o=Ht("tracking"),s=Ht("leading"),c=Ht("breakpoint"),u=Ht("container"),f=Ht("spacing"),h=Ht("radius"),m=Ht("shadow"),g=Ht("inset-shadow"),y=Ht("drop-shadow"),b=Ht("blur"),S=Ht("perspective"),E=Ht("aspect"),_=Ht("ease"),N=Ht("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],M=()=>[yo,"px","full","auto",Ne,ke,f],R=()=>[gi,"none","subgrid",Ne,ke],U=()=>["auto",{span:["full",gi,Ne,ke]},Ne,ke],L=()=>[gi,"auto",Ne,ke],I=()=>["auto","min","max","fr",Ne,ke],q=()=>[Ne,ke,f],Y=()=>["start","end","center","between","around","evenly","stretch","baseline"],B=()=>["start","end","center","stretch"],X=()=>[Ne,ke,f],ne=()=>["px",...X()],F=()=>["px","auto",...X()],z=()=>[yo,"auto","px","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",Ne,ke,f],j=()=>[e,Ne,ke],K=()=>[a0,vi],G=()=>["","none","full",h,Ne,ke],H=()=>["",et,Uc,vi],O=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["","none",b,Ne,ke],re=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ne,ke],de=()=>["none",et,Ne,ke],ie=()=>["none",et,Ne,ke],oe=()=>[et,Ne,ke],Ce=()=>[yo,"full","px",Ne,ke,f];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oa],breakpoint:[Oa],color:[nk],container:[Oa],"drop-shadow":[Oa],ease:["in","out","in-out"],font:[ok],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oa],shadow:[Oa],spacing:[et],text:[Oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yo,ke,Ne,E]}],container:["container"],columns:[{columns:[et,ke,Ne,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...A(),ke,Ne]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[gi,"auto",Ne,ke]}],basis:[{basis:[yo,"full","auto",Ne,ke,u,f]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,yo,"auto","initial","none",ke]}],grow:[{grow:["",et,Ne,ke]}],shrink:[{shrink:["",et,Ne,ke]}],order:[{order:[gi,"first","last","none",Ne,ke]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:q()}],"gap-x":[{"gap-x":q()}],"gap-y":[{"gap-y":q()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...B(),"baseline"]}],"align-self":[{self:["auto",...B(),"baseline"]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:ne()}],px:[{px:ne()}],py:[{py:ne()}],ps:[{ps:ne()}],pe:[{pe:ne()}],pt:[{pt:ne()}],pr:[{pr:ne()}],pb:[{pb:ne()}],pl:[{pl:ne()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":X()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":X()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[u,"screen",...z()]}],"min-w":[{"min-w":[u,"screen","none",...z()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...z()]}],h:[{h:["screen",...z()]}],"min-h":[{"min-h":["screen","none",...z()]}],"max-h":[{"max-h":["screen",...z()]}],"font-size":[{text:["base",n,Uc,vi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ne,Ih]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",a0,ke]}],"font-family":[{font:[dk,ke,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ne,ke]}],"line-clamp":[{"line-clamp":[et,"none",Ne,Ih]}],leading:[{leading:[Ne,ke,s,f]}],"list-image":[{"list-image":["none",Ne,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",Ne,vi]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[et,"auto",Ne,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:["px",...X()]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ne,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ne,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),fk,lk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",hk,sk]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gi,Ne,ke],radial:["",Ne,ke],conic:[gi,Ne,ke]},pk,ck]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...O(),"hidden","none"]}],"divide-style":[{divide:[...O(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...O(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,Ne,ke]}],"outline-w":[{outline:["",et,Uc,vi]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",m,mk,uk]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",Ne,ke,g]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[et,vi]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":j()}],opacity:[{opacity:[et,Ne,ke]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none",Ne,ke]}],blur:[{blur:W()}],brightness:[{brightness:[et,Ne,ke]}],contrast:[{contrast:[et,Ne,ke]}],"drop-shadow":[{"drop-shadow":["","none",y,Ne,ke]}],grayscale:[{grayscale:["",et,Ne,ke]}],"hue-rotate":[{"hue-rotate":[et,Ne,ke]}],invert:[{invert:["",et,Ne,ke]}],saturate:[{saturate:[et,Ne,ke]}],sepia:[{sepia:["",et,Ne,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,ke]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[et,Ne,ke]}],"backdrop-contrast":[{"backdrop-contrast":[et,Ne,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,Ne,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,Ne,ke]}],"backdrop-invert":[{"backdrop-invert":["",et,Ne,ke]}],"backdrop-opacity":[{"backdrop-opacity":[et,Ne,ke]}],"backdrop-saturate":[{"backdrop-saturate":[et,Ne,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",et,Ne,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":X()}],"border-spacing-x":[{"border-spacing-x":X()}],"border-spacing-y":[{"border-spacing-y":X()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ne,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",Ne,ke]}],ease:[{ease:["linear","initial",_,Ne,ke]}],delay:[{delay:[et,Ne,ke]}],animate:[{animate:["none",N,Ne,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ne,ke]}],"perspective-origin":[{"perspective-origin":re()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[Ne,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:re()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ce()}],"translate-x":[{"translate-x":Ce()}],"translate-y":[{"translate-y":Ce()}],"translate-z":[{"translate-z":Ce()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ne,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":X()}],"scroll-mx":[{"scroll-mx":X()}],"scroll-my":[{"scroll-my":X()}],"scroll-ms":[{"scroll-ms":X()}],"scroll-me":[{"scroll-me":X()}],"scroll-mt":[{"scroll-mt":X()}],"scroll-mr":[{"scroll-mr":X()}],"scroll-mb":[{"scroll-mb":X()}],"scroll-ml":[{"scroll-ml":X()}],"scroll-p":[{"scroll-p":X()}],"scroll-px":[{"scroll-px":X()}],"scroll-py":[{"scroll-py":X()}],"scroll-ps":[{"scroll-ps":X()}],"scroll-pe":[{"scroll-pe":X()}],"scroll-pt":[{"scroll-pt":X()}],"scroll-pr":[{"scroll-pr":X()}],"scroll-pb":[{"scroll-pb":X()}],"scroll-pl":[{"scroll-pl":X()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ne,ke]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[et,Uc,vi,Ih]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},Ek=XD(wk);function Oe(...e){return Ek(K1(e))}function Sk(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Sr(e){return e instanceof Error?e.message:`${e}`}const tg=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(a=>a[n]);return t},iE="",_r="ghost",_k="#B2EBF2",Ck="#000",Tk="#E2E2E2",Rk="#EEEEEE",Ak="#F57F17",Dk="#969696",kk="#F57F17",i0="#B2EBF2",Hh=20,o0=4,Nk=20,Ok=15,s0="*",jk={"text/plain":[".txt",".md"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},l0={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},Lk=Qm()(zD(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,queryLabel:s0,enableHealthCheck:!0,apiKey:null,currentTab:"documents",retrievalHistory:[],querySettings:{mode:"global",response_type:"Multiple Paragraphs",top_k:10,max_token_for_text_unit:4e3,max_token_for_global_context:4e3,max_token_for_local_context:4e3,only_need_context:!1,only_need_prompt:!1,stream:!0,history_turns:3,hl_keywords:[],ll_keywords:[]},setTheme:t=>e({theme:t}),setQueryLabel:t=>e({queryLabel:t}),setEnableHealthCheck:t=>e({enableHealthCheck:t}),setApiKey:t=>e({apiKey:t}),setCurrentTab:t=>e({currentTab:t}),setRetrievalHistory:t=>e({retrievalHistory:t}),updateQuerySettings:t=>e(n=>({querySettings:{...n.querySettings,...t}}))}),{name:"settings-storage",storage:W1(()=>localStorage),version:6,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=s0),t<4&&(e.showPropertyPanel=!0,e.showNodeSearchBar=!0,e.showNodeLabel=!0,e.enableHealthCheck=!0,e.apiKey=null),t<5&&(e.currentTab="documents"),t<6&&(e.querySettings={mode:"global",response_type:"Multiple Paragraphs",top_k:10,max_token_for_text_unit:4e3,max_token_for_global_context:4e3,max_token_for_local_context:4e3,only_need_context:!1,only_need_prompt:!1,stream:!0,history_turns:3,hl_keywords:[],ll_keywords:[]},e.retrievalHistory=[]),e)})),Ye=tg(Lk),zk={theme:"system",setTheme:()=>null},oE=w.createContext(zk);function Mk({children:e,...t}){const[n,a]=w.useState(Ye.getState().theme);w.useEffect(()=>{const s=window.document.documentElement;if(s.classList.remove("light","dark"),n==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";s.classList.add(c),a(c);return}s.classList.add(n)},[n]);const o={theme:n,setTheme:s=>{Ye.getState().setTheme(s),a(s)}};return x.jsx(oE.Provider,{...t,value:o,children:e})}const c0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,u0=K1,sE=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return u0(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,c=Object.keys(o).map(h=>{const m=n==null?void 0:n[h],g=s==null?void 0:s[h];if(m===null)return null;const y=c0(m)||c0(g);return o[h][y]}),u=n&&Object.entries(n).reduce((h,m)=>{let[g,y]=m;return y===void 0||(h[g]=y),h},{}),f=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,m)=>{let{class:g,className:y,...b}=m;return Object.entries(b).every(S=>{let[E,_]=S;return Array.isArray(_)?_.includes({...s,...u}[E]):{...s,...u}[E]===_})?[...h,g,y]:h},[]);return u0(e,c,f,n==null?void 0:n.class,n==null?void 0:n.className)},Pk=sE("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),lE=w.forwardRef(({className:e,variant:t,...n},a)=>x.jsx("div",{ref:a,role:"alert",className:Oe(Pk({variant:t}),e),...n}));lE.displayName="Alert";const cE=w.forwardRef(({className:e,...t},n)=>x.jsx("h5",{ref:n,className:Oe("mb-1 leading-none font-medium tracking-tight",e),...t}));cE.displayName="AlertTitle";const uE=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("text-sm [&_p]:leading-relaxed",e),...t}));uE.displayName="AlertDescription";function dE(e,t){return function(){return e.apply(t,arguments)}}const{toString:Gk}=Object.prototype,{getPrototypeOf:ng}=Object,Wu=(e=>t=>{const n=Gk.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),dr=e=>(e=e.toLowerCase(),t=>Wu(t)===e),Xu=e=>t=>typeof t===e,{isArray:Bo}=Array,ll=Xu("undefined");function Fk(e){return e!==null&&!ll(e)&&e.constructor!==null&&!ll(e.constructor)&&jn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fE=dr("ArrayBuffer");function Uk(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fE(e.buffer),t}const Bk=Xu("string"),jn=Xu("function"),hE=Xu("number"),Ku=e=>e!==null&&typeof e=="object",Ik=e=>e===!0||e===!1,cu=e=>{if(Wu(e)!=="object")return!1;const t=ng(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Hk=dr("Date"),$k=dr("File"),Vk=dr("Blob"),qk=dr("FileList"),Yk=e=>Ku(e)&&jn(e.pipe),Wk=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||jn(e.append)&&((t=Wu(e))==="formdata"||t==="object"&&jn(e.toString)&&e.toString()==="[object FormData]"))},Xk=dr("URLSearchParams"),[Kk,Zk,Qk,Jk]=["ReadableStream","Request","Response","Headers"].map(dr),eN=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yl(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let a,o;if(typeof e!="object"&&(e=[e]),Bo(e))for(a=0,o=e.length;a<o;a++)t.call(null,e[a],a,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),c=s.length;let u;for(a=0;a<c;a++)u=s[a],t.call(null,e[u],u,e)}}function pE(e,t){t=t.toLowerCase();const n=Object.keys(e);let a=n.length,o;for(;a-- >0;)if(o=n[a],t===o.toLowerCase())return o;return null}const Si=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,mE=e=>!ll(e)&&e!==Si;function am(){const{caseless:e}=mE(this)&&this||{},t={},n=(a,o)=>{const s=e&&pE(t,o)||o;cu(t[s])&&cu(a)?t[s]=am(t[s],a):cu(a)?t[s]=am({},a):Bo(a)?t[s]=a.slice():t[s]=a};for(let a=0,o=arguments.length;a<o;a++)arguments[a]&&yl(arguments[a],n);return t}const tN=(e,t,n,{allOwnKeys:a}={})=>(yl(t,(o,s)=>{n&&jn(o)?e[s]=dE(o,n):e[s]=o},{allOwnKeys:a}),e),nN=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),rN=(e,t,n,a)=>{e.prototype=Object.create(t.prototype,a),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},aN=(e,t,n,a)=>{let o,s,c;const u={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)c=o[s],(!a||a(c,e,t))&&!u[c]&&(t[c]=e[c],u[c]=!0);e=n!==!1&&ng(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},iN=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const a=e.indexOf(t,n);return a!==-1&&a===n},oN=e=>{if(!e)return null;if(Bo(e))return e;let t=e.length;if(!hE(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},sN=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ng(Uint8Array)),lN=(e,t)=>{const a=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=a.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},cN=(e,t)=>{let n;const a=[];for(;(n=e.exec(t))!==null;)a.push(n);return a},uN=dr("HTMLFormElement"),dN=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,o){return a.toUpperCase()+o}),d0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),fN=dr("RegExp"),gE=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),a={};yl(n,(o,s)=>{let c;(c=t(o,s,e))!==!1&&(a[s]=c||o)}),Object.defineProperties(e,a)},hN=e=>{gE(e,(t,n)=>{if(jn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const a=e[n];if(jn(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},pN=(e,t)=>{const n={},a=o=>{o.forEach(s=>{n[s]=!0})};return Bo(e)?a(e):a(String(e).split(t)),n},mN=()=>{},gN=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,$h="abcdefghijklmnopqrstuvwxyz",f0="0123456789",vE={DIGIT:f0,ALPHA:$h,ALPHA_DIGIT:$h+$h.toUpperCase()+f0},vN=(e=16,t=vE.ALPHA_DIGIT)=>{let n="";const{length:a}=t;for(;e--;)n+=t[Math.random()*a|0];return n};function yN(e){return!!(e&&jn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const bN=e=>{const t=new Array(10),n=(a,o)=>{if(Ku(a)){if(t.indexOf(a)>=0)return;if(!("toJSON"in a)){t[o]=a;const s=Bo(a)?[]:{};return yl(a,(c,u)=>{const f=n(c,o+1);!ll(f)&&(s[u]=f)}),t[o]=void 0,s}}return a};return n(e,0)},xN=dr("AsyncFunction"),wN=e=>e&&(Ku(e)||jn(e))&&jn(e.then)&&jn(e.catch),yE=((e,t)=>e?setImmediate:t?((n,a)=>(Si.addEventListener("message",({source:o,data:s})=>{o===Si&&s===n&&a.length&&a.shift()()},!1),o=>{a.push(o),Si.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",jn(Si.postMessage)),EN=typeof queueMicrotask<"u"?queueMicrotask.bind(Si):typeof process<"u"&&process.nextTick||yE,ce={isArray:Bo,isArrayBuffer:fE,isBuffer:Fk,isFormData:Wk,isArrayBufferView:Uk,isString:Bk,isNumber:hE,isBoolean:Ik,isObject:Ku,isPlainObject:cu,isReadableStream:Kk,isRequest:Zk,isResponse:Qk,isHeaders:Jk,isUndefined:ll,isDate:Hk,isFile:$k,isBlob:Vk,isRegExp:fN,isFunction:jn,isStream:Yk,isURLSearchParams:Xk,isTypedArray:sN,isFileList:qk,forEach:yl,merge:am,extend:tN,trim:eN,stripBOM:nN,inherits:rN,toFlatObject:aN,kindOf:Wu,kindOfTest:dr,endsWith:iN,toArray:oN,forEachEntry:lN,matchAll:cN,isHTMLForm:uN,hasOwnProperty:d0,hasOwnProp:d0,reduceDescriptors:gE,freezeMethods:hN,toObjectSet:pN,toCamelCase:dN,noop:mN,toFiniteNumber:gN,findKey:pE,global:Si,isContextDefined:mE,ALPHABET:vE,generateString:vN,isSpecCompliantForm:yN,toJSONObject:bN,isAsyncFn:xN,isThenable:wN,setImmediate:yE,asap:EN};function Xe(e,t,n,a,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),a&&(this.request=a),o&&(this.response=o,this.status=o.status?o.status:null)}ce.inherits(Xe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ce.toJSONObject(this.config),code:this.code,status:this.status}}});const bE=Xe.prototype,xE={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{xE[e]={value:e}});Object.defineProperties(Xe,xE);Object.defineProperty(bE,"isAxiosError",{value:!0});Xe.from=(e,t,n,a,o,s)=>{const c=Object.create(bE);return ce.toFlatObject(e,c,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),Xe.call(c,e.message,t,n,a,o),c.cause=e,c.name=e.name,s&&Object.assign(c,s),c};const SN=null;function im(e){return ce.isPlainObject(e)||ce.isArray(e)}function wE(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function h0(e,t,n){return e?e.concat(t).map(function(o,s){return o=wE(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function _N(e){return ce.isArray(e)&&!e.some(im)}const CN=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function Zu(e,t,n){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,_){return!ce.isUndefined(_[E])});const a=n.metaTokens,o=n.visitor||m,s=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(o))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(ce.isDate(S))return S.toISOString();if(!f&&ce.isBlob(S))throw new Xe("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(S)||ce.isTypedArray(S)?f&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function m(S,E,_){let N=S;if(S&&!_&&typeof S=="object"){if(ce.endsWith(E,"{}"))E=a?E:E.slice(0,-2),S=JSON.stringify(S);else if(ce.isArray(S)&&_N(S)||(ce.isFileList(S)||ce.endsWith(E,"[]"))&&(N=ce.toArray(S)))return E=wE(E),N.forEach(function(A,k){!(ce.isUndefined(A)||A===null)&&t.append(c===!0?h0([E],k,s):c===null?E:E+"[]",h(A))}),!1}return im(S)?!0:(t.append(h0(_,E,s),h(S)),!1)}const g=[],y=Object.assign(CN,{defaultVisitor:m,convertValue:h,isVisitable:im});function b(S,E){if(!ce.isUndefined(S)){if(g.indexOf(S)!==-1)throw Error("Circular reference detected in "+E.join("."));g.push(S),ce.forEach(S,function(N,C){(!(ce.isUndefined(N)||N===null)&&o.call(t,N,ce.isString(C)?C.trim():C,E,y))===!0&&b(N,E?E.concat(C):[C])}),g.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return b(e),t}function p0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(a){return t[a]})}function rg(e,t){this._pairs=[],e&&Zu(e,this,t)}const EE=rg.prototype;EE.append=function(t,n){this._pairs.push([t,n])};EE.toString=function(t){const n=t?function(a){return t.call(this,a,p0)}:p0;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function TN(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function SE(e,t,n){if(!t)return e;const a=n&&n.encode||TN;ce.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=ce.isURLSearchParams(t)?t.toString():new rg(t,n).toString(a),s){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class m0{constructor(){this.handlers=[]}use(t,n,a){return this.handlers.push({fulfilled:t,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ce.forEach(this.handlers,function(a){a!==null&&t(a)})}}const _E={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},RN=typeof URLSearchParams<"u"?URLSearchParams:rg,AN=typeof FormData<"u"?FormData:null,DN=typeof Blob<"u"?Blob:null,kN={isBrowser:!0,classes:{URLSearchParams:RN,FormData:AN,Blob:DN},protocols:["http","https","file","blob","url","data"]},ag=typeof window<"u"&&typeof document<"u",om=typeof navigator=="object"&&navigator||void 0,NN=ag&&(!om||["ReactNative","NativeScript","NS"].indexOf(om.product)<0),ON=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",jN=ag&&window.location.href||"http://localhost",LN=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ag,hasStandardBrowserEnv:NN,hasStandardBrowserWebWorkerEnv:ON,navigator:om,origin:jN},Symbol.toStringTag,{value:"Module"})),rn={...LN,...kN};function zN(e,t){return Zu(e,new rn.classes.URLSearchParams,Object.assign({visitor:function(n,a,o,s){return rn.isNode&&ce.isBuffer(n)?(this.append(a,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function MN(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function PN(e){const t={},n=Object.keys(e);let a;const o=n.length;let s;for(a=0;a<o;a++)s=n[a],t[s]=e[s];return t}function CE(e){function t(n,a,o,s){let c=n[s++];if(c==="__proto__")return!0;const u=Number.isFinite(+c),f=s>=n.length;return c=!c&&ce.isArray(o)?o.length:c,f?(ce.hasOwnProp(o,c)?o[c]=[o[c],a]:o[c]=a,!u):((!o[c]||!ce.isObject(o[c]))&&(o[c]=[]),t(n,a,o[c],s)&&ce.isArray(o[c])&&(o[c]=PN(o[c])),!u)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(a,o)=>{t(MN(a),o,n,0)}),n}return null}function GN(e,t,n){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(e)}const bl={transitional:_E,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const a=n.getContentType()||"",o=a.indexOf("application/json")>-1,s=ce.isObject(t);if(s&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return o?JSON.stringify(CE(t)):t;if(ce.isArrayBuffer(t)||ce.isBuffer(t)||ce.isStream(t)||ce.isFile(t)||ce.isBlob(t)||ce.isReadableStream(t))return t;if(ce.isArrayBufferView(t))return t.buffer;if(ce.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(s){if(a.indexOf("application/x-www-form-urlencoded")>-1)return zN(t,this.formSerializer).toString();if((u=ce.isFileList(t))||a.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Zu(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),GN(t)):t}],transformResponse:[function(t){const n=this.transitional||bl.transitional,a=n&&n.forcedJSONParsing,o=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(a&&!this.responseType||o)){const c=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(u){if(c)throw u.name==="SyntaxError"?Xe.from(u,Xe.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rn.classes.FormData,Blob:rn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{bl.headers[e]={}});const FN=ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),UN=e=>{const t={};let n,a,o;return e&&e.split(`
`).forEach(function(c){o=c.indexOf(":"),n=c.substring(0,o).trim().toLowerCase(),a=c.substring(o+1).trim(),!(!n||t[n]&&FN[n])&&(n==="set-cookie"?t[n]?t[n].push(a):t[n]=[a]:t[n]=t[n]?t[n]+", "+a:a)}),t},g0=Symbol("internals");function Ws(e){return e&&String(e).trim().toLowerCase()}function uu(e){return e===!1||e==null?e:ce.isArray(e)?e.map(uu):String(e)}function BN(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(e);)t[a[1]]=a[2];return t}const IN=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Vh(e,t,n,a,o){if(ce.isFunction(a))return a.call(this,t,n);if(o&&(t=n),!!ce.isString(t)){if(ce.isString(a))return t.indexOf(a)!==-1;if(ce.isRegExp(a))return a.test(t)}}function HN(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,a)=>n.toUpperCase()+a)}function $N(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+n,{value:function(o,s,c){return this[a].call(this,t,o,s,c)},configurable:!0})})}let wn=class{constructor(t){t&&this.set(t)}set(t,n,a){const o=this;function s(u,f,h){const m=Ws(f);if(!m)throw new Error("header name must be a non-empty string");const g=ce.findKey(o,m);(!g||o[g]===void 0||h===!0||h===void 0&&o[g]!==!1)&&(o[g||f]=uu(u))}const c=(u,f)=>ce.forEach(u,(h,m)=>s(h,m,f));if(ce.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(ce.isString(t)&&(t=t.trim())&&!IN(t))c(UN(t),n);else if(ce.isHeaders(t))for(const[u,f]of t.entries())s(f,u,a);else t!=null&&s(n,t,a);return this}get(t,n){if(t=Ws(t),t){const a=ce.findKey(this,t);if(a){const o=this[a];if(!n)return o;if(n===!0)return BN(o);if(ce.isFunction(n))return n.call(this,o,a);if(ce.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ws(t),t){const a=ce.findKey(this,t);return!!(a&&this[a]!==void 0&&(!n||Vh(this,this[a],a,n)))}return!1}delete(t,n){const a=this;let o=!1;function s(c){if(c=Ws(c),c){const u=ce.findKey(a,c);u&&(!n||Vh(a,a[u],u,n))&&(delete a[u],o=!0)}}return ce.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let a=n.length,o=!1;for(;a--;){const s=n[a];(!t||Vh(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,a={};return ce.forEach(this,(o,s)=>{const c=ce.findKey(a,s);if(c){n[c]=uu(o),delete n[s];return}const u=t?HN(s):String(s).trim();u!==s&&delete n[s],n[u]=uu(o),a[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(a,o)=>{a!=null&&a!==!1&&(n[o]=t&&ce.isArray(a)?a.join(", "):a)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const a=new this(t);return n.forEach(o=>a.set(o)),a}static accessor(t){const a=(this[g0]=this[g0]={accessors:{}}).accessors,o=this.prototype;function s(c){const u=Ws(c);a[u]||($N(o,c),a[u]=!0)}return ce.isArray(t)?t.forEach(s):s(t),this}};wn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(wn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(a){this[n]=a}}});ce.freezeMethods(wn);function qh(e,t){const n=this||bl,a=t||n,o=wn.from(a.headers);let s=a.data;return ce.forEach(e,function(u){s=u.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function TE(e){return!!(e&&e.__CANCEL__)}function Io(e,t,n){Xe.call(this,e??"canceled",Xe.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(Io,Xe,{__CANCEL__:!0});function RE(e,t,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?e(n):t(new Xe("Request failed with status code "+n.status,[Xe.ERR_BAD_REQUEST,Xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function VN(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function qN(e,t){e=e||10;const n=new Array(e),a=new Array(e);let o=0,s=0,c;return t=t!==void 0?t:1e3,function(f){const h=Date.now(),m=a[s];c||(c=h),n[o]=f,a[o]=h;let g=s,y=0;for(;g!==o;)y+=n[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),h-c<t)return;const b=m&&h-m;return b?Math.round(y*1e3/b):void 0}}function YN(e,t){let n=0,a=1e3/t,o,s;const c=(h,m=Date.now())=>{n=m,o=null,s&&(clearTimeout(s),s=null),e.apply(null,h)};return[(...h)=>{const m=Date.now(),g=m-n;g>=a?c(h,m):(o=h,s||(s=setTimeout(()=>{s=null,c(o)},a-g)))},()=>o&&c(o)]}const Cu=(e,t,n=3)=>{let a=0;const o=qN(50,250);return YN(s=>{const c=s.loaded,u=s.lengthComputable?s.total:void 0,f=c-a,h=o(f),m=c<=u;a=c;const g={loaded:c,total:u,progress:u?c/u:void 0,bytes:f,rate:h||void 0,estimated:h&&u&&m?(u-c)/h:void 0,event:s,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},v0=(e,t)=>{const n=e!=null;return[a=>t[0]({lengthComputable:n,total:e,loaded:a}),t[1]]},y0=e=>(...t)=>ce.asap(()=>e(...t)),WN=rn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,rn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(rn.origin),rn.navigator&&/(msie|trident)/i.test(rn.navigator.userAgent)):()=>!0,XN=rn.hasStandardBrowserEnv?{write(e,t,n,a,o,s){const c=[e+"="+encodeURIComponent(t)];ce.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),ce.isString(a)&&c.push("path="+a),ce.isString(o)&&c.push("domain="+o),s===!0&&c.push("secure"),document.cookie=c.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function KN(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ZN(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function AE(e,t){return e&&!KN(t)?ZN(e,t):t}const b0=e=>e instanceof wn?{...e}:e;function Ci(e,t){t=t||{};const n={};function a(h,m,g,y){return ce.isPlainObject(h)&&ce.isPlainObject(m)?ce.merge.call({caseless:y},h,m):ce.isPlainObject(m)?ce.merge({},m):ce.isArray(m)?m.slice():m}function o(h,m,g,y){if(ce.isUndefined(m)){if(!ce.isUndefined(h))return a(void 0,h,g,y)}else return a(h,m,g,y)}function s(h,m){if(!ce.isUndefined(m))return a(void 0,m)}function c(h,m){if(ce.isUndefined(m)){if(!ce.isUndefined(h))return a(void 0,h)}else return a(void 0,m)}function u(h,m,g){if(g in t)return a(h,m);if(g in e)return a(void 0,h)}const f={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:u,headers:(h,m,g)=>o(b0(h),b0(m),g,!0)};return ce.forEach(Object.keys(Object.assign({},e,t)),function(m){const g=f[m]||o,y=g(e[m],t[m],m);ce.isUndefined(y)&&g!==u||(n[m]=y)}),n}const DE=e=>{const t=Ci({},e);let{data:n,withXSRFToken:a,xsrfHeaderName:o,xsrfCookieName:s,headers:c,auth:u}=t;t.headers=c=wn.from(c),t.url=SE(AE(t.baseURL,t.url),e.params,e.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(ce.isFormData(n)){if(rn.hasStandardBrowserEnv||rn.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((f=c.getContentType())!==!1){const[h,...m]=f?f.split(";").map(g=>g.trim()).filter(Boolean):[];c.setContentType([h||"multipart/form-data",...m].join("; "))}}if(rn.hasStandardBrowserEnv&&(a&&ce.isFunction(a)&&(a=a(t)),a||a!==!1&&WN(t.url))){const h=o&&s&&XN.read(s);h&&c.set(o,h)}return t},QN=typeof XMLHttpRequest<"u",JN=QN&&function(e){return new Promise(function(n,a){const o=DE(e);let s=o.data;const c=wn.from(o.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:h}=o,m,g,y,b,S;function E(){b&&b(),S&&S(),o.cancelToken&&o.cancelToken.unsubscribe(m),o.signal&&o.signal.removeEventListener("abort",m)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function N(){if(!_)return;const A=wn.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),D={data:!u||u==="text"||u==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:A,config:e,request:_};RE(function(R){n(R),E()},function(R){a(R),E()},D),_=null}"onloadend"in _?_.onloadend=N:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(N)},_.onabort=function(){_&&(a(new Xe("Request aborted",Xe.ECONNABORTED,e,_)),_=null)},_.onerror=function(){a(new Xe("Network Error",Xe.ERR_NETWORK,e,_)),_=null},_.ontimeout=function(){let k=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const D=o.transitional||_E;o.timeoutErrorMessage&&(k=o.timeoutErrorMessage),a(new Xe(k,D.clarifyTimeoutError?Xe.ETIMEDOUT:Xe.ECONNABORTED,e,_)),_=null},s===void 0&&c.setContentType(null),"setRequestHeader"in _&&ce.forEach(c.toJSON(),function(k,D){_.setRequestHeader(D,k)}),ce.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),u&&u!=="json"&&(_.responseType=o.responseType),h&&([y,S]=Cu(h,!0),_.addEventListener("progress",y)),f&&_.upload&&([g,b]=Cu(f),_.upload.addEventListener("progress",g),_.upload.addEventListener("loadend",b)),(o.cancelToken||o.signal)&&(m=A=>{_&&(a(!A||A.type?new Io(null,e,_):A),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(m),o.signal&&(o.signal.aborted?m():o.signal.addEventListener("abort",m)));const C=VN(o.url);if(C&&rn.protocols.indexOf(C)===-1){a(new Xe("Unsupported protocol "+C+":",Xe.ERR_BAD_REQUEST,e));return}_.send(s||null)})},eO=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let a=new AbortController,o;const s=function(h){if(!o){o=!0,u();const m=h instanceof Error?h:this.reason;a.abort(m instanceof Xe?m:new Io(m instanceof Error?m.message:m))}};let c=t&&setTimeout(()=>{c=null,s(new Xe(`timeout ${t} of ms exceeded`,Xe.ETIMEDOUT))},t);const u=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(s):h.removeEventListener("abort",s)}),e=null)};e.forEach(h=>h.addEventListener("abort",s));const{signal:f}=a;return f.unsubscribe=()=>ce.asap(u),f}},tO=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let a=0,o;for(;a<n;)o=a+t,yield e.slice(a,o),a=o},nO=async function*(e,t){for await(const n of rO(e))yield*tO(n,t)},rO=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:a}=await t.read();if(n)break;yield a}}finally{await t.cancel()}},x0=(e,t,n,a)=>{const o=nO(e,t);let s=0,c,u=f=>{c||(c=!0,a&&a(f))};return new ReadableStream({async pull(f){try{const{done:h,value:m}=await o.next();if(h){u(),f.close();return}let g=m.byteLength;if(n){let y=s+=g;n(y)}f.enqueue(new Uint8Array(m))}catch(h){throw u(h),h}},cancel(f){return u(f),o.return()}},{highWaterMark:2})},Qu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",kE=Qu&&typeof ReadableStream=="function",aO=Qu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),NE=(e,...t)=>{try{return!!e(...t)}catch{return!1}},iO=kE&&NE(()=>{let e=!1;const t=new Request(rn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),w0=64*1024,sm=kE&&NE(()=>ce.isReadableStream(new Response("").body)),Tu={stream:sm&&(e=>e.body)};Qu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Tu[t]&&(Tu[t]=ce.isFunction(e[t])?n=>n[t]():(n,a)=>{throw new Xe(`Response type '${t}' is not supported`,Xe.ERR_NOT_SUPPORT,a)})})})(new Response);const oO=async e=>{if(e==null)return 0;if(ce.isBlob(e))return e.size;if(ce.isSpecCompliantForm(e))return(await new Request(rn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(e)||ce.isArrayBuffer(e))return e.byteLength;if(ce.isURLSearchParams(e)&&(e=e+""),ce.isString(e))return(await aO(e)).byteLength},sO=async(e,t)=>{const n=ce.toFiniteNumber(e.getContentLength());return n??oO(t)},lO=Qu&&(async e=>{let{url:t,method:n,data:a,signal:o,cancelToken:s,timeout:c,onDownloadProgress:u,onUploadProgress:f,responseType:h,headers:m,withCredentials:g="same-origin",fetchOptions:y}=DE(e);h=h?(h+"").toLowerCase():"text";let b=eO([o,s&&s.toAbortSignal()],c),S;const E=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let _;try{if(f&&iO&&n!=="get"&&n!=="head"&&(_=await sO(m,a))!==0){let D=new Request(t,{method:"POST",body:a,duplex:"half"}),M;if(ce.isFormData(a)&&(M=D.headers.get("content-type"))&&m.setContentType(M),D.body){const[R,U]=v0(_,Cu(y0(f)));a=x0(D.body,w0,R,U)}}ce.isString(g)||(g=g?"include":"omit");const N="credentials"in Request.prototype;S=new Request(t,{...y,signal:b,method:n.toUpperCase(),headers:m.normalize().toJSON(),body:a,duplex:"half",credentials:N?g:void 0});let C=await fetch(S);const A=sm&&(h==="stream"||h==="response");if(sm&&(u||A&&E)){const D={};["status","statusText","headers"].forEach(L=>{D[L]=C[L]});const M=ce.toFiniteNumber(C.headers.get("content-length")),[R,U]=u&&v0(M,Cu(y0(u),!0))||[];C=new Response(x0(C.body,w0,R,()=>{U&&U(),E&&E()}),D)}h=h||"text";let k=await Tu[ce.findKey(Tu,h)||"text"](C,e);return!A&&E&&E(),await new Promise((D,M)=>{RE(D,M,{data:k,headers:wn.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:S})})}catch(N){throw E&&E(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new Xe("Network Error",Xe.ERR_NETWORK,e,S),{cause:N.cause||N}):Xe.from(N,N&&N.code,e,S)}}),lm={http:SN,xhr:JN,fetch:lO};ce.forEach(lm,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const E0=e=>`- ${e}`,cO=e=>ce.isFunction(e)||e===null||e===!1,OE={getAdapter:e=>{e=ce.isArray(e)?e:[e];const{length:t}=e;let n,a;const o={};for(let s=0;s<t;s++){n=e[s];let c;if(a=n,!cO(n)&&(a=lm[(c=String(n)).toLowerCase()],a===void 0))throw new Xe(`Unknown adapter '${c}'`);if(a)break;o[c||"#"+s]=a}if(!a){const s=Object.entries(o).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=t?s.length>1?`since :
`+s.map(E0).join(`
`):" "+E0(s[0]):"as no adapter specified";throw new Xe("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return a},adapters:lm};function Yh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Io(null,e)}function S0(e){return Yh(e),e.headers=wn.from(e.headers),e.data=qh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),OE.getAdapter(e.adapter||bl.adapter)(e).then(function(a){return Yh(e),a.data=qh.call(e,e.transformResponse,a),a.headers=wn.from(a.headers),a},function(a){return TE(a)||(Yh(e),a&&a.response&&(a.response.data=qh.call(e,e.transformResponse,a.response),a.response.headers=wn.from(a.response.headers))),Promise.reject(a)})}const jE="1.7.9",Ju={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ju[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const _0={};Ju.transitional=function(t,n,a){function o(s,c){return"[Axios v"+jE+"] Transitional option '"+s+"'"+c+(a?". "+a:"")}return(s,c,u)=>{if(t===!1)throw new Xe(o(c," has been removed"+(n?" in "+n:"")),Xe.ERR_DEPRECATED);return n&&!_0[c]&&(_0[c]=!0,console.warn(o(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,c,u):!0}};Ju.spelling=function(t){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function uO(e,t,n){if(typeof e!="object")throw new Xe("options must be an object",Xe.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let o=a.length;for(;o-- >0;){const s=a[o],c=t[s];if(c){const u=e[s],f=u===void 0||c(u,s,e);if(f!==!0)throw new Xe("option "+s+" must be "+f,Xe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xe("Unknown option "+s,Xe.ERR_BAD_OPTION)}}const du={assertOptions:uO,validators:Ju},br=du.validators;let _i=class{constructor(t){this.defaults=t,this.interceptors={request:new m0,response:new m0}}async request(t,n){try{return await this._request(t,n)}catch(a){if(a instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{a.stack?s&&!String(a.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(a.stack+=`
`+s):a.stack=s}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ci(this.defaults,n);const{transitional:a,paramsSerializer:o,headers:s}=n;a!==void 0&&du.assertOptions(a,{silentJSONParsing:br.transitional(br.boolean),forcedJSONParsing:br.transitional(br.boolean),clarifyTimeoutError:br.transitional(br.boolean)},!1),o!=null&&(ce.isFunction(o)?n.paramsSerializer={serialize:o}:du.assertOptions(o,{encode:br.function,serialize:br.function},!0)),du.assertOptions(n,{baseUrl:br.spelling("baseURL"),withXsrfToken:br.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=s&&ce.merge(s.common,s[n.method]);s&&ce.forEach(["delete","get","head","post","put","patch","common"],S=>{delete s[S]}),n.headers=wn.concat(c,s);const u=[];let f=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(f=f&&E.synchronous,u.unshift(E.fulfilled,E.rejected))});const h=[];this.interceptors.response.forEach(function(E){h.push(E.fulfilled,E.rejected)});let m,g=0,y;if(!f){const S=[S0.bind(this),void 0];for(S.unshift.apply(S,u),S.push.apply(S,h),y=S.length,m=Promise.resolve(n);g<y;)m=m.then(S[g++],S[g++]);return m}y=u.length;let b=n;for(g=0;g<y;){const S=u[g++],E=u[g++];try{b=S(b)}catch(_){E.call(this,_);break}}try{m=S0.call(this,b)}catch(S){return Promise.reject(S)}for(g=0,y=h.length;g<y;)m=m.then(h[g++],h[g++]);return m}getUri(t){t=Ci(this.defaults,t);const n=AE(t.baseURL,t.url);return SE(n,t.params,t.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(t){_i.prototype[t]=function(n,a){return this.request(Ci(a||{},{method:t,url:n,data:(a||{}).data}))}});ce.forEach(["post","put","patch"],function(t){function n(a){return function(s,c,u){return this.request(Ci(u||{},{method:t,headers:a?{"Content-Type":"multipart/form-data"}:{},url:s,data:c}))}}_i.prototype[t]=n(),_i.prototype[t+"Form"]=n(!0)});let dO=class LE{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const a=this;this.promise.then(o=>{if(!a._listeners)return;let s=a._listeners.length;for(;s-- >0;)a._listeners[s](o);a._listeners=null}),this.promise.then=o=>{let s;const c=new Promise(u=>{a.subscribe(u),s=u}).then(o);return c.cancel=function(){a.unsubscribe(s)},c},t(function(s,c,u){a.reason||(a.reason=new Io(s,c,u),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new LE(function(o){t=o}),cancel:t}}};function fO(e){return function(n){return e.apply(null,n)}}function hO(e){return ce.isObject(e)&&e.isAxiosError===!0}const cm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cm).forEach(([e,t])=>{cm[t]=e});function zE(e){const t=new _i(e),n=dE(_i.prototype.request,t);return ce.extend(n,_i.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return zE(Ci(e,o))},n}const kt=zE(bl);kt.Axios=_i;kt.CanceledError=Io;kt.CancelToken=dO;kt.isCancel=TE;kt.VERSION=jE;kt.toFormData=Zu;kt.AxiosError=Xe;kt.Cancel=kt.CanceledError;kt.all=function(t){return Promise.all(t)};kt.spread=fO;kt.isAxiosError=hO;kt.mergeConfig=Ci;kt.AxiosHeaders=wn;kt.formToJSON=e=>CE(ce.isHTMLForm(e)?new FormData(e):e);kt.getAdapter=OE.getAdapter;kt.HttpStatusCode=cm;kt.default=kt;const{Axios:R6,AxiosError:A6,CanceledError:D6,isCancel:k6,CancelToken:N6,VERSION:O6,all:j6,Cancel:L6,isAxiosError:z6,spread:M6,toFormData:P6,AxiosHeaders:G6,HttpStatusCode:F6,formToJSON:U6,getAdapter:B6,mergeConfig:I6}=kt,ME="Invalid API Key",PE="API Key required",fr=kt.create({baseURL:iE,headers:{"Content-Type":"application/json"}});fr.interceptors.request.use(e=>{const t=Ye.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});fr.interceptors.response.use(e=>e,e=>{var t;throw e.response?new Error(`${e.response.status} ${e.response.statusText}
${JSON.stringify(e.response.data)}
${(t=e.config)==null?void 0:t.url}`):e});const pO=async e=>(await fr.get(`/graphs?label=${e}`)).data,mO=async()=>(await fr.get("/graph/label/list")).data,gO=async()=>{try{return(await fr.get("/health")).data}catch(e){return{status:"error",message:Sr(e)}}},vO=async()=>(await fr.get("/documents")).data,yO=async()=>(await fr.post("/documents/scan")).data,bO=async e=>(await fr.post("/query",e)).data,xO=async(e,t,n)=>{try{let a="";if(await fr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[o=>{a+=o;const s=a.split(`
`);a=s.pop()||"";for(const c of s)if(c.trim())try{const u=JSON.parse(c);u.response?t(u.response):u.error}catch(u){console.error("Error parsing stream chunk:",u)}return o}]}),a.trim())try{const o=JSON.parse(a);o.response?t(o.response):o.error}catch(o){console.error("Error parsing final chunk:",o)}}catch(a){const o=Sr(a);console.error("Stream request failed:",o)}},wO=async(e,t)=>{const n=new FormData;return n.append("file",e),(await fr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?o=>{const s=Math.round(o.loaded*100/o.total);t(s)}:void 0})).data},EO=async()=>(await fr.delete("/documents")).data,SO=Qm()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await gO();return t.status==="healthy"?(e({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:t}),!0):(e({health:!1,message:t.message,messageTitle:"Backend Health Check Error!",lastCheckTime:Date.now(),status:null}),!1)},clear:()=>{e({health:!0,message:null,messageTitle:null})},setErrorMessage:(t,n)=>{e({health:!1,message:t,messageTitle:n})}})),En=tg(SO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _O=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),GE=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var CO={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const TO=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:s,iconNode:c,...u},f)=>w.createElement("svg",{ref:f,...CO,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:GE("lucide",o),...u},[...c.map(([h,m])=>w.createElement(h,m)),...Array.isArray(s)?s:[s]]));/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ht=(e,t)=>{const n=w.forwardRef(({className:a,...o},s)=>w.createElement(TO,{ref:s,iconNode:t,className:GE(`lucide-${_O(e)}`,a),...o}));return n.displayName=`${e}`,n};/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const RO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ig=ht("Check",RO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const AO=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],og=ht("ChevronDown",AO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const DO=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],FE=ht("ChevronUp",DO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kO=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],NO=ht("ChevronsUpDown",kO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const OO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],jO=ht("CircleAlert",OO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const LO=[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]],UE=ht("Eraser",LO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zO=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],MO=ht("FileText",zO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const PO=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],GO=ht("Files",PO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const FO=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["rect",{width:"10",height:"8",x:"7",y:"8",rx:"1",key:"vys8me"}]],UO=ht("Fullscreen",FO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const BO=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],IO=ht("Github",BO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const HO=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],$O=ht("Grip",HO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const VO=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],BE=ht("LoaderCircle",VO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qO=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],YO=ht("Loader",qO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const WO=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],XO=ht("Maximize",WO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const KO=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],ZO=ht("Minimize",KO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const QO=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],JO=ht("Moon",QO);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ej=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],tj=ht("Pause",ej);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nj=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],rj=ht("Play",nj);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aj=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ij=ht("RefreshCw",aj);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oj=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],sj=ht("Search",oj);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lj=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],cj=ht("Send",lj);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uj=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],dj=ht("Settings",uj);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fj=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],hj=ht("Sun",fj);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pj=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],um=ht("Upload",pj);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],IE=ht("X",mj);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gj=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],vj=ht("Zap",gj);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yj=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],bj=ht("ZoomIn",yj);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xj=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],wj=ht("ZoomOut",xj),Ej=()=>{const e=En.use.health(),t=En.use.message(),n=En.use.messageTitle(),[a,o]=w.useState(!1);return w.useEffect(()=>{setTimeout(()=>{o(!0)},50)},[]),x.jsxs(lE,{className:Oe("bg-background/90 absolute top-12 left-1/2 flex w-auto max-w-lg -translate-x-1/2 transform items-center gap-4 shadow-md backdrop-blur-lg transition-all duration-500 ease-in-out",a?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&x.jsx("div",{children:x.jsx(jO,{className:"size-4"})}),x.jsxs("div",{children:[x.jsx(cE,{className:"font-bold",children:n}),x.jsx(uE,{children:t})]})]})};function Sj(e,t){const n=w.createContext(t),a=s=>{const{children:c,...u}=s,f=w.useMemo(()=>u,Object.values(u));return x.jsx(n.Provider,{value:f,children:c})};a.displayName=e+"Provider";function o(s){const c=w.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[a,o]}function Kn(e,t=[]){let n=[];function a(s,c){const u=w.createContext(c),f=n.length;n=[...n,c];const h=g=>{var N;const{scope:y,children:b,...S}=g,E=((N=y==null?void 0:y[e])==null?void 0:N[f])||u,_=w.useMemo(()=>S,Object.values(S));return x.jsx(E.Provider,{value:_,children:b})};h.displayName=s+"Provider";function m(g,y){var E;const b=((E=y==null?void 0:y[e])==null?void 0:E[f])||u,S=w.useContext(b);if(S)return S;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[h,m]}const o=()=>{const s=n.map(c=>w.createContext(c));return function(u){const f=(u==null?void 0:u[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return o.scopeName=e,[a,_j(o,...t)]}function _j(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=a.reduce((u,{useScope:f,scopeName:h})=>{const g=f(s)[`__scope${h}`];return{...u,...g}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function C0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function HE(...e){return t=>{let n=!1;const a=e.map(o=>{const s=C0(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<a.length;o++){const s=a[o];typeof s=="function"?s():C0(e[o],null)}}}}function nt(...e){return w.useCallback(HE(...e),e)}function Be(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var sn=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},Cj=SD.useId||(()=>{}),Tj=0;function on(e){const[t,n]=w.useState(Cj());return sn(()=>{n(a=>a??String(Tj++))},[e]),t?`radix-${t}`:""}function Zt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function aa({prop:e,defaultProp:t,onChange:n=()=>{}}){const[a,o]=Rj({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:a,u=Zt(n),f=w.useCallback(h=>{if(s){const g=typeof h=="function"?h(e):h;g!==e&&u(g)}else o(h)},[s,e,o,u]);return[c,f]}function Rj({defaultProp:e,onChange:t}){const n=w.useState(e),[a]=n,o=w.useRef(a),s=Zt(t);return w.useEffect(()=>{o.current!==a&&(s(a),o.current=a)},[a,o,s]),n}var xl=Y1();const $E=dn(xl);var Ba=w.forwardRef((e,t)=>{const{children:n,...a}=e,o=w.Children.toArray(n),s=o.find(Aj);if(s){const c=s.props.children,u=o.map(f=>f===s?w.Children.count(c)>1?w.Children.only(null):w.isValidElement(c)?c.props.children:null:f);return x.jsx(dm,{...a,ref:t,children:w.isValidElement(c)?w.cloneElement(c,void 0,u):null})}return x.jsx(dm,{...a,ref:t,children:n})});Ba.displayName="Slot";var dm=w.forwardRef((e,t)=>{const{children:n,...a}=e;if(w.isValidElement(n)){const o=kj(n),s=Dj(a,n.props);return n.type!==w.Fragment&&(s.ref=t?HE(t,o):o),w.cloneElement(n,s)}return w.Children.count(n)>1?w.Children.only(null):null});dm.displayName="SlotClone";var sg=({children:e})=>x.jsx(x.Fragment,{children:e});function Aj(e){return w.isValidElement(e)&&e.type===sg}function Dj(e,t){const n={...t};for(const a in t){const o=e[a],s=t[a];/^on[A-Z]/.test(a)?o&&s?n[a]=(...u)=>{s(...u),o(...u)}:o&&(n[a]=o):a==="style"?n[a]={...o,...s}:a==="className"&&(n[a]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function kj(e){var a,o;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Nj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ie=Nj.reduce((e,t)=>{const n=w.forwardRef((a,o)=>{const{asChild:s,...c}=a,u=s?Ba:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(u,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Oj(e,t){e&&xl.flushSync(()=>e.dispatchEvent(t))}function jj(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);w.useEffect(()=>{const a=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var Lj="DismissableLayer",fm="dismissableLayer.update",zj="dismissableLayer.pointerDownOutside",Mj="dismissableLayer.focusOutside",T0,VE=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wl=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:u,...f}=e,h=w.useContext(VE),[m,g]=w.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=w.useState({}),S=nt(t,R=>g(R)),E=Array.from(h.layers),[_]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),N=E.indexOf(_),C=m?E.indexOf(m):-1,A=h.layersWithOutsidePointerEventsDisabled.size>0,k=C>=N,D=Fj(R=>{const U=R.target,L=[...h.branches].some(I=>I.contains(U));!k||L||(o==null||o(R),c==null||c(R),R.defaultPrevented||u==null||u())},y),M=Uj(R=>{const U=R.target;[...h.branches].some(I=>I.contains(U))||(s==null||s(R),c==null||c(R),R.defaultPrevented||u==null||u())},y);return jj(R=>{C===h.layers.size-1&&(a==null||a(R),!R.defaultPrevented&&u&&(R.preventDefault(),u()))},y),w.useEffect(()=>{if(m)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(T0=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),R0(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=T0)}},[m,y,n,h]),w.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),R0())},[m,h]),w.useEffect(()=>{const R=()=>b({});return document.addEventListener(fm,R),()=>document.removeEventListener(fm,R)},[]),x.jsx(Ie.div,{...f,ref:S,style:{pointerEvents:A?k?"auto":"none":void 0,...e.style},onFocusCapture:Be(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Be(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Be(e.onPointerDownCapture,D.onPointerDownCapture)})});wl.displayName=Lj;var Pj="DismissableLayerBranch",Gj=w.forwardRef((e,t)=>{const n=w.useContext(VE),a=w.useRef(null),o=nt(t,a);return w.useEffect(()=>{const s=a.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(Ie.div,{...e,ref:o})});Gj.displayName=Pj;function Fj(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),a=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const s=u=>{if(u.target&&!a.current){let f=function(){qE(zj,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);a.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function Uj(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),a=w.useRef(!1);return w.useEffect(()=>{const o=s=>{s.target&&!a.current&&qE(Mj,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function R0(){const e=new CustomEvent(fm);document.dispatchEvent(e)}function qE(e,t,n,{discrete:a}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),a?Oj(o,s):o.dispatchEvent(s)}var Wh="focusScope.autoFocusOnMount",Xh="focusScope.autoFocusOnUnmount",A0={bubbles:!1,cancelable:!0},Bj="FocusScope",ed=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[u,f]=w.useState(null),h=Zt(o),m=Zt(s),g=w.useRef(null),y=nt(t,E=>f(E)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(a){let E=function(A){if(b.paused||!u)return;const k=A.target;u.contains(k)?g.current=k:Ma(g.current,{select:!0})},_=function(A){if(b.paused||!u)return;const k=A.relatedTarget;k!==null&&(u.contains(k)||Ma(g.current,{select:!0}))},N=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&Ma(u)};document.addEventListener("focusin",E),document.addEventListener("focusout",_);const C=new MutationObserver(N);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",_),C.disconnect()}}},[a,u,b.paused]),w.useEffect(()=>{if(u){k0.add(b);const E=document.activeElement;if(!u.contains(E)){const N=new CustomEvent(Wh,A0);u.addEventListener(Wh,h),u.dispatchEvent(N),N.defaultPrevented||(Ij(Yj(YE(u)),{select:!0}),document.activeElement===E&&Ma(u))}return()=>{u.removeEventListener(Wh,h),setTimeout(()=>{const N=new CustomEvent(Xh,A0);u.addEventListener(Xh,m),u.dispatchEvent(N),N.defaultPrevented||Ma(E??document.body,{select:!0}),u.removeEventListener(Xh,m),k0.remove(b)},0)}}},[u,h,m,b]);const S=w.useCallback(E=>{if(!n&&!a||b.paused)return;const _=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,N=document.activeElement;if(_&&N){const C=E.currentTarget,[A,k]=Hj(C);A&&k?!E.shiftKey&&N===k?(E.preventDefault(),n&&Ma(A,{select:!0})):E.shiftKey&&N===A&&(E.preventDefault(),n&&Ma(k,{select:!0})):N===C&&E.preventDefault()}},[n,a,b.paused]);return x.jsx(Ie.div,{tabIndex:-1,...c,ref:y,onKeyDown:S})});ed.displayName=Bj;function Ij(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(Ma(a,{select:t}),document.activeElement!==n)return}function Hj(e){const t=YE(e),n=D0(t,e),a=D0(t.reverse(),e);return[n,a]}function YE(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const o=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||o?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function D0(e,t){for(const n of e)if(!$j(n,{upTo:t}))return n}function $j(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Vj(e){return e instanceof HTMLInputElement&&"select"in e}function Ma(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Vj(e)&&t&&e.select()}}var k0=qj();function qj(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=N0(e,t),e.unshift(t)},remove(t){var n;e=N0(e,t),(n=e[0])==null||n.resume()}}}function N0(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function Yj(e){return e.filter(t=>t.tagName!=="A")}var Wj="Portal",td=w.forwardRef((e,t)=>{var u;const{container:n,...a}=e,[o,s]=w.useState(!1);sn(()=>s(!0),[]);const c=n||o&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?$E.createPortal(x.jsx(Ie.div,{...a,ref:t}),c):null});td.displayName=Wj;function Xj(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var zn=e=>{const{present:t,children:n}=e,a=Kj(t),o=typeof n=="function"?n({present:a.isPresent}):w.Children.only(n),s=nt(a.ref,Zj(o));return typeof n=="function"||a.isPresent?w.cloneElement(o,{ref:s}):null};zn.displayName="Presence";function Kj(e){const[t,n]=w.useState(),a=w.useRef({}),o=w.useRef(e),s=w.useRef("none"),c=e?"mounted":"unmounted",[u,f]=Xj(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const h=Bc(a.current);s.current=u==="mounted"?h:"none"},[u]),sn(()=>{const h=a.current,m=o.current;if(m!==e){const y=s.current,b=Bc(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(m&&y!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),sn(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,g=b=>{const E=Bc(a.current).includes(b.animationName);if(b.target===t&&E&&(f("ANIMATION_END"),!o.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},y=b=>{b.target===t&&(s.current=Bc(a.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:w.useCallback(h=>{h&&(a.current=getComputedStyle(h)),n(h)},[])}}function Bc(e){return(e==null?void 0:e.animationName)||"none"}function Zj(e){var a,o;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Kh=0;function lg(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??O0()),document.body.insertAdjacentElement("beforeend",e[1]??O0()),Kh++,()=>{Kh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Kh--}},[])}function O0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var wr=function(){return wr=Object.assign||function(t){for(var n,a=1,o=arguments.length;a<o;a++){n=arguments[a];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},wr.apply(this,arguments)};function WE(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n}function Oi(e,t,n,a){function o(s){return s instanceof n?s:new n(function(c){c(s)})}return new(n||(n=Promise))(function(s,c){function u(m){try{h(a.next(m))}catch(g){c(g)}}function f(m){try{h(a.throw(m))}catch(g){c(g)}}function h(m){m.done?s(m.value):o(m.value).then(u,f)}h((a=a.apply(e,t||[])).next())})}function Qj(e,t,n){if(n||arguments.length===2)for(var a=0,o=t.length,s;a<o;a++)(s||!(a in t))&&(s||(s=Array.prototype.slice.call(t,0,a)),s[a]=t[a]);return e.concat(s||Array.prototype.slice.call(t))}var fu="right-scroll-bar-position",hu="width-before-scroll-bar",Jj="with-scroll-bars-hidden",eL="--removed-body-scroll-bar-size";function Zh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tL(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var o=n.value;o!==a&&(n.value=a,n.callback(a,o))}}}})[0];return n.callback=t,n.facade}var nL=typeof window<"u"?w.useLayoutEffect:w.useEffect,j0=new WeakMap;function rL(e,t){var n=tL(null,function(a){return e.forEach(function(o){return Zh(o,a)})});return nL(function(){var a=j0.get(n);if(a){var o=new Set(a),s=new Set(e),c=n.current;o.forEach(function(u){s.has(u)||Zh(u,null)}),s.forEach(function(u){o.has(u)||Zh(u,c)})}j0.set(n,e)},[e]),n}function aL(e){return e}function iL(e,t){t===void 0&&(t=aL);var n=[],a=!1,o={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var c=t(s,a);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(s){for(a=!0;n.length;){var c=n;n=[],c.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){a=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(s),c=n}var f=function(){var m=c;c=[],m.forEach(s)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){c.push(m),h()},filter:function(m){return c=c.filter(m),n}}}};return o}function oL(e){e===void 0&&(e={});var t=iL(null);return t.options=wr({async:!0,ssr:!1},e),t}var XE=function(e){var t=e.sideCar,n=WE(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return w.createElement(a,wr({},n))};XE.isSideCarExport=!0;function sL(e,t){return e.useMedium(t),XE}var KE=oL(),Qh=function(){},nd=w.forwardRef(function(e,t){var n=w.useRef(null),a=w.useState({onScrollCapture:Qh,onWheelCapture:Qh,onTouchMoveCapture:Qh}),o=a[0],s=a[1],c=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,m=e.enabled,g=e.shards,y=e.sideCar,b=e.noIsolation,S=e.inert,E=e.allowPinchZoom,_=e.as,N=_===void 0?"div":_,C=e.gapMode,A=WE(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=y,D=rL([n,t]),M=wr(wr({},A),o);return w.createElement(w.Fragment,null,m&&w.createElement(k,{sideCar:KE,removeScrollBar:h,shards:g,noIsolation:b,inert:S,setCallbacks:s,allowPinchZoom:!!E,lockRef:n,gapMode:C}),c?w.cloneElement(w.Children.only(u),wr(wr({},M),{ref:D})):w.createElement(N,wr({},M,{className:f,ref:D}),u))});nd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};nd.classNames={fullWidth:hu,zeroRight:fu};var lL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=lL();return t&&e.setAttribute("nonce",t),e}function uL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var fL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cL())&&(uL(t,n),dL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hL=function(){var e=fL();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ZE=function(){var e=hL(),t=function(n){var a=n.styles,o=n.dynamic;return e(a,o),null};return t},pL={left:0,top:0,right:0,gap:0},Jh=function(e){return parseInt(e||"",10)||0},mL=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Jh(n),Jh(a),Jh(o)]},gL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return pL;var t=mL(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},vL=ZE(),Ro="data-scroll-locked",yL=function(e,t,n,a){var o=e.left,s=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
.`.concat(Jj,` {
overflow: hidden `).concat(a,`;
padding-right: `).concat(u,"px ").concat(a,`;
}
body[`).concat(Ro,`] {
overflow: hidden `).concat(a,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(s,`px;
padding-right: `).concat(c,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(u,"px ").concat(a,`;
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(a,";")].filter(Boolean).join(""),`
}
.`).concat(fu,` {
right: `).concat(u,"px ").concat(a,`;
}
.`).concat(hu,` {
margin-right: `).concat(u,"px ").concat(a,`;
}
.`).concat(fu," .").concat(fu,` {
right: 0 `).concat(a,`;
}
.`).concat(hu," .").concat(hu,` {
margin-right: 0 `).concat(a,`;
}
body[`).concat(Ro,`] {
`).concat(eL,": ").concat(u,`px;
}
`)},L0=function(){var e=parseInt(document.body.getAttribute(Ro)||"0",10);return isFinite(e)?e:0},bL=function(){w.useEffect(function(){return document.body.setAttribute(Ro,(L0()+1).toString()),function(){var e=L0()-1;e<=0?document.body.removeAttribute(Ro):document.body.setAttribute(Ro,e.toString())}},[])},xL=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,o=a===void 0?"margin":a;bL();var s=w.useMemo(function(){return gL(o)},[o]);return w.createElement(vL,{styles:yL(s,!t,o,n?"":"!important")})},hm=!1;if(typeof window<"u")try{var Ic=Object.defineProperty({},"passive",{get:function(){return hm=!0,!0}});window.addEventListener("test",Ic,Ic),window.removeEventListener("test",Ic,Ic)}catch{hm=!1}var bo=hm?{passive:!1}:!1,wL=function(e){return e.tagName==="TEXTAREA"},QE=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!wL(e)&&n[t]==="visible")},EL=function(e){return QE(e,"overflowY")},SL=function(e){return QE(e,"overflowX")},z0=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var o=JE(e,a);if(o){var s=eS(e,a),c=s[1],u=s[2];if(c>u)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},_L=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},CL=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},JE=function(e,t){return e==="v"?EL(t):SL(t)},eS=function(e,t){return e==="v"?_L(t):CL(t)},TL=function(e,t){return e==="h"&&t==="rtl"?-1:1},RL=function(e,t,n,a,o){var s=TL(e,window.getComputedStyle(t).direction),c=s*a,u=n.target,f=t.contains(u),h=!1,m=c>0,g=0,y=0;do{var b=eS(e,u),S=b[0],E=b[1],_=b[2],N=E-_-s*S;(S||N)&&JE(e,u)&&(g+=N,y+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(h=!0),h},Hc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},M0=function(e){return[e.deltaX,e.deltaY]},P0=function(e){return e&&"current"in e?e.current:e},AL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},DL=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},kL=0,xo=[];function NL(e){var t=w.useRef([]),n=w.useRef([0,0]),a=w.useRef(),o=w.useState(kL++)[0],s=w.useState(ZE)[0],c=w.useRef(e);w.useEffect(function(){c.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var E=Qj([e.lockRef.current],(e.shards||[]).map(P0),!0).filter(Boolean);return E.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),E.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=w.useCallback(function(E,_){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!c.current.allowPinchZoom;var N=Hc(E),C=n.current,A="deltaX"in E?E.deltaX:C[0]-N[0],k="deltaY"in E?E.deltaY:C[1]-N[1],D,M=E.target,R=Math.abs(A)>Math.abs(k)?"h":"v";if("touches"in E&&R==="h"&&M.type==="range")return!1;var U=z0(R,M);if(!U)return!0;if(U?D=R:(D=R==="v"?"h":"v",U=z0(R,M)),!U)return!1;if(!a.current&&"changedTouches"in E&&(A||k)&&(a.current=D),!D)return!0;var L=a.current||D;return RL(L,_,E,L==="h"?A:k)},[]),f=w.useCallback(function(E){var _=E;if(!(!xo.length||xo[xo.length-1]!==s)){var N="deltaY"in _?M0(_):Hc(_),C=t.current.filter(function(D){return D.name===_.type&&(D.target===_.target||_.target===D.shadowParent)&&AL(D.delta,N)})[0];if(C&&C.should){_.cancelable&&_.preventDefault();return}if(!C){var A=(c.current.shards||[]).map(P0).filter(Boolean).filter(function(D){return D.contains(_.target)}),k=A.length>0?u(_,A[0]):!c.current.noIsolation;k&&_.cancelable&&_.preventDefault()}}},[]),h=w.useCallback(function(E,_,N,C){var A={name:E,delta:_,target:N,should:C,shadowParent:OL(N)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(k){return k!==A})},1)},[]),m=w.useCallback(function(E){n.current=Hc(E),a.current=void 0},[]),g=w.useCallback(function(E){h(E.type,M0(E),E.target,u(E,e.lockRef.current))},[]),y=w.useCallback(function(E){h(E.type,Hc(E),E.target,u(E,e.lockRef.current))},[]);w.useEffect(function(){return xo.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,bo),document.addEventListener("touchmove",f,bo),document.addEventListener("touchstart",m,bo),function(){xo=xo.filter(function(E){return E!==s}),document.removeEventListener("wheel",f,bo),document.removeEventListener("touchmove",f,bo),document.removeEventListener("touchstart",m,bo)}},[]);var b=e.removeScrollBar,S=e.inert;return w.createElement(w.Fragment,null,S?w.createElement(s,{styles:DL(o)}):null,b?w.createElement(xL,{gapMode:e.gapMode}):null)}function OL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jL=sL(KE,NL);var rd=w.forwardRef(function(e,t){return w.createElement(nd,wr({},e,{ref:t,sideCar:jL}))});rd.classNames=nd.classNames;var LL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wo=new WeakMap,$c=new WeakMap,Vc={},ep=0,tS=function(e){return e&&(e.host||tS(e.parentNode))},zL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=tS(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ML=function(e,t,n,a){var o=zL(t,Array.isArray(e)?e:[e]);Vc[n]||(Vc[n]=new WeakMap);var s=Vc[n],c=[],u=new Set,f=new Set(o),h=function(g){!g||u.has(g)||(u.add(g),h(g.parentNode))};o.forEach(h);var m=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(y){if(u.has(y))m(y);else try{var b=y.getAttribute(a),S=b!==null&&b!=="false",E=(wo.get(y)||0)+1,_=(s.get(y)||0)+1;wo.set(y,E),s.set(y,_),c.push(y),E===1&&S&&$c.set(y,!0),_===1&&y.setAttribute(n,"true"),S||y.setAttribute(a,"true")}catch(N){console.error("aria-hidden: cannot operate on ",y,N)}})};return m(t),u.clear(),ep++,function(){c.forEach(function(g){var y=wo.get(g)-1,b=s.get(g)-1;wo.set(g,y),s.set(g,b),y||($c.has(g)||g.removeAttribute(a),$c.delete(g)),b||g.removeAttribute(n)}),ep--,ep||(wo=new WeakMap,wo=new WeakMap,$c=new WeakMap,Vc={})}},cg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),o=LL(e);return o?(a.push.apply(a,Array.from(o.querySelectorAll("[aria-live]"))),ML(a,o,n,"aria-hidden")):function(){return null}},ug="Dialog",[nS,rS]=Kn(ug),[PL,hr]=nS(ug),aS=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,u=w.useRef(null),f=w.useRef(null),[h=!1,m]=aa({prop:a,defaultProp:o,onChange:s});return x.jsx(PL,{scope:t,triggerRef:u,contentRef:f,contentId:on(),titleId:on(),descriptionId:on(),open:h,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(g=>!g),[m]),modal:c,children:n})};aS.displayName=ug;var iS="DialogTrigger",oS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(iS,n),s=nt(t,o.triggerRef);return x.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":hg(o.open),...a,ref:s,onClick:Be(e.onClick,o.onOpenToggle)})});oS.displayName=iS;var dg="DialogPortal",[GL,sS]=nS(dg,{forceMount:void 0}),lS=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:o}=e,s=hr(dg,t);return x.jsx(GL,{scope:t,forceMount:n,children:w.Children.map(a,c=>x.jsx(zn,{present:n||s.open,children:x.jsx(td,{asChild:!0,container:o,children:c})}))})};lS.displayName=dg;var Ru="DialogOverlay",cS=w.forwardRef((e,t)=>{const n=sS(Ru,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,s=hr(Ru,e.__scopeDialog);return s.modal?x.jsx(zn,{present:a||s.open,children:x.jsx(FL,{...o,ref:t})}):null});cS.displayName=Ru;var FL=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(Ru,n);return x.jsx(rd,{as:Ba,allowPinchZoom:!0,shards:[o.contentRef],children:x.jsx(Ie.div,{"data-state":hg(o.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Ti="DialogContent",uS=w.forwardRef((e,t)=>{const n=sS(Ti,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,s=hr(Ti,e.__scopeDialog);return x.jsx(zn,{present:a||s.open,children:s.modal?x.jsx(UL,{...o,ref:t}):x.jsx(BL,{...o,ref:t})})});uS.displayName=Ti;var UL=w.forwardRef((e,t)=>{const n=hr(Ti,e.__scopeDialog),a=w.useRef(null),o=nt(t,n.contentRef,a);return w.useEffect(()=>{const s=a.current;if(s)return cg(s)},[]),x.jsx(dS,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,s=>{var c;s.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&s.preventDefault()}),onFocusOutside:Be(e.onFocusOutside,s=>s.preventDefault())})}),BL=w.forwardRef((e,t)=>{const n=hr(Ti,e.__scopeDialog),a=w.useRef(!1),o=w.useRef(!1);return x.jsx(dS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(a.current||(u=n.triggerRef.current)==null||u.focus(),s.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:s=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),dS=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=e,u=hr(Ti,n),f=w.useRef(null),h=nt(t,f);return lg(),x.jsxs(x.Fragment,{children:[x.jsx(ed,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(wl,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":hg(u.open),...c,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(HL,{titleId:u.titleId}),x.jsx(VL,{contentRef:f,descriptionId:u.descriptionId})]})]})}),fg="DialogTitle",fS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(fg,n);return x.jsx(Ie.h2,{id:o.titleId,...a,ref:t})});fS.displayName=fg;var hS="DialogDescription",pS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(hS,n);return x.jsx(Ie.p,{id:o.descriptionId,...a,ref:t})});pS.displayName=hS;var mS="DialogClose",gS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(mS,n);return x.jsx(Ie.button,{type:"button",...a,ref:t,onClick:Be(e.onClick,()=>o.onOpenChange(!1))})});gS.displayName=mS;function hg(e){return e?"open":"closed"}var vS="DialogTitleWarning",[IL,yS]=Sj(vS,{contentName:Ti,titleName:fg,docsSlug:"dialog"}),HL=({titleId:e})=>{const t=yS(vS),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},$L="DialogDescriptionWarning",VL=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${yS($L).contentName}}.`;return w.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},pg=aS,bS=oS,mg=lS,ad=cS,id=uS,gg=fS,vg=pS,yg=gS,xS="AlertDialog",[qL,H6]=Kn(xS,[rS]),sa=rS(),wS=e=>{const{__scopeAlertDialog:t,...n}=e,a=sa(t);return x.jsx(pg,{...a,...n,modal:!0})};wS.displayName=xS;var YL="AlertDialogTrigger",WL=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(bS,{...o,...a,ref:t})});WL.displayName=YL;var XL="AlertDialogPortal",ES=e=>{const{__scopeAlertDialog:t,...n}=e,a=sa(t);return x.jsx(mg,{...a,...n})};ES.displayName=XL;var KL="AlertDialogOverlay",SS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(ad,{...o,...a,ref:t})});SS.displayName=KL;var Ao="AlertDialogContent",[ZL,QL]=qL(Ao),_S=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:a,...o}=e,s=sa(n),c=w.useRef(null),u=nt(t,c),f=w.useRef(null);return x.jsx(IL,{contentName:Ao,titleName:CS,docsSlug:"alert-dialog",children:x.jsx(ZL,{scope:n,cancelRef:f,children:x.jsxs(id,{role:"alertdialog",...s,...o,ref:u,onOpenAutoFocus:Be(o.onOpenAutoFocus,h=>{var m;h.preventDefault(),(m=f.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[x.jsx(sg,{children:a}),x.jsx(ez,{contentRef:c})]})})})});_S.displayName=Ao;var CS="AlertDialogTitle",TS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(gg,{...o,...a,ref:t})});TS.displayName=CS;var RS="AlertDialogDescription",AS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(vg,{...o,...a,ref:t})});AS.displayName=RS;var JL="AlertDialogAction",DS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(yg,{...o,...a,ref:t})});DS.displayName=JL;var kS="AlertDialogCancel",NS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:o}=QL(kS,n),s=sa(n),c=nt(t,o);return x.jsx(yg,{...s,...a,ref:c})});NS.displayName=kS;var ez=({contentRef:e})=>{const t=`\`${Ao}\` requires a description for the component to be accessible for screen reader users.
You can add a description to the \`${Ao}\` by passing a \`${RS}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ao}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var a;document.getElementById((a=e.current)==null?void 0:a.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},tz=wS,nz=ES,OS=SS,jS=_S,LS=DS,zS=NS,MS=TS,PS=AS;const rz=["top","right","bottom","left"],Ia=Math.min,On=Math.max,Au=Math.round,qc=Math.floor,Cr=e=>({x:e,y:e}),az={left:"right",right:"left",bottom:"top",top:"bottom"},iz={start:"end",end:"start"};function pm(e,t,n){return On(e,Ia(t,n))}function ia(e,t){return typeof e=="function"?e(t):e}function oa(e){return e.split("-")[0]}function Ho(e){return e.split("-")[1]}function bg(e){return e==="x"?"y":"x"}function xg(e){return e==="y"?"height":"width"}function Ha(e){return["top","bottom"].includes(oa(e))?"y":"x"}function wg(e){return bg(Ha(e))}function oz(e,t,n){n===void 0&&(n=!1);const a=Ho(e),o=wg(e),s=xg(o);let c=o==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Du(c)),[c,Du(c)]}function sz(e){const t=Du(e);return[mm(e),t,mm(t)]}function mm(e){return e.replace(/start|end/g,t=>iz[t])}function lz(e,t,n){const a=["left","right"],o=["right","left"],s=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:a:t?a:o;case"left":case"right":return t?s:c;default:return[]}}function cz(e,t,n,a){const o=Ho(e);let s=lz(oa(e),n==="start",a);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(mm)))),s}function Du(e){return e.replace(/left|right|bottom|top/g,t=>az[t])}function uz(e){return{top:0,right:0,bottom:0,left:0,...e}}function GS(e){return typeof e!="number"?uz(e):{top:e,right:e,bottom:e,left:e}}function ku(e){const{x:t,y:n,width:a,height:o}=e;return{width:a,height:o,top:n,left:t,right:t+a,bottom:n+o,x:t,y:n}}function G0(e,t,n){let{reference:a,floating:o}=e;const s=Ha(t),c=wg(t),u=xg(c),f=oa(t),h=s==="y",m=a.x+a.width/2-o.width/2,g=a.y+a.height/2-o.height/2,y=a[u]/2-o[u]/2;let b;switch(f){case"top":b={x:m,y:a.y-o.height};break;case"bottom":b={x:m,y:a.y+a.height};break;case"right":b={x:a.x+a.width,y:g};break;case"left":b={x:a.x-o.width,y:g};break;default:b={x:a.x,y:a.y}}switch(Ho(t)){case"start":b[c]-=y*(n&&h?-1:1);break;case"end":b[c]+=y*(n&&h?-1:1);break}return b}const dz=async(e,t,n)=>{const{placement:a="bottom",strategy:o="absolute",middleware:s=[],platform:c}=n,u=s.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:g}=G0(h,a,f),y=a,b={},S=0;for(let E=0;E<u.length;E++){const{name:_,fn:N}=u[E],{x:C,y:A,data:k,reset:D}=await N({x:m,y:g,initialPlacement:a,placement:y,strategy:o,middlewareData:b,rects:h,platform:c,elements:{reference:e,floating:t}});m=C??m,g=A??g,b={...b,[_]:{...b[_],...k}},D&&S<=50&&(S++,typeof D=="object"&&(D.placement&&(y=D.placement),D.rects&&(h=D.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:m,y:g}=G0(h,y,f)),E=-1)}return{x:m,y:g,placement:y,strategy:o,middlewareData:b}};async function cl(e,t){var n;t===void 0&&(t={});const{x:a,y:o,platform:s,rects:c,elements:u,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:y=!1,padding:b=0}=ia(t,e),S=GS(b),_=u[y?g==="floating"?"reference":"floating":g],N=ku(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(_)))==null||n?_:_.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:h,rootBoundary:m,strategy:f})),C=g==="floating"?{x:a,y:o,width:c.floating.width,height:c.floating.height}:c.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),k=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},D=ku(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:C,offsetParent:A,strategy:f}):C);return{top:(N.top-D.top+S.top)/k.y,bottom:(D.bottom-N.bottom+S.bottom)/k.y,left:(N.left-D.left+S.left)/k.x,right:(D.right-N.right+S.right)/k.x}}const fz=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:o,rects:s,platform:c,elements:u,middlewareData:f}=t,{element:h,padding:m=0}=ia(e,t)||{};if(h==null)return{};const g=GS(m),y={x:n,y:a},b=wg(o),S=xg(b),E=await c.getDimensions(h),_=b==="y",N=_?"top":"left",C=_?"bottom":"right",A=_?"clientHeight":"clientWidth",k=s.reference[S]+s.reference[b]-y[b]-s.floating[S],D=y[b]-s.reference[b],M=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let R=M?M[A]:0;(!R||!await(c.isElement==null?void 0:c.isElement(M)))&&(R=u.floating[A]||s.floating[S]);const U=k/2-D/2,L=R/2-E[S]/2-1,I=Ia(g[N],L),q=Ia(g[C],L),Y=I,B=R-E[S]-q,X=R/2-E[S]/2+U,ne=pm(Y,X,B),F=!f.arrow&&Ho(o)!=null&&X!==ne&&s.reference[S]/2-(X<Y?I:q)-E[S]/2<0,z=F?X<Y?X-Y:X-B:0;return{[b]:y[b]+z,data:{[b]:ne,centerOffset:X-ne-z,...F&&{alignmentOffset:z}},reset:F}}}),hz=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:o,middlewareData:s,rects:c,initialPlacement:u,platform:f,elements:h}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:E=!0,..._}=ia(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const N=oa(o),C=Ha(u),A=oa(u)===u,k=await(f.isRTL==null?void 0:f.isRTL(h.floating)),D=y||(A||!E?[Du(u)]:sz(u)),M=S!=="none";!y&&M&&D.push(...cz(u,E,S,k));const R=[u,...D],U=await cl(t,_),L=[];let I=((a=s.flip)==null?void 0:a.overflows)||[];if(m&&L.push(U[N]),g){const X=oz(o,c,k);L.push(U[X[0]],U[X[1]])}if(I=[...I,{placement:o,overflows:L}],!L.every(X=>X<=0)){var q,Y;const X=(((q=s.flip)==null?void 0:q.index)||0)+1,ne=R[X];if(ne)return{data:{index:X,overflows:I},reset:{placement:ne}};let F=(Y=I.filter(z=>z.overflows[0]<=0).sort((z,j)=>z.overflows[1]-j.overflows[1])[0])==null?void 0:Y.placement;if(!F)switch(b){case"bestFit":{var B;const z=(B=I.filter(j=>{if(M){const K=Ha(j.placement);return K===C||K==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(K=>K>0).reduce((K,G)=>K+G,0)]).sort((j,K)=>j[1]-K[1])[0])==null?void 0:B[0];z&&(F=z);break}case"initialPlacement":F=u;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function F0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function U0(e){return rz.some(t=>e[t]>=0)}const pz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...o}=ia(e,t);switch(a){case"referenceHidden":{const s=await cl(t,{...o,elementContext:"reference"}),c=F0(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:U0(c)}}}case"escaped":{const s=await cl(t,{...o,altBoundary:!0}),c=F0(s,n.floating);return{data:{escapedOffsets:c,escaped:U0(c)}}}default:return{}}}}};async function mz(e,t){const{placement:n,platform:a,elements:o}=e,s=await(a.isRTL==null?void 0:a.isRTL(o.floating)),c=oa(n),u=Ho(n),f=Ha(n)==="y",h=["left","top"].includes(c)?-1:1,m=s&&f?-1:1,g=ia(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),f?{x:b*m,y:y*h}:{x:y*h,y:b*m}}const gz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:o,y:s,placement:c,middlewareData:u}=t,f=await mz(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(a=u.arrow)!=null&&a.alignmentOffset?{}:{x:o+f.x,y:s+f.y,data:{...f,placement:c}}}}},vz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:u={fn:_=>{let{x:N,y:C}=_;return{x:N,y:C}}},...f}=ia(e,t),h={x:n,y:a},m=await cl(t,f),g=Ha(oa(o)),y=bg(g);let b=h[y],S=h[g];if(s){const _=y==="y"?"top":"left",N=y==="y"?"bottom":"right",C=b+m[_],A=b-m[N];b=pm(C,b,A)}if(c){const _=g==="y"?"top":"left",N=g==="y"?"bottom":"right",C=S+m[_],A=S-m[N];S=pm(C,S,A)}const E=u.fn({...t,[y]:b,[g]:S});return{...E,data:{x:E.x-n,y:E.y-a,enabled:{[y]:s,[g]:c}}}}}},yz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:o,rects:s,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=ia(e,t),m={x:n,y:a},g=Ha(o),y=bg(g);let b=m[y],S=m[g];const E=ia(u,t),_=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(f){const A=y==="y"?"height":"width",k=s.reference[y]-s.floating[A]+_.mainAxis,D=s.reference[y]+s.reference[A]-_.mainAxis;b<k?b=k:b>D&&(b=D)}if(h){var N,C;const A=y==="y"?"width":"height",k=["top","left"].includes(oa(o)),D=s.reference[g]-s.floating[A]+(k&&((N=c.offset)==null?void 0:N[g])||0)+(k?0:_.crossAxis),M=s.reference[g]+s.reference[A]+(k?0:((C=c.offset)==null?void 0:C[g])||0)-(k?_.crossAxis:0);S<D?S=D:S>M&&(S=M)}return{[y]:b,[g]:S}}}},bz=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:o,rects:s,platform:c,elements:u}=t,{apply:f=()=>{},...h}=ia(e,t),m=await cl(t,h),g=oa(o),y=Ho(o),b=Ha(o)==="y",{width:S,height:E}=s.floating;let _,N;g==="top"||g==="bottom"?(_=g,N=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(N=g,_=y==="end"?"top":"bottom");const C=E-m.top-m.bottom,A=S-m.left-m.right,k=Ia(E-m[_],C),D=Ia(S-m[N],A),M=!t.middlewareData.shift;let R=k,U=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(U=A),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(R=C),M&&!y){const I=On(m.left,0),q=On(m.right,0),Y=On(m.top,0),B=On(m.bottom,0);b?U=S-2*(I!==0||q!==0?I+q:On(m.left,m.right)):R=E-2*(Y!==0||B!==0?Y+B:On(m.top,m.bottom))}await f({...t,availableWidth:U,availableHeight:R});const L=await c.getDimensions(u.floating);return S!==L.width||E!==L.height?{reset:{rects:!0}}:{}}}};function od(){return typeof window<"u"}function $o(e){return FS(e)?(e.nodeName||"").toLowerCase():"#document"}function Ln(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rr(e){var t;return(t=(FS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function FS(e){return od()?e instanceof Node||e instanceof Ln(e).Node:!1}function cr(e){return od()?e instanceof Element||e instanceof Ln(e).Element:!1}function Tr(e){return od()?e instanceof HTMLElement||e instanceof Ln(e).HTMLElement:!1}function B0(e){return!od()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ln(e).ShadowRoot}function El(e){const{overflow:t,overflowX:n,overflowY:a,display:o}=ur(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(o)}function xz(e){return["table","td","th"].includes($o(e))}function sd(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Eg(e){const t=Sg(),n=cr(e)?ur(e):e;return["transform","translate","scale","rotate","perspective"].some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(a=>(n.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(n.contain||"").includes(a))}function wz(e){let t=$a(e);for(;Tr(t)&&!Oo(t);){if(Eg(t))return t;if(sd(t))return null;t=$a(t)}return null}function Sg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Oo(e){return["html","body","#document"].includes($o(e))}function ur(e){return Ln(e).getComputedStyle(e)}function ld(e){return cr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $a(e){if($o(e)==="html")return e;const t=e.assignedSlot||e.parentNode||B0(e)&&e.host||Rr(e);return B0(t)?t.host:t}function US(e){const t=$a(e);return Oo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tr(t)&&El(t)?t:US(t)}function ul(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=US(e),s=o===((a=e.ownerDocument)==null?void 0:a.body),c=Ln(o);if(s){const u=gm(c);return t.concat(c,c.visualViewport||[],El(o)?o:[],u&&n?ul(u):[])}return t.concat(o,ul(o,[],n))}function gm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BS(e){const t=ur(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const o=Tr(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:a,u=Au(n)!==s||Au(a)!==c;return u&&(n=s,a=c),{width:n,height:a,$:u}}function _g(e){return cr(e)?e:e.contextElement}function Do(e){const t=_g(e);if(!Tr(t))return Cr(1);const n=t.getBoundingClientRect(),{width:a,height:o,$:s}=BS(t);let c=(s?Au(n.width):n.width)/a,u=(s?Au(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const Ez=Cr(0);function IS(e){const t=Ln(e);return!Sg()||!t.visualViewport?Ez:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sz(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ln(e)?!1:t}function Ri(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=_g(e);let c=Cr(1);t&&(a?cr(a)&&(c=Do(a)):c=Do(e));const u=Sz(s,n,a)?IS(s):Cr(0);let f=(o.left+u.x)/c.x,h=(o.top+u.y)/c.y,m=o.width/c.x,g=o.height/c.y;if(s){const y=Ln(s),b=a&&cr(a)?Ln(a):a;let S=y,E=gm(S);for(;E&&a&&b!==S;){const _=Do(E),N=E.getBoundingClientRect(),C=ur(E),A=N.left+(E.clientLeft+parseFloat(C.paddingLeft))*_.x,k=N.top+(E.clientTop+parseFloat(C.paddingTop))*_.y;f*=_.x,h*=_.y,m*=_.x,g*=_.y,f+=A,h+=k,S=Ln(E),E=gm(S)}}return ku({width:m,height:g,x:f,y:h})}function Cg(e,t){const n=ld(e).scrollLeft;return t?t.left+n:Ri(Rr(e)).left+n}function HS(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=a.left+t.scrollLeft-(n?0:Cg(e,a)),s=a.top+t.scrollTop;return{x:o,y:s}}function _z(e){let{elements:t,rect:n,offsetParent:a,strategy:o}=e;const s=o==="fixed",c=Rr(a),u=t?sd(t.floating):!1;if(a===c||u&&s)return n;let f={scrollLeft:0,scrollTop:0},h=Cr(1);const m=Cr(0),g=Tr(a);if((g||!g&&!s)&&(($o(a)!=="body"||El(c))&&(f=ld(a)),Tr(a))){const b=Ri(a);h=Do(a),m.x=b.x+a.clientLeft,m.y=b.y+a.clientTop}const y=c&&!g&&!s?HS(c,f,!0):Cr(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+m.x+y.x,y:n.y*h.y-f.scrollTop*h.y+m.y+y.y}}function Cz(e){return Array.from(e.getClientRects())}function Tz(e){const t=Rr(e),n=ld(e),a=e.ownerDocument.body,o=On(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=On(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let c=-n.scrollLeft+Cg(e);const u=-n.scrollTop;return ur(a).direction==="rtl"&&(c+=On(t.clientWidth,a.clientWidth)-o),{width:o,height:s,x:c,y:u}}function Rz(e,t){const n=Ln(e),a=Rr(e),o=n.visualViewport;let s=a.clientWidth,c=a.clientHeight,u=0,f=0;if(o){s=o.width,c=o.height;const h=Sg();(!h||h&&t==="fixed")&&(u=o.offsetLeft,f=o.offsetTop)}return{width:s,height:c,x:u,y:f}}function Az(e,t){const n=Ri(e,!0,t==="fixed"),a=n.top+e.clientTop,o=n.left+e.clientLeft,s=Tr(e)?Do(e):Cr(1),c=e.clientWidth*s.x,u=e.clientHeight*s.y,f=o*s.x,h=a*s.y;return{width:c,height:u,x:f,y:h}}function I0(e,t,n){let a;if(t==="viewport")a=Rz(e,n);else if(t==="document")a=Tz(Rr(e));else if(cr(t))a=Az(t,n);else{const o=IS(e);a={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ku(a)}function $S(e,t){const n=$a(e);return n===t||!cr(n)||Oo(n)?!1:ur(n).position==="fixed"||$S(n,t)}function Dz(e,t){const n=t.get(e);if(n)return n;let a=ul(e,[],!1).filter(u=>cr(u)&&$o(u)!=="body"),o=null;const s=ur(e).position==="fixed";let c=s?$a(e):e;for(;cr(c)&&!Oo(c);){const u=ur(c),f=Eg(c);!f&&u.position==="fixed"&&(o=null),(s?!f&&!o:!f&&u.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||El(c)&&!f&&$S(e,c))?a=a.filter(m=>m!==c):o=u,c=$a(c)}return t.set(e,a),a}function kz(e){let{element:t,boundary:n,rootBoundary:a,strategy:o}=e;const c=[...n==="clippingAncestors"?sd(t)?[]:Dz(t,this._c):[].concat(n),a],u=c[0],f=c.reduce((h,m)=>{const g=I0(t,m,o);return h.top=On(g.top,h.top),h.right=Ia(g.right,h.right),h.bottom=Ia(g.bottom,h.bottom),h.left=On(g.left,h.left),h},I0(t,u,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Nz(e){const{width:t,height:n}=BS(e);return{width:t,height:n}}function Oz(e,t,n){const a=Tr(t),o=Rr(t),s=n==="fixed",c=Ri(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const f=Cr(0);if(a||!a&&!s)if(($o(t)!=="body"||El(o))&&(u=ld(t)),a){const y=Ri(t,!0,s,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else o&&(f.x=Cg(o));const h=o&&!a&&!s?HS(o,u):Cr(0),m=c.left+u.scrollLeft-f.x-h.x,g=c.top+u.scrollTop-f.y-h.y;return{x:m,y:g,width:c.width,height:c.height}}function tp(e){return ur(e).position==="static"}function H0(e,t){if(!Tr(e)||ur(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Rr(e)===n&&(n=n.ownerDocument.body),n}function VS(e,t){const n=Ln(e);if(sd(e))return n;if(!Tr(e)){let o=$a(e);for(;o&&!Oo(o);){if(cr(o)&&!tp(o))return o;o=$a(o)}return n}let a=H0(e,t);for(;a&&xz(a)&&tp(a);)a=H0(a,t);return a&&Oo(a)&&tp(a)&&!Eg(a)?n:a||wz(e)||n}const jz=async function(e){const t=this.getOffsetParent||VS,n=this.getDimensions,a=await n(e.floating);return{reference:Oz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Lz(e){return ur(e).direction==="rtl"}const zz={convertOffsetParentRelativeRectToViewportRelativeRect:_z,getDocumentElement:Rr,getClippingRect:kz,getOffsetParent:VS,getElementRects:jz,getClientRects:Cz,getDimensions:Nz,getScale:Do,isElement:cr,isRTL:Lz};function qS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mz(e,t){let n=null,a;const o=Rr(e);function s(){var u;clearTimeout(a),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),s();const h=e.getBoundingClientRect(),{left:m,top:g,width:y,height:b}=h;if(u||t(),!y||!b)return;const S=qc(g),E=qc(o.clientWidth-(m+y)),_=qc(o.clientHeight-(g+b)),N=qc(m),A={rootMargin:-S+"px "+-E+"px "+-_+"px "+-N+"px",threshold:On(0,Ia(1,f))||1};let k=!0;function D(M){const R=M[0].intersectionRatio;if(R!==f){if(!k)return c();R?c(!1,R):a=setTimeout(()=>{c(!1,1e-7)},1e3)}R===1&&!qS(h,e.getBoundingClientRect())&&c(),k=!1}try{n=new IntersectionObserver(D,{...A,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,A)}n.observe(e)}return c(!0),s}function Pz(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=a,h=_g(e),m=o||s?[...h?ul(h):[],...ul(t)]:[];m.forEach(N=>{o&&N.addEventListener("scroll",n,{passive:!0}),s&&N.addEventListener("resize",n)});const g=h&&u?Mz(h,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(N=>{let[C]=N;C&&C.target===h&&b&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var A;(A=b)==null||A.observe(t)})),n()}),h&&!f&&b.observe(h),b.observe(t));let S,E=f?Ri(e):null;f&&_();function _(){const N=Ri(e);E&&!qS(E,N)&&n(),E=N,S=requestAnimationFrame(_)}return n(),()=>{var N;m.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),g==null||g(),(N=b)==null||N.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const Gz=gz,Fz=vz,Uz=hz,Bz=bz,Iz=pz,$0=fz,Hz=yz,$z=(e,t,n)=>{const a=new Map,o={platform:zz,...n},s={...o.platform,_c:a};return dz(e,t,{...o,platform:s})};var pu=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Nu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,a,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!Nu(e[a],t[a]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,o[a]))return!1;for(a=n;a--!==0;){const s=o[a];if(!(s==="_owner"&&e.$$typeof)&&!Nu(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function YS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function V0(e,t){const n=YS(e);return Math.round(t*n)/n}function np(e){const t=w.useRef(e);return pu(()=>{t.current=e}),t}function Vz(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:o,elements:{reference:s,floating:c}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[m,g]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=w.useState(a);Nu(y,a)||b(a);const[S,E]=w.useState(null),[_,N]=w.useState(null),C=w.useCallback(j=>{j!==M.current&&(M.current=j,E(j))},[]),A=w.useCallback(j=>{j!==R.current&&(R.current=j,N(j))},[]),k=s||S,D=c||_,M=w.useRef(null),R=w.useRef(null),U=w.useRef(m),L=f!=null,I=np(f),q=np(o),Y=np(h),B=w.useCallback(()=>{if(!M.current||!R.current)return;const j={placement:t,strategy:n,middleware:y};q.current&&(j.platform=q.current),$z(M.current,R.current,j).then(K=>{const G={...K,isPositioned:Y.current!==!1};X.current&&!Nu(U.current,G)&&(U.current=G,xl.flushSync(()=>{g(G)}))})},[y,t,n,q,Y]);pu(()=>{h===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,g(j=>({...j,isPositioned:!1})))},[h]);const X=w.useRef(!1);pu(()=>(X.current=!0,()=>{X.current=!1}),[]),pu(()=>{if(k&&(M.current=k),D&&(R.current=D),k&&D){if(I.current)return I.current(k,D,B);B()}},[k,D,B,I,L]);const ne=w.useMemo(()=>({reference:M,floating:R,setReference:C,setFloating:A}),[C,A]),F=w.useMemo(()=>({reference:k,floating:D}),[k,D]),z=w.useMemo(()=>{const j={position:n,left:0,top:0};if(!F.floating)return j;const K=V0(F.floating,m.x),G=V0(F.floating,m.y);return u?{...j,transform:"translate("+K+"px, "+G+"px)",...YS(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:G}},[n,u,F.floating,m.x,m.y]);return w.useMemo(()=>({...m,update:B,refs:ne,elements:F,floatingStyles:z}),[m,B,ne,F,z])}const qz=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:o}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?$0({element:a.current,padding:o}).fn(n):{}:a?$0({element:a,padding:o}).fn(n):{}}}},Yz=(e,t)=>({...Gz(e),options:[e,t]}),Wz=(e,t)=>({...Fz(e),options:[e,t]}),Xz=(e,t)=>({...Hz(e),options:[e,t]}),Kz=(e,t)=>({...Uz(e),options:[e,t]}),Zz=(e,t)=>({...Bz(e),options:[e,t]}),Qz=(e,t)=>({...Iz(e),options:[e,t]}),Jz=(e,t)=>({...qz(e),options:[e,t]});var eM="Arrow",WS=w.forwardRef((e,t)=>{const{children:n,width:a=10,height:o=5,...s}=e;return x.jsx(Ie.svg,{...s,ref:t,width:a,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});WS.displayName=eM;var tM=WS;function XS(e){const[t,n]=w.useState(void 0);return sn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let c,u;if("borderBoxSize"in s){const f=s.borderBoxSize,h=Array.isArray(f)?f[0]:f;c=h.inlineSize,u=h.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var Tg="Popper",[KS,Vo]=Kn(Tg),[nM,ZS]=KS(Tg),QS=e=>{const{__scopePopper:t,children:n}=e,[a,o]=w.useState(null);return x.jsx(nM,{scope:t,anchor:a,onAnchorChange:o,children:n})};QS.displayName=Tg;var JS="PopperAnchor",e_=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...o}=e,s=ZS(JS,n),c=w.useRef(null),u=nt(t,c);return w.useEffect(()=>{s.onAnchorChange((a==null?void 0:a.current)||c.current)}),a?null:x.jsx(Ie.div,{...o,ref:u})});e_.displayName=JS;var Rg="PopperContent",[rM,aM]=KS(Rg),t_=w.forwardRef((e,t)=>{var ie,oe,Ce,he,Se,be;const{__scopePopper:n,side:a="bottom",sideOffset:o=0,align:s="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:S,...E}=e,_=ZS(Rg,n),[N,C]=w.useState(null),A=nt(t,Le=>C(Le)),[k,D]=w.useState(null),M=XS(k),R=(M==null?void 0:M.width)??0,U=(M==null?void 0:M.height)??0,L=a+(s!=="center"?"-"+s:""),I=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},q=Array.isArray(h)?h:[h],Y=q.length>0,B={padding:I,boundary:q.filter(oM),altBoundary:Y},{refs:X,floatingStyles:ne,placement:F,isPositioned:z,middlewareData:j}=Vz({strategy:"fixed",placement:L,whileElementsMounted:(...Le)=>Pz(...Le,{animationFrame:b==="always"}),elements:{reference:_.anchor},middleware:[Yz({mainAxis:o+U,alignmentAxis:c}),f&&Wz({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Xz():void 0,...B}),f&&Kz({...B}),Zz({...B,apply:({elements:Le,rects:Te,availableWidth:ye,availableHeight:J})=>{const{width:le,height:_e}=Te.reference,pe=Le.floating.style;pe.setProperty("--radix-popper-available-width",`${ye}px`),pe.setProperty("--radix-popper-available-height",`${J}px`),pe.setProperty("--radix-popper-anchor-width",`${le}px`),pe.setProperty("--radix-popper-anchor-height",`${_e}px`)}}),k&&Jz({element:k,padding:u}),sM({arrowWidth:R,arrowHeight:U}),y&&Qz({strategy:"referenceHidden",...B})]}),[K,G]=a_(F),H=Zt(S);sn(()=>{z&&(H==null||H())},[z,H]);const O=(ie=j.arrow)==null?void 0:ie.x,$=(oe=j.arrow)==null?void 0:oe.y,W=((Ce=j.arrow)==null?void 0:Ce.centerOffset)!==0,[re,de]=w.useState();return sn(()=>{N&&de(window.getComputedStyle(N).zIndex)},[N]),x.jsx("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:z?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(he=j.transformOrigin)==null?void 0:he.x,(Se=j.transformOrigin)==null?void 0:Se.y].join(" "),...((be=j.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(rM,{scope:n,placedSide:K,onArrowChange:D,arrowX:O,arrowY:$,shouldHideArrow:W,children:x.jsx(Ie.div,{"data-side":K,"data-align":G,...E,ref:A,style:{...E.style,animation:z?void 0:"none"}})})})});t_.displayName=Rg;var n_="PopperArrow",iM={top:"bottom",right:"left",bottom:"top",left:"right"},r_=w.forwardRef(function(t,n){const{__scopePopper:a,...o}=t,s=aM(n_,a),c=iM[s.placedSide];return x.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:x.jsx(tM,{...o,ref:n,style:{...o.style,display:"block"}})})});r_.displayName=n_;function oM(e){return e!==null}var sM=e=>({name:"transformOrigin",options:e,fn(t){var _,N,C;const{placement:n,rects:a,middlewareData:o}=t,c=((_=o.arrow)==null?void 0:_.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,m]=a_(n),g={start:"0%",center:"50%",end:"100%"}[m],y=(((N=o.arrow)==null?void 0:N.x)??0)+u/2,b=(((C=o.arrow)==null?void 0:C.y)??0)+f/2;let S="",E="";return h==="bottom"?(S=c?g:`${y}px`,E=`${-f}px`):h==="top"?(S=c?g:`${y}px`,E=`${a.floating.height+f}px`):h==="right"?(S=`${-f}px`,E=c?g:`${b}px`):h==="left"&&(S=`${a.floating.width+f}px`,E=c?g:`${b}px`),{data:{x:S,y:E}}}});function a_(e){const[t,n="center"]=e.split("-");return[t,n]}var Ag=QS,cd=e_,Dg=t_,kg=r_,lM="VisuallyHidden",Ng=w.forwardRef((e,t)=>x.jsx(Ie.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Ng.displayName=lM;var cM=Ng,[ud,$6]=Kn("Tooltip",[Vo]),dd=Vo(),i_="TooltipProvider",uM=700,vm="tooltip.open",[dM,Og]=ud(i_),o_=e=>{const{__scopeTooltip:t,delayDuration:n=uM,skipDelayDuration:a=300,disableHoverableContent:o=!1,children:s}=e,[c,u]=w.useState(!0),f=w.useRef(!1),h=w.useRef(0);return w.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),x.jsx(dM,{scope:t,isOpenDelayed:c,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(h.current),u(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(!0),a)},[a]),isPointerInTransitRef:f,onPointerInTransitChange:w.useCallback(m=>{f.current=m},[]),disableHoverableContent:o,children:s})};o_.displayName=i_;var fd="Tooltip",[fM,hd]=ud(fd),s_=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:c,delayDuration:u}=e,f=Og(fd,e.__scopeTooltip),h=dd(t),[m,g]=w.useState(null),y=on(),b=w.useRef(0),S=c??f.disableHoverableContent,E=u??f.delayDuration,_=w.useRef(!1),[N=!1,C]=aa({prop:a,defaultProp:o,onChange:R=>{R?(f.onOpen(),document.dispatchEvent(new CustomEvent(vm))):f.onClose(),s==null||s(R)}}),A=w.useMemo(()=>N?_.current?"delayed-open":"instant-open":"closed",[N]),k=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,_.current=!1,C(!0)},[C]),D=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C(!1)},[C]),M=w.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{_.current=!0,C(!0),b.current=0},E)},[E,C]);return w.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),x.jsx(Ag,{...h,children:x.jsx(fM,{scope:t,contentId:y,open:N,stateAttribute:A,trigger:m,onTriggerChange:g,onTriggerEnter:w.useCallback(()=>{f.isOpenDelayed?M():k()},[f.isOpenDelayed,M,k]),onTriggerLeave:w.useCallback(()=>{S?D():(window.clearTimeout(b.current),b.current=0)},[D,S]),onOpen:k,onClose:D,disableHoverableContent:S,children:n})})};s_.displayName=fd;var ym="TooltipTrigger",l_=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,o=hd(ym,n),s=Og(ym,n),c=dd(n),u=w.useRef(null),f=nt(t,u,o.onTriggerChange),h=w.useRef(!1),m=w.useRef(!1),g=w.useCallback(()=>h.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),x.jsx(cd,{asChild:!0,...c,children:x.jsx(Ie.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...a,ref:f,onPointerMove:Be(e.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:Be(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:Be(e.onPointerDown,()=>{h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Be(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:Be(e.onBlur,o.onClose),onClick:Be(e.onClick,o.onClose)})})});l_.displayName=ym;var hM="TooltipPortal",[V6,pM]=ud(hM,{forceMount:void 0}),jo="TooltipContent",c_=w.forwardRef((e,t)=>{const n=pM(jo,e.__scopeTooltip),{forceMount:a=n.forceMount,side:o="top",...s}=e,c=hd(jo,e.__scopeTooltip);return x.jsx(zn,{present:a||c.open,children:c.disableHoverableContent?x.jsx(u_,{side:o,...s,ref:t}):x.jsx(mM,{side:o,...s,ref:t})})}),mM=w.forwardRef((e,t)=>{const n=hd(jo,e.__scopeTooltip),a=Og(jo,e.__scopeTooltip),o=w.useRef(null),s=nt(t,o),[c,u]=w.useState(null),{trigger:f,onClose:h}=n,m=o.current,{onPointerInTransitChange:g}=a,y=w.useCallback(()=>{u(null),g(!1)},[g]),b=w.useCallback((S,E)=>{const _=S.currentTarget,N={x:S.clientX,y:S.clientY},C=bM(N,_.getBoundingClientRect()),A=xM(N,C),k=wM(E.getBoundingClientRect()),D=SM([...A,...k]);u(D),g(!0)},[g]);return w.useEffect(()=>()=>y(),[y]),w.useEffect(()=>{if(f&&m){const S=_=>b(_,m),E=_=>b(_,f);return f.addEventListener("pointerleave",S),m.addEventListener("pointerleave",E),()=>{f.removeEventListener("pointerleave",S),m.removeEventListener("pointerleave",E)}}},[f,m,b,y]),w.useEffect(()=>{if(c){const S=E=>{const _=E.target,N={x:E.clientX,y:E.clientY},C=(f==null?void 0:f.contains(_))||(m==null?void 0:m.contains(_)),A=!EM(N,c);C?y():A&&(y(),h())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[f,m,c,h,y]),x.jsx(u_,{...e,ref:s})}),[gM,vM]=ud(fd,{isInside:!1}),u_=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:c,...u}=e,f=hd(jo,n),h=dd(n),{onClose:m}=f;return w.useEffect(()=>(document.addEventListener(vm,m),()=>document.removeEventListener(vm,m)),[m]),w.useEffect(()=>{if(f.trigger){const g=y=>{const b=y.target;b!=null&&b.contains(f.trigger)&&m()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[f.trigger,m]),x.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:m,children:x.jsxs(Dg,{"data-state":f.stateAttribute,...h,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[x.jsx(sg,{children:a}),x.jsx(gM,{scope:n,isInside:!0,children:x.jsx(cM,{id:f.contentId,role:"tooltip",children:o||a})})]})})});c_.displayName=jo;var d_="TooltipArrow",yM=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,o=dd(n);return vM(d_,n).isInside?null:x.jsx(kg,{...o,...a,ref:t})});yM.displayName=d_;function bM(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,a,o,s)){case s:return"left";case o:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function xM(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function wM(e){const{top:t,right:n,bottom:a,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:a},{x:o,y:a}]}function EM(e,t){const{x:n,y:a}=e;let o=!1;for(let s=0,c=t.length-1;s<t.length;c=s++){const u=t[s].x,f=t[s].y,h=t[c].x,m=t[c].y;f>a!=m>a&&n<(h-u)*(a-f)/(m-f)+u&&(o=!o)}return o}function SM(e){const t=e.slice();return t.sort((n,a)=>n.x<a.x?-1:n.x>a.x?1:n.y<a.y?-1:n.y>a.y?1:0),_M(t)}function _M(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const o=e[a];for(;t.length>=2;){const s=t[t.length-1],c=t[t.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const o=e[a];for(;n.length>=2;){const s=n[n.length-1],c=n[n.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var CM=o_,TM=s_,RM=l_,f_=c_;const h_=CM,p_=TM,m_=RM,AM=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>x.jsxs(w.Fragment,{children:[t,n<e.split("\\n").length-1&&x.jsx("br",{})]},n)),jg=w.forwardRef(({className:e,sideOffset:t=4,children:n,...a},o)=>x.jsx(f_,{ref:o,sideOffset:t,className:Oe("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 mx-1 max-w-sm overflow-hidden rounded-md border px-3 py-2 text-sm shadow-md",e),...a,children:typeof n=="string"?AM(n):n}));jg.displayName=f_.displayName;const Ou=sE("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-8"}},defaultVariants:{variant:"default",size:"default"}}),wt=w.forwardRef(({className:e,variant:t,tooltip:n,size:a,side:o="right",asChild:s=!1,...c},u)=>{const f=s?Ba:"button";return n?x.jsx(h_,{children:x.jsxs(p_,{children:[x.jsx(m_,{asChild:!0,children:x.jsx(f,{className:Oe(Ou({variant:t,size:a,className:e}),"cursor-pointer"),ref:u,...c})}),x.jsx(jg,{side:o,children:n})]})}):x.jsx(f,{className:Oe(Ou({variant:t,size:a,className:e}),"cursor-pointer"),ref:u,...c})});wt.displayName="Button";const DM=tz,kM=nz,g_=w.forwardRef(({className:e,...t},n)=>x.jsx(OS,{className:Oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:n}));g_.displayName=OS.displayName;const v_=w.forwardRef(({className:e,...t},n)=>x.jsxs(kM,{children:[x.jsx(g_,{}),x.jsx(jS,{ref:n,className:Oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));v_.displayName=jS.displayName;const y_=({className:e,...t})=>x.jsx("div",{className:Oe("flex flex-col space-y-2 text-center sm:text-left",e),...t});y_.displayName="AlertDialogHeader";const b_=w.forwardRef(({className:e,...t},n)=>x.jsx(MS,{ref:n,className:Oe("text-lg font-semibold",e),...t}));b_.displayName=MS.displayName;const x_=w.forwardRef(({className:e,...t},n)=>x.jsx(PS,{ref:n,className:Oe("text-muted-foreground text-sm",e),...t}));x_.displayName=PS.displayName;const NM=w.forwardRef(({className:e,...t},n)=>x.jsx(LS,{ref:n,className:Oe(Ou(),e),...t}));NM.displayName=LS.displayName;const OM=w.forwardRef(({className:e,...t},n)=>x.jsx(zS,{ref:n,className:Oe(Ou({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));OM.displayName=zS.displayName;const Ai=w.forwardRef(({className:e,type:t,...n},a)=>x.jsx("input",{type:t,className:Oe("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...n}));Ai.displayName="Input";var jM=e=>{switch(e){case"success":return MM;case"info":return GM;case"warning":return PM;case"error":return FM;default:return null}},LM=Array(12).fill(0),zM=({visible:e,className:t})=>ve.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ve.createElement("div",{className:"sonner-spinner"},LM.map((n,a)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),MM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),PM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),GM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),FM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),UM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),BM=()=>{let[e,t]=ve.useState(document.hidden);return ve.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},bm=1,IM=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...a}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:bm++,s=this.toasts.find(u=>u.id===o),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(u=>u.id===o?(this.publish({...u,...e,id:o,title:n}),{...u,...e,id:o,dismissible:c,title:n}):u):this.addToast({title:n,...a,dismissible:c,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let a=e instanceof Promise?e:e(),o=n!==void 0,s,c=a.then(async f=>{if(s=["resolve",f],ve.isValidElement(f))o=!1,this.create({id:n,type:"default",message:f});else if($M(f)&&!f.ok){o=!1;let h=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,m=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description;this.create({id:n,type:"error",message:h,description:m})}else if(t.success!==void 0){o=!1;let h=typeof t.success=="function"?await t.success(f):t.success,m=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"success",message:h,description:m})}}).catch(async f=>{if(s=["reject",f],t.error!==void 0){o=!1;let h=typeof t.error=="function"?await t.error(f):t.error,m=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"error",message:h,description:m})}}).finally(()=>{var f;o&&(this.dismiss(n),n=void 0),(f=t.finally)==null||f.call(t)}),u=()=>new Promise((f,h)=>c.then(()=>s[0]==="reject"?h(s[1]):f(s[1])).catch(h));return typeof n!="string"&&typeof n!="number"?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||bm++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},xn=new IM,HM=(e,t)=>{let n=(t==null?void 0:t.id)||bm++;return xn.addToast({title:e,...t,id:n}),n},$M=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",VM=HM,qM=()=>xn.toasts,YM=()=>xn.getActiveToasts(),an=Object.assign(VM,{success:xn.success,info:xn.info,warning:xn.warning,error:xn.error,custom:xn.custom,message:xn.message,promise:xn.promise,dismiss:xn.dismiss,loading:xn.loading},{getHistory:qM,getToasts:YM});function WM(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t==="top"&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}WM(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function Yc(e){return e.label!==void 0}var XM=3,KM="32px",ZM="16px",q0=4e3,QM=356,JM=14,eP=20,tP=200;function ar(...e){return e.filter(Boolean).join(" ")}function nP(e){let[t,n]=e.split("-"),a=[];return t&&a.push(t),n&&a.push(n),a}var rP=e=>{var t,n,a,o,s,c,u,f,h,m,g;let{invert:y,toast:b,unstyled:S,interacting:E,setHeights:_,visibleToasts:N,heights:C,index:A,toasts:k,expanded:D,removeToast:M,defaultRichColors:R,closeButton:U,style:L,cancelButtonStyle:I,actionButtonStyle:q,className:Y="",descriptionClassName:B="",duration:X,position:ne,gap:F,loadingIcon:z,expandByDefault:j,classNames:K,icons:G,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:O}=e,[$,W]=ve.useState(null),[re,de]=ve.useState(null),[ie,oe]=ve.useState(!1),[Ce,he]=ve.useState(!1),[Se,be]=ve.useState(!1),[Le,Te]=ve.useState(!1),[ye,J]=ve.useState(!1),[le,_e]=ve.useState(0),[pe,Ee]=ve.useState(0),te=ve.useRef(b.duration||X||q0),Fe=ve.useRef(null),Pe=ve.useRef(null),me=A===0,Ae=A+1<=N,je=b.type,He=b.dismissible!==!1,it=b.className||"",Ct=b.descriptionClassName||"",bt=ve.useMemo(()=>C.findIndex(qe=>qe.toastId===b.id)||0,[C,b.id]),qt=ve.useMemo(()=>{var qe;return(qe=b.closeButton)!=null?qe:U},[b.closeButton,U]),fn=ve.useMemo(()=>b.duration||X||q0,[b.duration,X]),Gt=ve.useRef(0),at=ve.useRef(0),Tn=ve.useRef(0),xt=ve.useRef(null),[Lt,Wa]=ne.split("-"),ji=ve.useMemo(()=>C.reduce((qe,lt,pt)=>pt>=bt?qe:qe+lt.height,0),[C,bt]),Ol=BM(),Li=b.invert||y,ca=je==="loading";at.current=ve.useMemo(()=>bt*F+ji,[bt,ji]),ve.useEffect(()=>{te.current=fn},[fn]),ve.useEffect(()=>{oe(!0)},[]),ve.useEffect(()=>{let qe=Pe.current;if(qe){let lt=qe.getBoundingClientRect().height;return Ee(lt),_(pt=>[{toastId:b.id,height:lt,position:b.position},...pt]),()=>_(pt=>pt.filter(hn=>hn.toastId!==b.id))}},[_,b.id]),ve.useLayoutEffect(()=>{if(!ie)return;let qe=Pe.current,lt=qe.style.height;qe.style.height="auto";let pt=qe.getBoundingClientRect().height;qe.style.height=lt,Ee(pt),_(hn=>hn.find(ln=>ln.toastId===b.id)?hn.map(ln=>ln.toastId===b.id?{...ln,height:pt}:ln):[{toastId:b.id,height:pt,position:b.position},...hn])},[ie,b.title,b.description,_,b.id]);let Jt=ve.useCallback(()=>{he(!0),_e(at.current),_(qe=>qe.filter(lt=>lt.toastId!==b.id)),setTimeout(()=>{M(b)},tP)},[b,M,_,at]);ve.useEffect(()=>{if(b.promise&&je==="loading"||b.duration===1/0||b.type==="loading")return;let qe;return D||E||O&&Ol?(()=>{if(Tn.current<Gt.current){let lt=new Date().getTime()-Gt.current;te.current=te.current-lt}Tn.current=new Date().getTime()})():te.current!==1/0&&(Gt.current=new Date().getTime(),qe=setTimeout(()=>{var lt;(lt=b.onAutoClose)==null||lt.call(b,b),Jt()},te.current)),()=>clearTimeout(qe)},[D,E,b,je,O,Ol,Jt]),ve.useEffect(()=>{b.delete&&Jt()},[Jt,b.delete]);function zi(){var qe,lt,pt;return G!=null&&G.loading?ve.createElement("div",{className:ar(K==null?void 0:K.loader,(qe=b==null?void 0:b.classNames)==null?void 0:qe.loader,"sonner-loader"),"data-visible":je==="loading"},G.loading):z?ve.createElement("div",{className:ar(K==null?void 0:K.loader,(lt=b==null?void 0:b.classNames)==null?void 0:lt.loader,"sonner-loader"),"data-visible":je==="loading"},z):ve.createElement(zM,{className:ar(K==null?void 0:K.loader,(pt=b==null?void 0:b.classNames)==null?void 0:pt.loader),visible:je==="loading"})}return ve.createElement("li",{tabIndex:0,ref:Pe,className:ar(Y,it,K==null?void 0:K.toast,(t=b==null?void 0:b.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[je],(n=b==null?void 0:b.classNames)==null?void 0:n[je]),"data-sonner-toast":"","data-rich-colors":(a=b.richColors)!=null?a:R,"data-styled":!(b.jsx||b.unstyled||S),"data-mounted":ie,"data-promise":!!b.promise,"data-swiped":ye,"data-removed":Ce,"data-visible":Ae,"data-y-position":Lt,"data-x-position":Wa,"data-index":A,"data-front":me,"data-swiping":Se,"data-dismissible":He,"data-type":je,"data-invert":Li,"data-swipe-out":Le,"data-swipe-direction":re,"data-expanded":!!(D||j&&ie),style:{"--index":A,"--toasts-before":A,"--z-index":k.length-A,"--offset":`${Ce?le:at.current}px`,"--initial-height":j?"auto":`${pe}px`,...L,...b.style},onDragEnd:()=>{be(!1),W(null),xt.current=null},onPointerDown:qe=>{ca||!He||(Fe.current=new Date,_e(at.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName!=="BUTTON"&&(be(!0),xt.current={x:qe.clientX,y:qe.clientY}))},onPointerUp:()=>{var qe,lt,pt,hn;if(Le||!He)return;xt.current=null;let ln=Number(((qe=Pe.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),pn=Number(((lt=Pe.current)==null?void 0:lt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Nr=new Date().getTime()-((pt=Fe.current)==null?void 0:pt.getTime()),mn=$==="x"?ln:pn,Jn=Math.abs(mn)/Nr;if(Math.abs(mn)>=eP||Jn>.11){_e(at.current),(hn=b.onDismiss)==null||hn.call(b,b),de($==="x"?ln>0?"right":"left":pn>0?"down":"up"),Jt(),Te(!0),J(!1);return}be(!1),W(null)},onPointerMove:qe=>{var lt,pt,hn,ln;if(!xt.current||!He||((lt=window.getSelection())==null?void 0:lt.toString().length)>0)return;let pn=qe.clientY-xt.current.y,Nr=qe.clientX-xt.current.x,mn=(pt=e.swipeDirections)!=null?pt:nP(ne);!$&&(Math.abs(Nr)>1||Math.abs(pn)>1)&&W(Math.abs(Nr)>Math.abs(pn)?"x":"y");let Jn={x:0,y:0};$==="y"?(mn.includes("top")||mn.includes("bottom"))&&(mn.includes("top")&&pn<0||mn.includes("bottom")&&pn>0)&&(Jn.y=pn):$==="x"&&(mn.includes("left")||mn.includes("right"))&&(mn.includes("left")&&Nr<0||mn.includes("right")&&Nr>0)&&(Jn.x=Nr),(Math.abs(Jn.x)>0||Math.abs(Jn.y)>0)&&J(!0),(hn=Pe.current)==null||hn.style.setProperty("--swipe-amount-x",`${Jn.x}px`),(ln=Pe.current)==null||ln.style.setProperty("--swipe-amount-y",`${Jn.y}px`)}},qt&&!b.jsx?ve.createElement("button",{"aria-label":H,"data-disabled":ca,"data-close-button":!0,onClick:ca||!He?()=>{}:()=>{var qe;Jt(),(qe=b.onDismiss)==null||qe.call(b,b)},className:ar(K==null?void 0:K.closeButton,(o=b==null?void 0:b.classNames)==null?void 0:o.closeButton)},(s=G==null?void 0:G.close)!=null?s:UM):null,b.jsx||w.isValidElement(b.title)?b.jsx?b.jsx:typeof b.title=="function"?b.title():b.title:ve.createElement(ve.Fragment,null,je||b.icon||b.promise?ve.createElement("div",{"data-icon":"",className:ar(K==null?void 0:K.icon,(c=b==null?void 0:b.classNames)==null?void 0:c.icon)},b.promise||b.type==="loading"&&!b.icon?b.icon||zi():null,b.type!=="loading"?b.icon||(G==null?void 0:G[je])||jM(je):null):null,ve.createElement("div",{"data-content":"",className:ar(K==null?void 0:K.content,(u=b==null?void 0:b.classNames)==null?void 0:u.content)},ve.createElement("div",{"data-title":"",className:ar(K==null?void 0:K.title,(f=b==null?void 0:b.classNames)==null?void 0:f.title)},typeof b.title=="function"?b.title():b.title),b.description?ve.createElement("div",{"data-description":"",className:ar(B,Ct,K==null?void 0:K.description,(h=b==null?void 0:b.classNames)==null?void 0:h.description)},typeof b.description=="function"?b.description():b.description):null),w.isValidElement(b.cancel)?b.cancel:b.cancel&&Yc(b.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:b.cancelButtonStyle||I,onClick:qe=>{var lt,pt;Yc(b.cancel)&&He&&((pt=(lt=b.cancel).onClick)==null||pt.call(lt,qe),Jt())},className:ar(K==null?void 0:K.cancelButton,(m=b==null?void 0:b.classNames)==null?void 0:m.cancelButton)},b.cancel.label):null,w.isValidElement(b.action)?b.action:b.action&&Yc(b.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:b.actionButtonStyle||q,onClick:qe=>{var lt,pt;Yc(b.action)&&((pt=(lt=b.action).onClick)==null||pt.call(lt,qe),!qe.defaultPrevented&&Jt())},className:ar(K==null?void 0:K.actionButton,(g=b==null?void 0:b.classNames)==null?void 0:g.actionButton)},b.action.label):null))};function Y0(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function aP(e,t){let n={};return[e,t].forEach((a,o)=>{let s=o===1,c=s?"--mobile-offset":"--offset",u=s?ZM:KM;function f(h){["top","right","bottom","left"].forEach(m=>{n[`${c}-${m}`]=typeof h=="number"?`${h}px`:h})}typeof a=="number"||typeof a=="string"?f(a):typeof a=="object"?["top","right","bottom","left"].forEach(h=>{a[h]===void 0?n[`${c}-${h}`]=u:n[`${c}-${h}`]=typeof a[h]=="number"?`${a[h]}px`:a[h]}):f(u)}),n}var iP=w.forwardRef(function(e,t){let{invert:n,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:c,className:u,offset:f,mobileOffset:h,theme:m="light",richColors:g,duration:y,style:b,visibleToasts:S=XM,toastOptions:E,dir:_=Y0(),gap:N=JM,loadingIcon:C,icons:A,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:D}=e,[M,R]=ve.useState([]),U=ve.useMemo(()=>Array.from(new Set([a].concat(M.filter(O=>O.position).map(O=>O.position)))),[M,a]),[L,I]=ve.useState([]),[q,Y]=ve.useState(!1),[B,X]=ve.useState(!1),[ne,F]=ve.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=ve.useRef(null),j=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=ve.useRef(null),G=ve.useRef(!1),H=ve.useCallback(O=>{R($=>{var W;return(W=$.find(re=>re.id===O.id))!=null&&W.delete||xn.dismiss(O.id),$.filter(({id:re})=>re!==O.id)})},[]);return ve.useEffect(()=>xn.subscribe(O=>{if(O.dismiss){R($=>$.map(W=>W.id===O.id?{...W,delete:!0}:W));return}setTimeout(()=>{$E.flushSync(()=>{R($=>{let W=$.findIndex(re=>re.id===O.id);return W!==-1?[...$.slice(0,W),{...$[W],...O},...$.slice(W+1)]:[O,...$]})})})}),[]),ve.useEffect(()=>{if(m!=="system"){F(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;let O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:$})=>{F($?"dark":"light")})}catch{O.addListener(({matches:W})=>{try{F(W?"dark":"light")}catch(re){console.error(re)}})}},[m]),ve.useEffect(()=>{M.length<=1&&Y(!1)},[M]),ve.useEffect(()=>{let O=$=>{var W,re;o.every(de=>$[de]||$.code===de)&&(Y(!0),(W=z.current)==null||W.focus()),$.code==="Escape"&&(document.activeElement===z.current||(re=z.current)!=null&&re.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[o]),ve.useEffect(()=>{if(z.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,G.current=!1)}},[z.current]),ve.createElement("section",{ref:t,"aria-label":`${k} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((O,$)=>{var W;let[re,de]=O.split("-");return M.length?ve.createElement("ol",{key:O,dir:_==="auto"?Y0():_,tabIndex:-1,ref:z,className:u,"data-sonner-toaster":!0,"data-theme":ne,"data-y-position":re,"data-lifted":q&&M.length>1&&!s,"data-x-position":de,style:{"--front-toast-height":`${((W=L[0])==null?void 0:W.height)||0}px`,"--width":`${QM}px`,"--gap":`${N}px`,...b,...aP(f,h)},onBlur:ie=>{G.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(G.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||G.current||(G.current=!0,K.current=ie.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{B||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},M.filter(ie=>!ie.position&&$===0||ie.position===O).map((ie,oe)=>{var Ce,he;return ve.createElement(rP,{key:ie.id,icons:A,index:oe,toast:ie,defaultRichColors:g,duration:(Ce=E==null?void 0:E.duration)!=null?Ce:y,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:n,visibleToasts:S,closeButton:(he=E==null?void 0:E.closeButton)!=null?he:c,interacting:B,position:O,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,removeToast:H,toasts:M.filter(Se=>Se.position==ie.position),heights:L.filter(Se=>Se.position==ie.position),setHeights:I,expandByDefault:s,gap:N,loadingIcon:C,expanded:q,pauseWhenPageIsHidden:D,swipeDirections:e.swipeDirections})})):null}))});const oP=()=>{const[e,t]=w.useState(!0),n=Ye.use.apiKey(),[a,o]=w.useState(""),s=En.use.message();w.useEffect(()=>{o(n||"")},[n,e]),w.useEffect(()=>{s&&(s.includes(ME)||s.includes(PE))&&t(!0)},[s,t]);const c=w.useCallback(async()=>{if(Ye.setState({apiKey:a||null}),await En.getState().check()){t(!1);return}an.error("API Key is invalid")},[a]),u=w.useCallback(f=>{o(f.target.value)},[o]);return x.jsx(DM,{open:e,onOpenChange:t,children:x.jsxs(v_,{children:[x.jsxs(y_,{children:[x.jsx(b_,{children:"API Key is required"}),x.jsx(x_,{children:"Please enter your API key"})]}),x.jsxs("form",{className:"flex gap-2",onSubmit:f=>f.preventDefault(),children:[x.jsx(Ai,{type:"password",value:a,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),x.jsx(wt,{onClick:c,variant:"outline",size:"sm",children:"Save"})]})]})})};var Lg="Popover",[w_,q6]=Kn(Lg,[Vo]),Sl=Vo(),[sP,Va]=w_(Lg),E_=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,u=Sl(t),f=w.useRef(null),[h,m]=w.useState(!1),[g=!1,y]=aa({prop:a,defaultProp:o,onChange:s});return x.jsx(Ag,{...u,children:x.jsx(sP,{scope:t,contentId:on(),triggerRef:f,open:g,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(b=>!b),[y]),hasCustomAnchor:h,onCustomAnchorAdd:w.useCallback(()=>m(!0),[]),onCustomAnchorRemove:w.useCallback(()=>m(!1),[]),modal:c,children:n})})};E_.displayName=Lg;var S_="PopoverAnchor",lP=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Va(S_,n),s=Sl(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=o;return w.useEffect(()=>(c(),()=>u()),[c,u]),x.jsx(cd,{...s,...a,ref:t})});lP.displayName=S_;var __="PopoverTrigger",C_=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Va(__,n),s=Sl(n),c=nt(t,o.triggerRef),u=x.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":k_(o.open),...a,ref:c,onClick:Be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?u:x.jsx(cd,{asChild:!0,...s,children:u})});C_.displayName=__;var zg="PopoverPortal",[cP,uP]=w_(zg,{forceMount:void 0}),T_=e=>{const{__scopePopover:t,forceMount:n,children:a,container:o}=e,s=Va(zg,t);return x.jsx(cP,{scope:t,forceMount:n,children:x.jsx(zn,{present:n||s.open,children:x.jsx(td,{asChild:!0,container:o,children:a})})})};T_.displayName=zg;var Lo="PopoverContent",R_=w.forwardRef((e,t)=>{const n=uP(Lo,e.__scopePopover),{forceMount:a=n.forceMount,...o}=e,s=Va(Lo,e.__scopePopover);return x.jsx(zn,{present:a||s.open,children:s.modal?x.jsx(dP,{...o,ref:t}):x.jsx(fP,{...o,ref:t})})});R_.displayName=Lo;var dP=w.forwardRef((e,t)=>{const n=Va(Lo,e.__scopePopover),a=w.useRef(null),o=nt(t,a),s=w.useRef(!1);return w.useEffect(()=>{const c=a.current;if(c)return cg(c)},[]),x.jsx(rd,{as:Ba,allowPinchZoom:!0,children:x.jsx(A_,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),s.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,h=u.button===2||f;s.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Be(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),fP=w.forwardRef((e,t)=>{const n=Va(Lo,e.__scopePopover),a=w.useRef(!1),o=w.useRef(!1);return x.jsx(A_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(a.current||(u=n.triggerRef.current)==null||u.focus(),s.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:s=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),A_=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,...g}=e,y=Va(Lo,n),b=Sl(n);return lg(),x.jsx(ed,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(wl,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>y.onOpenChange(!1),children:x.jsx(Dg,{"data-state":k_(y.open),role:"dialog",id:y.contentId,...b,...g,ref:t,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),D_="PopoverClose",hP=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Va(D_,n);return x.jsx(Ie.button,{type:"button",...a,ref:t,onClick:Be(e.onClick,()=>o.onOpenChange(!1))})});hP.displayName=D_;var pP="PopoverArrow",mP=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Sl(n);return x.jsx(kg,{...o,...a,ref:t})});mP.displayName=pP;function k_(e){return e?"open":"closed"}var gP=E_,vP=C_,yP=T_,N_=R_;const pd=gP,md=vP,_l=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...a},o)=>x.jsx(yP,{children:x.jsx(N_,{ref:o,align:t,sideOffset:n,className:Oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",e),...a})}));_l.displayName=N_.displayName;const bP=({status:e})=>e?x.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Storage Info"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"Working Directory:"}),x.jsx("span",{className:"truncate",children:e.working_directory}),x.jsx("span",{children:"Input Directory:"}),x.jsx("span",{className:"truncate",children:e.input_directory})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"LLM Binding:"}),x.jsx("span",{children:e.configuration.llm_binding}),x.jsx("span",{children:"LLM Binding Host:"}),x.jsx("span",{children:e.configuration.llm_binding_host}),x.jsx("span",{children:"LLM Model:"}),x.jsx("span",{children:e.configuration.llm_model}),x.jsx("span",{children:"Max Tokens:"}),x.jsx("span",{children:e.configuration.max_tokens})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"Embedding Binding:"}),x.jsx("span",{children:e.configuration.embedding_binding}),x.jsx("span",{children:"Embedding Binding Host:"}),x.jsx("span",{children:e.configuration.embedding_binding_host}),x.jsx("span",{children:"Embedding Model:"}),x.jsx("span",{children:e.configuration.embedding_model})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"KV Storage:"}),x.jsx("span",{children:e.configuration.kv_storage}),x.jsx("span",{children:"Doc Status Storage:"}),x.jsx("span",{children:e.configuration.doc_status_storage}),x.jsx("span",{children:"Graph Storage:"}),x.jsx("span",{children:e.configuration.graph_storage}),x.jsx("span",{children:"Vector Storage:"}),x.jsx("span",{children:e.configuration.vector_storage})]})]})]}):x.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),xP=()=>{const e=En.use.health(),t=En.use.lastCheckTime(),n=En.use.status(),[a,o]=w.useState(!1);return w.useEffect(()=>{o(!0);const s=setTimeout(()=>o(!1),300);return()=>clearTimeout(s)},[t]),x.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:x.jsxs(pd,{children:[x.jsx(md,{asChild:!0,children:x.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[x.jsx("div",{className:Oe("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",e?"bg-green-500":"bg-red-500",a&&"scale-125",a&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",a&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),x.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),x.jsx(_l,{className:"w-auto",side:"top",align:"end",children:x.jsx(bP,{status:n})})]})})},O_=()=>{const e=w.useContext(oE);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function wP(){const{theme:e,setTheme:t}=O_(),n=w.useCallback(()=>t("light"),[t]),a=w.useCallback(()=>t("dark"),[t]);return e==="dark"?x.jsx(wt,{onClick:n,variant:_r,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:x.jsx(JO,{})}):x.jsx(wt,{onClick:a,variant:_r,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:x.jsx(hj,{})})}function j_(e){const t=e+"CollectionProvider",[n,a]=Kn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:S,children:E}=b,_=ve.useRef(null),N=ve.useRef(new Map).current;return x.jsx(o,{scope:S,itemMap:N,collectionRef:_,children:E})};c.displayName=t;const u=e+"CollectionSlot",f=ve.forwardRef((b,S)=>{const{scope:E,children:_}=b,N=s(u,E),C=nt(S,N.collectionRef);return x.jsx(Ba,{ref:C,children:_})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=ve.forwardRef((b,S)=>{const{scope:E,children:_,...N}=b,C=ve.useRef(null),A=nt(S,C),k=s(h,E);return ve.useEffect(()=>(k.itemMap.set(C,{ref:C,...N}),()=>void k.itemMap.delete(C))),x.jsx(Ba,{[m]:"",ref:A,children:_})});g.displayName=h;function y(b){const S=s(e+"CollectionConsumer",b);return ve.useCallback(()=>{const _=S.collectionRef.current;if(!_)return[];const N=Array.from(_.querySelectorAll(`[${m}]`));return Array.from(S.itemMap.values()).sort((k,D)=>N.indexOf(k.ref.current)-N.indexOf(D.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:c,Slot:f,ItemSlot:g},y,a]}var EP=w.createContext(void 0);function gd(e){const t=w.useContext(EP);return e||t||"ltr"}var rp="rovingFocusGroup.onEntryFocus",SP={bubbles:!1,cancelable:!0},vd="RovingFocusGroup",[xm,L_,_P]=j_(vd),[CP,z_]=Kn(vd,[_P]),[TP,RP]=CP(vd),M_=w.forwardRef((e,t)=>x.jsx(xm.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(xm.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(AP,{...e,ref:t})})}));M_.displayName=vd;var AP=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:m=!1,...g}=e,y=w.useRef(null),b=nt(t,y),S=gd(s),[E=null,_]=aa({prop:c,defaultProp:u,onChange:f}),[N,C]=w.useState(!1),A=Zt(h),k=L_(n),D=w.useRef(!1),[M,R]=w.useState(0);return w.useEffect(()=>{const U=y.current;if(U)return U.addEventListener(rp,A),()=>U.removeEventListener(rp,A)},[A]),x.jsx(TP,{scope:n,orientation:a,dir:S,loop:o,currentTabStopId:E,onItemFocus:w.useCallback(U=>_(U),[_]),onItemShiftTab:w.useCallback(()=>C(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(U=>U+1),[]),onFocusableItemRemove:w.useCallback(()=>R(U=>U-1),[]),children:x.jsx(Ie.div,{tabIndex:N||M===0?-1:0,"data-orientation":a,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:Be(e.onMouseDown,()=>{D.current=!0}),onFocus:Be(e.onFocus,U=>{const L=!D.current;if(U.target===U.currentTarget&&L&&!N){const I=new CustomEvent(rp,SP);if(U.currentTarget.dispatchEvent(I),!I.defaultPrevented){const q=k().filter(F=>F.focusable),Y=q.find(F=>F.active),B=q.find(F=>F.id===E),ne=[Y,B,...q].filter(Boolean).map(F=>F.ref.current);F_(ne,m)}}D.current=!1}),onBlur:Be(e.onBlur,()=>C(!1))})})}),P_="RovingFocusGroupItem",G_=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:o=!1,tabStopId:s,...c}=e,u=on(),f=s||u,h=RP(P_,n),m=h.currentTabStopId===f,g=L_(n),{onFocusableItemAdd:y,onFocusableItemRemove:b}=h;return w.useEffect(()=>{if(a)return y(),()=>b()},[a,y,b]),x.jsx(xm.ItemSlot,{scope:n,id:f,focusable:a,active:o,children:x.jsx(Ie.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Be(e.onMouseDown,S=>{a?h.onItemFocus(f):S.preventDefault()}),onFocus:Be(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Be(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const E=NP(S,h.orientation,h.dir);if(E!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let N=g().filter(C=>C.focusable).map(C=>C.ref.current);if(E==="last")N.reverse();else if(E==="prev"||E==="next"){E==="prev"&&N.reverse();const C=N.indexOf(S.currentTarget);N=h.loop?OP(N,C+1):N.slice(C+1)}setTimeout(()=>F_(N))}})})})});G_.displayName=P_;var DP={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kP(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NP(e,t,n){const a=kP(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return DP[a]}function F_(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function OP(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var jP=M_,LP=G_,Mg="Tabs",[zP,Y6]=Kn(Mg,[z_]),U_=z_(),[MP,Pg]=zP(Mg),B_=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:o,defaultValue:s,orientation:c="horizontal",dir:u,activationMode:f="automatic",...h}=e,m=gd(u),[g,y]=aa({prop:a,onChange:o,defaultProp:s});return x.jsx(MP,{scope:n,baseId:on(),value:g,onValueChange:y,orientation:c,dir:m,activationMode:f,children:x.jsx(Ie.div,{dir:m,"data-orientation":c,...h,ref:t})})});B_.displayName=Mg;var I_="TabsList",H_=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...o}=e,s=Pg(I_,n),c=U_(n);return x.jsx(jP,{asChild:!0,...c,orientation:s.orientation,dir:s.dir,loop:a,children:x.jsx(Ie.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});H_.displayName=I_;var $_="TabsTrigger",V_=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:o=!1,...s}=e,c=Pg($_,n),u=U_(n),f=W_(c.baseId,a),h=X_(c.baseId,a),m=a===c.value;return x.jsx(LP,{asChild:!0,...u,focusable:!o,active:m,children:x.jsx(Ie.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":h,"data-state":m?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:f,...s,ref:t,onMouseDown:Be(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?c.onValueChange(a):g.preventDefault()}),onKeyDown:Be(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(a)}),onFocus:Be(e.onFocus,()=>{const g=c.activationMode!=="manual";!m&&!o&&g&&c.onValueChange(a)})})})});V_.displayName=$_;var q_="TabsContent",Y_=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:o,children:s,...c}=e,u=Pg(q_,n),f=W_(u.baseId,a),h=X_(u.baseId,a),m=a===u.value,g=w.useRef(m);return w.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),x.jsx(zn,{present:o||m,children:({present:y})=>x.jsx(Ie.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!y,id:h,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:y&&s})})});Y_.displayName=q_;function W_(e,t){return`${e}-trigger-${t}`}function X_(e,t){return`${e}-content-${t}`}var PP=B_,K_=H_,Z_=V_,Q_=Y_;const GP=PP,J_=w.forwardRef(({className:e,...t},n)=>x.jsx(K_,{ref:n,className:Oe("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));J_.displayName=K_.displayName;const eC=w.forwardRef(({className:e,...t},n)=>x.jsx(Z_,{ref:n,className:Oe("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-sm px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm",e),...t}));eC.displayName=Z_.displayName;const rl=w.forwardRef(({className:e,...t},n)=>x.jsx(Q_,{ref:n,className:Oe("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t}));rl.displayName=Q_.displayName;function Wc({value:e,currentTab:t,children:n}){return x.jsx(eC,{value:e,className:Oe("cursor-pointer px-2 py-1 transition-all",t===e?"!bg-emerald-400 !text-zinc-50":"hover:bg-background/60"),children:n})}function FP(){const e=Ye.use.currentTab();return x.jsx("div",{className:"flex h-8 self-center",children:x.jsxs(J_,{className:"h-full gap-2",children:[x.jsx(Wc,{value:"documents",currentTab:e,children:"Documents"}),x.jsx(Wc,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),x.jsx(Wc,{value:"retrieval",currentTab:e,children:"Retrieval"}),x.jsx(Wc,{value:"api",currentTab:e,children:"API"})]})})}function UP(){return x.jsxs("header",{className:"border-border/40 bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50 flex h-10 w-full border-b px-4 backdrop-blur",children:[x.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[x.jsx(vj,{className:"size-4 text-emerald-400","aria-hidden":"true"}),x.jsx("span",{className:"font-bold md:inline-block",children:l0.name})]}),x.jsx("div",{className:"flex h-10 flex-1 justify-center",children:x.jsx(FP,{})}),x.jsxs("nav",{className:"flex items-center",children:[x.jsx(wt,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:x.jsx("a",{href:l0.github,target:"_blank",rel:"noopener noreferrer",children:x.jsx(IO,{className:"size-4","aria-hidden":"true"})})}),x.jsx(wP,{})]})]})}var Xc={exports:{}},W0;function BP(){if(W0)return Xc.exports;W0=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(D,M,R){return Function.prototype.apply.call(D,M,R)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:n=function(D){return Object.getOwnPropertyNames(D)};function a(k){console&&console.warn&&console.warn(k)}var o=Number.isNaN||function(D){return D!==D};function s(){s.init.call(this)}Xc.exports=s,Xc.exports.once=N,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function u(k){if(typeof k!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof k)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(k){if(typeof k!="number"||k<0||o(k))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+k+".");c=k}}),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(D){if(typeof D!="number"||D<0||o(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function f(k){return k._maxListeners===void 0?s.defaultMaxListeners:k._maxListeners}s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(D){for(var M=[],R=1;R<arguments.length;R++)M.push(arguments[R]);var U=D==="error",L=this._events;if(L!==void 0)U=U&&L.error===void 0;else if(!U)return!1;if(U){var I;if(M.length>0&&(I=M[0]),I instanceof Error)throw I;var q=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw q.context=I,q}var Y=L[D];if(Y===void 0)return!1;if(typeof Y=="function")t(Y,this,M);else for(var B=Y.length,X=S(Y,B),R=0;R<B;++R)t(X[R],this,M);return!0};function h(k,D,M,R){var U,L,I;if(u(M),L=k._events,L===void 0?(L=k._events=Object.create(null),k._eventsCount=0):(L.newListener!==void 0&&(k.emit("newListener",D,M.listener?M.listener:M),L=k._events),I=L[D]),I===void 0)I=L[D]=M,++k._eventsCount;else if(typeof I=="function"?I=L[D]=R?[M,I]:[I,M]:R?I.unshift(M):I.push(M),U=f(k),U>0&&I.length>U&&!I.warned){I.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=k,q.type=D,q.count=I.length,a(q)}return k}s.prototype.addListener=function(D,M){return h(this,D,M,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(D,M){return h(this,D,M,!0)};function m(){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 g(k,D,M){var R={fired:!1,wrapFn:void 0,target:k,type:D,listener:M},U=m.bind(R);return U.listener=M,R.wrapFn=U,U}s.prototype.once=function(D,M){return u(M),this.on(D,g(this,D,M)),this},s.prototype.prependOnceListener=function(D,M){return u(M),this.prependListener(D,g(this,D,M)),this},s.prototype.removeListener=function(D,M){var R,U,L,I,q;if(u(M),U=this._events,U===void 0)return this;if(R=U[D],R===void 0)return this;if(R===M||R.listener===M)--this._eventsCount===0?this._events=Object.create(null):(delete U[D],U.removeListener&&this.emit("removeListener",D,R.listener||M));else if(typeof R!="function"){for(L=-1,I=R.length-1;I>=0;I--)if(R[I]===M||R[I].listener===M){q=R[I].listener,L=I;break}if(L<0)return this;L===0?R.shift():E(R,L),R.length===1&&(U[D]=R[0]),U.removeListener!==void 0&&this.emit("removeListener",D,q||M)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(D){var M,R,U;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[D]),this;if(arguments.length===0){var L=Object.keys(R),I;for(U=0;U<L.length;++U)I=L[U],I!=="removeListener"&&this.removeAllListeners(I);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(M=R[D],typeof M=="function")this.removeListener(D,M);else if(M!==void 0)for(U=M.length-1;U>=0;U--)this.removeListener(D,M[U]);return this};function y(k,D,M){var R=k._events;if(R===void 0)return[];var U=R[D];return U===void 0?[]:typeof U=="function"?M?[U.listener||U]:[U]:M?_(U):S(U,U.length)}s.prototype.listeners=function(D){return y(this,D,!0)},s.prototype.rawListeners=function(D){return y(this,D,!1)},s.listenerCount=function(k,D){return typeof k.listenerCount=="function"?k.listenerCount(D):b.call(k,D)},s.prototype.listenerCount=b;function b(k){var D=this._events;if(D!==void 0){var M=D[k];if(typeof M=="function")return 1;if(M!==void 0)return M.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function S(k,D){for(var M=new Array(D),R=0;R<D;++R)M[R]=k[R];return M}function E(k,D){for(;D+1<k.length;D++)k[D]=k[D+1];k.pop()}function _(k){for(var D=new Array(k.length),M=0;M<D.length;++M)D[M]=k[M].listener||k[M];return D}function N(k,D){return new Promise(function(M,R){function U(I){k.removeListener(D,L),R(I)}function L(){typeof k.removeListener=="function"&&k.removeListener("error",U),M([].slice.call(arguments))}A(k,D,L,{once:!0}),D!=="error"&&C(k,U,{once:!0})})}function C(k,D,M){typeof k.on=="function"&&A(k,"error",D,M)}function A(k,D,M,R){if(typeof k.on=="function")R.once?k.once(D,M):k.on(D,M);else if(typeof k.addEventListener=="function")k.addEventListener(D,function U(L){R.once&&k.removeEventListener(D,U),M(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof k)}return Xc.exports}var tC=BP();function IP(){const e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(const a in arguments[t])e[a]=arguments[t][a];return e}let Pt=IP;typeof Object.assign=="function"&&(Pt=Object.assign);function Xn(e,t,n,a){const o=e._nodes.get(t);let s=null;return o&&(a==="mixed"?s=o.out&&o.out[n]||o.undirected&&o.undirected[n]:a==="directed"?s=o.out&&o.out[n]:s=o.undirected&&o.undirected[n]),s}function Qt(e){return typeof e=="object"&&e!==null}function nC(e){let t;for(t in e)return!1;return!0}function Wn(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function ir(e,t,n){const a={enumerable:!0,configurable:!0};typeof n=="function"?a.get=n:(a.value=n,a.writable=!1),Object.defineProperty(e,t,a)}function X0(e){return!(!Qt(e)||e.attributes&&!Array.isArray(e.attributes))}function HP(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function ra(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let a=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(a=t.next(),a.done){t=null;continue}break}while(!0);return a}}}function qo(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Gg extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class De extends Gg{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Re extends Gg{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Re.prototype.constructor)}}class $e extends Gg{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$e.prototype.constructor)}}function rC(e,t){this.key=e,this.attributes=t,this.clear()}rC.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 aC(e,t){this.key=e,this.attributes=t,this.clear()}aC.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function iC(e,t){this.key=e,this.attributes=t,this.clear()}iC.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Yo(e,t,n,a,o){this.key=t,this.attributes=o,this.undirected=e,this.source=n,this.target=a}Yo.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,a=this.target.key;this.source[e][a]=this,!(this.undirected&&n===a)&&(this.target[t][n]=this)};Yo.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,a=this.target.key;this.undirected&&(e=t="undirected");const o=this.source[e],s=o[a];if(typeof s>"u"){o[a]=this,this.undirected&&n===a||(this.target[t][n]=this);return}s.previous=this,this.next=s,o[a]=this,this.target[t][n]=this};Yo.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",a="in";this.undirected&&(n=a="undirected"),delete this.source[n][t],delete this.target[a][e]};Yo.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",a="in";this.undirected&&(n=a="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[a][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[a][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const oC=0,sC=1,$P=2,lC=3;function la(e,t,n,a,o,s,c){let u,f,h,m;if(a=""+a,n===oC){if(u=e._nodes.get(a),!u)throw new Re(`Graph.${t}: could not find the "${a}" node in the graph.`);h=o,m=s}else if(n===lC){if(o=""+o,f=e._edges.get(o),!f)throw new Re(`Graph.${t}: could not find the "${o}" edge in the graph.`);const g=f.source.key,y=f.target.key;if(a===g)u=f.target;else if(a===y)u=f.source;else throw new Re(`Graph.${t}: the "${a}" node is not attached to the "${o}" edge (${g}, ${y}).`);h=s,m=c}else{if(f=e._edges.get(a),!f)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`);n===sC?u=f.source:u=f.target,h=o,m=s}return[u,h,m]}function VP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);return c.attributes[u]}}function qP(e,t,n){e.prototype[t]=function(a,o){const[s]=la(this,t,n,a,o);return s.attributes}}function YP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);return c.attributes.hasOwnProperty(u)}}function WP(e,t,n){e.prototype[t]=function(a,o,s,c){const[u,f,h]=la(this,t,n,a,o,s,c);return u.attributes[f]=h,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function XP(e,t,n){e.prototype[t]=function(a,o,s,c){const[u,f,h]=la(this,t,n,a,o,s,c);if(typeof h!="function")throw new De(`Graph.${t}: updater should be a function.`);const m=u.attributes,g=h(m[f]);return m[f]=g,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function KP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);return delete c.attributes[u],this.emit("nodeAttributesUpdated",{key:c.key,type:"remove",attributes:c.attributes,name:u}),this}}function ZP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);if(!Qt(u))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return c.attributes=u,this.emit("nodeAttributesUpdated",{key:c.key,type:"replace",attributes:c.attributes}),this}}function QP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);if(!Qt(u))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return Pt(c.attributes,u),this.emit("nodeAttributesUpdated",{key:c.key,type:"merge",attributes:c.attributes,data:u}),this}}function JP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);if(typeof u!="function")throw new De(`Graph.${t}: provided updater is not a function.`);return c.attributes=u(c.attributes),this.emit("nodeAttributesUpdated",{key:c.key,type:"update",attributes:c.attributes}),this}}const e4=[{name:e=>`get${e}Attribute`,attacher:VP},{name:e=>`get${e}Attributes`,attacher:qP},{name:e=>`has${e}Attribute`,attacher:YP},{name:e=>`set${e}Attribute`,attacher:WP},{name:e=>`update${e}Attribute`,attacher:XP},{name:e=>`remove${e}Attribute`,attacher:KP},{name:e=>`replace${e}Attributes`,attacher:ZP},{name:e=>`merge${e}Attributes`,attacher:QP},{name:e=>`update${e}Attributes`,attacher:JP}];function t4(e){e4.forEach(function({name:t,attacher:n}){n(e,t("Node"),oC),n(e,t("Source"),sC),n(e,t("Target"),$P),n(e,t("Opposite"),lC)})}function n4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return s.attributes[o]}}function r4(e,t,n){e.prototype[t]=function(a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new $e(`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.`);const s=""+a,c=""+arguments[1];if(o=Xn(this,s,c,n),!o)throw new Re(`Graph.${t}: could not find an edge for the given path ("${s}" - "${c}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,o=this._edges.get(a),!o)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return o.attributes}}function a4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return s.attributes.hasOwnProperty(o)}}function i4(e,t,n){e.prototype[t]=function(a,o,s){let c;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new $e(`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.`);const u=""+a,f=""+o;if(o=arguments[2],s=arguments[3],c=Xn(this,u,f,n),!c)throw new Re(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,c=this._edges.get(a),!c)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return c.attributes[o]=s,this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:o}),this}}function o4(e,t,n){e.prototype[t]=function(a,o,s){let c;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new $e(`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.`);const u=""+a,f=""+o;if(o=arguments[2],s=arguments[3],c=Xn(this,u,f,n),!c)throw new Re(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,c=this._edges.get(a),!c)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(typeof s!="function")throw new De(`Graph.${t}: updater should be a function.`);return c.attributes[o]=s(c.attributes[o]),this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:o}),this}}function s4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return delete s.attributes[o],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:o}),this}}function l4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(!Qt(o))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return s.attributes=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function c4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(!Qt(o))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return Pt(s.attributes,o),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:o}),this}}function u4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(typeof o!="function")throw new De(`Graph.${t}: provided updater is not a function.`);return s.attributes=o(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const d4=[{name:e=>`get${e}Attribute`,attacher:n4},{name:e=>`get${e}Attributes`,attacher:r4},{name:e=>`has${e}Attribute`,attacher:a4},{name:e=>`set${e}Attribute`,attacher:i4},{name:e=>`update${e}Attribute`,attacher:o4},{name:e=>`remove${e}Attribute`,attacher:s4},{name:e=>`replace${e}Attributes`,attacher:l4},{name:e=>`merge${e}Attributes`,attacher:c4},{name:e=>`update${e}Attributes`,attacher:u4}];function f4(e){d4.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const h4=[{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 p4(e,t,n,a){let o=!1;for(const s in t){if(s===a)continue;const c=t[s];if(o=n(c.key,c.attributes,c.source.key,c.target.key,c.source.attributes,c.target.attributes,c.undirected),e&&o)return c.key}}function m4(e,t,n,a){let o,s,c,u=!1;for(const f in t)if(f!==a){o=t[f];do{if(s=o.source,c=o.target,u=n(o.key,o.attributes,s.key,c.key,s.attributes,c.attributes,o.undirected),e&&u)return o.key;o=o.next}while(o!==void 0)}}function ap(e,t){const n=Object.keys(e),a=n.length;let o,s=0;return{[Symbol.iterator](){return this},next(){do if(o)o=o.next;else{if(s>=a)return{done:!0};const c=n[s++];if(c===t){o=void 0;continue}o=e[c]}while(!o);return{done:!1,value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected}}}}}function g4(e,t,n,a){const o=t[n];if(!o)return;const s=o.source,c=o.target;if(a(o.key,o.attributes,s.key,c.key,s.attributes,c.attributes,o.undirected)&&e)return o.key}function v4(e,t,n,a){let o=t[n];if(!o)return;let s=!1;do{if(s=a(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&s)return o.key;o=o.next}while(o!==void 0)}function ip(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const o={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:o}}};let a=!1;return{[Symbol.iterator](){return this},next(){return a===!0?{done:!0}:(a=!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 y4(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,a=new Array(n),o=t==="undirected",s=e._edges.values();let c=0,u,f;for(;u=s.next(),u.done!==!0;)f=u.value,f.undirected===o&&(a[c++]=f.key);return a}function cC(e,t,n,a){if(t.size===0)return;const o=n!=="mixed"&&n!==t.type,s=n==="undirected";let c,u,f=!1;const h=t._edges.values();for(;c=h.next(),c.done!==!0;){if(u=c.value,o&&u.undirected!==s)continue;const{key:m,attributes:g,source:y,target:b}=u;if(f=a(m,g,y.key,b.key,y.attributes,b.attributes,u.undirected),e&&f)return m}}function b4(e,t){if(e.size===0)return qo();const n=t!=="mixed"&&t!==e.type,a=t==="undirected",o=e._edges.values();return{[Symbol.iterator](){return this},next(){let s,c;for(;;){if(s=o.next(),s.done)return s;if(c=s.value,!(n&&c.undirected!==a))break}return{value:{edge:c.key,attributes:c.attributes,source:c.source.key,target:c.target.key,sourceAttributes:c.source.attributes,targetAttributes:c.target.attributes,undirected:c.undirected},done:!1}}}}function Fg(e,t,n,a,o,s){const c=t?m4:p4;let u;if(n!=="undirected"&&(a!=="out"&&(u=c(e,o.in,s),e&&u)||a!=="in"&&(u=c(e,o.out,s,a?void 0:o.key),e&&u))||n!=="directed"&&(u=c(e,o.undirected,s),e&&u))return u}function x4(e,t,n,a){const o=[];return Fg(!1,e,t,n,a,function(s){o.push(s)}),o}function w4(e,t,n){let a=qo();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(a=ra(a,ap(n.in))),t!=="in"&&typeof n.out<"u"&&(a=ra(a,ap(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(a=ra(a,ap(n.undirected))),a}function Ug(e,t,n,a,o,s,c){const u=n?v4:g4;let f;if(t!=="undirected"&&(typeof o.in<"u"&&a!=="out"&&(f=u(e,o.in,s,c),e&&f)||typeof o.out<"u"&&a!=="in"&&(a||o.key!==s)&&(f=u(e,o.out,s,c),e&&f))||t!=="directed"&&typeof o.undirected<"u"&&(f=u(e,o.undirected,s,c),e&&f))return f}function E4(e,t,n,a,o){const s=[];return Ug(!1,e,t,n,a,o,function(c){s.push(c)}),s}function S4(e,t,n,a){let o=qo();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&a in n.in&&(o=ra(o,ip(n.in,a))),typeof n.out<"u"&&t!=="in"&&a in n.out&&(t||n.key!==a)&&(o=ra(o,ip(n.out,a)))),e!=="directed"&&typeof n.undirected<"u"&&a in n.undirected&&(o=ra(o,ip(n.undirected,a))),o}function _4(e,t){const{name:n,type:a,direction:o}=t;e.prototype[n]=function(s,c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];if(!arguments.length)return y4(this,a);if(arguments.length===1){s=""+s;const u=this._nodes.get(s);if(typeof u>"u")throw new Re(`Graph.${n}: could not find the "${s}" node in the graph.`);return x4(this.multi,a==="mixed"?this.type:a,o,u)}if(arguments.length===2){s=""+s,c=""+c;const u=this._nodes.get(s);if(!u)throw new Re(`Graph.${n}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(c))throw new Re(`Graph.${n}: could not find the "${c}" target node in the graph.`);return E4(a,this.multi,o,u,c)}throw new De(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function C4(e,t){const{name:n,type:a,direction:o}=t,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(h,m,g){if(!(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)){if(arguments.length===1)return g=h,cC(!1,this,a,g);if(arguments.length===2){h=""+h,g=m;const y=this._nodes.get(h);if(typeof y>"u")throw new Re(`Graph.${s}: could not find the "${h}" node in the graph.`);return Fg(!1,this.multi,a==="mixed"?this.type:a,o,y,g)}if(arguments.length===3){h=""+h,m=""+m;const y=this._nodes.get(h);if(!y)throw new Re(`Graph.${s}: could not find the "${h}" source node in the graph.`);if(!this._nodes.has(m))throw new Re(`Graph.${s}: could not find the "${m}" target node in the graph.`);return Ug(!1,a,this.multi,o,y,m,g)}throw new De(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const c="map"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){const h=Array.prototype.slice.call(arguments),m=h.pop();let g;if(h.length===0){let y=0;a!=="directed"&&(y+=this.undirectedSize),a!=="undirected"&&(y+=this.directedSize),g=new Array(y);let b=0;h.push((S,E,_,N,C,A,k)=>{g[b++]=m(S,E,_,N,C,A,k)})}else g=[],h.push((y,b,S,E,_,N,C)=>{g.push(m(y,b,S,E,_,N,C))});return this[s].apply(this,h),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const h=Array.prototype.slice.call(arguments),m=h.pop(),g=[];return h.push((y,b,S,E,_,N,C)=>{m(y,b,S,E,_,N,C)&&g.push(y)}),this[s].apply(this,h),g};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(){let h=Array.prototype.slice.call(arguments);if(h.length<2||h.length>4)throw new De(`Graph.${f}: invalid number of arguments (expecting 2, 3 or 4 and got ${h.length}).`);if(typeof h[h.length-1]=="function"&&typeof h[h.length-2]!="function")throw new De(`Graph.${f}: 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 m,g;h.length===2?(m=h[0],g=h[1],h=[]):h.length===3?(m=h[1],g=h[2],h=[h[0]]):h.length===4&&(m=h[2],g=h[3],h=[h[0],h[1]]);let y=g;return h.push((b,S,E,_,N,C,A)=>{y=m(y,b,S,E,_,N,C,A)}),this[s].apply(this,h),y}}function T4(e,t){const{name:n,type:a,direction:o}=t,s="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(f,h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return!1;if(arguments.length===1)return m=f,cC(!0,this,a,m);if(arguments.length===2){f=""+f,m=h;const g=this._nodes.get(f);if(typeof g>"u")throw new Re(`Graph.${s}: could not find the "${f}" node in the graph.`);return Fg(!0,this.multi,a==="mixed"?this.type:a,o,g,m)}if(arguments.length===3){f=""+f,h=""+h;const g=this._nodes.get(f);if(!g)throw new Re(`Graph.${s}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(h))throw new Re(`Graph.${s}: could not find the "${h}" target node in the graph.`);return Ug(!0,a,this.multi,o,g,h,m)}throw new De(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const c="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[c]=function(){const f=Array.prototype.slice.call(arguments),h=f.pop();return f.push((g,y,b,S,E,_,N)=>h(g,y,b,S,E,_,N)),!!this[s].apply(this,f)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),h=f.pop();return f.push((g,y,b,S,E,_,N)=>!h(g,y,b,S,E,_,N)),!this[s].apply(this,f)}}function R4(e,t){const{name:n,type:a,direction:o}=t,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(c,u){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return qo();if(!arguments.length)return b4(this,a);if(arguments.length===1){c=""+c;const f=this._nodes.get(c);if(!f)throw new Re(`Graph.${s}: could not find the "${c}" node in the graph.`);return w4(a,o,f)}if(arguments.length===2){c=""+c,u=""+u;const f=this._nodes.get(c);if(!f)throw new Re(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(u))throw new Re(`Graph.${s}: could not find the "${u}" target node in the graph.`);return S4(a,o,f,u)}throw new De(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function A4(e){h4.forEach(t=>{_4(e,t),C4(e,t),T4(e,t),R4(e,t)})}const D4=[{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 yd(){this.A=null,this.B=null}yd.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};yd.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Xs(e,t,n,a,o){for(const s in a){const c=a[s],u=c.source,f=c.target,h=u===n?f:u;if(t&&t.has(h.key))continue;const m=o(h.key,h.attributes);if(e&&m)return h.key}}function Bg(e,t,n,a,o){if(t!=="mixed"){if(t==="undirected")return Xs(e,null,a,a.undirected,o);if(typeof n=="string")return Xs(e,null,a,a[n],o)}const s=new yd;let c;if(t!=="undirected"){if(n!=="out"){if(c=Xs(e,null,a,a.in,o),e&&c)return c;s.wrap(a.in)}if(n!=="in"){if(c=Xs(e,s,a,a.out,o),e&&c)return c;s.wrap(a.out)}}if(t!=="directed"&&(c=Xs(e,s,a,a.undirected,o),e&&c))return c}function k4(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const a=[];return Bg(!1,e,t,n,function(o){a.push(o)}),a}function Ks(e,t,n){const a=Object.keys(n),o=a.length;let s=0;return{[Symbol.iterator](){return this},next(){let c=null;do{if(s>=o)return e&&e.wrap(n),{done:!0};const u=n[a[s++]],f=u.source,h=u.target;if(c=f===t?h:f,e&&e.has(c.key)){c=null;continue}}while(c===null);return{done:!1,value:{neighbor:c.key,attributes:c.attributes}}}}}function N4(e,t,n){if(e!=="mixed"){if(e==="undirected")return Ks(null,n,n.undirected);if(typeof t=="string")return Ks(null,n,n[t])}let a=qo();const o=new yd;return e!=="undirected"&&(t!=="out"&&(a=ra(a,Ks(o,n,n.in))),t!=="in"&&(a=ra(a,Ks(o,n,n.out)))),e!=="directed"&&(a=ra(a,Ks(o,n,n.undirected))),a}function O4(e,t){const{name:n,type:a,direction:o}=t;e.prototype[n]=function(s){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];s=""+s;const c=this._nodes.get(s);if(typeof c>"u")throw new Re(`Graph.${n}: could not find the "${s}" node in the graph.`);return k4(a==="mixed"?this.type:a,o,c)}}function j4(e,t){const{name:n,type:a,direction:o}=t,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;h=""+h;const g=this._nodes.get(h);if(typeof g>"u")throw new Re(`Graph.${s}: could not find the "${h}" node in the graph.`);Bg(!1,a==="mixed"?this.type:a,o,g,m)};const c="map"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(h,m){const g=[];return this[s](h,(y,b)=>{g.push(m(y,b))}),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(h,m){const g=[];return this[s](h,(y,b)=>{m(y,b)&&g.push(y)}),g};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(h,m,g){if(arguments.length<3)throw new De(`Graph.${f}: 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 y=g;return this[s](h,(b,S)=>{y=m(y,b,S)}),y}}function L4(e,t){const{name:n,type:a,direction:o}=t,s=n[0].toUpperCase()+n.slice(1,-1),c="find"+s;e.prototype[c]=function(h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;h=""+h;const g=this._nodes.get(h);if(typeof g>"u")throw new Re(`Graph.${c}: could not find the "${h}" node in the graph.`);return Bg(!0,a==="mixed"?this.type:a,o,g,m)};const u="some"+s;e.prototype[u]=function(h,m){return!!this[c](h,m)};const f="every"+s;e.prototype[f]=function(h,m){return!this[c](h,(y,b)=>!m(y,b))}}function z4(e,t){const{name:n,type:a,direction:o}=t,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return qo();c=""+c;const u=this._nodes.get(c);if(typeof u>"u")throw new Re(`Graph.${s}: could not find the "${c}" node in the graph.`);return N4(a==="mixed"?this.type:a,o,u)}}function M4(e){D4.forEach(t=>{O4(e,t),j4(e,t),L4(e,t),z4(e,t)})}function Kc(e,t,n,a,o){const s=a._nodes.values(),c=a.type;let u,f,h,m,g,y;for(;u=s.next(),u.done!==!0;){let b=!1;if(f=u.value,c!=="undirected"){m=f.out;for(h in m){g=m[h];do y=g.target,b=!0,o(f.key,y.key,f.attributes,y.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(c!=="directed"){m=f.undirected;for(h in m)if(!(t&&f.key>h)){g=m[h];do y=g.target,y.key!==h&&(y=g.source),b=!0,o(f.key,y.key,f.attributes,y.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!b&&o(f.key,null,f.attributes,null,null,null,null)}}function P4(e,t){const n={key:e};return nC(t.attributes)||(n.attributes=Pt({},t.attributes)),n}function G4(e,t,n){const a={key:t,source:n.source.key,target:n.target.key};return nC(n.attributes)||(a.attributes=Pt({},n.attributes)),e==="mixed"&&n.undirected&&(a.undirected=!0),a}function F4(e){if(!Qt(e))throw new De('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 De("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!Qt(e.attributes)||e.attributes===null))throw new De("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function U4(e){if(!Qt(e))throw new De('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 De("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new De("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!Qt(e.attributes)||e.attributes===null))throw new De("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new De("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const B4=HP(),I4=new Set(["directed","undirected","mixed"]),K0=new Set(["domain","_events","_eventsCount","_maxListeners"]),H4=[{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"}],$4={allowSelfLoops:!0,multi:!1,type:"mixed"};function V4(e,t,n){if(n&&!Qt(n))throw new De(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new $e(`Graph.addNode: the "${t}" node already exist in the graph.`);const a=new e.NodeDataClass(t,n);return e._nodes.set(t,a),e.emit("nodeAdded",{key:t,attributes:n}),a}function Z0(e,t,n){const a=new e.NodeDataClass(t,n);return e._nodes.set(t,a),e.emit("nodeAdded",{key:t,attributes:n}),a}function uC(e,t,n,a,o,s,c,u){if(!a&&e.type==="undirected")throw new $e(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(a&&e.type==="directed")throw new $e(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!Qt(u))throw new De(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(s=""+s,c=""+c,u=u||{},!e.allowSelfLoops&&s===c)throw new $e(`Graph.${t}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const f=e._nodes.get(s),h=e._nodes.get(c);if(!f)throw new Re(`Graph.${t}: source node "${s}" not found.`);if(!h)throw new Re(`Graph.${t}: target node "${c}" not found.`);const m={key:null,undirected:a,source:s,target:c,attributes:u};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new $e(`Graph.${t}: the "${o}" edge already exists in the graph.`);if(!e.multi&&(a?typeof f.undirected[c]<"u":typeof f.out[c]<"u"))throw new $e(`Graph.${t}: an edge linking "${s}" to "${c}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const g=new Yo(a,o,f,h,u);e._edges.set(o,g);const y=s===c;return a?(f.undirectedDegree++,h.undirectedDegree++,y&&(f.undirectedLoops++,e._undirectedSelfLoopCount++)):(f.outDegree++,h.inDegree++,y&&(f.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),a?e._undirectedSize++:e._directedSize++,m.key=o,e.emit("edgeAdded",m),o}function q4(e,t,n,a,o,s,c,u,f){if(!a&&e.type==="undirected")throw new $e(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(a&&e.type==="directed")throw new $e(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(f){if(typeof u!="function")throw new De(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!Qt(u))throw new De(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}s=""+s,c=""+c;let h;if(f&&(h=u,u=void 0),!e.allowSelfLoops&&s===c)throw new $e(`Graph.${t}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let m=e._nodes.get(s),g=e._nodes.get(c),y,b;if(!n&&(y=e._edges.get(o),y)){if((y.source.key!==s||y.target.key!==c)&&(!a||y.source.key!==c||y.target.key!==s))throw new $e(`Graph.${t}: inconsistency detected when attempting to merge the "${o}" edge with "${s}" source & "${c}" target vs. ("${y.source.key}", "${y.target.key}").`);b=y}if(!b&&!e.multi&&m&&(b=a?m.undirected[c]:m.out[c]),b){const C=[b.key,!1,!1,!1];if(f?!h:!u)return C;if(f){const A=b.attributes;b.attributes=h(A),e.emit("edgeAttributesUpdated",{type:"replace",key:b.key,attributes:b.attributes})}else Pt(b.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:b.key,attributes:b.attributes,data:u});return C}u=u||{},f&&h&&(u=h(u));const S={key:null,undirected:a,source:s,target:c,attributes:u};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new $e(`Graph.${t}: the "${o}" edge already exists in the graph.`);let E=!1,_=!1;m||(m=Z0(e,s,{}),E=!0,s===c&&(g=m,_=!0)),g||(g=Z0(e,c,{}),_=!0),y=new Yo(a,o,m,g,u),e._edges.set(o,y);const N=s===c;return a?(m.undirectedDegree++,g.undirectedDegree++,N&&(m.undirectedLoops++,e._undirectedSelfLoopCount++)):(m.outDegree++,g.inDegree++,N&&(m.directedLoops++,e._directedSelfLoopCount++)),e.multi?y.attachMulti():y.attach(),a?e._undirectedSize++:e._directedSize++,S.key=o,e.emit("edgeAdded",S),[o,!0,E,_]}function Eo(e,t){e._edges.delete(t.key);const{source:n,target:a,attributes:o}=t,s=t.undirected,c=n===a;s?(n.undirectedDegree--,a.undirectedDegree--,c&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,a.inDegree--,c&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),s?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:o,source:n.key,target:a.key,undirected:s})}class ft extends tC.EventEmitter{constructor(t){if(super(),t=Pt({},$4,t),typeof t.multi!="boolean")throw new De(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!I4.has(t.type))throw new De(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new De(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?rC:t.type==="directed"?aC:iC;Wn(this,"NodeDataClass",n);const a="geid_"+B4()+"_";let o=0;const s=()=>{let c;do c=a+o++;while(this._edges.has(c));return c};Wn(this,"_attributes",{}),Wn(this,"_nodes",new Map),Wn(this,"_edges",new Map),Wn(this,"_directedSize",0),Wn(this,"_undirectedSize",0),Wn(this,"_directedSelfLoopCount",0),Wn(this,"_undirectedSelfLoopCount",0),Wn(this,"_edgeKeyGenerator",s),Wn(this,"_options",t),K0.forEach(c=>Wn(this,c,this[c])),ir(this,"order",()=>this._nodes.size),ir(this,"size",()=>this._edges.size),ir(this,"directedSize",()=>this._directedSize),ir(this,"undirectedSize",()=>this._undirectedSize),ir(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),ir(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),ir(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),ir(this,"multi",this._options.multi),ir(this,"type",this._options.type),ir(this,"allowSelfLoops",this._options.allowSelfLoops),ir(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const a=""+t,o=this._edges.get(a);return!!o&&!o.undirected}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?a.out.hasOwnProperty(n):!1}throw new De(`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(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const a=""+t,o=this._edges.get(a);return!!o&&o.undirected}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?a.undirected.hasOwnProperty(n):!1}throw new De(`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(t,n){if(arguments.length===1){const a=""+t;return this._edges.has(a)}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?typeof a.out<"u"&&a.out.hasOwnProperty(n)||typeof a.undirected<"u"&&a.undirected.hasOwnProperty(n):!1}throw new De(`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(t,n){if(this.type==="undirected")return;if(t=""+t,n=""+n,this.multi)throw new $e("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const a=this._nodes.get(t);if(!a)throw new Re(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const o=a.out&&a.out[n]||void 0;if(o)return o.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new $e("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const a=this._nodes.get(t);if(!a)throw new Re(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const o=a.undirected&&a.undirected[n]||void 0;if(o)return o.key}edge(t,n){if(this.multi)throw new $e("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.edge: could not find the "${n}" target node in the graph.`);const o=a.out&&a.out[n]||a.undirected&&a.undirected[n]||void 0;if(o)return o.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.in||n in a.out}areOutNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.out}areInNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in a.undirected}areNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in a.in||n in a.out)||this.type!=="directed"&&n in a.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in a.in||this.type!=="directed"&&n in a.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in a.out||this.type!=="directed"&&n in a.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.inDegree),a}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.outDegree),a}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.degree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.inDegree+n.outDegree),a}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.inDegree,o+=n.directedLoops),a-o}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.outDegree,o+=n.directedLoops),a-o}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.inDegree+n.outDegree,o+=n.directedLoops*2),a-o}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const a=this._edges.get(n);if(!a)throw new Re(`Graph.opposite: could not find the "${n}" edge in the graph.`);const o=a.source.key,s=a.target.key;if(t===o)return s;if(t===s)return o;throw new Re(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${o}, ${s}).`)}hasExtremity(t,n){t=""+t,n=""+n;const a=this._edges.get(t);if(!a)throw new Re(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return a.source.key===n||a.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return V4(this,t,n).key}mergeNode(t,n){if(n&&!Qt(n))throw new De(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let a=this._nodes.get(t);return a?(n&&(Pt(a.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:a.attributes,data:n})),[t,!1]):(a=new this.NodeDataClass(t,n),this._nodes.set(t,a),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new De(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let a=this._nodes.get(t);if(a){if(n){const s=a.attributes;a.attributes=n(s),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:a.attributes})}return[t,!1]}const o=n?n({}):{};return a=new this.NodeDataClass(t,o),this._nodes.set(t,a),this.emit("nodeAdded",{key:t,attributes:o}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.dropNode: could not find the "${t}" node in the graph.`);let a;if(this.type!=="undirected"){for(const o in n.out){a=n.out[o];do Eo(this,a),a=a.next;while(a)}for(const o in n.in){a=n.in[o];do Eo(this,a),a=a.next;while(a)}}if(this.type!=="directed")for(const o in n.undirected){a=n.undirected[o];do Eo(this,a),a=a.next;while(a)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const a=""+arguments[0],o=""+arguments[1];if(n=Xn(this,a,o,this.type),!n)throw new Re(`Graph.dropEdge: could not find the "${a}" -> "${o}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new Re(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Eo(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new $e("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 $e("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.");t=""+t,n=""+n;const a=Xn(this,t,n,"directed");if(!a)throw new Re(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Eo(this,a),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new $e("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 $e("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.");const a=Xn(this,t,n,"undirected");if(!a)throw new Re(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Eo(this,a),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new De("Graph.updateAttribute: updater should be a function.");const a=this._attributes[t];return this._attributes[t]=n(a),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!Qt(t))throw new De("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(t){if(!Qt(t))throw new De("Graph.mergeAttributes: provided attributes are not a plain object.");return Pt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new De("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(t,n){if(typeof t!="function")throw new De("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!X0(n))throw new De("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._nodes.values();let o,s;for(;o=a.next(),o.done!==!0;)s=o.value,s.attributes=t(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new De("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!X0(n))throw new De("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._edges.values();let o,s,c,u;for(;o=a.next(),o.done!==!0;)s=o.value,c=s.source,u=s.target,s.attributes=t(s.key,s.attributes,c.key,u.key,c.attributes,u.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new De("Graph.forEachAdjacencyEntry: expecting a callback.");Kc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new De("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Kc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new De("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Kc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new De("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Kc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new De("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)o=a.value,t(o.key,o.attributes)}findNode(t){if(typeof t!="function")throw new De("Graph.findNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,t(o.key,o.attributes))return o.key}mapNodes(t){if(typeof t!="function")throw new De("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let a,o;const s=new Array(this.order);let c=0;for(;a=n.next(),a.done!==!0;)o=a.value,s[c++]=t(o.key,o.attributes);return s}someNode(t){if(typeof t!="function")throw new De("Graph.someNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,t(o.key,o.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new De("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,!t(o.key,o.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new De("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let a,o;const s=[];for(;a=n.next(),a.done!==!0;)o=a.value,t(o.key,o.attributes)&&s.push(o.key);return s}reduceNodes(t,n){if(typeof t!="function")throw new De("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new De("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 a=n;const o=this._nodes.values();let s,c;for(;s=o.next(),s.done!==!0;)c=s.value,a=t(a,c.key,c.attributes);return a}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const a=n.value;return{value:{node:a.key,attributes:a.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((o,s)=>{t[n++]=P4(s,o)});const a=new Array(this._edges.size);return n=0,this._edges.forEach((o,s)=>{a[n++]=G4(this.type,s,o)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:a}}import(t,n=!1){if(t instanceof ft)return t.forEachNode((f,h)=>{n?this.mergeNode(f,h):this.addNode(f,h)}),t.forEachEdge((f,h,m,g,y,b,S)=>{n?S?this.mergeUndirectedEdgeWithKey(f,m,g,h):this.mergeDirectedEdgeWithKey(f,m,g,h):S?this.addUndirectedEdgeWithKey(f,m,g,h):this.addDirectedEdgeWithKey(f,m,g,h)}),this;if(!Qt(t))throw new De("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!Qt(t.attributes))throw new De("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let a,o,s,c,u;if(t.nodes){if(s=t.nodes,!Array.isArray(s))throw new De("Graph.import: invalid nodes. Expecting an array.");for(a=0,o=s.length;a<o;a++){c=s[a],F4(c);const{key:f,attributes:h}=c;n?this.mergeNode(f,h):this.addNode(f,h)}}if(t.edges){let f=!1;if(this.type==="undirected"&&(f=!0),s=t.edges,!Array.isArray(s))throw new De("Graph.import: invalid edges. Expecting an array.");for(a=0,o=s.length;a<o;a++){u=s[a],U4(u);const{source:h,target:m,attributes:g,undirected:y=f}=u;let b;"key"in u?(b=n?y?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:y?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,b.call(this,u.key,h,m,g)):(b=n?y?this.mergeUndirectedEdge:this.mergeDirectedEdge:y?this.addUndirectedEdge:this.addDirectedEdge,b.call(this,h,m,g))}}return this}nullCopy(t){const n=new ft(Pt({},this._options,t));return n.replaceAttributes(Pt({},this.getAttributes())),n}emptyCopy(t){const n=this.nullCopy(t);return this._nodes.forEach((a,o)=>{const s=Pt({},a.attributes);a=new n.NodeDataClass(o,s),n._nodes.set(o,a)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new $e(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${t.type}" because this would mean losing information about the current graph.`);if(typeof t.multi=="boolean"&&t.multi!==this.multi&&t.multi!==!0)throw new $e("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 t.allowSelfLoops=="boolean"&&t.allowSelfLoops!==this.allowSelfLoops&&t.allowSelfLoops!==!0)throw new $e("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.");const n=this.emptyCopy(t),a=this._edges.values();let o,s;for(;o=a.next(),o.done!==!0;)s=o.value,uC(n,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,Pt({},s.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((s,c)=>{t[c]=s.attributes});const n={},a={};this._edges.forEach((s,c)=>{const u=s.undirected?"--":"->";let f="",h=s.source.key,m=s.target.key,g;s.undirected&&h>m&&(g=h,h=m,m=g);const y=`(${h})${u}(${m})`;c.startsWith("geid_")?this.multi&&(typeof a[y]>"u"?a[y]=0:a[y]++,f+=`${a[y]}. `):f+=`[${c}]: `,f+=y,n[f]=s.attributes});const o={};for(const s in this)this.hasOwnProperty(s)&&!K0.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(o[s]=this[s]);return o.attributes=this._attributes,o.nodes=t,o.edges=n,Wn(o,"constructor",this.constructor),o}}typeof Symbol<"u"&&(ft.prototype[Symbol.for("nodejs.util.inspect.custom")]=ft.prototype.inspect);H4.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),a=t==="add"?uC:q4;e.generateKey?ft.prototype[n]=function(o,s,c){return a(this,n,!0,(e.type||this.type)==="undirected",null,o,s,c,t==="update")}:ft.prototype[n]=function(o,s,c,u){return a(this,n,!1,(e.type||this.type)==="undirected",o,s,c,u,t==="update")}})});t4(ft);f4(ft);A4(ft);M4(ft);class dl extends ft{constructor(t){const n=Pt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new De("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new De('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class dC extends ft{constructor(t){const n=Pt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new De("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new De('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class fC extends ft{constructor(t){const n=Pt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new De("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class hC extends ft{constructor(t){const n=Pt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new De("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new De('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class pC extends ft{constructor(t){const n=Pt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new De("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new De('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Wo(e){e.from=function(t,n){const a=Pt({},t.options,n),o=new e(a);return o.import(t),o}}Wo(ft);Wo(dl);Wo(dC);Wo(fC);Wo(hC);Wo(pC);ft.Graph=ft;ft.DirectedGraph=dl;ft.UndirectedGraph=dC;ft.MultiGraph=fC;ft.MultiDirectedGraph=hC;ft.MultiUndirectedGraph=pC;ft.InvalidArgumentsGraphError=De;ft.NotFoundGraphError=Re;ft.UsageGraphError=$e;function Y4(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ol(e){var t=Y4(e,"string");return typeof t=="symbol"?t:t+""}function $t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q0(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,ol(a.key),a)}}function Vt(e,t,n){return t&&Q0(e.prototype,t),n&&Q0(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zo(e){return zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zo(e)}function mC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mC=function(){return!!e})()}function W4(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X4(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W4(e)}function Sn(e,t,n){return t=zo(t),X4(e,mC()?Reflect.construct(t,n||[],zo(e).constructor):t.apply(e,n))}function wm(e,t){return wm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},wm(e,t)}function _n(e,t){if(typeof t!="function"&&t!==null)throw new 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&&wm(e,t)}function K4(e){if(Array.isArray(e))return e}function Z4(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,o,s,c,u=[],f=!0,h=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(a=s.call(n)).done)&&(u.push(a.value),u.length!==t);f=!0);}catch(m){h=!0,o=m}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(h)throw o}}return u}}function Em(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function gC(e,t){if(e){if(typeof e=="string")return Em(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)?Em(e,t):void 0}}function Q4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mo(e,t){return K4(e)||Z4(e,t)||gC(e,t)||Q4()}var op={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"},vC=new Int8Array(4),mu=new Int32Array(vC.buffer,0,1),yC=new Float32Array(vC.buffer,0,1),J4=/^\s*rgba?\s*\(/,eG=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function tG(e){var t=0,n=0,a=0,o=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),a=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),a=parseInt(e.charAt(5)+e.charAt(6),16)),e.length===9&&(o=parseInt(e.charAt(7)+e.charAt(8),16)/255);else if(J4.test(e)){var s=e.match(eG);s&&(t=+s[1],n=+s[2],a=+s[3],s[4]&&(o=+s[4]))}return{r:t,g:n,b:a,a:o}}var ko={};for(var Zc in op)ko[Zc]=Ar(op[Zc]),ko[op[Zc]]=ko[Zc];function bC(e,t,n,a,o){return mu[0]=a<<24|n<<16|t<<8|e,mu[0]=mu[0]&4278190079,yC[0]}function Ar(e){if(e=e.toLowerCase(),typeof ko[e]<"u")return ko[e];var t=tG(e),n=t.r,a=t.g,o=t.b,s=t.a;s=s*255|0;var c=bC(n,a,o,s);return ko[e]=c,c}function nG(e,t){yC[0]=Ar(e);var n=mu[0],a=n&255,o=n>>8&255,s=n>>16&255,c=n>>24&255;return[a,o,s,c]}var sp={};function xC(e){if(typeof sp[e]<"u")return sp[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,a=e&255,o=255,s=bC(t,n,a,o);return sp[e]=s,s}function J0(e,t,n,a){return n+(t<<8)+(e<<16)}function ew(e,t,n,a,o,s){var c=Math.floor(n/s*o),u=Math.floor(e.drawingBufferHeight/s-a/s*o),f=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(c,u,1,1,e.RGBA,e.UNSIGNED_BYTE,f);var h=Mo(f,4),m=h[0],g=h[1],y=h[2],b=h[3];return[m,g,y,b]}function we(e,t,n){return(t=ol(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function ze(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tw(Object(n),!0).forEach(function(a){we(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tw(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function rG(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=zo(e))!==null;);return e}function Sm(){return Sm=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var a=rG(e,t);if(a){var o=Object.getOwnPropertyDescriptor(a,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Sm.apply(null,arguments)}function wC(e,t,n,a){var o=Sm(zo(e.prototype),t,n);return typeof o=="function"?function(s){return o.apply(n,s)}:o}function aG(e){return e.normalized?1:e.size}function lp(e){var t=0;return e.forEach(function(n){return t+=aG(n)}),t}function EC(e,t,n){var a=e==="VERTEX"?t.VERTEX_SHADER:t.FRAGMENT_SHADER,o=t.createShader(a);if(o===null)throw new Error("loadShader: error while creating the shader");t.shaderSource(o,n),t.compileShader(o);var s=t.getShaderParameter(o,t.COMPILE_STATUS);if(!s){var c=t.getShaderInfoLog(o);throw t.deleteShader(o),new Error(`loadShader: error while compiling the shader:
`.concat(c,`
`).concat(n))}return o}function iG(e,t){return EC("VERTEX",e,t)}function oG(e,t){return EC("FRAGMENT",e,t)}function sG(e,t){var n=e.createProgram();if(n===null)throw new Error("loadProgram: error while creating the program.");var a,o;for(a=0,o=t.length;a<o;a++)e.attachShader(n,t[a]);e.linkProgram(n);var s=e.getProgramParameter(n,e.LINK_STATUS);if(!s)throw e.deleteProgram(n),new Error("loadProgram: error while linking the program.");return n}function nw(e){var t=e.gl,n=e.buffer,a=e.program,o=e.vertexShader,s=e.fragmentShader;t.deleteShader(o),t.deleteShader(s),t.deleteProgram(a),t.deleteBuffer(n)}function rw(e){return e%1===0?e.toFixed(1):e.toString()}var aw=`#define PICKING_MODE
`,lG=we(we(we(we(we(we(we(we({},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),SC=function(){function e(t,n,a){$t(this,e),we(this,"array",new Float32Array),we(this,"constantArray",new Float32Array),we(this,"capacity",0),we(this,"verticesCount",0);var o=this.getDefinition();if(this.VERTICES=o.VERTICES,this.VERTEX_SHADER_SOURCE=o.VERTEX_SHADER_SOURCE,this.FRAGMENT_SHADER_SOURCE=o.FRAGMENT_SHADER_SOURCE,this.UNIFORMS=o.UNIFORMS,this.ATTRIBUTES=o.ATTRIBUTES,this.METHOD=o.METHOD,this.CONSTANT_ATTRIBUTES="CONSTANT_ATTRIBUTES"in o?o.CONSTANT_ATTRIBUTES:[],this.CONSTANT_DATA="CONSTANT_DATA"in o?o.CONSTANT_DATA:[],this.isInstanced="CONSTANT_ATTRIBUTES"in o,this.ATTRIBUTES_ITEMS_COUNT=lp(this.ATTRIBUTES),this.STRIDE=this.VERTICES*this.ATTRIBUTES_ITEMS_COUNT,this.renderer=a,this.normalProgram=this.getProgramInfo("normal",t,o.VERTEX_SHADER_SOURCE,o.FRAGMENT_SHADER_SOURCE,null),this.pickProgram=n?this.getProgramInfo("pick",t,aw+o.VERTEX_SHADER_SOURCE,aw+o.FRAGMENT_SHADER_SOURCE,n):null,this.isInstanced){var s=lp(this.CONSTANT_ATTRIBUTES);if(this.CONSTANT_DATA.length!==this.VERTICES)throw new Error("Program: error while getting constant data (expected ".concat(this.VERTICES," items, received ").concat(this.CONSTANT_DATA.length," instead)"));this.constantArray=new Float32Array(this.CONSTANT_DATA.length*s);for(var c=0;c<this.CONSTANT_DATA.length;c++){var u=this.CONSTANT_DATA[c];if(u.length!==s)throw new Error("Program: error while getting constant data (one vector has ".concat(u.length," items instead of ").concat(s,")"));for(var f=0;f<u.length;f++)this.constantArray[c*s+f]=u[f]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return Vt(e,[{key:"kill",value:function(){nw(this.normalProgram),this.pickProgram&&(nw(this.pickProgram),this.pickProgram=null)}},{key:"getProgramInfo",value:function(n,a,o,s,c){var u=this.getDefinition(),f=a.createBuffer();if(f===null)throw new Error("Program: error while creating the WebGL buffer.");var h=iG(a,o),m=oG(a,s),g=sG(a,[h,m]),y={};u.UNIFORMS.forEach(function(E){var _=a.getUniformLocation(g,E);_&&(y[E]=_)});var b={};u.ATTRIBUTES.forEach(function(E){b[E.name]=a.getAttribLocation(g,E.name)});var S;if("CONSTANT_ATTRIBUTES"in u&&(u.CONSTANT_ATTRIBUTES.forEach(function(E){b[E.name]=a.getAttribLocation(g,E.name)}),S=a.createBuffer(),S===null))throw new Error("Program: error while creating the WebGL constant buffer.");return{name:n,program:g,gl:a,frameBuffer:c,buffer:f,constantBuffer:S||{},uniformLocations:y,attributeLocations:b,isPicking:n==="pick",vertexShader:h,fragmentShader:m}}},{key:"bindProgram",value:function(n){var a=this,o=0,s=n.gl,c=n.buffer;this.isInstanced?(s.bindBuffer(s.ARRAY_BUFFER,n.constantBuffer),o=0,this.CONSTANT_ATTRIBUTES.forEach(function(u){return o+=a.bindAttribute(u,n,o,!1)}),s.bufferData(s.ARRAY_BUFFER,this.constantArray,s.STATIC_DRAW),s.bindBuffer(s.ARRAY_BUFFER,n.buffer),o=0,this.ATTRIBUTES.forEach(function(u){return o+=a.bindAttribute(u,n,o,!0)}),s.bufferData(s.ARRAY_BUFFER,this.array,s.DYNAMIC_DRAW)):(s.bindBuffer(s.ARRAY_BUFFER,c),o=0,this.ATTRIBUTES.forEach(function(u){return o+=a.bindAttribute(u,n,o)}),s.bufferData(s.ARRAY_BUFFER,this.array,s.DYNAMIC_DRAW)),s.bindBuffer(s.ARRAY_BUFFER,null)}},{key:"unbindProgram",value:function(n){var a=this;this.isInstanced?(this.CONSTANT_ATTRIBUTES.forEach(function(o){return a.unbindAttribute(o,n,!1)}),this.ATTRIBUTES.forEach(function(o){return a.unbindAttribute(o,n,!0)})):this.ATTRIBUTES.forEach(function(o){return a.unbindAttribute(o,n)})}},{key:"bindAttribute",value:function(n,a,o,s){var c=lG[n.type];if(typeof c!="number")throw new Error('Program.bind: yet unsupported attribute type "'.concat(n.type,'"'));var u=a.attributeLocations[n.name],f=a.gl;if(u!==-1){f.enableVertexAttribArray(u);var h=this.isInstanced?(s?this.ATTRIBUTES_ITEMS_COUNT:lp(this.CONSTANT_ATTRIBUTES))*Float32Array.BYTES_PER_ELEMENT:this.ATTRIBUTES_ITEMS_COUNT*Float32Array.BYTES_PER_ELEMENT;if(f.vertexAttribPointer(u,n.size,n.type,n.normalized||!1,h,o),this.isInstanced&&s)if(f instanceof WebGL2RenderingContext)f.vertexAttribDivisor(u,1);else{var m=f.getExtension("ANGLE_instanced_arrays");m&&m.vertexAttribDivisorANGLE(u,1)}}return n.size*c}},{key:"unbindAttribute",value:function(n,a,o){var s=a.attributeLocations[n.name],c=a.gl;if(s!==-1&&(c.disableVertexAttribArray(s),this.isInstanced&&o))if(c instanceof WebGL2RenderingContext)c.vertexAttribDivisor(s,0);else{var u=c.getExtension("ANGLE_instanced_arrays");u&&u.vertexAttribDivisorANGLE(s,0)}}},{key:"reallocate",value:function(n){n!==this.capacity&&(this.capacity=n,this.verticesCount=this.VERTICES*n,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(n,a){var o=a.gl,s=a.program;o.enable(o.BLEND),o.useProgram(s),this.setUniforms(n,a),this.drawWebGL(this.METHOD,a)}},{key:"render",value:function(n){this.hasNothingToRender()||(this.pickProgram&&(this.pickProgram.gl.viewport(0,0,n.width*n.pixelRatio/n.downSizingRatio,n.height*n.pixelRatio/n.downSizingRatio),this.bindProgram(this.pickProgram),this.renderProgram(ze(ze({},n),{},{pixelRatio:n.pixelRatio/n.downSizingRatio}),this.pickProgram),this.unbindProgram(this.pickProgram)),this.normalProgram.gl.viewport(0,0,n.width*n.pixelRatio,n.height*n.pixelRatio),this.bindProgram(this.normalProgram),this.renderProgram(n,this.normalProgram),this.unbindProgram(this.normalProgram))}},{key:"drawWebGL",value:function(n,a){var o=a.gl,s=a.frameBuffer;if(o.bindFramebuffer(o.FRAMEBUFFER,s),!this.isInstanced)o.drawArrays(n,0,this.verticesCount);else if(o instanceof WebGL2RenderingContext)o.drawArraysInstanced(n,0,this.VERTICES,this.capacity);else{var c=o.getExtension("ANGLE_instanced_arrays");c&&c.drawArraysInstancedANGLE(n,0,this.VERTICES,this.capacity)}}}])}(),Ig=function(e){function t(){return $t(this,t),Sn(this,t,arguments)}return _n(t,e),Vt(t,[{key:"kill",value:function(){wC(t,"kill",this)([])}},{key:"process",value:function(a,o,s){var c=o*this.STRIDE;if(s.hidden){for(var u=c+this.STRIDE;c<u;c++)this.array[c]=0;return}return this.processVisibleItem(xC(a),c,s)}}])}(SC),Cl=function(e){function t(){var n;$t(this,t);for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return n=Sn(this,t,[].concat(o)),we(n,"drawLabel",void 0),n}return _n(t,e),Vt(t,[{key:"kill",value:function(){wC(t,"kill",this)([])}},{key:"process",value:function(a,o,s,c,u){var f=o*this.STRIDE;if(u.hidden||s.hidden||c.hidden){for(var h=f+this.STRIDE;f<h;f++)this.array[f]=0;return}return this.processVisibleItem(xC(a),f,s,c,u)}}])}(SC);function _C(e,t){return function(){function n(a,o,s){$t(this,n),we(this,"drawLabel",t),this.programs=e.map(function(c){return new c(a,o,s)})}return Vt(n,[{key:"reallocate",value:function(o){this.programs.forEach(function(s){return s.reallocate(o)})}},{key:"process",value:function(o,s,c,u,f){this.programs.forEach(function(h){return h.process(o,s,c,u,f)})}},{key:"render",value:function(o){this.programs.forEach(function(s){return s.render(o)})}},{key:"kill",value:function(){this.programs.forEach(function(o){return o.kill()})}}])}()}function cG(e,t,n,a,o){var s=o.edgeLabelSize,c=o.edgeLabelFont,u=o.edgeLabelWeight,f=o.edgeLabelColor.attribute?t[o.edgeLabelColor.attribute]||o.edgeLabelColor.color||"#000":o.edgeLabelColor.color,h=t.label;if(h){e.fillStyle=f,e.font="".concat(u," ").concat(s,"px ").concat(c);var m=n.size,g=a.size,y=n.x,b=n.y,S=a.x,E=a.y,_=(y+S)/2,N=(b+E)/2,C=S-y,A=E-b,k=Math.sqrt(C*C+A*A);if(!(k<m+g)){y+=C*m/k,b+=A*m/k,S-=C*g/k,E-=A*g/k,_=(y+S)/2,N=(b+E)/2,C=S-y,A=E-b,k=Math.sqrt(C*C+A*A);var D=e.measureText(h).width;if(D>k){var M="…";for(h=h+M,D=e.measureText(h).width;D>k&&h.length>1;)h=h.slice(0,-2)+M,D=e.measureText(h).width;if(h.length<4)return}var R;C>0?A>0?R=Math.acos(C/k):R=Math.asin(A/k):A>0?R=Math.acos(C/k)+Math.PI:R=Math.asin(C/k)+Math.PI/2,e.save(),e.translate(_,N),e.rotate(R),e.fillText(h,-D/2,t.size/2+s),e.restore()}}}function CC(e,t,n){if(t.label){var a=n.labelSize,o=n.labelFont,s=n.labelWeight,c=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=c,e.font="".concat(s," ").concat(a,"px ").concat(o),e.fillText(t.label,t.x+t.size+3,t.y+a/3)}}function uG(e,t,n){var a=n.labelSize,o=n.labelFont,s=n.labelWeight;e.font="".concat(s," ").concat(a,"px ").concat(o),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var c=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,f=Math.round(u+5),h=Math.round(a+2*c),m=Math.max(t.size,a/2)+c,g=Math.asin(h/2/m),y=Math.sqrt(Math.abs(Math.pow(m,2)-Math.pow(h/2,2)));e.beginPath(),e.moveTo(t.x+y,t.y+h/2),e.lineTo(t.x+m+f,t.y+h/2),e.lineTo(t.x+m+f,t.y-h/2),e.lineTo(t.x+y,t.y-h/2),e.arc(t.x,t.y,m,g,-g),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+c,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,CC(e,t,n)}var dG=`
precision highp float;
varying vec4 v_color;
varying vec2 v_diffVector;
varying float v_radius;
uniform float u_correctionRatio;
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
void main(void) {
float border = u_correctionRatio * 2.0;
float dist = length(v_diffVector) - v_radius + border;
// No antialiasing for picking mode:
#ifdef PICKING_MODE
if (dist > border)
gl_FragColor = transparent;
else
gl_FragColor = v_color;
#else
float t = 0.0;
if (dist > border)
t = 1.0;
else if (dist > 0.0)
t = dist / border;
gl_FragColor = mix(v_color, transparent, t);
#endif
}
`,fG=dG,hG=`
attribute vec4 a_id;
attribute vec4 a_color;
attribute vec2 a_position;
attribute float a_size;
attribute float a_angle;
uniform mat3 u_matrix;
uniform float u_sizeRatio;
uniform float u_correctionRatio;
varying vec4 v_color;
varying vec2 v_diffVector;
varying float v_radius;
varying float v_border;
const float bias = 255.0 / 254.0;
void main() {
float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;
vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));
vec2 position = a_position + diffVector;
gl_Position = vec4(
(u_matrix * vec3(position, 1)).xy,
0,
1
);
v_diffVector = diffVector;
v_radius = size / 2.0;
#ifdef PICKING_MODE
// For picking mode, we use the ID as the color:
v_color = a_id;
#else
// For normal mode, we use the color:
v_color = a_color;
#endif
v_color.a *= bias;
}
`,pG=hG,TC=WebGLRenderingContext,iw=TC.UNSIGNED_BYTE,cp=TC.FLOAT,mG=["u_sizeRatio","u_correctionRatio","u_matrix"],Tl=function(e){function t(){return $t(this,t),Sn(this,t,arguments)}return _n(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:pG,FRAGMENT_SHADER_SOURCE:fG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mG,ATTRIBUTES:[{name:"a_position",size:2,type:cp},{name:"a_size",size:1,type:cp},{name:"a_color",size:4,type:iw,normalized:!0},{name:"a_id",size:4,type:iw,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:cp}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(a,o,s){var c=this.array,u=Ar(s.color);c[o++]=s.x,c[o++]=s.y,c[o++]=s.size,c[o++]=u,c[o++]=a}},{key:"setUniforms",value:function(a,o){var s=o.gl,c=o.uniformLocations,u=c.u_sizeRatio,f=c.u_correctionRatio,h=c.u_matrix;s.uniform1f(f,a.correctionRatio),s.uniform1f(u,a.sizeRatio),s.uniformMatrix3fv(h,!1,a.matrix)}}])}(Ig);we(Tl,"ANGLE_1",0);we(Tl,"ANGLE_2",2*Math.PI/3);we(Tl,"ANGLE_3",4*Math.PI/3);var gG=`
precision mediump float;
varying vec4 v_color;
void main(void) {
gl_FragColor = v_color;
}
`,vG=gG,yG=`
attribute vec2 a_position;
attribute vec2 a_normal;
attribute float a_radius;
attribute vec3 a_barycentric;
#ifdef PICKING_MODE
attribute vec4 a_id;
#else
attribute vec4 a_color;
#endif
uniform mat3 u_matrix;
uniform float u_sizeRatio;
uniform float u_correctionRatio;
uniform float u_minEdgeThickness;
uniform float u_lengthToThicknessRatio;
uniform float u_widenessToThicknessRatio;
varying vec4 v_color;
const float bias = 255.0 / 254.0;
void main() {
float minThickness = u_minEdgeThickness;
float normalLength = length(a_normal);
vec2 unitNormal = a_normal / normalLength;
// These first computations are taken from edge.vert.glsl and
// edge.clamped.vert.glsl. Please read it to get better comments on what's
// happening:
float pixelsThickness = max(normalLength / u_sizeRatio, minThickness);
float webGLThickness = pixelsThickness * u_correctionRatio;
float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio;
float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio;
float da = a_barycentric.x;
float db = a_barycentric.y;
float dc = a_barycentric.z;
vec2 delta = vec2(
da * (webGLNodeRadius * unitNormal.y)
+ db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x)
+ dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x),
da * (-webGLNodeRadius * unitNormal.x)
+ db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y)
+ dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y)
);
vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;
gl_Position = vec4(position, 0, 1);
#ifdef PICKING_MODE
// For picking mode, we use the ID as the color:
v_color = a_id;
#else
// For normal mode, we use the color:
v_color = a_color;
#endif
v_color.a *= bias;
}
`,bG=yG,RC=WebGLRenderingContext,ow=RC.UNSIGNED_BYTE,Qc=RC.FLOAT,xG=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Rl={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function ju(e){var t=ze(ze({},Rl),e||{});return function(n){function a(){return $t(this,a),Sn(this,a,arguments)}return _n(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:bG,FRAGMENT_SHADER_SOURCE:vG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:xG,ATTRIBUTES:[{name:"a_position",size:2,type:Qc},{name:"a_normal",size:2,type:Qc},{name:"a_radius",size:1,type:Qc},{name:"a_color",size:4,type:ow,normalized:!0},{name:"a_id",size:4,type:ow,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Qc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(s,c,u,f,h){if(t.extremity==="source"){var m=[f,u];u=m[0],f=m[1]}var g=h.size||1,y=f.size||1,b=u.x,S=u.y,E=f.x,_=f.y,N=Ar(h.color),C=E-b,A=_-S,k=C*C+A*A,D=0,M=0;k&&(k=1/Math.sqrt(k),D=-A*k*g,M=C*k*g);var R=this.array;R[c++]=E,R[c++]=_,R[c++]=-D,R[c++]=-M,R[c++]=y,R[c++]=N,R[c++]=s}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_sizeRatio,g=f.u_correctionRatio,y=f.u_minEdgeThickness,b=f.u_lengthToThicknessRatio,S=f.u_widenessToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.sizeRatio),u.uniform1f(g,s.correctionRatio),u.uniform1f(y,s.minEdgeThickness),u.uniform1f(b,t.lengthToThicknessRatio),u.uniform1f(S,t.widenessToThicknessRatio)}}])}(Cl)}ju();var wG=`
precision mediump float;
varying vec4 v_color;
varying vec2 v_normal;
varying float v_thickness;
varying float v_feather;
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
void main(void) {
// We only handle antialiasing for normal mode:
#ifdef PICKING_MODE
gl_FragColor = v_color;
#else
float dist = length(v_normal) * v_thickness;
float t = smoothstep(
v_thickness - v_feather,
v_thickness,
dist
);
gl_FragColor = mix(v_color, transparent, t);
#endif
}
`,Hg=wG,EG=`
attribute vec4 a_id;
attribute vec4 a_color;
attribute vec2 a_normal;
attribute float a_normalCoef;
attribute vec2 a_positionStart;
attribute vec2 a_positionEnd;
attribute float a_positionCoef;
attribute float a_radius;
attribute float a_radiusCoef;
uniform mat3 u_matrix;
uniform float u_zoomRatio;
uniform float u_sizeRatio;
uniform float u_pixelRatio;
uniform float u_correctionRatio;
uniform float u_minEdgeThickness;
uniform float u_lengthToThicknessRatio;
uniform float u_feather;
varying vec4 v_color;
varying vec2 v_normal;
varying float v_thickness;
varying float v_feather;
const float bias = 255.0 / 254.0;
void main() {
float minThickness = u_minEdgeThickness;
float radius = a_radius * a_radiusCoef;
vec2 normal = a_normal * a_normalCoef;
vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
float normalLength = length(normal);
vec2 unitNormal = normal / normalLength;
// These first computations are taken from edge.vert.glsl. Please read it to
// get better comments on what's happening:
float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
// Here, we move the point to leave space for the arrow head:
float direction = sign(radius);
float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio;
float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength);
// Here is the proper position of the vertex
gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1);
v_thickness = webGLThickness / u_zoomRatio;
v_normal = unitNormal;
v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
#ifdef PICKING_MODE
// For picking mode, we use the ID as the color:
v_color = a_id;
#else
// For normal mode, we use the color:
v_color = a_color;
#endif
v_color.a *= bias;
}
`,SG=EG,AC=WebGLRenderingContext,sw=AC.UNSIGNED_BYTE,yi=AC.FLOAT,_G=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],CG={lengthToThicknessRatio:Rl.lengthToThicknessRatio};function DC(e){var t=ze(ze({},CG),{});return function(n){function a(){return $t(this,a),Sn(this,a,arguments)}return _n(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:SG,FRAGMENT_SHADER_SOURCE:Hg,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:_G,ATTRIBUTES:[{name:"a_positionStart",size:2,type:yi},{name:"a_positionEnd",size:2,type:yi},{name:"a_normal",size:2,type:yi},{name:"a_color",size:4,type:sw,normalized:!0},{name:"a_id",size:4,type:sw,normalized:!0},{name:"a_radius",size:1,type:yi}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:yi},{name:"a_normalCoef",size:1,type:yi},{name:"a_radiusCoef",size:1,type:yi}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(s,c,u,f,h){var m=h.size||1,g=u.x,y=u.y,b=f.x,S=f.y,E=Ar(h.color),_=b-g,N=S-y,C=f.size||1,A=_*_+N*N,k=0,D=0;A&&(A=1/Math.sqrt(A),k=-N*A*m,D=_*A*m);var M=this.array;M[c++]=g,M[c++]=y,M[c++]=b,M[c++]=S,M[c++]=k,M[c++]=D,M[c++]=E,M[c++]=s,M[c++]=C}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_zoomRatio,g=f.u_feather,y=f.u_pixelRatio,b=f.u_correctionRatio,S=f.u_sizeRatio,E=f.u_minEdgeThickness,_=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.zoomRatio),u.uniform1f(S,s.sizeRatio),u.uniform1f(b,s.correctionRatio),u.uniform1f(y,s.pixelRatio),u.uniform1f(g,s.antiAliasingFeather),u.uniform1f(E,s.minEdgeThickness),u.uniform1f(_,t.lengthToThicknessRatio)}}])}(Cl)}DC();function TG(e){return _C([DC(),ju(e)])}var RG=TG(),kC=RG,AG=`
attribute vec4 a_id;
attribute vec4 a_color;
attribute vec2 a_normal;
attribute float a_normalCoef;
attribute vec2 a_positionStart;
attribute vec2 a_positionEnd;
attribute float a_positionCoef;
uniform mat3 u_matrix;
uniform float u_sizeRatio;
uniform float u_zoomRatio;
uniform float u_pixelRatio;
uniform float u_correctionRatio;
uniform float u_minEdgeThickness;
uniform float u_feather;
varying vec4 v_color;
varying vec2 v_normal;
varying float v_thickness;
varying float v_feather;
const float bias = 255.0 / 254.0;
void main() {
float minThickness = u_minEdgeThickness;
vec2 normal = a_normal * a_normalCoef;
vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
float normalLength = length(normal);
vec2 unitNormal = normal / normalLength;
// We require edges to be at least "minThickness" pixels thick *on screen*
// (so we need to compensate the size ratio):
float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
// Then, we need to retrieve the normalized thickness of the edge in the WebGL
// referential (in a ([0, 1], [0, 1]) space), using our "magic" correction
// ratio:
float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
// Here is the proper position of the vertex
gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1);
// For the fragment shader though, we need a thickness that takes the "magic"
// correction ratio into account (as in webGLThickness), but so that the
// antialiasing effect does not depend on the zoom level. So here's yet
// another thickness version:
v_thickness = webGLThickness / u_zoomRatio;
v_normal = unitNormal;
v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
#ifdef PICKING_MODE
// For picking mode, we use the ID as the color:
v_color = a_id;
#else
// For normal mode, we use the color:
v_color = a_color;
#endif
v_color.a *= bias;
}
`,DG=AG,NC=WebGLRenderingContext,lw=NC.UNSIGNED_BYTE,Zs=NC.FLOAT,kG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],NG=function(e){function t(){return $t(this,t),Sn(this,t,arguments)}return _n(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:DG,FRAGMENT_SHADER_SOURCE:Hg,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:kG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Zs},{name:"a_positionEnd",size:2,type:Zs},{name:"a_normal",size:2,type:Zs},{name:"a_color",size:4,type:lw,normalized:!0},{name:"a_id",size:4,type:lw,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Zs},{name:"a_normalCoef",size:1,type:Zs}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(a,o,s,c,u){var f=u.size||1,h=s.x,m=s.y,g=c.x,y=c.y,b=Ar(u.color),S=g-h,E=y-m,_=S*S+E*E,N=0,C=0;_&&(_=1/Math.sqrt(_),N=-E*_*f,C=S*_*f);var A=this.array;A[o++]=h,A[o++]=m,A[o++]=g,A[o++]=y,A[o++]=N,A[o++]=C,A[o++]=b,A[o++]=a}},{key:"setUniforms",value:function(a,o){var s=o.gl,c=o.uniformLocations,u=c.u_matrix,f=c.u_zoomRatio,h=c.u_feather,m=c.u_pixelRatio,g=c.u_correctionRatio,y=c.u_sizeRatio,b=c.u_minEdgeThickness;s.uniformMatrix3fv(u,!1,a.matrix),s.uniform1f(f,a.zoomRatio),s.uniform1f(y,a.sizeRatio),s.uniform1f(g,a.correctionRatio),s.uniform1f(m,a.pixelRatio),s.uniform1f(h,a.antiAliasingFeather),s.uniform1f(b,a.minEdgeThickness)}}])}(Cl),$g=function(e){function t(){var n;return $t(this,t),n=Sn(this,t),n.rawEmitter=n,n}return _n(t,e),Vt(t)}(tC.EventEmitter),up,cw;function Dr(){return cw||(cw=1,up=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),up}var OG=Dr();const jG=dn(OG);var LG=function(t){return t},zG=function(t){return t*t},MG=function(t){return t*(2-t)},PG=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},GG=function(t){return t*t*t},FG=function(t){return--t*t*t+1},UG=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},OC={linear:LG,quadraticIn:zG,quadraticOut:MG,quadraticInOut:PG,cubicIn:GG,cubicOut:FG,cubicInOut:UG},jC={easing:"quadraticInOut",duration:150};function BG(e,t,n,a){var o=Object.assign({},jC,n),s=typeof o.easing=="function"?o.easing:OC[o.easing],c=Date.now(),u={};for(var f in t){var h=t[f];u[f]={};for(var m in h)u[f][m]=e.getNodeAttribute(f,m)}var g=null,y=function(){g=null;var S=(Date.now()-c)/o.duration;if(S>=1){for(var E in t){var _=t[E];for(var N in _)e.setNodeAttribute(E,N,_[N])}return}S=s(S);for(var C in t){var A=t[C],k=u[C];for(var D in A)e.setNodeAttribute(C,D,A[D]*S+k[D]*(1-S))}g=requestAnimationFrame(y)};return y(),function(){g&&cancelAnimationFrame(g)}}function or(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Jc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function uw(e,t){var n=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=n,e[3]=-n,e[4]=a,e}function dw(e,t,n){return e[6]=t,e[7]=n,e}function ja(e,t){var n=e[0],a=e[1],o=e[2],s=e[3],c=e[4],u=e[5],f=e[6],h=e[7],m=e[8],g=t[0],y=t[1],b=t[2],S=t[3],E=t[4],_=t[5],N=t[6],C=t[7],A=t[8];return e[0]=g*n+y*s+b*f,e[1]=g*a+y*c+b*h,e[2]=g*o+y*u+b*m,e[3]=S*n+E*s+_*f,e[4]=S*a+E*c+_*h,e[5]=S*o+E*u+_*m,e[6]=N*n+C*s+A*f,e[7]=N*a+C*c+A*h,e[8]=N*o+C*u+A*m,e}function _m(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=e[0],o=e[1],s=e[3],c=e[4],u=e[6],f=e[7],h=t.x,m=t.y;return{x:h*a+m*s+u*n,y:h*o+m*c+f*n}}function IG(e,t){var n=e.height/e.width,a=t.height/t.width;return n<1&&a>1||n>1&&a<1?1:Math.min(Math.max(a,1/a),Math.max(1/n,n))}function Qs(e,t,n,a,o){var s=e.angle,c=e.ratio,u=e.x,f=e.y,h=t.width,m=t.height,g=or(),y=Math.min(h,m)-2*a,b=IG(t,n);return o?(ja(g,dw(or(),u,f)),ja(g,Jc(or(),c)),ja(g,uw(or(),s)),ja(g,Jc(or(),h/y/2/b,m/y/2/b))):(ja(g,Jc(or(),2*(y/h)*b,2*(y/m)*b)),ja(g,uw(or(),-s)),ja(g,Jc(or(),1/c)),ja(g,dw(or(),-u,-f))),g}function HG(e,t,n){var a=_m(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),o=a.x,s=a.y;return 1/Math.sqrt(Math.pow(o,2)+Math.pow(s,2))/n.width}function $G(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,a=1/0,o=-1/0;return e.forEachNode(function(s,c){var u=c.x,f=c.y;u<t&&(t=u),u>n&&(n=u),f<a&&(a=f),f>o&&(o=f)}),{x:[t,n],y:[a,o]}}function VG(e){if(!jG(e))throw new Error("Sigma: invalid graph instance.");e.forEachNode(function(t,n){if(!Number.isFinite(n.x)||!Number.isFinite(n.y))throw new Error("Sigma: Coordinates of node ".concat(t," are invalid. A node must have a numeric 'x' and 'y' attribute."))})}function qG(e,t,n){var a=document.createElement(e);if(t)for(var o in t)a.style[o]=t[o];if(n)for(var s in n)a.setAttribute(s,n[s]);return a}function fw(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function hw(e,t,n){return n.sort(function(a,o){var s=t(a)||0,c=t(o)||0;return s<c?-1:s>c?1:0})}function pw(e){var t=Mo(e.x,2),n=t[0],a=t[1],o=Mo(e.y,2),s=o[0],c=o[1],u=Math.max(a-n,c-s),f=(a+n)/2,h=(c+s)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(f)&&(f=0),isNaN(h)&&(h=0);var m=function(y){return{x:.5+(y.x-f)/u,y:.5+(y.y-h)/u}};return m.applyTo=function(g){g.x=.5+(g.x-f)/u,g.y=.5+(g.y-h)/u},m.inverse=function(g){return{x:f+u*(g.x-.5),y:h+u*(g.y-.5)}},m.ratio=u,m}function Cm(e){"@babel/helpers - typeof";return Cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cm(e)}function mw(e,t){var n=t.size;if(n!==0){var a=e.length;e.length+=n;var o=0;t.forEach(function(s){e[a+o]=s,o++})}}function dp(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t<n;t++){var a=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];a&&Object.assign(e,a)}return e}var Vg={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:cG,defaultDrawNodeLabel:CC,defaultDrawNodeHover:uG,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:{}},YG={circle:Tl},WG={arrow:kC,line:NG};function fp(e){if(typeof e.labelDensity!="number"||e.labelDensity<0)throw new 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 new Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")}function XG(e){var t=dp({},Vg,e);return t.nodeProgramClasses=dp({},YG,t.nodeProgramClasses),t.edgeProgramClasses=dp({},WG,t.edgeProgramClasses),t}var eu=1.5,gw=function(e){function t(){var n;return $t(this,t),n=Sn(this,t),we(n,"x",.5),we(n,"y",.5),we(n,"angle",0),we(n,"ratio",1),we(n,"minRatio",null),we(n,"maxRatio",null),we(n,"enabledZooming",!0),we(n,"enabledPanning",!0),we(n,"enabledRotation",!0),we(n,"clean",null),we(n,"nextFrame",null),we(n,"previousState",null),we(n,"enabled",!0),n.previousState=n.getState(),n}return _n(t,e),Vt(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(a){return this.x===a.x&&this.y===a.y&&this.ratio===a.ratio&&this.angle===a.angle}},{key:"getPreviousState",value:function(){var a=this.previousState;return a?{x:a.x,y:a.y,angle:a.angle,ratio:a.ratio}:null}},{key:"getBoundedRatio",value:function(a){var o=a;return typeof this.minRatio=="number"&&(o=Math.max(o,this.minRatio)),typeof this.maxRatio=="number"&&(o=Math.min(o,this.maxRatio)),o}},{key:"validateState",value:function(a){var o={};return this.enabledPanning&&typeof a.x=="number"&&(o.x=a.x),this.enabledPanning&&typeof a.y=="number"&&(o.y=a.y),this.enabledZooming&&typeof a.ratio=="number"&&(o.ratio=this.getBoundedRatio(a.ratio)),this.enabledRotation&&typeof a.angle=="number"&&(o.angle=a.angle),this.clean?this.clean(ze(ze({},this.getState()),o)):o}},{key:"isAnimated",value:function(){return!!this.nextFrame}},{key:"setState",value:function(a){if(!this.enabled)return this;this.previousState=this.getState();var o=this.validateState(a);return typeof o.x=="number"&&(this.x=o.x),typeof o.y=="number"&&(this.y=o.y),typeof o.ratio=="number"&&(this.ratio=o.ratio),typeof o.angle=="number"&&(this.angle=o.angle),this.hasState(this.previousState)||this.emit("updated",this.getState()),this}},{key:"updateState",value:function(a){return this.setState(a(this.getState())),this}},{key:"animate",value:function(a){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;if(!c)return new Promise(function(b){return o.animate(a,s,b)});if(this.enabled){var u=ze(ze({},jC),s),f=this.validateState(a),h=typeof u.easing=="function"?u.easing:OC[u.easing],m=Date.now(),g=this.getState(),y=function(){var S=(Date.now()-m)/u.duration;if(S>=1){o.nextFrame=null,o.setState(f),o.animationCallback&&(o.animationCallback.call(null),o.animationCallback=void 0);return}var E=h(S),_={};typeof f.x=="number"&&(_.x=g.x+(f.x-g.x)*E),typeof f.y=="number"&&(_.y=g.y+(f.y-g.y)*E),o.enabledRotation&&typeof f.angle=="number"&&(_.angle=g.angle+(f.angle-g.angle)*E),typeof f.ratio=="number"&&(_.ratio=g.ratio+(f.ratio-g.ratio)*E),o.setState(_),o.nextFrame=requestAnimationFrame(y)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(y)):y(),this.animationCallback=c}}},{key:"animatedZoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio/a}):this.animate({ratio:this.ratio/(a.factor||eu)},a):this.animate({ratio:this.ratio/eu})}},{key:"animatedUnzoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio*a}):this.animate({ratio:this.ratio*(a.factor||eu)},a):this.animate({ratio:this.ratio*eu})}},{key:"animatedReset",value:function(a){return this.animate({x:.5,y:.5,ratio:1,angle:0},a)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(a){var o=new t;return o.setState(a)}}])}($g);function lr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Qr(e,t){var n=ze(ze({},lr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Js(e){var t="x"in e?e:ze(ze({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function KG(e,t){return ze(ze({},Qr(e,t)),{},{delta:LC(e)})}var ZG=2;function gu(e){for(var t=[],n=0,a=Math.min(e.length,ZG);n<a;n++)t.push(e[n]);return t}function el(e,t,n){var a={touches:gu(e.touches).map(function(o){return lr(o,n)}),previousTouches:t.map(function(o){return lr(o,n)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){a.sigmaDefaultPrevented=!0},original:e};return a}function LC(e){if(typeof e.deltaY<"u")return e.deltaY*-3/360;if(typeof e.detail<"u")return e.detail/-9;throw new Error("Captor: could not extract delta from event.")}var zC=function(e){function t(n,a){var o;return $t(this,t),o=Sn(this,t),o.container=n,o.renderer=a,o}return _n(t,e),Vt(t)}($g),QG=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],JG=QG.reduce(function(e,t){return ze(ze({},e),{},we({},t,Vg[t]))},{}),e3=function(e){function t(n,a){var o;return $t(this,t),o=Sn(this,t,[n,a]),we(o,"enabled",!0),we(o,"draggedEvents",0),we(o,"downStartTime",null),we(o,"lastMouseX",null),we(o,"lastMouseY",null),we(o,"isMouseDown",!1),we(o,"isMoving",!1),we(o,"movingTimeout",null),we(o,"startCameraState",null),we(o,"clicks",0),we(o,"doubleClickTimeout",null),we(o,"currentWheelDirection",0),we(o,"settings",JG),o.handleClick=o.handleClick.bind(o),o.handleRightClick=o.handleRightClick.bind(o),o.handleDown=o.handleDown.bind(o),o.handleUp=o.handleUp.bind(o),o.handleMove=o.handleMove.bind(o),o.handleWheel=o.handleWheel.bind(o),o.handleLeave=o.handleLeave.bind(o),o.handleEnter=o.handleEnter.bind(o),n.addEventListener("click",o.handleClick,{capture:!1}),n.addEventListener("contextmenu",o.handleRightClick,{capture:!1}),n.addEventListener("mousedown",o.handleDown,{capture:!1}),n.addEventListener("wheel",o.handleWheel,{capture:!1}),n.addEventListener("mouseleave",o.handleLeave,{capture:!1}),n.addEventListener("mouseenter",o.handleEnter,{capture:!1}),document.addEventListener("mousemove",o.handleMove,{capture:!1}),document.addEventListener("mouseup",o.handleUp,{capture:!1}),o}return _n(t,e),Vt(t,[{key:"kill",value:function(){var a=this.container;a.removeEventListener("click",this.handleClick),a.removeEventListener("contextmenu",this.handleRightClick),a.removeEventListener("mousedown",this.handleDown),a.removeEventListener("wheel",this.handleWheel),a.removeEventListener("mouseleave",this.handleLeave),a.removeEventListener("mouseenter",this.handleEnter),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("mouseup",this.handleUp)}},{key:"handleClick",value:function(a){var o=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(a);setTimeout(function(){o.clicks=0,o.doubleClickTimeout=null},this.settings.doubleClickTimeout),this.draggedEvents<this.settings.draggedEventsTolerance&&this.emit("click",Qr(a,this.container))}}},{key:"handleRightClick",value:function(a){this.enabled&&this.emit("rightClick",Qr(a,this.container))}},{key:"handleDoubleClick",value:function(a){if(this.enabled){a.preventDefault(),a.stopPropagation();var o=Qr(a,this.container);if(this.emit("doubleClick",o),!o.sigmaDefaultPrevented){var s=this.renderer.getCamera(),c=s.getBoundedRatio(s.getState().ratio/this.settings.doubleClickZoomingRatio);s.animate(this.renderer.getViewportZoomedState(lr(a,this.container),c),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}}},{key:"handleDown",value:function(a){if(this.enabled){if(a.button===0){this.startCameraState=this.renderer.getCamera().getState();var o=lr(a,this.container),s=o.x,c=o.y;this.lastMouseX=s,this.lastMouseY=c,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",Qr(a,this.container))}}},{key:"handleUp",value:function(a){var o=this;if(!(!this.enabled||!this.isMouseDown)){var s=this.renderer.getCamera();this.isMouseDown=!1,typeof this.movingTimeout=="number"&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var c=lr(a,this.container),u=c.x,f=c.y,h=s.getState(),m=s.getPreviousState()||{x:0,y:0};this.isMoving?s.animate({x:h.x+this.settings.inertiaRatio*(h.x-m.x),y:h.y+this.settings.inertiaRatio*(h.y-m.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"}):(this.lastMouseX!==u||this.lastMouseY!==f)&&s.setState({x:h.x,y:h.y}),this.isMoving=!1,setTimeout(function(){var g=o.draggedEvents>0;o.draggedEvents=0,g&&o.renderer.getSetting("hideEdgesOnMove")&&o.renderer.refresh()},0),this.emit("mouseup",Qr(a,this.container))}}},{key:"handleMove",value:function(a){var o=this;if(this.enabled){var s=Qr(a,this.container);if(this.emit("mousemovebody",s),(a.target===this.container||a.composedPath()[0]===this.container)&&this.emit("mousemove",s),!s.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){o.movingTimeout=null,o.isMoving=!1},this.settings.dragTimeout);var c=this.renderer.getCamera(),u=lr(a,this.container),f=u.x,h=u.y,m=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),g=this.renderer.viewportToFramedGraph({x:f,y:h}),y=m.x-g.x,b=m.y-g.y,S=c.getState(),E=S.x+y,_=S.y+b;c.setState({x:E,y:_}),this.lastMouseX=f,this.lastMouseY=h,a.preventDefault(),a.stopPropagation()}}}},{key:"handleLeave",value:function(a){this.emit("mouseleave",Qr(a,this.container))}},{key:"handleEnter",value:function(a){this.emit("mouseenter",Qr(a,this.container))}},{key:"handleWheel",value:function(a){var o=this,s=this.renderer.getCamera();if(!(!this.enabled||!s.enabledZooming)){var c=LC(a);if(c){var u=KG(a,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){a.preventDefault(),a.stopPropagation();return}var f=s.getState().ratio,h=c>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,m=s.getBoundedRatio(f*h),g=c>0?1:-1,y=Date.now();f!==m&&(a.preventDefault(),a.stopPropagation(),!(this.currentWheelDirection===g&&this.lastWheelTriggerTime&&y-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(s.animate(this.renderer.getViewportZoomedState(lr(a,this.container),m),{easing:"quadraticOut",duration:this.settings.zoomDuration},function(){o.currentWheelDirection=0}),this.currentWheelDirection=g,this.lastWheelTriggerTime=y))}}}},{key:"setSettings",value:function(a){this.settings=a}}])}(zC),t3=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],n3=t3.reduce(function(e,t){return ze(ze({},e),{},we({},t,Vg[t]))},{}),r3=function(e){function t(n,a){var o;return $t(this,t),o=Sn(this,t,[n,a]),we(o,"enabled",!0),we(o,"isMoving",!1),we(o,"hasMoved",!1),we(o,"touchMode",0),we(o,"startTouchesPositions",[]),we(o,"lastTouches",[]),we(o,"lastTap",null),we(o,"settings",n3),o.handleStart=o.handleStart.bind(o),o.handleLeave=o.handleLeave.bind(o),o.handleMove=o.handleMove.bind(o),n.addEventListener("touchstart",o.handleStart,{capture:!1}),n.addEventListener("touchcancel",o.handleLeave,{capture:!1}),document.addEventListener("touchend",o.handleLeave,{capture:!1,passive:!1}),document.addEventListener("touchmove",o.handleMove,{capture:!1,passive:!1}),o}return _n(t,e),Vt(t,[{key:"kill",value:function(){var a=this.container;a.removeEventListener("touchstart",this.handleStart),a.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(a){var o=this;if(this.enabled){a.preventDefault();var s=gu(a.touches);if(this.touchMode=s.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=s.map(function(b){return lr(b,o.container)}),this.touchMode===2){var c=Mo(this.startTouchesPositions,2),u=c[0],f=u.x,h=u.y,m=c[1],g=m.x,y=m.y;this.startTouchesAngle=Math.atan2(y-h,g-f),this.startTouchesDistance=Math.sqrt(Math.pow(g-f,2)+Math.pow(y-h,2))}this.emit("touchdown",el(a,this.lastTouches,this.container)),this.lastTouches=s,this.lastTouchesPositions=this.startTouchesPositions}}},{key:"handleLeave",value:function(a){if(!(!this.enabled||!this.startTouchesPositions.length)){switch(a.cancelable&&a.preventDefault(),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(a.touches.length===1){this.handleStart(a),a.preventDefault();break}case 1:if(this.isMoving){var o=this.renderer.getCamera(),s=o.getState(),c=o.getPreviousState()||{x:0,y:0};o.animate({x:s.x+this.settings.inertiaRatio*(s.x-c.x),y:s.y+this.settings.inertiaRatio*(s.y-c.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit("touchup",el(a,this.lastTouches,this.container)),!a.touches.length){var u=lr(this.lastTouches[0],this.container),f=this.startTouchesPositions[0],h=Math.pow(u.x-f.x,2)+Math.pow(u.y-f.y,2);if(!a.touches.length&&h<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var m=el(a,this.lastTouches,this.container);if(this.emit("doubletap",m),this.lastTap=null,!m.sigmaDefaultPrevented){var g=this.renderer.getCamera(),y=g.getBoundedRatio(g.getState().ratio/this.settings.doubleClickZoomingRatio);g.animate(this.renderer.getViewportZoomedState(u,y),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var b=el(a,this.lastTouches,this.container);this.emit("tap",b),this.lastTap={time:Date.now(),position:b.touches[0]||b.previousTouches[0]}}}this.lastTouches=gu(a.touches),this.startTouchesPositions=[]}}},{key:"handleMove",value:function(a){var o=this;if(!(!this.enabled||!this.startTouchesPositions.length)){a.preventDefault();var s=gu(a.touches),c=s.map(function(H){return lr(H,o.container)}),u=this.lastTouches;this.lastTouches=s,this.lastTouchesPositions=c;var f=el(a,u,this.container);if(this.emit("touchmove",f),!f.sigmaDefaultPrevented&&(this.hasMoved||(this.hasMoved=c.some(function(H,O){var $=o.startTouchesPositions[O];return $&&(H.x!==$.x||H.y!==$.y)})),!!this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){o.isMoving=!1},this.settings.dragTimeout);var h=this.renderer.getCamera(),m=this.startCameraState,g=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:{var y=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),b=y.x,S=y.y,E=this.renderer.viewportToFramedGraph(c[0]),_=E.x,N=E.y;h.setState({x:m.x+b-_,y:m.y+S-N});break}case 2:{var C={x:.5,y:.5,angle:0,ratio:1},A=c[0],k=A.x,D=A.y,M=c[1],R=M.x,U=M.y,L=Math.atan2(U-D,R-k)-this.startTouchesAngle,I=Math.hypot(U-D,R-k)/this.startTouchesDistance,q=h.getBoundedRatio(m.ratio/I);C.ratio=q,C.angle=m.angle+L;var Y=this.getDimensions(),B=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:m}),X=Math.min(Y.width,Y.height)-2*g,ne=X/Y.width,F=X/Y.height,z=q/X,j=k-X/2/ne,K=D-X/2/F,G=[j*Math.cos(-C.angle)-K*Math.sin(-C.angle),K*Math.cos(-C.angle)+j*Math.sin(-C.angle)];j=G[0],K=G[1],C.x=B.x-j*z,C.y=B.y+K*z,h.setState(C);break}}}}}},{key:"setSettings",value:function(a){this.settings=a}}])}(zC);function a3(e){if(Array.isArray(e))return Em(e)}function i3(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vw(e){return a3(e)||i3(e)||gC(e)||o3()}function s3(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}function hp(e,t){if(e==null)return{};var n,a,o=s3(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)n=s[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var yw=function(){function e(t,n){$t(this,e),this.key=t,this.size=n}return Vt(e,null,[{key:"compare",value:function(n,a){return n.size>a.size?-1:n.size<a.size||n.key>a.key?1:-1}}])}(),bw=function(){function e(){$t(this,e),we(this,"width",0),we(this,"height",0),we(this,"cellSize",0),we(this,"columns",0),we(this,"rows",0),we(this,"cells",{})}return Vt(e,[{key:"resizeAndClear",value:function(n,a){this.width=n.width,this.height=n.height,this.cellSize=a,this.columns=Math.ceil(n.width/a),this.rows=Math.ceil(n.height/a),this.cells={}}},{key:"getIndex",value:function(n){var a=Math.floor(n.x/this.cellSize),o=Math.floor(n.y/this.cellSize);return o*this.columns+a}},{key:"add",value:function(n,a,o){var s=new yw(n,a),c=this.getIndex(o),u=this.cells[c];u||(u=[],this.cells[c]=u),u.push(s)}},{key:"organize",value:function(){for(var n in this.cells){var a=this.cells[n];a.sort(yw.compare)}}},{key:"getLabelsToDisplay",value:function(n,a){var o=this.cellSize*this.cellSize,s=o/n/n,c=s*a/o,u=Math.ceil(c),f=[];for(var h in this.cells)for(var m=this.cells[h],g=0;g<Math.min(u,m.length);g++)f.push(m[g].key);return f}}])}();function l3(e){var t=e.graph,n=e.hoveredNode,a=e.highlightedNodes,o=e.displayedNodeLabels,s=[];return t.forEachEdge(function(c,u,f,h){(f===n||h===n||a.has(f)||a.has(h)||o.has(f)&&o.has(h))&&s.push(c)}),s}var c3=150,u3=50,na=Object.prototype.hasOwnProperty;function d3(e,t,n){if(!na.call(n,"x")||!na.call(n,"y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'.concat(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||(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||(n.size=2),na.call(n,"hidden")||(n.hidden=!1),na.call(n,"highlighted")||(n.highlighted=!1),na.call(n,"forceLabel")||(n.forceLabel=!1),(!n.type||n.type==="")&&(n.type=e.defaultNodeType),n.zIndex||(n.zIndex=0),n}function f3(e,t,n){return n.color||(n.color=e.defaultEdgeColor),n.label||(n.label=""),n.size||(n.size=.5),na.call(n,"hidden")||(n.hidden=!1),na.call(n,"forceLabel")||(n.forceLabel=!1),(!n.type||n.type==="")&&(n.type=e.defaultEdgeType),n.zIndex||(n.zIndex=0),n}var h3=function(e){function t(n,a){var o,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if($t(this,t),o=Sn(this,t),we(o,"elements",{}),we(o,"canvasContexts",{}),we(o,"webGLContexts",{}),we(o,"pickingLayers",new Set),we(o,"textures",{}),we(o,"frameBuffers",{}),we(o,"activeListeners",{}),we(o,"labelGrid",new bw),we(o,"nodeDataCache",{}),we(o,"edgeDataCache",{}),we(o,"nodeProgramIndex",{}),we(o,"edgeProgramIndex",{}),we(o,"nodesWithForcedLabels",new Set),we(o,"edgesWithForcedLabels",new Set),we(o,"nodeExtent",{x:[0,1],y:[0,1]}),we(o,"nodeZExtent",[1/0,-1/0]),we(o,"edgeZExtent",[1/0,-1/0]),we(o,"matrix",or()),we(o,"invMatrix",or()),we(o,"correctionRatio",1),we(o,"customBBox",null),we(o,"normalizationFunction",pw({x:[0,1],y:[0,1]})),we(o,"graphToViewportRatio",1),we(o,"itemIDsIndex",{}),we(o,"nodeIndices",{}),we(o,"edgeIndices",{}),we(o,"width",0),we(o,"height",0),we(o,"pixelRatio",fw()),we(o,"pickingDownSizingRatio",2*o.pixelRatio),we(o,"displayedNodeLabels",new Set),we(o,"displayedEdgeLabels",new Set),we(o,"highlightedNodes",new Set),we(o,"hoveredNode",null),we(o,"hoveredEdge",null),we(o,"renderFrame",null),we(o,"renderHighlightedNodesFrame",null),we(o,"needToProcess",!1),we(o,"checkEdgesEventsFrame",null),we(o,"nodePrograms",{}),we(o,"nodeHoverPrograms",{}),we(o,"edgePrograms",{}),o.settings=XG(s),fp(o.settings),VG(n),!(a instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");o.graph=n,o.container=a,o.createWebGLContext("edges",{picking:s.enableEdgeEvents}),o.createCanvasContext("edgeLabels"),o.createWebGLContext("nodes",{picking:!0}),o.createCanvasContext("labels"),o.createCanvasContext("hovers"),o.createWebGLContext("hoverNodes"),o.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),o.resize();for(var c in o.settings.nodeProgramClasses)o.registerNodeProgram(c,o.settings.nodeProgramClasses[c],o.settings.nodeHoverProgramClasses[c]);for(var u in o.settings.edgeProgramClasses)o.registerEdgeProgram(u,o.settings.edgeProgramClasses[u]);return o.camera=new gw,o.bindCameraHandlers(),o.mouseCaptor=new e3(o.elements.mouse,o),o.mouseCaptor.setSettings(o.settings),o.touchCaptor=new r3(o.elements.mouse,o),o.touchCaptor.setSettings(o.settings),o.bindEventHandlers(),o.bindGraphHandlers(),o.handleSettingsUpdate(),o.refresh(),o}return _n(t,e),Vt(t,[{key:"registerNodeProgram",value:function(a,o,s){return this.nodePrograms[a]&&this.nodePrograms[a].kill(),this.nodeHoverPrograms[a]&&this.nodeHoverPrograms[a].kill(),this.nodePrograms[a]=new o(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[a]=new(s||o)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(a,o){return this.edgePrograms[a]&&this.edgePrograms[a].kill(),this.edgePrograms[a]=new o(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(a){if(this.nodePrograms[a]){var o=this.nodePrograms,s=o[a],c=hp(o,[a].map(ol));s.kill(),this.nodePrograms=c}if(this.nodeHoverPrograms[a]){var u=this.nodeHoverPrograms,f=u[a],h=hp(u,[a].map(ol));f.kill(),this.nodePrograms=h}return this}},{key:"unregisterEdgeProgram",value:function(a){if(this.edgePrograms[a]){var o=this.edgePrograms,s=o[a],c=hp(o,[a].map(ol));s.kill(),this.edgePrograms=c}return this}},{key:"resetWebGLTexture",value:function(a){var o=this.webGLContexts[a],s=this.frameBuffers[a],c=this.textures[a];c&&o.deleteTexture(c);var u=o.createTexture();return o.bindFramebuffer(o.FRAMEBUFFER,s),o.bindTexture(o.TEXTURE_2D,u),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,this.width,this.height,0,o.RGBA,o.UNSIGNED_BYTE,null),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,u,0),this.textures[a]=u,this}},{key:"bindCameraHandlers",value:function(){var a=this;return this.activeListeners.camera=function(){a.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(a){var o=a.x,s=a.y,c=ew(this.webGLContexts.nodes,this.frameBuffers.nodes,o,s,this.pixelRatio,this.pickingDownSizingRatio),u=J0.apply(void 0,vw(c)),f=this.itemIDsIndex[u];return f&&f.type==="node"?f.id:null}},{key:"bindEventHandlers",value:function(){var a=this;this.activeListeners.handleResize=function(){a.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(s){var c=Js(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},f=a.getNodeAtPosition(c);if(f&&a.hoveredNode!==f&&!a.nodeDataCache[f].hidden){a.hoveredNode&&a.emit("leaveNode",ze(ze({},u),{},{node:a.hoveredNode})),a.hoveredNode=f,a.emit("enterNode",ze(ze({},u),{},{node:f})),a.scheduleHighlightedNodesRender();return}if(a.hoveredNode&&a.getNodeAtPosition(c)!==a.hoveredNode){var h=a.hoveredNode;a.hoveredNode=null,a.emit("leaveNode",ze(ze({},u),{},{node:h})),a.scheduleHighlightedNodesRender();return}if(a.settings.enableEdgeEvents){var m=a.hoveredNode?null:a.getEdgeAtPoint(u.event.x,u.event.y);m!==a.hoveredEdge&&(a.hoveredEdge&&a.emit("leaveEdge",ze(ze({},u),{},{edge:a.hoveredEdge})),m&&a.emit("enterEdge",ze(ze({},u),{},{edge:m})),a.hoveredEdge=m)}},this.activeListeners.handleMoveBody=function(s){var c=Js(s);a.emit("moveBody",{event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(s){var c=Js(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.hoveredNode&&(a.emit("leaveNode",ze(ze({},u),{},{node:a.hoveredNode})),a.scheduleHighlightedNodesRender()),a.settings.enableEdgeEvents&&a.hoveredEdge&&(a.emit("leaveEdge",ze(ze({},u),{},{edge:a.hoveredEdge})),a.scheduleHighlightedNodesRender()),a.emit("leaveStage",ze({},u))},this.activeListeners.handleEnter=function(s){var c=Js(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.emit("enterStage",ze({},u))};var o=function(c){return function(u){var f=Js(u),h={event:f,preventSigmaDefault:function(){f.preventSigmaDefault()}},m=a.getNodeAtPosition(f);if(m)return a.emit("".concat(c,"Node"),ze(ze({},h),{},{node:m}));if(a.settings.enableEdgeEvents){var g=a.getEdgeAtPoint(f.x,f.y);if(g)return a.emit("".concat(c,"Edge"),ze(ze({},h),{},{edge:g}))}return a.emit("".concat(c,"Stage"),h)}};return this.activeListeners.handleClick=o("click"),this.activeListeners.handleRightClick=o("rightClick"),this.activeListeners.handleDoubleClick=o("doubleClick"),this.activeListeners.handleWheel=o("wheel"),this.activeListeners.handleDown=o("down"),this.activeListeners.handleUp=o("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 a=this,o=this.graph,s=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(c){var u,f=(u=c.hints)===null||u===void 0?void 0:u.attributes;a.graph.forEachNode(function(m){return a.updateNode(m)});var h=!f||f.some(function(m){return s.has(m)});a.refresh({partialGraph:{nodes:o.nodes()},skipIndexation:!h,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(c){var u,f=(u=c.hints)===null||u===void 0?void 0:u.attributes;a.graph.forEachEdge(function(m){return a.updateEdge(m)});var h=f&&["zIndex","type"].some(function(m){return f==null?void 0:f.includes(m)});a.refresh({partialGraph:{edges:o.edges()},skipIndexation:!h,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(c){var u=c.key;a.addNode(u),a.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(c){var u=c.key;a.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(c){var u=c.key;a.removeNode(u),a.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(c){var u=c.key;a.addEdge(u),a.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(c){var u=c.key;a.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(c){var u=c.key;a.removeEdge(u),a.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){a.clearEdgeState(),a.clearEdgeIndices(),a.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){a.clearEdgeState(),a.clearNodeState(),a.clearEdgeIndices(),a.clearNodeIndices(),a.refresh({schedule:!0})},o.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),o.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),o.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),o.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),o.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),o.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),o.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),o.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),o.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),o.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var a=this.graph;a.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(a,o){var s=ew(this.webGLContexts.edges,this.frameBuffers.edges,a,o,this.pixelRatio,this.pickingDownSizingRatio),c=J0.apply(void 0,vw(s)),u=this.itemIDsIndex[c];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var a=this;this.emit("beforeProcess");var o=this.graph,s=this.settings,c=this.getDimensions();if(this.nodeExtent=$G(this.graph),!this.settings.autoRescale){var u=c.width,f=c.height,h=this.nodeExtent,m=h.x,g=h.y;this.nodeExtent={x:[(m[0]+m[1])/2-u/2,(m[0]+m[1])/2+u/2],y:[(g[0]+g[1])/2-f/2,(g[0]+g[1])/2+f/2]}}this.normalizationFunction=pw(this.customBBox||this.nodeExtent);var y=new gw,b=Qs(y.getState(),c,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(c,s.labelGridCellSize);for(var S={},E={},_={},N={},C=1,A=o.nodes(),k=0,D=A.length;k<D;k++){var M=A[k],R=this.nodeDataCache[M],U=o.getNodeAttributes(M);R.x=U.x,R.y=U.y,this.normalizationFunction.applyTo(R),typeof R.label=="string"&&!R.hidden&&this.labelGrid.add(M,R.size,this.framedGraphToViewport(R,{matrix:b})),S[R.type]=(S[R.type]||0)+1}this.labelGrid.organize();for(var L in this.nodePrograms){if(!na.call(this.nodePrograms,L))throw new Error('Sigma: could not find a suitable program for node type "'.concat(L,'"!'));this.nodePrograms[L].reallocate(S[L]||0),S[L]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(A=hw(this.nodeZExtent,function(re){return a.nodeDataCache[re].zIndex},A));for(var I=0,q=A.length;I<q;I++){var Y=A[I];E[Y]=C,N[E[Y]]={type:"node",id:Y},C++;var B=this.nodeDataCache[Y];this.addNodeToProgram(Y,E[Y],S[B.type]++)}for(var X={},ne=o.edges(),F=0,z=ne.length;F<z;F++){var j=ne[F],K=this.edgeDataCache[j];X[K.type]=(X[K.type]||0)+1}this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(ne=hw(this.edgeZExtent,function(re){return a.edgeDataCache[re].zIndex},ne));for(var G in this.edgePrograms){if(!na.call(this.edgePrograms,G))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(G,'"!'));this.edgePrograms[G].reallocate(X[G]||0),X[G]=0}for(var H=0,O=ne.length;H<O;H++){var $=ne[H];_[$]=C,N[_[$]]={type:"edge",id:$},C++;var W=this.edgeDataCache[$];this.addEdgeToProgram($,_[$],X[W.type]++)}return this.itemIDsIndex=N,this.nodeIndices=E,this.edgeIndices=_,this.emit("afterProcess"),this}},{key:"handleSettingsUpdate",value:function(a){var o=this,s=this.settings;if(this.camera.minRatio=s.minCameraRatio,this.camera.maxRatio=s.maxCameraRatio,this.camera.enabledZooming=s.enableCameraZooming,this.camera.enabledPanning=s.enableCameraPanning,this.camera.enabledRotation=s.enableCameraRotation,s.cameraPanBoundaries?this.camera.clean=function(m){return o.cleanCameraState(m,s.cameraPanBoundaries&&Cm(s.cameraPanBoundaries)==="object"?s.cameraPanBoundaries:{})}:this.camera.clean=null,this.camera.setState(this.camera.validateState(this.camera.getState())),a){if(a.edgeProgramClasses!==s.edgeProgramClasses){for(var c in s.edgeProgramClasses)s.edgeProgramClasses[c]!==a.edgeProgramClasses[c]&&this.registerEdgeProgram(c,s.edgeProgramClasses[c]);for(var u in a.edgeProgramClasses)s.edgeProgramClasses[u]||this.unregisterEdgeProgram(u)}if(a.nodeProgramClasses!==s.nodeProgramClasses||a.nodeHoverProgramClasses!==s.nodeHoverProgramClasses){for(var f in s.nodeProgramClasses)(s.nodeProgramClasses[f]!==a.nodeProgramClasses[f]||s.nodeHoverProgramClasses[f]!==a.nodeHoverProgramClasses[f])&&this.registerNodeProgram(f,s.nodeProgramClasses[f],s.nodeHoverProgramClasses[f]);for(var h in a.nodeProgramClasses)s.nodeProgramClasses[h]||this.unregisterNodeProgram(h)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:"cleanCameraState",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.tolerance,c=s===void 0?0:s,u=o.boundaries,f=ze({},a),h=u||this.nodeExtent,m=Mo(h.x,2),g=m[0],y=m[1],b=Mo(h.y,2),S=b[0],E=b[1],_=[this.graphToViewport({x:g,y:S},{cameraState:a}),this.graphToViewport({x:y,y:S},{cameraState:a}),this.graphToViewport({x:g,y:E},{cameraState:a}),this.graphToViewport({x:y,y:E},{cameraState:a})],N=1/0,C=-1/0,A=1/0,k=-1/0;_.forEach(function(X){var ne=X.x,F=X.y;N=Math.min(N,ne),C=Math.max(C,ne),A=Math.min(A,F),k=Math.max(k,F)});var D=C-N,M=k-A,R=this.getDimensions(),U=R.width,L=R.height,I=0,q=0;if(D>=U?C<U-c?I=C-(U-c):N>c&&(I=N-c):C>U+c?I=C-(U+c):N<-c&&(I=N+c),M>=L?k<L-c?q=k-(L-c):A>c&&(q=A-c):k>L+c?q=k-(L+c):A<-c&&(q=A+c),I||q){var Y=this.viewportToFramedGraph({x:0,y:0},{cameraState:a}),B=this.viewportToFramedGraph({x:I,y:q},{cameraState:a});I=B.x-Y.x,q=B.y-Y.y,f.x+=I,f.y+=q}return f}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var a=this.camera.getState(),o=this.labelGrid.getLabelsToDisplay(a.ratio,this.settings.labelDensity);mw(o,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var s=this.canvasContexts.labels,c=0,u=o.length;c<u;c++){var f=o[c],h=this.nodeDataCache[f];if(!this.displayedNodeLabels.has(f)&&!h.hidden){var m=this.framedGraphToViewport(h),g=m.x,y=m.y,b=this.scaleSize(h.size);if(!(!h.forceLabel&&b<this.settings.labelRenderedSizeThreshold)&&!(g<-150||g>this.width+c3||y<-50||y>this.height+u3)){this.displayedNodeLabels.add(f);var S=this.settings.defaultDrawNodeLabel,E=this.nodePrograms[h.type],_=(E==null?void 0:E.drawLabel)||S;_(s,ze(ze({key:f},h),{},{size:b,x:g,y}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var a=this.canvasContexts.edgeLabels;a.clearRect(0,0,this.width,this.height);var o=l3({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});mw(o,this.edgesWithForcedLabels);for(var s=new Set,c=0,u=o.length;c<u;c++){var f=o[c],h=this.graph.extremities(f),m=this.nodeDataCache[h[0]],g=this.nodeDataCache[h[1]],y=this.edgeDataCache[f];if(!s.has(f)&&!(y.hidden||m.hidden||g.hidden)){var b=this.settings.defaultDrawEdgeLabel,S=this.edgePrograms[y.type],E=(S==null?void 0:S.drawLabel)||b;E(a,ze(ze({key:f},y),{},{size:this.scaleSize(y.size)}),ze(ze(ze({key:h[0]},m),this.framedGraphToViewport(m)),{},{size:this.scaleSize(m.size)}),ze(ze(ze({key:h[1]},g),this.framedGraphToViewport(g)),{},{size:this.scaleSize(g.size)}),this.settings),s.add(f)}}return this.displayedEdgeLabels=s,this}},{key:"renderHighlightedNodes",value:function(){var a=this,o=this.canvasContexts.hovers;o.clearRect(0,0,this.width,this.height);var s=function(b){var S=a.nodeDataCache[b],E=a.framedGraphToViewport(S),_=E.x,N=E.y,C=a.scaleSize(S.size),A=a.settings.defaultDrawNodeHover,k=a.nodePrograms[S.type],D=(k==null?void 0:k.drawHover)||A;D(o,ze(ze({key:b},S),{},{size:C,x:_,y:N}),a.settings)},c=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&c.push(this.hoveredNode),this.highlightedNodes.forEach(function(y){y!==a.hoveredNode&&c.push(y)}),c.forEach(function(y){return s(y)});var u={};c.forEach(function(y){var b=a.nodeDataCache[y].type;u[b]=(u[b]||0)+1});for(var f in this.nodeHoverPrograms)this.nodeHoverPrograms[f].reallocate(u[f]||0),u[f]=0;c.forEach(function(y){var b=a.nodeDataCache[y];a.nodeHoverPrograms[b.type].process(0,u[b.type]++,b)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var h=this.getRenderParams();for(var m in this.nodeHoverPrograms){var g=this.nodeHoverPrograms[m];g.render(h)}}},{key:"scheduleHighlightedNodesRender",value:function(){var a=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=requestAnimationFrame(function(){a.renderHighlightedNodesFrame=null,a.renderHighlightedNodes(),a.renderEdgeLabels()}))}},{key:"render",value:function(){var a=this;this.emit("beforeRender");var o=function(){return a.emit("afterRender"),a};if(this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.resize(),this.needToProcess&&this.process(),this.needToProcess=!1,this.clear(),this.pickingLayers.forEach(function(_){return a.resetWebGLTexture(_)}),!this.graph.order)return o();var s=this.mouseCaptor,c=this.camera.isAnimated()||s.isMoving||s.draggedEvents||s.currentWheelDirection,u=this.camera.getState(),f=this.getDimensions(),h=this.getGraphDimensions(),m=this.getStagePadding();this.matrix=Qs(u,f,h,m),this.invMatrix=Qs(u,f,h,m,!0),this.correctionRatio=HG(this.matrix,u,f),this.graphToViewportRatio=this.getGraphToViewportRatio();var g=this.getRenderParams();for(var y in this.nodePrograms){var b=this.nodePrograms[y];b.render(g)}if(!this.settings.hideEdgesOnMove||!c)for(var S in this.edgePrograms){var E=this.edgePrograms[S];E.render(g)}return this.settings.hideLabelsOnMove&&c||(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes()),o()}},{key:"addNode",value:function(a){var o=Object.assign({},this.graph.getNodeAttributes(a));this.settings.nodeReducer&&(o=this.settings.nodeReducer(a,o));var s=d3(this.settings,a,o);this.nodeDataCache[a]=s,this.nodesWithForcedLabels.delete(a),s.forceLabel&&!s.hidden&&this.nodesWithForcedLabels.add(a),this.highlightedNodes.delete(a),s.highlighted&&!s.hidden&&this.highlightedNodes.add(a),this.settings.zIndex&&(s.zIndex<this.nodeZExtent[0]&&(this.nodeZExtent[0]=s.zIndex),s.zIndex>this.nodeZExtent[1]&&(this.nodeZExtent[1]=s.zIndex))}},{key:"updateNode",value:function(a){this.addNode(a);var o=this.nodeDataCache[a];this.normalizationFunction.applyTo(o)}},{key:"removeNode",value:function(a){delete this.nodeDataCache[a],delete this.nodeProgramIndex[a],this.highlightedNodes.delete(a),this.hoveredNode===a&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(a)}},{key:"addEdge",value:function(a){var o=Object.assign({},this.graph.getEdgeAttributes(a));this.settings.edgeReducer&&(o=this.settings.edgeReducer(a,o));var s=f3(this.settings,a,o);this.edgeDataCache[a]=s,this.edgesWithForcedLabels.delete(a),s.forceLabel&&!s.hidden&&this.edgesWithForcedLabels.add(a),this.settings.zIndex&&(s.zIndex<this.edgeZExtent[0]&&(this.edgeZExtent[0]=s.zIndex),s.zIndex>this.edgeZExtent[1]&&(this.edgeZExtent[1]=s.zIndex))}},{key:"updateEdge",value:function(a){this.addEdge(a)}},{key:"removeEdge",value:function(a){delete this.edgeDataCache[a],delete this.edgeProgramIndex[a],this.hoveredEdge===a&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(a)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new bw,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0]}},{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(a,o,s){var c=this.nodeDataCache[a],u=this.nodePrograms[c.type];if(!u)throw new Error('Sigma: could not find a suitable program for node type "'.concat(c.type,'"!'));u.process(o,s,c),this.nodeProgramIndex[a]=s}},{key:"addEdgeToProgram",value:function(a,o,s){var c=this.edgeDataCache[a],u=this.edgePrograms[c.type];if(!u)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(c.type,'"!'));var f=this.graph.extremities(a),h=this.nodeDataCache[f[0]],m=this.nodeDataCache[f[1]];u.process(o,s,h,m,c),this.edgeProgramIndex[a]=s}},{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 a=this.settings,o=a.stagePadding,s=a.autoRescale;return s&&o||0}},{key:"createLayer",value:function(a,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[a])throw new Error('Sigma: a layer named "'.concat(a,'" already exists'));var c=qG(o,{position:"absolute"},{class:"sigma-".concat(a)});return s.style&&Object.assign(c.style,s.style),this.elements[a]=c,"beforeLayer"in s&&s.beforeLayer?this.elements[s.beforeLayer].before(c):"afterLayer"in s&&s.afterLayer?this.elements[s.afterLayer].after(c):this.container.appendChild(c),c}},{key:"createCanvas",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(a,"canvas",o)}},{key:"createCanvasContext",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this.createCanvas(a,o),c={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[a]=s.getContext("2d",c),this}},{key:"createWebGLContext",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=(o==null?void 0:o.canvas)||this.createCanvas(a,o);o.hidden&&s.remove();var c=ze({preserveDrawingBuffer:!1,antialias:!1},o),u;u=s.getContext("webgl2",c),u||(u=s.getContext("webgl",c)),u||(u=s.getContext("experimental-webgl",c));var f=u;if(this.webGLContexts[a]=f,f.blendFunc(f.ONE,f.ONE_MINUS_SRC_ALPHA),o.picking){this.pickingLayers.add(a);var h=f.createFramebuffer();if(!h)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(a));this.frameBuffers[a]=h}return f}},{key:"killLayer",value:function(a){var o=this.elements[a];if(!o)throw new Error("Sigma: cannot kill layer ".concat(a,", which does not exist"));if(this.webGLContexts[a]){var s,c=this.webGLContexts[a];(s=c.getExtension("WEBGL_lose_context"))===null||s===void 0||s.loseContext(),delete this.webGLContexts[a]}else this.canvasContexts[a]&&delete this.canvasContexts[a];return o.remove(),delete this.elements[a],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(a){this.unbindCameraHandlers(),this.camera=a,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(a){a!==this.graph&&(this.hoveredNode&&!a.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!a.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=a,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 a=this.customBBox||this.nodeExtent;return{width:a.x[1]-a.x[0]||1,height:a.y[1]-a.y[0]||1}}},{key:"getNodeDisplayData",value:function(a){var o=this.nodeDataCache[a];return o?Object.assign({},o):void 0}},{key:"getEdgeDisplayData",value:function(a){var o=this.edgeDataCache[a];return o?Object.assign({},o):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 ze({},this.settings)}},{key:"getSetting",value:function(a){return this.settings[a]}},{key:"setSetting",value:function(a,o){var s=ze({},this.settings);return this.settings[a]=o,fp(this.settings),this.handleSettingsUpdate(s),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(a,o){return this.setSetting(a,o(this.settings[a])),this}},{key:"setSettings",value:function(a){var o=ze({},this.settings);return this.settings=ze(ze({},this.settings),a),fp(this.settings),this.handleSettingsUpdate(o),this.scheduleRefresh(),this}},{key:"resize",value:function(a){var o=this.width,s=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=fw(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw new 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 new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(!a&&o===this.width&&s===this.height)return this;for(var c in this.elements){var u=this.elements[c];u.style.width=this.width+"px",u.style.height=this.height+"px"}for(var f in this.canvasContexts)this.elements[f].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[f].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[f].scale(this.pixelRatio,this.pixelRatio);for(var h in this.webGLContexts){this.elements[h].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[h].setAttribute("height",this.height*this.pixelRatio+"px");var m=this.webGLContexts[h];if(m.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(h)){var g=this.textures[h];g&&m.deleteTexture(g)}}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(a){var o=this,s=(a==null?void 0:a.skipIndexation)!==void 0?a==null?void 0:a.skipIndexation:!1,c=(a==null?void 0:a.schedule)!==void 0?a.schedule:!1,u=!a||!a.partialGraph;if(u)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(k){return o.addNode(k)}),this.graph.forEachEdge(function(k){return o.addEdge(k)});else{for(var f,h,m=((f=a.partialGraph)===null||f===void 0?void 0:f.nodes)||[],g=0,y=(m==null?void 0:m.length)||0;g<y;g++){var b=m[g];if(this.updateNode(b),s){var S=this.nodeProgramIndex[b];if(S===void 0)throw new Error('Sigma: node "'.concat(b,`" can't be repaint`));this.addNodeToProgram(b,this.nodeIndices[b],S)}}for(var E=(a==null||(h=a.partialGraph)===null||h===void 0?void 0:h.edges)||[],_=0,N=E.length;_<N;_++){var C=E[_];if(this.updateEdge(C),s){var A=this.edgeProgramIndex[C];if(A===void 0)throw new Error('Sigma: edge "'.concat(C,`" can't be repaint`));this.addEdgeToProgram(C,this.edgeIndices[C],A)}}}return(u||!s)&&(this.needToProcess=!0),c?this.scheduleRender():this.render(),this}},{key:"scheduleRender",value:function(){var a=this;return this.renderFrame||(this.renderFrame=requestAnimationFrame(function(){a.render()})),this}},{key:"scheduleRefresh",value:function(a){return this.refresh(ze(ze({},a),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(a,o){var s=this.camera.getState(),c=s.ratio,u=s.angle,f=s.x,h=s.y,m=this.settings,g=m.minCameraRatio,y=m.maxCameraRatio;typeof y=="number"&&(o=Math.min(o,y)),typeof g=="number"&&(o=Math.max(o,g));var b=o/c,S={x:this.width/2,y:this.height/2},E=this.viewportToFramedGraph(a),_=this.viewportToFramedGraph(S);return{angle:u,x:(E.x-_.x)*(1-b)+f,y:(E.y-_.y)*(1-b)+h,ratio:o}}},{key:"viewRectangle",value:function(){var a=this.viewportToFramedGraph({x:0,y:0}),o=this.viewportToFramedGraph({x:this.width,y:0}),s=this.viewportToFramedGraph({x:0,y:this.height});return{x1:a.x,y1:a.y,x2:o.x,y2:o.y,height:o.y-s.y}}},{key:"framedGraphToViewport",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=!!o.cameraState||!!o.viewportDimensions||!!o.graphDimensions,c=o.matrix?o.matrix:s?Qs(o.cameraState||this.camera.getState(),o.viewportDimensions||this.getDimensions(),o.graphDimensions||this.getGraphDimensions(),o.padding||this.getStagePadding()):this.matrix,u=_m(c,a);return{x:(1+u.x)*this.width/2,y:(1-u.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=!!o.cameraState||!!o.viewportDimensions||!o.graphDimensions,c=o.matrix?o.matrix:s?Qs(o.cameraState||this.camera.getState(),o.viewportDimensions||this.getDimensions(),o.graphDimensions||this.getGraphDimensions(),o.padding||this.getStagePadding(),!0):this.invMatrix,u=_m(c,{x:a.x/this.width*2-1,y:1-a.y/this.height*2});return isNaN(u.x)&&(u.x=0),isNaN(u.y)&&(u.y=0),u}},{key:"viewportToGraph",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(a,o))}},{key:"graphToViewport",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(a),o)}},{key:"getGraphToViewportRatio",value:function(){var a={x:0,y:0},o={x:1,y:1},s=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),c=this.graphToViewport(a),u=this.graphToViewport(o),f=Math.sqrt(Math.pow(c.x-u.x,2)+Math.pow(c.y-u.y,2));return f/s}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(a){return this.customBBox=a,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),this.renderFrame=null),this.renderHighlightedNodesFrame&&(cancelAnimationFrame(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);for(var a=this.container;a.firstChild;)a.removeChild(a.firstChild);this.canvasContexts={},this.webGLContexts={},this.elements={};for(var o in this.nodePrograms)this.nodePrograms[o].kill();for(var s in this.nodeHoverPrograms)this.nodeHoverPrograms[s].kill();for(var c in this.edgePrograms)this.edgePrograms[c].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var u in this.elements)this.killLayer(u)}},{key:"scaleSize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return a/this.settings.zoomToSizeRatioFunction(o)*(this.getSetting("itemSizesReference")==="positions"?o*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var a={};for(var o in this.elements)this.elements[o]instanceof HTMLCanvasElement&&(a[o]=this.elements[o]);return a}}])}($g);const MC=w.createContext(null),p3=MC.Provider;function qg(){const e=w.useContext(MC);if(e==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of <SigmaContainer>");return e}function Zn(){return qg().sigma}function PC(){const{sigma:e}=qg();return w.useCallback(t=>{e&&Object.keys(t).forEach(n=>{e.setSetting(n,t[n])})},[e])}function bd(e){return new Set(Object.keys(e))}const xw=bd({clickNode:!0,rightClickNode:!0,downNode:!0,enterNode:!0,leaveNode:!0,doubleClickNode:!0,wheelNode:!0,clickEdge:!0,rightClickEdge:!0,downEdge:!0,enterEdge:!0,leaveEdge:!0,doubleClickEdge:!0,wheelEdge:!0,clickStage:!0,rightClickStage:!0,downStage:!0,doubleClickStage:!0,wheelStage:!0,beforeRender:!0,afterRender:!0,kill:!0,upStage:!0,upEdge:!0,upNode:!0,enterStage:!0,leaveStage:!0,resize:!0,afterClear:!0,afterProcess:!0,beforeClear:!0,beforeProcess:!0,moveBody:!0}),ww=bd({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),Ew=bd({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),Sw=bd({updated:!0});function GC(){const e=Zn(),t=PC(),[n,a]=w.useState({});return w.useEffect(()=>{if(!e||!n)return;const o=n,s=Object.keys(o);return s.forEach(c=>{const u=o[c];xw.has(c)&&e.on(c,u),ww.has(c)&&e.getMouseCaptor().on(c,u),Ew.has(c)&&e.getTouchCaptor().on(c,u),Sw.has(c)&&e.getCamera().on(c,u)}),()=>{e&&s.forEach(c=>{const u=o[c];xw.has(c)&&e.off(c,u),ww.has(c)&&e.getMouseCaptor().off(c,u),Ew.has(c)&&e.getTouchCaptor().off(c,u),Sw.has(c)&&e.getCamera().off(c,u)})}},[e,n,t]),a}function m3(){const e=Zn();return w.useCallback((t,n=!0)=>{e&&t&&(n&&e.getGraph().order>0&&e.getGraph().clear(),e.getGraph().import(t),e.refresh())},[e])}function Al(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!=Object.keys(t).length)return!1;for(const n in e)if(!Object.hasOwn(t,n)||!Al(e[n],t[n]))return!1;return!0}return!1}function FC(e){const t=Zn(),[n,a]=w.useState(e||{});w.useEffect(()=>{a(h=>Al(h,e||{})?h:e||{})},[e]);const o=w.useCallback(h=>{t.getCamera().animatedZoom(Object.assign(Object.assign({},n),h))},[t,n]),s=w.useCallback(h=>{t.getCamera().animatedUnzoom(Object.assign(Object.assign({},n),h))},[t,n]),c=w.useCallback(h=>{t.getCamera().animatedReset(Object.assign(Object.assign({},n),h))},[t,n]),u=w.useCallback((h,m)=>{t.getCamera().animate(h,Object.assign(Object.assign({},n),m))},[t,n]),f=w.useCallback((h,m)=>{const g=t.getNodeDisplayData(h);g?t.getCamera().animate(g,Object.assign(Object.assign({},n),m)):console.warn(`Node ${h} not found`)},[t,n]);return{zoomIn:o,zoomOut:s,reset:c,goto:u,gotoNode:f}}function g3(e){const t=qg(),[n,a]=w.useState(!1),[o,s]=w.useState(t.container),c=w.useCallback(()=>a(u=>!u),[]);return w.useEffect(()=>(document.addEventListener("fullscreenchange",c),()=>document.removeEventListener("fullscreenchange",c)),[c]),w.useEffect(()=>{s(t.container)},[e,t.container]),{toggle:w.useCallback(()=>{var u;u=o,document.fullscreenElement!==u?u.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},[o]),isFullScreen:n}}const v3=w.forwardRef(({graph:e,id:t,className:n,style:a,settings:o={},children:s},c)=>{const u=w.useRef(null),f=w.useRef(null),h={className:`react-sigma ${n||""}`,id:t,style:a},[m,g]=w.useState(null),[y,b]=w.useState(o);w.useEffect(()=>{b(_=>Al(_,o)?_:o)},[o]),w.useEffect(()=>{g(_=>{let N=null;if(f.current!==null){let C=new ft;e&&(C=typeof e=="function"?new e:e);let A=null;_&&(A=_.getCamera().getState(),_.kill()),N=new h3(C,f.current,y),A&&N.getCamera().setState(A)}return N})},[f,e,y]),w.useImperativeHandle(c,()=>m,[m]);const S=w.useMemo(()=>m&&u.current?{sigma:m,container:u.current}:null,[m,u]),E=S!==null?ve.createElement(p3,{value:S},s):null;return ve.createElement("div",Object.assign({},h,{ref:u}),ve.createElement("div",{className:"sigma-container",ref:f}),E)});var y3=`
precision mediump float;
varying vec4 v_color;
varying float v_border;
const float radius = 0.5;
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
void main(void) {
vec2 m = gl_PointCoord - vec2(0.5, 0.5);
float dist = radius - length(m);
// No antialiasing for picking mode:
#ifdef PICKING_MODE
if (dist > v_border)
gl_FragColor = v_color;
else
gl_FragColor = transparent;
#else
float t = 0.0;
if (dist > v_border)
t = 1.0;
else if (dist > 0.0)
t = dist / v_border;
gl_FragColor = mix(transparent, v_color, t);
#endif
}
`,b3=y3,x3=`
attribute vec4 a_id;
attribute vec4 a_color;
attribute vec2 a_position;
attribute float a_size;
uniform float u_sizeRatio;
uniform float u_pixelRatio;
uniform mat3 u_matrix;
varying vec4 v_color;
varying float v_border;
const float bias = 255.0 / 254.0;
void main() {
gl_Position = vec4(
(u_matrix * vec3(a_position, 1)).xy,
0,
1
);
// Multiply the point size twice:
// - x SCALING_RATIO to correct the canvas scaling
// - x 2 to correct the formulae
gl_PointSize = a_size / u_sizeRatio * u_pixelRatio * 2.0;
v_border = (0.5 / a_size) * u_sizeRatio;
#ifdef PICKING_MODE
// For picking mode, we use the ID as the color:
v_color = a_id;
#else
// For normal mode, we use the color:
v_color = a_color;
#endif
v_color.a *= bias;
}
`,w3=x3,UC=WebGLRenderingContext,_w=UC.UNSIGNED_BYTE,Cw=UC.FLOAT,E3=["u_sizeRatio","u_pixelRatio","u_matrix"],S3=function(e){function t(){return $t(this,t),Sn(this,t,arguments)}return _n(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:1,VERTEX_SHADER_SOURCE:w3,FRAGMENT_SHADER_SOURCE:b3,METHOD:WebGLRenderingContext.POINTS,UNIFORMS:E3,ATTRIBUTES:[{name:"a_position",size:2,type:Cw},{name:"a_size",size:1,type:Cw},{name:"a_color",size:4,type:_w,normalized:!0},{name:"a_id",size:4,type:_w,normalized:!0}]}}},{key:"processVisibleItem",value:function(a,o,s){var c=this.array;c[o++]=s.x,c[o++]=s.y,c[o++]=s.size,c[o++]=Ar(s.color),c[o++]=a}},{key:"setUniforms",value:function(a,o){var s=a.sizeRatio,c=a.pixelRatio,u=a.matrix,f=o.gl,h=o.uniformLocations,m=h.u_sizeRatio,g=h.u_pixelRatio,y=h.u_matrix;f.uniform1f(g,c),f.uniform1f(m,s),f.uniformMatrix3fv(y,!1,u)}}])}(Ig),_3=`
attribute vec4 a_id;
attribute vec4 a_color;
attribute vec2 a_normal;
attribute float a_normalCoef;
attribute vec2 a_positionStart;
attribute vec2 a_positionEnd;
attribute float a_positionCoef;
attribute float a_sourceRadius;
attribute float a_targetRadius;
attribute float a_sourceRadiusCoef;
attribute float a_targetRadiusCoef;
uniform mat3 u_matrix;
uniform float u_zoomRatio;
uniform float u_sizeRatio;
uniform float u_pixelRatio;
uniform float u_correctionRatio;
uniform float u_minEdgeThickness;
uniform float u_lengthToThicknessRatio;
uniform float u_feather;
varying vec4 v_color;
varying vec2 v_normal;
varying float v_thickness;
varying float v_feather;
const float bias = 255.0 / 254.0;
void main() {
float minThickness = u_minEdgeThickness;
vec2 normal = a_normal * a_normalCoef;
vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
float normalLength = length(normal);
vec2 unitNormal = normal / normalLength;
// These first computations are taken from edge.vert.glsl. Please read it to
// get better comments on what's happening:
float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
// Here, we move the point to leave space for the arrow heads:
// Source arrow head
float sourceRadius = a_sourceRadius * a_sourceRadiusCoef;
float sourceDirection = sign(sourceRadius);
float webGLSourceRadius = sourceDirection * sourceRadius * 2.0 * u_correctionRatio / u_sizeRatio;
float webGLSourceArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
vec2 sourceCompensationVector =
vec2(-sourceDirection * unitNormal.y, sourceDirection * unitNormal.x)
* (webGLSourceRadius + webGLSourceArrowHeadLength);
// Target arrow head
float targetRadius = a_targetRadius * a_targetRadiusCoef;
float targetDirection = sign(targetRadius);
float webGLTargetRadius = targetDirection * targetRadius * 2.0 * u_correctionRatio / u_sizeRatio;
float webGLTargetArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
vec2 targetCompensationVector =
vec2(-targetDirection * unitNormal.y, targetDirection * unitNormal.x)
* (webGLTargetRadius + webGLTargetArrowHeadLength);
// Here is the proper position of the vertex
gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + sourceCompensationVector + targetCompensationVector, 1)).xy, 0, 1);
v_thickness = webGLThickness / u_zoomRatio;
v_normal = unitNormal;
v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
#ifdef PICKING_MODE
// For picking mode, we use the ID as the color:
v_color = a_id;
#else
// For normal mode, we use the color:
v_color = a_color;
#endif
v_color.a *= bias;
}
`,C3=_3,BC=WebGLRenderingContext,Tw=BC.UNSIGNED_BYTE,Kr=BC.FLOAT,T3=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],R3={lengthToThicknessRatio:Rl.lengthToThicknessRatio};function IC(e){var t=ze(ze({},R3),{});return function(n){function a(){return $t(this,a),Sn(this,a,arguments)}return _n(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:C3,FRAGMENT_SHADER_SOURCE:Hg,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:T3,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Kr},{name:"a_positionEnd",size:2,type:Kr},{name:"a_normal",size:2,type:Kr},{name:"a_color",size:4,type:Tw,normalized:!0},{name:"a_id",size:4,type:Tw,normalized:!0},{name:"a_sourceRadius",size:1,type:Kr},{name:"a_targetRadius",size:1,type:Kr}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Kr},{name:"a_normalCoef",size:1,type:Kr},{name:"a_sourceRadiusCoef",size:1,type:Kr},{name:"a_targetRadiusCoef",size:1,type:Kr}],CONSTANT_DATA:[[0,1,-1,0],[0,-1,1,0],[1,1,0,1],[1,1,0,1],[0,-1,1,0],[1,-1,0,-1]]}}},{key:"processVisibleItem",value:function(s,c,u,f,h){var m=h.size||1,g=u.x,y=u.y,b=f.x,S=f.y,E=Ar(h.color),_=b-g,N=S-y,C=u.size||1,A=f.size||1,k=_*_+N*N,D=0,M=0;k&&(k=1/Math.sqrt(k),D=-N*k*m,M=_*k*m);var R=this.array;R[c++]=g,R[c++]=y,R[c++]=b,R[c++]=S,R[c++]=D,R[c++]=M,R[c++]=E,R[c++]=s,R[c++]=C,R[c++]=A}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_zoomRatio,g=f.u_feather,y=f.u_pixelRatio,b=f.u_correctionRatio,S=f.u_sizeRatio,E=f.u_minEdgeThickness,_=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.zoomRatio),u.uniform1f(S,s.sizeRatio),u.uniform1f(b,s.correctionRatio),u.uniform1f(y,s.pixelRatio),u.uniform1f(g,s.antiAliasingFeather),u.uniform1f(E,s.minEdgeThickness),u.uniform1f(_,t.lengthToThicknessRatio)}}])}(Cl)}IC();function A3(e){return _C([IC(),ju(e),ju(ze(ze({},e),{},{extremity:"source"}))])}A3();function D3(e){if(Array.isArray(e))return e}function k3(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,o,s,c,u=[],f=!0,h=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(f=(a=s.call(n)).done)&&(u.push(a.value),u.length!==t);f=!0);}catch(m){h=!0,o=m}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(h)throw o}}return u}}function Tm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function HC(e,t){if(e){if(typeof e=="string")return Tm(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)?Tm(e,t):void 0}}function N3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O3(e,t){return D3(e)||k3(e,t)||HC(e,t)||N3()}function j3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L3(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $C(e){var t=L3(e,"string");return typeof t=="symbol"?t:t+""}function z3(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,$C(a.key),a)}}function M3(e,t,n){return t&&z3(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lu(e){return Lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lu(e)}function VC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VC=function(){return!!e})()}function Rm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P3(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rm(e)}function G3(e,t,n){return t=Lu(t),P3(e,VC()?Reflect.construct(t,n||[],Lu(e).constructor):t.apply(e,n))}function Am(e,t){return Am=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Am(e,t)}function F3(e,t){if(typeof t!="function"&&t!==null)throw new 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&&Am(e,t)}function _o(e,t,n){return(t=$C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U3(e){if(Array.isArray(e))return Tm(e)}function B3(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function I3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pp(e){return U3(e)||B3(e)||HC(e)||I3()}function Rw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function Aw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rw(Object(n),!0).forEach(function(a){_o(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rw(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}var H3="relative",$3={drawLabel:void 0,drawHover:void 0,borders:[{size:{value:.1},color:{attribute:"borderColor"}},{size:{fill:!0},color:{attribute:"color"}}]},V3="#000000";function q3(e){var t=e.borders,n=rw(t.filter(function(o){var s=o.size;return"fill"in s}).length),a=`
precision highp float;
varying vec2 v_diffVector;
varying float v_radius;
#ifdef PICKING_MODE
varying vec4 v_color;
#else
// For normal mode, we use the border colors defined in the program:
`.concat(t.flatMap(function(o,s){var c=o.size;return"attribute"in c?["varying float v_borderSize_".concat(s+1,";")]:[]}).join(`
`),`
`).concat(t.flatMap(function(o,s){var c=o.color;return"attribute"in c?["varying vec4 v_borderColor_".concat(s+1,";")]:"value"in c?["uniform vec4 u_borderColor_".concat(s+1,";")]:[]}).join(`
`),`
#endif
uniform float u_correctionRatio;
const float bias = 255.0 / 254.0;
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
void main(void) {
float dist = length(v_diffVector);
float aaBorder = 2.0 * u_correctionRatio;
float v_borderSize_0 = v_radius;
vec4 v_borderColor_0 = transparent;
// No antialiasing for picking mode:
#ifdef PICKING_MODE
if (dist > v_radius)
gl_FragColor = transparent;
else {
gl_FragColor = v_color;
gl_FragColor.a *= bias;
}
#else
// Sizes:
`).concat(t.flatMap(function(o,s){var c=o.size;if("fill"in c)return[];c=c;var u="attribute"in c?"v_borderSize_".concat(s+1):rw(c.value),f=(c.mode||H3)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(s+1," = ").concat(f," * ").concat(u,";")]}).join(`
`),`
// Now, let's split the remaining space between "fill" borders:
float fillBorderSize = (v_radius - (`).concat(t.flatMap(function(o,s){var c=o.size;return"fill"in c?[]:["borderSize_".concat(s+1)]}).join(" + "),") ) / ").concat(n,`;
`).concat(t.flatMap(function(o,s){var c=o.size;return"fill"in c?[" float borderSize_".concat(s+1," = fillBorderSize;")]:[]}).join(`
`),`
// Finally, normalize all border sizes, to start from the full size and to end with the smallest:
float adjustedBorderSize_0 = v_radius;
`).concat(t.map(function(o,s){return" float adjustedBorderSize_".concat(s+1," = adjustedBorderSize_").concat(s," - borderSize_").concat(s+1,";")}).join(`
`),`
// Colors:
vec4 borderColor_0 = transparent;
`).concat(t.map(function(o,s){var c=o.color,u=[];return"attribute"in c?u.push(" vec4 borderColor_".concat(s+1," = v_borderColor_").concat(s+1,";")):"transparent"in c?u.push(" vec4 borderColor_".concat(s+1," = vec4(0.0, 0.0, 0.0, 0.0);")):u.push(" vec4 borderColor_".concat(s+1," = u_borderColor_").concat(s+1,";")),u.push(" borderColor_".concat(s+1,".a *= bias;")),u.push(" if (borderSize_".concat(s+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(s+1," = borderColor_").concat(s,"; }")),u.join(`
`)}).join(`
`),`
if (dist > adjustedBorderSize_0) {
gl_FragColor = borderColor_0;
} else `).concat(t.map(function(o,s){return"if (dist > adjustedBorderSize_".concat(s,` - aaBorder) {
gl_FragColor = mix(borderColor_`).concat(s+1,", borderColor_").concat(s,", (dist - adjustedBorderSize_").concat(s,` + aaBorder) / aaBorder);
} else if (dist > adjustedBorderSize_`).concat(s+1,`) {
gl_FragColor = borderColor_`).concat(s+1,`;
} else `)}).join(""),` { /* Nothing to add here */ }
#endif
}
`);return a}function Y3(e){var t=e.borders,n=`
attribute vec2 a_position;
attribute float a_size;
attribute float a_angle;
uniform mat3 u_matrix;
uniform float u_sizeRatio;
uniform float u_correctionRatio;
varying vec2 v_diffVector;
varying float v_radius;
#ifdef PICKING_MODE
attribute vec4 a_id;
varying vec4 v_color;
#else
`.concat(t.flatMap(function(a,o){var s=a.size;return"attribute"in s?["attribute float a_borderSize_".concat(o+1,";"),"varying float v_borderSize_".concat(o+1,";")]:[]}).join(`
`),`
`).concat(t.flatMap(function(a,o){var s=a.color;return"attribute"in s?["attribute vec4 a_borderColor_".concat(o+1,";"),"varying vec4 v_borderColor_".concat(o+1,";")]:[]}).join(`
`),`
#endif
const float bias = 255.0 / 254.0;
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
void main() {
float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;
vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));
vec2 position = a_position + diffVector;
gl_Position = vec4(
(u_matrix * vec3(position, 1)).xy,
0,
1
);
v_radius = size / 2.0;
v_diffVector = diffVector;
#ifdef PICKING_MODE
v_color = a_id;
#else
`).concat(t.flatMap(function(a,o){var s=a.size;return"attribute"in s?[" v_borderSize_".concat(o+1," = a_borderSize_").concat(o+1,";")]:[]}).join(`
`),`
`).concat(t.flatMap(function(a,o){var s=a.color;return"attribute"in s?[" v_borderColor_".concat(o+1," = a_borderColor_").concat(o+1,";")]:[]}).join(`
`),`
#endif
}
`);return n}var qC=WebGLRenderingContext,Dw=qC.UNSIGNED_BYTE,tu=qC.FLOAT;function W3(e){var t,n=Aw(Aw({},$3),{}),a=n.borders,o=n.drawLabel,s=n.drawHover,c=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(pp(a.flatMap(function(u,f){var h=u.color;return"value"in h?["u_borderColor_".concat(f+1)]:[]})));return t=function(u){F3(f,u);function f(){var h;j3(this,f);for(var m=arguments.length,g=new Array(m),y=0;y<m;y++)g[y]=arguments[y];return h=G3(this,f,[].concat(g)),_o(Rm(h),"drawLabel",o),_o(Rm(h),"drawHover",s),h}return M3(f,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:Y3(n),FRAGMENT_SHADER_SOURCE:q3(n),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:c,ATTRIBUTES:[{name:"a_position",size:2,type:tu},{name:"a_id",size:4,type:Dw,normalized:!0},{name:"a_size",size:1,type:tu}].concat(pp(a.flatMap(function(m,g){var y=m.color;return"attribute"in y?[{name:"a_borderColor_".concat(g+1),size:4,type:Dw,normalized:!0}]:[]})),pp(a.flatMap(function(m,g){var y=m.size;return"attribute"in y?[{name:"a_borderSize_".concat(g+1),size:1,type:tu}]:[]}))),CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:tu}],CONSTANT_DATA:[[f.ANGLE_1],[f.ANGLE_2],[f.ANGLE_3]]}}},{key:"processVisibleItem",value:function(m,g,y){var b=this.array;b[g++]=y.x,b[g++]=y.y,b[g++]=m,b[g++]=y.size,a.forEach(function(S){var E=S.color;"attribute"in E&&(b[g++]=Ar(y[E.attribute]||E.defaultValue||V3))}),a.forEach(function(S){var E=S.size;"attribute"in E&&(b[g++]=y[E.attribute]||E.defaultValue)})}},{key:"setUniforms",value:function(m,g){var y=g.gl,b=g.uniformLocations,S=b.u_sizeRatio,E=b.u_correctionRatio,_=b.u_matrix;y.uniform1f(E,m.correctionRatio),y.uniform1f(S,m.sizeRatio),y.uniformMatrix3fv(_,!1,m.matrix),a.forEach(function(N,C){var A=N.color;if("value"in A){var k=b["u_borderColor_".concat(C+1)],D=nG(A.value),M=O3(D,4),R=M[0],U=M[1],L=M[2],I=M[3];y.uniform4f(k,R/255,U/255,L/255,I/255)}})}}]),f}(Ig),_o(t,"ANGLE_1",0),_o(t,"ANGLE_2",2*Math.PI/3),_o(t,"ANGLE_3",4*Math.PI/3),t}var X3=W3();function K3(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YC(e){var t=K3(e,"string");return typeof t=="symbol"?t:t+""}function WC(e,t,n){return(t=YC(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function zu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kw(Object(n),!0).forEach(function(a){WC(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kw(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function Z3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q3(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,YC(a.key),a)}}function J3(e,t,n){return t&&Q3(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mu(e){return Mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mu(e)}function XC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XC=function(){return!!e})()}function KC(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e5(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KC(e)}function t5(e,t,n){return t=Mu(t),e5(e,XC()?Reflect.construct(t,n||[],Mu(e).constructor):t.apply(e,n))}function Dm(e,t){return Dm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Dm(e,t)}function n5(e,t){if(typeof t!="function"&&t!==null)throw new 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&&Dm(e,t)}function km(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function r5(e){if(Array.isArray(e))return km(e)}function a5(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i5(e,t){if(e){if(typeof e=="string")return km(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)?km(e,t):void 0}}function o5(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mp(e){return r5(e)||a5(e)||i5(e)||o5()}function ZC(e,t,n,a){var o=Math.pow(1-e,2)*t.x+2*(1-e)*e*n.x+Math.pow(e,2)*a.x,s=Math.pow(1-e,2)*t.y+2*(1-e)*e*n.y+Math.pow(e,2)*a.y;return{x:o,y:s}}function s5(e,t,n){for(var a=20,o=0,s=e,c=0;c<a;c++){var u=ZC((c+1)/a,e,t,n);o+=Math.sqrt(Math.pow(s.x-u.x,2)+Math.pow(s.y-u.y,2)),s=u}return o}function l5(e){var t=e.curvatureAttribute,n=e.defaultCurvature,a=e.keepLabelUpright,o=a===void 0?!0:a;return function(s,c,u,f,h){var m=h.edgeLabelSize,g=c[t]||n,y=h.edgeLabelFont,b=h.edgeLabelWeight,S=h.edgeLabelColor.attribute?c[h.edgeLabelColor.attribute]||h.edgeLabelColor.color||"#000":h.edgeLabelColor.color,E=c.label;if(E){s.fillStyle=S,s.font="".concat(b," ").concat(m,"px ").concat(y);var _=!o||u.x<f.x,N=_?u.x:f.x,C=_?u.y:f.y,A=_?f.x:u.x,k=_?f.y:u.y,D=(N+A)/2,M=(C+k)/2,R=A-N,U=k-C,L=Math.sqrt(Math.pow(R,2)+Math.pow(U,2)),I=_?1:-1,q=D+U*g*I,Y=M-R*g*I,B=c.size*.7+5,X={x:Y-C,y:-(q-N)},ne=Math.sqrt(Math.pow(X.x,2)+Math.pow(X.y,2)),F={x:k-Y,y:-(A-q)},z=Math.sqrt(Math.pow(F.x,2)+Math.pow(F.y,2));N+=B*X.x/ne,C+=B*X.y/ne,A+=B*F.x/z,k+=B*F.y/z,q+=B*U/L,Y-=B*R/L;var j={x:q,y:Y},K={x:N,y:C},G={x:A,y:k},H=s5(K,j,G);if(!(H<u.size+f.size)){var O=s.measureText(E).width,$=H-u.size-f.size;if(O>$){var W="…";for(E=E+W,O=s.measureText(E).width;O>$&&E.length>1;)E=E.slice(0,-2)+W,O=s.measureText(E).width;if(E.length<4)return}for(var re={},de=0,ie=E.length;de<ie;de++){var oe=E[de];re[oe]||(re[oe]=s.measureText(oe).width*(1+g*.35))}for(var Ce=.5-O/H/2,he=0,Se=E.length;he<Se;he++){var be=E[he],Le=ZC(Ce,K,j,G),Te=2*(1-Ce)*(q-N)+2*Ce*(A-q),ye=2*(1-Ce)*(Y-C)+2*Ce*(k-Y),J=Math.atan2(ye,Te);s.save(),s.translate(Le.x,Le.y),s.rotate(J),s.fillText(be,0,0),s.restore(),Ce+=re[be]/H}}}}}function c5(e){var t=e.arrowHead,n=(t==null?void 0:t.extremity)==="target"||(t==null?void 0:t.extremity)==="both",a=(t==null?void 0:t.extremity)==="source"||(t==null?void 0:t.extremity)==="both",o=`
precision highp float;
varying vec4 v_color;
varying float v_thickness;
varying float v_feather;
varying vec2 v_cpA;
varying vec2 v_cpB;
varying vec2 v_cpC;
`.concat(n?`
varying float v_targetSize;
varying vec2 v_targetPoint;`:"",`
`).concat(a?`
varying float v_sourceSize;
varying vec2 v_sourcePoint;`:"",`
`).concat(t?`
uniform float u_lengthToThicknessRatio;
uniform float u_widenessToThicknessRatio;`:"",`
float det(vec2 a, vec2 b) {
return a.x * b.y - b.x * a.y;
}
vec2 getDistanceVector(vec2 b0, vec2 b1, vec2 b2) {
float a = det(b0, b2), b = 2.0 * det(b1, b0), d = 2.0 * det(b2, b1);
float f = b * d - a * a;
vec2 d21 = b2 - b1, d10 = b1 - b0, d20 = b2 - b0;
vec2 gf = 2.0 * (b * d21 + d * d10 + a * d20);
gf = vec2(gf.y, -gf.x);
vec2 pp = -f * gf / dot(gf, gf);
vec2 d0p = b0 - pp;
float ap = det(d0p, d20), bp = 2.0 * det(d10, d0p);
float t = clamp((ap + bp) / (2.0 * a + b + d), 0.0, 1.0);
return mix(mix(b0, b1, t), mix(b1, b2, t), t);
}
float distToQuadraticBezierCurve(vec2 p, vec2 b0, vec2 b1, vec2 b2) {
return length(getDistanceVector(b0 - p, b1 - p, b2 - p));
}
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
void main(void) {
float dist = distToQuadraticBezierCurve(gl_FragCoord.xy, v_cpA, v_cpB, v_cpC);
float thickness = v_thickness;
`).concat(n?`
float distToTarget = length(gl_FragCoord.xy - v_targetPoint);
float targetArrowLength = v_targetSize + thickness * u_lengthToThicknessRatio;
if (distToTarget < targetArrowLength) {
thickness = (distToTarget - v_targetSize) / (targetArrowLength - v_targetSize) * u_widenessToThicknessRatio * thickness;
}`:"",`
`).concat(a?`
float distToSource = length(gl_FragCoord.xy - v_sourcePoint);
float sourceArrowLength = v_sourceSize + thickness * u_lengthToThicknessRatio;
if (distToSource < sourceArrowLength) {
thickness = (distToSource - v_sourceSize) / (sourceArrowLength - v_sourceSize) * u_widenessToThicknessRatio * thickness;
}`:"",`
float halfThickness = thickness / 2.0;
if (dist < halfThickness) {
#ifdef PICKING_MODE
gl_FragColor = v_color;
#else
float t = smoothstep(
halfThickness - v_feather,
halfThickness,
dist
);
gl_FragColor = mix(v_color, transparent, t);
#endif
} else {
gl_FragColor = transparent;
}
}
`);return o}function u5(e){var t=e.arrowHead,n=(t==null?void 0:t.extremity)==="target"||(t==null?void 0:t.extremity)==="both",a=(t==null?void 0:t.extremity)==="source"||(t==null?void 0:t.extremity)==="both",o=`
attribute vec4 a_id;
attribute vec4 a_color;
attribute float a_direction;
attribute float a_thickness;
attribute vec2 a_source;
attribute vec2 a_target;
attribute float a_current;
attribute float a_curvature;
`.concat(n?`attribute float a_targetSize;
`:"",`
`).concat(a?`attribute float a_sourceSize;
`:"",`
uniform mat3 u_matrix;
uniform float u_sizeRatio;
uniform float u_pixelRatio;
uniform vec2 u_dimensions;
uniform float u_minEdgeThickness;
uniform float u_feather;
varying vec4 v_color;
varying float v_thickness;
varying float v_feather;
varying vec2 v_cpA;
varying vec2 v_cpB;
varying vec2 v_cpC;
`).concat(n?`
varying float v_targetSize;
varying vec2 v_targetPoint;`:"",`
`).concat(a?`
varying float v_sourceSize;
varying vec2 v_sourcePoint;`:"",`
`).concat(t?`
uniform float u_widenessToThicknessRatio;`:"",`
const float bias = 255.0 / 254.0;
const float epsilon = 0.7;
vec2 clipspaceToViewport(vec2 pos, vec2 dimensions) {
return vec2(
(pos.x + 1.0) * dimensions.x / 2.0,
(pos.y + 1.0) * dimensions.y / 2.0
);
}
vec2 viewportToClipspace(vec2 pos, vec2 dimensions) {
return vec2(
pos.x / dimensions.x * 2.0 - 1.0,
pos.y / dimensions.y * 2.0 - 1.0
);
}
void main() {
float minThickness = u_minEdgeThickness;
// Selecting the correct position
// Branchless "position = a_source if a_current == 1.0 else a_target"
vec2 position = a_source * max(0.0, a_current) + a_target * max(0.0, 1.0 - a_current);
position = (u_matrix * vec3(position, 1)).xy;
vec2 source = (u_matrix * vec3(a_source, 1)).xy;
vec2 target = (u_matrix * vec3(a_target, 1)).xy;
vec2 viewportPosition = clipspaceToViewport(position, u_dimensions);
vec2 viewportSource = clipspaceToViewport(source, u_dimensions);
vec2 viewportTarget = clipspaceToViewport(target, u_dimensions);
vec2 delta = viewportTarget.xy - viewportSource.xy;
float len = length(delta);
vec2 normal = vec2(-delta.y, delta.x) * a_direction;
vec2 unitNormal = normal / len;
float boundingBoxThickness = len * a_curvature;
float curveThickness = max(minThickness, a_thickness / u_sizeRatio);
v_thickness = curveThickness * u_pixelRatio;
v_feather = u_feather;
v_cpA = viewportSource;
v_cpB = 0.5 * (viewportSource + viewportTarget) + unitNormal * a_direction * boundingBoxThickness;
v_cpC = viewportTarget;
vec2 viewportOffsetPosition = (
viewportPosition +
unitNormal * (boundingBoxThickness / 2.0 + sign(boundingBoxThickness) * (`).concat(t?"curveThickness * u_widenessToThicknessRatio":"curveThickness",` + epsilon)) *
max(0.0, a_direction) // NOTE: cutting the bounding box in half to avoid overdraw
);
position = viewportToClipspace(viewportOffsetPosition, u_dimensions);
gl_Position = vec4(position, 0, 1);
`).concat(n?`
v_targetSize = a_targetSize * u_pixelRatio / u_sizeRatio;
v_targetPoint = viewportTarget;
`:"",`
`).concat(a?`
v_sourceSize = a_sourceSize * u_pixelRatio / u_sizeRatio;
v_sourcePoint = viewportSource;
`:"",`
#ifdef PICKING_MODE
// For picking mode, we use the ID as the color:
v_color = a_id;
#else
// For normal mode, we use the color:
v_color = a_color;
#endif
v_color.a *= bias;
}
`);return o}var QC=.25,d5={arrowHead:null,curvatureAttribute:"curvature",defaultCurvature:QC},JC=WebGLRenderingContext,Nw=JC.UNSIGNED_BYTE,La=JC.FLOAT;function Yg(e){var t=zu(zu({},d5),e||{}),n=t,a=n.arrowHead,o=n.curvatureAttribute,s=n.drawLabel,c=(a==null?void 0:a.extremity)==="target"||(a==null?void 0:a.extremity)==="both",u=(a==null?void 0:a.extremity)==="source"||(a==null?void 0:a.extremity)==="both",f=["u_matrix","u_sizeRatio","u_dimensions","u_pixelRatio","u_feather","u_minEdgeThickness"].concat(mp(a?["u_lengthToThicknessRatio","u_widenessToThicknessRatio"]:[]));return function(h){n5(m,h);function m(){var g;Z3(this,m);for(var y=arguments.length,b=new Array(y),S=0;S<y;S++)b[S]=arguments[S];return g=t5(this,m,[].concat(b)),WC(KC(g),"drawLabel",s||l5(t)),g}return J3(m,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:u5(t),FRAGMENT_SHADER_SOURCE:c5(t),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:f,ATTRIBUTES:[{name:"a_source",size:2,type:La},{name:"a_target",size:2,type:La}].concat(mp(c?[{name:"a_targetSize",size:1,type:La}]:[]),mp(u?[{name:"a_sourceSize",size:1,type:La}]:[]),[{name:"a_thickness",size:1,type:La},{name:"a_curvature",size:1,type:La},{name:"a_color",size:4,type:Nw,normalized:!0},{name:"a_id",size:4,type:Nw,normalized:!0}]),CONSTANT_ATTRIBUTES:[{name:"a_current",size:1,type:La},{name:"a_direction",size:1,type:La}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[0,-1],[1,1],[1,-1]]}}},{key:"processVisibleItem",value:function(y,b,S,E,_){var N,C=_.size||1,A=S.x,k=S.y,D=E.x,M=E.y,R=Ar(_.color),U=(N=_[o])!==null&&N!==void 0?N:QC,L=this.array;L[b++]=A,L[b++]=k,L[b++]=D,L[b++]=M,c&&(L[b++]=E.size),u&&(L[b++]=S.size),L[b++]=C,L[b++]=U,L[b++]=R,L[b++]=y}},{key:"setUniforms",value:function(y,b){var S=b.gl,E=b.uniformLocations,_=E.u_matrix,N=E.u_pixelRatio,C=E.u_feather,A=E.u_sizeRatio,k=E.u_dimensions,D=E.u_minEdgeThickness;if(S.uniformMatrix3fv(_,!1,y.matrix),S.uniform1f(N,y.pixelRatio),S.uniform1f(A,y.sizeRatio),S.uniform1f(C,y.antiAliasingFeather),S.uniform2f(k,y.width*y.pixelRatio,y.height*y.pixelRatio),S.uniform1f(D,y.minEdgeThickness),a){var M=E.u_lengthToThicknessRatio,R=E.u_widenessToThicknessRatio;S.uniform1f(M,a.lengthToThicknessRatio),S.uniform1f(R,a.widenessToThicknessRatio)}}}]),m}(Cl)}var f5=Yg(),h5=Yg({arrowHead:Rl});Yg({arrowHead:zu(zu({},Rl),{},{extremity:"both"})});class p5{constructor(){Xr(this,"nodes",[]);Xr(this,"edges",[]);Xr(this,"nodeIdMap",{});Xr(this,"edgeIdMap",{});Xr(this,"edgeDynamicIdMap",{});Xr(this,"getNode",t=>{const n=this.nodeIdMap[t];if(n!==void 0)return this.nodes[n]});Xr(this,"getEdge",(t,n=!0)=>{const a=n?this.edgeDynamicIdMap[t]:this.edgeIdMap[t];if(a!==void 0)return this.edges[a]});Xr(this,"buildDynamicMap",()=>{this.edgeDynamicIdMap={};for(let t=0;t<this.edges.length;t++){const n=this.edges[t];this.edgeDynamicIdMap[n.dynamicId]=t}})}}const m5=Qm()(e=>({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,moveToSelectedNode:!1,rawGraph:null,sigmaGraph:null,setSelectedNode:(t,n)=>e({selectedNode:t,moveToSelectedNode:n}),setFocusedNode:t=>e({focusedNode:t}),setSelectedEdge:t=>e({selectedEdge:t}),setFocusedEdge:t=>e({focusedEdge:t}),clearSelection:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null}),reset:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,rawGraph:null,sigmaGraph:null,moveToSelectedNode:!1}),setRawGraph:t=>e({rawGraph:t}),setSigmaGraph:t=>e({sigmaGraph:t}),setMoveToSelectedNode:t=>e({moveToSelectedNode:t})})),ct=tg(m5),g5=({node:e,move:t})=>{const n=Zn(),{gotoNode:a}=FC();return w.useEffect(()=>{if(e)return n.getGraph().setNodeAttribute(e,"highlighted",!0),t&&(a(e),ct.getState().setMoveToSelectedNode(!1)),()=>{n.getGraph().setNodeAttribute(e,"highlighted",!1)}},[e,t,n,a]),null};function Xo(e,t){const n=Zn(),a=w.useRef(t);return Al(a.current,t)||(a.current=t),{positions:w.useCallback(()=>a.current?e(n.getGraph(),a.current):{},[n,a,e]),assign:w.useCallback(()=>{a.current&&e.assign(n.getGraph(),a.current)},[n,a,e])}}function Wg(e,t){const n=Zn(),[a,o]=w.useState(!1),[s,c]=w.useState(null),u=w.useRef(t);return Al(u.current,t)||(u.current=t),w.useEffect(()=>{o(!1);let f=null;return u.current&&(f=new e(n.getGraph(),u.current)),c(f),()=>{f!==null&&f.kill()}},[n,u,c,o,e]),{stop:w.useCallback(()=>{s&&(s.stop(),o(!1))},[s,o]),start:w.useCallback(()=>{s&&(s.start(),o(!0))},[s,o]),kill:w.useCallback(()=>{s&&s.kill(),o(!1)},[s,o]),isRunning:a}}var gp,Ow;function Dl(){if(Ow)return gp;Ow=1;function e(n){return!n||typeof n!="object"||typeof n=="function"||Array.isArray(n)||n instanceof Set||n instanceof Map||n instanceof RegExp||n instanceof Date}function t(n,a){n=n||{};var o={};for(var s in a){var c=n[s],u=a[s];if(!e(u)){o[s]=t(c,u);continue}c===void 0?o[s]=u:o[s]=c}return o}return gp=t,gp}var vp,jw;function v5(){if(jw)return vp;jw=1;function e(n){return function(a,o){return a+Math.floor(n()*(o-a+1))}}var t=e(Math.random);return t.createRandom=e,vp=t,vp}var yp,Lw;function y5(){if(Lw)return yp;Lw=1;var e=v5().createRandom;function t(a){var o=e(a);return function(s){for(var c=s.length,u=c-1,f=-1;++f<c;){var h=o(f,u),m=s[h];s[h]=s[f],s[f]=m}}}var n=t(Math.random);return n.createShuffleInPlace=t,yp=n,yp}var bp,zw;function b5(){if(zw)return bp;zw=1;var e=Dl(),t=Dr(),n=y5(),a={attributes:{x:"x",y:"y"},center:0,hierarchyAttributes:[],rng:Math.random,scale:1};function o(R,U,L,I,q){this.wrappedCircle=q||null,this.children={},this.countChildren=0,this.id=R||null,this.next=null,this.previous=null,this.x=U||null,this.y=L||null,q?this.r=1010101:this.r=I||999}o.prototype.hasChildren=function(){return this.countChildren>0},o.prototype.addChild=function(R,U){this.children[R]=U,++this.countChildren},o.prototype.getChild=function(R){if(!this.children.hasOwnProperty(R)){var U=new o;this.children[R]=U,++this.countChildren}return this.children[R]},o.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var R=this;for(var U in R.children){var L=R.children[U];L.x+=R.x,L.y+=R.y,L.applyPositionToChildren()}}};function s(R,U,L){for(var I in U.children){var q=U.children[I];q.hasChildren()?s(R,q,L):L[q.id]={x:q.x,y:q.y}}}function c(R,U){var L=R.r-U.r,I=U.x-R.x,q=U.y-R.y;return L<0||L*L<I*I+q*q}function u(R,U){var L=R.r-U.r+1e-6,I=U.x-R.x,q=U.y-R.y;return L>0&&L*L>I*I+q*q}function f(R,U){for(var L=0;L<U.length;++L)if(!u(R,U[L]))return!1;return!0}function h(R){return new o(null,R.x,R.y,R.r)}function m(R,U){var L=R.x,I=R.y,q=R.r,Y=U.x,B=U.y,X=U.r,ne=Y-L,F=B-I,z=X-q,j=Math.sqrt(ne*ne+F*F);return new o(null,(L+Y+ne/j*z)/2,(I+B+F/j*z)/2,(j+q+X)/2)}function g(R,U,L){var I=R.x,q=R.y,Y=R.r,B=U.x,X=U.y,ne=U.r,F=L.x,z=L.y,j=L.r,K=I-B,G=I-F,H=q-X,O=q-z,$=ne-Y,W=j-Y,re=I*I+q*q-Y*Y,de=re-B*B-X*X+ne*ne,ie=re-F*F-z*z+j*j,oe=G*H-K*O,Ce=(H*ie-O*de)/(oe*2)-I,he=(O*$-H*W)/oe,Se=(G*de-K*ie)/(oe*2)-q,be=(K*W-G*$)/oe,Le=he*he+be*be-1,Te=2*(Y+Ce*he+Se*be),ye=Ce*Ce+Se*Se-Y*Y,J=-(Le?(Te+Math.sqrt(Te*Te-4*Le*ye))/(2*Le):ye/Te);return new o(null,I+Ce+he*J,q+Se+be*J,J)}function y(R){switch(R.length){case 1:return h(R[0]);case 2:return m(R[0],R[1]);case 3:return g(R[0],R[1],R[2]);default:throw new Error("graphology-layout/circlepack: Invalid basis length "+R.length)}}function b(R,U){var L,I;if(f(U,R))return[U];for(L=0;L<R.length;++L)if(c(U,R[L])&&f(m(R[L],U),R))return[R[L],U];for(L=0;L<R.length-1;++L)for(I=L+1;I<R.length;++I)if(c(m(R[L],R[I]),U)&&c(m(R[L],U),R[I])&&c(m(R[I],U),R[L])&&f(g(R[L],R[I],U),R))return[R[L],R[I],U];throw new Error("graphology-layout/circlepack: extendBasis failure !")}function S(R){var U=R.wrappedCircle,L=R.next.wrappedCircle,I=U.r+L.r,q=(U.x*L.r+L.x*U.r)/I,Y=(U.y*L.r+L.y*U.r)/I;return q*q+Y*Y}function E(R,U){var L=0,I=R.slice(),q=R.length,Y=[],B,X;for(U(I);L<q;)B=I[L],X&&u(X,B)?++L:(Y=b(Y,B),X=y(Y),L=0);return X}function _(R,U,L){var I=R.x-U.x,q,Y,B=R.y-U.y,X,ne,F=I*I+B*B;F?(Y=U.r+L.r,Y*=Y,ne=R.r+L.r,ne*=ne,Y>ne?(q=(F+ne-Y)/(2*F),X=Math.sqrt(Math.max(0,ne/F-q*q)),L.x=R.x-q*I-X*B,L.y=R.y-q*B+X*I):(q=(F+Y-ne)/(2*F),X=Math.sqrt(Math.max(0,Y/F-q*q)),L.x=U.x+q*I-X*B,L.y=U.y+q*B+X*I)):(L.x=U.x+L.r,L.y=U.y)}function N(R,U){var L=R.r+U.r-1e-6,I=U.x-R.x,q=U.y-R.y;return L>0&&L*L>I*I+q*q}function C(R,U){var L=R.length;if(L===0)return 0;var I,q,Y,B,X,ne,F,z,j,K;if(I=R[0],I.x=0,I.y=0,L<=1)return I.r;if(q=R[1],I.x=-q.r,q.x=I.r,q.y=0,L<=2)return I.r+q.r;Y=R[2],_(q,I,Y),I=new o(null,null,null,null,I),q=new o(null,null,null,null,q),Y=new o(null,null,null,null,Y),I.next=Y.previous=q,q.next=I.previous=Y,Y.next=q.previous=I;e:for(ne=3;ne<L;++ne){Y=R[ne],_(I.wrappedCircle,q.wrappedCircle,Y),Y=new o(null,null,null,null,Y),F=q.next,z=I.previous,j=q.wrappedCircle.r,K=I.wrappedCircle.r;do if(j<=K){if(N(F.wrappedCircle,Y.wrappedCircle)){q=F,I.next=q,q.previous=I,--ne;continue e}j+=F.wrappedCircle.r,F=F.next}else{if(N(z.wrappedCircle,Y.wrappedCircle)){I=z,I.next=q,q.previous=I,--ne;continue e}K+=z.wrappedCircle.r,z=z.previous}while(F!==z.next);for(Y.previous=I,Y.next=q,I.next=q.previous=q=Y,B=S(I);(Y=Y.next)!==q;)(X=S(Y))<B&&(I=Y,B=X);q=I.next}I=[q.wrappedCircle],Y=q;for(var G=1e4;(Y=Y.next)!==q&&--G!==0;)I.push(Y.wrappedCircle);for(Y=E(I,U),ne=0;ne<L;++ne)I=R[ne],I.x-=Y.x,I.y-=Y.y;return Y.r}function A(R,U){var L=0;if(R.hasChildren()){for(var I in R.children){var q=R.children[I];q.hasChildren()&&(q.r=A(q,U))}L=C(Object.values(R.children),U)}return L}function k(R,U){A(R,U);for(var L in R.children){var I=R.children[L];I.applyPositionToChildren()}}function D(R,U,L){if(!t(U))throw new Error("graphology-layout/circlepack: the given graph is not a valid graphology instance.");L=e(L,a);var I={},q={},Y=U.nodes(),B=L.center,X=L.hierarchyAttributes,ne=n.createShuffleInPlace(L.rng),F=L.scale,z=new o;U.forEachNode(function($,W){var re=W.size?W.size:1,de=new o($,null,null,re),ie=z;X.forEach(function(oe){var Ce=W[oe];ie=ie.getChild(Ce)}),ie.addChild($,de)}),k(z,ne),s(U,z,I);var j=Y.length,K,G,H;for(H=0;H<j;H++){var O=Y[H];K=B+F*I[O].x,G=B+F*I[O].y,q[O]={x:K,y:G},R&&(U.setNodeAttribute(O,L.attributes.x,K),U.setNodeAttribute(O,L.attributes.y,G))}return q}var M=D.bind(null,!1);return M.assign=D.bind(null,!0),bp=M,bp}var x5=b5();const w5=dn(x5);function E5(e={}){return Xo(w5,e)}var xp,Mw;function S5(){if(Mw)return xp;Mw=1;var e=Dl(),t=Dr(),n={dimensions:["x","y"],center:.5,scale:1};function a(s,c,u){if(!t(c))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");u=e(u,n);var f=u.dimensions;if(!Array.isArray(f)||f.length!==2)throw new Error("graphology-layout/random: given dimensions are invalid.");var h=u.center,m=u.scale,g=Math.PI*2,y=(h-.5)*m,b=c.order,S=f[0],E=f[1];function _(A,k){return k[S]=m*Math.cos(A*g/b)+y,k[E]=m*Math.sin(A*g/b)+y,k}var N=0;if(!s){var C={};return c.forEachNode(function(A){C[A]=_(N++,{})}),C}c.updateEachNodeAttributes(function(A,k){return _(N++,k),k},{attributes:f})}var o=a.bind(null,!1);return o.assign=a.bind(null,!0),xp=o,xp}var _5=S5();const C5=dn(_5);function T5(e={}){return Xo(C5,e)}var tl={},Pw;function Xg(){if(Pw)return tl;Pw=1;function e(a){return typeof a!="number"||isNaN(a)?1:a}function t(a,o){var s={},c=function(h){return typeof h>"u"?o:h};typeof o=="function"&&(c=o);var u=function(h){return c(h[a])},f=function(){return c(void 0)};return typeof a=="string"?(s.fromAttributes=u,s.fromGraph=function(h,m){return u(h.getNodeAttributes(m))},s.fromEntry=function(h,m){return u(m)}):typeof a=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(h,m){return c(a(m,h.getNodeAttributes(m)))},s.fromEntry=function(h,m){return c(a(h,m))}):(s.fromAttributes=f,s.fromGraph=f,s.fromEntry=f),s}function n(a,o){var s={},c=function(h){return typeof h>"u"?o:h};typeof o=="function"&&(c=o);var u=function(h){return c(h[a])},f=function(){return c(void 0)};return typeof a=="string"?(s.fromAttributes=u,s.fromGraph=function(h,m){return u(h.getEdgeAttributes(m))},s.fromEntry=function(h,m){return u(m)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof a=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(h,m){var g=h.extremities(m);return c(a(m,h.getEdgeAttributes(m),g[0],g[1],h.getNodeAttributes(g[0]),h.getNodeAttributes(g[1]),h.isUndirected(m)))},s.fromEntry=function(h,m,g,y,b,S,E){return c(a(h,m,g,y,b,S,E))},s.fromPartialEntry=function(h,m,g,y){return c(a(h,m,g,y))},s.fromMinimalEntry=function(h,m){return c(a(h,m))}):(s.fromAttributes=f,s.fromGraph=f,s.fromEntry=f,s.fromMinimalEntry=f),s}return tl.createNodeValueGetter=t,tl.createEdgeValueGetter=n,tl.createEdgeWeightGetter=function(a){return n(a,e)},tl}var wp,Gw;function eT(){if(Gw)return wp;Gw=1;const{createNodeValueGetter:e,createEdgeValueGetter:t}=Xg();return wp=function(a,o,s){const{nodeXAttribute:c,nodeYAttribute:u}=s,{attraction:f,repulsion:h,gravity:m,inertia:g,maxMove:y}=s.settings;let{shouldSkipNode:b,shouldSkipEdge:S,isNodeFixed:E}=s;E=e(E),b=e(b,!1),S=t(S,!1);const _=a.filterNodes((A,k)=>!b.fromEntry(A,k)),N=_.length;for(let A=0;A<N;A++){const k=_[A],D=a.getNodeAttributes(k),M=o[k];M?o[k]={dx:M.dx*g,dy:M.dy*g,x:D[c]||0,y:D[u]||0}:o[k]={dx:0,dy:0,x:D[c]||0,y:D[u]||0}}if(h)for(let A=0;A<N;A++){const k=_[A],D=o[k];for(let M=A+1;M<N;M++){const R=_[M],U=o[R],L=U.x-D.x,I=U.y-D.y,q=Math.sqrt(L*L+I*I)||1,Y=h/q*L,B=h/q*I;D.dx-=Y,D.dy-=B,U.dx+=Y,U.dy+=B}}if(f&&a.forEachEdge((A,k,D,M,R,U,L)=>{if(D===M||b.fromEntry(D,R)||b.fromEntry(M,U)||S.fromEntry(A,k,D,M,R,U,L))return;const I=o[D],q=o[M],Y=q.x-I.x,B=q.y-I.y,X=Math.sqrt(Y*Y+B*B)||1,ne=f*X*Y,F=f*X*B;I.dx+=ne,I.dy+=F,q.dx-=ne,q.dy-=F}),m)for(let A=0;A<N;A++){const k=_[A],D=o[k],{x:M,y:R}=D,U=Math.sqrt(M*M+R*R)||1;o[k].dx-=M*m*U,o[k].dy-=R*m*U}const C=!1;for(let A=0;A<N;A++){const k=_[A],D=o[k],M=Math.sqrt(D.dx*D.dx+D.dy*D.dy);M>y&&(D.dx*=y/M,D.dy*=y/M),E.fromGraph(a,k)?D.fixed=!0:(D.x+=D.dx,D.y+=D.dy,D.fixed=!1)}return{converged:C}},wp}var nu={},Fw;function tT(){return Fw||(Fw=1,nu.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:a,nodeYAttribute:o}=n;e.updateEachNodeAttributes((s,c)=>{const u=t[s];return!u||u.fixed||(c[a]=u.x,c[o]=u.y),c},{attributes:["x","y"]})},nu.collectLayoutChanges=function(e){const t={};for(const n in e){const a=e[n];t[n]={x:a.x,y:a.y}}return t}),nu}var Ep,Uw;function nT(){return Uw||(Uw=1,Ep={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),Ep}var Sp,Bw;function R5(){if(Bw)return Sp;Bw=1;const e=Dr(),t=Dl(),n=eT(),a=tT(),o=nT();function s(u,f,h){if(!e(f))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof h=="number"?h={maxIterations:h}:h=h||{};const m=h.maxIterations;if(h=t(h,o),typeof m!="number"||m<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const g={};let y=null,b;for(b=0;b<m&&(y=n(f,g,h),!y.converged);b++);if(u){a.assignLayoutChanges(f,g,h);return}return a.collectLayoutChanges(g)}const c=s.bind(null,!1);return c.assign=s.bind(null,!0),Sp=c,Sp}var A5=R5();const D5=dn(A5);var _p,Iw;function k5(){if(Iw)return _p;Iw=1;const e=Dr(),t=Dl(),n=eT(),a=tT(),o=nT();function s(c,u){if(!e(c))throw new Error("graphology-layout-force/worker: the given graph is not a valid graphology instance.");u=t(u,o),this.callbacks={},u.onConverged&&(this.callbacks.onConverged=u.onConverged),this.graph=c,this.params=u,this.nodeStates={},this.frameID=null,this.running=!1,this.killed=!1}return s.prototype.isRunning=function(){return this.running},s.prototype.runFrame=function(){let{converged:c}=n(this.graph,this.nodeStates,this.params);a.assignLayoutChanges(this.graph,this.nodeStates,this.params),c=!1,c?(this.callbacks.onConverged&&this.callbacks.onConverged(),this.stop()):this.frameID=window.requestAnimationFrame(()=>this.runFrame())},s.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},s.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},s.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},_p=s,_p}var N5=k5();const O5=dn(N5);function j5(e={maxIterations:100}){return Xo(D5,e)}function L5(e={}){return Wg(O5,e)}var Cp,Hw;function z5(){if(Hw)return Cp;Hw=1;var e=0,t=1,n=2,a=3,o=4,s=5,c=6,u=7,f=8,h=9,m=0,g=1,y=2,b=0,S=1,E=2,_=3,N=4,C=5,A=6,k=7,D=8,M=3,R=10,U=3,L=9,I=10;return Cp=function(Y,B,X){var ne,F,z,j,K,G,H,O,$,W,re=B.length,de=X.length,ie=Y.adjustSizes,oe=Y.barnesHutTheta*Y.barnesHutTheta,Ce,he,Se,be,Le,Te,ye,J=[];for(z=0;z<re;z+=R)B[z+o]=B[z+n],B[z+s]=B[z+a],B[z+n]=0,B[z+a]=0;if(Y.outboundAttractionDistribution){for(Ce=0,z=0;z<re;z+=R)Ce+=B[z+c];Ce/=re/R}if(Y.barnesHutOptimize){var le=1/0,_e=-1/0,pe=1/0,Ee=-1/0,te,Fe,Pe;for(z=0;z<re;z+=R)le=Math.min(le,B[z+e]),_e=Math.max(_e,B[z+e]),pe=Math.min(pe,B[z+t]),Ee=Math.max(Ee,B[z+t]);var me=_e-le,Ae=Ee-pe;for(me>Ae?(pe-=(me-Ae)/2,Ee=pe+me):(le-=(Ae-me)/2,_e=le+Ae),J[0+b]=-1,J[0+S]=(le+_e)/2,J[0+E]=(pe+Ee)/2,J[0+_]=Math.max(_e-le,Ee-pe),J[0+N]=-1,J[0+C]=-1,J[0+A]=0,J[0+k]=0,J[0+D]=0,ne=1,z=0;z<re;z+=R)for(F=0,Pe=M;;)if(J[F+C]>=0){B[z+e]<J[F+S]?B[z+t]<J[F+E]?te=J[F+C]:te=J[F+C]+L:B[z+t]<J[F+E]?te=J[F+C]+L*2:te=J[F+C]+L*3,J[F+k]=(J[F+k]*J[F+A]+B[z+e]*B[z+c])/(J[F+A]+B[z+c]),J[F+D]=(J[F+D]*J[F+A]+B[z+t]*B[z+c])/(J[F+A]+B[z+c]),J[F+A]+=B[z+c],F=te;continue}else if(J[F+b]<0){J[F+b]=z;break}else{if(J[F+C]=ne*L,O=J[F+_]/2,$=J[F+C],J[$+b]=-1,J[$+S]=J[F+S]-O,J[$+E]=J[F+E]-O,J[$+_]=O,J[$+N]=$+L,J[$+C]=-1,J[$+A]=0,J[$+k]=0,J[$+D]=0,$+=L,J[$+b]=-1,J[$+S]=J[F+S]-O,J[$+E]=J[F+E]+O,J[$+_]=O,J[$+N]=$+L,J[$+C]=-1,J[$+A]=0,J[$+k]=0,J[$+D]=0,$+=L,J[$+b]=-1,J[$+S]=J[F+S]+O,J[$+E]=J[F+E]-O,J[$+_]=O,J[$+N]=$+L,J[$+C]=-1,J[$+A]=0,J[$+k]=0,J[$+D]=0,$+=L,J[$+b]=-1,J[$+S]=J[F+S]+O,J[$+E]=J[F+E]+O,J[$+_]=O,J[$+N]=J[F+N],J[$+C]=-1,J[$+A]=0,J[$+k]=0,J[$+D]=0,ne+=4,B[J[F+b]+e]<J[F+S]?B[J[F+b]+t]<J[F+E]?te=J[F+C]:te=J[F+C]+L:B[J[F+b]+t]<J[F+E]?te=J[F+C]+L*2:te=J[F+C]+L*3,J[F+A]=B[J[F+b]+c],J[F+k]=B[J[F+b]+e],J[F+D]=B[J[F+b]+t],J[te+b]=J[F+b],J[F+b]=-1,B[z+e]<J[F+S]?B[z+t]<J[F+E]?Fe=J[F+C]:Fe=J[F+C]+L:B[z+t]<J[F+E]?Fe=J[F+C]+L*2:Fe=J[F+C]+L*3,te===Fe)if(Pe--){F=te;continue}else{Pe=M;break}J[Fe+b]=z;break}}if(Y.barnesHutOptimize)for(he=Y.scalingRatio,z=0;z<re;z+=R)for(F=0;;)if(J[F+C]>=0)if(Te=Math.pow(B[z+e]-J[F+k],2)+Math.pow(B[z+t]-J[F+D],2),W=J[F+_],4*W*W/Te<oe){if(Se=B[z+e]-J[F+k],be=B[z+t]-J[F+D],ie===!0?Te>0?(ye=he*B[z+c]*J[F+A]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye):Te<0&&(ye=-he*B[z+c]*J[F+A]/Math.sqrt(Te),B[z+n]+=Se*ye,B[z+a]+=be*ye):Te>0&&(ye=he*B[z+c]*J[F+A]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye),F=J[F+N],F<0)break;continue}else{F=J[F+C];continue}else{if(G=J[F+b],G>=0&&G!==z&&(Se=B[z+e]-B[G+e],be=B[z+t]-B[G+t],Te=Se*Se+be*be,ie===!0?Te>0?(ye=he*B[z+c]*B[G+c]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye):Te<0&&(ye=-he*B[z+c]*B[G+c]/Math.sqrt(Te),B[z+n]+=Se*ye,B[z+a]+=be*ye):Te>0&&(ye=he*B[z+c]*B[G+c]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye)),F=J[F+N],F<0)break;continue}else for(he=Y.scalingRatio,j=0;j<re;j+=R)for(K=0;K<j;K+=R)Se=B[j+e]-B[K+e],be=B[j+t]-B[K+t],ie===!0?(Te=Math.sqrt(Se*Se+be*be)-B[j+f]-B[K+f],Te>0?(ye=he*B[j+c]*B[K+c]/Te/Te,B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye):Te<0&&(ye=100*he*B[j+c]*B[K+c],B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye)):(Te=Math.sqrt(Se*Se+be*be),Te>0&&(ye=he*B[j+c]*B[K+c]/Te/Te,B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye));for($=Y.gravity/Y.scalingRatio,he=Y.scalingRatio,z=0;z<re;z+=R)ye=0,Se=B[z+e],be=B[z+t],Te=Math.sqrt(Math.pow(Se,2)+Math.pow(be,2)),Y.strongGravityMode?Te>0&&(ye=he*B[z+c]*$):Te>0&&(ye=he*B[z+c]*$/Te),B[z+n]-=Se*ye,B[z+a]-=be*ye;for(he=1*(Y.outboundAttractionDistribution?Ce:1),H=0;H<de;H+=U)j=X[H+m],K=X[H+g],O=X[H+y],Le=Math.pow(O,Y.edgeWeightInfluence),Se=B[j+e]-B[K+e],be=B[j+t]-B[K+t],ie===!0?(Te=Math.sqrt(Se*Se+be*be)-B[j+f]-B[K+f],Y.linLogMode?Y.outboundAttractionDistribution?Te>0&&(ye=-he*Le*Math.log(1+Te)/Te/B[j+c]):Te>0&&(ye=-he*Le*Math.log(1+Te)/Te):Y.outboundAttractionDistribution?Te>0&&(ye=-he*Le/B[j+c]):Te>0&&(ye=-he*Le)):(Te=Math.sqrt(Math.pow(Se,2)+Math.pow(be,2)),Y.linLogMode?Y.outboundAttractionDistribution?Te>0&&(ye=-he*Le*Math.log(1+Te)/Te/B[j+c]):Te>0&&(ye=-he*Le*Math.log(1+Te)/Te):Y.outboundAttractionDistribution?(Te=1,ye=-he*Le/B[j+c]):(Te=1,ye=-he*Le)),Te>0&&(B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye);var je,He,it,Ct,bt,qt;if(ie===!0)for(z=0;z<re;z+=R)B[z+h]!==1&&(je=Math.sqrt(Math.pow(B[z+n],2)+Math.pow(B[z+a],2)),je>I&&(B[z+n]=B[z+n]*I/je,B[z+a]=B[z+a]*I/je),He=B[z+c]*Math.sqrt((B[z+o]-B[z+n])*(B[z+o]-B[z+n])+(B[z+s]-B[z+a])*(B[z+s]-B[z+a])),it=Math.sqrt((B[z+o]+B[z+n])*(B[z+o]+B[z+n])+(B[z+s]+B[z+a])*(B[z+s]+B[z+a]))/2,Ct=.1*Math.log(1+it)/(1+Math.sqrt(He)),bt=B[z+e]+B[z+n]*(Ct/Y.slowDown),B[z+e]=bt,qt=B[z+t]+B[z+a]*(Ct/Y.slowDown),B[z+t]=qt);else for(z=0;z<re;z+=R)B[z+h]!==1&&(He=B[z+c]*Math.sqrt((B[z+o]-B[z+n])*(B[z+o]-B[z+n])+(B[z+s]-B[z+a])*(B[z+s]-B[z+a])),it=Math.sqrt((B[z+o]+B[z+n])*(B[z+o]+B[z+n])+(B[z+s]+B[z+a])*(B[z+s]+B[z+a]))/2,Ct=B[z+u]*Math.log(1+it)/(1+Math.sqrt(He)),B[z+u]=Math.min(1,Math.sqrt(Ct*(Math.pow(B[z+n],2)+Math.pow(B[z+a],2))/(1+Math.sqrt(He)))),bt=B[z+e]+B[z+n]*(Ct/Y.slowDown),B[z+e]=bt,qt=B[z+t]+B[z+a]*(Ct/Y.slowDown),B[z+t]=qt);return{}},Cp}var Zr={},$w;function rT(){if($w)return Zr;$w=1;var e=10,t=3;return Zr.assign=function(n){n=n||{};var a=Array.prototype.slice.call(arguments).slice(1),o,s,c;for(o=0,c=a.length;o<c;o++)if(a[o])for(s in a[o])n[s]=a[o][s];return n},Zr.validateSettings=function(n){return"linLogMode"in n&&typeof n.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in n&&typeof n.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in n&&typeof n.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in n&&typeof n.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in n&&!(typeof n.scalingRatio=="number"&&n.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in n&&typeof n.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in n&&!(typeof n.gravity=="number"&&n.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in n&&!(typeof n.slowDown=="number"||n.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in n&&typeof n.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in n&&!(typeof n.barnesHutTheta=="number"&&n.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},Zr.graphToByteArrays=function(n,a){var o=n.order,s=n.size,c={},u,f=new Float32Array(o*e),h=new Float32Array(s*t);return u=0,n.forEachNode(function(m,g){c[m]=u,f[u]=g.x,f[u+1]=g.y,f[u+2]=0,f[u+3]=0,f[u+4]=0,f[u+5]=0,f[u+6]=1,f[u+7]=1,f[u+8]=g.size||1,f[u+9]=g.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(m,g,y,b,S,E,_){var N=c[y],C=c[b],A=a(m,g,y,b,S,E,_);f[N+6]+=A,f[C+6]+=A,h[u]=N,h[u+1]=C,h[u+2]=A,u+=t}),{nodes:f,edges:h}},Zr.assignLayoutChanges=function(n,a,o){var s=0;n.updateEachNodeAttributes(function(c,u){return u.x=a[s],u.y=a[s+1],s+=e,o?o(c,u):u})},Zr.readGraphPositions=function(n,a){var o=0;n.forEachNode(function(s,c){a[o]=c.x,a[o+1]=c.y,o+=e})},Zr.collectLayoutChanges=function(n,a,o){for(var s=n.nodes(),c={},u=0,f=0,h=a.length;u<h;u+=e){if(o){var m=Object.assign({},n.getNodeAttributes(s[f]));m.x=a[u],m.y=a[u+1],m=o(s[f],m),c[s[f]]={x:m.x,y:m.y}}else c[s[f]]={x:a[u],y:a[u+1]};f++}return c},Zr.createWorker=function(a){var o=window.URL||window.webkitURL,s=a.toString(),c=o.createObjectURL(new Blob(["("+s+").call(this);"],{type:"text/javascript"})),u=new Worker(c);return o.revokeObjectURL(c),u},Zr}var Tp,Vw;function aT(){return Vw||(Vw=1,Tp={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),Tp}var Rp,qw;function M5(){if(qw)return Rp;qw=1;var e=Dr(),t=Xg().createEdgeWeightGetter,n=z5(),a=rT(),o=aT();function s(f,h,m){if(!e(h))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof m=="number"&&(m={iterations:m});var g=m.iterations;if(typeof g!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(g<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var y=t("getEdgeWeight"in m?m.getEdgeWeight:"weight").fromEntry,b=typeof m.outputReducer=="function"?m.outputReducer:null,S=a.assign({},o,m.settings),E=a.validateSettings(S);if(E)throw new Error("graphology-layout-forceatlas2: "+E.message);var _=a.graphToByteArrays(h,y),N;for(N=0;N<g;N++)n(S,_.nodes,_.edges);if(f){a.assignLayoutChanges(h,_.nodes,b);return}return a.collectLayoutChanges(h,_.nodes)}function c(f){var h=typeof f=="number"?f:f.order;return{barnesHutOptimize:h>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(h)}}var u=s.bind(null,!1);return u.assign=s.bind(null,!0),u.inferSettings=c,Rp=u,Rp}var P5=M5();const G5=dn(P5);var Ap,Yw;function F5(){return Yw||(Yw=1,Ap=function(){var t,n,a={};(function(){var s=0,c=1,u=2,f=3,h=4,m=5,g=6,y=7,b=8,S=9,E=0,_=1,N=2,C=0,A=1,k=2,D=3,M=4,R=5,U=6,L=7,I=8,q=3,Y=10,B=3,X=9,ne=10;a.exports=function(z,j,K){var G,H,O,$,W,re,de,ie,oe,Ce,he=j.length,Se=K.length,be=z.adjustSizes,Le=z.barnesHutTheta*z.barnesHutTheta,Te,ye,J,le,_e,pe,Ee,te=[];for(O=0;O<he;O+=Y)j[O+h]=j[O+u],j[O+m]=j[O+f],j[O+u]=0,j[O+f]=0;if(z.outboundAttractionDistribution){for(Te=0,O=0;O<he;O+=Y)Te+=j[O+g];Te/=he/Y}if(z.barnesHutOptimize){var Fe=1/0,Pe=-1/0,me=1/0,Ae=-1/0,je,He,it;for(O=0;O<he;O+=Y)Fe=Math.min(Fe,j[O+s]),Pe=Math.max(Pe,j[O+s]),me=Math.min(me,j[O+c]),Ae=Math.max(Ae,j[O+c]);var Ct=Pe-Fe,bt=Ae-me;for(Ct>bt?(me-=(Ct-bt)/2,Ae=me+Ct):(Fe-=(bt-Ct)/2,Pe=Fe+bt),te[0+C]=-1,te[0+A]=(Fe+Pe)/2,te[0+k]=(me+Ae)/2,te[0+D]=Math.max(Pe-Fe,Ae-me),te[0+M]=-1,te[0+R]=-1,te[0+U]=0,te[0+L]=0,te[0+I]=0,G=1,O=0;O<he;O+=Y)for(H=0,it=q;;)if(te[H+R]>=0){j[O+s]<te[H+A]?j[O+c]<te[H+k]?je=te[H+R]:je=te[H+R]+X:j[O+c]<te[H+k]?je=te[H+R]+X*2:je=te[H+R]+X*3,te[H+L]=(te[H+L]*te[H+U]+j[O+s]*j[O+g])/(te[H+U]+j[O+g]),te[H+I]=(te[H+I]*te[H+U]+j[O+c]*j[O+g])/(te[H+U]+j[O+g]),te[H+U]+=j[O+g],H=je;continue}else if(te[H+C]<0){te[H+C]=O;break}else{if(te[H+R]=G*X,ie=te[H+D]/2,oe=te[H+R],te[oe+C]=-1,te[oe+A]=te[H+A]-ie,te[oe+k]=te[H+k]-ie,te[oe+D]=ie,te[oe+M]=oe+X,te[oe+R]=-1,te[oe+U]=0,te[oe+L]=0,te[oe+I]=0,oe+=X,te[oe+C]=-1,te[oe+A]=te[H+A]-ie,te[oe+k]=te[H+k]+ie,te[oe+D]=ie,te[oe+M]=oe+X,te[oe+R]=-1,te[oe+U]=0,te[oe+L]=0,te[oe+I]=0,oe+=X,te[oe+C]=-1,te[oe+A]=te[H+A]+ie,te[oe+k]=te[H+k]-ie,te[oe+D]=ie,te[oe+M]=oe+X,te[oe+R]=-1,te[oe+U]=0,te[oe+L]=0,te[oe+I]=0,oe+=X,te[oe+C]=-1,te[oe+A]=te[H+A]+ie,te[oe+k]=te[H+k]+ie,te[oe+D]=ie,te[oe+M]=te[H+M],te[oe+R]=-1,te[oe+U]=0,te[oe+L]=0,te[oe+I]=0,G+=4,j[te[H+C]+s]<te[H+A]?j[te[H+C]+c]<te[H+k]?je=te[H+R]:je=te[H+R]+X:j[te[H+C]+c]<te[H+k]?je=te[H+R]+X*2:je=te[H+R]+X*3,te[H+U]=j[te[H+C]+g],te[H+L]=j[te[H+C]+s],te[H+I]=j[te[H+C]+c],te[je+C]=te[H+C],te[H+C]=-1,j[O+s]<te[H+A]?j[O+c]<te[H+k]?He=te[H+R]:He=te[H+R]+X:j[O+c]<te[H+k]?He=te[H+R]+X*2:He=te[H+R]+X*3,je===He)if(it--){H=je;continue}else{it=q;break}te[He+C]=O;break}}if(z.barnesHutOptimize)for(ye=z.scalingRatio,O=0;O<he;O+=Y)for(H=0;;)if(te[H+R]>=0)if(pe=Math.pow(j[O+s]-te[H+L],2)+Math.pow(j[O+c]-te[H+I],2),Ce=te[H+D],4*Ce*Ce/pe<Le){if(J=j[O+s]-te[H+L],le=j[O+c]-te[H+I],be===!0?pe>0?(Ee=ye*j[O+g]*te[H+U]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe<0&&(Ee=-ye*j[O+g]*te[H+U]/Math.sqrt(pe),j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe>0&&(Ee=ye*j[O+g]*te[H+U]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee),H=te[H+M],H<0)break;continue}else{H=te[H+R];continue}else{if(re=te[H+C],re>=0&&re!==O&&(J=j[O+s]-j[re+s],le=j[O+c]-j[re+c],pe=J*J+le*le,be===!0?pe>0?(Ee=ye*j[O+g]*j[re+g]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe<0&&(Ee=-ye*j[O+g]*j[re+g]/Math.sqrt(pe),j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe>0&&(Ee=ye*j[O+g]*j[re+g]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee)),H=te[H+M],H<0)break;continue}else for(ye=z.scalingRatio,$=0;$<he;$+=Y)for(W=0;W<$;W+=Y)J=j[$+s]-j[W+s],le=j[$+c]-j[W+c],be===!0?(pe=Math.sqrt(J*J+le*le)-j[$+b]-j[W+b],pe>0?(Ee=ye*j[$+g]*j[W+g]/pe/pe,j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee):pe<0&&(Ee=100*ye*j[$+g]*j[W+g],j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee)):(pe=Math.sqrt(J*J+le*le),pe>0&&(Ee=ye*j[$+g]*j[W+g]/pe/pe,j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee));for(oe=z.gravity/z.scalingRatio,ye=z.scalingRatio,O=0;O<he;O+=Y)Ee=0,J=j[O+s],le=j[O+c],pe=Math.sqrt(Math.pow(J,2)+Math.pow(le,2)),z.strongGravityMode?pe>0&&(Ee=ye*j[O+g]*oe):pe>0&&(Ee=ye*j[O+g]*oe/pe),j[O+u]-=J*Ee,j[O+f]-=le*Ee;for(ye=1*(z.outboundAttractionDistribution?Te:1),de=0;de<Se;de+=B)$=K[de+E],W=K[de+_],ie=K[de+N],_e=Math.pow(ie,z.edgeWeightInfluence),J=j[$+s]-j[W+s],le=j[$+c]-j[W+c],be===!0?(pe=Math.sqrt(J*J+le*le)-j[$+b]-j[W+b],z.linLogMode?z.outboundAttractionDistribution?pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe/j[$+g]):pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe):z.outboundAttractionDistribution?pe>0&&(Ee=-ye*_e/j[$+g]):pe>0&&(Ee=-ye*_e)):(pe=Math.sqrt(Math.pow(J,2)+Math.pow(le,2)),z.linLogMode?z.outboundAttractionDistribution?pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe/j[$+g]):pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe):z.outboundAttractionDistribution?(pe=1,Ee=-ye*_e/j[$+g]):(pe=1,Ee=-ye*_e)),pe>0&&(j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee);var qt,fn,Gt,at,Tn,xt;if(be===!0)for(O=0;O<he;O+=Y)j[O+S]!==1&&(qt=Math.sqrt(Math.pow(j[O+u],2)+Math.pow(j[O+f],2)),qt>ne&&(j[O+u]=j[O+u]*ne/qt,j[O+f]=j[O+f]*ne/qt),fn=j[O+g]*Math.sqrt((j[O+h]-j[O+u])*(j[O+h]-j[O+u])+(j[O+m]-j[O+f])*(j[O+m]-j[O+f])),Gt=Math.sqrt((j[O+h]+j[O+u])*(j[O+h]+j[O+u])+(j[O+m]+j[O+f])*(j[O+m]+j[O+f]))/2,at=.1*Math.log(1+Gt)/(1+Math.sqrt(fn)),Tn=j[O+s]+j[O+u]*(at/z.slowDown),j[O+s]=Tn,xt=j[O+c]+j[O+f]*(at/z.slowDown),j[O+c]=xt);else for(O=0;O<he;O+=Y)j[O+S]!==1&&(fn=j[O+g]*Math.sqrt((j[O+h]-j[O+u])*(j[O+h]-j[O+u])+(j[O+m]-j[O+f])*(j[O+m]-j[O+f])),Gt=Math.sqrt((j[O+h]+j[O+u])*(j[O+h]+j[O+u])+(j[O+m]+j[O+f])*(j[O+m]+j[O+f]))/2,at=j[O+y]*Math.log(1+Gt)/(1+Math.sqrt(fn)),j[O+y]=Math.min(1,Math.sqrt(at*(Math.pow(j[O+u],2)+Math.pow(j[O+f],2))/(1+Math.sqrt(fn)))),Tn=j[O+s]+j[O+u]*(at/z.slowDown),j[O+s]=Tn,xt=j[O+c]+j[O+f]*(at/z.slowDown),j[O+c]=xt);return{}}})();var o=a.exports;self.addEventListener("message",function(s){var c=s.data;t=new Float32Array(c.nodes),c.edges&&(n=new Float32Array(c.edges)),o(c.settings,t,n),self.postMessage({nodes:t.buffer},[t.buffer])})}),Ap}var Dp,Ww;function U5(){if(Ww)return Dp;Ww=1;var e=F5(),t=Dr(),n=Xg().createEdgeWeightGetter,a=rT(),o=aT();function s(c,u){if(u=u||{},!t(c))throw new Error("graphology-layout-forceatlas2/worker: the given graph is not a valid graphology instance.");var f=n("getEdgeWeight"in u?u.getEdgeWeight:"weight").fromEntry,h=a.assign({},o,u.settings),m=a.validateSettings(h);if(m)throw new Error("graphology-layout-forceatlas2/worker: "+m.message);this.worker=null,this.graph=c,this.settings=h,this.getEdgeWeight=f,this.matrices=null,this.running=!1,this.killed=!1,this.outputReducer=typeof u.outputReducer=="function"?u.outputReducer:null,this.handleMessage=this.handleMessage.bind(this);var g=void 0,y=this;this.handleGraphUpdate=function(){y.worker&&y.worker.terminate(),g&&clearTimeout(g),g=setTimeout(function(){g=void 0,y.spawnWorker()},0)},c.on("nodeAdded",this.handleGraphUpdate),c.on("edgeAdded",this.handleGraphUpdate),c.on("nodeDropped",this.handleGraphUpdate),c.on("edgeDropped",this.handleGraphUpdate),this.spawnWorker()}return s.prototype.isRunning=function(){return this.running},s.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=a.createWorker(e),this.worker.addEventListener("message",this.handleMessage),this.running&&(this.running=!1,this.start())},s.prototype.handleMessage=function(c){if(this.running){var u=new Float32Array(c.data.nodes);a.assignLayoutChanges(this.graph,u,this.outputReducer),this.outputReducer&&a.readGraphPositions(this.graph,u),this.matrices.nodes=u,this.askForIterations()}},s.prototype.askForIterations=function(c){var u=this.matrices,f={settings:this.settings,nodes:u.nodes.buffer},h=[u.nodes.buffer];return c&&(f.edges=u.edges.buffer,h.push(u.edges.buffer)),this.worker.postMessage(f,h),this},s.prototype.start=function(){if(this.killed)throw new 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)},Dp=s,Dp}var B5=U5();const I5=dn(B5);function iT(e={iterations:100}){return Xo(G5,e)}function H5(e={}){return Wg(I5,e)}var kp,Xw;function $5(){if(Xw)return kp;Xw=1;var e=0,t=1,n=2,a=3;function o(c,u){return c+"§"+u}function s(){return .01*(.5-Math.random())}return kp=function(u,f){var h=u.margin,m=u.ratio,g=u.expansion,y=u.gridSize,b=u.speed,S,E,_,N,C,A,k=!0,D=f.length,M=D/a|0,R=new Float32Array(M),U=new Float32Array(M),L=1/0,I=1/0,q=-1/0,Y=-1/0;for(S=0;S<D;S+=a)_=f[S+e],N=f[S+t],A=f[S+n]*m+h,L=Math.min(L,_-A),q=Math.max(q,_+A),I=Math.min(I,N-A),Y=Math.max(Y,N+A);var B=q-L,X=Y-I,ne=(L+q)/2,F=(I+Y)/2;L=ne-g*B/2,q=ne+g*B/2,I=F-g*X/2,Y=F+g*X/2;var z=new Array(y*y),j=z.length,K;for(K=0;K<j;K++)z[K]=[];var G,H,O,$,W,re,de,ie,oe,Ce;for(S=0;S<D;S+=a)for(_=f[S+e],N=f[S+t],A=f[S+n]*m+h,G=_-A,H=_+A,O=N-A,$=N+A,W=Math.floor(y*(G-L)/(q-L)),re=Math.floor(y*(H-L)/(q-L)),de=Math.floor(y*(O-I)/(Y-I)),ie=Math.floor(y*($-I)/(Y-I)),oe=W;oe<=re;oe++)for(Ce=de;Ce<=ie;Ce++)z[oe*y+Ce].push(S);var he,Se=new Set,be,Le,Te,ye,J,le,_e,pe,Ee,te,Fe,Pe,me;for(K=0;K<j;K++)for(he=z[K],S=0,C=he.length;S<C;S++)for(be=he[S],Te=f[be+e],J=f[be+t],_e=f[be+n],E=S+1;E<C;E++)Le=he[E],Ee=o(be,Le),!(j>1&&Se.has(Ee))&&(j>1&&Se.add(Ee),ye=f[Le+e],le=f[Le+t],pe=f[Le+n],te=ye-Te,Fe=le-J,Pe=Math.sqrt(te*te+Fe*Fe),me=Pe<_e*m+h+(pe*m+h),me&&(k=!1,Le=Le/a|0,Pe>0?(R[Le]+=te/Pe*(1+_e),U[Le]+=Fe/Pe*(1+_e)):(R[Le]+=B*s(),U[Le]+=X*s())));for(S=0,E=0;S<D;S+=a,E++)f[S+e]+=R[E]*.1*b,f[S+t]+=U[E]*.1*b;return{converged:k}},kp}var bi={},Kw;function oT(){if(Kw)return bi;Kw=1;var e=3;return bi.validateSettings=function(t){return"gridSize"in t&&typeof t.gridSize!="number"||t.gridSize<=0?{message:"the `gridSize` setting should be a positive number."}:"margin"in t&&typeof t.margin!="number"||t.margin<0?{message:"the `margin` setting should be 0 or a positive number."}:"expansion"in t&&typeof t.expansion!="number"||t.expansion<=0?{message:"the `expansion` setting should be a positive number."}:"ratio"in t&&typeof t.ratio!="number"||t.ratio<=0?{message:"the `ratio` setting should be a positive number."}:"speed"in t&&typeof t.speed!="number"||t.speed<=0?{message:"the `speed` setting should be a positive number."}:null},bi.graphToByteArray=function(t,n){var a=t.order,o=new Float32Array(a*e),s=0;return t.forEachNode(function(c,u){typeof n=="function"&&(u=n(c,u)),o[s]=u.x,o[s+1]=u.y,o[s+2]=u.size||1,s+=e}),o},bi.assignLayoutChanges=function(t,n,a){var o=0;t.forEachNode(function(s){var c={x:n[o],y:n[o+1]};typeof a=="function"&&(c=a(s,c)),t.mergeNodeAttributes(s,c),o+=e})},bi.collectLayoutChanges=function(t,n,a){var o={},s=0;return t.forEachNode(function(c){var u={x:n[s],y:n[s+1]};typeof a=="function"&&(u=a(c,u)),o[c]=u,s+=e}),o},bi.createWorker=function(n){var a=window.URL||window.webkitURL,o=n.toString(),s=a.createObjectURL(new Blob(["("+o+").call(this);"],{type:"text/javascript"})),c=new Worker(s);return a.revokeObjectURL(s),c},bi}var Np,Zw;function sT(){return Zw||(Zw=1,Np={gridSize:20,margin:5,expansion:1.1,ratio:1,speed:3}),Np}var Op,Qw;function V5(){if(Qw)return Op;Qw=1;var e=Dr(),t=$5(),n=oT(),a=sT(),o=500;function s(u,f,h){if(!e(f))throw new Error("graphology-layout-noverlap: the given graph is not a valid graphology instance.");typeof h=="number"?h={maxIterations:h}:h=h||{};var m=h.maxIterations||o;if(typeof m!="number"||m<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");var g=Object.assign({},a,h.settings),y=n.validateSettings(g);if(y)throw new Error("graphology-layout-noverlap: "+y.message);var b=n.graphToByteArray(f,h.inputReducer),S=!1,E;for(E=0;E<m&&!S;E++)S=t(g,b).converged;if(u){n.assignLayoutChanges(f,b,h.outputReducer);return}return n.collectLayoutChanges(f,b,h.outputReducer)}var c=s.bind(null,!1);return c.assign=s.bind(null,!0),Op=c,Op}var q5=V5();const Y5=dn(q5);var jp,Jw;function W5(){return Jw||(Jw=1,jp=function(){var t,n={};(function(){var o=0,s=1,c=2,u=3;function f(m,g){return m+"§"+g}function h(){return .01*(.5-Math.random())}n.exports=function(g,y){var b=g.margin,S=g.ratio,E=g.expansion,_=g.gridSize,N=g.speed,C,A,k,D,M,R,U=!0,L=y.length,I=L/u|0,q=new Float32Array(I),Y=new Float32Array(I),B=1/0,X=1/0,ne=-1/0,F=-1/0;for(C=0;C<L;C+=u)k=y[C+o],D=y[C+s],R=y[C+c]*S+b,B=Math.min(B,k-R),ne=Math.max(ne,k+R),X=Math.min(X,D-R),F=Math.max(F,D+R);var z=ne-B,j=F-X,K=(B+ne)/2,G=(X+F)/2;B=K-E*z/2,ne=K+E*z/2,X=G-E*j/2,F=G+E*j/2;var H=new Array(_*_),O=H.length,$;for($=0;$<O;$++)H[$]=[];var W,re,de,ie,oe,Ce,he,Se,be,Le;for(C=0;C<L;C+=u)for(k=y[C+o],D=y[C+s],R=y[C+c]*S+b,W=k-R,re=k+R,de=D-R,ie=D+R,oe=Math.floor(_*(W-B)/(ne-B)),Ce=Math.floor(_*(re-B)/(ne-B)),he=Math.floor(_*(de-X)/(F-X)),Se=Math.floor(_*(ie-X)/(F-X)),be=oe;be<=Ce;be++)for(Le=he;Le<=Se;Le++)H[be*_+Le].push(C);var Te,ye=new Set,J,le,_e,pe,Ee,te,Fe,Pe,me,Ae,je,He,it;for($=0;$<O;$++)for(Te=H[$],C=0,M=Te.length;C<M;C++)for(J=Te[C],_e=y[J+o],Ee=y[J+s],Fe=y[J+c],A=C+1;A<M;A++)le=Te[A],me=f(J,le),!(O>1&&ye.has(me))&&(O>1&&ye.add(me),pe=y[le+o],te=y[le+s],Pe=y[le+c],Ae=pe-_e,je=te-Ee,He=Math.sqrt(Ae*Ae+je*je),it=He<Fe*S+b+(Pe*S+b),it&&(U=!1,le=le/u|0,He>0?(q[le]+=Ae/He*(1+Fe),Y[le]+=je/He*(1+Fe)):(q[le]+=z*h(),Y[le]+=j*h())));for(C=0,A=0;C<L;C+=u,A++)y[C+o]+=q[A]*.1*N,y[C+s]+=Y[A]*.1*N;return{converged:U}}})();var a=n.exports;self.addEventListener("message",function(o){var s=o.data;t=new Float32Array(s.nodes);var c=a(s.settings,t);self.postMessage({result:c,nodes:t.buffer},[t.buffer])})}),jp}var Lp,e1;function X5(){if(e1)return Lp;e1=1;var e=W5(),t=Dr(),n=oT(),a=sT();function o(s,c){if(c=c||{},!t(s))throw new Error("graphology-layout-noverlap/worker: the given graph is not a valid graphology instance.");var u=Object.assign({},a,c.settings),f=n.validateSettings(u);if(f)throw new Error("graphology-layout-noverlap/worker: "+f.message);this.worker=null,this.graph=s,this.settings=u,this.matrices=null,this.running=!1,this.killed=!1,this.inputReducer=c.inputReducer,this.outputReducer=c.outputReducer,this.callbacks={onConverged:typeof c.onConverged=="function"?c.onConverged:null},this.handleMessage=this.handleMessage.bind(this);var h=!1,m=this;this.handleAddition=function(){h||(h=!0,m.spawnWorker(),setTimeout(function(){h=!1},0))},s.on("nodeAdded",this.handleAddition),s.on("edgeAdded",this.handleAddition),this.spawnWorker()}return o.prototype.isRunning=function(){return this.running},o.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=n.createWorker(e),this.worker.addEventListener("message",this.handleMessage),this.running&&(this.running=!1,this.start())},o.prototype.handleMessage=function(s){if(this.running){var c=new Float32Array(s.data.nodes);if(n.assignLayoutChanges(this.graph,c,this.outputReducer),this.matrices.nodes=c,s.data.result.converged){this.callbacks.onConverged&&this.callbacks.onConverged(),this.stop();return}this.askForIterations()}},o.prototype.askForIterations=function(){var s=this.matrices,c={settings:this.settings,nodes:s.nodes.buffer},u=[s.nodes.buffer];return this.worker.postMessage(c,u),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-noverlap/worker.start: layout was killed.");return this.running?this:(this.matrices={nodes:n.graphToByteArray(this.graph,this.inputReducer)},this.running=!0,this.askForIterations(),this)},o.prototype.stop=function(){return this.running=!1,this},o.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.handleAddition),this.graph.removeListener("edgeAdded",this.handleAddition)},Lp=o,Lp}var K5=X5();const Z5=dn(K5);function Q5(e={}){return Xo(Y5,e)}function J5(e={}){return Wg(Z5,e)}var zp,t1;function eF(){if(t1)return zp;t1=1;var e=Dl(),t=Dr(),n={dimensions:["x","y"],center:.5,rng:Math.random,scale:1};function a(s,c,u){if(!t(c))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");u=e(u,n);var f=u.dimensions;if(!Array.isArray(f)||f.length<1)throw new Error("graphology-layout/random: given dimensions are invalid.");var h=f.length,m=u.center,g=u.rng,y=u.scale,b=(m-.5)*y;function S(_){for(var N=0;N<h;N++)_[f[N]]=g()*y+b;return _}if(!s){var E={};return c.forEachNode(function(_){E[_]=S({})}),E}c.updateEachNodeAttributes(function(_,N){return S(N),N},{attributes:f})}var o=a.bind(null,!1);return o.assign=a.bind(null,!0),zp=o,zp}var tF=eF();const nF=dn(tF);function rF(e={}){return Xo(nF,e)}var n1=1,aF=.9,iF=.8,oF=.17,Mp=.1,Pp=.999,sF=.9999,lF=.99,cF=/[\\\/_+.#"@\[\(\{&]/,uF=/[\\\/_+.#"@\[\(\{&]/g,dF=/[\s-]/,lT=/[\s-]/g;function Nm(e,t,n,a,o,s,c){if(s===t.length)return o===e.length?n1:lF;var u=`${o},${s}`;if(c[u]!==void 0)return c[u];for(var f=a.charAt(s),h=n.indexOf(f,o),m=0,g,y,b,S;h>=0;)g=Nm(e,t,n,a,h+1,s+1,c),g>m&&(h===o?g*=n1:cF.test(e.charAt(h-1))?(g*=iF,b=e.slice(o,h-1).match(uF),b&&o>0&&(g*=Math.pow(Pp,b.length))):dF.test(e.charAt(h-1))?(g*=aF,S=e.slice(o,h-1).match(lT),S&&o>0&&(g*=Math.pow(Pp,S.length))):(g*=oF,o>0&&(g*=Math.pow(Pp,h-o))),e.charAt(h)!==t.charAt(s)&&(g*=sF)),(g<Mp&&n.charAt(h-1)===a.charAt(s+1)||a.charAt(s+1)===a.charAt(s)&&n.charAt(h-1)!==a.charAt(s))&&(y=Nm(e,t,n,a,h+1,s+2,c),y*Mp>g&&(g=y*Mp)),g>m&&(m=g),h=n.indexOf(f,h+1);return c[u]=m,m}function r1(e){return e.toLowerCase().replace(lT," ")}function fF(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Nm(e,t,r1(e),r1(t),0,0,{})}var Gp={exports:{}},Fp={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var a1;function hF(){if(a1)return Fp;a1=1;var e=Yu();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,o=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function u(g,y){var b=y(),S=a({inst:{value:b,getSnapshot:y}}),E=S[0].inst,_=S[1];return s(function(){E.value=b,E.getSnapshot=y,f(E)&&_({inst:E})},[g,b,y]),o(function(){return f(E)&&_({inst:E}),g(function(){f(E)&&_({inst:E})})},[g]),c(b),b}function f(g){var y=g.getSnapshot;g=g.value;try{var b=y();return!n(g,b)}catch{return!0}}function h(g,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Fp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Fp}var i1;function pF(){return i1||(i1=1,Gp.exports=hF()),Gp.exports}var mF=pF(),nl='[cmdk-group=""]',Up='[cmdk-group-items=""]',gF='[cmdk-group-heading=""]',Kg='[cmdk-item=""]',o1=`${Kg}:not([aria-disabled="true"])`,Om="cmdk-item-select",xi="data-value",vF=(e,t,n)=>fF(e,t,n),cT=w.createContext(void 0),kl=()=>w.useContext(cT),uT=w.createContext(void 0),Zg=()=>w.useContext(uT),dT=w.createContext(void 0),fT=w.forwardRef((e,t)=>{let n=Co(()=>{var O,$;return{search:"",value:($=(O=e.value)!=null?O:e.defaultValue)!=null?$:"",filtered:{count:0,items:new Map,groups:new Set}}}),a=Co(()=>new Set),o=Co(()=>new Map),s=Co(()=>new Map),c=Co(()=>new Set),u=hT(e),{label:f,children:h,value:m,onValueChange:g,filter:y,shouldFilter:b,loop:S,disablePointerSelection:E=!1,vimBindings:_=!0,...N}=e,C=on(),A=on(),k=on(),D=w.useRef(null),M=AF();Di(()=>{if(m!==void 0){let O=m.trim();n.current.value=O,R.emit()}},[m]),Di(()=>{M(6,B)},[]);let R=w.useMemo(()=>({subscribe:O=>(c.current.add(O),()=>c.current.delete(O)),snapshot:()=>n.current,setState:(O,$,W)=>{var re,de,ie;if(!Object.is(n.current[O],$)){if(n.current[O]=$,O==="search")Y(),I(),M(1,q);else if(O==="value"&&(W||M(5,B),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=$??"";(ie=(de=u.current).onValueChange)==null||ie.call(de,oe);return}R.emit()}},emit:()=>{c.current.forEach(O=>O())}}),[]),U=w.useMemo(()=>({value:(O,$,W)=>{var re;$!==((re=s.current.get(O))==null?void 0:re.value)&&(s.current.set(O,{value:$,keywords:W}),n.current.filtered.items.set(O,L($,W)),M(2,()=>{I(),R.emit()}))},item:(O,$)=>(a.current.add(O),$&&(o.current.has($)?o.current.get($).add(O):o.current.set($,new Set([O]))),M(3,()=>{Y(),I(),n.current.value||q(),R.emit()}),()=>{s.current.delete(O),a.current.delete(O),n.current.filtered.items.delete(O);let W=X();M(4,()=>{Y(),(W==null?void 0:W.getAttribute("id"))===O&&q(),R.emit()})}),group:O=>(o.current.has(O)||o.current.set(O,new Set),()=>{s.current.delete(O),o.current.delete(O)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:C,inputId:k,labelId:A,listInnerRef:D}),[]);function L(O,$){var W,re;let de=(re=(W=u.current)==null?void 0:W.filter)!=null?re:vF;return O?de(O,n.current.search,$):0}function I(){if(!n.current.search||u.current.shouldFilter===!1)return;let O=n.current.filtered.items,$=[];n.current.filtered.groups.forEach(re=>{let de=o.current.get(re),ie=0;de.forEach(oe=>{let Ce=O.get(oe);ie=Math.max(Ce,ie)}),$.push([re,ie])});let W=D.current;ne().sort((re,de)=>{var ie,oe;let Ce=re.getAttribute("id"),he=de.getAttribute("id");return((ie=O.get(he))!=null?ie:0)-((oe=O.get(Ce))!=null?oe:0)}).forEach(re=>{let de=re.closest(Up);de?de.appendChild(re.parentElement===de?re:re.closest(`${Up} > *`)):W.appendChild(re.parentElement===W?re:re.closest(`${Up} > *`))}),$.sort((re,de)=>de[1]-re[1]).forEach(re=>{var de;let ie=(de=D.current)==null?void 0:de.querySelector(`${nl}[${xi}="${encodeURIComponent(re[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function q(){let O=ne().find(W=>W.getAttribute("aria-disabled")!=="true"),$=O==null?void 0:O.getAttribute(xi);R.setState("value",$||void 0)}function Y(){var O,$,W,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let de=0;for(let ie of a.current){let oe=($=(O=s.current.get(ie))==null?void 0:O.value)!=null?$:"",Ce=(re=(W=s.current.get(ie))==null?void 0:W.keywords)!=null?re:[],he=L(oe,Ce);n.current.filtered.items.set(ie,he),he>0&&de++}for(let[ie,oe]of o.current)for(let Ce of oe)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=de}function B(){var O,$,W;let re=X();re&&(((O=re.parentElement)==null?void 0:O.firstChild)===re&&((W=($=re.closest(nl))==null?void 0:$.querySelector(gF))==null||W.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function X(){var O;return(O=D.current)==null?void 0:O.querySelector(`${Kg}[aria-selected="true"]`)}function ne(){var O;return Array.from(((O=D.current)==null?void 0:O.querySelectorAll(o1))||[])}function F(O){let $=ne()[O];$&&R.setState("value",$.getAttribute(xi))}function z(O){var $;let W=X(),re=ne(),de=re.findIndex(oe=>oe===W),ie=re[de+O];($=u.current)!=null&&$.loop&&(ie=de+O<0?re[re.length-1]:de+O===re.length?re[0]:re[de+O]),ie&&R.setState("value",ie.getAttribute(xi))}function j(O){let $=X(),W=$==null?void 0:$.closest(nl),re;for(;W&&!re;)W=O>0?TF(W,nl):RF(W,nl),re=W==null?void 0:W.querySelector(o1);re?R.setState("value",re.getAttribute(xi)):z(O)}let K=()=>F(ne().length-1),G=O=>{O.preventDefault(),O.metaKey?K():O.altKey?j(1):z(1)},H=O=>{O.preventDefault(),O.metaKey?F(0):O.altKey?j(-1):z(-1)};return w.createElement(Ie.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:O=>{var $;if(($=N.onKeyDown)==null||$.call(N,O),!O.defaultPrevented)switch(O.key){case"n":case"j":{_&&O.ctrlKey&&G(O);break}case"ArrowDown":{G(O);break}case"p":case"k":{_&&O.ctrlKey&&H(O);break}case"ArrowUp":{H(O);break}case"Home":{O.preventDefault(),F(0);break}case"End":{O.preventDefault(),K();break}case"Enter":if(!O.nativeEvent.isComposing&&O.keyCode!==229){O.preventDefault();let W=X();if(W){let re=new Event(Om);W.dispatchEvent(re)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:kF},f),xd(e,O=>w.createElement(uT.Provider,{value:R},w.createElement(cT.Provider,{value:U},O))))}),yF=w.forwardRef((e,t)=>{var n,a;let o=on(),s=w.useRef(null),c=w.useContext(dT),u=kl(),f=hT(e),h=(a=(n=f.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;Di(()=>{if(!h)return u.item(o,c==null?void 0:c.id)},[h]);let m=pT(o,s,[e.value,e.children,s],e.keywords),g=Zg(),y=ki(M=>M.value&&M.value===m.current),b=ki(M=>h||u.filter()===!1?!0:M.search?M.filtered.items.get(o)>0:!0);w.useEffect(()=>{let M=s.current;if(!(!M||e.disabled))return M.addEventListener(Om,S),()=>M.removeEventListener(Om,S)},[b,e.onSelect,e.disabled]);function S(){var M,R;E(),(R=(M=f.current).onSelect)==null||R.call(M,m.current)}function E(){g.setState("value",m.current,!0)}if(!b)return null;let{disabled:_,value:N,onSelect:C,forceMount:A,keywords:k,...D}=e;return w.createElement(Ie.div,{ref:fl([s,t]),...D,id:o,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!y,"data-disabled":!!_,"data-selected":!!y,onPointerMove:_||u.getDisablePointerSelection()?void 0:E,onClick:_?void 0:S},e.children)}),bF=w.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:o,...s}=e,c=on(),u=w.useRef(null),f=w.useRef(null),h=on(),m=kl(),g=ki(b=>o||m.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);Di(()=>m.group(c),[]),pT(c,u,[e.value,e.heading,f]);let y=w.useMemo(()=>({id:c,forceMount:o}),[o]);return w.createElement(Ie.div,{ref:fl([u,t]),...s,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&w.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),xd(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},w.createElement(dT.Provider,{value:y},b))))}),xF=w.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,o=w.useRef(null),s=ki(c=>!c.search);return!n&&!s?null:w.createElement(Ie.div,{ref:fl([o,t]),...a,"cmdk-separator":"",role:"separator"})}),wF=w.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,o=e.value!=null,s=Zg(),c=ki(m=>m.search),u=ki(m=>m.value),f=kl(),h=w.useMemo(()=>{var m;let g=(m=f.listInnerRef.current)==null?void 0:m.querySelector(`${Kg}[${xi}="${encodeURIComponent(u)}"]`);return g==null?void 0:g.getAttribute("id")},[]);return w.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),w.createElement(Ie.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":h,id:f.inputId,type:"text",value:o?e.value:c,onChange:m=>{o||s.setState("search",m.target.value),n==null||n(m.target.value)}})}),EF=w.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...o}=e,s=w.useRef(null),c=w.useRef(null),u=kl();return w.useEffect(()=>{if(c.current&&s.current){let f=c.current,h=s.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let y=f.offsetHeight;h.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(m),g.unobserve(f)}}},[]),w.createElement(Ie.div,{ref:fl([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":a,id:u.listId},xd(e,f=>w.createElement("div",{ref:fl([c,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),SF=w.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:o,contentClassName:s,container:c,...u}=e;return w.createElement(pg,{open:n,onOpenChange:a},w.createElement(mg,{container:c},w.createElement(ad,{"cmdk-overlay":"",className:o}),w.createElement(id,{"aria-label":e.label,"cmdk-dialog":"",className:s},w.createElement(fT,{ref:t,...u}))))}),_F=w.forwardRef((e,t)=>ki(n=>n.filtered.count===0)?w.createElement(Ie.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),CF=w.forwardRef((e,t)=>{let{progress:n,children:a,label:o="Loading...",...s}=e;return w.createElement(Ie.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},xd(e,c=>w.createElement("div",{"aria-hidden":!0},c)))}),Cn=Object.assign(fT,{List:EF,Item:yF,Input:wF,Group:bF,Separator:xF,Dialog:SF,Empty:_F,Loading:CF});function TF(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function RF(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function hT(e){let t=w.useRef(e);return Di(()=>{t.current=e}),t}var Di=typeof window>"u"?w.useEffect:w.useLayoutEffect;function Co(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function fl(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function ki(e){let t=Zg(),n=()=>e(t.snapshot());return mF.useSyncExternalStore(t.subscribe,n,n)}function pT(e,t,n,a=[]){let o=w.useRef(),s=kl();return Di(()=>{var c;let u=(()=>{var h;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():o.current}})(),f=a.map(h=>h.trim());s.value(e,u,f),(c=t.current)==null||c.setAttribute(xi,u),o.current=u}),o}var AF=()=>{let[e,t]=w.useState(),n=Co(()=>new Map);return Di(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,o)=>{n.current.set(a,o),t({})}};function DF(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function xd({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(DF(t),{ref:t.ref},n(t.props.children)):n(t)}var kF={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const mT=pg,gT=bS,NF=mg,vT=w.forwardRef(({className:e,...t},n)=>x.jsx(ad,{ref:n,className:Oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t}));vT.displayName=ad.displayName;const Qg=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(NF,{children:[x.jsx(vT,{}),x.jsxs(id,{ref:a,className:Oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,x.jsxs(yg,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[x.jsx(IE,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Qg.displayName=id.displayName;const Jg=({className:e,...t})=>x.jsx("div",{className:Oe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Jg.displayName="DialogHeader";const ev=w.forwardRef(({className:e,...t},n)=>x.jsx(gg,{ref:n,className:Oe("text-lg leading-none font-semibold tracking-tight",e),...t}));ev.displayName=gg.displayName;const tv=w.forwardRef(({className:e,...t},n)=>x.jsx(vg,{ref:n,className:Oe("text-muted-foreground text-sm",e),...t}));tv.displayName=vg.displayName;const wd=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn,{ref:n,className:Oe("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));wd.displayName=Cn.displayName;const nv=w.forwardRef(({className:e,...t},n)=>x.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[x.jsx(sj,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),x.jsx(Cn.Input,{ref:n,className:Oe("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));nv.displayName=Cn.Input.displayName;const Ed=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.List,{ref:n,className:Oe("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));Ed.displayName=Cn.List.displayName;const rv=w.forwardRef((e,t)=>x.jsx(Cn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));rv.displayName=Cn.Empty.displayName;const Ko=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.Group,{ref:n,className:Oe("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t}));Ko.displayName=Cn.Group.displayName;const OF=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.Separator,{ref:n,className:Oe("bg-border -mx-1 h-px",e),...t}));OF.displayName=Cn.Separator.displayName;const Zo=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.Item,{ref:n,className:Oe("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Zo.displayName=Cn.Item.displayName;const jF=({layout:e,autoRunFor:t})=>{const n=Zn(),{stop:a,start:o,isRunning:s}=e;return w.useEffect(()=>{if(!n)return;let c=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(o(),c=t>0?window.setTimeout(()=>{a()},t):null),()=>{a(),c&&clearTimeout(c)}},[t,o,a,n]),x.jsx(wt,{size:"icon",onClick:()=>s?a():o(),tooltip:s?"Stop the layout animation":"Start the layout animation",variant:_r,children:s?x.jsx(tj,{}):x.jsx(rj,{})})},LF=()=>{const e=Zn(),[t,n]=w.useState("Circular"),[a,o]=w.useState(!1),s=T5(),c=E5(),u=rF(),f=Q5({settings:{margin:1}}),h=j5({maxIterations:20}),m=iT({iterations:20}),g=J5(),y=L5(),b=H5(),S=w.useMemo(()=>({Circular:{layout:s},Circlepack:{layout:c},Random:{layout:u},Noverlaps:{layout:f,worker:g},"Force Directed":{layout:h,worker:y},"Force Atlas":{layout:m,worker:b}}),[c,s,h,m,f,u,y,g,b]),E=w.useCallback(_=>{console.debug(_);const{positions:N}=S[_].layout;BG(e.getGraph(),N(),{duration:500}),n(_)},[S,e]);return x.jsxs(x.Fragment,{children:[x.jsx("div",{children:S[t]&&"worker"in S[t]&&x.jsx(jF,{layout:S[t].worker})}),x.jsx("div",{children:x.jsxs(pd,{open:a,onOpenChange:o,children:[x.jsx(md,{asChild:!0,children:x.jsx(wt,{size:"icon",variant:_r,onClick:()=>o(_=>!_),tooltip:"Layout Graph",children:x.jsx($O,{})})}),x.jsx(_l,{side:"right",align:"center",className:"p-1",children:x.jsx(wd,{children:x.jsx(Ed,{children:x.jsx(Ko,{children:Object.keys(S).map(_=>x.jsx(Zo,{onSelect:()=>{E(_)},className:"cursor-pointer text-xs",children:_},_))})})})})]})})]})};var vu={exports:{}},zF=vu.exports,s1;function MF(){return s1||(s1=1,function(e){(function(t,n,a){function o(f){var h=this,m=u();h.next=function(){var g=2091639*h.s0+h.c*23283064365386963e-26;return h.s0=h.s1,h.s1=h.s2,h.s2=g-(h.c=g|0)},h.c=1,h.s0=m(" "),h.s1=m(" "),h.s2=m(" "),h.s0-=m(f),h.s0<0&&(h.s0+=1),h.s1-=m(f),h.s1<0&&(h.s1+=1),h.s2-=m(f),h.s2<0&&(h.s2+=1),m=null}function s(f,h){return h.c=f.c,h.s0=f.s0,h.s1=f.s1,h.s2=f.s2,h}function c(f,h){var m=new o(f),g=h&&h.state,y=m.next;return y.int32=function(){return m.next()*4294967296|0},y.double=function(){return y()+(y()*2097152|0)*11102230246251565e-32},y.quick=y,g&&(typeof g=="object"&&s(g,m),y.state=function(){return s(m,{})}),y}function u(){var f=4022871197,h=function(m){m=String(m);for(var g=0;g<m.length;g++){f+=m.charCodeAt(g);var y=.02519603282416938*f;f=y>>>0,y-=f,y*=f,f=y>>>0,y-=f,f+=y*4294967296}return(f>>>0)*23283064365386963e-26};return h}n&&n.exports?n.exports=c:this.alea=c})(zF,e)}(vu)),vu.exports}var yu={exports:{}},PF=yu.exports,l1;function GF(){return l1||(l1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var g=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^g^g>>>8},u===(u|0)?f.x=u:h+=u;for(var m=0;m<h.length+64;m++)f.x^=h.charCodeAt(m)|0,f.next()}function s(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f}function c(u,f){var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xor128=c})(PF,e)}(yu)),yu.exports}var bu={exports:{}},FF=bu.exports,c1;function UF(){return c1||(c1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.next=function(){var g=f.x^f.x>>>2;return f.x=f.y,f.y=f.z,f.z=f.w,f.w=f.v,(f.d=f.d+362437|0)+(f.v=f.v^f.v<<4^(g^g<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:h+=u;for(var m=0;m<h.length+64;m++)f.x^=h.charCodeAt(m)|0,m==h.length&&(f.d=f.x<<10^f.x>>>4),f.next()}function s(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f.v=u.v,f.d=u.d,f}function c(u,f){var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xorwow=c})(FF,e)}(bu)),bu.exports}var xu={exports:{}},BF=xu.exports,u1;function IF(){return u1||(u1=1,function(e){(function(t,n,a){function o(u){var f=this;f.next=function(){var m=f.x,g=f.i,y,b;return y=m[g],y^=y>>>7,b=y^y<<24,y=m[g+1&7],b^=y^y>>>10,y=m[g+3&7],b^=y^y>>>3,y=m[g+4&7],b^=y^y<<7,y=m[g+7&7],y=y^y<<13,b^=y^y<<9,m[g]=b,f.i=g+1&7,b};function h(m,g){var y,b=[];if(g===(g|0))b[0]=g;else for(g=""+g,y=0;y<g.length;++y)b[y&7]=b[y&7]<<15^g.charCodeAt(y)+b[y+1&7]<<13;for(;b.length<8;)b.push(0);for(y=0;y<8&&b[y]===0;++y);for(y==8?b[7]=-1:b[y],m.x=b,m.i=0,y=256;y>0;--y)m.next()}h(f,u)}function s(u,f){return f.x=u.x.slice(),f.i=u.i,f}function c(u,f){u==null&&(u=+new Date);var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(m.x&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xorshift7=c})(BF,e)}(xu)),xu.exports}var wu={exports:{}},HF=wu.exports,d1;function $F(){return d1||(d1=1,function(e){(function(t,n,a){function o(u){var f=this;f.next=function(){var m=f.w,g=f.X,y=f.i,b,S;return f.w=m=m+1640531527|0,S=g[y+34&127],b=g[y=y+1&127],S^=S<<13,b^=b<<17,S^=S>>>15,b^=b>>>12,S=g[y]=S^b,f.i=y,S+(m^m>>>16)|0};function h(m,g){var y,b,S,E,_,N=[],C=128;for(g===(g|0)?(b=g,g=null):(g=g+"\0",b=0,C=Math.max(C,g.length)),S=0,E=-32;E<C;++E)g&&(b^=g.charCodeAt((E+32)%g.length)),E===0&&(_=b),b^=b<<10,b^=b>>>15,b^=b<<4,b^=b>>>13,E>=0&&(_=_+1640531527|0,y=N[E&127]^=b+_,S=y==0?S+1:0);for(S>=128&&(N[(g&&g.length||0)&127]=-1),S=127,E=4*128;E>0;--E)b=N[S+34&127],y=N[S=S+1&127],b^=b<<13,y^=y<<17,b^=b>>>15,y^=y>>>12,N[S]=b^y;m.w=_,m.X=N,m.i=S}h(f,u)}function s(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function c(u,f){u==null&&(u=+new Date);var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(m.X&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xor4096=c})(HF,e)}(wu)),wu.exports}var Eu={exports:{}},VF=Eu.exports,f1;function qF(){return f1||(f1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.next=function(){var g=f.b,y=f.c,b=f.d,S=f.a;return g=g<<25^g>>>7^y,y=y-b|0,b=b<<24^b>>>8^S,S=S-g|0,f.b=g=g<<20^g>>>12^y,f.c=y=y-b|0,f.d=b<<16^y>>>16^S,f.a=S-g|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,u===Math.floor(u)?(f.a=u/4294967296|0,f.b=u|0):h+=u;for(var m=0;m<h.length+20;m++)f.b^=h.charCodeAt(m)|0,f.next()}function s(u,f){return f.a=u.a,f.b=u.b,f.c=u.c,f.d=u.d,f}function c(u,f){var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.tychei=c})(VF,e)}(Eu)),Eu.exports}var Su={exports:{}};const YF={},WF=Object.freeze(Object.defineProperty({__proto__:null,default:YF},Symbol.toStringTag,{value:"Module"})),XF=bD(WF);var KF=Su.exports,h1;function ZF(){return h1||(h1=1,function(e){(function(t,n,a){var o=256,s=6,c=52,u="random",f=a.pow(o,s),h=a.pow(2,c),m=h*2,g=o-1,y;function b(k,D,M){var R=[];D=D==!0?{entropy:!0}:D||{};var U=N(_(D.entropy?[k,A(n)]:k??C(),3),R),L=new S(R),I=function(){for(var q=L.g(s),Y=f,B=0;q<h;)q=(q+B)*o,Y*=o,B=L.g(1);for(;q>=m;)q/=2,Y/=2,B>>>=1;return(q+B)/Y};return I.int32=function(){return L.g(4)|0},I.quick=function(){return L.g(4)/4294967296},I.double=I,N(A(L.S),n),(D.pass||M||function(q,Y,B,X){return X&&(X.S&&E(X,L),q.state=function(){return E(L,{})}),B?(a[u]=q,Y):q})(I,U,"global"in D?D.global:this==a,D.state)}function S(k){var D,M=k.length,R=this,U=0,L=R.i=R.j=0,I=R.S=[];for(M||(k=[M++]);U<o;)I[U]=U++;for(U=0;U<o;U++)I[U]=I[L=g&L+k[U%M]+(D=I[U])],I[L]=D;(R.g=function(q){for(var Y,B=0,X=R.i,ne=R.j,F=R.S;q--;)Y=F[X=g&X+1],B=B*o+F[g&(F[X]=F[ne=g&ne+Y])+(F[ne]=Y)];return R.i=X,R.j=ne,B})(o)}function E(k,D){return D.i=k.i,D.j=k.j,D.S=k.S.slice(),D}function _(k,D){var M=[],R=typeof k,U;if(D&&R=="object")for(U in k)try{M.push(_(k[U],D-1))}catch{}return M.length?M:R=="string"?k:k+"\0"}function N(k,D){for(var M=k+"",R,U=0;U<M.length;)D[g&U]=g&(R^=D[g&U]*19)+M.charCodeAt(U++);return A(D)}function C(){try{var k;return y&&(k=y.randomBytes)?k=k(o):(k=new Uint8Array(o),(t.crypto||t.msCrypto).getRandomValues(k)),A(k)}catch{var D=t.navigator,M=D&&D.plugins;return[+new Date,t,M,t.screen,A(n)]}}function A(k){return String.fromCharCode.apply(0,k)}if(N(a.random(),n),e.exports){e.exports=b;try{y=XF}catch{}}else a["seed"+u]=b})(typeof self<"u"?self:KF,[],Math)}(Su)),Su.exports}var Bp,p1;function QF(){if(p1)return Bp;p1=1;var e=MF(),t=GF(),n=UF(),a=IF(),o=$F(),s=qF(),c=ZF();return c.alea=e,c.xor128=t,c.xorwow=n,c.xorshift7=a,c.xor4096=o,c.tychei=s,Bp=c,Bp}var JF=QF();const eU=dn(JF),tU=e=>{if(!e||!Array.isArray(e.nodes)||!Array.isArray(e.edges))return!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return!1;for(const t of e.edges){const n=e.getNode(t.source),a=e.getNode(t.target);if(n==null||a==null)return!1}return!0},nU=async e=>{let t=null;try{t=await pO(e)}catch(a){return En.getState().setErrorMessage(Sr(a),"Query Graphs Error!"),null}let n=null;if(t){const a={},o={};for(let f=0;f<t.nodes.length;f++){const h=t.nodes[f];a[h.id]=f,eU(h.id,{global:!0}),h.color=Sk(),h.x=Math.random(),h.y=Math.random(),h.degree=0,h.size=10}for(let f=0;f<t.edges.length;f++){const h=t.edges[f];o[h.id]=f;const m=a[h.source],g=a[h.target];if(m!==void 0&&m!==void 0){const y=t.nodes[m],b=t.nodes[g];if(!y){console.error(`Source node ${h.source} is undefined`);continue}if(!b){console.error(`Target node ${h.target} is undefined`);continue}y.degree+=1,b.degree+=1}}let s=Number.MAX_SAFE_INTEGER,c=0;for(const f of t.nodes)s=Math.min(s,f.degree),c=Math.max(c,f.degree);const u=c-s;if(u>0){const f=Nk-o0;for(const h of t.nodes)h.size=Math.round(o0+f*Math.pow((h.degree-s)/u,.5))}n=new p5,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=a,n.edgeIdMap=o,tU(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},rU=e=>{const t=new dl;for(const n of(e==null?void 0:e.nodes)??[])t.addNode(n.id,{label:n.labels.join(", "),color:n.color,x:n.x,y:n.y,size:n.size,borderColor:Rk,borderSize:.2});for(const n of(e==null?void 0:e.edges)??[])n.dynamicId=t.addDirectedEdge(n.source,n.target,{label:n.type||void 0});return t},m1={label:""},yT=()=>{const e=Ye.use.queryLabel(),t=ct.use.rawGraph(),n=ct.use.sigmaGraph(),a=w.useCallback(c=>(t==null?void 0:t.getNode(c))||null,[t]),o=w.useCallback((c,u=!0)=>(t==null?void 0:t.getEdge(c,u))||null,[t]);return w.useEffect(()=>{if(e){if(m1.label!==e){m1.label=e;const c=ct.getState();c.reset(),nU(e).then(u=>{c.setSigmaGraph(rU(u)),u==null||u.buildDynamicMap(),c.setRawGraph(u)})}}else{const c=ct.getState();c.reset(),c.setSigmaGraph(new dl)}},[e]),{lightrageGraph:w.useCallback(()=>{if(n)return n;const c=new dl;return ct.getState().setSigmaGraph(c),c},[n]),getNode:a,getEdge:o}},ru=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),aU=({disableHoverEffect:e})=>{const{lightrageGraph:t}=yT(),n=Zn(),a=GC(),o=PC(),s=m3(),{assign:c}=iT({iterations:20}),{theme:u}=O_(),f=Ye.use.enableHideUnselectedEdges(),h=ct.use.selectedNode(),m=ct.use.focusedNode(),g=ct.use.selectedEdge(),y=ct.use.focusedEdge();return w.useEffect(()=>{const b=t();s(b),b.__force_applied||(c(),Object.assign(b,{__force_applied:!0}));const{setFocusedNode:S,setSelectedNode:E,setFocusedEdge:_,setSelectedEdge:N,clearSelection:C}=ct.getState();a({enterNode:A=>{ru(A.event.original)||S(A.node)},leaveNode:A=>{ru(A.event.original)||S(null)},clickNode:A=>{E(A.node),N(null)},clickEdge:A=>{N(A.edge),E(null)},enterEdge:A=>{ru(A.event.original)||_(A.edge)},leaveEdge:A=>{ru(A.event.original)||_(null)},clickStage:()=>C()})},[c,s,a,t]),w.useEffect(()=>{const b=u==="dark",S=b?_k:void 0,E=b?Dk:void 0;o({nodeReducer:(_,N)=>{const C=n.getGraph(),A={...N,highlighted:N.highlighted||!1,labelColor:S};if(!e){A.highlighted=!1;const k=m||h,D=y||g;if(k)(_===k||C.neighbors(k).includes(_))&&(A.highlighted=!0,_===h&&(A.borderColor=Ak));else if(D)C.extremities(D).includes(_)&&(A.highlighted=!0,A.size=3);else return A;A.highlighted?b&&(A.labelColor=Ck):A.color=Tk}return A},edgeReducer:(_,N)=>{const C=n.getGraph(),A={...N,hidden:!1,labelColor:S,color:E};if(!e){const k=m||h;k?f?C.extremities(_).includes(k)||(A.hidden=!0):C.extremities(_).includes(k)&&(A.color=i0):(y||g)&&(_===g?A.color=kk:_===y?A.color=i0:f&&(A.hidden=!0))}return A}})},[h,m,g,y,o,n,e,u,f]),null},iU=()=>{const{zoomIn:e,zoomOut:t,reset:n}=FC({duration:200,factor:1.5}),a=w.useCallback(()=>e(),[e]),o=w.useCallback(()=>t(),[t]),s=w.useCallback(()=>n(),[n]);return x.jsxs(x.Fragment,{children:[x.jsx(wt,{variant:_r,onClick:a,tooltip:"Zoom In",size:"icon",children:x.jsx(bj,{})}),x.jsx(wt,{variant:_r,onClick:o,tooltip:"Zoom Out",size:"icon",children:x.jsx(wj,{})}),x.jsx(wt,{variant:_r,onClick:s,tooltip:"Reset Zoom",size:"icon",children:x.jsx(UO,{})})]})},oU=()=>{const{isFullScreen:e,toggle:t}=g3();return x.jsx(x.Fragment,{children:e?x.jsx(wt,{variant:_r,onClick:t,tooltip:"Windowed",size:"icon",children:x.jsx(ZO,{})}):x.jsx(wt,{variant:_r,onClick:t,tooltip:"Full Screen",size:"icon",children:x.jsx(XO,{})})})};function bT(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var av="Checkbox",[sU,W6]=Kn(av),[lU,cU]=sU(av),xT=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:o,defaultChecked:s,required:c,disabled:u,value:f="on",onCheckedChange:h,form:m,...g}=e,[y,b]=w.useState(null),S=nt(t,k=>b(k)),E=w.useRef(!1),_=y?m||!!y.closest("form"):!0,[N=!1,C]=aa({prop:o,defaultProp:s,onChange:h}),A=w.useRef(N);return w.useEffect(()=>{const k=y==null?void 0:y.form;if(k){const D=()=>C(A.current);return k.addEventListener("reset",D),()=>k.removeEventListener("reset",D)}},[y,C]),x.jsxs(lU,{scope:n,state:N,disabled:u,children:[x.jsx(Ie.button,{type:"button",role:"checkbox","aria-checked":Fa(N)?"mixed":N,"aria-required":c,"data-state":ST(N),"data-disabled":u?"":void 0,disabled:u,value:f,...g,ref:S,onKeyDown:Be(e.onKeyDown,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:Be(e.onClick,k=>{C(D=>Fa(D)?!0:!D),_&&(E.current=k.isPropagationStopped(),E.current||k.stopPropagation())})}),_&&x.jsx(uU,{control:y,bubbles:!E.current,name:a,value:f,checked:N,required:c,disabled:u,form:m,style:{transform:"translateX(-100%)"},defaultChecked:Fa(s)?!1:s})]})});xT.displayName=av;var wT="CheckboxIndicator",ET=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...o}=e,s=cU(wT,n);return x.jsx(zn,{present:a||Fa(s.state)||s.state===!0,children:x.jsx(Ie.span,{"data-state":ST(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});ET.displayName=wT;var uU=e=>{const{control:t,checked:n,bubbles:a=!0,defaultChecked:o,...s}=e,c=w.useRef(null),u=bT(n),f=XS(t);w.useEffect(()=>{const m=c.current,g=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(g,"checked").set;if(u!==n&&b){const S=new Event("click",{bubbles:a});m.indeterminate=Fa(n),b.call(m,Fa(n)?!1:n),m.dispatchEvent(S)}},[u,n,a]);const h=w.useRef(Fa(n)?!1:n);return x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??h.current,...s,tabIndex:-1,ref:c,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Fa(e){return e==="indeterminate"}function ST(e){return Fa(e)?"indeterminate":e?"checked":"unchecked"}var _T=xT,dU=ET;const sl=w.forwardRef(({className:e,...t},n)=>x.jsx(_T,{ref:n,className:Oe("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:x.jsx(dU,{className:Oe("flex items-center justify-center text-current"),children:x.jsx(ig,{className:"h-4 w-4"})})}));sl.displayName=_T.displayName;var fU="Separator",g1="horizontal",hU=["horizontal","vertical"],CT=w.forwardRef((e,t)=>{const{decorative:n,orientation:a=g1,...o}=e,s=pU(a)?a:g1,u=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return x.jsx(Ie.div,{"data-orientation":s,...u,...o,ref:t})});CT.displayName=fU;function pU(e){return hU.includes(e)}var TT=CT;const al=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...a},o)=>x.jsx(TT,{ref:o,decorative:n,orientation:t,className:Oe("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...a}));al.displayName=TT.displayName;const za=({checked:e,onCheckedChange:t,label:n})=>x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(sl,{checked:e,onCheckedChange:t}),x.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function mU(){const[e,t]=w.useState(!1),[n,a]=w.useState(""),o=Ye.use.showPropertyPanel(),s=Ye.use.showNodeSearchBar(),c=Ye.use.showNodeLabel(),u=Ye.use.enableEdgeEvents(),f=Ye.use.enableNodeDrag(),h=Ye.use.enableHideUnselectedEdges(),m=Ye.use.showEdgeLabel(),g=Ye.use.enableHealthCheck(),y=Ye.use.apiKey();w.useEffect(()=>{a(y||"")},[y,e]);const b=w.useCallback(()=>Ye.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),S=w.useCallback(()=>Ye.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),E=w.useCallback(()=>Ye.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),_=w.useCallback(()=>Ye.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),N=w.useCallback(()=>Ye.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),C=w.useCallback(()=>Ye.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),A=w.useCallback(()=>Ye.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),k=w.useCallback(()=>Ye.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),D=w.useCallback(async()=>{Ye.setState({apiKey:n||null}),await En.getState().check(),t(!1)},[n]),M=w.useCallback(R=>{a(R.target.value)},[a]);return x.jsxs(pd,{open:e,onOpenChange:t,children:[x.jsx(md,{asChild:!0,children:x.jsx(wt,{variant:_r,tooltip:"Settings",size:"icon",children:x.jsx(dj,{})})}),x.jsx(_l,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx(za,{checked:o,onCheckedChange:N,label:"Show Property Panel"}),x.jsx(za,{checked:s,onCheckedChange:C,label:"Show Search Bar"}),x.jsx(al,{}),x.jsx(za,{checked:c,onCheckedChange:A,label:"Show Node Label"}),x.jsx(za,{checked:f,onCheckedChange:b,label:"Node Draggable"}),x.jsx(al,{}),x.jsx(za,{checked:m,onCheckedChange:_,label:"Show Edge Label"}),x.jsx(za,{checked:h,onCheckedChange:E,label:"Hide Unselected Edges"}),x.jsx(za,{checked:u,onCheckedChange:S,label:"Edge Events"}),x.jsx(al,{}),x.jsx(za,{checked:g,onCheckedChange:k,label:"Health Check"}),x.jsx(al,{}),x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-sm font-medium",children:"API Key"}),x.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[x.jsx("div",{className:"w-0 flex-1",children:x.jsx(Ai,{type:"password",value:n,onChange:M,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),x.jsx(wt,{onClick:D,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}function _u(e,t,n,a){function o(s){return s instanceof n?s:new n(function(c){c(s)})}return new(n||(n=Promise))(function(s,c){function u(m){try{h(a.next(m))}catch(g){c(g)}}function f(m){try{h(a.throw(m))}catch(g){c(g)}}function h(m){m.done?s(m.value):o(m.value).then(u,f)}h((a=a.apply(e,[])).next())})}const gU="ENTRIES",RT="KEYS",AT="VALUES",Kt="";class Ip{constructor(t,n){const a=t._tree,o=Array.from(a.keys());this.set=t,this._type=n,this._path=o.length>0?[{node:a,keys:o}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=So(this._path);if(So(n)===Kt)return{done:!1,value:this.result()};const a=t.get(So(n));return this._path.push({node:a,keys:Array.from(a.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=So(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>So(t)).filter(t=>t!==Kt).join("")}value(){return So(this._path).node.get(Kt)}result(){switch(this._type){case AT:return this.value();case RT:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const So=e=>e[e.length-1],vU=(e,t,n)=>{const a=new Map;if(t===void 0)return a;const o=t.length+1,s=o+n,c=new Uint8Array(s*o).fill(n+1);for(let u=0;u<o;++u)c[u]=u;for(let u=1;u<s;++u)c[u*o]=u;return DT(e,t,n,a,c,1,o,""),a},DT=(e,t,n,a,o,s,c,u)=>{const f=s*c;e:for(const h of e.keys())if(h===Kt){const m=o[f-1];m<=n&&a.set(u,[e.get(h),m])}else{let m=s;for(let g=0;g<h.length;++g,++m){const y=h[g],b=c*m,S=b-c;let E=o[b];const _=Math.max(0,m-n-1),N=Math.min(c-1,m+n);for(let C=_;C<N;++C){const A=y!==t[C],k=o[S+C]+ +A,D=o[S+C+1]+1,M=o[b+C]+1,R=o[b+C+1]=Math.min(k,D,M);R<E&&(E=R)}if(E>n)continue e}DT(e.get(h),t,n,a,o,m,c,u+h)}};class Ga{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,a]=Pu(this._tree,t.slice(this._prefix.length));if(n===void 0){const[o,s]=iv(a);for(const c of o.keys())if(c!==Kt&&c.startsWith(s)){const u=new Map;return u.set(c.slice(s.length),o.get(c)),new Ga(u,t)}}return new Ga(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,yU(this._tree,t)}entries(){return new Ip(this,gU)}forEach(t){for(const[n,a]of this)t(n,a,this)}fuzzyGet(t,n){return vU(this._tree,t,n)}get(t){const n=jm(this._tree,t);return n!==void 0?n.get(Kt):void 0}has(t){const n=jm(this._tree,t);return n!==void 0&&n.has(Kt)}keys(){return new Ip(this,RT)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,Hp(this._tree,t).set(Kt,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const a=Hp(this._tree,t);return a.set(Kt,n(a.get(Kt))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const a=Hp(this._tree,t);let o=a.get(Kt);return o===void 0&&a.set(Kt,o=n()),o}values(){return new Ip(this,AT)}[Symbol.iterator](){return this.entries()}static from(t){const n=new Ga;for(const[a,o]of t)n.set(a,o);return n}static fromObject(t){return Ga.from(Object.entries(t))}}const Pu=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const a of e.keys())if(a!==Kt&&t.startsWith(a))return n.push([e,a]),Pu(e.get(a),t.slice(a.length),n);return n.push([e,t]),Pu(void 0,"",n)},jm=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==Kt&&t.startsWith(n))return jm(e.get(n),t.slice(n.length))},Hp=(e,t)=>{const n=t.length;e:for(let a=0;e&&a<n;){for(const s of e.keys())if(s!==Kt&&t[a]===s[0]){const c=Math.min(n-a,s.length);let u=1;for(;u<c&&t[a+u]===s[u];)++u;const f=e.get(s);if(u===s.length)e=f;else{const h=new Map;h.set(s.slice(u),f),e.set(t.slice(a,a+u),h),e.delete(s),e=h}a+=u;continue e}const o=new Map;return e.set(t.slice(a),o),o}return e},yU=(e,t)=>{const[n,a]=Pu(e,t);if(n!==void 0){if(n.delete(Kt),n.size===0)kT(a);else if(n.size===1){const[o,s]=n.entries().next().value;NT(a,o,s)}}},kT=e=>{if(e.length===0)return;const[t,n]=iv(e);if(t.delete(n),t.size===0)kT(e.slice(0,-1));else if(t.size===1){const[a,o]=t.entries().next().value;a!==Kt&&NT(e.slice(0,-1),a,o)}},NT=(e,t,n)=>{if(e.length===0)return;const[a,o]=iv(e);a.set(o+t,n),a.delete(o)},iv=e=>e[e.length-1],ov="or",OT="and",bU="and_not";class Ua{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?qp:t.autoVacuum;this._options=Object.assign(Object.assign(Object.assign({},Vp),t),{autoVacuum:n,searchOptions:Object.assign(Object.assign({},v1),t.searchOptions||{}),autoSuggestOptions:Object.assign(Object.assign({},_U),t.autoSuggestOptions||{})}),this._index=new Ga,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=zm,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:a,processTerm:o,fields:s,idField:c}=this._options,u=n(t,c);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const h of s){const m=n(t,h);if(m==null)continue;const g=a(m.toString(),h),y=this._fieldIds[h],b=new Set(g).size;this.addFieldLength(f,y,this._documentCount-1,b);for(const S of g){const E=o(S,h);if(Array.isArray(E))for(const _ of E)this.addTerm(y,f,_);else E&&this.addTerm(y,f,E)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:a=10}=n,o={chunk:[],promise:Promise.resolve()},{chunk:s,promise:c}=t.reduce(({chunk:u,promise:f},h,m)=>(u.push(h),(m+1)%a===0?{chunk:[],promise:f.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),o);return c.then(()=>this.addAll(s))}remove(t){const{tokenize:n,processTerm:a,extractField:o,fields:s,idField:c}=this._options,u=o(t,c);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);const f=this._idToShortId.get(u);if(f==null)throw new Error(`MiniSearch: cannot remove document with ID ${u}: it is not in the index`);for(const h of s){const m=o(t,h);if(m==null)continue;const g=n(m.toString(),h),y=this._fieldIds[h],b=new Set(g).size;this.removeFieldLength(f,y,this._documentCount,b);for(const S of g){const E=a(S,h);if(Array.isArray(E))for(const _ of E)this.removeTerm(y,f,_);else E&&this.removeTerm(y,f,E)}}this._storedFields.delete(f),this._documentIds.delete(f),this._idToShortId.delete(u),this._fieldLength.delete(f),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Ga,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((a,o)=>{this.removeFieldLength(n,o,this._documentCount,a)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:a,batchWait:o}=this._options.autoVacuum;this.conditionalVacuum({batchSize:a,batchWait:o},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const a of t)this.discard(a)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:a}=this._options,o=a(t,n);this.discard(o),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const a=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=zm,this.performVacuuming(t,a)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}performVacuuming(t,n){return _u(this,void 0,void 0,function*(){const a=this._dirtCount;if(this.vacuumConditionsMet(n)){const o=t.batchSize||Lm.batchSize,s=t.batchWait||Lm.batchWait;let c=1;for(const[u,f]of this._index){for(const[h,m]of f)for(const[g]of m)this._documentIds.has(g)||(m.size<=1?f.delete(h):m.delete(g));this._index.get(u).size===0&&this._index.delete(u),c%o===0&&(yield new Promise(h=>setTimeout(h,s))),c+=1}this._dirtCount-=a}yield null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null})}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:a}=t;return n=n||qp.minDirtCount,a=a||qp.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=a}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:a}=this._options,o=Object.assign(Object.assign({},a),n),s=this.executeQuery(t,n),c=[];for(const[u,{score:f,terms:h,match:m}]of s){const g=h.length||1,y={id:this._documentIds.get(u),score:f*g,terms:Object.keys(m),queryTerms:h,match:m};Object.assign(y,this._storedFields.get(u)),(o.filter==null||o.filter(y))&&c.push(y)}return t===Ua.wildcard&&o.boostDocument==null||c.sort(b1),c}autoSuggest(t,n={}){n=Object.assign(Object.assign({},this._options.autoSuggestOptions),n);const a=new Map;for(const{score:s,terms:c}of this.search(t,n)){const u=c.join(" "),f=a.get(u);f!=null?(f.score+=s,f.count+=1):a.set(u,{score:s,terms:c,count:1})}const o=[];for(const[s,{score:c,terms:u,count:f}]of a)o.push({suggestion:s,terms:u,score:c/f});return o.sort(b1),o}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static loadJSONAsync(t,n){return _u(this,void 0,void 0,function*(){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)})}static getDefault(t){if(Vp.hasOwnProperty(t))return $p(Vp,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:a,documentIds:o,fieldLength:s,storedFields:c,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=au(o),f._fieldLength=au(s),f._storedFields=au(c);for(const[h,m]of f._documentIds)f._idToShortId.set(m,h);for(const[h,m]of a){const g=new Map;for(const y of Object.keys(m)){let b=m[y];u===1&&(b=b.ds),g.set(parseInt(y,10),au(b))}f._index.set(h,g)}return f}static loadJSAsync(t,n){return _u(this,void 0,void 0,function*(){const{index:a,documentIds:o,fieldLength:s,storedFields:c,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=yield iu(o),f._fieldLength=yield iu(s),f._storedFields=yield iu(c);for(const[m,g]of f._documentIds)f._idToShortId.set(g,m);let h=0;for(const[m,g]of a){const y=new Map;for(const b of Object.keys(g)){let S=g[b];u===1&&(S=S.ds),y.set(parseInt(b,10),yield iu(S))}++h%1e3===0&&(yield jT(0)),f._index.set(m,y)}return f})}static instantiateMiniSearch(t,n){const{documentCount:a,nextId:o,fieldIds:s,averageFieldLength:c,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const h=new Ua(n);return h._documentCount=a,h._nextId=o,h._idToShortId=new Map,h._fieldIds=s,h._avgFieldLength=c,h._dirtCount=u||0,h._index=new Ga,h}executeQuery(t,n={}){if(t===Ua.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const y=Object.assign(Object.assign(Object.assign({},n),t),{queries:void 0}),b=t.queries.map(S=>this.executeQuery(S,y));return this.combineResults(b,y.combineWith)}const{tokenize:a,processTerm:o,searchOptions:s}=this._options,c=Object.assign(Object.assign({tokenize:a,processTerm:o},s),n),{tokenize:u,processTerm:f}=c,g=u(t).flatMap(y=>f(y)).filter(y=>!!y).map(SU(c)).map(y=>this.executeQuerySpec(y,c));return this.combineResults(g,c.combineWith)}executeQuerySpec(t,n){const a=Object.assign(Object.assign({},this._options.searchOptions),n),o=(a.fields||this._options.fields).reduce((E,_)=>Object.assign(Object.assign({},E),{[_]:$p(a.boost,_)||1}),{}),{boostDocument:s,weights:c,maxFuzzy:u,bm25:f}=a,{fuzzy:h,prefix:m}=Object.assign(Object.assign({},v1.weights),c),g=this._index.get(t.term),y=this.termResults(t.term,t.term,1,t.termBoost,g,o,s,f);let b,S;if(t.prefix&&(b=this._index.atPrefix(t.term)),t.fuzzy){const E=t.fuzzy===!0?.2:t.fuzzy,_=E<1?Math.min(u,Math.round(t.term.length*E)):E;_&&(S=this._index.fuzzyGet(t.term,_))}if(b)for(const[E,_]of b){const N=E.length-t.term.length;if(!N)continue;S==null||S.delete(E);const C=m*E.length/(E.length+.3*N);this.termResults(t.term,E,C,t.termBoost,_,o,s,f,y)}if(S)for(const E of S.keys()){const[_,N]=S.get(E);if(!N)continue;const C=h*E.length/(E.length+N);this.termResults(t.term,E,C,t.termBoost,_,o,s,f,y)}return y}executeWildcardQuery(t){const n=new Map,a=Object.assign(Object.assign({},this._options.searchOptions),t);for(const[o,s]of this._documentIds){const c=a.boostDocument?a.boostDocument(s,"",this._storedFields.get(o)):1;n.set(o,{score:c,terms:[],match:{}})}return n}combineResults(t,n=ov){if(t.length===0)return new Map;const a=n.toLowerCase(),o=xU[a];if(!o)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(o)||new Map}toJSON(){const t=[];for(const[n,a]of this._index){const o={};for(const[s,c]of a)o[s]=Object.fromEntries(c);t.push([n,o])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,a,o,s,c,u,f,h=new Map){if(s==null)return h;for(const m of Object.keys(c)){const g=c[m],y=this._fieldIds[m],b=s.get(y);if(b==null)continue;let S=b.size;const E=this._avgFieldLength[y];for(const _ of b.keys()){if(!this._documentIds.has(_)){this.removeTerm(y,_,n),S-=1;continue}const N=u?u(this._documentIds.get(_),n,this._storedFields.get(_)):1;if(!N)continue;const C=b.get(_),A=this._fieldLength.get(_)[y],k=EU(C,S,this._documentCount,A,E,f),D=a*o*g*N*k,M=h.get(_);if(M){M.score+=D,CU(M.terms,t);const R=$p(M.match,n);R?R.push(m):M.match[n]=[m]}else h.set(_,{score:D,terms:[t],match:{[n]:[m]}})}}return h}addTerm(t,n,a){const o=this._index.fetch(a,x1);let s=o.get(t);if(s==null)s=new Map,s.set(n,1),o.set(t,s);else{const c=s.get(n);s.set(n,(c||0)+1)}}removeTerm(t,n,a){if(!this._index.has(a)){this.warnDocumentChanged(n,t,a);return}const o=this._index.fetch(a,x1),s=o.get(t);s==null||s.get(n)==null?this.warnDocumentChanged(n,t,a):s.get(n)<=1?s.size<=1?o.delete(t):s.delete(n):s.set(n,s.get(n)-1),this._index.get(a).size===0&&this._index.delete(a)}warnDocumentChanged(t,n,a){for(const o of Object.keys(this._fieldIds))if(this._fieldIds[o]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${a}" was not present in field "${o}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;n<t.length;n++)this._fieldIds[t[n]]=n}addFieldLength(t,n,a,o){let s=this._fieldLength.get(t);s==null&&this._fieldLength.set(t,s=[]),s[n]=o;const u=(this._avgFieldLength[n]||0)*a+o;this._avgFieldLength[n]=u/(a+1)}removeFieldLength(t,n,a,o){if(a===1){this._avgFieldLength[n]=0;return}const s=this._avgFieldLength[n]*a-o;this._avgFieldLength[n]=s/(a-1)}saveStoredFields(t,n){const{storeFields:a,extractField:o}=this._options;if(a==null||a.length===0)return;let s=this._storedFields.get(t);s==null&&this._storedFields.set(t,s={});for(const c of a){const u=o(n,c);u!==void 0&&(s[c]=u)}}}Ua.wildcard=Symbol("*");const $p=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,xU={[ov]:(e,t)=>{for(const n of t.keys()){const a=e.get(n);if(a==null)e.set(n,t.get(n));else{const{score:o,terms:s,match:c}=t.get(n);a.score=a.score+o,a.match=Object.assign(a.match,c),y1(a.terms,s)}}return e},[OT]:(e,t)=>{const n=new Map;for(const a of t.keys()){const o=e.get(a);if(o==null)continue;const{score:s,terms:c,match:u}=t.get(a);y1(o.terms,c),n.set(a,{score:o.score+s,terms:o.terms,match:Object.assign(o.match,u)})}return n},[bU]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},wU={k:1.2,b:.7,d:.5},EU=(e,t,n,a,o,s)=>{const{k:c,b:u,d:f}=s;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(c+1)/(e+c*(1-u+u*a/o)))},SU=e=>(t,n,a)=>{const o=typeof e.fuzzy=="function"?e.fuzzy(t,n,a):e.fuzzy||!1,s=typeof e.prefix=="function"?e.prefix(t,n,a):e.prefix===!0,c=typeof e.boostTerm=="function"?e.boostTerm(t,n,a):1;return{term:t,fuzzy:o,prefix:s,termBoost:c}},Vp={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(TU),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},v1={combineWith:ov,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:wU},_U={combineWith:OT,prefix:(e,t,n)=>t===n.length-1},Lm={batchSize:1e3,batchWait:10},zm={minDirtFactor:.1,minDirtCount:20},qp=Object.assign(Object.assign({},Lm),zm),CU=(e,t)=>{e.includes(t)||e.push(t)},y1=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},b1=({score:e},{score:t})=>t-e,x1=()=>new Map,au=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},iu=e=>_u(void 0,void 0,void 0,function*(){const t=new Map;let n=0;for(const a of Object.keys(e))t.set(parseInt(a,10),e[a]),++n%1e3===0&&(yield jT(0));return t}),jT=e=>new Promise(t=>setTimeout(t,e)),TU=/[\n\r\p{Z}\p{P}]+/u,RU={index:new Ua({fields:[]})};w.createContext(RU);const Mm=({label:e,color:t,hidden:n,labels:a={}})=>ve.createElement("div",{className:"node"},ve.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),ve.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||a.no_label||"No label")),AU=({id:e,labels:t})=>{const n=Zn(),a=w.useMemo(()=>{const o=n.getGraph().getNodeAttributes(e),s=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},o),s?s(e,o):{})},[n,e]);return ve.createElement(Mm,Object.assign({},a,{labels:t}))},DU=({label:e,color:t,source:n,target:a,hidden:o,directed:s,labels:c={}})=>ve.createElement("div",{className:"edge"},ve.createElement(Mm,Object.assign({},n,{labels:c})),ve.createElement("div",{className:"body"},ve.createElement("div",{className:"render"},ve.createElement("span",{className:o?"dotted":"dash",style:{borderColor:t||"#000"}})," ",s&&ve.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),ve.createElement("span",{className:`label ${o?"text-muted":""} ${e?"":"fst-italic"}`},e||c.no_label||"No label")),ve.createElement(Mm,Object.assign({},a,{labels:c}))),kU=({id:e,labels:t})=>{const n=Zn(),a=w.useMemo(()=>{const o=n.getGraph().getEdgeAttributes(e),s=n.getSetting("nodeReducer"),c=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),f=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},o),c?c(e,o):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),s?s(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),s?s(e,f):{})})},[n,e]);return ve.createElement(DU,Object.assign({},a,{labels:t}))};function sv(e,t){const[n,a]=w.useState(e);return w.useEffect(()=>{const o=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(o)}},[e,t]),n}function NU({fetcher:e,preload:t,filterFn:n,renderOption:a,getOptionValue:o,notFound:s,loadingSkeleton:c,label:u,placeholder:f="Select...",value:h,onChange:m,onFocus:g,disabled:y=!1,className:b,noResultsMessage:S}){const[E,_]=w.useState(!1),[N,C]=w.useState(!1),[A,k]=w.useState([]),[D,M]=w.useState(!1),[R,U]=w.useState(null),[L,I]=w.useState(h),[q,Y]=w.useState(null),[B,X]=w.useState(""),ne=sv(B,t?0:150),[F,z]=w.useState([]);w.useEffect(()=>{_(!0),I(h)},[h]),w.useEffect(()=>{E||(async()=>{try{M(!0),U(null);const H=h!==null?await e(h):[];z(H),k(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{M(!1)}})()},[E,e,h]),w.useEffect(()=>{const G=async()=>{try{M(!0),U(null);const H=await e(ne);z(H),k(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{M(!1)}};E&&t?t&&k(ne?F.filter(H=>n?n(H,ne):!0):F):G()},[e,ne,E,t,n]);const j=w.useCallback(G=>{G!==L&&(I(G),m(G)),C(!1)},[L,I,C,m]),K=w.useCallback(G=>{G!==q&&(Y(G),g(G))},[q,Y,g]);return x.jsx("div",{className:Oe(y&&"cursor-not-allowed opacity-50",b),onFocus:()=>{C(!0)},onBlur:()=>C(!1),children:x.jsxs(wd,{shouldFilter:!1,className:"bg-transparent",children:[x.jsxs("div",{children:[x.jsx(nv,{placeholder:f,value:B,className:"max-h-8",onValueChange:G=>{X(G),G&&!N&&C(!0)}}),D&&A.length>0&&x.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:x.jsx(BE,{className:"h-4 w-4 animate-spin"})})]}),x.jsxs(Ed,{hidden:!N||ne.length===0,children:[R&&x.jsx("div",{className:"text-destructive p-4 text-center",children:R}),D&&A.length===0&&(c||x.jsx(OU,{})),!D&&!R&&A.length===0&&(s||x.jsx(rv,{children:S??`No ${u.toLowerCase()} found.`})),x.jsx(Ko,{children:A.map((G,H)=>x.jsxs(x.Fragment,{children:[x.jsx(Zo,{value:o(G),onSelect:j,onMouseEnter:()=>K(o(G)),className:"truncate",children:a(G)},o(G)+`${H}`),H!==A.length-1&&x.jsx("div",{className:"bg-foreground/10 h-[1px]"},H)]}))})]})]})})}function OU(){return x.jsx(Ko,{children:x.jsx(Zo,{disabled:!0,children:x.jsxs("div",{className:"flex w-full items-center gap-2",children:[x.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),x.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[x.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),x.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function jU(e){return x.jsxs("div",{children:[e.type==="nodes"&&x.jsx(AU,{id:e.id}),e.type==="edges"&&x.jsx(kU,{id:e.id}),e.type==="message"&&x.jsx("div",{children:e.message})]})}const Yp="__message_item",ou={graph:null,searchEngine:null},LU=({onChange:e,onFocus:t,value:n})=>{const a=ct.use.sigmaGraph(),o=w.useMemo(()=>{if(ou.graph==a)return ou.searchEngine;if(!a||a.nodes().length==0)return;ou.graph=a;const c=new Ua({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=a.nodes().map(f=>({id:f,label:a.getNodeAttribute(f,"label")}));return c.addAll(u),ou.searchEngine=c,c},[a]),s=w.useCallback(async c=>{if(t&&t(null),!c||!o)return[];const u=o.search(c).map(f=>({id:f.id,type:"nodes"}));return u.length<=Hh?u:[...u.slice(0,Hh),{type:"message",id:Yp,message:`And ${u.length-Hh} others`}]},[o,t]);return x.jsx(NU,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:s,renderOption:jU,getOptionValue:c=>c.id,value:n&&n.type!=="message"?n.id:null,onChange:c=>{c!==Yp&&e(c?{id:c,type:"nodes"}:null)},onFocus:c=>{c!==Yp&&t&&t(c?{id:c,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},zU=({...e})=>x.jsx(LU,{...e});function MU({fetcher:e,preload:t,filterFn:n,renderOption:a,getOptionValue:o,getDisplayValue:s,notFound:c,loadingSkeleton:u,label:f,placeholder:h="Select...",value:m,onChange:g,disabled:y=!1,className:b,triggerClassName:S,searchInputClassName:E,noResultsMessage:_,triggerTooltip:N,clearable:C=!0}){const[A,k]=w.useState(!1),[D,M]=w.useState(!1),[R,U]=w.useState([]),[L,I]=w.useState(!1),[q,Y]=w.useState(null),[B,X]=w.useState(m),[ne,F]=w.useState(null),[z,j]=w.useState(""),K=sv(z,t?0:150),[G,H]=w.useState([]);w.useEffect(()=>{k(!0),X(m)},[m]),w.useEffect(()=>{if(m&&R.length>0){const $=R.find(W=>o(W)===m);$&&F($)}},[m,R,o]),w.useEffect(()=>{A||(async()=>{try{I(!0),Y(null);const W=await e(m);H(W),U(W)}catch(W){Y(W instanceof Error?W.message:"Failed to fetch options")}finally{I(!1)}})()},[A,e,m]),w.useEffect(()=>{const $=async()=>{try{I(!0),Y(null);const W=await e(K);H(W),U(W)}catch(W){Y(W instanceof Error?W.message:"Failed to fetch options")}finally{I(!1)}};A&&t?t&&U(K?G.filter(W=>n?n(W,K):!0):G):$()},[e,K,A,t,n]);const O=w.useCallback($=>{const W=C&&$===B?"":$;X(W),F(R.find(re=>o(re)===W)||null),g(W),M(!1)},[B,g,C,R,o]);return x.jsxs(pd,{open:D,onOpenChange:M,children:[x.jsx(md,{asChild:!0,children:x.jsxs(wt,{variant:"outline",role:"combobox","aria-expanded":D,className:Oe("justify-between",y&&"cursor-not-allowed opacity-50",S),disabled:y,tooltip:N,side:"bottom",children:[ne?s(ne):h,x.jsx(NO,{className:"opacity-50",size:10})]})}),x.jsx(_l,{className:Oe("p-0",b),onCloseAutoFocus:$=>$.preventDefault(),children:x.jsxs(wd,{shouldFilter:!1,children:[x.jsxs("div",{className:"relative w-full border-b",children:[x.jsx(nv,{placeholder:`Search ${f.toLowerCase()}...`,value:z,onValueChange:$=>{j($)},className:E}),L&&R.length>0&&x.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:x.jsx(BE,{className:"h-4 w-4 animate-spin"})})]}),x.jsxs(Ed,{children:[q&&x.jsx("div",{className:"text-destructive p-4 text-center",children:q}),L&&R.length===0&&(u||x.jsx(PU,{})),!L&&!q&&R.length===0&&(c||x.jsx(rv,{children:_??`No ${f.toLowerCase()} found.`})),x.jsx(Ko,{children:R.map($=>x.jsxs(Zo,{value:o($),onSelect:O,className:"truncate",children:[a($),x.jsx(ig,{className:Oe("ml-auto h-3 w-3",B===o($)?"opacity-100":"opacity-0")})]},o($)))})]})]})})]})}function PU(){return x.jsx(Ko,{children:x.jsx(Zo,{disabled:!0,children:x.jsxs("div",{className:"flex w-full items-center gap-2",children:[x.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),x.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[x.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),x.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const GU=()=>{const e=Ye.use.queryLabel(),[t,n]=w.useState({labels:[],searchEngine:null}),[a,o]=w.useState(!1),s=w.useCallback(async u=>{let f=t.labels,h=t.searchEngine;if(!a||!h){f=["*"].concat(await mO()),f.includes(Ye.getState().queryLabel)||Ye.getState().setQueryLabel(f[0]),h=new Ua({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const m=f.map((g,y)=>({id:y,value:g}));h.addAll(m),n({labels:f,searchEngine:h}),o(!0)}return u?h.search(u).map(m=>f[m.id]):f},[t,a,n,o]),c=w.useCallback(u=>{Ye.getState().setQueryLabel(u)},[]);return x.jsx(MU,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:s,renderOption:u=>x.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>x.jsx("div",{children:u}),notFound:x.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:c})},bn=({text:e,className:t,tooltipClassName:n,tooltip:a,side:o,onClick:s})=>a?x.jsx(h_,{delayDuration:200,children:x.jsxs(p_,{children:[x.jsx(m_,{asChild:!0,children:x.jsx("label",{className:Oe(t,s!==void 0?"cursor-pointer":void 0),onClick:s,children:e})}),x.jsx(jg,{side:o,className:n,children:a})]})}):x.jsx("label",{className:Oe(t,s!==void 0?"cursor-pointer":void 0),onClick:s,children:e}),FU=()=>{const{getNode:e,getEdge:t}=yT(),n=ct.use.selectedNode(),a=ct.use.focusedNode(),o=ct.use.selectedEdge(),s=ct.use.focusedEdge(),[c,u]=w.useState(null),[f,h]=w.useState(null);return w.useEffect(()=>{let m=null,g=null;a?(m="node",g=e(a)):n?(m="node",g=e(n)):s?(m="edge",g=t(s,!0)):o&&(m="edge",g=t(o,!0)),g?(m=="node"?u(UU(g)):u(BU(g)),h(m)):(u(null),h(null))},[a,n,s,o,u,h,e,t]),c?x.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?x.jsx(IU,{node:c}):x.jsx(HU,{edge:c})}):x.jsx(x.Fragment,{})},UU=e=>{const t=ct.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const a of t.sigmaGraph.edges(e.id)){const o=t.rawGraph.getEdge(a,!0);if(o){const s=e.id===o.source,c=s?o.target:o.source,u=t.rawGraph.getNode(c);u&&n.push({type:s?"Target":"Source",id:c,label:u.labels.join(", ")})}}return{...e,relationships:n}},BU=e=>{var o,s;const t=ct.getState(),n=(o=t.rawGraph)==null?void 0:o.getNode(e.source),a=(s=t.rawGraph)==null?void 0:s.getNode(e.target);return{...e,sourceNode:n,targetNode:a}},Er=({name:e,value:t,onClick:n,tooltip:a})=>x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",x.jsx(bn,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:a||t,side:"left",onClick:n})]}),IU=({node:e})=>x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),x.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[x.jsx(Er,{name:"Id",value:e.id}),x.jsx(Er,{name:"Labels",value:e.labels.join(", "),onClick:()=>{ct.getState().setSelectedNode(e.id,!0)}}),x.jsx(Er,{name:"Degree",value:e.degree})]}),x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>x.jsx(Er,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&x.jsxs(x.Fragment,{children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:a})=>x.jsx(Er,{name:t,value:a,onClick:()=>{ct.getState().setSelectedNode(n,!0)}},n))})]})]}),HU=({edge:e})=>x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),x.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[x.jsx(Er,{name:"Id",value:e.id}),e.type&&x.jsx(Er,{name:"Type",value:e.type}),x.jsx(Er,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{ct.getState().setSelectedNode(e.source,!0)}}),x.jsx(Er,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{ct.getState().setSelectedNode(e.target,!0)}})]}),x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>x.jsx(Er,{name:t,value:e.properties[t]},t))})]}),w1={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:kC,curvedArrow:h5,curvedNoArrow:f5},nodeProgramClasses:{default:X3,circel:Tl,point:S3},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},$U=()=>{const e=GC(),t=Zn(),[n,a]=w.useState(null);return w.useEffect(()=>{e({downNode:o=>{a(o.node),t.getGraph().setNodeAttribute(o.node,"highlighted",!0)},mousemovebody:o=>{if(!n)return;const s=t.viewportToGraph(o);t.getGraph().setNodeAttribute(n,"x",s.x),t.getGraph().setNodeAttribute(n,"y",s.y),o.preventSigmaDefault(),o.original.preventDefault(),o.original.stopPropagation()},mouseup:()=>{n&&(a(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},VU=()=>{const[e,t]=w.useState(w1),n=ct.use.selectedNode(),a=ct.use.focusedNode(),o=ct.use.moveToSelectedNode(),s=Ye.use.showPropertyPanel(),c=Ye.use.showNodeSearchBar(),u=Ye.use.showNodeLabel(),f=Ye.use.enableEdgeEvents(),h=Ye.use.enableNodeDrag(),m=Ye.use.showEdgeLabel();w.useEffect(()=>{t({...w1,enableEdgeEvents:f,renderEdgeLabels:m,renderLabels:u})},[u,f,m]);const g=w.useCallback(E=>{E===null?ct.getState().setFocusedNode(null):E.type==="nodes"&&ct.getState().setFocusedNode(E.id)},[]),y=w.useCallback(E=>{E===null?ct.getState().setSelectedNode(null):E.type==="nodes"&&ct.getState().setSelectedNode(E.id,!0)},[]),b=w.useMemo(()=>a??n,[a,n]),S=w.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return x.jsxs(v3,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[x.jsx(aU,{}),h&&x.jsx($U,{}),x.jsx(g5,{node:b,move:o}),x.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[x.jsx(GU,{}),c&&x.jsx(zU,{value:S,onFocus:g,onChange:y})]}),x.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[x.jsx(mU,{}),x.jsx(iU,{}),x.jsx(LF,{}),x.jsx(oU,{})]}),s&&x.jsx("div",{className:"absolute top-2 right-2",children:x.jsx(FU,{})})]})},LT=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{className:"relative w-full overflow-auto",children:x.jsx("table",{ref:n,className:Oe("w-full caption-bottom text-sm",e),...t})}));LT.displayName="Table";const zT=w.forwardRef(({className:e,...t},n)=>x.jsx("thead",{ref:n,className:Oe("[&_tr]:border-b",e),...t}));zT.displayName="TableHeader";const MT=w.forwardRef(({className:e,...t},n)=>x.jsx("tbody",{ref:n,className:Oe("[&_tr:last-child]:border-0",e),...t}));MT.displayName="TableBody";const qU=w.forwardRef(({className:e,...t},n)=>x.jsx("tfoot",{ref:n,className:Oe("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));qU.displayName="TableFooter";const Pm=w.forwardRef(({className:e,...t},n)=>x.jsx("tr",{ref:n,className:Oe("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));Pm.displayName="TableRow";const Jr=w.forwardRef(({className:e,...t},n)=>x.jsx("th",{ref:n,className:Oe("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Jr.displayName="TableHead";const ea=w.forwardRef(({className:e,...t},n)=>x.jsx("td",{ref:n,className:Oe("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));ea.displayName="TableCell";const YU=w.forwardRef(({className:e,...t},n)=>x.jsx("caption",{ref:n,className:Oe("text-muted-foreground mt-4 text-sm",e),...t}));YU.displayName="TableCaption";const hl=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("bg-card text-card-foreground rounded-xl border shadow",e),...t}));hl.displayName="Card";const Gu=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("flex flex-col space-y-1.5 p-6",e),...t}));Gu.displayName="CardHeader";const pl=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("leading-none font-semibold tracking-tight",e),...t}));pl.displayName="CardTitle";const Sd=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("text-muted-foreground text-sm",e),...t}));Sd.displayName="CardDescription";const Fu=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("p-6 pt-0",e),...t}));Fu.displayName="CardContent";const WU=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("flex items-center p-6 pt-0",e),...t}));WU.displayName="CardFooter";function XU({title:e,description:t,icon:n=GO,action:a,className:o,...s}){return x.jsxs(hl,{className:Oe("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",o),...s,children:[x.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:x.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),x.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[x.jsx(pl,{children:e}),t?x.jsx(Sd,{children:t}):null]}),a||null]})}var Wp={exports:{}},Xp,E1;function KU(){if(E1)return Xp;E1=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Xp=e,Xp}var Kp,S1;function ZU(){if(S1)return Kp;S1=1;var e=KU();function t(){}function n(){}return n.resetWarningCache=t,Kp=function(){function a(c,u,f,h,m,g){if(g!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}a.isRequired=a;function o(){return a}var s={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:o,element:a,elementType:a,instanceOf:o,node:a,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Kp}var _1;function QU(){return _1||(_1=1,Wp.exports=ZU()()),Wp.exports}var JU=QU();const gt=dn(JU),eB=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Po(e,t,n){const a=tB(e),{webkitRelativePath:o}=e,s=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof a.path!="string"&&C1(a,"path",s),C1(a,"relativePath",s),a}function tB(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const a=t.split(".").pop().toLowerCase(),o=eB.get(a);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function C1(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const nB=[".DS_Store","Thumbs.db"];function rB(e){return Oi(this,void 0,void 0,function*(){return Uu(e)&&aB(e.dataTransfer)?lB(e.dataTransfer,e.type):iB(e)?oB(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?sB(e):[]})}function aB(e){return Uu(e)}function iB(e){return Uu(e)&&Uu(e.target)}function Uu(e){return typeof e=="object"&&e!==null}function oB(e){return Gm(e.target.files).map(t=>Po(t))}function sB(e){return Oi(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Po(n))})}function lB(e,t){return Oi(this,void 0,void 0,function*(){if(e.items){const n=Gm(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const a=yield Promise.all(n.map(cB));return T1(PT(a))}return T1(Gm(e.files).map(n=>Po(n)))})}function T1(e){return e.filter(t=>nB.indexOf(t.name)===-1)}function Gm(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const a=e[n];t.push(a)}return t}function cB(e){if(typeof e.webkitGetAsEntry!="function")return R1(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?GT(t):R1(e,t)}function PT(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?PT(n):[n]],[])}function R1(e,t){return Oi(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const c=yield s.getFile();return c.handle=s,Po(c)}}const a=e.getAsFile();if(!a)throw new Error(`${e} is not a File`);return Po(a,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function uB(e){return Oi(this,void 0,void 0,function*(){return e.isDirectory?GT(e):dB(e)})}function GT(e){const t=e.createReader();return new Promise((n,a)=>{const o=[];function s(){t.readEntries(c=>Oi(this,void 0,void 0,function*(){if(c.length){const u=Promise.all(c.map(uB));o.push(u),s()}else try{const u=yield Promise.all(o);n(u)}catch(u){a(u)}}),c=>{a(c)})}s()})}function dB(e){return Oi(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(a=>{const o=Po(a,e.fullPath);t(o)},a=>{n(a)})})})}var su={},A1;function fB(){return A1||(A1=1,su.__esModule=!0,su.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var a=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(c){var u=c.trim().toLowerCase();return u.charAt(0)==="."?a.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):o===u})}return!0}),su}var hB=fB();const Zp=dn(hB);function D1(e){return gB(e)||mB(e)||UT(e)||pB()}function pB(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mB(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gB(e){if(Array.isArray(e))return Fm(e)}function k1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function N1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k1(Object(n),!0).forEach(function(a){FT(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k1(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function FT(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ml(e,t){return bB(e)||yB(e,t)||UT(e,t)||vB()}function vB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UT(e,t){if(e){if(typeof e=="string")return Fm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fm(e,t)}}function Fm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function yB(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return a}}function bB(e){if(Array.isArray(e))return e}var xB=typeof Zp=="function"?Zp:Zp.default,wB="file-invalid-type",EB="file-too-large",SB="file-too-small",_B="too-many-files",CB=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),a=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:wB,message:"File type must be ".concat(a)}},O1=function(t){return{code:EB,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},j1=function(t){return{code:SB,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},TB={code:_B,message:"Too many files"};function BT(e,t){var n=e.type==="application/x-moz-file"||xB(e,t);return[n,n?null:CB(t)]}function IT(e,t,n){if(wi(e.size))if(wi(t)&&wi(n)){if(e.size>n)return[!1,O1(n)];if(e.size<t)return[!1,j1(t)]}else{if(wi(t)&&e.size<t)return[!1,j1(t)];if(wi(n)&&e.size>n)return[!1,O1(n)]}return[!0,null]}function wi(e){return e!=null}function RB(e){var t=e.files,n=e.accept,a=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var h=BT(f,n),m=ml(h,1),g=m[0],y=IT(f,a,o),b=ml(y,1),S=b[0],E=u?u(f):null;return g&&S&&!E})}function Bu(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function lu(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function L1(e){e.preventDefault()}function AB(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function DB(e){return e.indexOf("Edge/")!==-1}function kB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return AB(e)||DB(e)}function xr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(a){for(var o=arguments.length,s=new Array(o>1?o-1:0),c=1;c<o;c++)s[c-1]=arguments[c];return t.some(function(u){return!Bu(a)&&u&&u.apply(void 0,[a].concat(s)),Bu(a)})}}function NB(){return"showOpenFilePicker"in window}function OB(e){if(wi(e)){var t=Object.entries(e).filter(function(n){var a=ml(n,2),o=a[0],s=a[1],c=!0;return HT(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),c=!1),(!Array.isArray(s)||!s.every($T))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,a){var o=ml(a,2),s=o[0],c=o[1];return N1(N1({},n),{},FT({},s,c))},{});return[{description:"Files",accept:t}]}return e}function jB(e){if(wi(e))return Object.entries(e).reduce(function(t,n){var a=ml(n,2),o=a[0],s=a[1];return[].concat(D1(t),[o],D1(s))},[]).filter(function(t){return HT(t)||$T(t)}).join(",")}function LB(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function zB(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function HT(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function $T(e){return/^.*\.[\w]+$/.test(e)}var MB=["children"],PB=["open"],GB=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],FB=["refKey","onChange","onClick"];function UB(e){return HB(e)||IB(e)||VT(e)||BB()}function BB(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IB(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function HB(e){if(Array.isArray(e))return Um(e)}function Qp(e,t){return qB(e)||VB(e,t)||VT(e,t)||$B()}function $B(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VT(e,t){if(e){if(typeof e=="string")return Um(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Um(e,t)}}function Um(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function VB(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return a}}function qB(e){if(Array.isArray(e))return e}function z1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function _t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z1(Object(n),!0).forEach(function(a){Bm(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z1(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function Bm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iu(e,t){if(e==null)return{};var n=YB(e,t),a,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)a=s[o],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function YB(e,t){if(e==null)return{};var n={},a=Object.keys(e),o,s;for(s=0;s<a.length;s++)o=a[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var _d=w.forwardRef(function(e,t){var n=e.children,a=Iu(e,MB),o=WB(a),s=o.open,c=Iu(o,PB);return w.useImperativeHandle(t,function(){return{open:s}},[s]),ve.createElement(w.Fragment,null,n(_t(_t({},c),{},{open:s})))});_d.displayName="Dropzone";var qT={disabled:!1,getFilesFromEvent:rB,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};_d.defaultProps=qT;_d.propTypes={children:gt.func,accept:gt.objectOf(gt.arrayOf(gt.string)),multiple:gt.bool,preventDropOnDocument:gt.bool,noClick:gt.bool,noKeyboard:gt.bool,noDrag:gt.bool,noDragEventsBubbling:gt.bool,minSize:gt.number,maxSize:gt.number,maxFiles:gt.number,disabled:gt.bool,getFilesFromEvent:gt.func,onFileDialogCancel:gt.func,onFileDialogOpen:gt.func,useFsAccessApi:gt.bool,autoFocus:gt.bool,onDragEnter:gt.func,onDragLeave:gt.func,onDragOver:gt.func,onDrop:gt.func,onDropAccepted:gt.func,onDropRejected:gt.func,onError:gt.func,validator:gt.func};var Im={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function WB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_t(_t({},qT),e),n=t.accept,a=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,h=t.onDragEnter,m=t.onDragLeave,g=t.onDragOver,y=t.onDrop,b=t.onDropAccepted,S=t.onDropRejected,E=t.onFileDialogCancel,_=t.onFileDialogOpen,N=t.useFsAccessApi,C=t.autoFocus,A=t.preventDropOnDocument,k=t.noClick,D=t.noKeyboard,M=t.noDrag,R=t.noDragEventsBubbling,U=t.onError,L=t.validator,I=w.useMemo(function(){return jB(n)},[n]),q=w.useMemo(function(){return OB(n)},[n]),Y=w.useMemo(function(){return typeof _=="function"?_:M1},[_]),B=w.useMemo(function(){return typeof E=="function"?E:M1},[E]),X=w.useRef(null),ne=w.useRef(null),F=w.useReducer(XB,Im),z=Qp(F,2),j=z[0],K=z[1],G=j.isFocused,H=j.isFileDialogActive,O=w.useRef(typeof window<"u"&&window.isSecureContext&&N&&NB()),$=function(){!O.current&&H&&setTimeout(function(){if(ne.current){var Ae=ne.current.files;Ae.length||(K({type:"closeDialog"}),B())}},300)};w.useEffect(function(){return window.addEventListener("focus",$,!1),function(){window.removeEventListener("focus",$,!1)}},[ne,H,B,O]);var W=w.useRef([]),re=function(Ae){X.current&&X.current.contains(Ae.target)||(Ae.preventDefault(),W.current=[])};w.useEffect(function(){return A&&(document.addEventListener("dragover",L1,!1),document.addEventListener("drop",re,!1)),function(){A&&(document.removeEventListener("dragover",L1),document.removeEventListener("drop",re))}},[X,A]),w.useEffect(function(){return!a&&C&&X.current&&X.current.focus(),function(){}},[X,C,a]);var de=w.useCallback(function(me){U?U(me):console.error(me)},[U]),ie=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me),W.current=[].concat(UB(W.current),[me.target]),lu(me)&&Promise.resolve(o(me)).then(function(Ae){if(!(Bu(me)&&!R)){var je=Ae.length,He=je>0&&RB({files:Ae,accept:I,minSize:c,maxSize:s,multiple:u,maxFiles:f,validator:L}),it=je>0&&!He;K({isDragAccept:He,isDragReject:it,isDragActive:!0,type:"setDraggedFiles"}),h&&h(me)}}).catch(function(Ae){return de(Ae)})},[o,h,de,R,I,c,s,u,f,L]),oe=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me);var Ae=lu(me);if(Ae&&me.dataTransfer)try{me.dataTransfer.dropEffect="copy"}catch{}return Ae&&g&&g(me),!1},[g,R]),Ce=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me);var Ae=W.current.filter(function(He){return X.current&&X.current.contains(He)}),je=Ae.indexOf(me.target);je!==-1&&Ae.splice(je,1),W.current=Ae,!(Ae.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),lu(me)&&m&&m(me))},[X,m,R]),he=w.useCallback(function(me,Ae){var je=[],He=[];me.forEach(function(it){var Ct=BT(it,I),bt=Qp(Ct,2),qt=bt[0],fn=bt[1],Gt=IT(it,c,s),at=Qp(Gt,2),Tn=at[0],xt=at[1],Lt=L?L(it):null;if(qt&&Tn&&!Lt)je.push(it);else{var Wa=[fn,xt];Lt&&(Wa=Wa.concat(Lt)),He.push({file:it,errors:Wa.filter(function(ji){return ji})})}}),(!u&&je.length>1||u&&f>=1&&je.length>f)&&(je.forEach(function(it){He.push({file:it,errors:[TB]})}),je.splice(0)),K({acceptedFiles:je,fileRejections:He,isDragReject:He.length>0,type:"setFiles"}),y&&y(je,He,Ae),He.length>0&&S&&S(He,Ae),je.length>0&&b&&b(je,Ae)},[K,u,I,c,s,f,y,b,S,L]),Se=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me),W.current=[],lu(me)&&Promise.resolve(o(me)).then(function(Ae){Bu(me)&&!R||he(Ae,me)}).catch(function(Ae){return de(Ae)}),K({type:"reset"})},[o,he,de,R]),be=w.useCallback(function(){if(O.current){K({type:"openDialog"}),Y();var me={multiple:u,types:q};window.showOpenFilePicker(me).then(function(Ae){return o(Ae)}).then(function(Ae){he(Ae,null),K({type:"closeDialog"})}).catch(function(Ae){LB(Ae)?(B(Ae),K({type:"closeDialog"})):zB(Ae)?(O.current=!1,ne.current?(ne.current.value=null,ne.current.click()):de(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):de(Ae)});return}ne.current&&(K({type:"openDialog"}),Y(),ne.current.value=null,ne.current.click())},[K,Y,B,N,he,de,q,u]),Le=w.useCallback(function(me){!X.current||!X.current.isEqualNode(me.target)||(me.key===" "||me.key==="Enter"||me.keyCode===32||me.keyCode===13)&&(me.preventDefault(),be())},[X,be]),Te=w.useCallback(function(){K({type:"focus"})},[]),ye=w.useCallback(function(){K({type:"blur"})},[]),J=w.useCallback(function(){k||(kB()?setTimeout(be,0):be())},[k,be]),le=function(Ae){return a?null:Ae},_e=function(Ae){return D?null:le(Ae)},pe=function(Ae){return M?null:le(Ae)},Ee=function(Ae){R&&Ae.stopPropagation()},te=w.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ae=me.refKey,je=Ae===void 0?"ref":Ae,He=me.role,it=me.onKeyDown,Ct=me.onFocus,bt=me.onBlur,qt=me.onClick,fn=me.onDragEnter,Gt=me.onDragOver,at=me.onDragLeave,Tn=me.onDrop,xt=Iu(me,GB);return _t(_t(Bm({onKeyDown:_e(xr(it,Le)),onFocus:_e(xr(Ct,Te)),onBlur:_e(xr(bt,ye)),onClick:le(xr(qt,J)),onDragEnter:pe(xr(fn,ie)),onDragOver:pe(xr(Gt,oe)),onDragLeave:pe(xr(at,Ce)),onDrop:pe(xr(Tn,Se)),role:typeof He=="string"&&He!==""?He:"presentation"},je,X),!a&&!D?{tabIndex:0}:{}),xt)}},[X,Le,Te,ye,J,ie,oe,Ce,Se,D,M,a]),Fe=w.useCallback(function(me){me.stopPropagation()},[]),Pe=w.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ae=me.refKey,je=Ae===void 0?"ref":Ae,He=me.onChange,it=me.onClick,Ct=Iu(me,FB),bt=Bm({accept:I,multiple:u,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:le(xr(He,Se)),onClick:le(xr(it,Fe)),tabIndex:-1},je,ne);return _t(_t({},bt),Ct)}},[ne,n,u,Se,a]);return _t(_t({},j),{},{isFocused:G&&!a,getRootProps:te,getInputProps:Pe,rootRef:X,inputRef:ne,open:le(be)})}function XB(e,t){switch(t.type){case"focus":return _t(_t({},e),{},{isFocused:!0});case"blur":return _t(_t({},e),{},{isFocused:!1});case"openDialog":return _t(_t({},Im),{},{isFileDialogActive:!0});case"closeDialog":return _t(_t({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _t(_t({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _t(_t({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return _t({},Im);default:return e}}function M1(){}var lv="Progress",cv=100,[KB,X6]=Kn(lv),[ZB,QB]=KB(lv),YT=w.forwardRef((e,t)=>{const{__scopeProgress:n,value:a=null,max:o,getValueLabel:s=JB,...c}=e;(o||o===0)&&!P1(o)&&console.error(eI(`${o}`,"Progress"));const u=P1(o)?o:cv;a!==null&&!G1(a,u)&&console.error(tI(`${a}`,"Progress"));const f=G1(a,u)?a:null,h=Hu(f)?s(f,u):void 0;return x.jsx(ZB,{scope:n,value:f,max:u,children:x.jsx(Ie.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Hu(f)?f:void 0,"aria-valuetext":h,role:"progressbar","data-state":KT(f,u),"data-value":f??void 0,"data-max":u,...c,ref:t})})});YT.displayName=lv;var WT="ProgressIndicator",XT=w.forwardRef((e,t)=>{const{__scopeProgress:n,...a}=e,o=QB(WT,n);return x.jsx(Ie.div,{"data-state":KT(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...a,ref:t})});XT.displayName=WT;function JB(e,t){return`${Math.round(e/t*100)}%`}function KT(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Hu(e){return typeof e=="number"}function P1(e){return Hu(e)&&!isNaN(e)&&e>0}function G1(e,t){return Hu(e)&&!isNaN(e)&&e<=t&&e>=0}function eI(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${cv}\`.`}function tI(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or ${cv} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`}var ZT=YT,nI=XT;const QT=w.forwardRef(({className:e,value:t,...n},a)=>x.jsx(ZT,{ref:a,className:Oe("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:x.jsx(nI,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));QT.displayName=ZT.displayName;function Hm(e,[t,n]){return Math.min(n,Math.max(t,e))}function rI(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var uv="ScrollArea",[JT,K6]=Kn(uv),[aI,Qn]=JT(uv),eR=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:a="hover",dir:o,scrollHideDelay:s=600,...c}=e,[u,f]=w.useState(null),[h,m]=w.useState(null),[g,y]=w.useState(null),[b,S]=w.useState(null),[E,_]=w.useState(null),[N,C]=w.useState(0),[A,k]=w.useState(0),[D,M]=w.useState(!1),[R,U]=w.useState(!1),L=nt(t,q=>f(q)),I=gd(o);return x.jsx(aI,{scope:n,type:a,dir:I,scrollHideDelay:s,scrollArea:u,viewport:h,onViewportChange:m,content:g,onContentChange:y,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:D,onScrollbarXEnabledChange:M,scrollbarY:E,onScrollbarYChange:_,scrollbarYEnabled:R,onScrollbarYEnabledChange:U,onCornerWidthChange:C,onCornerHeightChange:k,children:x.jsx(Ie.div,{dir:I,...c,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":A+"px",...e.style}})})});eR.displayName=uv;var tR="ScrollAreaViewport",nR=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:a,nonce:o,...s}=e,c=Qn(tR,n),u=w.useRef(null),f=nt(t,u,c.onViewportChange);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),x.jsx(Ie.div,{"data-radix-scroll-area-viewport":"",...s,ref:f,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:x.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});nR.displayName=tR;var kr="ScrollAreaScrollbar",dv=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Qn(kr,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=o,u=e.orientation==="horizontal";return w.useEffect(()=>(u?s(!0):c(!0),()=>{u?s(!1):c(!1)}),[u,s,c]),o.type==="hover"?x.jsx(iI,{...a,ref:t,forceMount:n}):o.type==="scroll"?x.jsx(oI,{...a,ref:t,forceMount:n}):o.type==="auto"?x.jsx(rR,{...a,ref:t,forceMount:n}):o.type==="always"?x.jsx(fv,{...a,ref:t}):null});dv.displayName=kr;var iI=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Qn(kr,e.__scopeScrollArea),[s,c]=w.useState(!1);return w.useEffect(()=>{const u=o.scrollArea;let f=0;if(u){const h=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return u.addEventListener("pointerenter",h),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",h),u.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),x.jsx(zn,{present:n||s,children:x.jsx(rR,{"data-state":s?"visible":"hidden",...a,ref:t})})}),oI=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Qn(kr,e.__scopeScrollArea),s=e.orientation==="horizontal",c=Td(()=>f("SCROLL_END"),100),[u,f]=rI("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(u==="idle"){const h=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(h)}},[u,o.scrollHideDelay,f]),w.useEffect(()=>{const h=o.viewport,m=s?"scrollLeft":"scrollTop";if(h){let g=h[m];const y=()=>{const b=h[m];g!==b&&(f("SCROLL"),c()),g=b};return h.addEventListener("scroll",y),()=>h.removeEventListener("scroll",y)}},[o.viewport,s,f,c]),x.jsx(zn,{present:n||u!=="hidden",children:x.jsx(fv,{"data-state":u==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:Be(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Be(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),rR=w.forwardRef((e,t)=>{const n=Qn(kr,e.__scopeScrollArea),{forceMount:a,...o}=e,[s,c]=w.useState(!1),u=e.orientation==="horizontal",f=Td(()=>{if(n.viewport){const h=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(u?h:m)}},10);return Go(n.viewport,f),Go(n.content,f),x.jsx(zn,{present:a||s,children:x.jsx(fv,{"data-state":s?"visible":"hidden",...o,ref:t})})}),fv=w.forwardRef((e,t)=>{const{orientation:n="vertical",...a}=e,o=Qn(kr,e.__scopeScrollArea),s=w.useRef(null),c=w.useRef(0),[u,f]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=lR(u.viewport,u.content),m={...a,sizes:u,onSizesChange:f,hasThumb:h>0&&h<1,onThumbChange:y=>s.current=y,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:y=>c.current=y};function g(y,b){return fI(y,c.current,u,b)}return n==="horizontal"?x.jsx(sI,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const y=o.viewport.scrollLeft,b=F1(y,u,o.dir);s.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollLeft=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollLeft=g(y,o.dir))}}):n==="vertical"?x.jsx(lI,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const y=o.viewport.scrollTop,b=F1(y,u);s.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollTop=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollTop=g(y))}}):null}),sI=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...o}=e,s=Qn(kr,e.__scopeScrollArea),[c,u]=w.useState(),f=w.useRef(null),h=nt(t,f,s.onScrollbarXChange);return w.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),x.jsx(iR,{"data-orientation":"horizontal",...o,ref:h,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Cd(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,g)=>{if(s.viewport){const y=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(y),uR(y,g)&&m.preventDefault()}},onResize:()=>{f.current&&s.viewport&&c&&a({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Vu(c.paddingLeft),paddingEnd:Vu(c.paddingRight)}})}})}),lI=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...o}=e,s=Qn(kr,e.__scopeScrollArea),[c,u]=w.useState(),f=w.useRef(null),h=nt(t,f,s.onScrollbarYChange);return w.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),x.jsx(iR,{"data-orientation":"vertical",...o,ref:h,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Cd(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,g)=>{if(s.viewport){const y=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(y),uR(y,g)&&m.preventDefault()}},onResize:()=>{f.current&&s.viewport&&c&&a({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Vu(c.paddingTop),paddingEnd:Vu(c.paddingBottom)}})}})}),[cI,aR]=JT(kr),iR=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:o,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:h,onWheelScroll:m,onResize:g,...y}=e,b=Qn(kr,n),[S,E]=w.useState(null),_=nt(t,L=>E(L)),N=w.useRef(null),C=w.useRef(""),A=b.viewport,k=a.content-a.viewport,D=Zt(m),M=Zt(f),R=Td(g,10);function U(L){if(N.current){const I=L.clientX-N.current.left,q=L.clientY-N.current.top;h({x:I,y:q})}}return w.useEffect(()=>{const L=I=>{const q=I.target;(S==null?void 0:S.contains(q))&&D(I,k)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[A,S,k,D]),w.useEffect(M,[a,M]),Go(S,R),Go(b.content,R),x.jsx(cI,{scope:n,scrollbar:S,hasThumb:o,onThumbChange:Zt(s),onThumbPointerUp:Zt(c),onThumbPositionChange:M,onThumbPointerDown:Zt(u),children:x.jsx(Ie.div,{...y,ref:_,style:{position:"absolute",...y.style},onPointerDown:Be(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),N.current=S.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),U(L))}),onPointerMove:Be(e.onPointerMove,U),onPointerUp:Be(e.onPointerUp,L=>{const I=L.target;I.hasPointerCapture(L.pointerId)&&I.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=C.current,b.viewport&&(b.viewport.style.scrollBehavior=""),N.current=null})})})}),$u="ScrollAreaThumb",oR=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=aR($u,e.__scopeScrollArea);return x.jsx(zn,{present:n||o.hasThumb,children:x.jsx(uI,{ref:t,...a})})}),uI=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:a,...o}=e,s=Qn($u,n),c=aR($u,n),{onThumbPositionChange:u}=c,f=nt(t,g=>c.onThumbChange(g)),h=w.useRef(void 0),m=Td(()=>{h.current&&(h.current(),h.current=void 0)},100);return w.useEffect(()=>{const g=s.viewport;if(g){const y=()=>{if(m(),!h.current){const b=hI(g,u);h.current=b,u()}};return u(),g.addEventListener("scroll",y),()=>g.removeEventListener("scroll",y)}},[s.viewport,m,u]),x.jsx(Ie.div,{"data-state":c.hasThumb?"visible":"hidden",...o,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Be(e.onPointerDownCapture,g=>{const b=g.target.getBoundingClientRect(),S=g.clientX-b.left,E=g.clientY-b.top;c.onThumbPointerDown({x:S,y:E})}),onPointerUp:Be(e.onPointerUp,c.onThumbPointerUp)})});oR.displayName=$u;var hv="ScrollAreaCorner",sR=w.forwardRef((e,t)=>{const n=Qn(hv,e.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?x.jsx(dI,{...e,ref:t}):null});sR.displayName=hv;var dI=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...a}=e,o=Qn(hv,n),[s,c]=w.useState(0),[u,f]=w.useState(0),h=!!(s&&u);return Go(o.scrollbarX,()=>{var g;const m=((g=o.scrollbarX)==null?void 0:g.offsetHeight)||0;o.onCornerHeightChange(m),f(m)}),Go(o.scrollbarY,()=>{var g;const m=((g=o.scrollbarY)==null?void 0:g.offsetWidth)||0;o.onCornerWidthChange(m),c(m)}),h?x.jsx(Ie.div,{...a,ref:t,style:{width:s,height:u,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Vu(e){return e?parseInt(e,10):0}function lR(e,t){const n=e/t;return isNaN(n)?0:n}function Cd(e){const t=lR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-n)*t;return Math.max(a,18)}function fI(e,t,n,a="ltr"){const o=Cd(n),s=o/2,c=t||s,u=o-c,f=n.scrollbar.paddingStart+c,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,g=a==="ltr"?[0,m]:[m*-1,0];return cR([f,h],g)(e)}function F1(e,t,n="ltr"){const a=Cd(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,c=t.content-t.viewport,u=s-a,f=n==="ltr"?[0,c]:[c*-1,0],h=Hm(e,f);return cR([0,c],[0,u])(h)}function cR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function uR(e,t){return e>0&&e<t}var hI=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},a=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},c=n.left!==s.left,u=n.top!==s.top;(c||u)&&t(),n=s,a=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(a)};function Td(e,t){const n=Zt(e),a=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(a.current),[]),w.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,t)},[n,t])}function Go(e,t){const n=Zt(t);sn(()=>{let a=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(a),o.unobserve(e)}}},[e,n])}var dR=eR,pI=nR,mI=sR;const fR=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(dR,{ref:a,className:Oe("relative overflow-hidden",e),...n,children:[x.jsx(pI,{className:"h-full w-full rounded-[inherit]",children:t}),x.jsx(hR,{}),x.jsx(mI,{})]}));fR.displayName=dR.displayName;const hR=w.forwardRef(({className:e,orientation:t="vertical",...n},a)=>x.jsx(dv,{ref:a,orientation:t,className:Oe("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:x.jsx(oR,{className:"bg-border relative flex-1 rounded-full"})}));hR.displayName=dv.displayName;function $m(e,t={}){const{decimals:n=0,sizeType:a="normal"}=t,o=["Bytes","KB","MB","GB","TB"],s=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const c=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,c)).toFixed(n)} ${a==="accurate"?s[c]??"Bytes":o[c]??"Bytes"}`}function gI(e){const{value:t,onValueChange:n,onUpload:a,progresses:o,accept:s=jk,maxSize:c=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:h=!1,description:m,className:g,...y}=e,[b,S]=aa({prop:t,onChange:n}),E=w.useCallback((C,A)=>{if(!f&&u===1&&C.length>1){an.error("Cannot upload more than 1 file at a time");return}if(((b==null?void 0:b.length)??0)+C.length>u){an.error(`Cannot upload more than ${u} files`);return}const k=C.map(M=>Object.assign(M,{preview:URL.createObjectURL(M)})),D=b?[...b,...k]:k;if(S(D),A.length>0&&A.forEach(({file:M})=>{an.error(`File ${M.name} was rejected`)}),a&&D.length>0&&D.length<=u){const M=D.length>0?`${D.length} files`:"file";an.promise(a(D),{loading:`Uploading ${M}...`,success:()=>(S([]),`${M} uploaded`),error:`Failed to upload ${M}`})}},[b,u,f,a,S]);function _(C){if(!b)return;const A=b.filter((k,D)=>D!==C);S(A),n==null||n(A)}w.useEffect(()=>()=>{b&&b.forEach(C=>{pR(C)&&URL.revokeObjectURL(C.preview)})},[]);const N=h||((b==null?void 0:b.length)??0)>=u;return x.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[x.jsx(_d,{onDrop:E,accept:s,maxSize:c,maxFiles:u,multiple:u>1||f,disabled:N,children:({getRootProps:C,getInputProps:A,isDragActive:k})=>x.jsxs("div",{...C(),className:Oe("group border-muted-foreground/25 hover:bg-muted/25 relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition","ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",k&&"border-muted-foreground/50",N&&"pointer-events-none opacity-60",g),...y,children:[x.jsx("input",{...A()}),k?x.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[x.jsx("div",{className:"rounded-full border border-dashed p-3",children:x.jsx(um,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),x.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):x.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[x.jsx("div",{className:"rounded-full border border-dashed p-3",children:x.jsx(um,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),x.jsxs("div",{className:"flex flex-col gap-px",children:[x.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),m?x.jsx("p",{className:"text-muted-foreground/70 text-sm",children:m}):x.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u}
files (up to ${$m(c)} each)`:` a file with ${$m(c)}`,"Supported formats: TXT, MD, DOC, PDF, PPTX"]})]})]})]})}),b!=null&&b.length?x.jsx(fR,{className:"h-fit w-full px-3",children:x.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:b==null?void 0:b.map((C,A)=>x.jsx(vI,{file:C,onRemove:()=>_(A),progress:o==null?void 0:o[C.name]},A))})}):null]})}function vI({file:e,progress:t,onRemove:n}){return x.jsxs("div",{className:"relative flex items-center gap-2.5",children:[x.jsxs("div",{className:"flex flex-1 gap-2.5",children:[pR(e)?x.jsx(yI,{file:e}):null,x.jsxs("div",{className:"flex w-full flex-col gap-2",children:[x.jsxs("div",{className:"flex flex-col gap-px",children:[x.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),x.jsx("p",{className:"text-muted-foreground text-xs",children:$m(e.size)})]}),t?x.jsx(QT,{value:t}):null]})]}),x.jsx("div",{className:"flex items-center gap-2",children:x.jsxs(wt,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[x.jsx(IE,{className:"size-4","aria-hidden":"true"}),x.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function pR(e){return"preview"in e&&typeof e.preview=="string"}function yI({file:e}){return e.type.startsWith("image/")?x.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):x.jsx(MO,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function bI(){const[e,t]=w.useState(!1),[n,a]=w.useState(!1),[o,s]=w.useState({}),c=w.useCallback(async u=>{a(!0);try{await Promise.all(u.map(async f=>{try{const h=await wO(f,m=>{console.debug(`Uploading ${f.name}: ${m}%`),s(g=>({...g,[f.name]:m}))});h.status==="success"?an.success(`Upload Success:
${f.name} uploaded successfully`):an.error(`Upload Failed:
${f.name}
${h.message}`)}catch(h){an.error(`Upload Failed:
${f.name}
${Sr(h)}`)}}))}catch(f){an.error(`Upload Failed
`+Sr(f))}finally{a(!1)}},[a,s]);return x.jsxs(mT,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[x.jsx(gT,{asChild:!0,children:x.jsxs(wt,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[x.jsx(um,{})," Upload"]})}),x.jsxs(Qg,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[x.jsxs(Jg,{children:[x.jsx(ev,{children:"Upload documents"}),x.jsx(tv,{children:"Drag and drop your documents here or click to browse."})]}),x.jsx(gI,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOC, PDF, PPTX",onUpload:c,progresses:o,disabled:n})]})]})}function xI(){const[e,t]=w.useState(!1),n=w.useCallback(async()=>{try{const a=await EO();a.status==="success"?(an.success("Documents cleared successfully"),t(!1)):an.error(`Clear Documents Failed:
${a.message}`)}catch(a){an.error(`Clear Documents Failed:
`+Sr(a))}},[t]);return x.jsxs(mT,{open:e,onOpenChange:t,children:[x.jsx(gT,{asChild:!0,children:x.jsxs(wt,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[x.jsx(UE,{})," Clear"]})}),x.jsxs(Qg,{className:"sm:max-w-xl",onCloseAutoFocus:a=>a.preventDefault(),children:[x.jsxs(Jg,{children:[x.jsx(ev,{children:"Clear documents"}),x.jsx(tv,{children:"Do you really want to clear all documents?"})]}),x.jsx(wt,{variant:"destructive",onClick:n,children:"YES"})]})]})}function wI(){const e=En.use.health(),[t,n]=w.useState(null),a=w.useCallback(async()=>{try{const s=await vO();s&&s.statuses?n(s):n(null)}catch(s){an.error(`Failed to load documents
`+Sr(s))}},[n]);w.useEffect(()=>{a()},[]);const o=w.useCallback(async()=>{try{const{status:s}=await yO();an.message(s)}catch(s){an.error(`Failed to load documents
`+Sr(s))}},[]);return w.useEffect(()=>{const s=setInterval(async()=>{if(e)try{await a()}catch(c){an.error(`Failed to get scan progress
`+Sr(c))}},5e3);return()=>clearInterval(s)},[e,a]),x.jsxs(hl,{className:"!size-full !rounded-none !border-none",children:[x.jsx(Gu,{children:x.jsx(pl,{className:"text-lg",children:"Document Management"})}),x.jsxs(Fu,{className:"space-y-4",children:[x.jsxs("div",{className:"flex gap-2",children:[x.jsxs(wt,{variant:"outline",onClick:o,side:"bottom",tooltip:"Scan documents",size:"sm",children:[x.jsx(ij,{})," Scan"]}),x.jsx("div",{className:"flex-1"}),x.jsx(xI,{}),x.jsx(bI,{})]}),x.jsxs(hl,{children:[x.jsxs(Gu,{children:[x.jsx(pl,{children:"Uploaded documents"}),x.jsx(Sd,{children:"view the uploaded documents here"})]}),x.jsxs(Fu,{children:[!t&&x.jsx(XU,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&x.jsxs(LT,{children:[x.jsx(zT,{children:x.jsxs(Pm,{children:[x.jsx(Jr,{children:"ID"}),x.jsx(Jr,{children:"Summary"}),x.jsx(Jr,{children:"Status"}),x.jsx(Jr,{children:"Length"}),x.jsx(Jr,{children:"Chunks"}),x.jsx(Jr,{children:"Created"}),x.jsx(Jr,{children:"Updated"}),x.jsx(Jr,{children:"Metadata"})]})}),x.jsx(MT,{className:"text-sm",children:Object.entries(t.statuses).map(([s,c])=>c.map(u=>x.jsxs(Pm,{children:[x.jsx(ea,{className:"truncate font-mono",children:u.id}),x.jsx(ea,{className:"max-w-xs min-w-24 truncate",children:x.jsx(bn,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),x.jsxs(ea,{children:[s==="processed"&&x.jsx("span",{className:"text-green-600",children:"Completed"}),s==="processing"&&x.jsx("span",{className:"text-blue-600",children:"Processing"}),s==="pending"&&x.jsx("span",{className:"text-yellow-600",children:"Pending"}),s==="failed"&&x.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&x.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),x.jsx(ea,{children:u.content_length??"-"}),x.jsx(ea,{children:u.chunks_count??"-"}),x.jsx(ea,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),x.jsx(ea,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),x.jsx(ea,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function mR(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n}var gl;(function(e){e.event="event",e.props="prop"})(gl||(gl={}));function Pa(){}function EI(e){var t,n=void 0;return function(){for(var a=[],o=arguments.length;o--;)a[o]=arguments[o];return t&&a.length===t.length&&a.every(function(s,c){return s===t[c]})||(t=a,n=e.apply(void 0,a)),n}}function vl(e){return!!(e||"").match(/\d/)}function No(e){return e==null}function SI(e){return typeof e=="number"&&isNaN(e)}function gR(e){return No(e)||SI(e)||typeof e=="number"&&!isFinite(e)}function vR(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function _I(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function CI(e,t,n){var a=_I(n),o=e.search(/[1-9]/);return o=o===-1?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(a,"$1"+t)}function TI(e){var t=w.useRef(e);t.current=e;var n=w.useRef(function(){for(var a=[],o=arguments.length;o--;)a[o]=arguments[o];return t.current.apply(t,a)});return n.current}function pv(e,t){t===void 0&&(t=!0);var n=e[0]==="-",a=n&&t;e=e.replace("-","");var o=e.split("."),s=o[0],c=o[1]||"";return{beforeDecimal:s,afterDecimal:c,hasNegation:n,addNegation:a}}function RI(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),a=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return(t?"-":"")+a+(o?"."+o:"")}function yR(e,t,n){for(var a="",o=n?"0":"",s=0;s<=t-1;s++)a+=e[s]||o;return a}function U1(e,t){return Array(t+1).join(e)}function bR(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var a=t.split(/[eE]/g),o=a[0],s=a[1];if(s=Number(s),!s)return n+o;o=o.replace(".","");var c=1+s,u=o.length;return c<0?o="0."+U1("0",Math.abs(c))+o:c>=u?o=o+U1("0",c-u):o=(o.substring(0,c)||"0")+"."+o.substring(c),n+o}function B1(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var a=(e.indexOf(".")!==-1||n)&&t,o=pv(e),s=o.beforeDecimal,c=o.afterDecimal,u=o.hasNegation,f=parseFloat("0."+(c||"0")),h=c.length<=t?"0."+c:f.toFixed(t),m=h.split("."),g=s;s&&Number(m[0])&&(g=s.split("").reverse().reduce(function(E,_,N){return E.length>N?(Number(E[0])+Number(_)).toString()+E.substring(1,E.length):_+E},m[0]));var y=yR(m[1]||"",t,n),b=u?"-":"",S=a?".":"";return""+b+g+S+y}function Ei(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var xR=EI(function(e,t){for(var n=0,a=0,o=e.length,s=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-a]===t[s-1-a]&&s-a>n&&o-a>n;)a++;return{from:{start:n,end:o-a},to:{start:n,end:s-a}}}),AI=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function DI(e,t,n){return Math.min(Math.max(e,t),n)}function Jp(e){return Math.max(e.selectionStart,e.selectionEnd)}function kI(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function NI(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function OI(e){var t=e.currentValue,n=e.formattedValue,a=e.currentValueIndex,o=e.formattedValueIndex;return t[a]===n[o]}function jI(e,t,n,a,o,s,c){c===void 0&&(c=OI);var u=o.findIndex(function(k){return k}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,a=a+f.length);for(var h=n.length,m=e.length,g={},y=new Array(h),b=0;b<h;b++){y[b]=-1;for(var S=0,E=m;S<E;S++){var _=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:S});if(_&&g[S]!==!0){y[b]=S,g[S]=!0;break}}}for(var N=a;N<h&&(y[N]===-1||!s(n[N]));)N++;var C=N===h||y[N]===-1?m:y[N];for(N=a-1;N>0&&y[N]===-1;)N--;var A=N===-1||y[N]===-1?0:y[N]+1;return A>C?C:a-A<C-a?A:C}function I1(e,t,n,a){var o=e.length;if(t=DI(t,0,o),a==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=o&&!n[t];)t++;t>o&&(t=n.lastIndexOf(!0))}return t===-1&&(t=o),t}function LI(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,a=t.length;n<a;n++)t[n]=!!(vl(e[n])||vl(e[n-1]));return t}function wR(e,t,n,a,o,s){s===void 0&&(s=Pa);var c=TI(function(S,E){var _,N;return gR(S)?(N="",_=""):typeof S=="number"||E?(N=typeof S=="number"?bR(S):S,_=a(N)):(N=o(S,void 0),_=a(N)),{formattedValue:_,numAsString:N}}),u=w.useState(function(){return c(No(e)?t:e,n)}),f=u[0],h=u[1],m=function(S,E){S.formattedValue!==f.formattedValue&&h({formattedValue:S.formattedValue,numAsString:S.value}),s(S,E)},g=e,y=n;No(e)&&(g=f.numAsString,y=!0);var b=c(g,y);return w.useMemo(function(){h(b)},[b.formattedValue]),[f,m]}function zI(e){return e.replace(/[^0-9]/g,"")}function MI(e){return e}function PI(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var a=e.customInput,o=e.renderText,s=e.getInputRef,c=e.format;c===void 0&&(c=MI);var u=e.removeFormatting;u===void 0&&(u=zI);var f=e.defaultValue,h=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,y=e.onChange;y===void 0&&(y=Pa);var b=e.onKeyDown;b===void 0&&(b=Pa);var S=e.onMouseUp;S===void 0&&(S=Pa);var E=e.onFocus;E===void 0&&(E=Pa);var _=e.onBlur;_===void 0&&(_=Pa);var N=e.value,C=e.getCaretBoundary;C===void 0&&(C=LI);var A=e.isValidInputCharacter;A===void 0&&(A=vl);var k=e.isCharacterSame,D=mR(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),M=wR(N,f,!!h,c,u,m),R=M[0],U=R.formattedValue,L=R.numAsString,I=M[1],q=w.useRef(),Y=w.useRef({formattedValue:U,numAsString:L}),B=function(le,_e){Y.current={formattedValue:le.formattedValue,numAsString:le.value},I(le,_e)},X=w.useState(!1),ne=X[0],F=X[1],z=w.useRef(null),j=w.useRef({setCaretTimeout:null,focusTimeout:null});w.useEffect(function(){return F(!0),function(){clearTimeout(j.current.setCaretTimeout),clearTimeout(j.current.focusTimeout)}},[]);var K=c,G=function(le,_e){var pe=parseFloat(_e);return{formattedValue:le,value:_e,floatValue:isNaN(pe)?void 0:pe}},H=function(le,_e,pe){le.selectionStart===0&&le.selectionEnd===le.value.length||(Ei(le,_e),j.current.setCaretTimeout=setTimeout(function(){le.value===pe&&le.selectionStart!==_e&&Ei(le,_e)},0))},O=function(le,_e,pe){return I1(le,_e,C(le),pe)},$=function(le,_e,pe){var Ee=C(_e),te=jI(_e,U,le,pe,Ee,A,k);return te=I1(_e,te,Ee),te},W=function(le){var _e=le.formattedValue;_e===void 0&&(_e="");var pe=le.input,Ee=le.source,te=le.event,Fe=le.numAsString,Pe;if(pe){var me=le.inputValue||pe.value,Ae=Jp(pe);pe.value=_e,Pe=$(me,_e,Ae),Pe!==void 0&&H(pe,Pe,_e)}_e!==U&&B(G(_e,Fe),{event:te,source:Ee})};w.useEffect(function(){var le=Y.current,_e=le.formattedValue,pe=le.numAsString;(U!==_e||L!==pe)&&B(G(U,L),{event:void 0,source:gl.props})},[U,L]);var re=z.current?Jp(z.current):void 0,de=typeof window<"u"?w.useLayoutEffect:w.useEffect;de(function(){var le=z.current;if(U!==Y.current.formattedValue&&le){var _e=$(Y.current.formattedValue,U,re);le.value=U,H(le,_e,U)}},[U]);var ie=function(le,_e,pe){var Ee=_e.target,te=q.current?AI(q.current,Ee.selectionEnd):xR(U,le),Fe=Object.assign(Object.assign({},te),{lastValue:U}),Pe=u(le,Fe),me=K(Pe);if(Pe=u(me,void 0),g&&!g(G(me,Pe))){var Ae=_e.target,je=Jp(Ae),He=$(le,U,je);return Ae.value=U,H(Ae,He,U),!1}return W({formattedValue:me,numAsString:Pe,inputValue:le,event:_e,source:pe,input:_e.target}),!0},oe=function(le,_e){_e===void 0&&(_e=0);var pe=le.selectionStart,Ee=le.selectionEnd;q.current={selectionStart:pe,selectionEnd:Ee+_e}},Ce=function(le){var _e=le.target,pe=_e.value,Ee=ie(pe,le,gl.event);Ee&&y(le),q.current=void 0},he=function(le){var _e=le.target,pe=le.key,Ee=_e.selectionStart,te=_e.selectionEnd,Fe=_e.value;Fe===void 0&&(Fe="");var Pe;pe==="ArrowLeft"||pe==="Backspace"?Pe=Math.max(Ee-1,0):pe==="ArrowRight"?Pe=Math.min(Ee+1,Fe.length):pe==="Delete"&&(Pe=Ee);var me=0;pe==="Delete"&&Ee===te&&(me=1);var Ae=pe==="ArrowLeft"||pe==="ArrowRight";if(Pe===void 0||Ee!==te&&!Ae){b(le),oe(_e,me);return}var je=Pe;if(Ae){var He=pe==="ArrowLeft"?"left":"right";je=O(Fe,Pe,He),je!==Pe&&le.preventDefault()}else pe==="Delete"&&!A(Fe[Pe])?je=O(Fe,Pe,"right"):pe==="Backspace"&&!A(Fe[Pe])&&(je=O(Fe,Pe,"left"));je!==Pe&&H(_e,je,Fe),b(le),oe(_e,me)},Se=function(le){var _e=le.target,pe=function(){var Ee=_e.selectionStart,te=_e.selectionEnd,Fe=_e.value;if(Fe===void 0&&(Fe=""),Ee===te){var Pe=O(Fe,Ee);Pe!==Ee&&H(_e,Pe,Fe)}};pe(),requestAnimationFrame(function(){pe()}),S(le),oe(_e)},be=function(le){le.persist&&le.persist();var _e=le.target,pe=le.currentTarget;z.current=_e,j.current.focusTimeout=setTimeout(function(){var Ee=_e.selectionStart,te=_e.selectionEnd,Fe=_e.value;Fe===void 0&&(Fe="");var Pe=O(Fe,Ee);Pe!==Ee&&!(Ee===0&&te===Fe.length)&&H(_e,Pe,Fe),E(Object.assign(Object.assign({},le),{currentTarget:pe}))},0)},Le=function(le){z.current=null,clearTimeout(j.current.focusTimeout),clearTimeout(j.current.setCaretTimeout),_(le)},Te=ne&&kI()?"numeric":void 0,ye=Object.assign({inputMode:Te},D,{type:t,value:U,onChange:Ce,onKeyDown:he,onMouseUp:Se,onFocus:be,onBlur:Le});if(n==="text")return o?ve.createElement(ve.Fragment,null,o(U,D)||null):ve.createElement("span",Object.assign({},D,{ref:s}),U);if(a){var J=a;return ve.createElement(J,Object.assign({},ye,{ref:s}))}return ve.createElement("input",Object.assign({},ye,{ref:s}))}function H1(e,t){var n=t.decimalScale,a=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");var s=t.suffix;s===void 0&&(s="");var c=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var f=Rd(t),h=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&a,y=pv(e,c),b=y.beforeDecimal,S=y.afterDecimal,E=y.addNegation;return n!==void 0&&(S=yR(S,n,!!a)),h&&(b=CI(b,h,u)),o&&(b=o+b),s&&(S=S+s),E&&(b="-"+b),e=b+(g&&m||"")+S,e}function Rd(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,a=e.allowedDecimalSeparators;return n===!0&&(n=","),a||(a=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:a}}function GI(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),a=new RegExp("(-)(.)*(-)"),o=n.test(e),s=a.test(e);return e=e.replace(/-/g,""),o&&!s&&t&&(e="-"+e),e}function FI(e,t){return new RegExp("(^-)|[0-9]|"+vR(e),"g")}function UI(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function BI(e,t,n){var a;t===void 0&&(t=NI(e));var o=n.allowNegative,s=n.prefix;s===void 0&&(s="");var c=n.suffix;c===void 0&&(c="");var u=n.decimalScale,f=t.from,h=t.to,m=h.start,g=h.end,y=Rd(n),b=y.allowedDecimalSeparators,S=y.decimalSeparator,E=e[g]===S;if(vl(e)&&(e===s||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var _=u===0?"":S;e=e.substring(0,m)+_+e.substring(m+1,e.length)}var N=function(z,j,K){var G=!1,H=!1;s.startsWith("-")?G=!1:z.startsWith("--")?(G=!1,H=!0):c.startsWith("-")&&z.length===c.length?G=!1:z[0]==="-"&&(G=!0);var O=G?1:0;return H&&(O=2),O&&(z=z.substring(O),j-=O,K-=O),{value:z,start:j,end:K,hasNegation:G}},C=N(e,m,g),A=C.hasNegation;a=C,e=a.value,m=a.start,g=a.end;var k=N(t.lastValue,f.start,f.end),D=k.start,M=k.end,R=k.value,U=e.substring(m,g);e.length&&R.length&&(D>R.length-c.length||M<s.length)&&!(U&&c.startsWith(U))&&(e=R);var L=0;e.startsWith(s)?L+=s.length:m<s.length&&(L=m),e=e.substring(L),g-=L;var I=e.length,q=e.length-c.length;e.endsWith(c)?I=q:(g>q||g>e.length-c.length)&&(I=g),e=e.substring(0,I),e=GI(A?"-"+e:e,o),e=(e.match(FI(S))||[]).join("");var Y=e.indexOf(S);e=e.replace(new RegExp(vR(S),"g"),function(z,j){return j===Y?".":""});var B=pv(e,o),X=B.beforeDecimal,ne=B.afterDecimal,F=B.addNegation;return h.end-h.start<f.end-f.start&&X===""&&E&&!parseFloat(ne)&&(e=F?"-":""),e}function II(e,t){var n=t.prefix;n===void 0&&(n="");var a=t.suffix;a===void 0&&(a="");var o=Array.from({length:e.length+1}).map(function(){return!0}),s=e[0]==="-";o.fill(!1,0,n.length+(s?1:0));var c=e.length;return o.fill(!1,c-a.length+1,c+1),o}function HI(e){var t=Rd(e),n=t.thousandSeparator,a=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");var s=e.allowNegative;if(s===void 0&&(s=!0),n===a)throw new Error(`
Decimal separator can't be same as thousand separator.
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
decimalSeparator: `+a+` (default value for decimalSeparator is .)
`);return o.startsWith("-")&&s&&(console.error(`
Prefix can't start with '-' when allowNegative is true.
prefix: `+o+`
allowNegative: `+s+`
`),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function $I(e){e=HI(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,a=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=Pa);var s=e.onBlur;s===void 0&&(s=Pa);var c=e.thousandSeparator,u=e.decimalScale,f=e.fixedDecimalScale,h=e.prefix;h===void 0&&(h="");var m=e.defaultValue,g=e.value,y=e.valueIsNumericString,b=e.onValueChange,S=mR(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),E=Rd(e),_=E.decimalSeparator,N=E.allowedDecimalSeparators,C=function(F){return H1(F,e)},A=function(F,z){return BI(F,z,e)},k=No(g)?m:g,D=y??UI(k,h,t);No(g)?No(m)||(D=D||typeof m=="number"):D=D||typeof g=="number";var M=function(F){return gR(F)?F:(typeof F=="number"&&(F=bR(F)),D&&typeof u=="number"?B1(F,u,!!f):F)},R=wR(M(g),M(m),!!D,C,A,b),U=R[0],L=U.numAsString,I=U.formattedValue,q=R[1],Y=function(F){var z=F.target,j=F.key,K=z.selectionStart,G=z.selectionEnd,H=z.value;if(H===void 0&&(H=""),(j==="Backspace"||j==="Delete")&&G<h.length){F.preventDefault();return}if(K!==G){o(F);return}j==="Backspace"&&H[0]==="-"&&K===h.length+1&&n&&Ei(z,1),u&&f&&(j==="Backspace"&&H[K-1]===_?(Ei(z,K-1),F.preventDefault()):j==="Delete"&&H[K]===_&&F.preventDefault()),N!=null&&N.includes(j)&&H[K]===_&&Ei(z,K+1);var O=c===!0?",":c;j==="Backspace"&&H[K-1]===O&&Ei(z,K-1),j==="Delete"&&H[K]===O&&Ei(z,K+1),o(F)},B=function(F){var z=L;if(z.match(/\d/g)||(z=""),a||(z=RI(z)),f&&u&&(z=B1(z,u,f)),z!==L){var j=H1(z,e);q({formattedValue:j,value:z,floatValue:parseFloat(z)},{event:F,source:gl.event})}s(F)},X=function(F){return F===_?!0:vl(F)},ne=function(F){var z=F.currentValue,j=F.lastValue,K=F.formattedValue,G=F.currentValueIndex,H=F.formattedValueIndex,O=z[G],$=K[H],W=xR(j,z),re=W.to,de=function(ie){return A(ie).indexOf(".")+h.length};return g===0&&f&&u&&z[re.start]===_&&de(z)<G&&de(K)>H?!1:G>=re.start&&G<re.end&&N&&N.includes(O)&&$===_?!0:O===$};return Object.assign(Object.assign({},S),{value:I,valueIsNumericString:!1,isValidInputCharacter:X,isCharacterSame:ne,onValueChange:q,format:C,removeFormatting:A,getCaretBoundary:function(F){return II(F,e)},onKeyDown:Y,onBlur:B})}function VI(e){var t=$I(e);return ve.createElement(PI,Object.assign({},t))}const To=w.forwardRef(({stepper:e,thousandSeparator:t,placeholder:n,defaultValue:a,min:o=-1/0,max:s=1/0,onValueChange:c,fixedDecimalScale:u=!1,decimalScale:f=0,className:h=void 0,suffix:m,prefix:g,value:y,...b},S)=>{const[E,_]=w.useState(y??a),N=w.useCallback(()=>{_(D=>D===void 0?e??1:Math.min(D+(e??1),s))},[e,s]),C=w.useCallback(()=>{_(D=>D===void 0?-(e??1):Math.max(D-(e??1),o))},[e,o]);w.useEffect(()=>{y!==void 0&&_(y)},[y]);const A=D=>{const M=D.floatValue===void 0?void 0:D.floatValue;_(M),c&&c(M)},k=()=>{E!==void 0&&(E<o?(_(o),S.current.value=String(o)):E>s&&(_(s),S.current.value=String(s)))};return x.jsxs("div",{className:"relative flex",children:[x.jsx(VI,{value:E,onValueChange:A,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:o<0,valueIsNumericString:!0,onBlur:k,max:s,min:o,suffix:m,prefix:g,customInput:D=>x.jsx(Ai,{...D,className:Oe("w-full",h)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:S,...b}),x.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[x.jsx(wt,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:N,disabled:E===s,children:x.jsx(FE,{size:15})}),x.jsx(wt,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:C,disabled:E===o,children:x.jsx(og,{size:15})})]})]})});To.displayName="NumberInput";var qI=[" ","Enter","ArrowUp","ArrowDown"],YI=[" ","Enter"],Nl="Select",[Ad,Dd,WI]=j_(Nl),[Qo,Z6]=Kn(Nl,[WI,Vo]),kd=Vo(),[XI,qa]=Qo(Nl),[KI,ZI]=Qo(Nl),ER=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:o,onOpenChange:s,value:c,defaultValue:u,onValueChange:f,dir:h,name:m,autoComplete:g,disabled:y,required:b,form:S}=e,E=kd(t),[_,N]=w.useState(null),[C,A]=w.useState(null),[k,D]=w.useState(!1),M=gd(h),[R=!1,U]=aa({prop:a,defaultProp:o,onChange:s}),[L,I]=aa({prop:c,defaultProp:u,onChange:f}),q=w.useRef(null),Y=_?S||!!_.closest("form"):!0,[B,X]=w.useState(new Set),ne=Array.from(B).map(F=>F.props.value).join(";");return x.jsx(Ag,{...E,children:x.jsxs(XI,{required:b,scope:t,trigger:_,onTriggerChange:N,valueNode:C,onValueNodeChange:A,valueNodeHasChildren:k,onValueNodeHasChildrenChange:D,contentId:on(),value:L,onValueChange:I,open:R,onOpenChange:U,dir:M,triggerPointerDownPosRef:q,disabled:y,children:[x.jsx(Ad.Provider,{scope:t,children:x.jsx(KI,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(F=>{X(z=>new Set(z).add(F))},[]),onNativeOptionRemove:w.useCallback(F=>{X(z=>{const j=new Set(z);return j.delete(F),j})},[]),children:n})}),Y?x.jsxs(WR,{"aria-hidden":!0,required:b,tabIndex:-1,name:m,autoComplete:g,value:L,onChange:F=>I(F.target.value),disabled:y,form:S,children:[L===void 0?x.jsx("option",{value:""}):null,Array.from(B)]},ne):null]})})};ER.displayName=Nl;var SR="SelectTrigger",_R=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...o}=e,s=kd(n),c=qa(SR,n),u=c.disabled||a,f=nt(t,c.onTriggerChange),h=Dd(n),m=w.useRef("touch"),[g,y,b]=XR(E=>{const _=h().filter(A=>!A.disabled),N=_.find(A=>A.value===c.value),C=KR(_,E,N);C!==void 0&&c.onValueChange(C.value)}),S=E=>{u||(c.onOpenChange(!0),b()),E&&(c.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return x.jsx(cd,{asChild:!0,...s,children:x.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":YR(c.value)?"":void 0,...o,ref:f,onClick:Be(o.onClick,E=>{E.currentTarget.focus(),m.current!=="mouse"&&S(E)}),onPointerDown:Be(o.onPointerDown,E=>{m.current=E.pointerType;const _=E.target;_.hasPointerCapture(E.pointerId)&&_.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(S(E),E.preventDefault())}),onKeyDown:Be(o.onKeyDown,E=>{const _=g.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&y(E.key),!(_&&E.key===" ")&&qI.includes(E.key)&&(S(),E.preventDefault())})})})});_R.displayName=SR;var CR="SelectValue",TR=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:o,children:s,placeholder:c="",...u}=e,f=qa(CR,n),{onValueNodeHasChildrenChange:h}=f,m=s!==void 0,g=nt(t,f.onValueNodeChange);return sn(()=>{h(m)},[h,m]),x.jsx(Ie.span,{...u,ref:g,style:{pointerEvents:"none"},children:YR(f.value)?x.jsx(x.Fragment,{children:c}):s})});TR.displayName=CR;var QI="SelectIcon",RR=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...o}=e;return x.jsx(Ie.span,{"aria-hidden":!0,...o,ref:t,children:a||"▼"})});RR.displayName=QI;var JI="SelectPortal",AR=e=>x.jsx(td,{asChild:!0,...e});AR.displayName=JI;var Ni="SelectContent",DR=w.forwardRef((e,t)=>{const n=qa(Ni,e.__scopeSelect),[a,o]=w.useState();if(sn(()=>{o(new DocumentFragment)},[]),!n.open){const s=a;return s?xl.createPortal(x.jsx(kR,{scope:e.__scopeSelect,children:x.jsx(Ad.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),s):null}return x.jsx(NR,{...e,ref:t})});DR.displayName=Ni;var sr=10,[kR,Ya]=Qo(Ni),e6="SelectContentImpl",NR=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:c,side:u,sideOffset:f,align:h,alignOffset:m,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:S,hideWhenDetached:E,avoidCollisions:_,...N}=e,C=qa(Ni,n),[A,k]=w.useState(null),[D,M]=w.useState(null),R=nt(t,ie=>k(ie)),[U,L]=w.useState(null),[I,q]=w.useState(null),Y=Dd(n),[B,X]=w.useState(!1),ne=w.useRef(!1);w.useEffect(()=>{if(A)return cg(A)},[A]),lg();const F=w.useCallback(ie=>{const[oe,...Ce]=Y().map(be=>be.ref.current),[he]=Ce.slice(-1),Se=document.activeElement;for(const be of ie)if(be===Se||(be==null||be.scrollIntoView({block:"nearest"}),be===oe&&D&&(D.scrollTop=0),be===he&&D&&(D.scrollTop=D.scrollHeight),be==null||be.focus(),document.activeElement!==Se))return},[Y,D]),z=w.useCallback(()=>F([U,A]),[F,U,A]);w.useEffect(()=>{B&&z()},[B,z]);const{onOpenChange:j,triggerPointerDownPosRef:K}=C;w.useEffect(()=>{if(A){let ie={x:0,y:0};const oe=he=>{var Se,be;ie={x:Math.abs(Math.round(he.pageX)-(((Se=K.current)==null?void 0:Se.x)??0)),y:Math.abs(Math.round(he.pageY)-(((be=K.current)==null?void 0:be.y)??0))}},Ce=he=>{ie.x<=10&&ie.y<=10?he.preventDefault():A.contains(he.target)||j(!1),document.removeEventListener("pointermove",oe),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[A,j,K]),w.useEffect(()=>{const ie=()=>j(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[j]);const[G,H]=XR(ie=>{const oe=Y().filter(Se=>!Se.disabled),Ce=oe.find(Se=>Se.ref.current===document.activeElement),he=KR(oe,ie,Ce);he&&setTimeout(()=>he.ref.current.focus())}),O=w.useCallback((ie,oe,Ce)=>{const he=!ne.current&&!Ce;(C.value!==void 0&&C.value===oe||he)&&(L(ie),he&&(ne.current=!0))},[C.value]),$=w.useCallback(()=>A==null?void 0:A.focus(),[A]),W=w.useCallback((ie,oe,Ce)=>{const he=!ne.current&&!Ce;(C.value!==void 0&&C.value===oe||he)&&q(ie)},[C.value]),re=a==="popper"?Vm:OR,de=re===Vm?{side:u,sideOffset:f,align:h,alignOffset:m,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:S,hideWhenDetached:E,avoidCollisions:_}:{};return x.jsx(kR,{scope:n,content:A,viewport:D,onViewportChange:M,itemRefCallback:O,selectedItem:U,onItemLeave:$,itemTextRefCallback:W,focusSelectedItem:z,selectedItemText:I,position:a,isPositioned:B,searchRef:G,children:x.jsx(rd,{as:Ba,allowPinchZoom:!0,children:x.jsx(ed,{asChild:!0,trapped:C.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Be(o,ie=>{var oe;(oe=C.trigger)==null||oe.focus({preventScroll:!0}),ie.preventDefault()}),children:x.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:x.jsx(re,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ie=>ie.preventDefault(),...N,...de,onPlaced:()=>X(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Be(N.onKeyDown,ie=>{const oe=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!oe&&ie.key.length===1&&H(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let he=Y().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Se=ie.target,be=he.indexOf(Se);he=he.slice(be+1)}setTimeout(()=>F(he)),ie.preventDefault()}})})})})})})});NR.displayName=e6;var t6="SelectItemAlignedPosition",OR=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...o}=e,s=qa(Ni,n),c=Ya(Ni,n),[u,f]=w.useState(null),[h,m]=w.useState(null),g=nt(t,R=>m(R)),y=Dd(n),b=w.useRef(!1),S=w.useRef(!0),{viewport:E,selectedItem:_,selectedItemText:N,focusSelectedItem:C}=c,A=w.useCallback(()=>{if(s.trigger&&s.valueNode&&u&&h&&E&&_&&N){const R=s.trigger.getBoundingClientRect(),U=h.getBoundingClientRect(),L=s.valueNode.getBoundingClientRect(),I=N.getBoundingClientRect();if(s.dir!=="rtl"){const Se=I.left-U.left,be=L.left-Se,Le=R.left-be,Te=R.width+Le,ye=Math.max(Te,U.width),J=window.innerWidth-sr,le=Hm(be,[sr,Math.max(sr,J-ye)]);u.style.minWidth=Te+"px",u.style.left=le+"px"}else{const Se=U.right-I.right,be=window.innerWidth-L.right-Se,Le=window.innerWidth-R.right-be,Te=R.width+Le,ye=Math.max(Te,U.width),J=window.innerWidth-sr,le=Hm(be,[sr,Math.max(sr,J-ye)]);u.style.minWidth=Te+"px",u.style.right=le+"px"}const q=y(),Y=window.innerHeight-sr*2,B=E.scrollHeight,X=window.getComputedStyle(h),ne=parseInt(X.borderTopWidth,10),F=parseInt(X.paddingTop,10),z=parseInt(X.borderBottomWidth,10),j=parseInt(X.paddingBottom,10),K=ne+F+B+j+z,G=Math.min(_.offsetHeight*5,K),H=window.getComputedStyle(E),O=parseInt(H.paddingTop,10),$=parseInt(H.paddingBottom,10),W=R.top+R.height/2-sr,re=Y-W,de=_.offsetHeight/2,ie=_.offsetTop+de,oe=ne+F+ie,Ce=K-oe;if(oe<=W){const Se=q.length>0&&_===q[q.length-1].ref.current;u.style.bottom="0px";const be=h.clientHeight-E.offsetTop-E.offsetHeight,Le=Math.max(re,de+(Se?$:0)+be+z),Te=oe+Le;u.style.height=Te+"px"}else{const Se=q.length>0&&_===q[0].ref.current;u.style.top="0px";const Le=Math.max(W,ne+E.offsetTop+(Se?O:0)+de)+Ce;u.style.height=Le+"px",E.scrollTop=oe-W+E.offsetTop}u.style.margin=`${sr}px 0`,u.style.minHeight=G+"px",u.style.maxHeight=Y+"px",a==null||a(),requestAnimationFrame(()=>b.current=!0)}},[y,s.trigger,s.valueNode,u,h,E,_,N,s.dir,a]);sn(()=>A(),[A]);const[k,D]=w.useState();sn(()=>{h&&D(window.getComputedStyle(h).zIndex)},[h]);const M=w.useCallback(R=>{R&&S.current===!0&&(A(),C==null||C(),S.current=!1)},[A,C]);return x.jsx(r6,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:M,children:x.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:x.jsx(Ie.div,{...o,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});OR.displayName=t6;var n6="SelectPopperPosition",Vm=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:o=sr,...s}=e,c=kd(n);return x.jsx(Dg,{...c,...s,ref:t,align:a,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Vm.displayName=n6;var[r6,mv]=Qo(Ni,{}),qm="SelectViewport",jR=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...o}=e,s=Ya(qm,n),c=mv(qm,n),u=nt(t,s.onViewportChange),f=w.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),x.jsx(Ad.Slot,{scope:n,children:x.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Be(o.onScroll,h=>{const m=h.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:y}=c;if(y!=null&&y.current&&g){const b=Math.abs(f.current-m.scrollTop);if(b>0){const S=window.innerHeight-sr*2,E=parseFloat(g.style.minHeight),_=parseFloat(g.style.height),N=Math.max(E,_);if(N<S){const C=N+b,A=Math.min(S,C),k=C-A;g.style.height=A+"px",g.style.bottom==="0px"&&(m.scrollTop=k>0?k:0,g.style.justifyContent="flex-end")}}}f.current=m.scrollTop})})})]})});jR.displayName=qm;var LR="SelectGroup",[a6,i6]=Qo(LR),zR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=on();return x.jsx(a6,{scope:n,id:o,children:x.jsx(Ie.div,{role:"group","aria-labelledby":o,...a,ref:t})})});zR.displayName=LR;var MR="SelectLabel",PR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=i6(MR,n);return x.jsx(Ie.div,{id:o.id,...a,ref:t})});PR.displayName=MR;var qu="SelectItem",[o6,GR]=Qo(qu),FR=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:o=!1,textValue:s,...c}=e,u=qa(qu,n),f=Ya(qu,n),h=u.value===a,[m,g]=w.useState(s??""),[y,b]=w.useState(!1),S=nt(t,C=>{var A;return(A=f.itemRefCallback)==null?void 0:A.call(f,C,a,o)}),E=on(),_=w.useRef("touch"),N=()=>{o||(u.onValueChange(a),u.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(o6,{scope:n,value:a,disabled:o,textId:E,isSelected:h,onItemTextChange:w.useCallback(C=>{g(A=>A||((C==null?void 0:C.textContent)??"").trim())},[]),children:x.jsx(Ad.ItemSlot,{scope:n,value:a,disabled:o,textValue:m,children:x.jsx(Ie.div,{role:"option","aria-labelledby":E,"data-highlighted":y?"":void 0,"aria-selected":h&&y,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:S,onFocus:Be(c.onFocus,()=>b(!0)),onBlur:Be(c.onBlur,()=>b(!1)),onClick:Be(c.onClick,()=>{_.current!=="mouse"&&N()}),onPointerUp:Be(c.onPointerUp,()=>{_.current==="mouse"&&N()}),onPointerDown:Be(c.onPointerDown,C=>{_.current=C.pointerType}),onPointerMove:Be(c.onPointerMove,C=>{var A;_.current=C.pointerType,o?(A=f.onItemLeave)==null||A.call(f):_.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Be(c.onPointerLeave,C=>{var A;C.currentTarget===document.activeElement&&((A=f.onItemLeave)==null||A.call(f))}),onKeyDown:Be(c.onKeyDown,C=>{var k;((k=f.searchRef)==null?void 0:k.current)!==""&&C.key===" "||(YI.includes(C.key)&&N(),C.key===" "&&C.preventDefault())})})})})});FR.displayName=qu;var il="SelectItemText",UR=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:o,...s}=e,c=qa(il,n),u=Ya(il,n),f=GR(il,n),h=ZI(il,n),[m,g]=w.useState(null),y=nt(t,N=>g(N),f.onItemTextChange,N=>{var C;return(C=u.itemTextRefCallback)==null?void 0:C.call(u,N,f.value,f.disabled)}),b=m==null?void 0:m.textContent,S=w.useMemo(()=>x.jsx("option",{value:f.value,disabled:f.disabled,children:b},f.value),[f.disabled,f.value,b]),{onNativeOptionAdd:E,onNativeOptionRemove:_}=h;return sn(()=>(E(S),()=>_(S)),[E,_,S]),x.jsxs(x.Fragment,{children:[x.jsx(Ie.span,{id:f.textId,...s,ref:y}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?xl.createPortal(s.children,c.valueNode):null]})});UR.displayName=il;var BR="SelectItemIndicator",IR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return GR(BR,n).isSelected?x.jsx(Ie.span,{"aria-hidden":!0,...a,ref:t}):null});IR.displayName=BR;var Ym="SelectScrollUpButton",HR=w.forwardRef((e,t)=>{const n=Ya(Ym,e.__scopeSelect),a=mv(Ym,e.__scopeSelect),[o,s]=w.useState(!1),c=nt(t,a.onScrollButtonChange);return sn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollTop>0;s(h)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),o?x.jsx(VR,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});HR.displayName=Ym;var Wm="SelectScrollDownButton",$R=w.forwardRef((e,t)=>{const n=Ya(Wm,e.__scopeSelect),a=mv(Wm,e.__scopeSelect),[o,s]=w.useState(!1),c=nt(t,a.onScrollButtonChange);return sn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollHeight-f.clientHeight,m=Math.ceil(f.scrollTop)<h;s(m)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),o?x.jsx(VR,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});$R.displayName=Wm;var VR=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...o}=e,s=Ya("SelectScrollButton",n),c=w.useRef(null),u=Dd(n),f=w.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return w.useEffect(()=>()=>f(),[f]),sn(()=>{var m;const h=u().find(g=>g.ref.current===document.activeElement);(m=h==null?void 0:h.ref.current)==null||m.scrollIntoView({block:"nearest"})},[u]),x.jsx(Ie.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Be(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(a,50))}),onPointerMove:Be(o.onPointerMove,()=>{var h;(h=s.onItemLeave)==null||h.call(s),c.current===null&&(c.current=window.setInterval(a,50))}),onPointerLeave:Be(o.onPointerLeave,()=>{f()})})}),s6="SelectSeparator",qR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return x.jsx(Ie.div,{"aria-hidden":!0,...a,ref:t})});qR.displayName=s6;var Xm="SelectArrow",l6=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=kd(n),s=qa(Xm,n),c=Ya(Xm,n);return s.open&&c.position==="popper"?x.jsx(kg,{...o,...a,ref:t}):null});l6.displayName=Xm;function YR(e){return e===""||e===void 0}var WR=w.forwardRef((e,t)=>{const{value:n,...a}=e,o=w.useRef(null),s=nt(t,o),c=bT(n);return w.useEffect(()=>{const u=o.current,f=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==n&&m){const g=new Event("change",{bubbles:!0});m.call(u,n),u.dispatchEvent(g)}},[c,n]),x.jsx(Ng,{asChild:!0,children:x.jsx("select",{...a,ref:s,defaultValue:n})})});WR.displayName="BubbleSelect";function XR(e){const t=Zt(e),n=w.useRef(""),a=w.useRef(0),o=w.useCallback(c=>{const u=n.current+c;t(u),function f(h){n.current=h,window.clearTimeout(a.current),h!==""&&(a.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),s=w.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,o,s]}function KR(e,t,n){const o=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let c=c6(e,Math.max(s,0));o.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function c6(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var u6=ER,ZR=_R,d6=TR,f6=RR,h6=AR,QR=DR,p6=jR,m6=zR,JR=PR,eA=FR,g6=UR,v6=IR,tA=HR,nA=$R,rA=qR;const $1=u6,V1=m6,q1=d6,Km=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(ZR,{ref:a,className:Oe("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,x.jsx(f6,{asChild:!0,children:x.jsx(og,{className:"h-4 w-4 opacity-50"})})]}));Km.displayName=ZR.displayName;const aA=w.forwardRef(({className:e,...t},n)=>x.jsx(tA,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(FE,{className:"h-4 w-4"})}));aA.displayName=tA.displayName;const iA=w.forwardRef(({className:e,...t},n)=>x.jsx(nA,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(og,{className:"h-4 w-4"})}));iA.displayName=nA.displayName;const Zm=w.forwardRef(({className:e,children:t,position:n="popper",...a},o)=>x.jsx(h6,{children:x.jsxs(QR,{ref:o,className:Oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...a,children:[x.jsx(aA,{}),x.jsx(p6,{className:Oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),x.jsx(iA,{})]})}));Zm.displayName=QR.displayName;const y6=w.forwardRef(({className:e,...t},n)=>x.jsx(JR,{ref:n,className:Oe("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));y6.displayName=JR.displayName;const ta=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(eA,{ref:a,className:Oe("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(v6,{children:x.jsx(ig,{className:"h-4 w-4"})})}),x.jsx(g6,{children:t})]}));ta.displayName=eA.displayName;const b6=w.forwardRef(({className:e,...t},n)=>x.jsx(rA,{ref:n,className:Oe("bg-muted -mx-1 my-1 h-px",e),...t}));b6.displayName=rA.displayName;function x6(){var n,a;const e=Ye(o=>o.querySettings),t=w.useCallback((o,s)=>{Ye.getState().updateQuerySettings({[o]:s})},[]);return x.jsxs(hl,{className:"flex shrink-0 flex-col",children:[x.jsxs(Gu,{className:"px-4 pt-4 pb-2",children:[x.jsx(pl,{children:"Parameters"}),x.jsx(Sd,{children:"Configure your query parameters"})]}),x.jsx(Fu,{className:"m-0 flex grow flex-col p-0 text-xs",children:x.jsx("div",{className:"relative size-full",children:x.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Query Mode",tooltip:"Select the retrieval strategy:\\n• Naive: Basic search without advanced techniques\\n• Local: Context-dependent information retrieval\\n• Global: Utilizes global knowledge base\\n• Hybrid: Combines local and global retrieval\\n• Mix: Integrates knowledge graph with vector retrieval",side:"left"}),x.jsxs($1,{value:e.mode,onValueChange:o=>t("mode",o),children:[x.jsx(Km,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:x.jsx(q1,{})}),x.jsx(Zm,{children:x.jsxs(V1,{children:[x.jsx(ta,{value:"naive",children:"Naive"}),x.jsx(ta,{value:"local",children:"Local"}),x.jsx(ta,{value:"global",children:"Global"}),x.jsx(ta,{value:"hybrid",children:"Hybrid"}),x.jsx(ta,{value:"mix",children:"Mix"})]})})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),x.jsxs($1,{value:e.response_type,onValueChange:o=>t("response_type",o),children:[x.jsx(Km,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:x.jsx(q1,{})}),x.jsx(Zm,{children:x.jsxs(V1,{children:[x.jsx(ta,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),x.jsx(ta,{value:"Single Paragraph",children:"Single Paragraph"}),x.jsx(ta,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Top K Results",tooltip:"Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode",side:"left"}),x.jsx(To,{id:"top_k",stepper:1,value:e.top_k,onValueChange:o=>t("top_k",o),min:1,placeholder:"Number of results"})]}),x.jsxs(x.Fragment,{children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),x.jsx(To,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:o=>t("max_token_for_text_unit",o),min:1,placeholder:"Max tokens for text unit"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),x.jsx(To,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:o=>t("max_token_for_global_context",o),min:1,placeholder:"Max tokens for global context"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),x.jsx(To,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:o=>t("max_token_for_local_context",o),min:1,placeholder:"Max tokens for local context"})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),x.jsx(To,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:o=>t("history_turns",o),min:0,placeholder:"Number of history turns"})]}),x.jsxs(x.Fragment,{children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),x.jsx(Ai,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:o=>{const s=o.target.value.split(",").map(c=>c.trim()).filter(c=>c!=="");t("hl_keywords",s)},placeholder:"Enter keywords"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),x.jsx(Ai,{id:"ll_keywords",type:"text",value:(a=e.ll_keywords)==null?void 0:a.join(", "),onChange:o=>{const s=o.target.value.split(",").map(c=>c.trim()).filter(c=>c!=="");t("ll_keywords",s)},placeholder:"Enter keywords"})]})]}),x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(sl,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:o=>t("only_need_context",o)})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(sl,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:o=>t("only_need_prompt",o)})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(sl,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:o=>t("stream",o)})]})]})]})})})]})}function w6(){const[e,t]=w.useState(()=>Ye.getState().retrievalHistory||[]),[n,a]=w.useState(""),[o,s]=w.useState(!1),c=w.useRef(null),u=w.useCallback(()=>{var g;(g=c.current)==null||g.scrollIntoView({behavior:"smooth"})},[]),f=w.useCallback(async g=>{if(g.preventDefault(),!n.trim()||o)return;const y={content:n,role:"user"},b={content:"",role:"assistant"},S=[...e];t([...S,y,b]),a(""),s(!0);const E=C=>{b.content+=C,t(A=>{const k=[...A],D=k[k.length-1];return D.role==="assistant"&&(D.content=b.content),k})},_=Ye.getState(),N={..._.querySettings,query:y.content,conversation_history:S};try{if(_.querySettings.stream)await xO(N,E);else{const C=await bO(N);E(C.response)}}catch(C){E(`Error: Failed to get response
${Sr(C)}`)}finally{s(!1),Ye.getState().setRetrievalHistory([...S,y,b])}},[n,o,e,t]),h=sv(e,100);w.useEffect(()=>u(),[h,u]);const m=w.useCallback(()=>{t([]),Ye.getState().setRetrievalHistory([])},[t]);return x.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[x.jsxs("div",{className:"flex grow flex-col gap-4",children:[x.jsx("div",{className:"relative grow",children:x.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:x.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?x.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-lg",children:"Start a retrieval by typing your query below"}):e.map((g,y)=>x.jsx("div",{className:`flex ${g.role==="user"?"justify-end":"justify-start"}`,children:x.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${g.role==="user"?"bg-primary text-primary-foreground":"bg-muted"}`,children:[x.jsx("pre",{className:"break-words whitespace-pre-wrap",children:g.content}),g.content.length===0&&x.jsx(YO,{className:"animate-spin duration-2000"})]})},y)),x.jsx("div",{ref:c,className:"pb-1"})]})})}),x.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[x.jsxs(wt,{type:"button",variant:"outline",onClick:m,disabled:o,size:"sm",children:[x.jsx(UE,{}),"Clear"]}),x.jsx(Ai,{className:"flex-1",value:n,onChange:g=>a(g.target.value),placeholder:"Type your query...",disabled:o}),x.jsxs(wt,{type:"submit",variant:"default",disabled:o,size:"sm",children:[x.jsx(cj,{}),"Send"]})]})]}),x.jsx(x6,{})]})}function E6(){return x.jsx("iframe",{src:iE+"/docs",className:"size-full"})}function S6(){const e=En.use.message(),t=Ye.use.enableHealthCheck(),[n]=w.useState(()=>Ye.getState().currentTab),[a,o]=w.useState(!1);w.useEffect(()=>{if(!t)return;En.getState().check();const c=setInterval(async()=>{await En.getState().check()},Ok*1e3);return()=>clearInterval(c)},[t]);const s=w.useCallback(c=>Ye.getState().setCurrentTab(c),[]);return w.useEffect(()=>{if(e&&(e.includes(ME)||e.includes(PE))){o(!0);return}o(!1)},[e,o]),x.jsx(Mk,{children:x.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[x.jsxs(GP,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:s,children:[x.jsx(UP,{}),x.jsxs("div",{className:"relative grow",children:[x.jsx(rl,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(wI,{})}),x.jsx(rl,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(VU,{})}),x.jsx(rl,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(w6,{})}),x.jsx(rl,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(E6,{})})]})]}),t&&x.jsx(xP,{}),e!==null&&!a&&x.jsx(Ej,{}),a&&x.jsx(oP,{}),x.jsx(iP,{})]})})}DD.createRoot(document.getElementById("root")).render(x.jsx(w.StrictMode,{children:x.jsx(S6,{})}));