LightRAG/lightrag/api/webui/assets/index-gr1CNi7P.js
2025-02-18 00:43:57 +08:00

1098 lines
971 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var aj=Object.defineProperty;var oj=(e,t,n)=>t in e?aj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var mi=(e,t,n)=>oj(e,typeof t!="symbol"?t+"":t,n);function sj(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lj(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?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(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Fp={exports:{}},_l={};/**
* @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 F0;function uj(){if(F0)return _l;F0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var l=null;if(o!==void 0&&(l=""+o),i.key!==void 0&&(l=""+i.key),"key"in i){o={};for(var u in i)u!=="key"&&(o[u]=i[u])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:o}}return _l.Fragment=t,_l.jsx=n,_l.jsxs=n,_l}var I0;function cj(){return I0||(I0=1,Fp.exports=uj()),Fp.exports}var S=cj(),Ip={exports:{}},nt={};/**
* @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 G0;function fj(){if(G0)return nt;G0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function v(A){return A===null||typeof A!="object"?null:(A=m&&A[m]||A["@@iterator"],typeof A=="function"?A:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function k(A,H,M){this.props=A,this.context=H,this.refs=x,this.updater=M||g}k.prototype.isReactComponent={},k.prototype.setState=function(A,H){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,H,"setState")},k.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=k.prototype;function _(A,H,M){this.props=A,this.context=H,this.refs=x,this.updater=M||g}var T=_.prototype=new C;T.constructor=_,w(T,k.prototype),T.isPureReactComponent=!0;var N=Array.isArray,D={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function R(A,H,M,O,X,re){return M=re.ref,{$$typeof:e,type:A,key:H,ref:M!==void 0?M:null,props:re}}function U(A,H){return R(A.type,H,void 0,void 0,void 0,A.props)}function P(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function z(A){var H={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(M){return H[M]})}var V=/\/+/g;function q(A,H){return typeof A=="object"&&A!==null&&A.key!=null?z(""+A.key):H.toString(36)}function I(){}function Y(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(I,I):(A.status="pending",A.then(function(H){A.status==="pending"&&(A.status="fulfilled",A.value=H)},function(H){A.status==="pending"&&(A.status="rejected",A.reason=H)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function Z(A,H,M,O,X){var re=typeof A;(re==="undefined"||re==="boolean")&&(A=null);var ue=!1;if(A===null)ue=!0;else switch(re){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(A.$$typeof){case e:case t:ue=!0;break;case p:return ue=A._init,Z(ue(A._payload),H,M,O,X)}}if(ue)return X=X(A),ue=O===""?"."+q(A,0):O,N(X)?(M="",ue!=null&&(M=ue.replace(V,"$&/")+"/"),Z(X,H,M,"",function(Ce){return Ce})):X!=null&&(P(X)&&(X=U(X,M+(X.key==null||A&&A.key===X.key?"":(""+X.key).replace(V,"$&/")+"/")+ue)),H.push(X)),1;ue=0;var ae=O===""?".":O+":";if(N(A))for(var oe=0;oe<A.length;oe++)O=A[oe],re=ae+q(O,oe),ue+=Z(O,H,M,re,X);else if(oe=v(A),typeof oe=="function")for(A=oe.call(A),oe=0;!(O=A.next()).done;)O=O.value,re=ae+q(O,oe++),ue+=Z(O,H,M,re,X);else if(re==="object"){if(typeof A.then=="function")return Z(Y(A),H,M,O,X);throw H=String(A),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ue}function B(A,H,M){if(A==null)return A;var O=[],X=0;return Z(A,O,"","",function(re){return H.call(M,re,X++)}),O}function G(A){if(A._status===-1){var H=A._result;H=H(),H.then(function(M){(A._status===0||A._status===-1)&&(A._status=1,A._result=M)},function(M){(A._status===0||A._status===-1)&&(A._status=2,A._result=M)}),A._status===-1&&(A._status=0,A._result=H)}if(A._status===1)return A._result.default;throw A._result}var F=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)};function K(){}return nt.Children={map:B,forEach:function(A,H,M){B(A,function(){H.apply(this,arguments)},M)},count:function(A){var H=0;return B(A,function(){H++}),H},toArray:function(A){return B(A,function(H){return H})||[]},only:function(A){if(!P(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},nt.Component=k,nt.Fragment=n,nt.Profiler=i,nt.PureComponent=_,nt.StrictMode=r,nt.Suspense=f,nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,nt.act=function(){throw Error("act(...) is not supported in production builds of React.")},nt.cache=function(A){return function(){return A.apply(null,arguments)}},nt.cloneElement=function(A,H,M){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var O=w({},A.props),X=A.key,re=void 0;if(H!=null)for(ue in H.ref!==void 0&&(re=void 0),H.key!==void 0&&(X=""+H.key),H)!L.call(H,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&H.ref===void 0||(O[ue]=H[ue]);var ue=arguments.length-2;if(ue===1)O.children=M;else if(1<ue){for(var ae=Array(ue),oe=0;oe<ue;oe++)ae[oe]=arguments[oe+2];O.children=ae}return R(A.type,X,void 0,void 0,re,O)},nt.createContext=function(A){return A={$$typeof:l,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:o,_context:A},A},nt.createElement=function(A,H,M){var O,X={},re=null;if(H!=null)for(O in H.key!==void 0&&(re=""+H.key),H)L.call(H,O)&&O!=="key"&&O!=="__self"&&O!=="__source"&&(X[O]=H[O]);var ue=arguments.length-2;if(ue===1)X.children=M;else if(1<ue){for(var ae=Array(ue),oe=0;oe<ue;oe++)ae[oe]=arguments[oe+2];X.children=ae}if(A&&A.defaultProps)for(O in ue=A.defaultProps,ue)X[O]===void 0&&(X[O]=ue[O]);return R(A,re,void 0,void 0,null,X)},nt.createRef=function(){return{current:null}},nt.forwardRef=function(A){return{$$typeof:u,render:A}},nt.isValidElement=P,nt.lazy=function(A){return{$$typeof:p,_payload:{_status:-1,_result:A},_init:G}},nt.memo=function(A,H){return{$$typeof:d,type:A,compare:H===void 0?null:H}},nt.startTransition=function(A){var H=D.T,M={};D.T=M;try{var O=A(),X=D.S;X!==null&&X(M,O),typeof O=="object"&&O!==null&&typeof O.then=="function"&&O.then(K,F)}catch(re){F(re)}finally{D.T=H}},nt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},nt.use=function(A){return D.H.use(A)},nt.useActionState=function(A,H,M){return D.H.useActionState(A,H,M)},nt.useCallback=function(A,H){return D.H.useCallback(A,H)},nt.useContext=function(A){return D.H.useContext(A)},nt.useDebugValue=function(){},nt.useDeferredValue=function(A,H){return D.H.useDeferredValue(A,H)},nt.useEffect=function(A,H){return D.H.useEffect(A,H)},nt.useId=function(){return D.H.useId()},nt.useImperativeHandle=function(A,H,M){return D.H.useImperativeHandle(A,H,M)},nt.useInsertionEffect=function(A,H){return D.H.useInsertionEffect(A,H)},nt.useLayoutEffect=function(A,H){return D.H.useLayoutEffect(A,H)},nt.useMemo=function(A,H){return D.H.useMemo(A,H)},nt.useOptimistic=function(A,H){return D.H.useOptimistic(A,H)},nt.useReducer=function(A,H,M){return D.H.useReducer(A,H,M)},nt.useRef=function(A){return D.H.useRef(A)},nt.useState=function(A){return D.H.useState(A)},nt.useSyncExternalStore=function(A,H,M){return D.H.useSyncExternalStore(A,H,M)},nt.useTransition=function(){return D.H.useTransition()},nt.version="19.0.0",nt}var U0;function Vf(){return U0||(U0=1,Ip.exports=fj()),Ip.exports}var E=Vf();const be=fn(E),dj=sj({__proto__:null,default:be},[E]);var Gp={exports:{}},kl={},Up={exports:{}},Bp={};/**
* @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 B0;function hj(){return B0||(B0=1,function(e){function t(B,G){var F=B.length;B.push(G);e:for(;0<F;){var K=F-1>>>1,A=B[K];if(0<i(A,G))B[K]=G,B[F]=A,F=K;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var G=B[0],F=B.pop();if(F!==G){B[0]=F;e:for(var K=0,A=B.length,H=A>>>1;K<H;){var M=2*(K+1)-1,O=B[M],X=M+1,re=B[X];if(0>i(O,F))X<A&&0>i(re,O)?(B[K]=re,B[X]=F,K=X):(B[K]=O,B[M]=F,K=M);else if(X<A&&0>i(re,F))B[K]=re,B[X]=F,K=X;else break e}}return G}function i(B,G){var F=B.sortIndex-G.sortIndex;return F!==0?F:B.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var f=[],d=[],p=1,m=null,v=3,g=!1,w=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function T(B){for(var G=n(d);G!==null;){if(G.callback===null)r(d);else if(G.startTime<=B)r(d),G.sortIndex=G.expirationTime,t(f,G);else break;G=n(d)}}function N(B){if(x=!1,T(B),!w)if(n(f)!==null)w=!0,Y();else{var G=n(d);G!==null&&Z(N,G.startTime-B)}}var D=!1,L=-1,R=5,U=-1;function P(){return!(e.unstable_now()-U<R)}function z(){if(D){var B=e.unstable_now();U=B;var G=!0;try{e:{w=!1,x&&(x=!1,C(L),L=-1),g=!0;var F=v;try{t:{for(T(B),m=n(f);m!==null&&!(m.expirationTime>B&&P());){var K=m.callback;if(typeof K=="function"){m.callback=null,v=m.priorityLevel;var A=K(m.expirationTime<=B);if(B=e.unstable_now(),typeof A=="function"){m.callback=A,T(B),G=!0;break t}m===n(f)&&r(f),T(B)}else r(f);m=n(f)}if(m!==null)G=!0;else{var H=n(d);H!==null&&Z(N,H.startTime-B),G=!1}}break e}finally{m=null,v=F,g=!1}G=void 0}}finally{G?V():D=!1}}}var V;if(typeof _=="function")V=function(){_(z)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,I=q.port2;q.port1.onmessage=z,V=function(){I.postMessage(null)}}else V=function(){k(z,0)};function Y(){D||(D=!0,V())}function Z(B,G){L=k(function(){B(e.unstable_now())},G)}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(B){B.callback=null},e.unstable_continueExecution=function(){w||g||(w=!0,Y())},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(B){switch(v){case 1:case 2:case 3:var G=3;break;default:G=v}var F=v;v=G;try{return B()}finally{v=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var F=v;v=B;try{return G()}finally{v=F}},e.unstable_scheduleCallback=function(B,G,F){var K=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?K+F:K):F=K,B){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=F+A,B={id:p++,callback:G,priorityLevel:B,startTime:F,expirationTime:A,sortIndex:-1},F>K?(B.sortIndex=F,t(d,B),n(f)===null&&B===n(d)&&(x?(C(L),L=-1):x=!0,Z(N,F-K))):(B.sortIndex=A,t(f,B),w||g||(w=!0,Y())),B},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(B){var G=v;return function(){var F=v;v=G;try{return B.apply(this,arguments)}finally{v=F}}}}(Bp)),Bp}var $0;function pj(){return $0||($0=1,Up.exports=hj()),Up.exports}var $p={exports:{}},mn={};/**
* @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 H0;function mj(){if(H0)return mn;H0=1;var e=Vf();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={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},i=Symbol.for("react.portal");function o(f,d,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:f,containerInfo:d,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,mn.createPortal=function(f,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return o(f,d,null,p)},mn.flushSync=function(f){var d=l.T,p=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=d,r.p=p,r.d.f()}},mn.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},mn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},mn.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin),v=typeof d.integrity=="string"?d.integrity:void 0,g=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:v,fetchPriority:g}):p==="script"&&r.d.X(f,{crossOrigin:m,integrity:v,fetchPriority:g,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},mn.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=u(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},mn.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin);r.d.L(f,p,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},mn.preloadModule=function(f,d){if(typeof f=="string")if(d){var p=u(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},mn.requestFormReset=function(f){r.d.r(f)},mn.unstable_batchedUpdates=function(f,d){return f(d)},mn.useFormState=function(f,d,p){return l.H.useFormState(f,d,p)},mn.useFormStatus=function(){return l.H.useHostTransitionStatus()},mn.version="19.0.0",mn}var V0;function R_(){if(V0)return $p.exports;V0=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(),$p.exports=mj(),$p.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 q0;function gj(){if(q0)return kl;q0=1;var e=pj(),t=Vf(),n=R_();function r(a){var s="https://react.dev/errors/"+a;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}var o=Symbol.for("react.element"),l=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),v=Symbol.for("react.consumer"),g=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),N=Symbol.for("react.memo_cache_sentinel"),D=Symbol.iterator;function L(a){return a===null||typeof a!="object"?null:(a=D&&a[D]||a["@@iterator"],typeof a=="function"?a:null)}var R=Symbol.for("react.client.reference");function U(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===R?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case f:return"Fragment";case u:return"Portal";case p:return"Profiler";case d:return"StrictMode";case x:return"Suspense";case k:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case g:return(a.displayName||"Context")+".Provider";case v:return(a._context.displayName||"Context")+".Consumer";case w:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case C:return s=a.displayName||null,s!==null?s:U(a.type)||"Memo";case _:s=a._payload,a=a._init;try{return U(a(s))}catch{}}return null}var P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.assign,V,q;function I(a){if(V===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);V=s&&s[1]||"",q=-1<c.stack.indexOf(`
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
`+V+a+q}var Y=!1;function Z(a,s){if(!a||Y)return"";Y=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(pe){var le=pe}Reflect.construct(a,[],_e)}else{try{_e.call()}catch(pe){le=pe}a.call(_e.prototype)}}else{try{throw Error()}catch(pe){le=pe}(_e=a())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(pe){if(pe&&le&&typeof pe.stack=="string")return[pe.stack,le.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=h.DetermineComponentFrameRoot(),j=b[0],$=b[1];if(j&&$){var W=j.split(`
`),J=$.split(`
`);for(y=h=0;h<W.length&&!W[h].includes("DetermineComponentFrameRoot");)h++;for(;y<J.length&&!J[y].includes("DetermineComponentFrameRoot");)y++;if(h===W.length||y===J.length)for(h=W.length-1,y=J.length-1;1<=h&&0<=y&&W[h]!==J[y];)y--;for(;1<=h&&0<=y;h--,y--)if(W[h]!==J[y]){if(h!==1||y!==1)do if(h--,y--,0>y||W[h]!==J[y]){var me=`
`+W[h].replace(" at new "," at ");return a.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",a.displayName)),me}while(1<=h&&0<=y);break}}}finally{Y=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?I(c):""}function B(a){switch(a.tag){case 26:case 27:case 5:return I(a.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 15:return a=Z(a.type,!1),a;case 11:return a=Z(a.type.render,!1),a;case 1:return a=Z(a.type,!0),a;default:return""}}function G(a){try{var s="";do s+=B(a),a=a.return;while(a);return s}catch(c){return`
Error generating stack: `+c.message+`
`+c.stack}}function F(a){var s=a,c=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,s.flags&4098&&(c=s.return),a=s.return;while(a)}return s.tag===3?c:null}function K(a){if(a.tag===13){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function A(a){if(F(a)!==a)throw Error(r(188))}function H(a){var s=a.alternate;if(!s){if(s=F(a),s===null)throw Error(r(188));return s!==a?null:a}for(var c=a,h=s;;){var y=c.return;if(y===null)break;var b=y.alternate;if(b===null){if(h=y.return,h!==null){c=h;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===c)return A(y),a;if(b===h)return A(y),s;b=b.sibling}throw Error(r(188))}if(c.return!==h.return)c=y,h=b;else{for(var j=!1,$=y.child;$;){if($===c){j=!0,c=y,h=b;break}if($===h){j=!0,h=y,c=b;break}$=$.sibling}if(!j){for($=b.child;$;){if($===c){j=!0,c=b,h=y;break}if($===h){j=!0,h=b,c=y;break}$=$.sibling}if(!j)throw Error(r(189))}}if(c.alternate!==h)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?a:s}function M(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a;for(a=a.child;a!==null;){if(s=M(a),s!==null)return s;a=a.sibling}return null}var O=Array.isArray,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ue=[],ae=-1;function oe(a){return{current:a}}function Ce(a){0>ae||(a.current=ue[ae],ue[ae]=null,ae--)}function he(a,s){ae++,ue[ae]=a.current,a.current=s}var Ee=oe(null),we=oe(null),Pe=oe(null),Ae=oe(null);function xe(a,s){switch(he(Pe,s),he(we,a),he(Ee,null),a=s.nodeType,a){case 9:case 11:s=(s=s.documentElement)&&(s=s.namespaceURI)?h0(s):0;break;default:if(a=a===8?s.parentNode:s,s=a.tagName,a=a.namespaceURI)a=h0(a),s=p0(a,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Ce(Ee),he(Ee,s)}function ee(){Ce(Ee),Ce(we),Ce(Pe)}function ce(a){a.memoizedState!==null&&he(Ae,a);var s=Ee.current,c=p0(s,a.type);s!==c&&(he(we,a),he(Ee,c))}function Te(a){we.current===a&&(Ce(Ee),Ce(we)),Ae.current===a&&(Ce(Ae),bl._currentValue=re)}var ge=Object.prototype.hasOwnProperty,Se=e.unstable_scheduleCallback,ie=e.unstable_cancelCallback,$e=e.unstable_shouldYield,Ge=e.unstable_requestPaint,ve=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,He=e.unstable_LowPriority,Ye=e.unstable_IdlePriority,vt=e.log,Mt=e.unstable_setDisableYieldValue,bt=null,rt=null;function qt(a){if(rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(bt,a,void 0,(a.current.flags&128)===128)}catch{}}function at(a){if(typeof vt=="function"&&Mt(a),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(bt,a)}catch{}}var At=Math.clz32?Math.clz32:xu,rn=Math.log,io=Math.LN2;function xu(a){return a>>>=0,a===0?32:31-(rn(a)/io|0)|0}var ao=128,Di=4194304;function dn(a){var s=a&42;if(s!==0)return s;switch(a&-a){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 a&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function oo(a,s){var c=a.pendingLanes;if(c===0)return 0;var h=0,y=a.suspendedLanes,b=a.pingedLanes,j=a.warmLanes;a=a.finishedLanes!==0;var $=c&134217727;return $!==0?(c=$&~y,c!==0?h=dn(c):(b&=$,b!==0?h=dn(b):a||(j=$&~j,j!==0&&(h=dn(j))))):($=c&~y,$!==0?h=dn($):b!==0?h=dn(b):a||(j=c&~j,j!==0&&(h=dn(j)))),h===0?0:s!==0&&s!==h&&!(s&y)&&(y=h&-h,j=s&-s,y>=j||y===32&&(j&4194176)!==0)?s:h}function Ze(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function gt(a,s){switch(a){case 1:case 2:case 4:case 8:return s+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 s+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 _t(){var a=ao;return ao<<=1,!(ao&4194176)&&(ao=128),a}function Cn(){var a=Di;return Di<<=1,!(Di&62914560)&&(Di=4194304),a}function Sn(a){for(var s=[],c=0;31>c;c++)s.push(a);return s}function Tn(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Zr(a,s,c,h,y,b){var j=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var $=a.entanglements,W=a.expirationTimes,J=a.hiddenUpdates;for(c=j&~c;0<c;){var me=31-At(c),_e=1<<me;$[me]=0,W[me]=-1;var le=J[me];if(le!==null)for(J[me]=null,me=0;me<le.length;me++){var pe=le[me];pe!==null&&(pe.lane&=-536870913)}c&=~_e}h!==0&&An(a,h,0),b!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=b&~(j&~s))}function An(a,s,c){a.pendingLanes|=s,a.suspendedLanes&=~s;var h=31-At(s);a.entangledLanes|=s,a.entanglements[h]=a.entanglements[h]|1073741824|c&4194218}function gr(a,s){var c=a.entangledLanes|=s;for(a=a.entanglements;c;){var h=31-At(c),y=1<<h;y&s|a[h]&s&&(a[h]|=s),c&=~y}}function ub(a){return a&=-a,2<a?8<a?a&134217727?32:268435456:8:2}function cb(){var a=X.p;return a!==0?a:(a=window.event,a===void 0?32:O0(a.type))}function XD(a,s){var c=X.p;try{return X.p=a,s()}finally{X.p=c}}var Ni=Math.random().toString(36).slice(2),hn="__reactFiber$"+Ni,Rn="__reactProps$"+Ni,so="__reactContainer$"+Ni,Ld="__reactEvents$"+Ni,KD="__reactListeners$"+Ni,ZD="__reactHandles$"+Ni,fb="__reactResources$"+Ni,Ns="__reactMarker$"+Ni;function zd(a){delete a[hn],delete a[Rn],delete a[Ld],delete a[KD],delete a[ZD]}function va(a){var s=a[hn];if(s)return s;for(var c=a.parentNode;c;){if(s=c[so]||c[hn]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(a=v0(a);a!==null;){if(c=a[hn])return c;a=v0(a)}return s}a=c,c=a.parentNode}return null}function lo(a){if(a=a[hn]||a[so]){var s=a.tag;if(s===5||s===6||s===13||s===26||s===27||s===3)return a}return null}function Os(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(r(33))}function uo(a){var s=a[fb];return s||(s=a[fb]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Kt(a){a[Ns]=!0}var db=new Set,hb={};function ya(a,s){co(a,s),co(a+"Capture",s)}function co(a,s){for(hb[a]=s,a=0;a<s.length;a++)db.add(s[a])}var Qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),QD=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]*$"),pb={},mb={};function JD(a){return ge.call(mb,a)?!0:ge.call(pb,a)?!1:QD.test(a)?mb[a]=!0:(pb[a]=!0,!1)}function wu(a,s,c){if(JD(s))if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+c)}}function Su(a,s,c){if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(s);return}a.setAttribute(s,""+c)}}function Jr(a,s,c,h){if(h===null)a.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(s,c,""+h)}}function Zn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function gb(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function eN(a){var s=gb(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,s),h=""+a[s];if(!a.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var y=c.get,b=c.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return y.call(this)},set:function(j){h=""+j,b.call(this,j)}}),Object.defineProperty(a,s,{enumerable:c.enumerable}),{getValue:function(){return h},setValue:function(j){h=""+j},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function Eu(a){a._valueTracker||(a._valueTracker=eN(a))}function vb(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var c=s.getValue(),h="";return a&&(h=gb(a)?a.checked?"true":"false":a.value),a=h,a!==c?(s.setValue(a),!0):!1}function _u(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var tN=/[\n"\\]/g;function Qn(a){return a.replace(tN,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Md(a,s,c,h,y,b,j,$){a.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?a.type=j:a.removeAttribute("type"),s!=null?j==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+Zn(s)):a.value!==""+Zn(s)&&(a.value=""+Zn(s)):j!=="submit"&&j!=="reset"||a.removeAttribute("value"),s!=null?Pd(a,j,Zn(s)):c!=null?Pd(a,j,Zn(c)):h!=null&&a.removeAttribute("value"),y==null&&b!=null&&(a.defaultChecked=!!b),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?a.name=""+Zn($):a.removeAttribute("name")}function yb(a,s,c,h,y,b,j,$){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(a.type=b),s!=null||c!=null){if(!(b!=="submit"&&b!=="reset"||s!=null))return;c=c!=null?""+Zn(c):"",s=s!=null?""+Zn(s):c,$||s===a.value||(a.value=s),a.defaultValue=s}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=$?a.checked:!!h,a.defaultChecked=!!h,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(a.name=j)}function Pd(a,s,c){s==="number"&&_u(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function fo(a,s,c,h){if(a=a.options,s){s={};for(var y=0;y<c.length;y++)s["$"+c[y]]=!0;for(c=0;c<a.length;c++)y=s.hasOwnProperty("$"+a[c].value),a[c].selected!==y&&(a[c].selected=y),y&&h&&(a[c].defaultSelected=!0)}else{for(c=""+Zn(c),s=null,y=0;y<a.length;y++){if(a[y].value===c){a[y].selected=!0,h&&(a[y].defaultSelected=!0);return}s!==null||a[y].disabled||(s=a[y])}s!==null&&(s.selected=!0)}}function bb(a,s,c){if(s!=null&&(s=""+Zn(s),s!==a.value&&(a.value=s),c==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=c!=null?""+Zn(c):""}function xb(a,s,c,h){if(s==null){if(h!=null){if(c!=null)throw Error(r(92));if(O(h)){if(1<h.length)throw Error(r(93));h=h[0]}c=h}c==null&&(c=""),s=c}c=Zn(s),a.defaultValue=c,h=a.textContent,h===c&&h!==""&&h!==null&&(a.value=h)}function ho(a,s){if(s){var c=a.firstChild;if(c&&c===a.lastChild&&c.nodeType===3){c.nodeValue=s;return}}a.textContent=s}var nN=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 wb(a,s,c){var h=s.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":h?a.setProperty(s,c):typeof c!="number"||c===0||nN.has(s)?s==="float"?a.cssFloat=c:a[s]=(""+c).trim():a[s]=c+"px"}function Sb(a,s,c){if(s!=null&&typeof s!="object")throw Error(r(62));if(a=a.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var y in s)h=s[y],s.hasOwnProperty(y)&&c[y]!==h&&wb(a,y,h)}else for(var b in s)s.hasOwnProperty(b)&&wb(a,b,s[b])}function Fd(a){if(a.indexOf("-")===-1)return!1;switch(a){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 rN=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"]]),iN=/^[\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 ku(a){return iN.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var Id=null;function Gd(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var po=null,mo=null;function Eb(a){var s=lo(a);if(s&&(a=s.stateNode)){var c=a[Rn]||null;e:switch(a=s.stateNode,s.type){case"input":if(Md(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),s=c.name,c.type==="radio"&&s!=null){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Qn(""+s)+'"][type="radio"]'),s=0;s<c.length;s++){var h=c[s];if(h!==a&&h.form===a.form){var y=h[Rn]||null;if(!y)throw Error(r(90));Md(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(s=0;s<c.length;s++)h=c[s],h.form===a.form&&vb(h)}break e;case"textarea":bb(a,c.value,c.defaultValue);break e;case"select":s=c.value,s!=null&&fo(a,!!c.multiple,s,!1)}}}var Ud=!1;function _b(a,s,c){if(Ud)return a(s,c);Ud=!0;try{var h=a(s);return h}finally{if(Ud=!1,(po!==null||mo!==null)&&(lc(),po&&(s=po,a=mo,mo=po=null,Eb(s),a)))for(s=0;s<a.length;s++)Eb(a[s])}}function js(a,s){var c=a.stateNode;if(c===null)return null;var h=c[Rn]||null;if(h===null)return null;c=h[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break e;default:a=!1}if(a)return null;if(c&&typeof c!="function")throw Error(r(231,s,typeof c));return c}var Bd=!1;if(Qr)try{var Ls={};Object.defineProperty(Ls,"passive",{get:function(){Bd=!0}}),window.addEventListener("test",Ls,Ls),window.removeEventListener("test",Ls,Ls)}catch{Bd=!1}var Oi=null,$d=null,Cu=null;function kb(){if(Cu)return Cu;var a,s=$d,c=s.length,h,y="value"in Oi?Oi.value:Oi.textContent,b=y.length;for(a=0;a<c&&s[a]===y[a];a++);var j=c-a;for(h=1;h<=j&&s[c-h]===y[b-h];h++);return Cu=y.slice(a,1<h?1-h:void 0)}function Tu(a){var s=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&s===13&&(a=13)):a=s,a===10&&(a=13),32<=a||a===13?a:0}function Au(){return!0}function Cb(){return!1}function Dn(a){function s(c,h,y,b,j){this._reactName=c,this._targetInst=y,this.type=h,this.nativeEvent=b,this.target=j,this.currentTarget=null;for(var $ in a)a.hasOwnProperty($)&&(c=a[$],this[$]=c?c(b):b[$]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Au:Cb,this.isPropagationStopped=Cb,this}return z(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Au)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Au)},persist:function(){},isPersistent:Au}),s}var ba={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ru=Dn(ba),zs=z({},ba,{view:0,detail:0}),aN=Dn(zs),Hd,Vd,Ms,Du=z({},zs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yd,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Ms&&(Ms&&a.type==="mousemove"?(Hd=a.screenX-Ms.screenX,Vd=a.screenY-Ms.screenY):Vd=Hd=0,Ms=a),Hd)},movementY:function(a){return"movementY"in a?a.movementY:Vd}}),Tb=Dn(Du),oN=z({},Du,{dataTransfer:0}),sN=Dn(oN),lN=z({},zs,{relatedTarget:0}),qd=Dn(lN),uN=z({},ba,{animationName:0,elapsedTime:0,pseudoElement:0}),cN=Dn(uN),fN=z({},ba,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),dN=Dn(fN),hN=z({},ba,{data:0}),Ab=Dn(hN),pN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mN={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"},gN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vN(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=gN[a])?!!s[a]:!1}function Yd(){return vN}var yN=z({},zs,{key:function(a){if(a.key){var s=pN[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=Tu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?mN[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yd,charCode:function(a){return a.type==="keypress"?Tu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Tu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),bN=Dn(yN),xN=z({},Du,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rb=Dn(xN),wN=z({},zs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yd}),SN=Dn(wN),EN=z({},ba,{propertyName:0,elapsedTime:0,pseudoElement:0}),_N=Dn(EN),kN=z({},Du,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),CN=Dn(kN),TN=z({},ba,{newState:0,oldState:0}),AN=Dn(TN),RN=[9,13,27,32],Wd=Qr&&"CompositionEvent"in window,Ps=null;Qr&&"documentMode"in document&&(Ps=document.documentMode);var DN=Qr&&"TextEvent"in window&&!Ps,Db=Qr&&(!Wd||Ps&&8<Ps&&11>=Ps),Nb=" ",Ob=!1;function jb(a,s){switch(a){case"keyup":return RN.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lb(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var go=!1;function NN(a,s){switch(a){case"compositionend":return Lb(s);case"keypress":return s.which!==32?null:(Ob=!0,Nb);case"textInput":return a=s.data,a===Nb&&Ob?null:a;default:return null}}function ON(a,s){if(go)return a==="compositionend"||!Wd&&jb(a,s)?(a=kb(),Cu=$d=Oi=null,go=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Db&&s.locale!=="ko"?null:s.data;default:return null}}var jN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function zb(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!jN[a.type]:s==="textarea"}function Mb(a,s,c,h){po?mo?mo.push(h):mo=[h]:po=h,s=hc(s,"onChange"),0<s.length&&(c=new Ru("onChange","change",null,c,h),a.push({event:c,listeners:s}))}var Fs=null,Is=null;function LN(a){l0(a,0)}function Nu(a){var s=Os(a);if(vb(s))return a}function Pb(a,s){if(a==="change")return s}var Fb=!1;if(Qr){var Xd;if(Qr){var Kd="oninput"in document;if(!Kd){var Ib=document.createElement("div");Ib.setAttribute("oninput","return;"),Kd=typeof Ib.oninput=="function"}Xd=Kd}else Xd=!1;Fb=Xd&&(!document.documentMode||9<document.documentMode)}function Gb(){Fs&&(Fs.detachEvent("onpropertychange",Ub),Is=Fs=null)}function Ub(a){if(a.propertyName==="value"&&Nu(Is)){var s=[];Mb(s,Is,a,Gd(a)),_b(LN,s)}}function zN(a,s,c){a==="focusin"?(Gb(),Fs=s,Is=c,Fs.attachEvent("onpropertychange",Ub)):a==="focusout"&&Gb()}function MN(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Nu(Is)}function PN(a,s){if(a==="click")return Nu(s)}function FN(a,s){if(a==="input"||a==="change")return Nu(s)}function IN(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var Gn=typeof Object.is=="function"?Object.is:IN;function Gs(a,s){if(Gn(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var c=Object.keys(a),h=Object.keys(s);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var y=c[h];if(!ge.call(s,y)||!Gn(a[y],s[y]))return!1}return!0}function Bb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function $b(a,s){var c=Bb(a);a=0;for(var h;c;){if(c.nodeType===3){if(h=a+c.textContent.length,a<=s&&h>=s)return{node:c,offset:s-a};a=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Bb(c)}}function Hb(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?Hb(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function Vb(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=_u(a.document);s instanceof a.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)a=s.contentWindow;else break;s=_u(a.document)}return s}function Zd(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}function GN(a,s){var c=Vb(s);s=a.focusedElem;var h=a.selectionRange;if(c!==s&&s&&s.ownerDocument&&Hb(s.ownerDocument.documentElement,s)){if(h!==null&&Zd(s)){if(a=h.start,c=h.end,c===void 0&&(c=a),"selectionStart"in s)s.selectionStart=a,s.selectionEnd=Math.min(c,s.value.length);else if(c=(a=s.ownerDocument||document)&&a.defaultView||window,c.getSelection){c=c.getSelection();var y=s.textContent.length,b=Math.min(h.start,y);h=h.end===void 0?b:Math.min(h.end,y),!c.extend&&b>h&&(y=h,h=b,b=y),y=$b(s,b);var j=$b(s,h);y&&j&&(c.rangeCount!==1||c.anchorNode!==y.node||c.anchorOffset!==y.offset||c.focusNode!==j.node||c.focusOffset!==j.offset)&&(a=a.createRange(),a.setStart(y.node,y.offset),c.removeAllRanges(),b>h?(c.addRange(a),c.extend(j.node,j.offset)):(a.setEnd(j.node,j.offset),c.addRange(a)))}}for(a=[],c=s;c=c.parentNode;)c.nodeType===1&&a.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<a.length;s++)c=a[s],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var UN=Qr&&"documentMode"in document&&11>=document.documentMode,vo=null,Qd=null,Us=null,Jd=!1;function qb(a,s,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Jd||vo==null||vo!==_u(h)||(h=vo,"selectionStart"in h&&Zd(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Us&&Gs(Us,h)||(Us=h,h=hc(Qd,"onSelect"),0<h.length&&(s=new Ru("onSelect","select",null,s,c),a.push({event:s,listeners:h}),s.target=vo)))}function xa(a,s){var c={};return c[a.toLowerCase()]=s.toLowerCase(),c["Webkit"+a]="webkit"+s,c["Moz"+a]="moz"+s,c}var yo={animationend:xa("Animation","AnimationEnd"),animationiteration:xa("Animation","AnimationIteration"),animationstart:xa("Animation","AnimationStart"),transitionrun:xa("Transition","TransitionRun"),transitionstart:xa("Transition","TransitionStart"),transitioncancel:xa("Transition","TransitionCancel"),transitionend:xa("Transition","TransitionEnd")},eh={},Yb={};Qr&&(Yb=document.createElement("div").style,"AnimationEvent"in window||(delete yo.animationend.animation,delete yo.animationiteration.animation,delete yo.animationstart.animation),"TransitionEvent"in window||delete yo.transitionend.transition);function wa(a){if(eh[a])return eh[a];if(!yo[a])return a;var s=yo[a],c;for(c in s)if(s.hasOwnProperty(c)&&c in Yb)return eh[a]=s[c];return a}var Wb=wa("animationend"),Xb=wa("animationiteration"),Kb=wa("animationstart"),BN=wa("transitionrun"),$N=wa("transitionstart"),HN=wa("transitioncancel"),Zb=wa("transitionend"),Qb=new Map,Jb="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 vr(a,s){Qb.set(a,s),ya(s,[a])}var Jn=[],bo=0,th=0;function Ou(){for(var a=bo,s=th=bo=0;s<a;){var c=Jn[s];Jn[s++]=null;var h=Jn[s];Jn[s++]=null;var y=Jn[s];Jn[s++]=null;var b=Jn[s];if(Jn[s++]=null,h!==null&&y!==null){var j=h.pending;j===null?y.next=y:(y.next=j.next,j.next=y),h.pending=y}b!==0&&ex(c,y,b)}}function ju(a,s,c,h){Jn[bo++]=a,Jn[bo++]=s,Jn[bo++]=c,Jn[bo++]=h,th|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function nh(a,s,c,h){return ju(a,s,c,h),Lu(a)}function ji(a,s){return ju(a,null,null,s),Lu(a)}function ex(a,s,c){a.lanes|=c;var h=a.alternate;h!==null&&(h.lanes|=c);for(var y=!1,b=a.return;b!==null;)b.childLanes|=c,h=b.alternate,h!==null&&(h.childLanes|=c),b.tag===22&&(a=b.stateNode,a===null||a._visibility&1||(y=!0)),a=b,b=b.return;y&&s!==null&&a.tag===3&&(b=a.stateNode,y=31-At(c),b=b.hiddenUpdates,a=b[y],a===null?b[y]=[s]:a.push(s),s.lane=c|536870912)}function Lu(a){if(50<dl)throw dl=0,lp=null,Error(r(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var xo={},tx=new WeakMap;function er(a,s){if(typeof a=="object"&&a!==null){var c=tx.get(a);return c!==void 0?c:(s={value:a,source:s,stack:G(s)},tx.set(a,s),s)}return{value:a,source:s,stack:G(s)}}var wo=[],So=0,zu=null,Mu=0,tr=[],nr=0,Sa=null,ei=1,ti="";function Ea(a,s){wo[So++]=Mu,wo[So++]=zu,zu=a,Mu=s}function nx(a,s,c){tr[nr++]=ei,tr[nr++]=ti,tr[nr++]=Sa,Sa=a;var h=ei;a=ti;var y=32-At(h)-1;h&=~(1<<y),c+=1;var b=32-At(s)+y;if(30<b){var j=y-y%5;b=(h&(1<<j)-1).toString(32),h>>=j,y-=j,ei=1<<32-At(s)+y|c<<y|h,ti=b+a}else ei=1<<b|c<<y|h,ti=a}function rh(a){a.return!==null&&(Ea(a,1),nx(a,1,0))}function ih(a){for(;a===zu;)zu=wo[--So],wo[So]=null,Mu=wo[--So],wo[So]=null;for(;a===Sa;)Sa=tr[--nr],tr[nr]=null,ti=tr[--nr],tr[nr]=null,ei=tr[--nr],tr[nr]=null}var En=null,an=null,pt=!1,yr=null,jr=!1,ah=Error(r(519));function _a(a){var s=Error(r(418,""));throw Hs(er(s,a)),ah}function rx(a){var s=a.stateNode,c=a.type,h=a.memoizedProps;switch(s[hn]=a,s[Rn]=h,c){case"dialog":ft("cancel",s),ft("close",s);break;case"iframe":case"object":case"embed":ft("load",s);break;case"video":case"audio":for(c=0;c<pl.length;c++)ft(pl[c],s);break;case"source":ft("error",s);break;case"img":case"image":case"link":ft("error",s),ft("load",s);break;case"details":ft("toggle",s);break;case"input":ft("invalid",s),yb(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),Eu(s);break;case"select":ft("invalid",s);break;case"textarea":ft("invalid",s),xb(s,h.value,h.defaultValue,h.children),Eu(s)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||s.textContent===""+c||h.suppressHydrationWarning===!0||d0(s.textContent,c)?(h.popover!=null&&(ft("beforetoggle",s),ft("toggle",s)),h.onScroll!=null&&ft("scroll",s),h.onScrollEnd!=null&&ft("scrollend",s),h.onClick!=null&&(s.onclick=pc),s=!0):s=!1,s||_a(a)}function ix(a){for(En=a.return;En;)switch(En.tag){case 3:case 27:jr=!0;return;case 5:case 13:jr=!1;return;default:En=En.return}}function Bs(a){if(a!==En)return!1;if(!pt)return ix(a),pt=!0,!1;var s=!1,c;if((c=a.tag!==3&&a.tag!==27)&&((c=a.tag===5)&&(c=a.type,c=!(c!=="form"&&c!=="button")||kp(a.type,a.memoizedProps)),c=!c),c&&(s=!0),s&&an&&_a(a),ix(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));e:{for(a=a.nextSibling,s=0;a;){if(a.nodeType===8)if(c=a.data,c==="/$"){if(s===0){an=xr(a.nextSibling);break e}s--}else c!=="$"&&c!=="$!"&&c!=="$?"||s++;a=a.nextSibling}an=null}}else an=En?xr(a.stateNode.nextSibling):null;return!0}function $s(){an=En=null,pt=!1}function Hs(a){yr===null?yr=[a]:yr.push(a)}var Vs=Error(r(460)),ax=Error(r(474)),oh={then:function(){}};function ox(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Pu(){}function sx(a,s,c){switch(c=a[c],c===void 0?a.push(s):c!==s&&(s.then(Pu,Pu),s=c),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,a===Vs?Error(r(483)):a;default:if(typeof s.status=="string")s.then(Pu,Pu);else{if(a=Rt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=s,a.status="pending",a.then(function(h){if(s.status==="pending"){var y=s;y.status="fulfilled",y.value=h}},function(h){if(s.status==="pending"){var y=s;y.status="rejected",y.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,a===Vs?Error(r(483)):a}throw qs=s,Vs}}var qs=null;function lx(){if(qs===null)throw Error(r(459));var a=qs;return qs=null,a}var Eo=null,Ys=0;function Fu(a){var s=Ys;return Ys+=1,Eo===null&&(Eo=[]),sx(Eo,a,s)}function Ws(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function Iu(a,s){throw s.$$typeof===o?Error(r(525)):(a=Object.prototype.toString.call(s),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":a)))}function ux(a){var s=a._init;return s(a._payload)}function cx(a){function s(ne,Q){if(a){var se=ne.deletions;se===null?(ne.deletions=[Q],ne.flags|=16):se.push(Q)}}function c(ne,Q){if(!a)return null;for(;Q!==null;)s(ne,Q),Q=Q.sibling;return null}function h(ne){for(var Q=new Map;ne!==null;)ne.key!==null?Q.set(ne.key,ne):Q.set(ne.index,ne),ne=ne.sibling;return Q}function y(ne,Q){return ne=Vi(ne,Q),ne.index=0,ne.sibling=null,ne}function b(ne,Q,se){return ne.index=se,a?(se=ne.alternate,se!==null?(se=se.index,se<Q?(ne.flags|=33554434,Q):se):(ne.flags|=33554434,Q)):(ne.flags|=1048576,Q)}function j(ne){return a&&ne.alternate===null&&(ne.flags|=33554434),ne}function $(ne,Q,se,ye){return Q===null||Q.tag!==6?(Q=ep(se,ne.mode,ye),Q.return=ne,Q):(Q=y(Q,se),Q.return=ne,Q)}function W(ne,Q,se,ye){var Ie=se.type;return Ie===f?me(ne,Q,se.props.children,ye,se.key):Q!==null&&(Q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===_&&ux(Ie)===Q.type)?(Q=y(Q,se.props),Ws(Q,se),Q.return=ne,Q):(Q=rc(se.type,se.key,se.props,null,ne.mode,ye),Ws(Q,se),Q.return=ne,Q)}function J(ne,Q,se,ye){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==se.containerInfo||Q.stateNode.implementation!==se.implementation?(Q=tp(se,ne.mode,ye),Q.return=ne,Q):(Q=y(Q,se.children||[]),Q.return=ne,Q)}function me(ne,Q,se,ye,Ie){return Q===null||Q.tag!==7?(Q=La(se,ne.mode,ye,Ie),Q.return=ne,Q):(Q=y(Q,se),Q.return=ne,Q)}function _e(ne,Q,se){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=ep(""+Q,ne.mode,se),Q.return=ne,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case l:return se=rc(Q.type,Q.key,Q.props,null,ne.mode,se),Ws(se,Q),se.return=ne,se;case u:return Q=tp(Q,ne.mode,se),Q.return=ne,Q;case _:var ye=Q._init;return Q=ye(Q._payload),_e(ne,Q,se)}if(O(Q)||L(Q))return Q=La(Q,ne.mode,se,null),Q.return=ne,Q;if(typeof Q.then=="function")return _e(ne,Fu(Q),se);if(Q.$$typeof===g)return _e(ne,ec(ne,Q),se);Iu(ne,Q)}return null}function le(ne,Q,se,ye){var Ie=Q!==null?Q.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Ie!==null?null:$(ne,Q,""+se,ye);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case l:return se.key===Ie?W(ne,Q,se,ye):null;case u:return se.key===Ie?J(ne,Q,se,ye):null;case _:return Ie=se._init,se=Ie(se._payload),le(ne,Q,se,ye)}if(O(se)||L(se))return Ie!==null?null:me(ne,Q,se,ye,null);if(typeof se.then=="function")return le(ne,Q,Fu(se),ye);if(se.$$typeof===g)return le(ne,Q,ec(ne,se),ye);Iu(ne,se)}return null}function pe(ne,Q,se,ye,Ie){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return ne=ne.get(se)||null,$(Q,ne,""+ye,Ie);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case l:return ne=ne.get(ye.key===null?se:ye.key)||null,W(Q,ne,ye,Ie);case u:return ne=ne.get(ye.key===null?se:ye.key)||null,J(Q,ne,ye,Ie);case _:var ot=ye._init;return ye=ot(ye._payload),pe(ne,Q,se,ye,Ie)}if(O(ye)||L(ye))return ne=ne.get(se)||null,me(Q,ne,ye,Ie,null);if(typeof ye.then=="function")return pe(ne,Q,se,Fu(ye),Ie);if(ye.$$typeof===g)return pe(ne,Q,se,ec(Q,ye),Ie);Iu(Q,ye)}return null}function Ue(ne,Q,se,ye){for(var Ie=null,ot=null,Ve=Q,Ke=Q=0,Jt=null;Ve!==null&&Ke<se.length;Ke++){Ve.index>Ke?(Jt=Ve,Ve=null):Jt=Ve.sibling;var mt=le(ne,Ve,se[Ke],ye);if(mt===null){Ve===null&&(Ve=Jt);break}a&&Ve&&mt.alternate===null&&s(ne,Ve),Q=b(mt,Q,Ke),ot===null?Ie=mt:ot.sibling=mt,ot=mt,Ve=Jt}if(Ke===se.length)return c(ne,Ve),pt&&Ea(ne,Ke),Ie;if(Ve===null){for(;Ke<se.length;Ke++)Ve=_e(ne,se[Ke],ye),Ve!==null&&(Q=b(Ve,Q,Ke),ot===null?Ie=Ve:ot.sibling=Ve,ot=Ve);return pt&&Ea(ne,Ke),Ie}for(Ve=h(Ve);Ke<se.length;Ke++)Jt=pe(Ve,ne,Ke,se[Ke],ye),Jt!==null&&(a&&Jt.alternate!==null&&Ve.delete(Jt.key===null?Ke:Jt.key),Q=b(Jt,Q,Ke),ot===null?Ie=Jt:ot.sibling=Jt,ot=Jt);return a&&Ve.forEach(function(Qi){return s(ne,Qi)}),pt&&Ea(ne,Ke),Ie}function Je(ne,Q,se,ye){if(se==null)throw Error(r(151));for(var Ie=null,ot=null,Ve=Q,Ke=Q=0,Jt=null,mt=se.next();Ve!==null&&!mt.done;Ke++,mt=se.next()){Ve.index>Ke?(Jt=Ve,Ve=null):Jt=Ve.sibling;var Qi=le(ne,Ve,mt.value,ye);if(Qi===null){Ve===null&&(Ve=Jt);break}a&&Ve&&Qi.alternate===null&&s(ne,Ve),Q=b(Qi,Q,Ke),ot===null?Ie=Qi:ot.sibling=Qi,ot=Qi,Ve=Jt}if(mt.done)return c(ne,Ve),pt&&Ea(ne,Ke),Ie;if(Ve===null){for(;!mt.done;Ke++,mt=se.next())mt=_e(ne,mt.value,ye),mt!==null&&(Q=b(mt,Q,Ke),ot===null?Ie=mt:ot.sibling=mt,ot=mt);return pt&&Ea(ne,Ke),Ie}for(Ve=h(Ve);!mt.done;Ke++,mt=se.next())mt=pe(Ve,ne,Ke,mt.value,ye),mt!==null&&(a&&mt.alternate!==null&&Ve.delete(mt.key===null?Ke:mt.key),Q=b(mt,Q,Ke),ot===null?Ie=mt:ot.sibling=mt,ot=mt);return a&&Ve.forEach(function(ij){return s(ne,ij)}),pt&&Ea(ne,Ke),Ie}function It(ne,Q,se,ye){if(typeof se=="object"&&se!==null&&se.type===f&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case l:e:{for(var Ie=se.key;Q!==null;){if(Q.key===Ie){if(Ie=se.type,Ie===f){if(Q.tag===7){c(ne,Q.sibling),ye=y(Q,se.props.children),ye.return=ne,ne=ye;break e}}else if(Q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===_&&ux(Ie)===Q.type){c(ne,Q.sibling),ye=y(Q,se.props),Ws(ye,se),ye.return=ne,ne=ye;break e}c(ne,Q);break}else s(ne,Q);Q=Q.sibling}se.type===f?(ye=La(se.props.children,ne.mode,ye,se.key),ye.return=ne,ne=ye):(ye=rc(se.type,se.key,se.props,null,ne.mode,ye),Ws(ye,se),ye.return=ne,ne=ye)}return j(ne);case u:e:{for(Ie=se.key;Q!==null;){if(Q.key===Ie)if(Q.tag===4&&Q.stateNode.containerInfo===se.containerInfo&&Q.stateNode.implementation===se.implementation){c(ne,Q.sibling),ye=y(Q,se.children||[]),ye.return=ne,ne=ye;break e}else{c(ne,Q);break}else s(ne,Q);Q=Q.sibling}ye=tp(se,ne.mode,ye),ye.return=ne,ne=ye}return j(ne);case _:return Ie=se._init,se=Ie(se._payload),It(ne,Q,se,ye)}if(O(se))return Ue(ne,Q,se,ye);if(L(se)){if(Ie=L(se),typeof Ie!="function")throw Error(r(150));return se=Ie.call(se),Je(ne,Q,se,ye)}if(typeof se.then=="function")return It(ne,Q,Fu(se),ye);if(se.$$typeof===g)return It(ne,Q,ec(ne,se),ye);Iu(ne,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,Q!==null&&Q.tag===6?(c(ne,Q.sibling),ye=y(Q,se),ye.return=ne,ne=ye):(c(ne,Q),ye=ep(se,ne.mode,ye),ye.return=ne,ne=ye),j(ne)):c(ne,Q)}return function(ne,Q,se,ye){try{Ys=0;var Ie=It(ne,Q,se,ye);return Eo=null,Ie}catch(Ve){if(Ve===Vs)throw Ve;var ot=or(29,Ve,null,ne.mode);return ot.lanes=ye,ot.return=ne,ot}finally{}}}var ka=cx(!0),fx=cx(!1),_o=oe(null),Gu=oe(0);function dx(a,s){a=di,he(Gu,a),he(_o,s),di=a|s.baseLanes}function sh(){he(Gu,di),he(_o,_o.current)}function lh(){di=Gu.current,Ce(_o),Ce(Gu)}var rr=oe(null),Lr=null;function Li(a){var s=a.alternate;he(Yt,Yt.current&1),he(rr,a),Lr===null&&(s===null||_o.current!==null||s.memoizedState!==null)&&(Lr=a)}function hx(a){if(a.tag===22){if(he(Yt,Yt.current),he(rr,a),Lr===null){var s=a.alternate;s!==null&&s.memoizedState!==null&&(Lr=a)}}else zi()}function zi(){he(Yt,Yt.current),he(rr,rr.current)}function ni(a){Ce(rr),Lr===a&&(Lr=null),Ce(Yt)}var Yt=oe(0);function Uu(a){for(var s=a;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if(s.flags&128)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var VN=typeof AbortController<"u"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(c,h){a.push(h)}};this.abort=function(){s.aborted=!0,a.forEach(function(c){return c()})}},qN=e.unstable_scheduleCallback,YN=e.unstable_NormalPriority,Wt={$$typeof:g,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uh(){return{controller:new VN,data:new Map,refCount:0}}function Xs(a){a.refCount--,a.refCount===0&&qN(YN,function(){a.controller.abort()})}var Ks=null,ch=0,ko=0,Co=null;function WN(a,s){if(Ks===null){var c=Ks=[];ch=0,ko=gp(),Co={status:"pending",value:void 0,then:function(h){c.push(h)}}}return ch++,s.then(px,px),s}function px(){if(--ch===0&&Ks!==null){Co!==null&&(Co.status="fulfilled");var a=Ks;Ks=null,ko=0,Co=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function XN(a,s){var c=[],h={status:"pending",value:null,reason:null,then:function(y){c.push(y)}};return a.then(function(){h.status="fulfilled",h.value=s;for(var y=0;y<c.length;y++)(0,c[y])(s)},function(y){for(h.status="rejected",h.reason=y,y=0;y<c.length;y++)(0,c[y])(void 0)}),h}var mx=P.S;P.S=function(a,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&WN(a,s),mx!==null&&mx(a,s)};var Ca=oe(null);function fh(){var a=Ca.current;return a!==null?a:Rt.pooledCache}function Bu(a,s){s===null?he(Ca,Ca.current):he(Ca,s.pool)}function gx(){var a=fh();return a===null?null:{parent:Wt._currentValue,pool:a}}var Mi=0,it=null,xt=null,Bt=null,$u=!1,To=!1,Ta=!1,Hu=0,Zs=0,Ao=null,KN=0;function Gt(){throw Error(r(321))}function dh(a,s){if(s===null)return!1;for(var c=0;c<s.length&&c<a.length;c++)if(!Gn(a[c],s[c]))return!1;return!0}function hh(a,s,c,h,y,b){return Mi=b,it=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,P.H=a===null||a.memoizedState===null?Aa:Pi,Ta=!1,b=c(h,y),Ta=!1,To&&(b=yx(s,c,h,y)),vx(a),b}function vx(a){P.H=zr;var s=xt!==null&&xt.next!==null;if(Mi=0,Bt=xt=it=null,$u=!1,Zs=0,Ao=null,s)throw Error(r(300));a===null||Zt||(a=a.dependencies,a!==null&&Ju(a)&&(Zt=!0))}function yx(a,s,c,h){it=a;var y=0;do{if(To&&(Ao=null),Zs=0,To=!1,25<=y)throw Error(r(301));if(y+=1,Bt=xt=null,a.updateQueue!=null){var b=a.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}P.H=Ra,b=s(c,h)}while(To);return b}function ZN(){var a=P.H,s=a.useState()[0];return s=typeof s.then=="function"?Qs(s):s,a=a.useState()[0],(xt!==null?xt.memoizedState:null)!==a&&(it.flags|=1024),s}function ph(){var a=Hu!==0;return Hu=0,a}function mh(a,s,c){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~c}function gh(a){if($u){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}$u=!1}Mi=0,Bt=xt=it=null,To=!1,Zs=Hu=0,Ao=null}function Nn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?it.memoizedState=Bt=a:Bt=Bt.next=a,Bt}function $t(){if(xt===null){var a=it.alternate;a=a!==null?a.memoizedState:null}else a=xt.next;var s=Bt===null?it.memoizedState:Bt.next;if(s!==null)Bt=s,xt=a;else{if(a===null)throw it.alternate===null?Error(r(467)):Error(r(310));xt=a,a={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},Bt===null?it.memoizedState=Bt=a:Bt=Bt.next=a}return Bt}var Vu;Vu=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function Qs(a){var s=Zs;return Zs+=1,Ao===null&&(Ao=[]),a=sx(Ao,a,s),s=it,(Bt===null?s.memoizedState:Bt.next)===null&&(s=s.alternate,P.H=s===null||s.memoizedState===null?Aa:Pi),a}function qu(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Qs(a);if(a.$$typeof===g)return pn(a)}throw Error(r(438,String(a)))}function vh(a){var s=null,c=it.updateQueue;if(c!==null&&(s=c.memoCache),s==null){var h=it.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(y){return y.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),c===null&&(c=Vu(),it.updateQueue=c),c.memoCache=s,c=s.data[s.index],c===void 0)for(c=s.data[s.index]=Array(a),h=0;h<a;h++)c[h]=N;return s.index++,c}function ri(a,s){return typeof s=="function"?s(a):s}function Yu(a){var s=$t();return yh(s,xt,a)}function yh(a,s,c){var h=a.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=c;var y=a.baseQueue,b=h.pending;if(b!==null){if(y!==null){var j=y.next;y.next=b.next,b.next=j}s.baseQueue=y=b,h.pending=null}if(b=a.baseState,y===null)a.memoizedState=b;else{s=y.next;var $=j=null,W=null,J=s,me=!1;do{var _e=J.lane&-536870913;if(_e!==J.lane?(ht&_e)===_e:(Mi&_e)===_e){var le=J.revertLane;if(le===0)W!==null&&(W=W.next={lane:0,revertLane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),_e===ko&&(me=!0);else if((Mi&le)===le){J=J.next,le===ko&&(me=!0);continue}else _e={lane:0,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},W===null?($=W=_e,j=b):W=W.next=_e,it.lanes|=le,qi|=le;_e=J.action,Ta&&c(b,_e),b=J.hasEagerState?J.eagerState:c(b,_e)}else le={lane:_e,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},W===null?($=W=le,j=b):W=W.next=le,it.lanes|=_e,qi|=_e;J=J.next}while(J!==null&&J!==s);if(W===null?j=b:W.next=$,!Gn(b,a.memoizedState)&&(Zt=!0,me&&(c=Co,c!==null)))throw c;a.memoizedState=b,a.baseState=j,a.baseQueue=W,h.lastRenderedState=b}return y===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function bh(a){var s=$t(),c=s.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=a;var h=c.dispatch,y=c.pending,b=s.memoizedState;if(y!==null){c.pending=null;var j=y=y.next;do b=a(b,j.action),j=j.next;while(j!==y);Gn(b,s.memoizedState)||(Zt=!0),s.memoizedState=b,s.baseQueue===null&&(s.baseState=b),c.lastRenderedState=b}return[b,h]}function bx(a,s,c){var h=it,y=$t(),b=pt;if(b){if(c===void 0)throw Error(r(407));c=c()}else c=s();var j=!Gn((xt||y).memoizedState,c);if(j&&(y.memoizedState=c,Zt=!0),y=y.queue,Sh(Sx.bind(null,h,y,a),[a]),y.getSnapshot!==s||j||Bt!==null&&Bt.memoizedState.tag&1){if(h.flags|=2048,Ro(9,wx.bind(null,h,y,c,s),{destroy:void 0},null),Rt===null)throw Error(r(349));b||Mi&60||xx(h,s,c)}return c}function xx(a,s,c){a.flags|=16384,a={getSnapshot:s,value:c},s=it.updateQueue,s===null?(s=Vu(),it.updateQueue=s,s.stores=[a]):(c=s.stores,c===null?s.stores=[a]:c.push(a))}function wx(a,s,c,h){s.value=c,s.getSnapshot=h,Ex(s)&&_x(a)}function Sx(a,s,c){return c(function(){Ex(s)&&_x(a)})}function Ex(a){var s=a.getSnapshot;a=a.value;try{var c=s();return!Gn(a,c)}catch{return!0}}function _x(a){var s=ji(a,2);s!==null&&_n(s,a,2)}function xh(a){var s=Nn();if(typeof a=="function"){var c=a;if(a=c(),Ta){at(!0);try{c()}finally{at(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:a},s}function kx(a,s,c,h){return a.baseState=c,yh(a,xt,typeof h=="function"?h:ri)}function QN(a,s,c,h,y){if(Ku(a))throw Error(r(485));if(a=s.action,a!==null){var b={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){b.listeners.push(j)}};P.T!==null?c(!0):b.isTransition=!1,h(b),c=s.pending,c===null?(b.next=s.pending=b,Cx(s,b)):(b.next=c.next,s.pending=c.next=b)}}function Cx(a,s){var c=s.action,h=s.payload,y=a.state;if(s.isTransition){var b=P.T,j={};P.T=j;try{var $=c(y,h),W=P.S;W!==null&&W(j,$),Tx(a,s,$)}catch(J){wh(a,s,J)}finally{P.T=b}}else try{b=c(y,h),Tx(a,s,b)}catch(J){wh(a,s,J)}}function Tx(a,s,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){Ax(a,s,h)},function(h){return wh(a,s,h)}):Ax(a,s,c)}function Ax(a,s,c){s.status="fulfilled",s.value=c,Rx(s),a.state=c,s=a.pending,s!==null&&(c=s.next,c===s?a.pending=null:(c=c.next,s.next=c,Cx(a,c)))}function wh(a,s,c){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=c,Rx(s),s=s.next;while(s!==h)}a.action=null}function Rx(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function Dx(a,s){return s}function Nx(a,s){if(pt){var c=Rt.formState;if(c!==null){e:{var h=it;if(pt){if(an){t:{for(var y=an,b=jr;y.nodeType!==8;){if(!b){y=null;break t}if(y=xr(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){an=xr(y.nextSibling),h=y.data==="F!";break e}}_a(h)}h=!1}h&&(s=c[0])}}return c=Nn(),c.memoizedState=c.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dx,lastRenderedState:s},c.queue=h,c=Xx.bind(null,it,h),h.dispatch=c,h=xh(!1),b=Th.bind(null,it,!1,h.queue),h=Nn(),y={state:s,dispatch:null,action:a,pending:null},h.queue=y,c=QN.bind(null,it,y,b,c),y.dispatch=c,h.memoizedState=a,[s,c,!1]}function Ox(a){var s=$t();return jx(s,xt,a)}function jx(a,s,c){s=yh(a,s,Dx)[0],a=Yu(ri)[0],s=typeof s=="object"&&s!==null&&typeof s.then=="function"?Qs(s):s;var h=$t(),y=h.queue,b=y.dispatch;return c!==h.memoizedState&&(it.flags|=2048,Ro(9,JN.bind(null,y,c),{destroy:void 0},null)),[s,b,a]}function JN(a,s){a.action=s}function Lx(a){var s=$t(),c=xt;if(c!==null)return jx(s,c,a);$t(),s=s.memoizedState,c=$t();var h=c.queue.dispatch;return c.memoizedState=a,[s,h,!1]}function Ro(a,s,c,h){return a={tag:a,create:s,inst:c,deps:h,next:null},s=it.updateQueue,s===null&&(s=Vu(),it.updateQueue=s),c=s.lastEffect,c===null?s.lastEffect=a.next=a:(h=c.next,c.next=a,a.next=h,s.lastEffect=a),a}function zx(){return $t().memoizedState}function Wu(a,s,c,h){var y=Nn();it.flags|=a,y.memoizedState=Ro(1|s,c,{destroy:void 0},h===void 0?null:h)}function Xu(a,s,c,h){var y=$t();h=h===void 0?null:h;var b=y.memoizedState.inst;xt!==null&&h!==null&&dh(h,xt.memoizedState.deps)?y.memoizedState=Ro(s,c,b,h):(it.flags|=a,y.memoizedState=Ro(1|s,c,b,h))}function Mx(a,s){Wu(8390656,8,a,s)}function Sh(a,s){Xu(2048,8,a,s)}function Px(a,s){return Xu(4,2,a,s)}function Fx(a,s){return Xu(4,4,a,s)}function Ix(a,s){if(typeof s=="function"){a=a();var c=s(a);return function(){typeof c=="function"?c():s(null)}}if(s!=null)return a=a(),s.current=a,function(){s.current=null}}function Gx(a,s,c){c=c!=null?c.concat([a]):null,Xu(4,4,Ix.bind(null,s,a),c)}function Eh(){}function Ux(a,s){var c=$t();s=s===void 0?null:s;var h=c.memoizedState;return s!==null&&dh(s,h[1])?h[0]:(c.memoizedState=[a,s],a)}function Bx(a,s){var c=$t();s=s===void 0?null:s;var h=c.memoizedState;if(s!==null&&dh(s,h[1]))return h[0];if(h=a(),Ta){at(!0);try{a()}finally{at(!1)}}return c.memoizedState=[h,s],h}function _h(a,s,c){return c===void 0||Mi&1073741824?a.memoizedState=s:(a.memoizedState=c,a=Hw(),it.lanes|=a,qi|=a,c)}function $x(a,s,c,h){return Gn(c,s)?c:_o.current!==null?(a=_h(a,c,h),Gn(a,s)||(Zt=!0),a):Mi&42?(a=Hw(),it.lanes|=a,qi|=a,s):(Zt=!0,a.memoizedState=c)}function Hx(a,s,c,h,y){var b=X.p;X.p=b!==0&&8>b?b:8;var j=P.T,$={};P.T=$,Th(a,!1,s,c);try{var W=y(),J=P.S;if(J!==null&&J($,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var me=XN(W,h);Js(a,s,me,Hn(a))}else Js(a,s,h,Hn(a))}catch(_e){Js(a,s,{then:function(){},status:"rejected",reason:_e},Hn())}finally{X.p=b,P.T=j}}function eO(){}function kh(a,s,c,h){if(a.tag!==5)throw Error(r(476));var y=Vx(a).queue;Hx(a,y,s,re,c===null?eO:function(){return qx(a),c(h)})}function Vx(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:re},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:c},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function qx(a){var s=Vx(a).next.queue;Js(a,s,{},Hn())}function Ch(){return pn(bl)}function Yx(){return $t().memoizedState}function Wx(){return $t().memoizedState}function tO(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var c=Hn();a=Gi(c);var h=Ui(s,a,c);h!==null&&(_n(h,s,c),nl(h,s,c)),s={cache:uh()},a.payload=s;return}s=s.return}}function nO(a,s,c){var h=Hn();c={lane:h,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null},Ku(a)?Kx(s,c):(c=nh(a,s,c,h),c!==null&&(_n(c,a,h),Zx(c,s,h)))}function Xx(a,s,c){var h=Hn();Js(a,s,c,h)}function Js(a,s,c,h){var y={lane:h,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null};if(Ku(a))Kx(s,y);else{var b=a.alternate;if(a.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var j=s.lastRenderedState,$=b(j,c);if(y.hasEagerState=!0,y.eagerState=$,Gn($,j))return ju(a,s,y,0),Rt===null&&Ou(),!1}catch{}finally{}if(c=nh(a,s,y,h),c!==null)return _n(c,a,h),Zx(c,s,h),!0}return!1}function Th(a,s,c,h){if(h={lane:2,revertLane:gp(),action:h,hasEagerState:!1,eagerState:null,next:null},Ku(a)){if(s)throw Error(r(479))}else s=nh(a,c,h,2),s!==null&&_n(s,a,2)}function Ku(a){var s=a.alternate;return a===it||s!==null&&s===it}function Kx(a,s){To=$u=!0;var c=a.pending;c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s}function Zx(a,s,c){if(c&4194176){var h=s.lanes;h&=a.pendingLanes,c|=h,s.lanes=c,gr(a,c)}}var zr={readContext:pn,use:qu,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt};zr.useCacheRefresh=Gt,zr.useMemoCache=Gt,zr.useHostTransitionStatus=Gt,zr.useFormState=Gt,zr.useActionState=Gt,zr.useOptimistic=Gt;var Aa={readContext:pn,use:qu,useCallback:function(a,s){return Nn().memoizedState=[a,s===void 0?null:s],a},useContext:pn,useEffect:Mx,useImperativeHandle:function(a,s,c){c=c!=null?c.concat([a]):null,Wu(4194308,4,Ix.bind(null,s,a),c)},useLayoutEffect:function(a,s){return Wu(4194308,4,a,s)},useInsertionEffect:function(a,s){Wu(4,2,a,s)},useMemo:function(a,s){var c=Nn();s=s===void 0?null:s;var h=a();if(Ta){at(!0);try{a()}finally{at(!1)}}return c.memoizedState=[h,s],h},useReducer:function(a,s,c){var h=Nn();if(c!==void 0){var y=c(s);if(Ta){at(!0);try{c(s)}finally{at(!1)}}}else y=s;return h.memoizedState=h.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},h.queue=a,a=a.dispatch=nO.bind(null,it,a),[h.memoizedState,a]},useRef:function(a){var s=Nn();return a={current:a},s.memoizedState=a},useState:function(a){a=xh(a);var s=a.queue,c=Xx.bind(null,it,s);return s.dispatch=c,[a.memoizedState,c]},useDebugValue:Eh,useDeferredValue:function(a,s){var c=Nn();return _h(c,a,s)},useTransition:function(){var a=xh(!1);return a=Hx.bind(null,it,a.queue,!0,!1),Nn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,c){var h=it,y=Nn();if(pt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=s(),Rt===null)throw Error(r(349));ht&60||xx(h,s,c)}y.memoizedState=c;var b={value:c,getSnapshot:s};return y.queue=b,Mx(Sx.bind(null,h,b,a),[a]),h.flags|=2048,Ro(9,wx.bind(null,h,b,c,s),{destroy:void 0},null),c},useId:function(){var a=Nn(),s=Rt.identifierPrefix;if(pt){var c=ti,h=ei;c=(h&~(1<<32-At(h)-1)).toString(32)+c,s=":"+s+"R"+c,c=Hu++,0<c&&(s+="H"+c.toString(32)),s+=":"}else c=KN++,s=":"+s+"r"+c.toString(32)+":";return a.memoizedState=s},useCacheRefresh:function(){return Nn().memoizedState=tO.bind(null,it)}};Aa.useMemoCache=vh,Aa.useHostTransitionStatus=Ch,Aa.useFormState=Nx,Aa.useActionState=Nx,Aa.useOptimistic=function(a){var s=Nn();s.memoizedState=s.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=c,s=Th.bind(null,it,!0,c),c.dispatch=s,[a,s]};var Pi={readContext:pn,use:qu,useCallback:Ux,useContext:pn,useEffect:Sh,useImperativeHandle:Gx,useInsertionEffect:Px,useLayoutEffect:Fx,useMemo:Bx,useReducer:Yu,useRef:zx,useState:function(){return Yu(ri)},useDebugValue:Eh,useDeferredValue:function(a,s){var c=$t();return $x(c,xt.memoizedState,a,s)},useTransition:function(){var a=Yu(ri)[0],s=$t().memoizedState;return[typeof a=="boolean"?a:Qs(a),s]},useSyncExternalStore:bx,useId:Yx};Pi.useCacheRefresh=Wx,Pi.useMemoCache=vh,Pi.useHostTransitionStatus=Ch,Pi.useFormState=Ox,Pi.useActionState=Ox,Pi.useOptimistic=function(a,s){var c=$t();return kx(c,xt,a,s)};var Ra={readContext:pn,use:qu,useCallback:Ux,useContext:pn,useEffect:Sh,useImperativeHandle:Gx,useInsertionEffect:Px,useLayoutEffect:Fx,useMemo:Bx,useReducer:bh,useRef:zx,useState:function(){return bh(ri)},useDebugValue:Eh,useDeferredValue:function(a,s){var c=$t();return xt===null?_h(c,a,s):$x(c,xt.memoizedState,a,s)},useTransition:function(){var a=bh(ri)[0],s=$t().memoizedState;return[typeof a=="boolean"?a:Qs(a),s]},useSyncExternalStore:bx,useId:Yx};Ra.useCacheRefresh=Wx,Ra.useMemoCache=vh,Ra.useHostTransitionStatus=Ch,Ra.useFormState=Lx,Ra.useActionState=Lx,Ra.useOptimistic=function(a,s){var c=$t();return xt!==null?kx(c,xt,a,s):(c.baseState=a,[a,c.queue.dispatch])};function Ah(a,s,c,h){s=a.memoizedState,c=c(h,s),c=c==null?s:z({},s,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}var Rh={isMounted:function(a){return(a=a._reactInternals)?F(a)===a:!1},enqueueSetState:function(a,s,c){a=a._reactInternals;var h=Hn(),y=Gi(h);y.payload=s,c!=null&&(y.callback=c),s=Ui(a,y,h),s!==null&&(_n(s,a,h),nl(s,a,h))},enqueueReplaceState:function(a,s,c){a=a._reactInternals;var h=Hn(),y=Gi(h);y.tag=1,y.payload=s,c!=null&&(y.callback=c),s=Ui(a,y,h),s!==null&&(_n(s,a,h),nl(s,a,h))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var c=Hn(),h=Gi(c);h.tag=2,s!=null&&(h.callback=s),s=Ui(a,h,c),s!==null&&(_n(s,a,c),nl(s,a,c))}};function Qx(a,s,c,h,y,b,j){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,b,j):s.prototype&&s.prototype.isPureReactComponent?!Gs(c,h)||!Gs(y,b):!0}function Jx(a,s,c,h){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,h),s.state!==a&&Rh.enqueueReplaceState(s,s.state,null)}function Da(a,s){var c=s;if("ref"in s){c={};for(var h in s)h!=="ref"&&(c[h]=s[h])}if(a=a.defaultProps){c===s&&(c=z({},c));for(var y in a)c[y]===void 0&&(c[y]=a[y])}return c}var Zu=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)};function ew(a){Zu(a)}function tw(a){console.error(a)}function nw(a){Zu(a)}function Qu(a,s){try{var c=a.onUncaughtError;c(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function rw(a,s,c){try{var h=a.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Dh(a,s,c){return c=Gi(c),c.tag=3,c.payload={element:null},c.callback=function(){Qu(a,s)},c}function iw(a){return a=Gi(a),a.tag=3,a}function aw(a,s,c,h){var y=c.type.getDerivedStateFromError;if(typeof y=="function"){var b=h.value;a.payload=function(){return y(b)},a.callback=function(){rw(s,c,h)}}var j=c.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(a.callback=function(){rw(s,c,h),typeof y!="function"&&(Yi===null?Yi=new Set([this]):Yi.add(this));var $=h.stack;this.componentDidCatch(h.value,{componentStack:$!==null?$:""})})}function rO(a,s,c,h,y){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(s=c.alternate,s!==null&&tl(s,c,y,!0),c=rr.current,c!==null){switch(c.tag){case 13:return Lr===null?fp():c.alternate===null&&Ft===0&&(Ft=3),c.flags&=-257,c.flags|=65536,c.lanes=y,h===oh?c.flags|=16384:(s=c.updateQueue,s===null?c.updateQueue=new Set([h]):s.add(h),hp(a,h,y)),!1;case 22:return c.flags|=65536,h===oh?c.flags|=16384:(s=c.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=s):(c=s.retryQueue,c===null?s.retryQueue=new Set([h]):c.add(h)),hp(a,h,y)),!1}throw Error(r(435,c.tag))}return hp(a,h,y),fp(),!1}if(pt)return s=rr.current,s!==null?(!(s.flags&65536)&&(s.flags|=256),s.flags|=65536,s.lanes=y,h!==ah&&(a=Error(r(422),{cause:h}),Hs(er(a,c)))):(h!==ah&&(s=Error(r(423),{cause:h}),Hs(er(s,c))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,h=er(h,c),y=Dh(a.stateNode,h,y),Vh(a,y),Ft!==4&&(Ft=2)),!1;var b=Error(r(520),{cause:h});if(b=er(b,c),cl===null?cl=[b]:cl.push(b),Ft!==4&&(Ft=2),s===null)return!0;h=er(h,c),c=s;do{switch(c.tag){case 3:return c.flags|=65536,a=y&-y,c.lanes|=a,a=Dh(c.stateNode,h,a),Vh(c,a),!1;case 1:if(s=c.type,b=c.stateNode,(c.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Yi===null||!Yi.has(b))))return c.flags|=65536,y&=-y,c.lanes|=y,y=iw(y),aw(y,a,c,h),Vh(c,y),!1}c=c.return}while(c!==null);return!1}var ow=Error(r(461)),Zt=!1;function on(a,s,c,h){s.child=a===null?fx(s,null,c,h):ka(s,a.child,c,h)}function sw(a,s,c,h,y){c=c.render;var b=s.ref;if("ref"in h){var j={};for(var $ in h)$!=="ref"&&(j[$]=h[$])}else j=h;return Oa(s),h=hh(a,s,c,j,b,y),$=ph(),a!==null&&!Zt?(mh(a,s,y),ii(a,s,y)):(pt&&$&&rh(s),s.flags|=1,on(a,s,h,y),s.child)}function lw(a,s,c,h,y){if(a===null){var b=c.type;return typeof b=="function"&&!Jh(b)&&b.defaultProps===void 0&&c.compare===null?(s.tag=15,s.type=b,uw(a,s,b,h,y)):(a=rc(c.type,null,h,s,s.mode,y),a.ref=s.ref,a.return=s,s.child=a)}if(b=a.child,!Ih(a,y)){var j=b.memoizedProps;if(c=c.compare,c=c!==null?c:Gs,c(j,h)&&a.ref===s.ref)return ii(a,s,y)}return s.flags|=1,a=Vi(b,h),a.ref=s.ref,a.return=s,s.child=a}function uw(a,s,c,h,y){if(a!==null){var b=a.memoizedProps;if(Gs(b,h)&&a.ref===s.ref)if(Zt=!1,s.pendingProps=h=b,Ih(a,y))a.flags&131072&&(Zt=!0);else return s.lanes=a.lanes,ii(a,s,y)}return Nh(a,s,c,h,y)}function cw(a,s,c){var h=s.pendingProps,y=h.children,b=(s.stateNode._pendingVisibility&2)!==0,j=a!==null?a.memoizedState:null;if(el(a,s),h.mode==="hidden"||b){if(s.flags&128){if(h=j!==null?j.baseLanes|c:c,a!==null){for(y=s.child=a.child,b=0;y!==null;)b=b|y.lanes|y.childLanes,y=y.sibling;s.childLanes=b&~h}else s.childLanes=0,s.child=null;return fw(a,s,h,c)}if(c&536870912)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&Bu(s,j!==null?j.cachePool:null),j!==null?dx(s,j):sh(),hx(s);else return s.lanes=s.childLanes=536870912,fw(a,s,j!==null?j.baseLanes|c:c,c)}else j!==null?(Bu(s,j.cachePool),dx(s,j),zi(),s.memoizedState=null):(a!==null&&Bu(s,null),sh(),zi());return on(a,s,y,c),s.child}function fw(a,s,c,h){var y=fh();return y=y===null?null:{parent:Wt._currentValue,pool:y},s.memoizedState={baseLanes:c,cachePool:y},a!==null&&Bu(s,null),sh(),hx(s),a!==null&&tl(a,s,h,!0),null}function el(a,s){var c=s.ref;if(c===null)a!==null&&a.ref!==null&&(s.flags|=2097664);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(a===null||a.ref!==c)&&(s.flags|=2097664)}}function Nh(a,s,c,h,y){return Oa(s),c=hh(a,s,c,h,void 0,y),h=ph(),a!==null&&!Zt?(mh(a,s,y),ii(a,s,y)):(pt&&h&&rh(s),s.flags|=1,on(a,s,c,y),s.child)}function dw(a,s,c,h,y,b){return Oa(s),s.updateQueue=null,c=yx(s,h,c,y),vx(a),h=ph(),a!==null&&!Zt?(mh(a,s,b),ii(a,s,b)):(pt&&h&&rh(s),s.flags|=1,on(a,s,c,b),s.child)}function hw(a,s,c,h,y){if(Oa(s),s.stateNode===null){var b=xo,j=c.contextType;typeof j=="object"&&j!==null&&(b=pn(j)),b=new c(h,b),s.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Rh,s.stateNode=b,b._reactInternals=s,b=s.stateNode,b.props=h,b.state=s.memoizedState,b.refs={},$h(s),j=c.contextType,b.context=typeof j=="object"&&j!==null?pn(j):xo,b.state=s.memoizedState,j=c.getDerivedStateFromProps,typeof j=="function"&&(Ah(s,c,j,h),b.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(j=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),j!==b.state&&Rh.enqueueReplaceState(b,b.state,null),il(s,h,b,y),rl(),b.state=s.memoizedState),typeof b.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(a===null){b=s.stateNode;var $=s.memoizedProps,W=Da(c,$);b.props=W;var J=b.context,me=c.contextType;j=xo,typeof me=="object"&&me!==null&&(j=pn(me));var _e=c.getDerivedStateFromProps;me=typeof _e=="function"||typeof b.getSnapshotBeforeUpdate=="function",$=s.pendingProps!==$,me||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||($||J!==j)&&Jx(s,b,h,j),Ii=!1;var le=s.memoizedState;b.state=le,il(s,h,b,y),rl(),J=s.memoizedState,$||le!==J||Ii?(typeof _e=="function"&&(Ah(s,c,_e,h),J=s.memoizedState),(W=Ii||Qx(s,c,W,h,le,J,j))?(me||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(s.flags|=4194308)):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=J),b.props=h,b.state=J,b.context=j,h=W):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{b=s.stateNode,Hh(a,s),j=s.memoizedProps,me=Da(c,j),b.props=me,_e=s.pendingProps,le=b.context,J=c.contextType,W=xo,typeof J=="object"&&J!==null&&(W=pn(J)),$=c.getDerivedStateFromProps,(J=typeof $=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(j!==_e||le!==W)&&Jx(s,b,h,W),Ii=!1,le=s.memoizedState,b.state=le,il(s,h,b,y),rl();var pe=s.memoizedState;j!==_e||le!==pe||Ii||a!==null&&a.dependencies!==null&&Ju(a.dependencies)?(typeof $=="function"&&(Ah(s,c,$,h),pe=s.memoizedState),(me=Ii||Qx(s,c,me,h,le,pe,W)||a!==null&&a.dependencies!==null&&Ju(a.dependencies))?(J||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(h,pe,W),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(h,pe,W)),typeof b.componentDidUpdate=="function"&&(s.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof b.componentDidUpdate!="function"||j===a.memoizedProps&&le===a.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&le===a.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=pe),b.props=h,b.state=pe,b.context=W,h=me):(typeof b.componentDidUpdate!="function"||j===a.memoizedProps&&le===a.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&le===a.memoizedState||(s.flags|=1024),h=!1)}return b=h,el(a,s),h=(s.flags&128)!==0,b||h?(b=s.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:b.render(),s.flags|=1,a!==null&&h?(s.child=ka(s,a.child,null,y),s.child=ka(s,null,c,y)):on(a,s,c,y),s.memoizedState=b.state,a=s.child):a=ii(a,s,y),a}function pw(a,s,c,h){return $s(),s.flags|=256,on(a,s,c,h),s.child}var Oh={dehydrated:null,treeContext:null,retryLane:0};function jh(a){return{baseLanes:a,cachePool:gx()}}function Lh(a,s,c){return a=a!==null?a.childLanes&~c:0,s&&(a|=sr),a}function mw(a,s,c){var h=s.pendingProps,y=!1,b=(s.flags&128)!==0,j;if((j=b)||(j=a!==null&&a.memoizedState===null?!1:(Yt.current&2)!==0),j&&(y=!0,s.flags&=-129),j=(s.flags&32)!==0,s.flags&=-33,a===null){if(pt){if(y?Li(s):zi(),pt){var $=an,W;if(W=$){e:{for(W=$,$=jr;W.nodeType!==8;){if(!$){$=null;break e}if(W=xr(W.nextSibling),W===null){$=null;break e}}$=W}$!==null?(s.memoizedState={dehydrated:$,treeContext:Sa!==null?{id:ei,overflow:ti}:null,retryLane:536870912},W=or(18,null,null,0),W.stateNode=$,W.return=s,s.child=W,En=s,an=null,W=!0):W=!1}W||_a(s)}if($=s.memoizedState,$!==null&&($=$.dehydrated,$!==null))return $.data==="$!"?s.lanes=16:s.lanes=536870912,null;ni(s)}return $=h.children,h=h.fallback,y?(zi(),y=s.mode,$=Mh({mode:"hidden",children:$},y),h=La(h,y,c,null),$.return=s,h.return=s,$.sibling=h,s.child=$,y=s.child,y.memoizedState=jh(c),y.childLanes=Lh(a,j,c),s.memoizedState=Oh,h):(Li(s),zh(s,$))}if(W=a.memoizedState,W!==null&&($=W.dehydrated,$!==null)){if(b)s.flags&256?(Li(s),s.flags&=-257,s=Ph(a,s,c)):s.memoizedState!==null?(zi(),s.child=a.child,s.flags|=128,s=null):(zi(),y=h.fallback,$=s.mode,h=Mh({mode:"visible",children:h.children},$),y=La(y,$,c,null),y.flags|=2,h.return=s,y.return=s,h.sibling=y,s.child=h,ka(s,a.child,null,c),h=s.child,h.memoizedState=jh(c),h.childLanes=Lh(a,j,c),s.memoizedState=Oh,s=y);else if(Li(s),$.data==="$!"){if(j=$.nextSibling&&$.nextSibling.dataset,j)var J=j.dgst;j=J,h=Error(r(419)),h.stack="",h.digest=j,Hs({value:h,source:null,stack:null}),s=Ph(a,s,c)}else if(Zt||tl(a,s,c,!1),j=(c&a.childLanes)!==0,Zt||j){if(j=Rt,j!==null){if(h=c&-c,h&42)h=1;else switch(h){case 2:h=1;break;case 8:h=4;break;case 32:h=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:h=64;break;case 268435456:h=134217728;break;default:h=0}if(h=h&(j.suspendedLanes|c)?0:h,h!==0&&h!==W.retryLane)throw W.retryLane=h,ji(a,h),_n(j,a,h),ow}$.data==="$?"||fp(),s=Ph(a,s,c)}else $.data==="$?"?(s.flags|=128,s.child=a.child,s=yO.bind(null,a),$._reactRetry=s,s=null):(a=W.treeContext,an=xr($.nextSibling),En=s,pt=!0,yr=null,jr=!1,a!==null&&(tr[nr++]=ei,tr[nr++]=ti,tr[nr++]=Sa,ei=a.id,ti=a.overflow,Sa=s),s=zh(s,h.children),s.flags|=4096);return s}return y?(zi(),y=h.fallback,$=s.mode,W=a.child,J=W.sibling,h=Vi(W,{mode:"hidden",children:h.children}),h.subtreeFlags=W.subtreeFlags&31457280,J!==null?y=Vi(J,y):(y=La(y,$,c,null),y.flags|=2),y.return=s,h.return=s,h.sibling=y,s.child=h,h=y,y=s.child,$=a.child.memoizedState,$===null?$=jh(c):(W=$.cachePool,W!==null?(J=Wt._currentValue,W=W.parent!==J?{parent:J,pool:J}:W):W=gx(),$={baseLanes:$.baseLanes|c,cachePool:W}),y.memoizedState=$,y.childLanes=Lh(a,j,c),s.memoizedState=Oh,h):(Li(s),c=a.child,a=c.sibling,c=Vi(c,{mode:"visible",children:h.children}),c.return=s,c.sibling=null,a!==null&&(j=s.deletions,j===null?(s.deletions=[a],s.flags|=16):j.push(a)),s.child=c,s.memoizedState=null,c)}function zh(a,s){return s=Mh({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function Mh(a,s){return Uw(a,s,0,null)}function Ph(a,s,c){return ka(s,a.child,null,c),a=zh(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function gw(a,s,c){a.lanes|=s;var h=a.alternate;h!==null&&(h.lanes|=s),Uh(a.return,s,c)}function Fh(a,s,c,h,y){var b=a.memoizedState;b===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:y}:(b.isBackwards=s,b.rendering=null,b.renderingStartTime=0,b.last=h,b.tail=c,b.tailMode=y)}function vw(a,s,c){var h=s.pendingProps,y=h.revealOrder,b=h.tail;if(on(a,s,h.children,c),h=Yt.current,h&2)h=h&1|2,s.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&gw(a,c,s);else if(a.tag===19)gw(a,c,s);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}h&=1}switch(he(Yt,h),y){case"forwards":for(c=s.child,y=null;c!==null;)a=c.alternate,a!==null&&Uu(a)===null&&(y=c),c=c.sibling;c=y,c===null?(y=s.child,s.child=null):(y=c.sibling,c.sibling=null),Fh(s,!1,y,c,b);break;case"backwards":for(c=null,y=s.child,s.child=null;y!==null;){if(a=y.alternate,a!==null&&Uu(a)===null){s.child=y;break}a=y.sibling,y.sibling=c,c=y,y=a}Fh(s,!0,c,null,b);break;case"together":Fh(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function ii(a,s,c){if(a!==null&&(s.dependencies=a.dependencies),qi|=s.lanes,!(c&s.childLanes))if(a!==null){if(tl(a,s,c,!1),(c&s.childLanes)===0)return null}else return null;if(a!==null&&s.child!==a.child)throw Error(r(153));if(s.child!==null){for(a=s.child,c=Vi(a,a.pendingProps),s.child=c,c.return=s;a.sibling!==null;)a=a.sibling,c=c.sibling=Vi(a,a.pendingProps),c.return=s;c.sibling=null}return s.child}function Ih(a,s){return a.lanes&s?!0:(a=a.dependencies,!!(a!==null&&Ju(a)))}function iO(a,s,c){switch(s.tag){case 3:xe(s,s.stateNode.containerInfo),Fi(s,Wt,a.memoizedState.cache),$s();break;case 27:case 5:ce(s);break;case 4:xe(s,s.stateNode.containerInfo);break;case 10:Fi(s,s.type,s.memoizedProps.value);break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(Li(s),s.flags|=128,null):c&s.child.childLanes?mw(a,s,c):(Li(s),a=ii(a,s,c),a!==null?a.sibling:null);Li(s);break;case 19:var y=(a.flags&128)!==0;if(h=(c&s.childLanes)!==0,h||(tl(a,s,c,!1),h=(c&s.childLanes)!==0),y){if(h)return vw(a,s,c);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),he(Yt,Yt.current),h)break;return null;case 22:case 23:return s.lanes=0,cw(a,s,c);case 24:Fi(s,Wt,a.memoizedState.cache)}return ii(a,s,c)}function yw(a,s,c){if(a!==null)if(a.memoizedProps!==s.pendingProps)Zt=!0;else{if(!Ih(a,c)&&!(s.flags&128))return Zt=!1,iO(a,s,c);Zt=!!(a.flags&131072)}else Zt=!1,pt&&s.flags&1048576&&nx(s,Mu,s.index);switch(s.lanes=0,s.tag){case 16:e:{a=s.pendingProps;var h=s.elementType,y=h._init;if(h=y(h._payload),s.type=h,typeof h=="function")Jh(h)?(a=Da(h,a),s.tag=1,s=hw(null,s,h,a,c)):(s.tag=0,s=Nh(null,s,h,a,c));else{if(h!=null){if(y=h.$$typeof,y===w){s.tag=11,s=sw(null,s,h,a,c);break e}else if(y===C){s.tag=14,s=lw(null,s,h,a,c);break e}}throw s=U(h)||h,Error(r(306,s,""))}}return s;case 0:return Nh(a,s,s.type,s.pendingProps,c);case 1:return h=s.type,y=Da(h,s.pendingProps),hw(a,s,h,y,c);case 3:e:{if(xe(s,s.stateNode.containerInfo),a===null)throw Error(r(387));var b=s.pendingProps;y=s.memoizedState,h=y.element,Hh(a,s),il(s,b,null,c);var j=s.memoizedState;if(b=j.cache,Fi(s,Wt,b),b!==y.cache&&Bh(s,[Wt],c,!0),rl(),b=j.element,y.isDehydrated)if(y={element:b,isDehydrated:!1,cache:j.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=pw(a,s,b,c);break e}else if(b!==h){h=er(Error(r(424)),s),Hs(h),s=pw(a,s,b,c);break e}else for(an=xr(s.stateNode.containerInfo.firstChild),En=s,pt=!0,yr=null,jr=!0,c=fx(s,null,b,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if($s(),b===h){s=ii(a,s,c);break e}on(a,s,b,c)}s=s.child}return s;case 26:return el(a,s),a===null?(c=w0(s.type,null,s.pendingProps,null))?s.memoizedState=c:pt||(c=s.type,a=s.pendingProps,h=mc(Pe.current).createElement(c),h[hn]=s,h[Rn]=a,sn(h,c,a),Kt(h),s.stateNode=h):s.memoizedState=w0(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return ce(s),a===null&&pt&&(h=s.stateNode=y0(s.type,s.pendingProps,Pe.current),En=s,jr=!0,an=xr(h.firstChild)),h=s.pendingProps.children,a!==null||pt?on(a,s,h,c):s.child=ka(s,null,h,c),el(a,s),s.child;case 5:return a===null&&pt&&((y=h=an)&&(h=LO(h,s.type,s.pendingProps,jr),h!==null?(s.stateNode=h,En=s,an=xr(h.firstChild),jr=!1,y=!0):y=!1),y||_a(s)),ce(s),y=s.type,b=s.pendingProps,j=a!==null?a.memoizedProps:null,h=b.children,kp(y,b)?h=null:j!==null&&kp(y,j)&&(s.flags|=32),s.memoizedState!==null&&(y=hh(a,s,ZN,null,null,c),bl._currentValue=y),el(a,s),on(a,s,h,c),s.child;case 6:return a===null&&pt&&((a=c=an)&&(c=zO(c,s.pendingProps,jr),c!==null?(s.stateNode=c,En=s,an=null,a=!0):a=!1),a||_a(s)),null;case 13:return mw(a,s,c);case 4:return xe(s,s.stateNode.containerInfo),h=s.pendingProps,a===null?s.child=ka(s,null,h,c):on(a,s,h,c),s.child;case 11:return sw(a,s,s.type,s.pendingProps,c);case 7:return on(a,s,s.pendingProps,c),s.child;case 8:return on(a,s,s.pendingProps.children,c),s.child;case 12:return on(a,s,s.pendingProps.children,c),s.child;case 10:return h=s.pendingProps,Fi(s,s.type,h.value),on(a,s,h.children,c),s.child;case 9:return y=s.type._context,h=s.pendingProps.children,Oa(s),y=pn(y),h=h(y),s.flags|=1,on(a,s,h,c),s.child;case 14:return lw(a,s,s.type,s.pendingProps,c);case 15:return uw(a,s,s.type,s.pendingProps,c);case 19:return vw(a,s,c);case 22:return cw(a,s,c);case 24:return Oa(s),h=pn(Wt),a===null?(y=fh(),y===null&&(y=Rt,b=uh(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=c),y=b),s.memoizedState={parent:h,cache:y},$h(s),Fi(s,Wt,y)):(a.lanes&c&&(Hh(a,s),il(s,null,null,c),rl()),y=a.memoizedState,b=s.memoizedState,y.parent!==h?(y={parent:h,cache:h},s.memoizedState=y,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=y),Fi(s,Wt,h)):(h=b.cache,Fi(s,Wt,h),h!==y.cache&&Bh(s,[Wt],c,!0))),on(a,s,s.pendingProps.children,c),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}var Gh=oe(null),Na=null,ai=null;function Fi(a,s,c){he(Gh,s._currentValue),s._currentValue=c}function oi(a){a._currentValue=Gh.current,Ce(Gh)}function Uh(a,s,c){for(;a!==null;){var h=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),a===c)break;a=a.return}}function Bh(a,s,c,h){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var b=y.dependencies;if(b!==null){var j=y.child;b=b.firstContext;e:for(;b!==null;){var $=b;b=y;for(var W=0;W<s.length;W++)if($.context===s[W]){b.lanes|=c,$=b.alternate,$!==null&&($.lanes|=c),Uh(b.return,c,a),h||(j=null);break e}b=$.next}}else if(y.tag===18){if(j=y.return,j===null)throw Error(r(341));j.lanes|=c,b=j.alternate,b!==null&&(b.lanes|=c),Uh(j,c,a),j=null}else j=y.child;if(j!==null)j.return=y;else for(j=y;j!==null;){if(j===a){j=null;break}if(y=j.sibling,y!==null){y.return=j.return,j=y;break}j=j.return}y=j}}function tl(a,s,c,h){a=null;for(var y=s,b=!1;y!==null;){if(!b){if(y.flags&524288)b=!0;else if(y.flags&262144)break}if(y.tag===10){var j=y.alternate;if(j===null)throw Error(r(387));if(j=j.memoizedProps,j!==null){var $=y.type;Gn(y.pendingProps.value,j.value)||(a!==null?a.push($):a=[$])}}else if(y===Ae.current){if(j=y.alternate,j===null)throw Error(r(387));j.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(bl):a=[bl])}y=y.return}a!==null&&Bh(s,a,c,h),s.flags|=262144}function Ju(a){for(a=a.firstContext;a!==null;){if(!Gn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Oa(a){Na=a,ai=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function pn(a){return bw(Na,a)}function ec(a,s){return Na===null&&Oa(a),bw(a,s)}function bw(a,s){var c=s._currentValue;if(s={context:s,memoizedValue:c,next:null},ai===null){if(a===null)throw Error(r(308));ai=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else ai=ai.next=s;return c}var Ii=!1;function $h(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hh(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Gi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Ui(a,s,c){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,Lt&2){var y=h.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),h.pending=s,s=Lu(a),ex(a,null,c),s}return ju(a,h,s,c),Lu(a)}function nl(a,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194176)!==0)){var h=s.lanes;h&=a.pendingLanes,c|=h,s.lanes=c,gr(a,c)}}function Vh(a,s){var c=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var y=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var j={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};b===null?y=b=j:b=b.next=j,c=c.next}while(c!==null);b===null?y=b=s:b=b.next=s}else y=b=s;c={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:h.shared,callbacks:h.callbacks},a.updateQueue=c;return}a=c.lastBaseUpdate,a===null?c.firstBaseUpdate=s:a.next=s,c.lastBaseUpdate=s}var qh=!1;function rl(){if(qh){var a=Co;if(a!==null)throw a}}function il(a,s,c,h){qh=!1;var y=a.updateQueue;Ii=!1;var b=y.firstBaseUpdate,j=y.lastBaseUpdate,$=y.shared.pending;if($!==null){y.shared.pending=null;var W=$,J=W.next;W.next=null,j===null?b=J:j.next=J,j=W;var me=a.alternate;me!==null&&(me=me.updateQueue,$=me.lastBaseUpdate,$!==j&&($===null?me.firstBaseUpdate=J:$.next=J,me.lastBaseUpdate=W))}if(b!==null){var _e=y.baseState;j=0,me=J=W=null,$=b;do{var le=$.lane&-536870913,pe=le!==$.lane;if(pe?(ht&le)===le:(h&le)===le){le!==0&&le===ko&&(qh=!0),me!==null&&(me=me.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Ue=a,Je=$;le=s;var It=c;switch(Je.tag){case 1:if(Ue=Je.payload,typeof Ue=="function"){_e=Ue.call(It,_e,le);break e}_e=Ue;break e;case 3:Ue.flags=Ue.flags&-65537|128;case 0:if(Ue=Je.payload,le=typeof Ue=="function"?Ue.call(It,_e,le):Ue,le==null)break e;_e=z({},_e,le);break e;case 2:Ii=!0}}le=$.callback,le!==null&&(a.flags|=64,pe&&(a.flags|=8192),pe=y.callbacks,pe===null?y.callbacks=[le]:pe.push(le))}else pe={lane:le,tag:$.tag,payload:$.payload,callback:$.callback,next:null},me===null?(J=me=pe,W=_e):me=me.next=pe,j|=le;if($=$.next,$===null){if($=y.shared.pending,$===null)break;pe=$,$=pe.next,pe.next=null,y.lastBaseUpdate=pe,y.shared.pending=null}}while(!0);me===null&&(W=_e),y.baseState=W,y.firstBaseUpdate=J,y.lastBaseUpdate=me,b===null&&(y.shared.lanes=0),qi|=j,a.lanes=j,a.memoizedState=_e}}function xw(a,s){if(typeof a!="function")throw Error(r(191,a));a.call(s)}function ww(a,s){var c=a.callbacks;if(c!==null)for(a.callbacks=null,a=0;a<c.length;a++)xw(c[a],s)}function al(a,s){try{var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var y=h.next;c=y;do{if((c.tag&a)===a){h=void 0;var b=c.create,j=c.inst;h=b(),j.destroy=h}c=c.next}while(c!==y)}}catch($){kt(s,s.return,$)}}function Bi(a,s,c){try{var h=s.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var b=y.next;h=b;do{if((h.tag&a)===a){var j=h.inst,$=j.destroy;if($!==void 0){j.destroy=void 0,y=s;var W=c;try{$()}catch(J){kt(y,W,J)}}}h=h.next}while(h!==b)}}catch(J){kt(s,s.return,J)}}function Sw(a){var s=a.updateQueue;if(s!==null){var c=a.stateNode;try{ww(s,c)}catch(h){kt(a,a.return,h)}}}function Ew(a,s,c){c.props=Da(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(h){kt(a,s,h)}}function ja(a,s){try{var c=a.ref;if(c!==null){var h=a.stateNode;switch(a.tag){case 26:case 27:case 5:var y=h;break;default:y=h}typeof c=="function"?a.refCleanup=c(y):c.current=y}}catch(b){kt(a,s,b)}}function Un(a,s){var c=a.ref,h=a.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(y){kt(a,s,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(y){kt(a,s,y)}else c.current=null}function _w(a){var s=a.type,c=a.memoizedProps,h=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(y){kt(a,a.return,y)}}function kw(a,s,c){try{var h=a.stateNode;RO(h,a.type,c,s),h[Rn]=s}catch(y){kt(a,a.return,y)}}function Cw(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27||a.tag===4}function Yh(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Cw(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==27&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Wh(a,s,c){var h=a.tag;if(h===5||h===6)a=a.stateNode,s?c.nodeType===8?c.parentNode.insertBefore(a,s):c.insertBefore(a,s):(c.nodeType===8?(s=c.parentNode,s.insertBefore(a,c)):(s=c,s.appendChild(a)),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=pc));else if(h!==4&&h!==27&&(a=a.child,a!==null))for(Wh(a,s,c),a=a.sibling;a!==null;)Wh(a,s,c),a=a.sibling}function tc(a,s,c){var h=a.tag;if(h===5||h===6)a=a.stateNode,s?c.insertBefore(a,s):c.appendChild(a);else if(h!==4&&h!==27&&(a=a.child,a!==null))for(tc(a,s,c),a=a.sibling;a!==null;)tc(a,s,c),a=a.sibling}var si=!1,Pt=!1,Xh=!1,Tw=typeof WeakSet=="function"?WeakSet:Set,Qt=null,Aw=!1;function aO(a,s){if(a=a.containerInfo,Ep=wc,a=Vb(a),Zd(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else e:{c=(c=a.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var y=h.anchorOffset,b=h.focusNode;h=h.focusOffset;try{c.nodeType,b.nodeType}catch{c=null;break e}var j=0,$=-1,W=-1,J=0,me=0,_e=a,le=null;t:for(;;){for(var pe;_e!==c||y!==0&&_e.nodeType!==3||($=j+y),_e!==b||h!==0&&_e.nodeType!==3||(W=j+h),_e.nodeType===3&&(j+=_e.nodeValue.length),(pe=_e.firstChild)!==null;)le=_e,_e=pe;for(;;){if(_e===a)break t;if(le===c&&++J===y&&($=j),le===b&&++me===h&&(W=j),(pe=_e.nextSibling)!==null)break;_e=le,le=_e.parentNode}_e=pe}c=$===-1||W===-1?null:{start:$,end:W}}else c=null}c=c||{start:0,end:0}}else c=null;for(_p={focusedElem:a,selectionRange:c},wc=!1,Qt=s;Qt!==null;)if(s=Qt,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,Qt=a;else for(;Qt!==null;){switch(s=Qt,b=s.alternate,a=s.flags,s.tag){case 0:break;case 11:case 15:break;case 1:if(a&1024&&b!==null){a=void 0,c=s,y=b.memoizedProps,b=b.memoizedState,h=c.stateNode;try{var Ue=Da(c.type,y,c.elementType===c.type);a=h.getSnapshotBeforeUpdate(Ue,b),h.__reactInternalSnapshotBeforeUpdate=a}catch(Je){kt(c,c.return,Je)}}break;case 3:if(a&1024){if(a=s.stateNode.containerInfo,c=a.nodeType,c===9)Ap(a);else if(c===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Ap(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(a&1024)throw Error(r(163))}if(a=s.sibling,a!==null){a.return=s.return,Qt=a;break}Qt=s.return}return Ue=Aw,Aw=!1,Ue}function Rw(a,s,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:ui(a,c),h&4&&al(5,c);break;case 1:if(ui(a,c),h&4)if(a=c.stateNode,s===null)try{a.componentDidMount()}catch($){kt(c,c.return,$)}else{var y=Da(c.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(y,s,a.__reactInternalSnapshotBeforeUpdate)}catch($){kt(c,c.return,$)}}h&64&&Sw(c),h&512&&ja(c,c.return);break;case 3:if(ui(a,c),h&64&&(h=c.updateQueue,h!==null)){if(a=null,c.child!==null)switch(c.child.tag){case 27:case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}try{ww(h,a)}catch($){kt(c,c.return,$)}}break;case 26:ui(a,c),h&512&&ja(c,c.return);break;case 27:case 5:ui(a,c),s===null&&h&4&&_w(c),h&512&&ja(c,c.return);break;case 12:ui(a,c);break;case 13:ui(a,c),h&4&&Ow(a,c);break;case 22:if(y=c.memoizedState!==null||si,!y){s=s!==null&&s.memoizedState!==null||Pt;var b=si,j=Pt;si=y,(Pt=s)&&!j?$i(a,c,(c.subtreeFlags&8772)!==0):ui(a,c),si=b,Pt=j}h&512&&(c.memoizedProps.mode==="manual"?ja(c,c.return):Un(c,c.return));break;default:ui(a,c)}}function Dw(a){var s=a.alternate;s!==null&&(a.alternate=null,Dw(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&zd(s)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Ht=null,Bn=!1;function li(a,s,c){for(c=c.child;c!==null;)Nw(a,s,c),c=c.sibling}function Nw(a,s,c){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(bt,c)}catch{}switch(c.tag){case 26:Pt||Un(c,s),li(a,s,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Pt||Un(c,s);var h=Ht,y=Bn;for(Ht=c.stateNode,li(a,s,c),c=c.stateNode,s=c.attributes;s.length;)c.removeAttributeNode(s[0]);zd(c),Ht=h,Bn=y;break;case 5:Pt||Un(c,s);case 6:y=Ht;var b=Bn;if(Ht=null,li(a,s,c),Ht=y,Bn=b,Ht!==null)if(Bn)try{a=Ht,h=c.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)}catch(j){kt(c,s,j)}else try{Ht.removeChild(c.stateNode)}catch(j){kt(c,s,j)}break;case 18:Ht!==null&&(Bn?(s=Ht,c=c.stateNode,s.nodeType===8?Tp(s.parentNode,c):s.nodeType===1&&Tp(s,c),El(s)):Tp(Ht,c.stateNode));break;case 4:h=Ht,y=Bn,Ht=c.stateNode.containerInfo,Bn=!0,li(a,s,c),Ht=h,Bn=y;break;case 0:case 11:case 14:case 15:Pt||Bi(2,c,s),Pt||Bi(4,c,s),li(a,s,c);break;case 1:Pt||(Un(c,s),h=c.stateNode,typeof h.componentWillUnmount=="function"&&Ew(c,s,h)),li(a,s,c);break;case 21:li(a,s,c);break;case 22:Pt||Un(c,s),Pt=(h=Pt)||c.memoizedState!==null,li(a,s,c),Pt=h;break;default:li(a,s,c)}}function Ow(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{El(a)}catch(c){kt(s,s.return,c)}}function oO(a){switch(a.tag){case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new Tw),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new Tw),s;default:throw Error(r(435,a.tag))}}function Kh(a,s){var c=oO(a);s.forEach(function(h){var y=bO.bind(null,a,h);c.has(h)||(c.add(h),h.then(y,y))})}function ir(a,s){var c=s.deletions;if(c!==null)for(var h=0;h<c.length;h++){var y=c[h],b=a,j=s,$=j;e:for(;$!==null;){switch($.tag){case 27:case 5:Ht=$.stateNode,Bn=!1;break e;case 3:Ht=$.stateNode.containerInfo,Bn=!0;break e;case 4:Ht=$.stateNode.containerInfo,Bn=!0;break e}$=$.return}if(Ht===null)throw Error(r(160));Nw(b,j,y),Ht=null,Bn=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)jw(s,a),s=s.sibling}var br=null;function jw(a,s){var c=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:ir(s,a),ar(a),h&4&&(Bi(3,a,a.return),al(3,a),Bi(5,a,a.return));break;case 1:ir(s,a),ar(a),h&512&&(Pt||c===null||Un(c,c.return)),h&64&&si&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var y=br;if(ir(s,a),ar(a),h&512&&(Pt||c===null||Un(c,c.return)),h&4){var b=c!==null?c.memoizedState:null;if(h=a.memoizedState,c===null)if(h===null)if(a.stateNode===null){e:{h=a.type,c=a.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":b=y.getElementsByTagName("title")[0],(!b||b[Ns]||b[hn]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(h),y.head.insertBefore(b,y.querySelector("head > title"))),sn(b,h,c),b[hn]=a,Kt(b),h=b;break e;case"link":var j=_0("link","href",y).get(h+(c.href||""));if(j){for(var $=0;$<j.length;$++)if(b=j[$],b.getAttribute("href")===(c.href==null?null:c.href)&&b.getAttribute("rel")===(c.rel==null?null:c.rel)&&b.getAttribute("title")===(c.title==null?null:c.title)&&b.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){j.splice($,1);break t}}b=y.createElement(h),sn(b,h,c),y.head.appendChild(b);break;case"meta":if(j=_0("meta","content",y).get(h+(c.content||""))){for($=0;$<j.length;$++)if(b=j[$],b.getAttribute("content")===(c.content==null?null:""+c.content)&&b.getAttribute("name")===(c.name==null?null:c.name)&&b.getAttribute("property")===(c.property==null?null:c.property)&&b.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&b.getAttribute("charset")===(c.charSet==null?null:c.charSet)){j.splice($,1);break t}}b=y.createElement(h),sn(b,h,c),y.head.appendChild(b);break;default:throw Error(r(468,h))}b[hn]=a,Kt(b),h=b}a.stateNode=h}else k0(y,a.type,a.stateNode);else a.stateNode=E0(y,h,a.memoizedProps);else b!==h?(b===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):b.count--,h===null?k0(y,a.type,a.stateNode):E0(y,h,a.memoizedProps)):h===null&&a.stateNode!==null&&kw(a,a.memoizedProps,c.memoizedProps)}break;case 27:if(h&4&&a.alternate===null){y=a.stateNode,b=a.memoizedProps;try{for(var W=y.firstChild;W;){var J=W.nextSibling,me=W.nodeName;W[Ns]||me==="HEAD"||me==="BODY"||me==="SCRIPT"||me==="STYLE"||me==="LINK"&&W.rel.toLowerCase()==="stylesheet"||y.removeChild(W),W=J}for(var _e=a.type,le=y.attributes;le.length;)y.removeAttributeNode(le[0]);sn(y,_e,b),y[hn]=a,y[Rn]=b}catch(Ue){kt(a,a.return,Ue)}}case 5:if(ir(s,a),ar(a),h&512&&(Pt||c===null||Un(c,c.return)),a.flags&32){y=a.stateNode;try{ho(y,"")}catch(Ue){kt(a,a.return,Ue)}}h&4&&a.stateNode!=null&&(y=a.memoizedProps,kw(a,y,c!==null?c.memoizedProps:y)),h&1024&&(Xh=!0);break;case 6:if(ir(s,a),ar(a),h&4){if(a.stateNode===null)throw Error(r(162));h=a.memoizedProps,c=a.stateNode;try{c.nodeValue=h}catch(Ue){kt(a,a.return,Ue)}}break;case 3:if(yc=null,y=br,br=gc(s.containerInfo),ir(s,a),br=y,ar(a),h&4&&c!==null&&c.memoizedState.isDehydrated)try{El(s.containerInfo)}catch(Ue){kt(a,a.return,Ue)}Xh&&(Xh=!1,Lw(a));break;case 4:h=br,br=gc(a.stateNode.containerInfo),ir(s,a),ar(a),br=h;break;case 12:ir(s,a),ar(a);break;case 13:ir(s,a),ar(a),a.child.flags&8192&&a.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(ap=ve()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Kh(a,h)));break;case 22:if(h&512&&(Pt||c===null||Un(c,c.return)),W=a.memoizedState!==null,J=c!==null&&c.memoizedState!==null,me=si,_e=Pt,si=me||W,Pt=_e||J,ir(s,a),Pt=_e,si=me,ar(a),s=a.stateNode,s._current=a,s._visibility&=-3,s._visibility|=s._pendingVisibility&2,h&8192&&(s._visibility=W?s._visibility&-2:s._visibility|1,W&&(s=si||Pt,c===null||J||s||Do(a)),a.memoizedProps===null||a.memoizedProps.mode!=="manual"))e:for(c=null,s=a;;){if(s.tag===5||s.tag===26||s.tag===27){if(c===null){J=c=s;try{if(y=J.stateNode,W)b=y.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{j=J.stateNode,$=J.memoizedProps.style;var pe=$!=null&&$.hasOwnProperty("display")?$.display:null;j.style.display=pe==null||typeof pe=="boolean"?"":(""+pe).trim()}}catch(Ue){kt(J,J.return,Ue)}}}else if(s.tag===6){if(c===null){J=s;try{J.stateNode.nodeValue=W?"":J.memoizedProps}catch(Ue){kt(J,J.return,Ue)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===a)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;c===s&&(c=null),s=s.return}c===s&&(c=null),s.sibling.return=s.return,s=s.sibling}h&4&&(h=a.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,Kh(a,c))));break;case 19:ir(s,a),ar(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Kh(a,h)));break;case 21:break;default:ir(s,a),ar(a)}}function ar(a){var s=a.flags;if(s&2){try{if(a.tag!==27){e:{for(var c=a.return;c!==null;){if(Cw(c)){var h=c;break e}c=c.return}throw Error(r(160))}switch(h.tag){case 27:var y=h.stateNode,b=Yh(a);tc(a,b,y);break;case 5:var j=h.stateNode;h.flags&32&&(ho(j,""),h.flags&=-33);var $=Yh(a);tc(a,$,j);break;case 3:case 4:var W=h.stateNode.containerInfo,J=Yh(a);Wh(a,J,W);break;default:throw Error(r(161))}}}catch(me){kt(a,a.return,me)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function Lw(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;Lw(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function ui(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Rw(a,s.alternate,s),s=s.sibling}function Do(a){for(a=a.child;a!==null;){var s=a;switch(s.tag){case 0:case 11:case 14:case 15:Bi(4,s,s.return),Do(s);break;case 1:Un(s,s.return);var c=s.stateNode;typeof c.componentWillUnmount=="function"&&Ew(s,s.return,c),Do(s);break;case 26:case 27:case 5:Un(s,s.return),Do(s);break;case 22:Un(s,s.return),s.memoizedState===null&&Do(s);break;default:Do(s)}a=a.sibling}}function $i(a,s,c){for(c=c&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var h=s.alternate,y=a,b=s,j=b.flags;switch(b.tag){case 0:case 11:case 15:$i(y,b,c),al(4,b);break;case 1:if($i(y,b,c),h=b,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(J){kt(h,h.return,J)}if(h=b,y=h.updateQueue,y!==null){var $=h.stateNode;try{var W=y.shared.hiddenCallbacks;if(W!==null)for(y.shared.hiddenCallbacks=null,y=0;y<W.length;y++)xw(W[y],$)}catch(J){kt(h,h.return,J)}}c&&j&64&&Sw(b),ja(b,b.return);break;case 26:case 27:case 5:$i(y,b,c),c&&h===null&&j&4&&_w(b),ja(b,b.return);break;case 12:$i(y,b,c);break;case 13:$i(y,b,c),c&&j&4&&Ow(y,b);break;case 22:b.memoizedState===null&&$i(y,b,c),ja(b,b.return);break;default:$i(y,b,c)}s=s.sibling}}function Zh(a,s){var c=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==c&&(a!=null&&a.refCount++,c!=null&&Xs(c))}function Qh(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Xs(a))}function Hi(a,s,c,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)zw(a,s,c,h),s=s.sibling}function zw(a,s,c,h){var y=s.flags;switch(s.tag){case 0:case 11:case 15:Hi(a,s,c,h),y&2048&&al(9,s);break;case 3:Hi(a,s,c,h),y&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Xs(a)));break;case 12:if(y&2048){Hi(a,s,c,h),a=s.stateNode;try{var b=s.memoizedProps,j=b.id,$=b.onPostCommit;typeof $=="function"&&$(j,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(W){kt(s,s.return,W)}}else Hi(a,s,c,h);break;case 23:break;case 22:b=s.stateNode,s.memoizedState!==null?b._visibility&4?Hi(a,s,c,h):ol(a,s):b._visibility&4?Hi(a,s,c,h):(b._visibility|=4,No(a,s,c,h,(s.subtreeFlags&10256)!==0)),y&2048&&Zh(s.alternate,s);break;case 24:Hi(a,s,c,h),y&2048&&Qh(s.alternate,s);break;default:Hi(a,s,c,h)}}function No(a,s,c,h,y){for(y=y&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;){var b=a,j=s,$=c,W=h,J=j.flags;switch(j.tag){case 0:case 11:case 15:No(b,j,$,W,y),al(8,j);break;case 23:break;case 22:var me=j.stateNode;j.memoizedState!==null?me._visibility&4?No(b,j,$,W,y):ol(b,j):(me._visibility|=4,No(b,j,$,W,y)),y&&J&2048&&Zh(j.alternate,j);break;case 24:No(b,j,$,W,y),y&&J&2048&&Qh(j.alternate,j);break;default:No(b,j,$,W,y)}s=s.sibling}}function ol(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var c=a,h=s,y=h.flags;switch(h.tag){case 22:ol(c,h),y&2048&&Zh(h.alternate,h);break;case 24:ol(c,h),y&2048&&Qh(h.alternate,h);break;default:ol(c,h)}s=s.sibling}}var sl=8192;function Oo(a){if(a.subtreeFlags&sl)for(a=a.child;a!==null;)Mw(a),a=a.sibling}function Mw(a){switch(a.tag){case 26:Oo(a),a.flags&sl&&a.memoizedState!==null&&WO(br,a.memoizedState,a.memoizedProps);break;case 5:Oo(a);break;case 3:case 4:var s=br;br=gc(a.stateNode.containerInfo),Oo(a),br=s;break;case 22:a.memoizedState===null&&(s=a.alternate,s!==null&&s.memoizedState!==null?(s=sl,sl=16777216,Oo(a),sl=s):Oo(a));break;default:Oo(a)}}function Pw(a){var s=a.alternate;if(s!==null&&(a=s.child,a!==null)){s.child=null;do s=a.sibling,a.sibling=null,a=s;while(a!==null)}}function ll(a){var s=a.deletions;if(a.flags&16){if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];Qt=h,Iw(h,a)}Pw(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Fw(a),a=a.sibling}function Fw(a){switch(a.tag){case 0:case 11:case 15:ll(a),a.flags&2048&&Bi(9,a,a.return);break;case 3:ll(a);break;case 12:ll(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&4&&(a.return===null||a.return.tag!==13)?(s._visibility&=-5,nc(a)):ll(a);break;default:ll(a)}}function nc(a){var s=a.deletions;if(a.flags&16){if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];Qt=h,Iw(h,a)}Pw(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:Bi(8,s,s.return),nc(s);break;case 22:c=s.stateNode,c._visibility&4&&(c._visibility&=-5,nc(s));break;default:nc(s)}a=a.sibling}}function Iw(a,s){for(;Qt!==null;){var c=Qt;switch(c.tag){case 0:case 11:case 15:Bi(8,c,s);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Xs(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,Qt=h;else e:for(c=a;Qt!==null;){h=Qt;var y=h.sibling,b=h.return;if(Dw(h),h===c){Qt=null;break e}if(y!==null){y.return=b,Qt=y;break e}Qt=b}}}function sO(a,s,c,h){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function or(a,s,c,h){return new sO(a,s,c,h)}function Jh(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Vi(a,s){var c=a.alternate;return c===null?(c=or(a.tag,s,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=s,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&31457280,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,s=a.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function Gw(a,s){a.flags&=31457282;var c=a.alternate;return c===null?(a.childLanes=0,a.lanes=s,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,s=c.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a}function rc(a,s,c,h,y,b){var j=0;if(h=a,typeof a=="function")Jh(a)&&(j=1);else if(typeof a=="string")j=qO(a,c,Ee.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case f:return La(c.children,y,b,s);case d:j=8,y|=24;break;case p:return a=or(12,c,s,y|2),a.elementType=p,a.lanes=b,a;case x:return a=or(13,c,s,y),a.elementType=x,a.lanes=b,a;case k:return a=or(19,c,s,y),a.elementType=k,a.lanes=b,a;case T:return Uw(c,y,b,s);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case m:case g:j=10;break e;case v:j=9;break e;case w:j=11;break e;case C:j=14;break e;case _:j=16,h=null;break e}j=29,c=Error(r(130,a===null?"null":typeof a,"")),h=null}return s=or(j,c,s,y),s.elementType=a,s.type=h,s.lanes=b,s}function La(a,s,c,h){return a=or(7,a,h,s),a.lanes=c,a}function Uw(a,s,c,h){a=or(22,a,h,s),a.elementType=T,a.lanes=c;var y={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var b=y._current;if(b===null)throw Error(r(456));if(!(y._pendingVisibility&2)){var j=ji(b,2);j!==null&&(y._pendingVisibility|=2,_n(j,b,2))}},attach:function(){var b=y._current;if(b===null)throw Error(r(456));if(y._pendingVisibility&2){var j=ji(b,2);j!==null&&(y._pendingVisibility&=-3,_n(j,b,2))}}};return a.stateNode=y,a}function ep(a,s,c){return a=or(6,a,null,s),a.lanes=c,a}function tp(a,s,c){return s=or(4,a.children!==null?a.children:[],a.key,s),s.lanes=c,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}function ci(a){a.flags|=4}function Bw(a,s){if(s.type!=="stylesheet"||s.state.loading&4)a.flags&=-16777217;else if(a.flags|=16777216,!C0(s)){if(s=rr.current,s!==null&&((ht&4194176)===ht?Lr!==null:(ht&62914560)!==ht&&!(ht&536870912)||s!==Lr))throw qs=oh,ax;a.flags|=8192}}function ic(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?Cn():536870912,a.lanes|=s,Lo|=s)}function ul(a,s){if(!pt)switch(a.tailMode){case"hidden":s=a.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function jt(a){var s=a.alternate!==null&&a.alternate.child===a.child,c=0,h=0;if(s)for(var y=a.child;y!==null;)c|=y.lanes|y.childLanes,h|=y.subtreeFlags&31457280,h|=y.flags&31457280,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)c|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=h,a.childLanes=c,s}function lO(a,s,c){var h=s.pendingProps;switch(ih(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(s),null;case 1:return jt(s),null;case 3:return c=s.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),oi(Wt),ee(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&(Bs(s)?ci(s):a===null||a.memoizedState.isDehydrated&&!(s.flags&256)||(s.flags|=1024,yr!==null&&(up(yr),yr=null))),jt(s),null;case 26:return c=s.memoizedState,a===null?(ci(s),c!==null?(jt(s),Bw(s,c)):(jt(s),s.flags&=-16777217)):c?c!==a.memoizedState?(ci(s),jt(s),Bw(s,c)):(jt(s),s.flags&=-16777217):(a.memoizedProps!==h&&ci(s),jt(s),s.flags&=-16777217),null;case 27:Te(s),c=Pe.current;var y=s.type;if(a!==null&&s.stateNode!=null)a.memoizedProps!==h&&ci(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return jt(s),null}a=Ee.current,Bs(s)?rx(s):(a=y0(y,h,c),s.stateNode=a,ci(s))}return jt(s),null;case 5:if(Te(s),c=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==h&&ci(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return jt(s),null}if(a=Ee.current,Bs(s))rx(s);else{switch(y=mc(Pe.current),a){case 1:a=y.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:a=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":a=y.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":a=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":a=y.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?a.multiple=!0:h.size&&(a.size=h.size);break;default:a=typeof h.is=="string"?y.createElement(c,{is:h.is}):y.createElement(c)}}a[hn]=s,a[Rn]=h;e:for(y=s.child;y!==null;){if(y.tag===5||y.tag===6)a.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===s)break e;for(;y.sibling===null;){if(y.return===null||y.return===s)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}s.stateNode=a;e:switch(sn(a,c,h),c){case"button":case"input":case"select":case"textarea":a=!!h.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ci(s)}}return jt(s),s.flags&=-16777217,null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==h&&ci(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(a=Pe.current,Bs(s)){if(a=s.stateNode,c=s.memoizedProps,h=null,y=En,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}a[hn]=s,a=!!(a.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||d0(a.nodeValue,c)),a||_a(s)}else a=mc(a).createTextNode(h),a[hn]=s,s.stateNode=a}return jt(s),null;case 13:if(h=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=Bs(s),h!==null&&h.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[hn]=s}else $s(),!(s.flags&128)&&(s.memoizedState=null),s.flags|=4;jt(s),y=!1}else yr!==null&&(up(yr),yr=null),y=!0;if(!y)return s.flags&256?(ni(s),s):(ni(s),null)}if(ni(s),s.flags&128)return s.lanes=c,s;if(c=h!==null,a=a!==null&&a.memoizedState!==null,c){h=s.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var b=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(b=h.memoizedState.cachePool.pool),b!==y&&(h.flags|=2048)}return c!==a&&c&&(s.child.flags|=8192),ic(s,s.updateQueue),jt(s),null;case 4:return ee(),a===null&&xp(s.stateNode.containerInfo),jt(s),null;case 10:return oi(s.type),jt(s),null;case 19:if(Ce(Yt),y=s.memoizedState,y===null)return jt(s),null;if(h=(s.flags&128)!==0,b=y.rendering,b===null)if(h)ul(y,!1);else{if(Ft!==0||a!==null&&a.flags&128)for(a=s.child;a!==null;){if(b=Uu(a),b!==null){for(s.flags|=128,ul(y,!1),a=b.updateQueue,s.updateQueue=a,ic(s,a),s.subtreeFlags=0,a=c,c=s.child;c!==null;)Gw(c,a),c=c.sibling;return he(Yt,Yt.current&1|2),s.child}a=a.sibling}y.tail!==null&&ve()>ac&&(s.flags|=128,h=!0,ul(y,!1),s.lanes=4194304)}else{if(!h)if(a=Uu(b),a!==null){if(s.flags|=128,h=!0,a=a.updateQueue,s.updateQueue=a,ic(s,a),ul(y,!0),y.tail===null&&y.tailMode==="hidden"&&!b.alternate&&!pt)return jt(s),null}else 2*ve()-y.renderingStartTime>ac&&c!==536870912&&(s.flags|=128,h=!0,ul(y,!1),s.lanes=4194304);y.isBackwards?(b.sibling=s.child,s.child=b):(a=y.last,a!==null?a.sibling=b:s.child=b,y.last=b)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=ve(),s.sibling=null,a=Yt.current,he(Yt,h?a&1|2:a&1),s):(jt(s),null);case 22:case 23:return ni(s),lh(),h=s.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?c&536870912&&!(s.flags&128)&&(jt(s),s.subtreeFlags&6&&(s.flags|=8192)):jt(s),c=s.updateQueue,c!==null&&ic(s,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==c&&(s.flags|=2048),a!==null&&Ce(Ca),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),oi(Wt),jt(s),null;case 25:return null}throw Error(r(156,s.tag))}function uO(a,s){switch(ih(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return oi(Wt),ee(),a=s.flags,a&65536&&!(a&128)?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return Te(s),null;case 13:if(ni(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));$s()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return Ce(Yt),null;case 4:return ee(),null;case 10:return oi(s.type),null;case 22:case 23:return ni(s),lh(),a!==null&&Ce(Ca),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return oi(Wt),null;case 25:return null;default:return null}}function $w(a,s){switch(ih(s),s.tag){case 3:oi(Wt),ee();break;case 26:case 27:case 5:Te(s);break;case 4:ee();break;case 13:ni(s);break;case 19:Ce(Yt);break;case 10:oi(s.type);break;case 22:case 23:ni(s),lh(),a!==null&&Ce(Ca);break;case 24:oi(Wt)}}var cO={getCacheForType:function(a){var s=pn(Wt),c=s.data.get(a);return c===void 0&&(c=a(),s.data.set(a,c)),c}},fO=typeof WeakMap=="function"?WeakMap:Map,Lt=0,Rt=null,lt=null,ht=0,Dt=0,$n=null,fi=!1,jo=!1,np=!1,di=0,Ft=0,qi=0,za=0,rp=0,sr=0,Lo=0,cl=null,Mr=null,ip=!1,ap=0,ac=1/0,oc=null,Yi=null,sc=!1,Ma=null,fl=0,op=0,sp=null,dl=0,lp=null;function Hn(){if(Lt&2&&ht!==0)return ht&-ht;if(P.T!==null){var a=ko;return a!==0?a:gp()}return cb()}function Hw(){sr===0&&(sr=!(ht&536870912)||pt?_t():536870912);var a=rr.current;return a!==null&&(a.flags|=32),sr}function _n(a,s,c){(a===Rt&&Dt===2||a.cancelPendingCommit!==null)&&(zo(a,0),hi(a,ht,sr,!1)),Tn(a,c),(!(Lt&2)||a!==Rt)&&(a===Rt&&(!(Lt&2)&&(za|=c),Ft===4&&hi(a,ht,sr,!1)),Pr(a))}function Vw(a,s,c){if(Lt&6)throw Error(r(327));var h=!c&&(s&60)===0&&(s&a.expiredLanes)===0||Ze(a,s),y=h?pO(a,s):dp(a,s,!0),b=h;do{if(y===0){jo&&!h&&hi(a,s,0,!1);break}else if(y===6)hi(a,s,0,!fi);else{if(c=a.current.alternate,b&&!dO(c)){y=dp(a,s,!1),b=!1;continue}if(y===2){if(b=s,a.errorRecoveryDisabledLanes&b)var j=0;else j=a.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){s=j;e:{var $=a;y=cl;var W=$.current.memoizedState.isDehydrated;if(W&&(zo($,j).flags|=256),j=dp($,j,!1),j!==2){if(np&&!W){$.errorRecoveryDisabledLanes|=b,za|=b,y=4;break e}b=Mr,Mr=y,b!==null&&up(b)}y=j}if(b=!1,y!==2)continue}}if(y===1){zo(a,0),hi(a,s,0,!0);break}e:{switch(h=a,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194176)===s){hi(h,s,sr,!fi);break e}break;case 2:Mr=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=c,h.finishedLanes=s,(s&62914560)===s&&(b=ap+300-ve(),10<b)){if(hi(h,s,sr,!fi),oo(h,0)!==0)break e;h.timeoutHandle=m0(qw.bind(null,h,c,Mr,oc,ip,s,sr,za,Lo,fi,2,-0,0),b);break e}qw(h,c,Mr,oc,ip,s,sr,za,Lo,fi,0,-0,0)}}break}while(!0);Pr(a)}function up(a){Mr===null?Mr=a:Mr.push.apply(Mr,a)}function qw(a,s,c,h,y,b,j,$,W,J,me,_e,le){var pe=s.subtreeFlags;if((pe&8192||(pe&16785408)===16785408)&&(yl={stylesheets:null,count:0,unsuspend:YO},Mw(s),s=XO(),s!==null)){a.cancelPendingCommit=s(Jw.bind(null,a,c,h,y,j,$,W,1,_e,le)),hi(a,b,j,!J);return}Jw(a,c,h,y,j,$,W,me,_e,le)}function dO(a){for(var s=a;;){var c=s.tag;if((c===0||c===11||c===15)&&s.flags&16384&&(c=s.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var y=c[h],b=y.getSnapshot;y=y.value;try{if(!Gn(b(),y))return!1}catch{return!1}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function hi(a,s,c,h){s&=~rp,s&=~za,a.suspendedLanes|=s,a.pingedLanes&=~s,h&&(a.warmLanes|=s),h=a.expirationTimes;for(var y=s;0<y;){var b=31-At(y),j=1<<b;h[b]=-1,y&=~j}c!==0&&An(a,c,s)}function lc(){return Lt&6?!0:(hl(0),!1)}function cp(){if(lt!==null){if(Dt===0)var a=lt.return;else a=lt,ai=Na=null,gh(a),Eo=null,Ys=0,a=lt;for(;a!==null;)$w(a.alternate,a),a=a.return;lt=null}}function zo(a,s){a.finishedWork=null,a.finishedLanes=0;var c=a.timeoutHandle;c!==-1&&(a.timeoutHandle=-1,NO(c)),c=a.cancelPendingCommit,c!==null&&(a.cancelPendingCommit=null,c()),cp(),Rt=a,lt=c=Vi(a.current,null),ht=s,Dt=0,$n=null,fi=!1,jo=Ze(a,s),np=!1,Lo=sr=rp=za=qi=Ft=0,Mr=cl=null,ip=!1,s&8&&(s|=s&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=s;0<h;){var y=31-At(h),b=1<<y;s|=a[y],h&=~b}return di=s,Ou(),c}function Yw(a,s){it=null,P.H=zr,s===Vs?(s=lx(),Dt=3):s===ax?(s=lx(),Dt=4):Dt=s===ow?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,$n=s,lt===null&&(Ft=1,Qu(a,er(s,a.current)))}function Ww(){var a=P.H;return P.H=zr,a===null?zr:a}function Xw(){var a=P.A;return P.A=cO,a}function fp(){Ft=4,fi||(ht&4194176)!==ht&&rr.current!==null||(jo=!0),!(qi&134217727)&&!(za&134217727)||Rt===null||hi(Rt,ht,sr,!1)}function dp(a,s,c){var h=Lt;Lt|=2;var y=Ww(),b=Xw();(Rt!==a||ht!==s)&&(oc=null,zo(a,s)),s=!1;var j=Ft;e:do try{if(Dt!==0&&lt!==null){var $=lt,W=$n;switch(Dt){case 8:cp(),j=6;break e;case 3:case 2:case 6:rr.current===null&&(s=!0);var J=Dt;if(Dt=0,$n=null,Mo(a,$,W,J),c&&jo){j=0;break e}break;default:J=Dt,Dt=0,$n=null,Mo(a,$,W,J)}}hO(),j=Ft;break}catch(me){Yw(a,me)}while(!0);return s&&a.shellSuspendCounter++,ai=Na=null,Lt=h,P.H=y,P.A=b,lt===null&&(Rt=null,ht=0,Ou()),j}function hO(){for(;lt!==null;)Kw(lt)}function pO(a,s){var c=Lt;Lt|=2;var h=Ww(),y=Xw();Rt!==a||ht!==s?(oc=null,ac=ve()+500,zo(a,s)):jo=Ze(a,s);e:do try{if(Dt!==0&&lt!==null){s=lt;var b=$n;t:switch(Dt){case 1:Dt=0,$n=null,Mo(a,s,b,1);break;case 2:if(ox(b)){Dt=0,$n=null,Zw(s);break}s=function(){Dt===2&&Rt===a&&(Dt=7),Pr(a)},b.then(s,s);break e;case 3:Dt=7;break e;case 4:Dt=5;break e;case 7:ox(b)?(Dt=0,$n=null,Zw(s)):(Dt=0,$n=null,Mo(a,s,b,7));break;case 5:var j=null;switch(lt.tag){case 26:j=lt.memoizedState;case 5:case 27:var $=lt;if(!j||C0(j)){Dt=0,$n=null;var W=$.sibling;if(W!==null)lt=W;else{var J=$.return;J!==null?(lt=J,uc(J)):lt=null}break t}}Dt=0,$n=null,Mo(a,s,b,5);break;case 6:Dt=0,$n=null,Mo(a,s,b,6);break;case 8:cp(),Ft=6;break e;default:throw Error(r(462))}}mO();break}catch(me){Yw(a,me)}while(!0);return ai=Na=null,P.H=h,P.A=y,Lt=c,lt!==null?0:(Rt=null,ht=0,Ou(),Ft)}function mO(){for(;lt!==null&&!$e();)Kw(lt)}function Kw(a){var s=yw(a.alternate,a,di);a.memoizedProps=a.pendingProps,s===null?uc(a):lt=s}function Zw(a){var s=a,c=s.alternate;switch(s.tag){case 15:case 0:s=dw(c,s,s.pendingProps,s.type,void 0,ht);break;case 11:s=dw(c,s,s.pendingProps,s.type.render,s.ref,ht);break;case 5:gh(s);default:$w(c,s),s=lt=Gw(s,di),s=yw(c,s,di)}a.memoizedProps=a.pendingProps,s===null?uc(a):lt=s}function Mo(a,s,c,h){ai=Na=null,gh(s),Eo=null,Ys=0;var y=s.return;try{if(rO(a,y,s,c,ht)){Ft=1,Qu(a,er(c,a.current)),lt=null;return}}catch(b){if(y!==null)throw lt=y,b;Ft=1,Qu(a,er(c,a.current)),lt=null;return}s.flags&32768?(pt||h===1?a=!0:jo||ht&536870912?a=!1:(fi=a=!0,(h===2||h===3||h===6)&&(h=rr.current,h!==null&&h.tag===13&&(h.flags|=16384))),Qw(s,a)):uc(s)}function uc(a){var s=a;do{if(s.flags&32768){Qw(s,fi);return}a=s.return;var c=lO(s.alternate,s,di);if(c!==null){lt=c;return}if(s=s.sibling,s!==null){lt=s;return}lt=s=a}while(s!==null);Ft===0&&(Ft=5)}function Qw(a,s){do{var c=uO(a.alternate,a);if(c!==null){c.flags&=32767,lt=c;return}if(c=a.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!s&&(a=a.sibling,a!==null)){lt=a;return}lt=a=c}while(a!==null);Ft=6,lt=null}function Jw(a,s,c,h,y,b,j,$,W,J){var me=P.T,_e=X.p;try{X.p=2,P.T=null,gO(a,s,c,h,_e,y,b,j,$,W,J)}finally{P.T=me,X.p=_e}}function gO(a,s,c,h,y,b,j,$){do Po();while(Ma!==null);if(Lt&6)throw Error(r(327));var W=a.finishedWork;if(h=a.finishedLanes,W===null)return null;if(a.finishedWork=null,a.finishedLanes=0,W===a.current)throw Error(r(177));a.callbackNode=null,a.callbackPriority=0,a.cancelPendingCommit=null;var J=W.lanes|W.childLanes;if(J|=th,Zr(a,h,J,b,j,$),a===Rt&&(lt=Rt=null,ht=0),!(W.subtreeFlags&10256)&&!(W.flags&10256)||sc||(sc=!0,op=J,sp=c,xO(Oe,function(){return Po(),null})),c=(W.flags&15990)!==0,W.subtreeFlags&15990||c?(c=P.T,P.T=null,b=X.p,X.p=2,j=Lt,Lt|=4,aO(a,W),jw(W,a),GN(_p,a.containerInfo),wc=!!Ep,_p=Ep=null,a.current=W,Rw(a,W.alternate,W),Ge(),Lt=j,X.p=b,P.T=c):a.current=W,sc?(sc=!1,Ma=a,fl=h):e0(a,J),J=a.pendingLanes,J===0&&(Yi=null),qt(W.stateNode),Pr(a),s!==null)for(y=a.onRecoverableError,W=0;W<s.length;W++)J=s[W],y(J.value,{componentStack:J.stack});return fl&3&&Po(),J=a.pendingLanes,h&4194218&&J&42?a===lp?dl++:(dl=0,lp=a):dl=0,hl(0),null}function e0(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,Xs(s)))}function Po(){if(Ma!==null){var a=Ma,s=op;op=0;var c=ub(fl),h=P.T,y=X.p;try{if(X.p=32>c?32:c,P.T=null,Ma===null)var b=!1;else{c=sp,sp=null;var j=Ma,$=fl;if(Ma=null,fl=0,Lt&6)throw Error(r(331));var W=Lt;if(Lt|=4,Fw(j.current),zw(j,j.current,$,c),Lt=W,hl(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(bt,j)}catch{}b=!0}return b}finally{X.p=y,P.T=h,e0(a,s)}}return!1}function t0(a,s,c){s=er(c,s),s=Dh(a.stateNode,s,2),a=Ui(a,s,2),a!==null&&(Tn(a,2),Pr(a))}function kt(a,s,c){if(a.tag===3)t0(a,a,c);else for(;s!==null;){if(s.tag===3){t0(s,a,c);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Yi===null||!Yi.has(h))){a=er(c,a),c=iw(2),h=Ui(s,c,2),h!==null&&(aw(c,h,s,a),Tn(h,2),Pr(h));break}}s=s.return}}function hp(a,s,c){var h=a.pingCache;if(h===null){h=a.pingCache=new fO;var y=new Set;h.set(s,y)}else y=h.get(s),y===void 0&&(y=new Set,h.set(s,y));y.has(c)||(np=!0,y.add(c),a=vO.bind(null,a,s,c),s.then(a,a))}function vO(a,s,c){var h=a.pingCache;h!==null&&h.delete(s),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,Rt===a&&(ht&c)===c&&(Ft===4||Ft===3&&(ht&62914560)===ht&&300>ve()-ap?!(Lt&2)&&zo(a,0):rp|=c,Lo===ht&&(Lo=0)),Pr(a)}function n0(a,s){s===0&&(s=Cn()),a=ji(a,s),a!==null&&(Tn(a,s),Pr(a))}function yO(a){var s=a.memoizedState,c=0;s!==null&&(c=s.retryLane),n0(a,c)}function bO(a,s){var c=0;switch(a.tag){case 13:var h=a.stateNode,y=a.memoizedState;y!==null&&(c=y.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),n0(a,c)}function xO(a,s){return Se(a,s)}var cc=null,Fo=null,pp=!1,fc=!1,mp=!1,Pa=0;function Pr(a){a!==Fo&&a.next===null&&(Fo===null?cc=Fo=a:Fo=Fo.next=a),fc=!0,pp||(pp=!0,SO(wO))}function hl(a,s){if(!mp&&fc){mp=!0;do for(var c=!1,h=cc;h!==null;){if(a!==0){var y=h.pendingLanes;if(y===0)var b=0;else{var j=h.suspendedLanes,$=h.pingedLanes;b=(1<<31-At(42|a)+1)-1,b&=y&~(j&~$),b=b&201326677?b&201326677|1:b?b|2:0}b!==0&&(c=!0,a0(h,b))}else b=ht,b=oo(h,h===Rt?b:0),!(b&3)||Ze(h,b)||(c=!0,a0(h,b));h=h.next}while(c);mp=!1}}function wO(){fc=pp=!1;var a=0;Pa!==0&&(DO()&&(a=Pa),Pa=0);for(var s=ve(),c=null,h=cc;h!==null;){var y=h.next,b=r0(h,s);b===0?(h.next=null,c===null?cc=y:c.next=y,y===null&&(Fo=c)):(c=h,(a!==0||b&3)&&(fc=!0)),h=y}hl(a)}function r0(a,s){for(var c=a.suspendedLanes,h=a.pingedLanes,y=a.expirationTimes,b=a.pendingLanes&-62914561;0<b;){var j=31-At(b),$=1<<j,W=y[j];W===-1?(!($&c)||$&h)&&(y[j]=gt($,s)):W<=s&&(a.expiredLanes|=$),b&=~$}if(s=Rt,c=ht,c=oo(a,a===s?c:0),h=a.callbackNode,c===0||a===s&&Dt===2||a.cancelPendingCommit!==null)return h!==null&&h!==null&&ie(h),a.callbackNode=null,a.callbackPriority=0;if(!(c&3)||Ze(a,c)){if(s=c&-c,s===a.callbackPriority)return s;switch(h!==null&&ie(h),ub(c)){case 2:case 8:c=de;break;case 32:c=Oe;break;case 268435456:c=Ye;break;default:c=Oe}return h=i0.bind(null,a),c=Se(c,h),a.callbackPriority=s,a.callbackNode=c,s}return h!==null&&h!==null&&ie(h),a.callbackPriority=2,a.callbackNode=null,2}function i0(a,s){var c=a.callbackNode;if(Po()&&a.callbackNode!==c)return null;var h=ht;return h=oo(a,a===Rt?h:0),h===0?null:(Vw(a,h,s),r0(a,ve()),a.callbackNode!=null&&a.callbackNode===c?i0.bind(null,a):null)}function a0(a,s){if(Po())return null;Vw(a,s,!0)}function SO(a){OO(function(){Lt&6?Se(te,a):a()})}function gp(){return Pa===0&&(Pa=_t()),Pa}function o0(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:ku(""+a)}function s0(a,s){var c=s.ownerDocument.createElement("input");return c.name=s.name,c.value=s.value,a.id&&c.setAttribute("form",a.id),s.parentNode.insertBefore(c,s),a=new FormData(a),c.parentNode.removeChild(c),a}function EO(a,s,c,h,y){if(s==="submit"&&c&&c.stateNode===y){var b=o0((y[Rn]||null).action),j=h.submitter;j&&(s=(s=j[Rn]||null)?o0(s.formAction):j.getAttribute("formAction"),s!==null&&(b=s,j=null));var $=new Ru("action","action",null,h,y);a.push({event:$,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Pa!==0){var W=j?s0(y,j):new FormData(y);kh(c,{pending:!0,data:W,method:y.method,action:b},null,W)}}else typeof b=="function"&&($.preventDefault(),W=j?s0(y,j):new FormData(y),kh(c,{pending:!0,data:W,method:y.method,action:b},b,W))},currentTarget:y}]})}}for(var vp=0;vp<Jb.length;vp++){var yp=Jb[vp],_O=yp.toLowerCase(),kO=yp[0].toUpperCase()+yp.slice(1);vr(_O,"on"+kO)}vr(Wb,"onAnimationEnd"),vr(Xb,"onAnimationIteration"),vr(Kb,"onAnimationStart"),vr("dblclick","onDoubleClick"),vr("focusin","onFocus"),vr("focusout","onBlur"),vr(BN,"onTransitionRun"),vr($N,"onTransitionStart"),vr(HN,"onTransitionCancel"),vr(Zb,"onTransitionEnd"),co("onMouseEnter",["mouseout","mouseover"]),co("onMouseLeave",["mouseout","mouseover"]),co("onPointerEnter",["pointerout","pointerover"]),co("onPointerLeave",["pointerout","pointerover"]),ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ya("onBeforeInput",["compositionend","keypress","textInput","paste"]),ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pl="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(" "),CO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pl));function l0(a,s){s=(s&4)!==0;for(var c=0;c<a.length;c++){var h=a[c],y=h.event;h=h.listeners;e:{var b=void 0;if(s)for(var j=h.length-1;0<=j;j--){var $=h[j],W=$.instance,J=$.currentTarget;if($=$.listener,W!==b&&y.isPropagationStopped())break e;b=$,y.currentTarget=J;try{b(y)}catch(me){Zu(me)}y.currentTarget=null,b=W}else for(j=0;j<h.length;j++){if($=h[j],W=$.instance,J=$.currentTarget,$=$.listener,W!==b&&y.isPropagationStopped())break e;b=$,y.currentTarget=J;try{b(y)}catch(me){Zu(me)}y.currentTarget=null,b=W}}}}function ft(a,s){var c=s[Ld];c===void 0&&(c=s[Ld]=new Set);var h=a+"__bubble";c.has(h)||(u0(s,a,2,!1),c.add(h))}function bp(a,s,c){var h=0;s&&(h|=4),u0(c,a,h,s)}var dc="_reactListening"+Math.random().toString(36).slice(2);function xp(a){if(!a[dc]){a[dc]=!0,db.forEach(function(c){c!=="selectionchange"&&(CO.has(c)||bp(c,!1,a),bp(c,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[dc]||(s[dc]=!0,bp("selectionchange",!1,s))}}function u0(a,s,c,h){switch(O0(s)){case 2:var y=QO;break;case 8:y=JO;break;default:y=jp}c=y.bind(null,s,c,a),y=void 0,!Bd||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(y=!0),h?y!==void 0?a.addEventListener(s,c,{capture:!0,passive:y}):a.addEventListener(s,c,!0):y!==void 0?a.addEventListener(s,c,{passive:y}):a.addEventListener(s,c,!1)}function wp(a,s,c,h,y){var b=h;if(!(s&1)&&!(s&2)&&h!==null)e:for(;;){if(h===null)return;var j=h.tag;if(j===3||j===4){var $=h.stateNode.containerInfo;if($===y||$.nodeType===8&&$.parentNode===y)break;if(j===4)for(j=h.return;j!==null;){var W=j.tag;if((W===3||W===4)&&(W=j.stateNode.containerInfo,W===y||W.nodeType===8&&W.parentNode===y))return;j=j.return}for(;$!==null;){if(j=va($),j===null)return;if(W=j.tag,W===5||W===6||W===26||W===27){h=b=j;continue e}$=$.parentNode}}h=h.return}_b(function(){var J=b,me=Gd(c),_e=[];e:{var le=Qb.get(a);if(le!==void 0){var pe=Ru,Ue=a;switch(a){case"keypress":if(Tu(c)===0)break e;case"keydown":case"keyup":pe=bN;break;case"focusin":Ue="focus",pe=qd;break;case"focusout":Ue="blur",pe=qd;break;case"beforeblur":case"afterblur":pe=qd;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Tb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=sN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=SN;break;case Wb:case Xb:case Kb:pe=cN;break;case Zb:pe=_N;break;case"scroll":case"scrollend":pe=aN;break;case"wheel":pe=CN;break;case"copy":case"cut":case"paste":pe=dN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Rb;break;case"toggle":case"beforetoggle":pe=AN}var Je=(s&4)!==0,It=!Je&&(a==="scroll"||a==="scrollend"),ne=Je?le!==null?le+"Capture":null:le;Je=[];for(var Q=J,se;Q!==null;){var ye=Q;if(se=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||se===null||ne===null||(ye=js(Q,ne),ye!=null&&Je.push(ml(Q,ye,se))),It)break;Q=Q.return}0<Je.length&&(le=new pe(le,Ue,null,c,me),_e.push({event:le,listeners:Je}))}}if(!(s&7)){e:{if(le=a==="mouseover"||a==="pointerover",pe=a==="mouseout"||a==="pointerout",le&&c!==Id&&(Ue=c.relatedTarget||c.fromElement)&&(va(Ue)||Ue[so]))break e;if((pe||le)&&(le=me.window===me?me:(le=me.ownerDocument)?le.defaultView||le.parentWindow:window,pe?(Ue=c.relatedTarget||c.toElement,pe=J,Ue=Ue?va(Ue):null,Ue!==null&&(It=F(Ue),Je=Ue.tag,Ue!==It||Je!==5&&Je!==27&&Je!==6)&&(Ue=null)):(pe=null,Ue=J),pe!==Ue)){if(Je=Tb,ye="onMouseLeave",ne="onMouseEnter",Q="mouse",(a==="pointerout"||a==="pointerover")&&(Je=Rb,ye="onPointerLeave",ne="onPointerEnter",Q="pointer"),It=pe==null?le:Os(pe),se=Ue==null?le:Os(Ue),le=new Je(ye,Q+"leave",pe,c,me),le.target=It,le.relatedTarget=se,ye=null,va(me)===J&&(Je=new Je(ne,Q+"enter",Ue,c,me),Je.target=se,Je.relatedTarget=It,ye=Je),It=ye,pe&&Ue)t:{for(Je=pe,ne=Ue,Q=0,se=Je;se;se=Io(se))Q++;for(se=0,ye=ne;ye;ye=Io(ye))se++;for(;0<Q-se;)Je=Io(Je),Q--;for(;0<se-Q;)ne=Io(ne),se--;for(;Q--;){if(Je===ne||ne!==null&&Je===ne.alternate)break t;Je=Io(Je),ne=Io(ne)}Je=null}else Je=null;pe!==null&&c0(_e,le,pe,Je,!1),Ue!==null&&It!==null&&c0(_e,It,Ue,Je,!0)}}e:{if(le=J?Os(J):window,pe=le.nodeName&&le.nodeName.toLowerCase(),pe==="select"||pe==="input"&&le.type==="file")var Ie=Pb;else if(zb(le))if(Fb)Ie=FN;else{Ie=MN;var ot=zN}else pe=le.nodeName,!pe||pe.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?J&&Fd(J.elementType)&&(Ie=Pb):Ie=PN;if(Ie&&(Ie=Ie(a,J))){Mb(_e,Ie,c,me);break e}ot&&ot(a,le,J),a==="focusout"&&J&&le.type==="number"&&J.memoizedProps.value!=null&&Pd(le,"number",le.value)}switch(ot=J?Os(J):window,a){case"focusin":(zb(ot)||ot.contentEditable==="true")&&(vo=ot,Qd=J,Us=null);break;case"focusout":Us=Qd=vo=null;break;case"mousedown":Jd=!0;break;case"contextmenu":case"mouseup":case"dragend":Jd=!1,qb(_e,c,me);break;case"selectionchange":if(UN)break;case"keydown":case"keyup":qb(_e,c,me)}var Ve;if(Wd)e:{switch(a){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else go?jb(a,c)&&(Ke="onCompositionEnd"):a==="keydown"&&c.keyCode===229&&(Ke="onCompositionStart");Ke&&(Db&&c.locale!=="ko"&&(go||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&go&&(Ve=kb()):(Oi=me,$d="value"in Oi?Oi.value:Oi.textContent,go=!0)),ot=hc(J,Ke),0<ot.length&&(Ke=new Ab(Ke,a,null,c,me),_e.push({event:Ke,listeners:ot}),Ve?Ke.data=Ve:(Ve=Lb(c),Ve!==null&&(Ke.data=Ve)))),(Ve=DN?NN(a,c):ON(a,c))&&(Ke=hc(J,"onBeforeInput"),0<Ke.length&&(ot=new Ab("onBeforeInput","beforeinput",null,c,me),_e.push({event:ot,listeners:Ke}),ot.data=Ve)),EO(_e,a,J,c,me)}l0(_e,s)})}function ml(a,s,c){return{instance:a,listener:s,currentTarget:c}}function hc(a,s){for(var c=s+"Capture",h=[];a!==null;){var y=a,b=y.stateNode;y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=js(a,c),y!=null&&h.unshift(ml(a,y,b)),y=js(a,s),y!=null&&h.push(ml(a,y,b))),a=a.return}return h}function Io(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function c0(a,s,c,h,y){for(var b=s._reactName,j=[];c!==null&&c!==h;){var $=c,W=$.alternate,J=$.stateNode;if($=$.tag,W!==null&&W===h)break;$!==5&&$!==26&&$!==27||J===null||(W=J,y?(J=js(c,b),J!=null&&j.unshift(ml(c,J,W))):y||(J=js(c,b),J!=null&&j.push(ml(c,J,W)))),c=c.return}j.length!==0&&a.push({event:s,listeners:j})}var TO=/\r\n?/g,AO=/\u0000|\uFFFD/g;function f0(a){return(typeof a=="string"?a:""+a).replace(TO,`
`).replace(AO,"")}function d0(a,s){return s=f0(s),f0(a)===s}function pc(){}function wt(a,s,c,h,y,b){switch(c){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||ho(a,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&ho(a,""+h);break;case"className":Su(a,"class",h);break;case"tabIndex":Su(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Su(a,c,h);break;case"style":Sb(a,h,b);break;case"data":if(s!=="object"){Su(a,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||c!=="href")){a.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(c);break}h=ku(""+h),a.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){a.setAttribute(c,"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 b=="function"&&(c==="formAction"?(s!=="input"&&wt(a,s,"name",y.name,y,null),wt(a,s,"formEncType",y.formEncType,y,null),wt(a,s,"formMethod",y.formMethod,y,null),wt(a,s,"formTarget",y.formTarget,y,null)):(wt(a,s,"encType",y.encType,y,null),wt(a,s,"method",y.method,y,null),wt(a,s,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(c);break}h=ku(""+h),a.setAttribute(c,h);break;case"onClick":h!=null&&(a.onclick=pc);break;case"onScroll":h!=null&&ft("scroll",a);break;case"onScrollEnd":h!=null&&ft("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(c=h.__html,c!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=c}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}c=ku(""+h),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,""+h):a.removeAttribute(c);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":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,""):a.removeAttribute(c);break;case"capture":case"download":h===!0?a.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,h):a.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(c,h):a.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(c):a.setAttribute(c,h);break;case"popover":ft("beforetoggle",a),ft("toggle",a),wu(a,"popover",h);break;case"xlinkActuate":Jr(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Jr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Jr(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Jr(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Jr(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Jr(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Jr(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Jr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Jr(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":wu(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=rN.get(c)||c,wu(a,c,h))}}function Sp(a,s,c,h,y,b){switch(c){case"style":Sb(a,h,b);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(c=h.__html,c!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=c}}break;case"children":typeof h=="string"?ho(a,h):(typeof h=="number"||typeof h=="bigint")&&ho(a,""+h);break;case"onScroll":h!=null&&ft("scroll",a);break;case"onScrollEnd":h!=null&&ft("scrollend",a);break;case"onClick":h!=null&&(a.onclick=pc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hb.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(y=c.endsWith("Capture"),s=c.slice(2,y?c.length-7:void 0),b=a[Rn]||null,b=b!=null?b[c]:null,typeof b=="function"&&a.removeEventListener(s,b,y),typeof h=="function")){typeof b!="function"&&b!==null&&(c in a?a[c]=null:a.hasAttribute(c)&&a.removeAttribute(c)),a.addEventListener(s,h,y);break e}c in a?a[c]=h:h===!0?a.setAttribute(c,""):wu(a,c,h)}}}function sn(a,s,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ft("error",a),ft("load",a);var h=!1,y=!1,b;for(b in c)if(c.hasOwnProperty(b)){var j=c[b];if(j!=null)switch(b){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:wt(a,s,b,j,c,null)}}y&&wt(a,s,"srcSet",c.srcSet,c,null),h&&wt(a,s,"src",c.src,c,null);return;case"input":ft("invalid",a);var $=b=j=y=null,W=null,J=null;for(h in c)if(c.hasOwnProperty(h)){var me=c[h];if(me!=null)switch(h){case"name":y=me;break;case"type":j=me;break;case"checked":W=me;break;case"defaultChecked":J=me;break;case"value":b=me;break;case"defaultValue":$=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,s));break;default:wt(a,s,h,me,c,null)}}yb(a,b,$,W,J,j,y,!1),Eu(a);return;case"select":ft("invalid",a),h=j=b=null;for(y in c)if(c.hasOwnProperty(y)&&($=c[y],$!=null))switch(y){case"value":b=$;break;case"defaultValue":j=$;break;case"multiple":h=$;default:wt(a,s,y,$,c,null)}s=b,c=j,a.multiple=!!h,s!=null?fo(a,!!h,s,!1):c!=null&&fo(a,!!h,c,!0);return;case"textarea":ft("invalid",a),b=y=h=null;for(j in c)if(c.hasOwnProperty(j)&&($=c[j],$!=null))switch(j){case"value":h=$;break;case"defaultValue":y=$;break;case"children":b=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(r(91));break;default:wt(a,s,j,$,c,null)}xb(a,h,y,b),Eu(a);return;case"option":for(W in c)if(c.hasOwnProperty(W)&&(h=c[W],h!=null))switch(W){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:wt(a,s,W,h,c,null)}return;case"dialog":ft("cancel",a),ft("close",a);break;case"iframe":case"object":ft("load",a);break;case"video":case"audio":for(h=0;h<pl.length;h++)ft(pl[h],a);break;case"image":ft("error",a),ft("load",a);break;case"details":ft("toggle",a);break;case"embed":case"source":case"link":ft("error",a),ft("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in c)if(c.hasOwnProperty(J)&&(h=c[J],h!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:wt(a,s,J,h,c,null)}return;default:if(Fd(s)){for(me in c)c.hasOwnProperty(me)&&(h=c[me],h!==void 0&&Sp(a,s,me,h,c,void 0));return}}for($ in c)c.hasOwnProperty($)&&(h=c[$],h!=null&&wt(a,s,$,h,c,null))}function RO(a,s,c,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,j=null,$=null,W=null,J=null,me=null;for(pe in c){var _e=c[pe];if(c.hasOwnProperty(pe)&&_e!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":W=_e;default:h.hasOwnProperty(pe)||wt(a,s,pe,null,h,_e)}}for(var le in h){var pe=h[le];if(_e=c[le],h.hasOwnProperty(le)&&(pe!=null||_e!=null))switch(le){case"type":b=pe;break;case"name":y=pe;break;case"checked":J=pe;break;case"defaultChecked":me=pe;break;case"value":j=pe;break;case"defaultValue":$=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,s));break;default:pe!==_e&&wt(a,s,le,pe,h,_e)}}Md(a,j,$,W,J,me,b,y);return;case"select":pe=j=$=le=null;for(b in c)if(W=c[b],c.hasOwnProperty(b)&&W!=null)switch(b){case"value":break;case"multiple":pe=W;default:h.hasOwnProperty(b)||wt(a,s,b,null,h,W)}for(y in h)if(b=h[y],W=c[y],h.hasOwnProperty(y)&&(b!=null||W!=null))switch(y){case"value":le=b;break;case"defaultValue":$=b;break;case"multiple":j=b;default:b!==W&&wt(a,s,y,b,h,W)}s=$,c=j,h=pe,le!=null?fo(a,!!c,le,!1):!!h!=!!c&&(s!=null?fo(a,!!c,s,!0):fo(a,!!c,c?[]:"",!1));return;case"textarea":pe=le=null;for($ in c)if(y=c[$],c.hasOwnProperty($)&&y!=null&&!h.hasOwnProperty($))switch($){case"value":break;case"children":break;default:wt(a,s,$,null,h,y)}for(j in h)if(y=h[j],b=c[j],h.hasOwnProperty(j)&&(y!=null||b!=null))switch(j){case"value":le=y;break;case"defaultValue":pe=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==b&&wt(a,s,j,y,h,b)}bb(a,le,pe);return;case"option":for(var Ue in c)if(le=c[Ue],c.hasOwnProperty(Ue)&&le!=null&&!h.hasOwnProperty(Ue))switch(Ue){case"selected":a.selected=!1;break;default:wt(a,s,Ue,null,h,le)}for(W in h)if(le=h[W],pe=c[W],h.hasOwnProperty(W)&&le!==pe&&(le!=null||pe!=null))switch(W){case"selected":a.selected=le&&typeof le!="function"&&typeof le!="symbol";break;default:wt(a,s,W,le,h,pe)}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 Je in c)le=c[Je],c.hasOwnProperty(Je)&&le!=null&&!h.hasOwnProperty(Je)&&wt(a,s,Je,null,h,le);for(J in h)if(le=h[J],pe=c[J],h.hasOwnProperty(J)&&le!==pe&&(le!=null||pe!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,s));break;default:wt(a,s,J,le,h,pe)}return;default:if(Fd(s)){for(var It in c)le=c[It],c.hasOwnProperty(It)&&le!==void 0&&!h.hasOwnProperty(It)&&Sp(a,s,It,void 0,h,le);for(me in h)le=h[me],pe=c[me],!h.hasOwnProperty(me)||le===pe||le===void 0&&pe===void 0||Sp(a,s,me,le,h,pe);return}}for(var ne in c)le=c[ne],c.hasOwnProperty(ne)&&le!=null&&!h.hasOwnProperty(ne)&&wt(a,s,ne,null,h,le);for(_e in h)le=h[_e],pe=c[_e],!h.hasOwnProperty(_e)||le===pe||le==null&&pe==null||wt(a,s,_e,le,h,pe)}var Ep=null,_p=null;function mc(a){return a.nodeType===9?a:a.ownerDocument}function h0(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function p0(a,s){if(a===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&s==="foreignObject"?0:a}function kp(a,s){return a==="textarea"||a==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Cp=null;function DO(){var a=window.event;return a&&a.type==="popstate"?a===Cp?!1:(Cp=a,!0):(Cp=null,!1)}var m0=typeof setTimeout=="function"?setTimeout:void 0,NO=typeof clearTimeout=="function"?clearTimeout:void 0,g0=typeof Promise=="function"?Promise:void 0,OO=typeof queueMicrotask=="function"?queueMicrotask:typeof g0<"u"?function(a){return g0.resolve(null).then(a).catch(jO)}:m0;function jO(a){setTimeout(function(){throw a})}function Tp(a,s){var c=s,h=0;do{var y=c.nextSibling;if(a.removeChild(c),y&&y.nodeType===8)if(c=y.data,c==="/$"){if(h===0){a.removeChild(y),El(s);return}h--}else c!=="$"&&c!=="$?"&&c!=="$!"||h++;c=y}while(c);El(s)}function Ap(a){var s=a.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var c=s;switch(s=s.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Ap(c),zd(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}a.removeChild(c)}}function LO(a,s,c,h){for(;a.nodeType===1;){var y=c;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[Ns])switch(s){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(b=a.getAttribute("rel"),b==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(b!==y.rel||a.getAttribute("href")!==(y.href==null?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(b=a.getAttribute("src"),(b!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(s==="input"&&a.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===b)return a}else return a;if(a=xr(a.nextSibling),a===null)break}return null}function zO(a,s,c){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=xr(a.nextSibling),a===null))return null;return a}function xr(a){for(;a!=null;a=a.nextSibling){var s=a.nodeType;if(s===1||s===3)break;if(s===8){if(s=a.data,s==="$"||s==="$!"||s==="$?"||s==="F!"||s==="F")break;if(s==="/$")return null}}return a}function v0(a){a=a.previousSibling;for(var s=0;a;){if(a.nodeType===8){var c=a.data;if(c==="$"||c==="$!"||c==="$?"){if(s===0)return a;s--}else c==="/$"&&s++}a=a.previousSibling}return null}function y0(a,s,c){switch(s=mc(c),a){case"html":if(a=s.documentElement,!a)throw Error(r(452));return a;case"head":if(a=s.head,!a)throw Error(r(453));return a;case"body":if(a=s.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}var lr=new Map,b0=new Set;function gc(a){return typeof a.getRootNode=="function"?a.getRootNode():a.ownerDocument}var pi=X.d;X.d={f:MO,r:PO,D:FO,C:IO,L:GO,m:UO,X:$O,S:BO,M:HO};function MO(){var a=pi.f(),s=lc();return a||s}function PO(a){var s=lo(a);s!==null&&s.tag===5&&s.type==="form"?qx(s):pi.r(a)}var Go=typeof document>"u"?null:document;function x0(a,s,c){var h=Go;if(h&&typeof s=="string"&&s){var y=Qn(s);y='link[rel="'+a+'"][href="'+y+'"]',typeof c=="string"&&(y+='[crossorigin="'+c+'"]'),b0.has(y)||(b0.add(y),a={rel:a,crossOrigin:c,href:s},h.querySelector(y)===null&&(s=h.createElement("link"),sn(s,"link",a),Kt(s),h.head.appendChild(s)))}}function FO(a){pi.D(a),x0("dns-prefetch",a,null)}function IO(a,s){pi.C(a,s),x0("preconnect",a,s)}function GO(a,s,c){pi.L(a,s,c);var h=Go;if(h&&a&&s){var y='link[rel="preload"][as="'+Qn(s)+'"]';s==="image"&&c&&c.imageSrcSet?(y+='[imagesrcset="'+Qn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(y+='[imagesizes="'+Qn(c.imageSizes)+'"]')):y+='[href="'+Qn(a)+'"]';var b=y;switch(s){case"style":b=Uo(a);break;case"script":b=Bo(a)}lr.has(b)||(a=z({rel:"preload",href:s==="image"&&c&&c.imageSrcSet?void 0:a,as:s},c),lr.set(b,a),h.querySelector(y)!==null||s==="style"&&h.querySelector(gl(b))||s==="script"&&h.querySelector(vl(b))||(s=h.createElement("link"),sn(s,"link",a),Kt(s),h.head.appendChild(s)))}}function UO(a,s){pi.m(a,s);var c=Go;if(c&&a){var h=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+Qn(h)+'"][href="'+Qn(a)+'"]',b=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Bo(a)}if(!lr.has(b)&&(a=z({rel:"modulepreload",href:a},s),lr.set(b,a),c.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(vl(b)))return}h=c.createElement("link"),sn(h,"link",a),Kt(h),c.head.appendChild(h)}}}function BO(a,s,c){pi.S(a,s,c);var h=Go;if(h&&a){var y=uo(h).hoistableStyles,b=Uo(a);s=s||"default";var j=y.get(b);if(!j){var $={loading:0,preload:null};if(j=h.querySelector(gl(b)))$.loading=5;else{a=z({rel:"stylesheet",href:a,"data-precedence":s},c),(c=lr.get(b))&&Rp(a,c);var W=j=h.createElement("link");Kt(W),sn(W,"link",a),W._p=new Promise(function(J,me){W.onload=J,W.onerror=me}),W.addEventListener("load",function(){$.loading|=1}),W.addEventListener("error",function(){$.loading|=2}),$.loading|=4,vc(j,s,h)}j={type:"stylesheet",instance:j,count:1,state:$},y.set(b,j)}}}function $O(a,s){pi.X(a,s);var c=Go;if(c&&a){var h=uo(c).hoistableScripts,y=Bo(a),b=h.get(y);b||(b=c.querySelector(vl(y)),b||(a=z({src:a,async:!0},s),(s=lr.get(y))&&Dp(a,s),b=c.createElement("script"),Kt(b),sn(b,"link",a),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function HO(a,s){pi.M(a,s);var c=Go;if(c&&a){var h=uo(c).hoistableScripts,y=Bo(a),b=h.get(y);b||(b=c.querySelector(vl(y)),b||(a=z({src:a,async:!0,type:"module"},s),(s=lr.get(y))&&Dp(a,s),b=c.createElement("script"),Kt(b),sn(b,"link",a),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function w0(a,s,c,h){var y=(y=Pe.current)?gc(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(s=Uo(c.href),c=uo(y).hoistableStyles,h=c.get(s),h||(h={type:"style",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){a=Uo(c.href);var b=uo(y).hoistableStyles,j=b.get(a);if(j||(y=y.ownerDocument||y,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(a,j),(b=y.querySelector(gl(a)))&&!b._p&&(j.instance=b,j.state.loading=5),lr.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},lr.set(a,c),b||VO(y,a,c,j.state))),s&&h===null)throw Error(r(528,""));return j}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=c.async,c=c.src,typeof c=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Bo(c),c=uo(y).hoistableScripts,h=c.get(s),h||(h={type:"script",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Uo(a){return'href="'+Qn(a)+'"'}function gl(a){return'link[rel="stylesheet"]['+a+"]"}function S0(a){return z({},a,{"data-precedence":a.precedence,precedence:null})}function VO(a,s,c,h){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=a.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),sn(s,"link",c),Kt(s),a.head.appendChild(s))}function Bo(a){return'[src="'+Qn(a)+'"]'}function vl(a){return"script[async]"+a}function E0(a,s,c){if(s.count++,s.instance===null)switch(s.type){case"style":var h=a.querySelector('style[data-href~="'+Qn(c.href)+'"]');if(h)return s.instance=h,Kt(h),h;var y=z({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),Kt(h),sn(h,"style",y),vc(h,c.precedence,a),s.instance=h;case"stylesheet":y=Uo(c.href);var b=a.querySelector(gl(y));if(b)return s.state.loading|=4,s.instance=b,Kt(b),b;h=S0(c),(y=lr.get(y))&&Rp(h,y),b=(a.ownerDocument||a).createElement("link"),Kt(b);var j=b;return j._p=new Promise(function($,W){j.onload=$,j.onerror=W}),sn(b,"link",h),s.state.loading|=4,vc(b,c.precedence,a),s.instance=b;case"script":return b=Bo(c.src),(y=a.querySelector(vl(b)))?(s.instance=y,Kt(y),y):(h=c,(y=lr.get(b))&&(h=z({},c),Dp(h,y)),a=a.ownerDocument||a,y=a.createElement("script"),Kt(y),sn(y,"link",h),a.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&!(s.state.loading&4)&&(h=s.instance,s.state.loading|=4,vc(h,c.precedence,a));return s.instance}function vc(a,s,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,b=y,j=0;j<h.length;j++){var $=h[j];if($.dataset.precedence===s)b=$;else if(b!==y)break}b?b.parentNode.insertBefore(a,b.nextSibling):(s=c.nodeType===9?c.head:c,s.insertBefore(a,s.firstChild))}function Rp(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function Dp(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var yc=null;function _0(a,s,c){if(yc===null){var h=new Map,y=yc=new Map;y.set(c,h)}else y=yc,h=y.get(c),h||(h=new Map,y.set(c,h));if(h.has(a))return h;for(h.set(a,null),c=c.getElementsByTagName(a),y=0;y<c.length;y++){var b=c[y];if(!(b[Ns]||b[hn]||a==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var j=b.getAttribute(s)||"";j=a+j;var $=h.get(j);$?$.push(b):h.set(j,[b])}}return h}function k0(a,s,c){a=a.ownerDocument||a,a.head.insertBefore(c,s==="title"?a.querySelector("head > title"):null)}function qO(a,s,c){if(c===1||s.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return a=s.disabled,typeof s.precedence=="string"&&a==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function C0(a){return!(a.type==="stylesheet"&&!(a.state.loading&3))}var yl=null;function YO(){}function WO(a,s,c){if(yl===null)throw Error(r(475));var h=yl;if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&!(s.state.loading&4)){if(s.instance===null){var y=Uo(c.href),b=a.querySelector(gl(y));if(b){a=b._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(h.count++,h=bc.bind(h),a.then(h,h)),s.state.loading|=4,s.instance=b,Kt(b);return}b=a.ownerDocument||a,c=S0(c),(y=lr.get(y))&&Rp(c,y),b=b.createElement("link"),Kt(b);var j=b;j._p=new Promise(function($,W){j.onload=$,j.onerror=W}),sn(b,"link",c),s.instance=b}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(s,a),(a=s.state.preload)&&!(s.state.loading&3)&&(h.count++,s=bc.bind(h),a.addEventListener("load",s),a.addEventListener("error",s))}}function XO(){if(yl===null)throw Error(r(475));var a=yl;return a.stylesheets&&a.count===0&&Np(a,a.stylesheets),0<a.count?function(s){var c=setTimeout(function(){if(a.stylesheets&&Np(a,a.stylesheets),a.unsuspend){var h=a.unsuspend;a.unsuspend=null,h()}},6e4);return a.unsuspend=s,function(){a.unsuspend=null,clearTimeout(c)}}:null}function bc(){if(this.count--,this.count===0){if(this.stylesheets)Np(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var xc=null;function Np(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,xc=new Map,s.forEach(KO,a),xc=null,bc.call(a))}function KO(a,s){if(!(s.state.loading&4)){var c=xc.get(a);if(c)var h=c.get(null);else{c=new Map,xc.set(a,c);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var j=y[b];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(c.set(j.dataset.precedence,j),h=j)}h&&c.set(null,h)}y=s.instance,j=y.getAttribute("data-precedence"),b=c.get(j)||h,b===h&&c.set(null,y),c.set(j,y),this.count++,h=bc.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),b?b.parentNode.insertBefore(y,b.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),s.state.loading|=4}}var bl={$$typeof:g,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function ZO(a,s,c,h,y,b,j,$){this.tag=1,this.containerInfo=a,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=Sn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sn(0),this.hiddenUpdates=Sn(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function T0(a,s,c,h,y,b,j,$,W,J,me,_e){return a=new ZO(a,s,c,j,$,W,J,_e),s=1,b===!0&&(s|=24),b=or(3,null,null,s),a.current=b,b.stateNode=a,s=uh(),s.refCount++,a.pooledCache=s,s.refCount++,b.memoizedState={element:h,isDehydrated:c,cache:s},$h(b),a}function A0(a){return a?(a=xo,a):xo}function R0(a,s,c,h,y,b){y=A0(y),h.context===null?h.context=y:h.pendingContext=y,h=Gi(s),h.payload={element:c},b=b===void 0?null:b,b!==null&&(h.callback=b),c=Ui(a,h,s),c!==null&&(_n(c,a,s),nl(c,a,s))}function D0(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c<s?c:s}}function Op(a,s){D0(a,s),(a=a.alternate)&&D0(a,s)}function N0(a){if(a.tag===13){var s=ji(a,67108864);s!==null&&_n(s,a,67108864),Op(a,67108864)}}var wc=!0;function QO(a,s,c,h){var y=P.T;P.T=null;var b=X.p;try{X.p=2,jp(a,s,c,h)}finally{X.p=b,P.T=y}}function JO(a,s,c,h){var y=P.T;P.T=null;var b=X.p;try{X.p=8,jp(a,s,c,h)}finally{X.p=b,P.T=y}}function jp(a,s,c,h){if(wc){var y=Lp(h);if(y===null)wp(a,s,h,Sc,c),j0(a,h);else if(tj(y,a,s,c,h))h.stopPropagation();else if(j0(a,h),s&4&&-1<ej.indexOf(a)){for(;y!==null;){var b=lo(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var j=dn(b.pendingLanes);if(j!==0){var $=b;for($.pendingLanes|=2,$.entangledLanes|=2;j;){var W=1<<31-At(j);$.entanglements[1]|=W,j&=~W}Pr(b),!(Lt&6)&&(ac=ve()+500,hl(0))}}break;case 13:$=ji(b,2),$!==null&&_n($,b,2),lc(),Op(b,2)}if(b=Lp(h),b===null&&wp(a,s,h,Sc,c),b===y)break;y=b}y!==null&&h.stopPropagation()}else wp(a,s,h,null,c)}}function Lp(a){return a=Gd(a),zp(a)}var Sc=null;function zp(a){if(Sc=null,a=va(a),a!==null){var s=F(a);if(s===null)a=null;else{var c=s.tag;if(c===13){if(a=K(s),a!==null)return a;a=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;a=null}else s!==a&&(a=null)}}return Sc=a,null}function O0(a){switch(a){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(Ne()){case te:return 2;case de:return 8;case Oe:case He:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Mp=!1,Wi=null,Xi=null,Ki=null,xl=new Map,wl=new Map,Zi=[],ej="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 j0(a,s){switch(a){case"focusin":case"focusout":Wi=null;break;case"dragenter":case"dragleave":Xi=null;break;case"mouseover":case"mouseout":Ki=null;break;case"pointerover":case"pointerout":xl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":wl.delete(s.pointerId)}}function Sl(a,s,c,h,y,b){return a===null||a.nativeEvent!==b?(a={blockedOn:s,domEventName:c,eventSystemFlags:h,nativeEvent:b,targetContainers:[y]},s!==null&&(s=lo(s),s!==null&&N0(s)),a):(a.eventSystemFlags|=h,s=a.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),a)}function tj(a,s,c,h,y){switch(s){case"focusin":return Wi=Sl(Wi,a,s,c,h,y),!0;case"dragenter":return Xi=Sl(Xi,a,s,c,h,y),!0;case"mouseover":return Ki=Sl(Ki,a,s,c,h,y),!0;case"pointerover":var b=y.pointerId;return xl.set(b,Sl(xl.get(b)||null,a,s,c,h,y)),!0;case"gotpointercapture":return b=y.pointerId,wl.set(b,Sl(wl.get(b)||null,a,s,c,h,y)),!0}return!1}function L0(a){var s=va(a.target);if(s!==null){var c=F(s);if(c!==null){if(s=c.tag,s===13){if(s=K(c),s!==null){a.blockedOn=s,XD(a.priority,function(){if(c.tag===13){var h=Hn(),y=ji(c,h);y!==null&&_n(y,c,h),Op(c,h)}});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Ec(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var c=Lp(a.nativeEvent);if(c===null){c=a.nativeEvent;var h=new c.constructor(c.type,c);Id=h,c.target.dispatchEvent(h),Id=null}else return s=lo(c),s!==null&&N0(s),a.blockedOn=c,!1;s.shift()}return!0}function z0(a,s,c){Ec(a)&&c.delete(s)}function nj(){Mp=!1,Wi!==null&&Ec(Wi)&&(Wi=null),Xi!==null&&Ec(Xi)&&(Xi=null),Ki!==null&&Ec(Ki)&&(Ki=null),xl.forEach(z0),wl.forEach(z0)}function _c(a,s){a.blockedOn===s&&(a.blockedOn=null,Mp||(Mp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,nj)))}var kc=null;function M0(a){kc!==a&&(kc=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){kc===a&&(kc=null);for(var s=0;s<a.length;s+=3){var c=a[s],h=a[s+1],y=a[s+2];if(typeof h!="function"){if(zp(h||c)===null)continue;break}var b=lo(c);b!==null&&(a.splice(s,3),s-=3,kh(b,{pending:!0,data:y,method:c.method,action:h},h,y))}}))}function El(a){function s(W){return _c(W,a)}Wi!==null&&_c(Wi,a),Xi!==null&&_c(Xi,a),Ki!==null&&_c(Ki,a),xl.forEach(s),wl.forEach(s);for(var c=0;c<Zi.length;c++){var h=Zi[c];h.blockedOn===a&&(h.blockedOn=null)}for(;0<Zi.length&&(c=Zi[0],c.blockedOn===null);)L0(c),c.blockedOn===null&&Zi.shift();if(c=(a.ownerDocument||a).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var y=c[h],b=c[h+1],j=y[Rn]||null;if(typeof b=="function")j||M0(c);else if(j){var $=null;if(b&&b.hasAttribute("formAction")){if(y=b,j=b[Rn]||null)$=j.formAction;else if(zp(y)!==null)continue}else $=j.action;typeof $=="function"?c[h+1]=$:(c.splice(h,3),h-=3),M0(c)}}}function Pp(a){this._internalRoot=a}Cc.prototype.render=Pp.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(r(409));var c=s.current,h=Hn();R0(c,h,a,s,null,null)},Cc.prototype.unmount=Pp.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;a.tag===0&&Po(),R0(a.current,2,null,a,null,null),lc(),s[so]=null}};function Cc(a){this._internalRoot=a}Cc.prototype.unstable_scheduleHydration=function(a){if(a){var s=cb();a={blockedOn:null,target:a,priority:s};for(var c=0;c<Zi.length&&s!==0&&s<Zi[c].priority;c++);Zi.splice(c,0,a),c===0&&L0(a)}};var P0=t.version;if(P0!=="19.0.0")throw Error(r(527,P0,"19.0.0"));X.findDOMNode=function(a){var s=a._reactInternals;if(s===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=H(s),a=a!==null?M(a):null,a=a===null?null:a.stateNode,a};var rj={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:P,findFiberByHostInstance:va,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tc.isDisabled&&Tc.supportsFiber)try{bt=Tc.inject(rj),rt=Tc}catch{}}return kl.createRoot=function(a,s){if(!i(a))throw Error(r(299));var c=!1,h="",y=ew,b=tw,j=nw,$=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(b=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&($=s.unstable_transitionCallbacks)),s=T0(a,1,!1,null,null,c,h,y,b,j,$,null),a[so]=s.current,xp(a.nodeType===8?a.parentNode:a),new Pp(s)},kl.hydrateRoot=function(a,s,c){if(!i(a))throw Error(r(299));var h=!1,y="",b=ew,j=tw,$=nw,W=null,J=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(b=c.onUncaughtError),c.onCaughtError!==void 0&&(j=c.onCaughtError),c.onRecoverableError!==void 0&&($=c.onRecoverableError),c.unstable_transitionCallbacks!==void 0&&(W=c.unstable_transitionCallbacks),c.formState!==void 0&&(J=c.formState)),s=T0(a,1,!0,s,c??null,h,y,b,j,$,W,J),s.context=A0(null),c=s.current,h=Hn(),y=Gi(h),y.callback=null,Ui(c,y,h),s.current.lanes=h,Tn(s,h),Pr(s),a[so]=s.current,xp(a),new Cc(s)},kl.version="19.0.0",kl}var Y0;function vj(){if(Y0)return Gp.exports;Y0=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(),Gp.exports=gj(),Gp.exports}var yj=vj();const W0=e=>{let t;const n=new Set,r=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const v=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(g=>g(t,v))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,i,u);return u},bj=e=>e?W0(e):W0,xj=e=>e;function wj(e,t=xj){const n=be.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return be.useDebugValue(n),n}const Sj=e=>{const t=bj(e),n=r=>wj(t,r);return Object.assign(n,t),n},Tv=e=>Sj;function D_(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const l=f=>f===null?null:JSON.parse(f,void 0),u=(o=n.getItem(i))!=null?o:null;return u instanceof Promise?u.then(l):l(u)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const bg=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return bg(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return bg(r)(n)}}}},Ej=(e,t)=>(n,r,i)=>{let o={storage:D_(()=>localStorage),partialize:x=>x,version:0,merge:(x,k)=>({...k,...x}),...t},l=!1;const u=new Set,f=new Set;let d=o.storage;if(!d)return e((...x)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...x)},r,i);const p=()=>{const x=o.partialize({...r()});return d.setItem(o.name,{state:x,version:o.version})},m=i.setState;i.setState=(x,k)=>{m(x,k),p()};const v=e((...x)=>{n(...x),p()},r,i);i.getInitialState=()=>v;let g;const w=()=>{var x,k;if(!d)return;l=!1,u.forEach(_=>{var T;return _((T=r())!=null?T:v)});const C=((k=o.onRehydrateStorage)==null?void 0:k.call(o,(x=r())!=null?x:v))||void 0;return bg(d.getItem.bind(d))(o.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate){const T=o.migrate(_.state,_.version);return T instanceof Promise?T.then(N=>[!0,N]):[!0,T]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var T;const[N,D]=_;if(g=o.merge(D,(T=r())!=null?T:v),n(g,!0),N)return p()}).then(()=>{C==null||C(g,void 0),g=r(),l=!0,f.forEach(_=>_(g))}).catch(_=>{C==null||C(void 0,_)})};return i.persist={setOptions:x=>{o={...o,...x},x.storage&&(d=x.storage)},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>w(),hasHydrated:()=>l,onHydrate:x=>(u.add(x),()=>{u.delete(x)}),onFinishHydration:x=>(f.add(x),()=>{f.delete(x)})},o.skipHydration||w(),g||v},_j=Ej;function N_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=N_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function O_(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=N_(e))&&(r&&(r+=" "),r+=t);return r}const Av="-",kj=e=>{const t=Tj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const u=l.split(Av);return u[0]===""&&u.length!==1&&u.shift(),j_(u,t)||Cj(l)},getConflictingClassGroupIds:(l,u)=>{const f=n[l]||[];return u&&r[l]?[...f,...r[l]]:f}}},j_=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?j_(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Av);return(l=t.validators.find(({validator:u})=>u(o)))==null?void 0:l.classGroupId},X0=/^\[(.+)\]$/,Cj=e=>{if(X0.test(e)){const t=X0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Tj=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)xg(n[i],r,i,t);return r},xg=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:K0(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Aj(i)){xg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,l])=>{xg(l,K0(t,o),n,r)})})},K0=(e,t)=>{let n=e;return t.split(Av).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Aj=e=>e.isThemeGetter,Rj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,l)=>{n.set(o,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let l=n.get(o);if(l!==void 0)return l;if((l=r.get(o))!==void 0)return i(o,l),l},set(o,l){n.has(o)?n.set(o,l):i(o,l)}}},wg="!",Sg=":",Dj=Sg.length,Nj=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let l=0,u=0,f=0,d;for(let w=0;w<i.length;w++){let x=i[w];if(l===0&&u===0){if(x===Sg){o.push(i.slice(f,w)),f=w+Dj;continue}if(x==="/"){d=w;continue}}x==="["?l++:x==="]"?l--:x==="("?u++:x===")"&&u--}const p=o.length===0?i:i.substring(f),m=Oj(p),v=m!==p,g=d&&d>f?d-f:void 0;return{modifiers:o,hasImportantModifier:v,baseClassName:m,maybePostfixModifierPosition:g}};if(t){const i=t+Sg,o=r;r=l=>l.startsWith(i)?o(l.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},Oj=e=>e.endsWith(wg)?e.substring(0,e.length-1):e.startsWith(wg)?e.substring(1):e,jj=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let o=[];return r.forEach(l=>{l[0]==="["||t[l]?(i.push(...o.sort(),l),o=[]):o.push(l)}),i.push(...o.sort()),i}},Lj=e=>({cache:Rj(e.cacheSize),parseClassName:Nj(e),sortModifiers:jj(e),...kj(e)}),zj=/\s+/,Mj=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,l=[],u=e.trim().split(zj);let f="";for(let d=u.length-1;d>=0;d-=1){const p=u[d],{isExternal:m,modifiers:v,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:x}=n(p);if(m){f=p+(f.length>0?" "+f:f);continue}let k=!!x,C=r(k?w.substring(0,x):w);if(!C){if(!k){f=p+(f.length>0?" "+f:f);continue}if(C=r(w),!C){f=p+(f.length>0?" "+f:f);continue}k=!1}const _=o(v).join(":"),T=g?_+wg:_,N=T+C;if(l.includes(N))continue;l.push(N);const D=i(C,k);for(let L=0;L<D.length;++L){const R=D[L];l.push(T+R)}f=p+(f.length>0?" "+f:f)}return f};function Pj(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=L_(t))&&(r&&(r+=" "),r+=n);return r}const L_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=L_(e[r]))&&(n&&(n+=" "),n+=t);return n};function Fj(e,...t){let n,r,i,o=l;function l(f){const d=t.reduce((p,m)=>m(p),e());return n=Lj(d),r=n.cache.get,i=n.cache.set,o=u,u(f)}function u(f){const d=r(f);if(d)return d;const p=Mj(f,n);return i(f,p),p}return function(){return o(Pj.apply(null,arguments))}}const en=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},z_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ij=/^\d+\/\d+$/,Gj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Uj=/\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$/,Bj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,$j=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$o=e=>Ij.test(e),ct=e=>!!e&&!Number.isNaN(Number(e)),Fa=e=>!!e&&Number.isInteger(Number(e)),Z0=e=>e.endsWith("%")&&ct(e.slice(0,-1)),Ji=e=>Gj.test(e),Vj=()=>!0,qj=e=>Uj.test(e)&&!Bj.test(e),Rv=()=>!1,Yj=e=>$j.test(e),Wj=e=>Hj.test(e),Xj=e=>!Le(e)&&!ze(e),Kj=e=>ms(e,I_,Rv),Le=e=>z_.test(e),Ia=e=>ms(e,G_,qj),Hp=e=>ms(e,sL,ct),Zj=e=>ms(e,P_,Rv),Qj=e=>ms(e,F_,Wj),Jj=e=>ms(e,Rv,Yj),ze=e=>M_.test(e),Ac=e=>gs(e,G_),eL=e=>gs(e,lL),tL=e=>gs(e,P_),nL=e=>gs(e,I_),rL=e=>gs(e,F_),iL=e=>gs(e,uL,!0),ms=(e,t,n)=>{const r=z_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},gs=(e,t,n=!1)=>{const r=M_.exec(e);return r?r[1]?t(r[1]):n:!1},P_=e=>e==="position",aL=new Set(["image","url"]),F_=e=>aL.has(e),oL=new Set(["length","size","percentage"]),I_=e=>oL.has(e),G_=e=>e==="length",sL=e=>e==="number",lL=e=>e==="family-name",uL=e=>e==="shadow",cL=()=>{const e=en("color"),t=en("font"),n=en("text"),r=en("font-weight"),i=en("tracking"),o=en("leading"),l=en("breakpoint"),u=en("container"),f=en("spacing"),d=en("radius"),p=en("shadow"),m=en("inset-shadow"),v=en("drop-shadow"),g=en("blur"),w=en("perspective"),x=en("aspect"),k=en("ease"),C=en("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],L=()=>[$o,"px","full","auto",ze,Le,f],R=()=>[Fa,"none","subgrid",ze,Le],U=()=>["auto",{span:["full",Fa,ze,Le]},ze,Le],P=()=>[Fa,"auto",ze,Le],z=()=>["auto","min","max","fr",ze,Le],V=()=>[ze,Le,f],q=()=>["start","end","center","between","around","evenly","stretch","baseline"],I=()=>["start","end","center","stretch"],Y=()=>[ze,Le,f],Z=()=>["px",...Y()],B=()=>["px","auto",...Y()],G=()=>[$o,"auto","px","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",ze,Le,f],F=()=>[e,ze,Le],K=()=>[Z0,Ia],A=()=>["","none","full",d,ze,Le],H=()=>["",ct,Ac,Ia],M=()=>["solid","dashed","dotted","double"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["","none",g,ze,Le],re=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ze,Le],ue=()=>["none",ct,ze,Le],ae=()=>["none",ct,ze,Le],oe=()=>[ct,ze,Le],Ce=()=>[$o,"full","px",ze,Le,f];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ji],breakpoint:[Ji],color:[Vj],container:[Ji],"drop-shadow":[Ji],ease:["in","out","in-out"],font:[Xj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ji],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ji],shadow:[Ji],spacing:[ct],text:[Ji],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$o,Le,ze,x]}],container:["container"],columns:[{columns:[ct,Le,ze,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:[...T(),Le,ze]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Fa,"auto",ze,Le]}],basis:[{basis:[$o,"full","auto",ze,Le,u,f]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ct,$o,"auto","initial","none",Le]}],grow:[{grow:["",ct,ze,Le]}],shrink:[{shrink:["",ct,ze,Le]}],order:[{order:[Fa,"first","last","none",ze,Le]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...I(),"normal"]}],"justify-self":[{"justify-self":["auto",...I()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...I(),"baseline"]}],"align-self":[{self:["auto",...I(),"baseline"]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...I(),"baseline"]}],"place-self":[{"place-self":["auto",...I()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":Y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Y()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[u,"screen",...G()]}],"min-w":[{"min-w":[u,"screen","none",...G()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...G()]}],h:[{h:["screen",...G()]}],"min-h":[{"min-h":["screen","none",...G()]}],"max-h":[{"max-h":["screen",...G()]}],"font-size":[{text:["base",n,Ac,Ia]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ze,Hp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Z0,Le]}],"font-family":[{font:[eL,Le,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:[i,ze,Le]}],"line-clamp":[{"line-clamp":[ct,"none",ze,Hp]}],leading:[{leading:[ze,Le,o,f]}],"list-image":[{"list-image":["none",ze,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ze,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:[ct,"from-font","auto",ze,Ia]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[ct,"auto",ze,Le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:["px",...Y()]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze,Le]}],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",ze,Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...T(),tL,Zj]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",nL,Kj]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fa,ze,Le],radial:["",ze,Le],conic:[Fa,ze,Le]},rL,Qj]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"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:[...M(),"hidden","none"]}],"divide-style":[{divide:[...M(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...M(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ct,ze,Le]}],"outline-w":[{outline:["",ct,Ac,Ia]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",p,iL,Jj]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",ze,Le,m]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[ct,Ia]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":F()}],opacity:[{opacity:[ct,ze,Le]}],"mix-blend":[{"mix-blend":[...O(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none",ze,Le]}],blur:[{blur:X()}],brightness:[{brightness:[ct,ze,Le]}],contrast:[{contrast:[ct,ze,Le]}],"drop-shadow":[{"drop-shadow":["","none",v,ze,Le]}],grayscale:[{grayscale:["",ct,ze,Le]}],"hue-rotate":[{"hue-rotate":[ct,ze,Le]}],invert:[{invert:["",ct,ze,Le]}],saturate:[{saturate:[ct,ze,Le]}],sepia:[{sepia:["",ct,ze,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",ze,Le]}],"backdrop-blur":[{"backdrop-blur":X()}],"backdrop-brightness":[{"backdrop-brightness":[ct,ze,Le]}],"backdrop-contrast":[{"backdrop-contrast":[ct,ze,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ct,ze,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,ze,Le]}],"backdrop-invert":[{"backdrop-invert":["",ct,ze,Le]}],"backdrop-opacity":[{"backdrop-opacity":[ct,ze,Le]}],"backdrop-saturate":[{"backdrop-saturate":[ct,ze,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",ct,ze,Le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Y()}],"border-spacing-x":[{"border-spacing-x":Y()}],"border-spacing-y":[{"border-spacing-y":Y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ze,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ct,"initial",ze,Le]}],ease:[{ease:["linear","initial",k,ze,Le]}],delay:[{delay:[ct,ze,Le]}],animate:[{animate:["none",C,ze,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ze,Le]}],"perspective-origin":[{"perspective-origin":re()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[ze,Le,"","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:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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",ze,Le]}],"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":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"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",ze,Le]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[ct,Ac,Ia,Hp]}],stroke:[{stroke:["none",...F()]}],"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","*","**"]}},fL=Fj(cL);function Me(...e){return fL(O_(e))}function dL(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Cr(e){return e instanceof Error?e.message:`${e}`}const Dv=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(r=>r[n]);return t},U_="",$r="ghost",hL="#B2EBF2",pL="#000",mL="#E2E2E2",gL="#EEEEEE",vL="#F57F17",yL="#969696",bL="#F57F17",Q0="#B2EBF2",Vp=20,J0=4,xL=20,wL=15,e1="*",SL={"text/plain":[".txt",".md"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},t1={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},EL=Tv()(_j(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,queryLabel:e1,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:D_(()=>localStorage),version:6,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=e1),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)})),Qe=Dv(EL),_L={theme:"system",setTheme:()=>null},B_=E.createContext(_L);function kL({children:e,...t}){const[n,r]=E.useState(Qe.getState().theme);E.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),n==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";o.classList.add(l),r(l);return}o.classList.add(n)},[n]);const i={theme:n,setTheme:o=>{Qe.getState().setTheme(o),r(o)}};return S.jsx(B_.Provider,{...t,value:i,children:e})}const n1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,r1=O_,$_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return r1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(d=>{const p=n==null?void 0:n[d],m=o==null?void 0:o[d];if(p===null)return null;const v=n1(p)||n1(m);return i[d][v]}),u=n&&Object.entries(n).reduce((d,p)=>{let[m,v]=p;return v===void 0||(d[m]=v),d},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:m,className:v,...g}=p;return Object.entries(g).every(w=>{let[x,k]=w;return Array.isArray(k)?k.includes({...o,...u}[x]):{...o,...u}[x]===k})?[...d,m,v]:d},[]);return r1(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},CL=$_("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"}}),H_=E.forwardRef(({className:e,variant:t,...n},r)=>S.jsx("div",{ref:r,role:"alert",className:Me(CL({variant:t}),e),...n}));H_.displayName="Alert";const V_=E.forwardRef(({className:e,...t},n)=>S.jsx("h5",{ref:n,className:Me("mb-1 leading-none font-medium tracking-tight",e),...t}));V_.displayName="AlertTitle";const q_=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("text-sm [&_p]:leading-relaxed",e),...t}));q_.displayName="AlertDescription";function Y_(e,t){return function(){return e.apply(t,arguments)}}const{toString:TL}=Object.prototype,{getPrototypeOf:Nv}=Object,qf=(e=>t=>{const n=TL.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Dr=e=>(e=e.toLowerCase(),t=>qf(t)===e),Yf=e=>t=>typeof t===e,{isArray:vs}=Array,Vl=Yf("undefined");function AL(e){return e!==null&&!Vl(e)&&e.constructor!==null&&!Vl(e.constructor)&&Yn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const W_=Dr("ArrayBuffer");function RL(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&W_(e.buffer),t}const DL=Yf("string"),Yn=Yf("function"),X_=Yf("number"),Wf=e=>e!==null&&typeof e=="object",NL=e=>e===!0||e===!1,tf=e=>{if(qf(e)!=="object")return!1;const t=Nv(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},OL=Dr("Date"),jL=Dr("File"),LL=Dr("Blob"),zL=Dr("FileList"),ML=e=>Wf(e)&&Yn(e.pipe),PL=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Yn(e.append)&&((t=qf(e))==="formdata"||t==="object"&&Yn(e.toString)&&e.toString()==="[object FormData]"))},FL=Dr("URLSearchParams"),[IL,GL,UL,BL]=["ReadableStream","Request","Response","Headers"].map(Dr),$L=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ru(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),vs(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),l=o.length;let u;for(r=0;r<l;r++)u=o[r],t.call(null,e[u],u,e)}}function K_(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const qa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Z_=e=>!Vl(e)&&e!==qa;function Eg(){const{caseless:e}=Z_(this)&&this||{},t={},n=(r,i)=>{const o=e&&K_(t,i)||i;tf(t[o])&&tf(r)?t[o]=Eg(t[o],r):tf(r)?t[o]=Eg({},r):vs(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&ru(arguments[r],n);return t}const HL=(e,t,n,{allOwnKeys:r}={})=>(ru(t,(i,o)=>{n&&Yn(i)?e[o]=Y_(i,n):e[o]=i},{allOwnKeys:r}),e),VL=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qL=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},YL=(e,t,n,r)=>{let i,o,l;const u={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)l=i[o],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&Nv(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},WL=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},XL=e=>{if(!e)return null;if(vs(e))return e;let t=e.length;if(!X_(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},KL=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Nv(Uint8Array)),ZL=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},QL=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},JL=Dr("HTMLFormElement"),ez=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),i1=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),tz=Dr("RegExp"),Q_=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ru(n,(i,o)=>{let l;(l=t(i,o,e))!==!1&&(r[o]=l||i)}),Object.defineProperties(e,r)},nz=e=>{Q_(e,(t,n)=>{if(Yn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Yn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},rz=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return vs(e)?r(e):r(String(e).split(t)),n},iz=()=>{},az=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,qp="abcdefghijklmnopqrstuvwxyz",a1="0123456789",J_={DIGIT:a1,ALPHA:qp,ALPHA_DIGIT:qp+qp.toUpperCase()+a1},oz=(e=16,t=J_.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function sz(e){return!!(e&&Yn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const lz=e=>{const t=new Array(10),n=(r,i)=>{if(Wf(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=vs(r)?[]:{};return ru(r,(l,u)=>{const f=n(l,i+1);!Vl(f)&&(o[u]=f)}),t[i]=void 0,o}}return r};return n(e,0)},uz=Dr("AsyncFunction"),cz=e=>e&&(Wf(e)||Yn(e))&&Yn(e.then)&&Yn(e.catch),ek=((e,t)=>e?setImmediate:t?((n,r)=>(qa.addEventListener("message",({source:i,data:o})=>{i===qa&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),qa.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Yn(qa.postMessage)),fz=typeof queueMicrotask<"u"?queueMicrotask.bind(qa):typeof process<"u"&&process.nextTick||ek,fe={isArray:vs,isArrayBuffer:W_,isBuffer:AL,isFormData:PL,isArrayBufferView:RL,isString:DL,isNumber:X_,isBoolean:NL,isObject:Wf,isPlainObject:tf,isReadableStream:IL,isRequest:GL,isResponse:UL,isHeaders:BL,isUndefined:Vl,isDate:OL,isFile:jL,isBlob:LL,isRegExp:tz,isFunction:Yn,isStream:ML,isURLSearchParams:FL,isTypedArray:KL,isFileList:zL,forEach:ru,merge:Eg,extend:HL,trim:$L,stripBOM:VL,inherits:qL,toFlatObject:YL,kindOf:qf,kindOfTest:Dr,endsWith:WL,toArray:XL,forEachEntry:ZL,matchAll:QL,isHTMLForm:JL,hasOwnProperty:i1,hasOwnProp:i1,reduceDescriptors:Q_,freezeMethods:nz,toObjectSet:rz,toCamelCase:ez,noop:iz,toFiniteNumber:az,findKey:K_,global:qa,isContextDefined:Z_,ALPHABET:J_,generateString:oz,isSpecCompliantForm:sz,toJSONObject:lz,isAsyncFn:uz,isThenable:cz,setImmediate:ek,asap:fz};function tt(e,t,n,r,i){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),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}fe.inherits(tt,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:fe.toJSONObject(this.config),code:this.code,status:this.status}}});const tk=tt.prototype,nk={};["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=>{nk[e]={value:e}});Object.defineProperties(tt,nk);Object.defineProperty(tk,"isAxiosError",{value:!0});tt.from=(e,t,n,r,i,o)=>{const l=Object.create(tk);return fe.toFlatObject(e,l,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),tt.call(l,e.message,t,n,r,i),l.cause=e,l.name=e.name,o&&Object.assign(l,o),l};const dz=null;function _g(e){return fe.isPlainObject(e)||fe.isArray(e)}function rk(e){return fe.endsWith(e,"[]")?e.slice(0,-2):e}function o1(e,t,n){return e?e.concat(t).map(function(i,o){return i=rk(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function hz(e){return fe.isArray(e)&&!e.some(_g)}const pz=fe.toFlatObject(fe,{},null,function(t){return/^is[A-Z]/.test(t)});function Xf(e,t,n){if(!fe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=fe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,k){return!fe.isUndefined(k[x])});const r=n.metaTokens,i=n.visitor||p,o=n.dots,l=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&fe.isSpecCompliantForm(t);if(!fe.isFunction(i))throw new TypeError("visitor must be a function");function d(w){if(w===null)return"";if(fe.isDate(w))return w.toISOString();if(!f&&fe.isBlob(w))throw new tt("Blob is not supported. Use a Buffer instead.");return fe.isArrayBuffer(w)||fe.isTypedArray(w)?f&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function p(w,x,k){let C=w;if(w&&!k&&typeof w=="object"){if(fe.endsWith(x,"{}"))x=r?x:x.slice(0,-2),w=JSON.stringify(w);else if(fe.isArray(w)&&hz(w)||(fe.isFileList(w)||fe.endsWith(x,"[]"))&&(C=fe.toArray(w)))return x=rk(x),C.forEach(function(T,N){!(fe.isUndefined(T)||T===null)&&t.append(l===!0?o1([x],N,o):l===null?x:x+"[]",d(T))}),!1}return _g(w)?!0:(t.append(o1(k,x,o),d(w)),!1)}const m=[],v=Object.assign(pz,{defaultVisitor:p,convertValue:d,isVisitable:_g});function g(w,x){if(!fe.isUndefined(w)){if(m.indexOf(w)!==-1)throw Error("Circular reference detected in "+x.join("."));m.push(w),fe.forEach(w,function(C,_){(!(fe.isUndefined(C)||C===null)&&i.call(t,C,fe.isString(_)?_.trim():_,x,v))===!0&&g(C,x?x.concat(_):[_])}),m.pop()}}if(!fe.isObject(e))throw new TypeError("data must be an object");return g(e),t}function s1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ov(e,t){this._pairs=[],e&&Xf(e,this,t)}const ik=Ov.prototype;ik.append=function(t,n){this._pairs.push([t,n])};ik.toString=function(t){const n=t?function(r){return t.call(this,r,s1)}:s1;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function mz(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ak(e,t,n){if(!t)return e;const r=n&&n.encode||mz;fe.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=fe.isURLSearchParams(t)?t.toString():new Ov(t,n).toString(r),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class l1{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){fe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ok={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gz=typeof URLSearchParams<"u"?URLSearchParams:Ov,vz=typeof FormData<"u"?FormData:null,yz=typeof Blob<"u"?Blob:null,bz={isBrowser:!0,classes:{URLSearchParams:gz,FormData:vz,Blob:yz},protocols:["http","https","file","blob","url","data"]},jv=typeof window<"u"&&typeof document<"u",kg=typeof navigator=="object"&&navigator||void 0,xz=jv&&(!kg||["ReactNative","NativeScript","NS"].indexOf(kg.product)<0),wz=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Sz=jv&&window.location.href||"http://localhost",Ez=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:jv,hasStandardBrowserEnv:xz,hasStandardBrowserWebWorkerEnv:wz,navigator:kg,origin:Sz},Symbol.toStringTag,{value:"Module"})),gn={...Ez,...bz};function _z(e,t){return Xf(e,new gn.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return gn.isNode&&fe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function kz(e){return fe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Cz(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function sk(e){function t(n,r,i,o){let l=n[o++];if(l==="__proto__")return!0;const u=Number.isFinite(+l),f=o>=n.length;return l=!l&&fe.isArray(i)?i.length:l,f?(fe.hasOwnProp(i,l)?i[l]=[i[l],r]:i[l]=r,!u):((!i[l]||!fe.isObject(i[l]))&&(i[l]=[]),t(n,r,i[l],o)&&fe.isArray(i[l])&&(i[l]=Cz(i[l])),!u)}if(fe.isFormData(e)&&fe.isFunction(e.entries)){const n={};return fe.forEachEntry(e,(r,i)=>{t(kz(r),i,n,0)}),n}return null}function Tz(e,t,n){if(fe.isString(e))try{return(t||JSON.parse)(e),fe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const iu={transitional:ok,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=fe.isObject(t);if(o&&fe.isHTMLForm(t)&&(t=new FormData(t)),fe.isFormData(t))return i?JSON.stringify(sk(t)):t;if(fe.isArrayBuffer(t)||fe.isBuffer(t)||fe.isStream(t)||fe.isFile(t)||fe.isBlob(t)||fe.isReadableStream(t))return t;if(fe.isArrayBufferView(t))return t.buffer;if(fe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return _z(t,this.formSerializer).toString();if((u=fe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Xf(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),Tz(t)):t}],transformResponse:[function(t){const n=this.transitional||iu.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(fe.isResponse(t)||fe.isReadableStream(t))return t;if(t&&fe.isString(t)&&(r&&!this.responseType||i)){const l=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(u){if(l)throw u.name==="SyntaxError"?tt.from(u,tt.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:gn.classes.FormData,Blob:gn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};fe.forEach(["delete","get","head","post","put","patch"],e=>{iu.headers[e]={}});const Az=fe.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"]),Rz=e=>{const t={};let n,r,i;return e&&e.split(`
`).forEach(function(l){i=l.indexOf(":"),n=l.substring(0,i).trim().toLowerCase(),r=l.substring(i+1).trim(),!(!n||t[n]&&Az[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},u1=Symbol("internals");function Cl(e){return e&&String(e).trim().toLowerCase()}function nf(e){return e===!1||e==null?e:fe.isArray(e)?e.map(nf):String(e)}function Dz(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Nz=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Yp(e,t,n,r,i){if(fe.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!fe.isString(t)){if(fe.isString(r))return t.indexOf(r)!==-1;if(fe.isRegExp(r))return r.test(t)}}function Oz(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function jz(e,t){const n=fe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,l){return this[r].call(this,t,i,o,l)},configurable:!0})})}let zn=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(u,f,d){const p=Cl(f);if(!p)throw new Error("header name must be a non-empty string");const m=fe.findKey(i,p);(!m||i[m]===void 0||d===!0||d===void 0&&i[m]!==!1)&&(i[m||f]=nf(u))}const l=(u,f)=>fe.forEach(u,(d,p)=>o(d,p,f));if(fe.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(fe.isString(t)&&(t=t.trim())&&!Nz(t))l(Rz(t),n);else if(fe.isHeaders(t))for(const[u,f]of t.entries())o(f,u,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=Cl(t),t){const r=fe.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return Dz(i);if(fe.isFunction(n))return n.call(this,i,r);if(fe.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Cl(t),t){const r=fe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Yp(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(l){if(l=Cl(l),l){const u=fe.findKey(r,l);u&&(!n||Yp(r,r[u],u,n))&&(delete r[u],i=!0)}}return fe.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||Yp(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return fe.forEach(this,(i,o)=>{const l=fe.findKey(r,o);if(l){n[l]=nf(i),delete n[o];return}const u=t?Oz(o):String(o).trim();u!==o&&delete n[o],n[u]=nf(i),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return fe.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&fe.isArray(r)?r.join(", "):r)}),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 r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[u1]=this[u1]={accessors:{}}).accessors,i=this.prototype;function o(l){const u=Cl(l);r[u]||(jz(i,l),r[u]=!0)}return fe.isArray(t)?t.forEach(o):o(t),this}};zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);fe.reduceDescriptors(zn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});fe.freezeMethods(zn);function Wp(e,t){const n=this||iu,r=t||n,i=zn.from(r.headers);let o=r.data;return fe.forEach(e,function(u){o=u.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function lk(e){return!!(e&&e.__CANCEL__)}function ys(e,t,n){tt.call(this,e??"canceled",tt.ERR_CANCELED,t,n),this.name="CanceledError"}fe.inherits(ys,tt,{__CANCEL__:!0});function uk(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new tt("Request failed with status code "+n.status,[tt.ERR_BAD_REQUEST,tt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Lz(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function zz(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,l;return t=t!==void 0?t:1e3,function(f){const d=Date.now(),p=r[o];l||(l=d),n[i]=f,r[i]=d;let m=o,v=0;for(;m!==i;)v+=n[m++],m=m%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),d-l<t)return;const g=p&&d-p;return g?Math.round(v*1e3/g):void 0}}function Mz(e,t){let n=0,r=1e3/t,i,o;const l=(d,p=Date.now())=>{n=p,i=null,o&&(clearTimeout(o),o=null),e.apply(null,d)};return[(...d)=>{const p=Date.now(),m=p-n;m>=r?l(d,p):(i=d,o||(o=setTimeout(()=>{o=null,l(i)},r-m)))},()=>i&&l(i)]}const bf=(e,t,n=3)=>{let r=0;const i=zz(50,250);return Mz(o=>{const l=o.loaded,u=o.lengthComputable?o.total:void 0,f=l-r,d=i(f),p=l<=u;r=l;const m={loaded:l,total:u,progress:u?l/u:void 0,bytes:f,rate:d||void 0,estimated:d&&u&&p?(u-l)/d:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(m)},n)},c1=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},f1=e=>(...t)=>fe.asap(()=>e(...t)),Pz=gn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,gn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(gn.origin),gn.navigator&&/(msie|trident)/i.test(gn.navigator.userAgent)):()=>!0,Fz=gn.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const l=[e+"="+encodeURIComponent(t)];fe.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),fe.isString(r)&&l.push("path="+r),fe.isString(i)&&l.push("domain="+i),o===!0&&l.push("secure"),document.cookie=l.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 Iz(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Gz(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ck(e,t){return e&&!Iz(t)?Gz(e,t):t}const d1=e=>e instanceof zn?{...e}:e;function Wa(e,t){t=t||{};const n={};function r(d,p,m,v){return fe.isPlainObject(d)&&fe.isPlainObject(p)?fe.merge.call({caseless:v},d,p):fe.isPlainObject(p)?fe.merge({},p):fe.isArray(p)?p.slice():p}function i(d,p,m,v){if(fe.isUndefined(p)){if(!fe.isUndefined(d))return r(void 0,d,m,v)}else return r(d,p,m,v)}function o(d,p){if(!fe.isUndefined(p))return r(void 0,p)}function l(d,p){if(fe.isUndefined(p)){if(!fe.isUndefined(d))return r(void 0,d)}else return r(void 0,p)}function u(d,p,m){if(m in t)return r(d,p);if(m in e)return r(void 0,d)}const f={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(d,p,m)=>i(d1(d),d1(p),m,!0)};return fe.forEach(Object.keys(Object.assign({},e,t)),function(p){const m=f[p]||i,v=m(e[p],t[p],p);fe.isUndefined(v)&&m!==u||(n[p]=v)}),n}const fk=e=>{const t=Wa({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:l,auth:u}=t;t.headers=l=zn.from(l),t.url=ak(ck(t.baseURL,t.url),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(fe.isFormData(n)){if(gn.hasStandardBrowserEnv||gn.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((f=l.getContentType())!==!1){const[d,...p]=f?f.split(";").map(m=>m.trim()).filter(Boolean):[];l.setContentType([d||"multipart/form-data",...p].join("; "))}}if(gn.hasStandardBrowserEnv&&(r&&fe.isFunction(r)&&(r=r(t)),r||r!==!1&&Pz(t.url))){const d=i&&o&&Fz.read(o);d&&l.set(i,d)}return t},Uz=typeof XMLHttpRequest<"u",Bz=Uz&&function(e){return new Promise(function(n,r){const i=fk(e);let o=i.data;const l=zn.from(i.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:d}=i,p,m,v,g,w;function x(){g&&g(),w&&w(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let k=new XMLHttpRequest;k.open(i.method.toUpperCase(),i.url,!0),k.timeout=i.timeout;function C(){if(!k)return;const T=zn.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),D={data:!u||u==="text"||u==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:T,config:e,request:k};uk(function(R){n(R),x()},function(R){r(R),x()},D),k=null}"onloadend"in k?k.onloadend=C:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(C)},k.onabort=function(){k&&(r(new tt("Request aborted",tt.ECONNABORTED,e,k)),k=null)},k.onerror=function(){r(new tt("Network Error",tt.ERR_NETWORK,e,k)),k=null},k.ontimeout=function(){let N=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const D=i.transitional||ok;i.timeoutErrorMessage&&(N=i.timeoutErrorMessage),r(new tt(N,D.clarifyTimeoutError?tt.ETIMEDOUT:tt.ECONNABORTED,e,k)),k=null},o===void 0&&l.setContentType(null),"setRequestHeader"in k&&fe.forEach(l.toJSON(),function(N,D){k.setRequestHeader(D,N)}),fe.isUndefined(i.withCredentials)||(k.withCredentials=!!i.withCredentials),u&&u!=="json"&&(k.responseType=i.responseType),d&&([v,w]=bf(d,!0),k.addEventListener("progress",v)),f&&k.upload&&([m,g]=bf(f),k.upload.addEventListener("progress",m),k.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(p=T=>{k&&(r(!T||T.type?new ys(null,e,k):T),k.abort(),k=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const _=Lz(i.url);if(_&&gn.protocols.indexOf(_)===-1){r(new tt("Unsupported protocol "+_+":",tt.ERR_BAD_REQUEST,e));return}k.send(o||null)})},$z=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(d){if(!i){i=!0,u();const p=d instanceof Error?d:this.reason;r.abort(p instanceof tt?p:new ys(p instanceof Error?p.message:p))}};let l=t&&setTimeout(()=>{l=null,o(new tt(`timeout ${t} of ms exceeded`,tt.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>fe.asap(u),f}},Hz=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},Vz=async function*(e,t){for await(const n of qz(e))yield*Hz(n,t)},qz=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},h1=(e,t,n,r)=>{const i=Vz(e,t);let o=0,l,u=f=>{l||(l=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:d,value:p}=await i.next();if(d){u(),f.close();return}let m=p.byteLength;if(n){let v=o+=m;n(v)}f.enqueue(new Uint8Array(p))}catch(d){throw u(d),d}},cancel(f){return u(f),i.return()}},{highWaterMark:2})},Kf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",dk=Kf&&typeof ReadableStream=="function",Yz=Kf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),hk=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Wz=dk&&hk(()=>{let e=!1;const t=new Request(gn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),p1=64*1024,Cg=dk&&hk(()=>fe.isReadableStream(new Response("").body)),xf={stream:Cg&&(e=>e.body)};Kf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!xf[t]&&(xf[t]=fe.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new tt(`Response type '${t}' is not supported`,tt.ERR_NOT_SUPPORT,r)})})})(new Response);const Xz=async e=>{if(e==null)return 0;if(fe.isBlob(e))return e.size;if(fe.isSpecCompliantForm(e))return(await new Request(gn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(fe.isArrayBufferView(e)||fe.isArrayBuffer(e))return e.byteLength;if(fe.isURLSearchParams(e)&&(e=e+""),fe.isString(e))return(await Yz(e)).byteLength},Kz=async(e,t)=>{const n=fe.toFiniteNumber(e.getContentLength());return n??Xz(t)},Zz=Kf&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:l,onDownloadProgress:u,onUploadProgress:f,responseType:d,headers:p,withCredentials:m="same-origin",fetchOptions:v}=fk(e);d=d?(d+"").toLowerCase():"text";let g=$z([i,o&&o.toAbortSignal()],l),w;const x=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let k;try{if(f&&Wz&&n!=="get"&&n!=="head"&&(k=await Kz(p,r))!==0){let D=new Request(t,{method:"POST",body:r,duplex:"half"}),L;if(fe.isFormData(r)&&(L=D.headers.get("content-type"))&&p.setContentType(L),D.body){const[R,U]=c1(k,bf(f1(f)));r=h1(D.body,p1,R,U)}}fe.isString(m)||(m=m?"include":"omit");const C="credentials"in Request.prototype;w=new Request(t,{...v,signal:g,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:C?m:void 0});let _=await fetch(w);const T=Cg&&(d==="stream"||d==="response");if(Cg&&(u||T&&x)){const D={};["status","statusText","headers"].forEach(P=>{D[P]=_[P]});const L=fe.toFiniteNumber(_.headers.get("content-length")),[R,U]=u&&c1(L,bf(f1(u),!0))||[];_=new Response(h1(_.body,p1,R,()=>{U&&U(),x&&x()}),D)}d=d||"text";let N=await xf[fe.findKey(xf,d)||"text"](_,e);return!T&&x&&x(),await new Promise((D,L)=>{uk(D,L,{data:N,headers:zn.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:w})})}catch(C){throw x&&x(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new tt("Network Error",tt.ERR_NETWORK,e,w),{cause:C.cause||C}):tt.from(C,C&&C.code,e,w)}}),Tg={http:dz,xhr:Bz,fetch:Zz};fe.forEach(Tg,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const m1=e=>`- ${e}`,Qz=e=>fe.isFunction(e)||e===null||e===!1,pk={getAdapter:e=>{e=fe.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o<t;o++){n=e[o];let l;if(r=n,!Qz(n)&&(r=Tg[(l=String(n)).toLowerCase()],r===void 0))throw new tt(`Unknown adapter '${l}'`);if(r)break;i[l||"#"+o]=r}if(!r){const o=Object.entries(i).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=t?o.length>1?`since :
`+o.map(m1).join(`
`):" "+m1(o[0]):"as no adapter specified";throw new tt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:Tg};function Xp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ys(null,e)}function g1(e){return Xp(e),e.headers=zn.from(e.headers),e.data=Wp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pk.getAdapter(e.adapter||iu.adapter)(e).then(function(r){return Xp(e),r.data=Wp.call(e,e.transformResponse,r),r.headers=zn.from(r.headers),r},function(r){return lk(r)||(Xp(e),r&&r.response&&(r.response.data=Wp.call(e,e.transformResponse,r.response),r.response.headers=zn.from(r.response.headers))),Promise.reject(r)})}const mk="1.7.9",Zf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Zf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const v1={};Zf.transitional=function(t,n,r){function i(o,l){return"[Axios v"+mk+"] Transitional option '"+o+"'"+l+(r?". "+r:"")}return(o,l,u)=>{if(t===!1)throw new tt(i(l," has been removed"+(n?" in "+n:"")),tt.ERR_DEPRECATED);return n&&!v1[l]&&(v1[l]=!0,console.warn(i(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,u):!0}};Zf.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Jz(e,t,n){if(typeof e!="object")throw new tt("options must be an object",tt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],l=t[o];if(l){const u=e[o],f=u===void 0||l(u,o,e);if(f!==!0)throw new tt("option "+o+" must be "+f,tt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new tt("Unknown option "+o,tt.ERR_BAD_OPTION)}}const rf={assertOptions:Jz,validators:Zf},Fr=rf.validators;let Ya=class{constructor(t){this.defaults=t,this.interceptors={request:new l1,response:new l1}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Wa(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&rf.assertOptions(r,{silentJSONParsing:Fr.transitional(Fr.boolean),forcedJSONParsing:Fr.transitional(Fr.boolean),clarifyTimeoutError:Fr.transitional(Fr.boolean)},!1),i!=null&&(fe.isFunction(i)?n.paramsSerializer={serialize:i}:rf.assertOptions(i,{encode:Fr.function,serialize:Fr.function},!0)),rf.assertOptions(n,{baseUrl:Fr.spelling("baseURL"),withXsrfToken:Fr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&fe.merge(o.common,o[n.method]);o&&fe.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=zn.concat(l,o);const u=[];let f=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(f=f&&x.synchronous,u.unshift(x.fulfilled,x.rejected))});const d=[];this.interceptors.response.forEach(function(x){d.push(x.fulfilled,x.rejected)});let p,m=0,v;if(!f){const w=[g1.bind(this),void 0];for(w.unshift.apply(w,u),w.push.apply(w,d),v=w.length,p=Promise.resolve(n);m<v;)p=p.then(w[m++],w[m++]);return p}v=u.length;let g=n;for(m=0;m<v;){const w=u[m++],x=u[m++];try{g=w(g)}catch(k){x.call(this,k);break}}try{p=g1.call(this,g)}catch(w){return Promise.reject(w)}for(m=0,v=d.length;m<v;)p=p.then(d[m++],d[m++]);return p}getUri(t){t=Wa(this.defaults,t);const n=ck(t.baseURL,t.url);return ak(n,t.params,t.paramsSerializer)}};fe.forEach(["delete","get","head","options"],function(t){Ya.prototype[t]=function(n,r){return this.request(Wa(r||{},{method:t,url:n,data:(r||{}).data}))}});fe.forEach(["post","put","patch"],function(t){function n(r){return function(o,l,u){return this.request(Wa(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:l}))}}Ya.prototype[t]=n(),Ya.prototype[t+"Form"]=n(!0)});let eM=class gk{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const l=new Promise(u=>{r.subscribe(u),o=u}).then(i);return l.cancel=function(){r.unsubscribe(o)},l},t(function(o,l,u){r.reason||(r.reason=new ys(o,l,u),n(r.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=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new gk(function(i){t=i}),cancel:t}}};function tM(e){return function(n){return e.apply(null,n)}}function nM(e){return fe.isObject(e)&&e.isAxiosError===!0}const Ag={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(Ag).forEach(([e,t])=>{Ag[t]=e});function vk(e){const t=new Ya(e),n=Y_(Ya.prototype.request,t);return fe.extend(n,Ya.prototype,t,{allOwnKeys:!0}),fe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return vk(Wa(e,i))},n}const Ut=vk(iu);Ut.Axios=Ya;Ut.CanceledError=ys;Ut.CancelToken=eM;Ut.isCancel=lk;Ut.VERSION=mk;Ut.toFormData=Xf;Ut.AxiosError=tt;Ut.Cancel=Ut.CanceledError;Ut.all=function(t){return Promise.all(t)};Ut.spread=tM;Ut.isAxiosError=nM;Ut.mergeConfig=Wa;Ut.AxiosHeaders=zn;Ut.formToJSON=e=>sk(fe.isHTMLForm(e)?new FormData(e):e);Ut.getAdapter=pk.getAdapter;Ut.HttpStatusCode=Ag;Ut.default=Ut;const{Axios:XX,AxiosError:KX,CanceledError:ZX,isCancel:QX,CancelToken:JX,VERSION:eK,all:tK,Cancel:nK,isAxiosError:rK,spread:iK,toFormData:aK,AxiosHeaders:oK,HttpStatusCode:sK,formToJSON:lK,getAdapter:uK,mergeConfig:cK}=Ut,yk="Invalid API Key",bk="API Key required",Nr=Ut.create({baseURL:U_,headers:{"Content-Type":"application/json"}});Nr.interceptors.request.use(e=>{const t=Qe.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});Nr.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 rM=async e=>(await Nr.get(`/graphs?label=${e}`)).data,iM=async()=>(await Nr.get("/graph/label/list")).data,aM=async()=>{try{return(await Nr.get("/health")).data}catch(e){return{status:"error",message:Cr(e)}}},oM=async()=>(await Nr.get("/documents")).data,sM=async()=>(await Nr.post("/documents/scan")).data,lM=async e=>(await Nr.post("/query",e)).data,uM=async(e,t,n)=>{try{let r="";if(await Nr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[i=>{r+=i;const o=r.split(`
`);r=o.pop()||"";for(const l of o)if(l.trim())try{const u=JSON.parse(l);u.response?t(u.response):u.error&&n&&n(u.error)}catch(u){console.error("Error parsing stream chunk:",u),n&&n("Error parsing server response")}return i}]}).catch(i=>{n&&n(Cr(i))}),r.trim())try{const i=JSON.parse(r);i.response?t(i.response):i.error&&n&&n(i.error)}catch(i){console.error("Error parsing final chunk:",i),n&&n("Error parsing server response")}}catch(r){const i=Cr(r);console.error("Stream request failed:",i),n&&n(i)}},cM=async(e,t)=>{const n=new FormData;return n.append("file",e),(await Nr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?i=>{const o=Math.round(i.loaded*100/i.total);t(o)}:void 0})).data},fM=async()=>(await Nr.delete("/documents")).data,dM=Tv()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await aM();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})}})),Mn=Dv(dM);/**
* @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 hM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),xk=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.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 pM={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 mM=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...u},f)=>E.createElement("svg",{ref:f,...pM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:xk("lucide",i),...u},[...l.map(([d,p])=>E.createElement(d,p)),...Array.isArray(o)?o:[o]]));/**
* @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 Et=(e,t)=>{const n=E.forwardRef(({className:r,...i},o)=>E.createElement(mM,{ref:o,iconNode:t,className:xk(`lucide-${hM(e)}`,r),...i}));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 gM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Lv=Et("Check",gM);/**
* @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 vM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zv=Et("ChevronDown",vM);/**
* @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 yM=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],wk=Et("ChevronUp",yM);/**
* @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 bM=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],xM=Et("ChevronsUpDown",bM);/**
* @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 wM=[["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"}]],SM=Et("CircleAlert",wM);/**
* @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 EM=[["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"}]],Sk=Et("Eraser",EM);/**
* @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 _M=[["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"}]],kM=Et("FileText",_M);/**
* @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 CM=[["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"}]],TM=Et("Files",CM);/**
* @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 AM=[["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"}]],RM=Et("Fullscreen",AM);/**
* @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 DM=[["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"}]],NM=Et("Github",DM);/**
* @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 OM=[["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"}]],jM=Et("Grip",OM);/**
* @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 LM=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ek=Et("LoaderCircle",LM);/**
* @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 zM=[["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"}]],MM=Et("Loader",zM);/**
* @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 PM=[["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"}]],FM=Et("Maximize",PM);/**
* @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 IM=[["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"}]],GM=Et("Minimize",IM);/**
* @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 UM=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],BM=Et("Moon",UM);/**
* @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 $M=[["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"}]],HM=Et("Pause",$M);/**
* @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 VM=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],qM=Et("Play",VM);/**
* @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 YM=[["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"}]],WM=Et("RefreshCw",YM);/**
* @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 XM=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],KM=Et("Search",XM);/**
* @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 ZM=[["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"}]],QM=Et("Send",ZM);/**
* @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 JM=[["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"}]],eP=Et("Settings",JM);/**
* @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 tP=[["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"}]],nP=Et("Sun",tP);/**
* @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 rP=[["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"}]],Rg=Et("Upload",rP);/**
* @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 iP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_k=Et("X",iP);/**
* @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 aP=[["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"}]],oP=Et("Zap",aP);/**
* @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 sP=[["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"}]],lP=Et("ZoomIn",sP);/**
* @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 uP=[["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"}]],cP=Et("ZoomOut",uP),fP=()=>{const e=Mn.use.health(),t=Mn.use.message(),n=Mn.use.messageTitle(),[r,i]=E.useState(!1);return E.useEffect(()=>{setTimeout(()=>{i(!0)},50)},[]),S.jsxs(H_,{className:Me("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",r?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&S.jsx("div",{children:S.jsx(SM,{className:"size-4"})}),S.jsxs("div",{children:[S.jsx(V_,{className:"font-bold",children:n}),S.jsx(q_,{children:t})]})]})};function dP(e,t){const n=E.createContext(t),r=o=>{const{children:l,...u}=o,f=E.useMemo(()=>u,Object.values(u));return S.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function i(o){const l=E.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function dr(e,t=[]){let n=[];function r(o,l){const u=E.createContext(l),f=n.length;n=[...n,l];const d=m=>{var C;const{scope:v,children:g,...w}=m,x=((C=v==null?void 0:v[e])==null?void 0:C[f])||u,k=E.useMemo(()=>w,Object.values(w));return S.jsx(x.Provider,{value:k,children:g})};d.displayName=o+"Provider";function p(m,v){var x;const g=((x=v==null?void 0:v[e])==null?void 0:x[f])||u,w=E.useContext(g);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[d,p]}const i=()=>{const o=n.map(l=>E.createContext(l));return function(u){const f=(u==null?void 0:u[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[r,hP(i,...t)]}function hP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((u,{useScope:f,scopeName:d})=>{const m=f(o)[`__scope${d}`];return{...u,...m}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function y1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function kk(...e){return t=>{let n=!1;const r=e.map(i=>{const o=y1(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():y1(e[i],null)}}}}function dt(...e){return E.useCallback(kk(...e),e)}function qe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}var xn=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},pP=dj.useId||(()=>{}),mP=0;function bn(e){const[t,n]=E.useState(pP());return xn(()=>{n(r=>r??String(mP++))},[e]),t?`radix-${t}`:""}function un(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function _i({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=gP({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:r,u=un(n),f=E.useCallback(d=>{if(o){const m=typeof d=="function"?d(e):d;m!==e&&u(m)}else i(d)},[o,e,i,u]);return[l,f]}function gP({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,i=E.useRef(r),o=un(t);return E.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var au=R_();const Ck=fn(au);var ua=E.forwardRef((e,t)=>{const{children:n,...r}=e,i=E.Children.toArray(n),o=i.find(vP);if(o){const l=o.props.children,u=i.map(f=>f===o?E.Children.count(l)>1?E.Children.only(null):E.isValidElement(l)?l.props.children:null:f);return S.jsx(Dg,{...r,ref:t,children:E.isValidElement(l)?E.cloneElement(l,void 0,u):null})}return S.jsx(Dg,{...r,ref:t,children:n})});ua.displayName="Slot";var Dg=E.forwardRef((e,t)=>{const{children:n,...r}=e;if(E.isValidElement(n)){const i=bP(n),o=yP(r,n.props);return n.type!==E.Fragment&&(o.ref=t?kk(t,i):i),E.cloneElement(n,o)}return E.Children.count(n)>1?E.Children.only(null):null});Dg.displayName="SlotClone";var Mv=({children:e})=>S.jsx(S.Fragment,{children:e});function vP(e){return E.isValidElement(e)&&e.type===Mv}function yP(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...u)=>{o(...u),i(...u)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function bP(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],We=xP.reduce((e,t)=>{const n=E.forwardRef((r,i)=>{const{asChild:o,...l}=r,u=o?ua:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function wP(e,t){e&&au.flushSync(()=>e.dispatchEvent(t))}function SP(e,t=globalThis==null?void 0:globalThis.document){const n=un(e);E.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var EP="DismissableLayer",Ng="dismissableLayer.update",_P="dismissableLayer.pointerDownOutside",kP="dismissableLayer.focusOutside",b1,Tk=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ou=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...f}=e,d=E.useContext(Tk),[p,m]=E.useState(null),v=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=E.useState({}),w=dt(t,R=>m(R)),x=Array.from(d.layers),[k]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=x.indexOf(k),_=p?x.indexOf(p):-1,T=d.layersWithOutsidePointerEventsDisabled.size>0,N=_>=C,D=AP(R=>{const U=R.target,P=[...d.branches].some(z=>z.contains(U));!N||P||(i==null||i(R),l==null||l(R),R.defaultPrevented||u==null||u())},v),L=RP(R=>{const U=R.target;[...d.branches].some(z=>z.contains(U))||(o==null||o(R),l==null||l(R),R.defaultPrevented||u==null||u())},v);return SP(R=>{_===d.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&u&&(R.preventDefault(),u()))},v),E.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(b1=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),x1(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=b1)}},[p,v,n,d]),E.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),x1())},[p,d]),E.useEffect(()=>{const R=()=>g({});return document.addEventListener(Ng,R),()=>document.removeEventListener(Ng,R)},[]),S.jsx(We.div,{...f,ref:w,style:{pointerEvents:T?N?"auto":"none":void 0,...e.style},onFocusCapture:qe(e.onFocusCapture,L.onFocusCapture),onBlurCapture:qe(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:qe(e.onPointerDownCapture,D.onPointerDownCapture)})});ou.displayName=EP;var CP="DismissableLayerBranch",TP=E.forwardRef((e,t)=>{const n=E.useContext(Tk),r=E.useRef(null),i=dt(t,r);return E.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),S.jsx(We.div,{...e,ref:i})});TP.displayName=CP;function AP(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let f=function(){Ak(_P,n,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function RP(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=E.useRef(!1);return E.useEffect(()=>{const i=o=>{o.target&&!r.current&&Ak(kP,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function x1(){const e=new CustomEvent(Ng);document.dispatchEvent(e)}function Ak(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?wP(i,o):i.dispatchEvent(o)}var Kp="focusScope.autoFocusOnMount",Zp="focusScope.autoFocusOnUnmount",w1={bubbles:!1,cancelable:!0},DP="FocusScope",Qf=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,f]=E.useState(null),d=un(i),p=un(o),m=E.useRef(null),v=dt(t,x=>f(x)),g=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let x=function(T){if(g.paused||!u)return;const N=T.target;u.contains(N)?m.current=N:ia(m.current,{select:!0})},k=function(T){if(g.paused||!u)return;const N=T.relatedTarget;N!==null&&(u.contains(N)||ia(m.current,{select:!0}))},C=function(T){if(document.activeElement===document.body)for(const D of T)D.removedNodes.length>0&&ia(u)};document.addEventListener("focusin",x),document.addEventListener("focusout",k);const _=new MutationObserver(C);return u&&_.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",k),_.disconnect()}}},[r,u,g.paused]),E.useEffect(()=>{if(u){E1.add(g);const x=document.activeElement;if(!u.contains(x)){const C=new CustomEvent(Kp,w1);u.addEventListener(Kp,d),u.dispatchEvent(C),C.defaultPrevented||(NP(MP(Rk(u)),{select:!0}),document.activeElement===x&&ia(u))}return()=>{u.removeEventListener(Kp,d),setTimeout(()=>{const C=new CustomEvent(Zp,w1);u.addEventListener(Zp,p),u.dispatchEvent(C),C.defaultPrevented||ia(x??document.body,{select:!0}),u.removeEventListener(Zp,p),E1.remove(g)},0)}}},[u,d,p,g]);const w=E.useCallback(x=>{if(!n&&!r||g.paused)return;const k=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,C=document.activeElement;if(k&&C){const _=x.currentTarget,[T,N]=OP(_);T&&N?!x.shiftKey&&C===N?(x.preventDefault(),n&&ia(T,{select:!0})):x.shiftKey&&C===T&&(x.preventDefault(),n&&ia(N,{select:!0})):C===_&&x.preventDefault()}},[n,r,g.paused]);return S.jsx(We.div,{tabIndex:-1,...l,ref:v,onKeyDown:w})});Qf.displayName=DP;function NP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ia(r,{select:t}),document.activeElement!==n)return}function OP(e){const t=Rk(e),n=S1(t,e),r=S1(t.reverse(),e);return[n,r]}function Rk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function S1(e,t){for(const n of e)if(!jP(n,{upTo:t}))return n}function jP(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 LP(e){return e instanceof HTMLInputElement&&"select"in e}function ia(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LP(e)&&t&&e.select()}}var E1=zP();function zP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_1(e,t),e.unshift(t)},remove(t){var n;e=_1(e,t),(n=e[0])==null||n.resume()}}}function _1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function MP(e){return e.filter(t=>t.tagName!=="A")}var PP="Portal",Jf=E.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[i,o]=E.useState(!1);xn(()=>o(!0),[]);const l=n||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?Ck.createPortal(S.jsx(We.div,{...r,ref:t}),l):null});Jf.displayName=PP;function FP(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Kn=e=>{const{present:t,children:n}=e,r=IP(t),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),o=dt(r.ref,GP(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:o}):null};Kn.displayName="Presence";function IP(e){const[t,n]=E.useState(),r=E.useRef({}),i=E.useRef(e),o=E.useRef("none"),l=e?"mounted":"unmounted",[u,f]=FP(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const d=Rc(r.current);o.current=u==="mounted"?d:"none"},[u]),xn(()=>{const d=r.current,p=i.current;if(p!==e){const v=o.current,g=Rc(d);e?f("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?f("UNMOUNT"):f(p&&v!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),xn(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=g=>{const x=Rc(r.current).includes(g.animationName);if(g.target===t&&x&&(f("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},v=g=>{g.target===t&&(o.current=Rc(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:E.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function Rc(e){return(e==null?void 0:e.animationName)||"none"}function GP(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qp=0;function Pv(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??k1()),document.body.insertAdjacentElement("beforeend",e[1]??k1()),Qp++,()=>{Qp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Qp--}},[])}function k1(){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 Ur=function(){return Ur=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ur.apply(this,arguments)};function Dk(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function no(e,t,n,r){function i(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(p){try{d(r.next(p))}catch(m){l(m)}}function f(p){try{d(r.throw(p))}catch(m){l(m)}}function d(p){p.done?o(p.value):i(p.value).then(u,f)}d((r=r.apply(e,t||[])).next())})}function UP(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var af="right-scroll-bar-position",of="width-before-scroll-bar",BP="with-scroll-bars-hidden",$P="--removed-body-scroll-bar-size";function Jp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function HP(e,t){var n=E.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var VP=typeof window<"u"?E.useLayoutEffect:E.useEffect,C1=new WeakMap;function qP(e,t){var n=HP(null,function(r){return e.forEach(function(i){return Jp(i,r)})});return VP(function(){var r=C1.get(n);if(r){var i=new Set(r),o=new Set(e),l=n.current;i.forEach(function(u){o.has(u)||Jp(u,null)}),o.forEach(function(u){i.has(u)||Jp(u,l)})}C1.set(n,e)},[e]),n}function YP(e){return e}function WP(e,t){t===void 0&&(t=YP);var n=[],r=!1,i={read:function(){if(r)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(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(o),l=n}var f=function(){var p=l;l=[],p.forEach(o)},d=function(){return Promise.resolve().then(f)};d(),n={push:function(p){l.push(p),d()},filter:function(p){return l=l.filter(p),n}}}};return i}function XP(e){e===void 0&&(e={});var t=WP(null);return t.options=Ur({async:!0,ssr:!1},e),t}var Nk=function(e){var t=e.sideCar,n=Dk(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return E.createElement(r,Ur({},n))};Nk.isSideCarExport=!0;function KP(e,t){return e.useMedium(t),Nk}var Ok=XP(),em=function(){},ed=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:em,onWheelCapture:em,onTouchMoveCapture:em}),i=r[0],o=r[1],l=e.forwardProps,u=e.children,f=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,v=e.sideCar,g=e.noIsolation,w=e.inert,x=e.allowPinchZoom,k=e.as,C=k===void 0?"div":k,_=e.gapMode,T=Dk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=v,D=qP([n,t]),L=Ur(Ur({},T),i);return E.createElement(E.Fragment,null,p&&E.createElement(N,{sideCar:Ok,removeScrollBar:d,shards:m,noIsolation:g,inert:w,setCallbacks:o,allowPinchZoom:!!x,lockRef:n,gapMode:_}),l?E.cloneElement(E.Children.only(u),Ur(Ur({},L),{ref:D})):E.createElement(C,Ur({},L,{className:f,ref:D}),u))});ed.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ed.classNames={fullWidth:of,zeroRight:af};var ZP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function QP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ZP();return t&&e.setAttribute("nonce",t),e}function JP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eF(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tF=function(){var e=0,t=null;return{add:function(n){e==0&&(t=QP())&&(JP(t,n),eF(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nF=function(){var e=tF();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},jk=function(){var e=nF(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},rF={left:0,top:0,right:0,gap:0},tm=function(e){return parseInt(e||"",10)||0},iF=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[tm(n),tm(r),tm(i)]},aF=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rF;var t=iF(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},oF=jk(),ts="data-scroll-locked",sF=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
.`.concat(BP,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(u,"px ").concat(r,`;
}
body[`).concat(ts,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(i,`px;
padding-top: `).concat(o,`px;
padding-right: `).concat(l,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(u,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(af,` {
right: `).concat(u,"px ").concat(r,`;
}
.`).concat(of,` {
margin-right: `).concat(u,"px ").concat(r,`;
}
.`).concat(af," .").concat(af,` {
right: 0 `).concat(r,`;
}
.`).concat(of," .").concat(of,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat(ts,`] {
`).concat($P,": ").concat(u,`px;
}
`)},T1=function(){var e=parseInt(document.body.getAttribute(ts)||"0",10);return isFinite(e)?e:0},lF=function(){E.useEffect(function(){return document.body.setAttribute(ts,(T1()+1).toString()),function(){var e=T1()-1;e<=0?document.body.removeAttribute(ts):document.body.setAttribute(ts,e.toString())}},[])},uF=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;lF();var o=E.useMemo(function(){return aF(i)},[i]);return E.createElement(oF,{styles:sF(o,!t,i,n?"":"!important")})},Og=!1;if(typeof window<"u")try{var Dc=Object.defineProperty({},"passive",{get:function(){return Og=!0,!0}});window.addEventListener("test",Dc,Dc),window.removeEventListener("test",Dc,Dc)}catch{Og=!1}var Ho=Og?{passive:!1}:!1,cF=function(e){return e.tagName==="TEXTAREA"},Lk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!cF(e)&&n[t]==="visible")},fF=function(e){return Lk(e,"overflowY")},dF=function(e){return Lk(e,"overflowX")},A1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=zk(e,r);if(i){var o=Mk(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hF=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},pF=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},zk=function(e,t){return e==="v"?fF(t):dF(t)},Mk=function(e,t){return e==="v"?hF(t):pF(t)},mF=function(e,t){return e==="h"&&t==="rtl"?-1:1},gF=function(e,t,n,r,i){var o=mF(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,f=t.contains(u),d=!1,p=l>0,m=0,v=0;do{var g=Mk(e,u),w=g[0],x=g[1],k=g[2],C=x-k-o*w;(w||C)&&zk(e,u)&&(m+=C,v+=w),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(v)<1)&&(d=!0),d},Nc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},R1=function(e){return[e.deltaX,e.deltaY]},D1=function(e){return e&&"current"in e?e.current:e},vF=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yF=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},bF=0,Vo=[];function xF(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(bF++)[0],o=E.useState(jk)[0],l=E.useRef(e);E.useEffect(function(){l.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=UP([e.lockRef.current],(e.shards||[]).map(D1),!0).filter(Boolean);return x.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=E.useCallback(function(x,k){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!l.current.allowPinchZoom;var C=Nc(x),_=n.current,T="deltaX"in x?x.deltaX:_[0]-C[0],N="deltaY"in x?x.deltaY:_[1]-C[1],D,L=x.target,R=Math.abs(T)>Math.abs(N)?"h":"v";if("touches"in x&&R==="h"&&L.type==="range")return!1;var U=A1(R,L);if(!U)return!0;if(U?D=R:(D=R==="v"?"h":"v",U=A1(R,L)),!U)return!1;if(!r.current&&"changedTouches"in x&&(T||N)&&(r.current=D),!D)return!0;var P=r.current||D;return gF(P,k,x,P==="h"?T:N)},[]),f=E.useCallback(function(x){var k=x;if(!(!Vo.length||Vo[Vo.length-1]!==o)){var C="deltaY"in k?R1(k):Nc(k),_=t.current.filter(function(D){return D.name===k.type&&(D.target===k.target||k.target===D.shadowParent)&&vF(D.delta,C)})[0];if(_&&_.should){k.cancelable&&k.preventDefault();return}if(!_){var T=(l.current.shards||[]).map(D1).filter(Boolean).filter(function(D){return D.contains(k.target)}),N=T.length>0?u(k,T[0]):!l.current.noIsolation;N&&k.cancelable&&k.preventDefault()}}},[]),d=E.useCallback(function(x,k,C,_){var T={name:x,delta:k,target:C,should:_,shadowParent:wF(C)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(N){return N!==T})},1)},[]),p=E.useCallback(function(x){n.current=Nc(x),r.current=void 0},[]),m=E.useCallback(function(x){d(x.type,R1(x),x.target,u(x,e.lockRef.current))},[]),v=E.useCallback(function(x){d(x.type,Nc(x),x.target,u(x,e.lockRef.current))},[]);E.useEffect(function(){return Vo.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",f,Ho),document.addEventListener("touchmove",f,Ho),document.addEventListener("touchstart",p,Ho),function(){Vo=Vo.filter(function(x){return x!==o}),document.removeEventListener("wheel",f,Ho),document.removeEventListener("touchmove",f,Ho),document.removeEventListener("touchstart",p,Ho)}},[]);var g=e.removeScrollBar,w=e.inert;return E.createElement(E.Fragment,null,w?E.createElement(o,{styles:yF(i)}):null,g?E.createElement(uF,{gapMode:e.gapMode}):null)}function wF(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SF=KP(Ok,xF);var td=E.forwardRef(function(e,t){return E.createElement(ed,Ur({},e,{ref:t,sideCar:SF}))});td.classNames=ed.classNames;var EF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qo=new WeakMap,Oc=new WeakMap,jc={},nm=0,Pk=function(e){return e&&(e.host||Pk(e.parentNode))},_F=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Pk(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kF=function(e,t,n,r){var i=_F(t,Array.isArray(e)?e:[e]);jc[n]||(jc[n]=new WeakMap);var o=jc[n],l=[],u=new Set,f=new Set(i),d=function(m){!m||u.has(m)||(u.add(m),d(m.parentNode))};i.forEach(d);var p=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(v){if(u.has(v))p(v);else try{var g=v.getAttribute(r),w=g!==null&&g!=="false",x=(qo.get(v)||0)+1,k=(o.get(v)||0)+1;qo.set(v,x),o.set(v,k),l.push(v),x===1&&w&&Oc.set(v,!0),k===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",v,C)}})};return p(t),u.clear(),nm++,function(){l.forEach(function(m){var v=qo.get(m)-1,g=o.get(m)-1;qo.set(m,v),o.set(m,g),v||(Oc.has(m)||m.removeAttribute(r),Oc.delete(m)),g||m.removeAttribute(n)}),nm--,nm||(qo=new WeakMap,qo=new WeakMap,Oc=new WeakMap,jc={})}},Fv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=EF(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),kF(r,i,n,"aria-hidden")):function(){return null}},Iv="Dialog",[Fk,Ik]=dr(Iv),[CF,Or]=Fk(Iv),Gk=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,u=E.useRef(null),f=E.useRef(null),[d=!1,p]=_i({prop:r,defaultProp:i,onChange:o});return S.jsx(CF,{scope:t,triggerRef:u,contentRef:f,contentId:bn(),titleId:bn(),descriptionId:bn(),open:d,onOpenChange:p,onOpenToggle:E.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};Gk.displayName=Iv;var Uk="DialogTrigger",Bk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Uk,n),o=dt(t,i.triggerRef);return S.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Bv(i.open),...r,ref:o,onClick:qe(e.onClick,i.onOpenToggle)})});Bk.displayName=Uk;var Gv="DialogPortal",[TF,$k]=Fk(Gv,{forceMount:void 0}),Hk=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Or(Gv,t);return S.jsx(TF,{scope:t,forceMount:n,children:E.Children.map(r,l=>S.jsx(Kn,{present:n||o.open,children:S.jsx(Jf,{asChild:!0,container:i,children:l})}))})};Hk.displayName=Gv;var wf="DialogOverlay",Vk=E.forwardRef((e,t)=>{const n=$k(wf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Or(wf,e.__scopeDialog);return o.modal?S.jsx(Kn,{present:r||o.open,children:S.jsx(AF,{...i,ref:t})}):null});Vk.displayName=wf;var AF=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(wf,n);return S.jsx(td,{as:ua,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(We.div,{"data-state":Bv(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Xa="DialogContent",qk=E.forwardRef((e,t)=>{const n=$k(Xa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Or(Xa,e.__scopeDialog);return S.jsx(Kn,{present:r||o.open,children:o.modal?S.jsx(RF,{...i,ref:t}):S.jsx(DF,{...i,ref:t})})});qk.displayName=Xa;var RF=E.forwardRef((e,t)=>{const n=Or(Xa,e.__scopeDialog),r=E.useRef(null),i=dt(t,n.contentRef,r);return E.useEffect(()=>{const o=r.current;if(o)return Fv(o)},[]),S.jsx(Yk,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qe(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:qe(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:qe(e.onFocusOutside,o=>o.preventDefault())})}),DF=E.forwardRef((e,t)=>{const n=Or(Xa,e.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(Yk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var f,d;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Yk=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=Or(Xa,n),f=E.useRef(null),d=dt(t,f);return Pv(),S.jsxs(S.Fragment,{children:[S.jsx(Qf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(ou,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Bv(u.open),...l,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(OF,{titleId:u.titleId}),S.jsx(LF,{contentRef:f,descriptionId:u.descriptionId})]})]})}),Uv="DialogTitle",Wk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Uv,n);return S.jsx(We.h2,{id:i.titleId,...r,ref:t})});Wk.displayName=Uv;var Xk="DialogDescription",Kk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Xk,n);return S.jsx(We.p,{id:i.descriptionId,...r,ref:t})});Kk.displayName=Xk;var Zk="DialogClose",Qk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Zk,n);return S.jsx(We.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,()=>i.onOpenChange(!1))})});Qk.displayName=Zk;function Bv(e){return e?"open":"closed"}var Jk="DialogTitleWarning",[NF,eC]=dP(Jk,{contentName:Xa,titleName:Uv,docsSlug:"dialog"}),OF=({titleId:e})=>{const t=eC(Jk),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 E.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jF="DialogDescriptionWarning",LF=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${eC(jF).contentName}}.`;return E.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},$v=Gk,tC=Bk,Hv=Hk,nd=Vk,rd=qk,Vv=Wk,qv=Kk,Yv=Qk,nC="AlertDialog",[zF,fK]=dr(nC,[Ik]),Ti=Ik(),rC=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ti(t);return S.jsx($v,{...r,...n,modal:!0})};rC.displayName=nC;var MF="AlertDialogTrigger",PF=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(tC,{...i,...r,ref:t})});PF.displayName=MF;var FF="AlertDialogPortal",iC=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ti(t);return S.jsx(Hv,{...r,...n})};iC.displayName=FF;var IF="AlertDialogOverlay",aC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(nd,{...i,...r,ref:t})});aC.displayName=IF;var ns="AlertDialogContent",[GF,UF]=zF(ns),oC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Ti(n),l=E.useRef(null),u=dt(t,l),f=E.useRef(null);return S.jsx(NF,{contentName:ns,titleName:sC,docsSlug:"alert-dialog",children:S.jsx(GF,{scope:n,cancelRef:f,children:S.jsxs(rd,{role:"alertdialog",...o,...i,ref:u,onOpenAutoFocus:qe(i.onOpenAutoFocus,d=>{var p;d.preventDefault(),(p=f.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[S.jsx(Mv,{children:r}),S.jsx($F,{contentRef:l})]})})})});oC.displayName=ns;var sC="AlertDialogTitle",lC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(Vv,{...i,...r,ref:t})});lC.displayName=sC;var uC="AlertDialogDescription",cC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(qv,{...i,...r,ref:t})});cC.displayName=uC;var BF="AlertDialogAction",fC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(Yv,{...i,...r,ref:t})});fC.displayName=BF;var dC="AlertDialogCancel",hC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=UF(dC,n),o=Ti(n),l=dt(t,i);return S.jsx(Yv,{...o,...r,ref:l})});hC.displayName=dC;var $F=({contentRef:e})=>{const t=`\`${ns}\` requires a description for the component to be accessible for screen reader users.
You can add a description to the \`${ns}\` by passing a \`${uC}\` 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 \`${ns}\`. 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 E.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},HF=rC,VF=iC,pC=aC,mC=oC,gC=fC,vC=hC,yC=lC,bC=cC;const qF=["top","right","bottom","left"],ca=Math.min,qn=Math.max,Sf=Math.round,Lc=Math.floor,Hr=e=>({x:e,y:e}),YF={left:"right",right:"left",bottom:"top",top:"bottom"},WF={start:"end",end:"start"};function jg(e,t,n){return qn(e,ca(t,n))}function ki(e,t){return typeof e=="function"?e(t):e}function Ci(e){return e.split("-")[0]}function bs(e){return e.split("-")[1]}function Wv(e){return e==="x"?"y":"x"}function Xv(e){return e==="y"?"height":"width"}function fa(e){return["top","bottom"].includes(Ci(e))?"y":"x"}function Kv(e){return Wv(fa(e))}function XF(e,t,n){n===void 0&&(n=!1);const r=bs(e),i=Kv(e),o=Xv(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Ef(l)),[l,Ef(l)]}function KF(e){const t=Ef(e);return[Lg(e),t,Lg(t)]}function Lg(e){return e.replace(/start|end/g,t=>WF[t])}function ZF(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:l;default:return[]}}function QF(e,t,n,r){const i=bs(e);let o=ZF(Ci(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Lg)))),o}function Ef(e){return e.replace(/left|right|bottom|top/g,t=>YF[t])}function JF(e){return{top:0,right:0,bottom:0,left:0,...e}}function xC(e){return typeof e!="number"?JF(e):{top:e,right:e,bottom:e,left:e}}function _f(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function N1(e,t,n){let{reference:r,floating:i}=e;const o=fa(t),l=Kv(t),u=Xv(l),f=Ci(t),d=o==="y",p=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,v=r[u]/2-i[u]/2;let g;switch(f){case"top":g={x:p,y:r.y-i.height};break;case"bottom":g={x:p,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:m};break;case"left":g={x:r.x-i.width,y:m};break;default:g={x:r.x,y:r.y}}switch(bs(t)){case"start":g[l]-=v*(n&&d?-1:1);break;case"end":g[l]+=v*(n&&d?-1:1);break}return g}const e4=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,u=o.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:m}=N1(d,r,f),v=r,g={},w=0;for(let x=0;x<u.length;x++){const{name:k,fn:C}=u[x],{x:_,y:T,data:N,reset:D}=await C({x:p,y:m,initialPlacement:r,placement:v,strategy:i,middlewareData:g,rects:d,platform:l,elements:{reference:e,floating:t}});p=_??p,m=T??m,g={...g,[k]:{...g[k],...N}},D&&w<=50&&(w++,typeof D=="object"&&(D.placement&&(v=D.placement),D.rects&&(d=D.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):D.rects),{x:p,y:m}=N1(d,v,f)),x=-1)}return{x:p,y:m,placement:v,strategy:i,middlewareData:g}};async function ql(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:l,elements:u,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:v=!1,padding:g=0}=ki(t,e),w=xC(g),k=u[v?m==="floating"?"reference":"floating":m],C=_f(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(k)))==null||n?k:k.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:d,rootBoundary:p,strategy:f})),_=m==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),N=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},D=_f(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:_,offsetParent:T,strategy:f}):_);return{top:(C.top-D.top+w.top)/N.y,bottom:(D.bottom-C.bottom+w.bottom)/N.y,left:(C.left-D.left+w.left)/N.x,right:(D.right-C.right+w.right)/N.x}}const t4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:u,middlewareData:f}=t,{element:d,padding:p=0}=ki(e,t)||{};if(d==null)return{};const m=xC(p),v={x:n,y:r},g=Kv(i),w=Xv(g),x=await l.getDimensions(d),k=g==="y",C=k?"top":"left",_=k?"bottom":"right",T=k?"clientHeight":"clientWidth",N=o.reference[w]+o.reference[g]-v[g]-o.floating[w],D=v[g]-o.reference[g],L=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let R=L?L[T]:0;(!R||!await(l.isElement==null?void 0:l.isElement(L)))&&(R=u.floating[T]||o.floating[w]);const U=N/2-D/2,P=R/2-x[w]/2-1,z=ca(m[C],P),V=ca(m[_],P),q=z,I=R-x[w]-V,Y=R/2-x[w]/2+U,Z=jg(q,Y,I),B=!f.arrow&&bs(i)!=null&&Y!==Z&&o.reference[w]/2-(Y<q?z:V)-x[w]/2<0,G=B?Y<q?Y-q:Y-I:0;return{[g]:v[g]+G,data:{[g]:Z,centerOffset:Y-Z-G,...B&&{alignmentOffset:G}},reset:B}}}),n4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:u,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:v,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:x=!0,...k}=ki(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=Ci(i),_=fa(u),T=Ci(u)===u,N=await(f.isRTL==null?void 0:f.isRTL(d.floating)),D=v||(T||!x?[Ef(u)]:KF(u)),L=w!=="none";!v&&L&&D.push(...QF(u,x,w,N));const R=[u,...D],U=await ql(t,k),P=[];let z=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&P.push(U[C]),m){const Y=XF(i,l,N);P.push(U[Y[0]],U[Y[1]])}if(z=[...z,{placement:i,overflows:P}],!P.every(Y=>Y<=0)){var V,q;const Y=(((V=o.flip)==null?void 0:V.index)||0)+1,Z=R[Y];if(Z)return{data:{index:Y,overflows:z},reset:{placement:Z}};let B=(q=z.filter(G=>G.overflows[0]<=0).sort((G,F)=>G.overflows[1]-F.overflows[1])[0])==null?void 0:q.placement;if(!B)switch(g){case"bestFit":{var I;const G=(I=z.filter(F=>{if(L){const K=fa(F.placement);return K===_||K==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(K=>K>0).reduce((K,A)=>K+A,0)]).sort((F,K)=>F[1]-K[1])[0])==null?void 0:I[0];G&&(B=G);break}case"initialPlacement":B=u;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function O1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function j1(e){return qF.some(t=>e[t]>=0)}const r4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ki(e,t);switch(r){case"referenceHidden":{const o=await ql(t,{...i,elementContext:"reference"}),l=O1(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:j1(l)}}}case"escaped":{const o=await ql(t,{...i,altBoundary:!0}),l=O1(o,n.floating);return{data:{escapedOffsets:l,escaped:j1(l)}}}default:return{}}}}};async function i4(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Ci(n),u=bs(n),f=fa(n)==="y",d=["left","top"].includes(l)?-1:1,p=o&&f?-1:1,m=ki(t,e);let{mainAxis:v,crossAxis:g,alignmentAxis:w}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof w=="number"&&(g=u==="end"?w*-1:w),f?{x:g*p,y:v*d}:{x:v*d,y:g*p}}const a4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:u}=t,f=await i4(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:l}}}}},o4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:k=>{let{x:C,y:_}=k;return{x:C,y:_}}},...f}=ki(e,t),d={x:n,y:r},p=await ql(t,f),m=fa(Ci(i)),v=Wv(m);let g=d[v],w=d[m];if(o){const k=v==="y"?"top":"left",C=v==="y"?"bottom":"right",_=g+p[k],T=g-p[C];g=jg(_,g,T)}if(l){const k=m==="y"?"top":"left",C=m==="y"?"bottom":"right",_=w+p[k],T=w-p[C];w=jg(_,w,T)}const x=u.fn({...t,[v]:g,[m]:w});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:o,[m]:l}}}}}},s4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:f=!0,crossAxis:d=!0}=ki(e,t),p={x:n,y:r},m=fa(i),v=Wv(m);let g=p[v],w=p[m];const x=ki(u,t),k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const T=v==="y"?"height":"width",N=o.reference[v]-o.floating[T]+k.mainAxis,D=o.reference[v]+o.reference[T]-k.mainAxis;g<N?g=N:g>D&&(g=D)}if(d){var C,_;const T=v==="y"?"width":"height",N=["top","left"].includes(Ci(i)),D=o.reference[m]-o.floating[T]+(N&&((C=l.offset)==null?void 0:C[m])||0)+(N?0:k.crossAxis),L=o.reference[m]+o.reference[T]+(N?0:((_=l.offset)==null?void 0:_[m])||0)-(N?k.crossAxis:0);w<D?w=D:w>L&&(w=L)}return{[v]:g,[m]:w}}}},l4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:u}=t,{apply:f=()=>{},...d}=ki(e,t),p=await ql(t,d),m=Ci(i),v=bs(i),g=fa(i)==="y",{width:w,height:x}=o.floating;let k,C;m==="top"||m==="bottom"?(k=m,C=v===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(C=m,k=v==="end"?"top":"bottom");const _=x-p.top-p.bottom,T=w-p.left-p.right,N=ca(x-p[k],_),D=ca(w-p[C],T),L=!t.middlewareData.shift;let R=N,U=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(U=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=_),L&&!v){const z=qn(p.left,0),V=qn(p.right,0),q=qn(p.top,0),I=qn(p.bottom,0);g?U=w-2*(z!==0||V!==0?z+V:qn(p.left,p.right)):R=x-2*(q!==0||I!==0?q+I:qn(p.top,p.bottom))}await f({...t,availableWidth:U,availableHeight:R});const P=await l.getDimensions(u.floating);return w!==P.width||x!==P.height?{reset:{rects:!0}}:{}}}};function id(){return typeof window<"u"}function xs(e){return wC(e)?(e.nodeName||"").toLowerCase():"#document"}function Wn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qr(e){var t;return(t=(wC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wC(e){return id()?e instanceof Node||e instanceof Wn(e).Node:!1}function Ar(e){return id()?e instanceof Element||e instanceof Wn(e).Element:!1}function Vr(e){return id()?e instanceof HTMLElement||e instanceof Wn(e).HTMLElement:!1}function L1(e){return!id()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wn(e).ShadowRoot}function su(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Rr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function u4(e){return["table","td","th"].includes(xs(e))}function ad(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Zv(e){const t=Qv(),n=Ar(e)?Rr(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="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(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function c4(e){let t=da(e);for(;Vr(t)&&!ss(t);){if(Zv(t))return t;if(ad(t))return null;t=da(t)}return null}function Qv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ss(e){return["html","body","#document"].includes(xs(e))}function Rr(e){return Wn(e).getComputedStyle(e)}function od(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function da(e){if(xs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||L1(e)&&e.host||qr(e);return L1(t)?t.host:t}function SC(e){const t=da(e);return ss(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vr(t)&&su(t)?t:SC(t)}function Yl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=SC(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=Wn(i);if(o){const u=zg(l);return t.concat(l,l.visualViewport||[],su(i)?i:[],u&&n?Yl(u):[])}return t.concat(i,Yl(i,[],n))}function zg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function EC(e){const t=Rr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Vr(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,u=Sf(n)!==o||Sf(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function Jv(e){return Ar(e)?e:e.contextElement}function rs(e){const t=Jv(e);if(!Vr(t))return Hr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=EC(t);let l=(o?Sf(n.width):n.width)/r,u=(o?Sf(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const f4=Hr(0);function _C(e){const t=Wn(e);return!Qv()||!t.visualViewport?f4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function d4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wn(e)?!1:t}function Ka(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Jv(e);let l=Hr(1);t&&(r?Ar(r)&&(l=rs(r)):l=rs(e));const u=d4(o,n,r)?_C(o):Hr(0);let f=(i.left+u.x)/l.x,d=(i.top+u.y)/l.y,p=i.width/l.x,m=i.height/l.y;if(o){const v=Wn(o),g=r&&Ar(r)?Wn(r):r;let w=v,x=zg(w);for(;x&&r&&g!==w;){const k=rs(x),C=x.getBoundingClientRect(),_=Rr(x),T=C.left+(x.clientLeft+parseFloat(_.paddingLeft))*k.x,N=C.top+(x.clientTop+parseFloat(_.paddingTop))*k.y;f*=k.x,d*=k.y,p*=k.x,m*=k.y,f+=T,d+=N,w=Wn(x),x=zg(w)}}return _f({width:p,height:m,x:f,y:d})}function ey(e,t){const n=od(e).scrollLeft;return t?t.left+n:Ka(qr(e)).left+n}function kC(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:ey(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function h4(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=qr(r),u=t?ad(t.floating):!1;if(r===l||u&&o)return n;let f={scrollLeft:0,scrollTop:0},d=Hr(1);const p=Hr(0),m=Vr(r);if((m||!m&&!o)&&((xs(r)!=="body"||su(l))&&(f=od(r)),Vr(r))){const g=Ka(r);d=rs(r),p.x=g.x+r.clientLeft,p.y=g.y+r.clientTop}const v=l&&!m&&!o?kC(l,f,!0):Hr(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+p.x+v.x,y:n.y*d.y-f.scrollTop*d.y+p.y+v.y}}function p4(e){return Array.from(e.getClientRects())}function m4(e){const t=qr(e),n=od(e),r=e.ownerDocument.body,i=qn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=qn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ey(e);const u=-n.scrollTop;return Rr(r).direction==="rtl"&&(l+=qn(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:u}}function g4(e,t){const n=Wn(e),r=qr(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,f=0;if(i){o=i.width,l=i.height;const d=Qv();(!d||d&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}return{width:o,height:l,x:u,y:f}}function v4(e,t){const n=Ka(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Vr(e)?rs(e):Hr(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,f=i*o.x,d=r*o.y;return{width:l,height:u,x:f,y:d}}function z1(e,t,n){let r;if(t==="viewport")r=g4(e,n);else if(t==="document")r=m4(qr(e));else if(Ar(t))r=v4(t,n);else{const i=_C(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return _f(r)}function CC(e,t){const n=da(e);return n===t||!Ar(n)||ss(n)?!1:Rr(n).position==="fixed"||CC(n,t)}function y4(e,t){const n=t.get(e);if(n)return n;let r=Yl(e,[],!1).filter(u=>Ar(u)&&xs(u)!=="body"),i=null;const o=Rr(e).position==="fixed";let l=o?da(e):e;for(;Ar(l)&&!ss(l);){const u=Rr(l),f=Zv(l);!f&&u.position==="fixed"&&(i=null),(o?!f&&!i:!f&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||su(l)&&!f&&CC(e,l))?r=r.filter(p=>p!==l):i=u,l=da(l)}return t.set(e,r),r}function b4(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?ad(t)?[]:y4(t,this._c):[].concat(n),r],u=l[0],f=l.reduce((d,p)=>{const m=z1(t,p,i);return d.top=qn(m.top,d.top),d.right=ca(m.right,d.right),d.bottom=ca(m.bottom,d.bottom),d.left=qn(m.left,d.left),d},z1(t,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function x4(e){const{width:t,height:n}=EC(e);return{width:t,height:n}}function w4(e,t,n){const r=Vr(t),i=qr(t),o=n==="fixed",l=Ka(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=Hr(0);if(r||!r&&!o)if((xs(t)!=="body"||su(i))&&(u=od(t)),r){const v=Ka(t,!0,o,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else i&&(f.x=ey(i));const d=i&&!r&&!o?kC(i,u):Hr(0),p=l.left+u.scrollLeft-f.x-d.x,m=l.top+u.scrollTop-f.y-d.y;return{x:p,y:m,width:l.width,height:l.height}}function rm(e){return Rr(e).position==="static"}function M1(e,t){if(!Vr(e)||Rr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qr(e)===n&&(n=n.ownerDocument.body),n}function TC(e,t){const n=Wn(e);if(ad(e))return n;if(!Vr(e)){let i=da(e);for(;i&&!ss(i);){if(Ar(i)&&!rm(i))return i;i=da(i)}return n}let r=M1(e,t);for(;r&&u4(r)&&rm(r);)r=M1(r,t);return r&&ss(r)&&rm(r)&&!Zv(r)?n:r||c4(e)||n}const S4=async function(e){const t=this.getOffsetParent||TC,n=this.getDimensions,r=await n(e.floating);return{reference:w4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function E4(e){return Rr(e).direction==="rtl"}const _4={convertOffsetParentRelativeRectToViewportRelativeRect:h4,getDocumentElement:qr,getClippingRect:b4,getOffsetParent:TC,getElementRects:S4,getClientRects:p4,getDimensions:x4,getScale:rs,isElement:Ar,isRTL:E4};function AC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function k4(e,t){let n=null,r;const i=qr(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const d=e.getBoundingClientRect(),{left:p,top:m,width:v,height:g}=d;if(u||t(),!v||!g)return;const w=Lc(m),x=Lc(i.clientWidth-(p+v)),k=Lc(i.clientHeight-(m+g)),C=Lc(p),T={rootMargin:-w+"px "+-x+"px "+-k+"px "+-C+"px",threshold:qn(0,ca(1,f))||1};let N=!0;function D(L){const R=L[0].intersectionRatio;if(R!==f){if(!N)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}R===1&&!AC(d,e.getBoundingClientRect())&&l(),N=!1}try{n=new IntersectionObserver(D,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,T)}n.observe(e)}return l(!0),o}function C4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=Jv(e),p=i||o?[...d?Yl(d):[],...Yl(t)]:[];p.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const m=d&&u?k4(d,n):null;let v=-1,g=null;l&&(g=new ResizeObserver(C=>{let[_]=C;_&&_.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var T;(T=g)==null||T.observe(t)})),n()}),d&&!f&&g.observe(d),g.observe(t));let w,x=f?Ka(e):null;f&&k();function k(){const C=Ka(e);x&&!AC(x,C)&&n(),x=C,w=requestAnimationFrame(k)}return n(),()=>{var C;p.forEach(_=>{i&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),m==null||m(),(C=g)==null||C.disconnect(),g=null,f&&cancelAnimationFrame(w)}}const T4=a4,A4=o4,R4=n4,D4=l4,N4=r4,P1=t4,O4=s4,j4=(e,t,n)=>{const r=new Map,i={platform:_4,...n},o={...i.platform,_c:r};return e4(e,t,{...i,platform:o})};var sf=typeof document<"u"?E.useLayoutEffect:E.useEffect;function kf(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,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!kf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!kf(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function RC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function F1(e,t){const n=RC(e);return Math.round(t*n)/n}function im(e){const t=E.useRef(e);return sf(()=>{t.current=e}),t}function L4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:f,open:d}=e,[p,m]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,g]=E.useState(r);kf(v,r)||g(r);const[w,x]=E.useState(null),[k,C]=E.useState(null),_=E.useCallback(F=>{F!==L.current&&(L.current=F,x(F))},[]),T=E.useCallback(F=>{F!==R.current&&(R.current=F,C(F))},[]),N=o||w,D=l||k,L=E.useRef(null),R=E.useRef(null),U=E.useRef(p),P=f!=null,z=im(f),V=im(i),q=im(d),I=E.useCallback(()=>{if(!L.current||!R.current)return;const F={placement:t,strategy:n,middleware:v};V.current&&(F.platform=V.current),j4(L.current,R.current,F).then(K=>{const A={...K,isPositioned:q.current!==!1};Y.current&&!kf(U.current,A)&&(U.current=A,au.flushSync(()=>{m(A)}))})},[v,t,n,V,q]);sf(()=>{d===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[d]);const Y=E.useRef(!1);sf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),sf(()=>{if(N&&(L.current=N),D&&(R.current=D),N&&D){if(z.current)return z.current(N,D,I);I()}},[N,D,I,z,P]);const Z=E.useMemo(()=>({reference:L,floating:R,setReference:_,setFloating:T}),[_,T]),B=E.useMemo(()=>({reference:N,floating:D}),[N,D]),G=E.useMemo(()=>{const F={position:n,left:0,top:0};if(!B.floating)return F;const K=F1(B.floating,p.x),A=F1(B.floating,p.y);return u?{...F,transform:"translate("+K+"px, "+A+"px)",...RC(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:A}},[n,u,B.floating,p.x,p.y]);return E.useMemo(()=>({...p,update:I,refs:Z,elements:B,floatingStyles:G}),[p,I,Z,B,G])}const z4=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?P1({element:r.current,padding:i}).fn(n):{}:r?P1({element:r,padding:i}).fn(n):{}}}},M4=(e,t)=>({...T4(e),options:[e,t]}),P4=(e,t)=>({...A4(e),options:[e,t]}),F4=(e,t)=>({...O4(e),options:[e,t]}),I4=(e,t)=>({...R4(e),options:[e,t]}),G4=(e,t)=>({...D4(e),options:[e,t]}),U4=(e,t)=>({...N4(e),options:[e,t]}),B4=(e,t)=>({...z4(e),options:[e,t]});var $4="Arrow",DC=E.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return S.jsx(We.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});DC.displayName=$4;var H4=DC;function NC(e){const[t,n]=E.useState(void 0);return xn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,u;if("borderBoxSize"in o){const f=o.borderBoxSize,d=Array.isArray(f)?f[0]:f;l=d.inlineSize,u=d.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ty="Popper",[OC,ws]=dr(ty),[V4,jC]=OC(ty),LC=e=>{const{__scopePopper:t,children:n}=e,[r,i]=E.useState(null);return S.jsx(V4,{scope:t,anchor:r,onAnchorChange:i,children:n})};LC.displayName=ty;var zC="PopperAnchor",MC=E.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=jC(zC,n),l=E.useRef(null),u=dt(t,l);return E.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:S.jsx(We.div,{...i,ref:u})});MC.displayName=zC;var ny="PopperContent",[q4,Y4]=OC(ny),PC=E.forwardRef((e,t)=>{var ae,oe,Ce,he,Ee,we;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:v=!1,updatePositionStrategy:g="optimized",onPlaced:w,...x}=e,k=jC(ny,n),[C,_]=E.useState(null),T=dt(t,Pe=>_(Pe)),[N,D]=E.useState(null),L=NC(N),R=(L==null?void 0:L.width)??0,U=(L==null?void 0:L.height)??0,P=r+(o!=="center"?"-"+o:""),z=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},V=Array.isArray(d)?d:[d],q=V.length>0,I={padding:z,boundary:V.filter(X4),altBoundary:q},{refs:Y,floatingStyles:Z,placement:B,isPositioned:G,middlewareData:F}=L4({strategy:"fixed",placement:P,whileElementsMounted:(...Pe)=>C4(...Pe,{animationFrame:g==="always"}),elements:{reference:k.anchor},middleware:[M4({mainAxis:i+U,alignmentAxis:l}),f&&P4({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?F4():void 0,...I}),f&&I4({...I}),G4({...I,apply:({elements:Pe,rects:Ae,availableWidth:xe,availableHeight:ee})=>{const{width:ce,height:Te}=Ae.reference,ge=Pe.floating.style;ge.setProperty("--radix-popper-available-width",`${xe}px`),ge.setProperty("--radix-popper-available-height",`${ee}px`),ge.setProperty("--radix-popper-anchor-width",`${ce}px`),ge.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),N&&B4({element:N,padding:u}),K4({arrowWidth:R,arrowHeight:U}),v&&U4({strategy:"referenceHidden",...I})]}),[K,A]=GC(B),H=un(w);xn(()=>{G&&(H==null||H())},[G,H]);const M=(ae=F.arrow)==null?void 0:ae.x,O=(oe=F.arrow)==null?void 0:oe.y,X=((Ce=F.arrow)==null?void 0:Ce.centerOffset)!==0,[re,ue]=E.useState();return xn(()=>{C&&ue(window.getComputedStyle(C).zIndex)},[C]),S.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:G?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(he=F.transformOrigin)==null?void 0:he.x,(Ee=F.transformOrigin)==null?void 0:Ee.y].join(" "),...((we=F.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(q4,{scope:n,placedSide:K,onArrowChange:D,arrowX:M,arrowY:O,shouldHideArrow:X,children:S.jsx(We.div,{"data-side":K,"data-align":A,...x,ref:T,style:{...x.style,animation:G?void 0:"none"}})})})});PC.displayName=ny;var FC="PopperArrow",W4={top:"bottom",right:"left",bottom:"top",left:"right"},IC=E.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Y4(FC,r),l=W4[o.placedSide];return S.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:S.jsx(H4,{...i,ref:n,style:{...i.style,display:"block"}})})});IC.displayName=FC;function X4(e){return e!==null}var K4=e=>({name:"transformOrigin",options:e,fn(t){var k,C,_;const{placement:n,rects:r,middlewareData:i}=t,l=((k=i.arrow)==null?void 0:k.centerOffset)!==0,u=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[d,p]=GC(n),m={start:"0%",center:"50%",end:"100%"}[p],v=(((C=i.arrow)==null?void 0:C.x)??0)+u/2,g=(((_=i.arrow)==null?void 0:_.y)??0)+f/2;let w="",x="";return d==="bottom"?(w=l?m:`${v}px`,x=`${-f}px`):d==="top"?(w=l?m:`${v}px`,x=`${r.floating.height+f}px`):d==="right"?(w=`${-f}px`,x=l?m:`${g}px`):d==="left"&&(w=`${r.floating.width+f}px`,x=l?m:`${g}px`),{data:{x:w,y:x}}}});function GC(e){const[t,n="center"]=e.split("-");return[t,n]}var ry=LC,sd=MC,iy=PC,ay=IC,Z4="VisuallyHidden",oy=E.forwardRef((e,t)=>S.jsx(We.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}}));oy.displayName=Z4;var Q4=oy,[ld,dK]=dr("Tooltip",[ws]),ud=ws(),UC="TooltipProvider",J4=700,Mg="tooltip.open",[eI,sy]=ld(UC),BC=e=>{const{__scopeTooltip:t,delayDuration:n=J4,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[l,u]=E.useState(!0),f=E.useRef(!1),d=E.useRef(0);return E.useEffect(()=>{const p=d.current;return()=>window.clearTimeout(p)},[]),S.jsx(eI,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(d.current),u(!1)},[]),onClose:E.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:f,onPointerInTransitChange:E.useCallback(p=>{f.current=p},[]),disableHoverableContent:i,children:o})};BC.displayName=UC;var cd="Tooltip",[tI,fd]=ld(cd),$C=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:l,delayDuration:u}=e,f=sy(cd,e.__scopeTooltip),d=ud(t),[p,m]=E.useState(null),v=bn(),g=E.useRef(0),w=l??f.disableHoverableContent,x=u??f.delayDuration,k=E.useRef(!1),[C=!1,_]=_i({prop:r,defaultProp:i,onChange:R=>{R?(f.onOpen(),document.dispatchEvent(new CustomEvent(Mg))):f.onClose(),o==null||o(R)}}),T=E.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),N=E.useCallback(()=>{window.clearTimeout(g.current),g.current=0,k.current=!1,_(!0)},[_]),D=E.useCallback(()=>{window.clearTimeout(g.current),g.current=0,_(!1)},[_]),L=E.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{k.current=!0,_(!0),g.current=0},x)},[x,_]);return E.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),S.jsx(ry,{...d,children:S.jsx(tI,{scope:t,contentId:v,open:C,stateAttribute:T,trigger:p,onTriggerChange:m,onTriggerEnter:E.useCallback(()=>{f.isOpenDelayed?L():N()},[f.isOpenDelayed,L,N]),onTriggerLeave:E.useCallback(()=>{w?D():(window.clearTimeout(g.current),g.current=0)},[D,w]),onOpen:N,onClose:D,disableHoverableContent:w,children:n})})};$C.displayName=cd;var Pg="TooltipTrigger",HC=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=fd(Pg,n),o=sy(Pg,n),l=ud(n),u=E.useRef(null),f=dt(t,u,i.onTriggerChange),d=E.useRef(!1),p=E.useRef(!1),m=E.useCallback(()=>d.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),S.jsx(sd,{asChild:!0,...l,children:S.jsx(We.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:f,onPointerMove:qe(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:qe(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:qe(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:qe(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:qe(e.onBlur,i.onClose),onClick:qe(e.onClick,i.onClose)})})});HC.displayName=Pg;var nI="TooltipPortal",[hK,rI]=ld(nI,{forceMount:void 0}),ls="TooltipContent",VC=E.forwardRef((e,t)=>{const n=rI(ls,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,l=fd(ls,e.__scopeTooltip);return S.jsx(Kn,{present:r||l.open,children:l.disableHoverableContent?S.jsx(qC,{side:i,...o,ref:t}):S.jsx(iI,{side:i,...o,ref:t})})}),iI=E.forwardRef((e,t)=>{const n=fd(ls,e.__scopeTooltip),r=sy(ls,e.__scopeTooltip),i=E.useRef(null),o=dt(t,i),[l,u]=E.useState(null),{trigger:f,onClose:d}=n,p=i.current,{onPointerInTransitChange:m}=r,v=E.useCallback(()=>{u(null),m(!1)},[m]),g=E.useCallback((w,x)=>{const k=w.currentTarget,C={x:w.clientX,y:w.clientY},_=lI(C,k.getBoundingClientRect()),T=uI(C,_),N=cI(x.getBoundingClientRect()),D=dI([...T,...N]);u(D),m(!0)},[m]);return E.useEffect(()=>()=>v(),[v]),E.useEffect(()=>{if(f&&p){const w=k=>g(k,p),x=k=>g(k,f);return f.addEventListener("pointerleave",w),p.addEventListener("pointerleave",x),()=>{f.removeEventListener("pointerleave",w),p.removeEventListener("pointerleave",x)}}},[f,p,g,v]),E.useEffect(()=>{if(l){const w=x=>{const k=x.target,C={x:x.clientX,y:x.clientY},_=(f==null?void 0:f.contains(k))||(p==null?void 0:p.contains(k)),T=!fI(C,l);_?v():T&&(v(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[f,p,l,d,v]),S.jsx(qC,{...e,ref:o})}),[aI,oI]=ld(cd,{isInside:!1}),qC=E.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:l,...u}=e,f=fd(ls,n),d=ud(n),{onClose:p}=f;return E.useEffect(()=>(document.addEventListener(Mg,p),()=>document.removeEventListener(Mg,p)),[p]),E.useEffect(()=>{if(f.trigger){const m=v=>{const g=v.target;g!=null&&g.contains(f.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[f.trigger,p]),S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:S.jsxs(iy,{"data-state":f.stateAttribute,...d,...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:[S.jsx(Mv,{children:r}),S.jsx(aI,{scope:n,isInside:!0,children:S.jsx(Q4,{id:f.contentId,role:"tooltip",children:i||r})})]})})});VC.displayName=ls;var YC="TooltipArrow",sI=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ud(n);return oI(YC,n).isInside?null:S.jsx(ay,{...i,...r,ref:t})});sI.displayName=YC;function lI(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function uI(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function cI(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function fI(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o].x,f=t[o].y,d=t[l].x,p=t[l].y;f>r!=p>r&&n<(d-u)*(r-f)/(p-f)+u&&(i=!i)}return i}function dI(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),hI(t)}function hI(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}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 pI=BC,mI=$C,gI=HC,WC=VC;const XC=pI,KC=mI,ZC=gI,vI=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>S.jsxs(E.Fragment,{children:[t,n<e.split("\\n").length-1&&S.jsx("br",{})]},n)),ly=E.forwardRef(({className:e,sideOffset:t=4,children:n,...r},i)=>S.jsx(WC,{ref:i,sideOffset:t,className:Me("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),...r,children:typeof n=="string"?vI(n):n}));ly.displayName=WC.displayName;const Cf=$_("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"}}),Ot=E.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:i="right",asChild:o=!1,...l},u)=>{const f=o?ua:"button";return n?S.jsx(XC,{children:S.jsxs(KC,{children:[S.jsx(ZC,{asChild:!0,children:S.jsx(f,{className:Me(Cf({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})}),S.jsx(ly,{side:i,children:n})]})}):S.jsx(f,{className:Me(Cf({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})});Ot.displayName="Button";const yI=HF,bI=VF,QC=E.forwardRef(({className:e,...t},n)=>S.jsx(pC,{className:Me("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}));QC.displayName=pC.displayName;const JC=E.forwardRef(({className:e,...t},n)=>S.jsxs(bI,{children:[S.jsx(QC,{}),S.jsx(mC,{ref:n,className:Me("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})]}));JC.displayName=mC.displayName;const eT=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});eT.displayName="AlertDialogHeader";const tT=E.forwardRef(({className:e,...t},n)=>S.jsx(yC,{ref:n,className:Me("text-lg font-semibold",e),...t}));tT.displayName=yC.displayName;const nT=E.forwardRef(({className:e,...t},n)=>S.jsx(bC,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));nT.displayName=bC.displayName;const xI=E.forwardRef(({className:e,...t},n)=>S.jsx(gC,{ref:n,className:Me(Cf(),e),...t}));xI.displayName=gC.displayName;const wI=E.forwardRef(({className:e,...t},n)=>S.jsx(vC,{ref:n,className:Me(Cf({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));wI.displayName=vC.displayName;const Za=E.forwardRef(({className:e,type:t,...n},r)=>S.jsx("input",{type:t,className:Me("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:r,...n}));Za.displayName="Input";var SI=e=>{switch(e){case"success":return kI;case"info":return TI;case"warning":return CI;case"error":return AI;default:return null}},EI=Array(12).fill(0),_I=({visible:e,className:t})=>be.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},be.createElement("div",{className:"sonner-spinner"},EI.map((n,r)=>be.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),kI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),CI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},be.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"})),TI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),AI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),RI=be.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"},be.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),be.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),DI=()=>{let[e,t]=be.useState(document.hidden);return be.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Fg=1,NI=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,...r}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Fg++,o=this.toasts.find(u=>u.id===i),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...e,id:i,title:n}),{...u,...e,id:i,dismissible:l,title:n}):u):this.addToast({title:n,...r,dismissible:l,id:i}),i},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 r=e instanceof Promise?e:e(),i=n!==void 0,o,l=r.then(async f=>{if(o=["resolve",f],be.isValidElement(f))i=!1,this.create({id:n,type:"default",message:f});else if(jI(f)&&!f.ok){i=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description;this.create({id:n,type:"error",message:d,description:p})}else if(t.success!==void 0){i=!1;let d=typeof t.success=="function"?await t.success(f):t.success,p=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"success",message:d,description:p})}}).catch(async f=>{if(o=["reject",f],t.error!==void 0){i=!1;let d=typeof t.error=="function"?await t.error(f):t.error,p=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"error",message:d,description:p})}}).finally(()=>{var f;i&&(this.dismiss(n),n=void 0),(f=t.finally)==null||f.call(t)}),u=()=>new Promise((f,d)=>l.then(()=>o[0]==="reject"?d(o[1]):f(o[1])).catch(d));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)||Fg++;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}},Ln=new NI,OI=(e,t)=>{let n=(t==null?void 0:t.id)||Fg++;return Ln.addToast({title:e,...t,id:n}),n},jI=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",LI=OI,zI=()=>Ln.toasts,MI=()=>Ln.getActiveToasts(),vn=Object.assign(LI,{success:Ln.success,info:Ln.info,warning:Ln.warning,error:Ln.error,custom:Ln.custom,message:Ln.message,promise:Ln.promise,dismiss:Ln.dismiss,loading:Ln.loading},{getHistory:zI,getToasts:MI});function PI(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}PI(`: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 zc(e){return e.label!==void 0}var FI=3,II="32px",GI="16px",I1=4e3,UI=356,BI=14,$I=20,HI=200;function wr(...e){return e.filter(Boolean).join(" ")}function VI(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var qI=e=>{var t,n,r,i,o,l,u,f,d,p,m;let{invert:v,toast:g,unstyled:w,interacting:x,setHeights:k,visibleToasts:C,heights:_,index:T,toasts:N,expanded:D,removeToast:L,defaultRichColors:R,closeButton:U,style:P,cancelButtonStyle:z,actionButtonStyle:V,className:q="",descriptionClassName:I="",duration:Y,position:Z,gap:B,loadingIcon:G,expandByDefault:F,classNames:K,icons:A,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:M}=e,[O,X]=be.useState(null),[re,ue]=be.useState(null),[ae,oe]=be.useState(!1),[Ce,he]=be.useState(!1),[Ee,we]=be.useState(!1),[Pe,Ae]=be.useState(!1),[xe,ee]=be.useState(!1),[ce,Te]=be.useState(0),[ge,Se]=be.useState(0),ie=be.useRef(g.duration||Y||I1),$e=be.useRef(null),Ge=be.useRef(null),ve=T===0,Ne=T+1<=C,te=g.type,de=g.dismissible!==!1,Oe=g.className||"",He=g.descriptionClassName||"",Ye=be.useMemo(()=>_.findIndex(Ze=>Ze.toastId===g.id)||0,[_,g.id]),vt=be.useMemo(()=>{var Ze;return(Ze=g.closeButton)!=null?Ze:U},[g.closeButton,U]),Mt=be.useMemo(()=>g.duration||Y||I1,[g.duration,Y]),bt=be.useRef(0),rt=be.useRef(0),qt=be.useRef(0),at=be.useRef(null),[At,rn]=Z.split("-"),io=be.useMemo(()=>_.reduce((Ze,gt,_t)=>_t>=Ye?Ze:Ze+gt.height,0),[_,Ye]),xu=DI(),ao=g.invert||v,Di=te==="loading";rt.current=be.useMemo(()=>Ye*B+io,[Ye,io]),be.useEffect(()=>{ie.current=Mt},[Mt]),be.useEffect(()=>{oe(!0)},[]),be.useEffect(()=>{let Ze=Ge.current;if(Ze){let gt=Ze.getBoundingClientRect().height;return Se(gt),k(_t=>[{toastId:g.id,height:gt,position:g.position},..._t]),()=>k(_t=>_t.filter(Cn=>Cn.toastId!==g.id))}},[k,g.id]),be.useLayoutEffect(()=>{if(!ae)return;let Ze=Ge.current,gt=Ze.style.height;Ze.style.height="auto";let _t=Ze.getBoundingClientRect().height;Ze.style.height=gt,Se(_t),k(Cn=>Cn.find(Sn=>Sn.toastId===g.id)?Cn.map(Sn=>Sn.toastId===g.id?{...Sn,height:_t}:Sn):[{toastId:g.id,height:_t,position:g.position},...Cn])},[ae,g.title,g.description,k,g.id]);let dn=be.useCallback(()=>{he(!0),Te(rt.current),k(Ze=>Ze.filter(gt=>gt.toastId!==g.id)),setTimeout(()=>{L(g)},HI)},[g,L,k,rt]);be.useEffect(()=>{if(g.promise&&te==="loading"||g.duration===1/0||g.type==="loading")return;let Ze;return D||x||M&&xu?(()=>{if(qt.current<bt.current){let gt=new Date().getTime()-bt.current;ie.current=ie.current-gt}qt.current=new Date().getTime()})():ie.current!==1/0&&(bt.current=new Date().getTime(),Ze=setTimeout(()=>{var gt;(gt=g.onAutoClose)==null||gt.call(g,g),dn()},ie.current)),()=>clearTimeout(Ze)},[D,x,g,te,M,xu,dn]),be.useEffect(()=>{g.delete&&dn()},[dn,g.delete]);function oo(){var Ze,gt,_t;return A!=null&&A.loading?be.createElement("div",{className:wr(K==null?void 0:K.loader,(Ze=g==null?void 0:g.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":te==="loading"},A.loading):G?be.createElement("div",{className:wr(K==null?void 0:K.loader,(gt=g==null?void 0:g.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":te==="loading"},G):be.createElement(_I,{className:wr(K==null?void 0:K.loader,(_t=g==null?void 0:g.classNames)==null?void 0:_t.loader),visible:te==="loading"})}return be.createElement("li",{tabIndex:0,ref:Ge,className:wr(q,Oe,K==null?void 0:K.toast,(t=g==null?void 0:g.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[te],(n=g==null?void 0:g.classNames)==null?void 0:n[te]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:R,"data-styled":!(g.jsx||g.unstyled||w),"data-mounted":ae,"data-promise":!!g.promise,"data-swiped":xe,"data-removed":Ce,"data-visible":Ne,"data-y-position":At,"data-x-position":rn,"data-index":T,"data-front":ve,"data-swiping":Ee,"data-dismissible":de,"data-type":te,"data-invert":ao,"data-swipe-out":Pe,"data-swipe-direction":re,"data-expanded":!!(D||F&&ae),style:{"--index":T,"--toasts-before":T,"--z-index":N.length-T,"--offset":`${Ce?ce:rt.current}px`,"--initial-height":F?"auto":`${ge}px`,...P,...g.style},onDragEnd:()=>{we(!1),X(null),at.current=null},onPointerDown:Ze=>{Di||!de||($e.current=new Date,Te(rt.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(we(!0),at.current={x:Ze.clientX,y:Ze.clientY}))},onPointerUp:()=>{var Ze,gt,_t,Cn;if(Pe||!de)return;at.current=null;let Sn=Number(((Ze=Ge.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tn=Number(((gt=Ge.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Zr=new Date().getTime()-((_t=$e.current)==null?void 0:_t.getTime()),An=O==="x"?Sn:Tn,gr=Math.abs(An)/Zr;if(Math.abs(An)>=$I||gr>.11){Te(rt.current),(Cn=g.onDismiss)==null||Cn.call(g,g),ue(O==="x"?Sn>0?"right":"left":Tn>0?"down":"up"),dn(),Ae(!0),ee(!1);return}we(!1),X(null)},onPointerMove:Ze=>{var gt,_t,Cn,Sn;if(!at.current||!de||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;let Tn=Ze.clientY-at.current.y,Zr=Ze.clientX-at.current.x,An=(_t=e.swipeDirections)!=null?_t:VI(Z);!O&&(Math.abs(Zr)>1||Math.abs(Tn)>1)&&X(Math.abs(Zr)>Math.abs(Tn)?"x":"y");let gr={x:0,y:0};O==="y"?(An.includes("top")||An.includes("bottom"))&&(An.includes("top")&&Tn<0||An.includes("bottom")&&Tn>0)&&(gr.y=Tn):O==="x"&&(An.includes("left")||An.includes("right"))&&(An.includes("left")&&Zr<0||An.includes("right")&&Zr>0)&&(gr.x=Zr),(Math.abs(gr.x)>0||Math.abs(gr.y)>0)&&ee(!0),(Cn=Ge.current)==null||Cn.style.setProperty("--swipe-amount-x",`${gr.x}px`),(Sn=Ge.current)==null||Sn.style.setProperty("--swipe-amount-y",`${gr.y}px`)}},vt&&!g.jsx?be.createElement("button",{"aria-label":H,"data-disabled":Di,"data-close-button":!0,onClick:Di||!de?()=>{}:()=>{var Ze;dn(),(Ze=g.onDismiss)==null||Ze.call(g,g)},className:wr(K==null?void 0:K.closeButton,(i=g==null?void 0:g.classNames)==null?void 0:i.closeButton)},(o=A==null?void 0:A.close)!=null?o:RI):null,g.jsx||E.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:be.createElement(be.Fragment,null,te||g.icon||g.promise?be.createElement("div",{"data-icon":"",className:wr(K==null?void 0:K.icon,(l=g==null?void 0:g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||oo():null,g.type!=="loading"?g.icon||(A==null?void 0:A[te])||SI(te):null):null,be.createElement("div",{"data-content":"",className:wr(K==null?void 0:K.content,(u=g==null?void 0:g.classNames)==null?void 0:u.content)},be.createElement("div",{"data-title":"",className:wr(K==null?void 0:K.title,(f=g==null?void 0:g.classNames)==null?void 0:f.title)},typeof g.title=="function"?g.title():g.title),g.description?be.createElement("div",{"data-description":"",className:wr(I,He,K==null?void 0:K.description,(d=g==null?void 0:g.classNames)==null?void 0:d.description)},typeof g.description=="function"?g.description():g.description):null),E.isValidElement(g.cancel)?g.cancel:g.cancel&&zc(g.cancel)?be.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||z,onClick:Ze=>{var gt,_t;zc(g.cancel)&&de&&((_t=(gt=g.cancel).onClick)==null||_t.call(gt,Ze),dn())},className:wr(K==null?void 0:K.cancelButton,(p=g==null?void 0:g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,E.isValidElement(g.action)?g.action:g.action&&zc(g.action)?be.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||V,onClick:Ze=>{var gt,_t;zc(g.action)&&((_t=(gt=g.action).onClick)==null||_t.call(gt,Ze),!Ze.defaultPrevented&&dn())},className:wr(K==null?void 0:K.actionButton,(m=g==null?void 0:g.classNames)==null?void 0:m.actionButton)},g.action.label):null))};function G1(){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 YI(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,l=o?"--mobile-offset":"--offset",u=o?GI:II;function f(d){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${l}-${d}`]=u:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):f(u)}),n}var WI=E.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:f,mobileOffset:d,theme:p="light",richColors:m,duration:v,style:g,visibleToasts:w=FI,toastOptions:x,dir:k=G1(),gap:C=BI,loadingIcon:_,icons:T,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:D}=e,[L,R]=be.useState([]),U=be.useMemo(()=>Array.from(new Set([r].concat(L.filter(M=>M.position).map(M=>M.position)))),[L,r]),[P,z]=be.useState([]),[V,q]=be.useState(!1),[I,Y]=be.useState(!1),[Z,B]=be.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=be.useRef(null),F=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=be.useRef(null),A=be.useRef(!1),H=be.useCallback(M=>{R(O=>{var X;return(X=O.find(re=>re.id===M.id))!=null&&X.delete||Ln.dismiss(M.id),O.filter(({id:re})=>re!==M.id)})},[]);return be.useEffect(()=>Ln.subscribe(M=>{if(M.dismiss){R(O=>O.map(X=>X.id===M.id?{...X,delete:!0}:X));return}setTimeout(()=>{Ck.flushSync(()=>{R(O=>{let X=O.findIndex(re=>re.id===M.id);return X!==-1?[...O.slice(0,X),{...O[X],...M},...O.slice(X+1)]:[M,...O]})})})}),[]),be.useEffect(()=>{if(p!=="system"){B(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:O})=>{B(O?"dark":"light")})}catch{M.addListener(({matches:X})=>{try{B(X?"dark":"light")}catch(re){console.error(re)}})}},[p]),be.useEffect(()=>{L.length<=1&&q(!1)},[L]),be.useEffect(()=>{let M=O=>{var X,re;i.every(ue=>O[ue]||O.code===ue)&&(q(!0),(X=G.current)==null||X.focus()),O.code==="Escape"&&(document.activeElement===G.current||(re=G.current)!=null&&re.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[i]),be.useEffect(()=>{if(G.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,A.current=!1)}},[G.current]),be.createElement("section",{ref:t,"aria-label":`${N} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((M,O)=>{var X;let[re,ue]=M.split("-");return L.length?be.createElement("ol",{key:M,dir:k==="auto"?G1():k,tabIndex:-1,ref:G,className:u,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":re,"data-lifted":V&&L.length>1&&!o,"data-x-position":ue,style:{"--front-toast-height":`${((X=P[0])==null?void 0:X.height)||0}px`,"--width":`${UI}px`,"--gap":`${C}px`,...g,...YI(f,d)},onBlur:ae=>{A.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(A.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||A.current||(A.current=!0,K.current=ae.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{I||q(!1)},onDragEnd:()=>q(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},L.filter(ae=>!ae.position&&O===0||ae.position===M).map((ae,oe)=>{var Ce,he;return be.createElement(qI,{key:ae.id,icons:T,index:oe,toast:ae,defaultRichColors:m,duration:(Ce=x==null?void 0:x.duration)!=null?Ce:v,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:n,visibleToasts:w,closeButton:(he=x==null?void 0:x.closeButton)!=null?he:l,interacting:I,position:M,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,removeToast:H,toasts:L.filter(Ee=>Ee.position==ae.position),heights:P.filter(Ee=>Ee.position==ae.position),setHeights:z,expandByDefault:o,gap:C,loadingIcon:_,expanded:V,pauseWhenPageIsHidden:D,swipeDirections:e.swipeDirections})})):null}))});const XI=()=>{const[e,t]=E.useState(!0),n=Qe.use.apiKey(),[r,i]=E.useState(""),o=Mn.use.message();E.useEffect(()=>{i(n||"")},[n,e]),E.useEffect(()=>{o&&(o.includes(yk)||o.includes(bk))&&t(!0)},[o,t]);const l=E.useCallback(async()=>{if(Qe.setState({apiKey:r||null}),await Mn.getState().check()){t(!1);return}vn.error("API Key is invalid")},[r]),u=E.useCallback(f=>{i(f.target.value)},[i]);return S.jsx(yI,{open:e,onOpenChange:t,children:S.jsxs(JC,{children:[S.jsxs(eT,{children:[S.jsx(tT,{children:"API Key is required"}),S.jsx(nT,{children:"Please enter your API key"})]}),S.jsxs("form",{className:"flex gap-2",onSubmit:f=>f.preventDefault(),children:[S.jsx(Za,{type:"password",value:r,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),S.jsx(Ot,{onClick:l,variant:"outline",size:"sm",children:"Save"})]})]})})};var uy="Popover",[rT,pK]=dr(uy,[ws]),lu=ws(),[KI,ha]=rT(uy),iT=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!1}=e,u=lu(t),f=E.useRef(null),[d,p]=E.useState(!1),[m=!1,v]=_i({prop:r,defaultProp:i,onChange:o});return S.jsx(ry,{...u,children:S.jsx(KI,{scope:t,contentId:bn(),triggerRef:f,open:m,onOpenChange:v,onOpenToggle:E.useCallback(()=>v(g=>!g),[v]),hasCustomAnchor:d,onCustomAnchorAdd:E.useCallback(()=>p(!0),[]),onCustomAnchorRemove:E.useCallback(()=>p(!1),[]),modal:l,children:n})})};iT.displayName=uy;var aT="PopoverAnchor",ZI=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(aT,n),o=lu(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=i;return E.useEffect(()=>(l(),()=>u()),[l,u]),S.jsx(sd,{...o,...r,ref:t})});ZI.displayName=aT;var oT="PopoverTrigger",sT=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(oT,n),o=lu(n),l=dt(t,i.triggerRef),u=S.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":dT(i.open),...r,ref:l,onClick:qe(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(sd,{asChild:!0,...o,children:u})});sT.displayName=oT;var cy="PopoverPortal",[QI,JI]=rT(cy,{forceMount:void 0}),lT=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=ha(cy,t);return S.jsx(QI,{scope:t,forceMount:n,children:S.jsx(Kn,{present:n||o.open,children:S.jsx(Jf,{asChild:!0,container:i,children:r})})})};lT.displayName=cy;var us="PopoverContent",uT=E.forwardRef((e,t)=>{const n=JI(us,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=ha(us,e.__scopePopover);return S.jsx(Kn,{present:r||o.open,children:o.modal?S.jsx(e3,{...i,ref:t}):S.jsx(t3,{...i,ref:t})})});uT.displayName=us;var e3=E.forwardRef((e,t)=>{const n=ha(us,e.__scopePopover),r=E.useRef(null),i=dt(t,r),o=E.useRef(!1);return E.useEffect(()=>{const l=r.current;if(l)return Fv(l)},[]),S.jsx(td,{as:ua,allowPinchZoom:!0,children:S.jsx(cT,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qe(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),o.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:qe(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,d=u.button===2||f;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:qe(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),t3=E.forwardRef((e,t)=>{const n=ha(us,e.__scopePopover),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(cT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var f,d;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),cT=E.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,...m}=e,v=ha(us,n),g=lu(n);return Pv(),S.jsx(Qf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:S.jsx(iy,{"data-state":dT(v.open),role:"dialog",id:v.contentId,...g,...m,ref:t,style:{...m.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)"}})})})}),fT="PopoverClose",n3=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(fT,n);return S.jsx(We.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,()=>i.onOpenChange(!1))})});n3.displayName=fT;var r3="PopoverArrow",i3=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=lu(n);return S.jsx(ay,{...i,...r,ref:t})});i3.displayName=r3;function dT(e){return e?"open":"closed"}var a3=iT,o3=sT,s3=lT,hT=uT;const dd=a3,hd=o3,uu=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>S.jsx(s3,{children:S.jsx(hT,{ref:i,align:t,sideOffset:n,className:Me("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),...r})}));uu.displayName=hT.displayName;const l3=({status:e})=>e?S.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Storage Info"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"Working Directory:"}),S.jsx("span",{className:"truncate",children:e.working_directory}),S.jsx("span",{children:"Input Directory:"}),S.jsx("span",{className:"truncate",children:e.input_directory})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"LLM Binding:"}),S.jsx("span",{children:e.configuration.llm_binding}),S.jsx("span",{children:"LLM Binding Host:"}),S.jsx("span",{children:e.configuration.llm_binding_host}),S.jsx("span",{children:"LLM Model:"}),S.jsx("span",{children:e.configuration.llm_model}),S.jsx("span",{children:"Max Tokens:"}),S.jsx("span",{children:e.configuration.max_tokens})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"Embedding Binding:"}),S.jsx("span",{children:e.configuration.embedding_binding}),S.jsx("span",{children:"Embedding Binding Host:"}),S.jsx("span",{children:e.configuration.embedding_binding_host}),S.jsx("span",{children:"Embedding Model:"}),S.jsx("span",{children:e.configuration.embedding_model})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"KV Storage:"}),S.jsx("span",{children:e.configuration.kv_storage}),S.jsx("span",{children:"Doc Status Storage:"}),S.jsx("span",{children:e.configuration.doc_status_storage}),S.jsx("span",{children:"Graph Storage:"}),S.jsx("span",{children:e.configuration.graph_storage}),S.jsx("span",{children:"Vector Storage:"}),S.jsx("span",{children:e.configuration.vector_storage})]})]})]}):S.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),u3=()=>{const e=Mn.use.health(),t=Mn.use.lastCheckTime(),n=Mn.use.status(),[r,i]=E.useState(!1);return E.useEffect(()=>{i(!0);const o=setTimeout(()=>i(!1),300);return()=>clearTimeout(o)},[t]),S.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:S.jsxs(dd,{children:[S.jsx(hd,{asChild:!0,children:S.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[S.jsx("div",{className:Me("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",r&&"scale-125",r&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",r&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),S.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),S.jsx(uu,{className:"w-auto",side:"top",align:"end",children:S.jsx(l3,{status:n})})]})})},pT=()=>{const e=E.useContext(B_);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function c3(){const{theme:e,setTheme:t}=pT(),n=E.useCallback(()=>t("light"),[t]),r=E.useCallback(()=>t("dark"),[t]);return e==="dark"?S.jsx(Ot,{onClick:n,variant:$r,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:S.jsx(BM,{})}):S.jsx(Ot,{onClick:r,variant:$r,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:S.jsx(nP,{})})}function mT(e){const t=e+"CollectionProvider",[n,r]=dr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=g=>{const{scope:w,children:x}=g,k=be.useRef(null),C=be.useRef(new Map).current;return S.jsx(i,{scope:w,itemMap:C,collectionRef:k,children:x})};l.displayName=t;const u=e+"CollectionSlot",f=be.forwardRef((g,w)=>{const{scope:x,children:k}=g,C=o(u,x),_=dt(w,C.collectionRef);return S.jsx(ua,{ref:_,children:k})});f.displayName=u;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=be.forwardRef((g,w)=>{const{scope:x,children:k,...C}=g,_=be.useRef(null),T=dt(w,_),N=o(d,x);return be.useEffect(()=>(N.itemMap.set(_,{ref:_,...C}),()=>void N.itemMap.delete(_))),S.jsx(ua,{[p]:"",ref:T,children:k})});m.displayName=d;function v(g){const w=o(e+"CollectionConsumer",g);return be.useCallback(()=>{const k=w.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((N,D)=>C.indexOf(N.ref.current)-C.indexOf(D.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:f,ItemSlot:m},v,r]}var f3=E.createContext(void 0);function pd(e){const t=E.useContext(f3);return e||t||"ltr"}var am="rovingFocusGroup.onEntryFocus",d3={bubbles:!1,cancelable:!0},md="RovingFocusGroup",[Ig,gT,h3]=mT(md),[p3,vT]=dr(md,[h3]),[m3,g3]=p3(md),yT=E.forwardRef((e,t)=>S.jsx(Ig.Provider,{scope:e.__scopeRovingFocusGroup,children:S.jsx(Ig.Slot,{scope:e.__scopeRovingFocusGroup,children:S.jsx(v3,{...e,ref:t})})}));yT.displayName=md;var v3=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,v=E.useRef(null),g=dt(t,v),w=pd(o),[x=null,k]=_i({prop:l,defaultProp:u,onChange:f}),[C,_]=E.useState(!1),T=un(d),N=gT(n),D=E.useRef(!1),[L,R]=E.useState(0);return E.useEffect(()=>{const U=v.current;if(U)return U.addEventListener(am,T),()=>U.removeEventListener(am,T)},[T]),S.jsx(m3,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:x,onItemFocus:E.useCallback(U=>k(U),[k]),onItemShiftTab:E.useCallback(()=>_(!0),[]),onFocusableItemAdd:E.useCallback(()=>R(U=>U+1),[]),onFocusableItemRemove:E.useCallback(()=>R(U=>U-1),[]),children:S.jsx(We.div,{tabIndex:C||L===0?-1:0,"data-orientation":r,...m,ref:g,style:{outline:"none",...e.style},onMouseDown:qe(e.onMouseDown,()=>{D.current=!0}),onFocus:qe(e.onFocus,U=>{const P=!D.current;if(U.target===U.currentTarget&&P&&!C){const z=new CustomEvent(am,d3);if(U.currentTarget.dispatchEvent(z),!z.defaultPrevented){const V=N().filter(B=>B.focusable),q=V.find(B=>B.active),I=V.find(B=>B.id===x),Z=[q,I,...V].filter(Boolean).map(B=>B.ref.current);wT(Z,p)}}D.current=!1}),onBlur:qe(e.onBlur,()=>_(!1))})})}),bT="RovingFocusGroupItem",xT=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...l}=e,u=bn(),f=o||u,d=g3(bT,n),p=d.currentTabStopId===f,m=gT(n),{onFocusableItemAdd:v,onFocusableItemRemove:g}=d;return E.useEffect(()=>{if(r)return v(),()=>g()},[r,v,g]),S.jsx(Ig.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:S.jsx(We.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:qe(e.onMouseDown,w=>{r?d.onItemFocus(f):w.preventDefault()}),onFocus:qe(e.onFocus,()=>d.onItemFocus(f)),onKeyDown:qe(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){d.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=x3(w,d.orientation,d.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let C=m().filter(_=>_.focusable).map(_=>_.ref.current);if(x==="last")C.reverse();else if(x==="prev"||x==="next"){x==="prev"&&C.reverse();const _=C.indexOf(w.currentTarget);C=d.loop?w3(C,_+1):C.slice(_+1)}setTimeout(()=>wT(C))}})})})});xT.displayName=bT;var y3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function b3(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function x3(e,t,n){const r=b3(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return y3[r]}function wT(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function w3(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var S3=yT,E3=xT,fy="Tabs",[_3,mK]=dr(fy,[vT]),ST=vT(),[k3,dy]=_3(fy),ET=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:u,activationMode:f="automatic",...d}=e,p=pd(u),[m,v]=_i({prop:r,onChange:i,defaultProp:o});return S.jsx(k3,{scope:n,baseId:bn(),value:m,onValueChange:v,orientation:l,dir:p,activationMode:f,children:S.jsx(We.div,{dir:p,"data-orientation":l,...d,ref:t})})});ET.displayName=fy;var _T="TabsList",kT=E.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=dy(_T,n),l=ST(n);return S.jsx(S3,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:S.jsx(We.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});kT.displayName=_T;var CT="TabsTrigger",TT=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=dy(CT,n),u=ST(n),f=DT(l.baseId,r),d=NT(l.baseId,r),p=r===l.value;return S.jsx(E3,{asChild:!0,...u,focusable:!i,active:p,children:S.jsx(We.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...o,ref:t,onMouseDown:qe(e.onMouseDown,m=>{!i&&m.button===0&&m.ctrlKey===!1?l.onValueChange(r):m.preventDefault()}),onKeyDown:qe(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&l.onValueChange(r)}),onFocus:qe(e.onFocus,()=>{const m=l.activationMode!=="manual";!p&&!i&&m&&l.onValueChange(r)})})})});TT.displayName=CT;var AT="TabsContent",RT=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,u=dy(AT,n),f=DT(u.baseId,r),d=NT(u.baseId,r),p=r===u.value,m=E.useRef(p);return E.useEffect(()=>{const v=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(v)},[]),S.jsx(Kn,{present:i||p,children:({present:v})=>S.jsx(We.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!v,id:d,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:v&&o})})});RT.displayName=AT;function DT(e,t){return`${e}-trigger-${t}`}function NT(e,t){return`${e}-content-${t}`}var C3=ET,OT=kT,jT=TT,LT=RT;const T3=C3,zT=E.forwardRef(({className:e,...t},n)=>S.jsx(OT,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));zT.displayName=OT.displayName;const MT=E.forwardRef(({className:e,...t},n)=>S.jsx(jT,{ref:n,className:Me("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}));MT.displayName=jT.displayName;const Pl=E.forwardRef(({className:e,...t},n)=>S.jsx(LT,{ref:n,className:Me("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t}));Pl.displayName=LT.displayName;function Mc({value:e,currentTab:t,children:n}){return S.jsx(MT,{value:e,className:Me("cursor-pointer px-2 py-1 transition-all",t===e?"!bg-emerald-400 !text-zinc-50":"hover:bg-background/60"),children:n})}function A3(){const e=Qe.use.currentTab();return S.jsx("div",{className:"flex h-8 self-center",children:S.jsxs(zT,{className:"h-full gap-2",children:[S.jsx(Mc,{value:"documents",currentTab:e,children:"Documents"}),S.jsx(Mc,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),S.jsx(Mc,{value:"retrieval",currentTab:e,children:"Retrieval"}),S.jsx(Mc,{value:"api",currentTab:e,children:"API"})]})})}function R3(){return S.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:[S.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[S.jsx(oP,{className:"size-4 text-emerald-400","aria-hidden":"true"}),S.jsx("span",{className:"font-bold md:inline-block",children:t1.name})]}),S.jsx("div",{className:"flex h-10 flex-1 justify-center",children:S.jsx(A3,{})}),S.jsxs("nav",{className:"flex items-center",children:[S.jsx(Ot,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:S.jsx("a",{href:t1.github,target:"_blank",rel:"noopener noreferrer",children:S.jsx(NM,{className:"size-4","aria-hidden":"true"})})}),S.jsx(c3,{})]})]})}var Pc={exports:{}},U1;function D3(){if(U1)return Pc.exports;U1=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(D,L,R){return Function.prototype.apply.call(D,L,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 r(N){console&&console.warn&&console.warn(N)}var i=Number.isNaN||function(D){return D!==D};function o(){o.init.call(this)}Pc.exports=o,Pc.exports.once=C,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var l=10;function u(N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(N){if(typeof N!="number"||N<0||i(N))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");l=N}}),o.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},o.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||i(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(N){return N._maxListeners===void 0?o.defaultMaxListeners:N._maxListeners}o.prototype.getMaxListeners=function(){return f(this)},o.prototype.emit=function(D){for(var L=[],R=1;R<arguments.length;R++)L.push(arguments[R]);var U=D==="error",P=this._events;if(P!==void 0)U=U&&P.error===void 0;else if(!U)return!1;if(U){var z;if(L.length>0&&(z=L[0]),z instanceof Error)throw z;var V=new Error("Unhandled error."+(z?" ("+z.message+")":""));throw V.context=z,V}var q=P[D];if(q===void 0)return!1;if(typeof q=="function")t(q,this,L);else for(var I=q.length,Y=w(q,I),R=0;R<I;++R)t(Y[R],this,L);return!0};function d(N,D,L,R){var U,P,z;if(u(L),P=N._events,P===void 0?(P=N._events=Object.create(null),N._eventsCount=0):(P.newListener!==void 0&&(N.emit("newListener",D,L.listener?L.listener:L),P=N._events),z=P[D]),z===void 0)z=P[D]=L,++N._eventsCount;else if(typeof z=="function"?z=P[D]=R?[L,z]:[z,L]:R?z.unshift(L):z.push(L),U=f(N),U>0&&z.length>U&&!z.warned){z.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+z.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=N,V.type=D,V.count=z.length,r(V)}return N}o.prototype.addListener=function(D,L){return d(this,D,L,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(D,L){return d(this,D,L,!0)};function p(){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 m(N,D,L){var R={fired:!1,wrapFn:void 0,target:N,type:D,listener:L},U=p.bind(R);return U.listener=L,R.wrapFn=U,U}o.prototype.once=function(D,L){return u(L),this.on(D,m(this,D,L)),this},o.prototype.prependOnceListener=function(D,L){return u(L),this.prependListener(D,m(this,D,L)),this},o.prototype.removeListener=function(D,L){var R,U,P,z,V;if(u(L),U=this._events,U===void 0)return this;if(R=U[D],R===void 0)return this;if(R===L||R.listener===L)--this._eventsCount===0?this._events=Object.create(null):(delete U[D],U.removeListener&&this.emit("removeListener",D,R.listener||L));else if(typeof R!="function"){for(P=-1,z=R.length-1;z>=0;z--)if(R[z]===L||R[z].listener===L){V=R[z].listener,P=z;break}if(P<0)return this;P===0?R.shift():x(R,P),R.length===1&&(U[D]=R[0]),U.removeListener!==void 0&&this.emit("removeListener",D,V||L)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(D){var L,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 P=Object.keys(R),z;for(U=0;U<P.length;++U)z=P[U],z!=="removeListener"&&this.removeAllListeners(z);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(L=R[D],typeof L=="function")this.removeListener(D,L);else if(L!==void 0)for(U=L.length-1;U>=0;U--)this.removeListener(D,L[U]);return this};function v(N,D,L){var R=N._events;if(R===void 0)return[];var U=R[D];return U===void 0?[]:typeof U=="function"?L?[U.listener||U]:[U]:L?k(U):w(U,U.length)}o.prototype.listeners=function(D){return v(this,D,!0)},o.prototype.rawListeners=function(D){return v(this,D,!1)},o.listenerCount=function(N,D){return typeof N.listenerCount=="function"?N.listenerCount(D):g.call(N,D)},o.prototype.listenerCount=g;function g(N){var D=this._events;if(D!==void 0){var L=D[N];if(typeof L=="function")return 1;if(L!==void 0)return L.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(N,D){for(var L=new Array(D),R=0;R<D;++R)L[R]=N[R];return L}function x(N,D){for(;D+1<N.length;D++)N[D]=N[D+1];N.pop()}function k(N){for(var D=new Array(N.length),L=0;L<D.length;++L)D[L]=N[L].listener||N[L];return D}function C(N,D){return new Promise(function(L,R){function U(z){N.removeListener(D,P),R(z)}function P(){typeof N.removeListener=="function"&&N.removeListener("error",U),L([].slice.call(arguments))}T(N,D,P,{once:!0}),D!=="error"&&_(N,U,{once:!0})})}function _(N,D,L){typeof N.on=="function"&&T(N,"error",D,L)}function T(N,D,L,R){if(typeof N.on=="function")R.once?N.once(D,L):N.on(D,L);else if(typeof N.addEventListener=="function")N.addEventListener(D,function U(P){R.once&&N.removeEventListener(D,U),L(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof N)}return Pc.exports}var PT=D3();function N3(){const e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(const r in arguments[t])e[r]=arguments[t][r];return e}let Xt=N3;typeof Object.assign=="function"&&(Xt=Object.assign);function fr(e,t,n,r){const i=e._nodes.get(t);let o=null;return i&&(r==="mixed"?o=i.out&&i.out[n]||i.undirected&&i.undirected[n]:r==="directed"?o=i.out&&i.out[n]:o=i.undirected&&i.undirected[n]),o}function cn(e){return typeof e=="object"&&e!==null}function FT(e){let t;for(t in e)return!1;return!0}function ur(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function Sr(e,t,n){const r={enumerable:!0,configurable:!0};typeof n=="function"?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function B1(e){return!(!cn(e)||e.attributes&&!Array.isArray(e.attributes))}function O3(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function Ei(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Ss(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class hy extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class je extends hy{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,je.prototype.constructor)}}class De extends hy{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Xe extends hy{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Xe.prototype.constructor)}}function IT(e,t){this.key=e,this.attributes=t,this.clear()}IT.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 GT(e,t){this.key=e,this.attributes=t,this.clear()}GT.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function UT(e,t){this.key=e,this.attributes=t,this.clear()}UT.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Es(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}Es.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};Es.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const i=this.source[e],o=i[r];if(typeof o>"u"){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}o.previous=this,this.next=o,i[r]=this,this.target[t][n]=this};Es.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};Es.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const BT=0,$T=1,j3=2,HT=3;function Ai(e,t,n,r,i,o,l){let u,f,d,p;if(r=""+r,n===BT){if(u=e._nodes.get(r),!u)throw new De(`Graph.${t}: could not find the "${r}" node in the graph.`);d=i,p=o}else if(n===HT){if(i=""+i,f=e._edges.get(i),!f)throw new De(`Graph.${t}: could not find the "${i}" edge in the graph.`);const m=f.source.key,v=f.target.key;if(r===m)u=f.target;else if(r===v)u=f.source;else throw new De(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${m}, ${v}).`);d=o,p=l}else{if(f=e._edges.get(r),!f)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===$T?u=f.source:u=f.target,d=i,p=o}return[u,d,p]}function L3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);return l.attributes[u]}}function z3(e,t,n){e.prototype[t]=function(r,i){const[o]=Ai(this,t,n,r,i);return o.attributes}}function M3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);return l.attributes.hasOwnProperty(u)}}function P3(e,t,n){e.prototype[t]=function(r,i,o,l){const[u,f,d]=Ai(this,t,n,r,i,o,l);return u.attributes[f]=d,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function F3(e,t,n){e.prototype[t]=function(r,i,o,l){const[u,f,d]=Ai(this,t,n,r,i,o,l);if(typeof d!="function")throw new je(`Graph.${t}: updater should be a function.`);const p=u.attributes,m=d(p[f]);return p[f]=m,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function I3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);return delete l.attributes[u],this.emit("nodeAttributesUpdated",{key:l.key,type:"remove",attributes:l.attributes,name:u}),this}}function G3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);if(!cn(u))throw new je(`Graph.${t}: provided attributes are not a plain object.`);return l.attributes=u,this.emit("nodeAttributesUpdated",{key:l.key,type:"replace",attributes:l.attributes}),this}}function U3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);if(!cn(u))throw new je(`Graph.${t}: provided attributes are not a plain object.`);return Xt(l.attributes,u),this.emit("nodeAttributesUpdated",{key:l.key,type:"merge",attributes:l.attributes,data:u}),this}}function B3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);if(typeof u!="function")throw new je(`Graph.${t}: provided updater is not a function.`);return l.attributes=u(l.attributes),this.emit("nodeAttributesUpdated",{key:l.key,type:"update",attributes:l.attributes}),this}}const $3=[{name:e=>`get${e}Attribute`,attacher:L3},{name:e=>`get${e}Attributes`,attacher:z3},{name:e=>`has${e}Attribute`,attacher:M3},{name:e=>`set${e}Attribute`,attacher:P3},{name:e=>`update${e}Attribute`,attacher:F3},{name:e=>`remove${e}Attribute`,attacher:I3},{name:e=>`replace${e}Attributes`,attacher:G3},{name:e=>`merge${e}Attributes`,attacher:U3},{name:e=>`update${e}Attributes`,attacher:B3}];function H3(e){$3.forEach(function({name:t,attacher:n}){n(e,t("Node"),BT),n(e,t("Source"),$T),n(e,t("Target"),j3),n(e,t("Opposite"),HT)})}function V3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`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 l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes[i]}}function q3(e,t,n){e.prototype[t]=function(r){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Xe(`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 o=""+r,l=""+arguments[1];if(i=fr(this,o,l,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new Xe(`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(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes}}function Y3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`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 l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes.hasOwnProperty(i)}}function W3(e,t,n){e.prototype[t]=function(r,i,o){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Xe(`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=""+r,f=""+i;if(i=arguments[2],o=arguments[3],l=fr(this,u,f,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new Xe(`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(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return l.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:i}),this}}function X3(e,t,n){e.prototype[t]=function(r,i,o){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Xe(`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=""+r,f=""+i;if(i=arguments[2],o=arguments[3],l=fr(this,u,f,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new Xe(`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(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof o!="function")throw new je(`Graph.${t}: updater should be a function.`);return l.attributes[i]=o(l.attributes[i]),this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:i}),this}}function K3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`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 l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:i}),this}}function Z3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`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 l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!cn(i))throw new je(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function Q3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`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 l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!cn(i))throw new je(`Graph.${t}: provided attributes are not a plain object.`);return Xt(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:i}),this}}function J3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`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 l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new je(`Graph.${t}: provided updater is not a function.`);return o.attributes=i(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const e5=[{name:e=>`get${e}Attribute`,attacher:V3},{name:e=>`get${e}Attributes`,attacher:q3},{name:e=>`has${e}Attribute`,attacher:Y3},{name:e=>`set${e}Attribute`,attacher:W3},{name:e=>`update${e}Attribute`,attacher:X3},{name:e=>`remove${e}Attribute`,attacher:K3},{name:e=>`replace${e}Attributes`,attacher:Z3},{name:e=>`merge${e}Attributes`,attacher:Q3},{name:e=>`update${e}Attributes`,attacher:J3}];function t5(e){e5.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const n5=[{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 r5(e,t,n,r){let i=!1;for(const o in t){if(o===r)continue;const l=t[o];if(i=n(l.key,l.attributes,l.source.key,l.target.key,l.source.attributes,l.target.attributes,l.undirected),e&&i)return l.key}}function i5(e,t,n,r){let i,o,l,u=!1;for(const f in t)if(f!==r){i=t[f];do{if(o=i.source,l=i.target,u=n(i.key,i.attributes,o.key,l.key,o.attributes,l.attributes,i.undirected),e&&u)return i.key;i=i.next}while(i!==void 0)}}function om(e,t){const n=Object.keys(e),r=n.length;let i,o=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(o>=r)return{done:!0};const l=n[o++];if(l===t){i=void 0;continue}i=e[l]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function a5(e,t,n,r){const i=t[n];if(!i)return;const o=i.source,l=i.target;if(r(i.key,i.attributes,o.key,l.key,o.attributes,l.attributes,i.undirected)&&e)return i.key}function o5(e,t,n,r){let i=t[n];if(!i)return;let o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&o)return i.key;i=i.next}while(i!==void 0)}function sm(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const i={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:i}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function s5(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,r=new Array(n),i=t==="undirected",o=e._edges.values();let l=0,u,f;for(;u=o.next(),u.done!==!0;)f=u.value,f.undirected===i&&(r[l++]=f.key);return r}function VT(e,t,n,r){if(t.size===0)return;const i=n!=="mixed"&&n!==t.type,o=n==="undirected";let l,u,f=!1;const d=t._edges.values();for(;l=d.next(),l.done!==!0;){if(u=l.value,i&&u.undirected!==o)continue;const{key:p,attributes:m,source:v,target:g}=u;if(f=r(p,m,v.key,g.key,v.attributes,g.attributes,u.undirected),e&&f)return p}}function l5(e,t){if(e.size===0)return Ss();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",i=e._edges.values();return{[Symbol.iterator](){return this},next(){let o,l;for(;;){if(o=i.next(),o.done)return o;if(l=o.value,!(n&&l.undirected!==r))break}return{value:{edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected},done:!1}}}}function py(e,t,n,r,i,o){const l=t?i5:r5;let u;if(n!=="undirected"&&(r!=="out"&&(u=l(e,i.in,o),e&&u)||r!=="in"&&(u=l(e,i.out,o,r?void 0:i.key),e&&u))||n!=="directed"&&(u=l(e,i.undirected,o),e&&u))return u}function u5(e,t,n,r){const i=[];return py(!1,e,t,n,r,function(o){i.push(o)}),i}function c5(e,t,n){let r=Ss();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=Ei(r,om(n.in))),t!=="in"&&typeof n.out<"u"&&(r=Ei(r,om(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=Ei(r,om(n.undirected))),r}function my(e,t,n,r,i,o,l){const u=n?o5:a5;let f;if(t!=="undirected"&&(typeof i.in<"u"&&r!=="out"&&(f=u(e,i.in,o,l),e&&f)||typeof i.out<"u"&&r!=="in"&&(r||i.key!==o)&&(f=u(e,i.out,o,l),e&&f))||t!=="directed"&&typeof i.undirected<"u"&&(f=u(e,i.undirected,o,l),e&&f))return f}function f5(e,t,n,r,i){const o=[];return my(!1,e,t,n,r,i,function(l){o.push(l)}),o}function d5(e,t,n,r){let i=Ss();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(i=Ei(i,sm(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(i=Ei(i,sm(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(i=Ei(i,sm(n.undirected,r))),i}function h5(e,t){const{name:n,type:r,direction:i}=t;e.prototype[n]=function(o,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return s5(this,r);if(arguments.length===1){o=""+o;const u=this._nodes.get(o);if(typeof u>"u")throw new De(`Graph.${n}: could not find the "${o}" node in the graph.`);return u5(this.multi,r==="mixed"?this.type:r,i,u)}if(arguments.length===2){o=""+o,l=""+l;const u=this._nodes.get(o);if(!u)throw new De(`Graph.${n}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(l))throw new De(`Graph.${n}: could not find the "${l}" target node in the graph.`);return f5(r,this.multi,i,u,l)}throw new je(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function p5(e,t){const{name:n,type:r,direction:i}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p,m){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return m=d,VT(!1,this,r,m);if(arguments.length===2){d=""+d,m=p;const v=this._nodes.get(d);if(typeof v>"u")throw new De(`Graph.${o}: could not find the "${d}" node in the graph.`);return py(!1,this.multi,r==="mixed"?this.type:r,i,v,m)}if(arguments.length===3){d=""+d,p=""+p;const v=this._nodes.get(d);if(!v)throw new De(`Graph.${o}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(p))throw new De(`Graph.${o}: could not find the "${p}" target node in the graph.`);return my(!1,r,this.multi,i,v,p,m)}throw new je(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop();let m;if(d.length===0){let v=0;r!=="directed"&&(v+=this.undirectedSize),r!=="undirected"&&(v+=this.directedSize),m=new Array(v);let g=0;d.push((w,x,k,C,_,T,N)=>{m[g++]=p(w,x,k,C,_,T,N)})}else m=[],d.push((v,g,w,x,k,C,_)=>{m.push(p(v,g,w,x,k,C,_))});return this[o].apply(this,d),m};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop(),m=[];return d.push((v,g,w,x,k,C,_)=>{p(v,g,w,x,k,C,_)&&m.push(v)}),this[o].apply(this,d),m};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(){let d=Array.prototype.slice.call(arguments);if(d.length<2||d.length>4)throw new je(`Graph.${f}: invalid number of arguments (expecting 2, 3 or 4 and got ${d.length}).`);if(typeof d[d.length-1]=="function"&&typeof d[d.length-2]!="function")throw new je(`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 p,m;d.length===2?(p=d[0],m=d[1],d=[]):d.length===3?(p=d[1],m=d[2],d=[d[0]]):d.length===4&&(p=d[2],m=d[3],d=[d[0],d[1]]);let v=m;return d.push((g,w,x,k,C,_,T)=>{v=p(v,g,w,x,k,C,_,T)}),this[o].apply(this,d),v}}function m5(e,t){const{name:n,type:r,direction:i}=t,o="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(f,d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=f,VT(!0,this,r,p);if(arguments.length===2){f=""+f,p=d;const m=this._nodes.get(f);if(typeof m>"u")throw new De(`Graph.${o}: could not find the "${f}" node in the graph.`);return py(!0,this.multi,r==="mixed"?this.type:r,i,m,p)}if(arguments.length===3){f=""+f,d=""+d;const m=this._nodes.get(f);if(!m)throw new De(`Graph.${o}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(d))throw new De(`Graph.${o}: could not find the "${d}" target node in the graph.`);return my(!0,r,this.multi,i,m,d,p)}throw new je(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const l="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[l]=function(){const f=Array.prototype.slice.call(arguments),d=f.pop();return f.push((m,v,g,w,x,k,C)=>d(m,v,g,w,x,k,C)),!!this[o].apply(this,f)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),d=f.pop();return f.push((m,v,g,w,x,k,C)=>!d(m,v,g,w,x,k,C)),!this[o].apply(this,f)}}function g5(e,t){const{name:n,type:r,direction:i}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(l,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Ss();if(!arguments.length)return l5(this,r);if(arguments.length===1){l=""+l;const f=this._nodes.get(l);if(!f)throw new De(`Graph.${o}: could not find the "${l}" node in the graph.`);return c5(r,i,f)}if(arguments.length===2){l=""+l,u=""+u;const f=this._nodes.get(l);if(!f)throw new De(`Graph.${o}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(u))throw new De(`Graph.${o}: could not find the "${u}" target node in the graph.`);return d5(r,i,f,u)}throw new je(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function v5(e){n5.forEach(t=>{h5(e,t),p5(e,t),m5(e,t),g5(e,t)})}const y5=[{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 gd(){this.A=null,this.B=null}gd.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};gd.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Tl(e,t,n,r,i){for(const o in r){const l=r[o],u=l.source,f=l.target,d=u===n?f:u;if(t&&t.has(d.key))continue;const p=i(d.key,d.attributes);if(e&&p)return d.key}}function gy(e,t,n,r,i){if(t!=="mixed"){if(t==="undirected")return Tl(e,null,r,r.undirected,i);if(typeof n=="string")return Tl(e,null,r,r[n],i)}const o=new gd;let l;if(t!=="undirected"){if(n!=="out"){if(l=Tl(e,null,r,r.in,i),e&&l)return l;o.wrap(r.in)}if(n!=="in"){if(l=Tl(e,o,r,r.out,i),e&&l)return l;o.wrap(r.out)}}if(t!=="directed"&&(l=Tl(e,o,r,r.undirected,i),e&&l))return l}function b5(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return gy(!1,e,t,n,function(i){r.push(i)}),r}function Al(e,t,n){const r=Object.keys(n),i=r.length;let o=0;return{[Symbol.iterator](){return this},next(){let l=null;do{if(o>=i)return e&&e.wrap(n),{done:!0};const u=n[r[o++]],f=u.source,d=u.target;if(l=f===t?d:f,e&&e.has(l.key)){l=null;continue}}while(l===null);return{done:!1,value:{neighbor:l.key,attributes:l.attributes}}}}}function x5(e,t,n){if(e!=="mixed"){if(e==="undirected")return Al(null,n,n.undirected);if(typeof t=="string")return Al(null,n,n[t])}let r=Ss();const i=new gd;return e!=="undirected"&&(t!=="out"&&(r=Ei(r,Al(i,n,n.in))),t!=="in"&&(r=Ei(r,Al(i,n,n.out)))),e!=="directed"&&(r=Ei(r,Al(i,n,n.undirected))),r}function w5(e,t){const{name:n,type:r,direction:i}=t;e.prototype[n]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];o=""+o;const l=this._nodes.get(o);if(typeof l>"u")throw new De(`Graph.${n}: could not find the "${o}" node in the graph.`);return b5(r==="mixed"?this.type:r,i,l)}}function S5(e,t){const{name:n,type:r,direction:i}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const m=this._nodes.get(d);if(typeof m>"u")throw new De(`Graph.${o}: could not find the "${d}" node in the graph.`);gy(!1,r==="mixed"?this.type:r,i,m,p)};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(d,p){const m=[];return this[o](d,(v,g)=>{m.push(p(v,g))}),m};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(d,p){const m=[];return this[o](d,(v,g)=>{p(v,g)&&m.push(v)}),m};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(d,p,m){if(arguments.length<3)throw new je(`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 v=m;return this[o](d,(g,w)=>{v=p(v,g,w)}),v}}function E5(e,t){const{name:n,type:r,direction:i}=t,o=n[0].toUpperCase()+n.slice(1,-1),l="find"+o;e.prototype[l]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const m=this._nodes.get(d);if(typeof m>"u")throw new De(`Graph.${l}: could not find the "${d}" node in the graph.`);return gy(!0,r==="mixed"?this.type:r,i,m,p)};const u="some"+o;e.prototype[u]=function(d,p){return!!this[l](d,p)};const f="every"+o;e.prototype[f]=function(d,p){return!this[l](d,(v,g)=>!p(v,g))}}function _5(e,t){const{name:n,type:r,direction:i}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Ss();l=""+l;const u=this._nodes.get(l);if(typeof u>"u")throw new De(`Graph.${o}: could not find the "${l}" node in the graph.`);return x5(r==="mixed"?this.type:r,i,u)}}function k5(e){y5.forEach(t=>{w5(e,t),S5(e,t),E5(e,t),_5(e,t)})}function Fc(e,t,n,r,i){const o=r._nodes.values(),l=r.type;let u,f,d,p,m,v;for(;u=o.next(),u.done!==!0;){let g=!1;if(f=u.value,l!=="undirected"){p=f.out;for(d in p){m=p[d];do v=m.target,g=!0,i(f.key,v.key,f.attributes,v.attributes,m.key,m.attributes,m.undirected),m=m.next;while(m)}}if(l!=="directed"){p=f.undirected;for(d in p)if(!(t&&f.key>d)){m=p[d];do v=m.target,v.key!==d&&(v=m.source),g=!0,i(f.key,v.key,f.attributes,v.attributes,m.key,m.attributes,m.undirected),m=m.next;while(m)}}n&&!g&&i(f.key,null,f.attributes,null,null,null,null)}}function C5(e,t){const n={key:e};return FT(t.attributes)||(n.attributes=Xt({},t.attributes)),n}function T5(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return FT(n.attributes)||(r.attributes=Xt({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function A5(e){if(!cn(e))throw new je('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 je("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!cn(e.attributes)||e.attributes===null))throw new je("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function R5(e){if(!cn(e))throw new je('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 je("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new je("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!cn(e.attributes)||e.attributes===null))throw new je("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new je("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const D5=O3(),N5=new Set(["directed","undirected","mixed"]),$1=new Set(["domain","_events","_eventsCount","_maxListeners"]),O5=[{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"}],j5={allowSelfLoops:!0,multi:!1,type:"mixed"};function L5(e,t,n){if(n&&!cn(n))throw new je(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Xe(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function H1(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function qT(e,t,n,r,i,o,l,u){if(!r&&e.type==="undirected")throw new Xe(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Xe(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!cn(u))throw new je(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(o=""+o,l=""+l,u=u||{},!e.allowSelfLoops&&o===l)throw new Xe(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const f=e._nodes.get(o),d=e._nodes.get(l);if(!f)throw new De(`Graph.${t}: source node "${o}" not found.`);if(!d)throw new De(`Graph.${t}: target node "${l}" not found.`);const p={key:null,undirected:r,source:o,target:l,attributes:u};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new Xe(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?typeof f.undirected[l]<"u":typeof f.out[l]<"u"))throw new Xe(`Graph.${t}: an edge linking "${o}" to "${l}" 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 m=new Es(r,i,f,d,u);e._edges.set(i,m);const v=o===l;return r?(f.undirectedDegree++,d.undirectedDegree++,v&&(f.undirectedLoops++,e._undirectedSelfLoopCount++)):(f.outDegree++,d.inDegree++,v&&(f.directedLoops++,e._directedSelfLoopCount++)),e.multi?m.attachMulti():m.attach(),r?e._undirectedSize++:e._directedSize++,p.key=i,e.emit("edgeAdded",p),i}function z5(e,t,n,r,i,o,l,u,f){if(!r&&e.type==="undirected")throw new Xe(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Xe(`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 je(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!cn(u))throw new je(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}o=""+o,l=""+l;let d;if(f&&(d=u,u=void 0),!e.allowSelfLoops&&o===l)throw new Xe(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(o),m=e._nodes.get(l),v,g;if(!n&&(v=e._edges.get(i),v)){if((v.source.key!==o||v.target.key!==l)&&(!r||v.source.key!==l||v.target.key!==o))throw new Xe(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${o}" source & "${l}" target vs. ("${v.source.key}", "${v.target.key}").`);g=v}if(!g&&!e.multi&&p&&(g=r?p.undirected[l]:p.out[l]),g){const _=[g.key,!1,!1,!1];if(f?!d:!u)return _;if(f){const T=g.attributes;g.attributes=d(T),e.emit("edgeAttributesUpdated",{type:"replace",key:g.key,attributes:g.attributes})}else Xt(g.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:g.key,attributes:g.attributes,data:u});return _}u=u||{},f&&d&&(u=d(u));const w={key:null,undirected:r,source:o,target:l,attributes:u};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new Xe(`Graph.${t}: the "${i}" edge already exists in the graph.`);let x=!1,k=!1;p||(p=H1(e,o,{}),x=!0,o===l&&(m=p,k=!0)),m||(m=H1(e,l,{}),k=!0),v=new Es(r,i,p,m,u),e._edges.set(i,v);const C=o===l;return r?(p.undirectedDegree++,m.undirectedDegree++,C&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,m.inDegree++,C&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?v.attachMulti():v.attach(),r?e._undirectedSize++:e._directedSize++,w.key=i,e.emit("edgeAdded",w),[i,!0,x,k]}function Yo(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:i}=t,o=t.undirected,l=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,l&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,l&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),o?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:i,source:n.key,target:r.key,undirected:o})}class St extends PT.EventEmitter{constructor(t){if(super(),t=Xt({},j5,t),typeof t.multi!="boolean")throw new je(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!N5.has(t.type))throw new je(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new je(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?IT:t.type==="directed"?GT:UT;ur(this,"NodeDataClass",n);const r="geid_"+D5()+"_";let i=0;const o=()=>{let l;do l=r+i++;while(this._edges.has(l));return l};ur(this,"_attributes",{}),ur(this,"_nodes",new Map),ur(this,"_edges",new Map),ur(this,"_directedSize",0),ur(this,"_undirectedSize",0),ur(this,"_directedSelfLoopCount",0),ur(this,"_undirectedSelfLoopCount",0),ur(this,"_edgeKeyGenerator",o),ur(this,"_options",t),$1.forEach(l=>ur(this,l,this[l])),Sr(this,"order",()=>this._nodes.size),Sr(this,"size",()=>this._edges.size),Sr(this,"directedSize",()=>this._directedSize),Sr(this,"undirectedSize",()=>this._undirectedSize),Sr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Sr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Sr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Sr(this,"multi",this._options.multi),Sr(this,"type",this._options.type),Sr(this,"allowSelfLoops",this._options.allowSelfLoops),Sr(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 r=""+t,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new je(`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 r=""+t,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new je(`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 r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new je(`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 Xe("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||void 0;if(i)return i.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Xe("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const i=r.undirected&&r.undirected[n]||void 0;if(i)return i.key}edge(t,n){if(this.multi)throw new Xe("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 r=this._nodes.get(t);if(!r)throw new De(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.edge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(i)return i.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`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 De(`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 De(`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 De(`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 De(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`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 De(`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 De(`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 De(`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 De(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,i+=n.directedLoops),r-i}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,i+=n.directedLoops),r-i}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,i+=n.directedLoops*2),r-i}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`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 De(`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 De(`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 r=this._edges.get(n);if(!r)throw new De(`Graph.opposite: could not find the "${n}" edge in the graph.`);const i=r.source.key,o=r.target.key;if(t===i)return o;if(t===o)return i;throw new De(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${i}, ${o}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new De(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`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 De(`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 De(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return L5(this,t,n).key}mergeNode(t,n){if(n&&!cn(n))throw new je(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(Xt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new je(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const o=r.attributes;r.attributes=n(o),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const i=n?n({}):{};return r=new this.NodeDataClass(t,i),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:i}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const i in n.out){r=n.out[i];do Yo(this,r),r=r.next;while(r)}for(const i in n.in){r=n.in[i];do Yo(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const i in n.undirected){r=n.undirected[i];do Yo(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],i=""+arguments[1];if(n=fr(this,r,i,this.type),!n)throw new De(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new De(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Yo(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Xe("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 Xe("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 r=fr(this,t,n,"directed");if(!r)throw new De(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Yo(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Xe("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 Xe("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 r=fr(this,t,n,"undirected");if(!r)throw new De(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Yo(this,r),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 je("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),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(!cn(t))throw new je("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(!cn(t))throw new je("Graph.mergeAttributes: provided attributes are not a plain object.");return Xt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new je("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 je("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!B1(n))throw new je("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,o.attributes=t(o.key,o.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new je("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!B1(n))throw new je("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let i,o,l,u;for(;i=r.next(),i.done!==!0;)o=i.value,l=o.source,u=o.target,o.attributes=t(o.key,o.attributes,l.key,u.key,l.attributes,u.attributes,o.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new je("Graph.forEachAdjacencyEntry: expecting a callback.");Fc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new je("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Fc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new je("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Fc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new je("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Fc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new je("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)}findNode(t){if(typeof t!="function")throw new je("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return i.key}mapNodes(t){if(typeof t!="function")throw new je("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,i;const o=new Array(this.order);let l=0;for(;r=n.next(),r.done!==!0;)i=r.value,o[l++]=t(i.key,i.attributes);return o}someNode(t){if(typeof t!="function")throw new je("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new je("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,!t(i.key,i.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new je("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,i;const o=[];for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)&&o.push(i.key);return o}reduceNodes(t,n){if(typeof t!="function")throw new je("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new je("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 r=n;const i=this._nodes.values();let o,l;for(;o=i.next(),o.done!==!0;)l=o.value,r=t(r,l.key,l.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((i,o)=>{t[n++]=C5(o,i)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((i,o)=>{r[n++]=T5(this.type,o,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof St)return t.forEachNode((f,d)=>{n?this.mergeNode(f,d):this.addNode(f,d)}),t.forEachEdge((f,d,p,m,v,g,w)=>{n?w?this.mergeUndirectedEdgeWithKey(f,p,m,d):this.mergeDirectedEdgeWithKey(f,p,m,d):w?this.addUndirectedEdgeWithKey(f,p,m,d):this.addDirectedEdgeWithKey(f,p,m,d)}),this;if(!cn(t))throw new je("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!cn(t.attributes))throw new je("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,o,l,u;if(t.nodes){if(o=t.nodes,!Array.isArray(o))throw new je("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=o.length;r<i;r++){l=o[r],A5(l);const{key:f,attributes:d}=l;n?this.mergeNode(f,d):this.addNode(f,d)}}if(t.edges){let f=!1;if(this.type==="undirected"&&(f=!0),o=t.edges,!Array.isArray(o))throw new je("Graph.import: invalid edges. Expecting an array.");for(r=0,i=o.length;r<i;r++){u=o[r],R5(u);const{source:d,target:p,attributes:m,undirected:v=f}=u;let g;"key"in u?(g=n?v?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:v?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,g.call(this,u.key,d,p,m)):(g=n?v?this.mergeUndirectedEdge:this.mergeDirectedEdge:v?this.addUndirectedEdge:this.addDirectedEdge,g.call(this,d,p,m))}}return this}nullCopy(t){const n=new St(Xt({},this._options,t));return n.replaceAttributes(Xt({},this.getAttributes())),n}emptyCopy(t){const n=this.nullCopy(t);return this._nodes.forEach((r,i)=>{const o=Xt({},r.attributes);r=new n.NodeDataClass(i,o),n._nodes.set(i,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Xe(`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 Xe("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 Xe("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),r=this._edges.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,qT(n,"copy",!1,o.undirected,o.key,o.source.key,o.target.key,Xt({},o.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((o,l)=>{t[l]=o.attributes});const n={},r={};this._edges.forEach((o,l)=>{const u=o.undirected?"--":"->";let f="",d=o.source.key,p=o.target.key,m;o.undirected&&d>p&&(m=d,d=p,p=m);const v=`(${d})${u}(${p})`;l.startsWith("geid_")?this.multi&&(typeof r[v]>"u"?r[v]=0:r[v]++,f+=`${r[v]}. `):f+=`[${l}]: `,f+=v,n[f]=o.attributes});const i={};for(const o in this)this.hasOwnProperty(o)&&!$1.has(o)&&typeof this[o]!="function"&&typeof o!="symbol"&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,ur(i,"constructor",this.constructor),i}}typeof Symbol<"u"&&(St.prototype[Symbol.for("nodejs.util.inspect.custom")]=St.prototype.inspect);O5.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?qT:z5;e.generateKey?St.prototype[n]=function(i,o,l){return r(this,n,!0,(e.type||this.type)==="undirected",null,i,o,l,t==="update")}:St.prototype[n]=function(i,o,l,u){return r(this,n,!1,(e.type||this.type)==="undirected",i,o,l,u,t==="update")}})});H3(St);t5(St);v5(St);k5(St);class Wl extends St{constructor(t){const n=Xt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new je("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new je('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class YT extends St{constructor(t){const n=Xt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new je("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new je('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class WT extends St{constructor(t){const n=Xt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new je("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class XT extends St{constructor(t){const n=Xt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new je("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new je('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class KT extends St{constructor(t){const n=Xt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new je("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new je('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function _s(e){e.from=function(t,n){const r=Xt({},t.options,n),i=new e(r);return i.import(t),i}}_s(St);_s(Wl);_s(YT);_s(WT);_s(XT);_s(KT);St.Graph=St;St.DirectedGraph=Wl;St.UndirectedGraph=YT;St.MultiGraph=WT;St.MultiDirectedGraph=XT;St.MultiUndirectedGraph=KT;St.InvalidArgumentsGraphError=je;St.NotFoundGraphError=De;St.UsageGraphError=Xe;function M5(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Gl(e){var t=M5(e,"string");return typeof t=="symbol"?t:t+""}function tn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gl(r.key),r)}}function nn(e,t,n){return t&&V1(e.prototype,t),n&&V1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cs(e){return cs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cs(e)}function ZT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZT=function(){return!!e})()}function P5(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F5(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 P5(e)}function Pn(e,t,n){return t=cs(t),F5(e,ZT()?Reflect.construct(t,n||[],cs(e).constructor):t.apply(e,n))}function Gg(e,t){return Gg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Gg(e,t)}function Fn(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&&Gg(e,t)}function I5(e){if(Array.isArray(e))return e}function G5(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,l,u=[],f=!0,d=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);f=!0);}catch(p){d=!0,i=p}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return u}}function Ug(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function QT(e,t){if(e){if(typeof e=="string")return Ug(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)?Ug(e,t):void 0}}function U5(){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 fs(e,t){return I5(e)||G5(e,t)||QT(e,t)||U5()}var lm={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"},JT=new Int8Array(4),lf=new Int32Array(JT.buffer,0,1),eA=new Float32Array(JT.buffer,0,1),B5=/^\s*rgba?\s*\(/,$5=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function H5(e){var t=0,n=0,r=0,i=1;if(e[0]==="#")e.length===4?(t=parseInt(e.charAt(1)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(2),16),r=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(4),16),r=parseInt(e.charAt(5)+e.charAt(6),16)),e.length===9&&(i=parseInt(e.charAt(7)+e.charAt(8),16)/255);else if(B5.test(e)){var o=e.match($5);o&&(t=+o[1],n=+o[2],r=+o[3],o[4]&&(i=+o[4]))}return{r:t,g:n,b:r,a:i}}var is={};for(var Ic in lm)is[Ic]=Yr(lm[Ic]),is[lm[Ic]]=is[Ic];function tA(e,t,n,r,i){return lf[0]=r<<24|n<<16|t<<8|e,lf[0]=lf[0]&4278190079,eA[0]}function Yr(e){if(e=e.toLowerCase(),typeof is[e]<"u")return is[e];var t=H5(e),n=t.r,r=t.g,i=t.b,o=t.a;o=o*255|0;var l=tA(n,r,i,o);return is[e]=l,l}function V5(e,t){eA[0]=Yr(e);var n=lf[0],r=n&255,i=n>>8&255,o=n>>16&255,l=n>>24&255;return[r,i,o,l]}var um={};function nA(e){if(typeof um[e]<"u")return um[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,r=e&255,i=255,o=tA(t,n,r,i);return um[e]=o,o}function q1(e,t,n,r){return n+(t<<8)+(e<<16)}function Y1(e,t,n,r,i,o){var l=Math.floor(n/o*i),u=Math.floor(e.drawingBufferHeight/o-r/o*i),f=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(l,u,1,1,e.RGBA,e.UNSIGNED_BYTE,f);var d=fs(f,4),p=d[0],m=d[1],v=d[2],g=d[3];return[p,m,v,g]}function ke(e,t,n){return(t=Gl(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W1(Object(n),!0).forEach(function(r){ke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q5(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=cs(e))!==null;);return e}function Bg(){return Bg=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=q5(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Bg.apply(null,arguments)}function rA(e,t,n,r){var i=Bg(cs(e.prototype),t,n);return typeof i=="function"?function(o){return i.apply(n,o)}:i}function Y5(e){return e.normalized?1:e.size}function cm(e){var t=0;return e.forEach(function(n){return t+=Y5(n)}),t}function iA(e,t,n){var r=e==="VERTEX"?t.VERTEX_SHADER:t.FRAGMENT_SHADER,i=t.createShader(r);if(i===null)throw new Error("loadShader: error while creating the shader");t.shaderSource(i,n),t.compileShader(i);var o=t.getShaderParameter(i,t.COMPILE_STATUS);if(!o){var l=t.getShaderInfoLog(i);throw t.deleteShader(i),new Error(`loadShader: error while compiling the shader:
`.concat(l,`
`).concat(n))}return i}function W5(e,t){return iA("VERTEX",e,t)}function X5(e,t){return iA("FRAGMENT",e,t)}function K5(e,t){var n=e.createProgram();if(n===null)throw new Error("loadProgram: error while creating the program.");var r,i;for(r=0,i=t.length;r<i;r++)e.attachShader(n,t[r]);e.linkProgram(n);var o=e.getProgramParameter(n,e.LINK_STATUS);if(!o)throw e.deleteProgram(n),new Error("loadProgram: error while linking the program.");return n}function X1(e){var t=e.gl,n=e.buffer,r=e.program,i=e.vertexShader,o=e.fragmentShader;t.deleteShader(i),t.deleteShader(o),t.deleteProgram(r),t.deleteBuffer(n)}function K1(e){return e%1===0?e.toFixed(1):e.toString()}var Z1=`#define PICKING_MODE
`,Z5=ke(ke(ke(ke(ke(ke(ke(ke({},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),aA=function(){function e(t,n,r){tn(this,e),ke(this,"array",new Float32Array),ke(this,"constantArray",new Float32Array),ke(this,"capacity",0),ke(this,"verticesCount",0);var i=this.getDefinition();if(this.VERTICES=i.VERTICES,this.VERTEX_SHADER_SOURCE=i.VERTEX_SHADER_SOURCE,this.FRAGMENT_SHADER_SOURCE=i.FRAGMENT_SHADER_SOURCE,this.UNIFORMS=i.UNIFORMS,this.ATTRIBUTES=i.ATTRIBUTES,this.METHOD=i.METHOD,this.CONSTANT_ATTRIBUTES="CONSTANT_ATTRIBUTES"in i?i.CONSTANT_ATTRIBUTES:[],this.CONSTANT_DATA="CONSTANT_DATA"in i?i.CONSTANT_DATA:[],this.isInstanced="CONSTANT_ATTRIBUTES"in i,this.ATTRIBUTES_ITEMS_COUNT=cm(this.ATTRIBUTES),this.STRIDE=this.VERTICES*this.ATTRIBUTES_ITEMS_COUNT,this.renderer=r,this.normalProgram=this.getProgramInfo("normal",t,i.VERTEX_SHADER_SOURCE,i.FRAGMENT_SHADER_SOURCE,null),this.pickProgram=n?this.getProgramInfo("pick",t,Z1+i.VERTEX_SHADER_SOURCE,Z1+i.FRAGMENT_SHADER_SOURCE,n):null,this.isInstanced){var o=cm(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*o);for(var l=0;l<this.CONSTANT_DATA.length;l++){var u=this.CONSTANT_DATA[l];if(u.length!==o)throw new Error("Program: error while getting constant data (one vector has ".concat(u.length," items instead of ").concat(o,")"));for(var f=0;f<u.length;f++)this.constantArray[l*o+f]=u[f]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return nn(e,[{key:"kill",value:function(){X1(this.normalProgram),this.pickProgram&&(X1(this.pickProgram),this.pickProgram=null)}},{key:"getProgramInfo",value:function(n,r,i,o,l){var u=this.getDefinition(),f=r.createBuffer();if(f===null)throw new Error("Program: error while creating the WebGL buffer.");var d=W5(r,i),p=X5(r,o),m=K5(r,[d,p]),v={};u.UNIFORMS.forEach(function(x){var k=r.getUniformLocation(m,x);k&&(v[x]=k)});var g={};u.ATTRIBUTES.forEach(function(x){g[x.name]=r.getAttribLocation(m,x.name)});var w;if("CONSTANT_ATTRIBUTES"in u&&(u.CONSTANT_ATTRIBUTES.forEach(function(x){g[x.name]=r.getAttribLocation(m,x.name)}),w=r.createBuffer(),w===null))throw new Error("Program: error while creating the WebGL constant buffer.");return{name:n,program:m,gl:r,frameBuffer:l,buffer:f,constantBuffer:w||{},uniformLocations:v,attributeLocations:g,isPicking:n==="pick",vertexShader:d,fragmentShader:p}}},{key:"bindProgram",value:function(n){var r=this,i=0,o=n.gl,l=n.buffer;this.isInstanced?(o.bindBuffer(o.ARRAY_BUFFER,n.constantBuffer),i=0,this.CONSTANT_ATTRIBUTES.forEach(function(u){return i+=r.bindAttribute(u,n,i,!1)}),o.bufferData(o.ARRAY_BUFFER,this.constantArray,o.STATIC_DRAW),o.bindBuffer(o.ARRAY_BUFFER,n.buffer),i=0,this.ATTRIBUTES.forEach(function(u){return i+=r.bindAttribute(u,n,i,!0)}),o.bufferData(o.ARRAY_BUFFER,this.array,o.DYNAMIC_DRAW)):(o.bindBuffer(o.ARRAY_BUFFER,l),i=0,this.ATTRIBUTES.forEach(function(u){return i+=r.bindAttribute(u,n,i)}),o.bufferData(o.ARRAY_BUFFER,this.array,o.DYNAMIC_DRAW)),o.bindBuffer(o.ARRAY_BUFFER,null)}},{key:"unbindProgram",value:function(n){var r=this;this.isInstanced?(this.CONSTANT_ATTRIBUTES.forEach(function(i){return r.unbindAttribute(i,n,!1)}),this.ATTRIBUTES.forEach(function(i){return r.unbindAttribute(i,n,!0)})):this.ATTRIBUTES.forEach(function(i){return r.unbindAttribute(i,n)})}},{key:"bindAttribute",value:function(n,r,i,o){var l=Z5[n.type];if(typeof l!="number")throw new Error('Program.bind: yet unsupported attribute type "'.concat(n.type,'"'));var u=r.attributeLocations[n.name],f=r.gl;if(u!==-1){f.enableVertexAttribArray(u);var d=this.isInstanced?(o?this.ATTRIBUTES_ITEMS_COUNT:cm(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,d,i),this.isInstanced&&o)if(f instanceof WebGL2RenderingContext)f.vertexAttribDivisor(u,1);else{var p=f.getExtension("ANGLE_instanced_arrays");p&&p.vertexAttribDivisorANGLE(u,1)}}return n.size*l}},{key:"unbindAttribute",value:function(n,r,i){var o=r.attributeLocations[n.name],l=r.gl;if(o!==-1&&(l.disableVertexAttribArray(o),this.isInstanced&&i))if(l instanceof WebGL2RenderingContext)l.vertexAttribDivisor(o,0);else{var u=l.getExtension("ANGLE_instanced_arrays");u&&u.vertexAttribDivisorANGLE(o,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,r){var i=r.gl,o=r.program;i.enable(i.BLEND),i.useProgram(o),this.setUniforms(n,r),this.drawWebGL(this.METHOD,r)}},{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(Fe(Fe({},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,r){var i=r.gl,o=r.frameBuffer;if(i.bindFramebuffer(i.FRAMEBUFFER,o),!this.isInstanced)i.drawArrays(n,0,this.verticesCount);else if(i instanceof WebGL2RenderingContext)i.drawArraysInstanced(n,0,this.VERTICES,this.capacity);else{var l=i.getExtension("ANGLE_instanced_arrays");l&&l.drawArraysInstancedANGLE(n,0,this.VERTICES,this.capacity)}}}])}(),vy=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"kill",value:function(){rA(t,"kill",this)([])}},{key:"process",value:function(r,i,o){var l=i*this.STRIDE;if(o.hidden){for(var u=l+this.STRIDE;l<u;l++)this.array[l]=0;return}return this.processVisibleItem(nA(r),l,o)}}])}(aA),cu=function(e){function t(){var n;tn(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=Pn(this,t,[].concat(i)),ke(n,"drawLabel",void 0),n}return Fn(t,e),nn(t,[{key:"kill",value:function(){rA(t,"kill",this)([])}},{key:"process",value:function(r,i,o,l,u){var f=i*this.STRIDE;if(u.hidden||o.hidden||l.hidden){for(var d=f+this.STRIDE;f<d;f++)this.array[f]=0;return}return this.processVisibleItem(nA(r),f,o,l,u)}}])}(aA);function oA(e,t){return function(){function n(r,i,o){tn(this,n),ke(this,"drawLabel",t),this.programs=e.map(function(l){return new l(r,i,o)})}return nn(n,[{key:"reallocate",value:function(i){this.programs.forEach(function(o){return o.reallocate(i)})}},{key:"process",value:function(i,o,l,u,f){this.programs.forEach(function(d){return d.process(i,o,l,u,f)})}},{key:"render",value:function(i){this.programs.forEach(function(o){return o.render(i)})}},{key:"kill",value:function(){this.programs.forEach(function(i){return i.kill()})}}])}()}function Q5(e,t,n,r,i){var o=i.edgeLabelSize,l=i.edgeLabelFont,u=i.edgeLabelWeight,f=i.edgeLabelColor.attribute?t[i.edgeLabelColor.attribute]||i.edgeLabelColor.color||"#000":i.edgeLabelColor.color,d=t.label;if(d){e.fillStyle=f,e.font="".concat(u," ").concat(o,"px ").concat(l);var p=n.size,m=r.size,v=n.x,g=n.y,w=r.x,x=r.y,k=(v+w)/2,C=(g+x)/2,_=w-v,T=x-g,N=Math.sqrt(_*_+T*T);if(!(N<p+m)){v+=_*p/N,g+=T*p/N,w-=_*m/N,x-=T*m/N,k=(v+w)/2,C=(g+x)/2,_=w-v,T=x-g,N=Math.sqrt(_*_+T*T);var D=e.measureText(d).width;if(D>N){var L="…";for(d=d+L,D=e.measureText(d).width;D>N&&d.length>1;)d=d.slice(0,-2)+L,D=e.measureText(d).width;if(d.length<4)return}var R;_>0?T>0?R=Math.acos(_/N):R=Math.asin(T/N):T>0?R=Math.acos(_/N)+Math.PI:R=Math.asin(_/N)+Math.PI/2,e.save(),e.translate(k,C),e.rotate(R),e.fillText(d,-D/2,t.size/2+o),e.restore()}}}function sA(e,t,n){if(t.label){var r=n.labelSize,i=n.labelFont,o=n.labelWeight,l=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=l,e.font="".concat(o," ").concat(r,"px ").concat(i),e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function J5(e,t,n){var r=n.labelSize,i=n.labelFont,o=n.labelWeight;e.font="".concat(o," ").concat(r,"px ").concat(i),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var l=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,f=Math.round(u+5),d=Math.round(r+2*l),p=Math.max(t.size,r/2)+l,m=Math.asin(d/2/p),v=Math.sqrt(Math.abs(Math.pow(p,2)-Math.pow(d/2,2)));e.beginPath(),e.moveTo(t.x+v,t.y+d/2),e.lineTo(t.x+p+f,t.y+d/2),e.lineTo(t.x+p+f,t.y-d/2),e.lineTo(t.x+v,t.y-d/2),e.arc(t.x,t.y,p,m,-m),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+l,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,sA(e,t,n)}var eG=`
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
}
`,tG=eG,nG=`
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;
}
`,rG=nG,lA=WebGLRenderingContext,Q1=lA.UNSIGNED_BYTE,fm=lA.FLOAT,iG=["u_sizeRatio","u_correctionRatio","u_matrix"],fu=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:rG,FRAGMENT_SHADER_SOURCE:tG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:iG,ATTRIBUTES:[{name:"a_position",size:2,type:fm},{name:"a_size",size:1,type:fm},{name:"a_color",size:4,type:Q1,normalized:!0},{name:"a_id",size:4,type:Q1,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:fm}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(r,i,o){var l=this.array,u=Yr(o.color);l[i++]=o.x,l[i++]=o.y,l[i++]=o.size,l[i++]=u,l[i++]=r}},{key:"setUniforms",value:function(r,i){var o=i.gl,l=i.uniformLocations,u=l.u_sizeRatio,f=l.u_correctionRatio,d=l.u_matrix;o.uniform1f(f,r.correctionRatio),o.uniform1f(u,r.sizeRatio),o.uniformMatrix3fv(d,!1,r.matrix)}}])}(vy);ke(fu,"ANGLE_1",0);ke(fu,"ANGLE_2",2*Math.PI/3);ke(fu,"ANGLE_3",4*Math.PI/3);var aG=`
precision mediump float;
varying vec4 v_color;
void main(void) {
gl_FragColor = v_color;
}
`,oG=aG,sG=`
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;
}
`,lG=sG,uA=WebGLRenderingContext,J1=uA.UNSIGNED_BYTE,Gc=uA.FLOAT,uG=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],du={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Tf(e){var t=Fe(Fe({},du),e||{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:lG,FRAGMENT_SHADER_SOURCE:oG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:uG,ATTRIBUTES:[{name:"a_position",size:2,type:Gc},{name:"a_normal",size:2,type:Gc},{name:"a_radius",size:1,type:Gc},{name:"a_color",size:4,type:J1,normalized:!0},{name:"a_id",size:4,type:J1,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Gc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(o,l,u,f,d){if(t.extremity==="source"){var p=[f,u];u=p[0],f=p[1]}var m=d.size||1,v=f.size||1,g=u.x,w=u.y,x=f.x,k=f.y,C=Yr(d.color),_=x-g,T=k-w,N=_*_+T*T,D=0,L=0;N&&(N=1/Math.sqrt(N),D=-T*N*m,L=_*N*m);var R=this.array;R[l++]=x,R[l++]=k,R[l++]=-D,R[l++]=-L,R[l++]=v,R[l++]=C,R[l++]=o}},{key:"setUniforms",value:function(o,l){var u=l.gl,f=l.uniformLocations,d=f.u_matrix,p=f.u_sizeRatio,m=f.u_correctionRatio,v=f.u_minEdgeThickness,g=f.u_lengthToThicknessRatio,w=f.u_widenessToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.sizeRatio),u.uniform1f(m,o.correctionRatio),u.uniform1f(v,o.minEdgeThickness),u.uniform1f(g,t.lengthToThicknessRatio),u.uniform1f(w,t.widenessToThicknessRatio)}}])}(cu)}Tf();var cG=`
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
}
`,yy=cG,fG=`
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;
}
`,dG=fG,cA=WebGLRenderingContext,eS=cA.UNSIGNED_BYTE,Ga=cA.FLOAT,hG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],pG={lengthToThicknessRatio:du.lengthToThicknessRatio};function fA(e){var t=Fe(Fe({},pG),{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:dG,FRAGMENT_SHADER_SOURCE:yy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:hG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ga},{name:"a_positionEnd",size:2,type:Ga},{name:"a_normal",size:2,type:Ga},{name:"a_color",size:4,type:eS,normalized:!0},{name:"a_id",size:4,type:eS,normalized:!0},{name:"a_radius",size:1,type:Ga}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ga},{name:"a_normalCoef",size:1,type:Ga},{name:"a_radiusCoef",size:1,type:Ga}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(o,l,u,f,d){var p=d.size||1,m=u.x,v=u.y,g=f.x,w=f.y,x=Yr(d.color),k=g-m,C=w-v,_=f.size||1,T=k*k+C*C,N=0,D=0;T&&(T=1/Math.sqrt(T),N=-C*T*p,D=k*T*p);var L=this.array;L[l++]=m,L[l++]=v,L[l++]=g,L[l++]=w,L[l++]=N,L[l++]=D,L[l++]=x,L[l++]=o,L[l++]=_}},{key:"setUniforms",value:function(o,l){var u=l.gl,f=l.uniformLocations,d=f.u_matrix,p=f.u_zoomRatio,m=f.u_feather,v=f.u_pixelRatio,g=f.u_correctionRatio,w=f.u_sizeRatio,x=f.u_minEdgeThickness,k=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.zoomRatio),u.uniform1f(w,o.sizeRatio),u.uniform1f(g,o.correctionRatio),u.uniform1f(v,o.pixelRatio),u.uniform1f(m,o.antiAliasingFeather),u.uniform1f(x,o.minEdgeThickness),u.uniform1f(k,t.lengthToThicknessRatio)}}])}(cu)}fA();function mG(e){return oA([fA(),Tf(e)])}var gG=mG(),dA=gG,vG=`
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;
}
`,yG=vG,hA=WebGLRenderingContext,tS=hA.UNSIGNED_BYTE,Rl=hA.FLOAT,bG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],xG=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:yG,FRAGMENT_SHADER_SOURCE:yy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:bG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Rl},{name:"a_positionEnd",size:2,type:Rl},{name:"a_normal",size:2,type:Rl},{name:"a_color",size:4,type:tS,normalized:!0},{name:"a_id",size:4,type:tS,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Rl},{name:"a_normalCoef",size:1,type:Rl}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(r,i,o,l,u){var f=u.size||1,d=o.x,p=o.y,m=l.x,v=l.y,g=Yr(u.color),w=m-d,x=v-p,k=w*w+x*x,C=0,_=0;k&&(k=1/Math.sqrt(k),C=-x*k*f,_=w*k*f);var T=this.array;T[i++]=d,T[i++]=p,T[i++]=m,T[i++]=v,T[i++]=C,T[i++]=_,T[i++]=g,T[i++]=r}},{key:"setUniforms",value:function(r,i){var o=i.gl,l=i.uniformLocations,u=l.u_matrix,f=l.u_zoomRatio,d=l.u_feather,p=l.u_pixelRatio,m=l.u_correctionRatio,v=l.u_sizeRatio,g=l.u_minEdgeThickness;o.uniformMatrix3fv(u,!1,r.matrix),o.uniform1f(f,r.zoomRatio),o.uniform1f(v,r.sizeRatio),o.uniform1f(m,r.correctionRatio),o.uniform1f(p,r.pixelRatio),o.uniform1f(d,r.antiAliasingFeather),o.uniform1f(g,r.minEdgeThickness)}}])}(cu),by=function(e){function t(){var n;return tn(this,t),n=Pn(this,t),n.rawEmitter=n,n}return Fn(t,e),nn(t)}(PT.EventEmitter),dm,nS;function Wr(){return nS||(nS=1,dm=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),dm}var wG=Wr();const SG=fn(wG);var EG=function(t){return t},_G=function(t){return t*t},kG=function(t){return t*(2-t)},CG=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},TG=function(t){return t*t*t},AG=function(t){return--t*t*t+1},RG=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},pA={linear:EG,quadraticIn:_G,quadraticOut:kG,quadraticInOut:CG,cubicIn:TG,cubicOut:AG,cubicInOut:RG},mA={easing:"quadraticInOut",duration:150};function DG(e,t,n,r){var i=Object.assign({},mA,n),o=typeof i.easing=="function"?i.easing:pA[i.easing],l=Date.now(),u={};for(var f in t){var d=t[f];u[f]={};for(var p in d)u[f][p]=e.getNodeAttribute(f,p)}var m=null,v=function(){m=null;var w=(Date.now()-l)/i.duration;if(w>=1){for(var x in t){var k=t[x];for(var C in k)e.setNodeAttribute(x,C,k[C])}return}w=o(w);for(var _ in t){var T=t[_],N=u[_];for(var D in T)e.setNodeAttribute(_,D,T[D]*w+N[D]*(1-w))}m=requestAnimationFrame(v)};return v(),function(){m&&cancelAnimationFrame(m)}}function Er(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Uc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function rS(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function iS(e,t,n){return e[6]=t,e[7]=n,e}function ea(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],l=e[4],u=e[5],f=e[6],d=e[7],p=e[8],m=t[0],v=t[1],g=t[2],w=t[3],x=t[4],k=t[5],C=t[6],_=t[7],T=t[8];return e[0]=m*n+v*o+g*f,e[1]=m*r+v*l+g*d,e[2]=m*i+v*u+g*p,e[3]=w*n+x*o+k*f,e[4]=w*r+x*l+k*d,e[5]=w*i+x*u+k*p,e[6]=C*n+_*o+T*f,e[7]=C*r+_*l+T*d,e[8]=C*i+_*u+T*p,e}function $g(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],i=e[1],o=e[3],l=e[4],u=e[6],f=e[7],d=t.x,p=t.y;return{x:d*r+p*o+u*n,y:d*i+p*l+f*n}}function NG(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Dl(e,t,n,r,i){var o=e.angle,l=e.ratio,u=e.x,f=e.y,d=t.width,p=t.height,m=Er(),v=Math.min(d,p)-2*r,g=NG(t,n);return i?(ea(m,iS(Er(),u,f)),ea(m,Uc(Er(),l)),ea(m,rS(Er(),o)),ea(m,Uc(Er(),d/v/2/g,p/v/2/g))):(ea(m,Uc(Er(),2*(v/d)*g,2*(v/p)*g)),ea(m,rS(Er(),-o)),ea(m,Uc(Er(),1/l)),ea(m,iS(Er(),-u,-f))),m}function OG(e,t,n){var r=$g(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),i=r.x,o=r.y;return 1/Math.sqrt(Math.pow(i,2)+Math.pow(o,2))/n.width}function jG(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,i=-1/0;return e.forEachNode(function(o,l){var u=l.x,f=l.y;u<t&&(t=u),u>n&&(n=u),f<r&&(r=f),f>i&&(i=f)}),{x:[t,n],y:[r,i]}}function LG(e){if(!SG(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 zG(e,t,n){var r=document.createElement(e);if(t)for(var i in t)r.style[i]=t[i];if(n)for(var o in n)r.setAttribute(o,n[o]);return r}function aS(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function oS(e,t,n){return n.sort(function(r,i){var o=t(r)||0,l=t(i)||0;return o<l?-1:o>l?1:0})}function sS(e){var t=fs(e.x,2),n=t[0],r=t[1],i=fs(e.y,2),o=i[0],l=i[1],u=Math.max(r-n,l-o),f=(r+n)/2,d=(l+o)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(f)&&(f=0),isNaN(d)&&(d=0);var p=function(v){return{x:.5+(v.x-f)/u,y:.5+(v.y-d)/u}};return p.applyTo=function(m){m.x=.5+(m.x-f)/u,m.y=.5+(m.y-d)/u},p.inverse=function(m){return{x:f+u*(m.x-.5),y:d+u*(m.y-.5)}},p.ratio=u,p}function Hg(e){"@babel/helpers - typeof";return Hg=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},Hg(e)}function lS(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var i=0;t.forEach(function(o){e[r+i]=o,i++})}}function hm(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t<n;t++){var r=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];r&&Object.assign(e,r)}return e}var xy={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:Q5,defaultDrawNodeLabel:sA,defaultDrawNodeHover:J5,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:{}},MG={circle:fu},PG={arrow:dA,line:xG};function pm(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 FG(e){var t=hm({},xy,e);return t.nodeProgramClasses=hm({},MG,t.nodeProgramClasses),t.edgeProgramClasses=hm({},PG,t.edgeProgramClasses),t}var Bc=1.5,uS=function(e){function t(){var n;return tn(this,t),n=Pn(this,t),ke(n,"x",.5),ke(n,"y",.5),ke(n,"angle",0),ke(n,"ratio",1),ke(n,"minRatio",null),ke(n,"maxRatio",null),ke(n,"enabledZooming",!0),ke(n,"enabledPanning",!0),ke(n,"enabledRotation",!0),ke(n,"clean",null),ke(n,"nextFrame",null),ke(n,"previousState",null),ke(n,"enabled",!0),n.previousState=n.getState(),n}return Fn(t,e),nn(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(r){return this.x===r.x&&this.y===r.y&&this.ratio===r.ratio&&this.angle===r.angle}},{key:"getPreviousState",value:function(){var r=this.previousState;return r?{x:r.x,y:r.y,angle:r.angle,ratio:r.ratio}:null}},{key:"getBoundedRatio",value:function(r){var i=r;return typeof this.minRatio=="number"&&(i=Math.max(i,this.minRatio)),typeof this.maxRatio=="number"&&(i=Math.min(i,this.maxRatio)),i}},{key:"validateState",value:function(r){var i={};return this.enabledPanning&&typeof r.x=="number"&&(i.x=r.x),this.enabledPanning&&typeof r.y=="number"&&(i.y=r.y),this.enabledZooming&&typeof r.ratio=="number"&&(i.ratio=this.getBoundedRatio(r.ratio)),this.enabledRotation&&typeof r.angle=="number"&&(i.angle=r.angle),this.clean?this.clean(Fe(Fe({},this.getState()),i)):i}},{key:"isAnimated",value:function(){return!!this.nextFrame}},{key:"setState",value:function(r){if(!this.enabled)return this;this.previousState=this.getState();var i=this.validateState(r);return typeof i.x=="number"&&(this.x=i.x),typeof i.y=="number"&&(this.y=i.y),typeof i.ratio=="number"&&(this.ratio=i.ratio),typeof i.angle=="number"&&(this.angle=i.angle),this.hasState(this.previousState)||this.emit("updated",this.getState()),this}},{key:"updateState",value:function(r){return this.setState(r(this.getState())),this}},{key:"animate",value:function(r){var i=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0;if(!l)return new Promise(function(g){return i.animate(r,o,g)});if(this.enabled){var u=Fe(Fe({},mA),o),f=this.validateState(r),d=typeof u.easing=="function"?u.easing:pA[u.easing],p=Date.now(),m=this.getState(),v=function(){var w=(Date.now()-p)/u.duration;if(w>=1){i.nextFrame=null,i.setState(f),i.animationCallback&&(i.animationCallback.call(null),i.animationCallback=void 0);return}var x=d(w),k={};typeof f.x=="number"&&(k.x=m.x+(f.x-m.x)*x),typeof f.y=="number"&&(k.y=m.y+(f.y-m.y)*x),i.enabledRotation&&typeof f.angle=="number"&&(k.angle=m.angle+(f.angle-m.angle)*x),typeof f.ratio=="number"&&(k.ratio=m.ratio+(f.ratio-m.ratio)*x),i.setState(k),i.nextFrame=requestAnimationFrame(v)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(v)):v(),this.animationCallback=l}}},{key:"animatedZoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio/r}):this.animate({ratio:this.ratio/(r.factor||Bc)},r):this.animate({ratio:this.ratio/Bc})}},{key:"animatedUnzoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio*r}):this.animate({ratio:this.ratio*(r.factor||Bc)},r):this.animate({ratio:this.ratio*Bc})}},{key:"animatedReset",value:function(r){return this.animate({x:.5,y:.5,ratio:1,angle:0},r)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(r){var i=new t;return i.setState(r)}}])}(by);function kr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function yi(e,t){var n=Fe(Fe({},kr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Nl(e){var t="x"in e?e:Fe(Fe({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function IG(e,t){return Fe(Fe({},yi(e,t)),{},{delta:gA(e)})}var GG=2;function uf(e){for(var t=[],n=0,r=Math.min(e.length,GG);n<r;n++)t.push(e[n]);return t}function Ol(e,t,n){var r={touches:uf(e.touches).map(function(i){return kr(i,n)}),previousTouches:t.map(function(i){return kr(i,n)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){r.sigmaDefaultPrevented=!0},original:e};return r}function gA(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 vA=function(e){function t(n,r){var i;return tn(this,t),i=Pn(this,t),i.container=n,i.renderer=r,i}return Fn(t,e),nn(t)}(by),UG=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],BG=UG.reduce(function(e,t){return Fe(Fe({},e),{},ke({},t,xy[t]))},{}),$G=function(e){function t(n,r){var i;return tn(this,t),i=Pn(this,t,[n,r]),ke(i,"enabled",!0),ke(i,"draggedEvents",0),ke(i,"downStartTime",null),ke(i,"lastMouseX",null),ke(i,"lastMouseY",null),ke(i,"isMouseDown",!1),ke(i,"isMoving",!1),ke(i,"movingTimeout",null),ke(i,"startCameraState",null),ke(i,"clicks",0),ke(i,"doubleClickTimeout",null),ke(i,"currentWheelDirection",0),ke(i,"settings",BG),i.handleClick=i.handleClick.bind(i),i.handleRightClick=i.handleRightClick.bind(i),i.handleDown=i.handleDown.bind(i),i.handleUp=i.handleUp.bind(i),i.handleMove=i.handleMove.bind(i),i.handleWheel=i.handleWheel.bind(i),i.handleLeave=i.handleLeave.bind(i),i.handleEnter=i.handleEnter.bind(i),n.addEventListener("click",i.handleClick,{capture:!1}),n.addEventListener("contextmenu",i.handleRightClick,{capture:!1}),n.addEventListener("mousedown",i.handleDown,{capture:!1}),n.addEventListener("wheel",i.handleWheel,{capture:!1}),n.addEventListener("mouseleave",i.handleLeave,{capture:!1}),n.addEventListener("mouseenter",i.handleEnter,{capture:!1}),document.addEventListener("mousemove",i.handleMove,{capture:!1}),document.addEventListener("mouseup",i.handleUp,{capture:!1}),i}return Fn(t,e),nn(t,[{key:"kill",value:function(){var r=this.container;r.removeEventListener("click",this.handleClick),r.removeEventListener("contextmenu",this.handleRightClick),r.removeEventListener("mousedown",this.handleDown),r.removeEventListener("wheel",this.handleWheel),r.removeEventListener("mouseleave",this.handleLeave),r.removeEventListener("mouseenter",this.handleEnter),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("mouseup",this.handleUp)}},{key:"handleClick",value:function(r){var i=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(r);setTimeout(function(){i.clicks=0,i.doubleClickTimeout=null},this.settings.doubleClickTimeout),this.draggedEvents<this.settings.draggedEventsTolerance&&this.emit("click",yi(r,this.container))}}},{key:"handleRightClick",value:function(r){this.enabled&&this.emit("rightClick",yi(r,this.container))}},{key:"handleDoubleClick",value:function(r){if(this.enabled){r.preventDefault(),r.stopPropagation();var i=yi(r,this.container);if(this.emit("doubleClick",i),!i.sigmaDefaultPrevented){var o=this.renderer.getCamera(),l=o.getBoundedRatio(o.getState().ratio/this.settings.doubleClickZoomingRatio);o.animate(this.renderer.getViewportZoomedState(kr(r,this.container),l),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}}},{key:"handleDown",value:function(r){if(this.enabled){if(r.button===0){this.startCameraState=this.renderer.getCamera().getState();var i=kr(r,this.container),o=i.x,l=i.y;this.lastMouseX=o,this.lastMouseY=l,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",yi(r,this.container))}}},{key:"handleUp",value:function(r){var i=this;if(!(!this.enabled||!this.isMouseDown)){var o=this.renderer.getCamera();this.isMouseDown=!1,typeof this.movingTimeout=="number"&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var l=kr(r,this.container),u=l.x,f=l.y,d=o.getState(),p=o.getPreviousState()||{x:0,y:0};this.isMoving?o.animate({x:d.x+this.settings.inertiaRatio*(d.x-p.x),y:d.y+this.settings.inertiaRatio*(d.y-p.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"}):(this.lastMouseX!==u||this.lastMouseY!==f)&&o.setState({x:d.x,y:d.y}),this.isMoving=!1,setTimeout(function(){var m=i.draggedEvents>0;i.draggedEvents=0,m&&i.renderer.getSetting("hideEdgesOnMove")&&i.renderer.refresh()},0),this.emit("mouseup",yi(r,this.container))}}},{key:"handleMove",value:function(r){var i=this;if(this.enabled){var o=yi(r,this.container);if(this.emit("mousemovebody",o),(r.target===this.container||r.composedPath()[0]===this.container)&&this.emit("mousemove",o),!o.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){i.movingTimeout=null,i.isMoving=!1},this.settings.dragTimeout);var l=this.renderer.getCamera(),u=kr(r,this.container),f=u.x,d=u.y,p=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),m=this.renderer.viewportToFramedGraph({x:f,y:d}),v=p.x-m.x,g=p.y-m.y,w=l.getState(),x=w.x+v,k=w.y+g;l.setState({x,y:k}),this.lastMouseX=f,this.lastMouseY=d,r.preventDefault(),r.stopPropagation()}}}},{key:"handleLeave",value:function(r){this.emit("mouseleave",yi(r,this.container))}},{key:"handleEnter",value:function(r){this.emit("mouseenter",yi(r,this.container))}},{key:"handleWheel",value:function(r){var i=this,o=this.renderer.getCamera();if(!(!this.enabled||!o.enabledZooming)){var l=gA(r);if(l){var u=IG(r,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){r.preventDefault(),r.stopPropagation();return}var f=o.getState().ratio,d=l>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,p=o.getBoundedRatio(f*d),m=l>0?1:-1,v=Date.now();f!==p&&(r.preventDefault(),r.stopPropagation(),!(this.currentWheelDirection===m&&this.lastWheelTriggerTime&&v-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(o.animate(this.renderer.getViewportZoomedState(kr(r,this.container),p),{easing:"quadraticOut",duration:this.settings.zoomDuration},function(){i.currentWheelDirection=0}),this.currentWheelDirection=m,this.lastWheelTriggerTime=v))}}}},{key:"setSettings",value:function(r){this.settings=r}}])}(vA),HG=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],VG=HG.reduce(function(e,t){return Fe(Fe({},e),{},ke({},t,xy[t]))},{}),qG=function(e){function t(n,r){var i;return tn(this,t),i=Pn(this,t,[n,r]),ke(i,"enabled",!0),ke(i,"isMoving",!1),ke(i,"hasMoved",!1),ke(i,"touchMode",0),ke(i,"startTouchesPositions",[]),ke(i,"lastTouches",[]),ke(i,"lastTap",null),ke(i,"settings",VG),i.handleStart=i.handleStart.bind(i),i.handleLeave=i.handleLeave.bind(i),i.handleMove=i.handleMove.bind(i),n.addEventListener("touchstart",i.handleStart,{capture:!1}),n.addEventListener("touchcancel",i.handleLeave,{capture:!1}),document.addEventListener("touchend",i.handleLeave,{capture:!1,passive:!1}),document.addEventListener("touchmove",i.handleMove,{capture:!1,passive:!1}),i}return Fn(t,e),nn(t,[{key:"kill",value:function(){var r=this.container;r.removeEventListener("touchstart",this.handleStart),r.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(r){var i=this;if(this.enabled){r.preventDefault();var o=uf(r.touches);if(this.touchMode=o.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=o.map(function(g){return kr(g,i.container)}),this.touchMode===2){var l=fs(this.startTouchesPositions,2),u=l[0],f=u.x,d=u.y,p=l[1],m=p.x,v=p.y;this.startTouchesAngle=Math.atan2(v-d,m-f),this.startTouchesDistance=Math.sqrt(Math.pow(m-f,2)+Math.pow(v-d,2))}this.emit("touchdown",Ol(r,this.lastTouches,this.container)),this.lastTouches=o,this.lastTouchesPositions=this.startTouchesPositions}}},{key:"handleLeave",value:function(r){if(!(!this.enabled||!this.startTouchesPositions.length)){switch(r.cancelable&&r.preventDefault(),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(r.touches.length===1){this.handleStart(r),r.preventDefault();break}case 1:if(this.isMoving){var i=this.renderer.getCamera(),o=i.getState(),l=i.getPreviousState()||{x:0,y:0};i.animate({x:o.x+this.settings.inertiaRatio*(o.x-l.x),y:o.y+this.settings.inertiaRatio*(o.y-l.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit("touchup",Ol(r,this.lastTouches,this.container)),!r.touches.length){var u=kr(this.lastTouches[0],this.container),f=this.startTouchesPositions[0],d=Math.pow(u.x-f.x,2)+Math.pow(u.y-f.y,2);if(!r.touches.length&&d<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var p=Ol(r,this.lastTouches,this.container);if(this.emit("doubletap",p),this.lastTap=null,!p.sigmaDefaultPrevented){var m=this.renderer.getCamera(),v=m.getBoundedRatio(m.getState().ratio/this.settings.doubleClickZoomingRatio);m.animate(this.renderer.getViewportZoomedState(u,v),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var g=Ol(r,this.lastTouches,this.container);this.emit("tap",g),this.lastTap={time:Date.now(),position:g.touches[0]||g.previousTouches[0]}}}this.lastTouches=uf(r.touches),this.startTouchesPositions=[]}}},{key:"handleMove",value:function(r){var i=this;if(!(!this.enabled||!this.startTouchesPositions.length)){r.preventDefault();var o=uf(r.touches),l=o.map(function(H){return kr(H,i.container)}),u=this.lastTouches;this.lastTouches=o,this.lastTouchesPositions=l;var f=Ol(r,u,this.container);if(this.emit("touchmove",f),!f.sigmaDefaultPrevented&&(this.hasMoved||(this.hasMoved=l.some(function(H,M){var O=i.startTouchesPositions[M];return O&&(H.x!==O.x||H.y!==O.y)})),!!this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){i.isMoving=!1},this.settings.dragTimeout);var d=this.renderer.getCamera(),p=this.startCameraState,m=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:{var v=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),g=v.x,w=v.y,x=this.renderer.viewportToFramedGraph(l[0]),k=x.x,C=x.y;d.setState({x:p.x+g-k,y:p.y+w-C});break}case 2:{var _={x:.5,y:.5,angle:0,ratio:1},T=l[0],N=T.x,D=T.y,L=l[1],R=L.x,U=L.y,P=Math.atan2(U-D,R-N)-this.startTouchesAngle,z=Math.hypot(U-D,R-N)/this.startTouchesDistance,V=d.getBoundedRatio(p.ratio/z);_.ratio=V,_.angle=p.angle+P;var q=this.getDimensions(),I=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:p}),Y=Math.min(q.width,q.height)-2*m,Z=Y/q.width,B=Y/q.height,G=V/Y,F=N-Y/2/Z,K=D-Y/2/B,A=[F*Math.cos(-_.angle)-K*Math.sin(-_.angle),K*Math.cos(-_.angle)+F*Math.sin(-_.angle)];F=A[0],K=A[1],_.x=I.x-F*G,_.y=I.y+K*G,d.setState(_);break}}}}}},{key:"setSettings",value:function(r){this.settings=r}}])}(vA);function YG(e){if(Array.isArray(e))return Ug(e)}function WG(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function XG(){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 cS(e){return YG(e)||WG(e)||QT(e)||XG()}function KG(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function mm(e,t){if(e==null)return{};var n,r,i=KG(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var fS=function(){function e(t,n){tn(this,e),this.key=t,this.size=n}return nn(e,null,[{key:"compare",value:function(n,r){return n.size>r.size?-1:n.size<r.size||n.key>r.key?1:-1}}])}(),dS=function(){function e(){tn(this,e),ke(this,"width",0),ke(this,"height",0),ke(this,"cellSize",0),ke(this,"columns",0),ke(this,"rows",0),ke(this,"cells",{})}return nn(e,[{key:"resizeAndClear",value:function(n,r){this.width=n.width,this.height=n.height,this.cellSize=r,this.columns=Math.ceil(n.width/r),this.rows=Math.ceil(n.height/r),this.cells={}}},{key:"getIndex",value:function(n){var r=Math.floor(n.x/this.cellSize),i=Math.floor(n.y/this.cellSize);return i*this.columns+r}},{key:"add",value:function(n,r,i){var o=new fS(n,r),l=this.getIndex(i),u=this.cells[l];u||(u=[],this.cells[l]=u),u.push(o)}},{key:"organize",value:function(){for(var n in this.cells){var r=this.cells[n];r.sort(fS.compare)}}},{key:"getLabelsToDisplay",value:function(n,r){var i=this.cellSize*this.cellSize,o=i/n/n,l=o*r/i,u=Math.ceil(l),f=[];for(var d in this.cells)for(var p=this.cells[d],m=0;m<Math.min(u,p.length);m++)f.push(p[m].key);return f}}])}();function ZG(e){var t=e.graph,n=e.hoveredNode,r=e.highlightedNodes,i=e.displayedNodeLabels,o=[];return t.forEachEdge(function(l,u,f,d){(f===n||d===n||r.has(f)||r.has(d)||i.has(f)&&i.has(d))&&o.push(l)}),o}var QG=150,JG=50,Si=Object.prototype.hasOwnProperty;function eU(e,t,n){if(!Si.call(n,"x")||!Si.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),Si.call(n,"hidden")||(n.hidden=!1),Si.call(n,"highlighted")||(n.highlighted=!1),Si.call(n,"forceLabel")||(n.forceLabel=!1),(!n.type||n.type==="")&&(n.type=e.defaultNodeType),n.zIndex||(n.zIndex=0),n}function tU(e,t,n){return n.color||(n.color=e.defaultEdgeColor),n.label||(n.label=""),n.size||(n.size=.5),Si.call(n,"hidden")||(n.hidden=!1),Si.call(n,"forceLabel")||(n.forceLabel=!1),(!n.type||n.type==="")&&(n.type=e.defaultEdgeType),n.zIndex||(n.zIndex=0),n}var nU=function(e){function t(n,r){var i,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(tn(this,t),i=Pn(this,t),ke(i,"elements",{}),ke(i,"canvasContexts",{}),ke(i,"webGLContexts",{}),ke(i,"pickingLayers",new Set),ke(i,"textures",{}),ke(i,"frameBuffers",{}),ke(i,"activeListeners",{}),ke(i,"labelGrid",new dS),ke(i,"nodeDataCache",{}),ke(i,"edgeDataCache",{}),ke(i,"nodeProgramIndex",{}),ke(i,"edgeProgramIndex",{}),ke(i,"nodesWithForcedLabels",new Set),ke(i,"edgesWithForcedLabels",new Set),ke(i,"nodeExtent",{x:[0,1],y:[0,1]}),ke(i,"nodeZExtent",[1/0,-1/0]),ke(i,"edgeZExtent",[1/0,-1/0]),ke(i,"matrix",Er()),ke(i,"invMatrix",Er()),ke(i,"correctionRatio",1),ke(i,"customBBox",null),ke(i,"normalizationFunction",sS({x:[0,1],y:[0,1]})),ke(i,"graphToViewportRatio",1),ke(i,"itemIDsIndex",{}),ke(i,"nodeIndices",{}),ke(i,"edgeIndices",{}),ke(i,"width",0),ke(i,"height",0),ke(i,"pixelRatio",aS()),ke(i,"pickingDownSizingRatio",2*i.pixelRatio),ke(i,"displayedNodeLabels",new Set),ke(i,"displayedEdgeLabels",new Set),ke(i,"highlightedNodes",new Set),ke(i,"hoveredNode",null),ke(i,"hoveredEdge",null),ke(i,"renderFrame",null),ke(i,"renderHighlightedNodesFrame",null),ke(i,"needToProcess",!1),ke(i,"checkEdgesEventsFrame",null),ke(i,"nodePrograms",{}),ke(i,"nodeHoverPrograms",{}),ke(i,"edgePrograms",{}),i.settings=FG(o),pm(i.settings),LG(n),!(r instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");i.graph=n,i.container=r,i.createWebGLContext("edges",{picking:o.enableEdgeEvents}),i.createCanvasContext("edgeLabels"),i.createWebGLContext("nodes",{picking:!0}),i.createCanvasContext("labels"),i.createCanvasContext("hovers"),i.createWebGLContext("hoverNodes"),i.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),i.resize();for(var l in i.settings.nodeProgramClasses)i.registerNodeProgram(l,i.settings.nodeProgramClasses[l],i.settings.nodeHoverProgramClasses[l]);for(var u in i.settings.edgeProgramClasses)i.registerEdgeProgram(u,i.settings.edgeProgramClasses[u]);return i.camera=new uS,i.bindCameraHandlers(),i.mouseCaptor=new $G(i.elements.mouse,i),i.mouseCaptor.setSettings(i.settings),i.touchCaptor=new qG(i.elements.mouse,i),i.touchCaptor.setSettings(i.settings),i.bindEventHandlers(),i.bindGraphHandlers(),i.handleSettingsUpdate(),i.refresh(),i}return Fn(t,e),nn(t,[{key:"registerNodeProgram",value:function(r,i,o){return this.nodePrograms[r]&&this.nodePrograms[r].kill(),this.nodeHoverPrograms[r]&&this.nodeHoverPrograms[r].kill(),this.nodePrograms[r]=new i(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[r]=new(o||i)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(r,i){return this.edgePrograms[r]&&this.edgePrograms[r].kill(),this.edgePrograms[r]=new i(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(r){if(this.nodePrograms[r]){var i=this.nodePrograms,o=i[r],l=mm(i,[r].map(Gl));o.kill(),this.nodePrograms=l}if(this.nodeHoverPrograms[r]){var u=this.nodeHoverPrograms,f=u[r],d=mm(u,[r].map(Gl));f.kill(),this.nodePrograms=d}return this}},{key:"unregisterEdgeProgram",value:function(r){if(this.edgePrograms[r]){var i=this.edgePrograms,o=i[r],l=mm(i,[r].map(Gl));o.kill(),this.edgePrograms=l}return this}},{key:"resetWebGLTexture",value:function(r){var i=this.webGLContexts[r],o=this.frameBuffers[r],l=this.textures[r];l&&i.deleteTexture(l);var u=i.createTexture();return i.bindFramebuffer(i.FRAMEBUFFER,o),i.bindTexture(i.TEXTURE_2D,u),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.width,this.height,0,i.RGBA,i.UNSIGNED_BYTE,null),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,u,0),this.textures[r]=u,this}},{key:"bindCameraHandlers",value:function(){var r=this;return this.activeListeners.camera=function(){r.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(r){var i=r.x,o=r.y,l=Y1(this.webGLContexts.nodes,this.frameBuffers.nodes,i,o,this.pixelRatio,this.pickingDownSizingRatio),u=q1.apply(void 0,cS(l)),f=this.itemIDsIndex[u];return f&&f.type==="node"?f.id:null}},{key:"bindEventHandlers",value:function(){var r=this;this.activeListeners.handleResize=function(){r.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(o){var l=Nl(o),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}},f=r.getNodeAtPosition(l);if(f&&r.hoveredNode!==f&&!r.nodeDataCache[f].hidden){r.hoveredNode&&r.emit("leaveNode",Fe(Fe({},u),{},{node:r.hoveredNode})),r.hoveredNode=f,r.emit("enterNode",Fe(Fe({},u),{},{node:f})),r.scheduleHighlightedNodesRender();return}if(r.hoveredNode&&r.getNodeAtPosition(l)!==r.hoveredNode){var d=r.hoveredNode;r.hoveredNode=null,r.emit("leaveNode",Fe(Fe({},u),{},{node:d})),r.scheduleHighlightedNodesRender();return}if(r.settings.enableEdgeEvents){var p=r.hoveredNode?null:r.getEdgeAtPoint(u.event.x,u.event.y);p!==r.hoveredEdge&&(r.hoveredEdge&&r.emit("leaveEdge",Fe(Fe({},u),{},{edge:r.hoveredEdge})),p&&r.emit("enterEdge",Fe(Fe({},u),{},{edge:p})),r.hoveredEdge=p)}},this.activeListeners.handleMoveBody=function(o){var l=Nl(o);r.emit("moveBody",{event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(o){var l=Nl(o),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.hoveredNode&&(r.emit("leaveNode",Fe(Fe({},u),{},{node:r.hoveredNode})),r.scheduleHighlightedNodesRender()),r.settings.enableEdgeEvents&&r.hoveredEdge&&(r.emit("leaveEdge",Fe(Fe({},u),{},{edge:r.hoveredEdge})),r.scheduleHighlightedNodesRender()),r.emit("leaveStage",Fe({},u))},this.activeListeners.handleEnter=function(o){var l=Nl(o),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.emit("enterStage",Fe({},u))};var i=function(l){return function(u){var f=Nl(u),d={event:f,preventSigmaDefault:function(){f.preventSigmaDefault()}},p=r.getNodeAtPosition(f);if(p)return r.emit("".concat(l,"Node"),Fe(Fe({},d),{},{node:p}));if(r.settings.enableEdgeEvents){var m=r.getEdgeAtPoint(f.x,f.y);if(m)return r.emit("".concat(l,"Edge"),Fe(Fe({},d),{},{edge:m}))}return r.emit("".concat(l,"Stage"),d)}};return this.activeListeners.handleClick=i("click"),this.activeListeners.handleRightClick=i("rightClick"),this.activeListeners.handleDoubleClick=i("doubleClick"),this.activeListeners.handleWheel=i("wheel"),this.activeListeners.handleDown=i("down"),this.activeListeners.handleUp=i("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 r=this,i=this.graph,o=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(l){var u,f=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachNode(function(p){return r.updateNode(p)});var d=!f||f.some(function(p){return o.has(p)});r.refresh({partialGraph:{nodes:i.nodes()},skipIndexation:!d,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(l){var u,f=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachEdge(function(p){return r.updateEdge(p)});var d=f&&["zIndex","type"].some(function(p){return f==null?void 0:f.includes(p)});r.refresh({partialGraph:{edges:i.edges()},skipIndexation:!d,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(l){var u=l.key;r.addNode(u),r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(l){var u=l.key;r.removeNode(u),r.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(l){var u=l.key;r.addEdge(u),r.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(l){var u=l.key;r.removeEdge(u),r.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){r.clearEdgeState(),r.clearEdgeIndices(),r.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){r.clearEdgeState(),r.clearNodeState(),r.clearEdgeIndices(),r.clearNodeIndices(),r.refresh({schedule:!0})},i.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),i.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),i.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),i.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),i.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),i.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),i.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),i.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),i.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),i.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var r=this.graph;r.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),r.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),r.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),r.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),r.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),r.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),r.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),r.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),r.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),r.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(r,i){var o=Y1(this.webGLContexts.edges,this.frameBuffers.edges,r,i,this.pixelRatio,this.pickingDownSizingRatio),l=q1.apply(void 0,cS(o)),u=this.itemIDsIndex[l];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var r=this;this.emit("beforeProcess");var i=this.graph,o=this.settings,l=this.getDimensions();if(this.nodeExtent=jG(this.graph),!this.settings.autoRescale){var u=l.width,f=l.height,d=this.nodeExtent,p=d.x,m=d.y;this.nodeExtent={x:[(p[0]+p[1])/2-u/2,(p[0]+p[1])/2+u/2],y:[(m[0]+m[1])/2-f/2,(m[0]+m[1])/2+f/2]}}this.normalizationFunction=sS(this.customBBox||this.nodeExtent);var v=new uS,g=Dl(v.getState(),l,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(l,o.labelGridCellSize);for(var w={},x={},k={},C={},_=1,T=i.nodes(),N=0,D=T.length;N<D;N++){var L=T[N],R=this.nodeDataCache[L],U=i.getNodeAttributes(L);R.x=U.x,R.y=U.y,this.normalizationFunction.applyTo(R),typeof R.label=="string"&&!R.hidden&&this.labelGrid.add(L,R.size,this.framedGraphToViewport(R,{matrix:g})),w[R.type]=(w[R.type]||0)+1}this.labelGrid.organize();for(var P in this.nodePrograms){if(!Si.call(this.nodePrograms,P))throw new Error('Sigma: could not find a suitable program for node type "'.concat(P,'"!'));this.nodePrograms[P].reallocate(w[P]||0),w[P]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(T=oS(this.nodeZExtent,function(re){return r.nodeDataCache[re].zIndex},T));for(var z=0,V=T.length;z<V;z++){var q=T[z];x[q]=_,C[x[q]]={type:"node",id:q},_++;var I=this.nodeDataCache[q];this.addNodeToProgram(q,x[q],w[I.type]++)}for(var Y={},Z=i.edges(),B=0,G=Z.length;B<G;B++){var F=Z[B],K=this.edgeDataCache[F];Y[K.type]=(Y[K.type]||0)+1}this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(Z=oS(this.edgeZExtent,function(re){return r.edgeDataCache[re].zIndex},Z));for(var A in this.edgePrograms){if(!Si.call(this.edgePrograms,A))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(A,'"!'));this.edgePrograms[A].reallocate(Y[A]||0),Y[A]=0}for(var H=0,M=Z.length;H<M;H++){var O=Z[H];k[O]=_,C[k[O]]={type:"edge",id:O},_++;var X=this.edgeDataCache[O];this.addEdgeToProgram(O,k[O],Y[X.type]++)}return this.itemIDsIndex=C,this.nodeIndices=x,this.edgeIndices=k,this.emit("afterProcess"),this}},{key:"handleSettingsUpdate",value:function(r){var i=this,o=this.settings;if(this.camera.minRatio=o.minCameraRatio,this.camera.maxRatio=o.maxCameraRatio,this.camera.enabledZooming=o.enableCameraZooming,this.camera.enabledPanning=o.enableCameraPanning,this.camera.enabledRotation=o.enableCameraRotation,o.cameraPanBoundaries?this.camera.clean=function(p){return i.cleanCameraState(p,o.cameraPanBoundaries&&Hg(o.cameraPanBoundaries)==="object"?o.cameraPanBoundaries:{})}:this.camera.clean=null,this.camera.setState(this.camera.validateState(this.camera.getState())),r){if(r.edgeProgramClasses!==o.edgeProgramClasses){for(var l in o.edgeProgramClasses)o.edgeProgramClasses[l]!==r.edgeProgramClasses[l]&&this.registerEdgeProgram(l,o.edgeProgramClasses[l]);for(var u in r.edgeProgramClasses)o.edgeProgramClasses[u]||this.unregisterEdgeProgram(u)}if(r.nodeProgramClasses!==o.nodeProgramClasses||r.nodeHoverProgramClasses!==o.nodeHoverProgramClasses){for(var f in o.nodeProgramClasses)(o.nodeProgramClasses[f]!==r.nodeProgramClasses[f]||o.nodeHoverProgramClasses[f]!==r.nodeHoverProgramClasses[f])&&this.registerNodeProgram(f,o.nodeProgramClasses[f],o.nodeHoverProgramClasses[f]);for(var d in r.nodeProgramClasses)o.nodeProgramClasses[d]||this.unregisterNodeProgram(d)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:"cleanCameraState",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.tolerance,l=o===void 0?0:o,u=i.boundaries,f=Fe({},r),d=u||this.nodeExtent,p=fs(d.x,2),m=p[0],v=p[1],g=fs(d.y,2),w=g[0],x=g[1],k=[this.graphToViewport({x:m,y:w},{cameraState:r}),this.graphToViewport({x:v,y:w},{cameraState:r}),this.graphToViewport({x:m,y:x},{cameraState:r}),this.graphToViewport({x:v,y:x},{cameraState:r})],C=1/0,_=-1/0,T=1/0,N=-1/0;k.forEach(function(Y){var Z=Y.x,B=Y.y;C=Math.min(C,Z),_=Math.max(_,Z),T=Math.min(T,B),N=Math.max(N,B)});var D=_-C,L=N-T,R=this.getDimensions(),U=R.width,P=R.height,z=0,V=0;if(D>=U?_<U-l?z=_-(U-l):C>l&&(z=C-l):_>U+l?z=_-(U+l):C<-l&&(z=C+l),L>=P?N<P-l?V=N-(P-l):T>l&&(V=T-l):N>P+l?V=N-(P+l):T<-l&&(V=T+l),z||V){var q=this.viewportToFramedGraph({x:0,y:0},{cameraState:r}),I=this.viewportToFramedGraph({x:z,y:V},{cameraState:r});z=I.x-q.x,V=I.y-q.y,f.x+=z,f.y+=V}return f}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var r=this.camera.getState(),i=this.labelGrid.getLabelsToDisplay(r.ratio,this.settings.labelDensity);lS(i,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var o=this.canvasContexts.labels,l=0,u=i.length;l<u;l++){var f=i[l],d=this.nodeDataCache[f];if(!this.displayedNodeLabels.has(f)&&!d.hidden){var p=this.framedGraphToViewport(d),m=p.x,v=p.y,g=this.scaleSize(d.size);if(!(!d.forceLabel&&g<this.settings.labelRenderedSizeThreshold)&&!(m<-150||m>this.width+QG||v<-50||v>this.height+JG)){this.displayedNodeLabels.add(f);var w=this.settings.defaultDrawNodeLabel,x=this.nodePrograms[d.type],k=(x==null?void 0:x.drawLabel)||w;k(o,Fe(Fe({key:f},d),{},{size:g,x:m,y:v}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var r=this.canvasContexts.edgeLabels;r.clearRect(0,0,this.width,this.height);var i=ZG({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});lS(i,this.edgesWithForcedLabels);for(var o=new Set,l=0,u=i.length;l<u;l++){var f=i[l],d=this.graph.extremities(f),p=this.nodeDataCache[d[0]],m=this.nodeDataCache[d[1]],v=this.edgeDataCache[f];if(!o.has(f)&&!(v.hidden||p.hidden||m.hidden)){var g=this.settings.defaultDrawEdgeLabel,w=this.edgePrograms[v.type],x=(w==null?void 0:w.drawLabel)||g;x(r,Fe(Fe({key:f},v),{},{size:this.scaleSize(v.size)}),Fe(Fe(Fe({key:d[0]},p),this.framedGraphToViewport(p)),{},{size:this.scaleSize(p.size)}),Fe(Fe(Fe({key:d[1]},m),this.framedGraphToViewport(m)),{},{size:this.scaleSize(m.size)}),this.settings),o.add(f)}}return this.displayedEdgeLabels=o,this}},{key:"renderHighlightedNodes",value:function(){var r=this,i=this.canvasContexts.hovers;i.clearRect(0,0,this.width,this.height);var o=function(g){var w=r.nodeDataCache[g],x=r.framedGraphToViewport(w),k=x.x,C=x.y,_=r.scaleSize(w.size),T=r.settings.defaultDrawNodeHover,N=r.nodePrograms[w.type],D=(N==null?void 0:N.drawHover)||T;D(i,Fe(Fe({key:g},w),{},{size:_,x:k,y:C}),r.settings)},l=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&l.push(this.hoveredNode),this.highlightedNodes.forEach(function(v){v!==r.hoveredNode&&l.push(v)}),l.forEach(function(v){return o(v)});var u={};l.forEach(function(v){var g=r.nodeDataCache[v].type;u[g]=(u[g]||0)+1});for(var f in this.nodeHoverPrograms)this.nodeHoverPrograms[f].reallocate(u[f]||0),u[f]=0;l.forEach(function(v){var g=r.nodeDataCache[v];r.nodeHoverPrograms[g.type].process(0,u[g.type]++,g)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var d=this.getRenderParams();for(var p in this.nodeHoverPrograms){var m=this.nodeHoverPrograms[p];m.render(d)}}},{key:"scheduleHighlightedNodesRender",value:function(){var r=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=requestAnimationFrame(function(){r.renderHighlightedNodesFrame=null,r.renderHighlightedNodes(),r.renderEdgeLabels()}))}},{key:"render",value:function(){var r=this;this.emit("beforeRender");var i=function(){return r.emit("afterRender"),r};if(this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.resize(),this.needToProcess&&this.process(),this.needToProcess=!1,this.clear(),this.pickingLayers.forEach(function(k){return r.resetWebGLTexture(k)}),!this.graph.order)return i();var o=this.mouseCaptor,l=this.camera.isAnimated()||o.isMoving||o.draggedEvents||o.currentWheelDirection,u=this.camera.getState(),f=this.getDimensions(),d=this.getGraphDimensions(),p=this.getStagePadding();this.matrix=Dl(u,f,d,p),this.invMatrix=Dl(u,f,d,p,!0),this.correctionRatio=OG(this.matrix,u,f),this.graphToViewportRatio=this.getGraphToViewportRatio();var m=this.getRenderParams();for(var v in this.nodePrograms){var g=this.nodePrograms[v];g.render(m)}if(!this.settings.hideEdgesOnMove||!l)for(var w in this.edgePrograms){var x=this.edgePrograms[w];x.render(m)}return this.settings.hideLabelsOnMove&&l||(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes()),i()}},{key:"addNode",value:function(r){var i=Object.assign({},this.graph.getNodeAttributes(r));this.settings.nodeReducer&&(i=this.settings.nodeReducer(r,i));var o=eU(this.settings,r,i);this.nodeDataCache[r]=o,this.nodesWithForcedLabels.delete(r),o.forceLabel&&!o.hidden&&this.nodesWithForcedLabels.add(r),this.highlightedNodes.delete(r),o.highlighted&&!o.hidden&&this.highlightedNodes.add(r),this.settings.zIndex&&(o.zIndex<this.nodeZExtent[0]&&(this.nodeZExtent[0]=o.zIndex),o.zIndex>this.nodeZExtent[1]&&(this.nodeZExtent[1]=o.zIndex))}},{key:"updateNode",value:function(r){this.addNode(r);var i=this.nodeDataCache[r];this.normalizationFunction.applyTo(i)}},{key:"removeNode",value:function(r){delete this.nodeDataCache[r],delete this.nodeProgramIndex[r],this.highlightedNodes.delete(r),this.hoveredNode===r&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(r)}},{key:"addEdge",value:function(r){var i=Object.assign({},this.graph.getEdgeAttributes(r));this.settings.edgeReducer&&(i=this.settings.edgeReducer(r,i));var o=tU(this.settings,r,i);this.edgeDataCache[r]=o,this.edgesWithForcedLabels.delete(r),o.forceLabel&&!o.hidden&&this.edgesWithForcedLabels.add(r),this.settings.zIndex&&(o.zIndex<this.edgeZExtent[0]&&(this.edgeZExtent[0]=o.zIndex),o.zIndex>this.edgeZExtent[1]&&(this.edgeZExtent[1]=o.zIndex))}},{key:"updateEdge",value:function(r){this.addEdge(r)}},{key:"removeEdge",value:function(r){delete this.edgeDataCache[r],delete this.edgeProgramIndex[r],this.hoveredEdge===r&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(r)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new dS,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(r,i,o){var l=this.nodeDataCache[r],u=this.nodePrograms[l.type];if(!u)throw new Error('Sigma: could not find a suitable program for node type "'.concat(l.type,'"!'));u.process(i,o,l),this.nodeProgramIndex[r]=o}},{key:"addEdgeToProgram",value:function(r,i,o){var l=this.edgeDataCache[r],u=this.edgePrograms[l.type];if(!u)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(l.type,'"!'));var f=this.graph.extremities(r),d=this.nodeDataCache[f[0]],p=this.nodeDataCache[f[1]];u.process(i,o,d,p,l),this.edgeProgramIndex[r]=o}},{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 r=this.settings,i=r.stagePadding,o=r.autoRescale;return o&&i||0}},{key:"createLayer",value:function(r,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[r])throw new Error('Sigma: a layer named "'.concat(r,'" already exists'));var l=zG(i,{position:"absolute"},{class:"sigma-".concat(r)});return o.style&&Object.assign(l.style,o.style),this.elements[r]=l,"beforeLayer"in o&&o.beforeLayer?this.elements[o.beforeLayer].before(l):"afterLayer"in o&&o.afterLayer?this.elements[o.afterLayer].after(l):this.container.appendChild(l),l}},{key:"createCanvas",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(r,"canvas",i)}},{key:"createCanvasContext",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.createCanvas(r,i),l={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[r]=o.getContext("2d",l),this}},{key:"createWebGLContext",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=(i==null?void 0:i.canvas)||this.createCanvas(r,i);i.hidden&&o.remove();var l=Fe({preserveDrawingBuffer:!1,antialias:!1},i),u;u=o.getContext("webgl2",l),u||(u=o.getContext("webgl",l)),u||(u=o.getContext("experimental-webgl",l));var f=u;if(this.webGLContexts[r]=f,f.blendFunc(f.ONE,f.ONE_MINUS_SRC_ALPHA),i.picking){this.pickingLayers.add(r);var d=f.createFramebuffer();if(!d)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(r));this.frameBuffers[r]=d}return f}},{key:"killLayer",value:function(r){var i=this.elements[r];if(!i)throw new Error("Sigma: cannot kill layer ".concat(r,", which does not exist"));if(this.webGLContexts[r]){var o,l=this.webGLContexts[r];(o=l.getExtension("WEBGL_lose_context"))===null||o===void 0||o.loseContext(),delete this.webGLContexts[r]}else this.canvasContexts[r]&&delete this.canvasContexts[r];return i.remove(),delete this.elements[r],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(r){this.unbindCameraHandlers(),this.camera=r,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(r){r!==this.graph&&(this.hoveredNode&&!r.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!r.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=r,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 r=this.customBBox||this.nodeExtent;return{width:r.x[1]-r.x[0]||1,height:r.y[1]-r.y[0]||1}}},{key:"getNodeDisplayData",value:function(r){var i=this.nodeDataCache[r];return i?Object.assign({},i):void 0}},{key:"getEdgeDisplayData",value:function(r){var i=this.edgeDataCache[r];return i?Object.assign({},i):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 Fe({},this.settings)}},{key:"getSetting",value:function(r){return this.settings[r]}},{key:"setSetting",value:function(r,i){var o=Fe({},this.settings);return this.settings[r]=i,pm(this.settings),this.handleSettingsUpdate(o),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(r,i){return this.setSetting(r,i(this.settings[r])),this}},{key:"setSettings",value:function(r){var i=Fe({},this.settings);return this.settings=Fe(Fe({},this.settings),r),pm(this.settings),this.handleSettingsUpdate(i),this.scheduleRefresh(),this}},{key:"resize",value:function(r){var i=this.width,o=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=aS(),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(!r&&i===this.width&&o===this.height)return this;for(var l in this.elements){var u=this.elements[l];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 d in this.webGLContexts){this.elements[d].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[d].setAttribute("height",this.height*this.pixelRatio+"px");var p=this.webGLContexts[d];if(p.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(d)){var m=this.textures[d];m&&p.deleteTexture(m)}}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(r){var i=this,o=(r==null?void 0:r.skipIndexation)!==void 0?r==null?void 0:r.skipIndexation:!1,l=(r==null?void 0:r.schedule)!==void 0?r.schedule:!1,u=!r||!r.partialGraph;if(u)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(N){return i.addNode(N)}),this.graph.forEachEdge(function(N){return i.addEdge(N)});else{for(var f,d,p=((f=r.partialGraph)===null||f===void 0?void 0:f.nodes)||[],m=0,v=(p==null?void 0:p.length)||0;m<v;m++){var g=p[m];if(this.updateNode(g),o){var w=this.nodeProgramIndex[g];if(w===void 0)throw new Error('Sigma: node "'.concat(g,`" can't be repaint`));this.addNodeToProgram(g,this.nodeIndices[g],w)}}for(var x=(r==null||(d=r.partialGraph)===null||d===void 0?void 0:d.edges)||[],k=0,C=x.length;k<C;k++){var _=x[k];if(this.updateEdge(_),o){var T=this.edgeProgramIndex[_];if(T===void 0)throw new Error('Sigma: edge "'.concat(_,`" can't be repaint`));this.addEdgeToProgram(_,this.edgeIndices[_],T)}}}return(u||!o)&&(this.needToProcess=!0),l?this.scheduleRender():this.render(),this}},{key:"scheduleRender",value:function(){var r=this;return this.renderFrame||(this.renderFrame=requestAnimationFrame(function(){r.render()})),this}},{key:"scheduleRefresh",value:function(r){return this.refresh(Fe(Fe({},r),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(r,i){var o=this.camera.getState(),l=o.ratio,u=o.angle,f=o.x,d=o.y,p=this.settings,m=p.minCameraRatio,v=p.maxCameraRatio;typeof v=="number"&&(i=Math.min(i,v)),typeof m=="number"&&(i=Math.max(i,m));var g=i/l,w={x:this.width/2,y:this.height/2},x=this.viewportToFramedGraph(r),k=this.viewportToFramedGraph(w);return{angle:u,x:(x.x-k.x)*(1-g)+f,y:(x.y-k.y)*(1-g)+d,ratio:i}}},{key:"viewRectangle",value:function(){var r=this.viewportToFramedGraph({x:0,y:0}),i=this.viewportToFramedGraph({x:this.width,y:0}),o=this.viewportToFramedGraph({x:0,y:this.height});return{x1:r.x,y1:r.y,x2:i.x,y2:i.y,height:i.y-o.y}}},{key:"framedGraphToViewport",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=!!i.cameraState||!!i.viewportDimensions||!!i.graphDimensions,l=i.matrix?i.matrix:o?Dl(i.cameraState||this.camera.getState(),i.viewportDimensions||this.getDimensions(),i.graphDimensions||this.getGraphDimensions(),i.padding||this.getStagePadding()):this.matrix,u=$g(l,r);return{x:(1+u.x)*this.width/2,y:(1-u.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=!!i.cameraState||!!i.viewportDimensions||!i.graphDimensions,l=i.matrix?i.matrix:o?Dl(i.cameraState||this.camera.getState(),i.viewportDimensions||this.getDimensions(),i.graphDimensions||this.getGraphDimensions(),i.padding||this.getStagePadding(),!0):this.invMatrix,u=$g(l,{x:r.x/this.width*2-1,y:1-r.y/this.height*2});return isNaN(u.x)&&(u.x=0),isNaN(u.y)&&(u.y=0),u}},{key:"viewportToGraph",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(r,i))}},{key:"graphToViewport",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(r),i)}},{key:"getGraphToViewportRatio",value:function(){var r={x:0,y:0},i={x:1,y:1},o=Math.sqrt(Math.pow(r.x-i.x,2)+Math.pow(r.y-i.y,2)),l=this.graphToViewport(r),u=this.graphToViewport(i),f=Math.sqrt(Math.pow(l.x-u.x,2)+Math.pow(l.y-u.y,2));return f/o}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(r){return this.customBBox=r,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 r=this.container;r.firstChild;)r.removeChild(r.firstChild);this.canvasContexts={},this.webGLContexts={},this.elements={};for(var i in this.nodePrograms)this.nodePrograms[i].kill();for(var o in this.nodeHoverPrograms)this.nodeHoverPrograms[o].kill();for(var l in this.edgePrograms)this.edgePrograms[l].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var u in this.elements)this.killLayer(u)}},{key:"scaleSize",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return r/this.settings.zoomToSizeRatioFunction(i)*(this.getSetting("itemSizesReference")==="positions"?i*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var r={};for(var i in this.elements)this.elements[i]instanceof HTMLCanvasElement&&(r[i]=this.elements[i]);return r}}])}(by);const yA=E.createContext(null),rU=yA.Provider;function wy(){const e=E.useContext(yA);if(e==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of <SigmaContainer>");return e}function hr(){return wy().sigma}function bA(){const{sigma:e}=wy();return E.useCallback(t=>{e&&Object.keys(t).forEach(n=>{e.setSetting(n,t[n])})},[e])}function vd(e){return new Set(Object.keys(e))}const hS=vd({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}),pS=vd({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),mS=vd({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),gS=vd({updated:!0});function xA(){const e=hr(),t=bA(),[n,r]=E.useState({});return E.useEffect(()=>{if(!e||!n)return;const i=n,o=Object.keys(i);return o.forEach(l=>{const u=i[l];hS.has(l)&&e.on(l,u),pS.has(l)&&e.getMouseCaptor().on(l,u),mS.has(l)&&e.getTouchCaptor().on(l,u),gS.has(l)&&e.getCamera().on(l,u)}),()=>{e&&o.forEach(l=>{const u=i[l];hS.has(l)&&e.off(l,u),pS.has(l)&&e.getMouseCaptor().off(l,u),mS.has(l)&&e.getTouchCaptor().off(l,u),gS.has(l)&&e.getCamera().off(l,u)})}},[e,n,t]),r}function iU(){const e=hr();return E.useCallback((t,n=!0)=>{e&&t&&(n&&e.getGraph().order>0&&e.getGraph().clear(),e.getGraph().import(t),e.refresh())},[e])}function hu(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)||!hu(e[n],t[n]))return!1;return!0}return!1}function wA(e){const t=hr(),[n,r]=E.useState(e||{});E.useEffect(()=>{r(d=>hu(d,e||{})?d:e||{})},[e]);const i=E.useCallback(d=>{t.getCamera().animatedZoom(Object.assign(Object.assign({},n),d))},[t,n]),o=E.useCallback(d=>{t.getCamera().animatedUnzoom(Object.assign(Object.assign({},n),d))},[t,n]),l=E.useCallback(d=>{t.getCamera().animatedReset(Object.assign(Object.assign({},n),d))},[t,n]),u=E.useCallback((d,p)=>{t.getCamera().animate(d,Object.assign(Object.assign({},n),p))},[t,n]),f=E.useCallback((d,p)=>{const m=t.getNodeDisplayData(d);m?t.getCamera().animate(m,Object.assign(Object.assign({},n),p)):console.warn(`Node ${d} not found`)},[t,n]);return{zoomIn:i,zoomOut:o,reset:l,goto:u,gotoNode:f}}function aU(e){const t=wy(),[n,r]=E.useState(!1),[i,o]=E.useState(t.container),l=E.useCallback(()=>r(u=>!u),[]);return E.useEffect(()=>(document.addEventListener("fullscreenchange",l),()=>document.removeEventListener("fullscreenchange",l)),[l]),E.useEffect(()=>{o(t.container)},[e,t.container]),{toggle:E.useCallback(()=>{var u;u=i,document.fullscreenElement!==u?u.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},[i]),isFullScreen:n}}const oU=E.forwardRef(({graph:e,id:t,className:n,style:r,settings:i={},children:o},l)=>{const u=E.useRef(null),f=E.useRef(null),d={className:`react-sigma ${n||""}`,id:t,style:r},[p,m]=E.useState(null),[v,g]=E.useState(i);E.useEffect(()=>{g(k=>hu(k,i)?k:i)},[i]),E.useEffect(()=>{m(k=>{let C=null;if(f.current!==null){let _=new St;e&&(_=typeof e=="function"?new e:e);let T=null;k&&(T=k.getCamera().getState(),k.kill()),C=new nU(_,f.current,v),T&&C.getCamera().setState(T)}return C})},[f,e,v]),E.useImperativeHandle(l,()=>p,[p]);const w=E.useMemo(()=>p&&u.current?{sigma:p,container:u.current}:null,[p,u]),x=w!==null?be.createElement(rU,{value:w},o):null;return be.createElement("div",Object.assign({},d,{ref:u}),be.createElement("div",{className:"sigma-container",ref:f}),x)});var sU=`
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
}
`,lU=sU,uU=`
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;
}
`,cU=uU,SA=WebGLRenderingContext,vS=SA.UNSIGNED_BYTE,yS=SA.FLOAT,fU=["u_sizeRatio","u_pixelRatio","u_matrix"],dU=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:1,VERTEX_SHADER_SOURCE:cU,FRAGMENT_SHADER_SOURCE:lU,METHOD:WebGLRenderingContext.POINTS,UNIFORMS:fU,ATTRIBUTES:[{name:"a_position",size:2,type:yS},{name:"a_size",size:1,type:yS},{name:"a_color",size:4,type:vS,normalized:!0},{name:"a_id",size:4,type:vS,normalized:!0}]}}},{key:"processVisibleItem",value:function(r,i,o){var l=this.array;l[i++]=o.x,l[i++]=o.y,l[i++]=o.size,l[i++]=Yr(o.color),l[i++]=r}},{key:"setUniforms",value:function(r,i){var o=r.sizeRatio,l=r.pixelRatio,u=r.matrix,f=i.gl,d=i.uniformLocations,p=d.u_sizeRatio,m=d.u_pixelRatio,v=d.u_matrix;f.uniform1f(m,l),f.uniform1f(p,o),f.uniformMatrix3fv(v,!1,u)}}])}(vy),hU=`
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;
}
`,pU=hU,EA=WebGLRenderingContext,bS=EA.UNSIGNED_BYTE,gi=EA.FLOAT,mU=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],gU={lengthToThicknessRatio:du.lengthToThicknessRatio};function _A(e){var t=Fe(Fe({},gU),{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:pU,FRAGMENT_SHADER_SOURCE:yy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mU,ATTRIBUTES:[{name:"a_positionStart",size:2,type:gi},{name:"a_positionEnd",size:2,type:gi},{name:"a_normal",size:2,type:gi},{name:"a_color",size:4,type:bS,normalized:!0},{name:"a_id",size:4,type:bS,normalized:!0},{name:"a_sourceRadius",size:1,type:gi},{name:"a_targetRadius",size:1,type:gi}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:gi},{name:"a_normalCoef",size:1,type:gi},{name:"a_sourceRadiusCoef",size:1,type:gi},{name:"a_targetRadiusCoef",size:1,type:gi}],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(o,l,u,f,d){var p=d.size||1,m=u.x,v=u.y,g=f.x,w=f.y,x=Yr(d.color),k=g-m,C=w-v,_=u.size||1,T=f.size||1,N=k*k+C*C,D=0,L=0;N&&(N=1/Math.sqrt(N),D=-C*N*p,L=k*N*p);var R=this.array;R[l++]=m,R[l++]=v,R[l++]=g,R[l++]=w,R[l++]=D,R[l++]=L,R[l++]=x,R[l++]=o,R[l++]=_,R[l++]=T}},{key:"setUniforms",value:function(o,l){var u=l.gl,f=l.uniformLocations,d=f.u_matrix,p=f.u_zoomRatio,m=f.u_feather,v=f.u_pixelRatio,g=f.u_correctionRatio,w=f.u_sizeRatio,x=f.u_minEdgeThickness,k=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.zoomRatio),u.uniform1f(w,o.sizeRatio),u.uniform1f(g,o.correctionRatio),u.uniform1f(v,o.pixelRatio),u.uniform1f(m,o.antiAliasingFeather),u.uniform1f(x,o.minEdgeThickness),u.uniform1f(k,t.lengthToThicknessRatio)}}])}(cu)}_A();function vU(e){return oA([_A(),Tf(e),Tf(Fe(Fe({},e),{},{extremity:"source"}))])}vU();function yU(e){if(Array.isArray(e))return e}function bU(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,l,u=[],f=!0,d=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(f=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);f=!0);}catch(p){d=!0,i=p}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return u}}function Vg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kA(e,t){if(e){if(typeof e=="string")return Vg(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)?Vg(e,t):void 0}}function xU(){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 wU(e,t){return yU(e)||bU(e,t)||kA(e,t)||xU()}function SU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EU(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CA(e){var t=EU(e,"string");return typeof t=="symbol"?t:t+""}function _U(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CA(r.key),r)}}function kU(e,t,n){return t&&_U(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Af(e){return Af=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Af(e)}function TA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TA=function(){return!!e})()}function qg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CU(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 qg(e)}function TU(e,t,n){return t=Af(t),CU(e,TA()?Reflect.construct(t,n||[],Af(e).constructor):t.apply(e,n))}function Yg(e,t){return Yg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Yg(e,t)}function AU(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&&Yg(e,t)}function Zo(e,t,n){return(t=CA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RU(e){if(Array.isArray(e))return Vg(e)}function DU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NU(){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 gm(e){return RU(e)||DU(e)||kA(e)||NU()}function xS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xS(Object(n),!0).forEach(function(r){Zo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var OU="relative",jU={drawLabel:void 0,drawHover:void 0,borders:[{size:{value:.1},color:{attribute:"borderColor"}},{size:{fill:!0},color:{attribute:"color"}}]},LU="#000000";function zU(e){var t=e.borders,n=K1(t.filter(function(i){var o=i.size;return"fill"in o}).length),r=`
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(i,o){var l=i.size;return"attribute"in l?["varying float v_borderSize_".concat(o+1,";")]:[]}).join(`
`),`
`).concat(t.flatMap(function(i,o){var l=i.color;return"attribute"in l?["varying vec4 v_borderColor_".concat(o+1,";")]:"value"in l?["uniform vec4 u_borderColor_".concat(o+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(i,o){var l=i.size;if("fill"in l)return[];l=l;var u="attribute"in l?"v_borderSize_".concat(o+1):K1(l.value),f=(l.mode||OU)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(o+1," = ").concat(f," * ").concat(u,";")]}).join(`
`),`
// Now, let's split the remaining space between "fill" borders:
float fillBorderSize = (v_radius - (`).concat(t.flatMap(function(i,o){var l=i.size;return"fill"in l?[]:["borderSize_".concat(o+1)]}).join(" + "),") ) / ").concat(n,`;
`).concat(t.flatMap(function(i,o){var l=i.size;return"fill"in l?[" float borderSize_".concat(o+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(i,o){return" float adjustedBorderSize_".concat(o+1," = adjustedBorderSize_").concat(o," - borderSize_").concat(o+1,";")}).join(`
`),`
// Colors:
vec4 borderColor_0 = transparent;
`).concat(t.map(function(i,o){var l=i.color,u=[];return"attribute"in l?u.push(" vec4 borderColor_".concat(o+1," = v_borderColor_").concat(o+1,";")):"transparent"in l?u.push(" vec4 borderColor_".concat(o+1," = vec4(0.0, 0.0, 0.0, 0.0);")):u.push(" vec4 borderColor_".concat(o+1," = u_borderColor_").concat(o+1,";")),u.push(" borderColor_".concat(o+1,".a *= bias;")),u.push(" if (borderSize_".concat(o+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(o+1," = borderColor_").concat(o,"; }")),u.join(`
`)}).join(`
`),`
if (dist > adjustedBorderSize_0) {
gl_FragColor = borderColor_0;
} else `).concat(t.map(function(i,o){return"if (dist > adjustedBorderSize_".concat(o,` - aaBorder) {
gl_FragColor = mix(borderColor_`).concat(o+1,", borderColor_").concat(o,", (dist - adjustedBorderSize_").concat(o,` + aaBorder) / aaBorder);
} else if (dist > adjustedBorderSize_`).concat(o+1,`) {
gl_FragColor = borderColor_`).concat(o+1,`;
} else `)}).join(""),` { /* Nothing to add here */ }
#endif
}
`);return r}function MU(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(r,i){var o=r.size;return"attribute"in o?["attribute float a_borderSize_".concat(i+1,";"),"varying float v_borderSize_".concat(i+1,";")]:[]}).join(`
`),`
`).concat(t.flatMap(function(r,i){var o=r.color;return"attribute"in o?["attribute vec4 a_borderColor_".concat(i+1,";"),"varying vec4 v_borderColor_".concat(i+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(r,i){var o=r.size;return"attribute"in o?[" v_borderSize_".concat(i+1," = a_borderSize_").concat(i+1,";")]:[]}).join(`
`),`
`).concat(t.flatMap(function(r,i){var o=r.color;return"attribute"in o?[" v_borderColor_".concat(i+1," = a_borderColor_").concat(i+1,";")]:[]}).join(`
`),`
#endif
}
`);return n}var AA=WebGLRenderingContext,SS=AA.UNSIGNED_BYTE,$c=AA.FLOAT;function PU(e){var t,n=wS(wS({},jU),{}),r=n.borders,i=n.drawLabel,o=n.drawHover,l=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(gm(r.flatMap(function(u,f){var d=u.color;return"value"in d?["u_borderColor_".concat(f+1)]:[]})));return t=function(u){AU(f,u);function f(){var d;SU(this,f);for(var p=arguments.length,m=new Array(p),v=0;v<p;v++)m[v]=arguments[v];return d=TU(this,f,[].concat(m)),Zo(qg(d),"drawLabel",i),Zo(qg(d),"drawHover",o),d}return kU(f,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:MU(n),FRAGMENT_SHADER_SOURCE:zU(n),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:l,ATTRIBUTES:[{name:"a_position",size:2,type:$c},{name:"a_id",size:4,type:SS,normalized:!0},{name:"a_size",size:1,type:$c}].concat(gm(r.flatMap(function(p,m){var v=p.color;return"attribute"in v?[{name:"a_borderColor_".concat(m+1),size:4,type:SS,normalized:!0}]:[]})),gm(r.flatMap(function(p,m){var v=p.size;return"attribute"in v?[{name:"a_borderSize_".concat(m+1),size:1,type:$c}]:[]}))),CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:$c}],CONSTANT_DATA:[[f.ANGLE_1],[f.ANGLE_2],[f.ANGLE_3]]}}},{key:"processVisibleItem",value:function(p,m,v){var g=this.array;g[m++]=v.x,g[m++]=v.y,g[m++]=p,g[m++]=v.size,r.forEach(function(w){var x=w.color;"attribute"in x&&(g[m++]=Yr(v[x.attribute]||x.defaultValue||LU))}),r.forEach(function(w){var x=w.size;"attribute"in x&&(g[m++]=v[x.attribute]||x.defaultValue)})}},{key:"setUniforms",value:function(p,m){var v=m.gl,g=m.uniformLocations,w=g.u_sizeRatio,x=g.u_correctionRatio,k=g.u_matrix;v.uniform1f(x,p.correctionRatio),v.uniform1f(w,p.sizeRatio),v.uniformMatrix3fv(k,!1,p.matrix),r.forEach(function(C,_){var T=C.color;if("value"in T){var N=g["u_borderColor_".concat(_+1)],D=V5(T.value),L=wU(D,4),R=L[0],U=L[1],P=L[2],z=L[3];v.uniform4f(N,R/255,U/255,P/255,z/255)}})}}]),f}(vy),Zo(t,"ANGLE_1",0),Zo(t,"ANGLE_2",2*Math.PI/3),Zo(t,"ANGLE_3",4*Math.PI/3),t}var FU=PU();function IU(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RA(e){var t=IU(e,"string");return typeof t=="symbol"?t:t+""}function DA(e,t,n){return(t=RA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ES(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ES(Object(n),!0).forEach(function(r){DA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ES(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,RA(r.key),r)}}function BU(e,t,n){return t&&UU(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Df(e){return Df=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Df(e)}function NA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NA=function(){return!!e})()}function OA(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $U(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 OA(e)}function HU(e,t,n){return t=Df(t),$U(e,NA()?Reflect.construct(t,n||[],Df(e).constructor):t.apply(e,n))}function Wg(e,t){return Wg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Wg(e,t)}function VU(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&&Wg(e,t)}function Xg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qU(e){if(Array.isArray(e))return Xg(e)}function YU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function WU(e,t){if(e){if(typeof e=="string")return Xg(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)?Xg(e,t):void 0}}function XU(){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 vm(e){return qU(e)||YU(e)||WU(e)||XU()}function jA(e,t,n,r){var i=Math.pow(1-e,2)*t.x+2*(1-e)*e*n.x+Math.pow(e,2)*r.x,o=Math.pow(1-e,2)*t.y+2*(1-e)*e*n.y+Math.pow(e,2)*r.y;return{x:i,y:o}}function KU(e,t,n){for(var r=20,i=0,o=e,l=0;l<r;l++){var u=jA((l+1)/r,e,t,n);i+=Math.sqrt(Math.pow(o.x-u.x,2)+Math.pow(o.y-u.y,2)),o=u}return i}function ZU(e){var t=e.curvatureAttribute,n=e.defaultCurvature,r=e.keepLabelUpright,i=r===void 0?!0:r;return function(o,l,u,f,d){var p=d.edgeLabelSize,m=l[t]||n,v=d.edgeLabelFont,g=d.edgeLabelWeight,w=d.edgeLabelColor.attribute?l[d.edgeLabelColor.attribute]||d.edgeLabelColor.color||"#000":d.edgeLabelColor.color,x=l.label;if(x){o.fillStyle=w,o.font="".concat(g," ").concat(p,"px ").concat(v);var k=!i||u.x<f.x,C=k?u.x:f.x,_=k?u.y:f.y,T=k?f.x:u.x,N=k?f.y:u.y,D=(C+T)/2,L=(_+N)/2,R=T-C,U=N-_,P=Math.sqrt(Math.pow(R,2)+Math.pow(U,2)),z=k?1:-1,V=D+U*m*z,q=L-R*m*z,I=l.size*.7+5,Y={x:q-_,y:-(V-C)},Z=Math.sqrt(Math.pow(Y.x,2)+Math.pow(Y.y,2)),B={x:N-q,y:-(T-V)},G=Math.sqrt(Math.pow(B.x,2)+Math.pow(B.y,2));C+=I*Y.x/Z,_+=I*Y.y/Z,T+=I*B.x/G,N+=I*B.y/G,V+=I*U/P,q-=I*R/P;var F={x:V,y:q},K={x:C,y:_},A={x:T,y:N},H=KU(K,F,A);if(!(H<u.size+f.size)){var M=o.measureText(x).width,O=H-u.size-f.size;if(M>O){var X="…";for(x=x+X,M=o.measureText(x).width;M>O&&x.length>1;)x=x.slice(0,-2)+X,M=o.measureText(x).width;if(x.length<4)return}for(var re={},ue=0,ae=x.length;ue<ae;ue++){var oe=x[ue];re[oe]||(re[oe]=o.measureText(oe).width*(1+m*.35))}for(var Ce=.5-M/H/2,he=0,Ee=x.length;he<Ee;he++){var we=x[he],Pe=jA(Ce,K,F,A),Ae=2*(1-Ce)*(V-C)+2*Ce*(T-V),xe=2*(1-Ce)*(q-_)+2*Ce*(N-q),ee=Math.atan2(xe,Ae);o.save(),o.translate(Pe.x,Pe.y),o.rotate(ee),o.fillText(we,0,0),o.restore(),Ce+=re[we]/H}}}}}function QU(e){var t=e.arrowHead,n=(t==null?void 0:t.extremity)==="target"||(t==null?void 0:t.extremity)==="both",r=(t==null?void 0:t.extremity)==="source"||(t==null?void 0:t.extremity)==="both",i=`
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(r?`
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(r?`
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 i}function JU(e){var t=e.arrowHead,n=(t==null?void 0:t.extremity)==="target"||(t==null?void 0:t.extremity)==="both",r=(t==null?void 0:t.extremity)==="source"||(t==null?void 0:t.extremity)==="both",i=`
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(r?`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(r?`
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(r?`
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 i}var LA=.25,eB={arrowHead:null,curvatureAttribute:"curvature",defaultCurvature:LA},zA=WebGLRenderingContext,_S=zA.UNSIGNED_BYTE,ta=zA.FLOAT;function Sy(e){var t=Rf(Rf({},eB),e||{}),n=t,r=n.arrowHead,i=n.curvatureAttribute,o=n.drawLabel,l=(r==null?void 0:r.extremity)==="target"||(r==null?void 0:r.extremity)==="both",u=(r==null?void 0:r.extremity)==="source"||(r==null?void 0:r.extremity)==="both",f=["u_matrix","u_sizeRatio","u_dimensions","u_pixelRatio","u_feather","u_minEdgeThickness"].concat(vm(r?["u_lengthToThicknessRatio","u_widenessToThicknessRatio"]:[]));return function(d){VU(p,d);function p(){var m;GU(this,p);for(var v=arguments.length,g=new Array(v),w=0;w<v;w++)g[w]=arguments[w];return m=HU(this,p,[].concat(g)),DA(OA(m),"drawLabel",o||ZU(t)),m}return BU(p,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:JU(t),FRAGMENT_SHADER_SOURCE:QU(t),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:f,ATTRIBUTES:[{name:"a_source",size:2,type:ta},{name:"a_target",size:2,type:ta}].concat(vm(l?[{name:"a_targetSize",size:1,type:ta}]:[]),vm(u?[{name:"a_sourceSize",size:1,type:ta}]:[]),[{name:"a_thickness",size:1,type:ta},{name:"a_curvature",size:1,type:ta},{name:"a_color",size:4,type:_S,normalized:!0},{name:"a_id",size:4,type:_S,normalized:!0}]),CONSTANT_ATTRIBUTES:[{name:"a_current",size:1,type:ta},{name:"a_direction",size:1,type:ta}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[0,-1],[1,1],[1,-1]]}}},{key:"processVisibleItem",value:function(v,g,w,x,k){var C,_=k.size||1,T=w.x,N=w.y,D=x.x,L=x.y,R=Yr(k.color),U=(C=k[i])!==null&&C!==void 0?C:LA,P=this.array;P[g++]=T,P[g++]=N,P[g++]=D,P[g++]=L,l&&(P[g++]=x.size),u&&(P[g++]=w.size),P[g++]=_,P[g++]=U,P[g++]=R,P[g++]=v}},{key:"setUniforms",value:function(v,g){var w=g.gl,x=g.uniformLocations,k=x.u_matrix,C=x.u_pixelRatio,_=x.u_feather,T=x.u_sizeRatio,N=x.u_dimensions,D=x.u_minEdgeThickness;if(w.uniformMatrix3fv(k,!1,v.matrix),w.uniform1f(C,v.pixelRatio),w.uniform1f(T,v.sizeRatio),w.uniform1f(_,v.antiAliasingFeather),w.uniform2f(N,v.width*v.pixelRatio,v.height*v.pixelRatio),w.uniform1f(D,v.minEdgeThickness),r){var L=x.u_lengthToThicknessRatio,R=x.u_widenessToThicknessRatio;w.uniform1f(L,r.lengthToThicknessRatio),w.uniform1f(R,r.widenessToThicknessRatio)}}}]),p}(cu)}var tB=Sy(),nB=Sy({arrowHead:du});Sy({arrowHead:Rf(Rf({},du),{},{extremity:"both"})});class rB{constructor(){mi(this,"nodes",[]);mi(this,"edges",[]);mi(this,"nodeIdMap",{});mi(this,"edgeIdMap",{});mi(this,"edgeDynamicIdMap",{});mi(this,"getNode",t=>{const n=this.nodeIdMap[t];if(n!==void 0)return this.nodes[n]});mi(this,"getEdge",(t,n=!0)=>{const r=n?this.edgeDynamicIdMap[t]:this.edgeIdMap[t];if(r!==void 0)return this.edges[r]});mi(this,"buildDynamicMap",()=>{this.edgeDynamicIdMap={};for(let t=0;t<this.edges.length;t++){const n=this.edges[t];this.edgeDynamicIdMap[n.dynamicId]=t}})}}const iB=Tv()(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})})),yt=Dv(iB),aB=({node:e,move:t})=>{const n=hr(),{gotoNode:r}=wA();return E.useEffect(()=>{if(e)return n.getGraph().setNodeAttribute(e,"highlighted",!0),t&&(r(e),yt.getState().setMoveToSelectedNode(!1)),()=>{n.getGraph().setNodeAttribute(e,"highlighted",!1)}},[e,t,n,r]),null};function ks(e,t){const n=hr(),r=E.useRef(t);return hu(r.current,t)||(r.current=t),{positions:E.useCallback(()=>r.current?e(n.getGraph(),r.current):{},[n,r,e]),assign:E.useCallback(()=>{r.current&&e.assign(n.getGraph(),r.current)},[n,r,e])}}function Ey(e,t){const n=hr(),[r,i]=E.useState(!1),[o,l]=E.useState(null),u=E.useRef(t);return hu(u.current,t)||(u.current=t),E.useEffect(()=>{i(!1);let f=null;return u.current&&(f=new e(n.getGraph(),u.current)),l(f),()=>{f!==null&&f.kill()}},[n,u,l,i,e]),{stop:E.useCallback(()=>{o&&(o.stop(),i(!1))},[o,i]),start:E.useCallback(()=>{o&&(o.start(),i(!0))},[o,i]),kill:E.useCallback(()=>{o&&o.kill(),i(!1)},[o,i]),isRunning:r}}var ym,kS;function pu(){if(kS)return ym;kS=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,r){n=n||{};var i={};for(var o in r){var l=n[o],u=r[o];if(!e(u)){i[o]=t(l,u);continue}l===void 0?i[o]=u:i[o]=l}return i}return ym=t,ym}var bm,CS;function oB(){if(CS)return bm;CS=1;function e(n){return function(r,i){return r+Math.floor(n()*(i-r+1))}}var t=e(Math.random);return t.createRandom=e,bm=t,bm}var xm,TS;function sB(){if(TS)return xm;TS=1;var e=oB().createRandom;function t(r){var i=e(r);return function(o){for(var l=o.length,u=l-1,f=-1;++f<l;){var d=i(f,u),p=o[d];o[d]=o[f],o[f]=p}}}var n=t(Math.random);return n.createShuffleInPlace=t,xm=n,xm}var wm,AS;function lB(){if(AS)return wm;AS=1;var e=pu(),t=Wr(),n=sB(),r={attributes:{x:"x",y:"y"},center:0,hierarchyAttributes:[],rng:Math.random,scale:1};function i(R,U,P,z,V){this.wrappedCircle=V||null,this.children={},this.countChildren=0,this.id=R||null,this.next=null,this.previous=null,this.x=U||null,this.y=P||null,V?this.r=1010101:this.r=z||999}i.prototype.hasChildren=function(){return this.countChildren>0},i.prototype.addChild=function(R,U){this.children[R]=U,++this.countChildren},i.prototype.getChild=function(R){if(!this.children.hasOwnProperty(R)){var U=new i;this.children[R]=U,++this.countChildren}return this.children[R]},i.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var R=this;for(var U in R.children){var P=R.children[U];P.x+=R.x,P.y+=R.y,P.applyPositionToChildren()}}};function o(R,U,P){for(var z in U.children){var V=U.children[z];V.hasChildren()?o(R,V,P):P[V.id]={x:V.x,y:V.y}}}function l(R,U){var P=R.r-U.r,z=U.x-R.x,V=U.y-R.y;return P<0||P*P<z*z+V*V}function u(R,U){var P=R.r-U.r+1e-6,z=U.x-R.x,V=U.y-R.y;return P>0&&P*P>z*z+V*V}function f(R,U){for(var P=0;P<U.length;++P)if(!u(R,U[P]))return!1;return!0}function d(R){return new i(null,R.x,R.y,R.r)}function p(R,U){var P=R.x,z=R.y,V=R.r,q=U.x,I=U.y,Y=U.r,Z=q-P,B=I-z,G=Y-V,F=Math.sqrt(Z*Z+B*B);return new i(null,(P+q+Z/F*G)/2,(z+I+B/F*G)/2,(F+V+Y)/2)}function m(R,U,P){var z=R.x,V=R.y,q=R.r,I=U.x,Y=U.y,Z=U.r,B=P.x,G=P.y,F=P.r,K=z-I,A=z-B,H=V-Y,M=V-G,O=Z-q,X=F-q,re=z*z+V*V-q*q,ue=re-I*I-Y*Y+Z*Z,ae=re-B*B-G*G+F*F,oe=A*H-K*M,Ce=(H*ae-M*ue)/(oe*2)-z,he=(M*O-H*X)/oe,Ee=(A*ue-K*ae)/(oe*2)-V,we=(K*X-A*O)/oe,Pe=he*he+we*we-1,Ae=2*(q+Ce*he+Ee*we),xe=Ce*Ce+Ee*Ee-q*q,ee=-(Pe?(Ae+Math.sqrt(Ae*Ae-4*Pe*xe))/(2*Pe):xe/Ae);return new i(null,z+Ce+he*ee,V+Ee+we*ee,ee)}function v(R){switch(R.length){case 1:return d(R[0]);case 2:return p(R[0],R[1]);case 3:return m(R[0],R[1],R[2]);default:throw new Error("graphology-layout/circlepack: Invalid basis length "+R.length)}}function g(R,U){var P,z;if(f(U,R))return[U];for(P=0;P<R.length;++P)if(l(U,R[P])&&f(p(R[P],U),R))return[R[P],U];for(P=0;P<R.length-1;++P)for(z=P+1;z<R.length;++z)if(l(p(R[P],R[z]),U)&&l(p(R[P],U),R[z])&&l(p(R[z],U),R[P])&&f(m(R[P],R[z],U),R))return[R[P],R[z],U];throw new Error("graphology-layout/circlepack: extendBasis failure !")}function w(R){var U=R.wrappedCircle,P=R.next.wrappedCircle,z=U.r+P.r,V=(U.x*P.r+P.x*U.r)/z,q=(U.y*P.r+P.y*U.r)/z;return V*V+q*q}function x(R,U){var P=0,z=R.slice(),V=R.length,q=[],I,Y;for(U(z);P<V;)I=z[P],Y&&u(Y,I)?++P:(q=g(q,I),Y=v(q),P=0);return Y}function k(R,U,P){var z=R.x-U.x,V,q,I=R.y-U.y,Y,Z,B=z*z+I*I;B?(q=U.r+P.r,q*=q,Z=R.r+P.r,Z*=Z,q>Z?(V=(B+Z-q)/(2*B),Y=Math.sqrt(Math.max(0,Z/B-V*V)),P.x=R.x-V*z-Y*I,P.y=R.y-V*I+Y*z):(V=(B+q-Z)/(2*B),Y=Math.sqrt(Math.max(0,q/B-V*V)),P.x=U.x+V*z-Y*I,P.y=U.y+V*I+Y*z)):(P.x=U.x+P.r,P.y=U.y)}function C(R,U){var P=R.r+U.r-1e-6,z=U.x-R.x,V=U.y-R.y;return P>0&&P*P>z*z+V*V}function _(R,U){var P=R.length;if(P===0)return 0;var z,V,q,I,Y,Z,B,G,F,K;if(z=R[0],z.x=0,z.y=0,P<=1)return z.r;if(V=R[1],z.x=-V.r,V.x=z.r,V.y=0,P<=2)return z.r+V.r;q=R[2],k(V,z,q),z=new i(null,null,null,null,z),V=new i(null,null,null,null,V),q=new i(null,null,null,null,q),z.next=q.previous=V,V.next=z.previous=q,q.next=V.previous=z;e:for(Z=3;Z<P;++Z){q=R[Z],k(z.wrappedCircle,V.wrappedCircle,q),q=new i(null,null,null,null,q),B=V.next,G=z.previous,F=V.wrappedCircle.r,K=z.wrappedCircle.r;do if(F<=K){if(C(B.wrappedCircle,q.wrappedCircle)){V=B,z.next=V,V.previous=z,--Z;continue e}F+=B.wrappedCircle.r,B=B.next}else{if(C(G.wrappedCircle,q.wrappedCircle)){z=G,z.next=V,V.previous=z,--Z;continue e}K+=G.wrappedCircle.r,G=G.previous}while(B!==G.next);for(q.previous=z,q.next=V,z.next=V.previous=V=q,I=w(z);(q=q.next)!==V;)(Y=w(q))<I&&(z=q,I=Y);V=z.next}z=[V.wrappedCircle],q=V;for(var A=1e4;(q=q.next)!==V&&--A!==0;)z.push(q.wrappedCircle);for(q=x(z,U),Z=0;Z<P;++Z)z=R[Z],z.x-=q.x,z.y-=q.y;return q.r}function T(R,U){var P=0;if(R.hasChildren()){for(var z in R.children){var V=R.children[z];V.hasChildren()&&(V.r=T(V,U))}P=_(Object.values(R.children),U)}return P}function N(R,U){T(R,U);for(var P in R.children){var z=R.children[P];z.applyPositionToChildren()}}function D(R,U,P){if(!t(U))throw new Error("graphology-layout/circlepack: the given graph is not a valid graphology instance.");P=e(P,r);var z={},V={},q=U.nodes(),I=P.center,Y=P.hierarchyAttributes,Z=n.createShuffleInPlace(P.rng),B=P.scale,G=new i;U.forEachNode(function(O,X){var re=X.size?X.size:1,ue=new i(O,null,null,re),ae=G;Y.forEach(function(oe){var Ce=X[oe];ae=ae.getChild(Ce)}),ae.addChild(O,ue)}),N(G,Z),o(U,G,z);var F=q.length,K,A,H;for(H=0;H<F;H++){var M=q[H];K=I+B*z[M].x,A=I+B*z[M].y,V[M]={x:K,y:A},R&&(U.setNodeAttribute(M,P.attributes.x,K),U.setNodeAttribute(M,P.attributes.y,A))}return V}var L=D.bind(null,!1);return L.assign=D.bind(null,!0),wm=L,wm}var uB=lB();const cB=fn(uB);function fB(e={}){return ks(cB,e)}var Sm,RS;function dB(){if(RS)return Sm;RS=1;var e=pu(),t=Wr(),n={dimensions:["x","y"],center:.5,scale:1};function r(o,l,u){if(!t(l))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 d=u.center,p=u.scale,m=Math.PI*2,v=(d-.5)*p,g=l.order,w=f[0],x=f[1];function k(T,N){return N[w]=p*Math.cos(T*m/g)+v,N[x]=p*Math.sin(T*m/g)+v,N}var C=0;if(!o){var _={};return l.forEachNode(function(T){_[T]=k(C++,{})}),_}l.updateEachNodeAttributes(function(T,N){return k(C++,N),N},{attributes:f})}var i=r.bind(null,!1);return i.assign=r.bind(null,!0),Sm=i,Sm}var hB=dB();const pB=fn(hB);function mB(e={}){return ks(pB,e)}var jl={},DS;function _y(){if(DS)return jl;DS=1;function e(r){return typeof r!="number"||isNaN(r)?1:r}function t(r,i){var o={},l=function(d){return typeof d>"u"?i:d};typeof i=="function"&&(l=i);var u=function(d){return l(d[r])},f=function(){return l(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getNodeAttributes(p))},o.fromEntry=function(d,p){return u(p)}):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){return l(r(p,d.getNodeAttributes(p)))},o.fromEntry=function(d,p){return l(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f),o}function n(r,i){var o={},l=function(d){return typeof d>"u"?i:d};typeof i=="function"&&(l=i);var u=function(d){return l(d[r])},f=function(){return l(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getEdgeAttributes(p))},o.fromEntry=function(d,p){return u(p)},o.fromPartialEntry=o.fromEntry,o.fromMinimalEntry=o.fromEntry):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){var m=d.extremities(p);return l(r(p,d.getEdgeAttributes(p),m[0],m[1],d.getNodeAttributes(m[0]),d.getNodeAttributes(m[1]),d.isUndirected(p)))},o.fromEntry=function(d,p,m,v,g,w,x){return l(r(d,p,m,v,g,w,x))},o.fromPartialEntry=function(d,p,m,v){return l(r(d,p,m,v))},o.fromMinimalEntry=function(d,p){return l(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f,o.fromMinimalEntry=f),o}return jl.createNodeValueGetter=t,jl.createEdgeValueGetter=n,jl.createEdgeWeightGetter=function(r){return n(r,e)},jl}var Em,NS;function MA(){if(NS)return Em;NS=1;const{createNodeValueGetter:e,createEdgeValueGetter:t}=_y();return Em=function(r,i,o){const{nodeXAttribute:l,nodeYAttribute:u}=o,{attraction:f,repulsion:d,gravity:p,inertia:m,maxMove:v}=o.settings;let{shouldSkipNode:g,shouldSkipEdge:w,isNodeFixed:x}=o;x=e(x),g=e(g,!1),w=t(w,!1);const k=r.filterNodes((T,N)=>!g.fromEntry(T,N)),C=k.length;for(let T=0;T<C;T++){const N=k[T],D=r.getNodeAttributes(N),L=i[N];L?i[N]={dx:L.dx*m,dy:L.dy*m,x:D[l]||0,y:D[u]||0}:i[N]={dx:0,dy:0,x:D[l]||0,y:D[u]||0}}if(d)for(let T=0;T<C;T++){const N=k[T],D=i[N];for(let L=T+1;L<C;L++){const R=k[L],U=i[R],P=U.x-D.x,z=U.y-D.y,V=Math.sqrt(P*P+z*z)||1,q=d/V*P,I=d/V*z;D.dx-=q,D.dy-=I,U.dx+=q,U.dy+=I}}if(f&&r.forEachEdge((T,N,D,L,R,U,P)=>{if(D===L||g.fromEntry(D,R)||g.fromEntry(L,U)||w.fromEntry(T,N,D,L,R,U,P))return;const z=i[D],V=i[L],q=V.x-z.x,I=V.y-z.y,Y=Math.sqrt(q*q+I*I)||1,Z=f*Y*q,B=f*Y*I;z.dx+=Z,z.dy+=B,V.dx-=Z,V.dy-=B}),p)for(let T=0;T<C;T++){const N=k[T],D=i[N],{x:L,y:R}=D,U=Math.sqrt(L*L+R*R)||1;i[N].dx-=L*p*U,i[N].dy-=R*p*U}const _=!1;for(let T=0;T<C;T++){const N=k[T],D=i[N],L=Math.sqrt(D.dx*D.dx+D.dy*D.dy);L>v&&(D.dx*=v/L,D.dy*=v/L),x.fromGraph(r,N)?D.fixed=!0:(D.x+=D.dx,D.y+=D.dy,D.fixed=!1)}return{converged:_}},Em}var Hc={},OS;function PA(){return OS||(OS=1,Hc.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:r,nodeYAttribute:i}=n;e.updateEachNodeAttributes((o,l)=>{const u=t[o];return!u||u.fixed||(l[r]=u.x,l[i]=u.y),l},{attributes:["x","y"]})},Hc.collectLayoutChanges=function(e){const t={};for(const n in e){const r=e[n];t[n]={x:r.x,y:r.y}}return t}),Hc}var _m,jS;function FA(){return jS||(jS=1,_m={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),_m}var km,LS;function gB(){if(LS)return km;LS=1;const e=Wr(),t=pu(),n=MA(),r=PA(),i=FA();function o(u,f,d){if(!e(f))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof d=="number"?d={maxIterations:d}:d=d||{};const p=d.maxIterations;if(d=t(d,i),typeof p!="number"||p<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const m={};let v=null,g;for(g=0;g<p&&(v=n(f,m,d),!v.converged);g++);if(u){r.assignLayoutChanges(f,m,d);return}return r.collectLayoutChanges(m)}const l=o.bind(null,!1);return l.assign=o.bind(null,!0),km=l,km}var vB=gB();const yB=fn(vB);var Cm,zS;function bB(){if(zS)return Cm;zS=1;const e=Wr(),t=pu(),n=MA(),r=PA(),i=FA();function o(l,u){if(!e(l))throw new Error("graphology-layout-force/worker: the given graph is not a valid graphology instance.");u=t(u,i),this.callbacks={},u.onConverged&&(this.callbacks.onConverged=u.onConverged),this.graph=l,this.params=u,this.nodeStates={},this.frameID=null,this.running=!1,this.killed=!1}return o.prototype.isRunning=function(){return this.running},o.prototype.runFrame=function(){let{converged:l}=n(this.graph,this.nodeStates,this.params);r.assignLayoutChanges(this.graph,this.nodeStates,this.params),l=!1,l?(this.callbacks.onConverged&&this.callbacks.onConverged(),this.stop()):this.frameID=window.requestAnimationFrame(()=>this.runFrame())},o.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},o.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},Cm=o,Cm}var xB=bB();const wB=fn(xB);function SB(e={maxIterations:100}){return ks(yB,e)}function EB(e={}){return Ey(wB,e)}var Tm,MS;function _B(){if(MS)return Tm;MS=1;var e=0,t=1,n=2,r=3,i=4,o=5,l=6,u=7,f=8,d=9,p=0,m=1,v=2,g=0,w=1,x=2,k=3,C=4,_=5,T=6,N=7,D=8,L=3,R=10,U=3,P=9,z=10;return Tm=function(q,I,Y){var Z,B,G,F,K,A,H,M,O,X,re=I.length,ue=Y.length,ae=q.adjustSizes,oe=q.barnesHutTheta*q.barnesHutTheta,Ce,he,Ee,we,Pe,Ae,xe,ee=[];for(G=0;G<re;G+=R)I[G+i]=I[G+n],I[G+o]=I[G+r],I[G+n]=0,I[G+r]=0;if(q.outboundAttractionDistribution){for(Ce=0,G=0;G<re;G+=R)Ce+=I[G+l];Ce/=re/R}if(q.barnesHutOptimize){var ce=1/0,Te=-1/0,ge=1/0,Se=-1/0,ie,$e,Ge;for(G=0;G<re;G+=R)ce=Math.min(ce,I[G+e]),Te=Math.max(Te,I[G+e]),ge=Math.min(ge,I[G+t]),Se=Math.max(Se,I[G+t]);var ve=Te-ce,Ne=Se-ge;for(ve>Ne?(ge-=(ve-Ne)/2,Se=ge+ve):(ce-=(Ne-ve)/2,Te=ce+Ne),ee[0+g]=-1,ee[0+w]=(ce+Te)/2,ee[0+x]=(ge+Se)/2,ee[0+k]=Math.max(Te-ce,Se-ge),ee[0+C]=-1,ee[0+_]=-1,ee[0+T]=0,ee[0+N]=0,ee[0+D]=0,Z=1,G=0;G<re;G+=R)for(B=0,Ge=L;;)if(ee[B+_]>=0){I[G+e]<ee[B+w]?I[G+t]<ee[B+x]?ie=ee[B+_]:ie=ee[B+_]+P:I[G+t]<ee[B+x]?ie=ee[B+_]+P*2:ie=ee[B+_]+P*3,ee[B+N]=(ee[B+N]*ee[B+T]+I[G+e]*I[G+l])/(ee[B+T]+I[G+l]),ee[B+D]=(ee[B+D]*ee[B+T]+I[G+t]*I[G+l])/(ee[B+T]+I[G+l]),ee[B+T]+=I[G+l],B=ie;continue}else if(ee[B+g]<0){ee[B+g]=G;break}else{if(ee[B+_]=Z*P,M=ee[B+k]/2,O=ee[B+_],ee[O+g]=-1,ee[O+w]=ee[B+w]-M,ee[O+x]=ee[B+x]-M,ee[O+k]=M,ee[O+C]=O+P,ee[O+_]=-1,ee[O+T]=0,ee[O+N]=0,ee[O+D]=0,O+=P,ee[O+g]=-1,ee[O+w]=ee[B+w]-M,ee[O+x]=ee[B+x]+M,ee[O+k]=M,ee[O+C]=O+P,ee[O+_]=-1,ee[O+T]=0,ee[O+N]=0,ee[O+D]=0,O+=P,ee[O+g]=-1,ee[O+w]=ee[B+w]+M,ee[O+x]=ee[B+x]-M,ee[O+k]=M,ee[O+C]=O+P,ee[O+_]=-1,ee[O+T]=0,ee[O+N]=0,ee[O+D]=0,O+=P,ee[O+g]=-1,ee[O+w]=ee[B+w]+M,ee[O+x]=ee[B+x]+M,ee[O+k]=M,ee[O+C]=ee[B+C],ee[O+_]=-1,ee[O+T]=0,ee[O+N]=0,ee[O+D]=0,Z+=4,I[ee[B+g]+e]<ee[B+w]?I[ee[B+g]+t]<ee[B+x]?ie=ee[B+_]:ie=ee[B+_]+P:I[ee[B+g]+t]<ee[B+x]?ie=ee[B+_]+P*2:ie=ee[B+_]+P*3,ee[B+T]=I[ee[B+g]+l],ee[B+N]=I[ee[B+g]+e],ee[B+D]=I[ee[B+g]+t],ee[ie+g]=ee[B+g],ee[B+g]=-1,I[G+e]<ee[B+w]?I[G+t]<ee[B+x]?$e=ee[B+_]:$e=ee[B+_]+P:I[G+t]<ee[B+x]?$e=ee[B+_]+P*2:$e=ee[B+_]+P*3,ie===$e)if(Ge--){B=ie;continue}else{Ge=L;break}ee[$e+g]=G;break}}if(q.barnesHutOptimize)for(he=q.scalingRatio,G=0;G<re;G+=R)for(B=0;;)if(ee[B+_]>=0)if(Ae=Math.pow(I[G+e]-ee[B+N],2)+Math.pow(I[G+t]-ee[B+D],2),X=ee[B+k],4*X*X/Ae<oe){if(Ee=I[G+e]-ee[B+N],we=I[G+t]-ee[B+D],ae===!0?Ae>0?(xe=he*I[G+l]*ee[B+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+l]*ee[B+T]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+l]*ee[B+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe),B=ee[B+C],B<0)break;continue}else{B=ee[B+_];continue}else{if(A=ee[B+g],A>=0&&A!==G&&(Ee=I[G+e]-I[A+e],we=I[G+t]-I[A+t],Ae=Ee*Ee+we*we,ae===!0?Ae>0?(xe=he*I[G+l]*I[A+l]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+l]*I[A+l]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+l]*I[A+l]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe)),B=ee[B+C],B<0)break;continue}else for(he=q.scalingRatio,F=0;F<re;F+=R)for(K=0;K<F;K+=R)Ee=I[F+e]-I[K+e],we=I[F+t]-I[K+t],ae===!0?(Ae=Math.sqrt(Ee*Ee+we*we)-I[F+f]-I[K+f],Ae>0?(xe=he*I[F+l]*I[K+l]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe):Ae<0&&(xe=100*he*I[F+l]*I[K+l],I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe)):(Ae=Math.sqrt(Ee*Ee+we*we),Ae>0&&(xe=he*I[F+l]*I[K+l]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe));for(O=q.gravity/q.scalingRatio,he=q.scalingRatio,G=0;G<re;G+=R)xe=0,Ee=I[G+e],we=I[G+t],Ae=Math.sqrt(Math.pow(Ee,2)+Math.pow(we,2)),q.strongGravityMode?Ae>0&&(xe=he*I[G+l]*O):Ae>0&&(xe=he*I[G+l]*O/Ae),I[G+n]-=Ee*xe,I[G+r]-=we*xe;for(he=1*(q.outboundAttractionDistribution?Ce:1),H=0;H<ue;H+=U)F=Y[H+p],K=Y[H+m],M=Y[H+v],Pe=Math.pow(M,q.edgeWeightInfluence),Ee=I[F+e]-I[K+e],we=I[F+t]-I[K+t],ae===!0?(Ae=Math.sqrt(Ee*Ee+we*we)-I[F+f]-I[K+f],q.linLogMode?q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+l]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe/I[F+l]):Ae>0&&(xe=-he*Pe)):(Ae=Math.sqrt(Math.pow(Ee,2)+Math.pow(we,2)),q.linLogMode?q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+l]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?(Ae=1,xe=-he*Pe/I[F+l]):(Ae=1,xe=-he*Pe)),Ae>0&&(I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe);var te,de,Oe,He,Ye,vt;if(ae===!0)for(G=0;G<re;G+=R)I[G+d]!==1&&(te=Math.sqrt(Math.pow(I[G+n],2)+Math.pow(I[G+r],2)),te>z&&(I[G+n]=I[G+n]*z/te,I[G+r]=I[G+r]*z/te),de=I[G+l]*Math.sqrt((I[G+i]-I[G+n])*(I[G+i]-I[G+n])+(I[G+o]-I[G+r])*(I[G+o]-I[G+r])),Oe=Math.sqrt((I[G+i]+I[G+n])*(I[G+i]+I[G+n])+(I[G+o]+I[G+r])*(I[G+o]+I[G+r]))/2,He=.1*Math.log(1+Oe)/(1+Math.sqrt(de)),Ye=I[G+e]+I[G+n]*(He/q.slowDown),I[G+e]=Ye,vt=I[G+t]+I[G+r]*(He/q.slowDown),I[G+t]=vt);else for(G=0;G<re;G+=R)I[G+d]!==1&&(de=I[G+l]*Math.sqrt((I[G+i]-I[G+n])*(I[G+i]-I[G+n])+(I[G+o]-I[G+r])*(I[G+o]-I[G+r])),Oe=Math.sqrt((I[G+i]+I[G+n])*(I[G+i]+I[G+n])+(I[G+o]+I[G+r])*(I[G+o]+I[G+r]))/2,He=I[G+u]*Math.log(1+Oe)/(1+Math.sqrt(de)),I[G+u]=Math.min(1,Math.sqrt(He*(Math.pow(I[G+n],2)+Math.pow(I[G+r],2))/(1+Math.sqrt(de)))),Ye=I[G+e]+I[G+n]*(He/q.slowDown),I[G+e]=Ye,vt=I[G+t]+I[G+r]*(He/q.slowDown),I[G+t]=vt);return{}},Tm}var vi={},PS;function IA(){if(PS)return vi;PS=1;var e=10,t=3;return vi.assign=function(n){n=n||{};var r=Array.prototype.slice.call(arguments).slice(1),i,o,l;for(i=0,l=r.length;i<l;i++)if(r[i])for(o in r[i])n[o]=r[i][o];return n},vi.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},vi.graphToByteArrays=function(n,r){var i=n.order,o=n.size,l={},u,f=new Float32Array(i*e),d=new Float32Array(o*t);return u=0,n.forEachNode(function(p,m){l[p]=u,f[u]=m.x,f[u+1]=m.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]=m.size||1,f[u+9]=m.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(p,m,v,g,w,x,k){var C=l[v],_=l[g],T=r(p,m,v,g,w,x,k);f[C+6]+=T,f[_+6]+=T,d[u]=C,d[u+1]=_,d[u+2]=T,u+=t}),{nodes:f,edges:d}},vi.assignLayoutChanges=function(n,r,i){var o=0;n.updateEachNodeAttributes(function(l,u){return u.x=r[o],u.y=r[o+1],o+=e,i?i(l,u):u})},vi.readGraphPositions=function(n,r){var i=0;n.forEachNode(function(o,l){r[i]=l.x,r[i+1]=l.y,i+=e})},vi.collectLayoutChanges=function(n,r,i){for(var o=n.nodes(),l={},u=0,f=0,d=r.length;u<d;u+=e){if(i){var p=Object.assign({},n.getNodeAttributes(o[f]));p.x=r[u],p.y=r[u+1],p=i(o[f],p),l[o[f]]={x:p.x,y:p.y}}else l[o[f]]={x:r[u],y:r[u+1]};f++}return l},vi.createWorker=function(r){var i=window.URL||window.webkitURL,o=r.toString(),l=i.createObjectURL(new Blob(["("+o+").call(this);"],{type:"text/javascript"})),u=new Worker(l);return i.revokeObjectURL(l),u},vi}var Am,FS;function GA(){return FS||(FS=1,Am={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),Am}var Rm,IS;function kB(){if(IS)return Rm;IS=1;var e=Wr(),t=_y().createEdgeWeightGetter,n=_B(),r=IA(),i=GA();function o(f,d,p){if(!e(d))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof p=="number"&&(p={iterations:p});var m=p.iterations;if(typeof m!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(m<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var v=t("getEdgeWeight"in p?p.getEdgeWeight:"weight").fromEntry,g=typeof p.outputReducer=="function"?p.outputReducer:null,w=r.assign({},i,p.settings),x=r.validateSettings(w);if(x)throw new Error("graphology-layout-forceatlas2: "+x.message);var k=r.graphToByteArrays(d,v),C;for(C=0;C<m;C++)n(w,k.nodes,k.edges);if(f){r.assignLayoutChanges(d,k.nodes,g);return}return r.collectLayoutChanges(d,k.nodes)}function l(f){var d=typeof f=="number"?f:f.order;return{barnesHutOptimize:d>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(d)}}var u=o.bind(null,!1);return u.assign=o.bind(null,!0),u.inferSettings=l,Rm=u,Rm}var CB=kB();const TB=fn(CB);var Dm,GS;function AB(){return GS||(GS=1,Dm=function(){var t,n,r={};(function(){var o=0,l=1,u=2,f=3,d=4,p=5,m=6,v=7,g=8,w=9,x=0,k=1,C=2,_=0,T=1,N=2,D=3,L=4,R=5,U=6,P=7,z=8,V=3,q=10,I=3,Y=9,Z=10;r.exports=function(G,F,K){var A,H,M,O,X,re,ue,ae,oe,Ce,he=F.length,Ee=K.length,we=G.adjustSizes,Pe=G.barnesHutTheta*G.barnesHutTheta,Ae,xe,ee,ce,Te,ge,Se,ie=[];for(M=0;M<he;M+=q)F[M+d]=F[M+u],F[M+p]=F[M+f],F[M+u]=0,F[M+f]=0;if(G.outboundAttractionDistribution){for(Ae=0,M=0;M<he;M+=q)Ae+=F[M+m];Ae/=he/q}if(G.barnesHutOptimize){var $e=1/0,Ge=-1/0,ve=1/0,Ne=-1/0,te,de,Oe;for(M=0;M<he;M+=q)$e=Math.min($e,F[M+o]),Ge=Math.max(Ge,F[M+o]),ve=Math.min(ve,F[M+l]),Ne=Math.max(Ne,F[M+l]);var He=Ge-$e,Ye=Ne-ve;for(He>Ye?(ve-=(He-Ye)/2,Ne=ve+He):($e-=(Ye-He)/2,Ge=$e+Ye),ie[0+_]=-1,ie[0+T]=($e+Ge)/2,ie[0+N]=(ve+Ne)/2,ie[0+D]=Math.max(Ge-$e,Ne-ve),ie[0+L]=-1,ie[0+R]=-1,ie[0+U]=0,ie[0+P]=0,ie[0+z]=0,A=1,M=0;M<he;M+=q)for(H=0,Oe=V;;)if(ie[H+R]>=0){F[M+o]<ie[H+T]?F[M+l]<ie[H+N]?te=ie[H+R]:te=ie[H+R]+Y:F[M+l]<ie[H+N]?te=ie[H+R]+Y*2:te=ie[H+R]+Y*3,ie[H+P]=(ie[H+P]*ie[H+U]+F[M+o]*F[M+m])/(ie[H+U]+F[M+m]),ie[H+z]=(ie[H+z]*ie[H+U]+F[M+l]*F[M+m])/(ie[H+U]+F[M+m]),ie[H+U]+=F[M+m],H=te;continue}else if(ie[H+_]<0){ie[H+_]=M;break}else{if(ie[H+R]=A*Y,ae=ie[H+D]/2,oe=ie[H+R],ie[oe+_]=-1,ie[oe+T]=ie[H+T]-ae,ie[oe+N]=ie[H+N]-ae,ie[oe+D]=ae,ie[oe+L]=oe+Y,ie[oe+R]=-1,ie[oe+U]=0,ie[oe+P]=0,ie[oe+z]=0,oe+=Y,ie[oe+_]=-1,ie[oe+T]=ie[H+T]-ae,ie[oe+N]=ie[H+N]+ae,ie[oe+D]=ae,ie[oe+L]=oe+Y,ie[oe+R]=-1,ie[oe+U]=0,ie[oe+P]=0,ie[oe+z]=0,oe+=Y,ie[oe+_]=-1,ie[oe+T]=ie[H+T]+ae,ie[oe+N]=ie[H+N]-ae,ie[oe+D]=ae,ie[oe+L]=oe+Y,ie[oe+R]=-1,ie[oe+U]=0,ie[oe+P]=0,ie[oe+z]=0,oe+=Y,ie[oe+_]=-1,ie[oe+T]=ie[H+T]+ae,ie[oe+N]=ie[H+N]+ae,ie[oe+D]=ae,ie[oe+L]=ie[H+L],ie[oe+R]=-1,ie[oe+U]=0,ie[oe+P]=0,ie[oe+z]=0,A+=4,F[ie[H+_]+o]<ie[H+T]?F[ie[H+_]+l]<ie[H+N]?te=ie[H+R]:te=ie[H+R]+Y:F[ie[H+_]+l]<ie[H+N]?te=ie[H+R]+Y*2:te=ie[H+R]+Y*3,ie[H+U]=F[ie[H+_]+m],ie[H+P]=F[ie[H+_]+o],ie[H+z]=F[ie[H+_]+l],ie[te+_]=ie[H+_],ie[H+_]=-1,F[M+o]<ie[H+T]?F[M+l]<ie[H+N]?de=ie[H+R]:de=ie[H+R]+Y:F[M+l]<ie[H+N]?de=ie[H+R]+Y*2:de=ie[H+R]+Y*3,te===de)if(Oe--){H=te;continue}else{Oe=V;break}ie[de+_]=M;break}}if(G.barnesHutOptimize)for(xe=G.scalingRatio,M=0;M<he;M+=q)for(H=0;;)if(ie[H+R]>=0)if(ge=Math.pow(F[M+o]-ie[H+P],2)+Math.pow(F[M+l]-ie[H+z],2),Ce=ie[H+D],4*Ce*Ce/ge<Pe){if(ee=F[M+o]-ie[H+P],ce=F[M+l]-ie[H+z],we===!0?ge>0?(Se=xe*F[M+m]*ie[H+U]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*ie[H+U]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*ie[H+U]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se),H=ie[H+L],H<0)break;continue}else{H=ie[H+R];continue}else{if(re=ie[H+_],re>=0&&re!==M&&(ee=F[M+o]-F[re+o],ce=F[M+l]-F[re+l],ge=ee*ee+ce*ce,we===!0?ge>0?(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*F[re+m]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se)),H=ie[H+L],H<0)break;continue}else for(xe=G.scalingRatio,O=0;O<he;O+=q)for(X=0;X<O;X+=q)ee=F[O+o]-F[X+o],ce=F[O+l]-F[X+l],we===!0?(ge=Math.sqrt(ee*ee+ce*ce)-F[O+g]-F[X+g],ge>0?(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se):ge<0&&(Se=100*xe*F[O+m]*F[X+m],F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se)):(ge=Math.sqrt(ee*ee+ce*ce),ge>0&&(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se));for(oe=G.gravity/G.scalingRatio,xe=G.scalingRatio,M=0;M<he;M+=q)Se=0,ee=F[M+o],ce=F[M+l],ge=Math.sqrt(Math.pow(ee,2)+Math.pow(ce,2)),G.strongGravityMode?ge>0&&(Se=xe*F[M+m]*oe):ge>0&&(Se=xe*F[M+m]*oe/ge),F[M+u]-=ee*Se,F[M+f]-=ce*Se;for(xe=1*(G.outboundAttractionDistribution?Ae:1),ue=0;ue<Ee;ue+=I)O=K[ue+x],X=K[ue+k],ae=K[ue+C],Te=Math.pow(ae,G.edgeWeightInfluence),ee=F[O+o]-F[X+o],ce=F[O+l]-F[X+l],we===!0?(ge=Math.sqrt(ee*ee+ce*ce)-F[O+g]-F[X+g],G.linLogMode?G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te/F[O+m]):ge>0&&(Se=-xe*Te)):(ge=Math.sqrt(Math.pow(ee,2)+Math.pow(ce,2)),G.linLogMode?G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?(ge=1,Se=-xe*Te/F[O+m]):(ge=1,Se=-xe*Te)),ge>0&&(F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se);var vt,Mt,bt,rt,qt,at;if(we===!0)for(M=0;M<he;M+=q)F[M+w]!==1&&(vt=Math.sqrt(Math.pow(F[M+u],2)+Math.pow(F[M+f],2)),vt>Z&&(F[M+u]=F[M+u]*Z/vt,F[M+f]=F[M+f]*Z/vt),Mt=F[M+m]*Math.sqrt((F[M+d]-F[M+u])*(F[M+d]-F[M+u])+(F[M+p]-F[M+f])*(F[M+p]-F[M+f])),bt=Math.sqrt((F[M+d]+F[M+u])*(F[M+d]+F[M+u])+(F[M+p]+F[M+f])*(F[M+p]+F[M+f]))/2,rt=.1*Math.log(1+bt)/(1+Math.sqrt(Mt)),qt=F[M+o]+F[M+u]*(rt/G.slowDown),F[M+o]=qt,at=F[M+l]+F[M+f]*(rt/G.slowDown),F[M+l]=at);else for(M=0;M<he;M+=q)F[M+w]!==1&&(Mt=F[M+m]*Math.sqrt((F[M+d]-F[M+u])*(F[M+d]-F[M+u])+(F[M+p]-F[M+f])*(F[M+p]-F[M+f])),bt=Math.sqrt((F[M+d]+F[M+u])*(F[M+d]+F[M+u])+(F[M+p]+F[M+f])*(F[M+p]+F[M+f]))/2,rt=F[M+v]*Math.log(1+bt)/(1+Math.sqrt(Mt)),F[M+v]=Math.min(1,Math.sqrt(rt*(Math.pow(F[M+u],2)+Math.pow(F[M+f],2))/(1+Math.sqrt(Mt)))),qt=F[M+o]+F[M+u]*(rt/G.slowDown),F[M+o]=qt,at=F[M+l]+F[M+f]*(rt/G.slowDown),F[M+l]=at);return{}}})();var i=r.exports;self.addEventListener("message",function(o){var l=o.data;t=new Float32Array(l.nodes),l.edges&&(n=new Float32Array(l.edges)),i(l.settings,t,n),self.postMessage({nodes:t.buffer},[t.buffer])})}),Dm}var Nm,US;function RB(){if(US)return Nm;US=1;var e=AB(),t=Wr(),n=_y().createEdgeWeightGetter,r=IA(),i=GA();function o(l,u){if(u=u||{},!t(l))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,d=r.assign({},i,u.settings),p=r.validateSettings(d);if(p)throw new Error("graphology-layout-forceatlas2/worker: "+p.message);this.worker=null,this.graph=l,this.settings=d,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 m=void 0,v=this;this.handleGraphUpdate=function(){v.worker&&v.worker.terminate(),m&&clearTimeout(m),m=setTimeout(function(){m=void 0,v.spawnWorker()},0)},l.on("nodeAdded",this.handleGraphUpdate),l.on("edgeAdded",this.handleGraphUpdate),l.on("nodeDropped",this.handleGraphUpdate),l.on("edgeDropped",this.handleGraphUpdate),this.spawnWorker()}return o.prototype.isRunning=function(){return this.running},o.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=r.createWorker(e),this.worker.addEventListener("message",this.handleMessage),this.running&&(this.running=!1,this.start())},o.prototype.handleMessage=function(l){if(this.running){var u=new Float32Array(l.data.nodes);r.assignLayoutChanges(this.graph,u,this.outputReducer),this.outputReducer&&r.readGraphPositions(this.graph,u),this.matrices.nodes=u,this.askForIterations()}},o.prototype.askForIterations=function(l){var u=this.matrices,f={settings:this.settings,nodes:u.nodes.buffer},d=[u.nodes.buffer];return l&&(f.edges=u.edges.buffer,d.push(u.edges.buffer)),this.worker.postMessage(f,d),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-forceatlas2/worker.start: layout was killed.");return this.running?this:(this.matrices=r.graphToByteArrays(this.graph,this.getEdgeWeight),this.running=!0,this.askForIterations(!0),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.handleGraphUpdate),this.graph.removeListener("edgeAdded",this.handleGraphUpdate),this.graph.removeListener("nodeDropped",this.handleGraphUpdate),this.graph.removeListener("edgeDropped",this.handleGraphUpdate)},Nm=o,Nm}var DB=RB();const NB=fn(DB);function UA(e={iterations:100}){return ks(TB,e)}function OB(e={}){return Ey(NB,e)}var Om,BS;function jB(){if(BS)return Om;BS=1;var e=0,t=1,n=2,r=3;function i(l,u){return l+"§"+u}function o(){return .01*(.5-Math.random())}return Om=function(u,f){var d=u.margin,p=u.ratio,m=u.expansion,v=u.gridSize,g=u.speed,w,x,k,C,_,T,N=!0,D=f.length,L=D/r|0,R=new Float32Array(L),U=new Float32Array(L),P=1/0,z=1/0,V=-1/0,q=-1/0;for(w=0;w<D;w+=r)k=f[w+e],C=f[w+t],T=f[w+n]*p+d,P=Math.min(P,k-T),V=Math.max(V,k+T),z=Math.min(z,C-T),q=Math.max(q,C+T);var I=V-P,Y=q-z,Z=(P+V)/2,B=(z+q)/2;P=Z-m*I/2,V=Z+m*I/2,z=B-m*Y/2,q=B+m*Y/2;var G=new Array(v*v),F=G.length,K;for(K=0;K<F;K++)G[K]=[];var A,H,M,O,X,re,ue,ae,oe,Ce;for(w=0;w<D;w+=r)for(k=f[w+e],C=f[w+t],T=f[w+n]*p+d,A=k-T,H=k+T,M=C-T,O=C+T,X=Math.floor(v*(A-P)/(V-P)),re=Math.floor(v*(H-P)/(V-P)),ue=Math.floor(v*(M-z)/(q-z)),ae=Math.floor(v*(O-z)/(q-z)),oe=X;oe<=re;oe++)for(Ce=ue;Ce<=ae;Ce++)G[oe*v+Ce].push(w);var he,Ee=new Set,we,Pe,Ae,xe,ee,ce,Te,ge,Se,ie,$e,Ge,ve;for(K=0;K<F;K++)for(he=G[K],w=0,_=he.length;w<_;w++)for(we=he[w],Ae=f[we+e],ee=f[we+t],Te=f[we+n],x=w+1;x<_;x++)Pe=he[x],Se=i(we,Pe),!(F>1&&Ee.has(Se))&&(F>1&&Ee.add(Se),xe=f[Pe+e],ce=f[Pe+t],ge=f[Pe+n],ie=xe-Ae,$e=ce-ee,Ge=Math.sqrt(ie*ie+$e*$e),ve=Ge<Te*p+d+(ge*p+d),ve&&(N=!1,Pe=Pe/r|0,Ge>0?(R[Pe]+=ie/Ge*(1+Te),U[Pe]+=$e/Ge*(1+Te)):(R[Pe]+=I*o(),U[Pe]+=Y*o())));for(w=0,x=0;w<D;w+=r,x++)f[w+e]+=R[x]*.1*g,f[w+t]+=U[x]*.1*g;return{converged:N}},Om}var Ua={},$S;function BA(){if($S)return Ua;$S=1;var e=3;return Ua.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},Ua.graphToByteArray=function(t,n){var r=t.order,i=new Float32Array(r*e),o=0;return t.forEachNode(function(l,u){typeof n=="function"&&(u=n(l,u)),i[o]=u.x,i[o+1]=u.y,i[o+2]=u.size||1,o+=e}),i},Ua.assignLayoutChanges=function(t,n,r){var i=0;t.forEachNode(function(o){var l={x:n[i],y:n[i+1]};typeof r=="function"&&(l=r(o,l)),t.mergeNodeAttributes(o,l),i+=e})},Ua.collectLayoutChanges=function(t,n,r){var i={},o=0;return t.forEachNode(function(l){var u={x:n[o],y:n[o+1]};typeof r=="function"&&(u=r(l,u)),i[l]=u,o+=e}),i},Ua.createWorker=function(n){var r=window.URL||window.webkitURL,i=n.toString(),o=r.createObjectURL(new Blob(["("+i+").call(this);"],{type:"text/javascript"})),l=new Worker(o);return r.revokeObjectURL(o),l},Ua}var jm,HS;function $A(){return HS||(HS=1,jm={gridSize:20,margin:5,expansion:1.1,ratio:1,speed:3}),jm}var Lm,VS;function LB(){if(VS)return Lm;VS=1;var e=Wr(),t=jB(),n=BA(),r=$A(),i=500;function o(u,f,d){if(!e(f))throw new Error("graphology-layout-noverlap: the given graph is not a valid graphology instance.");typeof d=="number"?d={maxIterations:d}:d=d||{};var p=d.maxIterations||i;if(typeof p!="number"||p<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");var m=Object.assign({},r,d.settings),v=n.validateSettings(m);if(v)throw new Error("graphology-layout-noverlap: "+v.message);var g=n.graphToByteArray(f,d.inputReducer),w=!1,x;for(x=0;x<p&&!w;x++)w=t(m,g).converged;if(u){n.assignLayoutChanges(f,g,d.outputReducer);return}return n.collectLayoutChanges(f,g,d.outputReducer)}var l=o.bind(null,!1);return l.assign=o.bind(null,!0),Lm=l,Lm}var zB=LB();const MB=fn(zB);var zm,qS;function PB(){return qS||(qS=1,zm=function(){var t,n={};(function(){var i=0,o=1,l=2,u=3;function f(p,m){return p+"§"+m}function d(){return .01*(.5-Math.random())}n.exports=function(m,v){var g=m.margin,w=m.ratio,x=m.expansion,k=m.gridSize,C=m.speed,_,T,N,D,L,R,U=!0,P=v.length,z=P/u|0,V=new Float32Array(z),q=new Float32Array(z),I=1/0,Y=1/0,Z=-1/0,B=-1/0;for(_=0;_<P;_+=u)N=v[_+i],D=v[_+o],R=v[_+l]*w+g,I=Math.min(I,N-R),Z=Math.max(Z,N+R),Y=Math.min(Y,D-R),B=Math.max(B,D+R);var G=Z-I,F=B-Y,K=(I+Z)/2,A=(Y+B)/2;I=K-x*G/2,Z=K+x*G/2,Y=A-x*F/2,B=A+x*F/2;var H=new Array(k*k),M=H.length,O;for(O=0;O<M;O++)H[O]=[];var X,re,ue,ae,oe,Ce,he,Ee,we,Pe;for(_=0;_<P;_+=u)for(N=v[_+i],D=v[_+o],R=v[_+l]*w+g,X=N-R,re=N+R,ue=D-R,ae=D+R,oe=Math.floor(k*(X-I)/(Z-I)),Ce=Math.floor(k*(re-I)/(Z-I)),he=Math.floor(k*(ue-Y)/(B-Y)),Ee=Math.floor(k*(ae-Y)/(B-Y)),we=oe;we<=Ce;we++)for(Pe=he;Pe<=Ee;Pe++)H[we*k+Pe].push(_);var Ae,xe=new Set,ee,ce,Te,ge,Se,ie,$e,Ge,ve,Ne,te,de,Oe;for(O=0;O<M;O++)for(Ae=H[O],_=0,L=Ae.length;_<L;_++)for(ee=Ae[_],Te=v[ee+i],Se=v[ee+o],$e=v[ee+l],T=_+1;T<L;T++)ce=Ae[T],ve=f(ee,ce),!(M>1&&xe.has(ve))&&(M>1&&xe.add(ve),ge=v[ce+i],ie=v[ce+o],Ge=v[ce+l],Ne=ge-Te,te=ie-Se,de=Math.sqrt(Ne*Ne+te*te),Oe=de<$e*w+g+(Ge*w+g),Oe&&(U=!1,ce=ce/u|0,de>0?(V[ce]+=Ne/de*(1+$e),q[ce]+=te/de*(1+$e)):(V[ce]+=G*d(),q[ce]+=F*d())));for(_=0,T=0;_<P;_+=u,T++)v[_+i]+=V[T]*.1*C,v[_+o]+=q[T]*.1*C;return{converged:U}}})();var r=n.exports;self.addEventListener("message",function(i){var o=i.data;t=new Float32Array(o.nodes);var l=r(o.settings,t);self.postMessage({result:l,nodes:t.buffer},[t.buffer])})}),zm}var Mm,YS;function FB(){if(YS)return Mm;YS=1;var e=PB(),t=Wr(),n=BA(),r=$A();function i(o,l){if(l=l||{},!t(o))throw new Error("graphology-layout-noverlap/worker: the given graph is not a valid graphology instance.");var u=Object.assign({},r,l.settings),f=n.validateSettings(u);if(f)throw new Error("graphology-layout-noverlap/worker: "+f.message);this.worker=null,this.graph=o,this.settings=u,this.matrices=null,this.running=!1,this.killed=!1,this.inputReducer=l.inputReducer,this.outputReducer=l.outputReducer,this.callbacks={onConverged:typeof l.onConverged=="function"?l.onConverged:null},this.handleMessage=this.handleMessage.bind(this);var d=!1,p=this;this.handleAddition=function(){d||(d=!0,p.spawnWorker(),setTimeout(function(){d=!1},0))},o.on("nodeAdded",this.handleAddition),o.on("edgeAdded",this.handleAddition),this.spawnWorker()}return i.prototype.isRunning=function(){return this.running},i.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())},i.prototype.handleMessage=function(o){if(this.running){var l=new Float32Array(o.data.nodes);if(n.assignLayoutChanges(this.graph,l,this.outputReducer),this.matrices.nodes=l,o.data.result.converged){this.callbacks.onConverged&&this.callbacks.onConverged(),this.stop();return}this.askForIterations()}},i.prototype.askForIterations=function(){var o=this.matrices,l={settings:this.settings,nodes:o.nodes.buffer},u=[o.nodes.buffer];return this.worker.postMessage(l,u),this},i.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)},i.prototype.stop=function(){return this.running=!1,this},i.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)},Mm=i,Mm}var IB=FB();const GB=fn(IB);function UB(e={}){return ks(MB,e)}function BB(e={}){return Ey(GB,e)}var Pm,WS;function $B(){if(WS)return Pm;WS=1;var e=pu(),t=Wr(),n={dimensions:["x","y"],center:.5,rng:Math.random,scale:1};function r(o,l,u){if(!t(l))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 d=f.length,p=u.center,m=u.rng,v=u.scale,g=(p-.5)*v;function w(k){for(var C=0;C<d;C++)k[f[C]]=m()*v+g;return k}if(!o){var x={};return l.forEachNode(function(k){x[k]=w({})}),x}l.updateEachNodeAttributes(function(k,C){return w(C),C},{attributes:f})}var i=r.bind(null,!1);return i.assign=r.bind(null,!0),Pm=i,Pm}var HB=$B();const VB=fn(HB);function qB(e={}){return ks(VB,e)}var XS=1,YB=.9,WB=.8,XB=.17,Fm=.1,Im=.999,KB=.9999,ZB=.99,QB=/[\\\/_+.#"@\[\(\{&]/,JB=/[\\\/_+.#"@\[\(\{&]/g,e6=/[\s-]/,HA=/[\s-]/g;function Kg(e,t,n,r,i,o,l){if(o===t.length)return i===e.length?XS:ZB;var u=`${i},${o}`;if(l[u]!==void 0)return l[u];for(var f=r.charAt(o),d=n.indexOf(f,i),p=0,m,v,g,w;d>=0;)m=Kg(e,t,n,r,d+1,o+1,l),m>p&&(d===i?m*=XS:QB.test(e.charAt(d-1))?(m*=WB,g=e.slice(i,d-1).match(JB),g&&i>0&&(m*=Math.pow(Im,g.length))):e6.test(e.charAt(d-1))?(m*=YB,w=e.slice(i,d-1).match(HA),w&&i>0&&(m*=Math.pow(Im,w.length))):(m*=XB,i>0&&(m*=Math.pow(Im,d-i))),e.charAt(d)!==t.charAt(o)&&(m*=KB)),(m<Fm&&n.charAt(d-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(d-1)!==r.charAt(o))&&(v=Kg(e,t,n,r,d+1,o+2,l),v*Fm>m&&(m=v*Fm)),m>p&&(p=m),d=n.indexOf(f,d+1);return l[u]=p,p}function KS(e){return e.toLowerCase().replace(HA," ")}function t6(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Kg(e,t,KS(e),KS(t),0,0,{})}var Gm={exports:{}},Um={};/**
* @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 ZS;function n6(){if(ZS)return Um;ZS=1;var e=Vf();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(m,v){var g=v(),w=r({inst:{value:g,getSnapshot:v}}),x=w[0].inst,k=w[1];return o(function(){x.value=g,x.getSnapshot=v,f(x)&&k({inst:x})},[m,g,v]),i(function(){return f(x)&&k({inst:x}),m(function(){f(x)&&k({inst:x})})},[m]),l(g),g}function f(m){var v=m.getSnapshot;m=m.value;try{var g=v();return!n(m,g)}catch{return!0}}function d(m,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return Um.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Um}var QS;function r6(){return QS||(QS=1,Gm.exports=n6()),Gm.exports}var i6=r6(),Ll='[cmdk-group=""]',Bm='[cmdk-group-items=""]',a6='[cmdk-group-heading=""]',ky='[cmdk-item=""]',JS=`${ky}:not([aria-disabled="true"])`,Zg="cmdk-item-select",$a="data-value",o6=(e,t,n)=>t6(e,t,n),VA=E.createContext(void 0),mu=()=>E.useContext(VA),qA=E.createContext(void 0),Cy=()=>E.useContext(qA),YA=E.createContext(void 0),WA=E.forwardRef((e,t)=>{let n=Qo(()=>{var M,O;return{search:"",value:(O=(M=e.value)!=null?M:e.defaultValue)!=null?O:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Qo(()=>new Set),i=Qo(()=>new Map),o=Qo(()=>new Map),l=Qo(()=>new Set),u=XA(e),{label:f,children:d,value:p,onValueChange:m,filter:v,shouldFilter:g,loop:w,disablePointerSelection:x=!1,vimBindings:k=!0,...C}=e,_=bn(),T=bn(),N=bn(),D=E.useRef(null),L=v6();Qa(()=>{if(p!==void 0){let M=p.trim();n.current.value=M,R.emit()}},[p]),Qa(()=>{L(6,I)},[]);let R=E.useMemo(()=>({subscribe:M=>(l.current.add(M),()=>l.current.delete(M)),snapshot:()=>n.current,setState:(M,O,X)=>{var re,ue,ae;if(!Object.is(n.current[M],O)){if(n.current[M]=O,M==="search")q(),z(),L(1,V);else if(M==="value"&&(X||L(5,I),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=O??"";(ae=(ue=u.current).onValueChange)==null||ae.call(ue,oe);return}R.emit()}},emit:()=>{l.current.forEach(M=>M())}}),[]),U=E.useMemo(()=>({value:(M,O,X)=>{var re;O!==((re=o.current.get(M))==null?void 0:re.value)&&(o.current.set(M,{value:O,keywords:X}),n.current.filtered.items.set(M,P(O,X)),L(2,()=>{z(),R.emit()}))},item:(M,O)=>(r.current.add(M),O&&(i.current.has(O)?i.current.get(O).add(M):i.current.set(O,new Set([M]))),L(3,()=>{q(),z(),n.current.value||V(),R.emit()}),()=>{o.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let X=Y();L(4,()=>{q(),(X==null?void 0:X.getAttribute("id"))===M&&V(),R.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:_,inputId:N,labelId:T,listInnerRef:D}),[]);function P(M,O){var X,re;let ue=(re=(X=u.current)==null?void 0:X.filter)!=null?re:o6;return M?ue(M,n.current.search,O):0}function z(){if(!n.current.search||u.current.shouldFilter===!1)return;let M=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(re=>{let ue=i.current.get(re),ae=0;ue.forEach(oe=>{let Ce=M.get(oe);ae=Math.max(Ce,ae)}),O.push([re,ae])});let X=D.current;Z().sort((re,ue)=>{var ae,oe;let Ce=re.getAttribute("id"),he=ue.getAttribute("id");return((ae=M.get(he))!=null?ae:0)-((oe=M.get(Ce))!=null?oe:0)}).forEach(re=>{let ue=re.closest(Bm);ue?ue.appendChild(re.parentElement===ue?re:re.closest(`${Bm} > *`)):X.appendChild(re.parentElement===X?re:re.closest(`${Bm} > *`))}),O.sort((re,ue)=>ue[1]-re[1]).forEach(re=>{var ue;let ae=(ue=D.current)==null?void 0:ue.querySelector(`${Ll}[${$a}="${encodeURIComponent(re[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function V(){let M=Z().find(X=>X.getAttribute("aria-disabled")!=="true"),O=M==null?void 0:M.getAttribute($a);R.setState("value",O||void 0)}function q(){var M,O,X,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let ae of r.current){let oe=(O=(M=o.current.get(ae))==null?void 0:M.value)!=null?O:"",Ce=(re=(X=o.current.get(ae))==null?void 0:X.keywords)!=null?re:[],he=P(oe,Ce);n.current.filtered.items.set(ae,he),he>0&&ue++}for(let[ae,oe]of i.current)for(let Ce of oe)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ue}function I(){var M,O,X;let re=Y();re&&(((M=re.parentElement)==null?void 0:M.firstChild)===re&&((X=(O=re.closest(Ll))==null?void 0:O.querySelector(a6))==null||X.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function Y(){var M;return(M=D.current)==null?void 0:M.querySelector(`${ky}[aria-selected="true"]`)}function Z(){var M;return Array.from(((M=D.current)==null?void 0:M.querySelectorAll(JS))||[])}function B(M){let O=Z()[M];O&&R.setState("value",O.getAttribute($a))}function G(M){var O;let X=Y(),re=Z(),ue=re.findIndex(oe=>oe===X),ae=re[ue+M];(O=u.current)!=null&&O.loop&&(ae=ue+M<0?re[re.length-1]:ue+M===re.length?re[0]:re[ue+M]),ae&&R.setState("value",ae.getAttribute($a))}function F(M){let O=Y(),X=O==null?void 0:O.closest(Ll),re;for(;X&&!re;)X=M>0?m6(X,Ll):g6(X,Ll),re=X==null?void 0:X.querySelector(JS);re?R.setState("value",re.getAttribute($a)):G(M)}let K=()=>B(Z().length-1),A=M=>{M.preventDefault(),M.metaKey?K():M.altKey?F(1):G(1)},H=M=>{M.preventDefault(),M.metaKey?B(0):M.altKey?F(-1):G(-1)};return E.createElement(We.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:M=>{var O;if((O=C.onKeyDown)==null||O.call(C,M),!M.defaultPrevented)switch(M.key){case"n":case"j":{k&&M.ctrlKey&&A(M);break}case"ArrowDown":{A(M);break}case"p":case"k":{k&&M.ctrlKey&&H(M);break}case"ArrowUp":{H(M);break}case"Home":{M.preventDefault(),B(0);break}case"End":{M.preventDefault(),K();break}case"Enter":if(!M.nativeEvent.isComposing&&M.keyCode!==229){M.preventDefault();let X=Y();if(X){let re=new Event(Zg);X.dispatchEvent(re)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:b6},f),yd(e,M=>E.createElement(qA.Provider,{value:R},E.createElement(VA.Provider,{value:U},M))))}),s6=E.forwardRef((e,t)=>{var n,r;let i=bn(),o=E.useRef(null),l=E.useContext(YA),u=mu(),f=XA(e),d=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:l==null?void 0:l.forceMount;Qa(()=>{if(!d)return u.item(i,l==null?void 0:l.id)},[d]);let p=KA(i,o,[e.value,e.children,o],e.keywords),m=Cy(),v=Ja(L=>L.value&&L.value===p.current),g=Ja(L=>d||u.filter()===!1?!0:L.search?L.filtered.items.get(i)>0:!0);E.useEffect(()=>{let L=o.current;if(!(!L||e.disabled))return L.addEventListener(Zg,w),()=>L.removeEventListener(Zg,w)},[g,e.onSelect,e.disabled]);function w(){var L,R;x(),(R=(L=f.current).onSelect)==null||R.call(L,p.current)}function x(){m.setState("value",p.current,!0)}if(!g)return null;let{disabled:k,value:C,onSelect:_,forceMount:T,keywords:N,...D}=e;return E.createElement(We.div,{ref:Xl([o,t]),...D,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!v,"data-disabled":!!k,"data-selected":!!v,onPointerMove:k||u.getDisablePointerSelection()?void 0:x,onClick:k?void 0:w},e.children)}),l6=E.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,l=bn(),u=E.useRef(null),f=E.useRef(null),d=bn(),p=mu(),m=Ja(g=>i||p.filter()===!1?!0:g.search?g.filtered.groups.has(l):!0);Qa(()=>p.group(l),[]),KA(l,u,[e.value,e.heading,f]);let v=E.useMemo(()=>({id:l,forceMount:i}),[i]);return E.createElement(We.div,{ref:Xl([u,t]),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&E.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),yd(e,g=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},E.createElement(YA.Provider,{value:v},g))))}),u6=E.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=E.useRef(null),o=Ja(l=>!l.search);return!n&&!o?null:E.createElement(We.div,{ref:Xl([i,t]),...r,"cmdk-separator":"",role:"separator"})}),c6=E.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=Cy(),l=Ja(p=>p.search),u=Ja(p=>p.value),f=mu(),d=E.useMemo(()=>{var p;let m=(p=f.listInnerRef.current)==null?void 0:p.querySelector(`${ky}[${$a}="${encodeURIComponent(u)}"]`);return m==null?void 0:m.getAttribute("id")},[]);return E.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),E.createElement(We.input,{ref:t,...r,"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":d,id:f.inputId,type:"text",value:i?e.value:l,onChange:p=>{i||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),f6=E.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=E.useRef(null),l=E.useRef(null),u=mu();return E.useEffect(()=>{if(l.current&&o.current){let f=l.current,d=o.current,p,m=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=f.offsetHeight;d.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return m.observe(f),()=>{cancelAnimationFrame(p),m.unobserve(f)}}},[]),E.createElement(We.div,{ref:Xl([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:u.listId},yd(e,f=>E.createElement("div",{ref:Xl([l,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),d6=E.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:l,...u}=e;return E.createElement($v,{open:n,onOpenChange:r},E.createElement(Hv,{container:l},E.createElement(nd,{"cmdk-overlay":"",className:i}),E.createElement(rd,{"aria-label":e.label,"cmdk-dialog":"",className:o},E.createElement(WA,{ref:t,...u}))))}),h6=E.forwardRef((e,t)=>Ja(n=>n.filtered.count===0)?E.createElement(We.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),p6=E.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return E.createElement(We.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},yd(e,l=>E.createElement("div",{"aria-hidden":!0},l)))}),In=Object.assign(WA,{List:f6,Item:s6,Input:c6,Group:l6,Separator:u6,Dialog:d6,Empty:h6,Loading:p6});function m6(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function g6(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function XA(e){let t=E.useRef(e);return Qa(()=>{t.current=e}),t}var Qa=typeof window>"u"?E.useEffect:E.useLayoutEffect;function Qo(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function Xl(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ja(e){let t=Cy(),n=()=>e(t.snapshot());return i6.useSyncExternalStore(t.subscribe,n,n)}function KA(e,t,n,r=[]){let i=E.useRef(),o=mu();return Qa(()=>{var l;let u=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():i.current}})(),f=r.map(d=>d.trim());o.value(e,u,f),(l=t.current)==null||l.setAttribute($a,u),i.current=u}),i}var v6=()=>{let[e,t]=E.useState(),n=Qo(()=>new Map);return Qa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function y6(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function yd({asChild:e,children:t},n){return e&&E.isValidElement(t)?E.cloneElement(y6(t),{ref:t.ref},n(t.props.children)):n(t)}var b6={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ZA=$v,QA=tC,x6=Hv,JA=E.forwardRef(({className:e,...t},n)=>S.jsx(nd,{ref:n,className:Me("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}));JA.displayName=nd.displayName;const Ty=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(x6,{children:[S.jsx(JA,{}),S.jsxs(rd,{ref:r,className:Me("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,S.jsxs(Yv,{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:[S.jsx(_k,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ty.displayName=rd.displayName;const Ay=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ay.displayName="DialogHeader";const Ry=E.forwardRef(({className:e,...t},n)=>S.jsx(Vv,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));Ry.displayName=Vv.displayName;const Dy=E.forwardRef(({className:e,...t},n)=>S.jsx(qv,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Dy.displayName=qv.displayName;const bd=E.forwardRef(({className:e,...t},n)=>S.jsx(In,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));bd.displayName=In.displayName;const Ny=E.forwardRef(({className:e,...t},n)=>S.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[S.jsx(KM,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S.jsx(In.Input,{ref:n,className:Me("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})]}));Ny.displayName=In.Input.displayName;const xd=E.forwardRef(({className:e,...t},n)=>S.jsx(In.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));xd.displayName=In.List.displayName;const Oy=E.forwardRef((e,t)=>S.jsx(In.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Oy.displayName=In.Empty.displayName;const Cs=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Group,{ref:n,className:Me("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}));Cs.displayName=In.Group.displayName;const w6=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));w6.displayName=In.Separator.displayName;const Ts=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Item,{ref:n,className:Me("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}));Ts.displayName=In.Item.displayName;const S6=({layout:e,autoRunFor:t})=>{const n=hr(),{stop:r,start:i,isRunning:o}=e;return E.useEffect(()=>{if(!n)return;let l=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(i(),l=t>0?window.setTimeout(()=>{r()},t):null),()=>{r(),l&&clearTimeout(l)}},[t,i,r,n]),S.jsx(Ot,{size:"icon",onClick:()=>o?r():i(),tooltip:o?"Stop the layout animation":"Start the layout animation",variant:$r,children:o?S.jsx(HM,{}):S.jsx(qM,{})})},E6=()=>{const e=hr(),[t,n]=E.useState("Circular"),[r,i]=E.useState(!1),o=mB(),l=fB(),u=qB(),f=UB({settings:{margin:1}}),d=SB({maxIterations:20}),p=UA({iterations:20}),m=BB(),v=EB(),g=OB(),w=E.useMemo(()=>({Circular:{layout:o},Circlepack:{layout:l},Random:{layout:u},Noverlaps:{layout:f,worker:m},"Force Directed":{layout:d,worker:v},"Force Atlas":{layout:p,worker:g}}),[l,o,d,p,f,u,v,m,g]),x=E.useCallback(k=>{console.debug(k);const{positions:C}=w[k].layout;DG(e.getGraph(),C(),{duration:500}),n(k)},[w,e]);return S.jsxs(S.Fragment,{children:[S.jsx("div",{children:w[t]&&"worker"in w[t]&&S.jsx(S6,{layout:w[t].worker})}),S.jsx("div",{children:S.jsxs(dd,{open:r,onOpenChange:i,children:[S.jsx(hd,{asChild:!0,children:S.jsx(Ot,{size:"icon",variant:$r,onClick:()=>i(k=>!k),tooltip:"Layout Graph",children:S.jsx(jM,{})})}),S.jsx(uu,{side:"right",align:"center",className:"p-1",children:S.jsx(bd,{children:S.jsx(xd,{children:S.jsx(Cs,{children:Object.keys(w).map(k=>S.jsx(Ts,{onSelect:()=>{x(k)},className:"cursor-pointer text-xs",children:k},k))})})})})]})})]})};var cf={exports:{}},_6=cf.exports,eE;function k6(){return eE||(eE=1,function(e){(function(t,n,r){function i(f){var d=this,p=u();d.next=function(){var m=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=m-(d.c=m|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(f),d.s0<0&&(d.s0+=1),d.s1-=p(f),d.s1<0&&(d.s1+=1),d.s2-=p(f),d.s2<0&&(d.s2+=1),p=null}function o(f,d){return d.c=f.c,d.s0=f.s0,d.s1=f.s1,d.s2=f.s2,d}function l(f,d){var p=new i(f),m=d&&d.state,v=p.next;return v.int32=function(){return p.next()*4294967296|0},v.double=function(){return v()+(v()*2097152|0)*11102230246251565e-32},v.quick=v,m&&(typeof m=="object"&&o(m,p),v.state=function(){return o(p,{})}),v}function u(){var f=4022871197,d=function(p){p=String(p);for(var m=0;m<p.length;m++){f+=p.charCodeAt(m);var v=.02519603282416938*f;f=v>>>0,v-=f,v*=f,f=v>>>0,v-=f,f+=v*4294967296}return(f>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=l:this.alea=l})(_6,e)}(cf)),cf.exports}var ff={exports:{}},C6=ff.exports,tE;function T6(){return tE||(tE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var m=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^m^m>>>8},u===(u|0)?f.x=u:d+=u;for(var p=0;p<d.length+64;p++)f.x^=d.charCodeAt(p)|0,f.next()}function o(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f}function l(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=l:this.xor128=l})(C6,e)}(ff)),ff.exports}var df={exports:{}},A6=df.exports,nE;function R6(){return nE||(nE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=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^(m^m<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:d+=u;for(var p=0;p<d.length+64;p++)f.x^=d.charCodeAt(p)|0,p==d.length&&(f.d=f.x<<10^f.x>>>4),f.next()}function o(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 l(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=l:this.xorwow=l})(A6,e)}(df)),df.exports}var hf={exports:{}},D6=hf.exports,rE;function N6(){return rE||(rE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.x,m=f.i,v,g;return v=p[m],v^=v>>>7,g=v^v<<24,v=p[m+1&7],g^=v^v>>>10,v=p[m+3&7],g^=v^v>>>3,v=p[m+4&7],g^=v^v<<7,v=p[m+7&7],v=v^v<<13,g^=v^v<<9,p[m]=g,f.i=m+1&7,g};function d(p,m){var v,g=[];if(m===(m|0))g[0]=m;else for(m=""+m,v=0;v<m.length;++v)g[v&7]=g[v&7]<<15^m.charCodeAt(v)+g[v+1&7]<<13;for(;g.length<8;)g.push(0);for(v=0;v<8&&g[v]===0;++v);for(v==8?g[7]=-1:g[v],p.x=g,p.i=0,v=256;v>0;--v)p.next()}d(f,u)}function o(u,f){return f.x=u.x.slice(),f.i=u.i,f}function l(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.x&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=l:this.xorshift7=l})(D6,e)}(hf)),hf.exports}var pf={exports:{}},O6=pf.exports,iE;function j6(){return iE||(iE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.w,m=f.X,v=f.i,g,w;return f.w=p=p+1640531527|0,w=m[v+34&127],g=m[v=v+1&127],w^=w<<13,g^=g<<17,w^=w>>>15,g^=g>>>12,w=m[v]=w^g,f.i=v,w+(p^p>>>16)|0};function d(p,m){var v,g,w,x,k,C=[],_=128;for(m===(m|0)?(g=m,m=null):(m=m+"\0",g=0,_=Math.max(_,m.length)),w=0,x=-32;x<_;++x)m&&(g^=m.charCodeAt((x+32)%m.length)),x===0&&(k=g),g^=g<<10,g^=g>>>15,g^=g<<4,g^=g>>>13,x>=0&&(k=k+1640531527|0,v=C[x&127]^=g+k,w=v==0?w+1:0);for(w>=128&&(C[(m&&m.length||0)&127]=-1),w=127,x=4*128;x>0;--x)g=C[w+34&127],v=C[w=w+1&127],g^=g<<13,v^=v<<17,g^=g>>>15,v^=v>>>12,C[w]=g^v;p.w=k,p.X=C,p.i=w}d(f,u)}function o(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function l(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.X&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=l:this.xor4096=l})(O6,e)}(pf)),pf.exports}var mf={exports:{}},L6=mf.exports,aE;function z6(){return aE||(aE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.b,v=f.c,g=f.d,w=f.a;return m=m<<25^m>>>7^v,v=v-g|0,g=g<<24^g>>>8^w,w=w-m|0,f.b=m=m<<20^m>>>12^v,f.c=v=v-g|0,f.d=g<<16^v>>>16^w,f.a=w-m|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):d+=u;for(var p=0;p<d.length+20;p++)f.b^=d.charCodeAt(p)|0,f.next()}function o(u,f){return f.a=u.a,f.b=u.b,f.c=u.c,f.d=u.d,f}function l(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=l:this.tychei=l})(L6,e)}(mf)),mf.exports}var gf={exports:{}};const M6={},P6=Object.freeze(Object.defineProperty({__proto__:null,default:M6},Symbol.toStringTag,{value:"Module"})),F6=lj(P6);var I6=gf.exports,oE;function G6(){return oE||(oE=1,function(e){(function(t,n,r){var i=256,o=6,l=52,u="random",f=r.pow(i,o),d=r.pow(2,l),p=d*2,m=i-1,v;function g(N,D,L){var R=[];D=D==!0?{entropy:!0}:D||{};var U=C(k(D.entropy?[N,T(n)]:N??_(),3),R),P=new w(R),z=function(){for(var V=P.g(o),q=f,I=0;V<d;)V=(V+I)*i,q*=i,I=P.g(1);for(;V>=p;)V/=2,q/=2,I>>>=1;return(V+I)/q};return z.int32=function(){return P.g(4)|0},z.quick=function(){return P.g(4)/4294967296},z.double=z,C(T(P.S),n),(D.pass||L||function(V,q,I,Y){return Y&&(Y.S&&x(Y,P),V.state=function(){return x(P,{})}),I?(r[u]=V,q):V})(z,U,"global"in D?D.global:this==r,D.state)}function w(N){var D,L=N.length,R=this,U=0,P=R.i=R.j=0,z=R.S=[];for(L||(N=[L++]);U<i;)z[U]=U++;for(U=0;U<i;U++)z[U]=z[P=m&P+N[U%L]+(D=z[U])],z[P]=D;(R.g=function(V){for(var q,I=0,Y=R.i,Z=R.j,B=R.S;V--;)q=B[Y=m&Y+1],I=I*i+B[m&(B[Y]=B[Z=m&Z+q])+(B[Z]=q)];return R.i=Y,R.j=Z,I})(i)}function x(N,D){return D.i=N.i,D.j=N.j,D.S=N.S.slice(),D}function k(N,D){var L=[],R=typeof N,U;if(D&&R=="object")for(U in N)try{L.push(k(N[U],D-1))}catch{}return L.length?L:R=="string"?N:N+"\0"}function C(N,D){for(var L=N+"",R,U=0;U<L.length;)D[m&U]=m&(R^=D[m&U]*19)+L.charCodeAt(U++);return T(D)}function _(){try{var N;return v&&(N=v.randomBytes)?N=N(i):(N=new Uint8Array(i),(t.crypto||t.msCrypto).getRandomValues(N)),T(N)}catch{var D=t.navigator,L=D&&D.plugins;return[+new Date,t,L,t.screen,T(n)]}}function T(N){return String.fromCharCode.apply(0,N)}if(C(r.random(),n),e.exports){e.exports=g;try{v=F6}catch{}}else r["seed"+u]=g})(typeof self<"u"?self:I6,[],Math)}(gf)),gf.exports}var $m,sE;function U6(){if(sE)return $m;sE=1;var e=k6(),t=T6(),n=R6(),r=N6(),i=j6(),o=z6(),l=G6();return l.alea=e,l.xor128=t,l.xorwow=n,l.xorshift7=r,l.xor4096=i,l.tychei=o,$m=l,$m}var B6=U6();const $6=fn(B6),H6=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),r=e.getNode(t.target);if(n==null||r==null)return!1}return!0},V6=async e=>{let t=null;try{t=await rM(e)}catch(r){return Mn.getState().setErrorMessage(Cr(r),"Query Graphs Error!"),null}let n=null;if(t){const r={},i={};for(let f=0;f<t.nodes.length;f++){const d=t.nodes[f];r[d.id]=f,$6(d.id,{global:!0}),d.color=dL(),d.x=Math.random(),d.y=Math.random(),d.degree=0,d.size=10}for(let f=0;f<t.edges.length;f++){const d=t.edges[f];i[d.id]=f;const p=r[d.source],m=r[d.target];if(p!==void 0&&p!==void 0){const v=t.nodes[p],g=t.nodes[m];if(!v){console.error(`Source node ${d.source} is undefined`);continue}if(!g){console.error(`Target node ${d.target} is undefined`);continue}v.degree+=1,g.degree+=1}}let o=Number.MAX_SAFE_INTEGER,l=0;for(const f of t.nodes)o=Math.min(o,f.degree),l=Math.max(l,f.degree);const u=l-o;if(u>0){const f=xL-J0;for(const d of t.nodes)d.size=Math.round(J0+f*Math.pow((d.degree-o)/u,.5))}n=new rB,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=r,n.edgeIdMap=i,H6(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},q6=e=>{const t=new Wl;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:gL,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},lE={label:""},eR=()=>{const e=Qe.use.queryLabel(),t=yt.use.rawGraph(),n=yt.use.sigmaGraph(),r=E.useCallback(l=>(t==null?void 0:t.getNode(l))||null,[t]),i=E.useCallback((l,u=!0)=>(t==null?void 0:t.getEdge(l,u))||null,[t]);return E.useEffect(()=>{if(e){if(lE.label!==e){lE.label=e;const l=yt.getState();l.reset(),V6(e).then(u=>{l.setSigmaGraph(q6(u)),u==null||u.buildDynamicMap(),l.setRawGraph(u)})}}else{const l=yt.getState();l.reset(),l.setSigmaGraph(new Wl)}},[e]),{lightrageGraph:E.useCallback(()=>{if(n)return n;const l=new Wl;return yt.getState().setSigmaGraph(l),l},[n]),getNode:r,getEdge:i}},Vc=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),Y6=({disableHoverEffect:e})=>{const{lightrageGraph:t}=eR(),n=hr(),r=xA(),i=bA(),o=iU(),{assign:l}=UA({iterations:20}),{theme:u}=pT(),f=Qe.use.enableHideUnselectedEdges(),d=yt.use.selectedNode(),p=yt.use.focusedNode(),m=yt.use.selectedEdge(),v=yt.use.focusedEdge();return E.useEffect(()=>{const g=t();o(g),g.__force_applied||(l(),Object.assign(g,{__force_applied:!0}));const{setFocusedNode:w,setSelectedNode:x,setFocusedEdge:k,setSelectedEdge:C,clearSelection:_}=yt.getState();r({enterNode:T=>{Vc(T.event.original)||w(T.node)},leaveNode:T=>{Vc(T.event.original)||w(null)},clickNode:T=>{x(T.node),C(null)},clickEdge:T=>{C(T.edge),x(null)},enterEdge:T=>{Vc(T.event.original)||k(T.edge)},leaveEdge:T=>{Vc(T.event.original)||k(null)},clickStage:()=>_()})},[l,o,r,t]),E.useEffect(()=>{const g=u==="dark",w=g?hL:void 0,x=g?yL:void 0;i({nodeReducer:(k,C)=>{const _=n.getGraph(),T={...C,highlighted:C.highlighted||!1,labelColor:w};if(!e){T.highlighted=!1;const N=p||d,D=v||m;if(N)(k===N||_.neighbors(N).includes(k))&&(T.highlighted=!0,k===d&&(T.borderColor=vL));else if(D)_.extremities(D).includes(k)&&(T.highlighted=!0,T.size=3);else return T;T.highlighted?g&&(T.labelColor=pL):T.color=mL}return T},edgeReducer:(k,C)=>{const _=n.getGraph(),T={...C,hidden:!1,labelColor:w,color:x};if(!e){const N=p||d;N?f?_.extremities(k).includes(N)||(T.hidden=!0):_.extremities(k).includes(N)&&(T.color=Q0):(v||m)&&(k===m?T.color=bL:k===v?T.color=Q0:f&&(T.hidden=!0))}return T}})},[d,p,m,v,i,n,e,u,f]),null},W6=()=>{const{zoomIn:e,zoomOut:t,reset:n}=wA({duration:200,factor:1.5}),r=E.useCallback(()=>e(),[e]),i=E.useCallback(()=>t(),[t]),o=E.useCallback(()=>n(),[n]);return S.jsxs(S.Fragment,{children:[S.jsx(Ot,{variant:$r,onClick:r,tooltip:"Zoom In",size:"icon",children:S.jsx(lP,{})}),S.jsx(Ot,{variant:$r,onClick:i,tooltip:"Zoom Out",size:"icon",children:S.jsx(cP,{})}),S.jsx(Ot,{variant:$r,onClick:o,tooltip:"Reset Zoom",size:"icon",children:S.jsx(RM,{})})]})},X6=()=>{const{isFullScreen:e,toggle:t}=aU();return S.jsx(S.Fragment,{children:e?S.jsx(Ot,{variant:$r,onClick:t,tooltip:"Windowed",size:"icon",children:S.jsx(GM,{})}):S.jsx(Ot,{variant:$r,onClick:t,tooltip:"Full Screen",size:"icon",children:S.jsx(FM,{})})})};function tR(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var jy="Checkbox",[K6,gK]=dr(jy),[Z6,Q6]=K6(jy),nR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:l,disabled:u,value:f="on",onCheckedChange:d,form:p,...m}=e,[v,g]=E.useState(null),w=dt(t,N=>g(N)),x=E.useRef(!1),k=v?p||!!v.closest("form"):!0,[C=!1,_]=_i({prop:i,defaultProp:o,onChange:d}),T=E.useRef(C);return E.useEffect(()=>{const N=v==null?void 0:v.form;if(N){const D=()=>_(T.current);return N.addEventListener("reset",D),()=>N.removeEventListener("reset",D)}},[v,_]),S.jsxs(Z6,{scope:n,state:C,disabled:u,children:[S.jsx(We.button,{type:"button",role:"checkbox","aria-checked":sa(C)?"mixed":C,"aria-required":l,"data-state":aR(C),"data-disabled":u?"":void 0,disabled:u,value:f,...m,ref:w,onKeyDown:qe(e.onKeyDown,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:qe(e.onClick,N=>{_(D=>sa(D)?!0:!D),k&&(x.current=N.isPropagationStopped(),x.current||N.stopPropagation())})}),k&&S.jsx(J6,{control:v,bubbles:!x.current,name:r,value:f,checked:C,required:l,disabled:u,form:p,style:{transform:"translateX(-100%)"},defaultChecked:sa(o)?!1:o})]})});nR.displayName=jy;var rR="CheckboxIndicator",iR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Q6(rR,n);return S.jsx(Kn,{present:r||sa(o.state)||o.state===!0,children:S.jsx(We.span,{"data-state":aR(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});iR.displayName=rR;var J6=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...o}=e,l=E.useRef(null),u=tR(n),f=NC(t);E.useEffect(()=>{const p=l.current,m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(u!==n&&g){const w=new Event("click",{bubbles:r});p.indeterminate=sa(n),g.call(p,sa(n)?!1:n),p.dispatchEvent(w)}},[u,n,r]);const d=E.useRef(sa(n)?!1:n);return S.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??d.current,...o,tabIndex:-1,ref:l,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function sa(e){return e==="indeterminate"}function aR(e){return sa(e)?"indeterminate":e?"checked":"unchecked"}var oR=nR,e$=iR;const Ul=E.forwardRef(({className:e,...t},n)=>S.jsx(oR,{ref:n,className:Me("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:S.jsx(e$,{className:Me("flex items-center justify-center text-current"),children:S.jsx(Lv,{className:"h-4 w-4"})})}));Ul.displayName=oR.displayName;var t$="Separator",uE="horizontal",n$=["horizontal","vertical"],sR=E.forwardRef((e,t)=>{const{decorative:n,orientation:r=uE,...i}=e,o=r$(r)?r:uE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return S.jsx(We.div,{"data-orientation":o,...u,...i,ref:t})});sR.displayName=t$;function r$(e){return n$.includes(e)}var lR=sR;const Fl=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>S.jsx(lR,{ref:i,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Fl.displayName=lR.displayName;const na=({checked:e,onCheckedChange:t,label:n})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ul,{checked:e,onCheckedChange:t}),S.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function i$(){const[e,t]=E.useState(!1),[n,r]=E.useState(""),i=Qe.use.showPropertyPanel(),o=Qe.use.showNodeSearchBar(),l=Qe.use.showNodeLabel(),u=Qe.use.enableEdgeEvents(),f=Qe.use.enableNodeDrag(),d=Qe.use.enableHideUnselectedEdges(),p=Qe.use.showEdgeLabel(),m=Qe.use.enableHealthCheck(),v=Qe.use.apiKey();E.useEffect(()=>{r(v||"")},[v,e]);const g=E.useCallback(()=>Qe.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),w=E.useCallback(()=>Qe.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),x=E.useCallback(()=>Qe.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),k=E.useCallback(()=>Qe.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),C=E.useCallback(()=>Qe.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),_=E.useCallback(()=>Qe.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),T=E.useCallback(()=>Qe.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),N=E.useCallback(()=>Qe.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),D=E.useCallback(async()=>{Qe.setState({apiKey:n||null}),await Mn.getState().check(),t(!1)},[n]),L=E.useCallback(R=>{r(R.target.value)},[r]);return S.jsxs(dd,{open:e,onOpenChange:t,children:[S.jsx(hd,{asChild:!0,children:S.jsx(Ot,{variant:$r,tooltip:"Settings",size:"icon",children:S.jsx(eP,{})})}),S.jsx(uu,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(na,{checked:i,onCheckedChange:C,label:"Show Property Panel"}),S.jsx(na,{checked:o,onCheckedChange:_,label:"Show Search Bar"}),S.jsx(Fl,{}),S.jsx(na,{checked:l,onCheckedChange:T,label:"Show Node Label"}),S.jsx(na,{checked:f,onCheckedChange:g,label:"Node Draggable"}),S.jsx(Fl,{}),S.jsx(na,{checked:p,onCheckedChange:k,label:"Show Edge Label"}),S.jsx(na,{checked:d,onCheckedChange:x,label:"Hide Unselected Edges"}),S.jsx(na,{checked:u,onCheckedChange:w,label:"Edge Events"}),S.jsx(Fl,{}),S.jsx(na,{checked:m,onCheckedChange:N,label:"Health Check"}),S.jsx(Fl,{}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-sm font-medium",children:"API Key"}),S.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[S.jsx("div",{className:"w-0 flex-1",children:S.jsx(Za,{type:"password",value:n,onChange:L,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),S.jsx(Ot,{onClick:D,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}function vf(e,t,n,r){function i(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(p){try{d(r.next(p))}catch(m){l(m)}}function f(p){try{d(r.throw(p))}catch(m){l(m)}}function d(p){p.done?o(p.value):i(p.value).then(u,f)}d((r=r.apply(e,[])).next())})}const a$="ENTRIES",uR="KEYS",cR="VALUES",ln="";class Hm{constructor(t,n){const r=t._tree,i=Array.from(r.keys());this.set=t,this._type=n,this._path=i.length>0?[{node:r,keys:i}]:[]}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}=Wo(this._path);if(Wo(n)===ln)return{done:!1,value:this.result()};const r=t.get(Wo(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Wo(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Wo(t)).filter(t=>t!==ln).join("")}value(){return Wo(this._path).node.get(ln)}result(){switch(this._type){case cR:return this.value();case uR:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Wo=e=>e[e.length-1],o$=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const i=t.length+1,o=i+n,l=new Uint8Array(o*i).fill(n+1);for(let u=0;u<i;++u)l[u]=u;for(let u=1;u<o;++u)l[u*i]=u;return fR(e,t,n,r,l,1,i,""),r},fR=(e,t,n,r,i,o,l,u)=>{const f=o*l;e:for(const d of e.keys())if(d===ln){const p=i[f-1];p<=n&&r.set(u,[e.get(d),p])}else{let p=o;for(let m=0;m<d.length;++m,++p){const v=d[m],g=l*p,w=g-l;let x=i[g];const k=Math.max(0,p-n-1),C=Math.min(l-1,p+n);for(let _=k;_<C;++_){const T=v!==t[_],N=i[w+_]+ +T,D=i[w+_+1]+1,L=i[g+_]+1,R=i[g+_+1]=Math.min(N,D,L);R<x&&(x=R)}if(x>n)continue e}fR(e.get(d),t,n,r,i,p,l,u+d)}};class oa{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,r]=Nf(this._tree,t.slice(this._prefix.length));if(n===void 0){const[i,o]=Ly(r);for(const l of i.keys())if(l!==ln&&l.startsWith(o)){const u=new Map;return u.set(l.slice(o.length),i.get(l)),new oa(u,t)}}return new oa(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,s$(this._tree,t)}entries(){return new Hm(this,a$)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return o$(this._tree,t,n)}get(t){const n=Qg(this._tree,t);return n!==void 0?n.get(ln):void 0}has(t){const n=Qg(this._tree,t);return n!==void 0&&n.has(ln)}keys(){return new Hm(this,uR)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,Vm(this._tree,t).set(ln,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 r=Vm(this._tree,t);return r.set(ln,n(r.get(ln))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=Vm(this._tree,t);let i=r.get(ln);return i===void 0&&r.set(ln,i=n()),i}values(){return new Hm(this,cR)}[Symbol.iterator](){return this.entries()}static from(t){const n=new oa;for(const[r,i]of t)n.set(r,i);return n}static fromObject(t){return oa.from(Object.entries(t))}}const Nf=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==ln&&t.startsWith(r))return n.push([e,r]),Nf(e.get(r),t.slice(r.length),n);return n.push([e,t]),Nf(void 0,"",n)},Qg=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==ln&&t.startsWith(n))return Qg(e.get(n),t.slice(n.length))},Vm=(e,t)=>{const n=t.length;e:for(let r=0;e&&r<n;){for(const o of e.keys())if(o!==ln&&t[r]===o[0]){const l=Math.min(n-r,o.length);let u=1;for(;u<l&&t[r+u]===o[u];)++u;const f=e.get(o);if(u===o.length)e=f;else{const d=new Map;d.set(o.slice(u),f),e.set(t.slice(r,r+u),d),e.delete(o),e=d}r+=u;continue e}const i=new Map;return e.set(t.slice(r),i),i}return e},s$=(e,t)=>{const[n,r]=Nf(e,t);if(n!==void 0){if(n.delete(ln),n.size===0)dR(r);else if(n.size===1){const[i,o]=n.entries().next().value;hR(r,i,o)}}},dR=e=>{if(e.length===0)return;const[t,n]=Ly(e);if(t.delete(n),t.size===0)dR(e.slice(0,-1));else if(t.size===1){const[r,i]=t.entries().next().value;r!==ln&&hR(e.slice(0,-1),r,i)}},hR=(e,t,n)=>{if(e.length===0)return;const[r,i]=Ly(e);r.set(i+t,n),r.delete(i)},Ly=e=>e[e.length-1],zy="or",pR="and",l$="and_not";class la{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?Wm:t.autoVacuum;this._options=Object.assign(Object.assign(Object.assign({},Ym),t),{autoVacuum:n,searchOptions:Object.assign(Object.assign({},cE),t.searchOptions||{}),autoSuggestOptions:Object.assign(Object.assign({},h$),t.autoSuggestOptions||{})}),this._index=new oa,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=ev,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:i,fields:o,idField:l}=this._options,u=n(t,l);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${l}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const d of o){const p=n(t,d);if(p==null)continue;const m=r(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.addFieldLength(f,v,this._documentCount-1,g);for(const w of m){const x=i(w,d);if(Array.isArray(x))for(const k of x)this.addTerm(v,f,k);else x&&this.addTerm(v,f,x)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:l}=t.reduce(({chunk:u,promise:f},d,p)=>(u.push(d),(p+1)%r===0?{chunk:[],promise:f.then(()=>new Promise(m=>setTimeout(m,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),i);return l.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:i,fields:o,idField:l}=this._options,u=i(t,l);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${l}"`);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 d of o){const p=i(t,d);if(p==null)continue;const m=n(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.removeFieldLength(f,v,this._documentCount,g);for(const w of m){const x=r(w,d);if(Array.isArray(x))for(const k of x)this.removeTerm(v,f,k);else x&&this.removeTerm(v,f,x)}}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 oa,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((r,i)=>{this.removeFieldLength(n,i,this._documentCount,r)}),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:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,i=r(t,n);this.discard(i),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 r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=ev,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}performVacuuming(t,n){return vf(this,void 0,void 0,function*(){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const i=t.batchSize||Jg.batchSize,o=t.batchWait||Jg.batchWait;let l=1;for(const[u,f]of this._index){for(const[d,p]of f)for(const[m]of p)this._documentIds.has(m)||(p.size<=1?f.delete(d):p.delete(m));this._index.get(u).size===0&&this._index.delete(u),l%i===0&&(yield new Promise(d=>setTimeout(d,o))),l+=1}this._dirtCount-=r}yield null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null})}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||Wm.minDirtCount,r=r||Wm.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}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:r}=this._options,i=Object.assign(Object.assign({},r),n),o=this.executeQuery(t,n),l=[];for(const[u,{score:f,terms:d,match:p}]of o){const m=d.length||1,v={id:this._documentIds.get(u),score:f*m,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(v,this._storedFields.get(u)),(i.filter==null||i.filter(v))&&l.push(v)}return t===la.wildcard&&i.boostDocument==null||l.sort(dE),l}autoSuggest(t,n={}){n=Object.assign(Object.assign({},this._options.autoSuggestOptions),n);const r=new Map;for(const{score:o,terms:l}of this.search(t,n)){const u=l.join(" "),f=r.get(u);f!=null?(f.score+=o,f.count+=1):r.set(u,{score:o,terms:l,count:1})}const i=[];for(const[o,{score:l,terms:u,count:f}]of r)i.push({suggestion:o,terms:u,score:l/f});return i.sort(dE),i}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 vf(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(Ym.hasOwnProperty(t))return qm(Ym,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:l,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=qc(i),f._fieldLength=qc(o),f._storedFields=qc(l);for(const[d,p]of f._documentIds)f._idToShortId.set(p,d);for(const[d,p]of r){const m=new Map;for(const v of Object.keys(p)){let g=p[v];u===1&&(g=g.ds),m.set(parseInt(v,10),qc(g))}f._index.set(d,m)}return f}static loadJSAsync(t,n){return vf(this,void 0,void 0,function*(){const{index:r,documentIds:i,fieldLength:o,storedFields:l,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=yield Yc(i),f._fieldLength=yield Yc(o),f._storedFields=yield Yc(l);for(const[p,m]of f._documentIds)f._idToShortId.set(m,p);let d=0;for(const[p,m]of r){const v=new Map;for(const g of Object.keys(m)){let w=m[g];u===1&&(w=w.ds),v.set(parseInt(g,10),yield Yc(w))}++d%1e3===0&&(yield mR(0)),f._index.set(p,v)}return f})}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:i,fieldIds:o,averageFieldLength:l,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new la(n);return d._documentCount=r,d._nextId=i,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=l,d._dirtCount=u||0,d._index=new oa,d}executeQuery(t,n={}){if(t===la.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const v=Object.assign(Object.assign(Object.assign({},n),t),{queries:void 0}),g=t.queries.map(w=>this.executeQuery(w,v));return this.combineResults(g,v.combineWith)}const{tokenize:r,processTerm:i,searchOptions:o}=this._options,l=Object.assign(Object.assign({tokenize:r,processTerm:i},o),n),{tokenize:u,processTerm:f}=l,m=u(t).flatMap(v=>f(v)).filter(v=>!!v).map(d$(l)).map(v=>this.executeQuerySpec(v,l));return this.combineResults(m,l.combineWith)}executeQuerySpec(t,n){const r=Object.assign(Object.assign({},this._options.searchOptions),n),i=(r.fields||this._options.fields).reduce((x,k)=>Object.assign(Object.assign({},x),{[k]:qm(r.boost,k)||1}),{}),{boostDocument:o,weights:l,maxFuzzy:u,bm25:f}=r,{fuzzy:d,prefix:p}=Object.assign(Object.assign({},cE.weights),l),m=this._index.get(t.term),v=this.termResults(t.term,t.term,1,t.termBoost,m,i,o,f);let g,w;if(t.prefix&&(g=this._index.atPrefix(t.term)),t.fuzzy){const x=t.fuzzy===!0?.2:t.fuzzy,k=x<1?Math.min(u,Math.round(t.term.length*x)):x;k&&(w=this._index.fuzzyGet(t.term,k))}if(g)for(const[x,k]of g){const C=x.length-t.term.length;if(!C)continue;w==null||w.delete(x);const _=p*x.length/(x.length+.3*C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}if(w)for(const x of w.keys()){const[k,C]=w.get(x);if(!C)continue;const _=d*x.length/(x.length+C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}return v}executeWildcardQuery(t){const n=new Map,r=Object.assign(Object.assign({},this._options.searchOptions),t);for(const[i,o]of this._documentIds){const l=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(i)):1;n.set(i,{score:l,terms:[],match:{}})}return n}combineResults(t,n=zy){if(t.length===0)return new Map;const r=n.toLowerCase(),i=u$[r];if(!i)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(i)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const i={};for(const[o,l]of r)i[o]=Object.fromEntries(l);t.push([n,i])}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,r,i,o,l,u,f,d=new Map){if(o==null)return d;for(const p of Object.keys(l)){const m=l[p],v=this._fieldIds[p],g=o.get(v);if(g==null)continue;let w=g.size;const x=this._avgFieldLength[v];for(const k of g.keys()){if(!this._documentIds.has(k)){this.removeTerm(v,k,n),w-=1;continue}const C=u?u(this._documentIds.get(k),n,this._storedFields.get(k)):1;if(!C)continue;const _=g.get(k),T=this._fieldLength.get(k)[v],N=f$(_,w,this._documentCount,T,x,f),D=r*i*m*C*N,L=d.get(k);if(L){L.score+=D,p$(L.terms,t);const R=qm(L.match,n);R?R.push(p):L.match[n]=[p]}else d.set(k,{score:D,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const i=this._index.fetch(r,hE);let o=i.get(t);if(o==null)o=new Map,o.set(n,1),i.set(t,o);else{const l=o.get(n);o.set(n,(l||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const i=this._index.fetch(r,hE),o=i.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?i.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${i}". 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,r,i){let o=this._fieldLength.get(t);o==null&&this._fieldLength.set(t,o=[]),o[n]=i;const u=(this._avgFieldLength[n]||0)*r+i;this._avgFieldLength[n]=u/(r+1)}removeFieldLength(t,n,r,i){if(r===1){this._avgFieldLength[n]=0;return}const o=this._avgFieldLength[n]*r-i;this._avgFieldLength[n]=o/(r-1)}saveStoredFields(t,n){const{storeFields:r,extractField:i}=this._options;if(r==null||r.length===0)return;let o=this._storedFields.get(t);o==null&&this._storedFields.set(t,o={});for(const l of r){const u=i(n,l);u!==void 0&&(o[l]=u)}}}la.wildcard=Symbol("*");const qm=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,u$={[zy]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:i,terms:o,match:l}=t.get(n);r.score=r.score+i,r.match=Object.assign(r.match,l),fE(r.terms,o)}}return e},[pR]:(e,t)=>{const n=new Map;for(const r of t.keys()){const i=e.get(r);if(i==null)continue;const{score:o,terms:l,match:u}=t.get(r);fE(i.terms,l),n.set(r,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,u)})}return n},[l$]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},c$={k:1.2,b:.7,d:.5},f$=(e,t,n,r,i,o)=>{const{k:l,b:u,d:f}=o;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(l+1)/(e+l*(1-u+u*r/i)))},d$=e=>(t,n,r)=>{const i=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,l=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:i,prefix:o,termBoost:l}},Ym={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(m$),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},cE={combineWith:zy,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:c$},h$={combineWith:pR,prefix:(e,t,n)=>t===n.length-1},Jg={batchSize:1e3,batchWait:10},ev={minDirtFactor:.1,minDirtCount:20},Wm=Object.assign(Object.assign({},Jg),ev),p$=(e,t)=>{e.includes(t)||e.push(t)},fE=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},dE=({score:e},{score:t})=>t-e,hE=()=>new Map,qc=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Yc=e=>vf(void 0,void 0,void 0,function*(){const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&(yield mR(0));return t}),mR=e=>new Promise(t=>setTimeout(t,e)),m$=/[\n\r\p{Z}\p{P}]+/u,g$={index:new la({fields:[]})};E.createContext(g$);const tv=({label:e,color:t,hidden:n,labels:r={}})=>be.createElement("div",{className:"node"},be.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),be.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),v$=({id:e,labels:t})=>{const n=hr(),r=E.useMemo(()=>{const i=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},i),o?o(e,i):{})},[n,e]);return be.createElement(tv,Object.assign({},r,{labels:t}))},y$=({label:e,color:t,source:n,target:r,hidden:i,directed:o,labels:l={}})=>be.createElement("div",{className:"edge"},be.createElement(tv,Object.assign({},n,{labels:l})),be.createElement("div",{className:"body"},be.createElement("div",{className:"render"},be.createElement("span",{className:i?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&be.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),be.createElement("span",{className:`label ${i?"text-muted":""} ${e?"":"fst-italic"}`},e||l.no_label||"No label")),be.createElement(tv,Object.assign({},r,{labels:l}))),b$=({id:e,labels:t})=>{const n=hr(),r=E.useMemo(()=>{const i=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),l=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)},i),l?l(e,i):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),o?o(e,f):{})})},[n,e]);return be.createElement(y$,Object.assign({},r,{labels:t}))};function My(e,t){const[n,r]=E.useState(e);return E.useEffect(()=>{const i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n}function x$({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,notFound:o,loadingSkeleton:l,label:u,placeholder:f="Select...",value:d,onChange:p,onFocus:m,disabled:v=!1,className:g,noResultsMessage:w}){const[x,k]=E.useState(!1),[C,_]=E.useState(!1),[T,N]=E.useState([]),[D,L]=E.useState(!1),[R,U]=E.useState(null),[P,z]=E.useState(d),[V,q]=E.useState(null),[I,Y]=E.useState(""),Z=My(I,t?0:150),[B,G]=E.useState([]);E.useEffect(()=>{k(!0),z(d)},[d]),E.useEffect(()=>{x||(async()=>{try{L(!0),U(null);const H=d!==null?await e(d):[];G(H),N(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{L(!1)}})()},[x,e,d]),E.useEffect(()=>{const A=async()=>{try{L(!0),U(null);const H=await e(Z);G(H),N(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{L(!1)}};x&&t?t&&N(Z?B.filter(H=>n?n(H,Z):!0):B):A()},[e,Z,x,t,n]);const F=E.useCallback(A=>{A!==P&&(z(A),p(A)),_(!1)},[P,z,_,p]),K=E.useCallback(A=>{A!==V&&(q(A),m(A))},[V,q,m]);return S.jsx("div",{className:Me(v&&"cursor-not-allowed opacity-50",g),onFocus:()=>{_(!0)},onBlur:()=>_(!1),children:S.jsxs(bd,{shouldFilter:!1,className:"bg-transparent",children:[S.jsxs("div",{children:[S.jsx(Ny,{placeholder:f,value:I,className:"max-h-8",onValueChange:A=>{Y(A),A&&!C&&_(!0)}}),D&&T.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Ek,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(xd,{hidden:!C||Z.length===0,children:[R&&S.jsx("div",{className:"text-destructive p-4 text-center",children:R}),D&&T.length===0&&(l||S.jsx(w$,{})),!D&&!R&&T.length===0&&(o||S.jsx(Oy,{children:w??`No ${u.toLowerCase()} found.`})),S.jsx(Cs,{children:T.map((A,H)=>S.jsxs(S.Fragment,{children:[S.jsx(Ts,{value:i(A),onSelect:F,onMouseEnter:()=>K(i(A)),className:"truncate",children:r(A)},i(A)+`${H}`),H!==T.length-1&&S.jsx("div",{className:"bg-foreground/10 h-[1px]"},H)]}))})]})]})})}function w$(){return S.jsx(Cs,{children:S.jsx(Ts,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function S$(e){return S.jsxs("div",{children:[e.type==="nodes"&&S.jsx(v$,{id:e.id}),e.type==="edges"&&S.jsx(b$,{id:e.id}),e.type==="message"&&S.jsx("div",{children:e.message})]})}const Xm="__message_item",Wc={graph:null,searchEngine:null},E$=({onChange:e,onFocus:t,value:n})=>{const r=yt.use.sigmaGraph(),i=E.useMemo(()=>{if(Wc.graph==r)return Wc.searchEngine;if(!r||r.nodes().length==0)return;Wc.graph=r;const l=new la({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=r.nodes().map(f=>({id:f,label:r.getNodeAttribute(f,"label")}));return l.addAll(u),Wc.searchEngine=l,l},[r]),o=E.useCallback(async l=>{if(t&&t(null),!l||!i)return[];const u=i.search(l).map(f=>({id:f.id,type:"nodes"}));return u.length<=Vp?u:[...u.slice(0,Vp),{type:"message",id:Xm,message:`And ${u.length-Vp} others`}]},[i,t]);return S.jsx(x$,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:o,renderOption:S$,getOptionValue:l=>l.id,value:n&&n.type!=="message"?n.id:null,onChange:l=>{l!==Xm&&e(l?{id:l,type:"nodes"}:null)},onFocus:l=>{l!==Xm&&t&&t(l?{id:l,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},_$=({...e})=>S.jsx(E$,{...e});function k$({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,getDisplayValue:o,notFound:l,loadingSkeleton:u,label:f,placeholder:d="Select...",value:p,onChange:m,disabled:v=!1,className:g,triggerClassName:w,searchInputClassName:x,noResultsMessage:k,triggerTooltip:C,clearable:_=!0}){const[T,N]=E.useState(!1),[D,L]=E.useState(!1),[R,U]=E.useState([]),[P,z]=E.useState(!1),[V,q]=E.useState(null),[I,Y]=E.useState(p),[Z,B]=E.useState(null),[G,F]=E.useState(""),K=My(G,t?0:150),[A,H]=E.useState([]);E.useEffect(()=>{N(!0),Y(p)},[p]),E.useEffect(()=>{if(p&&R.length>0){const O=R.find(X=>i(X)===p);O&&B(O)}},[p,R,i]),E.useEffect(()=>{T||(async()=>{try{z(!0),q(null);const X=await e(p);H(X),U(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{z(!1)}})()},[T,e,p]),E.useEffect(()=>{const O=async()=>{try{z(!0),q(null);const X=await e(K);H(X),U(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{z(!1)}};T&&t?t&&U(K?A.filter(X=>n?n(X,K):!0):A):O()},[e,K,T,t,n]);const M=E.useCallback(O=>{const X=_&&O===I?"":O;Y(X),B(R.find(re=>i(re)===X)||null),m(X),L(!1)},[I,m,_,R,i]);return S.jsxs(dd,{open:D,onOpenChange:L,children:[S.jsx(hd,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",role:"combobox","aria-expanded":D,className:Me("justify-between",v&&"cursor-not-allowed opacity-50",w),disabled:v,tooltip:C,side:"bottom",children:[Z?o(Z):d,S.jsx(xM,{className:"opacity-50",size:10})]})}),S.jsx(uu,{className:Me("p-0",g),onCloseAutoFocus:O=>O.preventDefault(),children:S.jsxs(bd,{shouldFilter:!1,children:[S.jsxs("div",{className:"relative w-full border-b",children:[S.jsx(Ny,{placeholder:`Search ${f.toLowerCase()}...`,value:G,onValueChange:O=>{F(O)},className:x}),P&&R.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Ek,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(xd,{children:[V&&S.jsx("div",{className:"text-destructive p-4 text-center",children:V}),P&&R.length===0&&(u||S.jsx(C$,{})),!P&&!V&&R.length===0&&(l||S.jsx(Oy,{children:k??`No ${f.toLowerCase()} found.`})),S.jsx(Cs,{children:R.map(O=>S.jsxs(Ts,{value:i(O),onSelect:M,className:"truncate",children:[r(O),S.jsx(Lv,{className:Me("ml-auto h-3 w-3",I===i(O)?"opacity-100":"opacity-0")})]},i(O)))})]})]})})]})}function C$(){return S.jsx(Cs,{children:S.jsx(Ts,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const T$=()=>{const e=Qe.use.queryLabel(),[t,n]=E.useState({labels:[],searchEngine:null}),[r,i]=E.useState(!1),o=E.useCallback(async u=>{let f=t.labels,d=t.searchEngine;if(!r||!d){f=["*"].concat(await iM()),f.includes(Qe.getState().queryLabel)||Qe.getState().setQueryLabel(f[0]),d=new la({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const p=f.map((m,v)=>({id:v,value:m}));d.addAll(p),n({labels:f,searchEngine:d}),i(!0)}return u?d.search(u).map(p=>f[p.id]):f},[t,r,n,i]),l=E.useCallback(u=>{Qe.getState().setQueryLabel(u)},[]);return S.jsx(k$,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:o,renderOption:u=>S.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>S.jsx("div",{children:u}),notFound:S.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:l})},jn=({text:e,className:t,tooltipClassName:n,tooltip:r,side:i,onClick:o})=>r?S.jsx(XC,{delayDuration:200,children:S.jsxs(KC,{children:[S.jsx(ZC,{asChild:!0,children:S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),S.jsx(ly,{side:i,className:n,children:r})]})}):S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e}),A$=()=>{const{getNode:e,getEdge:t}=eR(),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.selectedEdge(),o=yt.use.focusedEdge(),[l,u]=E.useState(null),[f,d]=E.useState(null);return E.useEffect(()=>{let p=null,m=null;r?(p="node",m=e(r)):n?(p="node",m=e(n)):o?(p="edge",m=t(o,!0)):i&&(p="edge",m=t(i,!0)),m?(p=="node"?u(R$(m)):u(D$(m)),d(p)):(u(null),d(null))},[r,n,o,i,u,d,e,t]),l?S.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?S.jsx(N$,{node:l}):S.jsx(O$,{edge:l})}):S.jsx(S.Fragment,{})},R$=e=>{const t=yt.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const r of t.sigmaGraph.edges(e.id)){const i=t.rawGraph.getEdge(r,!0);if(i){const o=e.id===i.source,l=o?i.target:i.source,u=t.rawGraph.getNode(l);u&&n.push({type:o?"Target":"Source",id:l,label:u.labels.join(", ")})}}return{...e,relationships:n}},D$=e=>{var i,o;const t=yt.getState(),n=(i=t.rawGraph)==null?void 0:i.getNode(e.source),r=(o=t.rawGraph)==null?void 0:o.getNode(e.target);return{...e,sourceNode:n,targetNode:r}},Br=({name:e,value:t,onClick:n,tooltip:r})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",S.jsx(jn,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||t,side:"left",onClick:n})]}),N$=({node:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Br,{name:"Id",value:e.id}),S.jsx(Br,{name:"Labels",value:e.labels.join(", "),onClick:()=>{yt.getState().setSelectedNode(e.id,!0)}}),S.jsx(Br,{name:"Degree",value:e.degree})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Br,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:r})=>S.jsx(Br,{name:t,value:r,onClick:()=>{yt.getState().setSelectedNode(n,!0)}},n))})]})]}),O$=({edge:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Br,{name:"Id",value:e.id}),e.type&&S.jsx(Br,{name:"Type",value:e.type}),S.jsx(Br,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{yt.getState().setSelectedNode(e.source,!0)}}),S.jsx(Br,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{yt.getState().setSelectedNode(e.target,!0)}})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Br,{name:t,value:e.properties[t]},t))})]}),pE={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:dA,curvedArrow:nB,curvedNoArrow:tB},nodeProgramClasses:{default:FU,circel:fu,point:dU},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},j$=()=>{const e=xA(),t=hr(),[n,r]=E.useState(null);return E.useEffect(()=>{e({downNode:i=>{r(i.node),t.getGraph().setNodeAttribute(i.node,"highlighted",!0)},mousemovebody:i=>{if(!n)return;const o=t.viewportToGraph(i);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),i.preventSigmaDefault(),i.original.preventDefault(),i.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},L$=()=>{const[e,t]=E.useState(pE),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.moveToSelectedNode(),o=Qe.use.showPropertyPanel(),l=Qe.use.showNodeSearchBar(),u=Qe.use.showNodeLabel(),f=Qe.use.enableEdgeEvents(),d=Qe.use.enableNodeDrag(),p=Qe.use.showEdgeLabel();E.useEffect(()=>{t({...pE,enableEdgeEvents:f,renderEdgeLabels:p,renderLabels:u})},[u,f,p]);const m=E.useCallback(x=>{x===null?yt.getState().setFocusedNode(null):x.type==="nodes"&&yt.getState().setFocusedNode(x.id)},[]),v=E.useCallback(x=>{x===null?yt.getState().setSelectedNode(null):x.type==="nodes"&&yt.getState().setSelectedNode(x.id,!0)},[]),g=E.useMemo(()=>r??n,[r,n]),w=E.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return S.jsxs(oU,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[S.jsx(Y6,{}),d&&S.jsx(j$,{}),S.jsx(aB,{node:g,move:i}),S.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[S.jsx(T$,{}),l&&S.jsx(_$,{value:w,onFocus:m,onChange:v})]}),S.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[S.jsx(i$,{}),S.jsx(W6,{}),S.jsx(E6,{}),S.jsx(X6,{})]}),o&&S.jsx("div",{className:"absolute top-2 right-2",children:S.jsx(A$,{})})]})},gR=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{className:"relative w-full overflow-auto",children:S.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));gR.displayName="Table";const vR=E.forwardRef(({className:e,...t},n)=>S.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));vR.displayName="TableHeader";const yR=E.forwardRef(({className:e,...t},n)=>S.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));yR.displayName="TableBody";const z$=E.forwardRef(({className:e,...t},n)=>S.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));z$.displayName="TableFooter";const nv=E.forwardRef(({className:e,...t},n)=>S.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));nv.displayName="TableRow";const bi=E.forwardRef(({className:e,...t},n)=>S.jsx("th",{ref:n,className:Me("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}));bi.displayName="TableHead";const xi=E.forwardRef(({className:e,...t},n)=>S.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xi.displayName="TableCell";const M$=E.forwardRef(({className:e,...t},n)=>S.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));M$.displayName="TableCaption";const Kl=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));Kl.displayName="Card";const Of=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Of.displayName="CardHeader";const Zl=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));Zl.displayName="CardTitle";const wd=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));wd.displayName="CardDescription";const jf=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));jf.displayName="CardContent";const P$=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));P$.displayName="CardFooter";function F$({title:e,description:t,icon:n=TM,action:r,className:i,...o}){return S.jsxs(Kl,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",i),...o,children:[S.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:S.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[S.jsx(Zl,{children:e}),t?S.jsx(wd,{children:t}):null]}),r||null]})}var Km={exports:{}},Zm,mE;function I$(){if(mE)return Zm;mE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Zm=e,Zm}var Qm,gE;function G$(){if(gE)return Qm;gE=1;var e=I$();function t(){}function n(){}return n.resetWarningCache=t,Qm=function(){function r(l,u,f,d,p,m){if(m!==e){var v=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 v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Qm}var vE;function U$(){return vE||(vE=1,Km.exports=G$()()),Km.exports}var B$=U$();const Ct=fn(B$),$$=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 ds(e,t,n){const r=H$(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&yE(r,"path",o),yE(r,"relativePath",o),r}function H$(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=$$.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function yE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const V$=[".DS_Store","Thumbs.db"];function q$(e){return no(this,void 0,void 0,function*(){return Lf(e)&&Y$(e.dataTransfer)?Z$(e.dataTransfer,e.type):W$(e)?X$(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?K$(e):[]})}function Y$(e){return Lf(e)}function W$(e){return Lf(e)&&Lf(e.target)}function Lf(e){return typeof e=="object"&&e!==null}function X$(e){return rv(e.target.files).map(t=>ds(t))}function K$(e){return no(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>ds(n))})}function Z$(e,t){return no(this,void 0,void 0,function*(){if(e.items){const n=rv(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(Q$));return bE(bR(r))}return bE(rv(e.files).map(n=>ds(n)))})}function bE(e){return e.filter(t=>V$.indexOf(t.name)===-1)}function rv(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function Q$(e){if(typeof e.webkitGetAsEntry!="function")return xE(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?xR(t):xE(e,t)}function bR(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?bR(n):[n]],[])}function xE(e,t){return no(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const l=yield o.getFile();return l.handle=o,ds(l)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return ds(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function J$(e){return no(this,void 0,void 0,function*(){return e.isDirectory?xR(e):eH(e)})}function xR(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(l=>no(this,void 0,void 0,function*(){if(l.length){const u=Promise.all(l.map(J$));i.push(u),o()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),l=>{r(l)})}o()})}function eH(e){return no(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=ds(r,e.fullPath);t(i)},r=>{n(r)})})})}var Xc={},wE;function tH(){return wE||(wE=1,Xc.__esModule=!0,Xc.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(l){var u=l.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):i===u})}return!0}),Xc}var nH=tH();const Jm=fn(nH);function SE(e){return aH(e)||iH(e)||SR(e)||rH()}function rH(){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 iH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aH(e){if(Array.isArray(e))return iv(e)}function EE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EE(Object(n),!0).forEach(function(r){wR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ql(e,t){return lH(e)||sH(e,t)||SR(e,t)||oH()}function oH(){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 SR(e,t){if(e){if(typeof e=="string")return iv(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 iv(e,t)}}function iv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sH(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,l,u;try{for(n=n.call(e);!(i=(l=n.next()).done)&&(r.push(l.value),!(t&&r.length===t));i=!0);}catch(f){o=!0,u=f}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw u}}return r}}function lH(e){if(Array.isArray(e))return e}var uH=typeof Jm=="function"?Jm:Jm.default,cH="file-invalid-type",fH="file-too-large",dH="file-too-small",hH="too-many-files",pH=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:cH,message:"File type must be ".concat(r)}},kE=function(t){return{code:fH,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},CE=function(t){return{code:dH,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},mH={code:hH,message:"Too many files"};function ER(e,t){var n=e.type==="application/x-moz-file"||uH(e,t);return[n,n?null:pH(t)]}function _R(e,t,n){if(Ha(e.size))if(Ha(t)&&Ha(n)){if(e.size>n)return[!1,kE(n)];if(e.size<t)return[!1,CE(t)]}else{if(Ha(t)&&e.size<t)return[!1,CE(t)];if(Ha(n)&&e.size>n)return[!1,kE(n)]}return[!0,null]}function Ha(e){return e!=null}function gH(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,l=e.maxFiles,u=e.validator;return!o&&t.length>1||o&&l>=1&&t.length>l?!1:t.every(function(f){var d=ER(f,n),p=Ql(d,1),m=p[0],v=_R(f,r,i),g=Ql(v,1),w=g[0],x=u?u(f):null;return m&&w&&!x})}function zf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Kc(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 TE(e){e.preventDefault()}function vH(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function yH(e){return e.indexOf("Edge/")!==-1}function bH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return vH(e)||yH(e)}function Ir(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),l=1;l<i;l++)o[l-1]=arguments[l];return t.some(function(u){return!zf(r)&&u&&u.apply(void 0,[r].concat(o)),zf(r)})}}function xH(){return"showOpenFilePicker"in window}function wH(e){if(Ha(e)){var t=Object.entries(e).filter(function(n){var r=Ql(n,2),i=r[0],o=r[1],l=!0;return kR(i)||(console.warn('Skipped "'.concat(i,'" 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.')),l=!1),(!Array.isArray(o)||!o.every(CR))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),l=!1),l}).reduce(function(n,r){var i=Ql(r,2),o=i[0],l=i[1];return _E(_E({},n),{},wR({},o,l))},{});return[{description:"Files",accept:t}]}return e}function SH(e){if(Ha(e))return Object.entries(e).reduce(function(t,n){var r=Ql(n,2),i=r[0],o=r[1];return[].concat(SE(t),[i],SE(o))},[]).filter(function(t){return kR(t)||CR(t)}).join(",")}function EH(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function _H(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function kR(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function CR(e){return/^.*\.[\w]+$/.test(e)}var kH=["children"],CH=["open"],TH=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],AH=["refKey","onChange","onClick"];function RH(e){return OH(e)||NH(e)||TR(e)||DH()}function DH(){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 NH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function OH(e){if(Array.isArray(e))return av(e)}function eg(e,t){return zH(e)||LH(e,t)||TR(e,t)||jH()}function jH(){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 TR(e,t){if(e){if(typeof e=="string")return av(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 av(e,t)}}function av(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LH(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,l,u;try{for(n=n.call(e);!(i=(l=n.next()).done)&&(r.push(l.value),!(t&&r.length===t));i=!0);}catch(f){o=!0,u=f}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw u}}return r}}function zH(e){if(Array.isArray(e))return e}function AE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AE(Object(n),!0).forEach(function(r){ov(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ov(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mf(e,t){if(e==null)return{};var n=MH(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function MH(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Sd=E.forwardRef(function(e,t){var n=e.children,r=Mf(e,kH),i=PH(r),o=i.open,l=Mf(i,CH);return E.useImperativeHandle(t,function(){return{open:o}},[o]),be.createElement(E.Fragment,null,n(zt(zt({},l),{},{open:o})))});Sd.displayName="Dropzone";var AR={disabled:!1,getFilesFromEvent:q$,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};Sd.defaultProps=AR;Sd.propTypes={children:Ct.func,accept:Ct.objectOf(Ct.arrayOf(Ct.string)),multiple:Ct.bool,preventDropOnDocument:Ct.bool,noClick:Ct.bool,noKeyboard:Ct.bool,noDrag:Ct.bool,noDragEventsBubbling:Ct.bool,minSize:Ct.number,maxSize:Ct.number,maxFiles:Ct.number,disabled:Ct.bool,getFilesFromEvent:Ct.func,onFileDialogCancel:Ct.func,onFileDialogOpen:Ct.func,useFsAccessApi:Ct.bool,autoFocus:Ct.bool,onDragEnter:Ct.func,onDragLeave:Ct.func,onDragOver:Ct.func,onDrop:Ct.func,onDropAccepted:Ct.func,onDropRejected:Ct.func,onError:Ct.func,validator:Ct.func};var sv={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function PH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=zt(zt({},AR),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,l=t.minSize,u=t.multiple,f=t.maxFiles,d=t.onDragEnter,p=t.onDragLeave,m=t.onDragOver,v=t.onDrop,g=t.onDropAccepted,w=t.onDropRejected,x=t.onFileDialogCancel,k=t.onFileDialogOpen,C=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,N=t.noClick,D=t.noKeyboard,L=t.noDrag,R=t.noDragEventsBubbling,U=t.onError,P=t.validator,z=E.useMemo(function(){return SH(n)},[n]),V=E.useMemo(function(){return wH(n)},[n]),q=E.useMemo(function(){return typeof k=="function"?k:RE},[k]),I=E.useMemo(function(){return typeof x=="function"?x:RE},[x]),Y=E.useRef(null),Z=E.useRef(null),B=E.useReducer(FH,sv),G=eg(B,2),F=G[0],K=G[1],A=F.isFocused,H=F.isFileDialogActive,M=E.useRef(typeof window<"u"&&window.isSecureContext&&C&&xH()),O=function(){!M.current&&H&&setTimeout(function(){if(Z.current){var Ne=Z.current.files;Ne.length||(K({type:"closeDialog"}),I())}},300)};E.useEffect(function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}},[Z,H,I,M]);var X=E.useRef([]),re=function(Ne){Y.current&&Y.current.contains(Ne.target)||(Ne.preventDefault(),X.current=[])};E.useEffect(function(){return T&&(document.addEventListener("dragover",TE,!1),document.addEventListener("drop",re,!1)),function(){T&&(document.removeEventListener("dragover",TE),document.removeEventListener("drop",re))}},[Y,T]),E.useEffect(function(){return!r&&_&&Y.current&&Y.current.focus(),function(){}},[Y,_,r]);var ue=E.useCallback(function(ve){U?U(ve):console.error(ve)},[U]),ae=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[].concat(RH(X.current),[ve.target]),Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){if(!(zf(ve)&&!R)){var te=Ne.length,de=te>0&&gH({files:Ne,accept:z,minSize:l,maxSize:o,multiple:u,maxFiles:f,validator:P}),Oe=te>0&&!de;K({isDragAccept:de,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ve)}}).catch(function(Ne){return ue(Ne)})},[i,d,ue,R,z,l,o,u,f,P]),oe=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=Kc(ve);if(Ne&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return Ne&&m&&m(ve),!1},[m,R]),Ce=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=X.current.filter(function(de){return Y.current&&Y.current.contains(de)}),te=Ne.indexOf(ve.target);te!==-1&&Ne.splice(te,1),X.current=Ne,!(Ne.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Kc(ve)&&p&&p(ve))},[Y,p,R]),he=E.useCallback(function(ve,Ne){var te=[],de=[];ve.forEach(function(Oe){var He=ER(Oe,z),Ye=eg(He,2),vt=Ye[0],Mt=Ye[1],bt=_R(Oe,l,o),rt=eg(bt,2),qt=rt[0],at=rt[1],At=P?P(Oe):null;if(vt&&qt&&!At)te.push(Oe);else{var rn=[Mt,at];At&&(rn=rn.concat(At)),de.push({file:Oe,errors:rn.filter(function(io){return io})})}}),(!u&&te.length>1||u&&f>=1&&te.length>f)&&(te.forEach(function(Oe){de.push({file:Oe,errors:[mH]})}),te.splice(0)),K({acceptedFiles:te,fileRejections:de,isDragReject:de.length>0,type:"setFiles"}),v&&v(te,de,Ne),de.length>0&&w&&w(de,Ne),te.length>0&&g&&g(te,Ne)},[K,u,z,l,o,f,v,g,w,P]),Ee=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[],Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){zf(ve)&&!R||he(Ne,ve)}).catch(function(Ne){return ue(Ne)}),K({type:"reset"})},[i,he,ue,R]),we=E.useCallback(function(){if(M.current){K({type:"openDialog"}),q();var ve={multiple:u,types:V};window.showOpenFilePicker(ve).then(function(Ne){return i(Ne)}).then(function(Ne){he(Ne,null),K({type:"closeDialog"})}).catch(function(Ne){EH(Ne)?(I(Ne),K({type:"closeDialog"})):_H(Ne)?(M.current=!1,Z.current?(Z.current.value=null,Z.current.click()):ue(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."))):ue(Ne)});return}Z.current&&(K({type:"openDialog"}),q(),Z.current.value=null,Z.current.click())},[K,q,I,C,he,ue,V,u]),Pe=E.useCallback(function(ve){!Y.current||!Y.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),we())},[Y,we]),Ae=E.useCallback(function(){K({type:"focus"})},[]),xe=E.useCallback(function(){K({type:"blur"})},[]),ee=E.useCallback(function(){N||(bH()?setTimeout(we,0):we())},[N,we]),ce=function(Ne){return r?null:Ne},Te=function(Ne){return D?null:ce(Ne)},ge=function(Ne){return L?null:ce(Ne)},Se=function(Ne){R&&Ne.stopPropagation()},ie=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.role,Oe=ve.onKeyDown,He=ve.onFocus,Ye=ve.onBlur,vt=ve.onClick,Mt=ve.onDragEnter,bt=ve.onDragOver,rt=ve.onDragLeave,qt=ve.onDrop,at=Mf(ve,TH);return zt(zt(ov({onKeyDown:Te(Ir(Oe,Pe)),onFocus:Te(Ir(He,Ae)),onBlur:Te(Ir(Ye,xe)),onClick:ce(Ir(vt,ee)),onDragEnter:ge(Ir(Mt,ae)),onDragOver:ge(Ir(bt,oe)),onDragLeave:ge(Ir(rt,Ce)),onDrop:ge(Ir(qt,Ee)),role:typeof de=="string"&&de!==""?de:"presentation"},te,Y),!r&&!D?{tabIndex:0}:{}),at)}},[Y,Pe,Ae,xe,ee,ae,oe,Ce,Ee,D,L,r]),$e=E.useCallback(function(ve){ve.stopPropagation()},[]),Ge=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.onChange,Oe=ve.onClick,He=Mf(ve,AH),Ye=ov({accept:z,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:ce(Ir(de,Ee)),onClick:ce(Ir(Oe,$e)),tabIndex:-1},te,Z);return zt(zt({},Ye),He)}},[Z,n,u,Ee,r]);return zt(zt({},F),{},{isFocused:A&&!r,getRootProps:ie,getInputProps:Ge,rootRef:Y,inputRef:Z,open:ce(we)})}function FH(e,t){switch(t.type){case"focus":return zt(zt({},e),{},{isFocused:!0});case"blur":return zt(zt({},e),{},{isFocused:!1});case"openDialog":return zt(zt({},sv),{},{isFileDialogActive:!0});case"closeDialog":return zt(zt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return zt(zt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return zt(zt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return zt({},sv);default:return e}}function RE(){}var Py="Progress",Fy=100,[IH,vK]=dr(Py),[GH,UH]=IH(Py),RR=E.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=BH,...l}=e;(i||i===0)&&!DE(i)&&console.error($H(`${i}`,"Progress"));const u=DE(i)?i:Fy;r!==null&&!NE(r,u)&&console.error(HH(`${r}`,"Progress"));const f=NE(r,u)?r:null,d=Pf(f)?o(f,u):void 0;return S.jsx(GH,{scope:n,value:f,max:u,children:S.jsx(We.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Pf(f)?f:void 0,"aria-valuetext":d,role:"progressbar","data-state":OR(f,u),"data-value":f??void 0,"data-max":u,...l,ref:t})})});RR.displayName=Py;var DR="ProgressIndicator",NR=E.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=UH(DR,n);return S.jsx(We.div,{"data-state":OR(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});NR.displayName=DR;function BH(e,t){return`${Math.round(e/t*100)}%`}function OR(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Pf(e){return typeof e=="number"}function DE(e){return Pf(e)&&!isNaN(e)&&e>0}function NE(e,t){return Pf(e)&&!isNaN(e)&&e<=t&&e>=0}function $H(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Fy}\`.`}function HH(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 ${Fy} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`}var jR=RR,VH=NR;const LR=E.forwardRef(({className:e,value:t,...n},r)=>S.jsx(jR,{ref:r,className:Me("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:S.jsx(VH,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));LR.displayName=jR.displayName;function lv(e,[t,n]){return Math.min(n,Math.max(t,e))}function qH(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Iy="ScrollArea",[zR,yK]=dr(Iy),[YH,pr]=zR(Iy),MR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...l}=e,[u,f]=E.useState(null),[d,p]=E.useState(null),[m,v]=E.useState(null),[g,w]=E.useState(null),[x,k]=E.useState(null),[C,_]=E.useState(0),[T,N]=E.useState(0),[D,L]=E.useState(!1),[R,U]=E.useState(!1),P=dt(t,V=>f(V)),z=pd(i);return S.jsx(YH,{scope:n,type:r,dir:z,scrollHideDelay:o,scrollArea:u,viewport:d,onViewportChange:p,content:m,onContentChange:v,scrollbarX:g,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:L,scrollbarY:x,onScrollbarYChange:k,scrollbarYEnabled:R,onScrollbarYEnabledChange:U,onCornerWidthChange:_,onCornerHeightChange:N,children:S.jsx(We.div,{dir:z,...l,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});MR.displayName=Iy;var PR="ScrollAreaViewport",FR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,l=pr(PR,n),u=E.useRef(null),f=dt(t,u,l.onViewportChange);return S.jsxs(S.Fragment,{children:[S.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:i}),S.jsx(We.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:S.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});FR.displayName=PR;var Xr="ScrollAreaScrollbar",Gy=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=pr(Xr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=i,u=e.orientation==="horizontal";return E.useEffect(()=>(u?o(!0):l(!0),()=>{u?o(!1):l(!1)}),[u,o,l]),i.type==="hover"?S.jsx(WH,{...r,ref:t,forceMount:n}):i.type==="scroll"?S.jsx(XH,{...r,ref:t,forceMount:n}):i.type==="auto"?S.jsx(IR,{...r,ref:t,forceMount:n}):i.type==="always"?S.jsx(Uy,{...r,ref:t}):null});Gy.displayName=Xr;var WH=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=pr(Xr,e.__scopeScrollArea),[o,l]=E.useState(!1);return E.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const d=()=>{window.clearTimeout(f),l(!0)},p=()=>{f=window.setTimeout(()=>l(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",d),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",d),u.removeEventListener("pointerleave",p)}}},[i.scrollArea,i.scrollHideDelay]),S.jsx(Kn,{present:n||o,children:S.jsx(IR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),XH=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=pr(Xr,e.__scopeScrollArea),o=e.orientation==="horizontal",l=_d(()=>f("SCROLL_END"),100),[u,f]=qH("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 E.useEffect(()=>{if(u==="idle"){const d=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[u,i.scrollHideDelay,f]),E.useEffect(()=>{const d=i.viewport,p=o?"scrollLeft":"scrollTop";if(d){let m=d[p];const v=()=>{const g=d[p];m!==g&&(f("SCROLL"),l()),m=g};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[i.viewport,o,f,l]),S.jsx(Kn,{present:n||u!=="hidden",children:S.jsx(Uy,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:qe(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:qe(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),IR=E.forwardRef((e,t)=>{const n=pr(Xr,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,l]=E.useState(!1),u=e.orientation==="horizontal",f=_d(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;l(u?d:p)}},10);return hs(n.viewport,f),hs(n.content,f),S.jsx(Kn,{present:r||o,children:S.jsx(Uy,{"data-state":o?"visible":"hidden",...i,ref:t})})}),Uy=E.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=pr(Xr,e.__scopeScrollArea),o=E.useRef(null),l=E.useRef(0),[u,f]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=HR(u.viewport,u.content),p={...r,sizes:u,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:v=>o.current=v,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:v=>l.current=v};function m(v,g){return t9(v,l.current,u,g)}return n==="horizontal"?S.jsx(KH,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,g=OE(v,u,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollLeft=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollLeft=m(v,i.dir))}}):n==="vertical"?S.jsx(ZH,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,g=OE(v,u);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollTop=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollTop=m(v))}}):null}),KH=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=pr(Xr,e.__scopeScrollArea),[l,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarXChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(UR,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ed(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(v),qR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&l&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:If(l.paddingLeft),paddingEnd:If(l.paddingRight)}})}})}),ZH=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=pr(Xr,e.__scopeScrollArea),[l,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarYChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(UR,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ed(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(v),qR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&l&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:If(l.paddingTop),paddingEnd:If(l.paddingBottom)}})}})}),[QH,GR]=zR(Xr),UR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:p,onResize:m,...v}=e,g=pr(Xr,n),[w,x]=E.useState(null),k=dt(t,P=>x(P)),C=E.useRef(null),_=E.useRef(""),T=g.viewport,N=r.content-r.viewport,D=un(p),L=un(f),R=_d(m,10);function U(P){if(C.current){const z=P.clientX-C.current.left,V=P.clientY-C.current.top;d({x:z,y:V})}}return E.useEffect(()=>{const P=z=>{const V=z.target;(w==null?void 0:w.contains(V))&&D(z,N)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[T,w,N,D]),E.useEffect(L,[r,L]),hs(w,R),hs(g.content,R),S.jsx(QH,{scope:n,scrollbar:w,hasThumb:i,onThumbChange:un(o),onThumbPointerUp:un(l),onThumbPositionChange:L,onThumbPointerDown:un(u),children:S.jsx(We.div,{...v,ref:k,style:{position:"absolute",...v.style},onPointerDown:qe(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=w.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),U(P))}),onPointerMove:qe(e.onPointerMove,U),onPointerUp:qe(e.onPointerUp,P=>{const z=P.target;z.hasPointerCapture(P.pointerId)&&z.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),C.current=null})})})}),Ff="ScrollAreaThumb",BR=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=GR(Ff,e.__scopeScrollArea);return S.jsx(Kn,{present:n||i.hasThumb,children:S.jsx(JH,{ref:t,...r})})}),JH=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=pr(Ff,n),l=GR(Ff,n),{onThumbPositionChange:u}=l,f=dt(t,m=>l.onThumbChange(m)),d=E.useRef(void 0),p=_d(()=>{d.current&&(d.current(),d.current=void 0)},100);return E.useEffect(()=>{const m=o.viewport;if(m){const v=()=>{if(p(),!d.current){const g=n9(m,u);d.current=g,u()}};return u(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[o.viewport,p,u]),S.jsx(We.div,{"data-state":l.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:qe(e.onPointerDownCapture,m=>{const g=m.target.getBoundingClientRect(),w=m.clientX-g.left,x=m.clientY-g.top;l.onThumbPointerDown({x:w,y:x})}),onPointerUp:qe(e.onPointerUp,l.onThumbPointerUp)})});BR.displayName=Ff;var By="ScrollAreaCorner",$R=E.forwardRef((e,t)=>{const n=pr(By,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?S.jsx(e9,{...e,ref:t}):null});$R.displayName=By;var e9=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=pr(By,n),[o,l]=E.useState(0),[u,f]=E.useState(0),d=!!(o&&u);return hs(i.scrollbarX,()=>{var m;const p=((m=i.scrollbarX)==null?void 0:m.offsetHeight)||0;i.onCornerHeightChange(p),f(p)}),hs(i.scrollbarY,()=>{var m;const p=((m=i.scrollbarY)==null?void 0:m.offsetWidth)||0;i.onCornerWidthChange(p),l(p)}),d?S.jsx(We.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function If(e){return e?parseInt(e,10):0}function HR(e,t){const n=e/t;return isNaN(n)?0:n}function Ed(e){const t=HR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function t9(e,t,n,r="ltr"){const i=Ed(n),o=i/2,l=t||o,u=i-l,f=n.scrollbar.paddingStart+l,d=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,m=r==="ltr"?[0,p]:[p*-1,0];return VR([f,d],m)(e)}function OE(e,t,n="ltr"){const r=Ed(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,l=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,l]:[l*-1,0],d=lv(e,f);return VR([0,l],[0,u])(d)}function VR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function qR(e,t){return e>0&&e<t}var n9=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},l=n.left!==o.left,u=n.top!==o.top;(l||u)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function _d(e,t){const n=un(e),r=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),E.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hs(e,t){const n=un(t);xn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var YR=MR,r9=FR,i9=$R;const WR=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(YR,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[S.jsx(r9,{className:"h-full w-full rounded-[inherit]",children:t}),S.jsx(XR,{}),S.jsx(i9,{})]}));WR.displayName=YR.displayName;const XR=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>S.jsx(Gy,{ref:r,orientation:t,className:Me("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:S.jsx(BR,{className:"bg-border relative flex-1 rounded-full"})}));XR.displayName=Gy.displayName;function uv(e,t={}){const{decimals:n=0,sizeType:r="normal"}=t,i=["Bytes","KB","MB","GB","TB"],o=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const l=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,l)).toFixed(n)} ${r==="accurate"?o[l]??"Bytes":i[l]??"Bytes"}`}function a9(e){const{value:t,onValueChange:n,onUpload:r,progresses:i,accept:o=SL,maxSize:l=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:d=!1,description:p,className:m,...v}=e,[g,w]=_i({prop:t,onChange:n}),x=E.useCallback((_,T)=>{if(!f&&u===1&&_.length>1){vn.error("Cannot upload more than 1 file at a time");return}if(((g==null?void 0:g.length)??0)+_.length>u){vn.error(`Cannot upload more than ${u} files`);return}const N=_.map(L=>Object.assign(L,{preview:URL.createObjectURL(L)})),D=g?[...g,...N]:N;if(w(D),T.length>0&&T.forEach(({file:L})=>{vn.error(`File ${L.name} was rejected`)}),r&&D.length>0&&D.length<=u){const L=D.length>0?`${D.length} files`:"file";vn.promise(r(D),{loading:`Uploading ${L}...`,success:()=>(w([]),`${L} uploaded`),error:`Failed to upload ${L}`})}},[g,u,f,r,w]);function k(_){if(!g)return;const T=g.filter((N,D)=>D!==_);w(T),n==null||n(T)}E.useEffect(()=>()=>{g&&g.forEach(_=>{KR(_)&&URL.revokeObjectURL(_.preview)})},[]);const C=d||((g==null?void 0:g.length)??0)>=u;return S.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[S.jsx(Sd,{onDrop:x,accept:o,maxSize:l,maxFiles:u,multiple:u>1||f,disabled:C,children:({getRootProps:_,getInputProps:T,isDragActive:N})=>S.jsxs("div",{..._(),className:Me("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",N&&"border-muted-foreground/50",C&&"pointer-events-none opacity-60",m),...v,children:[S.jsx("input",{...T()}),N?S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Rg,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Rg,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),p?S.jsx("p",{className:"text-muted-foreground/70 text-sm",children:p}):S.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u}
files (up to ${uv(l)} each)`:` a file with ${uv(l)}`,"Supported formats: TXT, MD, DOC, PDF, PPTX"]})]})]})]})}),g!=null&&g.length?S.jsx(WR,{className:"h-fit w-full px-3",children:S.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:g==null?void 0:g.map((_,T)=>S.jsx(o9,{file:_,onRemove:()=>k(T),progress:i==null?void 0:i[_.name]},T))})}):null]})}function o9({file:e,progress:t,onRemove:n}){return S.jsxs("div",{className:"relative flex items-center gap-2.5",children:[S.jsxs("div",{className:"flex flex-1 gap-2.5",children:[KR(e)?S.jsx(s9,{file:e}):null,S.jsxs("div",{className:"flex w-full flex-col gap-2",children:[S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),S.jsx("p",{className:"text-muted-foreground text-xs",children:uv(e.size)})]}),t?S.jsx(LR,{value:t}):null]})]}),S.jsx("div",{className:"flex items-center gap-2",children:S.jsxs(Ot,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[S.jsx(_k,{className:"size-4","aria-hidden":"true"}),S.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function KR(e){return"preview"in e&&typeof e.preview=="string"}function s9({file:e}){return e.type.startsWith("image/")?S.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):S.jsx(kM,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function l9(){const[e,t]=E.useState(!1),[n,r]=E.useState(!1),[i,o]=E.useState({}),l=E.useCallback(async u=>{r(!0);try{await Promise.all(u.map(async f=>{try{const d=await cM(f,p=>{console.debug(`Uploading ${f.name}: ${p}%`),o(m=>({...m,[f.name]:p}))});d.status==="success"?vn.success(`Upload Success:
${f.name} uploaded successfully`):vn.error(`Upload Failed:
${f.name}
${d.message}`)}catch(d){vn.error(`Upload Failed:
${f.name}
${Cr(d)}`)}}))}catch(f){vn.error(`Upload Failed
`+Cr(f))}finally{r(!1)}},[r,o]);return S.jsxs(ZA,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[S.jsx(QA,{asChild:!0,children:S.jsxs(Ot,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[S.jsx(Rg,{})," Upload"]})}),S.jsxs(Ty,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[S.jsxs(Ay,{children:[S.jsx(Ry,{children:"Upload documents"}),S.jsx(Dy,{children:"Drag and drop your documents here or click to browse."})]}),S.jsx(a9,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOC, PDF, PPTX",onUpload:l,progresses:i,disabled:n})]})]})}function u9(){const[e,t]=E.useState(!1),n=E.useCallback(async()=>{try{const r=await fM();r.status==="success"?(vn.success("Documents cleared successfully"),t(!1)):vn.error(`Clear Documents Failed:
${r.message}`)}catch(r){vn.error(`Clear Documents Failed:
`+Cr(r))}},[t]);return S.jsxs(ZA,{open:e,onOpenChange:t,children:[S.jsx(QA,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[S.jsx(Sk,{})," Clear"]})}),S.jsxs(Ty,{className:"sm:max-w-xl",onCloseAutoFocus:r=>r.preventDefault(),children:[S.jsxs(Ay,{children:[S.jsx(Ry,{children:"Clear documents"}),S.jsx(Dy,{children:"Do you really want to clear all documents?"})]}),S.jsx(Ot,{variant:"destructive",onClick:n,children:"YES"})]})]})}function c9(){const e=Mn.use.health(),[t,n]=E.useState(null),r=E.useCallback(async()=>{try{const o=await oM();o&&o.statuses&&Object.values(o.statuses).reduce((u,f)=>u+f.length,0)>0?n(o):n(null)}catch(o){vn.error(`Failed to load documents
`+Cr(o))}},[n]);E.useEffect(()=>{r()},[]);const i=E.useCallback(async()=>{try{const{status:o}=await sM();vn.message(o)}catch(o){vn.error(`Failed to load documents
`+Cr(o))}},[]);return E.useEffect(()=>{const o=setInterval(async()=>{if(e)try{await r()}catch(l){vn.error(`Failed to get scan progress
`+Cr(l))}},5e3);return()=>clearInterval(o)},[e,r]),S.jsxs(Kl,{className:"!size-full !rounded-none !border-none",children:[S.jsx(Of,{children:S.jsx(Zl,{className:"text-lg",children:"Document Management"})}),S.jsxs(jf,{className:"space-y-4",children:[S.jsxs("div",{className:"flex gap-2",children:[S.jsxs(Ot,{variant:"outline",onClick:i,side:"bottom",tooltip:"Scan documents",size:"sm",children:[S.jsx(WM,{})," Scan"]}),S.jsx("div",{className:"flex-1"}),S.jsx(u9,{}),S.jsx(l9,{})]}),S.jsxs(Kl,{children:[S.jsxs(Of,{children:[S.jsx(Zl,{children:"Uploaded documents"}),S.jsx(wd,{children:"view the uploaded documents here"})]}),S.jsxs(jf,{children:[!t&&S.jsx(F$,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&S.jsxs(gR,{children:[S.jsx(vR,{children:S.jsxs(nv,{children:[S.jsx(bi,{children:"ID"}),S.jsx(bi,{children:"Summary"}),S.jsx(bi,{children:"Status"}),S.jsx(bi,{children:"Length"}),S.jsx(bi,{children:"Chunks"}),S.jsx(bi,{children:"Created"}),S.jsx(bi,{children:"Updated"}),S.jsx(bi,{children:"Metadata"})]})}),S.jsx(yR,{className:"text-sm",children:Object.entries(t.statuses).map(([o,l])=>l.map(u=>S.jsxs(nv,{children:[S.jsx(xi,{className:"truncate font-mono",children:u.id}),S.jsx(xi,{className:"max-w-xs min-w-24 truncate",children:S.jsx(jn,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),S.jsxs(xi,{children:[o==="processed"&&S.jsx("span",{className:"text-green-600",children:"Completed"}),o==="processing"&&S.jsx("span",{className:"text-blue-600",children:"Processing"}),o==="pending"&&S.jsx("span",{className:"text-yellow-600",children:"Pending"}),o==="failed"&&S.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&S.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),S.jsx(xi,{children:u.content_length??"-"}),S.jsx(xi,{children:u.chunks_count??"-"}),S.jsx(xi,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),S.jsx(xi,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),S.jsx(xi,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function ZR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var Jl;(function(e){e.event="event",e.props="prop"})(Jl||(Jl={}));function aa(){}function f9(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(o,l){return o===t[l]})||(t=r,n=e.apply(void 0,r)),n}}function eu(e){return!!(e||"").match(/\d/)}function as(e){return e==null}function d9(e){return typeof e=="number"&&isNaN(e)}function QR(e){return as(e)||d9(e)||typeof e=="number"&&!isFinite(e)}function JR(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function h9(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 p9(e,t,n){var r=h9(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function m9(e){var t=E.useRef(e);t.current=e;var n=E.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function $y(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),o=i[0],l=i[1]||"";return{beforeDecimal:o,afterDecimal:l,hasNegation:n,addNegation:r}}function g9(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function e2(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function jE(e,t){return Array(t+1).join(e)}function t2(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],o=r[1];if(o=Number(o),!o)return n+i;i=i.replace(".","");var l=1+o,u=i.length;return l<0?i="0."+jE("0",Math.abs(l))+i:l>=u?i=i+jE("0",l-u):i=(i.substring(0,l)||"0")+"."+i.substring(l),n+i}function LE(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=$y(e),o=i.beforeDecimal,l=i.afterDecimal,u=i.hasNegation,f=parseFloat("0."+(l||"0")),d=l.length<=t?"0."+l:f.toFixed(t),p=d.split("."),m=o;o&&Number(p[0])&&(m=o.split("").reverse().reduce(function(x,k,C){return x.length>C?(Number(x[0])+Number(k)).toString()+x.substring(1,x.length):k+x},p[0]));var v=e2(p[1]||"",t,n),g=u?"-":"",w=r?".":"";return""+g+m+w+v}function Va(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 n2=f9(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[o-1-r]&&o-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),v9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function y9(e,t,n){return Math.min(Math.max(e,t),n)}function tg(e){return Math.max(e.selectionStart,e.selectionEnd)}function b9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function x9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function w9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function S9(e,t,n,r,i,o,l){l===void 0&&(l=w9);var u=i.findIndex(function(N){return N}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var d=n.length,p=e.length,m={},v=new Array(d),g=0;g<d;g++){v[g]=-1;for(var w=0,x=p;w<x;w++){var k=l({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:g,formattedValueIndex:w});if(k&&m[w]!==!0){v[g]=w,m[w]=!0;break}}}for(var C=r;C<d&&(v[C]===-1||!o(n[C]));)C++;var _=C===d||v[C]===-1?p:v[C];for(C=r-1;C>0&&v[C]===-1;)C--;var T=C===-1||v[C]===-1?0:v[C]+1;return T>_?_:r-T<_-r?T:_}function zE(e,t,n,r){var i=e.length;if(t=y9(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function E9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(eu(e[n])||eu(e[n-1]));return t}function r2(e,t,n,r,i,o){o===void 0&&(o=aa);var l=m9(function(w,x){var k,C;return QR(w)?(C="",k=""):typeof w=="number"||x?(C=typeof w=="number"?t2(w):w,k=r(C)):(C=i(w,void 0),k=r(C)),{formattedValue:k,numAsString:C}}),u=E.useState(function(){return l(as(e)?t:e,n)}),f=u[0],d=u[1],p=function(w,x){w.formattedValue!==f.formattedValue&&d({formattedValue:w.formattedValue,numAsString:w.value}),o(w,x)},m=e,v=n;as(e)&&(m=f.numAsString,v=!0);var g=l(m,v);return E.useMemo(function(){d(g)},[g.formattedValue]),[f,p]}function _9(e){return e.replace(/[^0-9]/g,"")}function k9(e){return e}function C9(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,o=e.getInputRef,l=e.format;l===void 0&&(l=k9);var u=e.removeFormatting;u===void 0&&(u=_9);var f=e.defaultValue,d=e.valueIsNumericString,p=e.onValueChange,m=e.isAllowed,v=e.onChange;v===void 0&&(v=aa);var g=e.onKeyDown;g===void 0&&(g=aa);var w=e.onMouseUp;w===void 0&&(w=aa);var x=e.onFocus;x===void 0&&(x=aa);var k=e.onBlur;k===void 0&&(k=aa);var C=e.value,_=e.getCaretBoundary;_===void 0&&(_=E9);var T=e.isValidInputCharacter;T===void 0&&(T=eu);var N=e.isCharacterSame,D=ZR(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),L=r2(C,f,!!d,l,u,p),R=L[0],U=R.formattedValue,P=R.numAsString,z=L[1],V=E.useRef(),q=E.useRef({formattedValue:U,numAsString:P}),I=function(ce,Te){q.current={formattedValue:ce.formattedValue,numAsString:ce.value},z(ce,Te)},Y=E.useState(!1),Z=Y[0],B=Y[1],G=E.useRef(null),F=E.useRef({setCaretTimeout:null,focusTimeout:null});E.useEffect(function(){return B(!0),function(){clearTimeout(F.current.setCaretTimeout),clearTimeout(F.current.focusTimeout)}},[]);var K=l,A=function(ce,Te){var ge=parseFloat(Te);return{formattedValue:ce,value:Te,floatValue:isNaN(ge)?void 0:ge}},H=function(ce,Te,ge){ce.selectionStart===0&&ce.selectionEnd===ce.value.length||(Va(ce,Te),F.current.setCaretTimeout=setTimeout(function(){ce.value===ge&&ce.selectionStart!==Te&&Va(ce,Te)},0))},M=function(ce,Te,ge){return zE(ce,Te,_(ce),ge)},O=function(ce,Te,ge){var Se=_(Te),ie=S9(Te,U,ce,ge,Se,T,N);return ie=zE(Te,ie,Se),ie},X=function(ce){var Te=ce.formattedValue;Te===void 0&&(Te="");var ge=ce.input,Se=ce.source,ie=ce.event,$e=ce.numAsString,Ge;if(ge){var ve=ce.inputValue||ge.value,Ne=tg(ge);ge.value=Te,Ge=O(ve,Te,Ne),Ge!==void 0&&H(ge,Ge,Te)}Te!==U&&I(A(Te,$e),{event:ie,source:Se})};E.useEffect(function(){var ce=q.current,Te=ce.formattedValue,ge=ce.numAsString;(U!==Te||P!==ge)&&I(A(U,P),{event:void 0,source:Jl.props})},[U,P]);var re=G.current?tg(G.current):void 0,ue=typeof window<"u"?E.useLayoutEffect:E.useEffect;ue(function(){var ce=G.current;if(U!==q.current.formattedValue&&ce){var Te=O(q.current.formattedValue,U,re);ce.value=U,H(ce,Te,U)}},[U]);var ae=function(ce,Te,ge){var Se=Te.target,ie=V.current?v9(V.current,Se.selectionEnd):n2(U,ce),$e=Object.assign(Object.assign({},ie),{lastValue:U}),Ge=u(ce,$e),ve=K(Ge);if(Ge=u(ve,void 0),m&&!m(A(ve,Ge))){var Ne=Te.target,te=tg(Ne),de=O(ce,U,te);return Ne.value=U,H(Ne,de,U),!1}return X({formattedValue:ve,numAsString:Ge,inputValue:ce,event:Te,source:ge,input:Te.target}),!0},oe=function(ce,Te){Te===void 0&&(Te=0);var ge=ce.selectionStart,Se=ce.selectionEnd;V.current={selectionStart:ge,selectionEnd:Se+Te}},Ce=function(ce){var Te=ce.target,ge=Te.value,Se=ae(ge,ce,Jl.event);Se&&v(ce),V.current=void 0},he=function(ce){var Te=ce.target,ge=ce.key,Se=Te.selectionStart,ie=Te.selectionEnd,$e=Te.value;$e===void 0&&($e="");var Ge;ge==="ArrowLeft"||ge==="Backspace"?Ge=Math.max(Se-1,0):ge==="ArrowRight"?Ge=Math.min(Se+1,$e.length):ge==="Delete"&&(Ge=Se);var ve=0;ge==="Delete"&&Se===ie&&(ve=1);var Ne=ge==="ArrowLeft"||ge==="ArrowRight";if(Ge===void 0||Se!==ie&&!Ne){g(ce),oe(Te,ve);return}var te=Ge;if(Ne){var de=ge==="ArrowLeft"?"left":"right";te=M($e,Ge,de),te!==Ge&&ce.preventDefault()}else ge==="Delete"&&!T($e[Ge])?te=M($e,Ge,"right"):ge==="Backspace"&&!T($e[Ge])&&(te=M($e,Ge,"left"));te!==Ge&&H(Te,te,$e),g(ce),oe(Te,ve)},Ee=function(ce){var Te=ce.target,ge=function(){var Se=Te.selectionStart,ie=Te.selectionEnd,$e=Te.value;if($e===void 0&&($e=""),Se===ie){var Ge=M($e,Se);Ge!==Se&&H(Te,Ge,$e)}};ge(),requestAnimationFrame(function(){ge()}),w(ce),oe(Te)},we=function(ce){ce.persist&&ce.persist();var Te=ce.target,ge=ce.currentTarget;G.current=Te,F.current.focusTimeout=setTimeout(function(){var Se=Te.selectionStart,ie=Te.selectionEnd,$e=Te.value;$e===void 0&&($e="");var Ge=M($e,Se);Ge!==Se&&!(Se===0&&ie===$e.length)&&H(Te,Ge,$e),x(Object.assign(Object.assign({},ce),{currentTarget:ge}))},0)},Pe=function(ce){G.current=null,clearTimeout(F.current.focusTimeout),clearTimeout(F.current.setCaretTimeout),k(ce)},Ae=Z&&b9()?"numeric":void 0,xe=Object.assign({inputMode:Ae},D,{type:t,value:U,onChange:Ce,onKeyDown:he,onMouseUp:Ee,onFocus:we,onBlur:Pe});if(n==="text")return i?be.createElement(be.Fragment,null,i(U,D)||null):be.createElement("span",Object.assign({},D,{ref:o}),U);if(r){var ee=r;return be.createElement(ee,Object.assign({},xe,{ref:o}))}return be.createElement("input",Object.assign({},xe,{ref:o}))}function ME(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var o=t.suffix;o===void 0&&(o="");var l=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var f=kd(t),d=f.thousandSeparator,p=f.decimalSeparator,m=n!==0&&e.indexOf(".")!==-1||n&&r,v=$y(e,l),g=v.beforeDecimal,w=v.afterDecimal,x=v.addNegation;return n!==void 0&&(w=e2(w,n,!!r)),d&&(g=p9(g,d,u)),i&&(g=i+g),o&&(w=w+o),x&&(g="-"+g),e=g+(m&&p||"")+w,e}function kd(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function T9(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),i&&!o&&t&&(e="-"+e),e}function A9(e,t){return new RegExp("(^-)|[0-9]|"+JR(e),"g")}function R9(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function D9(e,t,n){var r;t===void 0&&(t=x9(e));var i=n.allowNegative,o=n.prefix;o===void 0&&(o="");var l=n.suffix;l===void 0&&(l="");var u=n.decimalScale,f=t.from,d=t.to,p=d.start,m=d.end,v=kd(n),g=v.allowedDecimalSeparators,w=v.decimalSeparator,x=e[m]===w;if(eu(e)&&(e===o||e===l)&&t.lastValue==="")return e;if(m-p===1&&g.indexOf(e[p])!==-1){var k=u===0?"":w;e=e.substring(0,p)+k+e.substring(p+1,e.length)}var C=function(G,F,K){var A=!1,H=!1;o.startsWith("-")?A=!1:G.startsWith("--")?(A=!1,H=!0):l.startsWith("-")&&G.length===l.length?A=!1:G[0]==="-"&&(A=!0);var M=A?1:0;return H&&(M=2),M&&(G=G.substring(M),F-=M,K-=M),{value:G,start:F,end:K,hasNegation:A}},_=C(e,p,m),T=_.hasNegation;r=_,e=r.value,p=r.start,m=r.end;var N=C(t.lastValue,f.start,f.end),D=N.start,L=N.end,R=N.value,U=e.substring(p,m);e.length&&R.length&&(D>R.length-l.length||L<o.length)&&!(U&&l.startsWith(U))&&(e=R);var P=0;e.startsWith(o)?P+=o.length:p<o.length&&(P=p),e=e.substring(P),m-=P;var z=e.length,V=e.length-l.length;e.endsWith(l)?z=V:(m>V||m>e.length-l.length)&&(z=m),e=e.substring(0,z),e=T9(T?"-"+e:e,i),e=(e.match(A9(w))||[]).join("");var q=e.indexOf(w);e=e.replace(new RegExp(JR(w),"g"),function(G,F){return F===q?".":""});var I=$y(e,i),Y=I.beforeDecimal,Z=I.afterDecimal,B=I.addNegation;return d.end-d.start<f.end-f.start&&Y===""&&x&&!parseFloat(Z)&&(e=B?"-":""),e}function N9(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";i.fill(!1,0,n.length+(o?1:0));var l=e.length;return i.fill(!1,l-r.length+1,l+1),i}function O9(e){var t=kd(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
Decimal separator can't be same as thousand separator.
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
decimalSeparator: `+r+` (default value for decimalSeparator is .)
`);return i.startsWith("-")&&o&&(console.error(`
Prefix can't start with '-' when allowNegative is true.
prefix: `+i+`
allowNegative: `+o+`
`),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function j9(e){e=O9(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=aa);var o=e.onBlur;o===void 0&&(o=aa);var l=e.thousandSeparator,u=e.decimalScale,f=e.fixedDecimalScale,d=e.prefix;d===void 0&&(d="");var p=e.defaultValue,m=e.value,v=e.valueIsNumericString,g=e.onValueChange,w=ZR(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),x=kd(e),k=x.decimalSeparator,C=x.allowedDecimalSeparators,_=function(B){return ME(B,e)},T=function(B,G){return D9(B,G,e)},N=as(m)?p:m,D=v??R9(N,d,t);as(m)?as(p)||(D=D||typeof p=="number"):D=D||typeof m=="number";var L=function(B){return QR(B)?B:(typeof B=="number"&&(B=t2(B)),D&&typeof u=="number"?LE(B,u,!!f):B)},R=r2(L(m),L(p),!!D,_,T,g),U=R[0],P=U.numAsString,z=U.formattedValue,V=R[1],q=function(B){var G=B.target,F=B.key,K=G.selectionStart,A=G.selectionEnd,H=G.value;if(H===void 0&&(H=""),(F==="Backspace"||F==="Delete")&&A<d.length){B.preventDefault();return}if(K!==A){i(B);return}F==="Backspace"&&H[0]==="-"&&K===d.length+1&&n&&Va(G,1),u&&f&&(F==="Backspace"&&H[K-1]===k?(Va(G,K-1),B.preventDefault()):F==="Delete"&&H[K]===k&&B.preventDefault()),C!=null&&C.includes(F)&&H[K]===k&&Va(G,K+1);var M=l===!0?",":l;F==="Backspace"&&H[K-1]===M&&Va(G,K-1),F==="Delete"&&H[K]===M&&Va(G,K+1),i(B)},I=function(B){var G=P;if(G.match(/\d/g)||(G=""),r||(G=g9(G)),f&&u&&(G=LE(G,u,f)),G!==P){var F=ME(G,e);V({formattedValue:F,value:G,floatValue:parseFloat(G)},{event:B,source:Jl.event})}o(B)},Y=function(B){return B===k?!0:eu(B)},Z=function(B){var G=B.currentValue,F=B.lastValue,K=B.formattedValue,A=B.currentValueIndex,H=B.formattedValueIndex,M=G[A],O=K[H],X=n2(F,G),re=X.to,ue=function(ae){return T(ae).indexOf(".")+d.length};return m===0&&f&&u&&G[re.start]===k&&ue(G)<A&&ue(K)>H?!1:A>=re.start&&A<re.end&&C&&C.includes(M)&&O===k?!0:M===O};return Object.assign(Object.assign({},w),{value:z,valueIsNumericString:!1,isValidInputCharacter:Y,isCharacterSame:Z,onValueChange:V,format:_,removeFormatting:T,getCaretBoundary:function(B){return N9(B,e)},onKeyDown:q,onBlur:I})}function L9(e){var t=j9(e);return be.createElement(C9,Object.assign({},t))}const Jo=E.forwardRef(({stepper:e,thousandSeparator:t,placeholder:n,defaultValue:r,min:i=-1/0,max:o=1/0,onValueChange:l,fixedDecimalScale:u=!1,decimalScale:f=0,className:d=void 0,suffix:p,prefix:m,value:v,...g},w)=>{const[x,k]=E.useState(v??r),C=E.useCallback(()=>{k(D=>D===void 0?e??1:Math.min(D+(e??1),o))},[e,o]),_=E.useCallback(()=>{k(D=>D===void 0?-(e??1):Math.max(D-(e??1),i))},[e,i]);E.useEffect(()=>{v!==void 0&&k(v)},[v]);const T=D=>{const L=D.floatValue===void 0?void 0:D.floatValue;k(L),l&&l(L)},N=()=>{x!==void 0&&(x<i?(k(i),w.current.value=String(i)):x>o&&(k(o),w.current.value=String(o)))};return S.jsxs("div",{className:"relative flex",children:[S.jsx(L9,{value:x,onValueChange:T,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:i<0,valueIsNumericString:!0,onBlur:N,max:o,min:i,suffix:p,prefix:m,customInput:D=>S.jsx(Za,{...D,className:Me("w-full",d)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:w,...g}),S.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[S.jsx(Ot,{"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:C,disabled:x===o,children:S.jsx(wk,{size:15})}),S.jsx(Ot,{"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:_,disabled:x===i,children:S.jsx(zv,{size:15})})]})]})});Jo.displayName="NumberInput";var z9=[" ","Enter","ArrowUp","ArrowDown"],M9=[" ","Enter"],gu="Select",[Cd,Td,P9]=mT(gu),[As,bK]=dr(gu,[P9,ws]),Ad=ws(),[F9,pa]=As(gu),[I9,G9]=As(gu),i2=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:u,onValueChange:f,dir:d,name:p,autoComplete:m,disabled:v,required:g,form:w}=e,x=Ad(t),[k,C]=E.useState(null),[_,T]=E.useState(null),[N,D]=E.useState(!1),L=pd(d),[R=!1,U]=_i({prop:r,defaultProp:i,onChange:o}),[P,z]=_i({prop:l,defaultProp:u,onChange:f}),V=E.useRef(null),q=k?w||!!k.closest("form"):!0,[I,Y]=E.useState(new Set),Z=Array.from(I).map(B=>B.props.value).join(";");return S.jsx(ry,{...x,children:S.jsxs(F9,{required:g,scope:t,trigger:k,onTriggerChange:C,valueNode:_,onValueNodeChange:T,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:bn(),value:P,onValueChange:z,open:R,onOpenChange:U,dir:L,triggerPointerDownPosRef:V,disabled:v,children:[S.jsx(Cd.Provider,{scope:t,children:S.jsx(I9,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(B=>{Y(G=>new Set(G).add(B))},[]),onNativeOptionRemove:E.useCallback(B=>{Y(G=>{const F=new Set(G);return F.delete(B),F})},[]),children:n})}),q?S.jsxs(D2,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:m,value:P,onChange:B=>z(B.target.value),disabled:v,form:w,children:[P===void 0?S.jsx("option",{value:""}):null,Array.from(I)]},Z):null]})})};i2.displayName=gu;var a2="SelectTrigger",o2=E.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Ad(n),l=pa(a2,n),u=l.disabled||r,f=dt(t,l.onTriggerChange),d=Td(n),p=E.useRef("touch"),[m,v,g]=N2(x=>{const k=d().filter(T=>!T.disabled),C=k.find(T=>T.value===l.value),_=O2(k,x,C);_!==void 0&&l.onValueChange(_.value)}),w=x=>{u||(l.onOpenChange(!0),g()),x&&(l.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return S.jsx(sd,{asChild:!0,...o,children:S.jsx(We.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":R2(l.value)?"":void 0,...i,ref:f,onClick:qe(i.onClick,x=>{x.currentTarget.focus(),p.current!=="mouse"&&w(x)}),onPointerDown:qe(i.onPointerDown,x=>{p.current=x.pointerType;const k=x.target;k.hasPointerCapture(x.pointerId)&&k.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(w(x),x.preventDefault())}),onKeyDown:qe(i.onKeyDown,x=>{const k=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&v(x.key),!(k&&x.key===" ")&&z9.includes(x.key)&&(w(),x.preventDefault())})})})});o2.displayName=a2;var s2="SelectValue",l2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...u}=e,f=pa(s2,n),{onValueNodeHasChildrenChange:d}=f,p=o!==void 0,m=dt(t,f.onValueNodeChange);return xn(()=>{d(p)},[d,p]),S.jsx(We.span,{...u,ref:m,style:{pointerEvents:"none"},children:R2(f.value)?S.jsx(S.Fragment,{children:l}):o})});l2.displayName=s2;var U9="SelectIcon",u2=E.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return S.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});u2.displayName=U9;var B9="SelectPortal",c2=e=>S.jsx(Jf,{asChild:!0,...e});c2.displayName=B9;var eo="SelectContent",f2=E.forwardRef((e,t)=>{const n=pa(eo,e.__scopeSelect),[r,i]=E.useState();if(xn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?au.createPortal(S.jsx(d2,{scope:e.__scopeSelect,children:S.jsx(Cd.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),o):null}return S.jsx(h2,{...e,ref:t})});f2.displayName=eo;var _r=10,[d2,ma]=As(eo),$9="SelectContentImpl",h2=E.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k,...C}=e,_=pa(eo,n),[T,N]=E.useState(null),[D,L]=E.useState(null),R=dt(t,ae=>N(ae)),[U,P]=E.useState(null),[z,V]=E.useState(null),q=Td(n),[I,Y]=E.useState(!1),Z=E.useRef(!1);E.useEffect(()=>{if(T)return Fv(T)},[T]),Pv();const B=E.useCallback(ae=>{const[oe,...Ce]=q().map(we=>we.ref.current),[he]=Ce.slice(-1),Ee=document.activeElement;for(const we of ae)if(we===Ee||(we==null||we.scrollIntoView({block:"nearest"}),we===oe&&D&&(D.scrollTop=0),we===he&&D&&(D.scrollTop=D.scrollHeight),we==null||we.focus(),document.activeElement!==Ee))return},[q,D]),G=E.useCallback(()=>B([U,T]),[B,U,T]);E.useEffect(()=>{I&&G()},[I,G]);const{onOpenChange:F,triggerPointerDownPosRef:K}=_;E.useEffect(()=>{if(T){let ae={x:0,y:0};const oe=he=>{var Ee,we;ae={x:Math.abs(Math.round(he.pageX)-(((Ee=K.current)==null?void 0:Ee.x)??0)),y:Math.abs(Math.round(he.pageY)-(((we=K.current)==null?void 0:we.y)??0))}},Ce=he=>{ae.x<=10&&ae.y<=10?he.preventDefault():T.contains(he.target)||F(!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})}}},[T,F,K]),E.useEffect(()=>{const ae=()=>F(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[F]);const[A,H]=N2(ae=>{const oe=q().filter(Ee=>!Ee.disabled),Ce=oe.find(Ee=>Ee.ref.current===document.activeElement),he=O2(oe,ae,Ce);he&&setTimeout(()=>he.ref.current.focus())}),M=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&(P(ae),he&&(Z.current=!0))},[_.value]),O=E.useCallback(()=>T==null?void 0:T.focus(),[T]),X=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&V(ae)},[_.value]),re=r==="popper"?cv:p2,ue=re===cv?{side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k}:{};return S.jsx(d2,{scope:n,content:T,viewport:D,onViewportChange:L,itemRefCallback:M,selectedItem:U,onItemLeave:O,itemTextRefCallback:X,focusSelectedItem:G,selectedItemText:z,position:r,isPositioned:I,searchRef:A,children:S.jsx(td,{as:ua,allowPinchZoom:!0,children:S.jsx(Qf,{asChild:!0,trapped:_.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:qe(i,ae=>{var oe;(oe=_.trigger)==null||oe.focus({preventScroll:!0}),ae.preventDefault()}),children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:S.jsx(re,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:ae=>ae.preventDefault(),...C,...ue,onPlaced:()=>Y(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:qe(C.onKeyDown,ae=>{const oe=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!oe&&ae.key.length===1&&H(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let he=q().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ee=ae.target,we=he.indexOf(Ee);he=he.slice(we+1)}setTimeout(()=>B(he)),ae.preventDefault()}})})})})})})});h2.displayName=$9;var H9="SelectItemAlignedPosition",p2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=pa(eo,n),l=ma(eo,n),[u,f]=E.useState(null),[d,p]=E.useState(null),m=dt(t,R=>p(R)),v=Td(n),g=E.useRef(!1),w=E.useRef(!0),{viewport:x,selectedItem:k,selectedItemText:C,focusSelectedItem:_}=l,T=E.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&d&&x&&k&&C){const R=o.trigger.getBoundingClientRect(),U=d.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),z=C.getBoundingClientRect();if(o.dir!=="rtl"){const Ee=z.left-U.left,we=P.left-Ee,Pe=R.left-we,Ae=R.width+Pe,xe=Math.max(Ae,U.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.left=ce+"px"}else{const Ee=U.right-z.right,we=window.innerWidth-P.right-Ee,Pe=window.innerWidth-R.right-we,Ae=R.width+Pe,xe=Math.max(Ae,U.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.right=ce+"px"}const V=v(),q=window.innerHeight-_r*2,I=x.scrollHeight,Y=window.getComputedStyle(d),Z=parseInt(Y.borderTopWidth,10),B=parseInt(Y.paddingTop,10),G=parseInt(Y.borderBottomWidth,10),F=parseInt(Y.paddingBottom,10),K=Z+B+I+F+G,A=Math.min(k.offsetHeight*5,K),H=window.getComputedStyle(x),M=parseInt(H.paddingTop,10),O=parseInt(H.paddingBottom,10),X=R.top+R.height/2-_r,re=q-X,ue=k.offsetHeight/2,ae=k.offsetTop+ue,oe=Z+B+ae,Ce=K-oe;if(oe<=X){const Ee=V.length>0&&k===V[V.length-1].ref.current;u.style.bottom="0px";const we=d.clientHeight-x.offsetTop-x.offsetHeight,Pe=Math.max(re,ue+(Ee?O:0)+we+G),Ae=oe+Pe;u.style.height=Ae+"px"}else{const Ee=V.length>0&&k===V[0].ref.current;u.style.top="0px";const Pe=Math.max(X,Z+x.offsetTop+(Ee?M:0)+ue)+Ce;u.style.height=Pe+"px",x.scrollTop=oe-X+x.offsetTop}u.style.margin=`${_r}px 0`,u.style.minHeight=A+"px",u.style.maxHeight=q+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[v,o.trigger,o.valueNode,u,d,x,k,C,o.dir,r]);xn(()=>T(),[T]);const[N,D]=E.useState();xn(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const L=E.useCallback(R=>{R&&w.current===!0&&(T(),_==null||_(),w.current=!1)},[T,_]);return S.jsx(q9,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:L,children:S.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:S.jsx(We.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});p2.displayName=H9;var V9="SelectPopperPosition",cv=E.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_r,...o}=e,l=Ad(n);return S.jsx(iy,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.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)"}})});cv.displayName=V9;var[q9,Hy]=As(eo,{}),fv="SelectViewport",m2=E.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ma(fv,n),l=Hy(fv,n),u=dt(t,o.onViewportChange),f=E.useRef(0);return S.jsxs(S.Fragment,{children:[S.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:r}),S.jsx(Cd.Slot,{scope:n,children:S.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qe(i.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:v}=l;if(v!=null&&v.current&&m){const g=Math.abs(f.current-p.scrollTop);if(g>0){const w=window.innerHeight-_r*2,x=parseFloat(m.style.minHeight),k=parseFloat(m.style.height),C=Math.max(x,k);if(C<w){const _=C+g,T=Math.min(w,_),N=_-T;m.style.height=T+"px",m.style.bottom==="0px"&&(p.scrollTop=N>0?N:0,m.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});m2.displayName=fv;var g2="SelectGroup",[Y9,W9]=As(g2),v2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=bn();return S.jsx(Y9,{scope:n,id:i,children:S.jsx(We.div,{role:"group","aria-labelledby":i,...r,ref:t})})});v2.displayName=g2;var y2="SelectLabel",b2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=W9(y2,n);return S.jsx(We.div,{id:i.id,...r,ref:t})});b2.displayName=y2;var Gf="SelectItem",[X9,x2]=As(Gf),w2=E.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,u=pa(Gf,n),f=ma(Gf,n),d=u.value===r,[p,m]=E.useState(o??""),[v,g]=E.useState(!1),w=dt(t,_=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,_,r,i)}),x=bn(),k=E.useRef("touch"),C=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")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 S.jsx(X9,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:E.useCallback(_=>{m(T=>T||((_==null?void 0:_.textContent)??"").trim())},[]),children:S.jsx(Cd.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:S.jsx(We.div,{role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:qe(l.onFocus,()=>g(!0)),onBlur:qe(l.onBlur,()=>g(!1)),onClick:qe(l.onClick,()=>{k.current!=="mouse"&&C()}),onPointerUp:qe(l.onPointerUp,()=>{k.current==="mouse"&&C()}),onPointerDown:qe(l.onPointerDown,_=>{k.current=_.pointerType}),onPointerMove:qe(l.onPointerMove,_=>{var T;k.current=_.pointerType,i?(T=f.onItemLeave)==null||T.call(f):k.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qe(l.onPointerLeave,_=>{var T;_.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:qe(l.onKeyDown,_=>{var N;((N=f.searchRef)==null?void 0:N.current)!==""&&_.key===" "||(M9.includes(_.key)&&C(),_.key===" "&&_.preventDefault())})})})})});w2.displayName=Gf;var Il="SelectItemText",S2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=pa(Il,n),u=ma(Il,n),f=x2(Il,n),d=G9(Il,n),[p,m]=E.useState(null),v=dt(t,C=>m(C),f.onItemTextChange,C=>{var _;return(_=u.itemTextRefCallback)==null?void 0:_.call(u,C,f.value,f.disabled)}),g=p==null?void 0:p.textContent,w=E.useMemo(()=>S.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:x,onNativeOptionRemove:k}=d;return xn(()=>(x(w),()=>k(w)),[x,k,w]),S.jsxs(S.Fragment,{children:[S.jsx(We.span,{id:f.textId,...o,ref:v}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren?au.createPortal(o.children,l.valueNode):null]})});S2.displayName=Il;var E2="SelectItemIndicator",_2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x2(E2,n).isSelected?S.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});_2.displayName=E2;var dv="SelectScrollUpButton",k2=E.forwardRef((e,t)=>{const n=ma(dv,e.__scopeSelect),r=Hy(dv,e.__scopeSelect),[i,o]=E.useState(!1),l=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollTop>0;o(d)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(T2,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});k2.displayName=dv;var hv="SelectScrollDownButton",C2=E.forwardRef((e,t)=>{const n=ma(hv,e.__scopeSelect),r=Hy(hv,e.__scopeSelect),[i,o]=E.useState(!1),l=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)<d;o(p)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(T2,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});C2.displayName=hv;var T2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ma("SelectScrollButton",n),l=E.useRef(null),u=Td(n),f=E.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return E.useEffect(()=>()=>f(),[f]),xn(()=>{var p;const d=u().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),S.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qe(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:qe(i.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:qe(i.onPointerLeave,()=>{f()})})}),K9="SelectSeparator",A2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return S.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});A2.displayName=K9;var pv="SelectArrow",Z9=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Ad(n),o=pa(pv,n),l=ma(pv,n);return o.open&&l.position==="popper"?S.jsx(ay,{...i,...r,ref:t}):null});Z9.displayName=pv;function R2(e){return e===""||e===void 0}var D2=E.forwardRef((e,t)=>{const{value:n,...r}=e,i=E.useRef(null),o=dt(t,i),l=tR(n);return E.useEffect(()=>{const u=i.current,f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(l!==n&&p){const m=new Event("change",{bubbles:!0});p.call(u,n),u.dispatchEvent(m)}},[l,n]),S.jsx(oy,{asChild:!0,children:S.jsx("select",{...r,ref:o,defaultValue:n})})});D2.displayName="BubbleSelect";function N2(e){const t=un(e),n=E.useRef(""),r=E.useRef(0),i=E.useCallback(l=>{const u=n.current+l;t(u),function f(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),o=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function O2(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=Q9(e,Math.max(o,0));i.length===1&&(l=l.filter(d=>d!==n));const f=l.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function Q9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var J9=i2,j2=o2,e8=l2,t8=u2,n8=c2,L2=f2,r8=m2,i8=v2,z2=b2,M2=w2,a8=S2,o8=_2,P2=k2,F2=C2,I2=A2;const PE=J9,FE=i8,IE=e8,mv=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(j2,{ref:r,className:Me("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,S.jsx(t8,{asChild:!0,children:S.jsx(zv,{className:"h-4 w-4 opacity-50"})})]}));mv.displayName=j2.displayName;const G2=E.forwardRef(({className:e,...t},n)=>S.jsx(P2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(wk,{className:"h-4 w-4"})}));G2.displayName=P2.displayName;const U2=E.forwardRef(({className:e,...t},n)=>S.jsx(F2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(zv,{className:"h-4 w-4"})}));U2.displayName=F2.displayName;const gv=E.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>S.jsx(n8,{children:S.jsxs(L2,{ref:i,className:Me("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,...r,children:[S.jsx(G2,{}),S.jsx(r8,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(U2,{})]})}));gv.displayName=L2.displayName;const s8=E.forwardRef(({className:e,...t},n)=>S.jsx(z2,{ref:n,className:Me("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));s8.displayName=z2.displayName;const wi=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(M2,{ref:r,className:Me("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:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(o8,{children:S.jsx(Lv,{className:"h-4 w-4"})})}),S.jsx(a8,{children:t})]}));wi.displayName=M2.displayName;const l8=E.forwardRef(({className:e,...t},n)=>S.jsx(I2,{ref:n,className:Me("bg-muted -mx-1 my-1 h-px",e),...t}));l8.displayName=I2.displayName;function u8(){var n,r;const e=Qe(i=>i.querySettings),t=E.useCallback((i,o)=>{Qe.getState().updateQuerySettings({[i]:o})},[]);return S.jsxs(Kl,{className:"flex shrink-0 flex-col",children:[S.jsxs(Of,{className:"px-4 pt-4 pb-2",children:[S.jsx(Zl,{children:"Parameters"}),S.jsx(wd,{children:"Configure your query parameters"})]}),S.jsx(jf,{className:"m-0 flex grow flex-col p-0 text-xs",children:S.jsx("div",{className:"relative size-full",children:S.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[S.jsxs(S.Fragment,{children:[S.jsx(jn,{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"}),S.jsxs(PE,{value:e.mode,onValueChange:i=>t("mode",i),children:[S.jsx(mv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(IE,{})}),S.jsx(gv,{children:S.jsxs(FE,{children:[S.jsx(wi,{value:"naive",children:"Naive"}),S.jsx(wi,{value:"local",children:"Local"}),S.jsx(wi,{value:"global",children:"Global"}),S.jsx(wi,{value:"hybrid",children:"Hybrid"}),S.jsx(wi,{value:"mix",children:"Mix"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),S.jsxs(PE,{value:e.response_type,onValueChange:i=>t("response_type",i),children:[S.jsx(mv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(IE,{})}),S.jsx(gv,{children:S.jsxs(FE,{children:[S.jsx(wi,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),S.jsx(wi,{value:"Single Paragraph",children:"Single Paragraph"}),S.jsx(wi,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{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"}),S.jsx(Jo,{id:"top_k",stepper:1,value:e.top_k,onValueChange:i=>t("top_k",i),min:1,placeholder:"Number of results"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),S.jsx(Jo,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:i=>t("max_token_for_text_unit",i),min:1,placeholder:"Max tokens for text unit"})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:i=>t("max_token_for_global_context",i),min:1,placeholder:"Max tokens for global context"})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:i=>t("max_token_for_local_context",i),min:1,placeholder:"Max tokens for local context"})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),S.jsx(Jo,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:i=>t("history_turns",i),min:0,placeholder:"Number of history turns"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),S.jsx(Za,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:i=>{const o=i.target.value.split(",").map(l=>l.trim()).filter(l=>l!=="");t("hl_keywords",o)},placeholder:"Enter keywords"})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),S.jsx(Za,{id:"ll_keywords",type:"text",value:(r=e.ll_keywords)==null?void 0:r.join(", "),onChange:i=>{const o=i.target.value.split(",").map(l=>l.trim()).filter(l=>l!=="");t("ll_keywords",o)},placeholder:"Enter keywords"})]})]}),S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(jn,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Ul,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:i=>t("only_need_context",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(jn,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Ul,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:i=>t("only_need_prompt",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(jn,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Ul,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:i=>t("stream",i)})]})]})]})})})]})}function c8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const f8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,h8={};function GE(e,t){return(h8.jsx?d8:f8).test(e)}const p8=/[ \t\n\f\r]/g;function m8(e){return typeof e=="object"?e.type==="text"?UE(e.value):!1:UE(e)}function UE(e){return e.replace(p8,"")===""}class vu{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}vu.prototype.property={};vu.prototype.normal={};vu.prototype.space=null;function B2(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new vu(n,r,t)}function vv(e){return e.toLowerCase()}class mr{constructor(t,n){this.property=t,this.attribute=n}}mr.prototype.space=null;mr.prototype.boolean=!1;mr.prototype.booleanish=!1;mr.prototype.overloadedBoolean=!1;mr.prototype.number=!1;mr.prototype.commaSeparated=!1;mr.prototype.spaceSeparated=!1;mr.prototype.commaOrSpaceSeparated=!1;mr.prototype.mustUseProperty=!1;mr.prototype.defined=!1;let g8=0;const et=ro(),Vt=ro(),$2=ro(),Re=ro(),Nt=ro(),os=ro(),Vn=ro();function ro(){return 2**++g8}const yv=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:Vt,commaOrSpaceSeparated:Vn,commaSeparated:os,number:Re,overloadedBoolean:$2,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),ng=Object.keys(yv);class Vy extends mr{constructor(t,n,r,i){let o=-1;if(super(t,n),BE(this,"space",i),typeof r=="number")for(;++o<ng.length;){const l=ng[o];BE(this,ng[o],(r&yv[l])===yv[l])}}}Vy.prototype.defined=!0;function BE(e,t,n){n&&(e[t]=n)}const v8={}.hasOwnProperty;function Rs(e){const t={},n={};let r;for(r in e.properties)if(v8.call(e.properties,r)){const i=e.properties[r],o=new Vy(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[vv(r)]=r,n[vv(o.attribute)]=r}return new vu(t,n,e.space)}const H2=Rs({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),V2=Rs({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function q2(e,t){return t in e?e[t]:t}function Y2(e,t){return q2(e,t.toLowerCase())}const W2=Rs({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Y2,properties:{xmlns:null,xmlnsXLink:null}}),X2=Rs({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Vt,ariaAutoComplete:null,ariaBusy:Vt,ariaChecked:Vt,ariaColCount:Re,ariaColIndex:Re,ariaColSpan:Re,ariaControls:Nt,ariaCurrent:null,ariaDescribedBy:Nt,ariaDetails:null,ariaDisabled:Vt,ariaDropEffect:Nt,ariaErrorMessage:null,ariaExpanded:Vt,ariaFlowTo:Nt,ariaGrabbed:Vt,ariaHasPopup:null,ariaHidden:Vt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nt,ariaLevel:Re,ariaLive:null,ariaModal:Vt,ariaMultiLine:Vt,ariaMultiSelectable:Vt,ariaOrientation:null,ariaOwns:Nt,ariaPlaceholder:null,ariaPosInSet:Re,ariaPressed:Vt,ariaReadOnly:Vt,ariaRelevant:null,ariaRequired:Vt,ariaRoleDescription:Nt,ariaRowCount:Re,ariaRowIndex:Re,ariaRowSpan:Re,ariaSelected:Vt,ariaSetSize:Re,ariaSort:null,ariaValueMax:Re,ariaValueMin:Re,ariaValueNow:Re,ariaValueText:null,role:null}}),y8=Rs({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Y2,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:os,acceptCharset:Nt,accessKey:Nt,action:null,allow:null,allowFullScreen:et,allowPaymentRequest:et,allowUserMedia:et,alt:null,as:null,async:et,autoCapitalize:null,autoComplete:Nt,autoFocus:et,autoPlay:et,blocking:Nt,capture:null,charSet:null,checked:et,cite:null,className:Nt,cols:Re,colSpan:null,content:null,contentEditable:Vt,controls:et,controlsList:Nt,coords:Re|os,crossOrigin:null,data:null,dateTime:null,decoding:null,default:et,defer:et,dir:null,dirName:null,disabled:et,download:$2,draggable:Vt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:et,formTarget:null,headers:Nt,height:Re,hidden:et,high:Re,href:null,hrefLang:null,htmlFor:Nt,httpEquiv:Nt,id:null,imageSizes:null,imageSrcSet:null,inert:et,inputMode:null,integrity:null,is:null,isMap:et,itemId:null,itemProp:Nt,itemRef:Nt,itemScope:et,itemType:Nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:et,low:Re,manifest:null,max:null,maxLength:Re,media:null,method:null,min:null,minLength:Re,multiple:et,muted:et,name:null,nonce:null,noModule:et,noValidate:et,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:et,optimum:Re,pattern:null,ping:Nt,placeholder:null,playsInline:et,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:et,referrerPolicy:null,rel:Nt,required:et,reversed:et,rows:Re,rowSpan:Re,sandbox:Nt,scope:null,scoped:et,seamless:et,selected:et,shadowRootClonable:et,shadowRootDelegatesFocus:et,shadowRootMode:null,shape:null,size:Re,sizes:null,slot:null,span:Re,spellCheck:Vt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Re,step:null,style:null,tabIndex:Re,target:null,title:null,translate:null,type:null,typeMustMatch:et,useMap:null,value:Vt,width:Re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nt,axis:null,background:null,bgColor:null,border:Re,borderColor:null,bottomMargin:Re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:et,declare:et,event:null,face:null,frame:null,frameBorder:null,hSpace:Re,leftMargin:Re,link:null,longDesc:null,lowSrc:null,marginHeight:Re,marginWidth:Re,noResize:et,noHref:et,noShade:et,noWrap:et,object:null,profile:null,prompt:null,rev:null,rightMargin:Re,rules:null,scheme:null,scrolling:Vt,standby:null,summary:null,text:null,topMargin:Re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:et,disableRemotePlayback:et,prefix:null,property:null,results:Re,security:null,unselectable:null}}),b8=Rs({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:q2,properties:{about:Vn,accentHeight:Re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Re,amplitude:Re,arabicForm:null,ascent:Re,attributeName:null,attributeType:null,azimuth:Re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Re,by:null,calcMode:null,capHeight:Re,className:Nt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Re,diffuseConstant:Re,direction:null,display:null,dur:null,divisor:Re,dominantBaseline:null,download:et,dx:null,dy:null,edgeMode:null,editable:null,elevation:Re,enableBackground:null,end:null,event:null,exponent:Re,externalResourcesRequired:null,fill:null,fillOpacity:Re,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:os,g2:os,glyphName:os,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Re,horizOriginX:Re,horizOriginY:Re,id:null,ideographic:Re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Re,k:Re,k1:Re,k2:Re,k3:Re,k4:Re,kernelMatrix:Vn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Re,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Re,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Re,overlineThickness:Re,paintOrder:null,panose1:null,path:null,pathLength:Re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Re,pointsAtY:Re,pointsAtZ:Re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Vn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Vn,rev:Vn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Vn,requiredFeatures:Vn,requiredFonts:Vn,requiredFormats:Vn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Re,specularExponent:Re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Re,strikethroughThickness:Re,string:null,stroke:null,strokeDashArray:Vn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Re,strokeOpacity:Re,strokeWidth:null,style:null,surfaceScale:Re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Vn,tabIndex:Re,tableValues:null,target:null,targetX:Re,targetY:Re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Vn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Re,underlineThickness:Re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Re,values:null,vAlphabetic:Re,vMathematical:Re,vectorEffect:null,vHanging:Re,vIdeographic:Re,version:null,vertAdvY:Re,vertOriginX:Re,vertOriginY:Re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),x8=/^data[-\w.:]+$/i,$E=/-[a-z]/g,w8=/[A-Z]/g;function S8(e,t){const n=vv(t);let r=t,i=mr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&x8.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace($E,_8);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!$E.test(o)){let l=o.replace(w8,E8);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Vy}return new i(r,t)}function E8(e){return"-"+e.toLowerCase()}function _8(e){return e.charAt(1).toUpperCase()}const k8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},C8=B2([V2,H2,W2,X2,y8],"html"),qy=B2([V2,H2,W2,X2,b8],"svg");function T8(e){return e.join(" ").trim()}var Xo={},rg,HE;function A8(){if(HE)return rg;HE=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,f=`
`,d="/",p="*",m="",v="comment",g="declaration";rg=function(x,k){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];k=k||{};var C=1,_=1;function T(I){var Y=I.match(t);Y&&(C+=Y.length);var Z=I.lastIndexOf(f);_=~Z?I.length-Z:_+I.length}function N(){var I={line:C,column:_};return function(Y){return Y.position=new D(I),U(),Y}}function D(I){this.start=I,this.end={line:C,column:_},this.source=k.source}D.prototype.content=x;function L(I){var Y=new Error(k.source+":"+C+":"+_+": "+I);if(Y.reason=I,Y.filename=k.source,Y.line=C,Y.column=_,Y.source=x,!k.silent)throw Y}function R(I){var Y=I.exec(x);if(Y){var Z=Y[0];return T(Z),x=x.slice(Z.length),Y}}function U(){R(n)}function P(I){var Y;for(I=I||[];Y=z();)Y!==!1&&I.push(Y);return I}function z(){var I=N();if(!(d!=x.charAt(0)||p!=x.charAt(1))){for(var Y=2;m!=x.charAt(Y)&&(p!=x.charAt(Y)||d!=x.charAt(Y+1));)++Y;if(Y+=2,m===x.charAt(Y-1))return L("End of comment missing");var Z=x.slice(2,Y-2);return _+=2,T(Z),x=x.slice(Y),_+=2,I({type:v,comment:Z})}}function V(){var I=N(),Y=R(r);if(Y){if(z(),!R(i))return L("property missing ':'");var Z=R(o),B=I({type:g,property:w(Y[0].replace(e,m)),value:Z?w(Z[0].replace(e,m)):m});return R(l),B}}function q(){var I=[];P(I);for(var Y;Y=V();)Y!==!1&&(I.push(Y),P(I));return I}return U(),q()};function w(x){return x?x.replace(u,m):m}return rg}var VE;function R8(){if(VE)return Xo;VE=1;var e=Xo&&Xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=n;var t=e(A8());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var l=(0,t.default)(r),u=typeof i=="function";return l.forEach(function(f){if(f.type==="declaration"){var d=f.property,p=f.value;u?i(d,p,f):p&&(o=o||{},o[d]=p)}}),o}return Xo}var D8=R8();const qE=fn(D8),N8=qE.default||qE,K2=Z2("end"),Yy=Z2("start");function Z2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function O8(e){const t=Yy(e),n=K2(e);if(t&&n)return{start:t,end:n}}function Bl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?YE(e.position):"start"in e||"end"in e?YE(e):"line"in e||"column"in e?bv(e):""}function bv(e){return WE(e&&e.line)+":"+WE(e&&e.column)}function YE(e){return bv(e&&e.start)+"-"+bv(e&&e.end)}function WE(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=u?u.line:void 0,this.name=Bl(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const Wy={}.hasOwnProperty,j8=new Map,L8=/[A-Z]/g,z8=/-([a-z])/g,M8=new Set(["table","tbody","thead","tfoot","tr"]),P8=new Set(["td","th"]),Q2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function J2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=V8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=H8(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qy:C8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=eD(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function eD(e,t,n){if(t.type==="element")return F8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return I8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return U8(e,t,n);if(t.type==="mdxjsEsm")return G8(e,t);if(t.type==="root")return B8(e,t,n);if(t.type==="text")return $8(e,t)}function F8(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qy,e.schema=i),e.ancestors.push(t);const o=nD(e,t.tagName,!1),l=q8(e,t);let u=Ky(e,t);return M8.has(t.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!m8(f):!0})),tD(e,l,o,t),Xy(l,u),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function I8(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tu(e,t.position)}function G8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tu(e,t.position)}function U8(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:nD(e,t.name,!0),l=Y8(e,t),u=Ky(e,t);return tD(e,l,o,t),Xy(l,u),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function B8(e,t,n){const r={};return Xy(r,Ky(e,t)),e.create(t,e.Fragment,r,n)}function $8(e,t){return t.value}function tD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Xy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function H8(e,t,n){return r;function r(i,o,l,u){const d=Array.isArray(l.children)?n:t;return u?d(o,l,u):d(o,l)}}function V8(e,t){return n;function n(r,i,o,l){const u=Array.isArray(o.children),f=Yy(r);return t(i,o,l,u,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function q8(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Wy.call(t.properties,i)){const o=W8(e,i,t.properties[i]);if(o){const[l,u]=o;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&P8.has(t.tagName)?r=u:n[l]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Y8(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else tu(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else tu(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Ky(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:j8;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const d=i.get(f)||0;l=f+"-"+d,i.set(f,d+1)}}const u=eD(e,o,l);u!==void 0&&n.push(u)}return n}function W8(e,t,n){const r=S8(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?c8(n):T8(n)),r.property==="style"){let i=typeof n=="object"?n:X8(e,String(n));return e.stylePropertyNameCase==="css"&&(i=K8(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?k8[r.property]||r.property:r.attribute,n]}}function X8(e,t){const n={};try{N8(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,l=new wn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=Q2+"#cannot-parse-style-attribute",l}}return n;function r(i,o){let l=i;l.slice(0,2)!=="--"&&(l.slice(0,4)==="-ms-"&&(l="ms-"+l.slice(4)),l=l.replace(z8,Q8)),n[l]=o}}function nD(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const u=GE(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(o&&u.type==="Literal"),optional:!1}:u}r=l}else r=GE(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Wy.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);tu(e)}function tu(e,t){const n=new wn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Q2+"#cannot-handle-mdx-estrees-without-createevaluater",n}function K8(e){const t={};let n;for(n in e)Wy.call(e,n)&&(t[Z8(n)]=e[n]);return t}function Z8(e){let t=e.replace(L8,J8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Q8(e,t){return t.toUpperCase()}function J8(e){return"-"+e.toLowerCase()}const ig={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},e7={};function Zy(e,t){const n=e7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return rD(e,r,i)}function rD(e,t,n){if(t7(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return XE(e.children,t,n)}return Array.isArray(e)?XE(e,t,n):""}function XE(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=rD(e[i],t,n);return r.join("")}function t7(e){return!!(e&&typeof e=="object")}const KE=document.createElement("i");function Qy(e){const t="&"+e+";";KE.innerHTML=t;const n=KE.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Xn(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function cr(e,t){return e.length>0?(Xn(e,e.length,0,t),e):t}const ZE={}.hasOwnProperty;function iD(e){const t={};let n=-1;for(;++n<e.length;)n7(t,e[n]);return t}function n7(e,t){let n;for(n in t){const i=(ZE.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){ZE.call(i,l)||(i[l]=[]);const u=o[l];r7(i[l],Array.isArray(u)?u:u?[u]:[])}}}function r7(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Xn(e,0,0,r)}function aD(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"<22>":String.fromCodePoint(n)}function Tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=ga(/[A-Za-z]/),yn=ga(/[\dA-Za-z]/),i7=ga(/[#-'*+\--9=?A-Z^-~]/);function Uf(e){return e!==null&&(e<32||e===127)}const xv=ga(/\d/),a7=ga(/[\dA-Fa-f]/),o7=ga(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const Rd=ga(new RegExp("\\p{P}|\\p{S}","u")),to=ga(/\s/);function ga(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ds(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&yn(e.charCodeAt(n+1))&&yn(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(l=String.fromCharCode(o,u),i=1):l="<22>"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function st(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(f){return ut(f)?(e.enter(n),u(f)):t(f)}function u(f){return ut(f)&&o++<i?(e.consume(f),u):(e.exit(n),t(f))}}const s7={tokenize:l7};function l7(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),st(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),o(u)}function o(u){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Be(u)?(e.consume(u),e.exit("chunkText"),o):(e.consume(u),l)}}const u7={tokenize:c7},QE={tokenize:f7};function c7(e){const t=this,n=[];let r=0,i,o,l;return u;function u(T){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,f,d)(T)}return d(T)}function f(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&_();const N=t.events.length;let D=N,L;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){L=t.events[D][1].end;break}C(r);let R=N;for(;R<t.events.length;)t.events[R][1].end={...L},R++;return Xn(t.events,D+1,0,t.events.slice(N)),t.events.length=R,d(T)}return u(T)}function d(T){if(r===n.length){if(!i)return v(T);if(i.currentConstruct&&i.currentConstruct.concrete)return w(T);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(QE,p,m)(T)}function p(T){return i&&_(),C(r),v(T)}function m(T){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(T)}function v(T){return t.containerState={},e.attempt(QE,g,w)(T)}function g(T){return r++,n.push([t.currentConstruct,t.containerState]),v(T)}function w(T){if(T===null){i&&_(),C(0),e.consume(T);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),x(T)}function x(T){if(T===null){k(e.exit("chunkFlow"),!0),C(0),e.consume(T);return}return Be(T)?(e.consume(T),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(T),x)}function k(T,N){const D=t.sliceStream(T);if(N&&D.push(null),T.previous=o,o&&(o.next=T),o=T,i.defineSkip(T.start),i.write(D),t.parser.lazy[T.start.line]){let L=i.events.length;for(;L--;)if(i.events[L][1].start.offset<l&&(!i.events[L][1].end||i.events[L][1].end.offset>l))return;const R=t.events.length;let U=R,P,z;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(P){z=t.events[U][1].end;break}P=!0}for(C(r),L=R;L<t.events.length;)t.events[L][1].end={...z},L++;Xn(t.events,U+1,0,t.events.slice(R)),t.events.length=L}}function C(T){let N=n.length;for(;N-- >T;){const D=n[N];t.containerState=D[1],D[0].exit.call(t,e)}n.length=T}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function f7(e,t,n){return st(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ps(e){if(e===null||Tt(e)||to(e))return 1;if(Rd(e))return 2}function Dd(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const wv={name:"attention",resolveAll:d7,tokenize:h7};function d7(e,t){let n=-1,r,i,o,l,u,f,d,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},v={...e[n][1].start};JE(m,-f),JE(v,f),l={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=cr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=cr(d,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),d=cr(d,Dd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=cr(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=cr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Xn(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function h7(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ps(r);let o;return l;function l(f){return o=f,e.enter("attentionSequence"),u(f)}function u(f){if(f===o)return e.consume(f),u;const d=e.exit("attentionSequence"),p=ps(f),m=!p||p===2&&i||n.includes(f),v=!i||i===2&&p||n.includes(r);return d._open=!!(o===42?m:m&&(i||!v)),d._close=!!(o===42?v:v&&(p||!m)),t(f)}}function JE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const p7={name:"autolink",tokenize:m7};function m7(e,t,n){let r=0;return i;function i(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(g){return kn(g)?(e.consume(g),l):g===64?n(g):d(g)}function l(g){return g===43||g===45||g===46||yn(g)?(r=1,u(g)):d(g)}function u(g){return g===58?(e.consume(g),r=0,f):(g===43||g===45||g===46||yn(g))&&r++<32?(e.consume(g),u):(r=0,d(g))}function f(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Uf(g)?n(g):(e.consume(g),f)}function d(g){return g===64?(e.consume(g),p):i7(g)?(e.consume(g),d):n(g)}function p(g){return yn(g)?m(g):n(g)}function m(g){return g===46?(e.consume(g),r=0,p):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):v(g)}function v(g){if((g===45||yn(g))&&r++<63){const w=g===45?v:m;return e.consume(g),w}return n(g)}}const yu={partial:!0,tokenize:g7};function g7(e,t,n){return r;function r(o){return ut(o)?st(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Be(o)?t(o):n(o)}}const oD={continuation:{tokenize:y7},exit:b7,name:"blockQuote",tokenize:v7};function v7(e,t,n){const r=this;return i;function i(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return ut(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function y7(e,t,n){const r=this;return i;function i(l){return ut(l)?st(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(oD,t,n)(l)}}function b7(e){e.exit("blockQuote")}const sD={name:"characterEscape",tokenize:x7};function x7(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return o7(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const lD={name:"characterReference",tokenize:w7};function w7(e,t,n){const r=this;let i=0,o,l;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),f}function f(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,l=yn,p(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=a7,p):(e.enter("characterReferenceValue"),o=7,l=xv,p(m))}function p(m){if(m===59&&i){const v=e.exit("characterReferenceValue");return l===yn&&!Qy(r.sliceSerialize(v))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&i++<o?(e.consume(m),p):n(m)}}const e_={partial:!0,tokenize:E7},t_={concrete:!0,name:"codeFenced",tokenize:S7};function S7(e,t,n){const r=this,i={partial:!0,tokenize:D};let o=0,l=0,u;return f;function f(L){return d(L)}function d(L){const R=r.events[r.events.length-1];return o=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,u=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(L)}function p(L){return L===u?(l++,e.consume(L),p):l<3?n(L):(e.exit("codeFencedFenceSequence"),ut(L)?st(e,m,"whitespace")(L):m(L))}function m(L){return L===null||Be(L)?(e.exit("codeFencedFence"),r.interrupt?t(L):e.check(e_,x,N)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(L))}function v(L){return L===null||Be(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(L)):ut(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),st(e,g,"whitespace")(L)):L===96&&L===u?n(L):(e.consume(L),v)}function g(L){return L===null||Be(L)?m(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(L))}function w(L){return L===null||Be(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(L)):L===96&&L===u?n(L):(e.consume(L),w)}function x(L){return e.attempt(i,N,k)(L)}function k(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),C}function C(L){return o>0&&ut(L)?st(e,_,"linePrefix",o+1)(L):_(L)}function _(L){return L===null||Be(L)?e.check(e_,x,N)(L):(e.enter("codeFlowValue"),T(L))}function T(L){return L===null||Be(L)?(e.exit("codeFlowValue"),_(L)):(e.consume(L),T)}function N(L){return e.exit("codeFenced"),t(L)}function D(L,R,U){let P=0;return z;function z(Z){return L.enter("lineEnding"),L.consume(Z),L.exit("lineEnding"),V}function V(Z){return L.enter("codeFencedFence"),ut(Z)?st(L,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):q(Z)}function q(Z){return Z===u?(L.enter("codeFencedFenceSequence"),I(Z)):U(Z)}function I(Z){return Z===u?(P++,L.consume(Z),I):P>=l?(L.exit("codeFencedFenceSequence"),ut(Z)?st(L,Y,"whitespace")(Z):Y(Z)):U(Z)}function Y(Z){return Z===null||Be(Z)?(L.exit("codeFencedFence"),R(Z)):U(Z)}}}function E7(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const ag={name:"codeIndented",tokenize:k7},_7={partial:!0,tokenize:C7};function k7(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),st(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):Be(d)?e.attempt(_7,l,f)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Be(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),u)}function f(d){return e.exit("codeIndented"),t(d)}}function C7(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):Be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):st(e,o,"linePrefix",5)(l)}function o(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):Be(l)?i(l):n(l)}}const T7={name:"codeText",previous:R7,resolve:A7,tokenize:D7};function A7(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function R7(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function D7(e,t,n){let r=0,i,o;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),f(m))}function f(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),f):m===96?(o=e.enter("codeTextSequence"),i=0,p(m)):Be(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Be(m)?(e.exit("codeTextData"),f(m)):(e.consume(m),d)}function p(m){return m===96?(e.consume(m),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(o.type="codeTextData",d(m))}}class N7{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&zl(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),zl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);zl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zl(this.left,n.reverse())}}}function zl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function uD(e){const t={};let n=-1,r,i,o,l,u,f,d;const p=new N7(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,O7(p,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=p.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(l[1].type!=="linePrefix")break;i&&(r[1].end={...p.get(i)[1].start},u=p.slice(i,n),u.unshift(r),p.splice(i,n-i+1,u))}}return Xn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function O7(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[],l=n._tokenizer||r.parser[n.contentType](n.start),u=l.events,f=[],d={};let p,m,v=-1,g=n,w=0,x=0;const k=[x];for(;g;){for(;e.get(++i)[1]!==g;);o.push(i),g._tokenizer||(p=r.sliceStream(g),g.next||p.push(null),m&&l.defineSkip(g.start),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=g,g=g.next}for(g=n;++v<u.length;)u[v][0]==="exit"&&u[v-1][0]==="enter"&&u[v][1].type===u[v-1][1].type&&u[v][1].start.line!==u[v][1].end.line&&(x=v+1,k.push(x),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(l.events=[],g?(g._tokenizer=void 0,g.previous=void 0):k.pop(),v=k.length;v--;){const C=u.slice(k[v],k[v+1]),_=o.pop();f.push([_,_+C.length-1]),e.splice(_,2,C)}for(f.reverse(),v=-1;++v<f.length;)d[w+f[v][0]]=w+f[v][1],w+=f[v][1]-f[v][0]-1;return d}const j7={resolve:z7,tokenize:M7},L7={partial:!0,tokenize:P7};function z7(e){return uD(e),e}function M7(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?o(u):Be(u)?e.check(L7,l,o)(u):(e.consume(u),i)}function o(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function P7(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),st(e,o,"linePrefix")}function o(l){if(l===null||Be(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function cD(e,t,n,r,i,o,l,u,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),v):C===null||C===32||C===41||Uf(C)?n(C):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),x(C))}function v(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===62?(e.exit("chunkString"),e.exit(u),v(C)):C===null||C===60||Be(C)?n(C):(e.consume(C),C===92?w:g)}function w(C){return C===60||C===62||C===92?(e.consume(C),g):g(C)}function x(C){return!p&&(C===null||C===41||Tt(C))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(C)):p<d&&C===40?(e.consume(C),p++,x):C===41?(e.consume(C),p--,x):C===null||C===32||C===40||Uf(C)?n(C):(e.consume(C),C===92?k:x)}function k(C){return C===40||C===41||C===92?(e.consume(C),x):x(C)}}function fD(e,t,n,r,i,o){const l=this;let u=0,f;return d;function d(g){return e.enter(r),e.enter(i),e.consume(g),e.exit(i),e.enter(o),p}function p(g){return u>999||g===null||g===91||g===93&&!f||g===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):Be(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===null||g===91||g===93||Be(g)||u++>999?(e.exit("chunkString"),p(g)):(e.consume(g),f||(f=!ut(g)),g===92?v:m)}function v(g){return g===91||g===92||g===93?(e.consume(g),u++,m):m(g)}}function dD(e,t,n,r,i,o){let l;return u;function u(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),l=v===40?41:v,f):n(v)}function f(v){return v===l?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),d(v))}function d(v){return v===l?(e.exit(o),f(l)):v===null?n(v):Be(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),st(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===l||v===null||Be(v)?(e.exit("chunkString"),d(v)):(e.consume(v),v===92?m:p)}function m(v){return v===l||v===92?(e.consume(v),p):p(v)}}function $l(e,t){let n;return r;function r(i){return Be(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ut(i)?st(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const F7={name:"definition",tokenize:G7},I7={partial:!0,tokenize:U7};function G7(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),l(g)}function l(g){return fD.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function u(g){return i=Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return Tt(g)?$l(e,d)(g):d(g)}function d(g){return cD(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(I7,m,m)(g)}function m(g){return ut(g)?st(e,v,"whitespace")(g):v(g)}function v(g){return g===null||Be(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function U7(e,t,n){return r;function r(u){return Tt(u)?$l(e,i)(u):n(u)}function i(u){return dD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return ut(u)?st(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Be(u)?t(u):n(u)}}const B7={name:"hardBreakEscape",tokenize:$7};function $7(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Be(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const H7={name:"headingAtx",resolve:V7,tokenize:q7};function V7(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Xn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function q7(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||Tt(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Be(p)?(e.exit("atxHeading"),t(p)):ut(p)?st(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||Tt(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const Y7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],n_=["pre","script","style","textarea"],W7={concrete:!0,name:"htmlFlow",resolveTo:Z7,tokenize:Q7},X7={partial:!0,tokenize:eV},K7={partial:!0,tokenize:J7};function Z7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Q7(e,t,n){const r=this;let i,o,l,u,f;return d;function d(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),m}function m(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,x):O===63?(e.consume(O),i=3,r.interrupt?t:A):kn(O)?(e.consume(O),l=String.fromCharCode(O),k):n(O)}function v(O){return O===45?(e.consume(O),i=2,g):O===91?(e.consume(O),i=5,u=0,w):kn(O)?(e.consume(O),i=4,r.interrupt?t:A):n(O)}function g(O){return O===45?(e.consume(O),r.interrupt?t:A):n(O)}function w(O){const X="CDATA[";return O===X.charCodeAt(u++)?(e.consume(O),u===X.length?r.interrupt?t:q:w):n(O)}function x(O){return kn(O)?(e.consume(O),l=String.fromCharCode(O),k):n(O)}function k(O){if(O===null||O===47||O===62||Tt(O)){const X=O===47,re=l.toLowerCase();return!X&&!o&&n_.includes(re)?(i=1,r.interrupt?t(O):q(O)):Y7.includes(l.toLowerCase())?(i=6,X?(e.consume(O),C):r.interrupt?t(O):q(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?_(O):T(O))}return O===45||yn(O)?(e.consume(O),l+=String.fromCharCode(O),k):n(O)}function C(O){return O===62?(e.consume(O),r.interrupt?t:q):n(O)}function _(O){return ut(O)?(e.consume(O),_):z(O)}function T(O){return O===47?(e.consume(O),z):O===58||O===95||kn(O)?(e.consume(O),N):ut(O)?(e.consume(O),T):z(O)}function N(O){return O===45||O===46||O===58||O===95||yn(O)?(e.consume(O),N):D(O)}function D(O){return O===61?(e.consume(O),L):ut(O)?(e.consume(O),D):T(O)}function L(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),f=O,R):ut(O)?(e.consume(O),L):U(O)}function R(O){return O===f?(e.consume(O),f=null,P):O===null||Be(O)?n(O):(e.consume(O),R)}function U(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Tt(O)?D(O):(e.consume(O),U)}function P(O){return O===47||O===62||ut(O)?T(O):n(O)}function z(O){return O===62?(e.consume(O),V):n(O)}function V(O){return O===null||Be(O)?q(O):ut(O)?(e.consume(O),V):n(O)}function q(O){return O===45&&i===2?(e.consume(O),B):O===60&&i===1?(e.consume(O),G):O===62&&i===4?(e.consume(O),H):O===63&&i===3?(e.consume(O),A):O===93&&i===5?(e.consume(O),K):Be(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(X7,M,I)(O)):O===null||Be(O)?(e.exit("htmlFlowData"),I(O)):(e.consume(O),q)}function I(O){return e.check(K7,Y,M)(O)}function Y(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Z}function Z(O){return O===null||Be(O)?I(O):(e.enter("htmlFlowData"),q(O))}function B(O){return O===45?(e.consume(O),A):q(O)}function G(O){return O===47?(e.consume(O),l="",F):q(O)}function F(O){if(O===62){const X=l.toLowerCase();return n_.includes(X)?(e.consume(O),H):q(O)}return kn(O)&&l.length<8?(e.consume(O),l+=String.fromCharCode(O),F):q(O)}function K(O){return O===93?(e.consume(O),A):q(O)}function A(O){return O===62?(e.consume(O),H):O===45&&i===2?(e.consume(O),A):q(O)}function H(O){return O===null||Be(O)?(e.exit("htmlFlowData"),M(O)):(e.consume(O),H)}function M(O){return e.exit("htmlFlow"),t(O)}}function J7(e,t,n){const r=this;return i;function i(l){return Be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function eV(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yu,t,n)}}const tV={name:"htmlText",tokenize:nV};function nV(e,t,n){const r=this;let i,o,l;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),D):A===63?(e.consume(A),T):kn(A)?(e.consume(A),U):n(A)}function d(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),o=0,w):kn(A)?(e.consume(A),_):n(A)}function p(A){return A===45?(e.consume(A),g):n(A)}function m(A){return A===null?n(A):A===45?(e.consume(A),v):Be(A)?(l=m,G(A)):(e.consume(A),m)}function v(A){return A===45?(e.consume(A),g):m(A)}function g(A){return A===62?B(A):A===45?v(A):m(A)}function w(A){const H="CDATA[";return A===H.charCodeAt(o++)?(e.consume(A),o===H.length?x:w):n(A)}function x(A){return A===null?n(A):A===93?(e.consume(A),k):Be(A)?(l=x,G(A)):(e.consume(A),x)}function k(A){return A===93?(e.consume(A),C):x(A)}function C(A){return A===62?B(A):A===93?(e.consume(A),C):x(A)}function _(A){return A===null||A===62?B(A):Be(A)?(l=_,G(A)):(e.consume(A),_)}function T(A){return A===null?n(A):A===63?(e.consume(A),N):Be(A)?(l=T,G(A)):(e.consume(A),T)}function N(A){return A===62?B(A):T(A)}function D(A){return kn(A)?(e.consume(A),L):n(A)}function L(A){return A===45||yn(A)?(e.consume(A),L):R(A)}function R(A){return Be(A)?(l=R,G(A)):ut(A)?(e.consume(A),R):B(A)}function U(A){return A===45||yn(A)?(e.consume(A),U):A===47||A===62||Tt(A)?P(A):n(A)}function P(A){return A===47?(e.consume(A),B):A===58||A===95||kn(A)?(e.consume(A),z):Be(A)?(l=P,G(A)):ut(A)?(e.consume(A),P):B(A)}function z(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),z):V(A)}function V(A){return A===61?(e.consume(A),q):Be(A)?(l=V,G(A)):ut(A)?(e.consume(A),V):P(A)}function q(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,I):Be(A)?(l=q,G(A)):ut(A)?(e.consume(A),q):(e.consume(A),Y)}function I(A){return A===i?(e.consume(A),i=void 0,Z):A===null?n(A):Be(A)?(l=I,G(A)):(e.consume(A),I)}function Y(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Tt(A)?P(A):(e.consume(A),Y)}function Z(A){return A===47||A===62||Tt(A)?P(A):n(A)}function B(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function G(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return ut(A)?st(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):K(A)}function K(A){return e.enter("htmlTextData"),l(A)}}const Jy={name:"labelEnd",resolveAll:oV,resolveTo:sV,tokenize:lV},rV={tokenize:uV},iV={tokenize:cV},aV={tokenize:fV};function oV(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Xn(e,0,e.length,n),e}function sV(e,t){let n=e.length,r=0,i,o,l,u;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const f={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",f,t],["enter",d,t]],u=cr(u,e.slice(o+1,o+r+3)),u=cr(u,[["enter",p,t]]),u=cr(u,Dd(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),u=cr(u,[["exit",p,t],e[l-2],e[l-1],["exit",d,t]]),u=cr(u,e.slice(l+1)),u=cr(u,[["exit",f,t]]),Xn(e,o,e.length,u),e}function lV(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return u;function u(v){return o?o._inactive?m(v):(l=r.parser.defined.includes(Tr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),f):n(v)}function f(v){return v===40?e.attempt(rV,p,l?p:m)(v):v===91?e.attempt(iV,p,l?d:m)(v):l?p(v):m(v)}function d(v){return e.attempt(aV,p,m)(v)}function p(v){return t(v)}function m(v){return o._balanced=!0,n(v)}}function uV(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return Tt(m)?$l(e,o)(m):o(m)}function o(m){return m===41?p(m):cD(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return Tt(m)?$l(e,f)(m):p(m)}function u(m){return n(m)}function f(m){return m===34||m===39||m===40?dD(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function d(m){return Tt(m)?$l(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function cV(e,t,n){const r=this;return i;function i(u){return fD.call(r,e,o,l,"reference","referenceMarker","referenceString")(u)}function o(u){return r.parser.defined.includes(Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function fV(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const dV={name:"labelStartImage",resolveAll:Jy.resolveAll,tokenize:hV};function hV(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),o}function o(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const pV={name:"labelStartLink",resolveAll:Jy.resolveAll,tokenize:mV};function mV(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const og={name:"lineEnding",tokenize:gV};function gV(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),st(e,t,"linePrefix")}}const yf={name:"thematicBreak",tokenize:vV};function vV(e,t,n){let r=0,i;return o;function o(d){return e.enter("thematicBreak"),l(d)}function l(d){return i=d,u(d)}function u(d){return d===i?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||Be(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===i?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),ut(d)?st(e,u,"whitespace")(d):u(d))}}const On={continuation:{tokenize:wV},exit:EV,name:"list",tokenize:xV},yV={partial:!0,tokenize:_V},bV={partial:!0,tokenize:SV};function xV(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return u;function u(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:xv(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(yf,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return xv(g)&&++l<10?(e.consume(g),f):(!r.interrupt||l<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(yu,r.interrupt?n:p,e.attempt(yV,v,m))}function p(g){return r.containerState.initialBlankLine=!0,o++,v(g)}function m(g){return ut(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):n(g)}function v(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function wV(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yu,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,st(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!ut(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(bV,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,st(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function SV(e,t,n){const r=this;return st(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function EV(e){e.exit(this.containerState.type)}function _V(e,t,n){const r=this;return st(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!ut(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const r_={name:"setextUnderline",resolveTo:kV,tokenize:CV};function kV(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function CV(e,t,n){const r=this;let i;return o;function o(d){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===i?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),ut(d)?st(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Be(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const TV={tokenize:AV};function AV(e){const t=this,n=e.attempt(yu,r,e.attempt(this.parser.constructs.flowInitial,i,st(e,e.attempt(this.parser.constructs.flow,i,e.attempt(j7,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const RV={resolveAll:pD()},DV=hD("string"),NV=hD("text");function hD(e){return{resolveAll:pD(e==="text"?OV:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,u);return l;function l(p){return d(p)?o(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=i[p];let v=-1;if(m)for(;++v<m.length;){const g=m[v];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function pD(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function OV(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,u=0,f;for(;o--;){const d=i[o];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(d===-2)f=!0,u++;else if(d!==-1){o++;break}}if(u){const d={type:n===e.length||f||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const jV={42:On,43:On,45:On,48:On,49:On,50:On,51:On,52:On,53:On,54:On,55:On,56:On,57:On,62:oD},LV={91:F7},zV={[-2]:ag,[-1]:ag,32:ag},MV={35:H7,42:yf,45:[r_,yf],60:W7,61:r_,95:yf,96:t_,126:t_},PV={38:lD,92:sD},FV={[-5]:og,[-4]:og,[-3]:og,33:dV,38:lD,42:wv,60:[p7,tV],91:pV,92:[B7,sD],93:Jy,95:wv,96:T7},IV={null:[wv,RV]},GV={null:[42,95]},UV={null:[]},BV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:GV,contentInitial:LV,disable:UV,document:jV,flow:MV,flowInitial:zV,insideSpan:IV,string:PV,text:FV},Symbol.toStringTag,{value:"Module"}));function $V(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],u=[];const f={attempt:R(D),check:R(L),consume:_,enter:T,exit:N,interrupt:R(L,{interrupt:!0})},d={code:null,containerState:{},defineSkip:x,events:[],now:w,parser:e,previous:null,sliceSerialize:v,sliceStream:g,write:m};let p=t.tokenize.call(d,f);return t.resolveAll&&o.push(t),d;function m(V){return l=cr(l,V),k(),l[l.length-1]!==null?[]:(U(t,0),d.events=Dd(o,d.events,d),d.events)}function v(V,q){return VV(g(V),q)}function g(V){return HV(l,V)}function w(){const{_bufferIndex:V,_index:q,line:I,column:Y,offset:Z}=r;return{_bufferIndex:V,_index:q,line:I,column:Y,offset:Z}}function x(V){i[V.line]=V.column,z()}function k(){let V;for(;r._index<l.length;){const q=l[r._index];if(typeof q=="string")for(V=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===V&&r._bufferIndex<q.length;)C(q.charCodeAt(r._bufferIndex));else C(q)}}function C(V){p=p(V)}function _(V){Be(V)?(r.line++,r.column=1,r.offset+=V===-3?2:1,z()):V!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=V}function T(V,q){const I=q||{};return I.type=V,I.start=w(),d.events.push(["enter",I,d]),u.push(I),I}function N(V){const q=u.pop();return q.end=w(),d.events.push(["exit",q,d]),q}function D(V,q){U(V,q.from)}function L(V,q){q.restore()}function R(V,q){return I;function I(Y,Z,B){let G,F,K,A;return Array.isArray(Y)?M(Y):"tokenize"in Y?M([Y]):H(Y);function H(ue){return ae;function ae(oe){const Ce=oe!==null&&ue[oe],he=oe!==null&&ue.null,Ee=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(he)?he:he?[he]:[]];return M(Ee)(oe)}}function M(ue){return G=ue,F=0,ue.length===0?B:O(ue[F])}function O(ue){return ae;function ae(oe){return A=P(),K=ue,ue.partial||(d.currentConstruct=ue),ue.name&&d.parser.constructs.disable.null.includes(ue.name)?re():ue.tokenize.call(q?Object.assign(Object.create(d),q):d,f,X,re)(oe)}}function X(ue){return V(K,A),Z}function re(ue){return A.restore(),++F<G.length?O(G[F]):B}}}function U(V,q){V.resolveAll&&!o.includes(V)&&o.push(V),V.resolve&&Xn(d.events,q,d.events.length-q,V.resolve(d.events.slice(q),d)),V.resolveTo&&(d.events=V.resolveTo(d.events,d))}function P(){const V=w(),q=d.previous,I=d.currentConstruct,Y=d.events.length,Z=Array.from(u);return{from:Y,restore:B};function B(){r=V,d.previous=q,d.currentConstruct=I,d.events.length=Y,u=Z,z()}}function z(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function HV(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function VV(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
`;break}case-3:{l=`\r
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function qV(e){const r={constructs:iD([BV,...(e||{}).extensions||[]]),content:i(s7),defined:[],document:i(u7),flow:i(TV),lazy:{},string:i(DV),text:i(NV)};return r;function i(o){return l;function l(u){return $V(r,o,u)}}}function YV(e){for(;!uD(e););return e}const i_=/[\0\t\n\r]/g;function WV(){let e=1,t="",n=!0,r;return i;function i(o,l,u){const f=[];let d,p,m,v,g;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),m=0,t="",n&&(o.charCodeAt(0)===65279&&m++,n=void 0);m<o.length;){if(i_.lastIndex=m,d=i_.exec(o),v=d&&d.index!==void 0?d.index:o.length,g=o.charCodeAt(v),!d){t=o.slice(m);break}if(g===10&&m===v&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),m<v&&(f.push(o.slice(m,v)),e+=v-m),g){case 0:{f.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,f.push(-2);e++<p;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}m=v+1}return u&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const XV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function KV(e){return e.replace(XV,ZV)}function ZV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return aD(n.slice(o?2:1),o?16:10)}return Qy(n)||e}const mD={}.hasOwnProperty;function QV(e,t,n){return typeof t!="string"&&(n=t,t=void 0),JV(n)(YV(qV(n).document().write(WV()(e,t,!0))))}function JV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ge),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(xe),blockQuote:o(he),characterEscape:P,characterReference:P,codeFenced:o(Ee),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Ee,l),codeText:o(we,l),codeTextData:P,data:P,codeFlowValue:P,definition:o(Pe),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Ae),hardBreakEscape:o(ee),hardBreakTrailing:o(ee),htmlFlow:o(ce,l),htmlFlowData:P,htmlText:o(ce,l),htmlTextData:P,image:o(Te),label:l,link:o(ge),listItem:o(ie),listItemValue:v,listOrdered:o(Se,m),listUnordered:o(Se),paragraph:o($e),reference:O,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(xe),strong:o(Ge),thematicBreak:o(Ne)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:Ce,autolinkProtocol:oe,blockQuote:f(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ue,characterReference:ae,codeFenced:f(k),codeFencedFence:x,codeFencedFenceInfo:g,codeFencedFenceMeta:w,codeFlowValue:z,codeIndented:f(C),codeText:f(Z),codeTextData:z,data:z,definition:f(),definitionDestinationString:N,definitionLabelString:_,definitionTitleString:T,emphasis:f(),hardBreakEscape:f(q),hardBreakTrailing:f(q),htmlFlow:f(I),htmlFlowData:z,htmlText:f(Y),htmlTextData:z,image:f(G),label:K,labelText:F,lineEnding:V,link:f(B),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:X,resourceDestinationString:A,resourceTitleString:H,resource:M,setextHeading:f(U),setextHeadingLineSequence:R,setextHeadingText:L,strong:f(),thematicBreak:f()}};gD(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let de={type:"root",children:[]};const Oe={stack:[de],tokenStack:[],config:t,enter:u,exit:d,buffer:l,resume:p,data:n},He=[];let Ye=-1;for(;++Ye<te.length;)if(te[Ye][1].type==="listOrdered"||te[Ye][1].type==="listUnordered")if(te[Ye][0]==="enter")He.push(Ye);else{const vt=He.pop();Ye=i(te,vt,Ye)}for(Ye=-1;++Ye<te.length;){const vt=t[te[Ye][0]];mD.call(vt,te[Ye][1].type)&&vt[te[Ye][1].type].call(Object.assign({sliceSerialize:te[Ye][2].sliceSerialize},Oe),te[Ye][1])}if(Oe.tokenStack.length>0){const vt=Oe.tokenStack[Oe.tokenStack.length-1];(vt[1]||a_).call(Oe,void 0,vt[0])}for(de.position={start:ra(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:ra(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye<t.transforms.length;)de=t.transforms[Ye](de)||de;return de}function i(te,de,Oe){let He=de-1,Ye=-1,vt=!1,Mt,bt,rt,qt;for(;++He<=Oe;){const at=te[He];switch(at[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{at[0]==="enter"?Ye++:Ye--,qt=void 0;break}case"lineEndingBlank":{at[0]==="enter"&&(Mt&&!qt&&!Ye&&!rt&&(rt=He),qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qt=void 0}if(!Ye&&at[0]==="enter"&&at[1].type==="listItemPrefix"||Ye===-1&&at[0]==="exit"&&(at[1].type==="listUnordered"||at[1].type==="listOrdered")){if(Mt){let At=He;for(bt=void 0;At--;){const rn=te[At];if(rn[1].type==="lineEnding"||rn[1].type==="lineEndingBlank"){if(rn[0]==="exit")continue;bt&&(te[bt][1].type="lineEndingBlank",vt=!0),rn[1].type="lineEnding",bt=At}else if(!(rn[1].type==="linePrefix"||rn[1].type==="blockQuotePrefix"||rn[1].type==="blockQuotePrefixWhitespace"||rn[1].type==="blockQuoteMarker"||rn[1].type==="listItemIndent"))break}rt&&(!bt||rt<bt)&&(Mt._spread=!0),Mt.end=Object.assign({},bt?te[bt][1].start:at[1].end),te.splice(bt||He,0,["exit",Mt,at[2]]),He++,Oe++}if(at[1].type==="listItemPrefix"){const At={type:"listItem",_spread:!1,start:Object.assign({},at[1].start),end:void 0};Mt=At,te.splice(He,0,["enter",At,at[2]]),He++,Oe++,rt=void 0,qt=!0}}}return te[de][1]._spread=vt,Oe}function o(te,de){return Oe;function Oe(He){u.call(this,te(He),He),de&&de.call(this,He)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(te,de,Oe){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([de,Oe||void 0]),te.position={start:ra(de.start),end:void 0}}function f(te){return de;function de(Oe){te&&te.call(this,Oe),d.call(this,Oe)}}function d(te,de){const Oe=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==te.type&&(de?de.call(this,te,He[0]):(He[1]||a_).call(this,te,He[0]));else throw new Error("Cannot close `"+te.type+"` ("+Bl({start:te.start,end:te.end})+"): its not open");Oe.position.end=ra(te.end)}function p(){return Zy(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function v(te){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function g(){const te=this.resume(),de=this.stack[this.stack.length-1];de.lang=te}function w(){const te=this.resume(),de=this.stack[this.stack.length-1];de.meta=te}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/(\r?\n|\r)$/g,"")}function _(te){const de=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=de,Oe.identifier=Tr(this.sliceSerialize(te)).toLowerCase()}function T(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function N(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function D(te){const de=this.stack[this.stack.length-1];if(!de.depth){const Oe=this.sliceSerialize(te).length;de.depth=Oe}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function R(te){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function P(te){const Oe=this.stack[this.stack.length-1].children;let He=Oe[Oe.length-1];(!He||He.type!=="text")&&(He=ve(),He.position={start:ra(te.start),end:void 0},Oe.push(He)),this.stack.push(He)}function z(te){const de=this.stack.pop();de.value+=this.sliceSerialize(te),de.position.end=ra(te.end)}function V(te){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=de.children[de.children.length-1];Oe.position.end=ra(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(P.call(this,te),z.call(this,te))}function q(){this.data.atHardBreak=!0}function I(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function Y(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function Z(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function B(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function G(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function F(te){const de=this.sliceSerialize(te),Oe=this.stack[this.stack.length-2];Oe.label=KV(de),Oe.identifier=Tr(de).toLowerCase()}function K(){const te=this.stack[this.stack.length-1],de=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const He=te.children;Oe.children=He}else Oe.alt=de}function A(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function H(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function M(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function X(te){const de=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=de,Oe.identifier=Tr(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function re(te){this.data.characterReferenceType=te.type}function ue(te){const de=this.sliceSerialize(te),Oe=this.data.characterReferenceType;let He;Oe?(He=aD(de,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=Qy(de);const Ye=this.stack[this.stack.length-1];Ye.value+=He}function ae(te){const de=this.stack.pop();de.position.end=ra(te.end)}function oe(te){z.call(this,te);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(te)}function Ce(te){z.call(this,te);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(te)}function he(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function Pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ae(){return{type:"emphasis",children:[]}}function xe(){return{type:"heading",depth:0,children:[]}}function ee(){return{type:"break"}}function ce(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function ge(){return{type:"link",title:null,url:"",children:[]}}function Se(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function ie(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function $e(){return{type:"paragraph",children:[]}}function Ge(){return{type:"strong",children:[]}}function ve(){return{type:"text",value:""}}function Ne(){return{type:"thematicBreak"}}}function ra(e){return{line:e.line,column:e.column,offset:e.offset}}function gD(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?gD(e,r):eq(e,r)}}function eq(e,t){let n;for(n in t)if(mD.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function a_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Bl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Bl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Bl({start:t.start,end:t.end})+") is still open")}function tq(e){const t=this;t.parser=n;function n(r){return QV(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function nq(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function rq(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function iq(e,t){const n=t.value?t.value+`
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function aq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oq(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ds(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,u+=1,e.footnoteCounts.set(r,u);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function lq(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function vD(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function cq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return vD(e,t);const i={src:Ds(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function fq(e,t){const n={src:Ds(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function dq(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function hq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return vD(e,t);const i={href:Ds(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function pq(e,t){const n={href:Ds(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mq(e,t,n){const r=e.all(t),i=n?gq(n):yD(t),o={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(i||u!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
`}),p.type==="element"&&p.tagName==="p"&&!i?l.push(...p.children):l.push(p)}const f=r[r.length-1];f&&(i||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
`});const d={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,d),e.applyData(t,d)}function gq(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=yD(n[r])}return t}function yD(e){const t=e.spread;return t??e.children.length>1}function vq(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function yq(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bq(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function xq(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wq(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=Yy(t.children[1]),f=K2(t.children[t.children.length-1]);u&&f&&(l.position={start:u,end:f}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Sq(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let f=-1;const d=[];for(;++f<u;){const m=t.children[f],v={},g=l?l[f]:void 0;g&&(v.align=g);let w={type:"element",tagName:o,properties:v,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),d.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function Eq(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const o_=9,s_=32;function _q(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(l_(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(l_(t.slice(i),i>0,!1)),o.join("")}function l_(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===o_||o===s_;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===o_||o===s_;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function kq(e,t){const n={type:"text",value:_q(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Cq(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Tq={blockquote:nq,break:rq,code:iq,delete:aq,emphasis:oq,footnoteReference:sq,heading:lq,html:uq,imageReference:cq,image:fq,inlineCode:dq,linkReference:hq,link:pq,listItem:mq,list:vq,paragraph:yq,root:bq,strong:xq,table:wq,tableCell:Eq,tableRow:Sq,text:kq,thematicBreak:Cq,toml:Zc,yaml:Zc,definition:Zc,footnoteDefinition:Zc};function Zc(){}const bD=-1,Nd=0,Hl=1,Bf=2,eb=3,tb=4,nb=5,rb=6,xD=7,wD=8,u_=typeof self=="object"?self:globalThis,Aq=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case Nd:case bD:return n(l,i);case Hl:{const u=n([],i);for(const f of l)u.push(r(f));return u}case Bf:{const u=n({},i);for(const[f,d]of l)u[r(f)]=r(d);return u}case eb:return n(new Date(l),i);case tb:{const{source:u,flags:f}=l;return n(new RegExp(u,f),i)}case nb:{const u=n(new Map,i);for(const[f,d]of l)u.set(r(f),r(d));return u}case rb:{const u=n(new Set,i);for(const f of l)u.add(r(f));return u}case xD:{const{name:u,message:f}=l;return n(new u_[u](f),i)}case wD:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new u_[o](l),i)};return r},c_=e=>Aq(new Map,e)(0),Ko="",{toString:Rq}={},{keys:Dq}=Object,Ml=e=>{const t=typeof e;if(t!=="object"||!e)return[Nd,t];const n=Rq.call(e).slice(8,-1);switch(n){case"Array":return[Hl,Ko];case"Object":return[Bf,Ko];case"Date":return[eb,Ko];case"RegExp":return[tb,Ko];case"Map":return[nb,Ko];case"Set":return[rb,Ko];case"DataView":return[Hl,n]}return n.includes("Array")?[Hl,n]:n.includes("Error")?[xD,n]:[Bf,n]},Qc=([e,t])=>e===Nd&&(t==="function"||t==="symbol"),Nq=(e,t,n,r)=>{const i=(l,u)=>{const f=r.push(l)-1;return n.set(u,f),f},o=l=>{if(n.has(l))return n.get(l);let[u,f]=Ml(l);switch(u){case Nd:{let p=l;switch(f){case"bigint":u=wD,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return i([bD],l)}return i([u,p],l)}case Hl:{if(f){let v=l;return f==="DataView"?v=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(l)),i([f,[...v]],l)}const p=[],m=i([u,p],l);for(const v of l)p.push(o(v));return m}case Bf:{if(f)switch(f){case"BigInt":return i([f,l.toString()],l);case"Boolean":case"Number":case"String":return i([f,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const p=[],m=i([u,p],l);for(const v of Dq(l))(e||!Qc(Ml(l[v])))&&p.push([o(v),o(l[v])]);return m}case eb:return i([u,l.toISOString()],l);case tb:{const{source:p,flags:m}=l;return i([u,{source:p,flags:m}],l)}case nb:{const p=[],m=i([u,p],l);for(const[v,g]of l)(e||!(Qc(Ml(v))||Qc(Ml(g))))&&p.push([o(v),o(g)]);return m}case rb:{const p=[],m=i([u,p],l);for(const v of l)(e||!Qc(Ml(v)))&&p.push(o(v));return m}}const{message:d}=l;return i([u,{name:f,message:d}],l)};return o},f_=(e,{json:t,lossy:n}={})=>{const r=[];return Nq(!(t||n),!!t,new Map,r)(e),r},$f=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?c_(f_(e,t)):structuredClone(e):(e,t)=>c_(f_(e,t));function Oq(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function jq(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Lq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Oq,r=e.options.footnoteBackLabel||jq,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const p=e.all(d),m=String(d.identifier).toUpperCase(),v=Ds(m.toLowerCase());let g=0;const w=[],x=e.footnoteCounts.get(m);for(;x!==void 0&&++g<=x;){w.length>0&&w.push({type:"text",value:" "});let _=typeof n=="string"?n:n(f,g);typeof _=="string"&&(_={type:"text",value:_}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const k=p[p.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const _=k.children[k.children.length-1];_&&_.type==="text"?_.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...w)}else p.push(...w);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(p,!0)};e.patch(d,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...$f(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
`}]}}const Od=function(e){if(e==null)return Fq;if(typeof e=="function")return jd(e);if(typeof e=="object")return Array.isArray(e)?zq(e):Mq(e);if(typeof e=="string")return Pq(e);throw new Error("Expected function, string, or object as test")};function zq(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Od(e[n]);return jd(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Mq(e){const t=e;return jd(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Pq(e){return jd(t);function t(n){return n&&n.type===e}}function jd(e){return t;function t(n,r,i){return!!(Iq(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Fq(){return!0}function Iq(e){return e!==null&&typeof e=="object"&&"type"in e}const SD=[],Gq=!0,Sv=!1,Uq="skip";function ED(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Od(i),l=r?-1:1;u(e,void 0,[])();function u(f,d,p){const m=f&&typeof f=="object"?f:{};if(typeof m.type=="string"){const g=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(f.type+(g?"<"+g+">":""))+")"})}return v;function v(){let g=SD,w,x,k;if((!t||o(f,d,p[p.length-1]||void 0))&&(g=Bq(n(f,p)),g[0]===Sv))return g;if("children"in f&&f.children){const C=f;if(C.children&&g[0]!==Uq)for(x=(r?C.children.length:-1)+l,k=p.concat(C);x>-1&&x<C.children.length;){const _=C.children[x];if(w=u(_,x,k)(),w[0]===Sv)return w;x=typeof w[1]=="number"?w[1]:x+l}}return g}}}function Bq(e){return Array.isArray(e)?e:typeof e=="number"?[Gq,e]:e==null?SD:[e]}function ib(e,t,n,r){let i,o,l;typeof t=="function"?(o=void 0,l=t,i=n):(o=t,l=n,i=r),ED(e,o,u,i);function u(f,d){const p=d[d.length-1],m=p?p.children.indexOf(f):void 0;return l(f,m,p)}}const Ev={}.hasOwnProperty,$q={};function Hq(e,t){const n=t||$q,r=new Map,i=new Map,o=new Map,l={...Tq,...n.handlers},u={all:d,applyData:qq,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:f,options:n,patch:Vq,wrap:Wq};return ib(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,v=String(p.identifier).toUpperCase();m.has(v)||m.set(v,p)}}),u;function f(p,m){const v=p.type,g=u.handlers[v];if(Ev.call(u.handlers,v)&&g)return g(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(v)){if("children"in p){const{children:x,...k}=p,C=$f(k);return C.children=u.all(p),C}return $f(p)}return(u.options.unknownHandler||Yq)(u,p,m)}function d(p){const m=[];if("children"in p){const v=p.children;let g=-1;for(;++g<v.length;){const w=u.one(v[g],p);if(w){if(g&&v[g-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=d_(w.value)),!Array.isArray(w)&&w.type==="element")){const x=w.children[0];x&&x.type==="text"&&(x.value=d_(x.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function Vq(e,t){e.position&&(t.position=O8(e))}function qq(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,$f(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Yq(e,t){const n=t.data||{},r="value"in t&&!(Ev.call(n,"hProperties")||Ev.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Wq(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function d_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function h_(e,t){const n=Hq(e,t),r=n.one(e,void 0),i=Lq(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
`},i),o}function Xq(e,t){return e&&"run"in e?async function(n,r){const i=h_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return h_(n,{file:r,...e||t})}}function p_(e){if(e)throw e}var sg,m_;function Kq(){if(m_)return sg;m_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var v;for(v in d);return typeof v>"u"||e.call(d,v)},l=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},u=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return sg=function f(){var d,p,m,v,g,w,x=arguments[0],k=1,C=arguments.length,_=!1;for(typeof x=="boolean"&&(_=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});k<C;++k)if(d=arguments[k],d!=null)for(p in d)m=u(x,p),v=u(d,p),x!==v&&(_&&v&&(o(v)||(g=i(v)))?(g?(g=!1,w=m&&i(m)?m:[]):w=m&&o(m)?m:{},l(x,{name:p,newValue:f(_,w,v)})):typeof v<"u"&&l(x,{name:p,newValue:v}));return x},sg}var Zq=Kq();const lg=fn(Zq);function _v(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Qq(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...i);function u(f,...d){const p=e[++o];let m=-1;if(f){l(f);return}for(;++m<i.length;)(d[m]===null||d[m]===void 0)&&(d[m]=i[m]);i=d,p?Jq(p,u)(...d):l(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Jq(e,t){let n;return r;function r(...l){const u=e.length>l.length;let f;u&&l.push(i);try{f=e.apply(this,l)}catch(d){const p=d;if(u&&n)throw p;return i(p)}u||(f&&f.then&&typeof f.then=="function"?f.then(o,i):f instanceof Error?i(f):o(f))}function i(l,...u){n||(n=!0,t(l,...u))}function o(l){i(null,l)}}const Gr={basename:eY,dirname:tY,extname:nY,join:rY,sep:"/"};function eY(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bu(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function tY(e){if(bu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function nY(e){bu(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function rY(...e){let t=-1,n;for(;++t<e.length;)bu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":iY(n)}function iY(e){bu(e);const t=e.codePointAt(0)===47;let n=aY(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function aY(e,t){let n="",r=0,i=-1,o=0,l=-1,u,f;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else u===46&&o>-1?o++:o=-1}return n}function bu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const oY={cwd:sY};function sY(){return"/"}function kv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function lY(e){if(typeof e=="string")e=new URL(e);else if(!kv(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return uY(e)}function uY(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ug=["history","path","basename","stem","extname","dirname"];class _D{constructor(t){let n;t?kv(t)?n={path:t}:typeof t=="string"||cY(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":oY.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ug.length;){const o=ug[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)ug.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Gr.basename(this.path):void 0}set basename(t){fg(t,"basename"),cg(t,"basename"),this.path=Gr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Gr.dirname(this.path):void 0}set dirname(t){g_(this.basename,"dirname"),this.path=Gr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Gr.extname(this.path):void 0}set extname(t){if(cg(t,"extname"),g_(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Gr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){kv(t)&&(t=lY(t)),fg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Gr.basename(this.path,this.extname):void 0}set stem(t){fg(t,"stem"),cg(t,"stem"),this.path=Gr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new wn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function cg(e,t){if(e&&e.includes(Gr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Gr.sep+"`")}function fg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function g_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function cY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fY=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},dY={}.hasOwnProperty;class ab extends fY{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Qq()}copy(){const t=new ab;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(lg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(pg("data",this.frozen),this.namespace[t]=n,this):dY.call(this.namespace,t)&&this.namespace[t]||void 0:t?(pg("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Jc(t),r=this.parser||this.Parser;return dg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),dg("process",this.parser||this.Parser),hg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,l){const u=Jc(t),f=r.parse(u);r.run(f,u,function(p,m,v){if(p||!m||!v)return d(p);const g=m,w=r.stringify(g,v);mY(w)?v.value=w:v.result=w,d(p,v)});function d(p,m){p||!m?l(p):o?o(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),dg("processSync",this.parser||this.Parser),hg("processSync",this.compiler||this.Compiler),this.process(t,i),y_("processSync","process",n),r;function i(o,l){n=!0,p_(o),r=l}}run(t,n,r){v_(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,u){const f=Jc(n);i.run(t,f,d);function d(p,m,v){const g=m||t;p?u(p):l?l(g):r(void 0,g,v)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),y_("runSync","run",r),i;function o(l,u){p_(l),i=u,r=!0}}stringify(t,n){this.freeze();const r=Jc(n),i=this.compiler||this.Compiler;return hg("stringify",i),v_(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(pg("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...m]=d;f(p,m)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(d.plugins),d.settings&&(i.settings=lg(!0,i.settings,d.settings))}function u(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const m=d[p];o(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,p){let m=-1,v=-1;for(;++m<r.length;)if(r[m][0]===d){v=m;break}if(v===-1)r.push([d,...p]);else if(p.length>0){let[g,...w]=p;const x=r[v][1];_v(x)&&_v(g)&&(g=lg(!0,x,g)),r[v]=[d,g,...w]}}}}const hY=new ab().freeze();function dg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function v_(e){if(!_v(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function y_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jc(e){return pY(e)?e:new _D(e)}function pY(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function mY(e){return typeof e=="string"||gY(e)}function gY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",b_=[],x_={allowDangerousHtml:!0},yY=/^(https?|ircs?|mailto|xmpp)$/i,bY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function xY(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,l=e.disallowedElements,u=e.rehypePlugins||b_,f=e.remarkPlugins||b_,d=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...x_}:x_,p=e.skipHtml,m=e.unwrapDisallowed,v=e.urlTransform||wY,g=hY().use(tq).use(f).use(Xq,d).use(u),w=new _D;typeof r=="string"&&(w.value=r);for(const _ of bY)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+vY+_.id,void 0);const x=g.parse(w);let k=g.runSync(x,w);return i&&(k={type:"element",tagName:"div",properties:{className:i},children:k.type==="root"?k.children:[k]}),ib(k,C),J2(k,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function C(_,T,N){if(_.type==="raw"&&N&&typeof T=="number")return p?N.children.splice(T,1):N.children[T]={type:"text",value:_.value},T;if(_.type==="element"){let D;for(D in ig)if(Object.hasOwn(ig,D)&&Object.hasOwn(_.properties,D)){const L=_.properties[D],R=ig[D];(R===null||R.includes(_.tagName))&&(_.properties[D]=v(String(L||""),D,_))}}if(_.type==="element"){let D=t?!t.includes(_.tagName):l?l.includes(_.tagName):!1;if(!D&&n&&typeof T=="number"&&(D=!n(_,T,N)),D&&N&&typeof T=="number")return m&&_.children?N.children.splice(T,1,..._.children):N.children.splice(T,1),T}}}function wY(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||yY.test(e.slice(0,t))?e:""}function w_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function SY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function EY(e,t,n){const i=Od((n||{}).ignore||[]),o=_Y(t);let l=-1;for(;++l<o.length;)ED(e,"text",u);function u(d,p){let m=-1,v;for(;++m<p.length;){const g=p[m],w=v?v.children:void 0;if(i(g,w?w.indexOf(g):void 0,v))return;v=g}if(v)return f(d,p)}function f(d,p){const m=p[p.length-1],v=o[l][0],g=o[l][1];let w=0;const k=m.children.indexOf(d);let C=!1,_=[];v.lastIndex=0;let T=v.exec(d.value);for(;T;){const N=T.index,D={index:T.index,input:T.input,stack:[...p,d]};let L=g(...T,D);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?v.lastIndex=N+1:(w!==N&&_.push({type:"text",value:d.value.slice(w,N)}),Array.isArray(L)?_.push(...L):L&&_.push(L),w=N+T[0].length,C=!0),!v.global)break;T=v.exec(d.value)}return C?(w<d.value.length&&_.push({type:"text",value:d.value.slice(w)}),m.children.splice(k,1,..._)):_=[d],k+_.length}}function _Y(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([kY(i[0]),CY(i[1])])}return t}function kY(e){return typeof e=="string"?new RegExp(SY(e),"g"):e}function CY(e){return typeof e=="function"?e:function(){return e}}const mg="phrasing",gg=["autolink","link","image","label"];function TY(){return{transforms:[LY],enter:{literalAutolink:RY,literalAutolinkEmail:vg,literalAutolinkHttp:vg,literalAutolinkWww:vg},exit:{literalAutolink:jY,literalAutolinkEmail:OY,literalAutolinkHttp:DY,literalAutolinkWww:NY}}}function AY(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mg,notInConstruct:gg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mg,notInConstruct:gg},{character:":",before:"[ps]",after:"\\/",inConstruct:mg,notInConstruct:gg}]}}function RY(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vg(e){this.config.enter.autolinkProtocol.call(this,e)}function DY(e){this.config.exit.autolinkProtocol.call(this,e)}function NY(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function OY(e){this.config.exit.autolinkEmail.call(this,e)}function jY(e){this.exit(e)}function LY(e){EY(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,zY],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),MY]],{ignore:["link","linkReference"]})}function zY(e,t,n,r,i){let o="";if(!kD(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!PY(n)))return!1;const l=FY(n+r);if(!l[0])return!1;const u={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function MY(e,t,n,r){return!kD(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function PY(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function FY(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=w_(e,"(");let o=w_(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function kD(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||to(n)||Rd(n))&&(!t||n!==47)}CD.peek=YY;function IY(){this.buffer()}function GY(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function UY(){this.buffer()}function BY(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function $Y(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function HY(e){this.exit(e)}function VY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qY(e){this.exit(e)}function YY(){return"["}function CD(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),u(),l(),o+=i.move("]"),o}function WY(){return{enter:{gfmFootnoteCallString:IY,gfmFootnoteCall:GY,gfmFootnoteDefinitionLabelString:UY,gfmFootnoteDefinition:BY},exit:{gfmFootnoteCallString:$Y,gfmFootnoteCall:HY,gfmFootnoteDefinitionLabelString:VY,gfmFootnoteDefinition:qY}}}function XY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:CD},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,l){const u=o.createTracker(l);let f=u.move("[^");const d=o.enter("footnoteDefinition"),p=o.enter("label");return f+=u.move(o.safe(o.associationId(r),{before:f,after:"]"})),p(),f+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),f+=u.move((t?`
`:" ")+o.indentLines(o.containerFlow(r,u.current()),t?TD:KY))),d(),f}}function KY(e,t,n){return t===0?e:TD(e,t,n)}function TD(e,t,n){return(n?"":" ")+e}const ZY=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];AD.peek=nW;function QY(){return{canContainEols:["delete"],enter:{strikethrough:eW},exit:{strikethrough:tW}}}function JY(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ZY}],handlers:{delete:AD}}}function eW(e){this.enter({type:"delete",children:[]},e)}function tW(e){this.exit(e)}function AD(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function nW(){return"~"}function rW(e){return e.length}function iW(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||rW,o=[],l=[],u=[],f=[];let d=0,p=-1;for(;++p<e.length;){const x=[],k=[];let C=-1;for(e[p].length>d&&(d=e[p].length);++C<e[p].length;){const _=aW(e[p][C]);if(n.alignDelimiters!==!1){const T=i(_);k[C]=T,(f[C]===void 0||T>f[C])&&(f[C]=T)}x.push(_)}l[p]=x,u[p]=k}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<d;)o[m]=S_(r[m]);else{const x=S_(r);for(;++m<d;)o[m]=x}m=-1;const v=[],g=[];for(;++m<d;){const x=o[m];let k="",C="";x===99?(k=":",C=":"):x===108?k=":":x===114&&(C=":");let _=n.alignDelimiters===!1?1:Math.max(1,f[m]-k.length-C.length);const T=k+"-".repeat(_)+C;n.alignDelimiters!==!1&&(_=k.length+_+C.length,_>f[m]&&(f[m]=_),g[m]=_),v[m]=T}l.splice(1,0,v),u.splice(1,0,g),p=-1;const w=[];for(;++p<l.length;){const x=l[p],k=u[p];m=-1;const C=[];for(;++m<d;){const _=x[m]||"";let T="",N="";if(n.alignDelimiters!==!1){const D=f[m]-(k[m]||0),L=o[m];L===114?T=" ".repeat(D):L===99?D%2?(T=" ".repeat(D/2+.5),N=" ".repeat(D/2-.5)):(T=" ".repeat(D/2),N=T):N=" ".repeat(D)}n.delimiterStart!==!1&&!m&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&_==="")&&(n.delimiterStart!==!1||m)&&C.push(" "),n.alignDelimiters!==!1&&C.push(T),C.push(_),n.alignDelimiters!==!1&&C.push(N),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&C.push("|")}w.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return w.join(`
`)}function aW(e){return e==null?"":String(e)}function S_(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function oW(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),sW);return i(),l}function sW(e,t,n){return">"+(n?"":" ")+e}function lW(e,t){return E_(e,t.inConstruct,!0)&&!E_(e,t.notInConstruct,!1)}function E_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function __(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&lW(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function RD(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+t.length,r=n.indexOf(t,i);return l}function uW(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function cW(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function fW(e,t,n,r){const i=cW(n),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(uW(e,n)){const m=n.enter("codeIndented"),v=n.indentLines(o,dW);return m(),v}const u=n.createTracker(r),f=i.repeat(Math.max(RD(o,i)+1,3)),d=n.enter("codeFenced");let p=u.move(f);if(e.lang){const m=n.enter(`codeFencedLang${l}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:`
`,encode:["`"],...u.current()})),m()}return p+=u.move(`
`),o&&(p+=u.move(o+`
`)),p+=u.move(f),d(),p}function dW(e,t,n){return(n?"":" ")+e}function ob(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function hW(e,t,n,r){const i=ob(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
`,...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),l(),d}function pW(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function nu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Hf(e,t,n){const r=ps(e),i=ps(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}DD.peek=mW;function DD(e,t,n,r){const i=pW(n),o=n.enter("emphasis"),l=n.createTracker(r),u=l.move(i);let f=l.move(n.containerPhrasing(e,{after:i,before:u,...l.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=l.move(i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function mW(e,t,n){return n.options.emphasis||"*"}function gW(e,t){let n=!1;return ib(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Sv}),!!((!e.depth||e.depth<3)&&Zy(e)&&(t.options.setext||n))}function vW(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(gW(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:`
`,after:`
`});return m(),p(),v+`
`+(i===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
`))+1))}const l="#".repeat(i),u=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
`,...o.current()});return/^[\t ]/.test(d)&&(d=nu(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),u(),d}ND.peek=yW;function ND(e){return e.value||""}function yW(){return"<"}OD.peek=bW;function OD(e,t,n,r){const i=ob(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),d+=f.move(")"),l(),d}function bW(){return"!"}jD.peek=xW;function jD(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let f=u.move("![");const d=n.safe(e.alt,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return l(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function xW(){return"!"}LD.peek=wW;function LD(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],u=n.compilePattern(l);let f;if(l.atBreak)for(;f=u.exec(r);){let d=f.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(f.index+1)}}return i+r+i}function wW(){return"`"}function zD(e,t){const n=Zy(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}MD.peek=SW;function MD(e,t,n,r){const i=ob(n),o=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,f;if(zD(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),u(),n.stack=p,m}u=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=l.move(" "+i),d+=l.move(n.safe(e.title,{before:d,after:i,...l.current()})),d+=l.move(i),f()),d+=l.move(")"),u(),d}function SW(e,t,n){return zD(e,n)?"<":"["}PD.peek=EW;function PD(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(r);let f=u.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return l(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function EW(){return"["}function sb(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function _W(e){const t=sb(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function kW(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function FD(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function CW(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?kW(n):sb(n);const u=e.ordered?l==="."?")":".":_W(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),FD(n)===l&&p){let m=-1;for(;++m<e.children.length;){const v=e.children[m];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=u),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,i(),d}function TW(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function AW(e,t,n,r){const i=TW(n);let o=n.bulletCurrent||sb(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(l-o.length)),u.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),p);return f(),d;function p(m,v,g){return v?(g?"":" ".repeat(l))+m:(g?o:o+" ".repeat(l-o.length))+m}}function RW(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),i(),l}const DW=Od(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function NW(e,t,n,r){return(e.children.some(function(l){return DW(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function OW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ID.peek=jW;function ID(e,t,n,r){const i=OW(n),o=n.enter("strong"),l=n.createTracker(r),u=l.move(i+i);let f=l.move(n.containerPhrasing(e,{after:i,before:u,...l.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=l.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function jW(e,t,n){return n.options.strong||"*"}function LW(e,t,n,r){return n.safe(e.value,r)}function zW(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function MW(e,t,n){const r=(FD(n)+(n.options.ruleSpaces?" ":"")).repeat(zW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const GD={blockquote:oW,break:__,code:fW,definition:hW,emphasis:DD,hardBreak:__,heading:vW,html:ND,image:OD,imageReference:jD,inlineCode:LD,link:MD,linkReference:PD,list:CW,listItem:AW,paragraph:RW,root:NW,strong:ID,text:LW,thematicBreak:MW};function PW(){return{enter:{table:FW,tableData:k_,tableHeader:k_,tableRow:GW},exit:{codeText:UW,table:IW,tableData:yg,tableHeader:yg,tableRow:yg}}}function FW(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function IW(e){this.exit(e),this.data.inTable=void 0}function GW(e){this.enter({type:"tableRow",children:[]},e)}function yg(e){this.exit(e)}function k_(e){this.enter({type:"tableCell",children:[]},e)}function UW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,BW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function BW(e,t){return t==="|"?t:e}function $W(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:l,tableCell:f,tableRow:u}};function l(g,w,x,k){return d(p(g,x,k),g.align)}function u(g,w,x,k){const C=m(g,x,k),_=d([C]);return _.slice(0,_.indexOf(`
`))}function f(g,w,x,k){const C=x.enter("tableCell"),_=x.enter("phrasing"),T=x.containerPhrasing(g,{...k,before:o,after:o});return _(),C(),T}function d(g,w){return iW(g,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function p(g,w,x){const k=g.children;let C=-1;const _=[],T=w.enter("table");for(;++C<k.length;)_[C]=m(k[C],w,x);return T(),_}function m(g,w,x){const k=g.children;let C=-1;const _=[],T=w.enter("tableRow");for(;++C<k.length;)_[C]=f(k[C],g,w,x);return T(),_}function v(g,w,x){let k=GD.inlineCode(g,w,x);return x.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function HW(){return{exit:{taskListCheckValueChecked:C_,taskListCheckValueUnchecked:C_,paragraph:qW}}}function VW(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:YW}}}function C_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function qW(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,l;for(;++o<i.length;){const u=i[o];if(u.type==="paragraph"){l=u;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function YW(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);o&&u.move(l);let f=GD.listItem(e,t,n,{...r,...u.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(p){return p+l}}function WW(){return[TY(),WY(),QY(),PW(),HW()]}function XW(e){return{extensions:[AY(),XY(e),JY(),$W(e),VW()]}}const KW={tokenize:nX,partial:!0},UD={tokenize:rX,partial:!0},BD={tokenize:iX,partial:!0},$D={tokenize:aX,partial:!0},ZW={tokenize:oX,partial:!0},HD={name:"wwwAutolink",tokenize:eX,previous:qD},VD={name:"protocolAutolink",tokenize:tX,previous:YD},Ri={name:"emailAutolink",tokenize:JW,previous:WD},Kr={};function QW(){return{text:Kr}}let Ba=48;for(;Ba<123;)Kr[Ba]=Ri,Ba++,Ba===58?Ba=65:Ba===91&&(Ba=97);Kr[43]=Ri;Kr[45]=Ri;Kr[46]=Ri;Kr[95]=Ri;Kr[72]=[Ri,VD];Kr[104]=[Ri,VD];Kr[87]=[Ri,HD];Kr[119]=[Ri,HD];function JW(e,t,n){const r=this;let i,o;return l;function l(m){return!Cv(m)||!WD.call(r,r.previous)||lb(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(m))}function u(m){return Cv(m)?(e.consume(m),u):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check(ZW,p,d)(m):m===45||m===95||yn(m)?(o=!0,e.consume(m),f):p(m)}function d(m){return e.consume(m),i=!0,f}function p(m){return o&&i&&kn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function eX(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!qD.call(r,r.previous)||lb(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(KW,e.attempt(UD,e.attempt(BD,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function tX(e,t,n){const r=this;let i="",o=!1;return l;function l(m){return(m===72||m===104)&&YD.call(r,r.previous)&&!lb(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(m),e.consume(m),u):n(m)}function u(m){if(kn(m)&&i.length<5)return i+=String.fromCodePoint(m),e.consume(m),u;if(m===58){const v=i.toLowerCase();if(v==="http"||v==="https")return e.consume(m),f}return n(m)}function f(m){return m===47?(e.consume(m),o?d:(o=!0,f)):n(m)}function d(m){return m===null||Uf(m)||Tt(m)||to(m)||Rd(m)?n(m):e.attempt(UD,e.attempt(BD,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function nX(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function rX(e,t,n){let r,i,o;return l;function l(d){return d===46||d===95?e.check($D,f,u)(d):d===null||Tt(d)||to(d)||d!==45&&Rd(d)?f(d):(o=!0,e.consume(d),l)}function u(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),l}function f(d){return i||r||!o?n(d):t(d)}}function iX(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check($D,t,o)(l):l===null||Tt(l)||to(l)?t(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function aX(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),o):u===93?(e.consume(u),i):u===60||u===null||Tt(u)||to(u)?t(u):n(u)}function i(u){return u===null||u===40||u===91||Tt(u)||to(u)?t(u):r(u)}function o(u){return kn(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):kn(u)?(e.consume(u),l):n(u)}}function oX(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return yn(o)?n(o):t(o)}}function qD(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Tt(e)}function YD(e){return!kn(e)}function WD(e){return!(e===47||Cv(e))}function Cv(e){return e===43||e===45||e===46||e===95||yn(e)}function lb(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const sX={tokenize:mX,partial:!0};function lX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:dX,continuation:{tokenize:hX},exit:pX}},text:{91:{name:"gfmFootnoteCall",tokenize:fX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uX,resolveTo:cX}}}}function uX(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return u;function u(f){if(!l||!l._balanced)return n(f);const d=Tr(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function cX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function fX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!l||m===null||m===91||Tt(m))return n(m);if(m===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return i.includes(Tr(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Tt(m)||(l=!0),o++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function dX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,u;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(l>999||w===93&&!u||w===null||w===91||Tt(w))return n(w);if(w===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=Tr(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Tt(w)||(u=!0),l++,e.consume(w),w===92?m:p}function m(w){return w===91||w===92||w===93?(e.consume(w),l++,p):p(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),st(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function hX(e,t,n){return e.check(yu,t,e.attempt(sX,t,n))}function pX(e){e.exit("gfmFootnoteDefinition")}function mX(e,t,n){const r=this;return st(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function gX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,u){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let d=f;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[f][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[f][1].end)},m={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[f][1].start)},v=[["enter",p,u],["enter",l[d][1],u],["exit",l[d][1],u],["enter",m,u]],g=u.parser.constructs.insideSpan.null;g&&Xn(v,v.length,0,Dd(g,l.slice(d+1,f),u)),Xn(v,v.length,0,[["exit",m,u],["enter",l[f][1],u],["exit",l[f][1],u],["exit",p,u]]),Xn(l,d-1,f-d+3,v),f=d+v.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function o(l,u,f){const d=this.previous,p=this.events;let m=0;return v;function v(w){return d===126&&p[p.length-1][1].type!=="characterEscape"?f(w):(l.enter("strikethroughSequenceTemporary"),g(w))}function g(w){const x=ps(d);if(w===126)return m>1?f(w):(l.consume(w),m++,g);if(m<2&&!n)return f(w);const k=l.exit("strikethroughSequenceTemporary"),C=ps(w);return k._open=!C||C===2&&!!x,k._close=!x||x===2&&!!C,u(w)}}}class vX{constructor(){this.map=[]}add(t,n,r){yX(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function yX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function bX(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function xX(){return{flow:{null:{name:"table",tokenize:wX,resolveAll:SX}}}}function wX(e,t,n){const r=this;let i=0,o=0,l;return u;function u(z){let V=r.events.length-1;for(;V>-1;){const Y=r.events[V][1].type;if(Y==="lineEnding"||Y==="linePrefix")V--;else break}const q=V>-1?r.events[V][1].type:null,I=q==="tableHead"||q==="tableRow"?L:f;return I===L&&r.parser.lazy[r.now().line]?n(z):I(z)}function f(z){return e.enter("tableHead"),e.enter("tableRow"),d(z)}function d(z){return z===124||(l=!0,o+=1),p(z)}function p(z){return z===null?n(z):Be(z)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),g):n(z):ut(z)?st(e,p,"whitespace")(z):(o+=1,l&&(l=!1,i+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(z)))}function m(z){return z===null||z===124||Tt(z)?(e.exit("data"),p(z)):(e.consume(z),z===92?v:m)}function v(z){return z===92||z===124?(e.consume(z),m):m(z)}function g(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(z):(e.enter("tableDelimiterRow"),l=!1,ut(z)?st(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):w(z))}function w(z){return z===45||z===58?k(z):z===124?(l=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),x):D(z)}function x(z){return ut(z)?st(e,k,"whitespace")(z):k(z)}function k(z){return z===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),C):z===45?(o+=1,C(z)):z===null||Be(z)?N(z):D(z)}function C(z){return z===45?(e.enter("tableDelimiterFiller"),_(z)):D(z)}function _(z){return z===45?(e.consume(z),_):z===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(z))}function T(z){return ut(z)?st(e,N,"whitespace")(z):N(z)}function N(z){return z===124?w(z):z===null||Be(z)?!l||i!==o?D(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):D(z)}function D(z){return n(z)}function L(z){return e.enter("tableRow"),R(z)}function R(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),R):z===null||Be(z)?(e.exit("tableRow"),t(z)):ut(z)?st(e,R,"whitespace")(z):(e.enter("data"),U(z))}function U(z){return z===null||z===124||Tt(z)?(e.exit("data"),R(z)):(e.consume(z),z===92?P:U)}function P(z){return z===92||z===124?(e.consume(z),U):U(z)}}function SX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],u=!1,f=0,d,p,m;const v=new vX;for(;++n<e.length;){const g=e[n],w=g[1];g[0]==="enter"?w.type==="tableHead"?(u=!1,f!==0&&(T_(v,t,f,d,p),p=void 0,f=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(n,0,[["enter",d,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,m=void 0,o=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,p={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(n,0,[["enter",p,t]])),i=w.type==="tableDelimiterRow"?2:p?3:1):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],m=ef(v,t,o,i,void 0,m),o=[0,0,0,0]),l[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],m=ef(v,t,o,i,void 0,m)),o=l,l=[o[1],n,0,0])):w.type==="tableHead"?(u=!0,f=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(f=n,o[1]!==0?(l[0]=l[1],m=ef(v,t,o,i,n,m)):l[1]!==0&&(m=ef(v,t,l,i,n,m)),i=0):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&T_(v,t,f,d,p),v.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=bX(t.events,n))}return e}function ef(e,t,n,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(o.end=Object.assign({},es(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=es(t.events,n[1]);if(o={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=es(t.events,n[2]),p=es(t.events,n[3]),m={type:u,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const v=t.events[n[2]],g=t.events[n[3]];if(v[1].end=Object.assign({},g[1].end),v[1].type="chunkText",v[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,x=n[3]-n[2]-1;e.add(w,x,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return i!==void 0&&(o.end=Object.assign({},es(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function T_(e,t,n,r,i){const o=[],l=es(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function es(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const EX={name:"tasklistCheck",tokenize:kX};function _X(){return{text:{91:EX}}}function kX(e,t,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Tt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(f)}function u(f){return Be(f)?t(f):ut(f)?e.check({tokenize:CX},t,n)(f):n(f)}}function CX(e,t,n){return st(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function TX(e){return iD([QW(),lX(),gX(e),xX(),_X()])}const AX={};function RX(e){const t=this,n=e||AX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(TX(n)),o.push(WW()),l.push(XW(n))}function DX(e){const t=this;t.compiler=n;function n(r,i){return J2(r,{filePath:i.path,...e})}}function NX(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:u,mathText:l,mathTextData:u}};function e(f){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},f)}function t(){this.buffer()}function n(){const f=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=f}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(f){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d;const m=p.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function o(f){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},f),this.buffer()}function l(f){const d=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d,p.data.hChildren.push({type:"text",value:d})}function u(f){this.config.enter.data.call(this,f),this.config.exit.data.call(this,f)}}function OX(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,l,u,f){const d=o.value||"",p=u.createTracker(f),m="$".repeat(Math.max(RD(d,"$")+1,2)),v=u.enter("mathFlow");let g=p.move(m);if(o.meta){const w=u.enter("mathFlowMeta");g+=p.move(u.safe(o.meta,{after:`
`,before:g,encode:["$"],...p.current()})),w()}return g+=p.move(`
`),d&&(g+=p.move(d+`
`)),g+=p.move(m),v(),g}function r(o,l,u){let f=o.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(f);)d++;const p="$".repeat(d);/[^ \r\n]/.test(f)&&(/^[ \r\n]/.test(f)&&/[ \r\n]$/.test(f)||/^\$|\$$/.test(f))&&(f=" "+f+" ");let m=-1;for(;++m<u.unsafe.length;){const v=u.unsafe[m];if(!v.atBreak)continue;const g=u.compilePattern(v);let w;for(;w=g.exec(f);){let x=w.index;f.codePointAt(x)===10&&f.codePointAt(x-1)===13&&x--,f=f.slice(0,x)+" "+f.slice(w.index+1)}}return p+f+p}function i(){return"$"}}const jX={tokenize:LX,concrete:!0,name:"mathFlow"},A_={tokenize:zX,partial:!0};function LX(e,t,n){const r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let l=0;return u;function u(_){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),f(_)}function f(_){return _===36?(e.consume(_),l++,f):l<2?n(_):(e.exit("mathFlowFenceSequence"),st(e,d,"whitespace")(_))}function d(_){return _===null||Be(_)?m(_):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===null||Be(_)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),m(_)):_===36?n(_):(e.consume(_),p)}function m(_){return e.exit("mathFlowFence"),r.interrupt?t(_):e.attempt(A_,v,k)(_)}function v(_){return e.attempt({tokenize:C,partial:!0},k,g)(_)}function g(_){return(o?st(e,w,"linePrefix",o+1):w)(_)}function w(_){return _===null?k(_):Be(_)?e.attempt(A_,v,k)(_):(e.enter("mathFlowValue"),x(_))}function x(_){return _===null||Be(_)?(e.exit("mathFlowValue"),w(_)):(e.consume(_),x)}function k(_){return e.exit("mathFlow"),t(_)}function C(_,T,N){let D=0;return st(_,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function L(P){return _.enter("mathFlowFence"),_.enter("mathFlowFenceSequence"),R(P)}function R(P){return P===36?(D++,_.consume(P),R):D<l?N(P):(_.exit("mathFlowFenceSequence"),st(_,U,"whitespace")(P))}function U(P){return P===null||Be(P)?(_.exit("mathFlowFence"),T(P)):N(P)}}}function zX(e,t,n){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function MX(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:PX,previous:FX,name:"mathText"};function r(i,o,l){let u=0,f,d;return p;function p(x){return i.enter("mathText"),i.enter("mathTextSequence"),m(x)}function m(x){return x===36?(i.consume(x),u++,m):u<2&&!n?l(x):(i.exit("mathTextSequence"),v(x))}function v(x){return x===null?l(x):x===36?(d=i.enter("mathTextSequence"),f=0,w(x)):x===32?(i.enter("space"),i.consume(x),i.exit("space"),v):Be(x)?(i.enter("lineEnding"),i.consume(x),i.exit("lineEnding"),v):(i.enter("mathTextData"),g(x))}function g(x){return x===null||x===32||x===36||Be(x)?(i.exit("mathTextData"),v(x)):(i.consume(x),g)}function w(x){return x===36?(i.consume(x),f++,w):f===u?(i.exit("mathTextSequence"),i.exit("mathText"),o(x)):(d.type="mathTextData",g(x))}}}function PX(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="mathTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function FX(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function IX(e){return{flow:{36:jX},text:{36:MX(e)}}}const GX={};function UX(e){const t=this,n=e||GX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(IX(n)),o.push(NX()),l.push(OX(n))}const BX=({message:e})=>S.jsx(xY,{className:"prose lg:prose-xs dark:prose-invert max-w-none text-base",remarkPlugins:[RX,UX],rehypePlugins:[DX],skipHtml:!1,children:e.content});function $X(){const[e,t]=E.useState(()=>Qe.getState().retrievalHistory||[]),[n,r]=E.useState(""),[i,o]=E.useState(!1),l=E.useRef(null),u=E.useCallback(()=>{var m;(m=l.current)==null||m.scrollIntoView({behavior:"smooth"})},[]),f=E.useCallback(async m=>{if(m.preventDefault(),!n.trim()||i)return;const v={content:n,role:"user"},g={content:"",role:"assistant"},w=[...e];t([...w,v,g]),r(""),o(!0);const x=(_,T)=>{g.content+=_,t(N=>{const D=[...N],L=D[D.length-1];return L.role==="assistant"&&(L.content=g.content,L.isError=T),D})},k=Qe.getState(),C={...k.querySettings,query:v.content,conversation_history:w.filter(_=>_.isError!==!0).map(_=>({role:_.role,content:_.content}))};try{if(k.querySettings.stream){let _="";await uM(C,x,T=>{_+=T}),_&&(g.content&&(_=g.content+`
`+_),x(_,!0))}else{const _=await lM(C);x(_.response)}}catch(_){x(`Error: Failed to get response
${Cr(_)}`,!0)}finally{o(!1),Qe.getState().setRetrievalHistory([...w,v,g])}},[n,i,e,t]),d=My(e,100);E.useEffect(()=>u(),[d,u]);const p=E.useCallback(()=>{t([]),Qe.getState().setRetrievalHistory([])},[t]);return S.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[S.jsxs("div",{className:"flex grow flex-col gap-4",children:[S.jsx("div",{className:"relative grow",children:S.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?S.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((m,v)=>S.jsx("div",{className:`flex ${m.role==="user"?"justify-end":"justify-start"}`,children:S.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${m.role==="user"?"bg-primary text-primary-foreground":m.isError?"bg-red-100 text-red-600 dark:bg-red-950 dark:text-red-400":"bg-muted"}`,children:[S.jsx("pre",{className:"break-words whitespace-pre-wrap",children:S.jsx(BX,{message:m})}),m.content.length===0&&S.jsx(MM,{className:"animate-spin duration-2000"})]})},v)),S.jsx("div",{ref:l,className:"pb-1"})]})})}),S.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[S.jsxs(Ot,{type:"button",variant:"outline",onClick:p,disabled:i,size:"sm",children:[S.jsx(Sk,{}),"Clear"]}),S.jsx(Za,{className:"flex-1",value:n,onChange:m=>r(m.target.value),placeholder:"Type your query...",disabled:i}),S.jsxs(Ot,{type:"submit",variant:"default",disabled:i,size:"sm",children:[S.jsx(QM,{}),"Send"]})]})]}),S.jsx(u8,{})]})}function HX(){return S.jsx("iframe",{src:U_+"/docs",className:"size-full"})}function VX(){const e=Mn.use.message(),t=Qe.use.enableHealthCheck(),[n]=E.useState(()=>Qe.getState().currentTab),[r,i]=E.useState(!1);E.useEffect(()=>{if(!t)return;Mn.getState().check();const l=setInterval(async()=>{await Mn.getState().check()},wL*1e3);return()=>clearInterval(l)},[t]);const o=E.useCallback(l=>Qe.getState().setCurrentTab(l),[]);return E.useEffect(()=>{if(e&&(e.includes(yk)||e.includes(bk))){i(!0);return}i(!1)},[e,i]),S.jsx(kL,{children:S.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[S.jsxs(T3,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:o,children:[S.jsx(R3,{}),S.jsxs("div",{className:"relative grow",children:[S.jsx(Pl,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(c9,{})}),S.jsx(Pl,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(L$,{})}),S.jsx(Pl,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx($X,{})}),S.jsx(Pl,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(HX,{})})]})]}),t&&S.jsx(u3,{}),e!==null&&!r&&S.jsx(fP,{}),r&&S.jsx(XI,{}),S.jsx(WI,{})]})})}yj.createRoot(document.getElementById("root")).render(S.jsx(E.StrictMode,{children:S.jsx(VX,{})}));