@langgraph-js/ui 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,214 @@
1
+ var mT=Object.defineProperty;var pT=(e,t,n)=>t in e?mT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var vt=(e,t,n)=>pT(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}})();function yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vd={exports:{}},us={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var bv;function gT(){if(bv)return us;bv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,l,s){var o=null;if(s!==void 0&&(o=""+s),l.key!==void 0&&(o=""+l.key),"key"in l){s={};for(var c in l)c!=="key"&&(s[c]=l[c])}else s=l;return l=s.ref,{$$typeof:e,type:i,key:o,ref:l!==void 0?l:null,props:s}}return us.Fragment=t,us.jsx=n,us.jsxs=n,us}var _v;function yT(){return _v||(_v=1,Vd.exports=gT()),Vd.exports}var I=yT(),$d={exports:{}},os={},Zd={exports:{}},Yd={};/**
10
+ * @license React
11
+ * scheduler.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var wv;function vT(){return wv||(wv=1,function(e){function t(j,P){var K=j.length;j.push(P);e:for(;0<K;){var X=K-1>>>1,w=j[X];if(0<l(w,P))j[X]=P,j[K]=w,K=X;else break e}}function n(j){return j.length===0?null:j[0]}function i(j){if(j.length===0)return null;var P=j[0],K=j.pop();if(K!==P){j[0]=K;e:for(var X=0,w=j.length,Z=w>>>1;X<Z;){var te=2*(X+1)-1,C=j[te],Y=te+1,Q=j[Y];if(0>l(C,K))Y<w&&0>l(Q,C)?(j[X]=Q,j[Y]=K,X=Y):(j[X]=C,j[te]=K,X=te);else if(Y<w&&0>l(Q,K))j[X]=Q,j[Y]=K,X=Y;else break e}}return P}function l(j,P){var K=j.sortIndex-P.sortIndex;return K!==0?K:j.id-P.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],h=[],m=1,p=null,y=3,v=!1,b=!1,_=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function O(j){for(var P=n(h);P!==null;){if(P.callback===null)i(h);else if(P.startTime<=j)i(h),P.sortIndex=P.expirationTime,t(d,P);else break;P=n(h)}}function D(j){if(_=!1,O(j),!b)if(n(d)!==null)b=!0,M||(M=!0,H());else{var P=n(h);P!==null&&$(D,P.startTime-j)}}var M=!1,U=-1,L=5,q=-1;function N(){return S?!0:!(e.unstable_now()-q<L)}function B(){if(S=!1,M){var j=e.unstable_now();q=j;var P=!0;try{e:{b=!1,_&&(_=!1,A(U),U=-1),v=!0;var K=y;try{t:{for(O(j),p=n(d);p!==null&&!(p.expirationTime>j&&N());){var X=p.callback;if(typeof X=="function"){p.callback=null,y=p.priorityLevel;var w=X(p.expirationTime<=j);if(j=e.unstable_now(),typeof w=="function"){p.callback=w,O(j),P=!0;break t}p===n(d)&&i(d),O(j)}else i(d);p=n(d)}if(p!==null)P=!0;else{var Z=n(h);Z!==null&&$(D,Z.startTime-j),P=!1}}break e}finally{p=null,y=K,v=!1}P=void 0}}finally{P?H():M=!1}}}var H;if(typeof E=="function")H=function(){E(B)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,R=F.port2;F.port1.onmessage=B,H=function(){R.postMessage(null)}}else H=function(){k(B,0)};function $(j,P){U=k(function(){j(e.unstable_now())},P)}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(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(j){switch(y){case 1:case 2:case 3:var P=3;break;default:P=y}var K=y;y=P;try{return j()}finally{y=K}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(j,P){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var K=y;y=j;try{return P()}finally{y=K}},e.unstable_scheduleCallback=function(j,P,K){var X=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?X+K:X):K=X,j){case 1:var w=-1;break;case 2:w=250;break;case 5:w=1073741823;break;case 4:w=1e4;break;default:w=5e3}return w=K+w,j={id:m++,callback:P,priorityLevel:j,startTime:K,expirationTime:w,sortIndex:-1},K>X?(j.sortIndex=K,t(h,j),n(d)===null&&j===n(h)&&(_?(A(U),U=-1):_=!0,$(D,K-X))):(j.sortIndex=w,t(d,j),b||v||(b=!0,M||(M=!0,H()))),j},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(j){var P=y;return function(){var K=y;y=P;try{return j.apply(this,arguments)}finally{y=K}}}}(Yd)),Yd}var Sv;function xT(){return Sv||(Sv=1,Zd.exports=vT()),Zd.exports}var Fd={exports:{}},Le={};/**
18
+ * @license React
19
+ * react.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Ev;function bT(){if(Ev)return Le;Ev=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function y(w){return w===null||typeof w!="object"?null:(w=p&&w[p]||w["@@iterator"],typeof w=="function"?w:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,_={};function S(w,Z,te){this.props=w,this.context=Z,this.refs=_,this.updater=te||v}S.prototype.isReactComponent={},S.prototype.setState=function(w,Z){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,Z,"setState")},S.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function k(){}k.prototype=S.prototype;function A(w,Z,te){this.props=w,this.context=Z,this.refs=_,this.updater=te||v}var E=A.prototype=new k;E.constructor=A,b(E,S.prototype),E.isPureReactComponent=!0;var O=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},M=Object.prototype.hasOwnProperty;function U(w,Z,te,C,Y,Q){return te=Q.ref,{$$typeof:e,type:w,key:Z,ref:te!==void 0?te:null,props:Q}}function L(w,Z){return U(w.type,Z,void 0,void 0,void 0,w.props)}function q(w){return typeof w=="object"&&w!==null&&w.$$typeof===e}function N(w){var Z={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(te){return Z[te]})}var B=/\/+/g;function H(w,Z){return typeof w=="object"&&w!==null&&w.key!=null?N(""+w.key):Z.toString(36)}function F(){}function R(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(F,F):(w.status="pending",w.then(function(Z){w.status==="pending"&&(w.status="fulfilled",w.value=Z)},function(Z){w.status==="pending"&&(w.status="rejected",w.reason=Z)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function $(w,Z,te,C,Y){var Q=typeof w;(Q==="undefined"||Q==="boolean")&&(w=null);var W=!1;if(w===null)W=!0;else switch(Q){case"bigint":case"string":case"number":W=!0;break;case"object":switch(w.$$typeof){case e:case t:W=!0;break;case m:return W=w._init,$(W(w._payload),Z,te,C,Y)}}if(W)return Y=Y(w),W=C===""?"."+H(w,0):C,O(Y)?(te="",W!=null&&(te=W.replace(B,"$&/")+"/"),$(Y,Z,te,"",function(ge){return ge})):Y!=null&&(q(Y)&&(Y=L(Y,te+(Y.key==null||w&&w.key===Y.key?"":(""+Y.key).replace(B,"$&/")+"/")+W)),Z.push(Y)),1;W=0;var ue=C===""?".":C+":";if(O(w))for(var ce=0;ce<w.length;ce++)C=w[ce],Q=ue+H(C,ce),W+=$(C,Z,te,Q,Y);else if(ce=y(w),typeof ce=="function")for(w=ce.call(w),ce=0;!(C=w.next()).done;)C=C.value,Q=ue+H(C,ce++),W+=$(C,Z,te,Q,Y);else if(Q==="object"){if(typeof w.then=="function")return $(R(w),Z,te,C,Y);throw Z=String(w),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return W}function j(w,Z,te){if(w==null)return w;var C=[],Y=0;return $(w,C,"","",function(Q){return Z.call(te,Q,Y++)}),C}function P(w){if(w._status===-1){var Z=w._result;Z=Z(),Z.then(function(te){(w._status===0||w._status===-1)&&(w._status=1,w._result=te)},function(te){(w._status===0||w._status===-1)&&(w._status=2,w._result=te)}),w._status===-1&&(w._status=0,w._result=Z)}if(w._status===1)return w._result.default;throw w._result}var K=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)};function X(){}return Le.Children={map:j,forEach:function(w,Z,te){j(w,function(){Z.apply(this,arguments)},te)},count:function(w){var Z=0;return j(w,function(){Z++}),Z},toArray:function(w){return j(w,function(Z){return Z})||[]},only:function(w){if(!q(w))throw Error("React.Children.only expected to receive a single React element child.");return w}},Le.Component=S,Le.Fragment=n,Le.Profiler=l,Le.PureComponent=A,Le.StrictMode=i,Le.Suspense=d,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Le.__COMPILER_RUNTIME={__proto__:null,c:function(w){return D.H.useMemoCache(w)}},Le.cache=function(w){return function(){return w.apply(null,arguments)}},Le.cloneElement=function(w,Z,te){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var C=b({},w.props),Y=w.key,Q=void 0;if(Z!=null)for(W in Z.ref!==void 0&&(Q=void 0),Z.key!==void 0&&(Y=""+Z.key),Z)!M.call(Z,W)||W==="key"||W==="__self"||W==="__source"||W==="ref"&&Z.ref===void 0||(C[W]=Z[W]);var W=arguments.length-2;if(W===1)C.children=te;else if(1<W){for(var ue=Array(W),ce=0;ce<W;ce++)ue[ce]=arguments[ce+2];C.children=ue}return U(w.type,Y,void 0,void 0,Q,C)},Le.createContext=function(w){return w={$$typeof:o,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:s,_context:w},w},Le.createElement=function(w,Z,te){var C,Y={},Q=null;if(Z!=null)for(C in Z.key!==void 0&&(Q=""+Z.key),Z)M.call(Z,C)&&C!=="key"&&C!=="__self"&&C!=="__source"&&(Y[C]=Z[C]);var W=arguments.length-2;if(W===1)Y.children=te;else if(1<W){for(var ue=Array(W),ce=0;ce<W;ce++)ue[ce]=arguments[ce+2];Y.children=ue}if(w&&w.defaultProps)for(C in W=w.defaultProps,W)Y[C]===void 0&&(Y[C]=W[C]);return U(w,Q,void 0,void 0,null,Y)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(w){return{$$typeof:c,render:w}},Le.isValidElement=q,Le.lazy=function(w){return{$$typeof:m,_payload:{_status:-1,_result:w},_init:P}},Le.memo=function(w,Z){return{$$typeof:h,type:w,compare:Z===void 0?null:Z}},Le.startTransition=function(w){var Z=D.T,te={};D.T=te;try{var C=w(),Y=D.S;Y!==null&&Y(te,C),typeof C=="object"&&C!==null&&typeof C.then=="function"&&C.then(X,K)}catch(Q){K(Q)}finally{D.T=Z}},Le.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Le.use=function(w){return D.H.use(w)},Le.useActionState=function(w,Z,te){return D.H.useActionState(w,Z,te)},Le.useCallback=function(w,Z){return D.H.useCallback(w,Z)},Le.useContext=function(w){return D.H.useContext(w)},Le.useDebugValue=function(){},Le.useDeferredValue=function(w,Z){return D.H.useDeferredValue(w,Z)},Le.useEffect=function(w,Z,te){var C=D.H;if(typeof te=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return C.useEffect(w,Z)},Le.useId=function(){return D.H.useId()},Le.useImperativeHandle=function(w,Z,te){return D.H.useImperativeHandle(w,Z,te)},Le.useInsertionEffect=function(w,Z){return D.H.useInsertionEffect(w,Z)},Le.useLayoutEffect=function(w,Z){return D.H.useLayoutEffect(w,Z)},Le.useMemo=function(w,Z){return D.H.useMemo(w,Z)},Le.useOptimistic=function(w,Z){return D.H.useOptimistic(w,Z)},Le.useReducer=function(w,Z,te){return D.H.useReducer(w,Z,te)},Le.useRef=function(w){return D.H.useRef(w)},Le.useState=function(w){return D.H.useState(w)},Le.useSyncExternalStore=function(w,Z,te){return D.H.useSyncExternalStore(w,Z,te)},Le.useTransition=function(){return D.H.useTransition()},Le.version="19.1.0",Le}var kv;function Zs(){return kv||(kv=1,Fd.exports=bT()),Fd.exports}var Gd={exports:{}},Ut={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Tv;function _T(){if(Tv)return Ut;Tv=1;var e=Zs();function t(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={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},l=Symbol.for("react.portal");function s(d,h,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:p==null?null:""+p,children:d,containerInfo:h,implementation:m}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Ut.createPortal=function(d,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return s(d,h,null,m)},Ut.flushSync=function(d){var h=o.T,m=i.p;try{if(o.T=null,i.p=2,d)return d()}finally{o.T=h,i.p=m,i.d.f()}},Ut.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(d,h))},Ut.prefetchDNS=function(d){typeof d=="string"&&i.d.D(d)},Ut.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var m=h.as,p=c(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,v=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?i.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:y,fetchPriority:v}):m==="script"&&i.d.X(d,{crossOrigin:p,integrity:y,fetchPriority:v,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ut.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=c(h.as,h.crossOrigin);i.d.M(d,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(d)},Ut.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,p=c(m,h.crossOrigin);i.d.L(d,m,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Ut.preloadModule=function(d,h){if(typeof d=="string")if(h){var m=c(h.as,h.crossOrigin);i.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(d)},Ut.requestFormReset=function(d){i.d.r(d)},Ut.unstable_batchedUpdates=function(d,h){return d(h)},Ut.useFormState=function(d,h,m){return o.H.useFormState(d,h,m)},Ut.useFormStatus=function(){return o.H.useHostTransitionStatus()},Ut.version="19.1.0",Ut}var Cv;function J1(){if(Cv)return Gd.exports;Cv=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(),Gd.exports=_T(),Gd.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Av;function wT(){if(Av)return os;Av=1;var e=xT(),t=Zs(),n=J1();function i(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function s(r){var a=r,u=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,(a.flags&4098)!==0&&(u=a.return),r=a.return;while(r)}return a.tag===3?u:null}function o(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function c(r){if(s(r)!==r)throw Error(i(188))}function d(r){var a=r.alternate;if(!a){if(a=s(r),a===null)throw Error(i(188));return a!==r?null:r}for(var u=r,f=a;;){var g=u.return;if(g===null)break;var x=g.alternate;if(x===null){if(f=g.return,f!==null){u=f;continue}break}if(g.child===x.child){for(x=g.child;x;){if(x===u)return c(g),r;if(x===f)return c(g),a;x=x.sibling}throw Error(i(188))}if(u.return!==f.return)u=g,f=x;else{for(var T=!1,z=g.child;z;){if(z===u){T=!0,u=g,f=x;break}if(z===f){T=!0,f=g,u=x;break}z=z.sibling}if(!T){for(z=x.child;z;){if(z===u){T=!0,u=x,f=g;break}if(z===f){T=!0,f=x,u=g;break}z=z.sibling}if(!T)throw Error(i(189))}}if(u.alternate!==f)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?r:a}function h(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=h(r),a!==null)return a;r=r.sibling}return null}var m=Object.assign,p=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),A=Symbol.for("react.consumer"),E=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),N=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function H(r){return r===null||typeof r!="object"?null:(r=B&&r[B]||r["@@iterator"],typeof r=="function"?r:null)}var F=Symbol.for("react.client.reference");function R(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===F?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case b:return"Fragment";case S:return"Profiler";case _:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case q:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case v:return"Portal";case E:return(r.displayName||"Context")+".Provider";case A:return(r._context.displayName||"Context")+".Consumer";case O:var a=r.render;return r=r.displayName,r||(r=a.displayName||a.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case U:return a=r.displayName||null,a!==null?a:R(r.type)||"Memo";case L:a=r._payload,r=r._init;try{return R(r(a))}catch{}}return null}var $=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},X=[],w=-1;function Z(r){return{current:r}}function te(r){0>w||(r.current=X[w],X[w]=null,w--)}function C(r,a){w++,X[w]=r.current,r.current=a}var Y=Z(null),Q=Z(null),W=Z(null),ue=Z(null);function ce(r,a){switch(C(W,a),C(Q,r),C(Y,null),a.nodeType){case 9:case 11:r=(r=a.documentElement)&&(r=r.namespaceURI)?G0(r):0;break;default:if(r=a.tagName,a=a.namespaceURI)a=G0(a),r=X0(a,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}te(Y),C(Y,r)}function ge(){te(Y),te(Q),te(W)}function ke(r){r.memoizedState!==null&&C(ue,r);var a=Y.current,u=X0(a,r.type);a!==u&&(C(Q,r),C(Y,u))}function we(r){Q.current===r&&(te(Y),te(Q)),ue.current===r&&(te(ue),rs._currentValue=K)}var ye=Object.prototype.hasOwnProperty,Re=e.unstable_scheduleCallback,ze=e.unstable_cancelCallback,lt=e.unstable_shouldYield,ot=e.unstable_requestPaint,xt=e.unstable_now,xi=e.unstable_getCurrentPriorityLevel,ar=e.unstable_ImmediatePriority,Nn=e.unstable_UserBlockingPriority,$n=e.unstable_NormalPriority,lr=e.unstable_LowPriority,Zn=e.unstable_IdlePriority,bi=e.log,Yn=e.unstable_setDisableYieldValue,le=null,de=null;function Ee(r){if(typeof bi=="function"&&Yn(r),de&&typeof de.setStrictMode=="function")try{de.setStrictMode(le,r)}catch{}}var Te=Math.clz32?Math.clz32:On,Xe=Math.log,Vt=Math.LN2;function On(r){return r>>>=0,r===0?32:31-(Xe(r)/Vt|0)|0}var It=256,xn=4194304;function $t(r){var a=r&42;if(a!==0)return a;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function bt(r,a,u){var f=r.pendingLanes;if(f===0)return 0;var g=0,x=r.suspendedLanes,T=r.pingedLanes;r=r.warmLanes;var z=f&134217727;return z!==0?(f=z&~x,f!==0?g=$t(f):(T&=z,T!==0?g=$t(T):u||(u=z&~r,u!==0&&(g=$t(u))))):(z=f&~x,z!==0?g=$t(z):T!==0?g=$t(T):u||(u=f&~r,u!==0&&(g=$t(u)))),g===0?0:a!==0&&a!==g&&(a&x)===0&&(x=g&-g,u=a&-a,x>=u||x===32&&(u&4194048)!==0)?a:g}function Gt(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function an(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+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 tu(){var r=It;return It<<=1,(It&4194048)===0&&(It=256),r}function nu(){var r=xn;return xn<<=1,(xn&62914560)===0&&(xn=4194304),r}function ll(r){for(var a=[],u=0;31>u;u++)a.push(r);return a}function _i(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function zc(r,a,u,f,g,x){var T=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var z=r.entanglements,V=r.expirationTimes,ne=r.hiddenUpdates;for(u=T&~u;0<u;){var se=31-Te(u),fe=1<<se;z[se]=0,V[se]=-1;var re=ne[se];if(re!==null)for(ne[se]=null,se=0;se<re.length;se++){var ae=re[se];ae!==null&&(ae.lane&=-536870913)}u&=~fe}f!==0&&sl(r,f,0),x!==0&&g===0&&r.tag!==0&&(r.suspendedLanes|=x&~(T&~a))}function sl(r,a,u){r.pendingLanes|=a,r.suspendedLanes&=~a;var f=31-Te(a);r.entangledLanes|=a,r.entanglements[f]=r.entanglements[f]|1073741824|u&4194090}function ru(r,a){var u=r.entangledLanes|=a;for(r=r.entanglements;u;){var f=31-Te(u),g=1<<f;g&a|r[f]&a&&(r[f]|=a),u&=~g}}function ul(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function ol(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function iu(){var r=P.p;return r!==0?r:(r=window.event,r===void 0?32:mv(r.type))}function Dc(r,a){var u=P.p;try{return P.p=r,a()}finally{P.p=u}}var Fn=Math.random().toString(36).slice(2),Ot="__reactFiber$"+Fn,Bt="__reactProps$"+Fn,Rr="__reactContainer$"+Fn,cl="__reactEvents$"+Fn,jc="__reactListeners$"+Fn,Lc="__reactHandles$"+Fn,au="__reactResources$"+Fn,wi="__reactMarker$"+Fn;function fl(r){delete r[Ot],delete r[Bt],delete r[cl],delete r[jc],delete r[Lc]}function sr(r){var a=r[Ot];if(a)return a;for(var u=r.parentNode;u;){if(a=u[Rr]||u[Ot]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(r=W0(r);r!==null;){if(u=r[Ot])return u;r=W0(r)}return a}r=u,u=r.parentNode}return null}function ur(r){if(r=r[Ot]||r[Rr]){var a=r.tag;if(a===5||a===6||a===13||a===26||a===27||a===3)return r}return null}function zr(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(i(33))}function Dr(r){var a=r[au];return a||(a=r[au]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function _t(r){r[wi]=!0}var lu=new Set,su={};function or(r,a){jr(r,a),jr(r+"Capture",a)}function jr(r,a){for(su[r]=a,r=0;r<a.length;r++)lu.add(a[r])}var uu=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]*$"),ou={},cu={};function Ic(r){return ye.call(cu,r)?!0:ye.call(ou,r)?!1:uu.test(r)?cu[r]=!0:(ou[r]=!0,!1)}function Qi(r,a,u){if(Ic(a))if(u===null)r.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var f=a.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,""+u)}}function Ki(r,a,u){if(u===null)r.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+u)}}function Mn(r,a,u,f){if(f===null)r.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(a,u,""+f)}}var dl,hl;function Lr(r){if(dl===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);dl=a&&a[1]||"",hl=-1<u.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+dl+r+hl}var ml=!1;function pl(r,a){if(!r||ml)return"";ml=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(a){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ae){var re=ae}Reflect.construct(r,[],fe)}else{try{fe.call()}catch(ae){re=ae}r.call(fe.prototype)}}else{try{throw Error()}catch(ae){re=ae}(fe=r())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ae){if(ae&&re&&typeof ae.stack=="string")return[ae.stack,re.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=f.DetermineComponentFrameRoot(),T=x[0],z=x[1];if(T&&z){var V=T.split(`
44
+ `),ne=z.split(`
45
+ `);for(g=f=0;f<V.length&&!V[f].includes("DetermineComponentFrameRoot");)f++;for(;g<ne.length&&!ne[g].includes("DetermineComponentFrameRoot");)g++;if(f===V.length||g===ne.length)for(f=V.length-1,g=ne.length-1;1<=f&&0<=g&&V[f]!==ne[g];)g--;for(;1<=f&&0<=g;f--,g--)if(V[f]!==ne[g]){if(f!==1||g!==1)do if(f--,g--,0>g||V[f]!==ne[g]){var se=`
46
+ `+V[f].replace(" at new "," at ");return r.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",r.displayName)),se}while(1<=f&&0<=g);break}}}finally{ml=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?Lr(u):""}function Bc(r){switch(r.tag){case 26:case 27:case 5:return Lr(r.type);case 16:return Lr("Lazy");case 13:return Lr("Suspense");case 19:return Lr("SuspenseList");case 0:case 15:return pl(r.type,!1);case 11:return pl(r.type.render,!1);case 1:return pl(r.type,!0);case 31:return Lr("Activity");default:return""}}function fu(r){try{var a="";do a+=Bc(r),r=r.return;while(r);return a}catch(u){return`
47
+ Error generating stack: `+u.message+`
48
+ `+u.stack}}function Xt(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function du(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Ji(r){var a=du(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,a),f=""+r[a];if(!r.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var g=u.get,x=u.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return g.call(this)},set:function(T){f=""+T,x.call(this,T)}}),Object.defineProperty(r,a,{enumerable:u.enumerable}),{getValue:function(){return f},setValue:function(T){f=""+T},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function Wi(r){r._valueTracker||(r._valueTracker=Ji(r))}function hu(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var u=a.getValue(),f="";return r&&(f=du(r)?r.checked?"true":"false":r.value),r=f,r!==u?(a.setValue(r),!0):!1}function Ir(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Hc=/[\n"\\]/g;function Qt(r){return r.replace(Hc,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function ea(r,a,u,f,g,x,T,z){r.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?r.type=T:r.removeAttribute("type"),a!=null?T==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+Xt(a)):r.value!==""+Xt(a)&&(r.value=""+Xt(a)):T!=="submit"&&T!=="reset"||r.removeAttribute("value"),a!=null?Uc(r,T,Xt(a)):u!=null?Uc(r,T,Xt(u)):f!=null&&r.removeAttribute("value"),g==null&&x!=null&&(r.defaultChecked=!!x),g!=null&&(r.checked=g&&typeof g!="function"&&typeof g!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?r.name=""+Xt(z):r.removeAttribute("name")}function Zp(r,a,u,f,g,x,T,z){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(r.type=x),a!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||a!=null))return;u=u!=null?""+Xt(u):"",a=a!=null?""+Xt(a):u,z||a===r.value||(r.value=a),r.defaultValue=a}f=f??g,f=typeof f!="function"&&typeof f!="symbol"&&!!f,r.checked=z?r.checked:!!f,r.defaultChecked=!!f,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(r.name=T)}function Uc(r,a,u){a==="number"&&Ir(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function ta(r,a,u,f){if(r=r.options,a){a={};for(var g=0;g<u.length;g++)a["$"+u[g]]=!0;for(u=0;u<r.length;u++)g=a.hasOwnProperty("$"+r[u].value),r[u].selected!==g&&(r[u].selected=g),g&&f&&(r[u].defaultSelected=!0)}else{for(u=""+Xt(u),a=null,g=0;g<r.length;g++){if(r[g].value===u){r[g].selected=!0,f&&(r[g].defaultSelected=!0);return}a!==null||r[g].disabled||(a=r[g])}a!==null&&(a.selected=!0)}}function Yp(r,a,u){if(a!=null&&(a=""+Xt(a),a!==r.value&&(r.value=a),u==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=u!=null?""+Xt(u):""}function Fp(r,a,u,f){if(a==null){if(f!=null){if(u!=null)throw Error(i(92));if($(f)){if(1<f.length)throw Error(i(93));f=f[0]}u=f}u==null&&(u=""),a=u}u=Xt(a),r.defaultValue=u,f=r.textContent,f===u&&f!==""&&f!==null&&(r.value=f)}function na(r,a){if(a){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=a;return}}r.textContent=a}var fE=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 Gp(r,a,u){var f=a.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":f?r.setProperty(a,u):typeof u!="number"||u===0||fE.has(a)?a==="float"?r.cssFloat=u:r[a]=(""+u).trim():r[a]=u+"px"}function Xp(r,a,u){if(a!=null&&typeof a!="object")throw Error(i(62));if(r=r.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||a!=null&&a.hasOwnProperty(f)||(f.indexOf("--")===0?r.setProperty(f,""):f==="float"?r.cssFloat="":r[f]="");for(var g in a)f=a[g],a.hasOwnProperty(g)&&u[g]!==f&&Gp(r,g,f)}else for(var x in a)a.hasOwnProperty(x)&&Gp(r,x,a[x])}function qc(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var dE=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"]]),hE=/^[\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 mu(r){return hE.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}var Pc=null;function Vc(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ra=null,ia=null;function Qp(r){var a=ur(r);if(a&&(r=a.stateNode)){var u=r[Bt]||null;e:switch(r=a.stateNode,a.type){case"input":if(ea(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),a=u.name,u.type==="radio"&&a!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Qt(""+a)+'"][type="radio"]'),a=0;a<u.length;a++){var f=u[a];if(f!==r&&f.form===r.form){var g=f[Bt]||null;if(!g)throw Error(i(90));ea(f,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(a=0;a<u.length;a++)f=u[a],f.form===r.form&&hu(f)}break e;case"textarea":Yp(r,u.value,u.defaultValue);break e;case"select":a=u.value,a!=null&&ta(r,!!u.multiple,a,!1)}}}var $c=!1;function Kp(r,a,u){if($c)return r(a,u);$c=!0;try{var f=r(a);return f}finally{if($c=!1,(ra!==null||ia!==null)&&(Wu(),ra&&(a=ra,r=ia,ia=ra=null,Qp(a),r)))for(a=0;a<r.length;a++)Qp(r[a])}}function gl(r,a){var u=r.stateNode;if(u===null)return null;var f=u[Bt]||null;if(f===null)return null;u=f[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(i(231,a,typeof u));return u}var cr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zc=!1;if(cr)try{var yl={};Object.defineProperty(yl,"passive",{get:function(){Zc=!0}}),window.addEventListener("test",yl,yl),window.removeEventListener("test",yl,yl)}catch{Zc=!1}var Br=null,Yc=null,pu=null;function Jp(){if(pu)return pu;var r,a=Yc,u=a.length,f,g="value"in Br?Br.value:Br.textContent,x=g.length;for(r=0;r<u&&a[r]===g[r];r++);var T=u-r;for(f=1;f<=T&&a[u-f]===g[x-f];f++);return pu=g.slice(r,1<f?1-f:void 0)}function gu(r){var a=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function yu(){return!0}function Wp(){return!1}function Kt(r){function a(u,f,g,x,T){this._reactName=u,this._targetInst=g,this.type=f,this.nativeEvent=x,this.target=T,this.currentTarget=null;for(var z in r)r.hasOwnProperty(z)&&(u=r[z],this[z]=u?u(x):x[z]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?yu:Wp,this.isPropagationStopped=Wp,this}return m(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=yu)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=yu)},persist:function(){},isPersistent:yu}),a}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vu=Kt(Si),vl=m({},Si,{view:0,detail:0}),mE=Kt(vl),Fc,Gc,xl,xu=m({},vl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qc,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==xl&&(xl&&r.type==="mousemove"?(Fc=r.screenX-xl.screenX,Gc=r.screenY-xl.screenY):Gc=Fc=0,xl=r),Fc)},movementY:function(r){return"movementY"in r?r.movementY:Gc}}),eg=Kt(xu),pE=m({},xu,{dataTransfer:0}),gE=Kt(pE),yE=m({},vl,{relatedTarget:0}),Xc=Kt(yE),vE=m({},Si,{animationName:0,elapsedTime:0,pseudoElement:0}),xE=Kt(vE),bE=m({},Si,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),_E=Kt(bE),wE=m({},Si,{data:0}),tg=Kt(wE),SE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},EE={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"},kE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function TE(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=kE[r])?!!a[r]:!1}function Qc(){return TE}var CE=m({},vl,{key:function(r){if(r.key){var a=SE[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=gu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?EE[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qc,charCode:function(r){return r.type==="keypress"?gu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?gu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),AE=Kt(CE),NE=m({},xu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ng=Kt(NE),OE=m({},vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qc}),ME=Kt(OE),RE=m({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0}),zE=Kt(RE),DE=m({},xu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),jE=Kt(DE),LE=m({},Si,{newState:0,oldState:0}),IE=Kt(LE),BE=[9,13,27,32],Kc=cr&&"CompositionEvent"in window,bl=null;cr&&"documentMode"in document&&(bl=document.documentMode);var HE=cr&&"TextEvent"in window&&!bl,rg=cr&&(!Kc||bl&&8<bl&&11>=bl),ig=" ",ag=!1;function lg(r,a){switch(r){case"keyup":return BE.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sg(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var aa=!1;function UE(r,a){switch(r){case"compositionend":return sg(a);case"keypress":return a.which!==32?null:(ag=!0,ig);case"textInput":return r=a.data,r===ig&&ag?null:r;default:return null}}function qE(r,a){if(aa)return r==="compositionend"||!Kc&&lg(r,a)?(r=Jp(),pu=Yc=Br=null,aa=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return rg&&a.locale!=="ko"?null:a.data;default:return null}}var PE={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 ug(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!PE[r.type]:a==="textarea"}function og(r,a,u,f){ra?ia?ia.push(f):ia=[f]:ra=f,a=ao(a,"onChange"),0<a.length&&(u=new vu("onChange","change",null,u,f),r.push({event:u,listeners:a}))}var _l=null,wl=null;function VE(r){V0(r,0)}function bu(r){var a=zr(r);if(hu(a))return r}function cg(r,a){if(r==="change")return a}var fg=!1;if(cr){var Jc;if(cr){var Wc="oninput"in document;if(!Wc){var dg=document.createElement("div");dg.setAttribute("oninput","return;"),Wc=typeof dg.oninput=="function"}Jc=Wc}else Jc=!1;fg=Jc&&(!document.documentMode||9<document.documentMode)}function hg(){_l&&(_l.detachEvent("onpropertychange",mg),wl=_l=null)}function mg(r){if(r.propertyName==="value"&&bu(wl)){var a=[];og(a,wl,r,Vc(r)),Kp(VE,a)}}function $E(r,a,u){r==="focusin"?(hg(),_l=a,wl=u,_l.attachEvent("onpropertychange",mg)):r==="focusout"&&hg()}function ZE(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return bu(wl)}function YE(r,a){if(r==="click")return bu(a)}function FE(r,a){if(r==="input"||r==="change")return bu(a)}function GE(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var ln=typeof Object.is=="function"?Object.is:GE;function Sl(r,a){if(ln(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var u=Object.keys(r),f=Object.keys(a);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var g=u[f];if(!ye.call(a,g)||!ln(r[g],a[g]))return!1}return!0}function pg(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function gg(r,a){var u=pg(r);r=0;for(var f;u;){if(u.nodeType===3){if(f=r+u.textContent.length,r<=a&&f>=a)return{node:u,offset:a-r};r=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=pg(u)}}function yg(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?yg(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function vg(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=Ir(r.document);a instanceof r.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)r=a.contentWindow;else break;a=Ir(r.document)}return a}function ef(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}var XE=cr&&"documentMode"in document&&11>=document.documentMode,la=null,tf=null,El=null,nf=!1;function xg(r,a,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;nf||la==null||la!==Ir(f)||(f=la,"selectionStart"in f&&ef(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),El&&Sl(El,f)||(El=f,f=ao(tf,"onSelect"),0<f.length&&(a=new vu("onSelect","select",null,a,u),r.push({event:a,listeners:f}),a.target=la)))}function Ei(r,a){var u={};return u[r.toLowerCase()]=a.toLowerCase(),u["Webkit"+r]="webkit"+a,u["Moz"+r]="moz"+a,u}var sa={animationend:Ei("Animation","AnimationEnd"),animationiteration:Ei("Animation","AnimationIteration"),animationstart:Ei("Animation","AnimationStart"),transitionrun:Ei("Transition","TransitionRun"),transitionstart:Ei("Transition","TransitionStart"),transitioncancel:Ei("Transition","TransitionCancel"),transitionend:Ei("Transition","TransitionEnd")},rf={},bg={};cr&&(bg=document.createElement("div").style,"AnimationEvent"in window||(delete sa.animationend.animation,delete sa.animationiteration.animation,delete sa.animationstart.animation),"TransitionEvent"in window||delete sa.transitionend.transition);function ki(r){if(rf[r])return rf[r];if(!sa[r])return r;var a=sa[r],u;for(u in a)if(a.hasOwnProperty(u)&&u in bg)return rf[r]=a[u];return r}var _g=ki("animationend"),wg=ki("animationiteration"),Sg=ki("animationstart"),QE=ki("transitionrun"),KE=ki("transitionstart"),JE=ki("transitioncancel"),Eg=ki("transitionend"),kg=new Map,af="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");af.push("scrollEnd");function Rn(r,a){kg.set(r,a),or(a,[r])}var Tg=new WeakMap;function bn(r,a){if(typeof r=="object"&&r!==null){var u=Tg.get(r);return u!==void 0?u:(a={value:r,source:a,stack:fu(a)},Tg.set(r,a),a)}return{value:r,source:a,stack:fu(a)}}var _n=[],ua=0,lf=0;function _u(){for(var r=ua,a=lf=ua=0;a<r;){var u=_n[a];_n[a++]=null;var f=_n[a];_n[a++]=null;var g=_n[a];_n[a++]=null;var x=_n[a];if(_n[a++]=null,f!==null&&g!==null){var T=f.pending;T===null?g.next=g:(g.next=T.next,T.next=g),f.pending=g}x!==0&&Cg(u,g,x)}}function wu(r,a,u,f){_n[ua++]=r,_n[ua++]=a,_n[ua++]=u,_n[ua++]=f,lf|=f,r.lanes|=f,r=r.alternate,r!==null&&(r.lanes|=f)}function sf(r,a,u,f){return wu(r,a,u,f),Su(r)}function oa(r,a){return wu(r,null,null,a),Su(r)}function Cg(r,a,u){r.lanes|=u;var f=r.alternate;f!==null&&(f.lanes|=u);for(var g=!1,x=r.return;x!==null;)x.childLanes|=u,f=x.alternate,f!==null&&(f.childLanes|=u),x.tag===22&&(r=x.stateNode,r===null||r._visibility&1||(g=!0)),r=x,x=x.return;return r.tag===3?(x=r.stateNode,g&&a!==null&&(g=31-Te(u),r=x.hiddenUpdates,f=r[g],f===null?r[g]=[a]:f.push(a),a.lane=u|536870912),x):null}function Su(r){if(50<Xl)throw Xl=0,hd=null,Error(i(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var ca={};function WE(r,a,u,f){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(r,a,u,f){return new WE(r,a,u,f)}function uf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function fr(r,a){var u=r.alternate;return u===null?(u=sn(r.tag,a,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=a,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&65011712,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,a=r.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.refCleanup=r.refCleanup,u}function Ag(r,a){r.flags&=65011714;var u=r.alternate;return u===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,a=u.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function Eu(r,a,u,f,g,x){var T=0;if(f=r,typeof r=="function")uf(r)&&(T=1);else if(typeof r=="string")T=tT(r,u,Y.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case q:return r=sn(31,u,a,g),r.elementType=q,r.lanes=x,r;case b:return Ti(u.children,g,x,a);case _:T=8,g|=24;break;case S:return r=sn(12,u,a,g|2),r.elementType=S,r.lanes=x,r;case D:return r=sn(13,u,a,g),r.elementType=D,r.lanes=x,r;case M:return r=sn(19,u,a,g),r.elementType=M,r.lanes=x,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case k:case E:T=10;break e;case A:T=9;break e;case O:T=11;break e;case U:T=14;break e;case L:T=16,f=null;break e}T=29,u=Error(i(130,r===null?"null":typeof r,"")),f=null}return a=sn(T,u,a,g),a.elementType=r,a.type=f,a.lanes=x,a}function Ti(r,a,u,f){return r=sn(7,r,f,a),r.lanes=u,r}function of(r,a,u){return r=sn(6,r,null,a),r.lanes=u,r}function cf(r,a,u){return a=sn(4,r.children!==null?r.children:[],r.key,a),a.lanes=u,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var fa=[],da=0,ku=null,Tu=0,wn=[],Sn=0,Ci=null,dr=1,hr="";function Ai(r,a){fa[da++]=Tu,fa[da++]=ku,ku=r,Tu=a}function Ng(r,a,u){wn[Sn++]=dr,wn[Sn++]=hr,wn[Sn++]=Ci,Ci=r;var f=dr;r=hr;var g=32-Te(f)-1;f&=~(1<<g),u+=1;var x=32-Te(a)+g;if(30<x){var T=g-g%5;x=(f&(1<<T)-1).toString(32),f>>=T,g-=T,dr=1<<32-Te(a)+g|u<<g|f,hr=x+r}else dr=1<<x|u<<g|f,hr=r}function ff(r){r.return!==null&&(Ai(r,1),Ng(r,1,0))}function df(r){for(;r===ku;)ku=fa[--da],fa[da]=null,Tu=fa[--da],fa[da]=null;for(;r===Ci;)Ci=wn[--Sn],wn[Sn]=null,hr=wn[--Sn],wn[Sn]=null,dr=wn[--Sn],wn[Sn]=null}var Zt=null,ht=null,Qe=!1,Ni=null,Gn=!1,hf=Error(i(519));function Oi(r){var a=Error(i(418,""));throw Cl(bn(a,r)),hf}function Og(r){var a=r.stateNode,u=r.type,f=r.memoizedProps;switch(a[Ot]=r,a[Bt]=f,u){case"dialog":qe("cancel",a),qe("close",a);break;case"iframe":case"object":case"embed":qe("load",a);break;case"video":case"audio":for(u=0;u<Kl.length;u++)qe(Kl[u],a);break;case"source":qe("error",a);break;case"img":case"image":case"link":qe("error",a),qe("load",a);break;case"details":qe("toggle",a);break;case"input":qe("invalid",a),Zp(a,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0),Wi(a);break;case"select":qe("invalid",a);break;case"textarea":qe("invalid",a),Fp(a,f.value,f.defaultValue,f.children),Wi(a)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||a.textContent===""+u||f.suppressHydrationWarning===!0||F0(a.textContent,u)?(f.popover!=null&&(qe("beforetoggle",a),qe("toggle",a)),f.onScroll!=null&&qe("scroll",a),f.onScrollEnd!=null&&qe("scrollend",a),f.onClick!=null&&(a.onclick=lo),a=!0):a=!1,a||Oi(r)}function Mg(r){for(Zt=r.return;Zt;)switch(Zt.tag){case 5:case 13:Gn=!1;return;case 27:case 3:Gn=!0;return;default:Zt=Zt.return}}function kl(r){if(r!==Zt)return!1;if(!Qe)return Mg(r),Qe=!0,!1;var a=r.tag,u;if((u=a!==3&&a!==27)&&((u=a===5)&&(u=r.type,u=!(u!=="form"&&u!=="button")||Nd(r.type,r.memoizedProps)),u=!u),u&&ht&&Oi(r),Mg(r),a===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));e:{for(r=r.nextSibling,a=0;r;){if(r.nodeType===8)if(u=r.data,u==="/$"){if(a===0){ht=Dn(r.nextSibling);break e}a--}else u!=="$"&&u!=="$!"&&u!=="$?"||a++;r=r.nextSibling}ht=null}}else a===27?(a=ht,ei(r.type)?(r=zd,zd=null,ht=r):ht=a):ht=Zt?Dn(r.stateNode.nextSibling):null;return!0}function Tl(){ht=Zt=null,Qe=!1}function Rg(){var r=Ni;return r!==null&&(en===null?en=r:en.push.apply(en,r),Ni=null),r}function Cl(r){Ni===null?Ni=[r]:Ni.push(r)}var mf=Z(null),Mi=null,mr=null;function Hr(r,a,u){C(mf,a._currentValue),a._currentValue=u}function pr(r){r._currentValue=mf.current,te(mf)}function pf(r,a,u){for(;r!==null;){var f=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,f!==null&&(f.childLanes|=a)):f!==null&&(f.childLanes&a)!==a&&(f.childLanes|=a),r===u)break;r=r.return}}function gf(r,a,u,f){var g=r.child;for(g!==null&&(g.return=r);g!==null;){var x=g.dependencies;if(x!==null){var T=g.child;x=x.firstContext;e:for(;x!==null;){var z=x;x=g;for(var V=0;V<a.length;V++)if(z.context===a[V]){x.lanes|=u,z=x.alternate,z!==null&&(z.lanes|=u),pf(x.return,u,r),f||(T=null);break e}x=z.next}}else if(g.tag===18){if(T=g.return,T===null)throw Error(i(341));T.lanes|=u,x=T.alternate,x!==null&&(x.lanes|=u),pf(T,u,r),T=null}else T=g.child;if(T!==null)T.return=g;else for(T=g;T!==null;){if(T===r){T=null;break}if(g=T.sibling,g!==null){g.return=T.return,T=g;break}T=T.return}g=T}}function Al(r,a,u,f){r=null;for(var g=a,x=!1;g!==null;){if(!x){if((g.flags&524288)!==0)x=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var T=g.alternate;if(T===null)throw Error(i(387));if(T=T.memoizedProps,T!==null){var z=g.type;ln(g.pendingProps.value,T.value)||(r!==null?r.push(z):r=[z])}}else if(g===ue.current){if(T=g.alternate,T===null)throw Error(i(387));T.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(r!==null?r.push(rs):r=[rs])}g=g.return}r!==null&&gf(a,r,u,f),a.flags|=262144}function Cu(r){for(r=r.firstContext;r!==null;){if(!ln(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ri(r){Mi=r,mr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Ht(r){return zg(Mi,r)}function Au(r,a){return Mi===null&&Ri(r),zg(r,a)}function zg(r,a){var u=a._currentValue;if(a={context:a,memoizedValue:u,next:null},mr===null){if(r===null)throw Error(i(308));mr=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else mr=mr.next=a;return u}var ek=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(u,f){r.push(f)}};this.abort=function(){a.aborted=!0,r.forEach(function(u){return u()})}},tk=e.unstable_scheduleCallback,nk=e.unstable_NormalPriority,At={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yf(){return{controller:new ek,data:new Map,refCount:0}}function Nl(r){r.refCount--,r.refCount===0&&tk(nk,function(){r.controller.abort()})}var Ol=null,vf=0,ha=0,ma=null;function rk(r,a){if(Ol===null){var u=Ol=[];vf=0,ha=bd(),ma={status:"pending",value:void 0,then:function(f){u.push(f)}}}return vf++,a.then(Dg,Dg),a}function Dg(){if(--vf===0&&Ol!==null){ma!==null&&(ma.status="fulfilled");var r=Ol;Ol=null,ha=0,ma=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function ik(r,a){var u=[],f={status:"pending",value:null,reason:null,then:function(g){u.push(g)}};return r.then(function(){f.status="fulfilled",f.value=a;for(var g=0;g<u.length;g++)(0,u[g])(a)},function(g){for(f.status="rejected",f.reason=g,g=0;g<u.length;g++)(0,u[g])(void 0)}),f}var jg=j.S;j.S=function(r,a){typeof a=="object"&&a!==null&&typeof a.then=="function"&&rk(r,a),jg!==null&&jg(r,a)};var zi=Z(null);function xf(){var r=zi.current;return r!==null?r:st.pooledCache}function Nu(r,a){a===null?C(zi,zi.current):C(zi,a.pool)}function Lg(){var r=xf();return r===null?null:{parent:At._currentValue,pool:r}}var Ml=Error(i(460)),Ig=Error(i(474)),Ou=Error(i(542)),bf={then:function(){}};function Bg(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Mu(){}function Hg(r,a,u){switch(u=r[u],u===void 0?r.push(a):u!==a&&(a.then(Mu,Mu),a=u),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,qg(r),r;default:if(typeof a.status=="string")a.then(Mu,Mu);else{if(r=st,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=a,r.status="pending",r.then(function(f){if(a.status==="pending"){var g=a;g.status="fulfilled",g.value=f}},function(f){if(a.status==="pending"){var g=a;g.status="rejected",g.reason=f}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,qg(r),r}throw Rl=a,Ml}}var Rl=null;function Ug(){if(Rl===null)throw Error(i(459));var r=Rl;return Rl=null,r}function qg(r){if(r===Ml||r===Ou)throw Error(i(483))}var Ur=!1;function _f(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wf(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function qr(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Pr(r,a,u){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(Je&2)!==0){var g=f.pending;return g===null?a.next=a:(a.next=g.next,g.next=a),f.pending=a,a=Su(r),Cg(r,null,u),a}return wu(r,f,a,u),Su(r)}function zl(r,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194048)!==0)){var f=a.lanes;f&=r.pendingLanes,u|=f,a.lanes=u,ru(r,u)}}function Sf(r,a){var u=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var g=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var T={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?g=x=T:x=x.next=T,u=u.next}while(u!==null);x===null?g=x=a:x=x.next=a}else g=x=a;u={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:f.shared,callbacks:f.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=a:r.next=a,u.lastBaseUpdate=a}var Ef=!1;function Dl(){if(Ef){var r=ma;if(r!==null)throw r}}function jl(r,a,u,f){Ef=!1;var g=r.updateQueue;Ur=!1;var x=g.firstBaseUpdate,T=g.lastBaseUpdate,z=g.shared.pending;if(z!==null){g.shared.pending=null;var V=z,ne=V.next;V.next=null,T===null?x=ne:T.next=ne,T=V;var se=r.alternate;se!==null&&(se=se.updateQueue,z=se.lastBaseUpdate,z!==T&&(z===null?se.firstBaseUpdate=ne:z.next=ne,se.lastBaseUpdate=V))}if(x!==null){var fe=g.baseState;T=0,se=ne=V=null,z=x;do{var re=z.lane&-536870913,ae=re!==z.lane;if(ae?(Ve&re)===re:(f&re)===re){re!==0&&re===ha&&(Ef=!0),se!==null&&(se=se.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Me=r,Ne=z;re=a;var rt=u;switch(Ne.tag){case 1:if(Me=Ne.payload,typeof Me=="function"){fe=Me.call(rt,fe,re);break e}fe=Me;break e;case 3:Me.flags=Me.flags&-65537|128;case 0:if(Me=Ne.payload,re=typeof Me=="function"?Me.call(rt,fe,re):Me,re==null)break e;fe=m({},fe,re);break e;case 2:Ur=!0}}re=z.callback,re!==null&&(r.flags|=64,ae&&(r.flags|=8192),ae=g.callbacks,ae===null?g.callbacks=[re]:ae.push(re))}else ae={lane:re,tag:z.tag,payload:z.payload,callback:z.callback,next:null},se===null?(ne=se=ae,V=fe):se=se.next=ae,T|=re;if(z=z.next,z===null){if(z=g.shared.pending,z===null)break;ae=z,z=ae.next,ae.next=null,g.lastBaseUpdate=ae,g.shared.pending=null}}while(!0);se===null&&(V=fe),g.baseState=V,g.firstBaseUpdate=ne,g.lastBaseUpdate=se,x===null&&(g.shared.lanes=0),Qr|=T,r.lanes=T,r.memoizedState=fe}}function Pg(r,a){if(typeof r!="function")throw Error(i(191,r));r.call(a)}function Vg(r,a){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)Pg(u[r],a)}var pa=Z(null),Ru=Z(0);function $g(r,a){r=wr,C(Ru,r),C(pa,a),wr=r|a.baseLanes}function kf(){C(Ru,wr),C(pa,pa.current)}function Tf(){wr=Ru.current,te(pa),te(Ru)}var Vr=0,Ie=null,tt=null,wt=null,zu=!1,ga=!1,Di=!1,Du=0,Ll=0,ya=null,ak=0;function gt(){throw Error(i(321))}function Cf(r,a){if(a===null)return!1;for(var u=0;u<a.length&&u<r.length;u++)if(!ln(r[u],a[u]))return!1;return!0}function Af(r,a,u,f,g,x){return Vr=x,Ie=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,j.H=r===null||r.memoizedState===null?Cy:Ay,Di=!1,x=u(f,g),Di=!1,ga&&(x=Yg(a,u,f,g)),Zg(r),x}function Zg(r){j.H=Uu;var a=tt!==null&&tt.next!==null;if(Vr=0,wt=tt=Ie=null,zu=!1,Ll=0,ya=null,a)throw Error(i(300));r===null||Mt||(r=r.dependencies,r!==null&&Cu(r)&&(Mt=!0))}function Yg(r,a,u,f){Ie=r;var g=0;do{if(ga&&(ya=null),Ll=0,ga=!1,25<=g)throw Error(i(301));if(g+=1,wt=tt=null,r.updateQueue!=null){var x=r.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}j.H=dk,x=a(u,f)}while(ga);return x}function lk(){var r=j.H,a=r.useState()[0];return a=typeof a.then=="function"?Il(a):a,r=r.useState()[0],(tt!==null?tt.memoizedState:null)!==r&&(Ie.flags|=1024),a}function Nf(){var r=Du!==0;return Du=0,r}function Of(r,a,u){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~u}function Mf(r){if(zu){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}zu=!1}Vr=0,wt=tt=Ie=null,ga=!1,Ll=Du=0,ya=null}function Jt(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?Ie.memoizedState=wt=r:wt=wt.next=r,wt}function St(){if(tt===null){var r=Ie.alternate;r=r!==null?r.memoizedState:null}else r=tt.next;var a=wt===null?Ie.memoizedState:wt.next;if(a!==null)wt=a,tt=r;else{if(r===null)throw Ie.alternate===null?Error(i(467)):Error(i(310));tt=r,r={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},wt===null?Ie.memoizedState=wt=r:wt=wt.next=r}return wt}function Rf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Il(r){var a=Ll;return Ll+=1,ya===null&&(ya=[]),r=Hg(ya,r,a),a=Ie,(wt===null?a.memoizedState:wt.next)===null&&(a=a.alternate,j.H=a===null||a.memoizedState===null?Cy:Ay),r}function ju(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Il(r);if(r.$$typeof===E)return Ht(r)}throw Error(i(438,String(r)))}function zf(r){var a=null,u=Ie.updateQueue;if(u!==null&&(a=u.memoCache),a==null){var f=Ie.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(a={data:f.data.map(function(g){return g.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),u===null&&(u=Rf(),Ie.updateQueue=u),u.memoCache=a,u=a.data[a.index],u===void 0)for(u=a.data[a.index]=Array(r),f=0;f<r;f++)u[f]=N;return a.index++,u}function gr(r,a){return typeof a=="function"?a(r):a}function Lu(r){var a=St();return Df(a,tt,r)}function Df(r,a,u){var f=r.queue;if(f===null)throw Error(i(311));f.lastRenderedReducer=u;var g=r.baseQueue,x=f.pending;if(x!==null){if(g!==null){var T=g.next;g.next=x.next,x.next=T}a.baseQueue=g=x,f.pending=null}if(x=r.baseState,g===null)r.memoizedState=x;else{a=g.next;var z=T=null,V=null,ne=a,se=!1;do{var fe=ne.lane&-536870913;if(fe!==ne.lane?(Ve&fe)===fe:(Vr&fe)===fe){var re=ne.revertLane;if(re===0)V!==null&&(V=V.next={lane:0,revertLane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),fe===ha&&(se=!0);else if((Vr&re)===re){ne=ne.next,re===ha&&(se=!0);continue}else fe={lane:0,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},V===null?(z=V=fe,T=x):V=V.next=fe,Ie.lanes|=re,Qr|=re;fe=ne.action,Di&&u(x,fe),x=ne.hasEagerState?ne.eagerState:u(x,fe)}else re={lane:fe,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},V===null?(z=V=re,T=x):V=V.next=re,Ie.lanes|=fe,Qr|=fe;ne=ne.next}while(ne!==null&&ne!==a);if(V===null?T=x:V.next=z,!ln(x,r.memoizedState)&&(Mt=!0,se&&(u=ma,u!==null)))throw u;r.memoizedState=x,r.baseState=T,r.baseQueue=V,f.lastRenderedState=x}return g===null&&(f.lanes=0),[r.memoizedState,f.dispatch]}function jf(r){var a=St(),u=a.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=r;var f=u.dispatch,g=u.pending,x=a.memoizedState;if(g!==null){u.pending=null;var T=g=g.next;do x=r(x,T.action),T=T.next;while(T!==g);ln(x,a.memoizedState)||(Mt=!0),a.memoizedState=x,a.baseQueue===null&&(a.baseState=x),u.lastRenderedState=x}return[x,f]}function Fg(r,a,u){var f=Ie,g=St(),x=Qe;if(x){if(u===void 0)throw Error(i(407));u=u()}else u=a();var T=!ln((tt||g).memoizedState,u);T&&(g.memoizedState=u,Mt=!0),g=g.queue;var z=Qg.bind(null,f,g,r);if(Bl(2048,8,z,[r]),g.getSnapshot!==a||T||wt!==null&&wt.memoizedState.tag&1){if(f.flags|=2048,va(9,Iu(),Xg.bind(null,f,g,u,a),null),st===null)throw Error(i(349));x||(Vr&124)!==0||Gg(f,a,u)}return u}function Gg(r,a,u){r.flags|=16384,r={getSnapshot:a,value:u},a=Ie.updateQueue,a===null?(a=Rf(),Ie.updateQueue=a,a.stores=[r]):(u=a.stores,u===null?a.stores=[r]:u.push(r))}function Xg(r,a,u,f){a.value=u,a.getSnapshot=f,Kg(a)&&Jg(r)}function Qg(r,a,u){return u(function(){Kg(a)&&Jg(r)})}function Kg(r){var a=r.getSnapshot;r=r.value;try{var u=a();return!ln(r,u)}catch{return!0}}function Jg(r){var a=oa(r,2);a!==null&&dn(a,r,2)}function Lf(r){var a=Jt();if(typeof r=="function"){var u=r;if(r=u(),Di){Ee(!0);try{u()}finally{Ee(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:r},a}function Wg(r,a,u,f){return r.baseState=u,Df(r,tt,typeof f=="function"?f:gr)}function sk(r,a,u,f,g){if(Hu(r))throw Error(i(485));if(r=a.action,r!==null){var x={payload:g,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){x.listeners.push(T)}};j.T!==null?u(!0):x.isTransition=!1,f(x),u=a.pending,u===null?(x.next=a.pending=x,ey(a,x)):(x.next=u.next,a.pending=u.next=x)}}function ey(r,a){var u=a.action,f=a.payload,g=r.state;if(a.isTransition){var x=j.T,T={};j.T=T;try{var z=u(g,f),V=j.S;V!==null&&V(T,z),ty(r,a,z)}catch(ne){If(r,a,ne)}finally{j.T=x}}else try{x=u(g,f),ty(r,a,x)}catch(ne){If(r,a,ne)}}function ty(r,a,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){ny(r,a,f)},function(f){return If(r,a,f)}):ny(r,a,u)}function ny(r,a,u){a.status="fulfilled",a.value=u,ry(a),r.state=u,a=r.pending,a!==null&&(u=a.next,u===a?r.pending=null:(u=u.next,a.next=u,ey(r,u)))}function If(r,a,u){var f=r.pending;if(r.pending=null,f!==null){f=f.next;do a.status="rejected",a.reason=u,ry(a),a=a.next;while(a!==f)}r.action=null}function ry(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function iy(r,a){return a}function ay(r,a){if(Qe){var u=st.formState;if(u!==null){e:{var f=Ie;if(Qe){if(ht){t:{for(var g=ht,x=Gn;g.nodeType!==8;){if(!x){g=null;break t}if(g=Dn(g.nextSibling),g===null){g=null;break t}}x=g.data,g=x==="F!"||x==="F"?g:null}if(g){ht=Dn(g.nextSibling),f=g.data==="F!";break e}}Oi(f)}f=!1}f&&(a=u[0])}}return u=Jt(),u.memoizedState=u.baseState=a,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:iy,lastRenderedState:a},u.queue=f,u=Ey.bind(null,Ie,f),f.dispatch=u,f=Lf(!1),x=Pf.bind(null,Ie,!1,f.queue),f=Jt(),g={state:a,dispatch:null,action:r,pending:null},f.queue=g,u=sk.bind(null,Ie,g,x,u),g.dispatch=u,f.memoizedState=r,[a,u,!1]}function ly(r){var a=St();return sy(a,tt,r)}function sy(r,a,u){if(a=Df(r,a,iy)[0],r=Lu(gr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var f=Il(a)}catch(T){throw T===Ml?Ou:T}else f=a;a=St();var g=a.queue,x=g.dispatch;return u!==a.memoizedState&&(Ie.flags|=2048,va(9,Iu(),uk.bind(null,g,u),null)),[f,x,r]}function uk(r,a){r.action=a}function uy(r){var a=St(),u=tt;if(u!==null)return sy(a,u,r);St(),a=a.memoizedState,u=St();var f=u.queue.dispatch;return u.memoizedState=r,[a,f,!1]}function va(r,a,u,f){return r={tag:r,create:u,deps:f,inst:a,next:null},a=Ie.updateQueue,a===null&&(a=Rf(),Ie.updateQueue=a),u=a.lastEffect,u===null?a.lastEffect=r.next=r:(f=u.next,u.next=r,r.next=f,a.lastEffect=r),r}function Iu(){return{destroy:void 0,resource:void 0}}function oy(){return St().memoizedState}function Bu(r,a,u,f){var g=Jt();f=f===void 0?null:f,Ie.flags|=r,g.memoizedState=va(1|a,Iu(),u,f)}function Bl(r,a,u,f){var g=St();f=f===void 0?null:f;var x=g.memoizedState.inst;tt!==null&&f!==null&&Cf(f,tt.memoizedState.deps)?g.memoizedState=va(a,x,u,f):(Ie.flags|=r,g.memoizedState=va(1|a,x,u,f))}function cy(r,a){Bu(8390656,8,r,a)}function fy(r,a){Bl(2048,8,r,a)}function dy(r,a){return Bl(4,2,r,a)}function hy(r,a){return Bl(4,4,r,a)}function my(r,a){if(typeof a=="function"){r=r();var u=a(r);return function(){typeof u=="function"?u():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function py(r,a,u){u=u!=null?u.concat([r]):null,Bl(4,4,my.bind(null,a,r),u)}function Bf(){}function gy(r,a){var u=St();a=a===void 0?null:a;var f=u.memoizedState;return a!==null&&Cf(a,f[1])?f[0]:(u.memoizedState=[r,a],r)}function yy(r,a){var u=St();a=a===void 0?null:a;var f=u.memoizedState;if(a!==null&&Cf(a,f[1]))return f[0];if(f=r(),Di){Ee(!0);try{r()}finally{Ee(!1)}}return u.memoizedState=[f,a],f}function Hf(r,a,u){return u===void 0||(Vr&1073741824)!==0?r.memoizedState=a:(r.memoizedState=u,r=b0(),Ie.lanes|=r,Qr|=r,u)}function vy(r,a,u,f){return ln(u,a)?u:pa.current!==null?(r=Hf(r,u,f),ln(r,a)||(Mt=!0),r):(Vr&42)===0?(Mt=!0,r.memoizedState=u):(r=b0(),Ie.lanes|=r,Qr|=r,a)}function xy(r,a,u,f,g){var x=P.p;P.p=x!==0&&8>x?x:8;var T=j.T,z={};j.T=z,Pf(r,!1,a,u);try{var V=g(),ne=j.S;if(ne!==null&&ne(z,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var se=ik(V,f);Hl(r,a,se,fn(r))}else Hl(r,a,f,fn(r))}catch(fe){Hl(r,a,{then:function(){},status:"rejected",reason:fe},fn())}finally{P.p=x,j.T=T}}function ok(){}function Uf(r,a,u,f){if(r.tag!==5)throw Error(i(476));var g=by(r).queue;xy(r,g,a,K,u===null?ok:function(){return _y(r),u(f)})}function by(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:K},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:u},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function _y(r){var a=by(r).next.queue;Hl(r,a,{},fn())}function qf(){return Ht(rs)}function wy(){return St().memoizedState}function Sy(){return St().memoizedState}function ck(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var u=fn();r=qr(u);var f=Pr(a,r,u);f!==null&&(dn(f,a,u),zl(f,a,u)),a={cache:yf()},r.payload=a;return}a=a.return}}function fk(r,a,u){var f=fn();u={lane:f,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},Hu(r)?ky(a,u):(u=sf(r,a,u,f),u!==null&&(dn(u,r,f),Ty(u,a,f)))}function Ey(r,a,u){var f=fn();Hl(r,a,u,f)}function Hl(r,a,u,f){var g={lane:f,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(Hu(r))ky(a,g);else{var x=r.alternate;if(r.lanes===0&&(x===null||x.lanes===0)&&(x=a.lastRenderedReducer,x!==null))try{var T=a.lastRenderedState,z=x(T,u);if(g.hasEagerState=!0,g.eagerState=z,ln(z,T))return wu(r,a,g,0),st===null&&_u(),!1}catch{}finally{}if(u=sf(r,a,g,f),u!==null)return dn(u,r,f),Ty(u,a,f),!0}return!1}function Pf(r,a,u,f){if(f={lane:2,revertLane:bd(),action:f,hasEagerState:!1,eagerState:null,next:null},Hu(r)){if(a)throw Error(i(479))}else a=sf(r,u,f,2),a!==null&&dn(a,r,2)}function Hu(r){var a=r.alternate;return r===Ie||a!==null&&a===Ie}function ky(r,a){ga=zu=!0;var u=r.pending;u===null?a.next=a:(a.next=u.next,u.next=a),r.pending=a}function Ty(r,a,u){if((u&4194048)!==0){var f=a.lanes;f&=r.pendingLanes,u|=f,a.lanes=u,ru(r,u)}}var Uu={readContext:Ht,use:ju,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,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt},Cy={readContext:Ht,use:ju,useCallback:function(r,a){return Jt().memoizedState=[r,a===void 0?null:a],r},useContext:Ht,useEffect:cy,useImperativeHandle:function(r,a,u){u=u!=null?u.concat([r]):null,Bu(4194308,4,my.bind(null,a,r),u)},useLayoutEffect:function(r,a){return Bu(4194308,4,r,a)},useInsertionEffect:function(r,a){Bu(4,2,r,a)},useMemo:function(r,a){var u=Jt();a=a===void 0?null:a;var f=r();if(Di){Ee(!0);try{r()}finally{Ee(!1)}}return u.memoizedState=[f,a],f},useReducer:function(r,a,u){var f=Jt();if(u!==void 0){var g=u(a);if(Di){Ee(!0);try{u(a)}finally{Ee(!1)}}}else g=a;return f.memoizedState=f.baseState=g,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:g},f.queue=r,r=r.dispatch=fk.bind(null,Ie,r),[f.memoizedState,r]},useRef:function(r){var a=Jt();return r={current:r},a.memoizedState=r},useState:function(r){r=Lf(r);var a=r.queue,u=Ey.bind(null,Ie,a);return a.dispatch=u,[r.memoizedState,u]},useDebugValue:Bf,useDeferredValue:function(r,a){var u=Jt();return Hf(u,r,a)},useTransition:function(){var r=Lf(!1);return r=xy.bind(null,Ie,r.queue,!0,!1),Jt().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,u){var f=Ie,g=Jt();if(Qe){if(u===void 0)throw Error(i(407));u=u()}else{if(u=a(),st===null)throw Error(i(349));(Ve&124)!==0||Gg(f,a,u)}g.memoizedState=u;var x={value:u,getSnapshot:a};return g.queue=x,cy(Qg.bind(null,f,x,r),[r]),f.flags|=2048,va(9,Iu(),Xg.bind(null,f,x,u,a),null),u},useId:function(){var r=Jt(),a=st.identifierPrefix;if(Qe){var u=hr,f=dr;u=(f&~(1<<32-Te(f)-1)).toString(32)+u,a="«"+a+"R"+u,u=Du++,0<u&&(a+="H"+u.toString(32)),a+="»"}else u=ak++,a="«"+a+"r"+u.toString(32)+"»";return r.memoizedState=a},useHostTransitionStatus:qf,useFormState:ay,useActionState:ay,useOptimistic:function(r){var a=Jt();a.memoizedState=a.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=u,a=Pf.bind(null,Ie,!0,u),u.dispatch=a,[r,a]},useMemoCache:zf,useCacheRefresh:function(){return Jt().memoizedState=ck.bind(null,Ie)}},Ay={readContext:Ht,use:ju,useCallback:gy,useContext:Ht,useEffect:fy,useImperativeHandle:py,useInsertionEffect:dy,useLayoutEffect:hy,useMemo:yy,useReducer:Lu,useRef:oy,useState:function(){return Lu(gr)},useDebugValue:Bf,useDeferredValue:function(r,a){var u=St();return vy(u,tt.memoizedState,r,a)},useTransition:function(){var r=Lu(gr)[0],a=St().memoizedState;return[typeof r=="boolean"?r:Il(r),a]},useSyncExternalStore:Fg,useId:wy,useHostTransitionStatus:qf,useFormState:ly,useActionState:ly,useOptimistic:function(r,a){var u=St();return Wg(u,tt,r,a)},useMemoCache:zf,useCacheRefresh:Sy},dk={readContext:Ht,use:ju,useCallback:gy,useContext:Ht,useEffect:fy,useImperativeHandle:py,useInsertionEffect:dy,useLayoutEffect:hy,useMemo:yy,useReducer:jf,useRef:oy,useState:function(){return jf(gr)},useDebugValue:Bf,useDeferredValue:function(r,a){var u=St();return tt===null?Hf(u,r,a):vy(u,tt.memoizedState,r,a)},useTransition:function(){var r=jf(gr)[0],a=St().memoizedState;return[typeof r=="boolean"?r:Il(r),a]},useSyncExternalStore:Fg,useId:wy,useHostTransitionStatus:qf,useFormState:uy,useActionState:uy,useOptimistic:function(r,a){var u=St();return tt!==null?Wg(u,tt,r,a):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:zf,useCacheRefresh:Sy},xa=null,Ul=0;function qu(r){var a=Ul;return Ul+=1,xa===null&&(xa=[]),Hg(xa,r,a)}function ql(r,a){a=a.props.ref,r.ref=a!==void 0?a:null}function Pu(r,a){throw a.$$typeof===p?Error(i(525)):(r=Object.prototype.toString.call(a),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function Ny(r){var a=r._init;return a(r._payload)}function Oy(r){function a(J,G){if(r){var ee=J.deletions;ee===null?(J.deletions=[G],J.flags|=16):ee.push(G)}}function u(J,G){if(!r)return null;for(;G!==null;)a(J,G),G=G.sibling;return null}function f(J){for(var G=new Map;J!==null;)J.key!==null?G.set(J.key,J):G.set(J.index,J),J=J.sibling;return G}function g(J,G){return J=fr(J,G),J.index=0,J.sibling=null,J}function x(J,G,ee){return J.index=ee,r?(ee=J.alternate,ee!==null?(ee=ee.index,ee<G?(J.flags|=67108866,G):ee):(J.flags|=67108866,G)):(J.flags|=1048576,G)}function T(J){return r&&J.alternate===null&&(J.flags|=67108866),J}function z(J,G,ee,oe){return G===null||G.tag!==6?(G=of(ee,J.mode,oe),G.return=J,G):(G=g(G,ee),G.return=J,G)}function V(J,G,ee,oe){var xe=ee.type;return xe===b?se(J,G,ee.props.children,oe,ee.key):G!==null&&(G.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===L&&Ny(xe)===G.type)?(G=g(G,ee.props),ql(G,ee),G.return=J,G):(G=Eu(ee.type,ee.key,ee.props,null,J.mode,oe),ql(G,ee),G.return=J,G)}function ne(J,G,ee,oe){return G===null||G.tag!==4||G.stateNode.containerInfo!==ee.containerInfo||G.stateNode.implementation!==ee.implementation?(G=cf(ee,J.mode,oe),G.return=J,G):(G=g(G,ee.children||[]),G.return=J,G)}function se(J,G,ee,oe,xe){return G===null||G.tag!==7?(G=Ti(ee,J.mode,oe,xe),G.return=J,G):(G=g(G,ee),G.return=J,G)}function fe(J,G,ee){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=of(""+G,J.mode,ee),G.return=J,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case y:return ee=Eu(G.type,G.key,G.props,null,J.mode,ee),ql(ee,G),ee.return=J,ee;case v:return G=cf(G,J.mode,ee),G.return=J,G;case L:var oe=G._init;return G=oe(G._payload),fe(J,G,ee)}if($(G)||H(G))return G=Ti(G,J.mode,ee,null),G.return=J,G;if(typeof G.then=="function")return fe(J,qu(G),ee);if(G.$$typeof===E)return fe(J,Au(J,G),ee);Pu(J,G)}return null}function re(J,G,ee,oe){var xe=G!==null?G.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return xe!==null?null:z(J,G,""+ee,oe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:return ee.key===xe?V(J,G,ee,oe):null;case v:return ee.key===xe?ne(J,G,ee,oe):null;case L:return xe=ee._init,ee=xe(ee._payload),re(J,G,ee,oe)}if($(ee)||H(ee))return xe!==null?null:se(J,G,ee,oe,null);if(typeof ee.then=="function")return re(J,G,qu(ee),oe);if(ee.$$typeof===E)return re(J,G,Au(J,ee),oe);Pu(J,ee)}return null}function ae(J,G,ee,oe,xe){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return J=J.get(ee)||null,z(G,J,""+oe,xe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case y:return J=J.get(oe.key===null?ee:oe.key)||null,V(G,J,oe,xe);case v:return J=J.get(oe.key===null?ee:oe.key)||null,ne(G,J,oe,xe);case L:var Be=oe._init;return oe=Be(oe._payload),ae(J,G,ee,oe,xe)}if($(oe)||H(oe))return J=J.get(ee)||null,se(G,J,oe,xe,null);if(typeof oe.then=="function")return ae(J,G,ee,qu(oe),xe);if(oe.$$typeof===E)return ae(J,G,ee,Au(G,oe),xe);Pu(G,oe)}return null}function Me(J,G,ee,oe){for(var xe=null,Be=null,Se=G,Oe=G=0,zt=null;Se!==null&&Oe<ee.length;Oe++){Se.index>Oe?(zt=Se,Se=null):zt=Se.sibling;var Fe=re(J,Se,ee[Oe],oe);if(Fe===null){Se===null&&(Se=zt);break}r&&Se&&Fe.alternate===null&&a(J,Se),G=x(Fe,G,Oe),Be===null?xe=Fe:Be.sibling=Fe,Be=Fe,Se=zt}if(Oe===ee.length)return u(J,Se),Qe&&Ai(J,Oe),xe;if(Se===null){for(;Oe<ee.length;Oe++)Se=fe(J,ee[Oe],oe),Se!==null&&(G=x(Se,G,Oe),Be===null?xe=Se:Be.sibling=Se,Be=Se);return Qe&&Ai(J,Oe),xe}for(Se=f(Se);Oe<ee.length;Oe++)zt=ae(Se,J,Oe,ee[Oe],oe),zt!==null&&(r&&zt.alternate!==null&&Se.delete(zt.key===null?Oe:zt.key),G=x(zt,G,Oe),Be===null?xe=zt:Be.sibling=zt,Be=zt);return r&&Se.forEach(function(ai){return a(J,ai)}),Qe&&Ai(J,Oe),xe}function Ne(J,G,ee,oe){if(ee==null)throw Error(i(151));for(var xe=null,Be=null,Se=G,Oe=G=0,zt=null,Fe=ee.next();Se!==null&&!Fe.done;Oe++,Fe=ee.next()){Se.index>Oe?(zt=Se,Se=null):zt=Se.sibling;var ai=re(J,Se,Fe.value,oe);if(ai===null){Se===null&&(Se=zt);break}r&&Se&&ai.alternate===null&&a(J,Se),G=x(ai,G,Oe),Be===null?xe=ai:Be.sibling=ai,Be=ai,Se=zt}if(Fe.done)return u(J,Se),Qe&&Ai(J,Oe),xe;if(Se===null){for(;!Fe.done;Oe++,Fe=ee.next())Fe=fe(J,Fe.value,oe),Fe!==null&&(G=x(Fe,G,Oe),Be===null?xe=Fe:Be.sibling=Fe,Be=Fe);return Qe&&Ai(J,Oe),xe}for(Se=f(Se);!Fe.done;Oe++,Fe=ee.next())Fe=ae(Se,J,Oe,Fe.value,oe),Fe!==null&&(r&&Fe.alternate!==null&&Se.delete(Fe.key===null?Oe:Fe.key),G=x(Fe,G,Oe),Be===null?xe=Fe:Be.sibling=Fe,Be=Fe);return r&&Se.forEach(function(hT){return a(J,hT)}),Qe&&Ai(J,Oe),xe}function rt(J,G,ee,oe){if(typeof ee=="object"&&ee!==null&&ee.type===b&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:e:{for(var xe=ee.key;G!==null;){if(G.key===xe){if(xe=ee.type,xe===b){if(G.tag===7){u(J,G.sibling),oe=g(G,ee.props.children),oe.return=J,J=oe;break e}}else if(G.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===L&&Ny(xe)===G.type){u(J,G.sibling),oe=g(G,ee.props),ql(oe,ee),oe.return=J,J=oe;break e}u(J,G);break}else a(J,G);G=G.sibling}ee.type===b?(oe=Ti(ee.props.children,J.mode,oe,ee.key),oe.return=J,J=oe):(oe=Eu(ee.type,ee.key,ee.props,null,J.mode,oe),ql(oe,ee),oe.return=J,J=oe)}return T(J);case v:e:{for(xe=ee.key;G!==null;){if(G.key===xe)if(G.tag===4&&G.stateNode.containerInfo===ee.containerInfo&&G.stateNode.implementation===ee.implementation){u(J,G.sibling),oe=g(G,ee.children||[]),oe.return=J,J=oe;break e}else{u(J,G);break}else a(J,G);G=G.sibling}oe=cf(ee,J.mode,oe),oe.return=J,J=oe}return T(J);case L:return xe=ee._init,ee=xe(ee._payload),rt(J,G,ee,oe)}if($(ee))return Me(J,G,ee,oe);if(H(ee)){if(xe=H(ee),typeof xe!="function")throw Error(i(150));return ee=xe.call(ee),Ne(J,G,ee,oe)}if(typeof ee.then=="function")return rt(J,G,qu(ee),oe);if(ee.$$typeof===E)return rt(J,G,Au(J,ee),oe);Pu(J,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,G!==null&&G.tag===6?(u(J,G.sibling),oe=g(G,ee),oe.return=J,J=oe):(u(J,G),oe=of(ee,J.mode,oe),oe.return=J,J=oe),T(J)):u(J,G)}return function(J,G,ee,oe){try{Ul=0;var xe=rt(J,G,ee,oe);return xa=null,xe}catch(Se){if(Se===Ml||Se===Ou)throw Se;var Be=sn(29,Se,null,J.mode);return Be.lanes=oe,Be.return=J,Be}finally{}}}var ba=Oy(!0),My=Oy(!1),En=Z(null),Xn=null;function $r(r){var a=r.alternate;C(Nt,Nt.current&1),C(En,r),Xn===null&&(a===null||pa.current!==null||a.memoizedState!==null)&&(Xn=r)}function Ry(r){if(r.tag===22){if(C(Nt,Nt.current),C(En,r),Xn===null){var a=r.alternate;a!==null&&a.memoizedState!==null&&(Xn=r)}}else Zr()}function Zr(){C(Nt,Nt.current),C(En,En.current)}function yr(r){te(En),Xn===r&&(Xn=null),te(Nt)}var Nt=Z(0);function Vu(r){for(var a=r;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||Rd(u)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function Vf(r,a,u,f){a=r.memoizedState,u=u(f,a),u=u==null?a:m({},a,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var $f={enqueueSetState:function(r,a,u){r=r._reactInternals;var f=fn(),g=qr(f);g.payload=a,u!=null&&(g.callback=u),a=Pr(r,g,f),a!==null&&(dn(a,r,f),zl(a,r,f))},enqueueReplaceState:function(r,a,u){r=r._reactInternals;var f=fn(),g=qr(f);g.tag=1,g.payload=a,u!=null&&(g.callback=u),a=Pr(r,g,f),a!==null&&(dn(a,r,f),zl(a,r,f))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var u=fn(),f=qr(u);f.tag=2,a!=null&&(f.callback=a),a=Pr(r,f,u),a!==null&&(dn(a,r,u),zl(a,r,u))}};function zy(r,a,u,f,g,x,T){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,x,T):a.prototype&&a.prototype.isPureReactComponent?!Sl(u,f)||!Sl(g,x):!0}function Dy(r,a,u,f){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,f),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,f),a.state!==r&&$f.enqueueReplaceState(a,a.state,null)}function ji(r,a){var u=a;if("ref"in a){u={};for(var f in a)f!=="ref"&&(u[f]=a[f])}if(r=r.defaultProps){u===a&&(u=m({},u));for(var g in r)u[g]===void 0&&(u[g]=r[g])}return u}var $u=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)};function jy(r){$u(r)}function Ly(r){console.error(r)}function Iy(r){$u(r)}function Zu(r,a){try{var u=r.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(f){setTimeout(function(){throw f})}}function By(r,a,u){try{var f=r.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Zf(r,a,u){return u=qr(u),u.tag=3,u.payload={element:null},u.callback=function(){Zu(r,a)},u}function Hy(r){return r=qr(r),r.tag=3,r}function Uy(r,a,u,f){var g=u.type.getDerivedStateFromError;if(typeof g=="function"){var x=f.value;r.payload=function(){return g(x)},r.callback=function(){By(a,u,f)}}var T=u.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(r.callback=function(){By(a,u,f),typeof g!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var z=f.stack;this.componentDidCatch(f.value,{componentStack:z!==null?z:""})})}function hk(r,a,u,f,g){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(a=u.alternate,a!==null&&Al(a,u,g,!0),u=En.current,u!==null){switch(u.tag){case 13:return Xn===null?pd():u.alternate===null&&mt===0&&(mt=3),u.flags&=-257,u.flags|=65536,u.lanes=g,f===bf?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([f]):a.add(f),yd(r,f,g)),!1;case 22:return u.flags|=65536,f===bf?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([f]):u.add(f)),yd(r,f,g)),!1}throw Error(i(435,u.tag))}return yd(r,f,g),pd(),!1}if(Qe)return a=En.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=g,f!==hf&&(r=Error(i(422),{cause:f}),Cl(bn(r,u)))):(f!==hf&&(a=Error(i(423),{cause:f}),Cl(bn(a,u))),r=r.current.alternate,r.flags|=65536,g&=-g,r.lanes|=g,f=bn(f,u),g=Zf(r.stateNode,f,g),Sf(r,g),mt!==4&&(mt=2)),!1;var x=Error(i(520),{cause:f});if(x=bn(x,u),Gl===null?Gl=[x]:Gl.push(x),mt!==4&&(mt=2),a===null)return!0;f=bn(f,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,r=g&-g,u.lanes|=r,r=Zf(u.stateNode,f,r),Sf(u,r),!1;case 1:if(a=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Kr===null||!Kr.has(x))))return u.flags|=65536,g&=-g,u.lanes|=g,g=Hy(g),Uy(g,r,u,f),Sf(u,g),!1}u=u.return}while(u!==null);return!1}var qy=Error(i(461)),Mt=!1;function Dt(r,a,u,f){a.child=r===null?My(a,null,u,f):ba(a,r.child,u,f)}function Py(r,a,u,f,g){u=u.render;var x=a.ref;if("ref"in f){var T={};for(var z in f)z!=="ref"&&(T[z]=f[z])}else T=f;return Ri(a),f=Af(r,a,u,T,x,g),z=Nf(),r!==null&&!Mt?(Of(r,a,g),vr(r,a,g)):(Qe&&z&&ff(a),a.flags|=1,Dt(r,a,f,g),a.child)}function Vy(r,a,u,f,g){if(r===null){var x=u.type;return typeof x=="function"&&!uf(x)&&x.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=x,$y(r,a,x,f,g)):(r=Eu(u.type,null,f,a,a.mode,g),r.ref=a.ref,r.return=a,a.child=r)}if(x=r.child,!Wf(r,g)){var T=x.memoizedProps;if(u=u.compare,u=u!==null?u:Sl,u(T,f)&&r.ref===a.ref)return vr(r,a,g)}return a.flags|=1,r=fr(x,f),r.ref=a.ref,r.return=a,a.child=r}function $y(r,a,u,f,g){if(r!==null){var x=r.memoizedProps;if(Sl(x,f)&&r.ref===a.ref)if(Mt=!1,a.pendingProps=f=x,Wf(r,g))(r.flags&131072)!==0&&(Mt=!0);else return a.lanes=r.lanes,vr(r,a,g)}return Yf(r,a,u,f,g)}function Zy(r,a,u){var f=a.pendingProps,g=f.children,x=r!==null?r.memoizedState:null;if(f.mode==="hidden"){if((a.flags&128)!==0){if(f=x!==null?x.baseLanes|u:u,r!==null){for(g=a.child=r.child,x=0;g!==null;)x=x|g.lanes|g.childLanes,g=g.sibling;a.childLanes=x&~f}else a.childLanes=0,a.child=null;return Yy(r,a,f,u)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&Nu(a,x!==null?x.cachePool:null),x!==null?$g(a,x):kf(),Ry(a);else return a.lanes=a.childLanes=536870912,Yy(r,a,x!==null?x.baseLanes|u:u,u)}else x!==null?(Nu(a,x.cachePool),$g(a,x),Zr(),a.memoizedState=null):(r!==null&&Nu(a,null),kf(),Zr());return Dt(r,a,g,u),a.child}function Yy(r,a,u,f){var g=xf();return g=g===null?null:{parent:At._currentValue,pool:g},a.memoizedState={baseLanes:u,cachePool:g},r!==null&&Nu(a,null),kf(),Ry(a),r!==null&&Al(r,a,f,!0),null}function Yu(r,a){var u=a.ref;if(u===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(r===null||r.ref!==u)&&(a.flags|=4194816)}}function Yf(r,a,u,f,g){return Ri(a),u=Af(r,a,u,f,void 0,g),f=Nf(),r!==null&&!Mt?(Of(r,a,g),vr(r,a,g)):(Qe&&f&&ff(a),a.flags|=1,Dt(r,a,u,g),a.child)}function Fy(r,a,u,f,g,x){return Ri(a),a.updateQueue=null,u=Yg(a,f,u,g),Zg(r),f=Nf(),r!==null&&!Mt?(Of(r,a,x),vr(r,a,x)):(Qe&&f&&ff(a),a.flags|=1,Dt(r,a,u,x),a.child)}function Gy(r,a,u,f,g){if(Ri(a),a.stateNode===null){var x=ca,T=u.contextType;typeof T=="object"&&T!==null&&(x=Ht(T)),x=new u(f,x),a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=$f,a.stateNode=x,x._reactInternals=a,x=a.stateNode,x.props=f,x.state=a.memoizedState,x.refs={},_f(a),T=u.contextType,x.context=typeof T=="object"&&T!==null?Ht(T):ca,x.state=a.memoizedState,T=u.getDerivedStateFromProps,typeof T=="function"&&(Vf(a,u,T,f),x.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(T=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),T!==x.state&&$f.enqueueReplaceState(x,x.state,null),jl(a,f,x,g),Dl(),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308),f=!0}else if(r===null){x=a.stateNode;var z=a.memoizedProps,V=ji(u,z);x.props=V;var ne=x.context,se=u.contextType;T=ca,typeof se=="object"&&se!==null&&(T=Ht(se));var fe=u.getDerivedStateFromProps;se=typeof fe=="function"||typeof x.getSnapshotBeforeUpdate=="function",z=a.pendingProps!==z,se||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(z||ne!==T)&&Dy(a,x,f,T),Ur=!1;var re=a.memoizedState;x.state=re,jl(a,f,x,g),Dl(),ne=a.memoizedState,z||re!==ne||Ur?(typeof fe=="function"&&(Vf(a,u,fe,f),ne=a.memoizedState),(V=Ur||zy(a,u,V,f,re,ne,T))?(se||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(a.flags|=4194308)):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=f,a.memoizedState=ne),x.props=f,x.state=ne,x.context=T,f=V):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),f=!1)}else{x=a.stateNode,wf(r,a),T=a.memoizedProps,se=ji(u,T),x.props=se,fe=a.pendingProps,re=x.context,ne=u.contextType,V=ca,typeof ne=="object"&&ne!==null&&(V=Ht(ne)),z=u.getDerivedStateFromProps,(ne=typeof z=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(T!==fe||re!==V)&&Dy(a,x,f,V),Ur=!1,re=a.memoizedState,x.state=re,jl(a,f,x,g),Dl();var ae=a.memoizedState;T!==fe||re!==ae||Ur||r!==null&&r.dependencies!==null&&Cu(r.dependencies)?(typeof z=="function"&&(Vf(a,u,z,f),ae=a.memoizedState),(se=Ur||zy(a,u,se,f,re,ae,V)||r!==null&&r.dependencies!==null&&Cu(r.dependencies))?(ne||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(f,ae,V),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(f,ae,V)),typeof x.componentDidUpdate=="function"&&(a.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof x.componentDidUpdate!="function"||T===r.memoizedProps&&re===r.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&re===r.memoizedState||(a.flags|=1024),a.memoizedProps=f,a.memoizedState=ae),x.props=f,x.state=ae,x.context=V,f=se):(typeof x.componentDidUpdate!="function"||T===r.memoizedProps&&re===r.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&re===r.memoizedState||(a.flags|=1024),f=!1)}return x=f,Yu(r,a),f=(a.flags&128)!==0,x||f?(x=a.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:x.render(),a.flags|=1,r!==null&&f?(a.child=ba(a,r.child,null,g),a.child=ba(a,null,u,g)):Dt(r,a,u,g),a.memoizedState=x.state,r=a.child):r=vr(r,a,g),r}function Xy(r,a,u,f){return Tl(),a.flags|=256,Dt(r,a,u,f),a.child}var Ff={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gf(r){return{baseLanes:r,cachePool:Lg()}}function Xf(r,a,u){return r=r!==null?r.childLanes&~u:0,a&&(r|=kn),r}function Qy(r,a,u){var f=a.pendingProps,g=!1,x=(a.flags&128)!==0,T;if((T=x)||(T=r!==null&&r.memoizedState===null?!1:(Nt.current&2)!==0),T&&(g=!0,a.flags&=-129),T=(a.flags&32)!==0,a.flags&=-33,r===null){if(Qe){if(g?$r(a):Zr(),Qe){var z=ht,V;if(V=z){e:{for(V=z,z=Gn;V.nodeType!==8;){if(!z){z=null;break e}if(V=Dn(V.nextSibling),V===null){z=null;break e}}z=V}z!==null?(a.memoizedState={dehydrated:z,treeContext:Ci!==null?{id:dr,overflow:hr}:null,retryLane:536870912,hydrationErrors:null},V=sn(18,null,null,0),V.stateNode=z,V.return=a,a.child=V,Zt=a,ht=null,V=!0):V=!1}V||Oi(a)}if(z=a.memoizedState,z!==null&&(z=z.dehydrated,z!==null))return Rd(z)?a.lanes=32:a.lanes=536870912,null;yr(a)}return z=f.children,f=f.fallback,g?(Zr(),g=a.mode,z=Fu({mode:"hidden",children:z},g),f=Ti(f,g,u,null),z.return=a,f.return=a,z.sibling=f,a.child=z,g=a.child,g.memoizedState=Gf(u),g.childLanes=Xf(r,T,u),a.memoizedState=Ff,f):($r(a),Qf(a,z))}if(V=r.memoizedState,V!==null&&(z=V.dehydrated,z!==null)){if(x)a.flags&256?($r(a),a.flags&=-257,a=Kf(r,a,u)):a.memoizedState!==null?(Zr(),a.child=r.child,a.flags|=128,a=null):(Zr(),g=f.fallback,z=a.mode,f=Fu({mode:"visible",children:f.children},z),g=Ti(g,z,u,null),g.flags|=2,f.return=a,g.return=a,f.sibling=g,a.child=f,ba(a,r.child,null,u),f=a.child,f.memoizedState=Gf(u),f.childLanes=Xf(r,T,u),a.memoizedState=Ff,a=g);else if($r(a),Rd(z)){if(T=z.nextSibling&&z.nextSibling.dataset,T)var ne=T.dgst;T=ne,f=Error(i(419)),f.stack="",f.digest=T,Cl({value:f,source:null,stack:null}),a=Kf(r,a,u)}else if(Mt||Al(r,a,u,!1),T=(u&r.childLanes)!==0,Mt||T){if(T=st,T!==null&&(f=u&-u,f=(f&42)!==0?1:ul(f),f=(f&(T.suspendedLanes|u))!==0?0:f,f!==0&&f!==V.retryLane))throw V.retryLane=f,oa(r,f),dn(T,r,f),qy;z.data==="$?"||pd(),a=Kf(r,a,u)}else z.data==="$?"?(a.flags|=192,a.child=r.child,a=null):(r=V.treeContext,ht=Dn(z.nextSibling),Zt=a,Qe=!0,Ni=null,Gn=!1,r!==null&&(wn[Sn++]=dr,wn[Sn++]=hr,wn[Sn++]=Ci,dr=r.id,hr=r.overflow,Ci=a),a=Qf(a,f.children),a.flags|=4096);return a}return g?(Zr(),g=f.fallback,z=a.mode,V=r.child,ne=V.sibling,f=fr(V,{mode:"hidden",children:f.children}),f.subtreeFlags=V.subtreeFlags&65011712,ne!==null?g=fr(ne,g):(g=Ti(g,z,u,null),g.flags|=2),g.return=a,f.return=a,f.sibling=g,a.child=f,f=g,g=a.child,z=r.child.memoizedState,z===null?z=Gf(u):(V=z.cachePool,V!==null?(ne=At._currentValue,V=V.parent!==ne?{parent:ne,pool:ne}:V):V=Lg(),z={baseLanes:z.baseLanes|u,cachePool:V}),g.memoizedState=z,g.childLanes=Xf(r,T,u),a.memoizedState=Ff,f):($r(a),u=r.child,r=u.sibling,u=fr(u,{mode:"visible",children:f.children}),u.return=a,u.sibling=null,r!==null&&(T=a.deletions,T===null?(a.deletions=[r],a.flags|=16):T.push(r)),a.child=u,a.memoizedState=null,u)}function Qf(r,a){return a=Fu({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function Fu(r,a){return r=sn(22,r,null,a),r.lanes=0,r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},r}function Kf(r,a,u){return ba(a,r.child,null,u),r=Qf(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function Ky(r,a,u){r.lanes|=a;var f=r.alternate;f!==null&&(f.lanes|=a),pf(r.return,a,u)}function Jf(r,a,u,f,g){var x=r.memoizedState;x===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:g}:(x.isBackwards=a,x.rendering=null,x.renderingStartTime=0,x.last=f,x.tail=u,x.tailMode=g)}function Jy(r,a,u){var f=a.pendingProps,g=f.revealOrder,x=f.tail;if(Dt(r,a,f.children,u),f=Nt.current,(f&2)!==0)f=f&1|2,a.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Ky(r,u,a);else if(r.tag===19)Ky(r,u,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}f&=1}switch(C(Nt,f),g){case"forwards":for(u=a.child,g=null;u!==null;)r=u.alternate,r!==null&&Vu(r)===null&&(g=u),u=u.sibling;u=g,u===null?(g=a.child,a.child=null):(g=u.sibling,u.sibling=null),Jf(a,!1,g,u,x);break;case"backwards":for(u=null,g=a.child,a.child=null;g!==null;){if(r=g.alternate,r!==null&&Vu(r)===null){a.child=g;break}r=g.sibling,g.sibling=u,u=g,g=r}Jf(a,!0,u,null,x);break;case"together":Jf(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function vr(r,a,u){if(r!==null&&(a.dependencies=r.dependencies),Qr|=a.lanes,(u&a.childLanes)===0)if(r!==null){if(Al(r,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(i(153));if(a.child!==null){for(r=a.child,u=fr(r,r.pendingProps),a.child=u,u.return=a;r.sibling!==null;)r=r.sibling,u=u.sibling=fr(r,r.pendingProps),u.return=a;u.sibling=null}return a.child}function Wf(r,a){return(r.lanes&a)!==0?!0:(r=r.dependencies,!!(r!==null&&Cu(r)))}function mk(r,a,u){switch(a.tag){case 3:ce(a,a.stateNode.containerInfo),Hr(a,At,r.memoizedState.cache),Tl();break;case 27:case 5:ke(a);break;case 4:ce(a,a.stateNode.containerInfo);break;case 10:Hr(a,a.type,a.memoizedProps.value);break;case 13:var f=a.memoizedState;if(f!==null)return f.dehydrated!==null?($r(a),a.flags|=128,null):(u&a.child.childLanes)!==0?Qy(r,a,u):($r(a),r=vr(r,a,u),r!==null?r.sibling:null);$r(a);break;case 19:var g=(r.flags&128)!==0;if(f=(u&a.childLanes)!==0,f||(Al(r,a,u,!1),f=(u&a.childLanes)!==0),g){if(f)return Jy(r,a,u);a.flags|=128}if(g=a.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),C(Nt,Nt.current),f)break;return null;case 22:case 23:return a.lanes=0,Zy(r,a,u);case 24:Hr(a,At,r.memoizedState.cache)}return vr(r,a,u)}function Wy(r,a,u){if(r!==null)if(r.memoizedProps!==a.pendingProps)Mt=!0;else{if(!Wf(r,u)&&(a.flags&128)===0)return Mt=!1,mk(r,a,u);Mt=(r.flags&131072)!==0}else Mt=!1,Qe&&(a.flags&1048576)!==0&&Ng(a,Tu,a.index);switch(a.lanes=0,a.tag){case 16:e:{r=a.pendingProps;var f=a.elementType,g=f._init;if(f=g(f._payload),a.type=f,typeof f=="function")uf(f)?(r=ji(f,r),a.tag=1,a=Gy(null,a,f,r,u)):(a.tag=0,a=Yf(null,a,f,r,u));else{if(f!=null){if(g=f.$$typeof,g===O){a.tag=11,a=Py(null,a,f,r,u);break e}else if(g===U){a.tag=14,a=Vy(null,a,f,r,u);break e}}throw a=R(f)||f,Error(i(306,a,""))}}return a;case 0:return Yf(r,a,a.type,a.pendingProps,u);case 1:return f=a.type,g=ji(f,a.pendingProps),Gy(r,a,f,g,u);case 3:e:{if(ce(a,a.stateNode.containerInfo),r===null)throw Error(i(387));f=a.pendingProps;var x=a.memoizedState;g=x.element,wf(r,a),jl(a,f,null,u);var T=a.memoizedState;if(f=T.cache,Hr(a,At,f),f!==x.cache&&gf(a,[At],u,!0),Dl(),f=T.element,x.isDehydrated)if(x={element:f,isDehydrated:!1,cache:T.cache},a.updateQueue.baseState=x,a.memoizedState=x,a.flags&256){a=Xy(r,a,f,u);break e}else if(f!==g){g=bn(Error(i(424)),a),Cl(g),a=Xy(r,a,f,u);break e}else{switch(r=a.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(ht=Dn(r.firstChild),Zt=a,Qe=!0,Ni=null,Gn=!0,u=My(a,null,f,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Tl(),f===g){a=vr(r,a,u);break e}Dt(r,a,f,u)}a=a.child}return a;case 26:return Yu(r,a),r===null?(u=rv(a.type,null,a.pendingProps,null))?a.memoizedState=u:Qe||(u=a.type,r=a.pendingProps,f=so(W.current).createElement(u),f[Ot]=a,f[Bt]=r,Lt(f,u,r),_t(f),a.stateNode=f):a.memoizedState=rv(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return ke(a),r===null&&Qe&&(f=a.stateNode=ev(a.type,a.pendingProps,W.current),Zt=a,Gn=!0,g=ht,ei(a.type)?(zd=g,ht=Dn(f.firstChild)):ht=g),Dt(r,a,a.pendingProps.children,u),Yu(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&Qe&&((g=f=ht)&&(f=Pk(f,a.type,a.pendingProps,Gn),f!==null?(a.stateNode=f,Zt=a,ht=Dn(f.firstChild),Gn=!1,g=!0):g=!1),g||Oi(a)),ke(a),g=a.type,x=a.pendingProps,T=r!==null?r.memoizedProps:null,f=x.children,Nd(g,x)?f=null:T!==null&&Nd(g,T)&&(a.flags|=32),a.memoizedState!==null&&(g=Af(r,a,lk,null,null,u),rs._currentValue=g),Yu(r,a),Dt(r,a,f,u),a.child;case 6:return r===null&&Qe&&((r=u=ht)&&(u=Vk(u,a.pendingProps,Gn),u!==null?(a.stateNode=u,Zt=a,ht=null,r=!0):r=!1),r||Oi(a)),null;case 13:return Qy(r,a,u);case 4:return ce(a,a.stateNode.containerInfo),f=a.pendingProps,r===null?a.child=ba(a,null,f,u):Dt(r,a,f,u),a.child;case 11:return Py(r,a,a.type,a.pendingProps,u);case 7:return Dt(r,a,a.pendingProps,u),a.child;case 8:return Dt(r,a,a.pendingProps.children,u),a.child;case 12:return Dt(r,a,a.pendingProps.children,u),a.child;case 10:return f=a.pendingProps,Hr(a,a.type,f.value),Dt(r,a,f.children,u),a.child;case 9:return g=a.type._context,f=a.pendingProps.children,Ri(a),g=Ht(g),f=f(g),a.flags|=1,Dt(r,a,f,u),a.child;case 14:return Vy(r,a,a.type,a.pendingProps,u);case 15:return $y(r,a,a.type,a.pendingProps,u);case 19:return Jy(r,a,u);case 31:return f=a.pendingProps,u=a.mode,f={mode:f.mode,children:f.children},r===null?(u=Fu(f,u),u.ref=a.ref,a.child=u,u.return=a,a=u):(u=fr(r.child,f),u.ref=a.ref,a.child=u,u.return=a,a=u),a;case 22:return Zy(r,a,u);case 24:return Ri(a),f=Ht(At),r===null?(g=xf(),g===null&&(g=st,x=yf(),g.pooledCache=x,x.refCount++,x!==null&&(g.pooledCacheLanes|=u),g=x),a.memoizedState={parent:f,cache:g},_f(a),Hr(a,At,g)):((r.lanes&u)!==0&&(wf(r,a),jl(a,null,null,u),Dl()),g=r.memoizedState,x=a.memoizedState,g.parent!==f?(g={parent:f,cache:f},a.memoizedState=g,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=g),Hr(a,At,f)):(f=x.cache,Hr(a,At,f),f!==g.cache&&gf(a,[At],u,!0))),Dt(r,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function xr(r){r.flags|=4}function e0(r,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!uv(a)){if(a=En.current,a!==null&&((Ve&4194048)===Ve?Xn!==null:(Ve&62914560)!==Ve&&(Ve&536870912)===0||a!==Xn))throw Rl=bf,Ig;r.flags|=8192}}function Gu(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag!==22?nu():536870912,r.lanes|=a,Ea|=a)}function Pl(r,a){if(!Qe)switch(r.tailMode){case"hidden":a=r.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function dt(r){var a=r.alternate!==null&&r.alternate.child===r.child,u=0,f=0;if(a)for(var g=r.child;g!==null;)u|=g.lanes|g.childLanes,f|=g.subtreeFlags&65011712,f|=g.flags&65011712,g.return=r,g=g.sibling;else for(g=r.child;g!==null;)u|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=f,r.childLanes=u,a}function pk(r,a,u){var f=a.pendingProps;switch(df(a),a.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(a),null;case 1:return dt(a),null;case 3:return u=a.stateNode,f=null,r!==null&&(f=r.memoizedState.cache),a.memoizedState.cache!==f&&(a.flags|=2048),pr(At),ge(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(kl(a)?xr(a):r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Rg())),dt(a),null;case 26:return u=a.memoizedState,r===null?(xr(a),u!==null?(dt(a),e0(a,u)):(dt(a),a.flags&=-16777217)):u?u!==r.memoizedState?(xr(a),dt(a),e0(a,u)):(dt(a),a.flags&=-16777217):(r.memoizedProps!==f&&xr(a),dt(a),a.flags&=-16777217),null;case 27:we(a),u=W.current;var g=a.type;if(r!==null&&a.stateNode!=null)r.memoizedProps!==f&&xr(a);else{if(!f){if(a.stateNode===null)throw Error(i(166));return dt(a),null}r=Y.current,kl(a)?Og(a):(r=ev(g,f,u),a.stateNode=r,xr(a))}return dt(a),null;case 5:if(we(a),u=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==f&&xr(a);else{if(!f){if(a.stateNode===null)throw Error(i(166));return dt(a),null}if(r=Y.current,kl(a))Og(a);else{switch(g=so(W.current),r){case 1:r=g.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:r=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":r=g.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":r=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":r=g.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof f.is=="string"?g.createElement("select",{is:f.is}):g.createElement("select"),f.multiple?r.multiple=!0:f.size&&(r.size=f.size);break;default:r=typeof f.is=="string"?g.createElement(u,{is:f.is}):g.createElement(u)}}r[Ot]=a,r[Bt]=f;e:for(g=a.child;g!==null;){if(g.tag===5||g.tag===6)r.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===a)break e;for(;g.sibling===null;){if(g.return===null||g.return===a)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}a.stateNode=r;e:switch(Lt(r,u,f),u){case"button":case"input":case"select":case"textarea":r=!!f.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&xr(a)}}return dt(a),a.flags&=-16777217,null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==f&&xr(a);else{if(typeof f!="string"&&a.stateNode===null)throw Error(i(166));if(r=W.current,kl(a)){if(r=a.stateNode,u=a.memoizedProps,f=null,g=Zt,g!==null)switch(g.tag){case 27:case 5:f=g.memoizedProps}r[Ot]=a,r=!!(r.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||F0(r.nodeValue,u)),r||Oi(a)}else r=so(r).createTextNode(f),r[Ot]=a,a.stateNode=r}return dt(a),null;case 13:if(f=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(g=kl(a),f!==null&&f.dehydrated!==null){if(r===null){if(!g)throw Error(i(318));if(g=a.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[Ot]=a}else Tl(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;dt(a),g=!1}else g=Rg(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=g),g=!0;if(!g)return a.flags&256?(yr(a),a):(yr(a),null)}if(yr(a),(a.flags&128)!==0)return a.lanes=u,a;if(u=f!==null,r=r!==null&&r.memoizedState!==null,u){f=a.child,g=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(g=f.alternate.memoizedState.cachePool.pool);var x=null;f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(x=f.memoizedState.cachePool.pool),x!==g&&(f.flags|=2048)}return u!==r&&u&&(a.child.flags|=8192),Gu(a,a.updateQueue),dt(a),null;case 4:return ge(),r===null&&Ed(a.stateNode.containerInfo),dt(a),null;case 10:return pr(a.type),dt(a),null;case 19:if(te(Nt),g=a.memoizedState,g===null)return dt(a),null;if(f=(a.flags&128)!==0,x=g.rendering,x===null)if(f)Pl(g,!1);else{if(mt!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(x=Vu(r),x!==null){for(a.flags|=128,Pl(g,!1),r=x.updateQueue,a.updateQueue=r,Gu(a,r),a.subtreeFlags=0,r=u,u=a.child;u!==null;)Ag(u,r),u=u.sibling;return C(Nt,Nt.current&1|2),a.child}r=r.sibling}g.tail!==null&&xt()>Ku&&(a.flags|=128,f=!0,Pl(g,!1),a.lanes=4194304)}else{if(!f)if(r=Vu(x),r!==null){if(a.flags|=128,f=!0,r=r.updateQueue,a.updateQueue=r,Gu(a,r),Pl(g,!0),g.tail===null&&g.tailMode==="hidden"&&!x.alternate&&!Qe)return dt(a),null}else 2*xt()-g.renderingStartTime>Ku&&u!==536870912&&(a.flags|=128,f=!0,Pl(g,!1),a.lanes=4194304);g.isBackwards?(x.sibling=a.child,a.child=x):(r=g.last,r!==null?r.sibling=x:a.child=x,g.last=x)}return g.tail!==null?(a=g.tail,g.rendering=a,g.tail=a.sibling,g.renderingStartTime=xt(),a.sibling=null,r=Nt.current,C(Nt,f?r&1|2:r&1),a):(dt(a),null);case 22:case 23:return yr(a),Tf(),f=a.memoizedState!==null,r!==null?r.memoizedState!==null!==f&&(a.flags|=8192):f&&(a.flags|=8192),f?(u&536870912)!==0&&(a.flags&128)===0&&(dt(a),a.subtreeFlags&6&&(a.flags|=8192)):dt(a),u=a.updateQueue,u!==null&&Gu(a,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==u&&(a.flags|=2048),r!==null&&te(zi),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),pr(At),dt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function gk(r,a){switch(df(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return pr(At),ge(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return we(a),null;case 13:if(yr(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(i(340));Tl()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return te(Nt),null;case 4:return ge(),null;case 10:return pr(a.type),null;case 22:case 23:return yr(a),Tf(),r!==null&&te(zi),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return pr(At),null;case 25:return null;default:return null}}function t0(r,a){switch(df(a),a.tag){case 3:pr(At),ge();break;case 26:case 27:case 5:we(a);break;case 4:ge();break;case 13:yr(a);break;case 19:te(Nt);break;case 10:pr(a.type);break;case 22:case 23:yr(a),Tf(),r!==null&&te(zi);break;case 24:pr(At)}}function Vl(r,a){try{var u=a.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var g=f.next;u=g;do{if((u.tag&r)===r){f=void 0;var x=u.create,T=u.inst;f=x(),T.destroy=f}u=u.next}while(u!==g)}}catch(z){it(a,a.return,z)}}function Yr(r,a,u){try{var f=a.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var x=g.next;f=x;do{if((f.tag&r)===r){var T=f.inst,z=T.destroy;if(z!==void 0){T.destroy=void 0,g=a;var V=u,ne=z;try{ne()}catch(se){it(g,V,se)}}}f=f.next}while(f!==x)}}catch(se){it(a,a.return,se)}}function n0(r){var a=r.updateQueue;if(a!==null){var u=r.stateNode;try{Vg(a,u)}catch(f){it(r,r.return,f)}}}function r0(r,a,u){u.props=ji(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(f){it(r,a,f)}}function $l(r,a){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var f=r.stateNode;break;case 30:f=r.stateNode;break;default:f=r.stateNode}typeof u=="function"?r.refCleanup=u(f):u.current=f}}catch(g){it(r,a,g)}}function Qn(r,a){var u=r.ref,f=r.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(g){it(r,a,g)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(g){it(r,a,g)}else u.current=null}function i0(r){var a=r.type,u=r.memoizedProps,f=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(g){it(r,r.return,g)}}function ed(r,a,u){try{var f=r.stateNode;Ik(f,r.type,u,a),f[Bt]=a}catch(g){it(r,r.return,g)}}function a0(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ei(r.type)||r.tag===4}function td(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||a0(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&ei(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function nd(r,a,u){var f=r.tag;if(f===5||f===6)r=r.stateNode,a?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,a):(a=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,a.appendChild(r),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=lo));else if(f!==4&&(f===27&&ei(r.type)&&(u=r.stateNode,a=null),r=r.child,r!==null))for(nd(r,a,u),r=r.sibling;r!==null;)nd(r,a,u),r=r.sibling}function Xu(r,a,u){var f=r.tag;if(f===5||f===6)r=r.stateNode,a?u.insertBefore(r,a):u.appendChild(r);else if(f!==4&&(f===27&&ei(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(Xu(r,a,u),r=r.sibling;r!==null;)Xu(r,a,u),r=r.sibling}function l0(r){var a=r.stateNode,u=r.memoizedProps;try{for(var f=r.type,g=a.attributes;g.length;)a.removeAttributeNode(g[0]);Lt(a,f,u),a[Ot]=r,a[Bt]=u}catch(x){it(r,r.return,x)}}var br=!1,yt=!1,rd=!1,s0=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function yk(r,a){if(r=r.containerInfo,Cd=mo,r=vg(r),ef(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var g=f.anchorOffset,x=f.focusNode;f=f.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var T=0,z=-1,V=-1,ne=0,se=0,fe=r,re=null;t:for(;;){for(var ae;fe!==u||g!==0&&fe.nodeType!==3||(z=T+g),fe!==x||f!==0&&fe.nodeType!==3||(V=T+f),fe.nodeType===3&&(T+=fe.nodeValue.length),(ae=fe.firstChild)!==null;)re=fe,fe=ae;for(;;){if(fe===r)break t;if(re===u&&++ne===g&&(z=T),re===x&&++se===f&&(V=T),(ae=fe.nextSibling)!==null)break;fe=re,re=fe.parentNode}fe=ae}u=z===-1||V===-1?null:{start:z,end:V}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ad={focusedElem:r,selectionRange:u},mo=!1,Rt=a;Rt!==null;)if(a=Rt,r=a.child,(a.subtreeFlags&1024)!==0&&r!==null)r.return=a,Rt=r;else for(;Rt!==null;){switch(a=Rt,x=a.alternate,r=a.flags,a.tag){case 0:break;case 11:case 15:break;case 1:if((r&1024)!==0&&x!==null){r=void 0,u=a,g=x.memoizedProps,x=x.memoizedState,f=u.stateNode;try{var Me=ji(u.type,g,u.elementType===u.type);r=f.getSnapshotBeforeUpdate(Me,x),f.__reactInternalSnapshotBeforeUpdate=r}catch(Ne){it(u,u.return,Ne)}}break;case 3:if((r&1024)!==0){if(r=a.stateNode.containerInfo,u=r.nodeType,u===9)Md(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Md(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=a.sibling,r!==null){r.return=a.return,Rt=r;break}Rt=a.return}}function u0(r,a,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:Fr(r,u),f&4&&Vl(5,u);break;case 1:if(Fr(r,u),f&4)if(r=u.stateNode,a===null)try{r.componentDidMount()}catch(T){it(u,u.return,T)}else{var g=ji(u.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(g,a,r.__reactInternalSnapshotBeforeUpdate)}catch(T){it(u,u.return,T)}}f&64&&n0(u),f&512&&$l(u,u.return);break;case 3:if(Fr(r,u),f&64&&(r=u.updateQueue,r!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{Vg(r,a)}catch(T){it(u,u.return,T)}}break;case 27:a===null&&f&4&&l0(u);case 26:case 5:Fr(r,u),a===null&&f&4&&i0(u),f&512&&$l(u,u.return);break;case 12:Fr(r,u);break;case 13:Fr(r,u),f&4&&f0(r,u),f&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=Tk.bind(null,u),$k(r,u))));break;case 22:if(f=u.memoizedState!==null||br,!f){a=a!==null&&a.memoizedState!==null||yt,g=br;var x=yt;br=f,(yt=a)&&!x?Gr(r,u,(u.subtreeFlags&8772)!==0):Fr(r,u),br=g,yt=x}break;case 30:break;default:Fr(r,u)}}function o0(r){var a=r.alternate;a!==null&&(r.alternate=null,o0(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&fl(a)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var ct=null,Wt=!1;function _r(r,a,u){for(u=u.child;u!==null;)c0(r,a,u),u=u.sibling}function c0(r,a,u){if(de&&typeof de.onCommitFiberUnmount=="function")try{de.onCommitFiberUnmount(le,u)}catch{}switch(u.tag){case 26:yt||Qn(u,a),_r(r,a,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:yt||Qn(u,a);var f=ct,g=Wt;ei(u.type)&&(ct=u.stateNode,Wt=!1),_r(r,a,u),Wl(u.stateNode),ct=f,Wt=g;break;case 5:yt||Qn(u,a);case 6:if(f=ct,g=Wt,ct=null,_r(r,a,u),ct=f,Wt=g,ct!==null)if(Wt)try{(ct.nodeType===9?ct.body:ct.nodeName==="HTML"?ct.ownerDocument.body:ct).removeChild(u.stateNode)}catch(x){it(u,a,x)}else try{ct.removeChild(u.stateNode)}catch(x){it(u,a,x)}break;case 18:ct!==null&&(Wt?(r=ct,J0(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),ss(r)):J0(ct,u.stateNode));break;case 4:f=ct,g=Wt,ct=u.stateNode.containerInfo,Wt=!0,_r(r,a,u),ct=f,Wt=g;break;case 0:case 11:case 14:case 15:yt||Yr(2,u,a),yt||Yr(4,u,a),_r(r,a,u);break;case 1:yt||(Qn(u,a),f=u.stateNode,typeof f.componentWillUnmount=="function"&&r0(u,a,f)),_r(r,a,u);break;case 21:_r(r,a,u);break;case 22:yt=(f=yt)||u.memoizedState!==null,_r(r,a,u),yt=f;break;default:_r(r,a,u)}}function f0(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ss(r)}catch(u){it(a,a.return,u)}}function vk(r){switch(r.tag){case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new s0),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new s0),a;default:throw Error(i(435,r.tag))}}function id(r,a){var u=vk(r);a.forEach(function(f){var g=Ck.bind(null,r,f);u.has(f)||(u.add(f),f.then(g,g))})}function un(r,a){var u=a.deletions;if(u!==null)for(var f=0;f<u.length;f++){var g=u[f],x=r,T=a,z=T;e:for(;z!==null;){switch(z.tag){case 27:if(ei(z.type)){ct=z.stateNode,Wt=!1;break e}break;case 5:ct=z.stateNode,Wt=!1;break e;case 3:case 4:ct=z.stateNode.containerInfo,Wt=!0;break e}z=z.return}if(ct===null)throw Error(i(160));c0(x,T,g),ct=null,Wt=!1,x=g.alternate,x!==null&&(x.return=null),g.return=null}if(a.subtreeFlags&13878)for(a=a.child;a!==null;)d0(a,r),a=a.sibling}var zn=null;function d0(r,a){var u=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:un(a,r),on(r),f&4&&(Yr(3,r,r.return),Vl(3,r),Yr(5,r,r.return));break;case 1:un(a,r),on(r),f&512&&(yt||u===null||Qn(u,u.return)),f&64&&br&&(r=r.updateQueue,r!==null&&(f=r.callbacks,f!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var g=zn;if(un(a,r),on(r),f&512&&(yt||u===null||Qn(u,u.return)),f&4){var x=u!==null?u.memoizedState:null;if(f=r.memoizedState,u===null)if(f===null)if(r.stateNode===null){e:{f=r.type,u=r.memoizedProps,g=g.ownerDocument||g;t:switch(f){case"title":x=g.getElementsByTagName("title")[0],(!x||x[wi]||x[Ot]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=g.createElement(f),g.head.insertBefore(x,g.querySelector("head > title"))),Lt(x,f,u),x[Ot]=r,_t(x),f=x;break e;case"link":var T=lv("link","href",g).get(f+(u.href||""));if(T){for(var z=0;z<T.length;z++)if(x=T[z],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){T.splice(z,1);break t}}x=g.createElement(f),Lt(x,f,u),g.head.appendChild(x);break;case"meta":if(T=lv("meta","content",g).get(f+(u.content||""))){for(z=0;z<T.length;z++)if(x=T[z],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){T.splice(z,1);break t}}x=g.createElement(f),Lt(x,f,u),g.head.appendChild(x);break;default:throw Error(i(468,f))}x[Ot]=r,_t(x),f=x}r.stateNode=f}else sv(g,r.type,r.stateNode);else r.stateNode=av(g,f,r.memoizedProps);else x!==f?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,f===null?sv(g,r.type,r.stateNode):av(g,f,r.memoizedProps)):f===null&&r.stateNode!==null&&ed(r,r.memoizedProps,u.memoizedProps)}break;case 27:un(a,r),on(r),f&512&&(yt||u===null||Qn(u,u.return)),u!==null&&f&4&&ed(r,r.memoizedProps,u.memoizedProps);break;case 5:if(un(a,r),on(r),f&512&&(yt||u===null||Qn(u,u.return)),r.flags&32){g=r.stateNode;try{na(g,"")}catch(ae){it(r,r.return,ae)}}f&4&&r.stateNode!=null&&(g=r.memoizedProps,ed(r,g,u!==null?u.memoizedProps:g)),f&1024&&(rd=!0);break;case 6:if(un(a,r),on(r),f&4){if(r.stateNode===null)throw Error(i(162));f=r.memoizedProps,u=r.stateNode;try{u.nodeValue=f}catch(ae){it(r,r.return,ae)}}break;case 3:if(co=null,g=zn,zn=uo(a.containerInfo),un(a,r),zn=g,on(r),f&4&&u!==null&&u.memoizedState.isDehydrated)try{ss(a.containerInfo)}catch(ae){it(r,r.return,ae)}rd&&(rd=!1,h0(r));break;case 4:f=zn,zn=uo(r.stateNode.containerInfo),un(a,r),on(r),zn=f;break;case 12:un(a,r),on(r);break;case 13:un(a,r),on(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(cd=xt()),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,id(r,f)));break;case 22:g=r.memoizedState!==null;var V=u!==null&&u.memoizedState!==null,ne=br,se=yt;if(br=ne||g,yt=se||V,un(a,r),yt=se,br=ne,on(r),f&8192)e:for(a=r.stateNode,a._visibility=g?a._visibility&-2:a._visibility|1,g&&(u===null||V||br||yt||Li(r)),u=null,a=r;;){if(a.tag===5||a.tag===26){if(u===null){V=u=a;try{if(x=V.stateNode,g)T=x.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{z=V.stateNode;var fe=V.memoizedProps.style,re=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;z.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(ae){it(V,V.return,ae)}}}else if(a.tag===6){if(u===null){V=a;try{V.stateNode.nodeValue=g?"":V.memoizedProps}catch(ae){it(V,V.return,ae)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===r)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;u===a&&(u=null),a=a.return}u===a&&(u=null),a.sibling.return=a.return,a=a.sibling}f&4&&(f=r.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,id(r,u))));break;case 19:un(a,r),on(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,id(r,f)));break;case 30:break;case 21:break;default:un(a,r),on(r)}}function on(r){var a=r.flags;if(a&2){try{for(var u,f=r.return;f!==null;){if(a0(f)){u=f;break}f=f.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var g=u.stateNode,x=td(r);Xu(r,x,g);break;case 5:var T=u.stateNode;u.flags&32&&(na(T,""),u.flags&=-33);var z=td(r);Xu(r,z,T);break;case 3:case 4:var V=u.stateNode.containerInfo,ne=td(r);nd(r,ne,V);break;default:throw Error(i(161))}}catch(se){it(r,r.return,se)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function h0(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;h0(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),r=r.sibling}}function Fr(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)u0(r,a.alternate,a),a=a.sibling}function Li(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:Yr(4,a,a.return),Li(a);break;case 1:Qn(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&r0(a,a.return,u),Li(a);break;case 27:Wl(a.stateNode);case 26:case 5:Qn(a,a.return),Li(a);break;case 22:a.memoizedState===null&&Li(a);break;case 30:Li(a);break;default:Li(a)}r=r.sibling}}function Gr(r,a,u){for(u=u&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var f=a.alternate,g=r,x=a,T=x.flags;switch(x.tag){case 0:case 11:case 15:Gr(g,x,u),Vl(4,x);break;case 1:if(Gr(g,x,u),f=x,g=f.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(ne){it(f,f.return,ne)}if(f=x,g=f.updateQueue,g!==null){var z=f.stateNode;try{var V=g.shared.hiddenCallbacks;if(V!==null)for(g.shared.hiddenCallbacks=null,g=0;g<V.length;g++)Pg(V[g],z)}catch(ne){it(f,f.return,ne)}}u&&T&64&&n0(x),$l(x,x.return);break;case 27:l0(x);case 26:case 5:Gr(g,x,u),u&&f===null&&T&4&&i0(x),$l(x,x.return);break;case 12:Gr(g,x,u);break;case 13:Gr(g,x,u),u&&T&4&&f0(g,x);break;case 22:x.memoizedState===null&&Gr(g,x,u),$l(x,x.return);break;case 30:break;default:Gr(g,x,u)}a=a.sibling}}function ad(r,a){var u=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==u&&(r!=null&&r.refCount++,u!=null&&Nl(u))}function ld(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Nl(r))}function Kn(r,a,u,f){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)m0(r,a,u,f),a=a.sibling}function m0(r,a,u,f){var g=a.flags;switch(a.tag){case 0:case 11:case 15:Kn(r,a,u,f),g&2048&&Vl(9,a);break;case 1:Kn(r,a,u,f);break;case 3:Kn(r,a,u,f),g&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Nl(r)));break;case 12:if(g&2048){Kn(r,a,u,f),r=a.stateNode;try{var x=a.memoizedProps,T=x.id,z=x.onPostCommit;typeof z=="function"&&z(T,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(V){it(a,a.return,V)}}else Kn(r,a,u,f);break;case 13:Kn(r,a,u,f);break;case 23:break;case 22:x=a.stateNode,T=a.alternate,a.memoizedState!==null?x._visibility&2?Kn(r,a,u,f):Zl(r,a):x._visibility&2?Kn(r,a,u,f):(x._visibility|=2,_a(r,a,u,f,(a.subtreeFlags&10256)!==0)),g&2048&&ad(T,a);break;case 24:Kn(r,a,u,f),g&2048&&ld(a.alternate,a);break;default:Kn(r,a,u,f)}}function _a(r,a,u,f,g){for(g=g&&(a.subtreeFlags&10256)!==0,a=a.child;a!==null;){var x=r,T=a,z=u,V=f,ne=T.flags;switch(T.tag){case 0:case 11:case 15:_a(x,T,z,V,g),Vl(8,T);break;case 23:break;case 22:var se=T.stateNode;T.memoizedState!==null?se._visibility&2?_a(x,T,z,V,g):Zl(x,T):(se._visibility|=2,_a(x,T,z,V,g)),g&&ne&2048&&ad(T.alternate,T);break;case 24:_a(x,T,z,V,g),g&&ne&2048&&ld(T.alternate,T);break;default:_a(x,T,z,V,g)}a=a.sibling}}function Zl(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var u=r,f=a,g=f.flags;switch(f.tag){case 22:Zl(u,f),g&2048&&ad(f.alternate,f);break;case 24:Zl(u,f),g&2048&&ld(f.alternate,f);break;default:Zl(u,f)}a=a.sibling}}var Yl=8192;function wa(r){if(r.subtreeFlags&Yl)for(r=r.child;r!==null;)p0(r),r=r.sibling}function p0(r){switch(r.tag){case 26:wa(r),r.flags&Yl&&r.memoizedState!==null&&rT(zn,r.memoizedState,r.memoizedProps);break;case 5:wa(r);break;case 3:case 4:var a=zn;zn=uo(r.stateNode.containerInfo),wa(r),zn=a;break;case 22:r.memoizedState===null&&(a=r.alternate,a!==null&&a.memoizedState!==null?(a=Yl,Yl=16777216,wa(r),Yl=a):wa(r));break;default:wa(r)}}function g0(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function Fl(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var f=a[u];Rt=f,v0(f,r)}g0(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)y0(r),r=r.sibling}function y0(r){switch(r.tag){case 0:case 11:case 15:Fl(r),r.flags&2048&&Yr(9,r,r.return);break;case 3:Fl(r);break;case 12:Fl(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,Qu(r)):Fl(r);break;default:Fl(r)}}function Qu(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var f=a[u];Rt=f,v0(f,r)}g0(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:Yr(8,a,a.return),Qu(a);break;case 22:u=a.stateNode,u._visibility&2&&(u._visibility&=-3,Qu(a));break;default:Qu(a)}r=r.sibling}}function v0(r,a){for(;Rt!==null;){var u=Rt;switch(u.tag){case 0:case 11:case 15:Yr(8,u,a);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Nl(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,Rt=f;else e:for(u=r;Rt!==null;){f=Rt;var g=f.sibling,x=f.return;if(o0(f),f===u){Rt=null;break e}if(g!==null){g.return=x,Rt=g;break e}Rt=x}}}var xk={getCacheForType:function(r){var a=Ht(At),u=a.data.get(r);return u===void 0&&(u=r(),a.data.set(r,u)),u}},bk=typeof WeakMap=="function"?WeakMap:Map,Je=0,st=null,Ue=null,Ve=0,We=0,cn=null,Xr=!1,Sa=!1,sd=!1,wr=0,mt=0,Qr=0,Ii=0,ud=0,kn=0,Ea=0,Gl=null,en=null,od=!1,cd=0,Ku=1/0,Ju=null,Kr=null,jt=0,Jr=null,ka=null,Ta=0,fd=0,dd=null,x0=null,Xl=0,hd=null;function fn(){if((Je&2)!==0&&Ve!==0)return Ve&-Ve;if(j.T!==null){var r=ha;return r!==0?r:bd()}return iu()}function b0(){kn===0&&(kn=(Ve&536870912)===0||Qe?tu():536870912);var r=En.current;return r!==null&&(r.flags|=32),kn}function dn(r,a,u){(r===st&&(We===2||We===9)||r.cancelPendingCommit!==null)&&(Ca(r,0),Wr(r,Ve,kn,!1)),_i(r,u),((Je&2)===0||r!==st)&&(r===st&&((Je&2)===0&&(Ii|=u),mt===4&&Wr(r,Ve,kn,!1)),Jn(r))}function _0(r,a,u){if((Je&6)!==0)throw Error(i(327));var f=!u&&(a&124)===0&&(a&r.expiredLanes)===0||Gt(r,a),g=f?Sk(r,a):gd(r,a,!0),x=f;do{if(g===0){Sa&&!f&&Wr(r,a,0,!1);break}else{if(u=r.current.alternate,x&&!_k(u)){g=gd(r,a,!1),x=!1;continue}if(g===2){if(x=a,r.errorRecoveryDisabledLanes&x)var T=0;else T=r.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){a=T;e:{var z=r;g=Gl;var V=z.current.memoizedState.isDehydrated;if(V&&(Ca(z,T).flags|=256),T=gd(z,T,!1),T!==2){if(sd&&!V){z.errorRecoveryDisabledLanes|=x,Ii|=x,g=4;break e}x=en,en=g,x!==null&&(en===null?en=x:en.push.apply(en,x))}g=T}if(x=!1,g!==2)continue}}if(g===1){Ca(r,0),Wr(r,a,0,!0);break}e:{switch(f=r,x=g,x){case 0:case 1:throw Error(i(345));case 4:if((a&4194048)!==a)break;case 6:Wr(f,a,kn,!Xr);break e;case 2:en=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(g=cd+300-xt(),10<g)){if(Wr(f,a,kn,!Xr),bt(f,0,!0)!==0)break e;f.timeoutHandle=Q0(w0.bind(null,f,u,en,Ju,od,a,kn,Ii,Ea,Xr,x,2,-0,0),g);break e}w0(f,u,en,Ju,od,a,kn,Ii,Ea,Xr,x,0,-0,0)}}break}while(!0);Jn(r)}function w0(r,a,u,f,g,x,T,z,V,ne,se,fe,re,ae){if(r.timeoutHandle=-1,fe=a.subtreeFlags,(fe&8192||(fe&16785408)===16785408)&&(ns={stylesheets:null,count:0,unsuspend:nT},p0(a),fe=iT(),fe!==null)){r.cancelPendingCommit=fe(N0.bind(null,r,a,x,u,f,g,T,z,V,se,1,re,ae)),Wr(r,x,T,!ne);return}N0(r,a,x,u,f,g,T,z,V)}function _k(r){for(var a=r;;){var u=a.tag;if((u===0||u===11||u===15)&&a.flags&16384&&(u=a.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var g=u[f],x=g.getSnapshot;g=g.value;try{if(!ln(x(),g))return!1}catch{return!1}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Wr(r,a,u,f){a&=~ud,a&=~Ii,r.suspendedLanes|=a,r.pingedLanes&=~a,f&&(r.warmLanes|=a),f=r.expirationTimes;for(var g=a;0<g;){var x=31-Te(g),T=1<<x;f[x]=-1,g&=~T}u!==0&&sl(r,u,a)}function Wu(){return(Je&6)===0?(Ql(0),!1):!0}function md(){if(Ue!==null){if(We===0)var r=Ue.return;else r=Ue,mr=Mi=null,Mf(r),xa=null,Ul=0,r=Ue;for(;r!==null;)t0(r.alternate,r),r=r.return;Ue=null}}function Ca(r,a){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,Hk(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),md(),st=r,Ue=u=fr(r.current,null),Ve=a,We=0,cn=null,Xr=!1,Sa=Gt(r,a),sd=!1,Ea=kn=ud=Ii=Qr=mt=0,en=Gl=null,od=!1,(a&8)!==0&&(a|=a&32);var f=r.entangledLanes;if(f!==0)for(r=r.entanglements,f&=a;0<f;){var g=31-Te(f),x=1<<g;a|=r[g],f&=~x}return wr=a,_u(),u}function S0(r,a){Ie=null,j.H=Uu,a===Ml||a===Ou?(a=Ug(),We=3):a===Ig?(a=Ug(),We=4):We=a===qy?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,cn=a,Ue===null&&(mt=1,Zu(r,bn(a,r.current)))}function E0(){var r=j.H;return j.H=Uu,r===null?Uu:r}function k0(){var r=j.A;return j.A=xk,r}function pd(){mt=4,Xr||(Ve&4194048)!==Ve&&En.current!==null||(Sa=!0),(Qr&134217727)===0&&(Ii&134217727)===0||st===null||Wr(st,Ve,kn,!1)}function gd(r,a,u){var f=Je;Je|=2;var g=E0(),x=k0();(st!==r||Ve!==a)&&(Ju=null,Ca(r,a)),a=!1;var T=mt;e:do try{if(We!==0&&Ue!==null){var z=Ue,V=cn;switch(We){case 8:md(),T=6;break e;case 3:case 2:case 9:case 6:En.current===null&&(a=!0);var ne=We;if(We=0,cn=null,Aa(r,z,V,ne),u&&Sa){T=0;break e}break;default:ne=We,We=0,cn=null,Aa(r,z,V,ne)}}wk(),T=mt;break}catch(se){S0(r,se)}while(!0);return a&&r.shellSuspendCounter++,mr=Mi=null,Je=f,j.H=g,j.A=x,Ue===null&&(st=null,Ve=0,_u()),T}function wk(){for(;Ue!==null;)T0(Ue)}function Sk(r,a){var u=Je;Je|=2;var f=E0(),g=k0();st!==r||Ve!==a?(Ju=null,Ku=xt()+500,Ca(r,a)):Sa=Gt(r,a);e:do try{if(We!==0&&Ue!==null){a=Ue;var x=cn;t:switch(We){case 1:We=0,cn=null,Aa(r,a,x,1);break;case 2:case 9:if(Bg(x)){We=0,cn=null,C0(a);break}a=function(){We!==2&&We!==9||st!==r||(We=7),Jn(r)},x.then(a,a);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Bg(x)?(We=0,cn=null,C0(a)):(We=0,cn=null,Aa(r,a,x,7));break;case 5:var T=null;switch(Ue.tag){case 26:T=Ue.memoizedState;case 5:case 27:var z=Ue;if(!T||uv(T)){We=0,cn=null;var V=z.sibling;if(V!==null)Ue=V;else{var ne=z.return;ne!==null?(Ue=ne,eo(ne)):Ue=null}break t}}We=0,cn=null,Aa(r,a,x,5);break;case 6:We=0,cn=null,Aa(r,a,x,6);break;case 8:md(),mt=6;break e;default:throw Error(i(462))}}Ek();break}catch(se){S0(r,se)}while(!0);return mr=Mi=null,j.H=f,j.A=g,Je=u,Ue!==null?0:(st=null,Ve=0,_u(),mt)}function Ek(){for(;Ue!==null&&!lt();)T0(Ue)}function T0(r){var a=Wy(r.alternate,r,wr);r.memoizedProps=r.pendingProps,a===null?eo(r):Ue=a}function C0(r){var a=r,u=a.alternate;switch(a.tag){case 15:case 0:a=Fy(u,a,a.pendingProps,a.type,void 0,Ve);break;case 11:a=Fy(u,a,a.pendingProps,a.type.render,a.ref,Ve);break;case 5:Mf(a);default:t0(u,a),a=Ue=Ag(a,wr),a=Wy(u,a,wr)}r.memoizedProps=r.pendingProps,a===null?eo(r):Ue=a}function Aa(r,a,u,f){mr=Mi=null,Mf(a),xa=null,Ul=0;var g=a.return;try{if(hk(r,g,a,u,Ve)){mt=1,Zu(r,bn(u,r.current)),Ue=null;return}}catch(x){if(g!==null)throw Ue=g,x;mt=1,Zu(r,bn(u,r.current)),Ue=null;return}a.flags&32768?(Qe||f===1?r=!0:Sa||(Ve&536870912)!==0?r=!1:(Xr=r=!0,(f===2||f===9||f===3||f===6)&&(f=En.current,f!==null&&f.tag===13&&(f.flags|=16384))),A0(a,r)):eo(a)}function eo(r){var a=r;do{if((a.flags&32768)!==0){A0(a,Xr);return}r=a.return;var u=pk(a.alternate,a,wr);if(u!==null){Ue=u;return}if(a=a.sibling,a!==null){Ue=a;return}Ue=a=r}while(a!==null);mt===0&&(mt=5)}function A0(r,a){do{var u=gk(r.alternate,r);if(u!==null){u.flags&=32767,Ue=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!a&&(r=r.sibling,r!==null)){Ue=r;return}Ue=r=u}while(r!==null);mt=6,Ue=null}function N0(r,a,u,f,g,x,T,z,V){r.cancelPendingCommit=null;do to();while(jt!==0);if((Je&6)!==0)throw Error(i(327));if(a!==null){if(a===r.current)throw Error(i(177));if(x=a.lanes|a.childLanes,x|=lf,zc(r,u,x,T,z,V),r===st&&(Ue=st=null,Ve=0),ka=a,Jr=r,Ta=u,fd=x,dd=g,x0=f,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,Ak($n,function(){return D0(),null})):(r.callbackNode=null,r.callbackPriority=0),f=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||f){f=j.T,j.T=null,g=P.p,P.p=2,T=Je,Je|=4;try{yk(r,a,u)}finally{Je=T,P.p=g,j.T=f}}jt=1,O0(),M0(),R0()}}function O0(){if(jt===1){jt=0;var r=Jr,a=ka,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=j.T,j.T=null;var f=P.p;P.p=2;var g=Je;Je|=4;try{d0(a,r);var x=Ad,T=vg(r.containerInfo),z=x.focusedElem,V=x.selectionRange;if(T!==z&&z&&z.ownerDocument&&yg(z.ownerDocument.documentElement,z)){if(V!==null&&ef(z)){var ne=V.start,se=V.end;if(se===void 0&&(se=ne),"selectionStart"in z)z.selectionStart=ne,z.selectionEnd=Math.min(se,z.value.length);else{var fe=z.ownerDocument||document,re=fe&&fe.defaultView||window;if(re.getSelection){var ae=re.getSelection(),Me=z.textContent.length,Ne=Math.min(V.start,Me),rt=V.end===void 0?Ne:Math.min(V.end,Me);!ae.extend&&Ne>rt&&(T=rt,rt=Ne,Ne=T);var J=gg(z,Ne),G=gg(z,rt);if(J&&G&&(ae.rangeCount!==1||ae.anchorNode!==J.node||ae.anchorOffset!==J.offset||ae.focusNode!==G.node||ae.focusOffset!==G.offset)){var ee=fe.createRange();ee.setStart(J.node,J.offset),ae.removeAllRanges(),Ne>rt?(ae.addRange(ee),ae.extend(G.node,G.offset)):(ee.setEnd(G.node,G.offset),ae.addRange(ee))}}}}for(fe=[],ae=z;ae=ae.parentNode;)ae.nodeType===1&&fe.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<fe.length;z++){var oe=fe[z];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}mo=!!Cd,Ad=Cd=null}finally{Je=g,P.p=f,j.T=u}}r.current=a,jt=2}}function M0(){if(jt===2){jt=0;var r=Jr,a=ka,u=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||u){u=j.T,j.T=null;var f=P.p;P.p=2;var g=Je;Je|=4;try{u0(r,a.alternate,a)}finally{Je=g,P.p=f,j.T=u}}jt=3}}function R0(){if(jt===4||jt===3){jt=0,ot();var r=Jr,a=ka,u=Ta,f=x0;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?jt=5:(jt=0,ka=Jr=null,z0(r,r.pendingLanes));var g=r.pendingLanes;if(g===0&&(Kr=null),ol(u),a=a.stateNode,de&&typeof de.onCommitFiberRoot=="function")try{de.onCommitFiberRoot(le,a,void 0,(a.current.flags&128)===128)}catch{}if(f!==null){a=j.T,g=P.p,P.p=2,j.T=null;try{for(var x=r.onRecoverableError,T=0;T<f.length;T++){var z=f[T];x(z.value,{componentStack:z.stack})}}finally{j.T=a,P.p=g}}(Ta&3)!==0&&to(),Jn(r),g=r.pendingLanes,(u&4194090)!==0&&(g&42)!==0?r===hd?Xl++:(Xl=0,hd=r):Xl=0,Ql(0)}}function z0(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,Nl(a)))}function to(r){return O0(),M0(),R0(),D0()}function D0(){if(jt!==5)return!1;var r=Jr,a=fd;fd=0;var u=ol(Ta),f=j.T,g=P.p;try{P.p=32>u?32:u,j.T=null,u=dd,dd=null;var x=Jr,T=Ta;if(jt=0,ka=Jr=null,Ta=0,(Je&6)!==0)throw Error(i(331));var z=Je;if(Je|=4,y0(x.current),m0(x,x.current,T,u),Je=z,Ql(0,!1),de&&typeof de.onPostCommitFiberRoot=="function")try{de.onPostCommitFiberRoot(le,x)}catch{}return!0}finally{P.p=g,j.T=f,z0(r,a)}}function j0(r,a,u){a=bn(u,a),a=Zf(r.stateNode,a,2),r=Pr(r,a,2),r!==null&&(_i(r,2),Jn(r))}function it(r,a,u){if(r.tag===3)j0(r,r,u);else for(;a!==null;){if(a.tag===3){j0(a,r,u);break}else if(a.tag===1){var f=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Kr===null||!Kr.has(f))){r=bn(u,r),u=Hy(2),f=Pr(a,u,2),f!==null&&(Uy(u,f,a,r),_i(f,2),Jn(f));break}}a=a.return}}function yd(r,a,u){var f=r.pingCache;if(f===null){f=r.pingCache=new bk;var g=new Set;f.set(a,g)}else g=f.get(a),g===void 0&&(g=new Set,f.set(a,g));g.has(u)||(sd=!0,g.add(u),r=kk.bind(null,r,a,u),a.then(r,r))}function kk(r,a,u){var f=r.pingCache;f!==null&&f.delete(a),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,st===r&&(Ve&u)===u&&(mt===4||mt===3&&(Ve&62914560)===Ve&&300>xt()-cd?(Je&2)===0&&Ca(r,0):ud|=u,Ea===Ve&&(Ea=0)),Jn(r)}function L0(r,a){a===0&&(a=nu()),r=oa(r,a),r!==null&&(_i(r,a),Jn(r))}function Tk(r){var a=r.memoizedState,u=0;a!==null&&(u=a.retryLane),L0(r,u)}function Ck(r,a){var u=0;switch(r.tag){case 13:var f=r.stateNode,g=r.memoizedState;g!==null&&(u=g.retryLane);break;case 19:f=r.stateNode;break;case 22:f=r.stateNode._retryCache;break;default:throw Error(i(314))}f!==null&&f.delete(a),L0(r,u)}function Ak(r,a){return Re(r,a)}var no=null,Na=null,vd=!1,ro=!1,xd=!1,Bi=0;function Jn(r){r!==Na&&r.next===null&&(Na===null?no=Na=r:Na=Na.next=r),ro=!0,vd||(vd=!0,Ok())}function Ql(r,a){if(!xd&&ro){xd=!0;do for(var u=!1,f=no;f!==null;){if(r!==0){var g=f.pendingLanes;if(g===0)var x=0;else{var T=f.suspendedLanes,z=f.pingedLanes;x=(1<<31-Te(42|r)+1)-1,x&=g&~(T&~z),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,U0(f,x))}else x=Ve,x=bt(f,f===st?x:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(x&3)===0||Gt(f,x)||(u=!0,U0(f,x));f=f.next}while(u);xd=!1}}function Nk(){I0()}function I0(){ro=vd=!1;var r=0;Bi!==0&&(Bk()&&(r=Bi),Bi=0);for(var a=xt(),u=null,f=no;f!==null;){var g=f.next,x=B0(f,a);x===0?(f.next=null,u===null?no=g:u.next=g,g===null&&(Na=u)):(u=f,(r!==0||(x&3)!==0)&&(ro=!0)),f=g}Ql(r)}function B0(r,a){for(var u=r.suspendedLanes,f=r.pingedLanes,g=r.expirationTimes,x=r.pendingLanes&-62914561;0<x;){var T=31-Te(x),z=1<<T,V=g[T];V===-1?((z&u)===0||(z&f)!==0)&&(g[T]=an(z,a)):V<=a&&(r.expiredLanes|=z),x&=~z}if(a=st,u=Ve,u=bt(r,r===a?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f=r.callbackNode,u===0||r===a&&(We===2||We===9)||r.cancelPendingCommit!==null)return f!==null&&f!==null&&ze(f),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||Gt(r,u)){if(a=u&-u,a===r.callbackPriority)return a;switch(f!==null&&ze(f),ol(u)){case 2:case 8:u=Nn;break;case 32:u=$n;break;case 268435456:u=Zn;break;default:u=$n}return f=H0.bind(null,r),u=Re(u,f),r.callbackPriority=a,r.callbackNode=u,a}return f!==null&&f!==null&&ze(f),r.callbackPriority=2,r.callbackNode=null,2}function H0(r,a){if(jt!==0&&jt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(to()&&r.callbackNode!==u)return null;var f=Ve;return f=bt(r,r===st?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f===0?null:(_0(r,f,a),B0(r,xt()),r.callbackNode!=null&&r.callbackNode===u?H0.bind(null,r):null)}function U0(r,a){if(to())return null;_0(r,a,!0)}function Ok(){Uk(function(){(Je&6)!==0?Re(ar,Nk):I0()})}function bd(){return Bi===0&&(Bi=tu()),Bi}function q0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:mu(""+r)}function P0(r,a){var u=a.ownerDocument.createElement("input");return u.name=a.name,u.value=a.value,r.id&&u.setAttribute("form",r.id),a.parentNode.insertBefore(u,a),r=new FormData(r),u.parentNode.removeChild(u),r}function Mk(r,a,u,f,g){if(a==="submit"&&u&&u.stateNode===g){var x=q0((g[Bt]||null).action),T=f.submitter;T&&(a=(a=T[Bt]||null)?q0(a.formAction):T.getAttribute("formAction"),a!==null&&(x=a,T=null));var z=new vu("action","action",null,f,g);r.push({event:z,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Bi!==0){var V=T?P0(g,T):new FormData(g);Uf(u,{pending:!0,data:V,method:g.method,action:x},null,V)}}else typeof x=="function"&&(z.preventDefault(),V=T?P0(g,T):new FormData(g),Uf(u,{pending:!0,data:V,method:g.method,action:x},x,V))},currentTarget:g}]})}}for(var _d=0;_d<af.length;_d++){var wd=af[_d],Rk=wd.toLowerCase(),zk=wd[0].toUpperCase()+wd.slice(1);Rn(Rk,"on"+zk)}Rn(_g,"onAnimationEnd"),Rn(wg,"onAnimationIteration"),Rn(Sg,"onAnimationStart"),Rn("dblclick","onDoubleClick"),Rn("focusin","onFocus"),Rn("focusout","onBlur"),Rn(QE,"onTransitionRun"),Rn(KE,"onTransitionStart"),Rn(JE,"onTransitionCancel"),Rn(Eg,"onTransitionEnd"),jr("onMouseEnter",["mouseout","mouseover"]),jr("onMouseLeave",["mouseout","mouseover"]),jr("onPointerEnter",["pointerout","pointerover"]),jr("onPointerLeave",["pointerout","pointerover"]),or("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),or("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),or("onBeforeInput",["compositionend","keypress","textInput","paste"]),or("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),or("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),or("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Kl="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(" "),Dk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Kl));function V0(r,a){a=(a&4)!==0;for(var u=0;u<r.length;u++){var f=r[u],g=f.event;f=f.listeners;e:{var x=void 0;if(a)for(var T=f.length-1;0<=T;T--){var z=f[T],V=z.instance,ne=z.currentTarget;if(z=z.listener,V!==x&&g.isPropagationStopped())break e;x=z,g.currentTarget=ne;try{x(g)}catch(se){$u(se)}g.currentTarget=null,x=V}else for(T=0;T<f.length;T++){if(z=f[T],V=z.instance,ne=z.currentTarget,z=z.listener,V!==x&&g.isPropagationStopped())break e;x=z,g.currentTarget=ne;try{x(g)}catch(se){$u(se)}g.currentTarget=null,x=V}}}}function qe(r,a){var u=a[cl];u===void 0&&(u=a[cl]=new Set);var f=r+"__bubble";u.has(f)||($0(a,r,2,!1),u.add(f))}function Sd(r,a,u){var f=0;a&&(f|=4),$0(u,r,f,a)}var io="_reactListening"+Math.random().toString(36).slice(2);function Ed(r){if(!r[io]){r[io]=!0,lu.forEach(function(u){u!=="selectionchange"&&(Dk.has(u)||Sd(u,!1,r),Sd(u,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[io]||(a[io]=!0,Sd("selectionchange",!1,a))}}function $0(r,a,u,f){switch(mv(a)){case 2:var g=sT;break;case 8:g=uT;break;default:g=Bd}u=g.bind(null,a,u,r),g=void 0,!Zc||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(g=!0),f?g!==void 0?r.addEventListener(a,u,{capture:!0,passive:g}):r.addEventListener(a,u,!0):g!==void 0?r.addEventListener(a,u,{passive:g}):r.addEventListener(a,u,!1)}function kd(r,a,u,f,g){var x=f;if((a&1)===0&&(a&2)===0&&f!==null)e:for(;;){if(f===null)return;var T=f.tag;if(T===3||T===4){var z=f.stateNode.containerInfo;if(z===g)break;if(T===4)for(T=f.return;T!==null;){var V=T.tag;if((V===3||V===4)&&T.stateNode.containerInfo===g)return;T=T.return}for(;z!==null;){if(T=sr(z),T===null)return;if(V=T.tag,V===5||V===6||V===26||V===27){f=x=T;continue e}z=z.parentNode}}f=f.return}Kp(function(){var ne=x,se=Vc(u),fe=[];e:{var re=kg.get(r);if(re!==void 0){var ae=vu,Me=r;switch(r){case"keypress":if(gu(u)===0)break e;case"keydown":case"keyup":ae=AE;break;case"focusin":Me="focus",ae=Xc;break;case"focusout":Me="blur",ae=Xc;break;case"beforeblur":case"afterblur":ae=Xc;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=eg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=gE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=ME;break;case _g:case wg:case Sg:ae=xE;break;case Eg:ae=zE;break;case"scroll":case"scrollend":ae=mE;break;case"wheel":ae=jE;break;case"copy":case"cut":case"paste":ae=_E;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=ng;break;case"toggle":case"beforetoggle":ae=IE}var Ne=(a&4)!==0,rt=!Ne&&(r==="scroll"||r==="scrollend"),J=Ne?re!==null?re+"Capture":null:re;Ne=[];for(var G=ne,ee;G!==null;){var oe=G;if(ee=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||ee===null||J===null||(oe=gl(G,J),oe!=null&&Ne.push(Jl(G,oe,ee))),rt)break;G=G.return}0<Ne.length&&(re=new ae(re,Me,null,u,se),fe.push({event:re,listeners:Ne}))}}if((a&7)===0){e:{if(re=r==="mouseover"||r==="pointerover",ae=r==="mouseout"||r==="pointerout",re&&u!==Pc&&(Me=u.relatedTarget||u.fromElement)&&(sr(Me)||Me[Rr]))break e;if((ae||re)&&(re=se.window===se?se:(re=se.ownerDocument)?re.defaultView||re.parentWindow:window,ae?(Me=u.relatedTarget||u.toElement,ae=ne,Me=Me?sr(Me):null,Me!==null&&(rt=s(Me),Ne=Me.tag,Me!==rt||Ne!==5&&Ne!==27&&Ne!==6)&&(Me=null)):(ae=null,Me=ne),ae!==Me)){if(Ne=eg,oe="onMouseLeave",J="onMouseEnter",G="mouse",(r==="pointerout"||r==="pointerover")&&(Ne=ng,oe="onPointerLeave",J="onPointerEnter",G="pointer"),rt=ae==null?re:zr(ae),ee=Me==null?re:zr(Me),re=new Ne(oe,G+"leave",ae,u,se),re.target=rt,re.relatedTarget=ee,oe=null,sr(se)===ne&&(Ne=new Ne(J,G+"enter",Me,u,se),Ne.target=ee,Ne.relatedTarget=rt,oe=Ne),rt=oe,ae&&Me)t:{for(Ne=ae,J=Me,G=0,ee=Ne;ee;ee=Oa(ee))G++;for(ee=0,oe=J;oe;oe=Oa(oe))ee++;for(;0<G-ee;)Ne=Oa(Ne),G--;for(;0<ee-G;)J=Oa(J),ee--;for(;G--;){if(Ne===J||J!==null&&Ne===J.alternate)break t;Ne=Oa(Ne),J=Oa(J)}Ne=null}else Ne=null;ae!==null&&Z0(fe,re,ae,Ne,!1),Me!==null&&rt!==null&&Z0(fe,rt,Me,Ne,!0)}}e:{if(re=ne?zr(ne):window,ae=re.nodeName&&re.nodeName.toLowerCase(),ae==="select"||ae==="input"&&re.type==="file")var xe=cg;else if(ug(re))if(fg)xe=FE;else{xe=ZE;var Be=$E}else ae=re.nodeName,!ae||ae.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ne&&qc(ne.elementType)&&(xe=cg):xe=YE;if(xe&&(xe=xe(r,ne))){og(fe,xe,u,se);break e}Be&&Be(r,re,ne),r==="focusout"&&ne&&re.type==="number"&&ne.memoizedProps.value!=null&&Uc(re,"number",re.value)}switch(Be=ne?zr(ne):window,r){case"focusin":(ug(Be)||Be.contentEditable==="true")&&(la=Be,tf=ne,El=null);break;case"focusout":El=tf=la=null;break;case"mousedown":nf=!0;break;case"contextmenu":case"mouseup":case"dragend":nf=!1,xg(fe,u,se);break;case"selectionchange":if(XE)break;case"keydown":case"keyup":xg(fe,u,se)}var Se;if(Kc)e:{switch(r){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else aa?lg(r,u)&&(Oe="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Oe="onCompositionStart");Oe&&(rg&&u.locale!=="ko"&&(aa||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&aa&&(Se=Jp()):(Br=se,Yc="value"in Br?Br.value:Br.textContent,aa=!0)),Be=ao(ne,Oe),0<Be.length&&(Oe=new tg(Oe,r,null,u,se),fe.push({event:Oe,listeners:Be}),Se?Oe.data=Se:(Se=sg(u),Se!==null&&(Oe.data=Se)))),(Se=HE?UE(r,u):qE(r,u))&&(Oe=ao(ne,"onBeforeInput"),0<Oe.length&&(Be=new tg("onBeforeInput","beforeinput",null,u,se),fe.push({event:Be,listeners:Oe}),Be.data=Se)),Mk(fe,r,ne,u,se)}V0(fe,a)})}function Jl(r,a,u){return{instance:r,listener:a,currentTarget:u}}function ao(r,a){for(var u=a+"Capture",f=[];r!==null;){var g=r,x=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||x===null||(g=gl(r,u),g!=null&&f.unshift(Jl(r,g,x)),g=gl(r,a),g!=null&&f.push(Jl(r,g,x))),r.tag===3)return f;r=r.return}return[]}function Oa(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Z0(r,a,u,f,g){for(var x=a._reactName,T=[];u!==null&&u!==f;){var z=u,V=z.alternate,ne=z.stateNode;if(z=z.tag,V!==null&&V===f)break;z!==5&&z!==26&&z!==27||ne===null||(V=ne,g?(ne=gl(u,x),ne!=null&&T.unshift(Jl(u,ne,V))):g||(ne=gl(u,x),ne!=null&&T.push(Jl(u,ne,V)))),u=u.return}T.length!==0&&r.push({event:a,listeners:T})}var jk=/\r\n?/g,Lk=/\u0000|\uFFFD/g;function Y0(r){return(typeof r=="string"?r:""+r).replace(jk,`
49
+ `).replace(Lk,"")}function F0(r,a){return a=Y0(a),Y0(r)===a}function lo(){}function nt(r,a,u,f,g,x){switch(u){case"children":typeof f=="string"?a==="body"||a==="textarea"&&f===""||na(r,f):(typeof f=="number"||typeof f=="bigint")&&a!=="body"&&na(r,""+f);break;case"className":Ki(r,"class",f);break;case"tabIndex":Ki(r,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Ki(r,u,f);break;case"style":Xp(r,f,x);break;case"data":if(a!=="object"){Ki(r,"data",f);break}case"src":case"href":if(f===""&&(a!=="a"||u!=="href")){r.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(u);break}f=mu(""+f),r.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){r.setAttribute(u,"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 x=="function"&&(u==="formAction"?(a!=="input"&&nt(r,a,"name",g.name,g,null),nt(r,a,"formEncType",g.formEncType,g,null),nt(r,a,"formMethod",g.formMethod,g,null),nt(r,a,"formTarget",g.formTarget,g,null)):(nt(r,a,"encType",g.encType,g,null),nt(r,a,"method",g.method,g,null),nt(r,a,"target",g.target,g,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(u);break}f=mu(""+f),r.setAttribute(u,f);break;case"onClick":f!=null&&(r.onclick=lo);break;case"onScroll":f!=null&&qe("scroll",r);break;case"onScrollEnd":f!=null&&qe("scrollend",r);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(i(61));if(u=f.__html,u!=null){if(g.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"multiple":r.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":r.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){r.removeAttribute("xlink:href");break}u=mu(""+f),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(u,""+f):r.removeAttribute(u);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":f&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":f===!0?r.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(u,f):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?r.setAttribute(u,f):r.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?r.removeAttribute(u):r.setAttribute(u,f);break;case"popover":qe("beforetoggle",r),qe("toggle",r),Qi(r,"popover",f);break;case"xlinkActuate":Mn(r,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Mn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Mn(r,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Mn(r,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Mn(r,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Mn(r,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Mn(r,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Mn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Mn(r,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Qi(r,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=dE.get(u)||u,Qi(r,u,f))}}function Td(r,a,u,f,g,x){switch(u){case"style":Xp(r,f,x);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(i(61));if(u=f.__html,u!=null){if(g.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"children":typeof f=="string"?na(r,f):(typeof f=="number"||typeof f=="bigint")&&na(r,""+f);break;case"onScroll":f!=null&&qe("scroll",r);break;case"onScrollEnd":f!=null&&qe("scrollend",r);break;case"onClick":f!=null&&(r.onclick=lo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!su.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(g=u.endsWith("Capture"),a=u.slice(2,g?u.length-7:void 0),x=r[Bt]||null,x=x!=null?x[u]:null,typeof x=="function"&&r.removeEventListener(a,x,g),typeof f=="function")){typeof x!="function"&&x!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(a,f,g);break e}u in r?r[u]=f:f===!0?r.setAttribute(u,""):Qi(r,u,f)}}}function Lt(r,a,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",r),qe("load",r);var f=!1,g=!1,x;for(x in u)if(u.hasOwnProperty(x)){var T=u[x];if(T!=null)switch(x){case"src":f=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:nt(r,a,x,T,u,null)}}g&&nt(r,a,"srcSet",u.srcSet,u,null),f&&nt(r,a,"src",u.src,u,null);return;case"input":qe("invalid",r);var z=x=T=g=null,V=null,ne=null;for(f in u)if(u.hasOwnProperty(f)){var se=u[f];if(se!=null)switch(f){case"name":g=se;break;case"type":T=se;break;case"checked":V=se;break;case"defaultChecked":ne=se;break;case"value":x=se;break;case"defaultValue":z=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,a));break;default:nt(r,a,f,se,u,null)}}Zp(r,x,z,V,ne,T,g,!1),Wi(r);return;case"select":qe("invalid",r),f=T=x=null;for(g in u)if(u.hasOwnProperty(g)&&(z=u[g],z!=null))switch(g){case"value":x=z;break;case"defaultValue":T=z;break;case"multiple":f=z;default:nt(r,a,g,z,u,null)}a=x,u=T,r.multiple=!!f,a!=null?ta(r,!!f,a,!1):u!=null&&ta(r,!!f,u,!0);return;case"textarea":qe("invalid",r),x=g=f=null;for(T in u)if(u.hasOwnProperty(T)&&(z=u[T],z!=null))switch(T){case"value":f=z;break;case"defaultValue":g=z;break;case"children":x=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(i(91));break;default:nt(r,a,T,z,u,null)}Fp(r,f,g,x),Wi(r);return;case"option":for(V in u)if(u.hasOwnProperty(V)&&(f=u[V],f!=null))switch(V){case"selected":r.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:nt(r,a,V,f,u,null)}return;case"dialog":qe("beforetoggle",r),qe("toggle",r),qe("cancel",r),qe("close",r);break;case"iframe":case"object":qe("load",r);break;case"video":case"audio":for(f=0;f<Kl.length;f++)qe(Kl[f],r);break;case"image":qe("error",r),qe("load",r);break;case"details":qe("toggle",r);break;case"embed":case"source":case"link":qe("error",r),qe("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in u)if(u.hasOwnProperty(ne)&&(f=u[ne],f!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:nt(r,a,ne,f,u,null)}return;default:if(qc(a)){for(se in u)u.hasOwnProperty(se)&&(f=u[se],f!==void 0&&Td(r,a,se,f,u,void 0));return}}for(z in u)u.hasOwnProperty(z)&&(f=u[z],f!=null&&nt(r,a,z,f,u,null))}function Ik(r,a,u,f){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,x=null,T=null,z=null,V=null,ne=null,se=null;for(ae in u){var fe=u[ae];if(u.hasOwnProperty(ae)&&fe!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":V=fe;default:f.hasOwnProperty(ae)||nt(r,a,ae,null,f,fe)}}for(var re in f){var ae=f[re];if(fe=u[re],f.hasOwnProperty(re)&&(ae!=null||fe!=null))switch(re){case"type":x=ae;break;case"name":g=ae;break;case"checked":ne=ae;break;case"defaultChecked":se=ae;break;case"value":T=ae;break;case"defaultValue":z=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,a));break;default:ae!==fe&&nt(r,a,re,ae,f,fe)}}ea(r,T,z,V,ne,se,x,g);return;case"select":ae=T=z=re=null;for(x in u)if(V=u[x],u.hasOwnProperty(x)&&V!=null)switch(x){case"value":break;case"multiple":ae=V;default:f.hasOwnProperty(x)||nt(r,a,x,null,f,V)}for(g in f)if(x=f[g],V=u[g],f.hasOwnProperty(g)&&(x!=null||V!=null))switch(g){case"value":re=x;break;case"defaultValue":z=x;break;case"multiple":T=x;default:x!==V&&nt(r,a,g,x,f,V)}a=z,u=T,f=ae,re!=null?ta(r,!!u,re,!1):!!f!=!!u&&(a!=null?ta(r,!!u,a,!0):ta(r,!!u,u?[]:"",!1));return;case"textarea":ae=re=null;for(z in u)if(g=u[z],u.hasOwnProperty(z)&&g!=null&&!f.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:nt(r,a,z,null,f,g)}for(T in f)if(g=f[T],x=u[T],f.hasOwnProperty(T)&&(g!=null||x!=null))switch(T){case"value":re=g;break;case"defaultValue":ae=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(i(91));break;default:g!==x&&nt(r,a,T,g,f,x)}Yp(r,re,ae);return;case"option":for(var Me in u)if(re=u[Me],u.hasOwnProperty(Me)&&re!=null&&!f.hasOwnProperty(Me))switch(Me){case"selected":r.selected=!1;break;default:nt(r,a,Me,null,f,re)}for(V in f)if(re=f[V],ae=u[V],f.hasOwnProperty(V)&&re!==ae&&(re!=null||ae!=null))switch(V){case"selected":r.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:nt(r,a,V,re,f,ae)}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 Ne in u)re=u[Ne],u.hasOwnProperty(Ne)&&re!=null&&!f.hasOwnProperty(Ne)&&nt(r,a,Ne,null,f,re);for(ne in f)if(re=f[ne],ae=u[ne],f.hasOwnProperty(ne)&&re!==ae&&(re!=null||ae!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(i(137,a));break;default:nt(r,a,ne,re,f,ae)}return;default:if(qc(a)){for(var rt in u)re=u[rt],u.hasOwnProperty(rt)&&re!==void 0&&!f.hasOwnProperty(rt)&&Td(r,a,rt,void 0,f,re);for(se in f)re=f[se],ae=u[se],!f.hasOwnProperty(se)||re===ae||re===void 0&&ae===void 0||Td(r,a,se,re,f,ae);return}}for(var J in u)re=u[J],u.hasOwnProperty(J)&&re!=null&&!f.hasOwnProperty(J)&&nt(r,a,J,null,f,re);for(fe in f)re=f[fe],ae=u[fe],!f.hasOwnProperty(fe)||re===ae||re==null&&ae==null||nt(r,a,fe,re,f,ae)}var Cd=null,Ad=null;function so(r){return r.nodeType===9?r:r.ownerDocument}function G0(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function X0(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function Nd(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Od=null;function Bk(){var r=window.event;return r&&r.type==="popstate"?r===Od?!1:(Od=r,!0):(Od=null,!1)}var Q0=typeof setTimeout=="function"?setTimeout:void 0,Hk=typeof clearTimeout=="function"?clearTimeout:void 0,K0=typeof Promise=="function"?Promise:void 0,Uk=typeof queueMicrotask=="function"?queueMicrotask:typeof K0<"u"?function(r){return K0.resolve(null).then(r).catch(qk)}:Q0;function qk(r){setTimeout(function(){throw r})}function ei(r){return r==="head"}function J0(r,a){var u=a,f=0,g=0;do{var x=u.nextSibling;if(r.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"){if(0<f&&8>f){u=f;var T=r.ownerDocument;if(u&1&&Wl(T.documentElement),u&2&&Wl(T.body),u&4)for(u=T.head,Wl(u),T=u.firstChild;T;){var z=T.nextSibling,V=T.nodeName;T[wi]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&T.rel.toLowerCase()==="stylesheet"||u.removeChild(T),T=z}}if(g===0){r.removeChild(x),ss(a);return}g--}else u==="$"||u==="$?"||u==="$!"?g++:f=u.charCodeAt(0)-48;else f=0;u=x}while(u);ss(a)}function Md(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var u=a;switch(a=a.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Md(u),fl(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function Pk(r,a,u,f){for(;r.nodeType===1;){var g=u;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!f&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(f){if(!r[wi])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(x=r.getAttribute("rel"),x==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(x!==g.rel||r.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||r.getAttribute("title")!==(g.title==null?null:g.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(x=r.getAttribute("src"),(x!==(g.src==null?null:g.src)||r.getAttribute("type")!==(g.type==null?null:g.type)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&x&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var x=g.name==null?null:""+g.name;if(g.type==="hidden"&&r.getAttribute("name")===x)return r}else return r;if(r=Dn(r.nextSibling),r===null)break}return null}function Vk(r,a,u){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!u||(r=Dn(r.nextSibling),r===null))return null;return r}function Rd(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState==="complete"}function $k(r,a){var u=r.ownerDocument;if(r.data!=="$?"||u.readyState==="complete")a();else{var f=function(){a(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),r._reactRetry=f}}function Dn(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="F!"||a==="F")break;if(a==="/$")return null}}return r}var zd=null;function W0(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(a===0)return r;a--}else u==="/$"&&a++}r=r.previousSibling}return null}function ev(r,a,u){switch(a=so(u),r){case"html":if(r=a.documentElement,!r)throw Error(i(452));return r;case"head":if(r=a.head,!r)throw Error(i(453));return r;case"body":if(r=a.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function Wl(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);fl(r)}var Tn=new Map,tv=new Set;function uo(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Sr=P.d;P.d={f:Zk,r:Yk,D:Fk,C:Gk,L:Xk,m:Qk,X:Jk,S:Kk,M:Wk};function Zk(){var r=Sr.f(),a=Wu();return r||a}function Yk(r){var a=ur(r);a!==null&&a.tag===5&&a.type==="form"?_y(a):Sr.r(r)}var Ma=typeof document>"u"?null:document;function nv(r,a,u){var f=Ma;if(f&&typeof a=="string"&&a){var g=Qt(a);g='link[rel="'+r+'"][href="'+g+'"]',typeof u=="string"&&(g+='[crossorigin="'+u+'"]'),tv.has(g)||(tv.add(g),r={rel:r,crossOrigin:u,href:a},f.querySelector(g)===null&&(a=f.createElement("link"),Lt(a,"link",r),_t(a),f.head.appendChild(a)))}}function Fk(r){Sr.D(r),nv("dns-prefetch",r,null)}function Gk(r,a){Sr.C(r,a),nv("preconnect",r,a)}function Xk(r,a,u){Sr.L(r,a,u);var f=Ma;if(f&&r&&a){var g='link[rel="preload"][as="'+Qt(a)+'"]';a==="image"&&u&&u.imageSrcSet?(g+='[imagesrcset="'+Qt(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(g+='[imagesizes="'+Qt(u.imageSizes)+'"]')):g+='[href="'+Qt(r)+'"]';var x=g;switch(a){case"style":x=Ra(r);break;case"script":x=za(r)}Tn.has(x)||(r=m({rel:"preload",href:a==="image"&&u&&u.imageSrcSet?void 0:r,as:a},u),Tn.set(x,r),f.querySelector(g)!==null||a==="style"&&f.querySelector(es(x))||a==="script"&&f.querySelector(ts(x))||(a=f.createElement("link"),Lt(a,"link",r),_t(a),f.head.appendChild(a)))}}function Qk(r,a){Sr.m(r,a);var u=Ma;if(u&&r){var f=a&&typeof a.as=="string"?a.as:"script",g='link[rel="modulepreload"][as="'+Qt(f)+'"][href="'+Qt(r)+'"]',x=g;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=za(r)}if(!Tn.has(x)&&(r=m({rel:"modulepreload",href:r},a),Tn.set(x,r),u.querySelector(g)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(ts(x)))return}f=u.createElement("link"),Lt(f,"link",r),_t(f),u.head.appendChild(f)}}}function Kk(r,a,u){Sr.S(r,a,u);var f=Ma;if(f&&r){var g=Dr(f).hoistableStyles,x=Ra(r);a=a||"default";var T=g.get(x);if(!T){var z={loading:0,preload:null};if(T=f.querySelector(es(x)))z.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":a},u),(u=Tn.get(x))&&Dd(r,u);var V=T=f.createElement("link");_t(V),Lt(V,"link",r),V._p=new Promise(function(ne,se){V.onload=ne,V.onerror=se}),V.addEventListener("load",function(){z.loading|=1}),V.addEventListener("error",function(){z.loading|=2}),z.loading|=4,oo(T,a,f)}T={type:"stylesheet",instance:T,count:1,state:z},g.set(x,T)}}}function Jk(r,a){Sr.X(r,a);var u=Ma;if(u&&r){var f=Dr(u).hoistableScripts,g=za(r),x=f.get(g);x||(x=u.querySelector(ts(g)),x||(r=m({src:r,async:!0},a),(a=Tn.get(g))&&jd(r,a),x=u.createElement("script"),_t(x),Lt(x,"link",r),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(g,x))}}function Wk(r,a){Sr.M(r,a);var u=Ma;if(u&&r){var f=Dr(u).hoistableScripts,g=za(r),x=f.get(g);x||(x=u.querySelector(ts(g)),x||(r=m({src:r,async:!0,type:"module"},a),(a=Tn.get(g))&&jd(r,a),x=u.createElement("script"),_t(x),Lt(x,"link",r),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(g,x))}}function rv(r,a,u,f){var g=(g=W.current)?uo(g):null;if(!g)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(a=Ra(u.href),u=Dr(g).hoistableStyles,f=u.get(a),f||(f={type:"style",instance:null,count:0,state:null},u.set(a,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=Ra(u.href);var x=Dr(g).hoistableStyles,T=x.get(r);if(T||(g=g.ownerDocument||g,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(r,T),(x=g.querySelector(es(r)))&&!x._p&&(T.instance=x,T.state.loading=5),Tn.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Tn.set(r,u),x||eT(g,r,u,T.state))),a&&f===null)throw Error(i(528,""));return T}if(a&&f!==null)throw Error(i(529,""));return null;case"script":return a=u.async,u=u.src,typeof u=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=za(u),u=Dr(g).hoistableScripts,f=u.get(a),f||(f={type:"script",instance:null,count:0,state:null},u.set(a,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function Ra(r){return'href="'+Qt(r)+'"'}function es(r){return'link[rel="stylesheet"]['+r+"]"}function iv(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function eT(r,a,u,f){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?f.loading=1:(a=r.createElement("link"),f.preload=a,a.addEventListener("load",function(){return f.loading|=1}),a.addEventListener("error",function(){return f.loading|=2}),Lt(a,"link",u),_t(a),r.head.appendChild(a))}function za(r){return'[src="'+Qt(r)+'"]'}function ts(r){return"script[async]"+r}function av(r,a,u){if(a.count++,a.instance===null)switch(a.type){case"style":var f=r.querySelector('style[data-href~="'+Qt(u.href)+'"]');if(f)return a.instance=f,_t(f),f;var g=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(r.ownerDocument||r).createElement("style"),_t(f),Lt(f,"style",g),oo(f,u.precedence,r),a.instance=f;case"stylesheet":g=Ra(u.href);var x=r.querySelector(es(g));if(x)return a.state.loading|=4,a.instance=x,_t(x),x;f=iv(u),(g=Tn.get(g))&&Dd(f,g),x=(r.ownerDocument||r).createElement("link"),_t(x);var T=x;return T._p=new Promise(function(z,V){T.onload=z,T.onerror=V}),Lt(x,"link",f),a.state.loading|=4,oo(x,u.precedence,r),a.instance=x;case"script":return x=za(u.src),(g=r.querySelector(ts(x)))?(a.instance=g,_t(g),g):(f=u,(g=Tn.get(x))&&(f=m({},u),jd(f,g)),r=r.ownerDocument||r,g=r.createElement("script"),_t(g),Lt(g,"link",f),r.head.appendChild(g),a.instance=g);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(f=a.instance,a.state.loading|=4,oo(f,u.precedence,r));return a.instance}function oo(r,a,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=f.length?f[f.length-1]:null,x=g,T=0;T<f.length;T++){var z=f[T];if(z.dataset.precedence===a)x=z;else if(x!==g)break}x?x.parentNode.insertBefore(r,x.nextSibling):(a=u.nodeType===9?u.head:u,a.insertBefore(r,a.firstChild))}function Dd(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.title==null&&(r.title=a.title)}function jd(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.integrity==null&&(r.integrity=a.integrity)}var co=null;function lv(r,a,u){if(co===null){var f=new Map,g=co=new Map;g.set(u,f)}else g=co,f=g.get(u),f||(f=new Map,g.set(u,f));if(f.has(r))return f;for(f.set(r,null),u=u.getElementsByTagName(r),g=0;g<u.length;g++){var x=u[g];if(!(x[wi]||x[Ot]||r==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var T=x.getAttribute(a)||"";T=r+T;var z=f.get(T);z?z.push(x):f.set(T,[x])}}return f}function sv(r,a,u){r=r.ownerDocument||r,r.head.insertBefore(u,a==="title"?r.querySelector("head > title"):null)}function tT(r,a,u){if(u===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return r=a.disabled,typeof a.precedence=="string"&&r==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function uv(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}var ns=null;function nT(){}function rT(r,a,u){if(ns===null)throw Error(i(475));var f=ns;if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var g=Ra(u.href),x=r.querySelector(es(g));if(x){r=x._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(f.count++,f=fo.bind(f),r.then(f,f)),a.state.loading|=4,a.instance=x,_t(x);return}x=r.ownerDocument||r,u=iv(u),(g=Tn.get(g))&&Dd(u,g),x=x.createElement("link"),_t(x);var T=x;T._p=new Promise(function(z,V){T.onload=z,T.onerror=V}),Lt(x,"link",u),a.instance=x}f.stylesheets===null&&(f.stylesheets=new Map),f.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(f.count++,a=fo.bind(f),r.addEventListener("load",a),r.addEventListener("error",a))}}function iT(){if(ns===null)throw Error(i(475));var r=ns;return r.stylesheets&&r.count===0&&Ld(r,r.stylesheets),0<r.count?function(a){var u=setTimeout(function(){if(r.stylesheets&&Ld(r,r.stylesheets),r.unsuspend){var f=r.unsuspend;r.unsuspend=null,f()}},6e4);return r.unsuspend=a,function(){r.unsuspend=null,clearTimeout(u)}}:null}function fo(){if(this.count--,this.count===0){if(this.stylesheets)Ld(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var ho=null;function Ld(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,ho=new Map,a.forEach(aT,r),ho=null,fo.call(r))}function aT(r,a){if(!(a.state.loading&4)){var u=ho.get(r);if(u)var f=u.get(null);else{u=new Map,ho.set(r,u);for(var g=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<g.length;x++){var T=g[x];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(u.set(T.dataset.precedence,T),f=T)}f&&u.set(null,f)}g=a.instance,T=g.getAttribute("data-precedence"),x=u.get(T)||f,x===f&&u.set(null,g),u.set(T,g),this.count++,f=fo.bind(this),g.addEventListener("load",f),g.addEventListener("error",f),x?x.parentNode.insertBefore(g,x.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(g,r.firstChild)),a.state.loading|=4}}var rs={$$typeof:E,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function lT(r,a,u,f,g,x,T,z){this.tag=1,this.containerInfo=r,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=ll(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ll(0),this.hiddenUpdates=ll(null),this.identifierPrefix=f,this.onUncaughtError=g,this.onCaughtError=x,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function ov(r,a,u,f,g,x,T,z,V,ne,se,fe){return r=new lT(r,a,u,T,z,V,ne,fe),a=1,x===!0&&(a|=24),x=sn(3,null,null,a),r.current=x,x.stateNode=r,a=yf(),a.refCount++,r.pooledCache=a,a.refCount++,x.memoizedState={element:f,isDehydrated:u,cache:a},_f(x),r}function cv(r){return r?(r=ca,r):ca}function fv(r,a,u,f,g,x){g=cv(g),f.context===null?f.context=g:f.pendingContext=g,f=qr(a),f.payload={element:u},x=x===void 0?null:x,x!==null&&(f.callback=x),u=Pr(r,f,a),u!==null&&(dn(u,r,a),zl(u,r,a))}function dv(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<a?u:a}}function Id(r,a){dv(r,a),(r=r.alternate)&&dv(r,a)}function hv(r){if(r.tag===13){var a=oa(r,67108864);a!==null&&dn(a,r,67108864),Id(r,67108864)}}var mo=!0;function sT(r,a,u,f){var g=j.T;j.T=null;var x=P.p;try{P.p=2,Bd(r,a,u,f)}finally{P.p=x,j.T=g}}function uT(r,a,u,f){var g=j.T;j.T=null;var x=P.p;try{P.p=8,Bd(r,a,u,f)}finally{P.p=x,j.T=g}}function Bd(r,a,u,f){if(mo){var g=Hd(f);if(g===null)kd(r,a,f,po,u),pv(r,f);else if(cT(g,r,a,u,f))f.stopPropagation();else if(pv(r,f),a&4&&-1<oT.indexOf(r)){for(;g!==null;){var x=ur(g);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var T=$t(x.pendingLanes);if(T!==0){var z=x;for(z.pendingLanes|=2,z.entangledLanes|=2;T;){var V=1<<31-Te(T);z.entanglements[1]|=V,T&=~V}Jn(x),(Je&6)===0&&(Ku=xt()+500,Ql(0))}}break;case 13:z=oa(x,2),z!==null&&dn(z,x,2),Wu(),Id(x,2)}if(x=Hd(f),x===null&&kd(r,a,f,po,u),x===g)break;g=x}g!==null&&f.stopPropagation()}else kd(r,a,f,null,u)}}function Hd(r){return r=Vc(r),Ud(r)}var po=null;function Ud(r){if(po=null,r=sr(r),r!==null){var a=s(r);if(a===null)r=null;else{var u=a.tag;if(u===13){if(r=o(a),r!==null)return r;r=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return po=r,null}function mv(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(xi()){case ar:return 2;case Nn:return 8;case $n:case lr:return 32;case Zn:return 268435456;default:return 32}default:return 32}}var qd=!1,ti=null,ni=null,ri=null,is=new Map,as=new Map,ii=[],oT="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 pv(r,a){switch(r){case"focusin":case"focusout":ti=null;break;case"dragenter":case"dragleave":ni=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":is.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":as.delete(a.pointerId)}}function ls(r,a,u,f,g,x){return r===null||r.nativeEvent!==x?(r={blockedOn:a,domEventName:u,eventSystemFlags:f,nativeEvent:x,targetContainers:[g]},a!==null&&(a=ur(a),a!==null&&hv(a)),r):(r.eventSystemFlags|=f,a=r.targetContainers,g!==null&&a.indexOf(g)===-1&&a.push(g),r)}function cT(r,a,u,f,g){switch(a){case"focusin":return ti=ls(ti,r,a,u,f,g),!0;case"dragenter":return ni=ls(ni,r,a,u,f,g),!0;case"mouseover":return ri=ls(ri,r,a,u,f,g),!0;case"pointerover":var x=g.pointerId;return is.set(x,ls(is.get(x)||null,r,a,u,f,g)),!0;case"gotpointercapture":return x=g.pointerId,as.set(x,ls(as.get(x)||null,r,a,u,f,g)),!0}return!1}function gv(r){var a=sr(r.target);if(a!==null){var u=s(a);if(u!==null){if(a=u.tag,a===13){if(a=o(u),a!==null){r.blockedOn=a,Dc(r.priority,function(){if(u.tag===13){var f=fn();f=ul(f);var g=oa(u,f);g!==null&&dn(g,u,f),Id(u,f)}});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function go(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var u=Hd(r.nativeEvent);if(u===null){u=r.nativeEvent;var f=new u.constructor(u.type,u);Pc=f,u.target.dispatchEvent(f),Pc=null}else return a=ur(u),a!==null&&hv(a),r.blockedOn=u,!1;a.shift()}return!0}function yv(r,a,u){go(r)&&u.delete(a)}function fT(){qd=!1,ti!==null&&go(ti)&&(ti=null),ni!==null&&go(ni)&&(ni=null),ri!==null&&go(ri)&&(ri=null),is.forEach(yv),as.forEach(yv)}function yo(r,a){r.blockedOn===a&&(r.blockedOn=null,qd||(qd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fT)))}var vo=null;function vv(r){vo!==r&&(vo=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){vo===r&&(vo=null);for(var a=0;a<r.length;a+=3){var u=r[a],f=r[a+1],g=r[a+2];if(typeof f!="function"){if(Ud(f||u)===null)continue;break}var x=ur(u);x!==null&&(r.splice(a,3),a-=3,Uf(x,{pending:!0,data:g,method:u.method,action:f},f,g))}}))}function ss(r){function a(V){return yo(V,r)}ti!==null&&yo(ti,r),ni!==null&&yo(ni,r),ri!==null&&yo(ri,r),is.forEach(a),as.forEach(a);for(var u=0;u<ii.length;u++){var f=ii[u];f.blockedOn===r&&(f.blockedOn=null)}for(;0<ii.length&&(u=ii[0],u.blockedOn===null);)gv(u),u.blockedOn===null&&ii.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var g=u[f],x=u[f+1],T=g[Bt]||null;if(typeof x=="function")T||vv(u);else if(T){var z=null;if(x&&x.hasAttribute("formAction")){if(g=x,T=x[Bt]||null)z=T.formAction;else if(Ud(g)!==null)continue}else z=T.action;typeof z=="function"?u[f+1]=z:(u.splice(f,3),f-=3),vv(u)}}}function Pd(r){this._internalRoot=r}xo.prototype.render=Pd.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(i(409));var u=a.current,f=fn();fv(u,f,r,a,null,null)},xo.prototype.unmount=Pd.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;fv(r.current,2,null,r,null,null),Wu(),a[Rr]=null}};function xo(r){this._internalRoot=r}xo.prototype.unstable_scheduleHydration=function(r){if(r){var a=iu();r={blockedOn:null,target:r,priority:a};for(var u=0;u<ii.length&&a!==0&&a<ii[u].priority;u++);ii.splice(u,0,r),u===0&&gv(r)}};var xv=t.version;if(xv!=="19.1.0")throw Error(i(527,xv,"19.1.0"));P.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=d(a),r=r!==null?h(r):null,r=r===null?null:r.stateNode,r};var dT={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bo.isDisabled&&bo.supportsFiber)try{le=bo.inject(dT),de=bo}catch{}}return os.createRoot=function(r,a){if(!l(r))throw Error(i(299));var u=!1,f="",g=jy,x=Ly,T=Iy,z=null;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(T=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(z=a.unstable_transitionCallbacks)),a=ov(r,1,!1,null,null,u,f,g,x,T,z,null),r[Rr]=a.current,Ed(r),new Pd(a)},os.hydrateRoot=function(r,a,u){if(!l(r))throw Error(i(299));var f=!1,g="",x=jy,T=Ly,z=Iy,V=null,ne=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(T=u.onCaughtError),u.onRecoverableError!==void 0&&(z=u.onRecoverableError),u.unstable_transitionCallbacks!==void 0&&(V=u.unstable_transitionCallbacks),u.formState!==void 0&&(ne=u.formState)),a=ov(r,1,!0,a,u??null,f,g,x,T,z,V,ne),a.context=cv(null),u=a.current,f=fn(),f=ul(f),g=qr(f),g.callback=null,Pr(u,g,f),u=f,a.current.lanes=u,_i(a,u),Jn(a),r[Rr]=a.current,Ed(r),new xo(a)},os.version="19.1.0",os}var Nv;function ST(){if(Nv)return $d.exports;Nv=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(),$d.exports=wT(),$d.exports}var ET=ST();const kT=yi(ET);var ie=Zs();const TT=yi(ie),CT=({content:e})=>{const t=()=>typeof e=="string"?I.jsx("div",{className:"message-text",children:e}):Array.isArray(e)?e.map((n,i)=>{switch(n.type){case"text":return I.jsx("div",{className:"message-text",children:n.text},i);case"image_url":return I.jsx("div",{className:"message-image",children:I.jsx("img",{src:n.image_url.url,alt:"用户上传的图片",style:{maxWidth:"200px",borderRadius:"4px"}})},i);case"audio":return I.jsx("div",{className:"message-audio",children:I.jsx("audio",{controls:!0,src:n.audio_url,children:"您的浏览器不支持音频播放"})},i);default:return I.jsx("div",{className:"message-text",children:JSON.stringify(n)},i)}}):I.jsx("div",{className:"message-text",children:JSON.stringify(e)});return I.jsx("div",{className:"message human",children:I.jsx("div",{className:"message-content",children:t()})})},op=({usage_metadata:e,spend_time:t,response_metadata:n,id:i,tool_call_id:l})=>{const s=o=>o.toString();return I.jsxs("div",{className:"message-meta",children:[I.jsxs("div",{className:"token-info",children:[I.jsxs("span",{className:"token-item",children:[I.jsx("span",{className:"token-emoji",children:"📥"}),s(e.input_tokens||0)]}),I.jsxs("span",{className:"token-item",children:[I.jsx("span",{className:"token-emoji",children:"📤"}),s(e.output_tokens||0)]}),I.jsxs("span",{className:"token-item",children:[I.jsx("span",{className:"token-emoji",children:"📊"}),s(e.total_tokens||0)]})]}),I.jsx("div",{children:n==null?void 0:n.model_name}),I.jsx("span",{className:"message-time",children:t?`${(t/1e3).toFixed(2)}s`:""}),l&&I.jsxs("span",{className:"tool-call-id",children:["Tool: ",l]}),i&&I.jsxs("span",{className:"message-id",children:["ID: ",i]})]})};var cs={exports:{}},Xd={},Qd,Ov;function AT(){if(Ov)return Qd;Ov=1;function e(t,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=n||{},this._maxRetryTime=n&&n.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return Qd=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var n=new Date().getTime();if(t&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var i=this._timeouts.shift();if(i===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1);else return!1;var l=this;return this._timer=setTimeout(function(){l._attempts++,l._operationTimeoutCb&&(l._timeout=setTimeout(function(){l._operationTimeoutCb(l._attempts)},l._operationTimeout),l._options.unref&&l._timeout.unref()),l._fn(l._attempts)},i),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,n){this._fn=t,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},n=null,i=0,l=0;l<this._errors.length;l++){var s=this._errors[l],o=s.message,c=(t[o]||0)+1;t[o]=c,c>=i&&(n=s,i=c)}return n},Qd}var Mv;function NT(){return Mv||(Mv=1,function(e){var t=AT();e.operation=function(n){var i=e.timeouts(n);return new t(i,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(n){if(n instanceof Array)return[].concat(n);var i={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var l in n)i[l]=n[l];if(i.minTimeout>i.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],o=0;o<i.retries;o++)s.push(this.createTimeout(o,i));return n&&n.forever&&!s.length&&s.push(this.createTimeout(o,i)),s.sort(function(c,d){return c-d}),s},e.createTimeout=function(n,i){var l=i.randomize?Math.random()+1:1,s=Math.round(l*Math.max(i.minTimeout,1)*Math.pow(i.factor,n));return s=Math.min(s,i.maxTimeout),s},e.wrap=function(n,i,l){if(i instanceof Array&&(l=i,i=null),!l){l=[];for(var s in n)typeof n[s]=="function"&&l.push(s)}for(var o=0;o<l.length;o++){var c=l[o],d=n[c];n[c]=(function(m){var p=e.operation(i),y=Array.prototype.slice.call(arguments,1),v=y.pop();y.push(function(b){p.retry(b)||(b&&(arguments[0]=p.mainError()),v.apply(this,arguments))}),p.attempt(function(){m.apply(n,y)})}).bind(n,d),n[c].options=i}}}(Xd)),Xd}var Kd,Rv;function OT(){return Rv||(Rv=1,Kd=NT()),Kd}var zv;function MT(){if(zv)return cs.exports;zv=1;const e=OT(),t=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class n extends Error{constructor(c){super(),c instanceof Error?(this.originalError=c,{message:c}=c):(this.originalError=new Error(c),this.originalError.stack=this.stack),this.name="AbortError",this.message=c}}const i=(o,c,d)=>{const h=d.retries-(c-1);return o.attemptNumber=c,o.retriesLeft=h,o},l=o=>t.includes(o),s=(o,c)=>new Promise((d,h)=>{c={onFailedAttempt:()=>{},retries:10,...c};const m=e.operation(c);m.attempt(async p=>{try{d(await o(p))}catch(y){if(!(y instanceof Error)){h(new TypeError(`Non-error was thrown: "${y}". You should only throw errors.`));return}if(y instanceof n)m.stop(),h(y.originalError);else if(y instanceof TypeError&&!l(y.message))m.stop(),h(y);else{i(y,p,c);try{await c.onFailedAttempt(y)}catch(v){h(v);return}m.retry(y)||h(m.mainError())}}})});return cs.exports=s,cs.exports.default=s,cs.exports.AbortError=n,cs.exports}var RT=MT();const zT=yi(RT);var _o={},Jd={exports:{}},Dv;function DT(){return Dv||(Dv=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function l(d,h,m){this.fn=d,this.context=h,this.once=m||!1}function s(d,h,m,p,y){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new l(m,p||d,y),b=n?n+h:h;return d._events[b]?d._events[b].fn?d._events[b]=[d._events[b],v]:d._events[b].push(v):(d._events[b]=v,d._eventsCount++),d}function o(d,h){--d._eventsCount===0?d._events=new i:delete d._events[h]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var h=[],m,p;if(this._eventsCount===0)return h;for(p in m=this._events)t.call(m,p)&&h.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},c.prototype.listeners=function(h){var m=n?n+h:h,p=this._events[m];if(!p)return[];if(p.fn)return[p.fn];for(var y=0,v=p.length,b=new Array(v);y<v;y++)b[y]=p[y].fn;return b},c.prototype.listenerCount=function(h){var m=n?n+h:h,p=this._events[m];return p?p.fn?1:p.length:0},c.prototype.emit=function(h,m,p,y,v,b){var _=n?n+h:h;if(!this._events[_])return!1;var S=this._events[_],k=arguments.length,A,E;if(S.fn){switch(S.once&&this.removeListener(h,S.fn,void 0,!0),k){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,m),!0;case 3:return S.fn.call(S.context,m,p),!0;case 4:return S.fn.call(S.context,m,p,y),!0;case 5:return S.fn.call(S.context,m,p,y,v),!0;case 6:return S.fn.call(S.context,m,p,y,v,b),!0}for(E=1,A=new Array(k-1);E<k;E++)A[E-1]=arguments[E];S.fn.apply(S.context,A)}else{var O=S.length,D;for(E=0;E<O;E++)switch(S[E].once&&this.removeListener(h,S[E].fn,void 0,!0),k){case 1:S[E].fn.call(S[E].context);break;case 2:S[E].fn.call(S[E].context,m);break;case 3:S[E].fn.call(S[E].context,m,p);break;case 4:S[E].fn.call(S[E].context,m,p,y);break;default:if(!A)for(D=1,A=new Array(k-1);D<k;D++)A[D-1]=arguments[D];S[E].fn.apply(S[E].context,A)}}return!0},c.prototype.on=function(h,m,p){return s(this,h,m,p,!1)},c.prototype.once=function(h,m,p){return s(this,h,m,p,!0)},c.prototype.removeListener=function(h,m,p,y){var v=n?n+h:h;if(!this._events[v])return this;if(!m)return o(this,v),this;var b=this._events[v];if(b.fn)b.fn===m&&(!y||b.once)&&(!p||b.context===p)&&o(this,v);else{for(var _=0,S=[],k=b.length;_<k;_++)(b[_].fn!==m||y&&!b[_].once||p&&b[_].context!==p)&&S.push(b[_]);S.length?this._events[v]=S.length===1?S[0]:S:o(this,v)}return this},c.prototype.removeAllListeners=function(h){var m;return h?(m=n?n+h:h,this._events[m]&&o(this,m)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c}(Jd)),Jd.exports}var fs={exports:{}},Wd,jv;function jT(){return jv||(jv=1,Wd=(e,t)=>(t=t||(()=>{}),e.then(n=>new Promise(i=>{i(t())}).then(()=>n),n=>new Promise(i=>{i(t())}).then(()=>{throw n})))),Wd}var Lv;function LT(){if(Lv)return fs.exports;Lv=1;const e=jT();class t extends Error{constructor(l){super(l),this.name="TimeoutError"}}const n=(i,l,s)=>new Promise((o,c)=>{if(typeof l!="number"||l<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(l===1/0){o(i);return}const d=setTimeout(()=>{if(typeof s=="function"){try{o(s())}catch(p){c(p)}return}const h=typeof s=="string"?s:`Promise timed out after ${l} milliseconds`,m=s instanceof Error?s:new t(h);typeof i.cancel=="function"&&i.cancel(),c(m)},l);e(i.then(o,c),()=>{clearTimeout(d)})});return fs.exports=n,fs.exports.default=n,fs.exports.TimeoutError=t,fs.exports}var wo={},So={},Iv;function IT(){if(Iv)return So;Iv=1,Object.defineProperty(So,"__esModule",{value:!0});function e(t,n,i){let l=0,s=t.length;for(;s>0;){const o=s/2|0;let c=l+o;i(t[c],n)<=0?(l=++c,s-=o+1):s=o}return l}return So.default=e,So}var Bv;function BT(){if(Bv)return wo;Bv=1,Object.defineProperty(wo,"__esModule",{value:!0});const e=IT();class t{constructor(){this._queue=[]}enqueue(i,l){l=Object.assign({priority:0},l);const s={priority:l.priority,run:i};if(this.size&&this._queue[this.size-1].priority>=l.priority){this._queue.push(s);return}const o=e.default(this._queue,s,(c,d)=>d.priority-c.priority);this._queue.splice(o,0,s)}dequeue(){const i=this._queue.shift();return i==null?void 0:i.run}filter(i){return this._queue.filter(l=>l.priority===i.priority).map(l=>l.run)}get size(){return this._queue.length}}return wo.default=t,wo}var Hv;function HT(){if(Hv)return _o;Hv=1,Object.defineProperty(_o,"__esModule",{value:!0});const e=DT(),t=LT(),n=BT(),i=()=>{},l=new t.TimeoutError;class s extends e{constructor(c){var d,h,m,p;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=i,this._resolveIdle=i,c=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:n.default},c),!(typeof c.intervalCap=="number"&&c.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(h=(d=c.intervalCap)===null||d===void 0?void 0:d.toString())!==null&&h!==void 0?h:""}\` (${typeof c.intervalCap})`);if(c.interval===void 0||!(Number.isFinite(c.interval)&&c.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(p=(m=c.interval)===null||m===void 0?void 0:m.toString())!==null&&p!==void 0?p:""}\` (${typeof c.interval})`);this._carryoverConcurrencyCount=c.carryoverConcurrencyCount,this._isIntervalIgnored=c.intervalCap===1/0||c.interval===0,this._intervalCap=c.intervalCap,this._interval=c.interval,this._queue=new c.queueClass,this._queueClass=c.queueClass,this.concurrency=c.concurrency,this._timeout=c.timeout,this._throwOnTimeout=c.throwOnTimeout===!0,this._isPaused=c.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=i,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=i,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const c=Date.now();if(this._intervalId===void 0){const d=this._intervalEnd-c;if(d<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},d)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const c=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const d=this._queue.dequeue();return d?(this.emit("active"),d(),c&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(c){if(!(typeof c=="number"&&c>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${c}\` (${typeof c})`);this._concurrency=c,this._processQueue()}async add(c,d={}){return new Promise((h,m)=>{const p=async()=>{this._pendingCount++,this._intervalCount++;try{const y=this._timeout===void 0&&d.timeout===void 0?c():t.default(Promise.resolve(c()),d.timeout===void 0?this._timeout:d.timeout,()=>{(d.throwOnTimeout===void 0?this._throwOnTimeout:d.throwOnTimeout)&&m(l)});h(await y)}catch(y){m(y)}this._next()};this._queue.enqueue(p,d),this._tryToStartAnother(),this.emit("add")})}async addAll(c,d){return Promise.all(c.map(async h=>this.add(h,d)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(c=>{const d=this._resolveEmpty;this._resolveEmpty=()=>{d(),c()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(c=>{const d=this._resolveIdle;this._resolveIdle=()=>{d(),c()}})}get size(){return this._queue.size}sizeBy(c){return this._queue.filter(c).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(c){this._timeout=c}}return _o.default=s,_o}var UT=HT();const eh=yi(UT),qT=(...e)=>fetch(...e),PT=Symbol.for("lg:fetch_implementation"),VT=()=>globalThis[PT]??qT,$T=[400,401,402,403,404,405,406,407,408,409,422];function ZT(e){return e==null||typeof e!="object"?!1:"status"in e&&"statusText"in e&&"text"in e}class Ns extends Error{constructor(t,n,i){super(`HTTP ${t}: ${n}`),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.status=t,this.text=n,this.response=i}static async fromResponse(t,n){try{return new Ns(t.status,await t.text(),n!=null&&n.includeResponse?t:void 0)}catch{return new Ns(t.status,t.statusText,n!=null&&n.includeResponse?t:void 0)}}}class YT{constructor(t){Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"customFetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxConcurrency=t.maxConcurrency??1/0,this.maxRetries=t.maxRetries??4,"default"in eh?this.queue=new eh.default({concurrency:this.maxConcurrency}):this.queue=new eh({concurrency:this.maxConcurrency}),this.onFailedResponseHook=t==null?void 0:t.onFailedResponseHook,this.customFetch=t.fetch}call(t,...n){const i=this.onFailedResponseHook;return this.queue.add(()=>zT(()=>t(...n).catch(async l=>{throw l instanceof Error?l:ZT(l)?await Ns.fromResponse(l,{includeResponse:!!i}):new Error(l)}),{async onFailedAttempt(l){if(l.message.startsWith("Cancel")||l.message.startsWith("TimeoutError")||l.message.startsWith("AbortError")||(l==null?void 0:l.code)==="ECONNABORTED")throw l;if(l instanceof Ns){if($T.includes(l.status))throw l;i&&l.response&&await i(l.response)}},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(t,n,...i){return t.signal?Promise.race([this.call(n,...i),new Promise((l,s)=>{var o;(o=t.signal)==null||o.addEventListener("abort",()=>{s(new Error("AbortError"))})})]):this.call(n,...i)}fetch(...t){const n=this.customFetch??VT();return this.call(()=>n(...t).then(i=>i.ok?i:Promise.reject(i)))}}var th={};function FT(e){try{return typeof process<"u"?th==null?void 0:th[e]:void 0}catch{return}}function GT(...e){const t=e.filter(i=>i!=null);if(t.length===0)return;if(t.length===1)return t[0];const n=new AbortController;for(const i of e){if(i!=null&&i.aborted)return n.abort(i.reason),n.signal;i==null||i.addEventListener("abort",()=>n.abort(i.reason),{once:!0})}return n.signal}const vs=13,Mm=10,XT=0,Uv=58,QT=32,KT=[vs,Mm];class qv extends TransformStream{constructor(){let t=[],n=!1;super({start(){t=[],n=!1},transform(i,l){let s=i;if(n&&(s=Bo([[vs],s]),n=!1),s.length>0&&s.at(-1)===vs&&(n=!0,s=s.subarray(0,-1)),!s.length)return;const o=KT.includes(s.at(-1)),c=s.length-1,{lines:d}=s.reduce((h,m,p)=>(h.from>p||((m===vs||m===Mm)&&(h.lines.push(s.subarray(h.from,p)),m===vs&&s[p+1]===Mm?h.from=p+2:h.from=p+1),p===c&&h.from<=c&&h.lines.push(s.subarray(h.from))),h),{lines:[],from:0});if(d.length===1&&!o){t.push(d[0]);return}t.length&&(t.push(d[0]),d[0]=Bo(t),t=[]),o||d.length&&(t=[d.pop()]);for(const h of d)l.enqueue(h)},flush(i){t.length&&i.enqueue(Bo(t))}})}}class Pv extends TransformStream{constructor(){let t="",n=[],i="",l=null;const s=new TextDecoder;super({transform(o,c){if(!o.length){if(!t&&!n.length&&!i&&l==null)return;const p={id:i||void 0,event:t,data:n.length?Vv(s,n):null};t="",n=[],l=null,c.enqueue(p);return}if(o[0]===Uv)return;const d=o.indexOf(Uv);if(d===-1)return;const h=s.decode(o.subarray(0,d));let m=o.subarray(d+1);if(m[0]===QT&&(m=m.subarray(1)),h==="event")t=s.decode(m);else if(h==="data")n.push(m);else if(h==="id")m.indexOf(XT)===-1&&(i=s.decode(m));else if(h==="retry"){const p=Number.parseInt(s.decode(m));Number.isNaN(p)||(l=p)}},flush(o){t&&o.enqueue({id:i||void 0,event:t,data:n.length?Vv(s,n):null})}})}}function Bo(e){const t=e.reduce((l,s)=>l+s.length,0);let n=new Uint8Array(t),i=0;for(const l of e)n.set(l,i),i+=l.length;return n}function Vv(e,t){return JSON.parse(e.decode(Bo(t)))}class Os extends ReadableStream{constructor(){super(...arguments),Object.defineProperty(this,"reader",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}ensureReader(){this.reader||(this.reader=this.getReader())}async next(){this.ensureReader();try{const t=await this.reader.read();return t.done?(this.reader.releaseLock(),{done:!0,value:void 0}):{done:!1,value:t.value}}catch(t){throw this.reader.releaseLock(),t}}async return(){if(this.ensureReader(),this.locked){const t=this.reader.cancel();this.reader.releaseLock(),await t}return{done:!0,value:void 0}}async throw(t){if(this.ensureReader(),this.locked){const n=this.reader.cancel();this.reader.releaseLock(),await n}throw t}async[Symbol.asyncDispose](){await this.return()}[Symbol.asyncIterator](){return this}static fromReadableStream(t){const n=t.getReader();return new Os({start(i){return l();function l(){return n.read().then(({done:s,value:o})=>{if(s){i.close();return}return i.enqueue(o),l()})}},cancel(){n.releaseLock()}})}static fromAsyncGenerator(t){return new Os({async pull(n){const{value:i,done:l}=await t.next();l&&n.close(),n.enqueue(i)},async cancel(n){await t.return(n)}})}}function JT(e){if(e)return e;const t=["LANGGRAPH","LANGSMITH","LANGCHAIN"];for(const n of t){const i=FT(`${n}_API_KEY`);if(i)return i.trim().replace(/^["']|["']$/g,"")}}const WT=/(\/threads\/(?<thread_id>.+))?\/runs\/(?<run_id>.+)/;function nh(e){var i;const t=e.headers.get("Content-Location");if(!t)return;const n=WT.exec(t);if((i=n==null?void 0:n.groups)!=null&&i.run_id)return{run_id:n.groups.run_id,thread_id:n.groups.thread_id||void 0}}class nl{constructor(t){var s;Object.defineProperty(this,"asyncCaller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeoutMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const n={maxRetries:4,maxConcurrency:4,...t==null?void 0:t.callerOptions};let i="http://localhost:8123";if(!(t!=null&&t.apiUrl)&&typeof globalThis=="object"&&globalThis!=null){const o=Symbol.for("langgraph_api:fetch"),c=Symbol.for("langgraph_api:url"),d=globalThis;d[o]&&(n.fetch??(n.fetch=d[o])),d[c]&&(i=d[c])}this.asyncCaller=new YT(n),this.timeoutMs=t==null?void 0:t.timeoutMs,this.apiUrl=((s=t==null?void 0:t.apiUrl)==null?void 0:s.replace(/\/$/,""))||i,this.defaultHeaders=(t==null?void 0:t.defaultHeaders)||{};const l=JT(t==null?void 0:t.apiKey);l&&(this.defaultHeaders["X-Api-Key"]=l)}prepareFetchOptions(t,n){const i={...n,headers:{...this.defaultHeaders,...n==null?void 0:n.headers}};i.json&&(i.body=JSON.stringify(i.json),i.headers={...i.headers,"Content-Type":"application/json"},delete i.json),i.withResponse&&delete i.withResponse;let l=null;typeof(n==null?void 0:n.timeoutMs)<"u"?n.timeoutMs!=null&&(l=AbortSignal.timeout(n.timeoutMs)):this.timeoutMs!=null&&(l=AbortSignal.timeout(this.timeoutMs)),i.signal=GT(l,i.signal);const s=new URL(`${this.apiUrl}${t}`);if(i.params){for(const[o,c]of Object.entries(i.params)){if(c==null)continue;let d=typeof c=="string"||typeof c=="number"?c.toString():JSON.stringify(c);s.searchParams.append(o,d)}delete i.params}return[s,i]}async fetch(t,n){const i=await this.asyncCaller.fetch(...this.prepareFetchOptions(t,n)),l=(()=>{if(!(i.status===202||i.status===204))return i.json()})();return n!=null&&n.withResponse?[await l,i]:l}}class e2 extends nl{async createForThread(t,n,i){const l={schedule:i==null?void 0:i.schedule,input:i==null?void 0:i.input,config:i==null?void 0:i.config,metadata:i==null?void 0:i.metadata,assistant_id:n,interrupt_before:i==null?void 0:i.interruptBefore,interrupt_after:i==null?void 0:i.interruptAfter,webhook:i==null?void 0:i.webhook,multitask_strategy:i==null?void 0:i.multitaskStrategy,if_not_exists:i==null?void 0:i.ifNotExists,checkpoint_during:i==null?void 0:i.checkpointDuring};return this.fetch(`/threads/${t}/runs/crons`,{method:"POST",json:l})}async create(t,n){const i={schedule:n==null?void 0:n.schedule,input:n==null?void 0:n.input,config:n==null?void 0:n.config,metadata:n==null?void 0:n.metadata,assistant_id:t,interrupt_before:n==null?void 0:n.interruptBefore,interrupt_after:n==null?void 0:n.interruptAfter,webhook:n==null?void 0:n.webhook,multitask_strategy:n==null?void 0:n.multitaskStrategy,if_not_exists:n==null?void 0:n.ifNotExists,checkpoint_during:n==null?void 0:n.checkpointDuring};return this.fetch("/runs/crons",{method:"POST",json:i})}async delete(t){await this.fetch(`/runs/crons/${t}`,{method:"DELETE"})}async search(t){return this.fetch("/runs/crons/search",{method:"POST",json:{assistant_id:(t==null?void 0:t.assistantId)??void 0,thread_id:(t==null?void 0:t.threadId)??void 0,limit:(t==null?void 0:t.limit)??10,offset:(t==null?void 0:t.offset)??0}})}}class t2 extends nl{async get(t){return this.fetch(`/assistants/${t}`)}async getGraph(t,n){return this.fetch(`/assistants/${t}/graph`,{params:{xray:n==null?void 0:n.xray}})}async getSchemas(t){return this.fetch(`/assistants/${t}/schemas`)}async getSubgraphs(t,n){return n!=null&&n.namespace?this.fetch(`/assistants/${t}/subgraphs/${n.namespace}`,{params:{recurse:n==null?void 0:n.recurse}}):this.fetch(`/assistants/${t}/subgraphs`,{params:{recurse:n==null?void 0:n.recurse}})}async create(t){return this.fetch("/assistants",{method:"POST",json:{graph_id:t.graphId,config:t.config,metadata:t.metadata,assistant_id:t.assistantId,if_exists:t.ifExists,name:t.name,description:t.description}})}async update(t,n){return this.fetch(`/assistants/${t}`,{method:"PATCH",json:{graph_id:n.graphId,config:n.config,metadata:n.metadata,name:n.name,description:n.description}})}async delete(t){return this.fetch(`/assistants/${t}`,{method:"DELETE"})}async search(t){return this.fetch("/assistants/search",{method:"POST",json:{graph_id:(t==null?void 0:t.graphId)??void 0,metadata:(t==null?void 0:t.metadata)??void 0,limit:(t==null?void 0:t.limit)??10,offset:(t==null?void 0:t.offset)??0,sort_by:(t==null?void 0:t.sortBy)??void 0,sort_order:(t==null?void 0:t.sortOrder)??void 0}})}async getVersions(t,n){return this.fetch(`/assistants/${t}/versions`,{method:"POST",json:{metadata:(n==null?void 0:n.metadata)??void 0,limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0}})}async setLatest(t,n){return this.fetch(`/assistants/${t}/latest`,{method:"POST",json:{version:n}})}}class n2 extends nl{async get(t){return this.fetch(`/threads/${t}`)}async create(t){var n;return this.fetch("/threads",{method:"POST",json:{metadata:{...t==null?void 0:t.metadata,graph_id:t==null?void 0:t.graphId},thread_id:t==null?void 0:t.threadId,if_exists:t==null?void 0:t.ifExists,supersteps:(n=t==null?void 0:t.supersteps)==null?void 0:n.map(i=>({updates:i.updates.map(l=>({values:l.values,command:l.command,as_node:l.asNode}))}))}})}async copy(t){return this.fetch(`/threads/${t}/copy`,{method:"POST"})}async update(t,n){return this.fetch(`/threads/${t}`,{method:"PATCH",json:{metadata:n==null?void 0:n.metadata}})}async delete(t){return this.fetch(`/threads/${t}`,{method:"DELETE"})}async search(t){return this.fetch("/threads/search",{method:"POST",json:{metadata:(t==null?void 0:t.metadata)??void 0,limit:(t==null?void 0:t.limit)??10,offset:(t==null?void 0:t.offset)??0,status:t==null?void 0:t.status,sort_by:t==null?void 0:t.sortBy,sort_order:t==null?void 0:t.sortOrder}})}async getState(t,n,i){return n!=null?typeof n!="string"?this.fetch(`/threads/${t}/state/checkpoint`,{method:"POST",json:{checkpoint:n,subgraphs:i==null?void 0:i.subgraphs}}):this.fetch(`/threads/${t}/state/${n}`,{params:{subgraphs:i==null?void 0:i.subgraphs}}):this.fetch(`/threads/${t}/state`,{params:{subgraphs:i==null?void 0:i.subgraphs}})}async updateState(t,n){return this.fetch(`/threads/${t}/state`,{method:"POST",json:{values:n.values,checkpoint_id:n.checkpointId,checkpoint:n.checkpoint,as_node:n==null?void 0:n.asNode}})}async patchState(t,n){var l;let i;if(typeof t!="string"){if(typeof((l=t.configurable)==null?void 0:l.thread_id)!="string")throw new Error("Thread ID is required when updating state with a config.");i=t.configurable.thread_id}else i=t;return this.fetch(`/threads/${i}/state`,{method:"PATCH",json:{metadata:n}})}async getHistory(t,n){return this.fetch(`/threads/${t}/history`,{method:"POST",json:{limit:(n==null?void 0:n.limit)??10,before:n==null?void 0:n.before,metadata:n==null?void 0:n.metadata,checkpoint:n==null?void 0:n.checkpoint}})}}class r2 extends nl{async*stream(t,n,i){var h;const l={input:i==null?void 0:i.input,command:i==null?void 0:i.command,config:i==null?void 0:i.config,metadata:i==null?void 0:i.metadata,stream_mode:i==null?void 0:i.streamMode,stream_subgraphs:i==null?void 0:i.streamSubgraphs,stream_resumable:i==null?void 0:i.streamResumable,feedback_keys:i==null?void 0:i.feedbackKeys,assistant_id:n,interrupt_before:i==null?void 0:i.interruptBefore,interrupt_after:i==null?void 0:i.interruptAfter,checkpoint:i==null?void 0:i.checkpoint,checkpoint_id:i==null?void 0:i.checkpointId,webhook:i==null?void 0:i.webhook,multitask_strategy:i==null?void 0:i.multitaskStrategy,on_completion:i==null?void 0:i.onCompletion,on_disconnect:i==null?void 0:i.onDisconnect,after_seconds:i==null?void 0:i.afterSeconds,if_not_exists:i==null?void 0:i.ifNotExists,checkpoint_during:i==null?void 0:i.checkpointDuring},s=t==null?"/runs/stream":`/threads/${t}/runs/stream`,o=await this.asyncCaller.fetch(...this.prepareFetchOptions(s,{method:"POST",json:l,timeoutMs:null,signal:i==null?void 0:i.signal})),c=nh(o);c&&((h=i==null?void 0:i.onRunCreated)==null||h.call(i,c));const d=(o.body||new ReadableStream({start:m=>m.close()})).pipeThrough(new qv).pipeThrough(new Pv);yield*Os.fromReadableStream(d)}async create(t,n,i){var d;const l={input:i==null?void 0:i.input,command:i==null?void 0:i.command,config:i==null?void 0:i.config,metadata:i==null?void 0:i.metadata,stream_mode:i==null?void 0:i.streamMode,stream_subgraphs:i==null?void 0:i.streamSubgraphs,stream_resumable:i==null?void 0:i.streamResumable,assistant_id:n,interrupt_before:i==null?void 0:i.interruptBefore,interrupt_after:i==null?void 0:i.interruptAfter,webhook:i==null?void 0:i.webhook,checkpoint:i==null?void 0:i.checkpoint,checkpoint_id:i==null?void 0:i.checkpointId,multitask_strategy:i==null?void 0:i.multitaskStrategy,after_seconds:i==null?void 0:i.afterSeconds,if_not_exists:i==null?void 0:i.ifNotExists,checkpoint_during:i==null?void 0:i.checkpointDuring},[s,o]=await this.fetch(`/threads/${t}/runs`,{method:"POST",json:l,signal:i==null?void 0:i.signal,withResponse:!0}),c=nh(o);return c&&((d=i==null?void 0:i.onRunCreated)==null||d.call(i,c)),s}async createBatch(t){const n=t.map(i=>({...i,assistant_id:i.assistantId})).map(i=>Object.fromEntries(Object.entries(i).filter(([l,s])=>s!==void 0)));return this.fetch("/runs/batch",{method:"POST",json:n})}async wait(t,n,i){var m,p,y;const l={input:i==null?void 0:i.input,command:i==null?void 0:i.command,config:i==null?void 0:i.config,metadata:i==null?void 0:i.metadata,assistant_id:n,interrupt_before:i==null?void 0:i.interruptBefore,interrupt_after:i==null?void 0:i.interruptAfter,checkpoint:i==null?void 0:i.checkpoint,checkpoint_id:i==null?void 0:i.checkpointId,webhook:i==null?void 0:i.webhook,multitask_strategy:i==null?void 0:i.multitaskStrategy,on_completion:i==null?void 0:i.onCompletion,on_disconnect:i==null?void 0:i.onDisconnect,after_seconds:i==null?void 0:i.afterSeconds,if_not_exists:i==null?void 0:i.ifNotExists,checkpoint_during:i==null?void 0:i.checkpointDuring},s=t==null?"/runs/wait":`/threads/${t}/runs/wait`,[o,c]=await this.fetch(s,{method:"POST",json:l,timeoutMs:null,signal:i==null?void 0:i.signal,withResponse:!0}),d=nh(c);if(d&&((m=i==null?void 0:i.onRunCreated)==null||m.call(i,d)),((i==null?void 0:i.raiseError)!==void 0?i.raiseError:!0)&&"__error__"in o&&typeof o.__error__=="object"&&o.__error__&&"error"in o.__error__&&"message"in o.__error__)throw new Error(`${(p=o.__error__)==null?void 0:p.error}: ${(y=o.__error__)==null?void 0:y.message}`);return o}async list(t,n){return this.fetch(`/threads/${t}/runs`,{params:{limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0,status:(n==null?void 0:n.status)??void 0}})}async get(t,n){return this.fetch(`/threads/${t}/runs/${n}`)}async cancel(t,n,i=!1,l="interrupt"){return this.fetch(`/threads/${t}/runs/${n}/cancel`,{method:"POST",params:{wait:i?"1":"0",action:l}})}async join(t,n,i){return this.fetch(`/threads/${t}/runs/${n}/join`,{timeoutMs:null,signal:i==null?void 0:i.signal})}async*joinStream(t,n,i){const l=typeof i=="object"&&i!=null&&i instanceof AbortSignal?{signal:i}:i,o=((await this.asyncCaller.fetch(...this.prepareFetchOptions(t!=null?`/threads/${t}/runs/${n}/stream`:`/runs/${n}/stream`,{method:"GET",timeoutMs:null,signal:l==null?void 0:l.signal,headers:l!=null&&l.lastEventId?{"Last-Event-ID":l.lastEventId}:void 0,params:{cancel_on_disconnect:l!=null&&l.cancelOnDisconnect?"1":"0",stream_mode:l==null?void 0:l.streamMode}}))).body||new ReadableStream({start:c=>c.close()})).pipeThrough(new qv).pipeThrough(new Pv);yield*Os.fromReadableStream(o)}async delete(t,n){return this.fetch(`/threads/${t}/runs/${n}`,{method:"DELETE"})}}class i2 extends nl{async putItem(t,n,i,l){t.forEach(o=>{if(o.includes("."))throw new Error(`Invalid namespace label '${o}'. Namespace labels cannot contain periods ('.')`)});const s={namespace:t,key:n,value:i,index:l==null?void 0:l.index,ttl:l==null?void 0:l.ttl};return this.fetch("/store/items",{method:"PUT",json:s})}async getItem(t,n,i){t.forEach(o=>{if(o.includes("."))throw new Error(`Invalid namespace label '${o}'. Namespace labels cannot contain periods ('.')`)});const l={namespace:t.join("."),key:n};(i==null?void 0:i.refreshTtl)!==void 0&&(l.refresh_ttl=i.refreshTtl);const s=await this.fetch("/store/items",{params:l});return s?{...s,createdAt:s.created_at,updatedAt:s.updated_at}:null}async deleteItem(t,n){return t.forEach(i=>{if(i.includes("."))throw new Error(`Invalid namespace label '${i}'. Namespace labels cannot contain periods ('.')`)}),this.fetch("/store/items",{method:"DELETE",json:{namespace:t,key:n}})}async searchItems(t,n){const i={namespace_prefix:t,filter:n==null?void 0:n.filter,limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0,query:n==null?void 0:n.query,refresh_ttl:n==null?void 0:n.refreshTtl};return{items:(await this.fetch("/store/items/search",{method:"POST",json:i})).items.map(s=>({...s,createdAt:s.created_at,updatedAt:s.updated_at}))}}async listNamespaces(t){const n={prefix:t==null?void 0:t.prefix,suffix:t==null?void 0:t.suffix,max_depth:t==null?void 0:t.maxDepth,limit:(t==null?void 0:t.limit)??100,offset:(t==null?void 0:t.offset)??0};return this.fetch("/store/namespaces",{method:"POST",json:n})}}class qi extends nl{static getOrCached(t,n){if(qi.promiseCache[t]!=null)return qi.promiseCache[t];const i=n();return qi.promiseCache[t]=i,i}async getComponent(t,n){return qi.getOrCached(`${this.apiUrl}-${t}-${n}`,async()=>(await this.asyncCaller.fetch(...this.prepareFetchOptions(`/ui/${t}`,{headers:{Accept:"text/html","Content-Type":"application/json"},method:"POST",json:{name:n}}))).text())}}Object.defineProperty(qi,"promiseCache",{enumerable:!0,configurable:!0,writable:!0,value:{}});class a2{constructor(t){Object.defineProperty(this,"assistants",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"threads",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"runs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"crons",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"~ui",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.assistants=new t2(t),this.threads=new n2(t),this.runs=new r2(t),this.crons=new e2(t),this.store=new i2(t),this["~ui"]=new qi(t)}}var Ge;(function(e){e.assertEqual=l=>{};function t(l){}e.assertIs=t;function n(l){throw new Error}e.assertNever=n,e.arrayToEnum=l=>{const s={};for(const o of l)s[o]=o;return s},e.getValidEnumValues=l=>{const s=e.objectKeys(l).filter(c=>typeof l[l[c]]!="number"),o={};for(const c of s)o[c]=l[c];return e.objectValues(o)},e.objectValues=l=>e.objectKeys(l).map(function(s){return l[s]}),e.objectKeys=typeof Object.keys=="function"?l=>Object.keys(l):l=>{const s=[];for(const o in l)Object.prototype.hasOwnProperty.call(l,o)&&s.push(o);return s},e.find=(l,s)=>{for(const o of l)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?l=>Number.isInteger(l):l=>typeof l=="number"&&Number.isFinite(l)&&Math.floor(l)===l;function i(l,s=" | "){return l.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=i,e.jsonStringifyReplacer=(l,s)=>typeof s=="bigint"?s.toString():s})(Ge||(Ge={}));var $v;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})($v||($v={}));const be=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ci=e=>{switch(typeof e){case"undefined":return be.undefined;case"string":return be.string;case"number":return Number.isNaN(e)?be.nan:be.number;case"boolean":return be.boolean;case"function":return be.function;case"bigint":return be.bigint;case"symbol":return be.symbol;case"object":return Array.isArray(e)?be.array:e===null?be.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?be.promise:typeof Map<"u"&&e instanceof Map?be.map:typeof Set<"u"&&e instanceof Set?be.set:typeof Date<"u"&&e instanceof Date?be.date:be.object;default:return be.unknown}},me=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ar extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(s){return s.message},i={_errors:[]},l=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(l);else if(o.code==="invalid_return_type")l(o.returnTypeError);else if(o.code==="invalid_arguments")l(o.argumentsError);else if(o.path.length===0)i._errors.push(n(o));else{let c=i,d=0;for(;d<o.path.length;){const h=o.path[d];d===o.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(n(o))):c[h]=c[h]||{_errors:[]},c=c[h],d++}}};return l(this),i}static assert(t){if(!(t instanceof Ar))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},i=[];for(const l of this.issues)l.path.length>0?(n[l.path[0]]=n[l.path[0]]||[],n[l.path[0]].push(t(l))):i.push(t(l));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Ar.create=e=>new Ar(e);const Rm=(e,t)=>{let n;switch(e.code){case me.invalid_type:e.received===be.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case me.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ge.jsonStringifyReplacer)}`;break;case me.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ge.joinValues(e.keys,", ")}`;break;case me.invalid_union:n="Invalid input";break;case me.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ge.joinValues(e.options)}`;break;case me.invalid_enum_value:n=`Invalid enum value. Expected ${Ge.joinValues(e.options)}, received '${e.received}'`;break;case me.invalid_arguments:n="Invalid function arguments";break;case me.invalid_return_type:n="Invalid function return type";break;case me.invalid_date:n="Invalid date";break;case me.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ge.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case me.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case me.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case me.custom:n="Invalid input";break;case me.invalid_intersection_types:n="Intersection results could not be merged";break;case me.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case me.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ge.assertNever(e)}return{message:n}};let l2=Rm;function s2(){return l2}const u2=e=>{const{data:t,path:n,errorMaps:i,issueData:l}=e,s=[...n,...l.path||[]],o={...l,path:s};if(l.message!==void 0)return{...l,path:s,message:l.message};let c="";const d=i.filter(h=>!!h).slice().reverse();for(const h of d)c=h(o,{data:t,defaultError:c}).message;return{...l,path:s,message:c}};function ve(e,t){const n=s2(),i=u2({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Rm?void 0:Rm].filter(l=>!!l)});e.common.issues.push(i)}class yn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const i=[];for(const l of n){if(l.status==="aborted")return je;l.status==="dirty"&&t.dirty(),i.push(l.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){const i=[];for(const l of n){const s=await l.key,o=await l.value;i.push({key:s,value:o})}return yn.mergeObjectSync(t,i)}static mergeObjectSync(t,n){const i={};for(const l of n){const{key:s,value:o}=l;if(s.status==="aborted"||o.status==="aborted")return je;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||l.alwaysSet)&&(i[s.value]=o.value)}return{status:t.value,value:i}}}const je=Object.freeze({status:"aborted"}),xs=e=>({status:"dirty",value:e}),An=e=>({status:"valid",value:e}),Zv=e=>e.status==="aborted",Yv=e=>e.status==="dirty",$a=e=>e.status==="valid",Zo=e=>typeof Promise<"u"&&e instanceof Promise;var _e;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(_e||(_e={}));var Yo=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},W1=function(e,t,n,i,l){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!l:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?l.call(e,n):l?l.value=n:t.set(e,n),n},bs,_s;class pi{constructor(t,n,i,l){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=l}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Fv=(e,t)=>{if($a(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ar(e.common.issues);return this._error=n,this._error}}};function He(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:i,description:l}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:l}:{errorMap:(o,c)=>{const{message:d}=e;return o.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:d??i??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:d??n??c.defaultError}},description:l}}class Ye{get description(){return this._def.description}_getType(t){return ci(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ci(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new yn,ctx:{common:t.parent.common,data:t.data,parsedType:ci(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Zo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){const i={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ci(t)},l=this._parseSync({data:t,path:i.path,parent:i});return Fv(i,l)}"~validate"(t){var i,l;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ci(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:n});return $a(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(l=(i=s==null?void 0:s.message)==null?void 0:i.toLowerCase())!=null&&l.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(s=>$a(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(t,n){const i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ci(t)},l=this._parse({data:t,path:i.path,parent:i}),s=await(Zo(l)?l:Promise.resolve(l));return Fv(i,s)}refine(t,n){const i=l=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(l):n;return this._refinement((l,s)=>{const o=t(l),c=()=>s.addIssue({code:me.custom,...i(l)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(t,n){return this._refinement((i,l)=>t(i)?!0:(l.addIssue(typeof n=="function"?n(i,l):n),!1))}_refinement(t){return new Fa({schema:this,typeName:pe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Tr.create(this,this._def)}nullable(){return Ga.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return er.create(this)}promise(){return Qo.create(this,this._def)}or(t){return Go.create([this,t],this._def)}and(t){return Xo.create(this,t,this._def)}transform(t){return new Fa({...He(this._def),schema:this,typeName:pe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new jm({...He(this._def),innerType:this,defaultValue:n,typeName:pe.ZodDefault})}brand(){return new M2({typeName:pe.ZodBranded,type:this,...He(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Lm({...He(this._def),innerType:this,catchValue:n,typeName:pe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return cp.create(this,t)}readonly(){return Im.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const o2=/^c[^\s-]{8,}$/i,c2=/^[0-9a-z]+$/,f2=/^[0-9A-HJKMNP-TV-Z]{26}$/i,d2=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,h2=/^[a-z0-9_-]{21}$/i,m2=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,p2=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,g2=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,y2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let rh;const v2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,x2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,b2=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_2=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,w2=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,S2=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,e_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",E2=new RegExp(`^${e_}$`);function t_(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function k2(e){return new RegExp(`^${t_(e)}$`)}function T2(e){let t=`${e_}T${t_(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function C2(e,t){return!!((t==="v4"||!t)&&v2.test(e)||(t==="v6"||!t)&&b2.test(e))}function A2(e,t){if(!m2.test(e))return!1;try{const[n]=e.split("."),i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),l=JSON.parse(atob(i));return!(typeof l!="object"||l===null||"typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||t&&l.alg!==t)}catch{return!1}}function N2(e,t){return!!((t==="v4"||!t)&&x2.test(e)||(t==="v6"||!t)&&_2.test(e))}class hi extends Ye{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==be.string){const s=this._getOrReturnCtx(t);return ve(s,{code:me.invalid_type,expected:be.string,received:s.parsedType}),je}const i=new yn;let l;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(l=this._getOrReturnCtx(t,l),ve(l,{code:me.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")t.data.length>s.value&&(l=this._getOrReturnCtx(t,l),ve(l,{code:me.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,c=t.data.length<s.value;(o||c)&&(l=this._getOrReturnCtx(t,l),o?ve(l,{code:me.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&ve(l,{code:me.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")g2.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"email",code:me.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")rh||(rh=new RegExp(y2,"u")),rh.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"emoji",code:me.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")d2.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"uuid",code:me.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")h2.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"nanoid",code:me.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")o2.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"cuid",code:me.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")c2.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"cuid2",code:me.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")f2.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"ulid",code:me.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{l=this._getOrReturnCtx(t,l),ve(l,{validation:"url",code:me.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"regex",code:me.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(l=this._getOrReturnCtx(t,l),ve(l,{code:me.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(l=this._getOrReturnCtx(t,l),ve(l,{code:me.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(l=this._getOrReturnCtx(t,l),ve(l,{code:me.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?T2(s).test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{code:me.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?E2.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{code:me.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?k2(s).test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{code:me.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?p2.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"duration",code:me.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?C2(t.data,s.version)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"ip",code:me.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?A2(t.data,s.alg)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"jwt",code:me.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?N2(t.data,s.version)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"cidr",code:me.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?w2.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"base64",code:me.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?S2.test(t.data)||(l=this._getOrReturnCtx(t,l),ve(l,{validation:"base64url",code:me.invalid_string,message:s.message}),i.dirty()):Ge.assertNever(s);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(l=>t.test(l),{validation:n,code:me.invalid_string,..._e.errToObj(i)})}_addCheck(t){return new hi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",..._e.errToObj(t)})}url(t){return this._addCheck({kind:"url",..._e.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",..._e.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",..._e.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",..._e.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",..._e.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",..._e.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",..._e.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",..._e.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",..._e.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",..._e.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",..._e.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",..._e.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,..._e.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,..._e.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",..._e.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,..._e.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,..._e.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,..._e.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,..._e.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,..._e.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,..._e.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,..._e.errToObj(n)})}nonempty(t){return this.min(1,_e.errToObj(t))}trim(){return new hi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new hi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new hi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}hi.create=e=>new hi({checks:[],typeName:pe.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...He(e)});function O2(e,t){const n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,l=n>i?n:i,s=Number.parseInt(e.toFixed(l).replace(".","")),o=Number.parseInt(t.toFixed(l).replace(".",""));return s%o/10**l}class Za extends Ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==be.number){const s=this._getOrReturnCtx(t);return ve(s,{code:me.invalid_type,expected:be.number,received:s.parsedType}),je}let i;const l=new yn;for(const s of this._def.checks)s.kind==="int"?Ge.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),ve(i,{code:me.invalid_type,expected:"integer",received:"float",message:s.message}),l.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),ve(i,{code:me.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),l.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),ve(i,{code:me.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),l.dirty()):s.kind==="multipleOf"?O2(t.data,s.value)!==0&&(i=this._getOrReturnCtx(t,i),ve(i,{code:me.not_multiple_of,multipleOf:s.value,message:s.message}),l.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),ve(i,{code:me.not_finite,message:s.message}),l.dirty()):Ge.assertNever(s);return{status:l.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,_e.toString(n))}gt(t,n){return this.setLimit("min",t,!1,_e.toString(n))}lte(t,n){return this.setLimit("max",t,!0,_e.toString(n))}lt(t,n){return this.setLimit("max",t,!1,_e.toString(n))}setLimit(t,n,i,l){return new Za({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:_e.toString(l)}]})}_addCheck(t){return new Za({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:_e.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_e.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:_e.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_e.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_e.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ge.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Za.create=e=>new Za({checks:[],typeName:pe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class Ms extends Ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==be.bigint)return this._getInvalidInput(t);let i;const l=new yn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),ve(i,{code:me.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),l.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),ve(i,{code:me.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),l.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),ve(i,{code:me.not_multiple_of,multipleOf:s.value,message:s.message}),l.dirty()):Ge.assertNever(s);return{status:l.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ve(n,{code:me.invalid_type,expected:be.bigint,received:n.parsedType}),je}gte(t,n){return this.setLimit("min",t,!0,_e.toString(n))}gt(t,n){return this.setLimit("min",t,!1,_e.toString(n))}lte(t,n){return this.setLimit("max",t,!0,_e.toString(n))}lt(t,n){return this.setLimit("max",t,!1,_e.toString(n))}setLimit(t,n,i,l){return new Ms({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:_e.toString(l)}]})}_addCheck(t){return new Ms({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ms.create=e=>new Ms({checks:[],typeName:pe.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...He(e)});class zm extends Ye{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==be.boolean){const i=this._getOrReturnCtx(t);return ve(i,{code:me.invalid_type,expected:be.boolean,received:i.parsedType}),je}return An(t.data)}}zm.create=e=>new zm({typeName:pe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class Fo extends Ye{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==be.date){const s=this._getOrReturnCtx(t);return ve(s,{code:me.invalid_type,expected:be.date,received:s.parsedType}),je}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return ve(s,{code:me.invalid_date}),je}const i=new yn;let l;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(l=this._getOrReturnCtx(t,l),ve(l,{code:me.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(l=this._getOrReturnCtx(t,l),ve(l,{code:me.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Ge.assertNever(s);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Fo({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:_e.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:_e.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Fo.create=e=>new Fo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:pe.ZodDate,...He(e)});class Gv extends Ye{_parse(t){if(this._getType(t)!==be.symbol){const i=this._getOrReturnCtx(t);return ve(i,{code:me.invalid_type,expected:be.symbol,received:i.parsedType}),je}return An(t.data)}}Gv.create=e=>new Gv({typeName:pe.ZodSymbol,...He(e)});class Xv extends Ye{_parse(t){if(this._getType(t)!==be.undefined){const i=this._getOrReturnCtx(t);return ve(i,{code:me.invalid_type,expected:be.undefined,received:i.parsedType}),je}return An(t.data)}}Xv.create=e=>new Xv({typeName:pe.ZodUndefined,...He(e)});class Qv extends Ye{_parse(t){if(this._getType(t)!==be.null){const i=this._getOrReturnCtx(t);return ve(i,{code:me.invalid_type,expected:be.null,received:i.parsedType}),je}return An(t.data)}}Qv.create=e=>new Qv({typeName:pe.ZodNull,...He(e)});class Kv extends Ye{constructor(){super(...arguments),this._any=!0}_parse(t){return An(t.data)}}Kv.create=e=>new Kv({typeName:pe.ZodAny,...He(e)});class Jv extends Ye{constructor(){super(...arguments),this._unknown=!0}_parse(t){return An(t.data)}}Jv.create=e=>new Jv({typeName:pe.ZodUnknown,...He(e)});class gi extends Ye{_parse(t){const n=this._getOrReturnCtx(t);return ve(n,{code:me.invalid_type,expected:be.never,received:n.parsedType}),je}}gi.create=e=>new gi({typeName:pe.ZodNever,...He(e)});class Wv extends Ye{_parse(t){if(this._getType(t)!==be.undefined){const i=this._getOrReturnCtx(t);return ve(i,{code:me.invalid_type,expected:be.void,received:i.parsedType}),je}return An(t.data)}}Wv.create=e=>new Wv({typeName:pe.ZodVoid,...He(e)});class er extends Ye{_parse(t){const{ctx:n,status:i}=this._processInputParams(t),l=this._def;if(n.parsedType!==be.array)return ve(n,{code:me.invalid_type,expected:be.array,received:n.parsedType}),je;if(l.exactLength!==null){const o=n.data.length>l.exactLength.value,c=n.data.length<l.exactLength.value;(o||c)&&(ve(n,{code:o?me.too_big:me.too_small,minimum:c?l.exactLength.value:void 0,maximum:o?l.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:l.exactLength.message}),i.dirty())}if(l.minLength!==null&&n.data.length<l.minLength.value&&(ve(n,{code:me.too_small,minimum:l.minLength.value,type:"array",inclusive:!0,exact:!1,message:l.minLength.message}),i.dirty()),l.maxLength!==null&&n.data.length>l.maxLength.value&&(ve(n,{code:me.too_big,maximum:l.maxLength.value,type:"array",inclusive:!0,exact:!1,message:l.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>l.type._parseAsync(new pi(n,o,n.path,c)))).then(o=>yn.mergeArray(i,o));const s=[...n.data].map((o,c)=>l.type._parseSync(new pi(n,o,n.path,c)));return yn.mergeArray(i,s)}get element(){return this._def.type}min(t,n){return new er({...this._def,minLength:{value:t,message:_e.toString(n)}})}max(t,n){return new er({...this._def,maxLength:{value:t,message:_e.toString(n)}})}length(t,n){return new er({...this._def,exactLength:{value:t,message:_e.toString(n)}})}nonempty(t){return this.min(1,t)}}er.create=(e,t)=>new er({type:e,minLength:null,maxLength:null,exactLength:null,typeName:pe.ZodArray,...He(t)});function Ia(e){if(e instanceof kt){const t={};for(const n in e.shape){const i=e.shape[n];t[n]=Tr.create(Ia(i))}return new kt({...e._def,shape:()=>t})}else return e instanceof er?new er({...e._def,type:Ia(e.element)}):e instanceof Tr?Tr.create(Ia(e.unwrap())):e instanceof Ga?Ga.create(Ia(e.unwrap())):e instanceof Zi?Zi.create(e.items.map(t=>Ia(t))):e}class kt extends Ye{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ge.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==be.object){const h=this._getOrReturnCtx(t);return ve(h,{code:me.invalid_type,expected:be.object,received:h.parsedType}),je}const{status:i,ctx:l}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof gi&&this._def.unknownKeys==="strip"))for(const h in l.data)o.includes(h)||c.push(h);const d=[];for(const h of o){const m=s[h],p=l.data[h];d.push({key:{status:"valid",value:h},value:m._parse(new pi(l,p,l.path,h)),alwaysSet:h in l.data})}if(this._def.catchall instanceof gi){const h=this._def.unknownKeys;if(h==="passthrough")for(const m of c)d.push({key:{status:"valid",value:m},value:{status:"valid",value:l.data[m]}});else if(h==="strict")c.length>0&&(ve(l,{code:me.unrecognized_keys,keys:c}),i.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const m of c){const p=l.data[m];d.push({key:{status:"valid",value:m},value:h._parse(new pi(l,p,l.path,m)),alwaysSet:m in l.data})}}return l.common.async?Promise.resolve().then(async()=>{const h=[];for(const m of d){const p=await m.key,y=await m.value;h.push({key:p,value:y,alwaysSet:m.alwaysSet})}return h}).then(h=>yn.mergeObjectSync(i,h)):yn.mergeObjectSync(i,d)}get shape(){return this._def.shape()}strict(t){return _e.errToObj,new kt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,i)=>{var s,o;const l=((o=(s=this._def).errorMap)==null?void 0:o.call(s,n,i).message)??i.defaultError;return n.code==="unrecognized_keys"?{message:_e.errToObj(t).message??l}:{message:l}}}:{}})}strip(){return new kt({...this._def,unknownKeys:"strip"})}passthrough(){return new kt({...this._def,unknownKeys:"passthrough"})}extend(t){return new kt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new kt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:pe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new kt({...this._def,catchall:t})}pick(t){const n={};for(const i of Ge.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new kt({...this._def,shape:()=>n})}omit(t){const n={};for(const i of Ge.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new kt({...this._def,shape:()=>n})}deepPartial(){return Ia(this)}partial(t){const n={};for(const i of Ge.objectKeys(this.shape)){const l=this.shape[i];t&&!t[i]?n[i]=l:n[i]=l.optional()}return new kt({...this._def,shape:()=>n})}required(t){const n={};for(const i of Ge.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Tr;)s=s._def.innerType;n[i]=s}return new kt({...this._def,shape:()=>n})}keyof(){return n_(Ge.objectKeys(this.shape))}}kt.create=(e,t)=>new kt({shape:()=>e,unknownKeys:"strip",catchall:gi.create(),typeName:pe.ZodObject,...He(t)});kt.strictCreate=(e,t)=>new kt({shape:()=>e,unknownKeys:"strict",catchall:gi.create(),typeName:pe.ZodObject,...He(t)});kt.lazycreate=(e,t)=>new kt({shape:e,unknownKeys:"strip",catchall:gi.create(),typeName:pe.ZodObject,...He(t)});class Go extends Ye{_parse(t){const{ctx:n}=this._processInputParams(t),i=this._def.options;function l(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=s.map(c=>new Ar(c.ctx.common.issues));return ve(n,{code:me.invalid_union,unionErrors:o}),je}if(n.common.async)return Promise.all(i.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(l);{let s;const o=[];for(const d of i){const h={...n,common:{...n.common,issues:[]},parent:null},m=d._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:h}),h.common.issues.length&&o.push(h.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const c=o.map(d=>new Ar(d));return ve(n,{code:me.invalid_union,unionErrors:c}),je}}get options(){return this._def.options}}Go.create=(e,t)=>new Go({options:e,typeName:pe.ZodUnion,...He(t)});function Dm(e,t){const n=ci(e),i=ci(t);if(e===t)return{valid:!0,data:e};if(n===be.object&&i===be.object){const l=Ge.objectKeys(t),s=Ge.objectKeys(e).filter(c=>l.indexOf(c)!==-1),o={...e,...t};for(const c of s){const d=Dm(e[c],t[c]);if(!d.valid)return{valid:!1};o[c]=d.data}return{valid:!0,data:o}}else if(n===be.array&&i===be.array){if(e.length!==t.length)return{valid:!1};const l=[];for(let s=0;s<e.length;s++){const o=e[s],c=t[s],d=Dm(o,c);if(!d.valid)return{valid:!1};l.push(d.data)}return{valid:!0,data:l}}else return n===be.date&&i===be.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Xo extends Ye{_parse(t){const{status:n,ctx:i}=this._processInputParams(t),l=(s,o)=>{if(Zv(s)||Zv(o))return je;const c=Dm(s.value,o.value);return c.valid?((Yv(s)||Yv(o))&&n.dirty(),{status:n.value,value:c.data}):(ve(i,{code:me.invalid_intersection_types}),je)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>l(s,o)):l(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Xo.create=(e,t,n)=>new Xo({left:e,right:t,typeName:pe.ZodIntersection,...He(n)});class Zi extends Ye{_parse(t){const{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==be.array)return ve(i,{code:me.invalid_type,expected:be.array,received:i.parsedType}),je;if(i.data.length<this._def.items.length)return ve(i,{code:me.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),je;!this._def.rest&&i.data.length>this._def.items.length&&(ve(i,{code:me.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((o,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new pi(i,o,i.path,c)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>yn.mergeArray(n,o)):yn.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Zi({...this._def,rest:t})}}Zi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zi({items:e,typeName:pe.ZodTuple,rest:null,...He(t)})};class ex extends Ye{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==be.map)return ve(i,{code:me.invalid_type,expected:be.map,received:i.parsedType}),je;const l=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([c,d],h)=>({key:l._parse(new pi(i,c,i.path,[h,"key"])),value:s._parse(new pi(i,d,i.path,[h,"value"]))}));if(i.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of o){const h=await d.key,m=await d.value;if(h.status==="aborted"||m.status==="aborted")return je;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),c.set(h.value,m.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const d of o){const h=d.key,m=d.value;if(h.status==="aborted"||m.status==="aborted")return je;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),c.set(h.value,m.value)}return{status:n.value,value:c}}}}ex.create=(e,t,n)=>new ex({valueType:t,keyType:e,typeName:pe.ZodMap,...He(n)});class Rs extends Ye{_parse(t){const{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==be.set)return ve(i,{code:me.invalid_type,expected:be.set,received:i.parsedType}),je;const l=this._def;l.minSize!==null&&i.data.size<l.minSize.value&&(ve(i,{code:me.too_small,minimum:l.minSize.value,type:"set",inclusive:!0,exact:!1,message:l.minSize.message}),n.dirty()),l.maxSize!==null&&i.data.size>l.maxSize.value&&(ve(i,{code:me.too_big,maximum:l.maxSize.value,type:"set",inclusive:!0,exact:!1,message:l.maxSize.message}),n.dirty());const s=this._def.valueType;function o(d){const h=new Set;for(const m of d){if(m.status==="aborted")return je;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const c=[...i.data.values()].map((d,h)=>s._parse(new pi(i,d,i.path,h)));return i.common.async?Promise.all(c).then(d=>o(d)):o(c)}min(t,n){return new Rs({...this._def,minSize:{value:t,message:_e.toString(n)}})}max(t,n){return new Rs({...this._def,maxSize:{value:t,message:_e.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Rs.create=(e,t)=>new Rs({valueType:e,minSize:null,maxSize:null,typeName:pe.ZodSet,...He(t)});class tx extends Ye{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}tx.create=(e,t)=>new tx({getter:e,typeName:pe.ZodLazy,...He(t)});class nx extends Ye{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ve(n,{received:n.data,code:me.invalid_literal,expected:this._def.value}),je}return{status:"valid",value:t.data}}get value(){return this._def.value}}nx.create=(e,t)=>new nx({value:e,typeName:pe.ZodLiteral,...He(t)});function n_(e,t){return new Ya({values:e,typeName:pe.ZodEnum,...He(t)})}class Ya extends Ye{constructor(){super(...arguments),bs.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),i=this._def.values;return ve(n,{expected:Ge.joinValues(i),received:n.parsedType,code:me.invalid_type}),je}if(Yo(this,bs,"f")||W1(this,bs,new Set(this._def.values),"f"),!Yo(this,bs,"f").has(t.data)){const n=this._getOrReturnCtx(t),i=this._def.values;return ve(n,{received:n.data,code:me.invalid_enum_value,options:i}),je}return An(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Ya.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ya.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}}bs=new WeakMap;Ya.create=n_;class rx extends Ye{constructor(){super(...arguments),_s.set(this,void 0)}_parse(t){const n=Ge.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==be.string&&i.parsedType!==be.number){const l=Ge.objectValues(n);return ve(i,{expected:Ge.joinValues(l),received:i.parsedType,code:me.invalid_type}),je}if(Yo(this,_s,"f")||W1(this,_s,new Set(Ge.getValidEnumValues(this._def.values)),"f"),!Yo(this,_s,"f").has(t.data)){const l=Ge.objectValues(n);return ve(i,{received:i.data,code:me.invalid_enum_value,options:l}),je}return An(t.data)}get enum(){return this._def.values}}_s=new WeakMap;rx.create=(e,t)=>new rx({values:e,typeName:pe.ZodNativeEnum,...He(t)});class Qo extends Ye{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==be.promise&&n.common.async===!1)return ve(n,{code:me.invalid_type,expected:be.promise,received:n.parsedType}),je;const i=n.parsedType===be.promise?n.data:Promise.resolve(n.data);return An(i.then(l=>this._def.type.parseAsync(l,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Qo.create=(e,t)=>new Qo({type:e,typeName:pe.ZodPromise,...He(t)});class Fa extends Ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:i}=this._processInputParams(t),l=this._def.effect||null,s={addIssue:o=>{ve(i,o),o.fatal?n.abort():n.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),l.type==="preprocess"){const o=l.transform(i.data,s);if(i.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return je;const d=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return d.status==="aborted"?je:d.status==="dirty"||n.value==="dirty"?xs(d.value):d});{if(n.value==="aborted")return je;const c=this._def.schema._parseSync({data:o,path:i.path,parent:i});return c.status==="aborted"?je:c.status==="dirty"||n.value==="dirty"?xs(c.value):c}}if(l.type==="refinement"){const o=c=>{const d=l.refinement(c,s);if(i.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?je:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?je:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(l.type==="transform")if(i.common.async===!1){const o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!$a(o))return o;const c=l.transform(o.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>$a(o)?Promise.resolve(l.transform(o.value,s)).then(c=>({status:n.value,value:c})):o);Ge.assertNever(l)}}Fa.create=(e,t,n)=>new Fa({schema:e,typeName:pe.ZodEffects,effect:t,...He(n)});Fa.createWithPreprocess=(e,t,n)=>new Fa({schema:t,effect:{type:"preprocess",transform:e},typeName:pe.ZodEffects,...He(n)});class Tr extends Ye{_parse(t){return this._getType(t)===be.undefined?An(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Tr.create=(e,t)=>new Tr({innerType:e,typeName:pe.ZodOptional,...He(t)});class Ga extends Ye{_parse(t){return this._getType(t)===be.null?An(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ga.create=(e,t)=>new Ga({innerType:e,typeName:pe.ZodNullable,...He(t)});class jm extends Ye{_parse(t){const{ctx:n}=this._processInputParams(t);let i=n.data;return n.parsedType===be.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}jm.create=(e,t)=>new jm({innerType:e,typeName:pe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...He(t)});class Lm extends Ye{_parse(t){const{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},l=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Zo(l)?l.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ar(i.common.issues)},input:i.data})})):{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ar(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Lm.create=(e,t)=>new Lm({innerType:e,typeName:pe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...He(t)});class ix extends Ye{_parse(t){if(this._getType(t)!==be.nan){const i=this._getOrReturnCtx(t);return ve(i,{code:me.invalid_type,expected:be.nan,received:i.parsedType}),je}return{status:"valid",value:t.data}}}ix.create=e=>new ix({typeName:pe.ZodNaN,...He(e)});class M2 extends Ye{_parse(t){const{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class cp extends Ye{_parse(t){const{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?je:s.status==="dirty"?(n.dirty(),xs(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const l=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?je:l.status==="dirty"?(n.dirty(),{status:"dirty",value:l.value}):this._def.out._parseSync({data:l.value,path:i.path,parent:i})}}static create(t,n){return new cp({in:t,out:n,typeName:pe.ZodPipeline})}}class Im extends Ye{_parse(t){const n=this._def.innerType._parse(t),i=l=>($a(l)&&(l.value=Object.freeze(l.value)),l);return Zo(n)?n.then(l=>i(l)):i(n)}unwrap(){return this._def.innerType}}Im.create=(e,t)=>new Im({innerType:e,typeName:pe.ZodReadonly,...He(t)});var pe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(pe||(pe={}));const R2=hi.create,z2=Za.create,D2=zm.create;gi.create;const j2=er.create,Ho=kt.create;Go.create;Xo.create;Zi.create;Ya.create;Qo.create;Tr.create;Ga.create;function L2(e){let t={};for(let i of e||[])t[i.name]=r_(i);let n=[];for(let i of e||[])i.required!==!1&&n.push(i.name);return{type:"object",properties:t,required:n}}function r_(e){var t,n,i;switch(e.type){case"string":return{type:"string",description:e.description,...e.enum&&{enum:e.enum}};case"number":case"boolean":return{type:e.type,description:e.description};case"object":case"object[]":const l=(t=e.attributes)==null?void 0:t.reduce((o,c)=>(o[c.name]=r_(c),o),{}),s=(n=e.attributes)==null?void 0:n.filter(o=>o.required!==!1).map(o=>o.name);return e.type==="object[]"?{type:"array",items:{type:"object",...l&&{properties:l},...s&&s.length>0&&{required:s}},description:e.description}:{type:"object",description:e.description,...l&&{properties:l},...s&&s.length>0&&{required:s}};default:return(i=e.type)!=null&&i.endsWith("[]")?{type:"array",items:{type:e.type.slice(0,-2)},description:e.description}:{type:"string",description:e.description}}}function I2(e){const t={};for(const[n,i]of Object.entries(e.properties))t[n]=Bm(i,e.required?e.required.includes(n):!1);return t}function Bm(e,t){if(e.type==="object"){const n={};if(!e.properties||!Object.keys(e.properties).length)return t?Ho(n):Ho(n).optional();for(const[l,s]of Object.entries(e.properties))n[l]=Bm(s,e.required?e.required.includes(l):!1);let i=Ho(n).describe(e.description);return t?i:i.optional()}else if(e.type==="string"){let n=R2().describe(e.description);return t?n:n.optional()}else if(e.type==="number"){let n=z2().describe(e.description);return t?n:n.optional()}else if(e.type==="boolean"){let n=D2().describe(e.description);return t?n:n.optional()}else if(e.type==="array"){let n=Bm(e.items,!0),i=j2(n).describe(e.description);return t?i:i.optional()}throw new Error("Invalid JSON schema")}const B2=Symbol("Let zodToJsonSchema decide on which parser to use"),H2={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},U2=e=>({...H2,...e}),q2=e=>{const t=U2(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([i,l])=>[l._def,{def:l._def,path:[...t.basePath,t.definitionPath,i],jsonSchema:void 0}]))}};function i_(e,t,n,i){i!=null&&i.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function et(e,t,n,i,l){e[t]=n,i_(e,t,i,l)}function P2(){return{}}function V2(e,t){var i,l,s;const n={type:"array"};return(i=e.type)!=null&&i._def&&((s=(l=e.type)==null?void 0:l._def)==null?void 0:s.typeName)!==pe.ZodAny&&(n.items=Ke(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&et(n,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&et(n,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(et(n,"minItems",e.exactLength.value,e.exactLength.message,t),et(n,"maxItems",e.exactLength.value,e.exactLength.message,t)),n}function $2(e,t){const n={type:"integer",format:"int64"};if(!e.checks)return n;for(const i of e.checks)switch(i.kind){case"min":t.target==="jsonSchema7"?i.inclusive?et(n,"minimum",i.value,i.message,t):et(n,"exclusiveMinimum",i.value,i.message,t):(i.inclusive||(n.exclusiveMinimum=!0),et(n,"minimum",i.value,i.message,t));break;case"max":t.target==="jsonSchema7"?i.inclusive?et(n,"maximum",i.value,i.message,t):et(n,"exclusiveMaximum",i.value,i.message,t):(i.inclusive||(n.exclusiveMaximum=!0),et(n,"maximum",i.value,i.message,t));break;case"multipleOf":et(n,"multipleOf",i.value,i.message,t);break}return n}function Z2(){return{type:"boolean"}}function a_(e,t){return Ke(e.type._def,t)}const Y2=(e,t)=>Ke(e.innerType._def,t);function l_(e,t,n){const i=n??t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((l,s)=>l_(e,t,l))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return F2(e,t)}}const F2=(e,t)=>{const n={type:"integer",format:"unix-time"};if(t.target==="openApi3")return n;for(const i of e.checks)switch(i.kind){case"min":et(n,"minimum",i.value,i.message,t);break;case"max":et(n,"maximum",i.value,i.message,t);break}return n};function G2(e,t){return{...Ke(e.innerType._def,t),default:e.defaultValue()}}function X2(e,t){return t.effectStrategy==="input"?Ke(e.schema._def,t):{}}function Q2(e){return{type:"string",enum:Array.from(e.values)}}const K2=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function J2(e,t){const n=[Ke(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Ke(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(s=>!!s);let i=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const l=[];return n.forEach(s=>{if(K2(s))l.push(...s.allOf),s.unevaluatedProperties===void 0&&(i=void 0);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:c,...d}=s;o=d}else i=void 0;l.push(o)}}),l.length?{allOf:l,...i}:void 0}function W2(e,t){const n=typeof e.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[e.value]}:{type:n==="bigint"?"integer":n,const:e.value}}let ih;const jn={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(ih===void 0&&(ih=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ih),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function s_(e,t){const n={type:"string"};if(e.checks)for(const i of e.checks)switch(i.kind){case"min":et(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t);break;case"max":et(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Ln(n,"email",i.message,t);break;case"format:idn-email":Ln(n,"idn-email",i.message,t);break;case"pattern:zod":Yt(n,jn.email,i.message,t);break}break;case"url":Ln(n,"uri",i.message,t);break;case"uuid":Ln(n,"uuid",i.message,t);break;case"regex":Yt(n,i.regex,i.message,t);break;case"cuid":Yt(n,jn.cuid,i.message,t);break;case"cuid2":Yt(n,jn.cuid2,i.message,t);break;case"startsWith":Yt(n,RegExp(`^${ah(i.value,t)}`),i.message,t);break;case"endsWith":Yt(n,RegExp(`${ah(i.value,t)}$`),i.message,t);break;case"datetime":Ln(n,"date-time",i.message,t);break;case"date":Ln(n,"date",i.message,t);break;case"time":Ln(n,"time",i.message,t);break;case"duration":Ln(n,"duration",i.message,t);break;case"length":et(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t),et(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"includes":{Yt(n,RegExp(ah(i.value,t)),i.message,t);break}case"ip":{i.version!=="v6"&&Ln(n,"ipv4",i.message,t),i.version!=="v4"&&Ln(n,"ipv6",i.message,t);break}case"base64url":Yt(n,jn.base64url,i.message,t);break;case"jwt":Yt(n,jn.jwt,i.message,t);break;case"cidr":{i.version!=="v6"&&Yt(n,jn.ipv4Cidr,i.message,t),i.version!=="v4"&&Yt(n,jn.ipv6Cidr,i.message,t);break}case"emoji":Yt(n,jn.emoji(),i.message,t);break;case"ulid":{Yt(n,jn.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Ln(n,"binary",i.message,t);break}case"contentEncoding:base64":{et(n,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{Yt(n,jn.base64,i.message,t);break}}break}case"nanoid":Yt(n,jn.nanoid,i.message,t)}return n}function ah(e,t){return t.patternStrategy==="escape"?tC(e):e}const eC=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function tC(e){let t="";for(let n=0;n<e.length;n++)eC.has(e[n])||(t+="\\"),t+=e[n];return t}function Ln(e,t,n,i){var l;e.format||(l=e.anyOf)!=null&&l.some(s=>s.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&i.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&i.errorMessages&&{errorMessage:{format:n}}})):et(e,"format",t,n,i)}function Yt(e,t,n,i){var l;e.pattern||(l=e.allOf)!=null&&l.some(s=>s.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&i.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:ax(t,i),...n&&i.errorMessages&&{errorMessage:{pattern:n}}})):et(e,"pattern",ax(t,i),n,i)}function ax(e,t){var d;if(!t.applyRegexFlags||!e.flags)return e.source;const n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=n.i?e.source.toLowerCase():e.source;let l="",s=!1,o=!1,c=!1;for(let h=0;h<i.length;h++){if(s){l+=i[h],s=!1;continue}if(n.i){if(o){if(i[h].match(/[a-z]/)){c?(l+=i[h],l+=`${i[h-2]}-${i[h]}`.toUpperCase(),c=!1):i[h+1]==="-"&&((d=i[h+2])!=null&&d.match(/[a-z]/))?(l+=i[h],c=!0):l+=`${i[h]}${i[h].toUpperCase()}`;continue}}else if(i[h].match(/[a-z]/)){l+=`[${i[h]}${i[h].toUpperCase()}]`;continue}}if(n.m){if(i[h]==="^"){l+=`(^|(?<=[\r
50
+ ]))`;continue}else if(i[h]==="$"){l+=`($|(?=[\r
51
+ ]))`;continue}}if(n.s&&i[h]==="."){l+=o?`${i[h]}\r
52
+ `:`[${i[h]}\r
53
+ ]`;continue}l+=i[h],i[h]==="\\"?s=!0:o&&i[h]==="]"?o=!1:!o&&i[h]==="["&&(o=!0)}try{new RegExp(l)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return l}function u_(e,t){var i,l,s,o,c,d;if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&((i=e.keyType)==null?void 0:i._def.typeName)===pe.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((h,m)=>({...h,[m]:Ke(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",m]})??{}}),{}),additionalProperties:t.rejectedAdditionalProperties};const n={type:"object",additionalProperties:Ke(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return n;if(((l=e.keyType)==null?void 0:l._def.typeName)===pe.ZodString&&((s=e.keyType._def.checks)!=null&&s.length)){const{type:h,...m}=s_(e.keyType._def,t);return{...n,propertyNames:m}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===pe.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};if(((c=e.keyType)==null?void 0:c._def.typeName)===pe.ZodBranded&&e.keyType._def.type._def.typeName===pe.ZodString&&((d=e.keyType._def.type._def.checks)!=null&&d.length)){const{type:h,...m}=a_(e.keyType._def,t);return{...n,propertyNames:m}}}return n}function nC(e,t){if(t.mapStrategy==="record")return u_(e,t);const n=Ke(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},i=Ke(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,i],minItems:2,maxItems:2}}}function rC(e){const t=e.values,i=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),l=Array.from(new Set(i.map(s=>typeof s)));return{type:l.length===1?l[0]==="string"?"string":"number":["string","number"],enum:i}}function iC(){return{not:{}}}function aC(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const Ko={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function lC(e,t){if(t.target==="openApi3")return lx(e,t);const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(i=>i._def.typeName in Ko&&(!i._def.checks||!i._def.checks.length))){const i=n.reduce((l,s)=>{const o=Ko[s._def.typeName];return o&&!l.includes(o)?[...l,o]:l},[]);return{type:i.length>1?i:i[0]}}else if(n.every(i=>i._def.typeName==="ZodLiteral"&&!i.description)){const i=n.reduce((l,s)=>{const o=typeof s._def.value;switch(o){case"string":case"number":case"boolean":return[...l,o];case"bigint":return[...l,"integer"];case"object":if(s._def.value===null)return[...l,"null"];case"symbol":case"undefined":case"function":default:return l}},[]);if(i.length===n.length){const l=i.filter((s,o,c)=>c.indexOf(s)===o);return{type:l.length>1?l:l[0],enum:n.reduce((s,o)=>s.includes(o._def.value)?s:[...s,o._def.value],[])}}}else if(n.every(i=>i._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((i,l)=>[...i,...l._def.values.filter(s=>!i.includes(s))],[])};return lx(e,t)}const lx=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((i,l)=>Ke(i._def,{...t,currentPath:[...t.currentPath,"anyOf",`${l}`]})).filter(i=>!!i&&(!t.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return n.length?{anyOf:n}:void 0};function sC(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Ko[e.innerType._def.typeName],nullable:!0}:{type:[Ko[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){const i=Ke(e.innerType._def,{...t,currentPath:[...t.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}const n=Ke(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function uC(e,t){const n={type:"number"};if(!e.checks)return n;for(const i of e.checks)switch(i.kind){case"int":n.type="integer",i_(n,"type",i.message,t);break;case"min":t.target==="jsonSchema7"?i.inclusive?et(n,"minimum",i.value,i.message,t):et(n,"exclusiveMinimum",i.value,i.message,t):(i.inclusive||(n.exclusiveMinimum=!0),et(n,"minimum",i.value,i.message,t));break;case"max":t.target==="jsonSchema7"?i.inclusive?et(n,"maximum",i.value,i.message,t):et(n,"exclusiveMaximum",i.value,i.message,t):(i.inclusive||(n.exclusiveMaximum=!0),et(n,"maximum",i.value,i.message,t));break;case"multipleOf":et(n,"multipleOf",i.value,i.message,t);break}return n}function oC(e,t){const n=t.target==="openAi",i={type:"object",properties:{}},l=[],s=e.shape();for(const c in s){let d=s[c];if(d===void 0||d._def===void 0)continue;let h=fC(d);h&&n&&(d instanceof Tr&&(d=d._def.innerType),d.isNullable()||(d=d.nullable()),h=!1);const m=Ke(d._def,{...t,currentPath:[...t.currentPath,"properties",c],propertyPath:[...t.currentPath,"properties",c]});m!==void 0&&(i.properties[c]=m,h||l.push(c))}l.length&&(i.required=l);const o=cC(e,t);return o!==void 0&&(i.additionalProperties=o),i}function cC(e,t){if(e.catchall._def.typeName!=="ZodNever")return Ke(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function fC(e){try{return e.isOptional()}catch{return!0}}const dC=(e,t)=>{var i;if(t.currentPath.toString()===((i=t.propertyPath)==null?void 0:i.toString()))return Ke(e.innerType._def,t);const n=Ke(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:{}},n]}:{}},hC=(e,t)=>{if(t.pipeStrategy==="input")return Ke(e.in._def,t);if(t.pipeStrategy==="output")return Ke(e.out._def,t);const n=Ke(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),i=Ke(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,i].filter(l=>l!==void 0)}};function mC(e,t){return Ke(e.type._def,t)}function pC(e,t){const i={type:"array",uniqueItems:!0,items:Ke(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&et(i,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&et(i,"maxItems",e.maxSize.value,e.maxSize.message,t),i}function gC(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,i)=>Ke(n._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[]),additionalItems:Ke(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,i)=>Ke(n._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[])}}function yC(){return{not:{}}}function vC(){return{}}const xC=(e,t)=>Ke(e.innerType._def,t),bC=(e,t,n)=>{switch(t){case pe.ZodString:return s_(e,n);case pe.ZodNumber:return uC(e,n);case pe.ZodObject:return oC(e,n);case pe.ZodBigInt:return $2(e,n);case pe.ZodBoolean:return Z2();case pe.ZodDate:return l_(e,n);case pe.ZodUndefined:return yC();case pe.ZodNull:return aC(n);case pe.ZodArray:return V2(e,n);case pe.ZodUnion:case pe.ZodDiscriminatedUnion:return lC(e,n);case pe.ZodIntersection:return J2(e,n);case pe.ZodTuple:return gC(e,n);case pe.ZodRecord:return u_(e,n);case pe.ZodLiteral:return W2(e,n);case pe.ZodEnum:return Q2(e);case pe.ZodNativeEnum:return rC(e);case pe.ZodNullable:return sC(e,n);case pe.ZodOptional:return dC(e,n);case pe.ZodMap:return nC(e,n);case pe.ZodSet:return pC(e,n);case pe.ZodLazy:return()=>e.getter()._def;case pe.ZodPromise:return mC(e,n);case pe.ZodNaN:case pe.ZodNever:return iC();case pe.ZodEffects:return X2(e,n);case pe.ZodAny:return P2();case pe.ZodUnknown:return vC();case pe.ZodDefault:return G2(e,n);case pe.ZodBranded:return a_(e,n);case pe.ZodReadonly:return xC(e,n);case pe.ZodCatch:return Y2(e,n);case pe.ZodPipeline:return hC(e,n);case pe.ZodFunction:case pe.ZodVoid:case pe.ZodSymbol:return;default:return(i=>{})()}};function Ke(e,t,n=!1){var c;const i=t.seen.get(e);if(t.override){const d=(c=t.override)==null?void 0:c.call(t,e,t,i,n);if(d!==B2)return d}if(i&&!n){const d=_C(i,t);if(d!==void 0)return d}const l={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,l);const s=bC(e,e.typeName,t),o=typeof s=="function"?Ke(s(),t):s;if(o&&SC(e,t,o),t.postProcess){const d=t.postProcess(o,e,t);return l.jsonSchema=o,d}return l.jsonSchema=o,o}const _C=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:wC(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,i)=>t.currentPath[i]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},wC=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},SC=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),EC=(e,t)=>{const n=q2(t),i=void 0,l=t==null?void 0:t.name,s=Ke(e._def,n,!1)??{},o=l===void 0?i?{...s,[n.definitionPath]:i}:s:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,l].join("/"),[n.definitionPath]:{...i,[l]:s}};return n.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in o||"oneOf"in o||"allOf"in o||"type"in o&&Array.isArray(o.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),o},kC=e=>({name:e.name,description:e.description||"",parameters:I2(L2(e.parameters||[])),returnDirect:e.returnDirect,callbackMessage:e.callbackMessage,async execute(t,n){var i;try{const l=await((i=e.handler)==null?void 0:i.call(e,t,n));return typeof l=="string"?[{type:"text",text:l}]:[{type:"text",text:JSON.stringify(l)}]}catch(l){return[{type:"text",text:`Error: ${l}`}]}}}),TC=e=>({name:e.name,description:e.description,parameters:EC(Ho(e.parameters))}),CC=e=>({...kC(e),render:e.render,onlyRender:e.onlyRender});class o_{constructor(){this.tools=new Map,this.waitingMap=new Map}bindTool(t){if(this.tools.has(t.name))throw new Error(`Tool with name ${t.name} already exists`);this.tools.set(t.name,t)}bindTools(t){t.forEach(n=>this.bindTool(n))}getAllTools(){return Array.from(this.tools.values())}getTool(t){return this.tools.get(t)}removeTool(t){return this.tools.delete(t)}clearTools(){this.tools.clear()}reset(){this.clearTools(),this.clearWaiting()}clearWaiting(){this.waitingMap.clear()}async callTool(t,n,i){const l=this.getTool(t);if(!l)throw new Error(`Tool with name ${t} not found`);return await l.execute(n,i)}toJSON(t=!0){return Array.from(this.tools.values()).filter(n=>t?!n.onlyRender:!0).map(n=>TC(n))}doneWaiting(t,n){return this.waitingMap.has(t)?(this.waitingMap.get(t)(n),this.waitingMap.delete(t),!0):(console.warn(`Waiting for tool ${t} not found`),!1)}waitForDone(t){return this.waitingMap.has(t)?this.waitingMap.get(t):new Promise((i,l)=>{this.waitingMap.set(t,i)})}static waitForUIDone(t,n){return n.client.tools.waitForDone(n.message.id)}}class lh{static isUser(t){return t.type==="human"}static isTool(t){return t.type==="tool"}static isAssistant(t){return t.type==="ai"&&!this.isToolAssistant(t)}static isToolAssistant(t){var n,i;return t.type==="ai"&&(((n=t.tool_calls)==null?void 0:n.length)||((i=t.tool_call_chunks)==null?void 0:i.length))}}class AC extends a2{constructor(t){super(t),this.currentAssistant=null,this.currentThread=null,this.streamingCallbacks=new Set,this.tools=new o_,this.stopController=null,this.availableAssistants=[],this.streamingMessage=[],this.graphMessages=[],this.graphState={},this.graphPosition=""}listAssistants(){return this.assistants.search({metadata:null,offset:0,limit:100})}async initAssistant(t){try{const n=await this.listAssistants();if(this.availableAssistants=n,n.length>0)if(t){if(this.currentAssistant=n.find(i=>i.graph_id===t)||null,!this.currentAssistant)throw new Error("Agent not found: "+t)}else this.currentAssistant=n[0];else throw new Error("No assistants found")}catch(n){throw console.error("Failed to initialize LangGraphClient:",n),n}}async createThread({threadId:t}={}){try{return this.currentThread=await this.threads.create({threadId:t}),this.currentThread}catch(n){throw console.error("Failed to create new thread:",n),n}}graphVisualize(){var t;return this.assistants.getGraph((t=this.currentAssistant)==null?void 0:t.assistant_id,{xray:!0})}async listThreads(){return this.threads.search({sortOrder:"desc"})}async resetThread(t,n){await this.initAssistant(t),this.currentThread=await this.threads.get(n),this.graphState=this.currentThread.values,this.graphMessages=this.graphState.messages,this.emitStreamingUpdate({type:"value",data:{event:"messages/partial",data:{messages:this.graphMessages}}})}cloneMessage(t){return JSON.parse(JSON.stringify(t))}updateStreamingMessage(t){const n=this.streamingMessage[this.streamingMessage.length-1];if(!(n!=null&&n.id)||t.id!==n.id){this.streamingMessage.push(t);return}this.streamingMessage[this.streamingMessage.length-1]=t}combineGraphMessagesWithStreamingMessages(){const t=new Map(this.streamingMessage.map(n=>[n.id,n]));return[...this.graphMessages.map(n=>{if(t.has(n.id)){const i=t.get(n.id);return t.delete(n.id),i}return n}),...t.values()]}get renderMessage(){var s;const t=new Map,n=new Set,i=[],l=this.combineGraphMessagesWithStreamingMessages();console.log(l);for(let o=l.length-1;o>=0;o--){const c=this.cloneMessage(l[o]);if(!c.id){i.unshift(c);continue}if(c.type==="ai"&&(c.name||(c.name=this.getGraphNodeNow().name)),lh.isToolAssistant(c)){const d=c;t.set(c.id,d);const m=((s=d.tool_calls)!=null&&s.length?d.tool_calls:d.tool_call_chunks).filter(p=>!n.has(p.id)).map((p,y)=>{var v,b,_,S;return{type:"tool",additional_kwargs:{},tool_input:(S=(_=(b=(v=d.additional_kwargs)==null?void 0:v.tool_calls)==null?void 0:b[y])==null?void 0:_.function)==null?void 0:S.arguments,id:p.id,name:p.name,response_metadata:{},tool_call_id:p.id,content:""}});for(const p of m)t.has(p.id)||(i.unshift(p),t.set(p.id,p));i.unshift(d)}else c.type==="tool"&&c.tool_call_id&&n.add(c.tool_call_id),t.set(c.id,c),i.unshift(c)}return this.attachInfoForMessage(this.composeToolMessages(i))}attachInfoForMessage(t){var i,l,s;let n=null;for(const o of t){const c=((i=o.response_metadata)==null?void 0:i.create_time)||"";try{o.unique_id=o.id+JSON.stringify(o.content).length}catch{o.unique_id=o.id}if(o.spend_time=new Date(c).getTime()-new Date(((l=n==null?void 0:n.response_metadata)==null?void 0:l.create_time)||c).getTime(),!o.usage_metadata&&((s=o.response_metadata)!=null&&s.usage)){const d=o.response_metadata.usage;o.usage_metadata={input_tokens:d.prompt_tokens,output_tokens:d.completion_tokens,total_tokens:d.total_tokens}}n=o}return t}composeToolMessages(t){var s,o;const n=[],i=new Map,l=new Map;for(const c of t)if(!(lh.isToolAssistant(c)&&((s=c.tool_calls||c.tool_call_chunks)==null||s.forEach(d=>{i.set(d.id,d),l.set(d.id,c)}),!c.content))){if(lh.isTool(c)&&!c.tool_input){const d=i.get(c.tool_call_id),h=l.get(c.tool_call_id);d&&(c.tool_input=typeof d.args!="string"?JSON.stringify(d.args):d.args,c.additional_kwargs?(c.additional_kwargs.done=!0,c.done=!0):(c.done=!0,c.additional_kwargs={done:!0})),h&&(c.usage_metadata=h.usage_metadata,c.node_name=h.name,c.name||(c.name=(o=h.tool_calls.find(m=>m.id===c.tool_call_id))==null?void 0:o.name))}n.push(c)}return n}get tokenCounter(){return this.graphMessages.reduce((t,n)=>{var i,l,s,o,c;if(n.usage_metadata)t.total_tokens+=((i=n.usage_metadata)==null?void 0:i.total_tokens)||0,t.input_tokens+=((l=n.usage_metadata)==null?void 0:l.input_tokens)||0,t.output_tokens+=((s=n.usage_metadata)==null?void 0:s.output_tokens)||0;else if((o=n.response_metadata)!=null&&o.usage){const d=(c=n.response_metadata)==null?void 0:c.usage;t.total_tokens+=d.total_tokens||0,t.input_tokens+=d.prompt_tokens||0,t.output_tokens+=d.completion_tokens||0}return t},{total_tokens:0,input_tokens:0,output_tokens:0})}onStreamingUpdate(t){return this.streamingCallbacks.add(t),()=>{this.streamingCallbacks.delete(t)}}emitStreamingUpdate(t){this.streamingCallbacks.forEach(n=>n(t))}cancelRun(){var t,n;(t=this.currentThread)!=null&&t.thread_id&&((n=this.currentRun)!=null&&n.run_id)&&this.runs.cancel(this.currentThread.thread_id,this.currentRun.run_id)}async sendMessage(t,{extraParams:n,_debug:i,command:l}={}){if(!this.currentAssistant)throw new Error("Thread or Assistant not initialized");this.currentThread||(await this.createThread(),this.emitStreamingUpdate({type:"thread",data:{event:"thread/create",data:{thread:this.currentThread}}}));const s=Array.isArray(t)?t:[{type:"human",content:t}],o=(i==null?void 0:i.streamResponse)||this.runs.stream(this.currentThread.thread_id,this.currentAssistant.assistant_id,{input:{...this.graphState,...n||{},messages:s,fe_tools:this.tools.toJSON()},streamMode:["messages","values"],streamSubgraphs:!0,command:l}),c=[];this.emitStreamingUpdate({type:"start",data:{event:"start"}});for await(const h of o)if(c.push(h),h.event==="metadata")this.currentRun=h.data;else if(h.event==="error")this.emitStreamingUpdate({type:"error",data:h});else if(h.event==="messages/partial"){for(const m of h.data)this.updateStreamingMessage(m);this.emitStreamingUpdate({type:"message",data:h});continue}else if(h.event==="values"){const m=h.data;if(m.messages){const p=!!(l!=null&&l.resume),y=m.messages.length>=this.graphMessages.length;(!p||p&&y)&&(this.graphMessages=m.messages,this.emitStreamingUpdate({type:"value",data:h})),this.graphState=h.data}continue}else h.event.startsWith("values|")&&(h.data.messages&&this.mergeSubGraphMessagesToStreamingMessages(h.data.messages),this.graphPosition=h.event.split("|")[1]);const d=await this.runFETool();return d&&c.push(...d),this.emitStreamingUpdate({type:"done",data:{event:"done"}}),this.streamingMessage=[],c}getGraphPosition(){return this.graphPosition.split("|").map(t=>{const[n,i]=t.split(":");return{id:i,name:n}})}getGraphNodeNow(){const t=this.getGraphPosition();return t[t.length-1]}mergeSubGraphMessagesToStreamingMessages(t){const n=new Map(t.filter(i=>i.id).map(i=>[i.id,i]));this.streamingMessage.forEach(i=>{if(n.has(i.id)){const l=n.get(i.id);Object.assign(i,l),n.delete(i.id)}}),n.forEach(i=>{i.type==="tool"&&i.tool_call_id&&this.streamingMessage.push(i)})}runFETool(){var i;const t=this.streamingMessage,n=t[t.length-1];if(n&&n.type==="ai"&&(i=n.tool_calls)!=null&&i.length){const l=n.tool_calls.map(s=>{if(this.tools.getTool(s.name)){const o={...s,tool_call_id:s.id,tool_input:JSON.stringify(s.args),additional_kwargs:{}};return this.callFETool(o,s.args)}});return this.currentThread.status="interrupted",Promise.all(l)}}async callFETool(t,n){const i=this,l=await this.tools.callTool(t.name,n,{client:i,message:t});return this.resume(l)}resume(t){return this.sendMessage([],{command:{resume:t}})}doneFEToolWaiting(t,n){var l;!this.tools.doneWaiting(t,n)&&((l=this.currentThread)==null?void 0:l.status)==="interrupted"&&this.resume(n)}getCurrentThread(){return this.currentThread}getCurrentAssistant(){return this.currentAssistant}async reset(){var t;await this.initAssistant((t=this.currentAssistant)==null?void 0:t.graph_id),this.currentThread=null,this.graphState={},this.graphMessages=[],this.streamingMessage=[],this.currentRun=void 0,this.tools.clearWaiting(),this.emitStreamingUpdate({type:"value",data:{event:"messages/partial"}})}}let In=[],li=0;const Eo=4;let hn=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(i){return n.lc=t.push(i),()=>{for(let s=li+Eo;s<In.length;)In[s]===i?In.splice(s,Eo):s+=Eo;let l=t.indexOf(i);~l&&(t.splice(l,1),--n.lc)}},notify(i,l){let s=!In.length;for(let o of t)In.push(o,n.value,i,l);if(s){for(li=0;li<In.length;li+=Eo)In[li](In[li+1],In[li+2],In[li+3]);In.length=0}},off(){},set(i){let l=n.value;l!==i&&(n.value=i,n.notify(l))},subscribe(i){let l=n.listen(i);return i(n.value),l},value:e};return n};function NC(e,t,n){let i=new Set(t).add(void 0);return e.listen((l,s,o)=>{i.has(o)&&n(l,s,o)})}function OC(e){let t=null,n=null;return function(...i){n=i,t!==null&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{n!==null&&(e(...n),n=null),t=null})}}const MC=e=>e.toLocaleTimeString("en-US"),RC=e=>e.toLocaleString("en"),fp=e=>typeof e=="string"?e:Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.type==="text"?t.text:t.type==="image_url"?"[图片]":JSON.stringify(t)).join(""):JSON.stringify(e),zC=e=>{var n,i,l;const t=(l=(i=(n=e==null?void 0:e.values)==null?void 0:n.messages)==null?void 0:i[0])==null?void 0:l.content;return t&&Array.isArray(t)?t.map(s=>{if(s.type==="text")return s.text}):typeof t=="string"?t:""},DC=(e,t,n={})=>{const i=hn(null),l=hn([]),s=hn(""),o=hn(!1),c=hn([]),d=hn(null),h=hn(n.showHistory??!1),m=hn(e),p=hn(null),y=hn("__start__"),v=hn(n.showGraph??!1),b=hn(null),_=async()=>{var N;v.get()&&b.set(await((N=i.get())==null?void 0:N.graphVisualize())||null)},S=OC(N=>{const B=N.renderMessage,H=B[B.length-1];y.set((H==null?void 0:H.node_name)||(H==null?void 0:H.name)||"__start__"),l.set(B)});async function k(){var B;const N=new AC(t);return await N.initAssistant(m.get()),m.set(N.getCurrentAssistant().graph_id),d.set(null),N.onStreamingUpdate(H=>{if(H.type==="start"&&o.set(!0),H.type==="thread"||H.type==="done")return y.set("__start__"),H.type==="done"&&o.set(!1),U();H.type==="error"&&(o.set(!1),d.set(H.data)),S(N)}),(B=n.onInit)==null||B.call(n,N),N.graphState={},i.set(N),v.get()&&_(),N}const A=async(N,B)=>{var H;!s.get().trim()&&!(N!=null&&N.length)||o.get()||!i.get()||(o.set(!0),d.set(null),await((H=i.get())==null?void 0:H.sendMessage(N||s.get(),B)),s.set(""),o.set(!1))},E=()=>{var N;(N=i.get())==null||N.cancelRun()},O=N=>{const B=c.get();c.set(B.includes(N)?B.filter(H=>H!==N):[...B,N])},D=()=>{h.set(!h.get()),h.get()&&U()},M=hn([]),U=async()=>{var N;if(!(!i.get()||!h.get()))try{const B=await((N=i.get())==null?void 0:N.listThreads());M.set(B||[])}catch(B){console.error("Failed to fetch threads:",B)}};return{data:{client:i,renderMessages:l,userInput:s,loading:o,inChatError:d,currentAgent:m,collapsedTools:c,showHistory:h,historyList:M,currentChatId:p,showGraph:v,graphVisualize:b,currentNodeName:y},mutations:{initClient:k,sendMessage:A,stopGeneration:E,toggleToolCollapse:O,toggleHistoryVisible:D,refreshHistoryList:U,addToHistory:N=>{const B=M.get();M.set([N,...B])},setUserInput(N){s.set(N)},setCurrentAgent(N){return m.set(N),k().then(()=>{h.get()&&U(),v.get()&&_()})},toggleGraphVisible(){v.set(!v.get()),v.get()&&_()},refreshGraph:_,createNewChat(){var N;(N=i.get())==null||N.reset(),d.set(null),o.set(!1)},toHistoryChat(N){var B,H;d.set(null),o.set(!1),(H=i.get())==null||H.resetThread((B=N.metadata)==null?void 0:B.graph_id,N.thread_id)},async deleteHistoryChat(N){var B;await((B=i.get())==null?void 0:B.threads.delete(N.thread_id)),await U()},getToolUIRender:N=>{var F;const H=(F=i.get().tools.getAllTools().find(R=>R.name===N))==null?void 0:F.render;return H?R=>H(new jC(R,i.get())):null}}}};class jC{constructor(t,n){this.message=t,this.client=n}get state(){var t,n;return this.message.type==="tool"&&((n=(t=this.message)==null?void 0:t.additional_kwargs)!=null&&n.done)?"done":"idle"}get input(){try{return JSON.parse(this.message.tool_input)}catch{return null}}get output(){return fp(this.message.content)}getJSONOutput(){return JSON.parse(this.output)}response(t){this.client.doneFEToolWaiting(this.message.id,JSON.stringify(t))}}const LC=(e,t)=>({...Object.fromEntries(Object.entries(e.data).map(([i,l])=>[i,t(l)])),...e.mutations});function IC(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const BC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,HC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,UC={};function sx(e,t){return(UC.jsx?HC:BC).test(e)}const qC=/[ \t\n\f\r]/g;function PC(e){return typeof e=="object"?e.type==="text"?ux(e.value):!1:ux(e)}function ux(e){return e.replace(qC,"")===""}class Ys{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Ys.prototype.normal={};Ys.prototype.property={};Ys.prototype.space=void 0;function c_(e,t){const n={},i={};for(const l of e)Object.assign(n,l.property),Object.assign(i,l.normal);return new Ys(n,i,t)}function Hm(e){return e.toLowerCase()}class rn{constructor(t,n){this.attribute=n,this.property=t}}rn.prototype.attribute="";rn.prototype.booleanish=!1;rn.prototype.boolean=!1;rn.prototype.commaOrSpaceSeparated=!1;rn.prototype.commaSeparated=!1;rn.prototype.defined=!1;rn.prototype.mustUseProperty=!1;rn.prototype.number=!1;rn.prototype.overloadedBoolean=!1;rn.prototype.property="";rn.prototype.spaceSeparated=!1;rn.prototype.space=void 0;let VC=0;const De=Xi(),Et=Xi(),f_=Xi(),he=Xi(),ut=Xi(),qa=Xi(),mn=Xi();function Xi(){return 2**++VC}const Um=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:Et,commaOrSpaceSeparated:mn,commaSeparated:qa,number:he,overloadedBoolean:f_,spaceSeparated:ut},Symbol.toStringTag,{value:"Module"})),sh=Object.keys(Um);class dp extends rn{constructor(t,n,i,l){let s=-1;if(super(t,n),ox(this,"space",l),typeof i=="number")for(;++s<sh.length;){const o=sh[s];ox(this,sh[s],(i&Um[o])===Um[o])}}}dp.prototype.defined=!0;function ox(e,t,n){n&&(e[t]=n)}function rl(e){const t={},n={};for(const[i,l]of Object.entries(e.properties)){const s=new dp(i,e.transform(e.attributes||{},i),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[Hm(i)]=i,n[Hm(s.attribute)]=i}return new Ys(t,n,e.space)}const d_=rl({properties:{ariaActiveDescendant:null,ariaAtomic:Et,ariaAutoComplete:null,ariaBusy:Et,ariaChecked:Et,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:ut,ariaCurrent:null,ariaDescribedBy:ut,ariaDetails:null,ariaDisabled:Et,ariaDropEffect:ut,ariaErrorMessage:null,ariaExpanded:Et,ariaFlowTo:ut,ariaGrabbed:Et,ariaHasPopup:null,ariaHidden:Et,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ut,ariaLevel:he,ariaLive:null,ariaModal:Et,ariaMultiLine:Et,ariaMultiSelectable:Et,ariaOrientation:null,ariaOwns:ut,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Et,ariaReadOnly:Et,ariaRelevant:null,ariaRequired:Et,ariaRoleDescription:ut,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Et,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function h_(e,t){return t in e?e[t]:t}function m_(e,t){return h_(e,t.toLowerCase())}const $C=rl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qa,acceptCharset:ut,accessKey:ut,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:ut,autoFocus:De,autoPlay:De,blocking:ut,capture:null,charSet:null,checked:De,cite:null,className:ut,cols:he,colSpan:null,content:null,contentEditable:Et,controls:De,controlsList:ut,coords:he|qa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:f_,draggable:Et,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:ut,height:he,hidden:De,high:he,href:null,hrefLang:null,htmlFor:ut,httpEquiv:ut,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:ut,itemRef:ut,itemScope:De,itemType:ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:he,pattern:null,ping:ut,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:ut,required:De,reversed:De,rows:he,rowSpan:he,sandbox:ut,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Et,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:Et,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ut,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Et,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:De,disableRemotePlayback:De,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:m_}),ZC=rl({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"},properties:{about:mn,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:ut,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:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,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:qa,g2:qa,glyphName:qa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:mn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,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:he,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:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mn,rev:mn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mn,requiredFeatures:mn,requiredFonts:mn,requiredFormats:mn,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:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:mn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mn,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:h_}),p_=rl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),g_=rl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:m_}),y_=rl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),YC={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"},FC=/[A-Z]/g,cx=/-[a-z]/g,GC=/^data[-\w.:]+$/i;function XC(e,t){const n=Hm(t);let i=t,l=rn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&GC.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(cx,KC);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!cx.test(s)){let o=s.replace(FC,QC);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}l=dp}return new l(i,t)}function QC(e){return"-"+e.toLowerCase()}function KC(e){return e.charAt(1).toUpperCase()}const JC=c_([d_,$C,p_,g_,y_],"html"),hp=c_([d_,ZC,p_,g_,y_],"svg");function WC(e){return e.join(" ").trim()}var Da={},uh,fx;function eA(){if(fx)return uh;fx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
54
+ `,h="/",m="*",p="",y="comment",v="declaration";uh=function(_,S){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];S=S||{};var k=1,A=1;function E(F){var R=F.match(t);R&&(k+=R.length);var $=F.lastIndexOf(d);A=~$?F.length-$:A+F.length}function O(){var F={line:k,column:A};return function(R){return R.position=new D(F),L(),R}}function D(F){this.start=F,this.end={line:k,column:A},this.source=S.source}D.prototype.content=_;function M(F){var R=new Error(S.source+":"+k+":"+A+": "+F);if(R.reason=F,R.filename=S.source,R.line=k,R.column=A,R.source=_,!S.silent)throw R}function U(F){var R=F.exec(_);if(R){var $=R[0];return E($),_=_.slice($.length),R}}function L(){U(n)}function q(F){var R;for(F=F||[];R=N();)R!==!1&&F.push(R);return F}function N(){var F=O();if(!(h!=_.charAt(0)||m!=_.charAt(1))){for(var R=2;p!=_.charAt(R)&&(m!=_.charAt(R)||h!=_.charAt(R+1));)++R;if(R+=2,p===_.charAt(R-1))return M("End of comment missing");var $=_.slice(2,R-2);return A+=2,E($),_=_.slice(R),A+=2,F({type:y,comment:$})}}function B(){var F=O(),R=U(i);if(R){if(N(),!U(l))return M("property missing ':'");var $=U(s),j=F({type:v,property:b(R[0].replace(e,p)),value:$?b($[0].replace(e,p)):p});return U(o),j}}function H(){var F=[];q(F);for(var R;R=B();)R!==!1&&(F.push(R),q(F));return F}return L(),H()};function b(_){return _?_.replace(c,p):p}return uh}var dx;function tA(){if(dx)return Da;dx=1;var e=Da&&Da.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Da,"__esModule",{value:!0}),Da.default=n;var t=e(eA());function n(i,l){var s=null;if(!i||typeof i!="string")return s;var o=(0,t.default)(i),c=typeof l=="function";return o.forEach(function(d){if(d.type==="declaration"){var h=d.property,m=d.value;c?l(h,m,d):m&&(s=s||{},s[h]=m)}}),s}return Da}var ds={},hx;function nA(){if(hx)return ds;hx=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,s=function(h){return!h||n.test(h)||e.test(h)},o=function(h,m){return m.toUpperCase()},c=function(h,m){return"".concat(m,"-")},d=function(h,m){return m===void 0&&(m={}),s(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(l,c):h=h.replace(i,c),h.replace(t,o))};return ds.camelCase=d,ds}var hs,mx;function rA(){if(mx)return hs;mx=1;var e=hs&&hs.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(tA()),n=nA();function i(l,s){var o={};return!l||typeof l!="string"||(0,t.default)(l,function(c,d){c&&d&&(o[(0,n.camelCase)(c,s)]=d)}),o}return i.default=i,hs=i,hs}var iA=rA();const aA=yi(iA),v_=x_("end"),mp=x_("start");function x_(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function lA(e){const t=mp(e),n=v_(e);if(t&&n)return{start:t,end:n}}function Es(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?px(e.position):"start"in e||"end"in e?px(e):"line"in e||"column"in e?qm(e):""}function qm(e){return gx(e&&e.line)+":"+gx(e&&e.column)}function px(e){return qm(e&&e.start)+"-"+qm(e&&e.end)}function gx(e){return e&&typeof e=="number"?e:1}class Pt extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let l="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?l=t:!s.cause&&t&&(o=!0,l=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const d=i.indexOf(":");d===-1?s.ruleId=i:(s.source=i.slice(0,d),s.ruleId=i.slice(d+1))}if(!s.place&&s.ancestors&&s.ancestors){const d=s.ancestors[s.ancestors.length-1];d&&(s.place=d.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file,this.message=l,this.line=c?c.line:void 0,this.name=Es(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}Pt.prototype.file="";Pt.prototype.name="";Pt.prototype.reason="";Pt.prototype.message="";Pt.prototype.stack="";Pt.prototype.column=void 0;Pt.prototype.line=void 0;Pt.prototype.ancestors=void 0;Pt.prototype.cause=void 0;Pt.prototype.fatal=void 0;Pt.prototype.place=void 0;Pt.prototype.ruleId=void 0;Pt.prototype.source=void 0;const pp={}.hasOwnProperty,sA=new Map,uA=/[A-Z]/g,oA=new Set(["table","tbody","thead","tfoot","tr"]),cA=new Set(["td","th"]),b_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function fA(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=xA(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");i=vA(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,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"?hp:JC,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=__(l,e,void 0);return s&&typeof s!="string"?s:l.create(e,l.Fragment,{children:s||void 0},void 0)}function __(e,t,n){if(t.type==="element")return dA(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return hA(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return pA(e,t,n);if(t.type==="mdxjsEsm")return mA(e,t);if(t.type==="root")return gA(e,t,n);if(t.type==="text")return yA(e,t)}function dA(e,t,n){const i=e.schema;let l=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(l=hp,e.schema=l),e.ancestors.push(t);const s=S_(e,t.tagName,!1),o=bA(e,t);let c=yp(e,t);return oA.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!PC(d):!0})),w_(e,o,s,t),gp(o,c),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function hA(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}zs(e,t.position)}function mA(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zs(e,t.position)}function pA(e,t,n){const i=e.schema;let l=i;t.name==="svg"&&i.space==="html"&&(l=hp,e.schema=l),e.ancestors.push(t);const s=t.name===null?e.Fragment:S_(e,t.name,!0),o=_A(e,t),c=yp(e,t);return w_(e,o,s,t),gp(o,c),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function gA(e,t,n){const i={};return gp(i,yp(e,t)),e.create(t,e.Fragment,i,n)}function yA(e,t){return t.value}function w_(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function gp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function vA(e,t,n){return i;function i(l,s,o,c){const h=Array.isArray(o.children)?n:t;return c?h(s,o,c):h(s,o)}}function xA(e,t){return n;function n(i,l,s,o){const c=Array.isArray(s.children),d=mp(i);return t(l,s,o,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function bA(e,t){const n={};let i,l;for(l in t.properties)if(l!=="children"&&pp.call(t.properties,l)){const s=wA(e,l,t.properties[l]);if(s){const[o,c]=s;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&cA.has(t.tagName)?i=c:n[o]=c}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function _A(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const o=s.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else zs(e,t.position);else{const l=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const c=i.value.data.estree.body[0];c.type,s=e.evaluater.evaluateExpression(c.expression)}else zs(e,t.position);else s=i.value===null?!0:i.value;n[l]=s}return n}function yp(e,t){const n=[];let i=-1;const l=e.passKeys?new Map:sA;for(;++i<t.children.length;){const s=t.children[i];let o;if(e.passKeys){const d=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(d){const h=l.get(d)||0;o=d+"-"+h,l.set(d,h+1)}}const c=__(e,s,o);c!==void 0&&n.push(c)}return n}function wA(e,t,n){const i=XC(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?IC(n):WC(n)),i.property==="style"){let l=typeof n=="object"?n:SA(e,String(n));return e.stylePropertyNameCase==="css"&&(l=EA(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&i.space?YC[i.property]||i.property:i.attribute,n]}}function SA(e,t){try{return aA(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,l=new Pt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=b_+"#cannot-parse-style-attribute",l}}function S_(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let s=-1,o;for(;++s<l.length;){const c=sx(l[s])?{type:"Identifier",name:l[s]}:{type:"Literal",value:l[s]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}i=o}else i=sx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const l=i.value;return pp.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(i);zs(e)}function zs(e,t){const n=new Pt("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=b_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function EA(e){const t={};let n;for(n in e)pp.call(e,n)&&(t[kA(n)]=e[n]);return t}function kA(e){let t=e.replace(uA,TA);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function TA(e){return"-"+e.toLowerCase()}const oh={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"]},CA={};function vp(e,t){const n=CA,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return E_(e,i,l)}function E_(e,t,n){if(AA(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 yx(e.children,t,n)}return Array.isArray(e)?yx(e,t,n):""}function yx(e,t,n){const i=[];let l=-1;for(;++l<e.length;)i[l]=E_(e[l],t,n);return i.join("")}function AA(e){return!!(e&&typeof e=="object")}const vx=document.createElement("i");function xp(e){const t="&"+e+";";vx.innerHTML=t;const n=vx.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function gn(e,t,n,i){const l=e.length;let s=0,o;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<i.length;)o=i.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function Cn(e,t){return e.length>0?(gn(e,e.length,0,t),e):t}const xx={}.hasOwnProperty;function k_(e){const t={};let n=-1;for(;++n<e.length;)NA(t,e[n]);return t}function NA(e,t){let n;for(n in t){const l=(xx.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){xx.call(l,o)||(l[o]=[]);const c=s[o];OA(l[o],Array.isArray(c)?c:c?[c]:[])}}}function OA(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);gn(e,0,0,i)}function T_(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?"�":String.fromCodePoint(n)}function qn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ft=vi(/[A-Za-z]/),qt=vi(/[\dA-Za-z]/),MA=vi(/[#-'*+\--9=?A-Z^-~]/);function Jo(e){return e!==null&&(e<32||e===127)}const Pm=vi(/\d/),RA=vi(/[\dA-Fa-f]/),zA=vi(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function at(e){return e!==null&&(e<0||e===32)}function Pe(e){return e===-2||e===-1||e===32}const pc=vi(new RegExp("\\p{P}|\\p{S}","u")),Yi=vi(/\s/);function vi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function il(e){const t=[];let n=-1,i=0,l=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&qt(e.charCodeAt(n+1))&&qt(e.charCodeAt(n+2)))l=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const c=e.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(o=String.fromCharCode(s,c),l=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+l+1,o=""),l&&(n+=l,l=0)}return t.join("")+e.slice(i)}function $e(e,t,n,i){const l=i?i-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(d){return Pe(d)?(e.enter(n),c(d)):t(d)}function c(d){return Pe(d)&&s++<l?(e.consume(d),c):(e.exit(n),t(d))}}const DA={tokenize:jA};function jA(e){const t=e.attempt(this.parser.constructs.contentInitial,i,l);let n;return t;function i(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),$e(e,t,"linePrefix")}function l(c){return e.enter("paragraph"),s(c)}function s(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ce(c)?(e.consume(c),e.exit("chunkText"),s):(e.consume(c),o)}}const LA={tokenize:IA},bx={tokenize:BA};function IA(e){const t=this,n=[];let i=0,l,s,o;return c;function c(E){if(i<n.length){const O=n[i];return t.containerState=O[1],e.attempt(O[0].continuation,d,h)(E)}return h(E)}function d(E){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&A();const O=t.events.length;let D=O,M;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){M=t.events[D][1].end;break}k(i);let U=O;for(;U<t.events.length;)t.events[U][1].end={...M},U++;return gn(t.events,D+1,0,t.events.slice(O)),t.events.length=U,h(E)}return c(E)}function h(E){if(i===n.length){if(!l)return y(E);if(l.currentConstruct&&l.currentConstruct.concrete)return b(E);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(bx,m,p)(E)}function m(E){return l&&A(),k(i),y(E)}function p(E){return t.parser.lazy[t.now().line]=i!==n.length,o=t.now().offset,b(E)}function y(E){return t.containerState={},e.attempt(bx,v,b)(E)}function v(E){return i++,n.push([t.currentConstruct,t.containerState]),y(E)}function b(E){if(E===null){l&&A(),k(0),e.consume(E);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:s}),_(E)}function _(E){if(E===null){S(e.exit("chunkFlow"),!0),k(0),e.consume(E);return}return Ce(E)?(e.consume(E),S(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(E),_)}function S(E,O){const D=t.sliceStream(E);if(O&&D.push(null),E.previous=s,s&&(s.next=E),s=E,l.defineSkip(E.start),l.write(D),t.parser.lazy[E.start.line]){let M=l.events.length;for(;M--;)if(l.events[M][1].start.offset<o&&(!l.events[M][1].end||l.events[M][1].end.offset>o))return;const U=t.events.length;let L=U,q,N;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(q){N=t.events[L][1].end;break}q=!0}for(k(i),M=U;M<t.events.length;)t.events[M][1].end={...N},M++;gn(t.events,L+1,0,t.events.slice(U)),t.events.length=M}}function k(E){let O=n.length;for(;O-- >E;){const D=n[O];t.containerState=D[1],D[0].exit.call(t,e)}n.length=E}function A(){l.write([null]),s=void 0,l=void 0,t.containerState._closeFlow=void 0}}function BA(e,t,n){return $e(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xa(e){if(e===null||at(e)||Yi(e))return 1;if(pc(e))return 2}function gc(e,t,n){const i=[];let l=-1;for(;++l<e.length;){const s=e[l].resolveAll;s&&!i.includes(s)&&(t=s(t,n),i.push(s))}return t}const Vm={name:"attention",resolveAll:HA,tokenize:UA};function HA(e,t){let n=-1,i,l,s,o,c,d,h,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[i][1].end},y={...e[n][1].start};_x(p,-d),_x(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[i][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},s={type:d>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},l={type:d>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[i][1].end={...o.start},e[n][1].start={...c.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=Cn(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=Cn(h,[["enter",l,t],["enter",o,t],["exit",o,t],["enter",s,t]]),h=Cn(h,gc(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=Cn(h,[["exit",s,t],["enter",c,t],["exit",c,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=Cn(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,gn(e,i-1,n-i+3,h),n=i+h.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function UA(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,l=Xa(i);let s;return o;function o(d){return s=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===s)return e.consume(d),c;const h=e.exit("attentionSequence"),m=Xa(d),p=!m||m===2&&l||n.includes(d),y=!l||l===2&&m||n.includes(i);return h._open=!!(s===42?p:p&&(l||!y)),h._close=!!(s===42?y:y&&(m||!p)),t(d)}}function _x(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const qA={name:"autolink",tokenize:PA};function PA(e,t,n){let i=0;return l;function l(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(v){return Ft(v)?(e.consume(v),o):v===64?n(v):h(v)}function o(v){return v===43||v===45||v===46||qt(v)?(i=1,c(v)):h(v)}function c(v){return v===58?(e.consume(v),i=0,d):(v===43||v===45||v===46||qt(v))&&i++<32?(e.consume(v),c):(i=0,h(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Jo(v)?n(v):(e.consume(v),d)}function h(v){return v===64?(e.consume(v),m):MA(v)?(e.consume(v),h):n(v)}function m(v){return qt(v)?p(v):n(v)}function p(v){return v===46?(e.consume(v),i=0,m):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||qt(v))&&i++<63){const b=v===45?y:p;return e.consume(v),b}return n(v)}}const Fs={partial:!0,tokenize:VA};function VA(e,t,n){return i;function i(s){return Pe(s)?$e(e,l,"linePrefix")(s):l(s)}function l(s){return s===null||Ce(s)?t(s):n(s)}}const C_={continuation:{tokenize:ZA},exit:YA,name:"blockQuote",tokenize:$A};function $A(e,t,n){const i=this;return l;function l(o){if(o===62){const c=i.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return Pe(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function ZA(e,t,n){const i=this;return l;function l(o){return Pe(o)?$e(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(C_,t,n)(o)}}function YA(e){e.exit("blockQuote")}const A_={name:"characterEscape",tokenize:FA};function FA(e,t,n){return i;function i(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),l}function l(s){return zA(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const N_={name:"characterReference",tokenize:GA};function GA(e,t,n){const i=this;let l=0,s,o;return c;function c(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),d}function d(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),s=31,o=qt,m(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=RA,m):(e.enter("characterReferenceValue"),s=7,o=Pm,m(p))}function m(p){if(p===59&&l){const y=e.exit("characterReferenceValue");return o===qt&&!xp(i.sliceSerialize(y))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&l++<s?(e.consume(p),m):n(p)}}const wx={partial:!0,tokenize:QA},Sx={concrete:!0,name:"codeFenced",tokenize:XA};function XA(e,t,n){const i=this,l={partial:!0,tokenize:D};let s=0,o=0,c;return d;function d(M){return h(M)}function h(M){const U=i.events[i.events.length-1];return s=U&&U[1].type==="linePrefix"?U[2].sliceSerialize(U[1],!0).length:0,c=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(M)}function m(M){return M===c?(o++,e.consume(M),m):o<3?n(M):(e.exit("codeFencedFenceSequence"),Pe(M)?$e(e,p,"whitespace")(M):p(M))}function p(M){return M===null||Ce(M)?(e.exit("codeFencedFence"),i.interrupt?t(M):e.check(wx,_,O)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(M))}function y(M){return M===null||Ce(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(M)):Pe(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),$e(e,v,"whitespace")(M)):M===96&&M===c?n(M):(e.consume(M),y)}function v(M){return M===null||Ce(M)?p(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(M))}function b(M){return M===null||Ce(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(M)):M===96&&M===c?n(M):(e.consume(M),b)}function _(M){return e.attempt(l,O,S)(M)}function S(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),k}function k(M){return s>0&&Pe(M)?$e(e,A,"linePrefix",s+1)(M):A(M)}function A(M){return M===null||Ce(M)?e.check(wx,_,O)(M):(e.enter("codeFlowValue"),E(M))}function E(M){return M===null||Ce(M)?(e.exit("codeFlowValue"),A(M)):(e.consume(M),E)}function O(M){return e.exit("codeFenced"),t(M)}function D(M,U,L){let q=0;return N;function N($){return M.enter("lineEnding"),M.consume($),M.exit("lineEnding"),B}function B($){return M.enter("codeFencedFence"),Pe($)?$e(M,H,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):H($)}function H($){return $===c?(M.enter("codeFencedFenceSequence"),F($)):L($)}function F($){return $===c?(q++,M.consume($),F):q>=o?(M.exit("codeFencedFenceSequence"),Pe($)?$e(M,R,"whitespace")($):R($)):L($)}function R($){return $===null||Ce($)?(M.exit("codeFencedFence"),U($)):L($)}}}function QA(e,t,n){const i=this;return l;function l(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const ch={name:"codeIndented",tokenize:JA},KA={partial:!0,tokenize:WA};function JA(e,t,n){const i=this;return l;function l(h){return e.enter("codeIndented"),$e(e,s,"linePrefix",5)(h)}function s(h){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?o(h):n(h)}function o(h){return h===null?d(h):Ce(h)?e.attempt(KA,o,d)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||Ce(h)?(e.exit("codeFlowValue"),o(h)):(e.consume(h),c)}function d(h){return e.exit("codeIndented"),t(h)}}function WA(e,t,n){const i=this;return l;function l(o){return i.parser.lazy[i.now().line]?n(o):Ce(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):$e(e,s,"linePrefix",5)(o)}function s(o){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):Ce(o)?l(o):n(o)}}const eN={name:"codeText",previous:nN,resolve:tN,tokenize:rN};function tN(e){let t=e.length-4,n=3,i,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)l===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(l=i):(i===t||e[i][1].type==="lineEnding")&&(e[l][1].type="codeTextData",i!==l+2&&(e[l][1].end=e[i-1][1].end,e.splice(l+2,i-l-2),t-=i-l-2,i=l+2),l=void 0);return e}function nN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function rN(e,t,n){let i=0,l,s;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),i++,c):(e.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),d):p===96?(s=e.enter("codeTextSequence"),l=0,m(p)):Ce(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||Ce(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),h)}function m(p){return p===96?(e.consume(p),l++,m):l===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(s.type="codeTextData",h(p))}}class iN{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 i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const l=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return i&&ms(this.left,i),s.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),ms(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ms(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);ms(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ms(this.left,n.reverse())}}}function ms(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 O_(e){const t={};let n=-1,i,l,s,o,c,d,h;const m=new iN(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(i=m.get(n),n&&i[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=i[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,aN(m,n)),n=t[n],h=!0);else if(i[1]._container){for(s=n,l=void 0;s--;)if(o=m.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(l&&(m.get(l)[1].type="lineEndingBlank"),o[1].type="lineEnding",l=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;l&&(i[1].end={...m.get(l)[1].start},c=m.slice(l,n),c.unshift(i),m.splice(l,n-l+1,c))}}return gn(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function aN(e,t){const n=e.get(t)[1],i=e.get(t)[2];let l=t-1;const s=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,d=[],h={};let m,p,y=-1,v=n,b=0,_=0;const S=[_];for(;v;){for(;e.get(++l)[1]!==v;);s.push(l),v._tokenizer||(m=i.sliceStream(v),v.next||m.push(null),p&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(m),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=v,v=v.next}for(v=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(_=y+1,S.push(_),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):S.pop(),y=S.length;y--;){const k=c.slice(S[y],S[y+1]),A=s.pop();d.push([A,A+k.length-1]),e.splice(A,2,k)}for(d.reverse(),y=-1;++y<d.length;)h[b+d[y][0]]=b+d[y][1],b+=d[y][1]-d[y][0]-1;return h}const lN={resolve:uN,tokenize:oN},sN={partial:!0,tokenize:cN};function uN(e){return O_(e),e}function oN(e,t){let n;return i;function i(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(c)}function l(c){return c===null?s(c):Ce(c)?e.check(sN,o,s)(c):(e.consume(c),l)}function s(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function cN(e,t,n){const i=this;return l;function l(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),$e(e,s,"linePrefix")}function s(o){if(o===null||Ce(o))return n(o);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function M_(e,t,n,i,l,s,o,c,d){const h=d||Number.POSITIVE_INFINITY;let m=0;return p;function p(k){return k===60?(e.enter(i),e.enter(l),e.enter(s),e.consume(k),e.exit(s),y):k===null||k===32||k===41||Jo(k)?n(k):(e.enter(i),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),_(k))}function y(k){return k===62?(e.enter(s),e.consume(k),e.exit(s),e.exit(l),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(c),y(k)):k===null||k===60||Ce(k)?n(k):(e.consume(k),k===92?b:v)}function b(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function _(k){return!m&&(k===null||k===41||at(k))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(i),t(k)):m<h&&k===40?(e.consume(k),m++,_):k===41?(e.consume(k),m--,_):k===null||k===32||k===40||Jo(k)?n(k):(e.consume(k),k===92?S:_)}function S(k){return k===40||k===41||k===92?(e.consume(k),_):_(k)}}function R_(e,t,n,i,l,s){const o=this;let c=0,d;return h;function h(v){return e.enter(i),e.enter(l),e.consume(v),e.exit(l),e.enter(s),m}function m(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(s),e.enter(l),e.consume(v),e.exit(l),e.exit(i),t):Ce(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||v===91||v===93||Ce(v)||c++>999?(e.exit("chunkString"),m(v)):(e.consume(v),d||(d=!Pe(v)),v===92?y:p)}function y(v){return v===91||v===92||v===93?(e.consume(v),c++,p):p(v)}}function z_(e,t,n,i,l,s){let o;return c;function c(y){return y===34||y===39||y===40?(e.enter(i),e.enter(l),e.consume(y),e.exit(l),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(l),e.consume(y),e.exit(l),e.exit(i),t):(e.enter(s),h(y))}function h(y){return y===o?(e.exit(s),d(o)):y===null?n(y):Ce(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),$e(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===o||y===null||Ce(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?p:m)}function p(y){return y===o||y===92?(e.consume(y),m):m(y)}}function ks(e,t){let n;return i;function i(l){return Ce(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,i):Pe(l)?$e(e,i,n?"linePrefix":"lineSuffix")(l):t(l)}}const fN={name:"definition",tokenize:hN},dN={partial:!0,tokenize:mN};function hN(e,t,n){const i=this;let l;return s;function s(v){return e.enter("definition"),o(v)}function o(v){return R_.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return l=qn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return at(v)?ks(e,h)(v):h(v)}function h(v){return M_(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return e.attempt(dN,p,p)(v)}function p(v){return Pe(v)?$e(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Ce(v)?(e.exit("definition"),i.parser.defined.push(l),t(v)):n(v)}}function mN(e,t,n){return i;function i(c){return at(c)?ks(e,l)(c):n(c)}function l(c){return z_(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return Pe(c)?$e(e,o,"whitespace")(c):o(c)}function o(c){return c===null||Ce(c)?t(c):n(c)}}const pN={name:"hardBreakEscape",tokenize:gN};function gN(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),l}function l(s){return Ce(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const yN={name:"headingAtx",resolve:vN,tokenize:xN};function vN(e,t){let n=e.length-2,i=3,l,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(l={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},gn(e,i,n-i+1,[["enter",l,t],["enter",s,t],["exit",s,t],["exit",l,t]])),e}function xN(e,t,n){let i=0;return l;function l(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),o(m)}function o(m){return m===35&&i++<6?(e.consume(m),o):m===null||at(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||Ce(m)?(e.exit("atxHeading"),t(m)):Pe(m)?$e(e,c,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),c(m))}function h(m){return m===null||m===35||at(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),h)}}const bN=["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"],Ex=["pre","script","style","textarea"],_N={concrete:!0,name:"htmlFlow",resolveTo:EN,tokenize:kN},wN={partial:!0,tokenize:CN},SN={partial:!0,tokenize:TN};function EN(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 kN(e,t,n){const i=this;let l,s,o,c,d;return h;function h(C){return m(C)}function m(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),p}function p(C){return C===33?(e.consume(C),y):C===47?(e.consume(C),s=!0,_):C===63?(e.consume(C),l=3,i.interrupt?t:w):Ft(C)?(e.consume(C),o=String.fromCharCode(C),S):n(C)}function y(C){return C===45?(e.consume(C),l=2,v):C===91?(e.consume(C),l=5,c=0,b):Ft(C)?(e.consume(C),l=4,i.interrupt?t:w):n(C)}function v(C){return C===45?(e.consume(C),i.interrupt?t:w):n(C)}function b(C){const Y="CDATA[";return C===Y.charCodeAt(c++)?(e.consume(C),c===Y.length?i.interrupt?t:H:b):n(C)}function _(C){return Ft(C)?(e.consume(C),o=String.fromCharCode(C),S):n(C)}function S(C){if(C===null||C===47||C===62||at(C)){const Y=C===47,Q=o.toLowerCase();return!Y&&!s&&Ex.includes(Q)?(l=1,i.interrupt?t(C):H(C)):bN.includes(o.toLowerCase())?(l=6,Y?(e.consume(C),k):i.interrupt?t(C):H(C)):(l=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(C):s?A(C):E(C))}return C===45||qt(C)?(e.consume(C),o+=String.fromCharCode(C),S):n(C)}function k(C){return C===62?(e.consume(C),i.interrupt?t:H):n(C)}function A(C){return Pe(C)?(e.consume(C),A):N(C)}function E(C){return C===47?(e.consume(C),N):C===58||C===95||Ft(C)?(e.consume(C),O):Pe(C)?(e.consume(C),E):N(C)}function O(C){return C===45||C===46||C===58||C===95||qt(C)?(e.consume(C),O):D(C)}function D(C){return C===61?(e.consume(C),M):Pe(C)?(e.consume(C),D):E(C)}function M(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),d=C,U):Pe(C)?(e.consume(C),M):L(C)}function U(C){return C===d?(e.consume(C),d=null,q):C===null||Ce(C)?n(C):(e.consume(C),U)}function L(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||at(C)?D(C):(e.consume(C),L)}function q(C){return C===47||C===62||Pe(C)?E(C):n(C)}function N(C){return C===62?(e.consume(C),B):n(C)}function B(C){return C===null||Ce(C)?H(C):Pe(C)?(e.consume(C),B):n(C)}function H(C){return C===45&&l===2?(e.consume(C),j):C===60&&l===1?(e.consume(C),P):C===62&&l===4?(e.consume(C),Z):C===63&&l===3?(e.consume(C),w):C===93&&l===5?(e.consume(C),X):Ce(C)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(wN,te,F)(C)):C===null||Ce(C)?(e.exit("htmlFlowData"),F(C)):(e.consume(C),H)}function F(C){return e.check(SN,R,te)(C)}function R(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),$}function $(C){return C===null||Ce(C)?F(C):(e.enter("htmlFlowData"),H(C))}function j(C){return C===45?(e.consume(C),w):H(C)}function P(C){return C===47?(e.consume(C),o="",K):H(C)}function K(C){if(C===62){const Y=o.toLowerCase();return Ex.includes(Y)?(e.consume(C),Z):H(C)}return Ft(C)&&o.length<8?(e.consume(C),o+=String.fromCharCode(C),K):H(C)}function X(C){return C===93?(e.consume(C),w):H(C)}function w(C){return C===62?(e.consume(C),Z):C===45&&l===2?(e.consume(C),w):H(C)}function Z(C){return C===null||Ce(C)?(e.exit("htmlFlowData"),te(C)):(e.consume(C),Z)}function te(C){return e.exit("htmlFlow"),t(C)}}function TN(e,t,n){const i=this;return l;function l(o){return Ce(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function CN(e,t,n){return i;function i(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Fs,t,n)}}const AN={name:"htmlText",tokenize:NN};function NN(e,t,n){const i=this;let l,s,o;return c;function c(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),d}function d(w){return w===33?(e.consume(w),h):w===47?(e.consume(w),D):w===63?(e.consume(w),E):Ft(w)?(e.consume(w),L):n(w)}function h(w){return w===45?(e.consume(w),m):w===91?(e.consume(w),s=0,b):Ft(w)?(e.consume(w),A):n(w)}function m(w){return w===45?(e.consume(w),v):n(w)}function p(w){return w===null?n(w):w===45?(e.consume(w),y):Ce(w)?(o=p,P(w)):(e.consume(w),p)}function y(w){return w===45?(e.consume(w),v):p(w)}function v(w){return w===62?j(w):w===45?y(w):p(w)}function b(w){const Z="CDATA[";return w===Z.charCodeAt(s++)?(e.consume(w),s===Z.length?_:b):n(w)}function _(w){return w===null?n(w):w===93?(e.consume(w),S):Ce(w)?(o=_,P(w)):(e.consume(w),_)}function S(w){return w===93?(e.consume(w),k):_(w)}function k(w){return w===62?j(w):w===93?(e.consume(w),k):_(w)}function A(w){return w===null||w===62?j(w):Ce(w)?(o=A,P(w)):(e.consume(w),A)}function E(w){return w===null?n(w):w===63?(e.consume(w),O):Ce(w)?(o=E,P(w)):(e.consume(w),E)}function O(w){return w===62?j(w):E(w)}function D(w){return Ft(w)?(e.consume(w),M):n(w)}function M(w){return w===45||qt(w)?(e.consume(w),M):U(w)}function U(w){return Ce(w)?(o=U,P(w)):Pe(w)?(e.consume(w),U):j(w)}function L(w){return w===45||qt(w)?(e.consume(w),L):w===47||w===62||at(w)?q(w):n(w)}function q(w){return w===47?(e.consume(w),j):w===58||w===95||Ft(w)?(e.consume(w),N):Ce(w)?(o=q,P(w)):Pe(w)?(e.consume(w),q):j(w)}function N(w){return w===45||w===46||w===58||w===95||qt(w)?(e.consume(w),N):B(w)}function B(w){return w===61?(e.consume(w),H):Ce(w)?(o=B,P(w)):Pe(w)?(e.consume(w),B):q(w)}function H(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),l=w,F):Ce(w)?(o=H,P(w)):Pe(w)?(e.consume(w),H):(e.consume(w),R)}function F(w){return w===l?(e.consume(w),l=void 0,$):w===null?n(w):Ce(w)?(o=F,P(w)):(e.consume(w),F)}function R(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||at(w)?q(w):(e.consume(w),R)}function $(w){return w===47||w===62||at(w)?q(w):n(w)}function j(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function P(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),K}function K(w){return Pe(w)?$e(e,X,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):X(w)}function X(w){return e.enter("htmlTextData"),o(w)}}const bp={name:"labelEnd",resolveAll:zN,resolveTo:DN,tokenize:jN},ON={tokenize:LN},MN={tokenize:IN},RN={tokenize:BN};function zN(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const l=i.type==="labelImage"?4:2;i.type="data",t+=l}}return e.length!==n.length&&gn(e,0,e.length,n),e}function DN(e,t){let n=e.length,i=0,l,s,o,c;for(;n--;)if(l=e[n][1],s){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(s=n,l.type!=="labelLink")){i=2;break}}else l.type==="labelEnd"&&(o=n);const d={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},m={type:"labelText",start:{...e[s+i+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",d,t],["enter",h,t]],c=Cn(c,e.slice(s+1,s+i+3)),c=Cn(c,[["enter",m,t]]),c=Cn(c,gc(t.parser.constructs.insideSpan.null,e.slice(s+i+4,o-3),t)),c=Cn(c,[["exit",m,t],e[o-2],e[o-1],["exit",h,t]]),c=Cn(c,e.slice(o+1)),c=Cn(c,[["exit",d,t]]),gn(e,s,e.length,c),e}function jN(e,t,n){const i=this;let l=i.events.length,s,o;for(;l--;)if((i.events[l][1].type==="labelImage"||i.events[l][1].type==="labelLink")&&!i.events[l][1]._balanced){s=i.events[l][1];break}return c;function c(y){return s?s._inactive?p(y):(o=i.parser.defined.includes(qn(i.sliceSerialize({start:s.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(ON,m,o?m:p)(y):y===91?e.attempt(MN,m,o?h:p)(y):o?m(y):p(y)}function h(y){return e.attempt(RN,m,p)(y)}function m(y){return t(y)}function p(y){return s._balanced=!0,n(y)}}function LN(e,t,n){return i;function i(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),l}function l(p){return at(p)?ks(e,s)(p):s(p)}function s(p){return p===41?m(p):M_(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return at(p)?ks(e,d)(p):m(p)}function c(p){return n(p)}function d(p){return p===34||p===39||p===40?z_(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return at(p)?ks(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function IN(e,t,n){const i=this;return l;function l(c){return R_.call(i,e,s,o,"reference","referenceMarker","referenceString")(c)}function s(c){return i.parser.defined.includes(qn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function BN(e,t,n){return i;function i(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),l}function l(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const HN={name:"labelStartImage",resolveAll:bp.resolveAll,tokenize:UN};function UN(e,t,n){const i=this;return l;function l(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),s}function s(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):t(c)}}const qN={name:"labelStartLink",resolveAll:bp.resolveAll,tokenize:PN};function PN(e,t,n){const i=this;return l;function l(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const fh={name:"lineEnding",tokenize:VN};function VN(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),$e(e,t,"linePrefix")}}const Uo={name:"thematicBreak",tokenize:$N};function $N(e,t,n){let i=0,l;return s;function s(h){return e.enter("thematicBreak"),o(h)}function o(h){return l=h,c(h)}function c(h){return h===l?(e.enter("thematicBreakSequence"),d(h)):i>=3&&(h===null||Ce(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===l?(e.consume(h),i++,d):(e.exit("thematicBreakSequence"),Pe(h)?$e(e,c,"whitespace")(h):c(h))}}const tn={continuation:{tokenize:GN},exit:QN,name:"list",tokenize:FN},ZN={partial:!0,tokenize:KN},YN={partial:!0,tokenize:XN};function FN(e,t,n){const i=this,l=i.events[i.events.length-1];let s=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,o=0;return c;function c(v){const b=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:Pm(v)){if(i.containerState.type||(i.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Uo,n,h)(v):h(v);if(!i.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return Pm(v)&&++o<10?(e.consume(v),d):(!i.interrupt||o<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),h(v)):n(v)}function h(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,e.check(Fs,i.interrupt?n:m,e.attempt(ZN,y,p))}function m(v){return i.containerState.initialBlankLine=!0,s++,y(v)}function p(v){return Pe(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function GN(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Fs,l,s);function l(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,$e(e,t,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!Pe(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(YN,t,o)(c))}function o(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,$e(e,e.attempt(tn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function XN(e,t,n){const i=this;return $e(e,l,"listItemIndent",i.containerState.size+1);function l(s){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(s):n(s)}}function QN(e){e.exit(this.containerState.type)}function KN(e,t,n){const i=this;return $e(e,l,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(s){const o=i.events[i.events.length-1];return!Pe(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const kx={name:"setextUnderline",resolveTo:JN,tokenize:WN};function JN(e,t){let n=e.length,i,l,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",s?(e.splice(l,0,["enter",o,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function WN(e,t,n){const i=this;let l;return s;function s(h){let m=i.events.length,p;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){p=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||p)?(e.enter("setextHeadingLine"),l=h,o(h)):n(h)}function o(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===l?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Pe(h)?$e(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Ce(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const eO={tokenize:tO};function tO(e){const t=this,n=e.attempt(Fs,i,e.attempt(this.parser.constructs.flowInitial,l,$e(e,e.attempt(this.parser.constructs.flow,l,e.attempt(lN,l)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const nO={resolveAll:j_()},rO=D_("string"),iO=D_("text");function D_(e){return{resolveAll:j_(e==="text"?aO:void 0),tokenize:t};function t(n){const i=this,l=this.parser.constructs[e],s=n.attempt(l,o,c);return o;function o(m){return h(m)?s(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return h(m)?(n.exit("data"),s(m)):(n.consume(m),d)}function h(m){if(m===null)return!0;const p=l[m];let y=-1;if(p)for(;++y<p.length;){const v=p[y];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function j_(e){return t;function t(n,i){let l=-1,s;for(;++l<=n.length;)s===void 0?n[l]&&n[l][1].type==="data"&&(s=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==s+2&&(n[s][1].end=n[l-1][1].end,n.splice(s+2,l-s-2),l=s+2),s=void 0);return e?e(n,i):n}}function aO(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 i=e[n-1][1],l=t.sliceStream(i);let s=l.length,o=-1,c=0,d;for(;s--;){const h=l[s];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(h===-2)d=!0,c++;else if(h!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:i.start._bufferIndex+o,_index:i.start._index+s,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const lO={42:tn,43:tn,45:tn,48:tn,49:tn,50:tn,51:tn,52:tn,53:tn,54:tn,55:tn,56:tn,57:tn,62:C_},sO={91:fN},uO={[-2]:ch,[-1]:ch,32:ch},oO={35:yN,42:Uo,45:[kx,Uo],60:_N,61:kx,95:Uo,96:Sx,126:Sx},cO={38:N_,92:A_},fO={[-5]:fh,[-4]:fh,[-3]:fh,33:HN,38:N_,42:Vm,60:[qA,AN],91:qN,92:[pN,A_],93:bp,95:Vm,96:eN},dO={null:[Vm,nO]},hO={null:[42,95]},mO={null:[]},pO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:hO,contentInitial:sO,disable:mO,document:lO,flow:oO,flowInitial:uO,insideSpan:dO,string:cO,text:fO},Symbol.toStringTag,{value:"Module"}));function gO(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},s=[];let o=[],c=[];const d={attempt:U(D),check:U(M),consume:A,enter:E,exit:O,interrupt:U(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:_,events:[],now:b,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:p};let m=t.tokenize.call(h,d);return t.resolveAll&&s.push(t),h;function p(B){return o=Cn(o,B),S(),o[o.length-1]!==null?[]:(L(t,0),h.events=gc(s,h.events,h),h.events)}function y(B,H){return vO(v(B),H)}function v(B){return yO(o,B)}function b(){const{_bufferIndex:B,_index:H,line:F,column:R,offset:$}=i;return{_bufferIndex:B,_index:H,line:F,column:R,offset:$}}function _(B){l[B.line]=B.column,N()}function S(){let B;for(;i._index<o.length;){const H=o[i._index];if(typeof H=="string")for(B=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===B&&i._bufferIndex<H.length;)k(H.charCodeAt(i._bufferIndex));else k(H)}}function k(B){m=m(B)}function A(B){Ce(B)?(i.line++,i.column=1,i.offset+=B===-3?2:1,N()):B!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=B}function E(B,H){const F=H||{};return F.type=B,F.start=b(),h.events.push(["enter",F,h]),c.push(F),F}function O(B){const H=c.pop();return H.end=b(),h.events.push(["exit",H,h]),H}function D(B,H){L(B,H.from)}function M(B,H){H.restore()}function U(B,H){return F;function F(R,$,j){let P,K,X,w;return Array.isArray(R)?te(R):"tokenize"in R?te([R]):Z(R);function Z(W){return ue;function ue(ce){const ge=ce!==null&&W[ce],ke=ce!==null&&W.null,we=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return te(we)(ce)}}function te(W){return P=W,K=0,W.length===0?j:C(W[K])}function C(W){return ue;function ue(ce){return w=q(),X=W,W.partial||(h.currentConstruct=W),W.name&&h.parser.constructs.disable.null.includes(W.name)?Q():W.tokenize.call(H?Object.assign(Object.create(h),H):h,d,Y,Q)(ce)}}function Y(W){return B(X,w),$}function Q(W){return w.restore(),++K<P.length?C(P[K]):j}}}function L(B,H){B.resolveAll&&!s.includes(B)&&s.push(B),B.resolve&&gn(h.events,H,h.events.length-H,B.resolve(h.events.slice(H),h)),B.resolveTo&&(h.events=B.resolveTo(h.events,h))}function q(){const B=b(),H=h.previous,F=h.currentConstruct,R=h.events.length,$=Array.from(c);return{from:R,restore:j};function j(){i=B,h.previous=H,h.currentConstruct=F,h.events.length=R,c=$,N()}}function N(){i.line in l&&i.column<2&&(i.column=l[i.line],i.offset+=l[i.line]-1)}}function yO(e,t){const n=t.start._index,i=t.start._bufferIndex,l=t.end._index,s=t.end._bufferIndex;let o;if(n===l)o=[e[n].slice(i,s)];else{if(o=e.slice(n,l),i>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(i):o.shift()}s>0&&o.push(e[l].slice(0,s))}return o}function vO(e,t){let n=-1;const i=[];let l;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
55
+ `;break}case-3:{o=`\r
56
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&l)continue;o=" ";break}default:o=String.fromCharCode(s)}l=s===-2,i.push(o)}return i.join("")}function xO(e){const i={constructs:k_([pO,...(e||{}).extensions||[]]),content:l(DA),defined:[],document:l(LA),flow:l(eO),lazy:{},string:l(rO),text:l(iO)};return i;function l(s){return o;function o(c){return gO(i,s,c)}}}function bO(e){for(;!O_(e););return e}const Tx=/[\0\t\n\r]/g;function _O(){let e=1,t="",n=!0,i;return l;function l(s,o,c){const d=[];let h,m,p,y,v;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),p=0,t="",n&&(s.charCodeAt(0)===65279&&p++,n=void 0);p<s.length;){if(Tx.lastIndex=p,h=Tx.exec(s),y=h&&h.index!==void 0?h.index:s.length,v=s.charCodeAt(y),!h){t=s.slice(p);break}if(v===10&&p===y&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),p<y&&(d.push(s.slice(p,y)),e+=y-p),v){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:i=!0,e=1}p=y+1}return c&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}const wO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function SO(e){return e.replace(wO,EO)}function EO(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),s=l===120||l===88;return T_(n.slice(s?2:1),s?16:10)}return xp(n)||e}const L_={}.hasOwnProperty;function kO(e,t,n){return typeof t!="string"&&(n=t,t=void 0),TO(n)(bO(xO(n).document().write(_O()(e,t,!0))))}function TO(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ar),autolinkProtocol:q,autolinkEmail:q,atxHeading:s(lt),blockQuote:s(ke),characterEscape:q,characterReference:q,codeFenced:s(we),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(we,o),codeText:s(ye,o),codeTextData:q,data:q,codeFlowValue:q,definition:s(Re),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(ze),hardBreakEscape:s(ot),hardBreakTrailing:s(ot),htmlFlow:s(xt,o),htmlFlowData:q,htmlText:s(xt,o),htmlTextData:q,image:s(xi),label:o,link:s(ar),listItem:s($n),listItemValue:y,listOrdered:s(Nn,p),listUnordered:s(Nn),paragraph:s(lr),reference:C,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(lt),strong:s(Zn),thematicBreak:s(Yn)},exit:{atxHeading:d(),atxHeadingSequence:D,autolink:d(),autolinkEmail:ge,autolinkProtocol:ce,blockQuote:d(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:Q,characterReferenceMarkerNumeric:Q,characterReferenceValue:W,characterReference:ue,codeFenced:d(S),codeFencedFence:_,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:N,codeIndented:d(k),codeText:d($),codeTextData:N,data:N,definition:d(),definitionDestinationString:O,definitionLabelString:A,definitionTitleString:E,emphasis:d(),hardBreakEscape:d(H),hardBreakTrailing:d(H),htmlFlow:d(F),htmlFlowData:N,htmlText:d(R),htmlTextData:N,image:d(P),label:X,labelText:K,lineEnding:B,link:d(j),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:Y,resourceDestinationString:w,resourceTitleString:Z,resource:te,setextHeading:d(L),setextHeadingLineSequence:U,setextHeadingText:M,strong:d(),thematicBreak:d()}};I_(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(le){let de={type:"root",children:[]};const Ee={stack:[de],tokenStack:[],config:t,enter:c,exit:h,buffer:o,resume:m,data:n},Te=[];let Xe=-1;for(;++Xe<le.length;)if(le[Xe][1].type==="listOrdered"||le[Xe][1].type==="listUnordered")if(le[Xe][0]==="enter")Te.push(Xe);else{const Vt=Te.pop();Xe=l(le,Vt,Xe)}for(Xe=-1;++Xe<le.length;){const Vt=t[le[Xe][0]];L_.call(Vt,le[Xe][1].type)&&Vt[le[Xe][1].type].call(Object.assign({sliceSerialize:le[Xe][2].sliceSerialize},Ee),le[Xe][1])}if(Ee.tokenStack.length>0){const Vt=Ee.tokenStack[Ee.tokenStack.length-1];(Vt[1]||Cx).call(Ee,void 0,Vt[0])}for(de.position={start:si(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:si(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)de=t.transforms[Xe](de)||de;return de}function l(le,de,Ee){let Te=de-1,Xe=-1,Vt=!1,On,It,xn,$t;for(;++Te<=Ee;){const bt=le[Te];switch(bt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{bt[0]==="enter"?Xe++:Xe--,$t=void 0;break}case"lineEndingBlank":{bt[0]==="enter"&&(On&&!$t&&!Xe&&!xn&&(xn=Te),$t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$t=void 0}if(!Xe&&bt[0]==="enter"&&bt[1].type==="listItemPrefix"||Xe===-1&&bt[0]==="exit"&&(bt[1].type==="listUnordered"||bt[1].type==="listOrdered")){if(On){let Gt=Te;for(It=void 0;Gt--;){const an=le[Gt];if(an[1].type==="lineEnding"||an[1].type==="lineEndingBlank"){if(an[0]==="exit")continue;It&&(le[It][1].type="lineEndingBlank",Vt=!0),an[1].type="lineEnding",It=Gt}else if(!(an[1].type==="linePrefix"||an[1].type==="blockQuotePrefix"||an[1].type==="blockQuotePrefixWhitespace"||an[1].type==="blockQuoteMarker"||an[1].type==="listItemIndent"))break}xn&&(!It||xn<It)&&(On._spread=!0),On.end=Object.assign({},It?le[It][1].start:bt[1].end),le.splice(It||Te,0,["exit",On,bt[2]]),Te++,Ee++}if(bt[1].type==="listItemPrefix"){const Gt={type:"listItem",_spread:!1,start:Object.assign({},bt[1].start),end:void 0};On=Gt,le.splice(Te,0,["enter",Gt,bt[2]]),Te++,Ee++,xn=void 0,$t=!0}}}return le[de][1]._spread=Vt,Ee}function s(le,de){return Ee;function Ee(Te){c.call(this,le(Te),Te),de&&de.call(this,Te)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(le,de,Ee){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([de,Ee||void 0]),le.position={start:si(de.start),end:void 0}}function d(le){return de;function de(Ee){le&&le.call(this,Ee),h.call(this,Ee)}}function h(le,de){const Ee=this.stack.pop(),Te=this.tokenStack.pop();if(Te)Te[0].type!==le.type&&(de?de.call(this,le,Te[0]):(Te[1]||Cx).call(this,le,Te[0]));else throw new Error("Cannot close `"+le.type+"` ("+Es({start:le.start,end:le.end})+"): it’s not open");Ee.position.end=si(le.end)}function m(){return vp(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function y(le){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function v(){const le=this.resume(),de=this.stack[this.stack.length-1];de.lang=le}function b(){const le=this.resume(),de=this.stack[this.stack.length-1];de.meta=le}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const le=this.resume(),de=this.stack[this.stack.length-1];de.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const le=this.resume(),de=this.stack[this.stack.length-1];de.value=le.replace(/(\r?\n|\r)$/g,"")}function A(le){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=de,Ee.identifier=qn(this.sliceSerialize(le)).toLowerCase()}function E(){const le=this.resume(),de=this.stack[this.stack.length-1];de.title=le}function O(){const le=this.resume(),de=this.stack[this.stack.length-1];de.url=le}function D(le){const de=this.stack[this.stack.length-1];if(!de.depth){const Ee=this.sliceSerialize(le).length;de.depth=Ee}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function U(le){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function q(le){const Ee=this.stack[this.stack.length-1].children;let Te=Ee[Ee.length-1];(!Te||Te.type!=="text")&&(Te=bi(),Te.position={start:si(le.start),end:void 0},Ee.push(Te)),this.stack.push(Te)}function N(le){const de=this.stack.pop();de.value+=this.sliceSerialize(le),de.position.end=si(le.end)}function B(le){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=de.children[de.children.length-1];Ee.position.end=si(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(q.call(this,le),N.call(this,le))}function H(){this.data.atHardBreak=!0}function F(){const le=this.resume(),de=this.stack[this.stack.length-1];de.value=le}function R(){const le=this.resume(),de=this.stack[this.stack.length-1];de.value=le}function $(){const le=this.resume(),de=this.stack[this.stack.length-1];de.value=le}function j(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=de,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function P(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=de,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function K(le){const de=this.sliceSerialize(le),Ee=this.stack[this.stack.length-2];Ee.label=SO(de),Ee.identifier=qn(de).toLowerCase()}function X(){const le=this.stack[this.stack.length-1],de=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Te=le.children;Ee.children=Te}else Ee.alt=de}function w(){const le=this.resume(),de=this.stack[this.stack.length-1];de.url=le}function Z(){const le=this.resume(),de=this.stack[this.stack.length-1];de.title=le}function te(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function Y(le){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=de,Ee.identifier=qn(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function Q(le){this.data.characterReferenceType=le.type}function W(le){const de=this.sliceSerialize(le),Ee=this.data.characterReferenceType;let Te;Ee?(Te=T_(de,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Te=xp(de);const Xe=this.stack[this.stack.length-1];Xe.value+=Te}function ue(le){const de=this.stack.pop();de.position.end=si(le.end)}function ce(le){N.call(this,le);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(le)}function ge(le){N.call(this,le);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(le)}function ke(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function ye(){return{type:"inlineCode",value:""}}function Re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function lt(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function xt(){return{type:"html",value:""}}function xi(){return{type:"image",title:null,url:"",alt:null}}function ar(){return{type:"link",title:null,url:"",children:[]}}function Nn(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function $n(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function lr(){return{type:"paragraph",children:[]}}function Zn(){return{type:"strong",children:[]}}function bi(){return{type:"text",value:""}}function Yn(){return{type:"thematicBreak"}}}function si(e){return{line:e.line,column:e.column,offset:e.offset}}function I_(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?I_(e,i):CO(e,i)}}function CO(e,t){let n;for(n in t)if(L_.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function Cx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Es({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Es({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Es({start:t.start,end:t.end})+") is still open")}function AO(e){const t=this;t.parser=n;function n(i){return kO(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function NO(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 OO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
57
+ `}]}function MO(e,t){const n=t.value?t.value+`
58
+ `:"",i={};t.lang&&(i.className=["language-"+t.lang]);let l={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function RO(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zO(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DO(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),l=il(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let o,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=s+1,c+=1,e.footnoteCounts.set(i,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function jO(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 LO(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function B_(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const l=e.all(t),s=l[0];s&&s.type==="text"?s.value="["+s.value:l.unshift({type:"text",value:"["});const o=l[l.length-1];return o&&o.type==="text"?o.value+=i:l.push({type:"text",value:i}),l}function IO(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return B_(e,t);const l={src:il(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(l.title=i.title);const s={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,s),e.applyData(t,s)}function BO(e,t){const n={src:il(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 i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function HO(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function UO(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return B_(e,t);const l={href:il(i.url||"")};i.title!==null&&i.title!==void 0&&(l.title=i.title);const s={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function qO(e,t){const n={href:il(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function PO(e,t,n){const i=e.all(t),l=n?VO(n):H_(t),s={},o=[];if(typeof t.checked=="boolean"){const m=i[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},i.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const m=i[c];(l||c!==0||m.type!=="element"||m.tagName!=="p")&&o.push({type:"text",value:`
59
+ `}),m.type==="element"&&m.tagName==="p"&&!l?o.push(...m.children):o.push(m)}const d=i[i.length-1];d&&(l||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
60
+ `});const h={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,h),e.applyData(t,h)}function VO(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=H_(n[i])}return t}function H_(e){const t=e.spread;return t??e.children.length>1}function $O(e,t){const n={},i=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<i.length;){const o=i[l];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function ZO(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YO(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function FO(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GO(e,t){const n=e.all(t),i=n.shift(),l=[];if(i){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],o),l.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=mp(t.children[1]),d=v_(t.children[t.children.length-1]);c&&d&&(o.position={start:c,end:d}),l.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,s),e.applyData(t,s)}function XO(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let d=-1;const h=[];for(;++d<c;){const p=t.children[d],y={},v=o?o[d]:void 0;v&&(y.align=v);let b={type:"element",tagName:s,properties:y,children:[]};p&&(b.children=e.all(p),e.patch(p,b),b=e.applyData(p,b)),h.push(b)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function QO(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ax=9,Nx=32;function KO(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),l=0;const s=[];for(;i;)s.push(Ox(t.slice(l,i.index),l>0,!0),i[0]),l=i.index+i[0].length,i=n.exec(t);return s.push(Ox(t.slice(l),l>0,!1)),s.join("")}function Ox(e,t,n){let i=0,l=e.length;if(t){let s=e.codePointAt(i);for(;s===Ax||s===Nx;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(l-1);for(;s===Ax||s===Nx;)l--,s=e.codePointAt(l-1)}return l>i?e.slice(i,l):""}function JO(e,t){const n={type:"text",value:KO(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function WO(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const eM={blockquote:NO,break:OO,code:MO,delete:RO,emphasis:zO,footnoteReference:DO,heading:jO,html:LO,imageReference:IO,image:BO,inlineCode:HO,linkReference:UO,link:qO,listItem:PO,list:$O,paragraph:ZO,root:YO,strong:FO,table:GO,tableCell:QO,tableRow:XO,text:JO,thematicBreak:WO,toml:ko,yaml:ko,definition:ko,footnoteDefinition:ko};function ko(){}const U_=-1,yc=0,Ts=1,Wo=2,_p=3,wp=4,Sp=5,Ep=6,q_=7,P_=8,Mx=typeof self=="object"?self:globalThis,tM=(e,t)=>{const n=(l,s)=>(e.set(s,l),l),i=l=>{if(e.has(l))return e.get(l);const[s,o]=t[l];switch(s){case yc:case U_:return n(o,l);case Ts:{const c=n([],l);for(const d of o)c.push(i(d));return c}case Wo:{const c=n({},l);for(const[d,h]of o)c[i(d)]=i(h);return c}case _p:return n(new Date(o),l);case wp:{const{source:c,flags:d}=o;return n(new RegExp(c,d),l)}case Sp:{const c=n(new Map,l);for(const[d,h]of o)c.set(i(d),i(h));return c}case Ep:{const c=n(new Set,l);for(const d of o)c.add(i(d));return c}case q_:{const{name:c,message:d}=o;return n(new Mx[c](d),l)}case P_:return n(BigInt(o),l);case"BigInt":return n(Object(BigInt(o)),l);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(new Mx[s](o),l)};return i},Rx=e=>tM(new Map,e)(0),ja="",{toString:nM}={},{keys:rM}=Object,ps=e=>{const t=typeof e;if(t!=="object"||!e)return[yc,t];const n=nM.call(e).slice(8,-1);switch(n){case"Array":return[Ts,ja];case"Object":return[Wo,ja];case"Date":return[_p,ja];case"RegExp":return[wp,ja];case"Map":return[Sp,ja];case"Set":return[Ep,ja];case"DataView":return[Ts,n]}return n.includes("Array")?[Ts,n]:n.includes("Error")?[q_,n]:[Wo,n]},To=([e,t])=>e===yc&&(t==="function"||t==="symbol"),iM=(e,t,n,i)=>{const l=(o,c)=>{const d=i.push(o)-1;return n.set(c,d),d},s=o=>{if(n.has(o))return n.get(o);let[c,d]=ps(o);switch(c){case yc:{let m=o;switch(d){case"bigint":c=P_,m=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return l([U_],o)}return l([c,m],o)}case Ts:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),l([d,[...y]],o)}const m=[],p=l([c,m],o);for(const y of o)m.push(s(y));return p}case Wo:{if(d)switch(d){case"BigInt":return l([d,o.toString()],o);case"Boolean":case"Number":case"String":return l([d,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const m=[],p=l([c,m],o);for(const y of rM(o))(e||!To(ps(o[y])))&&m.push([s(y),s(o[y])]);return p}case _p:return l([c,o.toISOString()],o);case wp:{const{source:m,flags:p}=o;return l([c,{source:m,flags:p}],o)}case Sp:{const m=[],p=l([c,m],o);for(const[y,v]of o)(e||!(To(ps(y))||To(ps(v))))&&m.push([s(y),s(v)]);return p}case Ep:{const m=[],p=l([c,m],o);for(const y of o)(e||!To(ps(y)))&&m.push(s(y));return p}}const{message:h}=o;return l([c,{name:d,message:h}],o)};return s},zx=(e,{json:t,lossy:n}={})=>{const i=[];return iM(!(t||n),!!t,new Map,i)(e),i},ec=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Rx(zx(e,t)):structuredClone(e):(e,t)=>Rx(zx(e,t));function aM(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 lM(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function sM(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||aM,i=e.options.footnoteBackLabel||lM,l=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const m=e.all(h),p=String(h.identifier).toUpperCase(),y=il(p.toLowerCase());let v=0;const b=[],_=e.footnoteCounts.get(p);for(;_!==void 0&&++v<=_;){b.length>0&&b.push({type:"text",value:" "});let A=typeof n=="string"?n:n(d,v);typeof A=="string"&&(A={type:"text",value:A}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,v),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const S=m[m.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const A=S.children[S.children.length-1];A&&A.type==="text"?A.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...b)}else m.push(...b);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(h,k),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...ec(o),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
61
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
62
+ `}]}}const vc=function(e){if(e==null)return fM;if(typeof e=="function")return xc(e);if(typeof e=="object")return Array.isArray(e)?uM(e):oM(e);if(typeof e=="string")return cM(e);throw new Error("Expected function, string, or object as test")};function uM(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=vc(e[n]);return xc(i);function i(...l){let s=-1;for(;++s<t.length;)if(t[s].apply(this,l))return!0;return!1}}function oM(e){const t=e;return xc(n);function n(i){const l=i;let s;for(s in e)if(l[s]!==t[s])return!1;return!0}}function cM(e){return xc(t);function t(n){return n&&n.type===e}}function xc(e){return t;function t(n,i,l){return!!(dM(n)&&e.call(this,n,typeof i=="number"?i:void 0,l||void 0))}}function fM(){return!0}function dM(e){return e!==null&&typeof e=="object"&&"type"in e}const V_=[],hM=!0,$m=!1,mM="skip";function $_(e,t,n,i){let l;typeof t=="function"&&typeof n!="function"?(i=n,n=t):l=t;const s=vc(l),o=i?-1:1;c(e,void 0,[])();function c(d,h,m){const p=d&&typeof d=="object"?d:{};if(typeof p.type=="string"){const v=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=V_,b,_,S;if((!t||s(d,h,m[m.length-1]||void 0))&&(v=pM(n(d,m)),v[0]===$m))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==mM)for(_=(i?k.children.length:-1)+o,S=m.concat(k);_>-1&&_<k.children.length;){const A=k.children[_];if(b=c(A,_,S)(),b[0]===$m)return b;_=typeof b[1]=="number"?b[1]:_+o}}return v}}}function pM(e){return Array.isArray(e)?e:typeof e=="number"?[hM,e]:e==null?V_:[e]}function kp(e,t,n,i){let l,s,o;typeof t=="function"?(s=void 0,o=t,l=n):(s=t,o=n,l=i),$_(e,s,c,l);function c(d,h){const m=h[h.length-1],p=m?m.children.indexOf(d):void 0;return o(d,p,m)}}const Zm={}.hasOwnProperty,gM={};function yM(e,t){const n=t||gM,i=new Map,l=new Map,s=new Map,o={...eM,...n.handlers},c={all:h,applyData:xM,definitionById:i,footnoteById:l,footnoteCounts:s,footnoteOrder:[],handlers:o,one:d,options:n,patch:vM,wrap:_M};return kp(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?i:l,y=String(m.identifier).toUpperCase();p.has(y)||p.set(y,m)}}),c;function d(m,p){const y=m.type,v=c.handlers[y];if(Zm.call(c.handlers,y)&&v)return v(c,m,p);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in m){const{children:_,...S}=m,k=ec(S);return k.children=c.all(m),k}return ec(m)}return(c.options.unknownHandler||bM)(c,m,p)}function h(m){const p=[];if("children"in m){const y=m.children;let v=-1;for(;++v<y.length;){const b=c.one(y[v],m);if(b){if(v&&y[v-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=Dx(b.value)),!Array.isArray(b)&&b.type==="element")){const _=b.children[0];_&&_.type==="text"&&(_.value=Dx(_.value))}Array.isArray(b)?p.push(...b):p.push(b)}}}return p}}function vM(e,t){e.position&&(t.position=lA(e))}function xM(e,t){let n=t;if(e&&e.data){const i=e.data.hName,l=e.data.hChildren,s=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const o="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,ec(s)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function bM(e,t){const n=t.data||{},i="value"in t&&!(Zm.call(n,"hProperties")||Zm.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function _M(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
63
+ `});++i<e.length;)i&&n.push({type:"text",value:`
64
+ `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
65
+ `}),n}function Dx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function jx(e,t){const n=yM(e,t),i=n.one(e,void 0),l=sM(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return l&&s.children.push({type:"text",value:`
66
+ `},l),s}function wM(e,t){return e&&"run"in e?async function(n,i){const l=jx(n,{file:i,...t});await e.run(l,i)}:function(n,i){return jx(n,{file:i,...e||t})}}function Lx(e){if(e)throw e}var dh,Ix;function SM(){if(Ix)return dh;Ix=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},s=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!p)return!1;var y;for(y in h);return typeof y>"u"||e.call(h,y)},o=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},c=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(i)return i(h,m).value}else return;return h[m]};return dh=function d(){var h,m,p,y,v,b,_=arguments[0],S=1,k=arguments.length,A=!1;for(typeof _=="boolean"&&(A=_,_=arguments[1]||{},S=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});S<k;++S)if(h=arguments[S],h!=null)for(m in h)p=c(_,m),y=c(h,m),_!==y&&(A&&y&&(s(y)||(v=l(y)))?(v?(v=!1,b=p&&l(p)?p:[]):b=p&&s(p)?p:{},o(_,{name:m,newValue:d(A,b,y)})):typeof y<"u"&&o(_,{name:m,newValue:y}));return _},dh}var EM=SM();const hh=yi(EM);function Ym(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 kM(){const e=[],t={run:n,use:i};return t;function n(...l){let s=-1;const o=l.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...l);function c(d,...h){const m=e[++s];let p=-1;if(d){o(d);return}for(;++p<l.length;)(h[p]===null||h[p]===void 0)&&(h[p]=l[p]);l=h,m?TM(m,c)(...h):o(null,...h)}}function i(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function TM(e,t){let n;return i;function i(...o){const c=e.length>o.length;let d;c&&o.push(l);try{d=e.apply(this,o)}catch(h){const m=h;if(c&&n)throw m;return l(m)}c||(d&&d.then&&typeof d.then=="function"?d.then(s,l):d instanceof Error?l(d):s(d))}function l(o,...c){n||(n=!0,t(o,...c))}function s(o){l(null,o)}}const Wn={basename:CM,dirname:AM,extname:NM,join:OM,sep:"/"};function CM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Gs(e);let n=0,i=-1,l=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(s){n=l+1;break}}else i<0&&(s=!0,i=l+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,c=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(s){n=l+1;break}}else o<0&&(s=!0,o=l+1),c>-1&&(e.codePointAt(l)===t.codePointAt(c--)?c<0&&(i=l):(c=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function AM(e){if(Gs(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function NM(e){Gs(e);let t=e.length,n=-1,i=0,l=-1,s=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?l<0?l=t:s!==1&&(s=1):l>-1&&(s=-1)}return l<0||n<0||s===0||s===1&&l===n-1&&l===i+1?"":e.slice(l,n)}function OM(...e){let t=-1,n;for(;++t<e.length;)Gs(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":MM(n)}function MM(e){Gs(e);const t=e.codePointAt(0)===47;let n=RM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function RM(e,t){let n="",i=0,l=-1,s=0,o=-1,c,d;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(l===o-1||s===1))if(l!==o-1&&s===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),l=o,s=0;continue}}else if(n.length>0){n="",i=0,l=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(l+1,o):n=e.slice(l+1,o),i=o-l-1;l=o,s=0}else c===46&&s>-1?s++:s=-1}return n}function Gs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const zM={cwd:DM};function DM(){return"/"}function Fm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jM(e){if(typeof e=="string")e=new URL(e);else if(!Fm(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 LM(e)}function LM(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const mh=["history","path","basename","stem","extname","dirname"];class Z_{constructor(t){let n;t?Fm(t)?n={path:t}:typeof t=="string"||IM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":zM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<mh.length;){const s=mh[i];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let l;for(l in n)mh.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Wn.basename(this.path):void 0}set basename(t){gh(t,"basename"),ph(t,"basename"),this.path=Wn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wn.dirname(this.path):void 0}set dirname(t){Bx(this.basename,"dirname"),this.path=Wn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wn.extname(this.path):void 0}set extname(t){if(ph(t,"extname"),Bx(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=Wn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Fm(t)&&(t=jM(t)),gh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wn.basename(this.path,this.extname):void 0}set stem(t){gh(t,"stem"),ph(t,"stem"),this.path=Wn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const l=this.message(t,n,i);throw l.fatal=!0,l}info(t,n,i){const l=this.message(t,n,i);return l.fatal=void 0,l}message(t,n,i){const l=new Pt(t,n,i);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ph(e,t){if(e&&e.includes(Wn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wn.sep+"`")}function gh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Bx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function IM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BM=function(e){const i=this.constructor.prototype,l=i[e],s=function(){return l.apply(s,arguments)};return Object.setPrototypeOf(s,i),s},HM={}.hasOwnProperty;class Tp extends BM{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=kM()}copy(){const t=new Tp;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(hh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(xh("data",this.frozen),this.namespace[t]=n,this):HM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(xh("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,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const l=n.call(t,...i);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Co(t),i=this.parser||this.Parser;return yh("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),yh("process",this.parser||this.Parser),vh("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(s,o){const c=Co(t),d=i.parse(c);i.run(d,c,function(m,p,y){if(m||!p||!y)return h(m);const v=p,b=i.stringify(v,y);PM(b)?y.value=b:y.result=b,h(m,y)});function h(m,p){m||!p?o(m):s?s(p):n(void 0,p)}}}processSync(t){let n=!1,i;return this.freeze(),yh("processSync",this.parser||this.Parser),vh("processSync",this.compiler||this.Compiler),this.process(t,l),Ux("processSync","process",n),i;function l(s,o){n=!0,Lx(s),i=o}}run(t,n,i){Hx(t),this.freeze();const l=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?s(void 0,i):new Promise(s);function s(o,c){const d=Co(n);l.run(t,d,h);function h(m,p,y){const v=p||t;m?c(m):o?o(v):i(void 0,v,y)}}}runSync(t,n){let i=!1,l;return this.run(t,n,s),Ux("runSync","run",i),l;function s(o,c){Lx(o),l=c,i=!0}}stringify(t,n){this.freeze();const i=Co(n),l=this.compiler||this.Compiler;return vh("stringify",l),Hx(t),l(t,i)}use(t,...n){const i=this.attachers,l=this.namespace;if(xh("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...p]=h;d(m,p)}else o(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function o(h){if(!("plugins"in h)&&!("settings"in h))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");c(h.plugins),h.settings&&(l.settings=hh(!0,l.settings,h.settings))}function c(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const p=h[m];s(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,m){let p=-1,y=-1;for(;++p<i.length;)if(i[p][0]===h){y=p;break}if(y===-1)i.push([h,...m]);else if(m.length>0){let[v,...b]=m;const _=i[y][1];Ym(_)&&Ym(v)&&(v=hh(!0,_,v)),i[y]=[h,v,...b]}}}}const UM=new Tp().freeze();function yh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function vh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xh(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 Hx(e){if(!Ym(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ux(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Co(e){return qM(e)?e:new Z_(e)}function qM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function PM(e){return typeof e=="string"||VM(e)}function VM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $M="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",qx=[],Px={allowDangerousHtml:!0},ZM=/^(https?|ircs?|mailto|xmpp)$/i,YM=[{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:"className",id:"remove-classname"},{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 FM(e){const t=GM(e),n=XM(e);return QM(t.runSync(t.parse(n),n),e)}function GM(e){const t=e.rehypePlugins||qx,n=e.remarkPlugins||qx,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Px}:Px;return UM().use(AO).use(n).use(wM,i).use(t)}function XM(e){const t=e.children||"",n=new Z_;return typeof t=="string"&&(n.value=t),n}function QM(e,t){const n=t.allowedElements,i=t.allowElement,l=t.components,s=t.disallowedElements,o=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||KM;for(const m of YM)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+$M+m.id,void 0);return kp(e,h),fA(e,{Fragment:I.Fragment,components:l,ignoreInvalidStyle:!0,jsx:I.jsx,jsxs:I.jsxs,passKeys:!0,passNode:!0});function h(m,p,y){if(m.type==="raw"&&y&&typeof p=="number")return o?y.children.splice(p,1):y.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let v;for(v in oh)if(Object.hasOwn(oh,v)&&Object.hasOwn(m.properties,v)){const b=m.properties[v],_=oh[v];(_===null||_.includes(m.tagName))&&(m.properties[v]=d(String(b||""),v,m))}}if(m.type==="element"){let v=n?!n.includes(m.tagName):s?s.includes(m.tagName):!1;if(!v&&i&&typeof p=="number"&&(v=!i(m,p,y)),v&&y&&typeof p=="number")return c&&m.children?y.children.splice(p,1,...m.children):y.children.splice(p,1),p}}}function KM(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||i!==-1&&t>i||ZM.test(e.slice(0,t))?e:""}function Vx(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,l=n.indexOf(t);for(;l!==-1;)i++,l=n.indexOf(t,l+t.length);return i}function JM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function WM(e,t,n){const l=vc((n||{}).ignore||[]),s=eR(t);let o=-1;for(;++o<s.length;)$_(e,"text",c);function c(h,m){let p=-1,y;for(;++p<m.length;){const v=m[p],b=y?y.children:void 0;if(l(v,b?b.indexOf(v):void 0,y))return;y=v}if(y)return d(h,m)}function d(h,m){const p=m[m.length-1],y=s[o][0],v=s[o][1];let b=0;const S=p.children.indexOf(h);let k=!1,A=[];y.lastIndex=0;let E=y.exec(h.value);for(;E;){const O=E.index,D={index:E.index,input:E.input,stack:[...m,h]};let M=v(...E,D);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?y.lastIndex=O+1:(b!==O&&A.push({type:"text",value:h.value.slice(b,O)}),Array.isArray(M)?A.push(...M):M&&A.push(M),b=O+E[0].length,k=!0),!y.global)break;E=y.exec(h.value)}return k?(b<h.value.length&&A.push({type:"text",value:h.value.slice(b)}),p.children.splice(S,1,...A)):A=[h],S+A.length}}function eR(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 i=-1;for(;++i<n.length;){const l=n[i];t.push([tR(l[0]),nR(l[1])])}return t}function tR(e){return typeof e=="string"?new RegExp(JM(e),"g"):e}function nR(e){return typeof e=="function"?e:function(){return e}}const bh="phrasing",_h=["autolink","link","image","label"];function rR(){return{transforms:[cR],enter:{literalAutolink:aR,literalAutolinkEmail:wh,literalAutolinkHttp:wh,literalAutolinkWww:wh},exit:{literalAutolink:oR,literalAutolinkEmail:uR,literalAutolinkHttp:lR,literalAutolinkWww:sR}}}function iR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:bh,notInConstruct:_h},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:bh,notInConstruct:_h},{character:":",before:"[ps]",after:"\\/",inConstruct:bh,notInConstruct:_h}]}}function aR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function wh(e){this.config.enter.autolinkProtocol.call(this,e)}function lR(e){this.config.exit.autolinkProtocol.call(this,e)}function sR(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 uR(e){this.config.exit.autolinkEmail.call(this,e)}function oR(e){this.exit(e)}function cR(e){WM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fR],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),dR]],{ignore:["link","linkReference"]})}function fR(e,t,n,i,l){let s="";if(!Y_(l)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!hR(n)))return!1;const o=mR(n+i);if(!o[0])return!1;const c={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[c,{type:"text",value:o[1]}]:c}function dR(e,t,n,i){return!Y_(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function hR(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 mR(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const l=Vx(e,"(");let s=Vx(e,")");for(;i!==-1&&l>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function Y_(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Yi(n)||pc(n))&&(!t||n!==47)}F_.peek=SR;function pR(){this.buffer()}function gR(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function yR(){this.buffer()}function vR(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function xR(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bR(e){this.exit(e)}function _R(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wR(e){this.exit(e)}function SR(){return"["}function F_(e,t,n,i){const l=n.createTracker(i);let s=l.move("[^");const o=n.enter("footnoteReference"),c=n.enter("reference");return s+=l.move(n.safe(n.associationId(e),{after:"]",before:s})),c(),o(),s+=l.move("]"),s}function ER(){return{enter:{gfmFootnoteCallString:pR,gfmFootnoteCall:gR,gfmFootnoteDefinitionLabelString:yR,gfmFootnoteDefinition:vR},exit:{gfmFootnoteCallString:xR,gfmFootnoteCall:bR,gfmFootnoteDefinitionLabelString:_R,gfmFootnoteDefinition:wR}}}function kR(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:F_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,l,s,o){const c=s.createTracker(o);let d=c.move("[^");const h=s.enter("footnoteDefinition"),m=s.enter("label");return d+=c.move(s.safe(s.associationId(i),{before:d,after:"]"})),m(),d+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),d+=c.move((t?`
67
+ `:" ")+s.indentLines(s.containerFlow(i,c.current()),t?G_:TR))),h(),d}}function TR(e,t,n){return t===0?e:G_(e,t,n)}function G_(e,t,n){return(n?"":" ")+e}const CR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];X_.peek=RR;function AR(){return{canContainEols:["delete"],enter:{strikethrough:OR},exit:{strikethrough:MR}}}function NR(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:CR}],handlers:{delete:X_}}}function OR(e){this.enter({type:"delete",children:[]},e)}function MR(e){this.exit(e)}function X_(e,t,n,i){const l=n.createTracker(i),s=n.enter("strikethrough");let o=l.move("~~");return o+=n.containerPhrasing(e,{...l.current(),before:o,after:"~"}),o+=l.move("~~"),s(),o}function RR(){return"~"}function zR(e){return e.length}function DR(e,t){const n=t||{},i=(n.align||[]).concat(),l=n.stringLength||zR,s=[],o=[],c=[],d=[];let h=0,m=-1;for(;++m<e.length;){const _=[],S=[];let k=-1;for(e[m].length>h&&(h=e[m].length);++k<e[m].length;){const A=jR(e[m][k]);if(n.alignDelimiters!==!1){const E=l(A);S[k]=E,(d[k]===void 0||E>d[k])&&(d[k]=E)}_.push(A)}o[m]=_,c[m]=S}let p=-1;if(typeof i=="object"&&"length"in i)for(;++p<h;)s[p]=$x(i[p]);else{const _=$x(i);for(;++p<h;)s[p]=_}p=-1;const y=[],v=[];for(;++p<h;){const _=s[p];let S="",k="";_===99?(S=":",k=":"):_===108?S=":":_===114&&(k=":");let A=n.alignDelimiters===!1?1:Math.max(1,d[p]-S.length-k.length);const E=S+"-".repeat(A)+k;n.alignDelimiters!==!1&&(A=S.length+A+k.length,A>d[p]&&(d[p]=A),v[p]=A),y[p]=E}o.splice(1,0,y),c.splice(1,0,v),m=-1;const b=[];for(;++m<o.length;){const _=o[m],S=c[m];p=-1;const k=[];for(;++p<h;){const A=_[p]||"";let E="",O="";if(n.alignDelimiters!==!1){const D=d[p]-(S[p]||0),M=s[p];M===114?E=" ".repeat(D):M===99?D%2?(E=" ".repeat(D/2+.5),O=" ".repeat(D/2-.5)):(E=" ".repeat(D/2),O=E):O=" ".repeat(D)}n.delimiterStart!==!1&&!p&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||p)&&k.push(" "),n.alignDelimiters!==!1&&k.push(E),k.push(A),n.alignDelimiters!==!1&&k.push(O),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&k.push("|")}b.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return b.join(`
68
+ `)}function jR(e){return e==null?"":String(e)}function $x(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 LR(e,t,n,i){const l=n.enter("blockquote"),s=n.createTracker(i);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),IR);return l(),o}function IR(e,t,n){return">"+(n?"":" ")+e}function BR(e,t){return Zx(e,t.inConstruct,!0)&&!Zx(e,t.notInConstruct,!1)}function Zx(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function Yx(e,t,n,i){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
69
+ `&&BR(n.stack,n.unsafe[l]))return/[ \t]/.test(i.before)?"":" ";return`\\
70
+ `}function HR(e,t){const n=String(e);let i=n.indexOf(t),l=i,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===l?++s>o&&(o=s):s=1,l=i+t.length,i=n.indexOf(t,l);return o}function UR(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 qR(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 PR(e,t,n,i){const l=qR(n),s=e.value||"",o=l==="`"?"GraveAccent":"Tilde";if(UR(e,n)){const p=n.enter("codeIndented"),y=n.indentLines(s,VR);return p(),y}const c=n.createTracker(i),d=l.repeat(Math.max(HR(s,l)+1,3)),h=n.enter("codeFenced");let m=c.move(d);if(e.lang){const p=n.enter(`codeFencedLang${o}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${o}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
71
+ `,encode:["`"],...c.current()})),p()}return m+=c.move(`
72
+ `),s&&(m+=c.move(s+`
73
+ `)),m+=c.move(d),h(),m}function VR(e,t,n){return(n?"":" ")+e}function Cp(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 $R(e,t,n,i){const l=Cp(n),s=l==='"'?"Quote":"Apostrophe",o=n.enter("definition");let c=n.enter("label");const d=n.createTracker(i);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(c=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
74
+ `,...d.current()}))),c(),e.title&&(c=n.enter(`title${s}`),h+=d.move(" "+l),h+=d.move(n.safe(e.title,{before:h,after:l,...d.current()})),h+=d.move(l),c()),o(),h}function ZR(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 Ds(e){return"&#x"+e.toString(16).toUpperCase()+";"}function tc(e,t,n){const i=Xa(e),l=Xa(t);return i===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Q_.peek=YR;function Q_(e,t,n,i){const l=ZR(n),s=n.enter("emphasis"),o=n.createTracker(i),c=o.move(l);let d=o.move(n.containerPhrasing(e,{after:l,before:c,...o.current()}));const h=d.charCodeAt(0),m=tc(i.before.charCodeAt(i.before.length-1),h,l);m.inside&&(d=Ds(h)+d.slice(1));const p=d.charCodeAt(d.length-1),y=tc(i.after.charCodeAt(0),p,l);y.inside&&(d=d.slice(0,-1)+Ds(p));const v=o.move(l);return s(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+d+v}function YR(e,t,n){return n.options.emphasis||"*"}function FR(e,t){let n=!1;return kp(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,$m}),!!((!e.depth||e.depth<3)&&vp(e)&&(t.options.setext||n))}function GR(e,t,n,i){const l=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(FR(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),y=n.containerPhrasing(e,{...s.current(),before:`
75
+ `,after:`
76
+ `});return p(),m(),y+`
77
+ `+(l===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
78
+ `))+1))}const o="#".repeat(l),c=n.enter("headingAtx"),d=n.enter("phrasing");s.move(o+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
79
+ `,...s.current()});return/^[\t ]/.test(h)&&(h=Ds(h.charCodeAt(0))+h.slice(1)),h=h?o+" "+h:o,n.options.closeAtx&&(h+=" "+o),d(),c(),h}K_.peek=XR;function K_(e){return e.value||""}function XR(){return"<"}J_.peek=QR;function J_(e,t,n,i){const l=Cp(n),s=l==='"'?"Quote":"Apostrophe",o=n.enter("image");let c=n.enter("label");const d=n.createTracker(i);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(c=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${s}`),h+=d.move(" "+l),h+=d.move(n.safe(e.title,{before:h,after:l,...d.current()})),h+=d.move(l),c()),h+=d.move(")"),o(),h}function QR(){return"!"}W_.peek=KR;function W_(e,t,n,i){const l=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const c=n.createTracker(i);let d=c.move("![");const h=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(h+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return o(),n.stack=m,s(),l==="full"||!h||h!==p?d+=c.move(p+"]"):l==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function KR(){return"!"}ew.peek=JR;function ew(e,t,n){let i=e.value||"",l="`",s=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(i);)l+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s<n.unsafe.length;){const o=n.unsafe[s],c=n.compilePattern(o);let d;if(o.atBreak)for(;d=c.exec(i);){let h=d.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(d.index+1)}}return l+i+l}function JR(){return"`"}function tw(e,t){const n=vp(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))}nw.peek=WR;function nw(e,t,n,i){const l=Cp(n),s=l==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let c,d;if(tw(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,{before:p,after:">",...o.current()})),p+=o.move(">"),c(),n.stack=m,p}c=n.enter("link"),d=n.enter("label");let h=o.move("[");return h+=o.move(n.containerPhrasing(e,{before:h,after:"](",...o.current()})),h+=o.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=o.move("<"),h+=o.move(n.safe(e.url,{before:h,after:">",...o.current()})),h+=o.move(">")):(d=n.enter("destinationRaw"),h+=o.move(n.safe(e.url,{before:h,after:e.title?" ":")",...o.current()}))),d(),e.title&&(d=n.enter(`title${s}`),h+=o.move(" "+l),h+=o.move(n.safe(e.title,{before:h,after:l,...o.current()})),h+=o.move(l),d()),h+=o.move(")"),c(),h}function WR(e,t,n){return tw(e,n)?"<":"["}rw.peek=e4;function rw(e,t,n,i){const l=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const c=n.createTracker(i);let d=c.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(h+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return o(),n.stack=m,s(),l==="full"||!h||h!==p?d+=c.move(p+"]"):l==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function e4(){return"["}function Ap(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 t4(e){const t=Ap(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 n4(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 iw(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 r4(e,t,n,i){const l=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?n4(n):Ap(n);const c=e.ordered?o==="."?")":".":t4(n);let d=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&m&&(!m.children||!m.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&&(d=!0),iw(n)===o&&m){let p=-1;for(;++p<e.children.length;){const y=e.children[p];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(o=c),n.bulletCurrent=o;const h=n.containerFlow(e,i);return n.bulletLastUsed=o,n.bulletCurrent=s,l(),h}function i4(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 a4(e,t,n,i){const l=i4(n);let s=n.bulletCurrent||Ap(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const c=n.createTracker(i);c.move(s+" ".repeat(o-s.length)),c.shift(o);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,c.current()),m);return d(),h;function m(p,y,v){return y?(v?"":" ".repeat(o))+p:(v?s:s+" ".repeat(o-s.length))+p}}function l4(e,t,n,i){const l=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,i);return s(),l(),o}const s4=vc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function u4(e,t,n,i){return(e.children.some(function(o){return s4(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function o4(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aw.peek=c4;function aw(e,t,n,i){const l=o4(n),s=n.enter("strong"),o=n.createTracker(i),c=o.move(l+l);let d=o.move(n.containerPhrasing(e,{after:l,before:c,...o.current()}));const h=d.charCodeAt(0),m=tc(i.before.charCodeAt(i.before.length-1),h,l);m.inside&&(d=Ds(h)+d.slice(1));const p=d.charCodeAt(d.length-1),y=tc(i.after.charCodeAt(0),p,l);y.inside&&(d=d.slice(0,-1)+Ds(p));const v=o.move(l+l);return s(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+d+v}function c4(e,t,n){return n.options.strong||"*"}function f4(e,t,n,i){return n.safe(e.value,i)}function d4(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 h4(e,t,n){const i=(iw(n)+(n.options.ruleSpaces?" ":"")).repeat(d4(n));return n.options.ruleSpaces?i.slice(0,-1):i}const lw={blockquote:LR,break:Yx,code:PR,definition:$R,emphasis:Q_,hardBreak:Yx,heading:GR,html:K_,image:J_,imageReference:W_,inlineCode:ew,link:nw,linkReference:rw,list:r4,listItem:a4,paragraph:l4,root:u4,strong:aw,text:f4,thematicBreak:h4};function m4(){return{enter:{table:p4,tableData:Fx,tableHeader:Fx,tableRow:y4},exit:{codeText:v4,table:g4,tableData:Sh,tableHeader:Sh,tableRow:Sh}}}function p4(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 g4(e){this.exit(e),this.data.inTable=void 0}function y4(e){this.enter({type:"tableRow",children:[]},e)}function Sh(e){this.exit(e)}function Fx(e){this.enter({type:"tableCell",children:[]},e)}function v4(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,x4));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function x4(e,t){return t==="|"?t:e}function b4(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,l=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
80
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:o,tableCell:d,tableRow:c}};function o(v,b,_,S){return h(m(v,_,S),v.align)}function c(v,b,_,S){const k=p(v,_,S),A=h([k]);return A.slice(0,A.indexOf(`
81
+ `))}function d(v,b,_,S){const k=_.enter("tableCell"),A=_.enter("phrasing"),E=_.containerPhrasing(v,{...S,before:s,after:s});return A(),k(),E}function h(v,b){return DR(v,{align:b,alignDelimiters:i,padding:n,stringLength:l})}function m(v,b,_){const S=v.children;let k=-1;const A=[],E=b.enter("table");for(;++k<S.length;)A[k]=p(S[k],b,_);return E(),A}function p(v,b,_){const S=v.children;let k=-1;const A=[],E=b.enter("tableRow");for(;++k<S.length;)A[k]=d(S[k],v,b,_);return E(),A}function y(v,b,_){let S=lw.inlineCode(v,b,_);return _.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function _4(){return{exit:{taskListCheckValueChecked:Gx,taskListCheckValueUnchecked:Gx,paragraph:S4}}}function w4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:E4}}}function Gx(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function S4(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 i=n.children[0];if(i&&i.type==="text"){const l=t.children;let s=-1,o;for(;++s<l.length;){const c=l[s];if(c.type==="paragraph"){o=c;break}}o===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function E4(e,t,n,i){const l=e.children[0],s=typeof e.checked=="boolean"&&l&&l.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",c=n.createTracker(i);s&&c.move(o);let d=lw.listItem(e,t,n,{...i,...c.current()});return s&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(m){return m+o}}function k4(){return[rR(),ER(),AR(),m4(),_4()]}function T4(e){return{extensions:[iR(),kR(e),NR(),b4(e),w4()]}}const C4={tokenize:z4,partial:!0},sw={tokenize:D4,partial:!0},uw={tokenize:j4,partial:!0},ow={tokenize:L4,partial:!0},A4={tokenize:I4,partial:!0},cw={name:"wwwAutolink",tokenize:M4,previous:dw},fw={name:"protocolAutolink",tokenize:R4,previous:hw},Or={name:"emailAutolink",tokenize:O4,previous:mw},rr={};function N4(){return{text:rr}}let Hi=48;for(;Hi<123;)rr[Hi]=Or,Hi++,Hi===58?Hi=65:Hi===91&&(Hi=97);rr[43]=Or;rr[45]=Or;rr[46]=Or;rr[95]=Or;rr[72]=[Or,fw];rr[104]=[Or,fw];rr[87]=[Or,cw];rr[119]=[Or,cw];function O4(e,t,n){const i=this;let l,s;return o;function o(p){return!Gm(p)||!mw.call(i,i.previous)||Np(i.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return Gm(p)?(e.consume(p),c):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(A4,m,h)(p):p===45||p===95||qt(p)?(s=!0,e.consume(p),d):m(p)}function h(p){return e.consume(p),l=!0,d}function m(p){return s&&l&&Ft(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function M4(e,t,n){const i=this;return l;function l(o){return o!==87&&o!==119||!dw.call(i,i.previous)||Np(i.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(C4,e.attempt(sw,e.attempt(uw,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function R4(e,t,n){const i=this;let l="",s=!1;return o;function o(p){return(p===72||p===104)&&hw.call(i,i.previous)&&!Np(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(Ft(p)&&l.length<5)return l+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const y=l.toLowerCase();if(y==="http"||y==="https")return e.consume(p),d}return n(p)}function d(p){return p===47?(e.consume(p),s?h:(s=!0,d)):n(p)}function h(p){return p===null||Jo(p)||at(p)||Yi(p)||pc(p)?n(p):e.attempt(sw,e.attempt(uw,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function z4(e,t,n){let i=0;return l;function l(o){return(o===87||o===119)&&i<3?(i++,e.consume(o),l):o===46&&i===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function D4(e,t,n){let i,l,s;return o;function o(h){return h===46||h===95?e.check(ow,d,c)(h):h===null||at(h)||Yi(h)||h!==45&&pc(h)?d(h):(s=!0,e.consume(h),o)}function c(h){return h===95?i=!0:(l=i,i=void 0),e.consume(h),o}function d(h){return l||i||!s?n(h):t(h)}}function j4(e,t){let n=0,i=0;return l;function l(o){return o===40?(n++,e.consume(o),l):o===41&&i<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(ow,t,s)(o):o===null||at(o)||Yi(o)?t(o):(e.consume(o),l)}function s(o){return o===41&&i++,e.consume(o),l}}function L4(e,t,n){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),i):c===38?(e.consume(c),s):c===93?(e.consume(c),l):c===60||c===null||at(c)||Yi(c)?t(c):n(c)}function l(c){return c===null||c===40||c===91||at(c)||Yi(c)?t(c):i(c)}function s(c){return Ft(c)?o(c):n(c)}function o(c){return c===59?(e.consume(c),i):Ft(c)?(e.consume(c),o):n(c)}}function I4(e,t,n){return i;function i(s){return e.consume(s),l}function l(s){return qt(s)?n(s):t(s)}}function dw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||at(e)}function hw(e){return!Ft(e)}function mw(e){return!(e===47||Gm(e))}function Gm(e){return e===43||e===45||e===46||e===95||qt(e)}function Np(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const B4={tokenize:Y4,partial:!0};function H4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:V4,continuation:{tokenize:$4},exit:Z4}},text:{91:{name:"gfmFootnoteCall",tokenize:P4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:U4,resolveTo:q4}}}}function U4(e,t,n){const i=this;let l=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;l--;){const d=i.events[l][1];if(d.type==="labelImage"){o=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!o||!o._balanced)return n(d);const h=qn(i.sliceSerialize({start:o.end,end:i.now()}));return h.codePointAt(0)!==94||!s.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function q4(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 i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},c=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...c),e}function P4(e,t,n){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,o;return c;function c(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),d}function d(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(p){if(s>999||p===93&&!o||p===null||p===91||at(p))return n(p);if(p===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return l.includes(qn(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return at(p)||(o=!0),s++,e.consume(p),p===92?m:h}function m(p){return p===91||p===92||p===93?(e.consume(p),s++,h):h(p)}}function V4(e,t,n){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,o=0,c;return d;function d(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(b)}function m(b){if(o>999||b===93&&!c||b===null||b===91||at(b))return n(b);if(b===93){e.exit("chunkString");const _=e.exit("gfmFootnoteDefinitionLabelString");return s=qn(i.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return at(b)||(c=!0),o++,e.consume(b),b===92?p:m}function p(b){return b===91||b===92||b===93?(e.consume(b),o++,m):m(b)}function y(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),l.includes(s)||l.push(s),$e(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function $4(e,t,n){return e.check(Fs,t,e.attempt(B4,t,n))}function Z4(e){e.exit("gfmFootnoteDefinition")}function Y4(e,t,n){const i=this;return $e(e,l,"gfmFootnoteDefinitionIndent",5);function l(s){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function F4(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:l};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function l(o,c){let d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let h=d;for(;h--;)if(o[h][0]==="exit"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[h][1].end.offset-o[h][1].start.offset){o[d][1].type="strikethroughSequence",o[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},o[h][1].start),end:Object.assign({},o[d][1].end)},p={type:"strikethroughText",start:Object.assign({},o[h][1].end),end:Object.assign({},o[d][1].start)},y=[["enter",m,c],["enter",o[h][1],c],["exit",o[h][1],c],["enter",p,c]],v=c.parser.constructs.insideSpan.null;v&&gn(y,y.length,0,gc(v,o.slice(h+1,d),c)),gn(y,y.length,0,[["exit",p,c],["enter",o[d][1],c],["exit",o[d][1],c],["exit",m,c]]),gn(o,h-1,d-h+3,y),d=h+y.length-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="strikethroughSequenceTemporary"&&(o[d][1].type="data");return o}function s(o,c,d){const h=this.previous,m=this.events;let p=0;return y;function y(b){return h===126&&m[m.length-1][1].type!=="characterEscape"?d(b):(o.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const _=Xa(h);if(b===126)return p>1?d(b):(o.consume(b),p++,v);if(p<2&&!n)return d(b);const S=o.exit("strikethroughSequenceTemporary"),k=Xa(b);return S._open=!k||k===2&&!!_,S._close=!_||_===2&&!!k,c(b)}}}class G4{constructor(){this.map=[]}add(t,n,i){X4(this,t,n,i)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let l=i.pop();for(;l;){for(const s of l)t.push(s);l=i.pop()}this.map.length=0}}function X4(e,t,n,i){let l=0;if(!(n===0&&i.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...i);return}l+=1}e.map.push([t,n,i])}}function Q4(e,t){let n=!1;const i=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=i.length-1;i[s]=i[s]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function K4(){return{flow:{null:{name:"table",tokenize:J4,resolveAll:W4}}}}function J4(e,t,n){const i=this;let l=0,s=0,o;return c;function c(N){let B=i.events.length-1;for(;B>-1;){const R=i.events[B][1].type;if(R==="lineEnding"||R==="linePrefix")B--;else break}const H=B>-1?i.events[B][1].type:null,F=H==="tableHead"||H==="tableRow"?M:d;return F===M&&i.parser.lazy[i.now().line]?n(N):F(N)}function d(N){return e.enter("tableHead"),e.enter("tableRow"),h(N)}function h(N){return N===124||(o=!0,s+=1),m(N)}function m(N){return N===null?n(N):Ce(N)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),v):n(N):Pe(N)?$e(e,m,"whitespace")(N):(s+=1,o&&(o=!1,l+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),o=!0,m):(e.enter("data"),p(N)))}function p(N){return N===null||N===124||at(N)?(e.exit("data"),m(N)):(e.consume(N),N===92?y:p)}function y(N){return N===92||N===124?(e.consume(N),p):p(N)}function v(N){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(N):(e.enter("tableDelimiterRow"),o=!1,Pe(N)?$e(e,b,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):b(N))}function b(N){return N===45||N===58?S(N):N===124?(o=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),_):D(N)}function _(N){return Pe(N)?$e(e,S,"whitespace")(N):S(N)}function S(N){return N===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),k):N===45?(s+=1,k(N)):N===null||Ce(N)?O(N):D(N)}function k(N){return N===45?(e.enter("tableDelimiterFiller"),A(N)):D(N)}function A(N){return N===45?(e.consume(N),A):N===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(N))}function E(N){return Pe(N)?$e(e,O,"whitespace")(N):O(N)}function O(N){return N===124?b(N):N===null||Ce(N)?!o||l!==s?D(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):D(N)}function D(N){return n(N)}function M(N){return e.enter("tableRow"),U(N)}function U(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),U):N===null||Ce(N)?(e.exit("tableRow"),t(N)):Pe(N)?$e(e,U,"whitespace")(N):(e.enter("data"),L(N))}function L(N){return N===null||N===124||at(N)?(e.exit("data"),U(N)):(e.consume(N),N===92?q:L)}function q(N){return N===92||N===124?(e.consume(N),L):L(N)}}function W4(e,t){let n=-1,i=!0,l=0,s=[0,0,0,0],o=[0,0,0,0],c=!1,d=0,h,m,p;const y=new G4;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(c=!1,d!==0&&(Xx(y,t,d,h,m),m=void 0,d=0),h={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},y.add(n,0,[["enter",h,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(i=!0,p=void 0,s=[0,0,0,0],o=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},y.add(n,0,[["enter",m,t]])),l=b.type==="tableDelimiterRow"?2:m?3:1):l&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(i=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],p=Ao(y,t,s,l,void 0,p),s=[0,0,0,0]),o[2]=n)):b.type==="tableCellDivider"&&(i?i=!1:(s[1]!==0&&(o[0]=o[1],p=Ao(y,t,s,l,void 0,p)),s=o,o=[s[1],n,0,0])):b.type==="tableHead"?(c=!0,d=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(d=n,s[1]!==0?(o[0]=o[1],p=Ao(y,t,s,l,n,p)):o[1]!==0&&(p=Ao(y,t,o,l,n,p)),l=0):l&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(o[3]=n)}for(d!==0&&Xx(y,t,d,h,m),y.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=Q4(t.events,n))}return e}function Ao(e,t,n,i,l,s){const o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},Ba(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const d=Ba(t.events,n[1]);if(s={type:o,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const h=Ba(t.events,n[2]),m=Ba(t.events,n[3]),p={type:c,start:Object.assign({},h),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),i!==2){const y=t.events[n[2]],v=t.events[n[3]];if(y[1].end=Object.assign({},v[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,_=n[3]-n[2]-1;e.add(b,_,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return l!==void 0&&(s.end=Object.assign({},Ba(t.events,l)),e.add(l,0,[["exit",s,t]]),s=void 0),s}function Xx(e,t,n,i,l){const s=[],o=Ba(t.events,n);l&&(l.end=Object.assign({},o),s.push(["exit",l,t])),i.end=Object.assign({},o),s.push(["exit",i,t]),e.add(n+1,0,s)}function Ba(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const ez={name:"tasklistCheck",tokenize:nz};function tz(){return{text:{91:ez}}}function nz(e,t,n){const i=this;return l;function l(d){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),s)}function s(d){return at(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),o):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),o):n(d)}function o(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return Ce(d)?t(d):Pe(d)?e.check({tokenize:rz},t,n)(d):n(d)}}function rz(e,t,n){return $e(e,i,"whitespace");function i(l){return l===null?n(l):t(l)}}function iz(e){return k_([N4(),H4(),F4(e),K4(),tz()])}const az={};function lz(e){const t=this,n=e||az,i=t.data(),l=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);l.push(iz(n)),s.push(k4()),o.push(T4(n))}const sz=({message:e})=>I.jsx("div",{className:"message ai",children:I.jsxs("div",{className:"message-content",children:[I.jsx("div",{className:"message-title",children:e.name}),I.jsx("div",{className:"message-text markdown-body",children:I.jsx(FM,{remarkPlugins:[lz],children:fp(e.content)})}),I.jsx(op,{response_metadata:e.response_metadata,usage_metadata:e.usage_metadata||{},spend_time:e.spend_time,id:e.id})]})}),uz=CC({name:"ask_user_for_approve",description:"Request user review and approval for plans or content, wait for user feedback before proceeding",parameters:[{name:"title",type:"string",description:"Title or subject of the content to be reviewed"}],onlyRender:!0,handler:o_.waitForUIDone,render(e){const t=e.input||{},[n,i]=ie.useState(""),l=()=>{const o={approved:!0,feedback:n.trim()||null};e.response(o)},s=()=>{const o={approved:!1,feedback:n.trim()||"用户拒绝了请求"};e.response(o)};return I.jsxs("div",{className:"approval-prompt-compact",children:[I.jsxs("div",{className:"approval-header-compact",children:[I.jsx("span",{children:"🔍请求审核批准"}),t.title&&I.jsx("span",{className:"approval-title",children:t.title})]}),I.jsxs("div",{className:"feedback-input-compact",children:[I.jsx("textarea",{disabled:e.state==="done",className:"feedback-textarea-compact",placeholder:"反馈意见(可选)",value:n,onChange:o=>i(o.target.value),rows:1}),I.jsx("button",{disabled:e.state==="done",className:"approve-button-compact",onClick:l,children:"✅ 批准"}),I.jsx("button",{disabled:e.state==="done",className:"reject-button-compact",onClick:s,children:"❌ 拒绝"})]})]})}}),oz=localStorage.getItem("withCredentials")==="true"?(e,t)=>(t.credentials="include",fetch(e,t)):fetch,cz=()=>({showHistory:localStorage.getItem("showHistory")==="true"||!1,showGraph:localStorage.getItem("showGraph")==="true"||!1}),Qx=e=>{Object.entries(e).forEach(([t,n])=>{localStorage.setItem(t,n.toString())})},fz=DC(localStorage.getItem("agent_name")||"",{apiUrl:localStorage.getItem("apiUrl")||"http://localhost:8123",defaultHeaders:JSON.parse(localStorage.getItem("code")||"{}"),callerOptions:{fetch:oz}},{...cz(),onInit(e){e.tools.bindTools([uz])}});let Eh=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function dz(e,{keys:t,deps:n=[e,t]}={}){let i=ie.useRef();i.current=e.get();let l=ie.useCallback(o=>(Eh(i,o)(e.value),(t==null?void 0:t.length)>0?NC(e,t,Eh(i,o)):e.listen(Eh(i,o))),n),s=()=>i.current;return ie.useSyncExternalStore(l,s,s)}const pw=ie.createContext(void 0),al=()=>{const e=ie.useContext(pw);if(!e)throw new Error("useChat must be used within a ChatProvider");return e},hz=({children:e})=>{const t=LC(fz,dz);return ie.useEffect(()=>{t.initClient().then(n=>{t.showHistory&&t.refreshHistoryList()})},[]),I.jsx(pw.Provider,{value:t,children:e})},mz=({message:e,client:t,getMessageContent:n,formatTokens:i,isCollapsed:l,onToggleCollapse:s})=>{const{getToolUIRender:o}=al(),c=o(e.name);return I.jsx("div",{className:"message tool",children:c?c(e):I.jsxs("div",{className:"tool-message",children:[I.jsx("div",{className:"tool-header",onClick:s,children:I.jsxs("div",{className:"tool-title",onClick:()=>console.log(e),children:[e.node_name," | ",e.name]})}),!l&&I.jsxs("div",{className:"tool-content",children:[I.jsx("div",{className:"tool-input",children:e.tool_input}),I.jsx("div",{className:"tool-output",children:n(e.content)}),I.jsx(op,{response_metadata:e.response_metadata,usage_metadata:e.usage_metadata||{},spend_time:e.spend_time,id:e.id,tool_call_id:e.tool_call_id})]})]})})},gw=({renderMessages:e,collapsedTools:t,toggleToolCollapse:n,client:i})=>I.jsx(I.Fragment,{children:e.map(l=>l.type==="human"?I.jsx(CT,{content:l.content},l.unique_id):l.type==="tool"?I.jsx(mz,{message:l,client:i,getMessageContent:fp,formatTokens:RC,isCollapsed:t.includes(l.id),onToggleCollapse:()=>n(l.id)},l.unique_id):I.jsx(sz,{message:l},l.unique_id))}),pz=({onClose:e,formatTime:t})=>{const{historyList:n,currentChatId:i,refreshHistoryList:l,createNewChat:s,deleteHistoryChat:o,toHistoryChat:c}=al();return I.jsxs("div",{className:"history-list",children:[I.jsxs("div",{className:"history-header",children:[I.jsxs("div",{className:"header-left",children:[I.jsx("h3",{children:"历史记录"}),I.jsx("button",{className:"refresh-button",onClick:l,title:"刷新列表",children:"🔁"})]}),I.jsx("button",{className:"close-button",onClick:e,title:"关闭",children:"❌"})]}),I.jsxs("div",{className:"history-content",children:[I.jsx("div",{className:"history-items",onClick:()=>{s()},children:I.jsx("div",{className:"history-item",children:I.jsx("div",{className:"history-title",children:" New Chat"})})}),n.length===0?I.jsx("div",{className:"empty-history",children:"暂无历史记录"}):I.jsx("div",{className:"history-items",children:n.sort((d,h)=>new Date(h.created_at).getTime()-new Date(d.created_at).getTime()).map(d=>I.jsxs("div",{className:`history-item ${d.thread_id===i?"active":""}`,children:[I.jsxs("div",{className:"history-info",children:[I.jsx("div",{className:"history-title",children:zC(d)}),I.jsxs("div",{className:"history-meta",children:[I.jsx("span",{className:"history-time",children:t(new Date(d.created_at))}),I.jsx("span",{className:"history-status",children:d.status})]})]}),I.jsxs("div",{className:"history-actions",children:[I.jsx("button",{className:"action-button",onClick:()=>{c(d)},title:"恢复对话",children:"⏪"}),I.jsx("button",{className:"action-button",onClick:async()=>{await o(d)},title:"删除对话",children:"❌"})]})]},d.thread_id))})]}),I.jsx("style",{children:`
82
+ .history-list {
83
+ background: #fff;
84
+ border-radius: 8px;
85
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
86
+ height: 100%;
87
+ display: flex;
88
+ flex-direction: column;
89
+ }
90
+
91
+ .history-header {
92
+ padding: 16px;
93
+ border-bottom: 1px solid #eee;
94
+ display: flex;
95
+ justify-content: space-between;
96
+ align-items: center;
97
+ }
98
+
99
+ .header-left {
100
+ display: flex;
101
+ align-items: center;
102
+ gap: 12px;
103
+ }
104
+
105
+ .history-header h3 {
106
+ margin: 0;
107
+ font-size: 18px;
108
+ color: #333;
109
+ }
110
+
111
+ .history-content {
112
+ flex: 1;
113
+ overflow-y: auto;
114
+ padding: 16px;
115
+ }
116
+
117
+ .history-items {
118
+ display: flex;
119
+ flex-direction: column;
120
+ gap: 12px;
121
+ }
122
+
123
+ .history-item {
124
+ display: flex;
125
+ justify-content: space-between;
126
+ align-items: center;
127
+ padding: 12px;
128
+ border-radius: 6px;
129
+ background: #f8f9fa;
130
+ transition: all 0.2s ease;
131
+ }
132
+
133
+ .history-item:hover {
134
+ background: #f0f2f5;
135
+ }
136
+
137
+ .history-item.active {
138
+ background: #e6f7ff;
139
+ border: 1px solid #91d5ff;
140
+ }
141
+
142
+ .history-info {
143
+ flex: 1;
144
+ min-width: 0;
145
+ }
146
+
147
+ .history-title {
148
+ font-size: 14px;
149
+ color: #333;
150
+ margin-bottom: 4px;
151
+ white-space: nowrap;
152
+ overflow: hidden;
153
+ text-overflow: ellipsis;
154
+ }
155
+
156
+ .history-meta {
157
+ display: flex;
158
+ gap: 12px;
159
+ color: #666;
160
+ font-size: 12px;
161
+ }
162
+
163
+ .history-actions {
164
+ display: flex;
165
+ gap: 8px;
166
+ margin-left: 12px;
167
+ }
168
+
169
+ .action-button, .close-button, .refresh-button {
170
+ background: none;
171
+ border: none;
172
+ cursor: pointer;
173
+ padding: 6px;
174
+ font-size: 16px;
175
+ border-radius: 4px;
176
+ transition: all 0.2s ease;
177
+ display: flex;
178
+ align-items: center;
179
+ justify-content: center;
180
+ }
181
+
182
+ .action-button:hover, .close-button:hover, .refresh-button:hover {
183
+ background: rgba(0, 0, 0, 0.05);
184
+ transform: scale(1.1);
185
+ }
186
+
187
+ .empty-history {
188
+ text-align: center;
189
+ color: #999;
190
+ padding: 32px 0;
191
+ }
192
+ `})]})},yw=ie.createContext(void 0),gz=({children:e})=>{const[t,n]=ie.useState(()=>{const l=localStorage.getItem("extraParams");try{return l?JSON.parse(l):{}}catch(s){return console.error("Failed to parse extraParams from localStorage",s),{}}});ie.useEffect(()=>{localStorage.setItem("extraParams",JSON.stringify(t))},[t]);const i=l=>{n(l)};return I.jsx(yw.Provider,{value:{extraParams:t,setExtraParams:i},children:e})},vw=()=>{const e=ie.useContext(yw);if(e===void 0)throw new Error("useExtraParams must be used within an ExtraParamsProvider");return e};class yz{constructor(t={}){vt(this,"apiUrl");this.apiUrl=t.apiUrl||""}createFormData(t,n){const i=new FormData;if(typeof t=="string"){const l=new Blob([t],{type:"text/plain"});i.append("file",l,n||"file.txt")}else i.append("file",t,n||(t instanceof File?t.name:"file"));return i}async upload(t,n={}){const l={method:"POST",body:this.createFormData(t,n.filename)};n.signal&&(l.signal=n.signal);try{const s=await fetch(`${this.apiUrl}${this.getUploadEndpoint()}`,l);if(!s.ok)throw new Error(`Upload failed with status: ${s.status}`);const o=await s.json();return this.processResponse(o)}catch(s){throw new Error(`File upload failed: ${s instanceof Error?s.message:String(s)}`)}}}class vz extends yz{constructor(t={}){super({apiUrl:t.apiUrl||"https://tmpfiles.org/api/v1"})}getUploadEndpoint(){return"/upload"}processResponse(t){var n;return(n=t.data)!=null&&n.url&&(t.data.url=t.data.url.replace("https://tmpfiles.org/","https://tmpfiles.org/dl/")),t}}const xz=({onFileUploaded:e})=>{const[t,n]=ie.useState([]),i=new vz,l=3,s=ie.useCallback(async c=>{var m;const h=Array.from(c.target.files||[]).filter(p=>p.type.startsWith("image/"));if(t.length+h.length>l){alert(`最多只能上传${l}张图片`),c.target.value="";return}n(p=>[...p,...h]);for(const p of h)try{const y=await i.upload(p);(m=y.data)!=null&&m.url&&e(y.data.url)}catch(y){console.error("Upload failed:",y)}c.target.value=""},[e,t.length]),o=ie.useCallback(c=>{n(d=>d.filter((h,m)=>m!==c))},[]);return I.jsxs("div",{className:"file-list",children:[t.length<l&&I.jsxs("label",{className:`file-upload-button ${t.length===0?"empty":""}`,children:[I.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",children:[I.jsx("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"}),I.jsx("path",{d:"M20 4h-3.17l-1.24-1.35A1.99 1.99 0 0 0 14.12 2H9.88c-.56 0-1.1.24-1.48.65L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 13c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"})]}),I.jsx("input",{type:"file",accept:"image/*",multiple:!0,onChange:s,style:{display:"none"}})]}),I.jsx("div",{className:"file-list-content",children:t.map((c,d)=>I.jsxs("div",{className:"file-item",children:[I.jsx("img",{src:URL.createObjectURL(c),alt:c.name,className:"file-preview"}),I.jsx("button",{className:"remove-button",onClick:()=>o(d),children:"×"})]},d))})]})},bz=({isOpen:e,initialJson:t,onClose:n,onSave:i})=>{const[l,s]=ie.useState(""),[o,c]=ie.useState(null);if(ie.useEffect(()=>{s(JSON.stringify(t,null,2)),c(null)},[t,e]),!e)return null;const d=()=>{try{const h=JSON.parse(l);i(h),n()}catch(h){c("JSON 格式无效,请检查后重试。"),console.error("Invalid JSON format:",h)}};return I.jsx("div",{className:"json-editor-popup-overlay",children:I.jsxs("div",{className:"json-editor-popup-content",children:[I.jsx("h2",{children:"编辑 Extra Parameters"}),I.jsx("textarea",{value:l,onChange:h=>{s(h.target.value),c(null)},rows:15}),o&&I.jsx("p",{className:"error-message",children:o}),I.jsxs("div",{className:"popup-actions",children:[I.jsx("button",{onClick:n,className:"cancel-button",children:"取消"}),I.jsx("button",{onClick:d,className:"save-button",children:"保存"})]})]})})},_z=({isOpen:e,onClose:t,initialJson:n})=>{const[i,l]=ie.useState(""),[s,o]=ie.useState(null),[c,d]=ie.useState([]);ie.useEffect(()=>{if(e){let m="";if(n)if(typeof n=="string")m=n;else try{m=JSON.stringify(n,null,2)}catch(p){console.error("Failed to stringify initial JSON",p),m=""}else m=JSON.stringify([],null,2);l(m),o(null);try{h(m)}catch(p){console.error("Failed to parse initial JSON",p)}}},[e,n]);const h=m=>{try{const p=JSON.parse(m);let y=[];if(Array.isArray(p)?y=p:y=p.messages,!Array.isArray(y))throw new Error("JSON 格式无效,请检查后重试");d(y),o(null)}catch(p){o("JSON 格式无效,请检查后重试"),console.error("Invalid JSON format:",p)}};return ie.useEffect(()=>{i&&h(i)},[i]),e?I.jsx("div",{className:"json-to-message-overlay",children:I.jsxs("div",{className:"json-to-message-content",children:[I.jsxs("div",{className:"json-to-message-header",children:[I.jsx("h2",{children:"JSON 消息预览"}),I.jsx("button",{onClick:t,className:"close-button",children:"×"})]}),I.jsxs("div",{className:"json-to-message-body",children:[I.jsxs("div",{className:"json-editor-pane",children:[I.jsx("textarea",{value:i,onChange:m=>l(m.target.value),rows:20,placeholder:"输入JSON消息格式..."}),s&&I.jsx("p",{className:"error-message",children:s})]}),I.jsx("div",{className:"message-preview-pane",children:I.jsx("div",{className:"preview-container chat-messages",children:(c==null?void 0:c.length)>0?I.jsx(gw,{renderMessages:c,collapsedTools:[],toggleToolCollapse:()=>{},client:null}):I.jsx("div",{className:"no-preview",children:"请输入有效的JSON以查看消息预览"})})})]})]})}):null},wz=({buttonText:e="JSON 预览",initialJson:t,className:n=""})=>{const[i,l]=ie.useState(!1),s=()=>l(!0),o=()=>l(!1);return I.jsxs(I.Fragment,{children:[I.jsx("button",{className:`history-button ${n}`,onClick:s,children:e}),I.jsx(_z,{isOpen:i,onClose:o,initialJson:t})]})};function Ct(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n<e.length;n++)(i=Ct(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Sz={value:()=>{}};function bc(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new qo(n)}function qo(e){this._=e}function Ez(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",l=n.indexOf(".");if(l>=0&&(i=n.slice(l+1),n=n.slice(0,l)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}qo.prototype=bc.prototype={constructor:qo,on:function(e,t){var n=this._,i=Ez(e+"",n),l,s=-1,o=i.length;if(arguments.length<2){for(;++s<o;)if((l=(e=i[s]).type)&&(l=kz(n[l],e.name)))return l;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(l=(e=i[s]).type)n[l]=Kx(n[l],e.name,t);else if(t==null)for(l in n)n[l]=Kx(n[l],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new qo(e)},call:function(e,t){if((l=arguments.length-2)>0)for(var n=new Array(l),i=0,l,s;i<l;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,l=s.length;i<l;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],l=0,s=i.length;l<s;++l)i[l].value.apply(t,n)}};function kz(e,t){for(var n=0,i=e.length,l;n<i;++n)if((l=e[n]).name===t)return l.value}function Kx(e,t,n){for(var i=0,l=e.length;i<l;++i)if(e[i].name===t){e[i]=Sz,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Xm="http://www.w3.org/1999/xhtml";const Jx={svg:"http://www.w3.org/2000/svg",xhtml:Xm,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _c(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Jx.hasOwnProperty(t)?{space:Jx[t],local:e}:e}function Tz(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Xm&&t.documentElement.namespaceURI===Xm?t.createElement(e):t.createElementNS(n,e)}}function Cz(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function xw(e){var t=_c(e);return(t.local?Cz:Tz)(t)}function Az(){}function Op(e){return e==null?Az:function(){return this.querySelector(e)}}function Nz(e){typeof e!="function"&&(e=Op(e));for(var t=this._groups,n=t.length,i=new Array(n),l=0;l<n;++l)for(var s=t[l],o=s.length,c=i[l]=new Array(o),d,h,m=0;m<o;++m)(d=s[m])&&(h=e.call(d,d.__data__,m,s))&&("__data__"in d&&(h.__data__=d.__data__),c[m]=h);return new vn(i,this._parents)}function Oz(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Mz(){return[]}function bw(e){return e==null?Mz:function(){return this.querySelectorAll(e)}}function Rz(e){return function(){return Oz(e.apply(this,arguments))}}function zz(e){typeof e=="function"?e=Rz(e):e=bw(e);for(var t=this._groups,n=t.length,i=[],l=[],s=0;s<n;++s)for(var o=t[s],c=o.length,d,h=0;h<c;++h)(d=o[h])&&(i.push(e.call(d,d.__data__,h,o)),l.push(d));return new vn(i,l)}function _w(e){return function(){return this.matches(e)}}function ww(e){return function(t){return t.matches(e)}}var Dz=Array.prototype.find;function jz(e){return function(){return Dz.call(this.children,e)}}function Lz(){return this.firstElementChild}function Iz(e){return this.select(e==null?Lz:jz(typeof e=="function"?e:ww(e)))}var Bz=Array.prototype.filter;function Hz(){return Array.from(this.children)}function Uz(e){return function(){return Bz.call(this.children,e)}}function qz(e){return this.selectAll(e==null?Hz:Uz(typeof e=="function"?e:ww(e)))}function Pz(e){typeof e!="function"&&(e=_w(e));for(var t=this._groups,n=t.length,i=new Array(n),l=0;l<n;++l)for(var s=t[l],o=s.length,c=i[l]=[],d,h=0;h<o;++h)(d=s[h])&&e.call(d,d.__data__,h,s)&&c.push(d);return new vn(i,this._parents)}function Sw(e){return new Array(e.length)}function Vz(){return new vn(this._enter||this._groups.map(Sw),this._parents)}function nc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}nc.prototype={constructor:nc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function $z(e){return function(){return e}}function Zz(e,t,n,i,l,s){for(var o=0,c,d=t.length,h=s.length;o<h;++o)(c=t[o])?(c.__data__=s[o],i[o]=c):n[o]=new nc(e,s[o]);for(;o<d;++o)(c=t[o])&&(l[o]=c)}function Yz(e,t,n,i,l,s,o){var c,d,h=new Map,m=t.length,p=s.length,y=new Array(m),v;for(c=0;c<m;++c)(d=t[c])&&(y[c]=v=o.call(d,d.__data__,c,t)+"",h.has(v)?l[c]=d:h.set(v,d));for(c=0;c<p;++c)v=o.call(e,s[c],c,s)+"",(d=h.get(v))?(i[c]=d,d.__data__=s[c],h.delete(v)):n[c]=new nc(e,s[c]);for(c=0;c<m;++c)(d=t[c])&&h.get(y[c])===d&&(l[c]=d)}function Fz(e){return e.__data__}function Gz(e,t){if(!arguments.length)return Array.from(this,Fz);var n=t?Yz:Zz,i=this._parents,l=this._groups;typeof e!="function"&&(e=$z(e));for(var s=l.length,o=new Array(s),c=new Array(s),d=new Array(s),h=0;h<s;++h){var m=i[h],p=l[h],y=p.length,v=Xz(e.call(m,m&&m.__data__,h,i)),b=v.length,_=c[h]=new Array(b),S=o[h]=new Array(b),k=d[h]=new Array(y);n(m,p,_,S,k,v,t);for(var A=0,E=0,O,D;A<b;++A)if(O=_[A]){for(A>=E&&(E=A+1);!(D=S[E])&&++E<b;);O._next=D||null}}return o=new vn(o,i),o._enter=c,o._exit=d,o}function Xz(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Qz(){return new vn(this._exit||this._groups.map(Sw),this._parents)}function Kz(e,t,n){var i=this.enter(),l=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(l=t(l),l&&(l=l.selection())),n==null?s.remove():n(s),i&&l?i.merge(l).order():l}function Jz(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,l=n.length,s=i.length,o=Math.min(l,s),c=new Array(l),d=0;d<o;++d)for(var h=n[d],m=i[d],p=h.length,y=c[d]=new Array(p),v,b=0;b<p;++b)(v=h[b]||m[b])&&(y[b]=v);for(;d<l;++d)c[d]=n[d];return new vn(c,this._parents)}function Wz(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],l=i.length-1,s=i[l],o;--l>=0;)(o=i[l])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function eD(e){e||(e=tD);function t(p,y){return p&&y?e(p.__data__,y.__data__):!p-!y}for(var n=this._groups,i=n.length,l=new Array(i),s=0;s<i;++s){for(var o=n[s],c=o.length,d=l[s]=new Array(c),h,m=0;m<c;++m)(h=o[m])&&(d[m]=h);d.sort(t)}return new vn(l,this._parents).order()}function tD(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function nD(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function rD(){return Array.from(this)}function iD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],l=0,s=i.length;l<s;++l){var o=i[l];if(o)return o}return null}function aD(){let e=0;for(const t of this)++e;return e}function lD(){return!this.node()}function sD(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var l=t[n],s=0,o=l.length,c;s<o;++s)(c=l[s])&&e.call(c,c.__data__,s,l);return this}function uD(e){return function(){this.removeAttribute(e)}}function oD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function cD(e,t){return function(){this.setAttribute(e,t)}}function fD(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function dD(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function hD(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function mD(e,t){var n=_c(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?oD:uD:typeof t=="function"?n.local?hD:dD:n.local?fD:cD)(n,t))}function Ew(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function pD(e){return function(){this.style.removeProperty(e)}}function gD(e,t,n){return function(){this.style.setProperty(e,t,n)}}function yD(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function vD(e,t,n){return arguments.length>1?this.each((t==null?pD:typeof t=="function"?yD:gD)(e,t,n??"")):Qa(this.node(),e)}function Qa(e,t){return e.style.getPropertyValue(t)||Ew(e).getComputedStyle(e,null).getPropertyValue(t)}function xD(e){return function(){delete this[e]}}function bD(e,t){return function(){this[e]=t}}function _D(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function wD(e,t){return arguments.length>1?this.each((t==null?xD:typeof t=="function"?_D:bD)(e,t)):this.node()[e]}function kw(e){return e.trim().split(/^|\s+/)}function Mp(e){return e.classList||new Tw(e)}function Tw(e){this._node=e,this._names=kw(e.getAttribute("class")||"")}Tw.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Cw(e,t){for(var n=Mp(e),i=-1,l=t.length;++i<l;)n.add(t[i])}function Aw(e,t){for(var n=Mp(e),i=-1,l=t.length;++i<l;)n.remove(t[i])}function SD(e){return function(){Cw(this,e)}}function ED(e){return function(){Aw(this,e)}}function kD(e,t){return function(){(t.apply(this,arguments)?Cw:Aw)(this,e)}}function TD(e,t){var n=kw(e+"");if(arguments.length<2){for(var i=Mp(this.node()),l=-1,s=n.length;++l<s;)if(!i.contains(n[l]))return!1;return!0}return this.each((typeof t=="function"?kD:t?SD:ED)(n,t))}function CD(){this.textContent=""}function AD(e){return function(){this.textContent=e}}function ND(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function OD(e){return arguments.length?this.each(e==null?CD:(typeof e=="function"?ND:AD)(e)):this.node().textContent}function MD(){this.innerHTML=""}function RD(e){return function(){this.innerHTML=e}}function zD(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function DD(e){return arguments.length?this.each(e==null?MD:(typeof e=="function"?zD:RD)(e)):this.node().innerHTML}function jD(){this.nextSibling&&this.parentNode.appendChild(this)}function LD(){return this.each(jD)}function ID(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function BD(){return this.each(ID)}function HD(e){var t=typeof e=="function"?e:xw(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function UD(){return null}function qD(e,t){var n=typeof e=="function"?e:xw(e),i=t==null?UD:typeof t=="function"?t:Op(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function PD(){var e=this.parentNode;e&&e.removeChild(this)}function VD(){return this.each(PD)}function $D(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ZD(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function YD(e){return this.select(e?ZD:$D)}function FD(e){return arguments.length?this.property("__data__",e):this.node().__data__}function GD(e){return function(t){e.call(this,t,this.__data__)}}function XD(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function QD(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,l=t.length,s;n<l;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function KD(e,t,n){return function(){var i=this.__on,l,s=GD(t);if(i){for(var o=0,c=i.length;o<c;++o)if((l=i[o]).type===e.type&&l.name===e.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=s,l.options=n),l.value=t;return}}this.addEventListener(e.type,s,n),l={type:e.type,name:e.name,value:t,listener:s,options:n},i?i.push(l):this.__on=[l]}}function JD(e,t,n){var i=XD(e+""),l,s=i.length,o;if(arguments.length<2){var c=this.node().__on;if(c){for(var d=0,h=c.length,m;d<h;++d)for(l=0,m=c[d];l<s;++l)if((o=i[l]).type===m.type&&o.name===m.name)return m.value}return}for(c=t?KD:QD,l=0;l<s;++l)this.each(c(i[l],t,n));return this}function Nw(e,t,n){var i=Ew(e),l=i.CustomEvent;typeof l=="function"?l=new l(t,n):(l=i.document.createEvent("Event"),n?(l.initEvent(t,n.bubbles,n.cancelable),l.detail=n.detail):l.initEvent(t,!1,!1)),e.dispatchEvent(l)}function WD(e,t){return function(){return Nw(this,e,t)}}function e3(e,t){return function(){return Nw(this,e,t.apply(this,arguments))}}function t3(e,t){return this.each((typeof t=="function"?e3:WD)(e,t))}function*n3(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],l=0,s=i.length,o;l<s;++l)(o=i[l])&&(yield o)}var Ow=[null];function vn(e,t){this._groups=e,this._parents=t}function Xs(){return new vn([[document.documentElement]],Ow)}function r3(){return this}vn.prototype=Xs.prototype={constructor:vn,select:Nz,selectAll:zz,selectChild:Iz,selectChildren:qz,filter:Pz,data:Gz,enter:Vz,exit:Qz,join:Kz,merge:Jz,selection:r3,order:Wz,sort:eD,call:nD,nodes:rD,node:iD,size:aD,empty:lD,each:sD,attr:mD,style:vD,property:wD,classed:TD,text:OD,html:DD,raise:LD,lower:BD,append:HD,insert:qD,remove:VD,clone:YD,datum:FD,on:JD,dispatch:t3,[Symbol.iterator]:n3};function pn(e){return typeof e=="string"?new vn([[document.querySelector(e)]],[document.documentElement]):new vn([[e]],Ow)}function i3(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Bn(e,t){if(e=i3(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var l=t.getBoundingClientRect();return[e.clientX-l.left-t.clientLeft,e.clientY-l.top-t.clientTop]}}return[e.pageX,e.pageY]}const a3={passive:!1},js={capture:!0,passive:!1};function kh(e){e.stopImmediatePropagation()}function Pa(e){e.preventDefault(),e.stopImmediatePropagation()}function Mw(e){var t=e.document.documentElement,n=pn(e).on("dragstart.drag",Pa,js);"onselectstart"in t?n.on("selectstart.drag",Pa,js):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Rw(e,t){var n=e.document.documentElement,i=pn(e).on("dragstart.drag",null);t&&(i.on("click.drag",Pa,js),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const No=e=>()=>e;function Qm(e,{sourceEvent:t,subject:n,target:i,identifier:l,active:s,x:o,y:c,dx:d,dy:h,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:m}})}Qm.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function l3(e){return!e.ctrlKey&&!e.button}function s3(){return this.parentNode}function u3(e,t){return t??{x:e.x,y:e.y}}function o3(){return navigator.maxTouchPoints||"ontouchstart"in this}function zw(){var e=l3,t=s3,n=u3,i=o3,l={},s=bc("start","drag","end"),o=0,c,d,h,m,p=0;function y(O){O.on("mousedown.drag",v).filter(i).on("touchstart.drag",S).on("touchmove.drag",k,a3).on("touchend.drag touchcancel.drag",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(O,D){if(!(m||!e.call(this,O,D))){var M=E(this,t.call(this,O,D),O,D,"mouse");M&&(pn(O.view).on("mousemove.drag",b,js).on("mouseup.drag",_,js),Mw(O.view),kh(O),h=!1,c=O.clientX,d=O.clientY,M("start",O))}}function b(O){if(Pa(O),!h){var D=O.clientX-c,M=O.clientY-d;h=D*D+M*M>p}l.mouse("drag",O)}function _(O){pn(O.view).on("mousemove.drag mouseup.drag",null),Rw(O.view,h),Pa(O),l.mouse("end",O)}function S(O,D){if(e.call(this,O,D)){var M=O.changedTouches,U=t.call(this,O,D),L=M.length,q,N;for(q=0;q<L;++q)(N=E(this,U,O,D,M[q].identifier,M[q]))&&(kh(O),N("start",O,M[q]))}}function k(O){var D=O.changedTouches,M=D.length,U,L;for(U=0;U<M;++U)(L=l[D[U].identifier])&&(Pa(O),L("drag",O,D[U]))}function A(O){var D=O.changedTouches,M=D.length,U,L;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),U=0;U<M;++U)(L=l[D[U].identifier])&&(kh(O),L("end",O,D[U]))}function E(O,D,M,U,L,q){var N=s.copy(),B=Bn(q||M,D),H,F,R;if((R=n.call(O,new Qm("beforestart",{sourceEvent:M,target:y,identifier:L,active:o,x:B[0],y:B[1],dx:0,dy:0,dispatch:N}),U))!=null)return H=R.x-B[0]||0,F=R.y-B[1]||0,function $(j,P,K){var X=B,w;switch(j){case"start":l[L]=$,w=o++;break;case"end":delete l[L],--o;case"drag":B=Bn(K||P,D),w=o;break}N.call(j,O,new Qm(j,{sourceEvent:P,subject:R,target:y,identifier:L,active:w,x:B[0]+H,y:B[1]+F,dx:B[0]-X[0],dy:B[1]-X[1],dispatch:N}),U)}}return y.filter=function(O){return arguments.length?(e=typeof O=="function"?O:No(!!O),y):e},y.container=function(O){return arguments.length?(t=typeof O=="function"?O:No(O),y):t},y.subject=function(O){return arguments.length?(n=typeof O=="function"?O:No(O),y):n},y.touchable=function(O){return arguments.length?(i=typeof O=="function"?O:No(!!O),y):i},y.on=function(){var O=s.on.apply(s,arguments);return O===s?y:O},y.clickDistance=function(O){return arguments.length?(p=(O=+O)*O,y):Math.sqrt(p)},y}function Rp(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Dw(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Qs(){}var Ls=.7,rc=1/Ls,Va="\\s*([+-]?\\d+)\\s*",Is="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",c3=/^#([0-9a-f]{3,8})$/,f3=new RegExp(`^rgb\\(${Va},${Va},${Va}\\)$`),d3=new RegExp(`^rgb\\(${tr},${tr},${tr}\\)$`),h3=new RegExp(`^rgba\\(${Va},${Va},${Va},${Is}\\)$`),m3=new RegExp(`^rgba\\(${tr},${tr},${tr},${Is}\\)$`),p3=new RegExp(`^hsl\\(${Is},${tr},${tr}\\)$`),g3=new RegExp(`^hsla\\(${Is},${tr},${tr},${Is}\\)$`),Wx={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Rp(Qs,Bs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:eb,formatHex:eb,formatHex8:y3,formatHsl:v3,formatRgb:tb,toString:tb});function eb(){return this.rgb().formatHex()}function y3(){return this.rgb().formatHex8()}function v3(){return jw(this).formatHsl()}function tb(){return this.rgb().formatRgb()}function Bs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=c3.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?nb(t):n===3?new nn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Oo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Oo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=f3.exec(e))?new nn(t[1],t[2],t[3],1):(t=d3.exec(e))?new nn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=h3.exec(e))?Oo(t[1],t[2],t[3],t[4]):(t=m3.exec(e))?Oo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=p3.exec(e))?ab(t[1],t[2]/100,t[3]/100,1):(t=g3.exec(e))?ab(t[1],t[2]/100,t[3]/100,t[4]):Wx.hasOwnProperty(e)?nb(Wx[e]):e==="transparent"?new nn(NaN,NaN,NaN,0):null}function nb(e){return new nn(e>>16&255,e>>8&255,e&255,1)}function Oo(e,t,n,i){return i<=0&&(e=t=n=NaN),new nn(e,t,n,i)}function x3(e){return e instanceof Qs||(e=Bs(e)),e?(e=e.rgb(),new nn(e.r,e.g,e.b,e.opacity)):new nn}function Km(e,t,n,i){return arguments.length===1?x3(e):new nn(e,t,n,i??1)}function nn(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}Rp(nn,Km,Dw(Qs,{brighter(e){return e=e==null?rc:Math.pow(rc,e),new nn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ls:Math.pow(Ls,e),new nn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nn(Vi(this.r),Vi(this.g),Vi(this.b),ic(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rb,formatHex:rb,formatHex8:b3,formatRgb:ib,toString:ib}));function rb(){return`#${Pi(this.r)}${Pi(this.g)}${Pi(this.b)}`}function b3(){return`#${Pi(this.r)}${Pi(this.g)}${Pi(this.b)}${Pi((isNaN(this.opacity)?1:this.opacity)*255)}`}function ib(){const e=ic(this.opacity);return`${e===1?"rgb(":"rgba("}${Vi(this.r)}, ${Vi(this.g)}, ${Vi(this.b)}${e===1?")":`, ${e})`}`}function ic(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pi(e){return e=Vi(e),(e<16?"0":"")+e.toString(16)}function ab(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Hn(e,t,n,i)}function jw(e){if(e instanceof Hn)return new Hn(e.h,e.s,e.l,e.opacity);if(e instanceof Qs||(e=Bs(e)),!e)return new Hn;if(e instanceof Hn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,l=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,c=s-l,d=(s+l)/2;return c?(t===s?o=(n-i)/c+(n<i)*6:n===s?o=(i-t)/c+2:o=(t-n)/c+4,c/=d<.5?s+l:2-s-l,o*=60):c=d>0&&d<1?0:o,new Hn(o,c,d,e.opacity)}function _3(e,t,n,i){return arguments.length===1?jw(e):new Hn(e,t,n,i??1)}function Hn(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Rp(Hn,_3,Dw(Qs,{brighter(e){return e=e==null?rc:Math.pow(rc,e),new Hn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ls:Math.pow(Ls,e),new Hn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,l=2*n-i;return new nn(Th(e>=240?e-240:e+120,l,i),Th(e,l,i),Th(e<120?e+240:e-120,l,i),this.opacity)},clamp(){return new Hn(lb(this.h),Mo(this.s),Mo(this.l),ic(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ic(this.opacity);return`${e===1?"hsl(":"hsla("}${lb(this.h)}, ${Mo(this.s)*100}%, ${Mo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function lb(e){return e=(e||0)%360,e<0?e+360:e}function Mo(e){return Math.max(0,Math.min(1,e||0))}function Th(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Lw=e=>()=>e;function w3(e,t){return function(n){return e+n*t}}function S3(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function E3(e){return(e=+e)==1?Iw:function(t,n){return n-t?S3(t,n,e):Lw(isNaN(t)?n:t)}}function Iw(e,t){var n=t-e;return n?w3(e,n):Lw(isNaN(e)?t:e)}const sb=function e(t){var n=E3(t);function i(l,s){var o=n((l=Km(l)).r,(s=Km(s)).r),c=n(l.g,s.g),d=n(l.b,s.b),h=Iw(l.opacity,s.opacity);return function(m){return l.r=o(m),l.g=c(m),l.b=d(m),l.opacity=h(m),l+""}}return i.gamma=e,i}(1);function fi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Jm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ch=new RegExp(Jm.source,"g");function k3(e){return function(){return e}}function T3(e){return function(t){return e(t)+""}}function C3(e,t){var n=Jm.lastIndex=Ch.lastIndex=0,i,l,s,o=-1,c=[],d=[];for(e=e+"",t=t+"";(i=Jm.exec(e))&&(l=Ch.exec(t));)(s=l.index)>n&&(s=t.slice(n,s),c[o]?c[o]+=s:c[++o]=s),(i=i[0])===(l=l[0])?c[o]?c[o]+=l:c[++o]=l:(c[++o]=null,d.push({i:o,x:fi(i,l)})),n=Ch.lastIndex;return n<t.length&&(s=t.slice(n),c[o]?c[o]+=s:c[++o]=s),c.length<2?d[0]?T3(d[0].x):k3(t):(t=d.length,function(h){for(var m=0,p;m<t;++m)c[(p=d[m]).i]=p.x(h);return c.join("")})}var ub=180/Math.PI,Wm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Bw(e,t,n,i,l,s){var o,c,d;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(d=e*n+t*i)&&(n-=e*d,i-=t*d),(c=Math.sqrt(n*n+i*i))&&(n/=c,i/=c,d/=c),e*i<t*n&&(e=-e,t=-t,d=-d,o=-o),{translateX:l,translateY:s,rotate:Math.atan2(t,e)*ub,skewX:Math.atan(d)*ub,scaleX:o,scaleY:c}}var Ro;function A3(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wm:Bw(t.a,t.b,t.c,t.d,t.e,t.f)}function N3(e){return e==null||(Ro||(Ro=document.createElementNS("http://www.w3.org/2000/svg","g")),Ro.setAttribute("transform",e),!(e=Ro.transform.baseVal.consolidate()))?Wm:(e=e.matrix,Bw(e.a,e.b,e.c,e.d,e.e,e.f))}function Hw(e,t,n,i){function l(h){return h.length?h.pop()+" ":""}function s(h,m,p,y,v,b){if(h!==p||m!==y){var _=v.push("translate(",null,t,null,n);b.push({i:_-4,x:fi(h,p)},{i:_-2,x:fi(m,y)})}else(p||y)&&v.push("translate("+p+t+y+n)}function o(h,m,p,y){h!==m?(h-m>180?m+=360:m-h>180&&(h+=360),y.push({i:p.push(l(p)+"rotate(",null,i)-2,x:fi(h,m)})):m&&p.push(l(p)+"rotate("+m+i)}function c(h,m,p,y){h!==m?y.push({i:p.push(l(p)+"skewX(",null,i)-2,x:fi(h,m)}):m&&p.push(l(p)+"skewX("+m+i)}function d(h,m,p,y,v,b){if(h!==p||m!==y){var _=v.push(l(v)+"scale(",null,",",null,")");b.push({i:_-4,x:fi(h,p)},{i:_-2,x:fi(m,y)})}else(p!==1||y!==1)&&v.push(l(v)+"scale("+p+","+y+")")}return function(h,m){var p=[],y=[];return h=e(h),m=e(m),s(h.translateX,h.translateY,m.translateX,m.translateY,p,y),o(h.rotate,m.rotate,p,y),c(h.skewX,m.skewX,p,y),d(h.scaleX,h.scaleY,m.scaleX,m.scaleY,p,y),h=m=null,function(v){for(var b=-1,_=y.length,S;++b<_;)p[(S=y[b]).i]=S.x(v);return p.join("")}}}var O3=Hw(A3,"px, ","px)","deg)"),M3=Hw(N3,", ",")",")"),R3=1e-12;function ob(e){return((e=Math.exp(e))+1/e)/2}function z3(e){return((e=Math.exp(e))-1/e)/2}function D3(e){return((e=Math.exp(2*e))-1)/(e+1)}const j3=function e(t,n,i){function l(s,o){var c=s[0],d=s[1],h=s[2],m=o[0],p=o[1],y=o[2],v=m-c,b=p-d,_=v*v+b*b,S,k;if(_<R3)k=Math.log(y/h)/t,S=function(U){return[c+U*v,d+U*b,h*Math.exp(t*U*k)]};else{var A=Math.sqrt(_),E=(y*y-h*h+i*_)/(2*h*n*A),O=(y*y-h*h-i*_)/(2*y*n*A),D=Math.log(Math.sqrt(E*E+1)-E),M=Math.log(Math.sqrt(O*O+1)-O);k=(M-D)/t,S=function(U){var L=U*k,q=ob(D),N=h/(n*A)*(q*D3(t*L+D)-z3(D));return[c+N*v,d+N*b,h*q/ob(t*L+D)]}}return S.duration=k*1e3*t/Math.SQRT2,S}return l.rho=function(s){var o=Math.max(.001,+s),c=o*o,d=c*c;return e(o,c,d)},l}(Math.SQRT2,2,4);var Ka=0,ws=0,gs=0,Uw=1e3,ac,Ss,lc=0,Fi=0,wc=0,Hs=typeof performance=="object"&&performance.now?performance:Date,qw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zp(){return Fi||(qw(L3),Fi=Hs.now()+wc)}function L3(){Fi=0}function sc(){this._call=this._time=this._next=null}sc.prototype=Pw.prototype={constructor:sc,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?zp():+n)+(t==null?0:+t),!this._next&&Ss!==this&&(Ss?Ss._next=this:ac=this,Ss=this),this._call=e,this._time=n,ep()},stop:function(){this._call&&(this._call=null,this._time=1/0,ep())}};function Pw(e,t,n){var i=new sc;return i.restart(e,t,n),i}function I3(){zp(),++Ka;for(var e=ac,t;e;)(t=Fi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ka}function cb(){Fi=(lc=Hs.now())+wc,Ka=ws=0;try{I3()}finally{Ka=0,H3(),Fi=0}}function B3(){var e=Hs.now(),t=e-lc;t>Uw&&(wc-=t,lc=e)}function H3(){for(var e,t=ac,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ac=n);Ss=e,ep(i)}function ep(e){if(!Ka){ws&&(ws=clearTimeout(ws));var t=e-Fi;t>24?(e<1/0&&(ws=setTimeout(cb,e-Hs.now()-wc)),gs&&(gs=clearInterval(gs))):(gs||(lc=Hs.now(),gs=setInterval(B3,Uw)),Ka=1,qw(cb))}}function fb(e,t,n){var i=new sc;return t=t==null?0:+t,i.restart(l=>{i.stop(),e(l+t)},t,n),i}var U3=bc("start","end","cancel","interrupt"),q3=[],Vw=0,db=1,tp=2,Po=3,hb=4,np=5,Vo=6;function Sc(e,t,n,i,l,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;P3(e,n,{name:t,index:i,group:l,on:U3,tween:q3,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Vw})}function Dp(e,t){var n=Vn(e,t);if(n.state>Vw)throw new Error("too late; already scheduled");return n}function ir(e,t){var n=Vn(e,t);if(n.state>Po)throw new Error("too late; already running");return n}function Vn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function P3(e,t,n){var i=e.__transition,l;i[t]=n,n.timer=Pw(s,0,n.time);function s(h){n.state=db,n.timer.restart(o,n.delay,n.time),n.delay<=h&&o(h-n.delay)}function o(h){var m,p,y,v;if(n.state!==db)return d();for(m in i)if(v=i[m],v.name===n.name){if(v.state===Po)return fb(o);v.state===hb?(v.state=Vo,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete i[m]):+m<t&&(v.state=Vo,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete i[m])}if(fb(function(){n.state===Po&&(n.state=hb,n.timer.restart(c,n.delay,n.time),c(h))}),n.state=tp,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tp){for(n.state=Po,l=new Array(y=n.tween.length),m=0,p=-1;m<y;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(l[++p]=v);l.length=p+1}}function c(h){for(var m=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(d),n.state=np,1),p=-1,y=l.length;++p<y;)l[p].call(e,m);n.state===np&&(n.on.call("end",e,e.__data__,n.index,n.group),d())}function d(){n.state=Vo,n.timer.stop(),delete i[t];for(var h in i)return;delete e.__transition}}function $o(e,t){var n=e.__transition,i,l,s=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((i=n[o]).name!==t){s=!1;continue}l=i.state>tp&&i.state<np,i.state=Vo,i.timer.stop(),i.on.call(l?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[o]}s&&delete e.__transition}}function V3(e){return this.each(function(){$o(this,e)})}function $3(e,t){var n,i;return function(){var l=ir(this,e),s=l.tween;if(s!==n){i=n=s;for(var o=0,c=i.length;o<c;++o)if(i[o].name===t){i=i.slice(),i.splice(o,1);break}}l.tween=i}}function Z3(e,t,n){var i,l;if(typeof n!="function")throw new Error;return function(){var s=ir(this,e),o=s.tween;if(o!==i){l=(i=o).slice();for(var c={name:t,value:n},d=0,h=l.length;d<h;++d)if(l[d].name===t){l[d]=c;break}d===h&&l.push(c)}s.tween=l}}function Y3(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=Vn(this.node(),n).tween,l=0,s=i.length,o;l<s;++l)if((o=i[l]).name===e)return o.value;return null}return this.each((t==null?$3:Z3)(n,e,t))}function jp(e,t,n){var i=e._id;return e.each(function(){var l=ir(this,i);(l.value||(l.value={}))[t]=n.apply(this,arguments)}),function(l){return Vn(l,i).value[t]}}function $w(e,t){var n;return(typeof t=="number"?fi:t instanceof Bs?sb:(n=Bs(t))?(t=n,sb):C3)(e,t)}function F3(e){return function(){this.removeAttribute(e)}}function G3(e){return function(){this.removeAttributeNS(e.space,e.local)}}function X3(e,t,n){var i,l=n+"",s;return function(){var o=this.getAttribute(e);return o===l?null:o===i?s:s=t(i=o,n)}}function Q3(e,t,n){var i,l=n+"",s;return function(){var o=this.getAttributeNS(e.space,e.local);return o===l?null:o===i?s:s=t(i=o,n)}}function K3(e,t,n){var i,l,s;return function(){var o,c=n(this),d;return c==null?void this.removeAttribute(e):(o=this.getAttribute(e),d=c+"",o===d?null:o===i&&d===l?s:(l=d,s=t(i=o,c)))}}function J3(e,t,n){var i,l,s;return function(){var o,c=n(this),d;return c==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),d=c+"",o===d?null:o===i&&d===l?s:(l=d,s=t(i=o,c)))}}function W3(e,t){var n=_c(e),i=n==="transform"?M3:$w;return this.attrTween(e,typeof t=="function"?(n.local?J3:K3)(n,i,jp(this,"attr."+e,t)):t==null?(n.local?G3:F3)(n):(n.local?Q3:X3)(n,i,t))}function ej(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function tj(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function nj(e,t){var n,i;function l(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&tj(e,s)),n}return l._value=t,l}function rj(e,t){var n,i;function l(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&ej(e,s)),n}return l._value=t,l}function ij(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var i=_c(e);return this.tween(n,(i.local?nj:rj)(i,t))}function aj(e,t){return function(){Dp(this,e).delay=+t.apply(this,arguments)}}function lj(e,t){return t=+t,function(){Dp(this,e).delay=t}}function sj(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?aj:lj)(t,e)):Vn(this.node(),t).delay}function uj(e,t){return function(){ir(this,e).duration=+t.apply(this,arguments)}}function oj(e,t){return t=+t,function(){ir(this,e).duration=t}}function cj(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?uj:oj)(t,e)):Vn(this.node(),t).duration}function fj(e,t){if(typeof t!="function")throw new Error;return function(){ir(this,e).ease=t}}function dj(e){var t=this._id;return arguments.length?this.each(fj(t,e)):Vn(this.node(),t).ease}function hj(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ir(this,e).ease=n}}function mj(e){if(typeof e!="function")throw new Error;return this.each(hj(this._id,e))}function pj(e){typeof e!="function"&&(e=_w(e));for(var t=this._groups,n=t.length,i=new Array(n),l=0;l<n;++l)for(var s=t[l],o=s.length,c=i[l]=[],d,h=0;h<o;++h)(d=s[h])&&e.call(d,d.__data__,h,s)&&c.push(d);return new Nr(i,this._parents,this._name,this._id)}function gj(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,l=n.length,s=Math.min(i,l),o=new Array(i),c=0;c<s;++c)for(var d=t[c],h=n[c],m=d.length,p=o[c]=new Array(m),y,v=0;v<m;++v)(y=d[v]||h[v])&&(p[v]=y);for(;c<i;++c)o[c]=t[c];return new Nr(o,this._parents,this._name,this._id)}function yj(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function vj(e,t,n){var i,l,s=yj(t)?Dp:ir;return function(){var o=s(this,e),c=o.on;c!==i&&(l=(i=c).copy()).on(t,n),o.on=l}}function xj(e,t){var n=this._id;return arguments.length<2?Vn(this.node(),n).on.on(e):this.each(vj(n,e,t))}function bj(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _j(){return this.on("end.remove",bj(this._id))}function wj(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Op(e));for(var i=this._groups,l=i.length,s=new Array(l),o=0;o<l;++o)for(var c=i[o],d=c.length,h=s[o]=new Array(d),m,p,y=0;y<d;++y)(m=c[y])&&(p=e.call(m,m.__data__,y,c))&&("__data__"in m&&(p.__data__=m.__data__),h[y]=p,Sc(h[y],t,n,y,h,Vn(m,n)));return new Nr(s,this._parents,t,n)}function Sj(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bw(e));for(var i=this._groups,l=i.length,s=[],o=[],c=0;c<l;++c)for(var d=i[c],h=d.length,m,p=0;p<h;++p)if(m=d[p]){for(var y=e.call(m,m.__data__,p,d),v,b=Vn(m,n),_=0,S=y.length;_<S;++_)(v=y[_])&&Sc(v,t,n,_,y,b);s.push(y),o.push(m)}return new Nr(s,o,t,n)}var Ej=Xs.prototype.constructor;function kj(){return new Ej(this._groups,this._parents)}function Tj(e,t){var n,i,l;return function(){var s=Qa(this,e),o=(this.style.removeProperty(e),Qa(this,e));return s===o?null:s===n&&o===i?l:l=t(n=s,i=o)}}function Zw(e){return function(){this.style.removeProperty(e)}}function Cj(e,t,n){var i,l=n+"",s;return function(){var o=Qa(this,e);return o===l?null:o===i?s:s=t(i=o,n)}}function Aj(e,t,n){var i,l,s;return function(){var o=Qa(this,e),c=n(this),d=c+"";return c==null&&(d=c=(this.style.removeProperty(e),Qa(this,e))),o===d?null:o===i&&d===l?s:(l=d,s=t(i=o,c))}}function Nj(e,t){var n,i,l,s="style."+t,o="end."+s,c;return function(){var d=ir(this,e),h=d.on,m=d.value[s]==null?c||(c=Zw(t)):void 0;(h!==n||l!==m)&&(i=(n=h).copy()).on(o,l=m),d.on=i}}function Oj(e,t,n){var i=(e+="")=="transform"?O3:$w;return t==null?this.styleTween(e,Tj(e,i)).on("end.style."+e,Zw(e)):typeof t=="function"?this.styleTween(e,Aj(e,i,jp(this,"style."+e,t))).each(Nj(this._id,e)):this.styleTween(e,Cj(e,i,t),n).on("end.style."+e,null)}function Mj(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function Rj(e,t,n){var i,l;function s(){var o=t.apply(this,arguments);return o!==l&&(i=(l=o)&&Mj(e,o,n)),i}return s._value=t,s}function zj(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,Rj(e,t,n??""))}function Dj(e){return function(){this.textContent=e}}function jj(e){return function(){var t=e(this);this.textContent=t??""}}function Lj(e){return this.tween("text",typeof e=="function"?jj(jp(this,"text",e)):Dj(e==null?"":e+""))}function Ij(e){return function(t){this.textContent=e.call(this,t)}}function Bj(e){var t,n;function i(){var l=e.apply(this,arguments);return l!==n&&(t=(n=l)&&Ij(l)),t}return i._value=e,i}function Hj(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Bj(e))}function Uj(){for(var e=this._name,t=this._id,n=Yw(),i=this._groups,l=i.length,s=0;s<l;++s)for(var o=i[s],c=o.length,d,h=0;h<c;++h)if(d=o[h]){var m=Vn(d,t);Sc(d,e,n,h,o,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Nr(i,this._parents,e,n)}function qj(){var e,t,n=this,i=n._id,l=n.size();return new Promise(function(s,o){var c={value:o},d={value:function(){--l===0&&s()}};n.each(function(){var h=ir(this,i),m=h.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(d)),h.on=t}),l===0&&s()})}var Pj=0;function Nr(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Yw(){return++Pj}var Er=Xs.prototype;Nr.prototype={constructor:Nr,select:wj,selectAll:Sj,selectChild:Er.selectChild,selectChildren:Er.selectChildren,filter:pj,merge:gj,selection:kj,transition:Uj,call:Er.call,nodes:Er.nodes,node:Er.node,size:Er.size,empty:Er.empty,each:Er.each,on:xj,attr:W3,attrTween:ij,style:Oj,styleTween:zj,text:Lj,textTween:Hj,remove:_j,tween:Y3,delay:sj,duration:cj,ease:dj,easeVarying:mj,end:qj,[Symbol.iterator]:Er[Symbol.iterator]};function Vj(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $j={time:null,delay:0,duration:250,ease:Vj};function Zj(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Yj(e){var t,n;e instanceof Nr?(t=e._id,e=e._name):(t=Yw(),(n=$j).time=zp(),e=e==null?null:e+"");for(var i=this._groups,l=i.length,s=0;s<l;++s)for(var o=i[s],c=o.length,d,h=0;h<c;++h)(d=o[h])&&Sc(d,e,t,h,o,n||Zj(d,t));return new Nr(i,this._parents,e,t)}Xs.prototype.interrupt=V3;Xs.prototype.transition=Yj;const zo=e=>()=>e;function Fj(e,{sourceEvent:t,target:n,transform:i,dispatch:l}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:l}})}function kr(e,t,n){this.k=e,this.x=t,this.y=n}kr.prototype={constructor:kr,scale:function(e){return e===1?this:new kr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new kr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ec=new kr(1,0,0);Fw.prototype=kr.prototype;function Fw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ec;return e.__zoom}function Ah(e){e.stopImmediatePropagation()}function ys(e){e.preventDefault(),e.stopImmediatePropagation()}function Gj(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Xj(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function mb(){return this.__zoom||Ec}function Qj(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Kj(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jj(e,t,n){var i=e.invertX(t[0][0])-n[0][0],l=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function Gw(){var e=Gj,t=Xj,n=Jj,i=Qj,l=Kj,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],c=250,d=j3,h=bc("start","zoom","end"),m,p,y,v=500,b=150,_=0,S=10;function k(R){R.property("__zoom",mb).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",N).filter(l).on("touchstart.zoom",B).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(R,$,j,P){var K=R.selection?R.selection():R;K.property("__zoom",mb),R!==K?D(R,$,j,P):K.interrupt().each(function(){M(this,arguments).event(P).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},k.scaleBy=function(R,$,j,P){k.scaleTo(R,function(){var K=this.__zoom.k,X=typeof $=="function"?$.apply(this,arguments):$;return K*X},j,P)},k.scaleTo=function(R,$,j,P){k.transform(R,function(){var K=t.apply(this,arguments),X=this.__zoom,w=j==null?O(K):typeof j=="function"?j.apply(this,arguments):j,Z=X.invert(w),te=typeof $=="function"?$.apply(this,arguments):$;return n(E(A(X,te),w,Z),K,o)},j,P)},k.translateBy=function(R,$,j,P){k.transform(R,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof j=="function"?j.apply(this,arguments):j),t.apply(this,arguments),o)},null,P)},k.translateTo=function(R,$,j,P,K){k.transform(R,function(){var X=t.apply(this,arguments),w=this.__zoom,Z=P==null?O(X):typeof P=="function"?P.apply(this,arguments):P;return n(Ec.translate(Z[0],Z[1]).scale(w.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof j=="function"?-j.apply(this,arguments):-j),X,o)},P,K)};function A(R,$){return $=Math.max(s[0],Math.min(s[1],$)),$===R.k?R:new kr($,R.x,R.y)}function E(R,$,j){var P=$[0]-j[0]*R.k,K=$[1]-j[1]*R.k;return P===R.x&&K===R.y?R:new kr(R.k,P,K)}function O(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function D(R,$,j,P){R.on("start.zoom",function(){M(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(P).end()}).tween("zoom",function(){var K=this,X=arguments,w=M(K,X).event(P),Z=t.apply(K,X),te=j==null?O(Z):typeof j=="function"?j.apply(K,X):j,C=Math.max(Z[1][0]-Z[0][0],Z[1][1]-Z[0][1]),Y=K.__zoom,Q=typeof $=="function"?$.apply(K,X):$,W=d(Y.invert(te).concat(C/Y.k),Q.invert(te).concat(C/Q.k));return function(ue){if(ue===1)ue=Q;else{var ce=W(ue),ge=C/ce[2];ue=new kr(ge,te[0]-ce[0]*ge,te[1]-ce[1]*ge)}w.zoom(null,ue)}})}function M(R,$,j){return!j&&R.__zooming||new U(R,$)}function U(R,$){this.that=R,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,$),this.taps=0}U.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,$){return this.mouse&&R!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var $=pn(this.that).datum();h.call(R,this.that,new Fj(R,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:h}),$)}};function L(R,...$){if(!e.apply(this,arguments))return;var j=M(this,$).event(R),P=this.__zoom,K=Math.max(s[0],Math.min(s[1],P.k*Math.pow(2,i.apply(this,arguments)))),X=Bn(R);if(j.wheel)(j.mouse[0][0]!==X[0]||j.mouse[0][1]!==X[1])&&(j.mouse[1]=P.invert(j.mouse[0]=X)),clearTimeout(j.wheel);else{if(P.k===K)return;j.mouse=[X,P.invert(X)],$o(this),j.start()}ys(R),j.wheel=setTimeout(w,b),j.zoom("mouse",n(E(A(P,K),j.mouse[0],j.mouse[1]),j.extent,o));function w(){j.wheel=null,j.end()}}function q(R,...$){if(y||!e.apply(this,arguments))return;var j=R.currentTarget,P=M(this,$,!0).event(R),K=pn(R.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",C,!0),X=Bn(R,j),w=R.clientX,Z=R.clientY;Mw(R.view),Ah(R),P.mouse=[X,this.__zoom.invert(X)],$o(this),P.start();function te(Y){if(ys(Y),!P.moved){var Q=Y.clientX-w,W=Y.clientY-Z;P.moved=Q*Q+W*W>_}P.event(Y).zoom("mouse",n(E(P.that.__zoom,P.mouse[0]=Bn(Y,j),P.mouse[1]),P.extent,o))}function C(Y){K.on("mousemove.zoom mouseup.zoom",null),Rw(Y.view,P.moved),ys(Y),P.event(Y).end()}}function N(R,...$){if(e.apply(this,arguments)){var j=this.__zoom,P=Bn(R.changedTouches?R.changedTouches[0]:R,this),K=j.invert(P),X=j.k*(R.shiftKey?.5:2),w=n(E(A(j,X),P,K),t.apply(this,$),o);ys(R),c>0?pn(this).transition().duration(c).call(D,w,P,R):pn(this).call(k.transform,w,P,R)}}function B(R,...$){if(e.apply(this,arguments)){var j=R.touches,P=j.length,K=M(this,$,R.changedTouches.length===P).event(R),X,w,Z,te;for(Ah(R),w=0;w<P;++w)Z=j[w],te=Bn(Z,this),te=[te,this.__zoom.invert(te),Z.identifier],K.touch0?!K.touch1&&K.touch0[2]!==te[2]&&(K.touch1=te,K.taps=0):(K.touch0=te,X=!0,K.taps=1+!!m);m&&(m=clearTimeout(m)),X&&(K.taps<2&&(p=te[0],m=setTimeout(function(){m=null},v)),$o(this),K.start())}}function H(R,...$){if(this.__zooming){var j=M(this,$).event(R),P=R.changedTouches,K=P.length,X,w,Z,te;for(ys(R),X=0;X<K;++X)w=P[X],Z=Bn(w,this),j.touch0&&j.touch0[2]===w.identifier?j.touch0[0]=Z:j.touch1&&j.touch1[2]===w.identifier&&(j.touch1[0]=Z);if(w=j.that.__zoom,j.touch1){var C=j.touch0[0],Y=j.touch0[1],Q=j.touch1[0],W=j.touch1[1],ue=(ue=Q[0]-C[0])*ue+(ue=Q[1]-C[1])*ue,ce=(ce=W[0]-Y[0])*ce+(ce=W[1]-Y[1])*ce;w=A(w,Math.sqrt(ue/ce)),Z=[(C[0]+Q[0])/2,(C[1]+Q[1])/2],te=[(Y[0]+W[0])/2,(Y[1]+W[1])/2]}else if(j.touch0)Z=j.touch0[0],te=j.touch0[1];else return;j.zoom("touch",n(E(w,Z,te),j.extent,o))}}function F(R,...$){if(this.__zooming){var j=M(this,$).event(R),P=R.changedTouches,K=P.length,X,w;for(Ah(R),y&&clearTimeout(y),y=setTimeout(function(){y=null},v),X=0;X<K;++X)w=P[X],j.touch0&&j.touch0[2]===w.identifier?delete j.touch0:j.touch1&&j.touch1[2]===w.identifier&&delete j.touch1;if(j.touch1&&!j.touch0&&(j.touch0=j.touch1,delete j.touch1),j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2&&(w=Bn(w,this),Math.hypot(p[0]-w[0],p[1]-w[1])<S)){var Z=pn(this).on("dblclick.zoom");Z&&Z.apply(this,arguments)}}}return k.wheelDelta=function(R){return arguments.length?(i=typeof R=="function"?R:zo(+R),k):i},k.filter=function(R){return arguments.length?(e=typeof R=="function"?R:zo(!!R),k):e},k.touchable=function(R){return arguments.length?(l=typeof R=="function"?R:zo(!!R),k):l},k.extent=function(R){return arguments.length?(t=typeof R=="function"?R:zo([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),k):t},k.scaleExtent=function(R){return arguments.length?(s[0]=+R[0],s[1]=+R[1],k):[s[0],s[1]]},k.translateExtent=function(R){return arguments.length?(o[0][0]=+R[0][0],o[1][0]=+R[1][0],o[0][1]=+R[0][1],o[1][1]=+R[1][1],k):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},k.constrain=function(R){return arguments.length?(n=R,k):n},k.duration=function(R){return arguments.length?(c=+R,k):c},k.interpolate=function(R){return arguments.length?(d=R,k):d},k.on=function(){var R=h.on.apply(h,arguments);return R===h?k:R},k.clickDistance=function(R){return arguments.length?(_=(R=+R)*R,k):Math.sqrt(_)},k.tapDistance=function(R){return arguments.length?(S=+R,k):S},k}const nr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Us=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Xw=["Enter"," ","Escape"];var Ja;(function(e){e.Strict="strict",e.Loose="loose"})(Ja||(Ja={}));var $i;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})($i||($i={}));var qs;(function(e){e.Partial="partial",e.Full="full"})(qs||(qs={}));const Qw={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var di;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(di||(di={}));var uc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(uc||(uc={}));var Ae;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ae||(Ae={}));const pb={[Ae.Left]:Ae.Right,[Ae.Right]:Ae.Left,[Ae.Top]:Ae.Bottom,[Ae.Bottom]:Ae.Top};function Kw(e){return e===null?null:e?"valid":"invalid"}const Jw=e=>"id"in e&&"source"in e&&"target"in e,Wj=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Lp=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ks=(e,t=[0,0])=>{const{width:n,height:i}=Mr(e),l=e.origin??t,s=n*l[0],o=i*l[1];return{x:e.position.x-s,y:e.position.y-o}},e9=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,l)=>{const s=typeof l=="string";let o=!t.nodeLookup&&!s?l:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(l):Lp(l)?l:t.nodeLookup.get(l.id));const c=o?oc(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return kc(i,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Tc(n)},Js=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(i=>{if(t.filter===void 0||t.filter(i)){const l=oc(i);n=kc(n,l)}}),Tc(n)},Ww=(e,t,[n,i,l]=[0,0,1],s=!1,o=!1)=>{const c={...Ws(t,[n,i,l]),width:t.width/l,height:t.height/l},d=[];for(const h of e.values()){const{measured:m,selectable:p=!0,hidden:y=!1}=h;if(o&&!p||y)continue;const v=m.width??h.width??h.initialWidth??null,b=m.height??h.height??h.initialHeight??null,_=Ps(c,el(h)),S=(v??0)*(b??0),k=s&&_>0;(!h.internals.handleBounds||k||_>=S||h.dragging)&&d.push(h)}return d},t9=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function n9(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(l=>l.id)):null;return e.forEach(l=>{l.measured.width&&l.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!l.hidden)&&(!i||i.has(l.id))&&n.set(l.id,l)}),n}async function r9({nodes:e,width:t,height:n,panZoom:i,minZoom:l,maxZoom:s},o){if(e.size===0)return Promise.resolve(!0);const c=n9(e,o),d=Js(c),h=Ip(d,t,n,(o==null?void 0:o.minZoom)??l,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await i.setViewport(h,{duration:o==null?void 0:o.duration}),Promise.resolve(!0)}function eS({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:l,onError:s}){const o=n.get(e),c=o.parentId?n.get(o.parentId):void 0,{x:d,y:h}=c?c.internals.positionAbsolute:{x:0,y:0},m=o.origin??i;let p=l;if(o.extent==="parent"&&!o.expandParent)if(!c)s==null||s("005",nr.error005());else{const v=c.measured.width,b=c.measured.height;v&&b&&(p=[[d,h],[d+v,h+b]])}else c&&tl(o.extent)&&(p=[[o.extent[0][0]+d,o.extent[0][1]+h],[o.extent[1][0]+d,o.extent[1][1]+h]]);const y=tl(p)?Gi(t,p,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",nr.error015())),{position:{x:y.x-d+(o.measured.width??0)*m[0],y:y.y-h+(o.measured.height??0)*m[1]},positionAbsolute:y}}async function i9({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:l}){const s=new Set(e.map(y=>y.id)),o=[];for(const y of n){if(y.deletable===!1)continue;const v=s.has(y.id),b=!v&&y.parentId&&o.find(_=>_.id===y.parentId);(v||b)&&o.push(y)}const c=new Set(t.map(y=>y.id)),d=i.filter(y=>y.deletable!==!1),m=t9(o,d);for(const y of d)c.has(y.id)&&!m.find(b=>b.id===y.id)&&m.push(y);if(!l)return{edges:m,nodes:o};const p=await l({nodes:o,edges:m});return typeof p=="boolean"?p?{edges:m,nodes:o}:{edges:[],nodes:[]}:p}const Wa=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Gi=(e={x:0,y:0},t,n)=>({x:Wa(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Wa(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function tS(e,t,n){const{width:i,height:l}=Mr(n),{x:s,y:o}=n.internals.positionAbsolute;return Gi(e,[[s,o],[s+i,o+l]],t)}const gb=(e,t,n)=>e<t?Wa(Math.abs(e-t),1,t)/t:e>n?-Wa(Math.abs(e-n),1,t)/t:0,nS=(e,t,n=15,i=40)=>{const l=gb(e.x,i,t.width-i)*n,s=gb(e.y,i,t.height-i)*n;return[l,s]},kc=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),rp=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),Tc=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),el=(e,t=[0,0])=>{var l,s;const{x:n,y:i}=Lp(e)?e.internals.positionAbsolute:Ks(e,t);return{x:n,y:i,width:((l=e.measured)==null?void 0:l.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},oc=(e,t=[0,0])=>{var l,s;const{x:n,y:i}=Lp(e)?e.internals.positionAbsolute:Ks(e,t);return{x:n,y:i,x2:n+(((l=e.measured)==null?void 0:l.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},rS=(e,t)=>Tc(kc(rp(e),rp(t))),Ps=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},yb=e=>Un(e.width)&&Un(e.height)&&Un(e.x)&&Un(e.y),Un=e=>!isNaN(e)&&isFinite(e),a9=(e,t)=>{},Cc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ws=({x:e,y:t},[n,i,l],s=!1,o=[1,1])=>{const c={x:(e-n)/l,y:(t-i)/l};return s?Cc(c,o):c},cc=({x:e,y:t},[n,i,l])=>({x:e*l+n,y:t*l+i});function La(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function l9(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=La(e,n),l=La(e,t);return{top:i,right:l,bottom:i,left:l,x:l*2,y:i*2}}if(typeof e=="object"){const i=La(e.top??e.y??0,n),l=La(e.bottom??e.y??0,n),s=La(e.left??e.x??0,t),o=La(e.right??e.x??0,t);return{top:i,right:o,bottom:l,left:s,x:s+o,y:i+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function s9(e,t,n,i,l,s){const{x:o,y:c}=cc(e,[t,n,i]),{x:d,y:h}=cc({x:e.x+e.width,y:e.y+e.height},[t,n,i]),m=l-d,p=s-h;return{left:Math.floor(o),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(p)}}const Ip=(e,t,n,i,l,s)=>{const o=l9(s,t,n),c=(t-o.x)/e.width,d=(n-o.y)/e.height,h=Math.min(c,d),m=Wa(h,i,l),p=e.x+e.width/2,y=e.y+e.height/2,v=t/2-p*m,b=n/2-y*m,_=s9(e,v,b,m,t,n),S={left:Math.min(_.left-o.left,0),top:Math.min(_.top-o.top,0),right:Math.min(_.right-o.right,0),bottom:Math.min(_.bottom-o.bottom,0)};return{x:v-S.left+S.right,y:b-S.top+S.bottom,zoom:m}},fc=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function tl(e){return e!==void 0&&e!=="parent"}function Mr(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function iS(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function aS(e,t={width:0,height:0},n,i,l){const s={...e},o=i.get(n);if(o){const c=o.origin||l;s.x+=o.internals.positionAbsolute.x-(t.width??0)*c[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*c[1]}return s}function vb(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function u9(){let e,t;return{promise:new Promise((i,l)=>{e=i,t=l}),resolve:e,reject:t}}function Cs(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:l}){const{x:s,y:o}=Cr(e),c=Ws({x:s-((l==null?void 0:l.left)??0),y:o-((l==null?void 0:l.top)??0)},i),{x:d,y:h}=n?Cc(c,t):c;return{xSnapped:d,ySnapped:h,...c}}const Bp=e=>({width:e.offsetWidth,height:e.offsetHeight}),lS=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},o9=["INPUT","SELECT","TEXTAREA"];function sS(e){var i,l;const t=((l=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:l[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:o9.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const uS=e=>"clientX"in e,Cr=(e,t)=>{var s,o;const n=uS(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,l=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:l-((t==null?void 0:t.top)??0)}},xb=(e,t,n,i,l)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const c=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:l,position:o.getAttribute("data-handlepos"),x:(c.left-n.left)/i,y:(c.top-n.top)/i,...Bp(o)}})};function oS({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:l,sourceControlY:s,targetControlX:o,targetControlY:c}){const d=e*.125+l*.375+o*.375+n*.125,h=t*.125+s*.375+c*.375+i*.125,m=Math.abs(d-e),p=Math.abs(h-t);return[d,h,m,p]}function Do(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function bb({pos:e,x1:t,y1:n,x2:i,y2:l,c:s}){switch(e){case Ae.Left:return[t-Do(t-i,s),n];case Ae.Right:return[t+Do(i-t,s),n];case Ae.Top:return[t,n-Do(n-l,s)];case Ae.Bottom:return[t,n+Do(l-n,s)]}}function cS({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:i,targetY:l,targetPosition:s=Ae.Top,curvature:o=.25}){const[c,d]=bb({pos:n,x1:e,y1:t,x2:i,y2:l,c:o}),[h,m]=bb({pos:s,x1:i,y1:l,x2:e,y2:t,c:o}),[p,y,v,b]=oS({sourceX:e,sourceY:t,targetX:i,targetY:l,sourceControlX:c,sourceControlY:d,targetControlX:h,targetControlY:m});return[`M${e},${t} C${c},${d} ${h},${m} ${i},${l}`,p,y,v,b]}function fS({sourceX:e,sourceY:t,targetX:n,targetY:i}){const l=Math.abs(n-e)/2,s=n<e?n+l:n-l,o=Math.abs(i-t)/2,c=i<t?i+o:i-o;return[s,c,l,o]}function c9({sourceNode:e,targetNode:t,selected:n=!1,zIndex:i=0,elevateOnSelect:l=!1}){if(!l)return i;const s=n||t.selected||e.selected,o=Math.max(e.internals.z||0,t.internals.z||0,1e3);return i+(s?o:0)}function f9({sourceNode:e,targetNode:t,width:n,height:i,transform:l}){const s=kc(oc(e),oc(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const o={x:-l[0]/l[2],y:-l[1]/l[2],width:n/l[2],height:i/l[2]};return Ps(o,Tc(s))>0}const d9=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,h9=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),m9=(e,t)=>{if(!e.source||!e.target)return t;let n;return Jw(e)?n={...e}:n={...e,id:d9(e)},h9(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function dS({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[l,s,o,c]=fS({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,l,s,o,c]}const _b={[Ae.Left]:{x:-1,y:0},[Ae.Right]:{x:1,y:0},[Ae.Top]:{x:0,y:-1},[Ae.Bottom]:{x:0,y:1}},p9=({source:e,sourcePosition:t=Ae.Bottom,target:n})=>t===Ae.Left||t===Ae.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},wb=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function g9({source:e,sourcePosition:t=Ae.Bottom,target:n,targetPosition:i=Ae.Top,center:l,offset:s}){const o=_b[t],c=_b[i],d={x:e.x+o.x*s,y:e.y+o.y*s},h={x:n.x+c.x*s,y:n.y+c.y*s},m=p9({source:d,sourcePosition:t,target:h}),p=m.x!==0?"x":"y",y=m[p];let v=[],b,_;const S={x:0,y:0},k={x:0,y:0},[A,E,O,D]=fS({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[p]*c[p]===-1){b=l.x??A,_=l.y??E;const U=[{x:b,y:d.y},{x:b,y:h.y}],L=[{x:d.x,y:_},{x:h.x,y:_}];o[p]===y?v=p==="x"?U:L:v=p==="x"?L:U}else{const U=[{x:d.x,y:h.y}],L=[{x:h.x,y:d.y}];if(p==="x"?v=o.x===y?L:U:v=o.y===y?U:L,t===i){const F=Math.abs(e[p]-n[p]);if(F<=s){const R=Math.min(s-1,s-F);o[p]===y?S[p]=(d[p]>e[p]?-1:1)*R:k[p]=(h[p]>n[p]?-1:1)*R}}if(t!==i){const F=p==="x"?"y":"x",R=o[p]===c[F],$=d[F]>h[F],j=d[F]<h[F];(o[p]===1&&(!R&&$||R&&j)||o[p]!==1&&(!R&&j||R&&$))&&(v=p==="x"?U:L)}const q={x:d.x+S.x,y:d.y+S.y},N={x:h.x+k.x,y:h.y+k.y},B=Math.max(Math.abs(q.x-v[0].x),Math.abs(N.x-v[0].x)),H=Math.max(Math.abs(q.y-v[0].y),Math.abs(N.y-v[0].y));B>=H?(b=(q.x+N.x)/2,_=v[0].y):(b=v[0].x,_=(q.y+N.y)/2)}return[[e,{x:d.x+S.x,y:d.y+S.y},...v,{x:h.x+k.x,y:h.y+k.y},n],b,_,O,D]}function y9(e,t,n,i){const l=Math.min(wb(e,t)/2,wb(t,n)/2,i),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const h=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${s+l*h},${o}Q ${s},${o} ${s},${o+l*m}`}const c=e.x<n.x?1:-1,d=e.y<n.y?-1:1;return`L ${s},${o+l*d}Q ${s},${o} ${s+l*c},${o}`}function ip({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:i,targetY:l,targetPosition:s=Ae.Top,borderRadius:o=5,centerX:c,centerY:d,offset:h=20}){const[m,p,y,v,b]=g9({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:l},targetPosition:s,center:{x:c,y:d},offset:h});return[m.reduce((S,k,A)=>{let E="";return A>0&&A<m.length-1?E=y9(m[A-1],k,m[A+1],o):E=`${A===0?"M":"L"}${k.x} ${k.y}`,S+=E,S},""),p,y,v,b]}function Sb(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function v9(e){var p;const{sourceNode:t,targetNode:n}=e;if(!Sb(t)||!Sb(n))return null;const i=t.internals.handleBounds||Eb(t.handles),l=n.internals.handleBounds||Eb(n.handles),s=kb((i==null?void 0:i.source)??[],e.sourceHandle),o=kb(e.connectionMode===Ja.Strict?(l==null?void 0:l.target)??[]:((l==null?void 0:l.target)??[]).concat((l==null?void 0:l.source)??[]),e.targetHandle);if(!s||!o)return(p=e.onError)==null||p.call(e,"008",nr.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(s==null?void 0:s.position)||Ae.Bottom,d=(o==null?void 0:o.position)||Ae.Top,h=Vs(t,s,c),m=Vs(n,o,d);return{sourceX:h.x,sourceY:h.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:d}}function Eb(e){if(!e)return null;const t=[],n=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&n.push(i);return{source:t,target:n}}function Vs(e,t,n=Ae.Left,i=!1){const l=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,s=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:c}=t??Mr(e);if(i)return{x:l+o/2,y:s+c/2};switch((t==null?void 0:t.position)??n){case Ae.Top:return{x:l+o/2,y:s};case Ae.Right:return{x:l+o,y:s+c/2};case Ae.Bottom:return{x:l+o/2,y:s+c};case Ae.Left:return{x:l,y:s+c/2}}}function kb(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function ap(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function x9(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:l}){const s=new Set;return e.reduce((o,c)=>([c.markerStart||i,c.markerEnd||l].forEach(d=>{if(d&&typeof d=="object"){const h=ap(d,t);s.has(h)||(o.push({id:h,color:d.color||n,...d}),s.add(h))}}),o),[]).sort((o,c)=>o.id.localeCompare(c.id))}const Hp={nodeOrigin:[0,0],nodeExtent:Us,elevateNodesOnSelect:!0,defaults:{}},b9={...Hp,checkEquality:!0};function Up(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function _9(e,t,n){const i=Up(Hp,n);for(const l of e.values())if(l.parentId)qp(l,e,t,i);else{const s=Ks(l,i.nodeOrigin),o=tl(l.extent)?l.extent:i.nodeExtent,c=Gi(s,o,Mr(l));l.internals.positionAbsolute=c}}function lp(e,t,n,i){var d,h;const l=Up(b9,i);let s=e.length>0;const o=new Map(t),c=l!=null&&l.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const m of e){let p=o.get(m.id);if(l.checkEquality&&m===(p==null?void 0:p.internals.userNode))t.set(m.id,p);else{const y=Ks(m,l.nodeOrigin),v=tl(m.extent)?m.extent:l.nodeExtent,b=Gi(y,v,Mr(m));p={...l.defaults,...m,measured:{width:(d=m.measured)==null?void 0:d.width,height:(h=m.measured)==null?void 0:h.height},internals:{positionAbsolute:b,handleBounds:m.measured?p==null?void 0:p.internals.handleBounds:void 0,z:hS(m,c),userNode:m}},t.set(m.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(s=!1),m.parentId&&qp(p,t,n,i)}return s}function w9(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function qp(e,t,n,i){const{elevateNodesOnSelect:l,nodeOrigin:s,nodeExtent:o}=Up(Hp,i),c=e.parentId,d=t.get(c);if(!d){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}w9(e,n);const h=l?1e3:0,{x:m,y:p,z:y}=S9(e,d,s,o,h),{positionAbsolute:v}=e.internals,b=m!==v.x||p!==v.y;(b||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:m,y:p}:v,z:y}})}function hS(e,t){return(Un(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function S9(e,t,n,i,l){const{x:s,y:o}=t.internals.positionAbsolute,c=Mr(e),d=Ks(e,n),h=tl(e.extent)?Gi(d,e.extent,c):d;let m=Gi({x:s+h.x,y:o+h.y},i,c);e.extent==="parent"&&(m=tS(m,c,t));const p=hS(e,l),y=t.internals.z??0;return{x:m.x,y:m.y,z:y>p?y:p}}function Pp(e,t,n,i=[0,0]){var o;const l=[],s=new Map;for(const c of e){const d=t.get(c.parentId);if(!d)continue;const h=((o=s.get(c.parentId))==null?void 0:o.expandedRect)??el(d),m=rS(h,c.rect);s.set(c.parentId,{expandedRect:m,parent:d})}return s.size>0&&s.forEach(({expandedRect:c,parent:d},h)=>{var E;const m=d.internals.positionAbsolute,p=Mr(d),y=d.origin??i,v=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,b=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,_=Math.max(p.width,Math.round(c.width)),S=Math.max(p.height,Math.round(c.height)),k=(_-p.width)*y[0],A=(S-p.height)*y[1];(v>0||b>0||k||A)&&(l.push({id:h,type:"position",position:{x:d.position.x-v+k,y:d.position.y-b+A}}),(E=n.get(h))==null||E.forEach(O=>{e.some(D=>D.id===O.id)||l.push({id:O.id,type:"position",position:{x:O.position.x+v,y:O.position.y+b}})})),(p.width<c.width||p.height<c.height||v||b)&&l.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:_+(v?y[0]*v-k:0),height:S+(b?y[1]*b-A:0)}})}),l}function E9(e,t,n,i,l,s){const o=i==null?void 0:i.querySelector(".xyflow__viewport");let c=!1;if(!o)return{changes:[],updatedInternals:c};const d=[],h=window.getComputedStyle(o),{m22:m}=new window.DOMMatrixReadOnly(h.transform),p=[];for(const y of e.values()){const v=t.get(y.id);if(!v)continue;if(v.hidden){t.set(v.id,{...v,internals:{...v.internals,handleBounds:void 0}}),c=!0;continue}const b=Bp(y.nodeElement),_=v.measured.width!==b.width||v.measured.height!==b.height;if(!!(b.width&&b.height&&(_||!v.internals.handleBounds||y.force))){const k=y.nodeElement.getBoundingClientRect(),A=tl(v.extent)?v.extent:s;let{positionAbsolute:E}=v.internals;v.parentId&&v.extent==="parent"?E=tS(E,b,t.get(v.parentId)):A&&(E=Gi(E,A,b));const O={...v,measured:b,internals:{...v.internals,positionAbsolute:E,handleBounds:{source:xb("source",y.nodeElement,k,m,v.id),target:xb("target",y.nodeElement,k,m,v.id)}}};t.set(v.id,O),v.parentId&&qp(O,t,n,{nodeOrigin:l}),c=!0,_&&(d.push({id:v.id,type:"dimensions",dimensions:b}),v.expandParent&&v.parentId&&p.push({id:v.id,parentId:v.parentId,rect:el(O,l)}))}}if(p.length>0){const y=Pp(p,t,n,l);d.push(...y)}return{changes:d,updatedInternals:c}}async function k9({delta:e,panZoom:t,transform:n,translateExtent:i,width:l,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[l,s]],i),c=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(c)}function Tb(e,t,n,i,l,s){let o=l;const c=i.get(o)||new Map;i.set(o,c.set(n,t)),o=`${l}-${e}`;const d=i.get(o)||new Map;if(i.set(o,d.set(n,t)),s){o=`${l}-${e}-${s}`;const h=i.get(o)||new Map;i.set(o,h.set(n,t))}}function mS(e,t,n){e.clear(),t.clear();for(const i of n){const{source:l,target:s,sourceHandle:o=null,targetHandle:c=null}=i,d={edgeId:i.id,source:l,target:s,sourceHandle:o,targetHandle:c},h=`${l}-${o}--${s}-${c}`,m=`${s}-${c}--${l}-${o}`;Tb("source",d,m,e,l,o),Tb("target",d,h,e,s,c),t.set(i.id,i)}}function pS(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:pS(n,t):!1}function Cb(e,t,n){var l;let i=e;do{if((l=i==null?void 0:i.matches)!=null&&l.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function T9(e,t,n,i){const l=new Map;for(const[s,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!pS(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const c=e.get(s);c&&l.set(s,{id:s,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return l}function Nh({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,c,d;const l=[];for(const[h,m]of t){const p=(o=n.get(h))==null?void 0:o.internals.userNode;p&&l.push({...p,position:m.position,dragging:i})}if(!e)return[l[0],l];const s=(c=n.get(e))==null?void 0:c.internals.userNode;return[s?{...s,position:((d=t.get(e))==null?void 0:d.position)||s.position,dragging:i}:l[0],l]}function C9({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:l}){let s={x:null,y:null},o=0,c=new Map,d=!1,h={x:0,y:0},m=null,p=!1,y=null,v=!1;function b({noDragClassName:S,handleSelector:k,domNode:A,isSelectable:E,nodeId:O,nodeClickDistance:D=0}){y=pn(A);function M({x:N,y:B},H){const{nodeLookup:F,nodeExtent:R,snapGrid:$,snapToGrid:j,nodeOrigin:P,onNodeDrag:K,onSelectionDrag:X,onError:w,updateNodePositions:Z}=t();s={x:N,y:B};let te=!1,C={x:0,y:0,x2:0,y2:0};if(c.size>1&&R){const Y=Js(c);C=rp(Y)}for(const[Y,Q]of c){if(!F.has(Y))continue;let W={x:N-Q.distance.x,y:B-Q.distance.y};j&&(W=Cc(W,$));let ue=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(c.size>1&&R&&!Q.extent){const{positionAbsolute:ke}=Q.internals,we=ke.x-C.x+R[0][0],ye=ke.x+Q.measured.width-C.x2+R[1][0],Re=ke.y-C.y+R[0][1],ze=ke.y+Q.measured.height-C.y2+R[1][1];ue=[[we,Re],[ye,ze]]}const{position:ce,positionAbsolute:ge}=eS({nodeId:Y,nextPosition:W,nodeLookup:F,nodeExtent:ue,nodeOrigin:P,onError:w});te=te||Q.position.x!==ce.x||Q.position.y!==ce.y,Q.position=ce,Q.internals.positionAbsolute=ge}if(te&&(Z(c,!0),H&&(i||K||!O&&X))){const[Y,Q]=Nh({nodeId:O,dragItems:c,nodeLookup:F});i==null||i(H,c,Y,Q),K==null||K(H,Y,Q),O||X==null||X(H,Q)}}async function U(){if(!m)return;const{transform:N,panBy:B,autoPanSpeed:H,autoPanOnNodeDrag:F}=t();if(!F){d=!1,cancelAnimationFrame(o);return}const[R,$]=nS(h,m,H);(R!==0||$!==0)&&(s.x=(s.x??0)-R/N[2],s.y=(s.y??0)-$/N[2],await B({x:R,y:$})&&M(s,null)),o=requestAnimationFrame(U)}function L(N){var te;const{nodeLookup:B,multiSelectionActive:H,nodesDraggable:F,transform:R,snapGrid:$,snapToGrid:j,selectNodesOnDrag:P,onNodeDragStart:K,onSelectionDragStart:X,unselectNodesAndEdges:w}=t();p=!0,(!P||!E)&&!H&&O&&((te=B.get(O))!=null&&te.selected||w()),E&&P&&O&&(e==null||e(O));const Z=Cs(N.sourceEvent,{transform:R,snapGrid:$,snapToGrid:j,containerBounds:m});if(s=Z,c=T9(B,F,Z,O),c.size>0&&(n||K||!O&&X)){const[C,Y]=Nh({nodeId:O,dragItems:c,nodeLookup:B});n==null||n(N.sourceEvent,c,C,Y),K==null||K(N.sourceEvent,C,Y),O||X==null||X(N.sourceEvent,Y)}}const q=zw().clickDistance(D).on("start",N=>{const{domNode:B,nodeDragThreshold:H,transform:F,snapGrid:R,snapToGrid:$}=t();m=(B==null?void 0:B.getBoundingClientRect())||null,v=!1,H===0&&L(N),s=Cs(N.sourceEvent,{transform:F,snapGrid:R,snapToGrid:$,containerBounds:m}),h=Cr(N.sourceEvent,m)}).on("drag",N=>{const{autoPanOnNodeDrag:B,transform:H,snapGrid:F,snapToGrid:R,nodeDragThreshold:$,nodeLookup:j}=t(),P=Cs(N.sourceEvent,{transform:H,snapGrid:F,snapToGrid:R,containerBounds:m});if((N.sourceEvent.type==="touchmove"&&N.sourceEvent.touches.length>1||O&&!j.has(O))&&(v=!0),!v){if(!d&&B&&p&&(d=!0,U()),!p){const K=P.xSnapped-(s.x??0),X=P.ySnapped-(s.y??0);Math.sqrt(K*K+X*X)>$&&L(N)}(s.x!==P.xSnapped||s.y!==P.ySnapped)&&c&&p&&(h=Cr(N.sourceEvent,m),M(P,N.sourceEvent))}}).on("end",N=>{if(!(!p||v)&&(d=!1,p=!1,cancelAnimationFrame(o),c.size>0)){const{nodeLookup:B,updateNodePositions:H,onNodeDragStop:F,onSelectionDragStop:R}=t();if(H(c,!1),l||F||!O&&R){const[$,j]=Nh({nodeId:O,dragItems:c,nodeLookup:B,dragging:!1});l==null||l(N.sourceEvent,c,$,j),F==null||F(N.sourceEvent,$,j),O||R==null||R(N.sourceEvent,j)}}}).filter(N=>{const B=N.target;return!N.button&&(!S||!Cb(B,`.${S}`,A))&&(!k||Cb(B,k,A))});y.call(q)}function _(){y==null||y.on(".drag",null)}return{update:b,destroy:_}}function A9(e,t,n){const i=[],l={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())Ps(l,el(s))>0&&i.push(s);return i}const N9=250;function O9(e,t,n,i){var c,d;let l=[],s=1/0;const o=A9(e,n,t+N9);for(const h of o){const m=[...((c=h.internals.handleBounds)==null?void 0:c.source)??[],...((d=h.internals.handleBounds)==null?void 0:d.target)??[]];for(const p of m){if(i.nodeId===p.nodeId&&i.type===p.type&&i.id===p.id)continue;const{x:y,y:v}=Vs(h,p,p.position,!0),b=Math.sqrt(Math.pow(y-e.x,2)+Math.pow(v-e.y,2));b>t||(b<s?(l=[{...p,x:y,y:v}],s=b):b===s&&l.push({...p,x:y,y:v}))}}if(!l.length)return null;if(l.length>1){const h=i.type==="source"?"target":"source";return l.find(m=>m.type===h)??l[0]}return l[0]}function gS(e,t,n,i,l,s=!1){var h,m,p;const o=i.get(e);if(!o)return null;const c=l==="strict"?(h=o.internals.handleBounds)==null?void 0:h[t]:[...((m=o.internals.handleBounds)==null?void 0:m.source)??[],...((p=o.internals.handleBounds)==null?void 0:p.target)??[]],d=(n?c==null?void 0:c.find(y=>y.id===n):c==null?void 0:c[0])??null;return d&&s?{...d,...Vs(o,d,d.position,!0)}:d}function yS(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function M9(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const vS=()=>!0;function R9(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:l,edgeUpdaterType:s,isTarget:o,domNode:c,nodeLookup:d,lib:h,autoPanOnConnect:m,flowId:p,panBy:y,cancelConnection:v,onConnectStart:b,onConnect:_,onConnectEnd:S,isValidConnection:k=vS,onReconnectEnd:A,updateConnection:E,getTransform:O,getFromHandle:D,autoPanSpeed:M}){const U=lS(e.target);let L=0,q;const{x:N,y:B}=Cr(e),H=U==null?void 0:U.elementFromPoint(N,B),F=yS(s,H),R=c==null?void 0:c.getBoundingClientRect();if(!R||!F)return;const $=gS(l,F,i,d,t);if(!$)return;let j=Cr(e,R),P=!1,K=null,X=!1,w=null;function Z(){if(!m||!R)return;const[ge,ke]=nS(j,R,M);y({x:ge,y:ke}),L=requestAnimationFrame(Z)}const te={...$,nodeId:l,type:F,position:$.position},C=d.get(l),Q={inProgress:!0,isValid:null,from:Vs(C,te,Ae.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:C,to:j,toHandle:null,toPosition:pb[te.position],toNode:null};E(Q);let W=Q;b==null||b(e,{nodeId:l,handleId:i,handleType:F});function ue(ge){if(!D()||!te){ce(ge);return}const ke=O();j=Cr(ge,R),q=O9(Ws(j,ke,!1,[1,1]),n,d,te),P||(Z(),P=!0);const we=xS(ge,{handle:q,connectionMode:t,fromNodeId:l,fromHandleId:i,fromType:o?"target":"source",isValidConnection:k,doc:U,lib:h,flowId:p,nodeLookup:d});w=we.handleDomNode,K=we.connection,X=M9(!!q,we.isValid);const ye={...W,isValid:X,to:we.toHandle&&X?cc({x:we.toHandle.x,y:we.toHandle.y},ke):j,toHandle:we.toHandle,toPosition:X&&we.toHandle?we.toHandle.position:pb[te.position],toNode:we.toHandle?d.get(we.toHandle.nodeId):null};X&&q&&W.toHandle&&ye.toHandle&&W.toHandle.type===ye.toHandle.type&&W.toHandle.nodeId===ye.toHandle.nodeId&&W.toHandle.id===ye.toHandle.id&&W.to.x===ye.to.x&&W.to.y===ye.to.y||(E(ye),W=ye)}function ce(ge){(q||w)&&K&&X&&(_==null||_(K));const{inProgress:ke,...we}=W,ye={...we,toPosition:W.toHandle?W.toPosition:null};S==null||S(ge,ye),s&&(A==null||A(ge,ye)),v(),cancelAnimationFrame(L),P=!1,X=!1,K=null,w=null,U.removeEventListener("mousemove",ue),U.removeEventListener("mouseup",ce),U.removeEventListener("touchmove",ue),U.removeEventListener("touchend",ce)}U.addEventListener("mousemove",ue),U.addEventListener("mouseup",ce),U.addEventListener("touchmove",ue),U.addEventListener("touchend",ce)}function xS(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:l,fromType:s,doc:o,lib:c,flowId:d,isValidConnection:h=vS,nodeLookup:m}){const p=s==="target",y=t?o.querySelector(`.${c}-flow__handle[data-id="${d}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:b}=Cr(e),_=o.elementFromPoint(v,b),S=_!=null&&_.classList.contains(`${c}-flow__handle`)?_:y,k={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const A=yS(void 0,S),E=S.getAttribute("data-nodeid"),O=S.getAttribute("data-handleid"),D=S.classList.contains("connectable"),M=S.classList.contains("connectableend");if(!E||!A)return k;const U={source:p?E:i,sourceHandle:p?O:l,target:p?i:E,targetHandle:p?l:O};k.connection=U;const q=D&&M&&(n===Ja.Strict?p&&A==="source"||!p&&A==="target":E!==i||O!==l);k.isValid=q&&h(U),k.toHandle=gS(E,A,O,m,n,!0)}return k}const sp={onPointerDown:R9,isValid:xS};function z9({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const l=pn(e);function s({translateExtent:c,width:d,height:h,zoomStep:m=10,pannable:p=!0,zoomable:y=!0,inversePan:v=!1}){const b=E=>{const O=n();if(E.sourceEvent.type!=="wheel"||!t)return;const D=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*m,M=O[2]*Math.pow(2,D);t.scaleTo(M)};let _=[0,0];const S=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(_=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},k=E=>{const O=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const D=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],M=[D[0]-_[0],D[1]-_[1]];_=D;const U=i()*Math.max(O[2],Math.log(O[2]))*(v?-1:1),L={x:O[0]-M[0]*U,y:O[1]-M[1]*U},q=[[0,0],[d,h]];t.setViewportConstrained({x:L.x,y:L.y,zoom:O[2]},q,c)},A=Gw().on("start",S).on("zoom",p?k:null).on("zoom.wheel",y?b:null);l.call(A,{})}function o(){l.on("zoom",null)}return{update:s,destroy:o,pointer:Bn}}const D9=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ac=e=>({x:e.x,y:e.y,zoom:e.k}),Oh=({x:e,y:t,zoom:n})=>Ec.translate(e,t).scale(n),Ha=(e,t)=>e.target.closest(`.${t}`),bS=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Mh=(e,t=0,n=()=>{})=>{const i=typeof t=="number"&&t>0;return i||n(),i?e.transition().duration(t).on("end",n):e},_S=e=>{const t=e.ctrlKey&&fc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function j9({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:l,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:c,onPanZoom:d,onPanZoomEnd:h}){return m=>{if(Ha(m,t))return!1;m.preventDefault(),m.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(m.ctrlKey&&o){const S=Bn(m),k=_S(m),A=p*Math.pow(2,k);i.scaleTo(n,A,S,m);return}const y=m.deltaMode===1?20:1;let v=l===$i.Vertical?0:m.deltaX*y,b=l===$i.Horizontal?0:m.deltaY*y;!fc()&&m.shiftKey&&l!==$i.Vertical&&(v=m.deltaY*y,b=0),i.translateBy(n,-(v/p)*s,-(b/p)*s,{internal:!0});const _=Ac(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(m,_)),e.isPanScrolling&&(d==null||d(m,_),e.panScrollTimeout=setTimeout(()=>{h==null||h(m,_),e.isPanScrolling=!1},150))}}function L9({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,l){const s=i.type==="wheel",o=!t&&s&&!i.ctrlKey,c=Ha(i,e);if(i.ctrlKey&&s&&c&&i.preventDefault(),o||c)return null;i.preventDefault(),n.call(this,i,l)}}function I9({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,o,c;if((s=i.sourceEvent)!=null&&s.internal)return;const l=Ac(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=l,((c=i.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,l))}}function B9({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:l}){return s=>{var o,c;e.usedRightMouseButton=!!(n&&bS(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||i([s.transform.x,s.transform.y,s.transform.k]),l&&!((c=s.sourceEvent)!=null&&c.internal)&&(l==null||l(s.sourceEvent,Ac(s.transform)))}}function H9({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:l,onPaneContextMenu:s}){return o=>{var c;if(!((c=o.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,s&&bS(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),l&&D9(e.prevViewport,o.transform))){const d=Ac(o.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{l==null||l(o.sourceEvent,d)},n?150:0)}}}function U9({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:l,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:c,noPanClassName:d,lib:h}){return m=>{var b;const p=e||t,y=n&&m.ctrlKey;if(m.button===1&&m.type==="mousedown"&&(Ha(m,`${h}-flow__node`)||Ha(m,`${h}-flow__edge`)))return!0;if(!i&&!p&&!l&&!s&&!n||o||Ha(m,c)&&m.type==="wheel"||Ha(m,d)&&(m.type!=="wheel"||l&&m.type==="wheel"&&!e)||!n&&m.ctrlKey&&m.type==="wheel")return!1;if(!n&&m.type==="touchstart"&&((b=m.touches)==null?void 0:b.length)>1)return m.preventDefault(),!1;if(!p&&!l&&!y&&m.type==="wheel"||!i&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(i)&&!i.includes(m.button)&&m.type==="mousedown")return!1;const v=Array.isArray(i)&&i.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||m.type==="wheel")&&v}}function q9({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:i,translateExtent:l,viewport:s,onPanZoom:o,onPanZoomStart:c,onPanZoomEnd:d,onDraggingChange:h}){const m={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),y=Gw().clickDistance(!Un(i)||i<0?0:i).scaleExtent([t,n]).translateExtent(l),v=pn(e).call(y);E({x:s.x,y:s.y,zoom:Wa(s.zoom,t,n)},[[0,0],[p.width,p.height]],l);const b=v.on("wheel.zoom"),_=v.on("dblclick.zoom");y.wheelDelta(_S);function S(H,F){return v?new Promise(R=>{y==null||y.transform(Mh(v,F==null?void 0:F.duration,()=>R(!0)),H)}):Promise.resolve(!1)}function k({noWheelClassName:H,noPanClassName:F,onPaneContextMenu:R,userSelectionActive:$,panOnScroll:j,panOnDrag:P,panOnScrollMode:K,panOnScrollSpeed:X,preventScrolling:w,zoomOnPinch:Z,zoomOnScroll:te,zoomOnDoubleClick:C,zoomActivationKeyPressed:Y,lib:Q,onTransformChange:W}){$&&!m.isZoomingOrPanning&&A();const ce=j&&!Y&&!$?j9({zoomPanValues:m,noWheelClassName:H,d3Selection:v,d3Zoom:y,panOnScrollMode:K,panOnScrollSpeed:X,zoomOnPinch:Z,onPanZoomStart:c,onPanZoom:o,onPanZoomEnd:d}):L9({noWheelClassName:H,preventScrolling:w,d3ZoomHandler:b});if(v.on("wheel.zoom",ce,{passive:!1}),!$){const ke=I9({zoomPanValues:m,onDraggingChange:h,onPanZoomStart:c});y.on("start",ke);const we=B9({zoomPanValues:m,panOnDrag:P,onPaneContextMenu:!!R,onPanZoom:o,onTransformChange:W});y.on("zoom",we);const ye=H9({zoomPanValues:m,panOnDrag:P,panOnScroll:j,onPaneContextMenu:R,onPanZoomEnd:d,onDraggingChange:h});y.on("end",ye)}const ge=U9({zoomActivationKeyPressed:Y,panOnDrag:P,zoomOnScroll:te,panOnScroll:j,zoomOnDoubleClick:C,zoomOnPinch:Z,userSelectionActive:$,noPanClassName:F,noWheelClassName:H,lib:Q});y.filter(ge),C?v.on("dblclick.zoom",_):v.on("dblclick.zoom",null)}function A(){y.on("zoom",null)}async function E(H,F,R){const $=Oh(H),j=y==null?void 0:y.constrain()($,F,R);return j&&await S(j),new Promise(P=>P(j))}async function O(H,F){const R=Oh(H);return await S(R,F),new Promise($=>$(R))}function D(H){if(v){const F=Oh(H),R=v.property("__zoom");(R.k!==H.zoom||R.x!==H.x||R.y!==H.y)&&(y==null||y.transform(v,F,null,{sync:!0}))}}function M(){const H=v?Fw(v.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}function U(H,F){return v?new Promise(R=>{y==null||y.scaleTo(Mh(v,F==null?void 0:F.duration,()=>R(!0)),H)}):Promise.resolve(!1)}function L(H,F){return v?new Promise(R=>{y==null||y.scaleBy(Mh(v,F==null?void 0:F.duration,()=>R(!0)),H)}):Promise.resolve(!1)}function q(H){y==null||y.scaleExtent(H)}function N(H){y==null||y.translateExtent(H)}function B(H){const F=!Un(H)||H<0?0:H;y==null||y.clickDistance(F)}return{update:k,destroy:A,setViewport:O,setViewportConstrained:E,getViewport:M,scaleTo:U,scaleBy:L,setScaleExtent:q,setTranslateExtent:N,syncViewport:D,setClickDistance:B}}var As;(function(e){e.Line="line",e.Handle="handle"})(As||(As={}));function P9({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:l,affectsY:s}){const o=e-t,c=n-i,d=[o>0?1:o<0?-1:0,c>0?1:c<0?-1:0];return o&&l&&(d[0]=d[0]*-1),c&&s&&(d[1]=d[1]*-1),d}function V9(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),l=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:l}}function ui(e,t){return Math.max(0,t-e)}function oi(e,t){return Math.max(0,e-t)}function jo(e,t,n){return Math.max(0,t-e,e-n)}function Ab(e,t){return e?!t:t}function $9(e,t,n,i,l,s,o,c){let{affectsX:d,affectsY:h}=t;const{isHorizontal:m,isVertical:p}=t,y=m&&p,{xSnapped:v,ySnapped:b}=n,{minWidth:_,maxWidth:S,minHeight:k,maxHeight:A}=i,{x:E,y:O,width:D,height:M,aspectRatio:U}=e;let L=Math.floor(m?v-e.pointerX:0),q=Math.floor(p?b-e.pointerY:0);const N=D+(d?-L:L),B=M+(h?-q:q),H=-s[0]*D,F=-s[1]*M;let R=jo(N,_,S),$=jo(B,k,A);if(o){let K=0,X=0;d&&L<0?K=ui(E+L+H,o[0][0]):!d&&L>0&&(K=oi(E+N+H,o[1][0])),h&&q<0?X=ui(O+q+F,o[0][1]):!h&&q>0&&(X=oi(O+B+F,o[1][1])),R=Math.max(R,K),$=Math.max($,X)}if(c){let K=0,X=0;d&&L>0?K=oi(E+L,c[0][0]):!d&&L<0&&(K=ui(E+N,c[1][0])),h&&q>0?X=oi(O+q,c[0][1]):!h&&q<0&&(X=ui(O+B,c[1][1])),R=Math.max(R,K),$=Math.max($,X)}if(l){if(m){const K=jo(N/U,k,A)*U;if(R=Math.max(R,K),o){let X=0;!d&&!h||d&&!h&&y?X=oi(O+F+N/U,o[1][1])*U:X=ui(O+F+(d?L:-L)/U,o[0][1])*U,R=Math.max(R,X)}if(c){let X=0;!d&&!h||d&&!h&&y?X=ui(O+N/U,c[1][1])*U:X=oi(O+(d?L:-L)/U,c[0][1])*U,R=Math.max(R,X)}}if(p){const K=jo(B*U,_,S)/U;if($=Math.max($,K),o){let X=0;!d&&!h||h&&!d&&y?X=oi(E+B*U+H,o[1][0])/U:X=ui(E+(h?q:-q)*U+H,o[0][0])/U,$=Math.max($,X)}if(c){let X=0;!d&&!h||h&&!d&&y?X=ui(E+B*U,c[1][0])/U:X=oi(E+(h?q:-q)*U,c[0][0])/U,$=Math.max($,X)}}}q=q+(q<0?$:-$),L=L+(L<0?R:-R),l&&(y?N>B*U?q=(Ab(d,h)?-L:L)/U:L=(Ab(d,h)?-q:q)*U:m?(q=L/U,h=d):(L=q*U,d=h));const j=d?E+L:E,P=h?O+q:O;return{width:D+(d?-L:L),height:M+(h?-q:q),x:s[0]*L*(d?-1:1)+j,y:s[1]*q*(h?-1:1)+P}}const wS={width:0,height:0,x:0,y:0},Z9={...wS,pointerX:0,pointerY:0,aspectRatio:1};function Y9(e){return[[0,0],[e.measured.width,e.measured.height]]}function F9(e,t,n){const i=t.position.x+e.position.x,l=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,c=n[0]*s,d=n[1]*o;return[[i-c,l-d],[i+s-c,l+o-d]]}function G9({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:l}){const s=pn(e);function o({controlPosition:d,boundaries:h,keepAspectRatio:m,resizeDirection:p,onResizeStart:y,onResize:v,onResizeEnd:b,shouldResize:_}){let S={...wS},k={...Z9};const A=V9(d);let E,O=null,D=[],M,U,L;const q=zw().on("start",N=>{const{nodeLookup:B,transform:H,snapGrid:F,snapToGrid:R,nodeOrigin:$,paneDomNode:j}=n();if(E=B.get(t),!E)return;O=(j==null?void 0:j.getBoundingClientRect())??null;const{xSnapped:P,ySnapped:K}=Cs(N.sourceEvent,{transform:H,snapGrid:F,snapToGrid:R,containerBounds:O});S={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},k={...S,pointerX:P,pointerY:K,aspectRatio:S.width/S.height},M=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(M=B.get(E.parentId),U=M&&E.extent==="parent"?Y9(M):void 0),D=[],L=void 0;for(const[X,w]of B)if(w.parentId===t&&(D.push({id:X,position:{...w.position},extent:w.extent}),w.extent==="parent"||w.expandParent)){const Z=F9(w,E,w.origin??$);L?L=[[Math.min(Z[0][0],L[0][0]),Math.min(Z[0][1],L[0][1])],[Math.max(Z[1][0],L[1][0]),Math.max(Z[1][1],L[1][1])]]:L=Z}y==null||y(N,{...S})}).on("drag",N=>{const{transform:B,snapGrid:H,snapToGrid:F,nodeOrigin:R}=n(),$=Cs(N.sourceEvent,{transform:B,snapGrid:H,snapToGrid:F,containerBounds:O}),j=[];if(!E)return;const{x:P,y:K,width:X,height:w}=S,Z={},te=E.origin??R,{width:C,height:Y,x:Q,y:W}=$9(k,A,$,h,m,te,U,L),ue=C!==X,ce=Y!==w,ge=Q!==P&&ue,ke=W!==K&&ce;if(!ge&&!ke&&!ue&&!ce)return;if((ge||ke||te[0]===1||te[1]===1)&&(Z.x=ge?Q:S.x,Z.y=ke?W:S.y,S.x=Z.x,S.y=Z.y,D.length>0)){const ze=Q-P,lt=W-K;for(const ot of D)ot.position={x:ot.position.x-ze+te[0]*(C-X),y:ot.position.y-lt+te[1]*(Y-w)},j.push(ot)}if((ue||ce)&&(Z.width=ue&&(!p||p==="horizontal")?C:S.width,Z.height=ce&&(!p||p==="vertical")?Y:S.height,S.width=Z.width,S.height=Z.height),M&&E.expandParent){const ze=te[0]*(Z.width??0);Z.x&&Z.x<ze&&(S.x=ze,k.x=k.x-(Z.x-ze));const lt=te[1]*(Z.height??0);Z.y&&Z.y<lt&&(S.y=lt,k.y=k.y-(Z.y-lt))}const we=P9({width:S.width,prevWidth:X,height:S.height,prevHeight:w,affectsX:A.affectsX,affectsY:A.affectsY}),ye={...S,direction:we};(_==null?void 0:_(N,ye))!==!1&&(v==null||v(N,ye),i(Z,j))}).on("end",N=>{b==null||b(N,{...S}),l==null||l({...S})});s.call(q)}function c(){s.on(".drag",null)}return{update:o,destroy:c}}var Rh={exports:{}},zh={},Dh={exports:{}},jh={};/**
193
+ * @license React
194
+ * use-sync-external-store-shim.production.js
195
+ *
196
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
197
+ *
198
+ * This source code is licensed under the MIT license found in the
199
+ * LICENSE file in the root directory of this source tree.
200
+ */var Nb;function X9(){if(Nb)return jh;Nb=1;var e=Zs();function t(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,l=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function c(p,y){var v=y(),b=i({inst:{value:v,getSnapshot:y}}),_=b[0].inst,S=b[1];return s(function(){_.value=v,_.getSnapshot=y,d(_)&&S({inst:_})},[p,v,y]),l(function(){return d(_)&&S({inst:_}),p(function(){d(_)&&S({inst:_})})},[p]),o(v),v}function d(p){var y=p.getSnapshot;p=p.value;try{var v=y();return!n(p,v)}catch{return!0}}function h(p,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return jh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,jh}var Ob;function Q9(){return Ob||(Ob=1,Dh.exports=X9()),Dh.exports}/**
201
+ * @license React
202
+ * use-sync-external-store-shim/with-selector.production.js
203
+ *
204
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
205
+ *
206
+ * This source code is licensed under the MIT license found in the
207
+ * LICENSE file in the root directory of this source tree.
208
+ */var Mb;function K9(){if(Mb)return zh;Mb=1;var e=Zs(),t=Q9();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var i=typeof Object.is=="function"?Object.is:n,l=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,c=e.useMemo,d=e.useDebugValue;return zh.useSyncExternalStoreWithSelector=function(h,m,p,y,v){var b=s(null);if(b.current===null){var _={hasValue:!1,value:null};b.current=_}else _=b.current;b=c(function(){function k(M){if(!A){if(A=!0,E=M,M=y(M),v!==void 0&&_.hasValue){var U=_.value;if(v(U,M))return O=U}return O=M}if(U=O,i(E,M))return U;var L=y(M);return v!==void 0&&v(U,L)?(E=M,U):(E=M,O=L)}var A=!1,E,O,D=p===void 0?null:p;return[function(){return k(m())},D===null?void 0:function(){return k(D())}]},[m,p,y,v]);var S=l(h,b[0],b[1]);return o(function(){_.hasValue=!0,_.value=S},[S]),d(S),S},zh}var Rb;function J9(){return Rb||(Rb=1,Rh.exports=K9()),Rh.exports}var W9=J9();const eL=yi(W9),tL={},zb=e=>{let t;const n=new Set,i=(m,p)=>{const y=typeof m=="function"?m(t):m;if(!Object.is(y,t)){const v=t;t=p??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(b=>b(t,v))}},l=()=>t,d={setState:i,getState:l,getInitialState:()=>h,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(tL?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(i,l,d);return d},nL=e=>e?zb(e):zb,{useDebugValue:rL}=TT,{useSyncExternalStoreWithSelector:iL}=eL,aL=e=>e;function SS(e,t=aL,n){const i=iL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return rL(i),i}const Db=(e,t)=>{const n=nL(e),i=(l,s=t)=>SS(n,l,s);return Object.assign(i,n),i},lL=(e,t)=>e?Db(e,t):Db;function pt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,l]of e)if(!Object.is(l,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}J1();const Nc=ie.createContext(null),sL=Nc.Provider,ES=nr.error001();function Ze(e,t){const n=ie.useContext(Nc);if(n===null)throw new Error(ES);return SS(n,e,t)}function ft(){const e=ie.useContext(Nc);if(e===null)throw new Error(ES);return ie.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const jb={display:"none"},uL={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},kS="react-flow__node-desc",TS="react-flow__edge-desc",oL="react-flow__aria-live",cL=e=>e.ariaLiveMessage;function fL({rfId:e}){const t=Ze(cL);return I.jsx("div",{id:`${oL}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:uL,children:t})}function dL({rfId:e,disableKeyboardA11y:t}){return I.jsxs(I.Fragment,{children:[I.jsxs("div",{id:`${kS}-${e}`,style:jb,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),I.jsx("div",{id:`${TS}-${e}`,style:jb,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&I.jsx(fL,{rfId:e})]})}const hL=e=>e.userSelectionActive?"none":"all",eu=ie.forwardRef(({position:e="top-left",children:t,className:n,style:i,...l},s)=>{const o=Ze(hL),c=`${e}`.split("-");return I.jsx("div",{className:Ct(["react-flow__panel",n,...c]),style:{...i,pointerEvents:o},ref:s,...l,children:t})});eu.displayName="Panel";function mL({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:I.jsx(eu,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:I.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const pL=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},Lo=e=>e.id;function gL(e,t){return pt(e.selectedNodes.map(Lo),t.selectedNodes.map(Lo))&&pt(e.selectedEdges.map(Lo),t.selectedEdges.map(Lo))}function yL({onSelectionChange:e}){const t=ft(),{selectedNodes:n,selectedEdges:i}=Ze(pL,gL);return ie.useEffect(()=>{const l={nodes:n,edges:i};e==null||e(l),t.getState().onSelectionChangeHandlers.forEach(s=>s(l))},[n,i,e]),null}const vL=e=>!!e.onSelectionChangeHandlers;function xL({onSelectionChange:e}){const t=Ze(vL);return e||t?I.jsx(yL,{onSelectionChange:e}):null}const CS=[0,0],bL={x:0,y:0,zoom:1},_L=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],Lb=[..._L,"rfId"],wL=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),Ib={translateExtent:Us,nodeOrigin:CS,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function SL(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:l,setTranslateExtent:s,setNodeExtent:o,reset:c,setDefaultNodesAndEdges:d,setPaneClickDistance:h}=Ze(wL,pt),m=ft();ie.useEffect(()=>(d(e.defaultNodes,e.defaultEdges),()=>{p.current=Ib,c()}),[]);const p=ie.useRef(Ib);return ie.useEffect(()=>{for(const y of Lb){const v=e[y],b=p.current[y];v!==b&&(typeof e[y]>"u"||(y==="nodes"?t(v):y==="edges"?n(v):y==="minZoom"?i(v):y==="maxZoom"?l(v):y==="translateExtent"?s(v):y==="nodeExtent"?o(v):y==="paneClickDistance"?h(v):y==="fitView"?m.setState({fitViewQueued:v}):y==="fitViewOptions"?m.setState({fitViewOptions:v}):m.setState({[y]:v})))}p.current=e},Lb.map(y=>e[y])),null}function Bb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function EL(e){var i;const[t,n]=ie.useState(e==="system"?null:e);return ie.useEffect(()=>{if(e!=="system"){n(e);return}const l=Bb(),s=()=>n(l!=null&&l.matches?"dark":"light");return s(),l==null||l.addEventListener("change",s),()=>{l==null||l.removeEventListener("change",s)}},[e]),t!==null?t:(i=Bb())!=null&&i.matches?"dark":"light"}const Hb=typeof document<"u"?document:null;function $s(e=null,t={target:Hb,actInsideInputWithModifier:!0}){const[n,i]=ie.useState(!1),l=ie.useRef(!1),s=ie.useRef(new Set([])),[o,c]=ie.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
209
+ `).replace(`
210
+
211
+ `,`
212
+ +`).split(`
213
+ `)),m=h.reduce((p,y)=>p.concat(...y),[]);return[h,m]}return[[],[]]},[e]);return ie.useEffect(()=>{const d=(t==null?void 0:t.target)??Hb,h=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var S,k;if(l.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!l.current||l.current&&!h)&&sS(v))return!1;const _=qb(v.code,c);if(s.current.add(v[_]),Ub(o,s.current,!1)){const A=((k=(S=v.composedPath)==null?void 0:S.call(v))==null?void 0:k[0])||v.target,E=(A==null?void 0:A.nodeName)==="BUTTON"||(A==null?void 0:A.nodeName)==="A";t.preventDefault!==!1&&(l.current||!E)&&v.preventDefault(),i(!0)}},p=v=>{const b=qb(v.code,c);Ub(o,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(v[b]),v.key==="Meta"&&s.current.clear(),l.current=!1},y=()=>{s.current.clear(),i(!1)};return d==null||d.addEventListener("keydown",m),d==null||d.addEventListener("keyup",p),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{d==null||d.removeEventListener("keydown",m),d==null||d.removeEventListener("keyup",p),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,i]),n}function Ub(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(l=>t.has(l)))}function qb(e,t){return t.includes(e)?"code":"key"}const kL=()=>{const e=ft();return ie.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,l,s],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??i,y:t.y??l,zoom:t.zoom??s},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>{const{width:l,height:s,maxZoom:o,panZoom:c}=e.getState(),d=typeof(i==null?void 0:i.zoom)<"u"?i.zoom:o,h=l/2-t*d,m=s/2-n*d;return c?(await c.setViewport({x:h,y:m,zoom:d},{duration:i==null?void 0:i.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:i,height:l,minZoom:s,maxZoom:o,panZoom:c}=e.getState(),d=Ip(t,i,l,s,o,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(d,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:l,snapToGrid:s,domNode:o}=e.getState();if(!o)return t;const{x:c,y:d}=o.getBoundingClientRect(),h={x:t.x-c,y:t.y-d},m=n.snapGrid??l,p=n.snapToGrid??s;return Ws(h,i,p,m)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:l,y:s}=i.getBoundingClientRect(),o=cc(t,n);return{x:o.x+l,y:o.y+s}}}),[])};function AS(e,t){const n=[],i=new Map,l=[];for(const s of e)if(s.type==="add"){l.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const o=i.get(s.id);o?o.push(s):i.set(s.id,[s])}for(const s of t){const o=i.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const c={...s};for(const d of o)TL(d,c);n.push(c)}return l.length&&l.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function TL(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function NS(e,t){return AS(e,t)}function OS(e,t){return AS(e,t)}function Ui(e,t){return{id:e,type:"select",selected:t}}function Ua(e,t=new Set,n=!1){const i=[];for(const[l,s]of e){const o=t.has(l);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),i.push(Ui(s.id,o)))}return i}function Pb({items:e=[],lookup:t}){var l;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const c=t.get(o.id),d=((l=c==null?void 0:c.internals)==null?void 0:l.userNode)??c;d!==void 0&&d!==o&&n.push({id:o.id,item:o,type:"replace"}),d===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function Vb(e){return{id:e.id,type:"remove"}}const $b=e=>Wj(e),CL=e=>Jw(e);function MS(e){return ie.forwardRef(e)}const AL=typeof window<"u"?ie.useLayoutEffect:ie.useEffect;function Zb(e){const[t,n]=ie.useState(BigInt(0)),[i]=ie.useState(()=>NL(()=>n(l=>l+BigInt(1))));return AL(()=>{const l=i.get();l.length&&(e(l),i.reset())},[t]),i}function NL(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const RS=ie.createContext(null);function OL({children:e}){const t=ft(),n=ie.useCallback(c=>{const{nodes:d=[],setNodes:h,hasDefaultNodes:m,onNodesChange:p,nodeLookup:y,fitViewQueued:v}=t.getState();let b=d;for(const S of c)b=typeof S=="function"?S(b):S;const _=Pb({items:b,lookup:y});m&&h(b),_.length>0?p==null||p(_):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:k,setNodes:A}=t.getState();S&&A(k)})},[]),i=Zb(n),l=ie.useCallback(c=>{const{edges:d=[],setEdges:h,hasDefaultEdges:m,onEdgesChange:p,edgeLookup:y}=t.getState();let v=d;for(const b of c)v=typeof b=="function"?b(v):b;m?h(v):p&&p(Pb({items:v,lookup:y}))},[]),s=Zb(l),o=ie.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return I.jsx(RS.Provider,{value:o,children:e})}function ML(){const e=ie.useContext(RS);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const RL=e=>!!e.panZoom;function Oc(){const e=kL(),t=ft(),n=ML(),i=Ze(RL),l=ie.useMemo(()=>{const s=p=>t.getState().nodeLookup.get(p),o=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},d=p=>{var k,A;const{nodeLookup:y,nodeOrigin:v}=t.getState(),b=$b(p)?p:y.get(p.id),_=b.parentId?aS(b.position,b.measured,b.parentId,y,v):b.position,S={...b,position:_,width:((k=b.measured)==null?void 0:k.width)??b.width,height:((A=b.measured)==null?void 0:A.height)??b.height};return el(S)},h=(p,y,v={replace:!1})=>{o(b=>b.map(_=>{if(_.id===p){const S=typeof y=="function"?y(_):y;return v.replace&&$b(S)?S:{..._,...S}}return _}))},m=(p,y,v={replace:!1})=>{c(b=>b.map(_=>{if(_.id===p){const S=typeof y=="function"?y(_):y;return v.replace&&CL(S)?S:{..._,...S}}return _}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var y;return(y=s(p))==null?void 0:y.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(y=>({...y}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:o,setEdges:c,addNodes:p=>{const y=Array.isArray(p)?p:[p];n.nodeQueue.push(v=>[...v,...y])},addEdges:p=>{const y=Array.isArray(p)?p:[p];n.edgeQueue.push(v=>[...v,...y])},toObject:()=>{const{nodes:p=[],edges:y=[],transform:v}=t.getState(),[b,_,S]=v;return{nodes:p.map(k=>({...k})),edges:y.map(k=>({...k})),viewport:{x:b,y:_,zoom:S}}},deleteElements:async({nodes:p=[],edges:y=[]})=>{const{nodes:v,edges:b,onNodesDelete:_,onEdgesDelete:S,triggerNodeChanges:k,triggerEdgeChanges:A,onDelete:E,onBeforeDelete:O}=t.getState(),{nodes:D,edges:M}=await i9({nodesToRemove:p,edgesToRemove:y,nodes:v,edges:b,onBeforeDelete:O}),U=M.length>0,L=D.length>0;if(U){const q=M.map(Vb);S==null||S(M),A(q)}if(L){const q=D.map(Vb);_==null||_(D),k(q)}return(L||U)&&(E==null||E({nodes:D,edges:M})),{deletedNodes:D,deletedEdges:M}},getIntersectingNodes:(p,y=!0,v)=>{const b=yb(p),_=b?p:d(p),S=v!==void 0;return _?(v||t.getState().nodes).filter(k=>{const A=t.getState().nodeLookup.get(k.id);if(A&&!b&&(k.id===p.id||!A.internals.positionAbsolute))return!1;const E=el(S?k:A),O=Ps(E,_);return y&&O>0||O>=_.width*_.height}):[]},isNodeIntersecting:(p,y,v=!0)=>{const _=yb(p)?p:d(p);if(!_)return!1;const S=Ps(_,y);return v&&S>0||S>=_.width*_.height},updateNode:h,updateNodeData:(p,y,v={replace:!1})=>{h(p,b=>{const _=typeof y=="function"?y(b):y;return v.replace?{...b,data:_}:{...b,data:{...b.data,..._}}},v)},updateEdge:m,updateEdgeData:(p,y,v={replace:!1})=>{m(p,b=>{const _=typeof y=="function"?y(b):y;return v.replace?{...b,data:_}:{...b,data:{...b.data,..._}}},v)},getNodesBounds:p=>{const{nodeLookup:y,nodeOrigin:v}=t.getState();return e9(p,{nodeLookup:y,nodeOrigin:v})},getHandleConnections:({type:p,id:y,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}-${p}${y?`-${y}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:p,handleId:y,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}${p?y?`-${p}-${y}`:`-${p}`:""}`))==null?void 0:b.values())??[])},fitView:async p=>{const y=t.getState().fitViewResolver??u9();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:y}),n.nodeQueue.push(v=>[...v]),y.promise}}},[]);return ie.useMemo(()=>({...l,...e,viewportInitialized:i}),[i])}const Yb=e=>e.selected,zL=typeof window<"u"?window:void 0;function DL({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ft(),{deleteElements:i}=Oc(),l=$s(e,{actInsideInputWithModifier:!1}),s=$s(t,{target:zL});ie.useEffect(()=>{if(l){const{edges:o,nodes:c}=n.getState();i({nodes:c.filter(Yb),edges:o.filter(Yb)}),n.setState({nodesSelectionActive:!1})}},[l]),ie.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function jL(e){const t=ft();ie.useEffect(()=>{const n=()=>{var l,s;if(!e.current)return!1;const i=Bp(e.current);(i.height===0||i.width===0)&&((s=(l=t.getState()).onError)==null||s.call(l,"004",nr.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const Mc={position:"absolute",width:"100%",height:"100%",top:0,left:0},LL=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function IL({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:l=.5,panOnScrollMode:s=$i.Free,zoomOnDoubleClick:o=!0,panOnDrag:c=!0,defaultViewport:d,translateExtent:h,minZoom:m,maxZoom:p,zoomActivationKeyCode:y,preventScrolling:v=!0,children:b,noWheelClassName:_,noPanClassName:S,onViewportChange:k,isControlledViewport:A,paneClickDistance:E}){const O=ft(),D=ie.useRef(null),{userSelectionActive:M,lib:U}=Ze(LL,pt),L=$s(y),q=ie.useRef();jL(D);const N=ie.useCallback(B=>{k==null||k({x:B[0],y:B[1],zoom:B[2]}),A||O.setState({transform:B})},[k,A]);return ie.useEffect(()=>{if(D.current){q.current=q9({domNode:D.current,minZoom:m,maxZoom:p,translateExtent:h,viewport:d,paneClickDistance:E,onDraggingChange:R=>O.setState({paneDragging:R}),onPanZoomStart:(R,$)=>{const{onViewportChangeStart:j,onMoveStart:P}=O.getState();P==null||P(R,$),j==null||j($)},onPanZoom:(R,$)=>{const{onViewportChange:j,onMove:P}=O.getState();P==null||P(R,$),j==null||j($)},onPanZoomEnd:(R,$)=>{const{onViewportChangeEnd:j,onMoveEnd:P}=O.getState();P==null||P(R,$),j==null||j($)}});const{x:B,y:H,zoom:F}=q.current.getViewport();return O.setState({panZoom:q.current,transform:[B,H,F],domNode:D.current.closest(".react-flow")}),()=>{var R;(R=q.current)==null||R.destroy()}}},[]),ie.useEffect(()=>{var B;(B=q.current)==null||B.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:l,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:c,zoomActivationKeyPressed:L,preventScrolling:v,noPanClassName:S,userSelectionActive:M,noWheelClassName:_,lib:U,onTransformChange:N})},[e,t,n,i,l,s,o,c,L,v,S,M,_,U,N]),I.jsx("div",{className:"react-flow__renderer",ref:D,style:Mc,children:b})}const BL=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function HL(){const{userSelectionActive:e,userSelectionRect:t}=Ze(BL,pt);return e&&t?I.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Lh=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},UL=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function qL({isSelecting:e,selectionKeyPressed:t,selectionMode:n=qs.Full,panOnDrag:i,selectionOnDrag:l,onSelectionStart:s,onSelectionEnd:o,onPaneClick:c,onPaneContextMenu:d,onPaneScroll:h,onPaneMouseEnter:m,onPaneMouseMove:p,onPaneMouseLeave:y,children:v}){const b=ft(),{userSelectionActive:_,elementsSelectable:S,dragging:k,connectionInProgress:A}=Ze(UL,pt),E=S&&(e||_),O=ie.useRef(null),D=ie.useRef(),M=ie.useRef(new Set),U=ie.useRef(new Set),L=ie.useRef(!1),q=ie.useRef(!1),N=P=>{if(L.current||A){L.current=!1;return}c==null||c(P),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},B=P=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){P.preventDefault();return}d==null||d(P)},H=h?P=>h(P):void 0,F=P=>{var te,C;const{resetSelectedElements:K,domNode:X}=b.getState();if(D.current=X==null?void 0:X.getBoundingClientRect(),!S||!e||P.button!==0||P.target!==O.current||!D.current)return;(C=(te=P.target)==null?void 0:te.setPointerCapture)==null||C.call(te,P.pointerId),q.current=!0,L.current=!1;const{x:w,y:Z}=Cr(P.nativeEvent,D.current);K(),b.setState({userSelectionRect:{width:0,height:0,startX:w,startY:Z,x:w,y:Z}}),s==null||s(P)},R=P=>{const{userSelectionRect:K,transform:X,nodeLookup:w,edgeLookup:Z,connectionLookup:te,triggerNodeChanges:C,triggerEdgeChanges:Y,defaultEdgeOptions:Q}=b.getState();if(!D.current||!K)return;L.current=!0;const{x:W,y:ue}=Cr(P.nativeEvent,D.current),{startX:ce,startY:ge}=K,ke={startX:ce,startY:ge,x:W<ce?W:ce,y:ue<ge?ue:ge,width:Math.abs(W-ce),height:Math.abs(ue-ge)},we=M.current,ye=U.current;M.current=new Set(Ww(w,ke,X,n===qs.Partial,!0).map(ze=>ze.id)),U.current=new Set;const Re=(Q==null?void 0:Q.selectable)??!0;for(const ze of M.current){const lt=te.get(ze);if(lt)for(const{edgeId:ot}of lt.values()){const xt=Z.get(ot);xt&&(xt.selectable??Re)&&U.current.add(ot)}}if(!vb(we,M.current)){const ze=Ua(w,M.current,!0);C(ze)}if(!vb(ye,U.current)){const ze=Ua(Z,U.current);Y(ze)}b.setState({userSelectionRect:ke,userSelectionActive:!0,nodesSelectionActive:!1})},$=P=>{var X,w;if(P.button!==0||!q.current)return;(w=(X=P.target)==null?void 0:X.releasePointerCapture)==null||w.call(X,P.pointerId);const{userSelectionRect:K}=b.getState();!_&&K&&P.target===O.current&&(N==null||N(P)),b.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:M.current.size>0}),o==null||o(P),(t||l)&&(L.current=!1),q.current=!1},j=i===!0||Array.isArray(i)&&i.includes(0);return I.jsxs("div",{className:Ct(["react-flow__pane",{draggable:j,dragging:k,selection:e}]),onClick:E?void 0:Lh(N,O),onContextMenu:Lh(B,O),onWheel:Lh(H,O),onPointerEnter:E?void 0:m,onPointerDown:E?F:p,onPointerMove:E?R:p,onPointerUp:E?$:void 0,onPointerLeave:y,ref:O,style:Mc,children:[v,I.jsx(HL,{})]})}function up({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:l,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:c,onError:d}=t.getState(),h=c.get(e);if(!h){d==null||d("012",nr.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&o)&&(s({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):l([e])}function zS({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:l,isSelectable:s,nodeClickDistance:o}){const c=ft(),[d,h]=ie.useState(!1),m=ie.useRef();return ie.useEffect(()=>{m.current=C9({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{up({id:p,store:c,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),ie.useEffect(()=>{var p,y;if(t)(p=m.current)==null||p.destroy();else if(e.current)return(y=m.current)==null||y.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:l,nodeClickDistance:o}),()=>{var v;(v=m.current)==null||v.destroy()}},[n,i,t,s,e,l]),d}const PL=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function DS(){const e=ft();return ie.useCallback(n=>{const{nodeExtent:i,snapToGrid:l,snapGrid:s,nodesDraggable:o,onError:c,updateNodePositions:d,nodeLookup:h,nodeOrigin:m}=e.getState(),p=new Map,y=PL(o),v=l?s[0]:5,b=l?s[1]:5,_=n.direction.x*v*n.factor,S=n.direction.y*b*n.factor;for(const[,k]of h){if(!y(k))continue;let A={x:k.internals.positionAbsolute.x+_,y:k.internals.positionAbsolute.y+S};l&&(A=Cc(A,s));const{position:E,positionAbsolute:O}=eS({nodeId:k.id,nextPosition:A,nodeLookup:h,nodeExtent:i,nodeOrigin:m,onError:c});k.position=E,k.internals.positionAbsolute=O,p.set(k.id,k)}d(p)},[])}const Vp=ie.createContext(null),VL=Vp.Provider;Vp.Consumer;const jS=()=>ie.useContext(Vp),$L=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ZL=(e,t,n)=>i=>{const{connectionClickStartHandle:l,connectionMode:s,connection:o}=i,{fromHandle:c,toHandle:d,isValid:h}=o,m=(d==null?void 0:d.nodeId)===e&&(d==null?void 0:d.id)===t&&(d==null?void 0:d.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,isPossibleEndHandle:s===Ja.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!l,valid:m&&h}};function YL({type:e="source",position:t=Ae.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:l=!0,isConnectableEnd:s=!0,id:o,onConnect:c,children:d,className:h,onMouseDown:m,onTouchStart:p,...y},v){var $,j;const b=o||null,_=e==="target",S=ft(),k=jS(),{connectOnClick:A,noPanClassName:E,rfId:O}=Ze($L,pt),{connectingFrom:D,connectingTo:M,clickConnecting:U,isPossibleEndHandle:L,connectionInProcess:q,clickConnectionInProcess:N,valid:B}=Ze(ZL(k,b,e),pt);k||(j=($=S.getState()).onError)==null||j.call($,"010",nr.error010());const H=P=>{const{defaultEdgeOptions:K,onConnect:X,hasDefaultEdges:w}=S.getState(),Z={...K,...P};if(w){const{edges:te,setEdges:C}=S.getState();C(m9(Z,te))}X==null||X(Z),c==null||c(Z)},F=P=>{if(!k)return;const K=uS(P.nativeEvent);if(l&&(K&&P.button===0||!K)){const X=S.getState();sp.onPointerDown(P.nativeEvent,{autoPanOnConnect:X.autoPanOnConnect,connectionMode:X.connectionMode,connectionRadius:X.connectionRadius,domNode:X.domNode,nodeLookup:X.nodeLookup,lib:X.lib,isTarget:_,handleId:b,nodeId:k,flowId:X.rfId,panBy:X.panBy,cancelConnection:X.cancelConnection,onConnectStart:X.onConnectStart,onConnectEnd:X.onConnectEnd,updateConnection:X.updateConnection,onConnect:H,isValidConnection:n||X.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:X.autoPanSpeed})}K?m==null||m(P):p==null||p(P)},R=P=>{const{onClickConnectStart:K,onClickConnectEnd:X,connectionClickStartHandle:w,connectionMode:Z,isValidConnection:te,lib:C,rfId:Y,nodeLookup:Q,connection:W}=S.getState();if(!k||!w&&!l)return;if(!w){K==null||K(P.nativeEvent,{nodeId:k,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:k,type:e,id:b}});return}const ue=lS(P.target),ce=n||te,{connection:ge,isValid:ke}=sp.isValid(P.nativeEvent,{handle:{nodeId:k,id:b,type:e},connectionMode:Z,fromNodeId:w.nodeId,fromHandleId:w.id||null,fromType:w.type,isValidConnection:ce,flowId:Y,doc:ue,lib:C,nodeLookup:Q});ke&&ge&&H(ge);const we=structuredClone(W);delete we.inProgress,we.toPosition=we.toHandle?we.toHandle.position:null,X==null||X(P,we),S.setState({connectionClickStartHandle:null})};return I.jsx("div",{"data-handleid":b,"data-nodeid":k,"data-handlepos":t,"data-id":`${O}-${k}-${b}-${e}`,className:Ct(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,h,{source:!_,target:_,connectable:i,connectablestart:l,connectableend:s,clickconnecting:U,connectingfrom:D,connectingto:M,valid:B,connectionindicator:i&&(!q||L)&&(q||N?s:l)}]),onMouseDown:F,onTouchStart:F,onClick:A?R:void 0,ref:v,...y,children:d})}const dc=ie.memo(MS(YL));function FL({data:e,isConnectable:t,sourcePosition:n=Ae.Bottom}){return I.jsxs(I.Fragment,{children:[e==null?void 0:e.label,I.jsx(dc,{type:"source",position:n,isConnectable:t})]})}function GL({data:e,isConnectable:t,targetPosition:n=Ae.Top,sourcePosition:i=Ae.Bottom}){return I.jsxs(I.Fragment,{children:[I.jsx(dc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,I.jsx(dc,{type:"source",position:i,isConnectable:t})]})}function XL(){return null}function QL({data:e,isConnectable:t,targetPosition:n=Ae.Top}){return I.jsxs(I.Fragment,{children:[I.jsx(dc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const hc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Fb={input:FL,default:GL,output:QL,group:XL};function KL(e){var t,n,i,l;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((l=e.style)==null?void 0:l.height)}}const JL=e=>{const{width:t,height:n,x:i,y:l}=Js(e.nodeLookup,{filter:s=>!!s.selected});return{width:Un(t)?t:null,height:Un(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${l}px)`}};function WL({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=ft(),{width:l,height:s,transformString:o,userSelectionActive:c}=Ze(JL,pt),d=DS(),h=ie.useRef(null);if(ie.useEffect(()=>{var y;n||(y=h.current)==null||y.focus({preventScroll:!0})},[n]),zS({nodeRef:h}),c||!l||!s)return null;const m=e?y=>{const v=i.getState().nodes.filter(b=>b.selected);e(y,v)}:void 0,p=y=>{Object.prototype.hasOwnProperty.call(hc,y.key)&&(y.preventDefault(),d({direction:hc[y.key],factor:y.shiftKey?4:1}))};return I.jsx("div",{className:Ct(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:I.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:l,height:s}})})}const Gb=typeof window<"u"?window:void 0,e6=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function LS({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:l,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:c,deleteKeyCode:d,selectionKeyCode:h,selectionOnDrag:m,selectionMode:p,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:_,zoomActivationKeyCode:S,elementsSelectable:k,zoomOnScroll:A,zoomOnPinch:E,panOnScroll:O,panOnScrollSpeed:D,panOnScrollMode:M,zoomOnDoubleClick:U,panOnDrag:L,defaultViewport:q,translateExtent:N,minZoom:B,maxZoom:H,preventScrolling:F,onSelectionContextMenu:R,noWheelClassName:$,noPanClassName:j,disableKeyboardA11y:P,onViewportChange:K,isControlledViewport:X}){const{nodesSelectionActive:w,userSelectionActive:Z}=Ze(e6),te=$s(h,{target:Gb}),C=$s(_,{target:Gb}),Y=C||L,Q=C||O,W=m&&Y!==!0,ue=te||Z||W;return DL({deleteKeyCode:d,multiSelectionKeyCode:b}),I.jsx(IL,{onPaneContextMenu:s,elementsSelectable:k,zoomOnScroll:A,zoomOnPinch:E,panOnScroll:Q,panOnScrollSpeed:D,panOnScrollMode:M,zoomOnDoubleClick:U,panOnDrag:!te&&Y,defaultViewport:q,translateExtent:N,minZoom:B,maxZoom:H,zoomActivationKeyCode:S,preventScrolling:F,noWheelClassName:$,noPanClassName:j,onViewportChange:K,isControlledViewport:X,paneClickDistance:c,children:I.jsxs(qL,{onSelectionStart:y,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:l,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:Y,isSelecting:!!ue,selectionMode:p,selectionKeyPressed:te,selectionOnDrag:W,children:[e,w&&I.jsx(WL,{onSelectionContextMenu:R,noPanClassName:j,disableKeyboardA11y:P})]})})}LS.displayName="FlowRenderer";const t6=ie.memo(LS),n6=e=>t=>e?Ww(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function r6(e){return Ze(ie.useCallback(n6(e),[e]),pt)}const i6=e=>e.updateNodeInternals;function a6(){const e=Ze(i6),[t]=ie.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(l=>{const s=l.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:l.target,force:!0})}),e(i)}));return ie.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function l6({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const l=ft(),s=ie.useRef(null),o=ie.useRef(null),c=ie.useRef(e.sourcePosition),d=ie.useRef(e.targetPosition),h=ie.useRef(t),m=n&&!!e.internals.handleBounds;return ie.useEffect(()=>{s.current&&!e.hidden&&(!m||o.current!==s.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(s.current),o.current=s.current)},[m,e.hidden]),ie.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.current=null)},[]),ie.useEffect(()=>{if(s.current){const p=h.current!==t,y=c.current!==e.sourcePosition,v=d.current!==e.targetPosition;(p||y||v)&&(h.current=t,c.current=e.sourcePosition,d.current=e.targetPosition,l.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function s6({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:l,onContextMenu:s,onDoubleClick:o,nodesDraggable:c,elementsSelectable:d,nodesConnectable:h,nodesFocusable:m,resizeObserver:p,noDragClassName:y,noPanClassName:v,disableKeyboardA11y:b,rfId:_,nodeTypes:S,nodeClickDistance:k,onError:A}){const{node:E,internals:O,isParent:D}=Ze(ue=>{const ce=ue.nodeLookup.get(e),ge=ue.parentLookup.has(e);return{node:ce,internals:ce.internals,isParent:ge}},pt);let M=E.type||"default",U=(S==null?void 0:S[M])||Fb[M];U===void 0&&(A==null||A("003",nr.error003(M)),M="default",U=Fb.default);const L=!!(E.draggable||c&&typeof E.draggable>"u"),q=!!(E.selectable||d&&typeof E.selectable>"u"),N=!!(E.connectable||h&&typeof E.connectable>"u"),B=!!(E.focusable||m&&typeof E.focusable>"u"),H=ft(),F=iS(E),R=l6({node:E,nodeType:M,hasDimensions:F,resizeObserver:p}),$=zS({nodeRef:R,disabled:E.hidden||!L,noDragClassName:y,handleSelector:E.dragHandle,nodeId:e,isSelectable:q,nodeClickDistance:k}),j=DS();if(E.hidden)return null;const P=Mr(E),K=KL(E),X=q||L||t||n||i||l,w=n?ue=>n(ue,{...O.userNode}):void 0,Z=i?ue=>i(ue,{...O.userNode}):void 0,te=l?ue=>l(ue,{...O.userNode}):void 0,C=s?ue=>s(ue,{...O.userNode}):void 0,Y=o?ue=>o(ue,{...O.userNode}):void 0,Q=ue=>{const{selectNodesOnDrag:ce,nodeDragThreshold:ge}=H.getState();q&&(!ce||!L||ge>0)&&up({id:e,store:H,nodeRef:R}),t&&t(ue,{...O.userNode})},W=ue=>{if(!(sS(ue.nativeEvent)||b))if(Xw.includes(ue.key)&&q){const ce=ue.key==="Escape";up({id:e,store:H,unselect:ce,nodeRef:R})}else L&&E.selected&&Object.prototype.hasOwnProperty.call(hc,ue.key)&&(ue.preventDefault(),H.setState({ariaLiveMessage:`Moved selected node ${ue.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~O.positionAbsolute.x}, y: ${~~O.positionAbsolute.y}`}),j({direction:hc[ue.key],factor:ue.shiftKey?4:1}))};return I.jsx("div",{className:Ct(["react-flow__node",`react-flow__node-${M}`,{[v]:L},E.className,{selected:E.selected,selectable:q,parent:D,draggable:L,dragging:$}]),ref:R,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:X?"all":"none",visibility:F?"visible":"hidden",...E.style,...K},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:w,onMouseMove:Z,onMouseLeave:te,onContextMenu:C,onClick:Q,onDoubleClick:Y,onKeyDown:B?W:void 0,tabIndex:B?0:void 0,role:B?"button":void 0,"aria-describedby":b?void 0:`${kS}-${_}`,"aria-label":E.ariaLabel,children:I.jsx(VL,{value:e,children:I.jsx(U,{id:e,data:E.data,type:M,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:E.selected??!1,selectable:q,draggable:L,deletable:E.deletable??!0,isConnectable:N,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:$,dragHandle:E.dragHandle,zIndex:O.z,parentId:E.parentId,...P})})})}const u6=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function IS(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:l,onError:s}=Ze(u6,pt),o=r6(e.onlyRenderVisibleElements),c=a6();return I.jsx("div",{className:"react-flow__nodes",style:Mc,children:o.map(d=>I.jsx(s6,{id:d,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:l,nodeClickDistance:e.nodeClickDistance,onError:s},d))})}IS.displayName="NodeRenderer";const o6=ie.memo(IS);function c6(e){return Ze(ie.useCallback(n=>{if(!e)return n.edges.map(l=>l.id);const i=[];if(n.width&&n.height)for(const l of n.edges){const s=n.nodeLookup.get(l.source),o=n.nodeLookup.get(l.target);s&&o&&f9({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(l.id)}return i},[e]),pt)}const f6=({color:e="none",strokeWidth:t=1})=>I.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),d6=({color:e="none",strokeWidth:t=1})=>I.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Xb={[uc.Arrow]:f6,[uc.ArrowClosed]:d6};function h6(e){const t=ft();return ie.useMemo(()=>{var l,s;return Object.prototype.hasOwnProperty.call(Xb,e)?Xb[e]:((s=(l=t.getState()).onError)==null||s.call(l,"009",nr.error009(e)),null)},[e])}const m6=({id:e,type:t,color:n,width:i=12.5,height:l=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:c="auto-start-reverse"})=>{const d=h6(t);return d?I.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0",children:I.jsx(d,{color:n,strokeWidth:o})}):null},BS=({defaultColor:e,rfId:t})=>{const n=Ze(s=>s.edges),i=Ze(s=>s.defaultEdgeOptions),l=ie.useMemo(()=>x9(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return l.length?I.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:I.jsx("defs",{children:l.map(s=>I.jsx(m6,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};BS.displayName="MarkerDefinitions";var p6=ie.memo(BS);function HS({x:e,y:t,label:n,labelStyle:i,labelShowBg:l=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:c=2,children:d,className:h,...m}){const[p,y]=ie.useState({x:1,y:0,width:0,height:0}),v=Ct(["react-flow__edge-textwrapper",h]),b=ie.useRef(null);return ie.useEffect(()=>{if(b.current){const _=b.current.getBBox();y({x:_.x,y:_.y,width:_.width,height:_.height})}},[n]),n?I.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:v,visibility:p.width?"visible":"hidden",...m,children:[l&&I.jsx("rect",{width:p.width+2*o[0],x:-o[0],y:-o[1],height:p.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),I.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:b,style:i,children:n}),d]}):null}HS.displayName="EdgeText";const g6=ie.memo(HS);function Rc({path:e,labelX:t,labelY:n,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:d,interactionWidth:h=20,...m}){return I.jsxs(I.Fragment,{children:[I.jsx("path",{...m,d:e,fill:"none",className:Ct(["react-flow__edge-path",m.className])}),h&&I.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&Un(t)&&Un(n)?I.jsx(g6,{x:t,y:n,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:d}):null]})}function Qb({pos:e,x1:t,y1:n,x2:i,y2:l}){return e===Ae.Left||e===Ae.Right?[.5*(t+i),n]:[t,.5*(n+l)]}function US({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:i,targetY:l,targetPosition:s=Ae.Top}){const[o,c]=Qb({pos:n,x1:e,y1:t,x2:i,y2:l}),[d,h]=Qb({pos:s,x1:i,y1:l,x2:e,y2:t}),[m,p,y,v]=oS({sourceX:e,sourceY:t,targetX:i,targetY:l,sourceControlX:o,sourceControlY:c,targetControlX:d,targetControlY:h});return[`M${e},${t} C${o},${c} ${d},${h} ${i},${l}`,m,p,y,v]}function qS(e){return ie.memo(({id:t,sourceX:n,sourceY:i,targetX:l,targetY:s,sourcePosition:o,targetPosition:c,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:v,style:b,markerEnd:_,markerStart:S,interactionWidth:k})=>{const[A,E,O]=US({sourceX:n,sourceY:i,sourcePosition:o,targetX:l,targetY:s,targetPosition:c}),D=e.isInternal?void 0:t;return I.jsx(Rc,{id:D,path:A,labelX:E,labelY:O,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:v,style:b,markerEnd:_,markerStart:S,interactionWidth:k})})}const y6=qS({isInternal:!1}),PS=qS({isInternal:!0});y6.displayName="SimpleBezierEdge";PS.displayName="SimpleBezierEdgeInternal";function VS(e){return ie.memo(({id:t,sourceX:n,sourceY:i,targetX:l,targetY:s,label:o,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:p,style:y,sourcePosition:v=Ae.Bottom,targetPosition:b=Ae.Top,markerEnd:_,markerStart:S,pathOptions:k,interactionWidth:A})=>{const[E,O,D]=ip({sourceX:n,sourceY:i,sourcePosition:v,targetX:l,targetY:s,targetPosition:b,borderRadius:k==null?void 0:k.borderRadius,offset:k==null?void 0:k.offset}),M=e.isInternal?void 0:t;return I.jsx(Rc,{id:M,path:E,labelX:O,labelY:D,label:o,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:p,style:y,markerEnd:_,markerStart:S,interactionWidth:A})})}const $S=VS({isInternal:!1}),ZS=VS({isInternal:!0});$S.displayName="SmoothStepEdge";ZS.displayName="SmoothStepEdgeInternal";function YS(e){return ie.memo(({id:t,...n})=>{var l;const i=e.isInternal?void 0:t;return I.jsx($S,{...n,id:i,pathOptions:ie.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(l=n.pathOptions)==null?void 0:l.offset])})})}const v6=YS({isInternal:!1}),FS=YS({isInternal:!0});v6.displayName="StepEdge";FS.displayName="StepEdgeInternal";function GS(e){return ie.memo(({id:t,sourceX:n,sourceY:i,targetX:l,targetY:s,label:o,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:p,style:y,markerEnd:v,markerStart:b,interactionWidth:_})=>{const[S,k,A]=dS({sourceX:n,sourceY:i,targetX:l,targetY:s}),E=e.isInternal?void 0:t;return I.jsx(Rc,{id:E,path:S,labelX:k,labelY:A,label:o,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:p,style:y,markerEnd:v,markerStart:b,interactionWidth:_})})}const x6=GS({isInternal:!1}),XS=GS({isInternal:!0});x6.displayName="StraightEdge";XS.displayName="StraightEdgeInternal";function QS(e){return ie.memo(({id:t,sourceX:n,sourceY:i,targetX:l,targetY:s,sourcePosition:o=Ae.Bottom,targetPosition:c=Ae.Top,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:v,style:b,markerEnd:_,markerStart:S,pathOptions:k,interactionWidth:A})=>{const[E,O,D]=cS({sourceX:n,sourceY:i,sourcePosition:o,targetX:l,targetY:s,targetPosition:c,curvature:k==null?void 0:k.curvature}),M=e.isInternal?void 0:t;return I.jsx(Rc,{id:M,path:E,labelX:O,labelY:D,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:v,style:b,markerEnd:_,markerStart:S,interactionWidth:A})})}const b6=QS({isInternal:!1}),KS=QS({isInternal:!0});b6.displayName="BezierEdge";KS.displayName="BezierEdgeInternal";const Kb={default:KS,straight:XS,step:FS,smoothstep:ZS,simplebezier:PS},Jb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},_6=(e,t,n)=>n===Ae.Left?e-t:n===Ae.Right?e+t:e,w6=(e,t,n)=>n===Ae.Top?e-t:n===Ae.Bottom?e+t:e,Wb="react-flow__edgeupdater";function e1({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:l,onMouseEnter:s,onMouseOut:o,type:c}){return I.jsx("circle",{onMouseDown:l,onMouseEnter:s,onMouseOut:o,className:Ct([Wb,`${Wb}-${c}`]),cx:_6(t,i,e),cy:w6(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function S6({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:l,targetX:s,targetY:o,sourcePosition:c,targetPosition:d,onReconnect:h,onReconnectStart:m,onReconnectEnd:p,setReconnecting:y,setUpdateHover:v}){const b=ft(),_=(O,D)=>{if(O.button!==0)return;const{autoPanOnConnect:M,domNode:U,isValidConnection:L,connectionMode:q,connectionRadius:N,lib:B,onConnectStart:H,onConnectEnd:F,cancelConnection:R,nodeLookup:$,rfId:j,panBy:P,updateConnection:K}=b.getState(),X=D.type==="target";y(!0),m==null||m(O,n,D.type);const w=(te,C)=>{y(!1),p==null||p(te,n,D.type,C)},Z=te=>h==null?void 0:h(n,te);sp.onPointerDown(O.nativeEvent,{autoPanOnConnect:M,connectionMode:q,connectionRadius:N,domNode:U,handleId:D.id,nodeId:D.nodeId,nodeLookup:$,isTarget:X,edgeUpdaterType:D.type,lib:B,flowId:j,cancelConnection:R,panBy:P,isValidConnection:L,onConnect:Z,onConnectStart:H,onConnectEnd:F,onReconnectEnd:w,updateConnection:K,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle})},S=O=>_(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=O=>_(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),A=()=>v(!0),E=()=>v(!1);return I.jsxs(I.Fragment,{children:[(e===!0||e==="source")&&I.jsx(e1,{position:c,centerX:i,centerY:l,radius:t,onMouseDown:S,onMouseEnter:A,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&I.jsx(e1,{position:d,centerX:s,centerY:o,radius:t,onMouseDown:k,onMouseEnter:A,onMouseOut:E,type:"target"})]})}function E6({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:l,onDoubleClick:s,onContextMenu:o,onMouseEnter:c,onMouseMove:d,onMouseLeave:h,reconnectRadius:m,onReconnect:p,onReconnectStart:y,onReconnectEnd:v,rfId:b,edgeTypes:_,noPanClassName:S,onError:k,disableKeyboardA11y:A}){let E=Ze(ye=>ye.edgeLookup.get(e));const O=Ze(ye=>ye.defaultEdgeOptions);E=O?{...O,...E}:E;let D=E.type||"default",M=(_==null?void 0:_[D])||Kb[D];M===void 0&&(k==null||k("011",nr.error011(D)),D="default",M=Kb.default);const U=!!(E.focusable||t&&typeof E.focusable>"u"),L=typeof p<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),q=!!(E.selectable||i&&typeof E.selectable>"u"),N=ie.useRef(null),[B,H]=ie.useState(!1),[F,R]=ie.useState(!1),$=ft(),{zIndex:j,sourceX:P,sourceY:K,targetX:X,targetY:w,sourcePosition:Z,targetPosition:te}=Ze(ie.useCallback(ye=>{const Re=ye.nodeLookup.get(E.source),ze=ye.nodeLookup.get(E.target);if(!Re||!ze)return{zIndex:E.zIndex,...Jb};const lt=v9({id:e,sourceNode:Re,targetNode:ze,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:ye.connectionMode,onError:k});return{zIndex:c9({selected:E.selected,zIndex:E.zIndex,sourceNode:Re,targetNode:ze,elevateOnSelect:ye.elevateEdgesOnSelect}),...lt||Jb}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),pt),C=ie.useMemo(()=>E.markerStart?`url('#${ap(E.markerStart,b)}')`:void 0,[E.markerStart,b]),Y=ie.useMemo(()=>E.markerEnd?`url('#${ap(E.markerEnd,b)}')`:void 0,[E.markerEnd,b]);if(E.hidden||P===null||K===null||X===null||w===null)return null;const Q=ye=>{var ot;const{addSelectedEdges:Re,unselectNodesAndEdges:ze,multiSelectionActive:lt}=$.getState();q&&($.setState({nodesSelectionActive:!1}),E.selected&&lt?(ze({nodes:[],edges:[E]}),(ot=N.current)==null||ot.blur()):Re([e])),l&&l(ye,E)},W=s?ye=>{s(ye,{...E})}:void 0,ue=o?ye=>{o(ye,{...E})}:void 0,ce=c?ye=>{c(ye,{...E})}:void 0,ge=d?ye=>{d(ye,{...E})}:void 0,ke=h?ye=>{h(ye,{...E})}:void 0,we=ye=>{var Re;if(!A&&Xw.includes(ye.key)&&q){const{unselectNodesAndEdges:ze,addSelectedEdges:lt}=$.getState();ye.key==="Escape"?((Re=N.current)==null||Re.blur(),ze({edges:[E]})):lt([e])}};return I.jsx("svg",{style:{zIndex:j},children:I.jsxs("g",{className:Ct(["react-flow__edge",`react-flow__edge-${D}`,E.className,S,{selected:E.selected,animated:E.animated,inactive:!q&&!l,updating:B,selectable:q}]),onClick:Q,onDoubleClick:W,onContextMenu:ue,onMouseEnter:ce,onMouseMove:ge,onMouseLeave:ke,onKeyDown:U?we:void 0,tabIndex:U?0:void 0,role:U?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":U?`${TS}-${b}`:void 0,ref:N,children:[!F&&I.jsx(M,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:q,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:P,sourceY:K,targetX:X,targetY:w,sourcePosition:Z,targetPosition:te,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:C,markerEnd:Y,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),L&&I.jsx(S6,{edge:E,isReconnectable:L,reconnectRadius:m,onReconnect:p,onReconnectStart:y,onReconnectEnd:v,sourceX:P,sourceY:K,targetX:X,targetY:w,sourcePosition:Z,targetPosition:te,setUpdateHover:H,setReconnecting:R})]})})}const k6=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function JS({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:l,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:c,onEdgeMouseMove:d,onEdgeMouseLeave:h,onEdgeClick:m,reconnectRadius:p,onEdgeDoubleClick:y,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:_}){const{edgesFocusable:S,edgesReconnectable:k,elementsSelectable:A,onError:E}=Ze(k6,pt),O=c6(t);return I.jsxs("div",{className:"react-flow__edges",children:[I.jsx(p6,{defaultColor:e,rfId:n}),O.map(D=>I.jsx(E6,{id:D,edgesFocusable:S,edgesReconnectable:k,elementsSelectable:A,noPanClassName:l,onReconnect:s,onContextMenu:o,onMouseEnter:c,onMouseMove:d,onMouseLeave:h,onClick:m,reconnectRadius:p,onDoubleClick:y,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:E,edgeTypes:i,disableKeyboardA11y:_},D))]})}JS.displayName="EdgeRenderer";const T6=ie.memo(JS),C6=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function A6({children:e}){const t=Ze(C6);return I.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function N6(e){const t=Oc(),n=ie.useRef(!1);ie.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const O6=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function M6(e){const t=Ze(O6),n=ft();return ie.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function R6(e){return e.connection.inProgress?{...e.connection,to:Ws(e.connection.to,e.transform)}:{...e.connection}}function z6(e){return R6}function D6(e){const t=z6();return Ze(t,pt)}const j6=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function L6({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:l,width:s,height:o,isValid:c,inProgress:d}=Ze(j6,pt);return!(s&&l&&d)?null:I.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:I.jsx("g",{className:Ct(["react-flow__connection",Kw(c)]),children:I.jsx(WS,{style:t,type:n,CustomComponent:i,isValid:c})})})}const WS=({style:e,type:t=di.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:l,from:s,fromNode:o,fromHandle:c,fromPosition:d,to:h,toNode:m,toHandle:p,toPosition:y}=D6();if(!l)return;if(n)return I.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:c,fromX:s.x,fromY:s.y,toX:h.x,toY:h.y,fromPosition:d,toPosition:y,connectionStatus:Kw(i),toNode:m,toHandle:p});let v="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:d,targetX:h.x,targetY:h.y,targetPosition:y};switch(t){case di.Bezier:[v]=cS(b);break;case di.SimpleBezier:[v]=US(b);break;case di.Step:[v]=ip({...b,borderRadius:0});break;case di.SmoothStep:[v]=ip(b);break;default:[v]=dS(b)}return I.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:e})};WS.displayName="ConnectionLine";const I6={};function t1(e=I6){ie.useRef(e),ft(),ie.useEffect(()=>{},[e])}function B6(){ft(),ie.useRef(!1),ie.useEffect(()=>{},[])}function eE({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:l,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:p,onSelectionStart:y,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:_,connectionLineComponent:S,connectionLineContainerStyle:k,selectionKeyCode:A,selectionOnDrag:E,selectionMode:O,multiSelectionKeyCode:D,panActivationKeyCode:M,zoomActivationKeyCode:U,deleteKeyCode:L,onlyRenderVisibleElements:q,elementsSelectable:N,defaultViewport:B,translateExtent:H,minZoom:F,maxZoom:R,preventScrolling:$,defaultMarkerColor:j,zoomOnScroll:P,zoomOnPinch:K,panOnScroll:X,panOnScrollSpeed:w,panOnScrollMode:Z,zoomOnDoubleClick:te,panOnDrag:C,onPaneClick:Y,onPaneMouseEnter:Q,onPaneMouseMove:W,onPaneMouseLeave:ue,onPaneScroll:ce,onPaneContextMenu:ge,paneClickDistance:ke,nodeClickDistance:we,onEdgeContextMenu:ye,onEdgeMouseEnter:Re,onEdgeMouseMove:ze,onEdgeMouseLeave:lt,reconnectRadius:ot,onReconnect:xt,onReconnectStart:xi,onReconnectEnd:ar,noDragClassName:Nn,noWheelClassName:$n,noPanClassName:lr,disableKeyboardA11y:Zn,nodeExtent:bi,rfId:Yn,viewport:le,onViewportChange:de}){return t1(e),t1(t),B6(),N6(n),M6(le),I.jsx(t6,{onPaneClick:Y,onPaneMouseEnter:Q,onPaneMouseMove:W,onPaneMouseLeave:ue,onPaneContextMenu:ge,onPaneScroll:ce,paneClickDistance:ke,deleteKeyCode:L,selectionKeyCode:A,selectionOnDrag:E,selectionMode:O,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:D,panActivationKeyCode:M,zoomActivationKeyCode:U,elementsSelectable:N,zoomOnScroll:P,zoomOnPinch:K,zoomOnDoubleClick:te,panOnScroll:X,panOnScrollSpeed:w,panOnScrollMode:Z,panOnDrag:C,defaultViewport:B,translateExtent:H,minZoom:F,maxZoom:R,onSelectionContextMenu:p,preventScrolling:$,noDragClassName:Nn,noWheelClassName:$n,noPanClassName:lr,disableKeyboardA11y:Zn,onViewportChange:de,isControlledViewport:!!le,children:I.jsxs(A6,{children:[I.jsx(T6,{edgeTypes:t,onEdgeClick:l,onEdgeDoubleClick:o,onReconnect:xt,onReconnectStart:xi,onReconnectEnd:ar,onlyRenderVisibleElements:q,onEdgeContextMenu:ye,onEdgeMouseEnter:Re,onEdgeMouseMove:ze,onEdgeMouseLeave:lt,reconnectRadius:ot,defaultMarkerColor:j,noPanClassName:lr,disableKeyboardA11y:Zn,rfId:Yn}),I.jsx(L6,{style:_,type:b,component:S,containerStyle:k}),I.jsx("div",{className:"react-flow__edgelabel-renderer"}),I.jsx(o6,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:m,nodeClickDistance:we,onlyRenderVisibleElements:q,noPanClassName:lr,noDragClassName:Nn,disableKeyboardA11y:Zn,nodeExtent:bi,rfId:Yn}),I.jsx("div",{className:"react-flow__viewport-portal"})]})})}eE.displayName="GraphView";const H6=ie.memo(eE),n1=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:l,height:s,fitView:o,fitViewOptions:c,minZoom:d=.5,maxZoom:h=2,nodeOrigin:m,nodeExtent:p}={})=>{const y=new Map,v=new Map,b=new Map,_=new Map,S=i??t??[],k=n??e??[],A=m??[0,0],E=p??Us;mS(b,_,S);const O=lp(k,y,v,{nodeOrigin:A,nodeExtent:E,elevateNodesOnSelect:!1});let D=[0,0,1];if(o&&l&&s){const M=Js(y,{filter:N=>!!((N.width||N.initialWidth)&&(N.height||N.initialHeight))}),{x:U,y:L,zoom:q}=Ip(M,l,s,d,h,(c==null?void 0:c.padding)??.1);D=[U,L,q]}return{rfId:"1",width:0,height:0,transform:D,nodes:k,nodesInitialized:O,nodeLookup:y,parentLookup:v,edges:S,edgeLookup:_,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:d,maxZoom:h,translateExtent:Us,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ja.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:A,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:c,fitViewResolver:null,connection:{...Qw},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:a9,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},U6=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:l,height:s,fitView:o,fitViewOptions:c,minZoom:d,maxZoom:h,nodeOrigin:m,nodeExtent:p})=>lL((y,v)=>{async function b(){const{nodeLookup:_,panZoom:S,fitViewOptions:k,fitViewResolver:A,width:E,height:O,minZoom:D,maxZoom:M}=v();S&&(await r9({nodes:_,width:E,height:O,panZoom:S,minZoom:D,maxZoom:M},k),A==null||A.resolve(!0),y({fitViewResolver:null}))}return{...n1({nodes:e,edges:t,width:l,height:s,fitView:o,fitViewOptions:c,minZoom:d,maxZoom:h,nodeOrigin:m,nodeExtent:p,defaultNodes:n,defaultEdges:i}),setNodes:_=>{const{nodeLookup:S,parentLookup:k,nodeOrigin:A,elevateNodesOnSelect:E,fitViewQueued:O}=v(),D=lp(_,S,k,{nodeOrigin:A,nodeExtent:p,elevateNodesOnSelect:E,checkEquality:!0});O&&D?(b(),y({nodes:_,nodesInitialized:D,fitViewQueued:!1,fitViewOptions:void 0})):y({nodes:_,nodesInitialized:D})},setEdges:_=>{const{connectionLookup:S,edgeLookup:k}=v();mS(S,k,_),y({edges:_})},setDefaultNodesAndEdges:(_,S)=>{if(_){const{setNodes:k}=v();k(_),y({hasDefaultNodes:!0})}if(S){const{setEdges:k}=v();k(S),y({hasDefaultEdges:!0})}},updateNodeInternals:_=>{const{triggerNodeChanges:S,nodeLookup:k,parentLookup:A,domNode:E,nodeOrigin:O,nodeExtent:D,debug:M,fitViewQueued:U}=v(),{changes:L,updatedInternals:q}=E9(_,k,A,E,O,D);q&&(_9(k,A,{nodeOrigin:O,nodeExtent:D}),U?(b(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(L==null?void 0:L.length)>0&&(M&&console.log("React Flow: trigger node changes",L),S==null||S(L)))},updateNodePositions:(_,S=!1)=>{const k=[],A=[],{nodeLookup:E,triggerNodeChanges:O}=v();for(const[D,M]of _){const U=E.get(D),L=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(M!=null&&M.position)),q={id:D,type:"position",position:L?{x:Math.max(0,M.position.x),y:Math.max(0,M.position.y)}:M.position,dragging:S};L&&U.parentId&&k.push({id:D,parentId:U.parentId,rect:{...M.internals.positionAbsolute,width:M.measured.width??0,height:M.measured.height??0}}),A.push(q)}if(k.length>0){const{parentLookup:D,nodeOrigin:M}=v(),U=Pp(k,E,D,M);A.push(...U)}O(A)},triggerNodeChanges:_=>{const{onNodesChange:S,setNodes:k,nodes:A,hasDefaultNodes:E,debug:O}=v();if(_!=null&&_.length){if(E){const D=NS(_,A);k(D)}O&&console.log("React Flow: trigger node changes",_),S==null||S(_)}},triggerEdgeChanges:_=>{const{onEdgesChange:S,setEdges:k,edges:A,hasDefaultEdges:E,debug:O}=v();if(_!=null&&_.length){if(E){const D=OS(_,A);k(D)}O&&console.log("React Flow: trigger edge changes",_),S==null||S(_)}},addSelectedNodes:_=>{const{multiSelectionActive:S,edgeLookup:k,nodeLookup:A,triggerNodeChanges:E,triggerEdgeChanges:O}=v();if(S){const D=_.map(M=>Ui(M,!0));E(D);return}E(Ua(A,new Set([..._]),!0)),O(Ua(k))},addSelectedEdges:_=>{const{multiSelectionActive:S,edgeLookup:k,nodeLookup:A,triggerNodeChanges:E,triggerEdgeChanges:O}=v();if(S){const D=_.map(M=>Ui(M,!0));O(D);return}O(Ua(k,new Set([..._]))),E(Ua(A,new Set,!0))},unselectNodesAndEdges:({nodes:_,edges:S}={})=>{const{edges:k,nodes:A,nodeLookup:E,triggerNodeChanges:O,triggerEdgeChanges:D}=v(),M=_||A,U=S||k,L=M.map(N=>{const B=E.get(N.id);return B&&(B.selected=!1),Ui(N.id,!1)}),q=U.map(N=>Ui(N.id,!1));O(L),D(q)},setMinZoom:_=>{const{panZoom:S,maxZoom:k}=v();S==null||S.setScaleExtent([_,k]),y({minZoom:_})},setMaxZoom:_=>{const{panZoom:S,minZoom:k}=v();S==null||S.setScaleExtent([k,_]),y({maxZoom:_})},setTranslateExtent:_=>{var S;(S=v().panZoom)==null||S.setTranslateExtent(_),y({translateExtent:_})},setPaneClickDistance:_=>{var S;(S=v().panZoom)==null||S.setClickDistance(_)},resetSelectedElements:()=>{const{edges:_,nodes:S,triggerNodeChanges:k,triggerEdgeChanges:A,elementsSelectable:E}=v();if(!E)return;const O=S.reduce((M,U)=>U.selected?[...M,Ui(U.id,!1)]:M,[]),D=_.reduce((M,U)=>U.selected?[...M,Ui(U.id,!1)]:M,[]);k(O),A(D)},setNodeExtent:_=>{const{nodes:S,nodeLookup:k,parentLookup:A,nodeOrigin:E,elevateNodesOnSelect:O,nodeExtent:D}=v();_[0][0]===D[0][0]&&_[0][1]===D[0][1]&&_[1][0]===D[1][0]&&_[1][1]===D[1][1]||(lp(S,k,A,{nodeOrigin:E,nodeExtent:_,elevateNodesOnSelect:O,checkEquality:!1}),y({nodeExtent:_}))},panBy:_=>{const{transform:S,width:k,height:A,panZoom:E,translateExtent:O}=v();return k9({delta:_,panZoom:E,transform:S,translateExtent:O,width:k,height:A})},cancelConnection:()=>{y({connection:{...Qw}})},updateConnection:_=>{y({connection:_})},reset:()=>y({...n1()})}},Object.is);function tE({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:l,initialHeight:s,initialMinZoom:o,initialMaxZoom:c,initialFitViewOptions:d,fitView:h,nodeOrigin:m,nodeExtent:p,children:y}){const[v]=ie.useState(()=>U6({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:l,height:s,fitView:h,minZoom:o,maxZoom:c,fitViewOptions:d,nodeOrigin:m,nodeExtent:p}));return I.jsx(sL,{value:v,children:I.jsx(OL,{children:y})})}function q6({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:l,width:s,height:o,fitView:c,fitViewOptions:d,minZoom:h,maxZoom:m,nodeOrigin:p,nodeExtent:y}){return ie.useContext(Nc)?I.jsx(I.Fragment,{children:e}):I.jsx(tE,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:l,initialWidth:s,initialHeight:o,fitView:c,initialFitViewOptions:d,initialMinZoom:h,initialMaxZoom:m,nodeOrigin:p,nodeExtent:y,children:e})}const P6={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function V6({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:l,nodeTypes:s,edgeTypes:o,onNodeClick:c,onEdgeClick:d,onInit:h,onMove:m,onMoveStart:p,onMoveEnd:y,onConnect:v,onConnectStart:b,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:k,onNodeMouseEnter:A,onNodeMouseMove:E,onNodeMouseLeave:O,onNodeContextMenu:D,onNodeDoubleClick:M,onNodeDragStart:U,onNodeDrag:L,onNodeDragStop:q,onNodesDelete:N,onEdgesDelete:B,onDelete:H,onSelectionChange:F,onSelectionDragStart:R,onSelectionDrag:$,onSelectionDragStop:j,onSelectionContextMenu:P,onSelectionStart:K,onSelectionEnd:X,onBeforeDelete:w,connectionMode:Z,connectionLineType:te=di.Bezier,connectionLineStyle:C,connectionLineComponent:Y,connectionLineContainerStyle:Q,deleteKeyCode:W="Backspace",selectionKeyCode:ue="Shift",selectionOnDrag:ce=!1,selectionMode:ge=qs.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:we=fc()?"Meta":"Control",zoomActivationKeyCode:ye=fc()?"Meta":"Control",snapToGrid:Re,snapGrid:ze,onlyRenderVisibleElements:lt=!1,selectNodesOnDrag:ot,nodesDraggable:xt,nodesConnectable:xi,nodesFocusable:ar,nodeOrigin:Nn=CS,edgesFocusable:$n,edgesReconnectable:lr,elementsSelectable:Zn=!0,defaultViewport:bi=bL,minZoom:Yn=.5,maxZoom:le=2,translateExtent:de=Us,preventScrolling:Ee=!0,nodeExtent:Te,defaultMarkerColor:Xe="#b1b1b7",zoomOnScroll:Vt=!0,zoomOnPinch:On=!0,panOnScroll:It=!1,panOnScrollSpeed:xn=.5,panOnScrollMode:$t=$i.Free,zoomOnDoubleClick:bt=!0,panOnDrag:Gt=!0,onPaneClick:an,onPaneMouseEnter:tu,onPaneMouseMove:nu,onPaneMouseLeave:ll,onPaneScroll:_i,onPaneContextMenu:zc,paneClickDistance:sl=0,nodeClickDistance:ru=0,children:ul,onReconnect:ol,onReconnectStart:iu,onReconnectEnd:Dc,onEdgeContextMenu:Fn,onEdgeDoubleClick:Ot,onEdgeMouseEnter:Bt,onEdgeMouseMove:Rr,onEdgeMouseLeave:cl,reconnectRadius:jc=10,onNodesChange:Lc,onEdgesChange:au,noDragClassName:wi="nodrag",noWheelClassName:fl="nowheel",noPanClassName:sr="nopan",fitView:ur,fitViewOptions:zr,connectOnClick:Dr,attributionPosition:_t,proOptions:lu,defaultEdgeOptions:su,elevateNodesOnSelect:or,elevateEdgesOnSelect:jr,disableKeyboardA11y:uu=!1,autoPanOnConnect:ou,autoPanOnNodeDrag:cu,autoPanSpeed:Ic,connectionRadius:Qi,isValidConnection:Ki,onError:Mn,style:dl,id:hl,nodeDragThreshold:Lr,viewport:ml,onViewportChange:pl,width:Bc,height:fu,colorMode:Xt="light",debug:du,onScroll:Ji,...Wi},hu){const Ir=hl||"1",Hc=EL(Xt),Qt=ie.useCallback(ea=>{ea.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ji==null||Ji(ea)},[Ji]);return I.jsx("div",{"data-testid":"rf__wrapper",...Wi,onScroll:Qt,style:{...dl,...P6},ref:hu,className:Ct(["react-flow",l,Hc]),id:hl,children:I.jsxs(q6,{nodes:e,edges:t,width:Bc,height:fu,fitView:ur,fitViewOptions:zr,minZoom:Yn,maxZoom:le,nodeOrigin:Nn,nodeExtent:Te,children:[I.jsx(H6,{onInit:h,onNodeClick:c,onEdgeClick:d,onNodeMouseEnter:A,onNodeMouseMove:E,onNodeMouseLeave:O,onNodeContextMenu:D,onNodeDoubleClick:M,nodeTypes:s,edgeTypes:o,connectionLineType:te,connectionLineStyle:C,connectionLineComponent:Y,connectionLineContainerStyle:Q,selectionKeyCode:ue,selectionOnDrag:ce,selectionMode:ge,deleteKeyCode:W,multiSelectionKeyCode:we,panActivationKeyCode:ke,zoomActivationKeyCode:ye,onlyRenderVisibleElements:lt,defaultViewport:bi,translateExtent:de,minZoom:Yn,maxZoom:le,preventScrolling:Ee,zoomOnScroll:Vt,zoomOnPinch:On,zoomOnDoubleClick:bt,panOnScroll:It,panOnScrollSpeed:xn,panOnScrollMode:$t,panOnDrag:Gt,onPaneClick:an,onPaneMouseEnter:tu,onPaneMouseMove:nu,onPaneMouseLeave:ll,onPaneScroll:_i,onPaneContextMenu:zc,paneClickDistance:sl,nodeClickDistance:ru,onSelectionContextMenu:P,onSelectionStart:K,onSelectionEnd:X,onReconnect:ol,onReconnectStart:iu,onReconnectEnd:Dc,onEdgeContextMenu:Fn,onEdgeDoubleClick:Ot,onEdgeMouseEnter:Bt,onEdgeMouseMove:Rr,onEdgeMouseLeave:cl,reconnectRadius:jc,defaultMarkerColor:Xe,noDragClassName:wi,noWheelClassName:fl,noPanClassName:sr,rfId:Ir,disableKeyboardA11y:uu,nodeExtent:Te,viewport:ml,onViewportChange:pl}),I.jsx(SL,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:b,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:xt,nodesConnectable:xi,nodesFocusable:ar,edgesFocusable:$n,edgesReconnectable:lr,elementsSelectable:Zn,elevateNodesOnSelect:or,elevateEdgesOnSelect:jr,minZoom:Yn,maxZoom:le,nodeExtent:Te,onNodesChange:Lc,onEdgesChange:au,snapToGrid:Re,snapGrid:ze,connectionMode:Z,translateExtent:de,connectOnClick:Dr,defaultEdgeOptions:su,fitView:ur,fitViewOptions:zr,onNodesDelete:N,onEdgesDelete:B,onDelete:H,onNodeDragStart:U,onNodeDrag:L,onNodeDragStop:q,onSelectionDrag:$,onSelectionDragStart:R,onSelectionDragStop:j,onMove:m,onMoveStart:p,onMoveEnd:y,noPanClassName:sr,nodeOrigin:Nn,rfId:Ir,autoPanOnConnect:ou,autoPanOnNodeDrag:cu,autoPanSpeed:Ic,onError:Mn,connectionRadius:Qi,isValidConnection:Ki,selectNodesOnDrag:ot,nodeDragThreshold:Lr,onBeforeDelete:w,paneClickDistance:sl,debug:du}),I.jsx(xL,{onSelectionChange:F}),ul,I.jsx(mL,{proOptions:lu,position:_t}),I.jsx(dL,{rfId:Ir,disableKeyboardA11y:uu})]})})}var $6=MS(V6);function Z6(e){const[t,n]=ie.useState(e),i=ie.useCallback(l=>n(s=>NS(l,s)),[]);return[t,n,i]}function Y6(e){const[t,n]=ie.useState(e),i=ie.useCallback(l=>n(s=>OS(l,s)),[]);return[t,n,i]}function F6({dimensions:e,lineWidth:t,variant:n,className:i}){return I.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ct(["react-flow__background-pattern",n,i])})}function G6({radius:e,className:t}){return I.jsx("circle",{cx:e,cy:e,r:e,className:Ct(["react-flow__background-pattern","dots",t])})}var mi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(mi||(mi={}));const X6={[mi.Dots]:1,[mi.Lines]:1,[mi.Cross]:6},Q6=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function nE({id:e,variant:t=mi.Dots,gap:n=20,size:i,lineWidth:l=1,offset:s=0,color:o,bgColor:c,style:d,className:h,patternClassName:m}){const p=ie.useRef(null),{transform:y,patternId:v}=Ze(Q6,pt),b=i||X6[t],_=t===mi.Dots,S=t===mi.Cross,k=Array.isArray(n)?n:[n,n],A=[k[0]*y[2]||1,k[1]*y[2]||1],E=b*y[2],O=Array.isArray(s)?s:[s,s],D=S?[E,E]:A,M=[O[0]*y[2]||1+D[0]/2,O[1]*y[2]||1+D[1]/2],U=`${v}${e||""}`;return I.jsxs("svg",{className:Ct(["react-flow__background",h]),style:{...d,...Mc,"--xy-background-color-props":c,"--xy-background-pattern-color-props":o},ref:p,"data-testid":"rf__background",children:[I.jsx("pattern",{id:U,x:y[0]%A[0],y:y[1]%A[1],width:A[0],height:A[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:_?I.jsx(G6,{radius:E/2,className:m}):I.jsx(F6,{dimensions:D,lineWidth:l,variant:t,className:m})}),I.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${U})`})]})}nE.displayName="Background";const K6=ie.memo(nE);function J6(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:I.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function W6(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:I.jsx("path",{d:"M0 0h32v4.2H0z"})})}function e5(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:I.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function t5(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:I.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function n5(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:I.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Io({children:e,className:t,...n}){return I.jsx("button",{type:"button",className:Ct(["react-flow__controls-button",t]),...n,children:e})}const r5=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function rE({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:l,onZoomIn:s,onZoomOut:o,onFitView:c,onInteractiveChange:d,className:h,children:m,position:p="bottom-left",orientation:y="vertical","aria-label":v="React Flow controls"}){const b=ft(),{isInteractive:_,minZoomReached:S,maxZoomReached:k}=Ze(r5,pt),{zoomIn:A,zoomOut:E,fitView:O}=Oc(),D=()=>{A(),s==null||s()},M=()=>{E(),o==null||o()},U=()=>{O(l),c==null||c()},L=()=>{b.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),d==null||d(!_)},q=y==="horizontal"?"horizontal":"vertical";return I.jsxs(eu,{className:Ct(["react-flow__controls",q,h]),position:p,style:e,"data-testid":"rf__controls","aria-label":v,children:[t&&I.jsxs(I.Fragment,{children:[I.jsx(Io,{onClick:D,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k,children:I.jsx(J6,{})}),I.jsx(Io,{onClick:M,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S,children:I.jsx(W6,{})})]}),n&&I.jsx(Io,{className:"react-flow__controls-fitview",onClick:U,title:"fit view","aria-label":"fit view",children:I.jsx(e5,{})}),i&&I.jsx(Io,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity",children:_?I.jsx(n5,{}):I.jsx(t5,{})}),m]})}rE.displayName="Controls";const i5=ie.memo(rE);function a5({id:e,x:t,y:n,width:i,height:l,style:s,color:o,strokeColor:c,strokeWidth:d,className:h,borderRadius:m,shapeRendering:p,selected:y,onClick:v}){const{background:b,backgroundColor:_}=s||{},S=o||b||_;return I.jsx("rect",{className:Ct(["react-flow__minimap-node",{selected:y},h]),x:t,y:n,rx:m,ry:m,width:i,height:l,style:{fill:S,stroke:c,strokeWidth:d},shapeRendering:p,onClick:v?k=>v(k,e):void 0})}const l5=ie.memo(a5),s5=e=>e.nodes.map(t=>t.id),Ih=e=>e instanceof Function?e:()=>e;function u5({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:s=l5,onClick:o}){const c=Ze(s5,pt),d=Ih(t),h=Ih(e),m=Ih(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return I.jsx(I.Fragment,{children:c.map(y=>I.jsx(c5,{id:y,nodeColorFunc:d,nodeStrokeColorFunc:h,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:l,NodeComponent:s,onClick:o,shapeRendering:p},y))})}function o5({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:l,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:c,onClick:d}){const{node:h,x:m,y:p,width:y,height:v}=Ze(b=>{const{internals:_}=b.nodeLookup.get(e),S=_.userNode,{x:k,y:A}=_.positionAbsolute,{width:E,height:O}=Mr(S);return{node:S,x:k,y:A,width:E,height:O}},pt);return!h||h.hidden||!iS(h)?null:I.jsx(c,{x:m,y:p,width:y,height:v,style:h.style,selected:!!h.selected,className:i(h),color:t(h),borderRadius:l,strokeColor:n(h),strokeWidth:s,shapeRendering:o,onClick:d,id:h.id})}const c5=ie.memo(o5);var f5=ie.memo(u5);const d5=200,h5=150,m5=e=>!e.hidden,p5=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?rS(Js(e.nodeLookup,{filter:m5}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},g5="react-flow__minimap-desc";function iE({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:l="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:c,bgColor:d,maskColor:h,maskStrokeColor:m,maskStrokeWidth:p,position:y="bottom-right",onClick:v,onNodeClick:b,pannable:_=!1,zoomable:S=!1,ariaLabel:k="React Flow mini map",inversePan:A,zoomStep:E=10,offsetScale:O=5}){const D=ft(),M=ie.useRef(null),{boundingRect:U,viewBB:L,rfId:q,panZoom:N,translateExtent:B,flowWidth:H,flowHeight:F}=Ze(p5,pt),R=(e==null?void 0:e.width)??d5,$=(e==null?void 0:e.height)??h5,j=U.width/R,P=U.height/$,K=Math.max(j,P),X=K*R,w=K*$,Z=O*K,te=U.x-(X-U.width)/2-Z,C=U.y-(w-U.height)/2-Z,Y=X+Z*2,Q=w+Z*2,W=`${g5}-${q}`,ue=ie.useRef(0),ce=ie.useRef();ue.current=K,ie.useEffect(()=>{if(M.current&&N)return ce.current=z9({domNode:M.current,panZoom:N,getTransform:()=>D.getState().transform,getViewScale:()=>ue.current}),()=>{var we;(we=ce.current)==null||we.destroy()}},[N]),ie.useEffect(()=>{var we;(we=ce.current)==null||we.update({translateExtent:B,width:H,height:F,inversePan:A,pannable:_,zoomStep:E,zoomable:S})},[_,S,A,E,B,H,F]);const ge=v?we=>{var ze;const[ye,Re]=((ze=ce.current)==null?void 0:ze.pointer(we))||[0,0];v(we,{x:ye,y:Re})}:void 0,ke=b?ie.useCallback((we,ye)=>{const Re=D.getState().nodeLookup.get(ye).internals.userNode;b(we,Re)},[]):void 0;return I.jsx(eu,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*K:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Ct(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:I.jsxs("svg",{width:R,height:$,viewBox:`${te} ${C} ${Y} ${Q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:M,onClick:ge,children:[k&&I.jsx("title",{id:W,children:k}),I.jsx(f5,{onClick:ke,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:l,nodeStrokeWidth:o,nodeComponent:c}),I.jsx("path",{className:"react-flow__minimap-mask",d:`M${te-Z},${C-Z}h${Y+Z*2}v${Q+Z*2}h${-Y-Z*2}z
214
+ M${L.x},${L.y}h${L.width}v${L.height}h${-L.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}iE.displayName="MiniMap";ie.memo(iE);function y5({nodeId:e,position:t,variant:n=As.Handle,className:i,style:l={},children:s,color:o,minWidth:c=10,minHeight:d=10,maxWidth:h=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:y,shouldResize:v,onResizeStart:b,onResize:_,onResizeEnd:S}){const k=jS(),A=typeof e=="string"?e:k,E=ft(),O=ie.useRef(null),D=n===As.Line?"right":"bottom-right",M=t??D,U=ie.useRef(null);ie.useEffect(()=>{if(!(!O.current||!A))return U.current||(U.current=G9({domNode:O.current,nodeId:A,getStoreItems:()=>{const{nodeLookup:B,transform:H,snapGrid:F,snapToGrid:R,nodeOrigin:$,domNode:j}=E.getState();return{nodeLookup:B,transform:H,snapGrid:F,snapToGrid:R,nodeOrigin:$,paneDomNode:j}},onChange:(B,H)=>{const{triggerNodeChanges:F,nodeLookup:R,parentLookup:$,nodeOrigin:j}=E.getState(),P=[],K={x:B.x,y:B.y},X=R.get(A);if(X&&X.expandParent&&X.parentId){const w=X.origin??j,Z=B.width??X.measured.width??0,te=B.height??X.measured.height??0,C={id:X.id,parentId:X.parentId,rect:{width:Z,height:te,...aS({x:B.x??X.position.x,y:B.y??X.position.y},{width:Z,height:te},X.parentId,R,w)}},Y=Pp([C],R,$,j);P.push(...Y),K.x=B.x?Math.max(w[0]*Z,B.x):void 0,K.y=B.y?Math.max(w[1]*te,B.y):void 0}if(K.x!==void 0&&K.y!==void 0){const w={id:A,type:"position",position:{...K}};P.push(w)}if(B.width!==void 0&&B.height!==void 0){const Z={id:A,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};P.push(Z)}for(const w of H){const Z={...w,type:"position"};P.push(Z)}F(P)},onEnd:({width:B,height:H})=>{const F={id:A,type:"dimensions",resizing:!1,dimensions:{width:B,height:H}};E.getState().triggerNodeChanges([F])}})),U.current.update({controlPosition:M,boundaries:{minWidth:c,minHeight:d,maxWidth:h,maxHeight:m},keepAspectRatio:p,resizeDirection:y,onResizeStart:b,onResize:_,onResizeEnd:S,shouldResize:v}),()=>{var B;(B=U.current)==null||B.destroy()}},[M,c,d,h,m,p,b,_,S,v]);const L=M.split("-"),q=n===As.Line?"borderColor":"backgroundColor",N=o?{...l,[q]:o}:l;return I.jsx("div",{className:Ct(["react-flow__resize-control","nodrag",...L,n,i]),ref:O,style:N,children:s})}ie.memo(y5);var Bh,r1;function $p(){if(r1)return Bh;r1=1;var e="\0",t="\0",n="";class i{constructor(m){vt(this,"_isDirected",!0);vt(this,"_isMultigraph",!1);vt(this,"_isCompound",!1);vt(this,"_label");vt(this,"_defaultNodeLabelFn",()=>{});vt(this,"_defaultEdgeLabelFn",()=>{});vt(this,"_nodes",{});vt(this,"_in",{});vt(this,"_preds",{});vt(this,"_out",{});vt(this,"_sucs",{});vt(this,"_edgeObjs",{});vt(this,"_edgeLabels",{});vt(this,"_nodeCount",0);vt(this,"_edgeCount",0);vt(this,"_parent");vt(this,"_children");m&&(this._isDirected=Object.hasOwn(m,"directed")?m.directed:!0,this._isMultigraph=Object.hasOwn(m,"multigraph")?m.multigraph:!1,this._isCompound=Object.hasOwn(m,"compound")?m.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(m){return this._label=m,this}graph(){return this._label}setDefaultNodeLabel(m){return this._defaultNodeLabelFn=m,typeof m!="function"&&(this._defaultNodeLabelFn=()=>m),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var m=this;return this.nodes().filter(p=>Object.keys(m._in[p]).length===0)}sinks(){var m=this;return this.nodes().filter(p=>Object.keys(m._out[p]).length===0)}setNodes(m,p){var y=arguments,v=this;return m.forEach(function(b){y.length>1?v.setNode(b,p):v.setNode(b)}),this}setNode(m,p){return Object.hasOwn(this._nodes,m)?(arguments.length>1&&(this._nodes[m]=p),this):(this._nodes[m]=arguments.length>1?p:this._defaultNodeLabelFn(m),this._isCompound&&(this._parent[m]=t,this._children[m]={},this._children[t][m]=!0),this._in[m]={},this._preds[m]={},this._out[m]={},this._sucs[m]={},++this._nodeCount,this)}node(m){return this._nodes[m]}hasNode(m){return Object.hasOwn(this._nodes,m)}removeNode(m){var p=this;if(Object.hasOwn(this._nodes,m)){var y=v=>p.removeEdge(p._edgeObjs[v]);delete this._nodes[m],this._isCompound&&(this._removeFromParentsChildList(m),delete this._parent[m],this.children(m).forEach(function(v){p.setParent(v)}),delete this._children[m]),Object.keys(this._in[m]).forEach(y),delete this._in[m],delete this._preds[m],Object.keys(this._out[m]).forEach(y),delete this._out[m],delete this._sucs[m],--this._nodeCount}return this}setParent(m,p){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(p===void 0)p=t;else{p+="";for(var y=p;y!==void 0;y=this.parent(y))if(y===m)throw new Error("Setting "+p+" as parent of "+m+" would create a cycle");this.setNode(p)}return this.setNode(m),this._removeFromParentsChildList(m),this._parent[m]=p,this._children[p][m]=!0,this}_removeFromParentsChildList(m){delete this._children[this._parent[m]][m]}parent(m){if(this._isCompound){var p=this._parent[m];if(p!==t)return p}}children(m=t){if(this._isCompound){var p=this._children[m];if(p)return Object.keys(p)}else{if(m===t)return this.nodes();if(this.hasNode(m))return[]}}predecessors(m){var p=this._preds[m];if(p)return Object.keys(p)}successors(m){var p=this._sucs[m];if(p)return Object.keys(p)}neighbors(m){var p=this.predecessors(m);if(p){const v=new Set(p);for(var y of this.successors(m))v.add(y);return Array.from(v.values())}}isLeaf(m){var p;return this.isDirected()?p=this.successors(m):p=this.neighbors(m),p.length===0}filterNodes(m){var p=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});p.setGraph(this.graph());var y=this;Object.entries(this._nodes).forEach(function([_,S]){m(_)&&p.setNode(_,S)}),Object.values(this._edgeObjs).forEach(function(_){p.hasNode(_.v)&&p.hasNode(_.w)&&p.setEdge(_,y.edge(_))});var v={};function b(_){var S=y.parent(_);return S===void 0||p.hasNode(S)?(v[_]=S,S):S in v?v[S]:b(S)}return this._isCompound&&p.nodes().forEach(_=>p.setParent(_,b(_))),p}setDefaultEdgeLabel(m){return this._defaultEdgeLabelFn=m,typeof m!="function"&&(this._defaultEdgeLabelFn=()=>m),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(m,p){var y=this,v=arguments;return m.reduce(function(b,_){return v.length>1?y.setEdge(b,_,p):y.setEdge(b,_),_}),this}setEdge(){var m,p,y,v,b=!1,_=arguments[0];typeof _=="object"&&_!==null&&"v"in _?(m=_.v,p=_.w,y=_.name,arguments.length===2&&(v=arguments[1],b=!0)):(m=_,p=arguments[1],y=arguments[3],arguments.length>2&&(v=arguments[2],b=!0)),m=""+m,p=""+p,y!==void 0&&(y=""+y);var S=o(this._isDirected,m,p,y);if(Object.hasOwn(this._edgeLabels,S))return b&&(this._edgeLabels[S]=v),this;if(y!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(m),this.setNode(p),this._edgeLabels[S]=b?v:this._defaultEdgeLabelFn(m,p,y);var k=c(this._isDirected,m,p,y);return m=k.v,p=k.w,Object.freeze(k),this._edgeObjs[S]=k,l(this._preds[p],m),l(this._sucs[m],p),this._in[p][S]=k,this._out[m][S]=k,this._edgeCount++,this}edge(m,p,y){var v=arguments.length===1?d(this._isDirected,arguments[0]):o(this._isDirected,m,p,y);return this._edgeLabels[v]}edgeAsObj(){const m=this.edge(...arguments);return typeof m!="object"?{label:m}:m}hasEdge(m,p,y){var v=arguments.length===1?d(this._isDirected,arguments[0]):o(this._isDirected,m,p,y);return Object.hasOwn(this._edgeLabels,v)}removeEdge(m,p,y){var v=arguments.length===1?d(this._isDirected,arguments[0]):o(this._isDirected,m,p,y),b=this._edgeObjs[v];return b&&(m=b.v,p=b.w,delete this._edgeLabels[v],delete this._edgeObjs[v],s(this._preds[p],m),s(this._sucs[m],p),delete this._in[p][v],delete this._out[m][v],this._edgeCount--),this}inEdges(m,p){var y=this._in[m];if(y){var v=Object.values(y);return p?v.filter(b=>b.v===p):v}}outEdges(m,p){var y=this._out[m];if(y){var v=Object.values(y);return p?v.filter(b=>b.w===p):v}}nodeEdges(m,p){var y=this.inEdges(m,p);if(y)return y.concat(this.outEdges(m,p))}}function l(h,m){h[m]?h[m]++:h[m]=1}function s(h,m){--h[m]||delete h[m]}function o(h,m,p,y){var v=""+m,b=""+p;if(!h&&v>b){var _=v;v=b,b=_}return v+n+b+n+(y===void 0?e:y)}function c(h,m,p,y){var v=""+m,b=""+p;if(!h&&v>b){var _=v;v=b,b=_}var S={v,w:b};return y&&(S.name=y),S}function d(h,m){return o(h,m.v,m.w,m.name)}return Bh=i,Bh}var Hh,i1;function v5(){return i1||(i1=1,Hh="2.2.4"),Hh}var Uh,a1;function x5(){return a1||(a1=1,Uh={Graph:$p(),version:v5()}),Uh}var qh,l1;function b5(){if(l1)return qh;l1=1;var e=$p();qh={write:t,read:l};function t(s){var o={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:n(s),edges:i(s)};return s.graph()!==void 0&&(o.value=structuredClone(s.graph())),o}function n(s){return s.nodes().map(function(o){var c=s.node(o),d=s.parent(o),h={v:o};return c!==void 0&&(h.value=c),d!==void 0&&(h.parent=d),h})}function i(s){return s.edges().map(function(o){var c=s.edge(o),d={v:o.v,w:o.w};return o.name!==void 0&&(d.name=o.name),c!==void 0&&(d.value=c),d})}function l(s){var o=new e(s.options).setGraph(s.value);return s.nodes.forEach(function(c){o.setNode(c.v,c.value),c.parent&&o.setParent(c.v,c.parent)}),s.edges.forEach(function(c){o.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),o}return qh}var Ph,s1;function _5(){if(s1)return Ph;s1=1,Ph=e;function e(t){var n={},i=[],l;function s(o){Object.hasOwn(n,o)||(n[o]=!0,l.push(o),t.successors(o).forEach(s),t.predecessors(o).forEach(s))}return t.nodes().forEach(function(o){l=[],s(o),l.length&&i.push(l)}),i}return Ph}var Vh,u1;function aE(){if(u1)return Vh;u1=1;class e{constructor(){vt(this,"_arr",[]);vt(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var i=this._keyIndices[n];if(i!==void 0)return this._arr[i].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,i){var l=this._keyIndices;if(n=String(n),!Object.hasOwn(l,n)){var s=this._arr,o=s.length;return l[n]=o,s.push({key:n,priority:i}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,i){var l=this._keyIndices[n];if(i>this._arr[l].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[l].priority+" New: "+i);this._arr[l].priority=i,this._decrease(l)}_heapify(n){var i=this._arr,l=2*n,s=l+1,o=n;l<i.length&&(o=i[l].priority<i[o].priority?l:o,s<i.length&&(o=i[s].priority<i[o].priority?s:o),o!==n&&(this._swap(n,o),this._heapify(o)))}_decrease(n){for(var i=this._arr,l=i[n].priority,s;n!==0&&(s=n>>1,!(i[s].priority<l));)this._swap(n,s),n=s}_swap(n,i){var l=this._arr,s=this._keyIndices,o=l[n],c=l[i];l[n]=c,l[i]=o,s[c.key]=n,s[o.key]=i}}return Vh=e,Vh}var $h,o1;function lE(){if(o1)return $h;o1=1;var e=aE();$h=n;var t=()=>1;function n(l,s,o,c){return i(l,String(s),o||t,c||function(d){return l.outEdges(d)})}function i(l,s,o,c){var d={},h=new e,m,p,y=function(v){var b=v.v!==m?v.v:v.w,_=d[b],S=o(v),k=p.distance+S;if(S<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+v+" Weight: "+S);k<_.distance&&(_.distance=k,_.predecessor=m,h.decrease(b,k))};for(l.nodes().forEach(function(v){var b=v===s?0:Number.POSITIVE_INFINITY;d[v]={distance:b},h.add(v,b)});h.size()>0&&(m=h.removeMin(),p=d[m],p.distance!==Number.POSITIVE_INFINITY);)c(m).forEach(y);return d}return $h}var Zh,c1;function w5(){if(c1)return Zh;c1=1;var e=lE();Zh=t;function t(n,i,l){return n.nodes().reduce(function(s,o){return s[o]=e(n,o,i,l),s},{})}return Zh}var Yh,f1;function sE(){if(f1)return Yh;f1=1,Yh=e;function e(t){var n=0,i=[],l={},s=[];function o(c){var d=l[c]={onStack:!0,lowlink:n,index:n++};if(i.push(c),t.successors(c).forEach(function(p){Object.hasOwn(l,p)?l[p].onStack&&(d.lowlink=Math.min(d.lowlink,l[p].index)):(o(p),d.lowlink=Math.min(d.lowlink,l[p].lowlink))}),d.lowlink===d.index){var h=[],m;do m=i.pop(),l[m].onStack=!1,h.push(m);while(c!==m);s.push(h)}}return t.nodes().forEach(function(c){Object.hasOwn(l,c)||o(c)}),s}return Yh}var Fh,d1;function S5(){if(d1)return Fh;d1=1;var e=sE();Fh=t;function t(n){return e(n).filter(function(i){return i.length>1||i.length===1&&n.hasEdge(i[0],i[0])})}return Fh}var Gh,h1;function E5(){if(h1)return Gh;h1=1,Gh=t;var e=()=>1;function t(i,l,s){return n(i,l||e,s||function(o){return i.outEdges(o)})}function n(i,l,s){var o={},c=i.nodes();return c.forEach(function(d){o[d]={},o[d][d]={distance:0},c.forEach(function(h){d!==h&&(o[d][h]={distance:Number.POSITIVE_INFINITY})}),s(d).forEach(function(h){var m=h.v===d?h.w:h.v,p=l(h);o[d][m]={distance:p,predecessor:d}})}),c.forEach(function(d){var h=o[d];c.forEach(function(m){var p=o[m];c.forEach(function(y){var v=p[d],b=h[y],_=p[y],S=v.distance+b.distance;S<_.distance&&(_.distance=S,_.predecessor=b.predecessor)})})}),o}return Gh}var Xh,m1;function uE(){if(m1)return Xh;m1=1;function e(n){var i={},l={},s=[];function o(c){if(Object.hasOwn(l,c))throw new t;Object.hasOwn(i,c)||(l[c]=!0,i[c]=!0,n.predecessors(c).forEach(o),delete l[c],s.push(c))}if(n.sinks().forEach(o),Object.keys(i).length!==n.nodeCount())throw new t;return s}class t extends Error{constructor(){super(...arguments)}}return Xh=e,e.CycleException=t,Xh}var Qh,p1;function k5(){if(p1)return Qh;p1=1;var e=uE();Qh=t;function t(n){try{e(n)}catch(i){if(i instanceof e.CycleException)return!1;throw i}return!0}return Qh}var Kh,g1;function oE(){if(g1)return Kh;g1=1,Kh=e;function e(l,s,o){Array.isArray(s)||(s=[s]);var c=l.isDirected()?p=>l.successors(p):p=>l.neighbors(p),d=o==="post"?t:n,h=[],m={};return s.forEach(p=>{if(!l.hasNode(p))throw new Error("Graph does not have node: "+p);d(p,c,m,h)}),h}function t(l,s,o,c){for(var d=[[l,!1]];d.length>0;){var h=d.pop();h[1]?c.push(h[0]):Object.hasOwn(o,h[0])||(o[h[0]]=!0,d.push([h[0],!0]),i(s(h[0]),m=>d.push([m,!1])))}}function n(l,s,o,c){for(var d=[l];d.length>0;){var h=d.pop();Object.hasOwn(o,h)||(o[h]=!0,c.push(h),i(s(h),m=>d.push(m)))}}function i(l,s){for(var o=l.length;o--;)s(l[o],o,l);return l}return Kh}var Jh,y1;function T5(){if(y1)return Jh;y1=1;var e=oE();Jh=t;function t(n,i){return e(n,i,"post")}return Jh}var Wh,v1;function C5(){if(v1)return Wh;v1=1;var e=oE();Wh=t;function t(n,i){return e(n,i,"pre")}return Wh}var em,x1;function A5(){if(x1)return em;x1=1;var e=$p(),t=aE();em=n;function n(i,l){var s=new e,o={},c=new t,d;function h(p){var y=p.v===d?p.w:p.v,v=c.priority(y);if(v!==void 0){var b=l(p);b<v&&(o[y]=d,c.decrease(y,b))}}if(i.nodeCount()===0)return s;i.nodes().forEach(function(p){c.add(p,Number.POSITIVE_INFINITY),s.setNode(p)}),c.decrease(i.nodes()[0],0);for(var m=!1;c.size()>0;){if(d=c.removeMin(),Object.hasOwn(o,d))s.setEdge(d,o[d]);else{if(m)throw new Error("Input graph is not connected: "+i);m=!0}i.nodeEdges(d).forEach(h)}return s}return em}var tm,b1;function N5(){return b1||(b1=1,tm={components:_5(),dijkstra:lE(),dijkstraAll:w5(),findCycles:S5(),floydWarshall:E5(),isAcyclic:k5(),postorder:T5(),preorder:C5(),prim:A5(),tarjan:sE(),topsort:uE()}),tm}var nm,_1;function Pn(){if(_1)return nm;_1=1;var e=x5();return nm={Graph:e.Graph,json:b5(),alg:N5(),version:e.version},nm}var rm,w1;function O5(){if(w1)return rm;w1=1;class e{constructor(){let l={};l._next=l._prev=l,this._sentinel=l}dequeue(){let l=this._sentinel,s=l._prev;if(s!==l)return t(s),s}enqueue(l){let s=this._sentinel;l._prev&&l._next&&t(l),l._next=s._next,s._next._prev=l,s._next=l,l._prev=s}toString(){let l=[],s=this._sentinel,o=s._prev;for(;o!==s;)l.push(JSON.stringify(o,n)),o=o._prev;return"["+l.join(", ")+"]"}}function t(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function n(i,l){if(i!=="_next"&&i!=="_prev")return l}return rm=e,rm}var im,S1;function M5(){if(S1)return im;S1=1;let e=Pn().Graph,t=O5();im=i;let n=()=>1;function i(h,m){if(h.nodeCount()<=1)return[];let p=o(h,m||n);return l(p.graph,p.buckets,p.zeroIdx).flatMap(v=>h.outEdges(v.v,v.w))}function l(h,m,p){let y=[],v=m[m.length-1],b=m[0],_;for(;h.nodeCount();){for(;_=b.dequeue();)s(h,m,p,_);for(;_=v.dequeue();)s(h,m,p,_);if(h.nodeCount()){for(let S=m.length-2;S>0;--S)if(_=m[S].dequeue(),_){y=y.concat(s(h,m,p,_,!0));break}}}return y}function s(h,m,p,y,v){let b=v?[]:void 0;return h.inEdges(y.v).forEach(_=>{let S=h.edge(_),k=h.node(_.v);v&&b.push({v:_.v,w:_.w}),k.out-=S,c(m,p,k)}),h.outEdges(y.v).forEach(_=>{let S=h.edge(_),k=_.w,A=h.node(k);A.in-=S,c(m,p,A)}),h.removeNode(y.v),b}function o(h,m){let p=new e,y=0,v=0;h.nodes().forEach(S=>{p.setNode(S,{v:S,in:0,out:0})}),h.edges().forEach(S=>{let k=p.edge(S.v,S.w)||0,A=m(S),E=k+A;p.setEdge(S.v,S.w,E),v=Math.max(v,p.node(S.v).out+=A),y=Math.max(y,p.node(S.w).in+=A)});let b=d(v+y+3).map(()=>new t),_=y+1;return p.nodes().forEach(S=>{c(b,_,p.node(S))}),{graph:p,buckets:b,zeroIdx:_}}function c(h,m,p){p.out?p.in?h[p.out-p.in+m].enqueue(p):h[h.length-1].enqueue(p):h[0].enqueue(p)}function d(h){const m=[];for(let p=0;p<h;p++)m.push(p);return m}return im}var am,E1;function Tt(){if(E1)return am;E1=1;let e=Pn().Graph;am={addBorderNode:m,addDummyNode:t,applyWithChunking:v,asNonCompoundGraph:i,buildLayerMatrix:c,intersectRect:o,mapValues:M,maxRank:b,normalizeRanks:d,notime:k,partition:_,pick:D,predecessorWeights:s,range:O,removeEmptyRanks:h,simplify:n,successorWeights:l,time:S,uniqueId:E,zipObject:U};function t(L,q,N,B){let H;do H=E(B);while(L.hasNode(H));return N.dummy=q,L.setNode(H,N),H}function n(L){let q=new e().setGraph(L.graph());return L.nodes().forEach(N=>q.setNode(N,L.node(N))),L.edges().forEach(N=>{let B=q.edge(N.v,N.w)||{weight:0,minlen:1},H=L.edge(N);q.setEdge(N.v,N.w,{weight:B.weight+H.weight,minlen:Math.max(B.minlen,H.minlen)})}),q}function i(L){let q=new e({multigraph:L.isMultigraph()}).setGraph(L.graph());return L.nodes().forEach(N=>{L.children(N).length||q.setNode(N,L.node(N))}),L.edges().forEach(N=>{q.setEdge(N,L.edge(N))}),q}function l(L){let q=L.nodes().map(N=>{let B={};return L.outEdges(N).forEach(H=>{B[H.w]=(B[H.w]||0)+L.edge(H).weight}),B});return U(L.nodes(),q)}function s(L){let q=L.nodes().map(N=>{let B={};return L.inEdges(N).forEach(H=>{B[H.v]=(B[H.v]||0)+L.edge(H).weight}),B});return U(L.nodes(),q)}function o(L,q){let N=L.x,B=L.y,H=q.x-N,F=q.y-B,R=L.width/2,$=L.height/2;if(!H&&!F)throw new Error("Not possible to find intersection inside of the rectangle");let j,P;return Math.abs(F)*R>Math.abs(H)*$?(F<0&&($=-$),j=$*H/F,P=$):(H<0&&(R=-R),j=R,P=R*F/H),{x:N+j,y:B+P}}function c(L){let q=O(b(L)+1).map(()=>[]);return L.nodes().forEach(N=>{let B=L.node(N),H=B.rank;H!==void 0&&(q[H][B.order]=N)}),q}function d(L){let q=L.nodes().map(B=>{let H=L.node(B).rank;return H===void 0?Number.MAX_VALUE:H}),N=v(Math.min,q);L.nodes().forEach(B=>{let H=L.node(B);Object.hasOwn(H,"rank")&&(H.rank-=N)})}function h(L){let q=L.nodes().map(R=>L.node(R).rank),N=v(Math.min,q),B=[];L.nodes().forEach(R=>{let $=L.node(R).rank-N;B[$]||(B[$]=[]),B[$].push(R)});let H=0,F=L.graph().nodeRankFactor;Array.from(B).forEach((R,$)=>{R===void 0&&$%F!==0?--H:R!==void 0&&H&&R.forEach(j=>L.node(j).rank+=H)})}function m(L,q,N,B){let H={width:0,height:0};return arguments.length>=4&&(H.rank=N,H.order=B),t(L,"border",H,q)}function p(L,q=y){const N=[];for(let B=0;B<L.length;B+=q){const H=L.slice(B,B+q);N.push(H)}return N}const y=65535;function v(L,q){if(q.length>y){const N=p(q);return L.apply(null,N.map(B=>L.apply(null,B)))}else return L.apply(null,q)}function b(L){const N=L.nodes().map(B=>{let H=L.node(B).rank;return H===void 0?Number.MIN_VALUE:H});return v(Math.max,N)}function _(L,q){let N={lhs:[],rhs:[]};return L.forEach(B=>{q(B)?N.lhs.push(B):N.rhs.push(B)}),N}function S(L,q){let N=Date.now();try{return q()}finally{console.log(L+" time: "+(Date.now()-N)+"ms")}}function k(L,q){return q()}let A=0;function E(L){var q=++A;return toString(L)+q}function O(L,q,N=1){q==null&&(q=L,L=0);let B=F=>F<q;N<0&&(B=F=>q<F);const H=[];for(let F=L;B(F);F+=N)H.push(F);return H}function D(L,q){const N={};for(const B of q)L[B]!==void 0&&(N[B]=L[B]);return N}function M(L,q){let N=q;return typeof q=="string"&&(N=B=>B[q]),Object.entries(L).reduce((B,[H,F])=>(B[H]=N(F,H),B),{})}function U(L,q){return L.reduce((N,B,H)=>(N[B]=q[H],N),{})}return am}var lm,k1;function R5(){if(k1)return lm;k1=1;let e=M5(),t=Tt().uniqueId;lm={run:n,undo:l};function n(s){(s.graph().acyclicer==="greedy"?e(s,c(s)):i(s)).forEach(d=>{let h=s.edge(d);s.removeEdge(d),h.forwardName=d.name,h.reversed=!0,s.setEdge(d.w,d.v,h,t("rev"))});function c(d){return h=>d.edge(h).weight}}function i(s){let o=[],c={},d={};function h(m){Object.hasOwn(d,m)||(d[m]=!0,c[m]=!0,s.outEdges(m).forEach(p=>{Object.hasOwn(c,p.w)?o.push(p):h(p.w)}),delete c[m])}return s.nodes().forEach(h),o}function l(s){s.edges().forEach(o=>{let c=s.edge(o);if(c.reversed){s.removeEdge(o);let d=c.forwardName;delete c.reversed,delete c.forwardName,s.setEdge(o.w,o.v,c,d)}})}return lm}var sm,T1;function z5(){if(T1)return sm;T1=1;let e=Tt();sm={run:t,undo:i};function t(l){l.graph().dummyChains=[],l.edges().forEach(s=>n(l,s))}function n(l,s){let o=s.v,c=l.node(o).rank,d=s.w,h=l.node(d).rank,m=s.name,p=l.edge(s),y=p.labelRank;if(h===c+1)return;l.removeEdge(s);let v,b,_;for(_=0,++c;c<h;++_,++c)p.points=[],b={width:0,height:0,edgeLabel:p,edgeObj:s,rank:c},v=e.addDummyNode(l,"edge",b,"_d"),c===y&&(b.width=p.width,b.height=p.height,b.dummy="edge-label",b.labelpos=p.labelpos),l.setEdge(o,v,{weight:p.weight},m),_===0&&l.graph().dummyChains.push(v),o=v;l.setEdge(o,d,{weight:p.weight},m)}function i(l){l.graph().dummyChains.forEach(s=>{let o=l.node(s),c=o.edgeLabel,d;for(l.setEdge(o.edgeObj,c);o.dummy;)d=l.successors(s)[0],l.removeNode(s),c.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(c.x=o.x,c.y=o.y,c.width=o.width,c.height=o.height),s=d,o=l.node(s)})}return sm}var um,C1;function mc(){if(C1)return um;C1=1;const{applyWithChunking:e}=Tt();um={longestPath:t,slack:n};function t(i){var l={};function s(o){var c=i.node(o);if(Object.hasOwn(l,o))return c.rank;l[o]=!0;let d=i.outEdges(o).map(m=>m==null?Number.POSITIVE_INFINITY:s(m.w)-i.edge(m).minlen);var h=e(Math.min,d);return h===Number.POSITIVE_INFINITY&&(h=0),c.rank=h}i.sources().forEach(s)}function n(i,l){return i.node(l.w).rank-i.node(l.v).rank-i.edge(l).minlen}return um}var om,A1;function cE(){if(A1)return om;A1=1;var e=Pn().Graph,t=mc().slack;om=n;function n(o){var c=new e({directed:!1}),d=o.nodes()[0],h=o.nodeCount();c.setNode(d,{});for(var m,p;i(c,o)<h;)m=l(c,o),p=c.hasNode(m.v)?t(o,m):-t(o,m),s(c,o,p);return c}function i(o,c){function d(h){c.nodeEdges(h).forEach(m=>{var p=m.v,y=h===p?m.w:p;!o.hasNode(y)&&!t(c,m)&&(o.setNode(y,{}),o.setEdge(h,y,{}),d(y))})}return o.nodes().forEach(d),o.nodeCount()}function l(o,c){return c.edges().reduce((h,m)=>{let p=Number.POSITIVE_INFINITY;return o.hasNode(m.v)!==o.hasNode(m.w)&&(p=t(c,m)),p<h[0]?[p,m]:h},[Number.POSITIVE_INFINITY,null])[1]}function s(o,c,d){o.nodes().forEach(h=>c.node(h).rank+=d)}return om}var cm,N1;function D5(){if(N1)return cm;N1=1;var e=cE(),t=mc().slack,n=mc().longestPath,i=Pn().alg.preorder,l=Pn().alg.postorder,s=Tt().simplify;cm=o,o.initLowLimValues=m,o.initCutValues=c,o.calcCutValue=h,o.leaveEdge=y,o.enterEdge=v,o.exchangeEdges=b;function o(A){A=s(A),n(A);var E=e(A);m(E),c(E,A);for(var O,D;O=y(E);)D=v(E,A,O),b(E,A,O,D)}function c(A,E){var O=l(A,A.nodes());O=O.slice(0,O.length-1),O.forEach(D=>d(A,E,D))}function d(A,E,O){var D=A.node(O),M=D.parent;A.edge(O,M).cutvalue=h(A,E,O)}function h(A,E,O){var D=A.node(O),M=D.parent,U=!0,L=E.edge(O,M),q=0;return L||(U=!1,L=E.edge(M,O)),q=L.weight,E.nodeEdges(O).forEach(N=>{var B=N.v===O,H=B?N.w:N.v;if(H!==M){var F=B===U,R=E.edge(N).weight;if(q+=F?R:-R,S(A,O,H)){var $=A.edge(O,H).cutvalue;q+=F?-$:$}}}),q}function m(A,E){arguments.length<2&&(E=A.nodes()[0]),p(A,{},1,E)}function p(A,E,O,D,M){var U=O,L=A.node(D);return E[D]=!0,A.neighbors(D).forEach(q=>{Object.hasOwn(E,q)||(O=p(A,E,O,q,D))}),L.low=U,L.lim=O++,M?L.parent=M:delete L.parent,O}function y(A){return A.edges().find(E=>A.edge(E).cutvalue<0)}function v(A,E,O){var D=O.v,M=O.w;E.hasEdge(D,M)||(D=O.w,M=O.v);var U=A.node(D),L=A.node(M),q=U,N=!1;U.lim>L.lim&&(q=L,N=!0);var B=E.edges().filter(H=>N===k(A,A.node(H.v),q)&&N!==k(A,A.node(H.w),q));return B.reduce((H,F)=>t(E,F)<t(E,H)?F:H)}function b(A,E,O,D){var M=O.v,U=O.w;A.removeEdge(M,U),A.setEdge(D.v,D.w,{}),m(A),c(A,E),_(A,E)}function _(A,E){var O=A.nodes().find(M=>!E.node(M).parent),D=i(A,O);D=D.slice(1),D.forEach(M=>{var U=A.node(M).parent,L=E.edge(M,U),q=!1;L||(L=E.edge(U,M),q=!0),E.node(M).rank=E.node(U).rank+(q?L.minlen:-L.minlen)})}function S(A,E,O){return A.hasEdge(E,O)}function k(A,E,O){return O.low<=E.lim&&E.lim<=O.lim}return cm}var fm,O1;function j5(){if(O1)return fm;O1=1;var e=mc(),t=e.longestPath,n=cE(),i=D5();fm=l;function l(d){switch(d.graph().ranker){case"network-simplex":c(d);break;case"tight-tree":o(d);break;case"longest-path":s(d);break;default:c(d)}}var s=t;function o(d){t(d),n(d)}function c(d){i(d)}return fm}var dm,M1;function L5(){if(M1)return dm;M1=1,dm=e;function e(i){let l=n(i);i.graph().dummyChains.forEach(s=>{let o=i.node(s),c=o.edgeObj,d=t(i,l,c.v,c.w),h=d.path,m=d.lca,p=0,y=h[p],v=!0;for(;s!==c.w;){if(o=i.node(s),v){for(;(y=h[p])!==m&&i.node(y).maxRank<o.rank;)p++;y===m&&(v=!1)}if(!v){for(;p<h.length-1&&i.node(y=h[p+1]).minRank<=o.rank;)p++;y=h[p]}i.setParent(s,y),s=i.successors(s)[0]}})}function t(i,l,s,o){let c=[],d=[],h=Math.min(l[s].low,l[o].low),m=Math.max(l[s].lim,l[o].lim),p,y;p=s;do p=i.parent(p),c.push(p);while(p&&(l[p].low>h||m>l[p].lim));for(y=p,p=o;(p=i.parent(p))!==y;)d.push(p);return{path:c.concat(d.reverse()),lca:y}}function n(i){let l={},s=0;function o(c){let d=s;i.children(c).forEach(o),l[c]={low:d,lim:s++}}return i.children().forEach(o),l}return dm}var hm,R1;function I5(){if(R1)return hm;R1=1;let e=Tt();hm={run:t,cleanup:s};function t(o){let c=e.addDummyNode(o,"root",{},"_root"),d=i(o),h=Object.values(d),m=e.applyWithChunking(Math.max,h)-1,p=2*m+1;o.graph().nestingRoot=c,o.edges().forEach(v=>o.edge(v).minlen*=p);let y=l(o)+1;o.children().forEach(v=>n(o,c,p,y,m,d,v)),o.graph().nodeRankFactor=p}function n(o,c,d,h,m,p,y){let v=o.children(y);if(!v.length){y!==c&&o.setEdge(c,y,{weight:0,minlen:d});return}let b=e.addBorderNode(o,"_bt"),_=e.addBorderNode(o,"_bb"),S=o.node(y);o.setParent(b,y),S.borderTop=b,o.setParent(_,y),S.borderBottom=_,v.forEach(k=>{n(o,c,d,h,m,p,k);let A=o.node(k),E=A.borderTop?A.borderTop:k,O=A.borderBottom?A.borderBottom:k,D=A.borderTop?h:2*h,M=E!==O?1:m-p[y]+1;o.setEdge(b,E,{weight:D,minlen:M,nestingEdge:!0}),o.setEdge(O,_,{weight:D,minlen:M,nestingEdge:!0})}),o.parent(y)||o.setEdge(c,b,{weight:0,minlen:m+p[y]})}function i(o){var c={};function d(h,m){var p=o.children(h);p&&p.length&&p.forEach(y=>d(y,m+1)),c[h]=m}return o.children().forEach(h=>d(h,1)),c}function l(o){return o.edges().reduce((c,d)=>c+o.edge(d).weight,0)}function s(o){var c=o.graph();o.removeNode(c.nestingRoot),delete c.nestingRoot,o.edges().forEach(d=>{var h=o.edge(d);h.nestingEdge&&o.removeEdge(d)})}return hm}var mm,z1;function B5(){if(z1)return mm;z1=1;let e=Tt();mm=t;function t(i){function l(s){let o=i.children(s),c=i.node(s);if(o.length&&o.forEach(l),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let d=c.minRank,h=c.maxRank+1;d<h;++d)n(i,"borderLeft","_bl",s,c,d),n(i,"borderRight","_br",s,c,d)}}i.children().forEach(l)}function n(i,l,s,o,c,d){let h={width:0,height:0,rank:d,borderType:l},m=c[l][d-1],p=e.addDummyNode(i,"border",h,s);c[l][d]=p,i.setParent(p,o),m&&i.setEdge(m,p,{weight:1})}return mm}var pm,D1;function H5(){if(D1)return pm;D1=1,pm={adjust:e,undo:t};function e(d){let h=d.graph().rankdir.toLowerCase();(h==="lr"||h==="rl")&&n(d)}function t(d){let h=d.graph().rankdir.toLowerCase();(h==="bt"||h==="rl")&&l(d),(h==="lr"||h==="rl")&&(o(d),n(d))}function n(d){d.nodes().forEach(h=>i(d.node(h))),d.edges().forEach(h=>i(d.edge(h)))}function i(d){let h=d.width;d.width=d.height,d.height=h}function l(d){d.nodes().forEach(h=>s(d.node(h))),d.edges().forEach(h=>{let m=d.edge(h);m.points.forEach(s),Object.hasOwn(m,"y")&&s(m)})}function s(d){d.y=-d.y}function o(d){d.nodes().forEach(h=>c(d.node(h))),d.edges().forEach(h=>{let m=d.edge(h);m.points.forEach(c),Object.hasOwn(m,"x")&&c(m)})}function c(d){let h=d.x;d.x=d.y,d.y=h}return pm}var gm,j1;function U5(){if(j1)return gm;j1=1;let e=Tt();gm=t;function t(n){let i={},l=n.nodes().filter(m=>!n.children(m).length),s=l.map(m=>n.node(m).rank),o=e.applyWithChunking(Math.max,s),c=e.range(o+1).map(()=>[]);function d(m){if(i[m])return;i[m]=!0;let p=n.node(m);c[p.rank].push(m),n.successors(m).forEach(d)}return l.sort((m,p)=>n.node(m).rank-n.node(p).rank).forEach(d),c}return gm}var ym,L1;function q5(){if(L1)return ym;L1=1;let e=Tt().zipObject;ym=t;function t(i,l){let s=0;for(let o=1;o<l.length;++o)s+=n(i,l[o-1],l[o]);return s}function n(i,l,s){let o=e(s,s.map((y,v)=>v)),c=l.flatMap(y=>i.outEdges(y).map(v=>({pos:o[v.w],weight:i.edge(v).weight})).sort((v,b)=>v.pos-b.pos)),d=1;for(;d<s.length;)d<<=1;let h=2*d-1;d-=1;let m=new Array(h).fill(0),p=0;return c.forEach(y=>{let v=y.pos+d;m[v]+=y.weight;let b=0;for(;v>0;)v%2&&(b+=m[v+1]),v=v-1>>1,m[v]+=y.weight;p+=y.weight*b}),p}return ym}var vm,I1;function P5(){if(I1)return vm;I1=1,vm=e;function e(t,n=[]){return n.map(i=>{let l=t.inEdges(i);if(l.length){let s=l.reduce((o,c)=>{let d=t.edge(c),h=t.node(c.v);return{sum:o.sum+d.weight*h.order,weight:o.weight+d.weight}},{sum:0,weight:0});return{v:i,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:i}})}return vm}var xm,B1;function V5(){if(B1)return xm;B1=1;let e=Tt();xm=t;function t(l,s){let o={};l.forEach((d,h)=>{let m=o[d.v]={indegree:0,in:[],out:[],vs:[d.v],i:h};d.barycenter!==void 0&&(m.barycenter=d.barycenter,m.weight=d.weight)}),s.edges().forEach(d=>{let h=o[d.v],m=o[d.w];h!==void 0&&m!==void 0&&(m.indegree++,h.out.push(o[d.w]))});let c=Object.values(o).filter(d=>!d.indegree);return n(c)}function n(l){let s=[];function o(d){return h=>{h.merged||(h.barycenter===void 0||d.barycenter===void 0||h.barycenter>=d.barycenter)&&i(d,h)}}function c(d){return h=>{h.in.push(d),--h.indegree===0&&l.push(h)}}for(;l.length;){let d=l.pop();s.push(d),d.in.reverse().forEach(o(d)),d.out.forEach(c(d))}return s.filter(d=>!d.merged).map(d=>e.pick(d,["vs","i","barycenter","weight"]))}function i(l,s){let o=0,c=0;l.weight&&(o+=l.barycenter*l.weight,c+=l.weight),s.weight&&(o+=s.barycenter*s.weight,c+=s.weight),l.vs=s.vs.concat(l.vs),l.barycenter=o/c,l.weight=c,l.i=Math.min(s.i,l.i),s.merged=!0}return xm}var bm,H1;function $5(){if(H1)return bm;H1=1;let e=Tt();bm=t;function t(l,s){let o=e.partition(l,b=>Object.hasOwn(b,"barycenter")),c=o.lhs,d=o.rhs.sort((b,_)=>_.i-b.i),h=[],m=0,p=0,y=0;c.sort(i(!!s)),y=n(h,d,y),c.forEach(b=>{y+=b.vs.length,h.push(b.vs),m+=b.barycenter*b.weight,p+=b.weight,y=n(h,d,y)});let v={vs:h.flat(!0)};return p&&(v.barycenter=m/p,v.weight=p),v}function n(l,s,o){let c;for(;s.length&&(c=s[s.length-1]).i<=o;)s.pop(),l.push(c.vs),o++;return o}function i(l){return(s,o)=>s.barycenter<o.barycenter?-1:s.barycenter>o.barycenter?1:l?o.i-s.i:s.i-o.i}return bm}var _m,U1;function Z5(){if(U1)return _m;U1=1;let e=P5(),t=V5(),n=$5();_m=i;function i(o,c,d,h){let m=o.children(c),p=o.node(c),y=p?p.borderLeft:void 0,v=p?p.borderRight:void 0,b={};y&&(m=m.filter(A=>A!==y&&A!==v));let _=e(o,m);_.forEach(A=>{if(o.children(A.v).length){let E=i(o,A.v,d,h);b[A.v]=E,Object.hasOwn(E,"barycenter")&&s(A,E)}});let S=t(_,d);l(S,b);let k=n(S,h);if(y&&(k.vs=[y,k.vs,v].flat(!0),o.predecessors(y).length)){let A=o.node(o.predecessors(y)[0]),E=o.node(o.predecessors(v)[0]);Object.hasOwn(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+A.order+E.order)/(k.weight+2),k.weight+=2}return k}function l(o,c){o.forEach(d=>{d.vs=d.vs.flatMap(h=>c[h]?c[h].vs:h)})}function s(o,c){o.barycenter!==void 0?(o.barycenter=(o.barycenter*o.weight+c.barycenter*c.weight)/(o.weight+c.weight),o.weight+=c.weight):(o.barycenter=c.barycenter,o.weight=c.weight)}return _m}var wm,q1;function Y5(){if(q1)return wm;q1=1;let e=Pn().Graph,t=Tt();wm=n;function n(l,s,o){let c=i(l),d=new e({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(h=>l.node(h));return l.nodes().forEach(h=>{let m=l.node(h),p=l.parent(h);(m.rank===s||m.minRank<=s&&s<=m.maxRank)&&(d.setNode(h),d.setParent(h,p||c),l[o](h).forEach(y=>{let v=y.v===h?y.w:y.v,b=d.edge(v,h),_=b!==void 0?b.weight:0;d.setEdge(v,h,{weight:l.edge(y).weight+_})}),Object.hasOwn(m,"minRank")&&d.setNode(h,{borderLeft:m.borderLeft[s],borderRight:m.borderRight[s]}))}),d}function i(l){for(var s;l.hasNode(s=t.uniqueId("_root")););return s}return wm}var Sm,P1;function F5(){if(P1)return Sm;P1=1,Sm=e;function e(t,n,i){let l={},s;i.forEach(o=>{let c=t.parent(o),d,h;for(;c;){if(d=t.parent(c),d?(h=l[d],l[d]=c):(h=s,s=c),h&&h!==c){n.setEdge(h,c);return}c=d}})}return Sm}var Em,V1;function G5(){if(V1)return Em;V1=1;let e=U5(),t=q5(),n=Z5(),i=Y5(),l=F5(),s=Pn().Graph,o=Tt();Em=c;function c(p,y){if(y&&typeof y.customOrder=="function"){y.customOrder(p,c);return}let v=o.maxRank(p),b=d(p,o.range(1,v+1),"inEdges"),_=d(p,o.range(v-1,-1,-1),"outEdges"),S=e(p);if(m(p,S),y&&y.disableOptimalOrderHeuristic)return;let k=Number.POSITIVE_INFINITY,A;for(let E=0,O=0;O<4;++E,++O){h(E%2?b:_,E%4>=2),S=o.buildLayerMatrix(p);let D=t(p,S);D<k&&(O=0,A=Object.assign({},S),k=D)}m(p,A)}function d(p,y,v){return y.map(function(b){return i(p,b,v)})}function h(p,y){let v=new s;p.forEach(function(b){let _=b.graph().root,S=n(b,_,v,y);S.vs.forEach((k,A)=>b.node(k).order=A),l(b,v,S.vs)})}function m(p,y){Object.values(y).forEach(v=>v.forEach((b,_)=>p.node(b).order=_))}return Em}var km,$1;function X5(){if($1)return km;$1=1;let e=Pn().Graph,t=Tt();km={positionX:v,findType1Conflicts:n,findType2Conflicts:i,addConflict:s,hasConflict:o,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:p,findSmallestWidthAlignment:m,balance:y};function n(S,k){let A={};function E(O,D){let M=0,U=0,L=O.length,q=D[D.length-1];return D.forEach((N,B)=>{let H=l(S,N),F=H?S.node(H).order:L;(H||N===q)&&(D.slice(U,B+1).forEach(R=>{S.predecessors(R).forEach($=>{let j=S.node($),P=j.order;(P<M||F<P)&&!(j.dummy&&S.node(R).dummy)&&s(A,$,R)})}),U=B+1,M=F)}),D}return k.length&&k.reduce(E),A}function i(S,k){let A={};function E(D,M,U,L,q){let N;t.range(M,U).forEach(B=>{N=D[B],S.node(N).dummy&&S.predecessors(N).forEach(H=>{let F=S.node(H);F.dummy&&(F.order<L||F.order>q)&&s(A,H,N)})})}function O(D,M){let U=-1,L,q=0;return M.forEach((N,B)=>{if(S.node(N).dummy==="border"){let H=S.predecessors(N);H.length&&(L=S.node(H[0]).order,E(M,q,B,U,L),q=B,U=L)}E(M,q,M.length,L,D.length)}),M}return k.length&&k.reduce(O),A}function l(S,k){if(S.node(k).dummy)return S.predecessors(k).find(A=>S.node(A).dummy)}function s(S,k,A){if(k>A){let O=k;k=A,A=O}let E=S[k];E||(S[k]=E={}),E[A]=!0}function o(S,k,A){if(k>A){let E=k;k=A,A=E}return!!S[k]&&Object.hasOwn(S[k],A)}function c(S,k,A,E){let O={},D={},M={};return k.forEach(U=>{U.forEach((L,q)=>{O[L]=L,D[L]=L,M[L]=q})}),k.forEach(U=>{let L=-1;U.forEach(q=>{let N=E(q);if(N.length){N=N.sort((H,F)=>M[H]-M[F]);let B=(N.length-1)/2;for(let H=Math.floor(B),F=Math.ceil(B);H<=F;++H){let R=N[H];D[q]===q&&L<M[R]&&!o(A,q,R)&&(D[R]=q,D[q]=O[q]=O[R],L=M[R])}}})}),{root:O,align:D}}function d(S,k,A,E,O){let D={},M=h(S,k,A,O),U=O?"borderLeft":"borderRight";function L(B,H){let F=M.nodes(),R=F.pop(),$={};for(;R;)$[R]?B(R):($[R]=!0,F.push(R),F=F.concat(H(R))),R=F.pop()}function q(B){D[B]=M.inEdges(B).reduce((H,F)=>Math.max(H,D[F.v]+M.edge(F)),0)}function N(B){let H=M.outEdges(B).reduce((R,$)=>Math.min(R,D[$.w]-M.edge($)),Number.POSITIVE_INFINITY),F=S.node(B);H!==Number.POSITIVE_INFINITY&&F.borderType!==U&&(D[B]=Math.max(D[B],H))}return L(q,M.predecessors.bind(M)),L(N,M.successors.bind(M)),Object.keys(E).forEach(B=>D[B]=D[A[B]]),D}function h(S,k,A,E){let O=new e,D=S.graph(),M=b(D.nodesep,D.edgesep,E);return k.forEach(U=>{let L;U.forEach(q=>{let N=A[q];if(O.setNode(N),L){var B=A[L],H=O.edge(B,N);O.setEdge(B,N,Math.max(M(S,q,L),H||0))}L=q})}),O}function m(S,k){return Object.values(k).reduce((A,E)=>{let O=Number.NEGATIVE_INFINITY,D=Number.POSITIVE_INFINITY;Object.entries(E).forEach(([U,L])=>{let q=_(S,U)/2;O=Math.max(L+q,O),D=Math.min(L-q,D)});const M=O-D;return M<A[0]&&(A=[M,E]),A},[Number.POSITIVE_INFINITY,null])[1]}function p(S,k){let A=Object.values(k),E=t.applyWithChunking(Math.min,A),O=t.applyWithChunking(Math.max,A);["u","d"].forEach(D=>{["l","r"].forEach(M=>{let U=D+M,L=S[U];if(L===k)return;let q=Object.values(L),N=E-t.applyWithChunking(Math.min,q);M!=="l"&&(N=O-t.applyWithChunking(Math.max,q)),N&&(S[U]=t.mapValues(L,B=>B+N))})})}function y(S,k){return t.mapValues(S.ul,(A,E)=>{if(k)return S[k.toLowerCase()][E];{let O=Object.values(S).map(D=>D[E]).sort((D,M)=>D-M);return(O[1]+O[2])/2}})}function v(S){let k=t.buildLayerMatrix(S),A=Object.assign(n(S,k),i(S,k)),E={},O;["u","d"].forEach(M=>{O=M==="u"?k:Object.values(k).reverse(),["l","r"].forEach(U=>{U==="r"&&(O=O.map(B=>Object.values(B).reverse()));let L=(M==="u"?S.predecessors:S.successors).bind(S),q=c(S,O,A,L),N=d(S,O,q.root,q.align,U==="r");U==="r"&&(N=t.mapValues(N,B=>-B)),E[M+U]=N})});let D=m(S,E);return p(E,D),y(E,S.graph().align)}function b(S,k,A){return(E,O,D)=>{let M=E.node(O),U=E.node(D),L=0,q;if(L+=M.width/2,Object.hasOwn(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":q=-M.width/2;break;case"r":q=M.width/2;break}if(q&&(L+=A?q:-q),q=0,L+=(M.dummy?k:S)/2,L+=(U.dummy?k:S)/2,L+=U.width/2,Object.hasOwn(U,"labelpos"))switch(U.labelpos.toLowerCase()){case"l":q=U.width/2;break;case"r":q=-U.width/2;break}return q&&(L+=A?q:-q),q=0,L}}function _(S,k){return S.node(k).width}return km}var Tm,Z1;function Q5(){if(Z1)return Tm;Z1=1;let e=Tt(),t=X5().positionX;Tm=n;function n(l){l=e.asNonCompoundGraph(l),i(l),Object.entries(t(l)).forEach(([s,o])=>l.node(s).x=o)}function i(l){let s=e.buildLayerMatrix(l),o=l.graph().ranksep,c=0;s.forEach(d=>{const h=d.reduce((m,p)=>{const y=l.node(p).height;return m>y?m:y},0);d.forEach(m=>l.node(m).y=c+h/2),c+=h+o})}return Tm}var Cm,Y1;function K5(){if(Y1)return Cm;Y1=1;let e=R5(),t=z5(),n=j5(),i=Tt().normalizeRanks,l=L5(),s=Tt().removeEmptyRanks,o=I5(),c=B5(),d=H5(),h=G5(),m=Q5(),p=Tt(),y=Pn().Graph;Cm=v;function v(C,Y){let Q=Y&&Y.debugTiming?p.time:p.notime;Q("layout",()=>{let W=Q(" buildLayoutGraph",()=>L(C));Q(" runLayout",()=>b(W,Q,Y)),Q(" updateInputGraph",()=>_(C,W))})}function b(C,Y,Q){Y(" makeSpaceForEdgeLabels",()=>q(C)),Y(" removeSelfEdges",()=>K(C)),Y(" acyclic",()=>e.run(C)),Y(" nestingGraph.run",()=>o.run(C)),Y(" rank",()=>n(p.asNonCompoundGraph(C))),Y(" injectEdgeLabelProxies",()=>N(C)),Y(" removeEmptyRanks",()=>s(C)),Y(" nestingGraph.cleanup",()=>o.cleanup(C)),Y(" normalizeRanks",()=>i(C)),Y(" assignRankMinMax",()=>B(C)),Y(" removeEdgeLabelProxies",()=>H(C)),Y(" normalize.run",()=>t.run(C)),Y(" parentDummyChains",()=>l(C)),Y(" addBorderSegments",()=>c(C)),Y(" order",()=>h(C,Q)),Y(" insertSelfEdges",()=>X(C)),Y(" adjustCoordinateSystem",()=>d.adjust(C)),Y(" position",()=>m(C)),Y(" positionSelfEdges",()=>w(C)),Y(" removeBorderNodes",()=>P(C)),Y(" normalize.undo",()=>t.undo(C)),Y(" fixupEdgeLabelCoords",()=>$(C)),Y(" undoCoordinateSystem",()=>d.undo(C)),Y(" translateGraph",()=>F(C)),Y(" assignNodeIntersects",()=>R(C)),Y(" reversePoints",()=>j(C)),Y(" acyclic.undo",()=>e.undo(C))}function _(C,Y){C.nodes().forEach(Q=>{let W=C.node(Q),ue=Y.node(Q);W&&(W.x=ue.x,W.y=ue.y,W.rank=ue.rank,Y.children(Q).length&&(W.width=ue.width,W.height=ue.height))}),C.edges().forEach(Q=>{let W=C.edge(Q),ue=Y.edge(Q);W.points=ue.points,Object.hasOwn(ue,"x")&&(W.x=ue.x,W.y=ue.y)}),C.graph().width=Y.graph().width,C.graph().height=Y.graph().height}let S=["nodesep","edgesep","ranksep","marginx","marginy"],k={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},A=["acyclicer","ranker","rankdir","align"],E=["width","height"],O={width:0,height:0},D=["minlen","weight","width","height","labeloffset"],M={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"];function L(C){let Y=new y({multigraph:!0,compound:!0}),Q=te(C.graph());return Y.setGraph(Object.assign({},k,Z(Q,S),p.pick(Q,A))),C.nodes().forEach(W=>{let ue=te(C.node(W));const ce=Z(ue,E);Object.keys(O).forEach(ge=>{ce[ge]===void 0&&(ce[ge]=O[ge])}),Y.setNode(W,ce),Y.setParent(W,C.parent(W))}),C.edges().forEach(W=>{let ue=te(C.edge(W));Y.setEdge(W,Object.assign({},M,Z(ue,D),p.pick(ue,U)))}),Y}function q(C){let Y=C.graph();Y.ranksep/=2,C.edges().forEach(Q=>{let W=C.edge(Q);W.minlen*=2,W.labelpos.toLowerCase()!=="c"&&(Y.rankdir==="TB"||Y.rankdir==="BT"?W.width+=W.labeloffset:W.height+=W.labeloffset)})}function N(C){C.edges().forEach(Y=>{let Q=C.edge(Y);if(Q.width&&Q.height){let W=C.node(Y.v),ce={rank:(C.node(Y.w).rank-W.rank)/2+W.rank,e:Y};p.addDummyNode(C,"edge-proxy",ce,"_ep")}})}function B(C){let Y=0;C.nodes().forEach(Q=>{let W=C.node(Q);W.borderTop&&(W.minRank=C.node(W.borderTop).rank,W.maxRank=C.node(W.borderBottom).rank,Y=Math.max(Y,W.maxRank))}),C.graph().maxRank=Y}function H(C){C.nodes().forEach(Y=>{let Q=C.node(Y);Q.dummy==="edge-proxy"&&(C.edge(Q.e).labelRank=Q.rank,C.removeNode(Y))})}function F(C){let Y=Number.POSITIVE_INFINITY,Q=0,W=Number.POSITIVE_INFINITY,ue=0,ce=C.graph(),ge=ce.marginx||0,ke=ce.marginy||0;function we(ye){let Re=ye.x,ze=ye.y,lt=ye.width,ot=ye.height;Y=Math.min(Y,Re-lt/2),Q=Math.max(Q,Re+lt/2),W=Math.min(W,ze-ot/2),ue=Math.max(ue,ze+ot/2)}C.nodes().forEach(ye=>we(C.node(ye))),C.edges().forEach(ye=>{let Re=C.edge(ye);Object.hasOwn(Re,"x")&&we(Re)}),Y-=ge,W-=ke,C.nodes().forEach(ye=>{let Re=C.node(ye);Re.x-=Y,Re.y-=W}),C.edges().forEach(ye=>{let Re=C.edge(ye);Re.points.forEach(ze=>{ze.x-=Y,ze.y-=W}),Object.hasOwn(Re,"x")&&(Re.x-=Y),Object.hasOwn(Re,"y")&&(Re.y-=W)}),ce.width=Q-Y+ge,ce.height=ue-W+ke}function R(C){C.edges().forEach(Y=>{let Q=C.edge(Y),W=C.node(Y.v),ue=C.node(Y.w),ce,ge;Q.points?(ce=Q.points[0],ge=Q.points[Q.points.length-1]):(Q.points=[],ce=ue,ge=W),Q.points.unshift(p.intersectRect(W,ce)),Q.points.push(p.intersectRect(ue,ge))})}function $(C){C.edges().forEach(Y=>{let Q=C.edge(Y);if(Object.hasOwn(Q,"x"))switch((Q.labelpos==="l"||Q.labelpos==="r")&&(Q.width-=Q.labeloffset),Q.labelpos){case"l":Q.x-=Q.width/2+Q.labeloffset;break;case"r":Q.x+=Q.width/2+Q.labeloffset;break}})}function j(C){C.edges().forEach(Y=>{let Q=C.edge(Y);Q.reversed&&Q.points.reverse()})}function P(C){C.nodes().forEach(Y=>{if(C.children(Y).length){let Q=C.node(Y),W=C.node(Q.borderTop),ue=C.node(Q.borderBottom),ce=C.node(Q.borderLeft[Q.borderLeft.length-1]),ge=C.node(Q.borderRight[Q.borderRight.length-1]);Q.width=Math.abs(ge.x-ce.x),Q.height=Math.abs(ue.y-W.y),Q.x=ce.x+Q.width/2,Q.y=W.y+Q.height/2}}),C.nodes().forEach(Y=>{C.node(Y).dummy==="border"&&C.removeNode(Y)})}function K(C){C.edges().forEach(Y=>{if(Y.v===Y.w){var Q=C.node(Y.v);Q.selfEdges||(Q.selfEdges=[]),Q.selfEdges.push({e:Y,label:C.edge(Y)}),C.removeEdge(Y)}})}function X(C){var Y=p.buildLayerMatrix(C);Y.forEach(Q=>{var W=0;Q.forEach((ue,ce)=>{var ge=C.node(ue);ge.order=ce+W,(ge.selfEdges||[]).forEach(ke=>{p.addDummyNode(C,"selfedge",{width:ke.label.width,height:ke.label.height,rank:ge.rank,order:ce+ ++W,e:ke.e,label:ke.label},"_se")}),delete ge.selfEdges})})}function w(C){C.nodes().forEach(Y=>{var Q=C.node(Y);if(Q.dummy==="selfedge"){var W=C.node(Q.e.v),ue=W.x+W.width/2,ce=W.y,ge=Q.x-ue,ke=W.height/2;C.setEdge(Q.e,Q.label),C.removeNode(Y),Q.label.points=[{x:ue+2*ge/3,y:ce-ke},{x:ue+5*ge/6,y:ce-ke},{x:ue+ge,y:ce},{x:ue+5*ge/6,y:ce+ke},{x:ue+2*ge/3,y:ce+ke}],Q.label.x=Q.x,Q.label.y=Q.y}})}function Z(C,Y){return p.mapValues(p.pick(C,Y),Number)}function te(C){var Y={};return C&&Object.entries(C).forEach(([Q,W])=>{typeof Q=="string"&&(Q=Q.toLowerCase()),Y[Q]=W}),Y}return Cm}var Am,F1;function J5(){if(F1)return Am;F1=1;let e=Tt(),t=Pn().Graph;Am={debugOrdering:n};function n(i){let l=e.buildLayerMatrix(i),s=new t({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(o=>{s.setNode(o,{label:o}),s.setParent(o,"layer"+i.node(o).rank)}),i.edges().forEach(o=>s.setEdge(o.v,o.w,{},o.name)),l.forEach((o,c)=>{let d="layer"+c;s.setNode(d,{rank:"same"}),o.reduce((h,m)=>(s.setEdge(h,m,{style:"invis"}),m))}),s}return Am}var Nm,G1;function W5(){return G1||(G1=1,Nm="1.1.4"),Nm}var Om,X1;function eI(){return X1||(X1=1,Om={graphlib:Pn(),layout:K5(),debug:J5(),util:{time:Tt().time,notime:Tt().notime},version:W5()}),Om}var tI=eI();const Q1=yi(tI);function nI(e){const t=new Map,n=[],i=s=>{const o=s.id.split(":"),c=o.slice(0,-1).join(":");if(o.length!==1){if(!t.has(c)){const d={id:c,type:"group",data:{label:c.split(":").pop(),name:c.split(":").pop()},position:{x:0,y:0},style:{},parentId:void 0},h=i(d);h&&(d.parentId=h.id),t.set(c,d)}return t.get(c)}};return e.forEach(s=>{const o={...s,id:s.id.toString(),position:{x:0,y:0},data:{label:s.id.split(":").pop(),name:s.id.split(":").pop()}},c=i(o);c&&(o.parentId=c.id.toString()),n.push(o)}),[...Array.from(t.values()),...n]}const rI={group:({data:e})=>I.jsx("div",{style:{position:"absolute",bottom:"100%",left:0},children:I.jsx("span",{children:e.name})})},iI=(e,t)=>{const n=e.map(i=>{const l=t.find(d=>d.id===i.source.toString()),s=t.find(d=>d.id===i.target.toString()),o=l==null?void 0:l.id,c=s==null?void 0:s.id;return{id:`${o}=${c}`,source:o,target:c,animated:i.conditional,label:i.data,style:{stroke:i.conditional?"#2563eb":"#64748b"}}});if(!n.find(i=>i.target==="__end__")){const i=[...t].reverse().find(l=>l.id.endsWith(":__end__"));i&&n.push({id:`${i.id}=__end__`,source:i.id,target:"__end__",type:"smoothstep"})}return n},aI=()=>{const{fitView:e}=Oc(),{graphVisualize:t,currentNodeName:n}=al(),i=t||{nodes:[],edges:[]},l=nI(i.nodes.map(v=>({...v,type:"default"}))),s=iI(i.edges,l),[o,c,d]=Z6(l),[h,m,p]=Y6(s),y=ie.useCallback(v=>{const b=K1(o,h,{direction:v});c([...b.nodes]),m([...b.edges]),e()},[o,h]);return ie.useEffect(()=>{if(i.nodes.length>0){const v=K1(l,s,{direction:"TB"});c([...v.nodes]),m([...v.edges]),e()}},[i]),ie.useEffect(()=>{const v=o.findIndex(b=>b.id.endsWith(n));if(v!==-1){const b=[...o].map(_=>({..._,selected:!1}));b[v]={...b[v],selected:!0},c(b),e()}},[n]),I.jsx("div",{style:{width:"30%",height:"100%",position:"relative",overflow:"hidden"},children:I.jsxs($6,{nodes:o,edges:h,onNodesChange:d,onEdgesChange:p,fitView:!0,className:"w-full h-full",nodeTypes:rI,children:[I.jsx(K6,{}),I.jsx(i5,{}),I.jsxs(eu,{position:"top-right",children:[I.jsx("button",{onClick:()=>y("TB"),children:"垂直布局"}),I.jsx("button",{onClick:()=>y("LR"),children:"水平布局"})]})]})})},K1=(e,t,n)=>{const i=new Q1.graphlib.Graph({compound:!0,multigraph:!0}).setDefaultEdgeLabel(()=>({}));i.setGraph({rankdir:n.direction,nodesep:40,ranksep:40,edgesep:20}),e.forEach(c=>{c.type!=="group"&&i.setNode(c.id,{...c,width:128,height:20})}),t.forEach(c=>i.setEdge(c.source,c.target)),Q1.layout(i);const l=e.map(c=>{const d=i.node(c.id);if(!d)return{...c};let h=0,m=0;return h=d.x+((d==null?void 0:d.width)??0),m=d.y+((d==null?void 0:d.height)??0),{...c,position:{x:h,y:m},_p:d,width:d.width,height:d.height}}),s=new Map,o=15;return[...l].reverse().forEach(c=>{if(c.type==="group"){const d=s.get(c.id)||[],h=Math.min(...d.map(v=>v.position.x)),m=Math.min(...d.map(v=>v.position.y)),p=Math.max(...d.map(v=>v.position.x+(v.width??0))),y=Math.max(...d.map(v=>v.position.y+(v.height??0)));c.position.x=h-o,c.position.y=m-o,c.width=p-h+o*2,c.height=y-m+o*2,d.forEach(v=>{v.position.x=v.position.x-c.position.x,v.position.y=v.position.y-c.position.y})}c.parentId&&s.set(c.parentId,[...s.get(c.parentId)??[],c])}),{nodes:l,edges:t}};function lI(){return I.jsx(tE,{children:I.jsx(aI,{})})}const sI=()=>I.jsx(lI,{}),uI=()=>{const{renderMessages:e,loading:t,inChatError:n,client:i,collapsedTools:l,toggleToolCollapse:s}=al();return I.jsxs("div",{className:"chat-messages",children:[I.jsx(gw,{renderMessages:e,collapsedTools:l,toggleToolCollapse:s,client:i}),t&&I.jsx("div",{className:"loading-indicator",children:"正在思考中..."}),n&&I.jsx("div",{className:"error-message",children:JSON.stringify(n)})]})},oI=()=>{const{userInput:e,setUserInput:t,loading:n,sendMessage:i,stopGeneration:l,currentAgent:s,setCurrentAgent:o,client:c}=al(),{extraParams:d}=vw(),[h,m]=ie.useState([]),p=_=>{m(S=>[...S,_])},y=_=>{localStorage.setItem("agent_name",_),o(_)},v=()=>{const _=[{type:"human",content:[{type:"text",text:e},...h.map(S=>({type:"image_url",image_url:{url:S}}))]}];i(_,{extraParams:d}),m([])},b=_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),v())};return I.jsxs("div",{className:"chat-input",children:[I.jsxs("div",{className:"chat-input-header",children:[I.jsx(xz,{onFileUploaded:p}),I.jsx(op,{usage_metadata:(c==null?void 0:c.tokenCounter)||{}}),I.jsx("select",{value:s,onChange:_=>y(_.target.value),children:c==null?void 0:c.availableAssistants.map(_=>I.jsx("option",{value:_.graph_id,children:_.name},_.graph_id))})]}),I.jsxs("div",{className:"input-container",children:[I.jsx("textarea",{className:"input-textarea",rows:2,value:e,onChange:_=>t(_.target.value),onKeyDown:b,placeholder:"输入消息...",disabled:n}),I.jsx("button",{className:`send-button ${n?"interrupt":""}`,onClick:()=>n?l():v(),disabled:!n&&!e.trim()&&h.length===0,children:n?"中断":"发送"})]})]})},cI=()=>{const[e,t]=ie.useState(!1),{showHistory:n,toggleHistoryVisible:i,showGraph:l,toggleGraphVisible:s,renderMessages:o}=al(),{extraParams:c,setExtraParams:d}=vw();return I.jsxs("div",{className:"chat-container",children:[n&&I.jsx(pz,{onClose:()=>i(),formatTime:MC}),I.jsxs("div",{className:"chat-main",children:[I.jsxs("div",{className:"chat-header",children:[I.jsx(wz,{}),I.jsx("button",{onClick:()=>t(!0),className:"edit-params-button",children:"编辑参数"}),I.jsx("button",{className:"history-button",onClick:()=>{i(),Qx({showHistory:!n})},children:"历史记录"}),I.jsx("button",{className:"graph-button",onClick:()=>{s(),Qx({showGraph:!l})},children:"图"}),I.jsx("button",{className:"graph-button",onClick:()=>{console.log(o)},children:"日志数据"}),I.jsx("button",{className:"history-button",onClick:()=>{localStorage.setItem("code",""),location.reload()},children:"退出登陆"})]}),I.jsx(uI,{}),I.jsx(oI,{}),I.jsx(bz,{isOpen:e,initialJson:c,onClose:()=>t(!1),onSave:d})]}),l&&I.jsx(sI,{})]})},fI=()=>I.jsx(hz,{children:I.jsx(gz,{children:I.jsx(cI,{})})}),dI=()=>{const[e,t]=ie.useState([{key:"authorization",value:""}]),[n,i]=ie.useState(localStorage.getItem("withCredentials")==="true"),[l,s]=ie.useState(localStorage.getItem("apiUrl")||""),o=()=>{t([...e,{key:"",value:""}])},c=m=>{t(e.filter((p,y)=>y!==m))},d=(m,p,y)=>{const v=[...e];v[m][p]=y,t(v)},h=()=>{const m=Object.fromEntries(e.map(p=>[p.key,p.value]));localStorage.setItem("code",JSON.stringify(m)),localStorage.setItem("withCredentials",JSON.stringify(n)),localStorage.setItem("apiUrl",l),location.reload()};return I.jsx("div",{className:"login-container",children:I.jsxs("form",{onSubmit:m=>{m.preventDefault(),h()},children:[I.jsx("h2",{children:"LangGraph UI"}),I.jsx("p",{children:"登录,自定义请求头配置"}),I.jsxs("div",{className:"form-group api-url-group",children:[I.jsx("label",{htmlFor:"api-url",children:"API URL"}),I.jsx("input",{type:"text",id:"api-url",value:l,onChange:m=>s(m.target.value),placeholder:"例如: http://localhost:8123"})]}),e.map((m,p)=>I.jsxs("div",{className:"header-group",children:[I.jsx("div",{className:"form-group",children:I.jsx("input",{type:"text",id:`header-key-${p}`,value:m.key,onChange:y=>d(p,"key",y.target.value),placeholder:"例如: authorization",required:!0})}),I.jsx("div",{className:"form-group",children:I.jsx("input",{type:"text",id:`header-value-${p}`,value:m.value,onChange:y=>d(p,"value",y.target.value),placeholder:"例如: Bearer token;无则填 1",required:!0})}),p>0&&I.jsx("button",{type:"button",className:"remove-header",onClick:()=>c(p),children:"删除"})]},p)),I.jsx("div",{className:"with-credentials-option",children:I.jsxs("label",{children:[I.jsx("input",{type:"checkbox",checked:n,onChange:m=>i(m.target.checked)}),"启用 withCredentials(跨域请求时发送 Cookie)"]})}),I.jsxs("div",{className:"button-group",children:[I.jsx("button",{type:"button",onClick:o,children:"添加请求头"}),I.jsx("button",{type:"submit",children:"保存配置"})]})]})})};function hI(){const[e,t]=ie.useState(localStorage.getItem("code"));return I.jsx(I.Fragment,{children:e?I.jsx(fI,{}):I.jsx(dI,{})})}kT.createRoot(document.getElementById("root")).render(I.jsx(hI,{}));