@langgraph-js/ui 1.2.0 → 1.3.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.
Files changed (46) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +6 -6
  3. package/cli.mjs +36 -36
  4. package/dist/assets/index-88Ds6iYK.js +214 -0
  5. package/dist/assets/index-_qsGvf6N.css +1 -0
  6. package/dist/index.html +14 -14
  7. package/index.html +22 -22
  8. package/package.json +10 -9
  9. package/src/chat/Chat.tsx +169 -164
  10. package/src/chat/FileUpload/index.ts +105 -105
  11. package/src/chat/chat.css +403 -403
  12. package/src/chat/components/FileList.css +128 -128
  13. package/src/chat/components/FileList.tsx +73 -73
  14. package/src/chat/components/HistoryList.tsx +192 -192
  15. package/src/chat/components/JsonEditorPopup.css +80 -80
  16. package/src/chat/components/JsonEditorPopup.tsx +56 -56
  17. package/src/chat/components/JsonToMessage/JsonToMessage.css +104 -0
  18. package/src/chat/components/JsonToMessage/JsonToMessage.tsx +114 -0
  19. package/src/chat/components/JsonToMessage/JsonToMessageButton.tsx +27 -0
  20. package/src/chat/components/JsonToMessage/index.tsx +5 -0
  21. package/src/chat/components/MessageAI.tsx +24 -24
  22. package/src/chat/components/MessageBox.tsx +39 -0
  23. package/src/chat/components/MessageHuman.tsx +55 -55
  24. package/src/chat/components/MessageTool.tsx +46 -46
  25. package/src/chat/components/UsageMetadata.tsx +40 -40
  26. package/src/chat/context/ChatContext.tsx +32 -29
  27. package/src/chat/context/ExtraParamsContext.tsx +41 -41
  28. package/src/chat/store/index.ts +38 -24
  29. package/src/chat/tools.ts +33 -33
  30. package/src/chat/types.ts +16 -16
  31. package/src/graph/GraphPanel.tsx +5 -0
  32. package/src/graph/flattenGraph.ts +45 -0
  33. package/src/graph/flow.css +176 -0
  34. package/src/graph/index.tsx +161 -0
  35. package/src/hooks/useLocalStorage.ts +27 -27
  36. package/src/index.ts +1 -1
  37. package/src/login/Login.css +93 -93
  38. package/src/login/Login.tsx +92 -92
  39. package/test/App.tsx +9 -9
  40. package/test/main.tsx +5 -5
  41. package/test/vite-env.d.ts +1 -1
  42. package/tsconfig.json +21 -21
  43. package/tsconfig.node.json +9 -9
  44. package/vite.config.ts +22 -17
  45. package/dist/assets/index-BHPbGlnP.js +0 -192
  46. package/dist/assets/index-Du4LMUX2.css +0 -1
@@ -0,0 +1,214 @@
1
+ var kT=Object.defineProperty;var TT=(e,t,n)=>t in e?kT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xt=(e,t,n)=>TT(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 u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).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 Ei(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fh={exports:{}},ys={};/**
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 CT(){if(Bv)return ys;Bv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,l,s){var u=null;if(s!==void 0&&(u=""+s),l.key!==void 0&&(u=""+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:u,ref:l!==void 0?l:null,props:s}}return ys.Fragment=t,ys.jsx=n,ys.jsxs=n,ys}var Hv;function AT(){return Hv||(Hv=1,fh.exports=CT()),fh.exports}var I=AT(),dh={exports:{}},vs={},hh={exports:{}},mh={};/**
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 Uv;function NT(){return Uv||(Uv=1,function(e){function t(L,q){var K=L.length;L.push(q);e:for(;0<K;){var X=K-1>>>1,w=L[X];if(0<l(w,q))L[X]=q,L[K]=w,K=X;else break e}}function n(L){return L.length===0?null:L[0]}function i(L){if(L.length===0)return null;var q=L[0],K=L.pop();if(K!==q){L[0]=K;e:for(var X=0,w=L.length,Z=w>>>1;X<Z;){var te=2*(X+1)-1,C=L[te],Y=te+1,Q=L[Y];if(0>l(C,K))Y<w&&0>l(Q,C)?(L[X]=Q,L[Y]=K,X=Y):(L[X]=C,L[te]=K,X=te);else if(Y<w&&0>l(Q,K))L[X]=Q,L[Y]=K,X=Y;else break e}}return q}function l(L,q){var K=L.sortIndex-q.sortIndex;return K!==0?K:L.id-q.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 u=Date,c=u.now();e.unstable_now=function(){return u.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 N(L){for(var q=n(h);q!==null;){if(q.callback===null)i(h);else if(q.startTime<=L)i(h),q.sortIndex=q.expirationTime,t(d,q);else break;q=n(h)}}function j(L){if(_=!1,N(L),!b)if(n(d)!==null)b=!0,M||(M=!0,P());else{var q=n(h);q!==null&&$(j,q.startTime-L)}}var M=!1,U=-1,R=5,B=-1;function O(){return S?!0:!(e.unstable_now()-B<R)}function H(){if(S=!1,M){var L=e.unstable_now();B=L;var q=!0;try{e:{b=!1,_&&(_=!1,A(U),U=-1),v=!0;var K=y;try{t:{for(N(L),p=n(d);p!==null&&!(p.expirationTime>L&&O());){var X=p.callback;if(typeof X=="function"){p.callback=null,y=p.priorityLevel;var w=X(p.expirationTime<=L);if(L=e.unstable_now(),typeof w=="function"){p.callback=w,N(L),q=!0;break t}p===n(d)&&i(d),N(L)}else i(d);p=n(d)}if(p!==null)q=!0;else{var Z=n(h);Z!==null&&$(j,Z.startTime-L),q=!1}}break e}finally{p=null,y=K,v=!1}q=void 0}}finally{q?P():M=!1}}}var P;if(typeof E=="function")P=function(){E(H)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,z=F.port2;F.port1.onmessage=H,P=function(){z.postMessage(null)}}else P=function(){k(H,0)};function $(L,q){U=k(function(){L(e.unstable_now())},q)}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(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(L){switch(y){case 1:case 2:case 3:var q=3;break;default:q=y}var K=y;y=q;try{return L()}finally{y=K}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(L,q){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var K=y;y=L;try{return q()}finally{y=K}},e.unstable_scheduleCallback=function(L,q,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,L){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,L={id:m++,callback:q,priorityLevel:L,startTime:K,expirationTime:w,sortIndex:-1},K>X?(L.sortIndex=K,t(h,L),n(d)===null&&L===n(h)&&(_?(A(U),U=-1):_=!0,$(j,K-X))):(L.sortIndex=w,t(d,L),b||v||(b=!0,M||(M=!0,P()))),L},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(L){var q=y;return function(){var K=y;y=q;try{return L.apply(this,arguments)}finally{y=K}}}}(mh)),mh}var Pv;function MT(){return Pv||(Pv=1,hh.exports=NT()),hh.exports}var ph={exports:{}},Ie={};/**
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 qv;function OT(){if(qv)return Ie;qv=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"),u=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 N=Array.isArray,j={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 R(w,Z){return U(w.type,Z,void 0,void 0,void 0,w.props)}function B(w){return typeof w=="object"&&w!==null&&w.$$typeof===e}function O(w){var Z={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(te){return Z[te]})}var H=/\/+/g;function P(w,Z){return typeof w=="object"&&w!==null&&w.key!=null?O(""+w.key):Z.toString(36)}function F(){}function z(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===""?"."+P(w,0):C,N(Y)?(te="",W!=null&&(te=W.replace(H,"$&/")+"/"),$(Y,Z,te,"",function(ge){return ge})):Y!=null&&(B(Y)&&(Y=R(Y,te+(Y.key==null||w&&w.key===Y.key?"":(""+Y.key).replace(H,"$&/")+"/")+W)),Z.push(Y)),1;W=0;var ue=C===""?".":C+":";if(N(w))for(var ce=0;ce<w.length;ce++)C=w[ce],Q=ue+P(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+P(C,ce++),W+=$(C,Z,te,Q,Y);else if(Q==="object"){if(typeof w.then=="function")return $(z(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 L(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 q(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 Ie.Children={map:L,forEach:function(w,Z,te){L(w,function(){Z.apply(this,arguments)},te)},count:function(w){var Z=0;return L(w,function(){Z++}),Z},toArray:function(w){return L(w,function(Z){return Z})||[]},only:function(w){if(!B(w))throw Error("React.Children.only expected to receive a single React element child.");return w}},Ie.Component=S,Ie.Fragment=n,Ie.Profiler=l,Ie.PureComponent=A,Ie.StrictMode=i,Ie.Suspense=d,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(w){return j.H.useMemoCache(w)}},Ie.cache=function(w){return function(){return w.apply(null,arguments)}},Ie.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)},Ie.createContext=function(w){return w={$$typeof:u,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:s,_context:w},w},Ie.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)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(w){return{$$typeof:c,render:w}},Ie.isValidElement=B,Ie.lazy=function(w){return{$$typeof:m,_payload:{_status:-1,_result:w},_init:q}},Ie.memo=function(w,Z){return{$$typeof:h,type:w,compare:Z===void 0?null:Z}},Ie.startTransition=function(w){var Z=j.T,te={};j.T=te;try{var C=w(),Y=j.S;Y!==null&&Y(te,C),typeof C=="object"&&C!==null&&typeof C.then=="function"&&C.then(X,K)}catch(Q){K(Q)}finally{j.T=Z}},Ie.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ie.use=function(w){return j.H.use(w)},Ie.useActionState=function(w,Z,te){return j.H.useActionState(w,Z,te)},Ie.useCallback=function(w,Z){return j.H.useCallback(w,Z)},Ie.useContext=function(w){return j.H.useContext(w)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(w,Z){return j.H.useDeferredValue(w,Z)},Ie.useEffect=function(w,Z,te){var C=j.H;if(typeof te=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return C.useEffect(w,Z)},Ie.useId=function(){return j.H.useId()},Ie.useImperativeHandle=function(w,Z,te){return j.H.useImperativeHandle(w,Z,te)},Ie.useInsertionEffect=function(w,Z){return j.H.useInsertionEffect(w,Z)},Ie.useLayoutEffect=function(w,Z){return j.H.useLayoutEffect(w,Z)},Ie.useMemo=function(w,Z){return j.H.useMemo(w,Z)},Ie.useOptimistic=function(w,Z){return j.H.useOptimistic(w,Z)},Ie.useReducer=function(w,Z,te){return j.H.useReducer(w,Z,te)},Ie.useRef=function(w){return j.H.useRef(w)},Ie.useState=function(w){return j.H.useState(w)},Ie.useSyncExternalStore=function(w,Z,te){return j.H.useSyncExternalStore(w,Z,te)},Ie.useTransition=function(){return j.H.useTransition()},Ie.version="19.1.0",Ie}var Vv;function cu(){return Vv||(Vv=1,ph.exports=OT()),ph.exports}var gh={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 $v;function RT(){if($v)return Ut;$v=1;var e=cu();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 u=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=u.T,m=i.p;try{if(u.T=null,i.p=2,d)return d()}finally{u.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 u.H.useFormState(d,h,m)},Ut.useFormStatus=function(){return u.H.useHostTransitionStatus()},Ut.version="19.1.0",Ut}var Zv;function i_(){if(Zv)return gh.exports;Zv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),gh.exports=RT(),gh.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 Yv;function zT(){if(Yv)return vs;Yv=1;var e=MT(),t=cu(),n=i_();function i(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)a+="&args[]="+encodeURIComponent(arguments[o])}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,o=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,(a.flags&4098)!==0&&(o=a.return),r=a.return;while(r)}return a.tag===3?o:null}function u(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 o=r,f=a;;){var g=o.return;if(g===null)break;var x=g.alternate;if(x===null){if(f=g.return,f!==null){o=f;continue}break}if(g.child===x.child){for(x=g.child;x;){if(x===o)return c(g),r;if(x===f)return c(g),a;x=x.sibling}throw Error(i(188))}if(o.return!==f.return)o=g,f=x;else{for(var T=!1,D=g.child;D;){if(D===o){T=!0,o=g,f=x;break}if(D===f){T=!0,f=g,o=x;break}D=D.sibling}if(!T){for(D=x.child;D;){if(D===o){T=!0,o=x,f=g;break}if(D===f){T=!0,f=x,o=g;break}D=D.sibling}if(!T)throw Error(i(189))}}if(o.alternate!==f)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?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"),N=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function P(r){return r===null||typeof r!="object"?null:(r=H&&r[H]||r["@@iterator"],typeof r=="function"?r:null)}var F=Symbol.for("react.client.reference");function z(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 j:return"Suspense";case M:return"SuspenseList";case B: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 N: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:z(r.type)||"Memo";case R:a=r._payload,r=r._init;try{return z(r(a))}catch{}}return null}var $=Array.isArray,L=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=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)?dv(r):0;break;default:if(r=a.tagName,a=a.namespaceURI)a=dv(a),r=hv(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,o=hv(a,r.type);a!==o&&(C(Q,r),C(Y,o))}function we(r){Q.current===r&&(te(Y),te(Q)),ue.current===r&&(te(ue),ds._currentValue=K)}var ve=Object.prototype.hasOwnProperty,ze=e.unstable_scheduleCallback,De=e.unstable_cancelCallback,lt=e.unstable_shouldYield,ot=e.unstable_requestPaint,bt=e.unstable_now,Ti=e.unstable_getCurrentPriorityLevel,fr=e.unstable_ImmediatePriority,Mn=e.unstable_UserBlockingPriority,Xn=e.unstable_NormalPriority,dr=e.unstable_LowPriority,Qn=e.unstable_IdlePriority,Ci=e.log,Kn=e.unstable_setDisableYieldValue,le=null,de=null;function Ee(r){if(typeof Ci=="function"&&Kn(r),de&&typeof de.setStrictMode=="function")try{de.setStrictMode(le,r)}catch{}}var Te=Math.clz32?Math.clz32:On,Xe=Math.log,$t=Math.LN2;function On(r){return r>>>=0,r===0?32:31-(Xe(r)/$t|0)|0}var It=256,bn=4194304;function Zt(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 _t(r,a,o){var f=r.pendingLanes;if(f===0)return 0;var g=0,x=r.suspendedLanes,T=r.pingedLanes;r=r.warmLanes;var D=f&134217727;return D!==0?(f=D&~x,f!==0?g=Zt(f):(T&=D,T!==0?g=Zt(T):o||(o=D&~r,o!==0&&(g=Zt(o))))):(D=f&~x,D!==0?g=Zt(D):T!==0?g=Zt(T):o||(o=f&~r,o!==0&&(g=Zt(o)))),g===0?0:a!==0&&a!==g&&(a&x)===0&&(x=g&-g,o=a&-a,x>=o||x===32&&(o&4194048)!==0)?a:g}function Qt(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function sn(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 wu(){var r=It;return It<<=1,(It&4194048)===0&&(It=256),r}function Su(){var r=bn;return bn<<=1,(bn&62914560)===0&&(bn=4194304),r}function pl(r){for(var a=[],o=0;31>o;o++)a.push(r);return a}function Ai(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function tf(r,a,o,f,g,x){var T=r.pendingLanes;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=o,r.entangledLanes&=o,r.errorRecoveryDisabledLanes&=o,r.shellSuspendCounter=0;var D=r.entanglements,V=r.expirationTimes,ne=r.hiddenUpdates;for(o=T&~o;0<o;){var se=31-Te(o),fe=1<<se;D[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)}o&=~fe}f!==0&&gl(r,f,0),x!==0&&g===0&&r.tag!==0&&(r.suspendedLanes|=x&~(T&~a))}function gl(r,a,o){r.pendingLanes|=a,r.suspendedLanes&=~a;var f=31-Te(a);r.entangledLanes|=a,r.entanglements[f]=r.entanglements[f]|1073741824|o&4194090}function Eu(r,a){var o=r.entangledLanes|=a;for(r=r.entanglements;o;){var f=31-Te(o),g=1<<f;g&a|r[f]&a&&(r[f]|=a),o&=~g}}function yl(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 vl(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ku(){var r=q.p;return r!==0?r:(r=window.event,r===void 0?32:Rv(r.type))}function nf(r,a){var o=q.p;try{return q.p=r,a()}finally{q.p=o}}var Jn=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Jn,Bt="__reactProps$"+Jn,Hr="__reactContainer$"+Jn,xl="__reactEvents$"+Jn,rf="__reactListeners$"+Jn,af="__reactHandles$"+Jn,Tu="__reactResources$"+Jn,Ni="__reactMarker$"+Jn;function bl(r){delete r[Mt],delete r[Bt],delete r[xl],delete r[rf],delete r[af]}function hr(r){var a=r[Mt];if(a)return a;for(var o=r.parentNode;o;){if(a=o[Hr]||o[Mt]){if(o=a.alternate,a.child!==null||o!==null&&o.child!==null)for(r=yv(r);r!==null;){if(o=r[Mt])return o;r=yv(r)}return a}r=o,o=r.parentNode}return null}function mr(r){if(r=r[Mt]||r[Hr]){var a=r.tag;if(a===5||a===6||a===13||a===26||a===27||a===3)return r}return null}function Ur(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(i(33))}function Pr(r){var a=r[Tu];return a||(a=r[Tu]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function wt(r){r[Ni]=!0}var Cu=new Set,Au={};function pr(r,a){qr(r,a),qr(r+"Capture",a)}function qr(r,a){for(Au[r]=a,r=0;r<a.length;r++)Cu.add(a[r])}var Nu=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]*$"),Mu={},Ou={};function lf(r){return ve.call(Ou,r)?!0:ve.call(Mu,r)?!1:Nu.test(r)?Ou[r]=!0:(Mu[r]=!0,!1)}function la(r,a,o){if(lf(a))if(o===null)r.removeAttribute(a);else{switch(typeof o){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,""+o)}}function sa(r,a,o){if(o===null)r.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+o)}}function Rn(r,a,o,f){if(f===null)r.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttributeNS(a,o,""+f)}}var _l,wl;function Vr(r){if(_l===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);_l=a&&a[1]||"",wl=-1<o.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+_l+r+wl}var Sl=!1;function El(r,a){if(!r||Sl)return"";Sl=!0;var o=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],D=x[1];if(T&&D){var V=T.split(`
44
+ `),ne=D.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{Sl=!1,Error.prepareStackTrace=o}return(o=r?r.displayName||r.name:"")?Vr(o):""}function sf(r){switch(r.tag){case 26:case 27:case 5:return Vr(r.type);case 16:return Vr("Lazy");case 13:return Vr("Suspense");case 19:return Vr("SuspenseList");case 0:case 15:return El(r.type,!1);case 11:return El(r.type.render,!1);case 1:return El(r.type,!0);case 31:return Vr("Activity");default:return""}}function Ru(r){try{var a="";do a+=sf(r),r=r.return;while(r);return a}catch(o){return`
47
+ Error generating stack: `+o.message+`
48
+ `+o.stack}}function Kt(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function zu(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function ua(r){var a=zu(r)?"checked":"value",o=Object.getOwnPropertyDescriptor(r.constructor.prototype,a),f=""+r[a];if(!r.hasOwnProperty(a)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var g=o.get,x=o.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:o.enumerable}),{getValue:function(){return f},setValue:function(T){f=""+T},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function oa(r){r._valueTracker||(r._valueTracker=ua(r))}function Du(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var o=a.getValue(),f="";return r&&(f=zu(r)?r.checked?"true":"false":r.value),r=f,r!==o?(a.setValue(r),!0):!1}function $r(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 uf=/[\n"\\]/g;function Jt(r){return r.replace(uf,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function ca(r,a,o,f,g,x,T,D){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=""+Kt(a)):r.value!==""+Kt(a)&&(r.value=""+Kt(a)):T!=="submit"&&T!=="reset"||r.removeAttribute("value"),a!=null?of(r,T,Kt(a)):o!=null?of(r,T,Kt(o)):f!=null&&r.removeAttribute("value"),g==null&&x!=null&&(r.defaultChecked=!!x),g!=null&&(r.checked=g&&typeof g!="function"&&typeof g!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?r.name=""+Kt(D):r.removeAttribute("name")}function og(r,a,o,f,g,x,T,D){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(r.type=x),a!=null||o!=null){if(!(x!=="submit"&&x!=="reset"||a!=null))return;o=o!=null?""+Kt(o):"",a=a!=null?""+Kt(a):o,D||a===r.value||(r.value=a),r.defaultValue=a}f=f??g,f=typeof f!="function"&&typeof f!="symbol"&&!!f,r.checked=D?r.checked:!!f,r.defaultChecked=!!f,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(r.name=T)}function of(r,a,o){a==="number"&&$r(r.ownerDocument)===r||r.defaultValue===""+o||(r.defaultValue=""+o)}function fa(r,a,o,f){if(r=r.options,a){a={};for(var g=0;g<o.length;g++)a["$"+o[g]]=!0;for(o=0;o<r.length;o++)g=a.hasOwnProperty("$"+r[o].value),r[o].selected!==g&&(r[o].selected=g),g&&f&&(r[o].defaultSelected=!0)}else{for(o=""+Kt(o),a=null,g=0;g<r.length;g++){if(r[g].value===o){r[g].selected=!0,f&&(r[g].defaultSelected=!0);return}a!==null||r[g].disabled||(a=r[g])}a!==null&&(a.selected=!0)}}function cg(r,a,o){if(a!=null&&(a=""+Kt(a),a!==r.value&&(r.value=a),o==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=o!=null?""+Kt(o):""}function fg(r,a,o,f){if(a==null){if(f!=null){if(o!=null)throw Error(i(92));if($(f)){if(1<f.length)throw Error(i(93));f=f[0]}o=f}o==null&&(o=""),a=o}o=Kt(a),r.defaultValue=o,f=r.textContent,f===o&&f!==""&&f!==null&&(r.value=f)}function da(r,a){if(a){var o=r.firstChild;if(o&&o===r.lastChild&&o.nodeType===3){o.nodeValue=a;return}}r.textContent=a}var wE=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 dg(r,a,o){var f=a.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?f?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":f?r.setProperty(a,o):typeof o!="number"||o===0||wE.has(a)?a==="float"?r.cssFloat=o:r[a]=(""+o).trim():r[a]=o+"px"}function hg(r,a,o){if(a!=null&&typeof a!="object")throw Error(i(62));if(r=r.style,o!=null){for(var f in o)!o.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)&&o[g]!==f&&dg(r,g,f)}else for(var x in a)a.hasOwnProperty(x)&&dg(r,x,a[x])}function cf(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 SE=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"]]),EE=/^[\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 ju(r){return EE.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}var ff=null;function df(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ha=null,ma=null;function mg(r){var a=mr(r);if(a&&(r=a.stateNode)){var o=r[Bt]||null;e:switch(r=a.stateNode,a.type){case"input":if(ca(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),a=o.name,o.type==="radio"&&a!=null){for(o=r;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Jt(""+a)+'"][type="radio"]'),a=0;a<o.length;a++){var f=o[a];if(f!==r&&f.form===r.form){var g=f[Bt]||null;if(!g)throw Error(i(90));ca(f,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(a=0;a<o.length;a++)f=o[a],f.form===r.form&&Du(f)}break e;case"textarea":cg(r,o.value,o.defaultValue);break e;case"select":a=o.value,a!=null&&fa(r,!!o.multiple,a,!1)}}}var hf=!1;function pg(r,a,o){if(hf)return r(a,o);hf=!0;try{var f=r(a);return f}finally{if(hf=!1,(ha!==null||ma!==null)&&(_o(),ha&&(a=ha,r=ma,ma=ha=null,mg(a),r)))for(a=0;a<r.length;a++)mg(r[a])}}function kl(r,a){var o=r.stateNode;if(o===null)return null;var f=o[Bt]||null;if(f===null)return null;o=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(o&&typeof o!="function")throw Error(i(231,a,typeof o));return o}var gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mf=!1;if(gr)try{var Tl={};Object.defineProperty(Tl,"passive",{get:function(){mf=!0}}),window.addEventListener("test",Tl,Tl),window.removeEventListener("test",Tl,Tl)}catch{mf=!1}var Zr=null,pf=null,Lu=null;function gg(){if(Lu)return Lu;var r,a=pf,o=a.length,f,g="value"in Zr?Zr.value:Zr.textContent,x=g.length;for(r=0;r<o&&a[r]===g[r];r++);var T=o-r;for(f=1;f<=T&&a[o-f]===g[x-f];f++);return Lu=g.slice(r,1<f?1-f:void 0)}function Iu(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 Bu(){return!0}function yg(){return!1}function Wt(r){function a(o,f,g,x,T){this._reactName=o,this._targetInst=g,this.type=f,this.nativeEvent=x,this.target=T,this.currentTarget=null;for(var D in r)r.hasOwnProperty(D)&&(o=r[D],this[D]=o?o(x):x[D]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Bu:yg,this.isPropagationStopped=yg,this}return m(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Bu)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Bu)},persist:function(){},isPersistent:Bu}),a}var Mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hu=Wt(Mi),Cl=m({},Mi,{view:0,detail:0}),kE=Wt(Cl),gf,yf,Al,Uu=m({},Cl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xf,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!==Al&&(Al&&r.type==="mousemove"?(gf=r.screenX-Al.screenX,yf=r.screenY-Al.screenY):yf=gf=0,Al=r),gf)},movementY:function(r){return"movementY"in r?r.movementY:yf}}),vg=Wt(Uu),TE=m({},Uu,{dataTransfer:0}),CE=Wt(TE),AE=m({},Cl,{relatedTarget:0}),vf=Wt(AE),NE=m({},Mi,{animationName:0,elapsedTime:0,pseudoElement:0}),ME=Wt(NE),OE=m({},Mi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),RE=Wt(OE),zE=m({},Mi,{data:0}),xg=Wt(zE),DE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jE={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"},LE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function IE(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=LE[r])?!!a[r]:!1}function xf(){return IE}var BE=m({},Cl,{key:function(r){if(r.key){var a=DE[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=Iu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?jE[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xf,charCode:function(r){return r.type==="keypress"?Iu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Iu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),HE=Wt(BE),UE=m({},Uu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bg=Wt(UE),PE=m({},Cl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xf}),qE=Wt(PE),VE=m({},Mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),$E=Wt(VE),ZE=m({},Uu,{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}),YE=Wt(ZE),FE=m({},Mi,{newState:0,oldState:0}),GE=Wt(FE),XE=[9,13,27,32],bf=gr&&"CompositionEvent"in window,Nl=null;gr&&"documentMode"in document&&(Nl=document.documentMode);var QE=gr&&"TextEvent"in window&&!Nl,_g=gr&&(!bf||Nl&&8<Nl&&11>=Nl),wg=" ",Sg=!1;function Eg(r,a){switch(r){case"keyup":return XE.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kg(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var pa=!1;function KE(r,a){switch(r){case"compositionend":return kg(a);case"keypress":return a.which!==32?null:(Sg=!0,wg);case"textInput":return r=a.data,r===wg&&Sg?null:r;default:return null}}function JE(r,a){if(pa)return r==="compositionend"||!bf&&Eg(r,a)?(r=gg(),Lu=pf=Zr=null,pa=!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 _g&&a.locale!=="ko"?null:a.data;default:return null}}var WE={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 Tg(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!WE[r.type]:a==="textarea"}function Cg(r,a,o,f){ha?ma?ma.push(f):ma=[f]:ha=f,a=Co(a,"onChange"),0<a.length&&(o=new Hu("onChange","change",null,o,f),r.push({event:o,listeners:a}))}var Ml=null,Ol=null;function ek(r){sv(r,0)}function Pu(r){var a=Ur(r);if(Du(a))return r}function Ag(r,a){if(r==="change")return a}var Ng=!1;if(gr){var _f;if(gr){var wf="oninput"in document;if(!wf){var Mg=document.createElement("div");Mg.setAttribute("oninput","return;"),wf=typeof Mg.oninput=="function"}_f=wf}else _f=!1;Ng=_f&&(!document.documentMode||9<document.documentMode)}function Og(){Ml&&(Ml.detachEvent("onpropertychange",Rg),Ol=Ml=null)}function Rg(r){if(r.propertyName==="value"&&Pu(Ol)){var a=[];Cg(a,Ol,r,df(r)),pg(ek,a)}}function tk(r,a,o){r==="focusin"?(Og(),Ml=a,Ol=o,Ml.attachEvent("onpropertychange",Rg)):r==="focusout"&&Og()}function nk(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Pu(Ol)}function rk(r,a){if(r==="click")return Pu(a)}function ik(r,a){if(r==="input"||r==="change")return Pu(a)}function ak(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var un=typeof Object.is=="function"?Object.is:ak;function Rl(r,a){if(un(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var o=Object.keys(r),f=Object.keys(a);if(o.length!==f.length)return!1;for(f=0;f<o.length;f++){var g=o[f];if(!ve.call(a,g)||!un(r[g],a[g]))return!1}return!0}function zg(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Dg(r,a){var o=zg(r);r=0;for(var f;o;){if(o.nodeType===3){if(f=r+o.textContent.length,r<=a&&f>=a)return{node:o,offset:a-r};r=f}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=zg(o)}}function jg(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?jg(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function Lg(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=$r(r.document);a instanceof r.HTMLIFrameElement;){try{var o=typeof a.contentWindow.location.href=="string"}catch{o=!1}if(o)r=a.contentWindow;else break;a=$r(r.document)}return a}function Sf(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 lk=gr&&"documentMode"in document&&11>=document.documentMode,ga=null,Ef=null,zl=null,kf=!1;function Ig(r,a,o){var f=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;kf||ga==null||ga!==$r(f)||(f=ga,"selectionStart"in f&&Sf(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}),zl&&Rl(zl,f)||(zl=f,f=Co(Ef,"onSelect"),0<f.length&&(a=new Hu("onSelect","select",null,a,o),r.push({event:a,listeners:f}),a.target=ga)))}function Oi(r,a){var o={};return o[r.toLowerCase()]=a.toLowerCase(),o["Webkit"+r]="webkit"+a,o["Moz"+r]="moz"+a,o}var ya={animationend:Oi("Animation","AnimationEnd"),animationiteration:Oi("Animation","AnimationIteration"),animationstart:Oi("Animation","AnimationStart"),transitionrun:Oi("Transition","TransitionRun"),transitionstart:Oi("Transition","TransitionStart"),transitioncancel:Oi("Transition","TransitionCancel"),transitionend:Oi("Transition","TransitionEnd")},Tf={},Bg={};gr&&(Bg=document.createElement("div").style,"AnimationEvent"in window||(delete ya.animationend.animation,delete ya.animationiteration.animation,delete ya.animationstart.animation),"TransitionEvent"in window||delete ya.transitionend.transition);function Ri(r){if(Tf[r])return Tf[r];if(!ya[r])return r;var a=ya[r],o;for(o in a)if(a.hasOwnProperty(o)&&o in Bg)return Tf[r]=a[o];return r}var Hg=Ri("animationend"),Ug=Ri("animationiteration"),Pg=Ri("animationstart"),sk=Ri("transitionrun"),uk=Ri("transitionstart"),ok=Ri("transitioncancel"),qg=Ri("transitionend"),Vg=new Map,Cf="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(" ");Cf.push("scrollEnd");function zn(r,a){Vg.set(r,a),pr(a,[r])}var $g=new WeakMap;function _n(r,a){if(typeof r=="object"&&r!==null){var o=$g.get(r);return o!==void 0?o:(a={value:r,source:a,stack:Ru(a)},$g.set(r,a),a)}return{value:r,source:a,stack:Ru(a)}}var wn=[],va=0,Af=0;function qu(){for(var r=va,a=Af=va=0;a<r;){var o=wn[a];wn[a++]=null;var f=wn[a];wn[a++]=null;var g=wn[a];wn[a++]=null;var x=wn[a];if(wn[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&&Zg(o,g,x)}}function Vu(r,a,o,f){wn[va++]=r,wn[va++]=a,wn[va++]=o,wn[va++]=f,Af|=f,r.lanes|=f,r=r.alternate,r!==null&&(r.lanes|=f)}function Nf(r,a,o,f){return Vu(r,a,o,f),$u(r)}function xa(r,a){return Vu(r,null,null,a),$u(r)}function Zg(r,a,o){r.lanes|=o;var f=r.alternate;f!==null&&(f.lanes|=o);for(var g=!1,x=r.return;x!==null;)x.childLanes|=o,f=x.alternate,f!==null&&(f.childLanes|=o),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(o),r=x.hiddenUpdates,f=r[g],f===null?r[g]=[a]:f.push(a),a.lane=o|536870912),x):null}function $u(r){if(50<is)throw is=0,jd=null,Error(i(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var ba={};function ck(r,a,o,f){this.tag=r,this.key=o,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 on(r,a,o,f){return new ck(r,a,o,f)}function Mf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function yr(r,a){var o=r.alternate;return o===null?(o=on(r.tag,a,r.key,r.mode),o.elementType=r.elementType,o.type=r.type,o.stateNode=r.stateNode,o.alternate=r,r.alternate=o):(o.pendingProps=a,o.type=r.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=r.flags&65011712,o.childLanes=r.childLanes,o.lanes=r.lanes,o.child=r.child,o.memoizedProps=r.memoizedProps,o.memoizedState=r.memoizedState,o.updateQueue=r.updateQueue,a=r.dependencies,o.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},o.sibling=r.sibling,o.index=r.index,o.ref=r.ref,o.refCleanup=r.refCleanup,o}function Yg(r,a){r.flags&=65011714;var o=r.alternate;return o===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=o.childLanes,r.lanes=o.lanes,r.child=o.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=o.memoizedProps,r.memoizedState=o.memoizedState,r.updateQueue=o.updateQueue,r.type=o.type,a=o.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function Zu(r,a,o,f,g,x){var T=0;if(f=r,typeof r=="function")Mf(r)&&(T=1);else if(typeof r=="string")T=dT(r,o,Y.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case B:return r=on(31,o,a,g),r.elementType=B,r.lanes=x,r;case b:return zi(o.children,g,x,a);case _:T=8,g|=24;break;case S:return r=on(12,o,a,g|2),r.elementType=S,r.lanes=x,r;case j:return r=on(13,o,a,g),r.elementType=j,r.lanes=x,r;case M:return r=on(19,o,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 N:T=11;break e;case U:T=14;break e;case R:T=16,f=null;break e}T=29,o=Error(i(130,r===null?"null":typeof r,"")),f=null}return a=on(T,o,a,g),a.elementType=r,a.type=f,a.lanes=x,a}function zi(r,a,o,f){return r=on(7,r,f,a),r.lanes=o,r}function Of(r,a,o){return r=on(6,r,null,a),r.lanes=o,r}function Rf(r,a,o){return a=on(4,r.children!==null?r.children:[],r.key,a),a.lanes=o,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var _a=[],wa=0,Yu=null,Fu=0,Sn=[],En=0,Di=null,vr=1,xr="";function ji(r,a){_a[wa++]=Fu,_a[wa++]=Yu,Yu=r,Fu=a}function Fg(r,a,o){Sn[En++]=vr,Sn[En++]=xr,Sn[En++]=Di,Di=r;var f=vr;r=xr;var g=32-Te(f)-1;f&=~(1<<g),o+=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,vr=1<<32-Te(a)+g|o<<g|f,xr=x+r}else vr=1<<x|o<<g|f,xr=r}function zf(r){r.return!==null&&(ji(r,1),Fg(r,1,0))}function Df(r){for(;r===Yu;)Yu=_a[--wa],_a[wa]=null,Fu=_a[--wa],_a[wa]=null;for(;r===Di;)Di=Sn[--En],Sn[En]=null,xr=Sn[--En],Sn[En]=null,vr=Sn[--En],Sn[En]=null}var Yt=null,mt=null,Qe=!1,Li=null,Wn=!1,jf=Error(i(519));function Ii(r){var a=Error(i(418,""));throw Ll(_n(a,r)),jf}function Gg(r){var a=r.stateNode,o=r.type,f=r.memoizedProps;switch(a[Mt]=r,a[Bt]=f,o){case"dialog":qe("cancel",a),qe("close",a);break;case"iframe":case"object":case"embed":qe("load",a);break;case"video":case"audio":for(o=0;o<ls.length;o++)qe(ls[o],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),og(a,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0),oa(a);break;case"select":qe("invalid",a);break;case"textarea":qe("invalid",a),fg(a,f.value,f.defaultValue,f.children),oa(a)}o=f.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||a.textContent===""+o||f.suppressHydrationWarning===!0||fv(a.textContent,o)?(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=Ao),a=!0):a=!1,a||Ii(r)}function Xg(r){for(Yt=r.return;Yt;)switch(Yt.tag){case 5:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:Yt=Yt.return}}function Dl(r){if(r!==Yt)return!1;if(!Qe)return Xg(r),Qe=!0,!1;var a=r.tag,o;if((o=a!==3&&a!==27)&&((o=a===5)&&(o=r.type,o=!(o!=="form"&&o!=="button")||Kd(r.type,r.memoizedProps)),o=!o),o&&mt&&Ii(r),Xg(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(o=r.data,o==="/$"){if(a===0){mt=jn(r.nextSibling);break e}a--}else o!=="$"&&o!=="$!"&&o!=="$?"||a++;r=r.nextSibling}mt=null}}else a===27?(a=mt,si(r.type)?(r=th,th=null,mt=r):mt=a):mt=Yt?jn(r.stateNode.nextSibling):null;return!0}function jl(){mt=Yt=null,Qe=!1}function Qg(){var r=Li;return r!==null&&(nn===null?nn=r:nn.push.apply(nn,r),Li=null),r}function Ll(r){Li===null?Li=[r]:Li.push(r)}var Lf=Z(null),Bi=null,br=null;function Yr(r,a,o){C(Lf,a._currentValue),a._currentValue=o}function _r(r){r._currentValue=Lf.current,te(Lf)}function If(r,a,o){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===o)break;r=r.return}}function Bf(r,a,o,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 D=x;x=g;for(var V=0;V<a.length;V++)if(D.context===a[V]){x.lanes|=o,D=x.alternate,D!==null&&(D.lanes|=o),If(x.return,o,r),f||(T=null);break e}x=D.next}}else if(g.tag===18){if(T=g.return,T===null)throw Error(i(341));T.lanes|=o,x=T.alternate,x!==null&&(x.lanes|=o),If(T,o,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 Il(r,a,o,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 D=g.type;un(g.pendingProps.value,T.value)||(r!==null?r.push(D):r=[D])}}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(ds):r=[ds])}g=g.return}r!==null&&Bf(a,r,o,f),a.flags|=262144}function Gu(r){for(r=r.firstContext;r!==null;){if(!un(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Hi(r){Bi=r,br=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Ht(r){return Kg(Bi,r)}function Xu(r,a){return Bi===null&&Hi(r),Kg(r,a)}function Kg(r,a){var o=a._currentValue;if(a={context:a,memoizedValue:o,next:null},br===null){if(r===null)throw Error(i(308));br=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else br=br.next=a;return o}var fk=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(o,f){r.push(f)}};this.abort=function(){a.aborted=!0,r.forEach(function(o){return o()})}},dk=e.unstable_scheduleCallback,hk=e.unstable_NormalPriority,At={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hf(){return{controller:new fk,data:new Map,refCount:0}}function Bl(r){r.refCount--,r.refCount===0&&dk(hk,function(){r.controller.abort()})}var Hl=null,Uf=0,Sa=0,Ea=null;function mk(r,a){if(Hl===null){var o=Hl=[];Uf=0,Sa=qd(),Ea={status:"pending",value:void 0,then:function(f){o.push(f)}}}return Uf++,a.then(Jg,Jg),a}function Jg(){if(--Uf===0&&Hl!==null){Ea!==null&&(Ea.status="fulfilled");var r=Hl;Hl=null,Sa=0,Ea=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function pk(r,a){var o=[],f={status:"pending",value:null,reason:null,then:function(g){o.push(g)}};return r.then(function(){f.status="fulfilled",f.value=a;for(var g=0;g<o.length;g++)(0,o[g])(a)},function(g){for(f.status="rejected",f.reason=g,g=0;g<o.length;g++)(0,o[g])(void 0)}),f}var Wg=L.S;L.S=function(r,a){typeof a=="object"&&a!==null&&typeof a.then=="function"&&mk(r,a),Wg!==null&&Wg(r,a)};var Ui=Z(null);function Pf(){var r=Ui.current;return r!==null?r:st.pooledCache}function Qu(r,a){a===null?C(Ui,Ui.current):C(Ui,a.pool)}function ey(){var r=Pf();return r===null?null:{parent:At._currentValue,pool:r}}var Ul=Error(i(460)),ty=Error(i(474)),Ku=Error(i(542)),qf={then:function(){}};function ny(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Ju(){}function ry(r,a,o){switch(o=r[o],o===void 0?r.push(a):o!==a&&(a.then(Ju,Ju),a=o),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,ay(r),r;default:if(typeof a.status=="string")a.then(Ju,Ju);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,ay(r),r}throw Pl=a,Ul}}var Pl=null;function iy(){if(Pl===null)throw Error(i(459));var r=Pl;return Pl=null,r}function ay(r){if(r===Ul||r===Ku)throw Error(i(483))}var Fr=!1;function Vf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $f(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 Gr(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Xr(r,a,o){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=$u(r),Zg(r,null,o),a}return Vu(r,f,a,o),$u(r)}function ql(r,a,o){if(a=a.updateQueue,a!==null&&(a=a.shared,(o&4194048)!==0)){var f=a.lanes;f&=r.pendingLanes,o|=f,a.lanes=o,Eu(r,o)}}function Zf(r,a){var o=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,o===f)){var g=null,x=null;if(o=o.firstBaseUpdate,o!==null){do{var T={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};x===null?g=x=T:x=x.next=T,o=o.next}while(o!==null);x===null?g=x=a:x=x.next=a}else g=x=a;o={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:f.shared,callbacks:f.callbacks},r.updateQueue=o;return}r=o.lastBaseUpdate,r===null?o.firstBaseUpdate=a:r.next=a,o.lastBaseUpdate=a}var Yf=!1;function Vl(){if(Yf){var r=Ea;if(r!==null)throw r}}function $l(r,a,o,f){Yf=!1;var g=r.updateQueue;Fr=!1;var x=g.firstBaseUpdate,T=g.lastBaseUpdate,D=g.shared.pending;if(D!==null){g.shared.pending=null;var V=D,ne=V.next;V.next=null,T===null?x=ne:T.next=ne,T=V;var se=r.alternate;se!==null&&(se=se.updateQueue,D=se.lastBaseUpdate,D!==T&&(D===null?se.firstBaseUpdate=ne:D.next=ne,se.lastBaseUpdate=V))}if(x!==null){var fe=g.baseState;T=0,se=ne=V=null,D=x;do{var re=D.lane&-536870913,ae=re!==D.lane;if(ae?($e&re)===re:(f&re)===re){re!==0&&re===Sa&&(Yf=!0),se!==null&&(se=se.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var Oe=r,Ne=D;re=a;var rt=o;switch(Ne.tag){case 1:if(Oe=Ne.payload,typeof Oe=="function"){fe=Oe.call(rt,fe,re);break e}fe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ne.payload,re=typeof Oe=="function"?Oe.call(rt,fe,re):Oe,re==null)break e;fe=m({},fe,re);break e;case 2:Fr=!0}}re=D.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:D.tag,payload:D.payload,callback:D.callback,next:null},se===null?(ne=se=ae,V=fe):se=se.next=ae,T|=re;if(D=D.next,D===null){if(D=g.shared.pending,D===null)break;ae=D,D=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),ri|=T,r.lanes=T,r.memoizedState=fe}}function ly(r,a){if(typeof r!="function")throw Error(i(191,r));r.call(a)}function sy(r,a){var o=r.callbacks;if(o!==null)for(r.callbacks=null,r=0;r<o.length;r++)ly(o[r],a)}var ka=Z(null),Wu=Z(0);function uy(r,a){r=Ar,C(Wu,r),C(ka,a),Ar=r|a.baseLanes}function Ff(){C(Wu,Ar),C(ka,ka.current)}function Gf(){Ar=Wu.current,te(ka),te(Wu)}var Qr=0,He=null,tt=null,St=null,eo=!1,Ta=!1,Pi=!1,to=0,Zl=0,Ca=null,gk=0;function yt(){throw Error(i(321))}function Xf(r,a){if(a===null)return!1;for(var o=0;o<a.length&&o<r.length;o++)if(!un(r[o],a[o]))return!1;return!0}function Qf(r,a,o,f,g,x){return Qr=x,He=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,L.H=r===null||r.memoizedState===null?Zy:Yy,Pi=!1,x=o(f,g),Pi=!1,Ta&&(x=cy(a,o,f,g)),oy(r),x}function oy(r){L.H=so;var a=tt!==null&&tt.next!==null;if(Qr=0,St=tt=He=null,eo=!1,Zl=0,Ca=null,a)throw Error(i(300));r===null||Ot||(r=r.dependencies,r!==null&&Gu(r)&&(Ot=!0))}function cy(r,a,o,f){He=r;var g=0;do{if(Ta&&(Ca=null),Zl=0,Ta=!1,25<=g)throw Error(i(301));if(g+=1,St=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)}L.H=Sk,x=a(o,f)}while(Ta);return x}function yk(){var r=L.H,a=r.useState()[0];return a=typeof a.then=="function"?Yl(a):a,r=r.useState()[0],(tt!==null?tt.memoizedState:null)!==r&&(He.flags|=1024),a}function Kf(){var r=to!==0;return to=0,r}function Jf(r,a,o){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~o}function Wf(r){if(eo){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}eo=!1}Qr=0,St=tt=He=null,Ta=!1,Zl=to=0,Ca=null}function en(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?He.memoizedState=St=r:St=St.next=r,St}function Et(){if(tt===null){var r=He.alternate;r=r!==null?r.memoizedState:null}else r=tt.next;var a=St===null?He.memoizedState:St.next;if(a!==null)St=a,tt=r;else{if(r===null)throw He.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},St===null?He.memoizedState=St=r:St=St.next=r}return St}function ed(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yl(r){var a=Zl;return Zl+=1,Ca===null&&(Ca=[]),r=ry(Ca,r,a),a=He,(St===null?a.memoizedState:St.next)===null&&(a=a.alternate,L.H=a===null||a.memoizedState===null?Zy:Yy),r}function no(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Yl(r);if(r.$$typeof===E)return Ht(r)}throw Error(i(438,String(r)))}function td(r){var a=null,o=He.updateQueue;if(o!==null&&(a=o.memoCache),a==null){var f=He.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}),o===null&&(o=ed(),He.updateQueue=o),o.memoCache=a,o=a.data[a.index],o===void 0)for(o=a.data[a.index]=Array(r),f=0;f<r;f++)o[f]=O;return a.index++,o}function wr(r,a){return typeof a=="function"?a(r):a}function ro(r){var a=Et();return nd(a,tt,r)}function nd(r,a,o){var f=r.queue;if(f===null)throw Error(i(311));f.lastRenderedReducer=o;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 D=T=null,V=null,ne=a,se=!1;do{var fe=ne.lane&-536870913;if(fe!==ne.lane?($e&fe)===fe:(Qr&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===Sa&&(se=!0);else if((Qr&re)===re){ne=ne.next,re===Sa&&(se=!0);continue}else fe={lane:0,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},V===null?(D=V=fe,T=x):V=V.next=fe,He.lanes|=re,ri|=re;fe=ne.action,Pi&&o(x,fe),x=ne.hasEagerState?ne.eagerState:o(x,fe)}else re={lane:fe,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},V===null?(D=V=re,T=x):V=V.next=re,He.lanes|=fe,ri|=fe;ne=ne.next}while(ne!==null&&ne!==a);if(V===null?T=x:V.next=D,!un(x,r.memoizedState)&&(Ot=!0,se&&(o=Ea,o!==null)))throw o;r.memoizedState=x,r.baseState=T,r.baseQueue=V,f.lastRenderedState=x}return g===null&&(f.lanes=0),[r.memoizedState,f.dispatch]}function rd(r){var a=Et(),o=a.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=r;var f=o.dispatch,g=o.pending,x=a.memoizedState;if(g!==null){o.pending=null;var T=g=g.next;do x=r(x,T.action),T=T.next;while(T!==g);un(x,a.memoizedState)||(Ot=!0),a.memoizedState=x,a.baseQueue===null&&(a.baseState=x),o.lastRenderedState=x}return[x,f]}function fy(r,a,o){var f=He,g=Et(),x=Qe;if(x){if(o===void 0)throw Error(i(407));o=o()}else o=a();var T=!un((tt||g).memoizedState,o);T&&(g.memoizedState=o,Ot=!0),g=g.queue;var D=my.bind(null,f,g,r);if(Fl(2048,8,D,[r]),g.getSnapshot!==a||T||St!==null&&St.memoizedState.tag&1){if(f.flags|=2048,Aa(9,io(),hy.bind(null,f,g,o,a),null),st===null)throw Error(i(349));x||(Qr&124)!==0||dy(f,a,o)}return o}function dy(r,a,o){r.flags|=16384,r={getSnapshot:a,value:o},a=He.updateQueue,a===null?(a=ed(),He.updateQueue=a,a.stores=[r]):(o=a.stores,o===null?a.stores=[r]:o.push(r))}function hy(r,a,o,f){a.value=o,a.getSnapshot=f,py(a)&&gy(r)}function my(r,a,o){return o(function(){py(a)&&gy(r)})}function py(r){var a=r.getSnapshot;r=r.value;try{var o=a();return!un(r,o)}catch{return!0}}function gy(r){var a=xa(r,2);a!==null&&mn(a,r,2)}function id(r){var a=en();if(typeof r=="function"){var o=r;if(r=o(),Pi){Ee(!0);try{o()}finally{Ee(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:r},a}function yy(r,a,o,f){return r.baseState=o,nd(r,tt,typeof f=="function"?f:wr)}function vk(r,a,o,f,g){if(lo(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)}};L.T!==null?o(!0):x.isTransition=!1,f(x),o=a.pending,o===null?(x.next=a.pending=x,vy(a,x)):(x.next=o.next,a.pending=o.next=x)}}function vy(r,a){var o=a.action,f=a.payload,g=r.state;if(a.isTransition){var x=L.T,T={};L.T=T;try{var D=o(g,f),V=L.S;V!==null&&V(T,D),xy(r,a,D)}catch(ne){ad(r,a,ne)}finally{L.T=x}}else try{x=o(g,f),xy(r,a,x)}catch(ne){ad(r,a,ne)}}function xy(r,a,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(f){by(r,a,f)},function(f){return ad(r,a,f)}):by(r,a,o)}function by(r,a,o){a.status="fulfilled",a.value=o,_y(a),r.state=o,a=r.pending,a!==null&&(o=a.next,o===a?r.pending=null:(o=o.next,a.next=o,vy(r,o)))}function ad(r,a,o){var f=r.pending;if(r.pending=null,f!==null){f=f.next;do a.status="rejected",a.reason=o,_y(a),a=a.next;while(a!==f)}r.action=null}function _y(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function wy(r,a){return a}function Sy(r,a){if(Qe){var o=st.formState;if(o!==null){e:{var f=He;if(Qe){if(mt){t:{for(var g=mt,x=Wn;g.nodeType!==8;){if(!x){g=null;break t}if(g=jn(g.nextSibling),g===null){g=null;break t}}x=g.data,g=x==="F!"||x==="F"?g:null}if(g){mt=jn(g.nextSibling),f=g.data==="F!";break e}}Ii(f)}f=!1}f&&(a=o[0])}}return o=en(),o.memoizedState=o.baseState=a,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wy,lastRenderedState:a},o.queue=f,o=qy.bind(null,He,f),f.dispatch=o,f=id(!1),x=cd.bind(null,He,!1,f.queue),f=en(),g={state:a,dispatch:null,action:r,pending:null},f.queue=g,o=vk.bind(null,He,g,x,o),g.dispatch=o,f.memoizedState=r,[a,o,!1]}function Ey(r){var a=Et();return ky(a,tt,r)}function ky(r,a,o){if(a=nd(r,a,wy)[0],r=ro(wr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var f=Yl(a)}catch(T){throw T===Ul?Ku:T}else f=a;a=Et();var g=a.queue,x=g.dispatch;return o!==a.memoizedState&&(He.flags|=2048,Aa(9,io(),xk.bind(null,g,o),null)),[f,x,r]}function xk(r,a){r.action=a}function Ty(r){var a=Et(),o=tt;if(o!==null)return ky(a,o,r);Et(),a=a.memoizedState,o=Et();var f=o.queue.dispatch;return o.memoizedState=r,[a,f,!1]}function Aa(r,a,o,f){return r={tag:r,create:o,deps:f,inst:a,next:null},a=He.updateQueue,a===null&&(a=ed(),He.updateQueue=a),o=a.lastEffect,o===null?a.lastEffect=r.next=r:(f=o.next,o.next=r,r.next=f,a.lastEffect=r),r}function io(){return{destroy:void 0,resource:void 0}}function Cy(){return Et().memoizedState}function ao(r,a,o,f){var g=en();f=f===void 0?null:f,He.flags|=r,g.memoizedState=Aa(1|a,io(),o,f)}function Fl(r,a,o,f){var g=Et();f=f===void 0?null:f;var x=g.memoizedState.inst;tt!==null&&f!==null&&Xf(f,tt.memoizedState.deps)?g.memoizedState=Aa(a,x,o,f):(He.flags|=r,g.memoizedState=Aa(1|a,x,o,f))}function Ay(r,a){ao(8390656,8,r,a)}function Ny(r,a){Fl(2048,8,r,a)}function My(r,a){return Fl(4,2,r,a)}function Oy(r,a){return Fl(4,4,r,a)}function Ry(r,a){if(typeof a=="function"){r=r();var o=a(r);return function(){typeof o=="function"?o():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function zy(r,a,o){o=o!=null?o.concat([r]):null,Fl(4,4,Ry.bind(null,a,r),o)}function ld(){}function Dy(r,a){var o=Et();a=a===void 0?null:a;var f=o.memoizedState;return a!==null&&Xf(a,f[1])?f[0]:(o.memoizedState=[r,a],r)}function jy(r,a){var o=Et();a=a===void 0?null:a;var f=o.memoizedState;if(a!==null&&Xf(a,f[1]))return f[0];if(f=r(),Pi){Ee(!0);try{r()}finally{Ee(!1)}}return o.memoizedState=[f,a],f}function sd(r,a,o){return o===void 0||(Qr&1073741824)!==0?r.memoizedState=a:(r.memoizedState=o,r=B0(),He.lanes|=r,ri|=r,o)}function Ly(r,a,o,f){return un(o,a)?o:ka.current!==null?(r=sd(r,o,f),un(r,a)||(Ot=!0),r):(Qr&42)===0?(Ot=!0,r.memoizedState=o):(r=B0(),He.lanes|=r,ri|=r,a)}function Iy(r,a,o,f,g){var x=q.p;q.p=x!==0&&8>x?x:8;var T=L.T,D={};L.T=D,cd(r,!1,a,o);try{var V=g(),ne=L.S;if(ne!==null&&ne(D,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var se=pk(V,f);Gl(r,a,se,hn(r))}else Gl(r,a,f,hn(r))}catch(fe){Gl(r,a,{then:function(){},status:"rejected",reason:fe},hn())}finally{q.p=x,L.T=T}}function bk(){}function ud(r,a,o,f){if(r.tag!==5)throw Error(i(476));var g=By(r).queue;Iy(r,g,a,K,o===null?bk:function(){return Hy(r),o(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:wr,lastRenderedState:K},next:null};var o={};return a.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:o},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function Hy(r){var a=By(r).next.queue;Gl(r,a,{},hn())}function od(){return Ht(ds)}function Uy(){return Et().memoizedState}function Py(){return Et().memoizedState}function _k(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var o=hn();r=Gr(o);var f=Xr(a,r,o);f!==null&&(mn(f,a,o),ql(f,a,o)),a={cache:Hf()},r.payload=a;return}a=a.return}}function wk(r,a,o){var f=hn();o={lane:f,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},lo(r)?Vy(a,o):(o=Nf(r,a,o,f),o!==null&&(mn(o,r,f),$y(o,a,f)))}function qy(r,a,o){var f=hn();Gl(r,a,o,f)}function Gl(r,a,o,f){var g={lane:f,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(lo(r))Vy(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,D=x(T,o);if(g.hasEagerState=!0,g.eagerState=D,un(D,T))return Vu(r,a,g,0),st===null&&qu(),!1}catch{}finally{}if(o=Nf(r,a,g,f),o!==null)return mn(o,r,f),$y(o,a,f),!0}return!1}function cd(r,a,o,f){if(f={lane:2,revertLane:qd(),action:f,hasEagerState:!1,eagerState:null,next:null},lo(r)){if(a)throw Error(i(479))}else a=Nf(r,o,f,2),a!==null&&mn(a,r,2)}function lo(r){var a=r.alternate;return r===He||a!==null&&a===He}function Vy(r,a){Ta=eo=!0;var o=r.pending;o===null?a.next=a:(a.next=o.next,o.next=a),r.pending=a}function $y(r,a,o){if((o&4194048)!==0){var f=a.lanes;f&=r.pendingLanes,o|=f,a.lanes=o,Eu(r,o)}}var so={readContext:Ht,use:no,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt},Zy={readContext:Ht,use:no,useCallback:function(r,a){return en().memoizedState=[r,a===void 0?null:a],r},useContext:Ht,useEffect:Ay,useImperativeHandle:function(r,a,o){o=o!=null?o.concat([r]):null,ao(4194308,4,Ry.bind(null,a,r),o)},useLayoutEffect:function(r,a){return ao(4194308,4,r,a)},useInsertionEffect:function(r,a){ao(4,2,r,a)},useMemo:function(r,a){var o=en();a=a===void 0?null:a;var f=r();if(Pi){Ee(!0);try{r()}finally{Ee(!1)}}return o.memoizedState=[f,a],f},useReducer:function(r,a,o){var f=en();if(o!==void 0){var g=o(a);if(Pi){Ee(!0);try{o(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=wk.bind(null,He,r),[f.memoizedState,r]},useRef:function(r){var a=en();return r={current:r},a.memoizedState=r},useState:function(r){r=id(r);var a=r.queue,o=qy.bind(null,He,a);return a.dispatch=o,[r.memoizedState,o]},useDebugValue:ld,useDeferredValue:function(r,a){var o=en();return sd(o,r,a)},useTransition:function(){var r=id(!1);return r=Iy.bind(null,He,r.queue,!0,!1),en().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,o){var f=He,g=en();if(Qe){if(o===void 0)throw Error(i(407));o=o()}else{if(o=a(),st===null)throw Error(i(349));($e&124)!==0||dy(f,a,o)}g.memoizedState=o;var x={value:o,getSnapshot:a};return g.queue=x,Ay(my.bind(null,f,x,r),[r]),f.flags|=2048,Aa(9,io(),hy.bind(null,f,x,o,a),null),o},useId:function(){var r=en(),a=st.identifierPrefix;if(Qe){var o=xr,f=vr;o=(f&~(1<<32-Te(f)-1)).toString(32)+o,a="«"+a+"R"+o,o=to++,0<o&&(a+="H"+o.toString(32)),a+="»"}else o=gk++,a="«"+a+"r"+o.toString(32)+"»";return r.memoizedState=a},useHostTransitionStatus:od,useFormState:Sy,useActionState:Sy,useOptimistic:function(r){var a=en();a.memoizedState=a.baseState=r;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=o,a=cd.bind(null,He,!0,o),o.dispatch=a,[r,a]},useMemoCache:td,useCacheRefresh:function(){return en().memoizedState=_k.bind(null,He)}},Yy={readContext:Ht,use:no,useCallback:Dy,useContext:Ht,useEffect:Ny,useImperativeHandle:zy,useInsertionEffect:My,useLayoutEffect:Oy,useMemo:jy,useReducer:ro,useRef:Cy,useState:function(){return ro(wr)},useDebugValue:ld,useDeferredValue:function(r,a){var o=Et();return Ly(o,tt.memoizedState,r,a)},useTransition:function(){var r=ro(wr)[0],a=Et().memoizedState;return[typeof r=="boolean"?r:Yl(r),a]},useSyncExternalStore:fy,useId:Uy,useHostTransitionStatus:od,useFormState:Ey,useActionState:Ey,useOptimistic:function(r,a){var o=Et();return yy(o,tt,r,a)},useMemoCache:td,useCacheRefresh:Py},Sk={readContext:Ht,use:no,useCallback:Dy,useContext:Ht,useEffect:Ny,useImperativeHandle:zy,useInsertionEffect:My,useLayoutEffect:Oy,useMemo:jy,useReducer:rd,useRef:Cy,useState:function(){return rd(wr)},useDebugValue:ld,useDeferredValue:function(r,a){var o=Et();return tt===null?sd(o,r,a):Ly(o,tt.memoizedState,r,a)},useTransition:function(){var r=rd(wr)[0],a=Et().memoizedState;return[typeof r=="boolean"?r:Yl(r),a]},useSyncExternalStore:fy,useId:Uy,useHostTransitionStatus:od,useFormState:Ty,useActionState:Ty,useOptimistic:function(r,a){var o=Et();return tt!==null?yy(o,tt,r,a):(o.baseState=r,[r,o.queue.dispatch])},useMemoCache:td,useCacheRefresh:Py},Na=null,Xl=0;function uo(r){var a=Xl;return Xl+=1,Na===null&&(Na=[]),ry(Na,r,a)}function Ql(r,a){a=a.props.ref,r.ref=a!==void 0?a:null}function oo(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 Fy(r){var a=r._init;return a(r._payload)}function Gy(r){function a(J,G){if(r){var ee=J.deletions;ee===null?(J.deletions=[G],J.flags|=16):ee.push(G)}}function o(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=yr(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 D(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 be=ee.type;return be===b?se(J,G,ee.props.children,oe,ee.key):G!==null&&(G.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===R&&Fy(be)===G.type)?(G=g(G,ee.props),Ql(G,ee),G.return=J,G):(G=Zu(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=Rf(ee,J.mode,oe),G.return=J,G):(G=g(G,ee.children||[]),G.return=J,G)}function se(J,G,ee,oe,be){return G===null||G.tag!==7?(G=zi(ee,J.mode,oe,be),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=Zu(G.type,G.key,G.props,null,J.mode,ee),Ql(ee,G),ee.return=J,ee;case v:return G=Rf(G,J.mode,ee),G.return=J,G;case R:var oe=G._init;return G=oe(G._payload),fe(J,G,ee)}if($(G)||P(G))return G=zi(G,J.mode,ee,null),G.return=J,G;if(typeof G.then=="function")return fe(J,uo(G),ee);if(G.$$typeof===E)return fe(J,Xu(J,G),ee);oo(J,G)}return null}function re(J,G,ee,oe){var be=G!==null?G.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return be!==null?null:D(J,G,""+ee,oe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:return ee.key===be?V(J,G,ee,oe):null;case v:return ee.key===be?ne(J,G,ee,oe):null;case R:return be=ee._init,ee=be(ee._payload),re(J,G,ee,oe)}if($(ee)||P(ee))return be!==null?null:se(J,G,ee,oe,null);if(typeof ee.then=="function")return re(J,G,uo(ee),oe);if(ee.$$typeof===E)return re(J,G,Xu(J,ee),oe);oo(J,ee)}return null}function ae(J,G,ee,oe,be){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return J=J.get(ee)||null,D(G,J,""+oe,be);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,be);case v:return J=J.get(oe.key===null?ee:oe.key)||null,ne(G,J,oe,be);case R:var Ue=oe._init;return oe=Ue(oe._payload),ae(J,G,ee,oe,be)}if($(oe)||P(oe))return J=J.get(ee)||null,se(G,J,oe,be,null);if(typeof oe.then=="function")return ae(J,G,ee,uo(oe),be);if(oe.$$typeof===E)return ae(J,G,ee,Xu(G,oe),be);oo(G,oe)}return null}function Oe(J,G,ee,oe){for(var be=null,Ue=null,Se=G,Me=G=0,zt=null;Se!==null&&Me<ee.length;Me++){Se.index>Me?(zt=Se,Se=null):zt=Se.sibling;var Ge=re(J,Se,ee[Me],oe);if(Ge===null){Se===null&&(Se=zt);break}r&&Se&&Ge.alternate===null&&a(J,Se),G=x(Ge,G,Me),Ue===null?be=Ge:Ue.sibling=Ge,Ue=Ge,Se=zt}if(Me===ee.length)return o(J,Se),Qe&&ji(J,Me),be;if(Se===null){for(;Me<ee.length;Me++)Se=fe(J,ee[Me],oe),Se!==null&&(G=x(Se,G,Me),Ue===null?be=Se:Ue.sibling=Se,Ue=Se);return Qe&&ji(J,Me),be}for(Se=f(Se);Me<ee.length;Me++)zt=ae(Se,J,Me,ee[Me],oe),zt!==null&&(r&&zt.alternate!==null&&Se.delete(zt.key===null?Me:zt.key),G=x(zt,G,Me),Ue===null?be=zt:Ue.sibling=zt,Ue=zt);return r&&Se.forEach(function(di){return a(J,di)}),Qe&&ji(J,Me),be}function Ne(J,G,ee,oe){if(ee==null)throw Error(i(151));for(var be=null,Ue=null,Se=G,Me=G=0,zt=null,Ge=ee.next();Se!==null&&!Ge.done;Me++,Ge=ee.next()){Se.index>Me?(zt=Se,Se=null):zt=Se.sibling;var di=re(J,Se,Ge.value,oe);if(di===null){Se===null&&(Se=zt);break}r&&Se&&di.alternate===null&&a(J,Se),G=x(di,G,Me),Ue===null?be=di:Ue.sibling=di,Ue=di,Se=zt}if(Ge.done)return o(J,Se),Qe&&ji(J,Me),be;if(Se===null){for(;!Ge.done;Me++,Ge=ee.next())Ge=fe(J,Ge.value,oe),Ge!==null&&(G=x(Ge,G,Me),Ue===null?be=Ge:Ue.sibling=Ge,Ue=Ge);return Qe&&ji(J,Me),be}for(Se=f(Se);!Ge.done;Me++,Ge=ee.next())Ge=ae(Se,J,Me,Ge.value,oe),Ge!==null&&(r&&Ge.alternate!==null&&Se.delete(Ge.key===null?Me:Ge.key),G=x(Ge,G,Me),Ue===null?be=Ge:Ue.sibling=Ge,Ue=Ge);return r&&Se.forEach(function(ET){return a(J,ET)}),Qe&&ji(J,Me),be}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 be=ee.key;G!==null;){if(G.key===be){if(be=ee.type,be===b){if(G.tag===7){o(J,G.sibling),oe=g(G,ee.props.children),oe.return=J,J=oe;break e}}else if(G.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===R&&Fy(be)===G.type){o(J,G.sibling),oe=g(G,ee.props),Ql(oe,ee),oe.return=J,J=oe;break e}o(J,G);break}else a(J,G);G=G.sibling}ee.type===b?(oe=zi(ee.props.children,J.mode,oe,ee.key),oe.return=J,J=oe):(oe=Zu(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(be=ee.key;G!==null;){if(G.key===be)if(G.tag===4&&G.stateNode.containerInfo===ee.containerInfo&&G.stateNode.implementation===ee.implementation){o(J,G.sibling),oe=g(G,ee.children||[]),oe.return=J,J=oe;break e}else{o(J,G);break}else a(J,G);G=G.sibling}oe=Rf(ee,J.mode,oe),oe.return=J,J=oe}return T(J);case R:return be=ee._init,ee=be(ee._payload),rt(J,G,ee,oe)}if($(ee))return Oe(J,G,ee,oe);if(P(ee)){if(be=P(ee),typeof be!="function")throw Error(i(150));return ee=be.call(ee),Ne(J,G,ee,oe)}if(typeof ee.then=="function")return rt(J,G,uo(ee),oe);if(ee.$$typeof===E)return rt(J,G,Xu(J,ee),oe);oo(J,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,G!==null&&G.tag===6?(o(J,G.sibling),oe=g(G,ee),oe.return=J,J=oe):(o(J,G),oe=Of(ee,J.mode,oe),oe.return=J,J=oe),T(J)):o(J,G)}return function(J,G,ee,oe){try{Xl=0;var be=rt(J,G,ee,oe);return Na=null,be}catch(Se){if(Se===Ul||Se===Ku)throw Se;var Ue=on(29,Se,null,J.mode);return Ue.lanes=oe,Ue.return=J,Ue}finally{}}}var Ma=Gy(!0),Xy=Gy(!1),kn=Z(null),er=null;function Kr(r){var a=r.alternate;C(Nt,Nt.current&1),C(kn,r),er===null&&(a===null||ka.current!==null||a.memoizedState!==null)&&(er=r)}function Qy(r){if(r.tag===22){if(C(Nt,Nt.current),C(kn,r),er===null){var a=r.alternate;a!==null&&a.memoizedState!==null&&(er=r)}}else Jr()}function Jr(){C(Nt,Nt.current),C(kn,kn.current)}function Sr(r){te(kn),er===r&&(er=null),te(Nt)}var Nt=Z(0);function co(r){for(var a=r;a!==null;){if(a.tag===13){var o=a.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||eh(o)))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 fd(r,a,o,f){a=r.memoizedState,o=o(f,a),o=o==null?a:m({},a,o),r.memoizedState=o,r.lanes===0&&(r.updateQueue.baseState=o)}var dd={enqueueSetState:function(r,a,o){r=r._reactInternals;var f=hn(),g=Gr(f);g.payload=a,o!=null&&(g.callback=o),a=Xr(r,g,f),a!==null&&(mn(a,r,f),ql(a,r,f))},enqueueReplaceState:function(r,a,o){r=r._reactInternals;var f=hn(),g=Gr(f);g.tag=1,g.payload=a,o!=null&&(g.callback=o),a=Xr(r,g,f),a!==null&&(mn(a,r,f),ql(a,r,f))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var o=hn(),f=Gr(o);f.tag=2,a!=null&&(f.callback=a),a=Xr(r,f,o),a!==null&&(mn(a,r,o),ql(a,r,o))}};function Ky(r,a,o,f,g,x,T){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,x,T):a.prototype&&a.prototype.isPureReactComponent?!Rl(o,f)||!Rl(g,x):!0}function Jy(r,a,o,f){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(o,f),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(o,f),a.state!==r&&dd.enqueueReplaceState(a,a.state,null)}function qi(r,a){var o=a;if("ref"in a){o={};for(var f in a)f!=="ref"&&(o[f]=a[f])}if(r=r.defaultProps){o===a&&(o=m({},o));for(var g in r)o[g]===void 0&&(o[g]=r[g])}return o}var fo=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 Wy(r){fo(r)}function e0(r){console.error(r)}function t0(r){fo(r)}function ho(r,a){try{var o=r.onUncaughtError;o(a.value,{componentStack:a.stack})}catch(f){setTimeout(function(){throw f})}}function n0(r,a,o){try{var f=r.onCaughtError;f(o.value,{componentStack:o.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function hd(r,a,o){return o=Gr(o),o.tag=3,o.payload={element:null},o.callback=function(){ho(r,a)},o}function r0(r){return r=Gr(r),r.tag=3,r}function i0(r,a,o,f){var g=o.type.getDerivedStateFromError;if(typeof g=="function"){var x=f.value;r.payload=function(){return g(x)},r.callback=function(){n0(a,o,f)}}var T=o.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(r.callback=function(){n0(a,o,f),typeof g!="function"&&(ii===null?ii=new Set([this]):ii.add(this));var D=f.stack;this.componentDidCatch(f.value,{componentStack:D!==null?D:""})})}function Ek(r,a,o,f,g){if(o.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(a=o.alternate,a!==null&&Il(a,o,g,!0),o=kn.current,o!==null){switch(o.tag){case 13:return er===null?Id():o.alternate===null&&pt===0&&(pt=3),o.flags&=-257,o.flags|=65536,o.lanes=g,f===qf?o.flags|=16384:(a=o.updateQueue,a===null?o.updateQueue=new Set([f]):a.add(f),Hd(r,f,g)),!1;case 22:return o.flags|=65536,f===qf?o.flags|=16384:(a=o.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([f])},o.updateQueue=a):(o=a.retryQueue,o===null?a.retryQueue=new Set([f]):o.add(f)),Hd(r,f,g)),!1}throw Error(i(435,o.tag))}return Hd(r,f,g),Id(),!1}if(Qe)return a=kn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=g,f!==jf&&(r=Error(i(422),{cause:f}),Ll(_n(r,o)))):(f!==jf&&(a=Error(i(423),{cause:f}),Ll(_n(a,o))),r=r.current.alternate,r.flags|=65536,g&=-g,r.lanes|=g,f=_n(f,o),g=hd(r.stateNode,f,g),Zf(r,g),pt!==4&&(pt=2)),!1;var x=Error(i(520),{cause:f});if(x=_n(x,o),rs===null?rs=[x]:rs.push(x),pt!==4&&(pt=2),a===null)return!0;f=_n(f,o),o=a;do{switch(o.tag){case 3:return o.flags|=65536,r=g&-g,o.lanes|=r,r=hd(o.stateNode,f,r),Zf(o,r),!1;case 1:if(a=o.type,x=o.stateNode,(o.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ii===null||!ii.has(x))))return o.flags|=65536,g&=-g,o.lanes|=g,g=r0(g),i0(g,r,o,f),Zf(o,g),!1}o=o.return}while(o!==null);return!1}var a0=Error(i(461)),Ot=!1;function Dt(r,a,o,f){a.child=r===null?Xy(a,null,o,f):Ma(a,r.child,o,f)}function l0(r,a,o,f,g){o=o.render;var x=a.ref;if("ref"in f){var T={};for(var D in f)D!=="ref"&&(T[D]=f[D])}else T=f;return Hi(a),f=Qf(r,a,o,T,x,g),D=Kf(),r!==null&&!Ot?(Jf(r,a,g),Er(r,a,g)):(Qe&&D&&zf(a),a.flags|=1,Dt(r,a,f,g),a.child)}function s0(r,a,o,f,g){if(r===null){var x=o.type;return typeof x=="function"&&!Mf(x)&&x.defaultProps===void 0&&o.compare===null?(a.tag=15,a.type=x,u0(r,a,x,f,g)):(r=Zu(o.type,null,f,a,a.mode,g),r.ref=a.ref,r.return=a,a.child=r)}if(x=r.child,!_d(r,g)){var T=x.memoizedProps;if(o=o.compare,o=o!==null?o:Rl,o(T,f)&&r.ref===a.ref)return Er(r,a,g)}return a.flags|=1,r=yr(x,f),r.ref=a.ref,r.return=a,a.child=r}function u0(r,a,o,f,g){if(r!==null){var x=r.memoizedProps;if(Rl(x,f)&&r.ref===a.ref)if(Ot=!1,a.pendingProps=f=x,_d(r,g))(r.flags&131072)!==0&&(Ot=!0);else return a.lanes=r.lanes,Er(r,a,g)}return md(r,a,o,f,g)}function o0(r,a,o){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|o:o,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 c0(r,a,f,o)}if((o&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&Qu(a,x!==null?x.cachePool:null),x!==null?uy(a,x):Ff(),Qy(a);else return a.lanes=a.childLanes=536870912,c0(r,a,x!==null?x.baseLanes|o:o,o)}else x!==null?(Qu(a,x.cachePool),uy(a,x),Jr(),a.memoizedState=null):(r!==null&&Qu(a,null),Ff(),Jr());return Dt(r,a,g,o),a.child}function c0(r,a,o,f){var g=Pf();return g=g===null?null:{parent:At._currentValue,pool:g},a.memoizedState={baseLanes:o,cachePool:g},r!==null&&Qu(a,null),Ff(),Qy(a),r!==null&&Il(r,a,f,!0),null}function mo(r,a){var o=a.ref;if(o===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(i(284));(r===null||r.ref!==o)&&(a.flags|=4194816)}}function md(r,a,o,f,g){return Hi(a),o=Qf(r,a,o,f,void 0,g),f=Kf(),r!==null&&!Ot?(Jf(r,a,g),Er(r,a,g)):(Qe&&f&&zf(a),a.flags|=1,Dt(r,a,o,g),a.child)}function f0(r,a,o,f,g,x){return Hi(a),a.updateQueue=null,o=cy(a,f,o,g),oy(r),f=Kf(),r!==null&&!Ot?(Jf(r,a,x),Er(r,a,x)):(Qe&&f&&zf(a),a.flags|=1,Dt(r,a,o,x),a.child)}function d0(r,a,o,f,g){if(Hi(a),a.stateNode===null){var x=ba,T=o.contextType;typeof T=="object"&&T!==null&&(x=Ht(T)),x=new o(f,x),a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=dd,a.stateNode=x,x._reactInternals=a,x=a.stateNode,x.props=f,x.state=a.memoizedState,x.refs={},Vf(a),T=o.contextType,x.context=typeof T=="object"&&T!==null?Ht(T):ba,x.state=a.memoizedState,T=o.getDerivedStateFromProps,typeof T=="function"&&(fd(a,o,T,f),x.state=a.memoizedState),typeof o.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&&dd.enqueueReplaceState(x,x.state,null),$l(a,f,x,g),Vl(),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308),f=!0}else if(r===null){x=a.stateNode;var D=a.memoizedProps,V=qi(o,D);x.props=V;var ne=x.context,se=o.contextType;T=ba,typeof se=="object"&&se!==null&&(T=Ht(se));var fe=o.getDerivedStateFromProps;se=typeof fe=="function"||typeof x.getSnapshotBeforeUpdate=="function",D=a.pendingProps!==D,se||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(D||ne!==T)&&Jy(a,x,f,T),Fr=!1;var re=a.memoizedState;x.state=re,$l(a,f,x,g),Vl(),ne=a.memoizedState,D||re!==ne||Fr?(typeof fe=="function"&&(fd(a,o,fe,f),ne=a.memoizedState),(V=Fr||Ky(a,o,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,$f(r,a),T=a.memoizedProps,se=qi(o,T),x.props=se,fe=a.pendingProps,re=x.context,ne=o.contextType,V=ba,typeof ne=="object"&&ne!==null&&(V=Ht(ne)),D=o.getDerivedStateFromProps,(ne=typeof D=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(T!==fe||re!==V)&&Jy(a,x,f,V),Fr=!1,re=a.memoizedState,x.state=re,$l(a,f,x,g),Vl();var ae=a.memoizedState;T!==fe||re!==ae||Fr||r!==null&&r.dependencies!==null&&Gu(r.dependencies)?(typeof D=="function"&&(fd(a,o,D,f),ae=a.memoizedState),(se=Fr||Ky(a,o,se,f,re,ae,V)||r!==null&&r.dependencies!==null&&Gu(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,mo(r,a),f=(a.flags&128)!==0,x||f?(x=a.stateNode,o=f&&typeof o.getDerivedStateFromError!="function"?null:x.render(),a.flags|=1,r!==null&&f?(a.child=Ma(a,r.child,null,g),a.child=Ma(a,null,o,g)):Dt(r,a,o,g),a.memoizedState=x.state,r=a.child):r=Er(r,a,g),r}function h0(r,a,o,f){return jl(),a.flags|=256,Dt(r,a,o,f),a.child}var pd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gd(r){return{baseLanes:r,cachePool:ey()}}function yd(r,a,o){return r=r!==null?r.childLanes&~o:0,a&&(r|=Tn),r}function m0(r,a,o){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?Kr(a):Jr(),Qe){var D=mt,V;if(V=D){e:{for(V=D,D=Wn;V.nodeType!==8;){if(!D){D=null;break e}if(V=jn(V.nextSibling),V===null){D=null;break e}}D=V}D!==null?(a.memoizedState={dehydrated:D,treeContext:Di!==null?{id:vr,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},V=on(18,null,null,0),V.stateNode=D,V.return=a,a.child=V,Yt=a,mt=null,V=!0):V=!1}V||Ii(a)}if(D=a.memoizedState,D!==null&&(D=D.dehydrated,D!==null))return eh(D)?a.lanes=32:a.lanes=536870912,null;Sr(a)}return D=f.children,f=f.fallback,g?(Jr(),g=a.mode,D=po({mode:"hidden",children:D},g),f=zi(f,g,o,null),D.return=a,f.return=a,D.sibling=f,a.child=D,g=a.child,g.memoizedState=gd(o),g.childLanes=yd(r,T,o),a.memoizedState=pd,f):(Kr(a),vd(a,D))}if(V=r.memoizedState,V!==null&&(D=V.dehydrated,D!==null)){if(x)a.flags&256?(Kr(a),a.flags&=-257,a=xd(r,a,o)):a.memoizedState!==null?(Jr(),a.child=r.child,a.flags|=128,a=null):(Jr(),g=f.fallback,D=a.mode,f=po({mode:"visible",children:f.children},D),g=zi(g,D,o,null),g.flags|=2,f.return=a,g.return=a,f.sibling=g,a.child=f,Ma(a,r.child,null,o),f=a.child,f.memoizedState=gd(o),f.childLanes=yd(r,T,o),a.memoizedState=pd,a=g);else if(Kr(a),eh(D)){if(T=D.nextSibling&&D.nextSibling.dataset,T)var ne=T.dgst;T=ne,f=Error(i(419)),f.stack="",f.digest=T,Ll({value:f,source:null,stack:null}),a=xd(r,a,o)}else if(Ot||Il(r,a,o,!1),T=(o&r.childLanes)!==0,Ot||T){if(T=st,T!==null&&(f=o&-o,f=(f&42)!==0?1:yl(f),f=(f&(T.suspendedLanes|o))!==0?0:f,f!==0&&f!==V.retryLane))throw V.retryLane=f,xa(r,f),mn(T,r,f),a0;D.data==="$?"||Id(),a=xd(r,a,o)}else D.data==="$?"?(a.flags|=192,a.child=r.child,a=null):(r=V.treeContext,mt=jn(D.nextSibling),Yt=a,Qe=!0,Li=null,Wn=!1,r!==null&&(Sn[En++]=vr,Sn[En++]=xr,Sn[En++]=Di,vr=r.id,xr=r.overflow,Di=a),a=vd(a,f.children),a.flags|=4096);return a}return g?(Jr(),g=f.fallback,D=a.mode,V=r.child,ne=V.sibling,f=yr(V,{mode:"hidden",children:f.children}),f.subtreeFlags=V.subtreeFlags&65011712,ne!==null?g=yr(ne,g):(g=zi(g,D,o,null),g.flags|=2),g.return=a,f.return=a,f.sibling=g,a.child=f,f=g,g=a.child,D=r.child.memoizedState,D===null?D=gd(o):(V=D.cachePool,V!==null?(ne=At._currentValue,V=V.parent!==ne?{parent:ne,pool:ne}:V):V=ey(),D={baseLanes:D.baseLanes|o,cachePool:V}),g.memoizedState=D,g.childLanes=yd(r,T,o),a.memoizedState=pd,f):(Kr(a),o=r.child,r=o.sibling,o=yr(o,{mode:"visible",children:f.children}),o.return=a,o.sibling=null,r!==null&&(T=a.deletions,T===null?(a.deletions=[r],a.flags|=16):T.push(r)),a.child=o,a.memoizedState=null,o)}function vd(r,a){return a=po({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function po(r,a){return r=on(22,r,null,a),r.lanes=0,r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},r}function xd(r,a,o){return Ma(a,r.child,null,o),r=vd(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function p0(r,a,o){r.lanes|=a;var f=r.alternate;f!==null&&(f.lanes|=a),If(r.return,a,o)}function bd(r,a,o,f,g){var x=r.memoizedState;x===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:f,tail:o,tailMode:g}:(x.isBackwards=a,x.rendering=null,x.renderingStartTime=0,x.last=f,x.tail=o,x.tailMode=g)}function g0(r,a,o){var f=a.pendingProps,g=f.revealOrder,x=f.tail;if(Dt(r,a,f.children,o),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&&p0(r,o,a);else if(r.tag===19)p0(r,o,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(o=a.child,g=null;o!==null;)r=o.alternate,r!==null&&co(r)===null&&(g=o),o=o.sibling;o=g,o===null?(g=a.child,a.child=null):(g=o.sibling,o.sibling=null),bd(a,!1,g,o,x);break;case"backwards":for(o=null,g=a.child,a.child=null;g!==null;){if(r=g.alternate,r!==null&&co(r)===null){a.child=g;break}r=g.sibling,g.sibling=o,o=g,g=r}bd(a,!0,o,null,x);break;case"together":bd(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Er(r,a,o){if(r!==null&&(a.dependencies=r.dependencies),ri|=a.lanes,(o&a.childLanes)===0)if(r!==null){if(Il(r,a,o,!1),(o&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,o=yr(r,r.pendingProps),a.child=o,o.return=a;r.sibling!==null;)r=r.sibling,o=o.sibling=yr(r,r.pendingProps),o.return=a;o.sibling=null}return a.child}function _d(r,a){return(r.lanes&a)!==0?!0:(r=r.dependencies,!!(r!==null&&Gu(r)))}function kk(r,a,o){switch(a.tag){case 3:ce(a,a.stateNode.containerInfo),Yr(a,At,r.memoizedState.cache),jl();break;case 27:case 5:ke(a);break;case 4:ce(a,a.stateNode.containerInfo);break;case 10:Yr(a,a.type,a.memoizedProps.value);break;case 13:var f=a.memoizedState;if(f!==null)return f.dehydrated!==null?(Kr(a),a.flags|=128,null):(o&a.child.childLanes)!==0?m0(r,a,o):(Kr(a),r=Er(r,a,o),r!==null?r.sibling:null);Kr(a);break;case 19:var g=(r.flags&128)!==0;if(f=(o&a.childLanes)!==0,f||(Il(r,a,o,!1),f=(o&a.childLanes)!==0),g){if(f)return g0(r,a,o);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,o0(r,a,o);case 24:Yr(a,At,r.memoizedState.cache)}return Er(r,a,o)}function y0(r,a,o){if(r!==null)if(r.memoizedProps!==a.pendingProps)Ot=!0;else{if(!_d(r,o)&&(a.flags&128)===0)return Ot=!1,kk(r,a,o);Ot=(r.flags&131072)!==0}else Ot=!1,Qe&&(a.flags&1048576)!==0&&Fg(a,Fu,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")Mf(f)?(r=qi(f,r),a.tag=1,a=d0(null,a,f,r,o)):(a.tag=0,a=md(null,a,f,r,o));else{if(f!=null){if(g=f.$$typeof,g===N){a.tag=11,a=l0(null,a,f,r,o);break e}else if(g===U){a.tag=14,a=s0(null,a,f,r,o);break e}}throw a=z(f)||f,Error(i(306,a,""))}}return a;case 0:return md(r,a,a.type,a.pendingProps,o);case 1:return f=a.type,g=qi(f,a.pendingProps),d0(r,a,f,g,o);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,$f(r,a),$l(a,f,null,o);var T=a.memoizedState;if(f=T.cache,Yr(a,At,f),f!==x.cache&&Bf(a,[At],o,!0),Vl(),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=h0(r,a,f,o);break e}else if(f!==g){g=_n(Error(i(424)),a),Ll(g),a=h0(r,a,f,o);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(mt=jn(r.firstChild),Yt=a,Qe=!0,Li=null,Wn=!0,o=Xy(a,null,f,o),a.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(jl(),f===g){a=Er(r,a,o);break e}Dt(r,a,f,o)}a=a.child}return a;case 26:return mo(r,a),r===null?(o=_v(a.type,null,a.pendingProps,null))?a.memoizedState=o:Qe||(o=a.type,r=a.pendingProps,f=No(W.current).createElement(o),f[Mt]=a,f[Bt]=r,Lt(f,o,r),wt(f),a.stateNode=f):a.memoizedState=_v(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return ke(a),r===null&&Qe&&(f=a.stateNode=vv(a.type,a.pendingProps,W.current),Yt=a,Wn=!0,g=mt,si(a.type)?(th=g,mt=jn(f.firstChild)):mt=g),Dt(r,a,a.pendingProps.children,o),mo(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&Qe&&((g=f=mt)&&(f=Wk(f,a.type,a.pendingProps,Wn),f!==null?(a.stateNode=f,Yt=a,mt=jn(f.firstChild),Wn=!1,g=!0):g=!1),g||Ii(a)),ke(a),g=a.type,x=a.pendingProps,T=r!==null?r.memoizedProps:null,f=x.children,Kd(g,x)?f=null:T!==null&&Kd(g,T)&&(a.flags|=32),a.memoizedState!==null&&(g=Qf(r,a,yk,null,null,o),ds._currentValue=g),mo(r,a),Dt(r,a,f,o),a.child;case 6:return r===null&&Qe&&((r=o=mt)&&(o=eT(o,a.pendingProps,Wn),o!==null?(a.stateNode=o,Yt=a,mt=null,r=!0):r=!1),r||Ii(a)),null;case 13:return m0(r,a,o);case 4:return ce(a,a.stateNode.containerInfo),f=a.pendingProps,r===null?a.child=Ma(a,null,f,o):Dt(r,a,f,o),a.child;case 11:return l0(r,a,a.type,a.pendingProps,o);case 7:return Dt(r,a,a.pendingProps,o),a.child;case 8:return Dt(r,a,a.pendingProps.children,o),a.child;case 12:return Dt(r,a,a.pendingProps.children,o),a.child;case 10:return f=a.pendingProps,Yr(a,a.type,f.value),Dt(r,a,f.children,o),a.child;case 9:return g=a.type._context,f=a.pendingProps.children,Hi(a),g=Ht(g),f=f(g),a.flags|=1,Dt(r,a,f,o),a.child;case 14:return s0(r,a,a.type,a.pendingProps,o);case 15:return u0(r,a,a.type,a.pendingProps,o);case 19:return g0(r,a,o);case 31:return f=a.pendingProps,o=a.mode,f={mode:f.mode,children:f.children},r===null?(o=po(f,o),o.ref=a.ref,a.child=o,o.return=a,a=o):(o=yr(r.child,f),o.ref=a.ref,a.child=o,o.return=a,a=o),a;case 22:return o0(r,a,o);case 24:return Hi(a),f=Ht(At),r===null?(g=Pf(),g===null&&(g=st,x=Hf(),g.pooledCache=x,x.refCount++,x!==null&&(g.pooledCacheLanes|=o),g=x),a.memoizedState={parent:f,cache:g},Vf(a),Yr(a,At,g)):((r.lanes&o)!==0&&($f(r,a),$l(a,null,null,o),Vl()),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),Yr(a,At,f)):(f=x.cache,Yr(a,At,f),f!==g.cache&&Bf(a,[At],o,!0))),Dt(r,a,a.pendingProps.children,o),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function kr(r){r.flags|=4}function v0(r,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Tv(a)){if(a=kn.current,a!==null&&(($e&4194048)===$e?er!==null:($e&62914560)!==$e&&($e&536870912)===0||a!==er))throw Pl=qf,ty;r.flags|=8192}}function go(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag!==22?Su():536870912,r.lanes|=a,Da|=a)}function Kl(r,a){if(!Qe)switch(r.tailMode){case"hidden":a=r.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?r.tail=null:o.sibling=null;break;case"collapsed":o=r.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.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,o=0,f=0;if(a)for(var g=r.child;g!==null;)o|=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;)o|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=f,r.childLanes=o,a}function Tk(r,a,o){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 o=a.stateNode,f=null,r!==null&&(f=r.memoizedState.cache),a.memoizedState.cache!==f&&(a.flags|=2048),_r(At),ge(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(r===null||r.child===null)&&(Dl(a)?kr(a):r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Qg())),dt(a),null;case 26:return o=a.memoizedState,r===null?(kr(a),o!==null?(dt(a),v0(a,o)):(dt(a),a.flags&=-16777217)):o?o!==r.memoizedState?(kr(a),dt(a),v0(a,o)):(dt(a),a.flags&=-16777217):(r.memoizedProps!==f&&kr(a),dt(a),a.flags&=-16777217),null;case 27:we(a),o=W.current;var g=a.type;if(r!==null&&a.stateNode!=null)r.memoizedProps!==f&&kr(a);else{if(!f){if(a.stateNode===null)throw Error(i(166));return dt(a),null}r=Y.current,Dl(a)?Gg(a):(r=vv(g,f,o),a.stateNode=r,kr(a))}return dt(a),null;case 5:if(we(a),o=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==f&&kr(a);else{if(!f){if(a.stateNode===null)throw Error(i(166));return dt(a),null}if(r=Y.current,Dl(a))Gg(a);else{switch(g=No(W.current),r){case 1:r=g.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:r=g.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":r=g.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":r=g.createElementNS("http://www.w3.org/1998/Math/MathML",o);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(o,{is:f.is}):g.createElement(o)}}r[Mt]=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,o,f),o){case"button":case"input":case"select":case"textarea":r=!!f.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&kr(a)}}return dt(a),a.flags&=-16777217,null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==f&&kr(a);else{if(typeof f!="string"&&a.stateNode===null)throw Error(i(166));if(r=W.current,Dl(a)){if(r=a.stateNode,o=a.memoizedProps,f=null,g=Yt,g!==null)switch(g.tag){case 27:case 5:f=g.memoizedProps}r[Mt]=a,r=!!(r.nodeValue===o||f!==null&&f.suppressHydrationWarning===!0||fv(r.nodeValue,o)),r||Ii(a)}else r=No(r).createTextNode(f),r[Mt]=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=Dl(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[Mt]=a}else jl(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;dt(a),g=!1}else g=Qg(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=g),g=!0;if(!g)return a.flags&256?(Sr(a),a):(Sr(a),null)}if(Sr(a),(a.flags&128)!==0)return a.lanes=o,a;if(o=f!==null,r=r!==null&&r.memoizedState!==null,o){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 o!==r&&o&&(a.child.flags|=8192),go(a,a.updateQueue),dt(a),null;case 4:return ge(),r===null&&Yd(a.stateNode.containerInfo),dt(a),null;case 10:return _r(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)Kl(g,!1);else{if(pt!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(x=co(r),x!==null){for(a.flags|=128,Kl(g,!1),r=x.updateQueue,a.updateQueue=r,go(a,r),a.subtreeFlags=0,r=o,o=a.child;o!==null;)Yg(o,r),o=o.sibling;return C(Nt,Nt.current&1|2),a.child}r=r.sibling}g.tail!==null&&bt()>xo&&(a.flags|=128,f=!0,Kl(g,!1),a.lanes=4194304)}else{if(!f)if(r=co(x),r!==null){if(a.flags|=128,f=!0,r=r.updateQueue,a.updateQueue=r,go(a,r),Kl(g,!0),g.tail===null&&g.tailMode==="hidden"&&!x.alternate&&!Qe)return dt(a),null}else 2*bt()-g.renderingStartTime>xo&&o!==536870912&&(a.flags|=128,f=!0,Kl(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=bt(),a.sibling=null,r=Nt.current,C(Nt,f?r&1|2:r&1),a):(dt(a),null);case 22:case 23:return Sr(a),Gf(),f=a.memoizedState!==null,r!==null?r.memoizedState!==null!==f&&(a.flags|=8192):f&&(a.flags|=8192),f?(o&536870912)!==0&&(a.flags&128)===0&&(dt(a),a.subtreeFlags&6&&(a.flags|=8192)):dt(a),o=a.updateQueue,o!==null&&go(a,o.retryQueue),o=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==o&&(a.flags|=2048),r!==null&&te(Ui),null;case 24:return o=null,r!==null&&(o=r.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),_r(At),dt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function Ck(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 _r(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(Sr(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(i(340));jl()}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 _r(a.type),null;case 22:case 23:return Sr(a),Gf(),r!==null&&te(Ui),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return _r(At),null;case 25:return null;default:return null}}function x0(r,a){switch(Df(a),a.tag){case 3:_r(At),ge();break;case 26:case 27:case 5:we(a);break;case 4:ge();break;case 13:Sr(a);break;case 19:te(Nt);break;case 10:_r(a.type);break;case 22:case 23:Sr(a),Gf(),r!==null&&te(Ui);break;case 24:_r(At)}}function Jl(r,a){try{var o=a.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var g=f.next;o=g;do{if((o.tag&r)===r){f=void 0;var x=o.create,T=o.inst;f=x(),T.destroy=f}o=o.next}while(o!==g)}}catch(D){it(a,a.return,D)}}function Wr(r,a,o){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,D=T.destroy;if(D!==void 0){T.destroy=void 0,g=a;var V=o,ne=D;try{ne()}catch(se){it(g,V,se)}}}f=f.next}while(f!==x)}}catch(se){it(a,a.return,se)}}function b0(r){var a=r.updateQueue;if(a!==null){var o=r.stateNode;try{sy(a,o)}catch(f){it(r,r.return,f)}}}function _0(r,a,o){o.props=qi(r.type,r.memoizedProps),o.state=r.memoizedState;try{o.componentWillUnmount()}catch(f){it(r,a,f)}}function Wl(r,a){try{var o=r.ref;if(o!==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 o=="function"?r.refCleanup=o(f):o.current=f}}catch(g){it(r,a,g)}}function tr(r,a){var o=r.ref,f=r.refCleanup;if(o!==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 o=="function")try{o(null)}catch(g){it(r,a,g)}else o.current=null}function w0(r){var a=r.type,o=r.memoizedProps,f=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":o.autoFocus&&f.focus();break e;case"img":o.src?f.src=o.src:o.srcSet&&(f.srcset=o.srcSet)}}catch(g){it(r,r.return,g)}}function wd(r,a,o){try{var f=r.stateNode;Gk(f,r.type,o,a),f[Bt]=a}catch(g){it(r,r.return,g)}}function S0(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&si(r.type)||r.tag===4}function Sd(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||S0(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&&si(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 Ed(r,a,o){var f=r.tag;if(f===5||f===6)r=r.stateNode,a?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(r,a):(a=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,a.appendChild(r),o=o._reactRootContainer,o!=null||a.onclick!==null||(a.onclick=Ao));else if(f!==4&&(f===27&&si(r.type)&&(o=r.stateNode,a=null),r=r.child,r!==null))for(Ed(r,a,o),r=r.sibling;r!==null;)Ed(r,a,o),r=r.sibling}function yo(r,a,o){var f=r.tag;if(f===5||f===6)r=r.stateNode,a?o.insertBefore(r,a):o.appendChild(r);else if(f!==4&&(f===27&&si(r.type)&&(o=r.stateNode),r=r.child,r!==null))for(yo(r,a,o),r=r.sibling;r!==null;)yo(r,a,o),r=r.sibling}function E0(r){var a=r.stateNode,o=r.memoizedProps;try{for(var f=r.type,g=a.attributes;g.length;)a.removeAttributeNode(g[0]);Lt(a,f,o),a[Mt]=r,a[Bt]=o}catch(x){it(r,r.return,x)}}var Tr=!1,vt=!1,kd=!1,k0=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function Ak(r,a){if(r=r.containerInfo,Xd=jo,r=Lg(r),Sf(r)){if("selectionStart"in r)var o={start:r.selectionStart,end:r.selectionEnd};else e:{o=(o=r.ownerDocument)&&o.defaultView||window;var f=o.getSelection&&o.getSelection();if(f&&f.rangeCount!==0){o=f.anchorNode;var g=f.anchorOffset,x=f.focusNode;f=f.focusOffset;try{o.nodeType,x.nodeType}catch{o=null;break e}var T=0,D=-1,V=-1,ne=0,se=0,fe=r,re=null;t:for(;;){for(var ae;fe!==o||g!==0&&fe.nodeType!==3||(D=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===o&&++ne===g&&(D=T),re===x&&++se===f&&(V=T),(ae=fe.nextSibling)!==null)break;fe=re,re=fe.parentNode}fe=ae}o=D===-1||V===-1?null:{start:D,end:V}}else o=null}o=o||{start:0,end:0}}else o=null;for(Qd={focusedElem:r,selectionRange:o},jo=!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,o=a,g=x.memoizedProps,x=x.memoizedState,f=o.stateNode;try{var Oe=qi(o.type,g,o.elementType===o.type);r=f.getSnapshotBeforeUpdate(Oe,x),f.__reactInternalSnapshotBeforeUpdate=r}catch(Ne){it(o,o.return,Ne)}}break;case 3:if((r&1024)!==0){if(r=a.stateNode.containerInfo,o=r.nodeType,o===9)Wd(r);else if(o===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Wd(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 T0(r,a,o){var f=o.flags;switch(o.tag){case 0:case 11:case 15:ei(r,o),f&4&&Jl(5,o);break;case 1:if(ei(r,o),f&4)if(r=o.stateNode,a===null)try{r.componentDidMount()}catch(T){it(o,o.return,T)}else{var g=qi(o.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(g,a,r.__reactInternalSnapshotBeforeUpdate)}catch(T){it(o,o.return,T)}}f&64&&b0(o),f&512&&Wl(o,o.return);break;case 3:if(ei(r,o),f&64&&(r=o.updateQueue,r!==null)){if(a=null,o.child!==null)switch(o.child.tag){case 27:case 5:a=o.child.stateNode;break;case 1:a=o.child.stateNode}try{sy(r,a)}catch(T){it(o,o.return,T)}}break;case 27:a===null&&f&4&&E0(o);case 26:case 5:ei(r,o),a===null&&f&4&&w0(o),f&512&&Wl(o,o.return);break;case 12:ei(r,o);break;case 13:ei(r,o),f&4&&N0(r,o),f&64&&(r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(o=Ik.bind(null,o),tT(r,o))));break;case 22:if(f=o.memoizedState!==null||Tr,!f){a=a!==null&&a.memoizedState!==null||vt,g=Tr;var x=vt;Tr=f,(vt=a)&&!x?ti(r,o,(o.subtreeFlags&8772)!==0):ei(r,o),Tr=g,vt=x}break;case 30:break;default:ei(r,o)}}function C0(r){var a=r.alternate;a!==null&&(r.alternate=null,C0(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&bl(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,tn=!1;function Cr(r,a,o){for(o=o.child;o!==null;)A0(r,a,o),o=o.sibling}function A0(r,a,o){if(de&&typeof de.onCommitFiberUnmount=="function")try{de.onCommitFiberUnmount(le,o)}catch{}switch(o.tag){case 26:vt||tr(o,a),Cr(r,a,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:vt||tr(o,a);var f=ct,g=tn;si(o.type)&&(ct=o.stateNode,tn=!1),Cr(r,a,o),us(o.stateNode),ct=f,tn=g;break;case 5:vt||tr(o,a);case 6:if(f=ct,g=tn,ct=null,Cr(r,a,o),ct=f,tn=g,ct!==null)if(tn)try{(ct.nodeType===9?ct.body:ct.nodeName==="HTML"?ct.ownerDocument.body:ct).removeChild(o.stateNode)}catch(x){it(o,a,x)}else try{ct.removeChild(o.stateNode)}catch(x){it(o,a,x)}break;case 18:ct!==null&&(tn?(r=ct,gv(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,o.stateNode),gs(r)):gv(ct,o.stateNode));break;case 4:f=ct,g=tn,ct=o.stateNode.containerInfo,tn=!0,Cr(r,a,o),ct=f,tn=g;break;case 0:case 11:case 14:case 15:vt||Wr(2,o,a),vt||Wr(4,o,a),Cr(r,a,o);break;case 1:vt||(tr(o,a),f=o.stateNode,typeof f.componentWillUnmount=="function"&&_0(o,a,f)),Cr(r,a,o);break;case 21:Cr(r,a,o);break;case 22:vt=(f=vt)||o.memoizedState!==null,Cr(r,a,o),vt=f;break;default:Cr(r,a,o)}}function N0(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{gs(r)}catch(o){it(a,a.return,o)}}function Nk(r){switch(r.tag){case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new k0),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new k0),a;default:throw Error(i(435,r.tag))}}function Td(r,a){var o=Nk(r);a.forEach(function(f){var g=Bk.bind(null,r,f);o.has(f)||(o.add(f),f.then(g,g))})}function cn(r,a){var o=a.deletions;if(o!==null)for(var f=0;f<o.length;f++){var g=o[f],x=r,T=a,D=T;e:for(;D!==null;){switch(D.tag){case 27:if(si(D.type)){ct=D.stateNode,tn=!1;break e}break;case 5:ct=D.stateNode,tn=!1;break e;case 3:case 4:ct=D.stateNode.containerInfo,tn=!0;break e}D=D.return}if(ct===null)throw Error(i(160));A0(x,T,g),ct=null,tn=!1,x=g.alternate,x!==null&&(x.return=null),g.return=null}if(a.subtreeFlags&13878)for(a=a.child;a!==null;)M0(a,r),a=a.sibling}var Dn=null;function M0(r,a){var o=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:cn(a,r),fn(r),f&4&&(Wr(3,r,r.return),Jl(3,r),Wr(5,r,r.return));break;case 1:cn(a,r),fn(r),f&512&&(vt||o===null||tr(o,o.return)),f&64&&Tr&&(r=r.updateQueue,r!==null&&(f=r.callbacks,f!==null&&(o=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=o===null?f:o.concat(f))));break;case 26:var g=Dn;if(cn(a,r),fn(r),f&512&&(vt||o===null||tr(o,o.return)),f&4){var x=o!==null?o.memoizedState:null;if(f=r.memoizedState,o===null)if(f===null)if(r.stateNode===null){e:{f=r.type,o=r.memoizedProps,g=g.ownerDocument||g;t:switch(f){case"title":x=g.getElementsByTagName("title")[0],(!x||x[Ni]||x[Mt]||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,o),x[Mt]=r,wt(x),f=x;break e;case"link":var T=Ev("link","href",g).get(f+(o.href||""));if(T){for(var D=0;D<T.length;D++)if(x=T[D],x.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&x.getAttribute("rel")===(o.rel==null?null:o.rel)&&x.getAttribute("title")===(o.title==null?null:o.title)&&x.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){T.splice(D,1);break t}}x=g.createElement(f),Lt(x,f,o),g.head.appendChild(x);break;case"meta":if(T=Ev("meta","content",g).get(f+(o.content||""))){for(D=0;D<T.length;D++)if(x=T[D],x.getAttribute("content")===(o.content==null?null:""+o.content)&&x.getAttribute("name")===(o.name==null?null:o.name)&&x.getAttribute("property")===(o.property==null?null:o.property)&&x.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&x.getAttribute("charset")===(o.charSet==null?null:o.charSet)){T.splice(D,1);break t}}x=g.createElement(f),Lt(x,f,o),g.head.appendChild(x);break;default:throw Error(i(468,f))}x[Mt]=r,wt(x),f=x}r.stateNode=f}else kv(g,r.type,r.stateNode);else r.stateNode=Sv(g,f,r.memoizedProps);else x!==f?(x===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):x.count--,f===null?kv(g,r.type,r.stateNode):Sv(g,f,r.memoizedProps)):f===null&&r.stateNode!==null&&wd(r,r.memoizedProps,o.memoizedProps)}break;case 27:cn(a,r),fn(r),f&512&&(vt||o===null||tr(o,o.return)),o!==null&&f&4&&wd(r,r.memoizedProps,o.memoizedProps);break;case 5:if(cn(a,r),fn(r),f&512&&(vt||o===null||tr(o,o.return)),r.flags&32){g=r.stateNode;try{da(g,"")}catch(ae){it(r,r.return,ae)}}f&4&&r.stateNode!=null&&(g=r.memoizedProps,wd(r,g,o!==null?o.memoizedProps:g)),f&1024&&(kd=!0);break;case 6:if(cn(a,r),fn(r),f&4){if(r.stateNode===null)throw Error(i(162));f=r.memoizedProps,o=r.stateNode;try{o.nodeValue=f}catch(ae){it(r,r.return,ae)}}break;case 3:if(Ro=null,g=Dn,Dn=Mo(a.containerInfo),cn(a,r),Dn=g,fn(r),f&4&&o!==null&&o.memoizedState.isDehydrated)try{gs(a.containerInfo)}catch(ae){it(r,r.return,ae)}kd&&(kd=!1,O0(r));break;case 4:f=Dn,Dn=Mo(r.stateNode.containerInfo),cn(a,r),fn(r),Dn=f;break;case 12:cn(a,r),fn(r);break;case 13:cn(a,r),fn(r),r.child.flags&8192&&r.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Rd=bt()),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Td(r,f)));break;case 22:g=r.memoizedState!==null;var V=o!==null&&o.memoizedState!==null,ne=Tr,se=vt;if(Tr=ne||g,vt=se||V,cn(a,r),vt=se,Tr=ne,fn(r),f&8192)e:for(a=r.stateNode,a._visibility=g?a._visibility&-2:a._visibility|1,g&&(o===null||V||Tr||vt||Vi(r)),o=null,a=r;;){if(a.tag===5||a.tag===26){if(o===null){V=o=a;try{if(x=V.stateNode,g)T=x.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{D=V.stateNode;var fe=V.memoizedProps.style,re=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;D.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(ae){it(V,V.return,ae)}}}else if(a.tag===6){if(o===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;o===a&&(o=null),a=a.return}o===a&&(o=null),a.sibling.return=a.return,a=a.sibling}f&4&&(f=r.updateQueue,f!==null&&(o=f.retryQueue,o!==null&&(f.retryQueue=null,Td(r,o))));break;case 19:cn(a,r),fn(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Td(r,f)));break;case 30:break;case 21:break;default:cn(a,r),fn(r)}}function fn(r){var a=r.flags;if(a&2){try{for(var o,f=r.return;f!==null;){if(S0(f)){o=f;break}f=f.return}if(o==null)throw Error(i(160));switch(o.tag){case 27:var g=o.stateNode,x=Sd(r);yo(r,x,g);break;case 5:var T=o.stateNode;o.flags&32&&(da(T,""),o.flags&=-33);var D=Sd(r);yo(r,D,T);break;case 3:case 4:var V=o.stateNode.containerInfo,ne=Sd(r);Ed(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 O0(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;O0(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),r=r.sibling}}function ei(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)T0(r,a.alternate,a),a=a.sibling}function Vi(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:Wr(4,a,a.return),Vi(a);break;case 1:tr(a,a.return);var o=a.stateNode;typeof o.componentWillUnmount=="function"&&_0(a,a.return,o),Vi(a);break;case 27:us(a.stateNode);case 26:case 5:tr(a,a.return),Vi(a);break;case 22:a.memoizedState===null&&Vi(a);break;case 30:Vi(a);break;default:Vi(a)}r=r.sibling}}function ti(r,a,o){for(o=o&&(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:ti(g,x,o),Jl(4,x);break;case 1:if(ti(g,x,o),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 D=f.stateNode;try{var V=g.shared.hiddenCallbacks;if(V!==null)for(g.shared.hiddenCallbacks=null,g=0;g<V.length;g++)ly(V[g],D)}catch(ne){it(f,f.return,ne)}}o&&T&64&&b0(x),Wl(x,x.return);break;case 27:E0(x);case 26:case 5:ti(g,x,o),o&&f===null&&T&4&&w0(x),Wl(x,x.return);break;case 12:ti(g,x,o);break;case 13:ti(g,x,o),o&&T&4&&N0(g,x);break;case 22:x.memoizedState===null&&ti(g,x,o),Wl(x,x.return);break;case 30:break;default:ti(g,x,o)}a=a.sibling}}function Cd(r,a){var o=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==o&&(r!=null&&r.refCount++,o!=null&&Bl(o))}function Ad(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Bl(r))}function nr(r,a,o,f){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)R0(r,a,o,f),a=a.sibling}function R0(r,a,o,f){var g=a.flags;switch(a.tag){case 0:case 11:case 15:nr(r,a,o,f),g&2048&&Jl(9,a);break;case 1:nr(r,a,o,f);break;case 3:nr(r,a,o,f),g&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Bl(r)));break;case 12:if(g&2048){nr(r,a,o,f),r=a.stateNode;try{var x=a.memoizedProps,T=x.id,D=x.onPostCommit;typeof D=="function"&&D(T,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(V){it(a,a.return,V)}}else nr(r,a,o,f);break;case 13:nr(r,a,o,f);break;case 23:break;case 22:x=a.stateNode,T=a.alternate,a.memoizedState!==null?x._visibility&2?nr(r,a,o,f):es(r,a):x._visibility&2?nr(r,a,o,f):(x._visibility|=2,Oa(r,a,o,f,(a.subtreeFlags&10256)!==0)),g&2048&&Cd(T,a);break;case 24:nr(r,a,o,f),g&2048&&Ad(a.alternate,a);break;default:nr(r,a,o,f)}}function Oa(r,a,o,f,g){for(g=g&&(a.subtreeFlags&10256)!==0,a=a.child;a!==null;){var x=r,T=a,D=o,V=f,ne=T.flags;switch(T.tag){case 0:case 11:case 15:Oa(x,T,D,V,g),Jl(8,T);break;case 23:break;case 22:var se=T.stateNode;T.memoizedState!==null?se._visibility&2?Oa(x,T,D,V,g):es(x,T):(se._visibility|=2,Oa(x,T,D,V,g)),g&&ne&2048&&Cd(T.alternate,T);break;case 24:Oa(x,T,D,V,g),g&&ne&2048&&Ad(T.alternate,T);break;default:Oa(x,T,D,V,g)}a=a.sibling}}function es(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var o=r,f=a,g=f.flags;switch(f.tag){case 22:es(o,f),g&2048&&Cd(f.alternate,f);break;case 24:es(o,f),g&2048&&Ad(f.alternate,f);break;default:es(o,f)}a=a.sibling}}var ts=8192;function Ra(r){if(r.subtreeFlags&ts)for(r=r.child;r!==null;)z0(r),r=r.sibling}function z0(r){switch(r.tag){case 26:Ra(r),r.flags&ts&&r.memoizedState!==null&&mT(Dn,r.memoizedState,r.memoizedProps);break;case 5:Ra(r);break;case 3:case 4:var a=Dn;Dn=Mo(r.stateNode.containerInfo),Ra(r),Dn=a;break;case 22:r.memoizedState===null&&(a=r.alternate,a!==null&&a.memoizedState!==null?(a=ts,ts=16777216,Ra(r),ts=a):Ra(r));break;default:Ra(r)}}function D0(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 ns(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var f=a[o];Rt=f,L0(f,r)}D0(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)j0(r),r=r.sibling}function j0(r){switch(r.tag){case 0:case 11:case 15:ns(r),r.flags&2048&&Wr(9,r,r.return);break;case 3:ns(r);break;case 12:ns(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,vo(r)):ns(r);break;default:ns(r)}}function vo(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var f=a[o];Rt=f,L0(f,r)}D0(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:Wr(8,a,a.return),vo(a);break;case 22:o=a.stateNode,o._visibility&2&&(o._visibility&=-3,vo(a));break;default:vo(a)}r=r.sibling}}function L0(r,a){for(;Rt!==null;){var o=Rt;switch(o.tag){case 0:case 11:case 15:Wr(8,o,a);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var f=o.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Bl(o.memoizedState.cache)}if(f=o.child,f!==null)f.return=o,Rt=f;else e:for(o=r;Rt!==null;){f=Rt;var g=f.sibling,x=f.return;if(C0(f),f===o){Rt=null;break e}if(g!==null){g.return=x,Rt=g;break e}Rt=x}}}var Mk={getCacheForType:function(r){var a=Ht(At),o=a.data.get(r);return o===void 0&&(o=r(),a.data.set(r,o)),o}},Ok=typeof WeakMap=="function"?WeakMap:Map,Je=0,st=null,Pe=null,$e=0,We=0,dn=null,ni=!1,za=!1,Nd=!1,Ar=0,pt=0,ri=0,$i=0,Md=0,Tn=0,Da=0,rs=null,nn=null,Od=!1,Rd=0,xo=1/0,bo=null,ii=null,jt=0,ai=null,ja=null,La=0,zd=0,Dd=null,I0=null,is=0,jd=null;function hn(){if((Je&2)!==0&&$e!==0)return $e&-$e;if(L.T!==null){var r=Sa;return r!==0?r:qd()}return ku()}function B0(){Tn===0&&(Tn=($e&536870912)===0||Qe?wu():536870912);var r=kn.current;return r!==null&&(r.flags|=32),Tn}function mn(r,a,o){(r===st&&(We===2||We===9)||r.cancelPendingCommit!==null)&&(Ia(r,0),li(r,$e,Tn,!1)),Ai(r,o),((Je&2)===0||r!==st)&&(r===st&&((Je&2)===0&&($i|=o),pt===4&&li(r,$e,Tn,!1)),rr(r))}function H0(r,a,o){if((Je&6)!==0)throw Error(i(327));var f=!o&&(a&124)===0&&(a&r.expiredLanes)===0||Qt(r,a),g=f?Dk(r,a):Bd(r,a,!0),x=f;do{if(g===0){za&&!f&&li(r,a,0,!1);break}else{if(o=r.current.alternate,x&&!Rk(o)){g=Bd(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 D=r;g=rs;var V=D.current.memoizedState.isDehydrated;if(V&&(Ia(D,T).flags|=256),T=Bd(D,T,!1),T!==2){if(Nd&&!V){D.errorRecoveryDisabledLanes|=x,$i|=x,g=4;break e}x=nn,nn=g,x!==null&&(nn===null?nn=x:nn.push.apply(nn,x))}g=T}if(x=!1,g!==2)continue}}if(g===1){Ia(r,0),li(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:li(f,a,Tn,!ni);break e;case 2:nn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(g=Rd+300-bt(),10<g)){if(li(f,a,Tn,!ni),_t(f,0,!0)!==0)break e;f.timeoutHandle=mv(U0.bind(null,f,o,nn,bo,Od,a,Tn,$i,Da,ni,x,2,-0,0),g);break e}U0(f,o,nn,bo,Od,a,Tn,$i,Da,ni,x,0,-0,0)}}break}while(!0);rr(r)}function U0(r,a,o,f,g,x,T,D,V,ne,se,fe,re,ae){if(r.timeoutHandle=-1,fe=a.subtreeFlags,(fe&8192||(fe&16785408)===16785408)&&(fs={stylesheets:null,count:0,unsuspend:hT},z0(a),fe=pT(),fe!==null)){r.cancelPendingCommit=fe(F0.bind(null,r,a,x,o,f,g,T,D,V,se,1,re,ae)),li(r,x,T,!ne);return}F0(r,a,x,o,f,g,T,D,V)}function Rk(r){for(var a=r;;){var o=a.tag;if((o===0||o===11||o===15)&&a.flags&16384&&(o=a.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var f=0;f<o.length;f++){var g=o[f],x=g.getSnapshot;g=g.value;try{if(!un(x(),g))return!1}catch{return!1}}if(o=a.child,a.subtreeFlags&16384&&o!==null)o.return=a,a=o;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 li(r,a,o,f){a&=~Md,a&=~$i,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}o!==0&&gl(r,o,a)}function _o(){return(Je&6)===0?(as(0),!1):!0}function Ld(){if(Pe!==null){if(We===0)var r=Pe.return;else r=Pe,br=Bi=null,Wf(r),Na=null,Xl=0,r=Pe;for(;r!==null;)x0(r.alternate,r),r=r.return;Pe=null}}function Ia(r,a){var o=r.timeoutHandle;o!==-1&&(r.timeoutHandle=-1,Qk(o)),o=r.cancelPendingCommit,o!==null&&(r.cancelPendingCommit=null,o()),Ld(),st=r,Pe=o=yr(r.current,null),$e=a,We=0,dn=null,ni=!1,za=Qt(r,a),Nd=!1,Da=Tn=Md=$i=ri=pt=0,nn=rs=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 Ar=a,qu(),o}function P0(r,a){He=null,L.H=so,a===Ul||a===Ku?(a=iy(),We=3):a===ty?(a=iy(),We=4):We=a===a0?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,dn=a,Pe===null&&(pt=1,ho(r,_n(a,r.current)))}function q0(){var r=L.H;return L.H=so,r===null?so:r}function V0(){var r=L.A;return L.A=Mk,r}function Id(){pt=4,ni||($e&4194048)!==$e&&kn.current!==null||(za=!0),(ri&134217727)===0&&($i&134217727)===0||st===null||li(st,$e,Tn,!1)}function Bd(r,a,o){var f=Je;Je|=2;var g=q0(),x=V0();(st!==r||$e!==a)&&(bo=null,Ia(r,a)),a=!1;var T=pt;e:do try{if(We!==0&&Pe!==null){var D=Pe,V=dn;switch(We){case 8:Ld(),T=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(a=!0);var ne=We;if(We=0,dn=null,Ba(r,D,V,ne),o&&za){T=0;break e}break;default:ne=We,We=0,dn=null,Ba(r,D,V,ne)}}zk(),T=pt;break}catch(se){P0(r,se)}while(!0);return a&&r.shellSuspendCounter++,br=Bi=null,Je=f,L.H=g,L.A=x,Pe===null&&(st=null,$e=0,qu()),T}function zk(){for(;Pe!==null;)$0(Pe)}function Dk(r,a){var o=Je;Je|=2;var f=q0(),g=V0();st!==r||$e!==a?(bo=null,xo=bt()+500,Ia(r,a)):za=Qt(r,a);e:do try{if(We!==0&&Pe!==null){a=Pe;var x=dn;t:switch(We){case 1:We=0,dn=null,Ba(r,a,x,1);break;case 2:case 9:if(ny(x)){We=0,dn=null,Z0(a);break}a=function(){We!==2&&We!==9||st!==r||(We=7),rr(r)},x.then(a,a);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:ny(x)?(We=0,dn=null,Z0(a)):(We=0,dn=null,Ba(r,a,x,7));break;case 5:var T=null;switch(Pe.tag){case 26:T=Pe.memoizedState;case 5:case 27:var D=Pe;if(!T||Tv(T)){We=0,dn=null;var V=D.sibling;if(V!==null)Pe=V;else{var ne=D.return;ne!==null?(Pe=ne,wo(ne)):Pe=null}break t}}We=0,dn=null,Ba(r,a,x,5);break;case 6:We=0,dn=null,Ba(r,a,x,6);break;case 8:Ld(),pt=6;break e;default:throw Error(i(462))}}jk();break}catch(se){P0(r,se)}while(!0);return br=Bi=null,L.H=f,L.A=g,Je=o,Pe!==null?0:(st=null,$e=0,qu(),pt)}function jk(){for(;Pe!==null&&!lt();)$0(Pe)}function $0(r){var a=y0(r.alternate,r,Ar);r.memoizedProps=r.pendingProps,a===null?wo(r):Pe=a}function Z0(r){var a=r,o=a.alternate;switch(a.tag){case 15:case 0:a=f0(o,a,a.pendingProps,a.type,void 0,$e);break;case 11:a=f0(o,a,a.pendingProps,a.type.render,a.ref,$e);break;case 5:Wf(a);default:x0(o,a),a=Pe=Yg(a,Ar),a=y0(o,a,Ar)}r.memoizedProps=r.pendingProps,a===null?wo(r):Pe=a}function Ba(r,a,o,f){br=Bi=null,Wf(a),Na=null,Xl=0;var g=a.return;try{if(Ek(r,g,a,o,$e)){pt=1,ho(r,_n(o,r.current)),Pe=null;return}}catch(x){if(g!==null)throw Pe=g,x;pt=1,ho(r,_n(o,r.current)),Pe=null;return}a.flags&32768?(Qe||f===1?r=!0:za||($e&536870912)!==0?r=!1:(ni=r=!0,(f===2||f===9||f===3||f===6)&&(f=kn.current,f!==null&&f.tag===13&&(f.flags|=16384))),Y0(a,r)):wo(a)}function wo(r){var a=r;do{if((a.flags&32768)!==0){Y0(a,ni);return}r=a.return;var o=Tk(a.alternate,a,Ar);if(o!==null){Pe=o;return}if(a=a.sibling,a!==null){Pe=a;return}Pe=a=r}while(a!==null);pt===0&&(pt=5)}function Y0(r,a){do{var o=Ck(r.alternate,r);if(o!==null){o.flags&=32767,Pe=o;return}if(o=r.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!a&&(r=r.sibling,r!==null)){Pe=r;return}Pe=r=o}while(r!==null);pt=6,Pe=null}function F0(r,a,o,f,g,x,T,D,V){r.cancelPendingCommit=null;do So();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|=Af,tf(r,o,x,T,D,V),r===st&&(Pe=st=null,$e=0),ja=a,ai=r,La=o,zd=x,Dd=g,I0=f,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,Hk(Xn,function(){return J0(),null})):(r.callbackNode=null,r.callbackPriority=0),f=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||f){f=L.T,L.T=null,g=q.p,q.p=2,T=Je,Je|=4;try{Ak(r,a,o)}finally{Je=T,q.p=g,L.T=f}}jt=1,G0(),X0(),Q0()}}function G0(){if(jt===1){jt=0;var r=ai,a=ja,o=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||o){o=L.T,L.T=null;var f=q.p;q.p=2;var g=Je;Je|=4;try{M0(a,r);var x=Qd,T=Lg(r.containerInfo),D=x.focusedElem,V=x.selectionRange;if(T!==D&&D&&D.ownerDocument&&jg(D.ownerDocument.documentElement,D)){if(V!==null&&Sf(D)){var ne=V.start,se=V.end;if(se===void 0&&(se=ne),"selectionStart"in D)D.selectionStart=ne,D.selectionEnd=Math.min(se,D.value.length);else{var fe=D.ownerDocument||document,re=fe&&fe.defaultView||window;if(re.getSelection){var ae=re.getSelection(),Oe=D.textContent.length,Ne=Math.min(V.start,Oe),rt=V.end===void 0?Ne:Math.min(V.end,Oe);!ae.extend&&Ne>rt&&(T=rt,rt=Ne,Ne=T);var J=Dg(D,Ne),G=Dg(D,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=D;ae=ae.parentNode;)ae.nodeType===1&&fe.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<fe.length;D++){var oe=fe[D];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}jo=!!Xd,Qd=Xd=null}finally{Je=g,q.p=f,L.T=o}}r.current=a,jt=2}}function X0(){if(jt===2){jt=0;var r=ai,a=ja,o=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||o){o=L.T,L.T=null;var f=q.p;q.p=2;var g=Je;Je|=4;try{T0(r,a.alternate,a)}finally{Je=g,q.p=f,L.T=o}}jt=3}}function Q0(){if(jt===4||jt===3){jt=0,ot();var r=ai,a=ja,o=La,f=I0;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?jt=5:(jt=0,ja=ai=null,K0(r,r.pendingLanes));var g=r.pendingLanes;if(g===0&&(ii=null),vl(o),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=L.T,g=q.p,q.p=2,L.T=null;try{for(var x=r.onRecoverableError,T=0;T<f.length;T++){var D=f[T];x(D.value,{componentStack:D.stack})}}finally{L.T=a,q.p=g}}(La&3)!==0&&So(),rr(r),g=r.pendingLanes,(o&4194090)!==0&&(g&42)!==0?r===jd?is++:(is=0,jd=r):is=0,as(0)}}function K0(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,Bl(a)))}function So(r){return G0(),X0(),Q0(),J0()}function J0(){if(jt!==5)return!1;var r=ai,a=zd;zd=0;var o=vl(La),f=L.T,g=q.p;try{q.p=32>o?32:o,L.T=null,o=Dd,Dd=null;var x=ai,T=La;if(jt=0,ja=ai=null,La=0,(Je&6)!==0)throw Error(i(331));var D=Je;if(Je|=4,j0(x.current),R0(x,x.current,T,o),Je=D,as(0,!1),de&&typeof de.onPostCommitFiberRoot=="function")try{de.onPostCommitFiberRoot(le,x)}catch{}return!0}finally{q.p=g,L.T=f,K0(r,a)}}function W0(r,a,o){a=_n(o,a),a=hd(r.stateNode,a,2),r=Xr(r,a,2),r!==null&&(Ai(r,2),rr(r))}function it(r,a,o){if(r.tag===3)W0(r,r,o);else for(;a!==null;){if(a.tag===3){W0(a,r,o);break}else if(a.tag===1){var f=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(ii===null||!ii.has(f))){r=_n(o,r),o=r0(2),f=Xr(a,o,2),f!==null&&(i0(o,f,a,r),Ai(f,2),rr(f));break}}a=a.return}}function Hd(r,a,o){var f=r.pingCache;if(f===null){f=r.pingCache=new Ok;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(o)||(Nd=!0,g.add(o),r=Lk.bind(null,r,a,o),a.then(r,r))}function Lk(r,a,o){var f=r.pingCache;f!==null&&f.delete(a),r.pingedLanes|=r.suspendedLanes&o,r.warmLanes&=~o,st===r&&($e&o)===o&&(pt===4||pt===3&&($e&62914560)===$e&&300>bt()-Rd?(Je&2)===0&&Ia(r,0):Md|=o,Da===$e&&(Da=0)),rr(r)}function ev(r,a){a===0&&(a=Su()),r=xa(r,a),r!==null&&(Ai(r,a),rr(r))}function Ik(r){var a=r.memoizedState,o=0;a!==null&&(o=a.retryLane),ev(r,o)}function Bk(r,a){var o=0;switch(r.tag){case 13:var f=r.stateNode,g=r.memoizedState;g!==null&&(o=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),ev(r,o)}function Hk(r,a){return ze(r,a)}var Eo=null,Ha=null,Ud=!1,ko=!1,Pd=!1,Zi=0;function rr(r){r!==Ha&&r.next===null&&(Ha===null?Eo=Ha=r:Ha=Ha.next=r),ko=!0,Ud||(Ud=!0,Pk())}function as(r,a){if(!Pd&&ko){Pd=!0;do for(var o=!1,f=Eo;f!==null;){if(r!==0){var g=f.pendingLanes;if(g===0)var x=0;else{var T=f.suspendedLanes,D=f.pingedLanes;x=(1<<31-Te(42|r)+1)-1,x&=g&~(T&~D),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(o=!0,iv(f,x))}else x=$e,x=_t(f,f===st?x:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(x&3)===0||Qt(f,x)||(o=!0,iv(f,x));f=f.next}while(o);Pd=!1}}function Uk(){tv()}function tv(){ko=Ud=!1;var r=0;Zi!==0&&(Xk()&&(r=Zi),Zi=0);for(var a=bt(),o=null,f=Eo;f!==null;){var g=f.next,x=nv(f,a);x===0?(f.next=null,o===null?Eo=g:o.next=g,g===null&&(Ha=o)):(o=f,(r!==0||(x&3)!==0)&&(ko=!0)),f=g}as(r)}function nv(r,a){for(var o=r.suspendedLanes,f=r.pingedLanes,g=r.expirationTimes,x=r.pendingLanes&-62914561;0<x;){var T=31-Te(x),D=1<<T,V=g[T];V===-1?((D&o)===0||(D&f)!==0)&&(g[T]=sn(D,a)):V<=a&&(r.expiredLanes|=D),x&=~D}if(a=st,o=$e,o=_t(r,r===a?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f=r.callbackNode,o===0||r===a&&(We===2||We===9)||r.cancelPendingCommit!==null)return f!==null&&f!==null&&De(f),r.callbackNode=null,r.callbackPriority=0;if((o&3)===0||Qt(r,o)){if(a=o&-o,a===r.callbackPriority)return a;switch(f!==null&&De(f),vl(o)){case 2:case 8:o=Mn;break;case 32:o=Xn;break;case 268435456:o=Qn;break;default:o=Xn}return f=rv.bind(null,r),o=ze(o,f),r.callbackPriority=a,r.callbackNode=o,a}return f!==null&&f!==null&&De(f),r.callbackPriority=2,r.callbackNode=null,2}function rv(r,a){if(jt!==0&&jt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var o=r.callbackNode;if(So()&&r.callbackNode!==o)return null;var f=$e;return f=_t(r,r===st?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f===0?null:(H0(r,f,a),nv(r,bt()),r.callbackNode!=null&&r.callbackNode===o?rv.bind(null,r):null)}function iv(r,a){if(So())return null;H0(r,a,!0)}function Pk(){Kk(function(){(Je&6)!==0?ze(fr,Uk):tv()})}function qd(){return Zi===0&&(Zi=wu()),Zi}function av(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:ju(""+r)}function lv(r,a){var o=a.ownerDocument.createElement("input");return o.name=a.name,o.value=a.value,r.id&&o.setAttribute("form",r.id),a.parentNode.insertBefore(o,a),r=new FormData(r),o.parentNode.removeChild(o),r}function qk(r,a,o,f,g){if(a==="submit"&&o&&o.stateNode===g){var x=av((g[Bt]||null).action),T=f.submitter;T&&(a=(a=T[Bt]||null)?av(a.formAction):T.getAttribute("formAction"),a!==null&&(x=a,T=null));var D=new Hu("action","action",null,f,g);r.push({event:D,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Zi!==0){var V=T?lv(g,T):new FormData(g);ud(o,{pending:!0,data:V,method:g.method,action:x},null,V)}}else typeof x=="function"&&(D.preventDefault(),V=T?lv(g,T):new FormData(g),ud(o,{pending:!0,data:V,method:g.method,action:x},x,V))},currentTarget:g}]})}}for(var Vd=0;Vd<Cf.length;Vd++){var $d=Cf[Vd],Vk=$d.toLowerCase(),$k=$d[0].toUpperCase()+$d.slice(1);zn(Vk,"on"+$k)}zn(Hg,"onAnimationEnd"),zn(Ug,"onAnimationIteration"),zn(Pg,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(sk,"onTransitionRun"),zn(uk,"onTransitionStart"),zn(ok,"onTransitionCancel"),zn(qg,"onTransitionEnd"),qr("onMouseEnter",["mouseout","mouseover"]),qr("onMouseLeave",["mouseout","mouseover"]),qr("onPointerEnter",["pointerout","pointerover"]),qr("onPointerLeave",["pointerout","pointerover"]),pr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pr("onBeforeInput",["compositionend","keypress","textInput","paste"]),pr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ls="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(" "),Zk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ls));function sv(r,a){a=(a&4)!==0;for(var o=0;o<r.length;o++){var f=r[o],g=f.event;f=f.listeners;e:{var x=void 0;if(a)for(var T=f.length-1;0<=T;T--){var D=f[T],V=D.instance,ne=D.currentTarget;if(D=D.listener,V!==x&&g.isPropagationStopped())break e;x=D,g.currentTarget=ne;try{x(g)}catch(se){fo(se)}g.currentTarget=null,x=V}else for(T=0;T<f.length;T++){if(D=f[T],V=D.instance,ne=D.currentTarget,D=D.listener,V!==x&&g.isPropagationStopped())break e;x=D,g.currentTarget=ne;try{x(g)}catch(se){fo(se)}g.currentTarget=null,x=V}}}}function qe(r,a){var o=a[xl];o===void 0&&(o=a[xl]=new Set);var f=r+"__bubble";o.has(f)||(uv(a,r,2,!1),o.add(f))}function Zd(r,a,o){var f=0;a&&(f|=4),uv(o,r,f,a)}var To="_reactListening"+Math.random().toString(36).slice(2);function Yd(r){if(!r[To]){r[To]=!0,Cu.forEach(function(o){o!=="selectionchange"&&(Zk.has(o)||Zd(o,!1,r),Zd(o,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[To]||(a[To]=!0,Zd("selectionchange",!1,a))}}function uv(r,a,o,f){switch(Rv(a)){case 2:var g=vT;break;case 8:g=xT;break;default:g=lh}o=g.bind(null,a,o,r),g=void 0,!mf||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(g=!0),f?g!==void 0?r.addEventListener(a,o,{capture:!0,passive:g}):r.addEventListener(a,o,!0):g!==void 0?r.addEventListener(a,o,{passive:g}):r.addEventListener(a,o,!1)}function Fd(r,a,o,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 D=f.stateNode.containerInfo;if(D===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(;D!==null;){if(T=hr(D),T===null)return;if(V=T.tag,V===5||V===6||V===26||V===27){f=x=T;continue e}D=D.parentNode}}f=f.return}pg(function(){var ne=x,se=df(o),fe=[];e:{var re=Vg.get(r);if(re!==void 0){var ae=Hu,Oe=r;switch(r){case"keypress":if(Iu(o)===0)break e;case"keydown":case"keyup":ae=HE;break;case"focusin":Oe="focus",ae=vf;break;case"focusout":Oe="blur",ae=vf;break;case"beforeblur":case"afterblur":ae=vf;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=vg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=CE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=qE;break;case Hg:case Ug:case Pg:ae=ME;break;case qg:ae=$E;break;case"scroll":case"scrollend":ae=kE;break;case"wheel":ae=YE;break;case"copy":case"cut":case"paste":ae=RE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=bg;break;case"toggle":case"beforetoggle":ae=GE}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=kl(G,J),oe!=null&&Ne.push(ss(G,oe,ee))),rt)break;G=G.return}0<Ne.length&&(re=new ae(re,Oe,null,o,se),fe.push({event:re,listeners:Ne}))}}if((a&7)===0){e:{if(re=r==="mouseover"||r==="pointerover",ae=r==="mouseout"||r==="pointerout",re&&o!==ff&&(Oe=o.relatedTarget||o.fromElement)&&(hr(Oe)||Oe[Hr]))break e;if((ae||re)&&(re=se.window===se?se:(re=se.ownerDocument)?re.defaultView||re.parentWindow:window,ae?(Oe=o.relatedTarget||o.toElement,ae=ne,Oe=Oe?hr(Oe):null,Oe!==null&&(rt=s(Oe),Ne=Oe.tag,Oe!==rt||Ne!==5&&Ne!==27&&Ne!==6)&&(Oe=null)):(ae=null,Oe=ne),ae!==Oe)){if(Ne=vg,oe="onMouseLeave",J="onMouseEnter",G="mouse",(r==="pointerout"||r==="pointerover")&&(Ne=bg,oe="onPointerLeave",J="onPointerEnter",G="pointer"),rt=ae==null?re:Ur(ae),ee=Oe==null?re:Ur(Oe),re=new Ne(oe,G+"leave",ae,o,se),re.target=rt,re.relatedTarget=ee,oe=null,hr(se)===ne&&(Ne=new Ne(J,G+"enter",Oe,o,se),Ne.target=ee,Ne.relatedTarget=rt,oe=Ne),rt=oe,ae&&Oe)t:{for(Ne=ae,J=Oe,G=0,ee=Ne;ee;ee=Ua(ee))G++;for(ee=0,oe=J;oe;oe=Ua(oe))ee++;for(;0<G-ee;)Ne=Ua(Ne),G--;for(;0<ee-G;)J=Ua(J),ee--;for(;G--;){if(Ne===J||J!==null&&Ne===J.alternate)break t;Ne=Ua(Ne),J=Ua(J)}Ne=null}else Ne=null;ae!==null&&ov(fe,re,ae,Ne,!1),Oe!==null&&rt!==null&&ov(fe,rt,Oe,Ne,!0)}}e:{if(re=ne?Ur(ne):window,ae=re.nodeName&&re.nodeName.toLowerCase(),ae==="select"||ae==="input"&&re.type==="file")var be=Ag;else if(Tg(re))if(Ng)be=ik;else{be=nk;var Ue=tk}else ae=re.nodeName,!ae||ae.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ne&&cf(ne.elementType)&&(be=Ag):be=rk;if(be&&(be=be(r,ne))){Cg(fe,be,o,se);break e}Ue&&Ue(r,re,ne),r==="focusout"&&ne&&re.type==="number"&&ne.memoizedProps.value!=null&&of(re,"number",re.value)}switch(Ue=ne?Ur(ne):window,r){case"focusin":(Tg(Ue)||Ue.contentEditable==="true")&&(ga=Ue,Ef=ne,zl=null);break;case"focusout":zl=Ef=ga=null;break;case"mousedown":kf=!0;break;case"contextmenu":case"mouseup":case"dragend":kf=!1,Ig(fe,o,se);break;case"selectionchange":if(lk)break;case"keydown":case"keyup":Ig(fe,o,se)}var Se;if(bf)e:{switch(r){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else pa?Eg(r,o)&&(Me="onCompositionEnd"):r==="keydown"&&o.keyCode===229&&(Me="onCompositionStart");Me&&(_g&&o.locale!=="ko"&&(pa||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&pa&&(Se=gg()):(Zr=se,pf="value"in Zr?Zr.value:Zr.textContent,pa=!0)),Ue=Co(ne,Me),0<Ue.length&&(Me=new xg(Me,r,null,o,se),fe.push({event:Me,listeners:Ue}),Se?Me.data=Se:(Se=kg(o),Se!==null&&(Me.data=Se)))),(Se=QE?KE(r,o):JE(r,o))&&(Me=Co(ne,"onBeforeInput"),0<Me.length&&(Ue=new xg("onBeforeInput","beforeinput",null,o,se),fe.push({event:Ue,listeners:Me}),Ue.data=Se)),qk(fe,r,ne,o,se)}sv(fe,a)})}function ss(r,a,o){return{instance:r,listener:a,currentTarget:o}}function Co(r,a){for(var o=a+"Capture",f=[];r!==null;){var g=r,x=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||x===null||(g=kl(r,o),g!=null&&f.unshift(ss(r,g,x)),g=kl(r,a),g!=null&&f.push(ss(r,g,x))),r.tag===3)return f;r=r.return}return[]}function Ua(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function ov(r,a,o,f,g){for(var x=a._reactName,T=[];o!==null&&o!==f;){var D=o,V=D.alternate,ne=D.stateNode;if(D=D.tag,V!==null&&V===f)break;D!==5&&D!==26&&D!==27||ne===null||(V=ne,g?(ne=kl(o,x),ne!=null&&T.unshift(ss(o,ne,V))):g||(ne=kl(o,x),ne!=null&&T.push(ss(o,ne,V)))),o=o.return}T.length!==0&&r.push({event:a,listeners:T})}var Yk=/\r\n?/g,Fk=/\u0000|\uFFFD/g;function cv(r){return(typeof r=="string"?r:""+r).replace(Yk,`
49
+ `).replace(Fk,"")}function fv(r,a){return a=cv(a),cv(r)===a}function Ao(){}function nt(r,a,o,f,g,x){switch(o){case"children":typeof f=="string"?a==="body"||a==="textarea"&&f===""||da(r,f):(typeof f=="number"||typeof f=="bigint")&&a!=="body"&&da(r,""+f);break;case"className":sa(r,"class",f);break;case"tabIndex":sa(r,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":sa(r,o,f);break;case"style":hg(r,f,x);break;case"data":if(a!=="object"){sa(r,"data",f);break}case"src":case"href":if(f===""&&(a!=="a"||o!=="href")){r.removeAttribute(o);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(o);break}f=ju(""+f),r.setAttribute(o,f);break;case"action":case"formAction":if(typeof f=="function"){r.setAttribute(o,"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"&&(o==="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(o);break}f=ju(""+f),r.setAttribute(o,f);break;case"onClick":f!=null&&(r.onclick=Ao);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(o=f.__html,o!=null){if(g.children!=null)throw Error(i(60));r.innerHTML=o}}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}o=ju(""+f),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);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(o,""+f):r.removeAttribute(o);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(o,""):r.removeAttribute(o);break;case"capture":case"download":f===!0?r.setAttribute(o,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(o,f):r.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?r.setAttribute(o,f):r.removeAttribute(o);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?r.removeAttribute(o):r.setAttribute(o,f);break;case"popover":qe("beforetoggle",r),qe("toggle",r),la(r,"popover",f);break;case"xlinkActuate":Rn(r,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Rn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Rn(r,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Rn(r,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Rn(r,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Rn(r,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Rn(r,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Rn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Rn(r,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":la(r,"is",f);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=SE.get(o)||o,la(r,o,f))}}function Gd(r,a,o,f,g,x){switch(o){case"style":hg(r,f,x);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(i(61));if(o=f.__html,o!=null){if(g.children!=null)throw Error(i(60));r.innerHTML=o}}break;case"children":typeof f=="string"?da(r,f):(typeof f=="number"||typeof f=="bigint")&&da(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=Ao);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Au.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(g=o.endsWith("Capture"),a=o.slice(2,g?o.length-7:void 0),x=r[Bt]||null,x=x!=null?x[o]:null,typeof x=="function"&&r.removeEventListener(a,x,g),typeof f=="function")){typeof x!="function"&&x!==null&&(o in r?r[o]=null:r.hasAttribute(o)&&r.removeAttribute(o)),r.addEventListener(a,f,g);break e}o in r?r[o]=f:f===!0?r.setAttribute(o,""):la(r,o,f)}}}function Lt(r,a,o){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 o)if(o.hasOwnProperty(x)){var T=o[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,o,null)}}g&&nt(r,a,"srcSet",o.srcSet,o,null),f&&nt(r,a,"src",o.src,o,null);return;case"input":qe("invalid",r);var D=x=T=g=null,V=null,ne=null;for(f in o)if(o.hasOwnProperty(f)){var se=o[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":D=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,a));break;default:nt(r,a,f,se,o,null)}}og(r,x,D,V,ne,T,g,!1),oa(r);return;case"select":qe("invalid",r),f=T=x=null;for(g in o)if(o.hasOwnProperty(g)&&(D=o[g],D!=null))switch(g){case"value":x=D;break;case"defaultValue":T=D;break;case"multiple":f=D;default:nt(r,a,g,D,o,null)}a=x,o=T,r.multiple=!!f,a!=null?fa(r,!!f,a,!1):o!=null&&fa(r,!!f,o,!0);return;case"textarea":qe("invalid",r),x=g=f=null;for(T in o)if(o.hasOwnProperty(T)&&(D=o[T],D!=null))switch(T){case"value":f=D;break;case"defaultValue":g=D;break;case"children":x=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(i(91));break;default:nt(r,a,T,D,o,null)}fg(r,f,g,x),oa(r);return;case"option":for(V in o)if(o.hasOwnProperty(V)&&(f=o[V],f!=null))switch(V){case"selected":r.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:nt(r,a,V,f,o,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<ls.length;f++)qe(ls[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 o)if(o.hasOwnProperty(ne)&&(f=o[ne],f!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:nt(r,a,ne,f,o,null)}return;default:if(cf(a)){for(se in o)o.hasOwnProperty(se)&&(f=o[se],f!==void 0&&Gd(r,a,se,f,o,void 0));return}}for(D in o)o.hasOwnProperty(D)&&(f=o[D],f!=null&&nt(r,a,D,f,o,null))}function Gk(r,a,o,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,D=null,V=null,ne=null,se=null;for(ae in o){var fe=o[ae];if(o.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=o[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":D=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)}}ca(r,T,D,V,ne,se,x,g);return;case"select":ae=T=D=re=null;for(x in o)if(V=o[x],o.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=o[g],f.hasOwnProperty(g)&&(x!=null||V!=null))switch(g){case"value":re=x;break;case"defaultValue":D=x;break;case"multiple":T=x;default:x!==V&&nt(r,a,g,x,f,V)}a=D,o=T,f=ae,re!=null?fa(r,!!o,re,!1):!!f!=!!o&&(a!=null?fa(r,!!o,a,!0):fa(r,!!o,o?[]:"",!1));return;case"textarea":ae=re=null;for(D in o)if(g=o[D],o.hasOwnProperty(D)&&g!=null&&!f.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:nt(r,a,D,null,f,g)}for(T in f)if(g=f[T],x=o[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)}cg(r,re,ae);return;case"option":for(var Oe in o)if(re=o[Oe],o.hasOwnProperty(Oe)&&re!=null&&!f.hasOwnProperty(Oe))switch(Oe){case"selected":r.selected=!1;break;default:nt(r,a,Oe,null,f,re)}for(V in f)if(re=f[V],ae=o[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 o)re=o[Ne],o.hasOwnProperty(Ne)&&re!=null&&!f.hasOwnProperty(Ne)&&nt(r,a,Ne,null,f,re);for(ne in f)if(re=f[ne],ae=o[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(cf(a)){for(var rt in o)re=o[rt],o.hasOwnProperty(rt)&&re!==void 0&&!f.hasOwnProperty(rt)&&Gd(r,a,rt,void 0,f,re);for(se in f)re=f[se],ae=o[se],!f.hasOwnProperty(se)||re===ae||re===void 0&&ae===void 0||Gd(r,a,se,re,f,ae);return}}for(var J in o)re=o[J],o.hasOwnProperty(J)&&re!=null&&!f.hasOwnProperty(J)&&nt(r,a,J,null,f,re);for(fe in f)re=f[fe],ae=o[fe],!f.hasOwnProperty(fe)||re===ae||re==null&&ae==null||nt(r,a,fe,re,f,ae)}var Xd=null,Qd=null;function No(r){return r.nodeType===9?r:r.ownerDocument}function dv(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 hv(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 Kd(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 Jd=null;function Xk(){var r=window.event;return r&&r.type==="popstate"?r===Jd?!1:(Jd=r,!0):(Jd=null,!1)}var mv=typeof setTimeout=="function"?setTimeout:void 0,Qk=typeof clearTimeout=="function"?clearTimeout:void 0,pv=typeof Promise=="function"?Promise:void 0,Kk=typeof queueMicrotask=="function"?queueMicrotask:typeof pv<"u"?function(r){return pv.resolve(null).then(r).catch(Jk)}:mv;function Jk(r){setTimeout(function(){throw r})}function si(r){return r==="head"}function gv(r,a){var o=a,f=0,g=0;do{var x=o.nextSibling;if(r.removeChild(o),x&&x.nodeType===8)if(o=x.data,o==="/$"){if(0<f&&8>f){o=f;var T=r.ownerDocument;if(o&1&&us(T.documentElement),o&2&&us(T.body),o&4)for(o=T.head,us(o),T=o.firstChild;T;){var D=T.nextSibling,V=T.nodeName;T[Ni]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&T.rel.toLowerCase()==="stylesheet"||o.removeChild(T),T=D}}if(g===0){r.removeChild(x),gs(a);return}g--}else o==="$"||o==="$?"||o==="$!"?g++:f=o.charCodeAt(0)-48;else f=0;o=x}while(o);gs(a)}function Wd(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var o=a;switch(a=a.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Wd(o),bl(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}r.removeChild(o)}}function Wk(r,a,o,f){for(;r.nodeType===1;){var g=o;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!f&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(f){if(!r[Ni])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=jn(r.nextSibling),r===null)break}return null}function eT(r,a,o){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=jn(r.nextSibling),r===null))return null;return r}function eh(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState==="complete"}function tT(r,a){var o=r.ownerDocument;if(r.data!=="$?"||o.readyState==="complete")a();else{var f=function(){a(),o.removeEventListener("DOMContentLoaded",f)};o.addEventListener("DOMContentLoaded",f),r._reactRetry=f}}function jn(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 th=null;function yv(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var o=r.data;if(o==="$"||o==="$!"||o==="$?"){if(a===0)return r;a--}else o==="/$"&&a++}r=r.previousSibling}return null}function vv(r,a,o){switch(a=No(o),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 us(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);bl(r)}var Cn=new Map,xv=new Set;function Mo(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Nr=q.d;q.d={f:nT,r:rT,D:iT,C:aT,L:lT,m:sT,X:oT,S:uT,M:cT};function nT(){var r=Nr.f(),a=_o();return r||a}function rT(r){var a=mr(r);a!==null&&a.tag===5&&a.type==="form"?Hy(a):Nr.r(r)}var Pa=typeof document>"u"?null:document;function bv(r,a,o){var f=Pa;if(f&&typeof a=="string"&&a){var g=Jt(a);g='link[rel="'+r+'"][href="'+g+'"]',typeof o=="string"&&(g+='[crossorigin="'+o+'"]'),xv.has(g)||(xv.add(g),r={rel:r,crossOrigin:o,href:a},f.querySelector(g)===null&&(a=f.createElement("link"),Lt(a,"link",r),wt(a),f.head.appendChild(a)))}}function iT(r){Nr.D(r),bv("dns-prefetch",r,null)}function aT(r,a){Nr.C(r,a),bv("preconnect",r,a)}function lT(r,a,o){Nr.L(r,a,o);var f=Pa;if(f&&r&&a){var g='link[rel="preload"][as="'+Jt(a)+'"]';a==="image"&&o&&o.imageSrcSet?(g+='[imagesrcset="'+Jt(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(g+='[imagesizes="'+Jt(o.imageSizes)+'"]')):g+='[href="'+Jt(r)+'"]';var x=g;switch(a){case"style":x=qa(r);break;case"script":x=Va(r)}Cn.has(x)||(r=m({rel:"preload",href:a==="image"&&o&&o.imageSrcSet?void 0:r,as:a},o),Cn.set(x,r),f.querySelector(g)!==null||a==="style"&&f.querySelector(os(x))||a==="script"&&f.querySelector(cs(x))||(a=f.createElement("link"),Lt(a,"link",r),wt(a),f.head.appendChild(a)))}}function sT(r,a){Nr.m(r,a);var o=Pa;if(o&&r){var f=a&&typeof a.as=="string"?a.as:"script",g='link[rel="modulepreload"][as="'+Jt(f)+'"][href="'+Jt(r)+'"]',x=g;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Va(r)}if(!Cn.has(x)&&(r=m({rel:"modulepreload",href:r},a),Cn.set(x,r),o.querySelector(g)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(cs(x)))return}f=o.createElement("link"),Lt(f,"link",r),wt(f),o.head.appendChild(f)}}}function uT(r,a,o){Nr.S(r,a,o);var f=Pa;if(f&&r){var g=Pr(f).hoistableStyles,x=qa(r);a=a||"default";var T=g.get(x);if(!T){var D={loading:0,preload:null};if(T=f.querySelector(os(x)))D.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":a},o),(o=Cn.get(x))&&nh(r,o);var V=T=f.createElement("link");wt(V),Lt(V,"link",r),V._p=new Promise(function(ne,se){V.onload=ne,V.onerror=se}),V.addEventListener("load",function(){D.loading|=1}),V.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Oo(T,a,f)}T={type:"stylesheet",instance:T,count:1,state:D},g.set(x,T)}}}function oT(r,a){Nr.X(r,a);var o=Pa;if(o&&r){var f=Pr(o).hoistableScripts,g=Va(r),x=f.get(g);x||(x=o.querySelector(cs(g)),x||(r=m({src:r,async:!0},a),(a=Cn.get(g))&&rh(r,a),x=o.createElement("script"),wt(x),Lt(x,"link",r),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(g,x))}}function cT(r,a){Nr.M(r,a);var o=Pa;if(o&&r){var f=Pr(o).hoistableScripts,g=Va(r),x=f.get(g);x||(x=o.querySelector(cs(g)),x||(r=m({src:r,async:!0,type:"module"},a),(a=Cn.get(g))&&rh(r,a),x=o.createElement("script"),wt(x),Lt(x,"link",r),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(g,x))}}function _v(r,a,o,f){var g=(g=W.current)?Mo(g):null;if(!g)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(a=qa(o.href),o=Pr(g).hoistableStyles,f=o.get(a),f||(f={type:"style",instance:null,count:0,state:null},o.set(a,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){r=qa(o.href);var x=Pr(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(os(r)))&&!x._p&&(T.instance=x,T.state.loading=5),Cn.has(r)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Cn.set(r,o),x||fT(g,r,o,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=o.async,o=o.src,typeof o=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Va(o),o=Pr(g).hoistableScripts,f=o.get(a),f||(f={type:"script",instance:null,count:0,state:null},o.set(a,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function qa(r){return'href="'+Jt(r)+'"'}function os(r){return'link[rel="stylesheet"]['+r+"]"}function wv(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function fT(r,a,o,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",o),wt(a),r.head.appendChild(a))}function Va(r){return'[src="'+Jt(r)+'"]'}function cs(r){return"script[async]"+r}function Sv(r,a,o){if(a.count++,a.instance===null)switch(a.type){case"style":var f=r.querySelector('style[data-href~="'+Jt(o.href)+'"]');if(f)return a.instance=f,wt(f),f;var g=m({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return f=(r.ownerDocument||r).createElement("style"),wt(f),Lt(f,"style",g),Oo(f,o.precedence,r),a.instance=f;case"stylesheet":g=qa(o.href);var x=r.querySelector(os(g));if(x)return a.state.loading|=4,a.instance=x,wt(x),x;f=wv(o),(g=Cn.get(g))&&nh(f,g),x=(r.ownerDocument||r).createElement("link"),wt(x);var T=x;return T._p=new Promise(function(D,V){T.onload=D,T.onerror=V}),Lt(x,"link",f),a.state.loading|=4,Oo(x,o.precedence,r),a.instance=x;case"script":return x=Va(o.src),(g=r.querySelector(cs(x)))?(a.instance=g,wt(g),g):(f=o,(g=Cn.get(x))&&(f=m({},o),rh(f,g)),r=r.ownerDocument||r,g=r.createElement("script"),wt(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,o.precedence,r));return a.instance}function Oo(r,a,o){for(var f=o.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 D=f[T];if(D.dataset.precedence===a)x=D;else if(x!==g)break}x?x.parentNode.insertBefore(r,x.nextSibling):(a=o.nodeType===9?o.head:o,a.insertBefore(r,a.firstChild))}function nh(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.title==null&&(r.title=a.title)}function rh(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.integrity==null&&(r.integrity=a.integrity)}var Ro=null;function Ev(r,a,o){if(Ro===null){var f=new Map,g=Ro=new Map;g.set(o,f)}else g=Ro,f=g.get(o),f||(f=new Map,g.set(o,f));if(f.has(r))return f;for(f.set(r,null),o=o.getElementsByTagName(r),g=0;g<o.length;g++){var x=o[g];if(!(x[Ni]||x[Mt]||r==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var T=x.getAttribute(a)||"";T=r+T;var D=f.get(T);D?D.push(x):f.set(T,[x])}}return f}function kv(r,a,o){r=r.ownerDocument||r,r.head.insertBefore(o,a==="title"?r.querySelector("head > title"):null)}function dT(r,a,o){if(o===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 Tv(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}var fs=null;function hT(){}function mT(r,a,o){if(fs===null)throw Error(i(475));var f=fs;if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var g=qa(o.href),x=r.querySelector(os(g));if(x){r=x._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(f.count++,f=zo.bind(f),r.then(f,f)),a.state.loading|=4,a.instance=x,wt(x);return}x=r.ownerDocument||r,o=wv(o),(g=Cn.get(g))&&nh(o,g),x=x.createElement("link"),wt(x);var T=x;T._p=new Promise(function(D,V){T.onload=D,T.onerror=V}),Lt(x,"link",o),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=zo.bind(f),r.addEventListener("load",a),r.addEventListener("error",a))}}function pT(){if(fs===null)throw Error(i(475));var r=fs;return r.stylesheets&&r.count===0&&ih(r,r.stylesheets),0<r.count?function(a){var o=setTimeout(function(){if(r.stylesheets&&ih(r,r.stylesheets),r.unsuspend){var f=r.unsuspend;r.unsuspend=null,f()}},6e4);return r.unsuspend=a,function(){r.unsuspend=null,clearTimeout(o)}}:null}function zo(){if(this.count--,this.count===0){if(this.stylesheets)ih(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Do=null;function ih(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Do=new Map,a.forEach(gT,r),Do=null,zo.call(r))}function gT(r,a){if(!(a.state.loading&4)){var o=Do.get(r);if(o)var f=o.get(null);else{o=new Map,Do.set(r,o);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")&&(o.set(T.dataset.precedence,T),f=T)}f&&o.set(null,f)}g=a.instance,T=g.getAttribute("data-precedence"),x=o.get(T)||f,x===f&&o.set(null,g),o.set(T,g),this.count++,f=zo.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 ds={$$typeof:E,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function yT(r,a,o,f,g,x,T,D){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=pl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pl(0),this.hiddenUpdates=pl(null),this.identifierPrefix=f,this.onUncaughtError=g,this.onCaughtError=x,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Cv(r,a,o,f,g,x,T,D,V,ne,se,fe){return r=new yT(r,a,o,T,D,V,ne,fe),a=1,x===!0&&(a|=24),x=on(3,null,null,a),r.current=x,x.stateNode=r,a=Hf(),a.refCount++,r.pooledCache=a,a.refCount++,x.memoizedState={element:f,isDehydrated:o,cache:a},Vf(x),r}function Av(r){return r?(r=ba,r):ba}function Nv(r,a,o,f,g,x){g=Av(g),f.context===null?f.context=g:f.pendingContext=g,f=Gr(a),f.payload={element:o},x=x===void 0?null:x,x!==null&&(f.callback=x),o=Xr(r,f,a),o!==null&&(mn(o,r,a),ql(o,r,a))}function Mv(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var o=r.retryLane;r.retryLane=o!==0&&o<a?o:a}}function ah(r,a){Mv(r,a),(r=r.alternate)&&Mv(r,a)}function Ov(r){if(r.tag===13){var a=xa(r,67108864);a!==null&&mn(a,r,67108864),ah(r,67108864)}}var jo=!0;function vT(r,a,o,f){var g=L.T;L.T=null;var x=q.p;try{q.p=2,lh(r,a,o,f)}finally{q.p=x,L.T=g}}function xT(r,a,o,f){var g=L.T;L.T=null;var x=q.p;try{q.p=8,lh(r,a,o,f)}finally{q.p=x,L.T=g}}function lh(r,a,o,f){if(jo){var g=sh(f);if(g===null)Fd(r,a,f,Lo,o),zv(r,f);else if(_T(g,r,a,o,f))f.stopPropagation();else if(zv(r,f),a&4&&-1<bT.indexOf(r)){for(;g!==null;){var x=mr(g);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var T=Zt(x.pendingLanes);if(T!==0){var D=x;for(D.pendingLanes|=2,D.entangledLanes|=2;T;){var V=1<<31-Te(T);D.entanglements[1]|=V,T&=~V}rr(x),(Je&6)===0&&(xo=bt()+500,as(0))}}break;case 13:D=xa(x,2),D!==null&&mn(D,x,2),_o(),ah(x,2)}if(x=sh(f),x===null&&Fd(r,a,f,Lo,o),x===g)break;g=x}g!==null&&f.stopPropagation()}else Fd(r,a,f,null,o)}}function sh(r){return r=df(r),uh(r)}var Lo=null;function uh(r){if(Lo=null,r=hr(r),r!==null){var a=s(r);if(a===null)r=null;else{var o=a.tag;if(o===13){if(r=u(a),r!==null)return r;r=null}else if(o===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return Lo=r,null}function Rv(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(Ti()){case fr:return 2;case Mn:return 8;case Xn:case dr:return 32;case Qn:return 268435456;default:return 32}default:return 32}}var oh=!1,ui=null,oi=null,ci=null,hs=new Map,ms=new Map,fi=[],bT="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 zv(r,a){switch(r){case"focusin":case"focusout":ui=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ci=null;break;case"pointerover":case"pointerout":hs.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":ms.delete(a.pointerId)}}function ps(r,a,o,f,g,x){return r===null||r.nativeEvent!==x?(r={blockedOn:a,domEventName:o,eventSystemFlags:f,nativeEvent:x,targetContainers:[g]},a!==null&&(a=mr(a),a!==null&&Ov(a)),r):(r.eventSystemFlags|=f,a=r.targetContainers,g!==null&&a.indexOf(g)===-1&&a.push(g),r)}function _T(r,a,o,f,g){switch(a){case"focusin":return ui=ps(ui,r,a,o,f,g),!0;case"dragenter":return oi=ps(oi,r,a,o,f,g),!0;case"mouseover":return ci=ps(ci,r,a,o,f,g),!0;case"pointerover":var x=g.pointerId;return hs.set(x,ps(hs.get(x)||null,r,a,o,f,g)),!0;case"gotpointercapture":return x=g.pointerId,ms.set(x,ps(ms.get(x)||null,r,a,o,f,g)),!0}return!1}function Dv(r){var a=hr(r.target);if(a!==null){var o=s(a);if(o!==null){if(a=o.tag,a===13){if(a=u(o),a!==null){r.blockedOn=a,nf(r.priority,function(){if(o.tag===13){var f=hn();f=yl(f);var g=xa(o,f);g!==null&&mn(g,o,f),ah(o,f)}});return}}else if(a===3&&o.stateNode.current.memoizedState.isDehydrated){r.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Io(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var o=sh(r.nativeEvent);if(o===null){o=r.nativeEvent;var f=new o.constructor(o.type,o);ff=f,o.target.dispatchEvent(f),ff=null}else return a=mr(o),a!==null&&Ov(a),r.blockedOn=o,!1;a.shift()}return!0}function jv(r,a,o){Io(r)&&o.delete(a)}function wT(){oh=!1,ui!==null&&Io(ui)&&(ui=null),oi!==null&&Io(oi)&&(oi=null),ci!==null&&Io(ci)&&(ci=null),hs.forEach(jv),ms.forEach(jv)}function Bo(r,a){r.blockedOn===a&&(r.blockedOn=null,oh||(oh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,wT)))}var Ho=null;function Lv(r){Ho!==r&&(Ho=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ho===r&&(Ho=null);for(var a=0;a<r.length;a+=3){var o=r[a],f=r[a+1],g=r[a+2];if(typeof f!="function"){if(uh(f||o)===null)continue;break}var x=mr(o);x!==null&&(r.splice(a,3),a-=3,ud(x,{pending:!0,data:g,method:o.method,action:f},f,g))}}))}function gs(r){function a(V){return Bo(V,r)}ui!==null&&Bo(ui,r),oi!==null&&Bo(oi,r),ci!==null&&Bo(ci,r),hs.forEach(a),ms.forEach(a);for(var o=0;o<fi.length;o++){var f=fi[o];f.blockedOn===r&&(f.blockedOn=null)}for(;0<fi.length&&(o=fi[0],o.blockedOn===null);)Dv(o),o.blockedOn===null&&fi.shift();if(o=(r.ownerDocument||r).$$reactFormReplay,o!=null)for(f=0;f<o.length;f+=3){var g=o[f],x=o[f+1],T=g[Bt]||null;if(typeof x=="function")T||Lv(o);else if(T){var D=null;if(x&&x.hasAttribute("formAction")){if(g=x,T=x[Bt]||null)D=T.formAction;else if(uh(g)!==null)continue}else D=T.action;typeof D=="function"?o[f+1]=D:(o.splice(f,3),f-=3),Lv(o)}}}function ch(r){this._internalRoot=r}Uo.prototype.render=ch.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(i(409));var o=a.current,f=hn();Nv(o,f,r,a,null,null)},Uo.prototype.unmount=ch.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;Nv(r.current,2,null,r,null,null),_o(),a[Hr]=null}};function Uo(r){this._internalRoot=r}Uo.prototype.unstable_scheduleHydration=function(r){if(r){var a=ku();r={blockedOn:null,target:r,priority:a};for(var o=0;o<fi.length&&a!==0&&a<fi[o].priority;o++);fi.splice(o,0,r),o===0&&Dv(r)}};var Iv=t.version;if(Iv!=="19.1.0")throw Error(i(527,Iv,"19.1.0"));q.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 ST={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Po.isDisabled&&Po.supportsFiber)try{le=Po.inject(ST),de=Po}catch{}}return vs.createRoot=function(r,a){if(!l(r))throw Error(i(299));var o=!1,f="",g=Wy,x=e0,T=t0,D=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!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&&(D=a.unstable_transitionCallbacks)),a=Cv(r,1,!1,null,null,o,f,g,x,T,D,null),r[Hr]=a.current,Yd(r),new ch(a)},vs.hydrateRoot=function(r,a,o){if(!l(r))throw Error(i(299));var f=!1,g="",x=Wy,T=e0,D=t0,V=null,ne=null;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(x=o.onUncaughtError),o.onCaughtError!==void 0&&(T=o.onCaughtError),o.onRecoverableError!==void 0&&(D=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(V=o.unstable_transitionCallbacks),o.formState!==void 0&&(ne=o.formState)),a=Cv(r,1,!0,a,o??null,f,g,x,T,D,V,ne),a.context=Av(null),o=a.current,f=hn(),f=yl(f),g=Gr(f),g.callback=null,Xr(o,g,f),o=f,a.current.lanes=o,Ai(a,o),rr(a),r[Hr]=a.current,Yd(r),new Uo(a)},vs.version="19.1.0",vs}var Fv;function DT(){if(Fv)return dh.exports;Fv=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(),dh.exports=zT(),dh.exports}var jT=DT();const LT=Ei(jT);var ie=cu();const IT=Ei(ie),BT=({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()})})},Ap=({usage_metadata:e,spend_time:t,response_metadata:n})=>{const i=l=>l.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:"📥"}),i(e.input_tokens||0)]}),I.jsxs("span",{className:"token-item",children:[I.jsx("span",{className:"token-emoji",children:"📤"}),i(e.output_tokens||0)]}),I.jsxs("span",{className:"token-item",children:[I.jsx("span",{className:"token-emoji",children:"📊"}),i(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`:""})]})};var xs={exports:{}},yh={},vh,Gv;function HT(){if(Gv)return vh;Gv=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 vh=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],u=s.message,c=(t[u]||0)+1;t[u]=c,c>=i&&(n=s,i=c)}return n},vh}var Xv;function UT(){return Xv||(Xv=1,function(e){var t=HT();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=[],u=0;u<i.retries;u++)s.push(this.createTimeout(u,i));return n&&n.forever&&!s.length&&s.push(this.createTimeout(u,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 u=0;u<l.length;u++){var c=l[u],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}}}(yh)),yh}var xh,Qv;function PT(){return Qv||(Qv=1,xh=UT()),xh}var Kv;function qT(){if(Kv)return xs.exports;Kv=1;const e=PT(),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=(u,c,d)=>{const h=d.retries-(c-1);return u.attemptNumber=c,u.retriesLeft=h,u},l=u=>t.includes(u),s=(u,c)=>new Promise((d,h)=>{c={onFailedAttempt:()=>{},retries:10,...c};const m=e.operation(c);m.attempt(async p=>{try{d(await u(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 xs.exports=s,xs.exports.default=s,xs.exports.AbortError=n,xs.exports}var VT=qT();const $T=Ei(VT);var qo={},bh={exports:{}},Jv;function ZT(){return Jv||(Jv=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 u(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 N=S.length,j;for(E=0;E<N;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(j=1,A=new Array(k-1);j<k;j++)A[j-1]=arguments[j];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 u(this,v),this;var b=this._events[v];if(b.fn)b.fn===m&&(!y||b.once)&&(!p||b.context===p)&&u(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:u(this,v)}return this},c.prototype.removeAllListeners=function(h){var m;return h?(m=n?n+h:h,this._events[m]&&u(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}(bh)),bh.exports}var bs={exports:{}},_h,Wv;function YT(){return Wv||(Wv=1,_h=(e,t)=>(t=t||(()=>{}),e.then(n=>new Promise(i=>{i(t())}).then(()=>n),n=>new Promise(i=>{i(t())}).then(()=>{throw n})))),_h}var ex;function FT(){if(ex)return bs.exports;ex=1;const e=YT();class t extends Error{constructor(l){super(l),this.name="TimeoutError"}}const n=(i,l,s)=>new Promise((u,c)=>{if(typeof l!="number"||l<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(l===1/0){u(i);return}const d=setTimeout(()=>{if(typeof s=="function"){try{u(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(u,c),()=>{clearTimeout(d)})});return bs.exports=n,bs.exports.default=n,bs.exports.TimeoutError=t,bs.exports}var Vo={},$o={},tx;function GT(){if(tx)return $o;tx=1,Object.defineProperty($o,"__esModule",{value:!0});function e(t,n,i){let l=0,s=t.length;for(;s>0;){const u=s/2|0;let c=l+u;i(t[c],n)<=0?(l=++c,s-=u+1):s=u}return l}return $o.default=e,$o}var nx;function XT(){if(nx)return Vo;nx=1,Object.defineProperty(Vo,"__esModule",{value:!0});const e=GT();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 u=e.default(this._queue,s,(c,d)=>d.priority-c.priority);this._queue.splice(u,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 Vo.default=t,Vo}var rx;function QT(){if(rx)return qo;rx=1,Object.defineProperty(qo,"__esModule",{value:!0});const e=ZT(),t=FT(),n=XT(),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 qo.default=s,qo}var KT=QT();const wh=Ei(KT),JT=(...e)=>fetch(...e),WT=Symbol.for("lg:fetch_implementation"),e2=()=>globalThis[WT]??JT,t2=[400,401,402,403,404,405,406,407,408,409,422];function n2(e){return e==null||typeof e!="object"?!1:"status"in e&&"statusText"in e&&"text"in e}class Is 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 Is(t.status,await t.text(),n!=null&&n.includeResponse?t:void 0)}catch{return new Is(t.status,t.statusText,n!=null&&n.includeResponse?t:void 0)}}}class r2{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 wh?this.queue=new wh.default({concurrency:this.maxConcurrency}):this.queue=new wh({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(()=>$T(()=>t(...n).catch(async l=>{throw l instanceof Error?l:n2(l)?await Is.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 Is){if(t2.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 u;(u=t.signal)==null||u.addEventListener("abort",()=>{s(new Error("AbortError"))})})]):this.call(n,...i)}fetch(...t){const n=this.customFetch??e2();return this.call(()=>n(...t).then(i=>i.ok?i:Promise.reject(i)))}}var Sh={};function i2(e){try{return typeof process<"u"?Sh==null?void 0:Sh[e]:void 0}catch{return}}function a2(...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 Cs=13,Wm=10,l2=0,ix=58,s2=32,u2=[Cs,Wm];class ax extends TransformStream{constructor(){let t=[],n=!1;super({start(){t=[],n=!1},transform(i,l){let s=i;if(n&&(s=ac([[Cs],s]),n=!1),s.length>0&&s.at(-1)===Cs&&(n=!0,s=s.subarray(0,-1)),!s.length)return;const u=u2.includes(s.at(-1)),c=s.length-1,{lines:d}=s.reduce((h,m,p)=>(h.from>p||((m===Cs||m===Wm)&&(h.lines.push(s.subarray(h.from,p)),m===Cs&&s[p+1]===Wm?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&&!u){t.push(d[0]);return}t.length&&(t.push(d[0]),d[0]=ac(t),t=[]),u||d.length&&(t=[d.pop()]);for(const h of d)l.enqueue(h)},flush(i){t.length&&i.enqueue(ac(t))}})}}class lx extends TransformStream{constructor(){let t="",n=[],i="",l=null;const s=new TextDecoder;super({transform(u,c){if(!u.length){if(!t&&!n.length&&!i&&l==null)return;const p={id:i||void 0,event:t,data:n.length?sx(s,n):null};t="",n=[],l=null,c.enqueue(p);return}if(u[0]===ix)return;const d=u.indexOf(ix);if(d===-1)return;const h=s.decode(u.subarray(0,d));let m=u.subarray(d+1);if(m[0]===s2&&(m=m.subarray(1)),h==="event")t=s.decode(m);else if(h==="data")n.push(m);else if(h==="id")m.indexOf(l2)===-1&&(i=s.decode(m));else if(h==="retry"){const p=Number.parseInt(s.decode(m));Number.isNaN(p)||(l=p)}},flush(u){t&&u.enqueue({id:i||void 0,event:t,data:n.length?sx(s,n):null})}})}}function ac(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 sx(e,t){return JSON.parse(e.decode(ac(t)))}class Bs 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 Bs({start(i){return l();function l(){return n.read().then(({done:s,value:u})=>{if(s){i.close();return}return i.enqueue(u),l()})}},cancel(){n.releaseLock()}})}static fromAsyncGenerator(t){return new Bs({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 o2(e){if(e)return e;const t=["LANGGRAPH","LANGSMITH","LANGCHAIN"];for(const n of t){const i=i2(`${n}_API_KEY`);if(i)return i.trim().replace(/^["']|["']$/g,"")}}const c2=/(\/threads\/(?<thread_id>.+))?\/runs\/(?<run_id>.+)/;function Eh(e){var i;const t=e.headers.get("Content-Location");if(!t)return;const n=c2.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 dl{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 u=Symbol.for("langgraph_api:fetch"),c=Symbol.for("langgraph_api:url"),d=globalThis;d[u]&&(n.fetch??(n.fetch=d[u])),d[c]&&(i=d[c])}this.asyncCaller=new r2(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=o2(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=a2(l,i.signal);const s=new URL(`${this.apiUrl}${t}`);if(i.params){for(const[u,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(u,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 f2 extends dl{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 d2 extends dl{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 h2 extends dl{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 m2 extends dl{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,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`,u=await this.asyncCaller.fetch(...this.prepareFetchOptions(s,{method:"POST",json:l,timeoutMs:null,signal:i==null?void 0:i.signal})),c=Eh(u);c&&((h=i==null?void 0:i.onRunCreated)==null||h.call(i,c));const d=(u.body||new ReadableStream({start:m=>m.close()})).pipeThrough(new ax).pipeThrough(new lx);yield*Bs.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,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,u]=await this.fetch(`/threads/${t}/runs`,{method:"POST",json:l,signal:i==null?void 0:i.signal,withResponse:!0}),c=Eh(u);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`,[u,c]=await this.fetch(s,{method:"POST",json:l,timeoutMs:null,signal:i==null?void 0:i.signal,withResponse:!0}),d=Eh(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 u&&typeof u.__error__=="object"&&u.__error__&&"error"in u.__error__&&"message"in u.__error__)throw new Error(`${(p=u.__error__)==null?void 0:p.error}: ${(y=u.__error__)==null?void 0:y.message}`);return u}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,u=((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 ax).pipeThrough(new lx);yield*Bs.fromReadableStream(u)}async delete(t,n){return this.fetch(`/threads/${t}/runs/${n}`,{method:"DELETE"})}}class p2 extends dl{async putItem(t,n,i,l){t.forEach(u=>{if(u.includes("."))throw new Error(`Invalid namespace label '${u}'. 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(u=>{if(u.includes("."))throw new Error(`Invalid namespace label '${u}'. 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 Gi extends dl{static getOrCached(t,n){if(Gi.promiseCache[t]!=null)return Gi.promiseCache[t];const i=n();return Gi.promiseCache[t]=i,i}async getComponent(t,n){return Gi.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(Gi,"promiseCache",{enumerable:!0,configurable:!0,writable:!0,value:{}});class g2{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 d2(t),this.threads=new h2(t),this.runs=new m2(t),this.crons=new f2(t),this.store=new p2(t),this["~ui"]=new Gi(t)}}var Ze;(function(e){e.assertEqual=l=>l;function t(l){}e.assertIs=t;function n(l){throw new Error}e.assertNever=n,e.arrayToEnum=l=>{const s={};for(const u of l)s[u]=u;return s},e.getValidEnumValues=l=>{const s=e.objectKeys(l).filter(c=>typeof l[l[c]]!="number"),u={};for(const c of s)u[c]=l[c];return e.objectValues(u)},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 u in l)Object.prototype.hasOwnProperty.call(l,u)&&s.push(u);return s},e.find=(l,s)=>{for(const u of l)if(s(u))return u},e.isInteger=typeof Number.isInteger=="function"?l=>Number.isInteger(l):l=>typeof l=="number"&&isFinite(l)&&Math.floor(l)===l;function i(l,s=" | "){return l.map(u=>typeof u=="string"?`'${u}'`:u).join(s)}e.joinValues=i,e.jsonStringifyReplacer=(l,s)=>typeof s=="bigint"?s.toString():s})(Ze||(Ze={}));var ep;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(ep||(ep={}));const xe=Ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Rr=e=>{switch(typeof e){case"undefined":return xe.undefined;case"string":return xe.string;case"number":return isNaN(e)?xe.nan:xe.number;case"boolean":return xe.boolean;case"function":return xe.function;case"bigint":return xe.bigint;case"symbol":return xe.symbol;case"object":return Array.isArray(e)?xe.array:e===null?xe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?xe.promise:typeof Map<"u"&&e instanceof Map?xe.map:typeof Set<"u"&&e instanceof Set?xe.set:typeof Date<"u"&&e instanceof Date?xe.date:xe.object;default:return xe.unknown}},he=Ze.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"]),y2=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class yn 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 u of s.issues)if(u.code==="invalid_union")u.unionErrors.map(l);else if(u.code==="invalid_return_type")l(u.returnTypeError);else if(u.code==="invalid_arguments")l(u.argumentsError);else if(u.path.length===0)i._errors.push(n(u));else{let c=i,d=0;for(;d<u.path.length;){const h=u.path[d];d===u.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(n(u))):c[h]=c[h]||{_errors:[]},c=c[h],d++}}};return l(this),i}static assert(t){if(!(t instanceof yn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ze.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()}}yn.create=e=>new yn(e);const nl=(e,t)=>{let n;switch(e.code){case he.invalid_type:e.received===xe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case he.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ze.jsonStringifyReplacer)}`;break;case he.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ze.joinValues(e.keys,", ")}`;break;case he.invalid_union:n="Invalid input";break;case he.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ze.joinValues(e.options)}`;break;case he.invalid_enum_value:n=`Invalid enum value. Expected ${Ze.joinValues(e.options)}, received '${e.received}'`;break;case he.invalid_arguments:n="Invalid function arguments";break;case he.invalid_return_type:n="Invalid function return type";break;case he.invalid_date:n="Invalid date";break;case he.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}"`:Ze.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case he.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 he.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 he.custom:n="Invalid input";break;case he.invalid_intersection_types:n="Intersection results could not be merged";break;case he.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case he.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ze.assertNever(e)}return{message:n}};let a_=nl;function v2(e){a_=e}function fc(){return a_}const dc=e=>{const{data:t,path:n,errorMaps:i,issueData:l}=e,s=[...n,...l.path||[]],u={...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(u,{data:t,defaultError:c}).message;return{...l,path:s,message:c}},x2=[];function ye(e,t){const n=fc(),i=dc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===nl?void 0:nl].filter(l=>!!l)});e.common.issues.push(i)}class qt{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 Re;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,u=await l.value;i.push({key:s,value:u})}return qt.mergeObjectSync(t,i)}static mergeObjectSync(t,n){const i={};for(const l of n){const{key:s,value:u}=l;if(s.status==="aborted"||u.status==="aborted")return Re;s.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof u.value<"u"||l.alwaysSet)&&(i[s.value]=u.value)}return{status:t.value,value:i}}}const Re=Object.freeze({status:"aborted"}),Xa=e=>({status:"dirty",value:e}),Xt=e=>({status:"valid",value:e}),tp=e=>e.status==="aborted",np=e=>e.status==="dirty",Wi=e=>e.status==="valid",Hs=e=>typeof Promise<"u"&&e instanceof Promise;function hc(e,t,n,i){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function l_(e,t,n,i,l){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}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 As,Ns;class lr{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||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ux=(e,t)=>{if(Wi(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 yn(e.common.issues);return this._error=n,this._error}}};function Le(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:(u,c)=>{var d,h;const{message:m}=e;return u.code==="invalid_enum_value"?{message:m??c.defaultError}:typeof c.data>"u"?{message:(d=m??i)!==null&&d!==void 0?d:c.defaultError}:u.code!=="invalid_type"?{message:c.defaultError}:{message:(h=m??n)!==null&&h!==void 0?h:c.defaultError}},description:l}}class Be{get description(){return this._def.description}_getType(t){return Rr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Rr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new qt,ctx:{common:t.parent.common,data:t.data,parsedType:Rr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Hs(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){var i;const l={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Rr(t)},s=this._parseSync({data:t,path:l.path,parent:l});return ux(l,s)}"~validate"(t){var n,i;const l={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Rr(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:l});return Wi(s)?{value:s.value}:{issues:l.common.issues}}catch(s){!((i=(n=s==null?void 0:s.message)===null||n===void 0?void 0:n.toLowerCase())===null||i===void 0)&&i.includes("encountered")&&(this["~standard"].async=!0),l.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:l}).then(s=>Wi(s)?{value:s.value}:{issues:l.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:Rr(t)},l=this._parse({data:t,path:i.path,parent:i}),s=await(Hs(l)?l:Promise.resolve(l));return ux(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 u=t(l),c=()=>s.addIssue({code:he.custom,...i(l)});return typeof Promise<"u"&&u instanceof Promise?u.then(d=>d?!0:(c(),!1)):u?!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 Yn({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 $n.create(this,this._def)}nullable(){return Si.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vn.create(this)}promise(){return il.create(this,this._def)}or(t){return Vs.create([this,t],this._def)}and(t){return $s.create(this,t,this._def)}transform(t){return new Yn({...Le(this._def),schema:this,typeName:pe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Xs({...Le(this._def),innerType:this,defaultValue:n,typeName:pe.ZodDefault})}brand(){return new Np({typeName:pe.ZodBranded,type:this,...Le(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Qs({...Le(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 fu.create(this,t)}readonly(){return Ks.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const b2=/^c[^\s-]{8,}$/i,_2=/^[0-9a-z]+$/,w2=/^[0-9A-HJKMNP-TV-Z]{26}$/i,S2=/^[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,E2=/^[a-z0-9_-]{21}$/i,k2=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,T2=/^[-+]?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)?)??$/,C2=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,A2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kh;const N2=/^(?:(?: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])$/,M2=/^(?:(?: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])$/,O2=/^(([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]))$/,R2=/^(([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])$/,z2=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,D2=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,s_="((\\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])))",j2=new RegExp(`^${s_}$`);function u_(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 L2(e){return new RegExp(`^${u_(e)}$`)}function o_(e){let t=`${s_}T${u_(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 I2(e,t){return!!((t==="v4"||!t)&&N2.test(e)||(t==="v6"||!t)&&O2.test(e))}function B2(e,t){if(!k2.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||!l.typ||!l.alg||t&&l.alg!==t)}catch{return!1}}function H2(e,t){return!!((t==="v4"||!t)&&M2.test(e)||(t==="v6"||!t)&&R2.test(e))}class Pn extends Be{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==xe.string){const s=this._getOrReturnCtx(t);return ye(s,{code:he.invalid_type,expected:xe.string,received:s.parsedType}),Re}const i=new qt;let l;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(l=this._getOrReturnCtx(t,l),ye(l,{code:he.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),ye(l,{code:he.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const u=t.data.length>s.value,c=t.data.length<s.value;(u||c)&&(l=this._getOrReturnCtx(t,l),u?ye(l,{code:he.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&ye(l,{code:he.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")C2.test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"email",code:he.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")kh||(kh=new RegExp(A2,"u")),kh.test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"emoji",code:he.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")S2.test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"uuid",code:he.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")E2.test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"nanoid",code:he.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")b2.test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"cuid",code:he.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")_2.test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"cuid2",code:he.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")w2.test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"ulid",code:he.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{l=this._getOrReturnCtx(t,l),ye(l,{validation:"url",code:he.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),ye(l,{validation:"regex",code:he.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),ye(l,{code:he.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),ye(l,{code:he.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(l=this._getOrReturnCtx(t,l),ye(l,{code:he.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?o_(s).test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{code:he.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?j2.test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{code:he.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?L2(s).test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{code:he.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?T2.test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"duration",code:he.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?I2(t.data,s.version)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"ip",code:he.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?B2(t.data,s.alg)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"jwt",code:he.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?H2(t.data,s.version)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"cidr",code:he.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?z2.test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"base64",code:he.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?D2.test(t.data)||(l=this._getOrReturnCtx(t,l),ye(l,{validation:"base64url",code:he.invalid_string,message:s.message}),i.dirty()):Ze.assertNever(s);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(l=>t.test(l),{validation:n,code:he.invalid_string,..._e.errToObj(i)})}_addCheck(t){return new Pn({...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){var n,i;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:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(i=t==null?void 0:t.local)!==null&&i!==void 0?i:!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 Pn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Pn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Pn({...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}}Pn.create=e=>{var t;return new Pn({checks:[],typeName:pe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Le(e)})};function U2(e,t){const n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,l=n>i?n:i,s=parseInt(e.toFixed(l).replace(".","")),u=parseInt(t.toFixed(l).replace(".",""));return s%u/Math.pow(10,l)}class bi extends Be{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)!==xe.number){const s=this._getOrReturnCtx(t);return ye(s,{code:he.invalid_type,expected:xe.number,received:s.parsedType}),Re}let i;const l=new qt;for(const s of this._def.checks)s.kind==="int"?Ze.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{code:he.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),ye(i,{code:he.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),ye(i,{code:he.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),l.dirty()):s.kind==="multipleOf"?U2(t.data,s.value)!==0&&(i=this._getOrReturnCtx(t,i),ye(i,{code:he.not_multiple_of,multipleOf:s.value,message:s.message}),l.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{code:he.not_finite,message:s.message}),l.dirty()):Ze.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 bi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:_e.toString(l)}]})}_addCheck(t){return new bi({...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"&&Ze.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)}}bi.create=e=>new bi({checks:[],typeName:pe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class _i extends Be{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)!==xe.bigint)return this._getInvalidInput(t);let i;const l=new qt;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),ye(i,{code:he.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),ye(i,{code:he.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),ye(i,{code:he.not_multiple_of,multipleOf:s.value,message:s.message}),l.dirty()):Ze.assertNever(s);return{status:l.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ye(n,{code:he.invalid_type,expected:xe.bigint,received:n.parsedType}),Re}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 _i({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:_e.toString(l)}]})}_addCheck(t){return new _i({...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}}_i.create=e=>{var t;return new _i({checks:[],typeName:pe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Le(e)})};class Us extends Be{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==xe.boolean){const i=this._getOrReturnCtx(t);return ye(i,{code:he.invalid_type,expected:xe.boolean,received:i.parsedType}),Re}return Xt(t.data)}}Us.create=e=>new Us({typeName:pe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class ea extends Be{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==xe.date){const s=this._getOrReturnCtx(t);return ye(s,{code:he.invalid_type,expected:xe.date,received:s.parsedType}),Re}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return ye(s,{code:he.invalid_date}),Re}const i=new qt;let l;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(l=this._getOrReturnCtx(t,l),ye(l,{code:he.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),ye(l,{code:he.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Ze.assertNever(s);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ea({...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}}ea.create=e=>new ea({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:pe.ZodDate,...Le(e)});class mc extends Be{_parse(t){if(this._getType(t)!==xe.symbol){const i=this._getOrReturnCtx(t);return ye(i,{code:he.invalid_type,expected:xe.symbol,received:i.parsedType}),Re}return Xt(t.data)}}mc.create=e=>new mc({typeName:pe.ZodSymbol,...Le(e)});class Ps extends Be{_parse(t){if(this._getType(t)!==xe.undefined){const i=this._getOrReturnCtx(t);return ye(i,{code:he.invalid_type,expected:xe.undefined,received:i.parsedType}),Re}return Xt(t.data)}}Ps.create=e=>new Ps({typeName:pe.ZodUndefined,...Le(e)});class qs extends Be{_parse(t){if(this._getType(t)!==xe.null){const i=this._getOrReturnCtx(t);return ye(i,{code:he.invalid_type,expected:xe.null,received:i.parsedType}),Re}return Xt(t.data)}}qs.create=e=>new qs({typeName:pe.ZodNull,...Le(e)});class rl extends Be{constructor(){super(...arguments),this._any=!0}_parse(t){return Xt(t.data)}}rl.create=e=>new rl({typeName:pe.ZodAny,...Le(e)});class Qi extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xt(t.data)}}Qi.create=e=>new Qi({typeName:pe.ZodUnknown,...Le(e)});class jr extends Be{_parse(t){const n=this._getOrReturnCtx(t);return ye(n,{code:he.invalid_type,expected:xe.never,received:n.parsedType}),Re}}jr.create=e=>new jr({typeName:pe.ZodNever,...Le(e)});class pc extends Be{_parse(t){if(this._getType(t)!==xe.undefined){const i=this._getOrReturnCtx(t);return ye(i,{code:he.invalid_type,expected:xe.void,received:i.parsedType}),Re}return Xt(t.data)}}pc.create=e=>new pc({typeName:pe.ZodVoid,...Le(e)});class Vn extends Be{_parse(t){const{ctx:n,status:i}=this._processInputParams(t),l=this._def;if(n.parsedType!==xe.array)return ye(n,{code:he.invalid_type,expected:xe.array,received:n.parsedType}),Re;if(l.exactLength!==null){const u=n.data.length>l.exactLength.value,c=n.data.length<l.exactLength.value;(u||c)&&(ye(n,{code:u?he.too_big:he.too_small,minimum:c?l.exactLength.value:void 0,maximum:u?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&&(ye(n,{code:he.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&&(ye(n,{code:he.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((u,c)=>l.type._parseAsync(new lr(n,u,n.path,c)))).then(u=>qt.mergeArray(i,u));const s=[...n.data].map((u,c)=>l.type._parseSync(new lr(n,u,n.path,c)));return qt.mergeArray(i,s)}get element(){return this._def.type}min(t,n){return new Vn({...this._def,minLength:{value:t,message:_e.toString(n)}})}max(t,n){return new Vn({...this._def,maxLength:{value:t,message:_e.toString(n)}})}length(t,n){return new Vn({...this._def,exactLength:{value:t,message:_e.toString(n)}})}nonempty(t){return this.min(1,t)}}Vn.create=(e,t)=>new Vn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:pe.ZodArray,...Le(t)});function Fa(e){if(e instanceof ht){const t={};for(const n in e.shape){const i=e.shape[n];t[n]=$n.create(Fa(i))}return new ht({...e._def,shape:()=>t})}else return e instanceof Vn?new Vn({...e._def,type:Fa(e.element)}):e instanceof $n?$n.create(Fa(e.unwrap())):e instanceof Si?Si.create(Fa(e.unwrap())):e instanceof sr?sr.create(e.items.map(t=>Fa(t))):e}class ht extends Be{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=Ze.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==xe.object){const h=this._getOrReturnCtx(t);return ye(h,{code:he.invalid_type,expected:xe.object,received:h.parsedType}),Re}const{status:i,ctx:l}=this._processInputParams(t),{shape:s,keys:u}=this._getCached(),c=[];if(!(this._def.catchall instanceof jr&&this._def.unknownKeys==="strip"))for(const h in l.data)u.includes(h)||c.push(h);const d=[];for(const h of u){const m=s[h],p=l.data[h];d.push({key:{status:"valid",value:h},value:m._parse(new lr(l,p,l.path,h)),alwaysSet:h in l.data})}if(this._def.catchall instanceof jr){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&&(ye(l,{code:he.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 lr(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=>qt.mergeObjectSync(i,h)):qt.mergeObjectSync(i,d)}get shape(){return this._def.shape()}strict(t){return _e.errToObj,new ht({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,i)=>{var l,s,u,c;const d=(u=(s=(l=this._def).errorMap)===null||s===void 0?void 0:s.call(l,n,i).message)!==null&&u!==void 0?u:i.defaultError;return n.code==="unrecognized_keys"?{message:(c=_e.errToObj(t).message)!==null&&c!==void 0?c:d}:{message:d}}}:{}})}strip(){return new ht({...this._def,unknownKeys:"strip"})}passthrough(){return new ht({...this._def,unknownKeys:"passthrough"})}extend(t){return new ht({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ht({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 ht({...this._def,catchall:t})}pick(t){const n={};return Ze.objectKeys(t).forEach(i=>{t[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new ht({...this._def,shape:()=>n})}omit(t){const n={};return Ze.objectKeys(this.shape).forEach(i=>{t[i]||(n[i]=this.shape[i])}),new ht({...this._def,shape:()=>n})}deepPartial(){return Fa(this)}partial(t){const n={};return Ze.objectKeys(this.shape).forEach(i=>{const l=this.shape[i];t&&!t[i]?n[i]=l:n[i]=l.optional()}),new ht({...this._def,shape:()=>n})}required(t){const n={};return Ze.objectKeys(this.shape).forEach(i=>{if(t&&!t[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof $n;)s=s._def.innerType;n[i]=s}}),new ht({...this._def,shape:()=>n})}keyof(){return c_(Ze.objectKeys(this.shape))}}ht.create=(e,t)=>new ht({shape:()=>e,unknownKeys:"strip",catchall:jr.create(),typeName:pe.ZodObject,...Le(t)});ht.strictCreate=(e,t)=>new ht({shape:()=>e,unknownKeys:"strict",catchall:jr.create(),typeName:pe.ZodObject,...Le(t)});ht.lazycreate=(e,t)=>new ht({shape:e,unknownKeys:"strip",catchall:jr.create(),typeName:pe.ZodObject,...Le(t)});class Vs extends Be{_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 u=s.map(c=>new yn(c.ctx.common.issues));return ye(n,{code:he.invalid_union,unionErrors:u}),Re}if(n.common.async)return Promise.all(i.map(async s=>{const u={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:u}),ctx:u}})).then(l);{let s;const u=[];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&&u.push(h.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const c=u.map(d=>new yn(d));return ye(n,{code:he.invalid_union,unionErrors:c}),Re}}get options(){return this._def.options}}Vs.create=(e,t)=>new Vs({options:e,typeName:pe.ZodUnion,...Le(t)});const Or=e=>e instanceof Ys?Or(e.schema):e instanceof Yn?Or(e.innerType()):e instanceof Fs?[e.value]:e instanceof wi?e.options:e instanceof Gs?Ze.objectValues(e.enum):e instanceof Xs?Or(e._def.innerType):e instanceof Ps?[void 0]:e instanceof qs?[null]:e instanceof $n?[void 0,...Or(e.unwrap())]:e instanceof Si?[null,...Or(e.unwrap())]:e instanceof Np||e instanceof Ks?Or(e.unwrap()):e instanceof Qs?Or(e._def.innerType):[];class Lc extends Be{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.object)return ye(n,{code:he.invalid_type,expected:xe.object,received:n.parsedType}),Re;const i=this.discriminator,l=n.data[i],s=this.optionsMap.get(l);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ye(n,{code:he.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Re)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){const l=new Map;for(const s of n){const u=Or(s.shape[t]);if(!u.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of u){if(l.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);l.set(c,s)}}return new Lc({typeName:pe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:l,...Le(i)})}}function rp(e,t){const n=Rr(e),i=Rr(t);if(e===t)return{valid:!0,data:e};if(n===xe.object&&i===xe.object){const l=Ze.objectKeys(t),s=Ze.objectKeys(e).filter(c=>l.indexOf(c)!==-1),u={...e,...t};for(const c of s){const d=rp(e[c],t[c]);if(!d.valid)return{valid:!1};u[c]=d.data}return{valid:!0,data:u}}else if(n===xe.array&&i===xe.array){if(e.length!==t.length)return{valid:!1};const l=[];for(let s=0;s<e.length;s++){const u=e[s],c=t[s],d=rp(u,c);if(!d.valid)return{valid:!1};l.push(d.data)}return{valid:!0,data:l}}else return n===xe.date&&i===xe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class $s extends Be{_parse(t){const{status:n,ctx:i}=this._processInputParams(t),l=(s,u)=>{if(tp(s)||tp(u))return Re;const c=rp(s.value,u.value);return c.valid?((np(s)||np(u))&&n.dirty(),{status:n.value,value:c.data}):(ye(i,{code:he.invalid_intersection_types}),Re)};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,u])=>l(s,u)):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}))}}$s.create=(e,t,n)=>new $s({left:e,right:t,typeName:pe.ZodIntersection,...Le(n)});class sr extends Be{_parse(t){const{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==xe.array)return ye(i,{code:he.invalid_type,expected:xe.array,received:i.parsedType}),Re;if(i.data.length<this._def.items.length)return ye(i,{code:he.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Re;!this._def.rest&&i.data.length>this._def.items.length&&(ye(i,{code:he.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((u,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new lr(i,u,i.path,c)):null}).filter(u=>!!u);return i.common.async?Promise.all(s).then(u=>qt.mergeArray(n,u)):qt.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new sr({...this._def,rest:t})}}sr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sr({items:e,typeName:pe.ZodTuple,rest:null,...Le(t)})};class Zs extends Be{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!==xe.object)return ye(i,{code:he.invalid_type,expected:xe.object,received:i.parsedType}),Re;const l=[],s=this._def.keyType,u=this._def.valueType;for(const c in i.data)l.push({key:s._parse(new lr(i,c,i.path,c)),value:u._parse(new lr(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?qt.mergeObjectAsync(n,l):qt.mergeObjectSync(n,l)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof Be?new Zs({keyType:t,valueType:n,typeName:pe.ZodRecord,...Le(i)}):new Zs({keyType:Pn.create(),valueType:t,typeName:pe.ZodRecord,...Le(n)})}}class gc extends Be{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!==xe.map)return ye(i,{code:he.invalid_type,expected:xe.map,received:i.parsedType}),Re;const l=this._def.keyType,s=this._def.valueType,u=[...i.data.entries()].map(([c,d],h)=>({key:l._parse(new lr(i,c,i.path,[h,"key"])),value:s._parse(new lr(i,d,i.path,[h,"value"]))}));if(i.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of u){const h=await d.key,m=await d.value;if(h.status==="aborted"||m.status==="aborted")return Re;(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 u){const h=d.key,m=d.value;if(h.status==="aborted"||m.status==="aborted")return Re;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),c.set(h.value,m.value)}return{status:n.value,value:c}}}}gc.create=(e,t,n)=>new gc({valueType:t,keyType:e,typeName:pe.ZodMap,...Le(n)});class ta extends Be{_parse(t){const{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==xe.set)return ye(i,{code:he.invalid_type,expected:xe.set,received:i.parsedType}),Re;const l=this._def;l.minSize!==null&&i.data.size<l.minSize.value&&(ye(i,{code:he.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&&(ye(i,{code:he.too_big,maximum:l.maxSize.value,type:"set",inclusive:!0,exact:!1,message:l.maxSize.message}),n.dirty());const s=this._def.valueType;function u(d){const h=new Set;for(const m of d){if(m.status==="aborted")return Re;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 lr(i,d,i.path,h)));return i.common.async?Promise.all(c).then(d=>u(d)):u(c)}min(t,n){return new ta({...this._def,minSize:{value:t,message:_e.toString(n)}})}max(t,n){return new ta({...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)}}ta.create=(e,t)=>new ta({valueType:e,minSize:null,maxSize:null,typeName:pe.ZodSet,...Le(t)});class Ja extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.function)return ye(n,{code:he.invalid_type,expected:xe.function,received:n.parsedType}),Re;function i(c,d){return dc({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fc(),nl].filter(h=>!!h),issueData:{code:he.invalid_arguments,argumentsError:d}})}function l(c,d){return dc({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fc(),nl].filter(h=>!!h),issueData:{code:he.invalid_return_type,returnTypeError:d}})}const s={errorMap:n.common.contextualErrorMap},u=n.data;if(this._def.returns instanceof il){const c=this;return Xt(async function(...d){const h=new yn([]),m=await c._def.args.parseAsync(d,s).catch(v=>{throw h.addIssue(i(d,v)),h}),p=await Reflect.apply(u,this,m);return await c._def.returns._def.type.parseAsync(p,s).catch(v=>{throw h.addIssue(l(p,v)),h})})}else{const c=this;return Xt(function(...d){const h=c._def.args.safeParse(d,s);if(!h.success)throw new yn([i(d,h.error)]);const m=Reflect.apply(u,this,h.data),p=c._def.returns.safeParse(m,s);if(!p.success)throw new yn([l(m,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ja({...this._def,args:sr.create(t).rest(Qi.create())})}returns(t){return new Ja({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,i){return new Ja({args:t||sr.create([]).rest(Qi.create()),returns:n||Qi.create(),typeName:pe.ZodFunction,...Le(i)})}}class Ys extends Be{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})}}Ys.create=(e,t)=>new Ys({getter:e,typeName:pe.ZodLazy,...Le(t)});class Fs extends Be{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ye(n,{received:n.data,code:he.invalid_literal,expected:this._def.value}),Re}return{status:"valid",value:t.data}}get value(){return this._def.value}}Fs.create=(e,t)=>new Fs({value:e,typeName:pe.ZodLiteral,...Le(t)});function c_(e,t){return new wi({values:e,typeName:pe.ZodEnum,...Le(t)})}class wi extends Be{constructor(){super(...arguments),As.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),i=this._def.values;return ye(n,{expected:Ze.joinValues(i),received:n.parsedType,code:he.invalid_type}),Re}if(hc(this,As)||l_(this,As,new Set(this._def.values)),!hc(this,As).has(t.data)){const n=this._getOrReturnCtx(t),i=this._def.values;return ye(n,{received:n.data,code:he.invalid_enum_value,options:i}),Re}return Xt(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 wi.create(t,{...this._def,...n})}exclude(t,n=this._def){return wi.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}}As=new WeakMap;wi.create=c_;class Gs extends Be{constructor(){super(...arguments),Ns.set(this,void 0)}_parse(t){const n=Ze.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==xe.string&&i.parsedType!==xe.number){const l=Ze.objectValues(n);return ye(i,{expected:Ze.joinValues(l),received:i.parsedType,code:he.invalid_type}),Re}if(hc(this,Ns)||l_(this,Ns,new Set(Ze.getValidEnumValues(this._def.values))),!hc(this,Ns).has(t.data)){const l=Ze.objectValues(n);return ye(i,{received:i.data,code:he.invalid_enum_value,options:l}),Re}return Xt(t.data)}get enum(){return this._def.values}}Ns=new WeakMap;Gs.create=(e,t)=>new Gs({values:e,typeName:pe.ZodNativeEnum,...Le(t)});class il extends Be{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.promise&&n.common.async===!1)return ye(n,{code:he.invalid_type,expected:xe.promise,received:n.parsedType}),Re;const i=n.parsedType===xe.promise?n.data:Promise.resolve(n.data);return Xt(i.then(l=>this._def.type.parseAsync(l,{path:n.path,errorMap:n.common.contextualErrorMap})))}}il.create=(e,t)=>new il({type:e,typeName:pe.ZodPromise,...Le(t)});class Yn extends Be{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:u=>{ye(i,u),u.fatal?n.abort():n.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),l.type==="preprocess"){const u=l.transform(i.data,s);if(i.common.async)return Promise.resolve(u).then(async c=>{if(n.value==="aborted")return Re;const d=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return d.status==="aborted"?Re:d.status==="dirty"||n.value==="dirty"?Xa(d.value):d});{if(n.value==="aborted")return Re;const c=this._def.schema._parseSync({data:u,path:i.path,parent:i});return c.status==="aborted"?Re:c.status==="dirty"||n.value==="dirty"?Xa(c.value):c}}if(l.type==="refinement"){const u=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"?Re:(c.status==="dirty"&&n.dirty(),u(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"?Re:(c.status==="dirty"&&n.dirty(),u(c.value).then(()=>({status:n.value,value:c.value}))))}if(l.type==="transform")if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Wi(u))return u;const c=l.transform(u.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(u=>Wi(u)?Promise.resolve(l.transform(u.value,s)).then(c=>({status:n.value,value:c})):u);Ze.assertNever(l)}}Yn.create=(e,t,n)=>new Yn({schema:e,typeName:pe.ZodEffects,effect:t,...Le(n)});Yn.createWithPreprocess=(e,t,n)=>new Yn({schema:t,effect:{type:"preprocess",transform:e},typeName:pe.ZodEffects,...Le(n)});class $n extends Be{_parse(t){return this._getType(t)===xe.undefined?Xt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$n.create=(e,t)=>new $n({innerType:e,typeName:pe.ZodOptional,...Le(t)});class Si extends Be{_parse(t){return this._getType(t)===xe.null?Xt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Si.create=(e,t)=>new Si({innerType:e,typeName:pe.ZodNullable,...Le(t)});class Xs extends Be{_parse(t){const{ctx:n}=this._processInputParams(t);let i=n.data;return n.parsedType===xe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Xs.create=(e,t)=>new Xs({innerType:e,typeName:pe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Le(t)});class Qs extends Be{_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 Hs(l)?l.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new yn(i.common.issues)},input:i.data})})):{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new yn(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Qs.create=(e,t)=>new Qs({innerType:e,typeName:pe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Le(t)});class yc extends Be{_parse(t){if(this._getType(t)!==xe.nan){const i=this._getOrReturnCtx(t);return ye(i,{code:he.invalid_type,expected:xe.nan,received:i.parsedType}),Re}return{status:"valid",value:t.data}}}yc.create=e=>new yc({typeName:pe.ZodNaN,...Le(e)});const P2=Symbol("zod_brand");class Np extends Be{_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 fu extends Be{_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"?Re:s.status==="dirty"?(n.dirty(),Xa(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"?Re: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 fu({in:t,out:n,typeName:pe.ZodPipeline})}}class Ks extends Be{_parse(t){const n=this._def.innerType._parse(t),i=l=>(Wi(l)&&(l.value=Object.freeze(l.value)),l);return Hs(n)?n.then(l=>i(l)):i(n)}unwrap(){return this._def.innerType}}Ks.create=(e,t)=>new Ks({innerType:e,typeName:pe.ZodReadonly,...Le(t)});function ox(e,t){const n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function f_(e,t={},n){return e?rl.create().superRefine((i,l)=>{var s,u;const c=e(i);if(c instanceof Promise)return c.then(d=>{var h,m;if(!d){const p=ox(t,i),y=(m=(h=p.fatal)!==null&&h!==void 0?h:n)!==null&&m!==void 0?m:!0;l.addIssue({code:"custom",...p,fatal:y})}});if(!c){const d=ox(t,i),h=(u=(s=d.fatal)!==null&&s!==void 0?s:n)!==null&&u!==void 0?u:!0;l.addIssue({code:"custom",...d,fatal:h})}}):rl.create()}const q2={object:ht.lazycreate};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 V2=(e,t={message:`Input not instance of ${e.name}`})=>f_(n=>n instanceof e,t),d_=Pn.create,h_=bi.create,$2=yc.create,Z2=_i.create,m_=Us.create,Y2=ea.create,F2=mc.create,G2=Ps.create,X2=qs.create,Q2=rl.create,K2=Qi.create,J2=jr.create,W2=pc.create,eC=Vn.create,tC=ht.create,nC=ht.strictCreate,rC=Vs.create,iC=Lc.create,aC=$s.create,lC=sr.create,sC=Zs.create,uC=gc.create,oC=ta.create,cC=Ja.create,fC=Ys.create,dC=Fs.create,hC=wi.create,mC=Gs.create,pC=il.create,cx=Yn.create,gC=$n.create,yC=Si.create,vC=Yn.createWithPreprocess,xC=fu.create,bC=()=>d_().optional(),_C=()=>h_().optional(),wC=()=>m_().optional(),SC={string:e=>Pn.create({...e,coerce:!0}),number:e=>bi.create({...e,coerce:!0}),boolean:e=>Us.create({...e,coerce:!0}),bigint:e=>_i.create({...e,coerce:!0}),date:e=>ea.create({...e,coerce:!0})},EC=Re;var kC=Object.freeze({__proto__:null,defaultErrorMap:nl,setErrorMap:v2,getErrorMap:fc,makeIssue:dc,EMPTY_PATH:x2,addIssueToContext:ye,ParseStatus:qt,INVALID:Re,DIRTY:Xa,OK:Xt,isAborted:tp,isDirty:np,isValid:Wi,isAsync:Hs,get util(){return Ze},get objectUtil(){return ep},ZodParsedType:xe,getParsedType:Rr,ZodType:Be,datetimeRegex:o_,ZodString:Pn,ZodNumber:bi,ZodBigInt:_i,ZodBoolean:Us,ZodDate:ea,ZodSymbol:mc,ZodUndefined:Ps,ZodNull:qs,ZodAny:rl,ZodUnknown:Qi,ZodNever:jr,ZodVoid:pc,ZodArray:Vn,ZodObject:ht,ZodUnion:Vs,ZodDiscriminatedUnion:Lc,ZodIntersection:$s,ZodTuple:sr,ZodRecord:Zs,ZodMap:gc,ZodSet:ta,ZodFunction:Ja,ZodLazy:Ys,ZodLiteral:Fs,ZodEnum:wi,ZodNativeEnum:Gs,ZodPromise:il,ZodEffects:Yn,ZodTransformer:Yn,ZodOptional:$n,ZodNullable:Si,ZodDefault:Xs,ZodCatch:Qs,ZodNaN:yc,BRAND:P2,ZodBranded:Np,ZodPipeline:fu,ZodReadonly:Ks,custom:f_,Schema:Be,ZodSchema:Be,late:q2,get ZodFirstPartyTypeKind(){return pe},coerce:SC,any:Q2,array:eC,bigint:Z2,boolean:m_,date:Y2,discriminatedUnion:iC,effect:cx,enum:hC,function:cC,instanceof:V2,intersection:aC,lazy:fC,literal:dC,map:uC,nan:$2,nativeEnum:mC,never:J2,null:X2,nullable:yC,number:h_,object:tC,oboolean:wC,onumber:_C,optional:gC,ostring:bC,pipeline:xC,preprocess:vC,promise:pC,record:sC,set:oC,strictObject:nC,string:d_,symbol:F2,transformer:cx,tuple:lC,undefined:G2,union:rC,unknown:K2,void:W2,NEVER:EC,ZodIssueCode:he,quotelessJson:y2,ZodError:yn});const TC=Symbol("Let zodToJsonSchema decide on which parser to use"),CC={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"},AC=e=>({...CC,...e}),NC=e=>{const t=AC(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 p_(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,p_(e,t,i,l)}function MC(){return{}}function OC(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 RC(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 zC(){return{type:"boolean"}}function g_(e,t){return Ke(e.type._def,t)}const DC=(e,t)=>Ke(e.innerType._def,t);function y_(e,t,n){const i=n??t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((l,s)=>y_(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 jC(e,t)}}const jC=(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 LC(e,t){return{...Ke(e.innerType._def,t),default:e.defaultValue()}}function IC(e,t){return t.effectStrategy==="input"?Ke(e.schema._def,t):{}}function BC(e){return{type:"string",enum:Array.from(e.values)}}const HC=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function UC(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(HC(s))l.push(...s.allOf),s.unevaluatedProperties===void 0&&(i=void 0);else{let u=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:c,...d}=s;u=d}else i=void 0;l.push(u)}}),l.length?{allOf:l,...i}:void 0}function PC(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 Th;const Ln={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:()=>(Th===void 0&&(Th=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Th),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 v_(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":In(n,"email",i.message,t);break;case"format:idn-email":In(n,"idn-email",i.message,t);break;case"pattern:zod":Ft(n,Ln.email,i.message,t);break}break;case"url":In(n,"uri",i.message,t);break;case"uuid":In(n,"uuid",i.message,t);break;case"regex":Ft(n,i.regex,i.message,t);break;case"cuid":Ft(n,Ln.cuid,i.message,t);break;case"cuid2":Ft(n,Ln.cuid2,i.message,t);break;case"startsWith":Ft(n,RegExp(`^${Ch(i.value,t)}`),i.message,t);break;case"endsWith":Ft(n,RegExp(`${Ch(i.value,t)}$`),i.message,t);break;case"datetime":In(n,"date-time",i.message,t);break;case"date":In(n,"date",i.message,t);break;case"time":In(n,"time",i.message,t);break;case"duration":In(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":{Ft(n,RegExp(Ch(i.value,t)),i.message,t);break}case"ip":{i.version!=="v6"&&In(n,"ipv4",i.message,t),i.version!=="v4"&&In(n,"ipv6",i.message,t);break}case"base64url":Ft(n,Ln.base64url,i.message,t);break;case"jwt":Ft(n,Ln.jwt,i.message,t);break;case"cidr":{i.version!=="v6"&&Ft(n,Ln.ipv4Cidr,i.message,t),i.version!=="v4"&&Ft(n,Ln.ipv6Cidr,i.message,t);break}case"emoji":Ft(n,Ln.emoji(),i.message,t);break;case"ulid":{Ft(n,Ln.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{In(n,"binary",i.message,t);break}case"contentEncoding:base64":{et(n,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{Ft(n,Ln.base64,i.message,t);break}}break}case"nanoid":Ft(n,Ln.nanoid,i.message,t)}return n}function Ch(e,t){return t.patternStrategy==="escape"?VC(e):e}const qC=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function VC(e){let t="";for(let n=0;n<e.length;n++)qC.has(e[n])||(t+="\\"),t+=e[n];return t}function In(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 Ft(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:fx(t,i),...n&&i.errorMessages&&{errorMessage:{pattern:n}}})):et(e,"pattern",fx(t,i),n,i)}function fx(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,u=!1,c=!1;for(let h=0;h<i.length;h++){if(s){l+=i[h],s=!1;continue}if(n.i){if(u){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+=u?`${i[h]}\r
52
+ `:`[${i[h]}\r
53
+ ]`;continue}l+=i[h],i[h]==="\\"?s=!0:u&&i[h]==="]"?u=!1:!u&&i[h]==="["&&(u=!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 x_(e,t){var i,l,s,u,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}=v_(e.keyType._def,t);return{...n,propertyNames:m}}else{if(((u=e.keyType)==null?void 0:u._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}=g_(e.keyType._def,t);return{...n,propertyNames:m}}}return n}function $C(e,t){if(t.mapStrategy==="record")return x_(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 ZC(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 YC(){return{not:{}}}function FC(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const vc={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function GC(e,t){if(t.target==="openApi3")return dx(e,t);const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(i=>i._def.typeName in vc&&(!i._def.checks||!i._def.checks.length))){const i=n.reduce((l,s)=>{const u=vc[s._def.typeName];return u&&!l.includes(u)?[...l,u]: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 u=typeof s._def.value;switch(u){case"string":case"number":case"boolean":return[...l,u];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,u,c)=>c.indexOf(s)===u);return{type:l.length>1?l:l[0],enum:n.reduce((s,u)=>s.includes(u._def.value)?s:[...s,u._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 dx(e,t)}const dx=(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 XC(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:vc[e.innerType._def.typeName],nullable:!0}:{type:[vc[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 QC(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",p_(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 KC(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=WC(d);h&&n&&(d instanceof $n&&(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 u=JC(e,t);return u!==void 0&&(i.additionalProperties=u),i}function JC(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 WC(e){try{return e.isOptional()}catch{return!0}}const eA=(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]}:{}},tA=(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 nA(e,t){return Ke(e.type._def,t)}function rA(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 iA(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 aA(){return{not:{}}}function lA(){return{}}const sA=(e,t)=>Ke(e.innerType._def,t),uA=(e,t,n)=>{switch(t){case pe.ZodString:return v_(e,n);case pe.ZodNumber:return QC(e,n);case pe.ZodObject:return KC(e,n);case pe.ZodBigInt:return RC(e,n);case pe.ZodBoolean:return zC();case pe.ZodDate:return y_(e,n);case pe.ZodUndefined:return aA();case pe.ZodNull:return FC(n);case pe.ZodArray:return OC(e,n);case pe.ZodUnion:case pe.ZodDiscriminatedUnion:return GC(e,n);case pe.ZodIntersection:return UC(e,n);case pe.ZodTuple:return iA(e,n);case pe.ZodRecord:return x_(e,n);case pe.ZodLiteral:return PC(e,n);case pe.ZodEnum:return BC(e);case pe.ZodNativeEnum:return ZC(e);case pe.ZodNullable:return XC(e,n);case pe.ZodOptional:return eA(e,n);case pe.ZodMap:return $C(e,n);case pe.ZodSet:return rA(e,n);case pe.ZodLazy:return()=>e.getter()._def;case pe.ZodPromise:return nA(e,n);case pe.ZodNaN:case pe.ZodNever:return YC();case pe.ZodEffects:return IC(e,n);case pe.ZodAny:return MC();case pe.ZodUnknown:return lA();case pe.ZodDefault:return LC(e,n);case pe.ZodBranded:return g_(e,n);case pe.ZodReadonly:return sA(e,n);case pe.ZodCatch:return DC(e,n);case pe.ZodPipeline:return tA(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!==TC)return d}if(i&&!n){const d=oA(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=uA(e,e.typeName,t),u=typeof s=="function"?Ke(s(),t):s;if(u&&fA(e,t,u),t.postProcess){const d=t.postProcess(u,e,t);return l.jsonSchema=u,d}return l.jsonSchema=u,u}const oA=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:cA(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}},cA=(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("/")},fA=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),dA=(e,t)=>{const n=NC(t),i=void 0,l=t==null?void 0:t.name,s=Ke(e._def,n,!1)??{},u=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"?u.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(u.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in u||"oneOf"in u||"allOf"in u||"type"in u&&Array.isArray(u.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),u},hA=e=>({name:e.name,description:e.description,parameters:dA(kC.object(e.parameters))});class mA{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()}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(){return Array.from(this.tools.values()).map(t=>hA(t))}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 Ah{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 pA extends g2{constructor(t){super(t),this.currentAssistant=null,this.currentThread=null,this.streamingCallbacks=new Set,this.tools=new mA,this.stopController=null,this.availableAssistants=[],this.streamingMessage=[],this.graphMessages=[],this.graphState={}}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(console.log("agentName",t),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))}replaceMessageWithValuesMessage(t,n=!1){const i=n?"tool_call_id":"id",l=this.graphMessages.find(s=>s[i]===t[i]);return l?{...l,tool_input:t.tool_input}:t}get renderMessage(){var l;const t=new Map,n=[],i=[...this.graphMessages,...this.streamingMessage];for(let s=i.length-1;s>=0;s--){const u=this.cloneMessage(i[s]);if(!u.id){n.unshift(u);continue}if(!t.has(u.id))if(Ah.isToolAssistant(u)){const c=this.replaceMessageWithValuesMessage(u);t.set(u.id,c);const h=((l=c.tool_calls)!=null&&l.length?c.tool_calls:c.tool_call_chunks).map((m,p)=>{var y,v,b,_;return this.replaceMessageWithValuesMessage({type:"tool",additional_kwargs:{},tool_input:(_=(b=(v=(y=c.additional_kwargs)==null?void 0:y.tool_calls)==null?void 0:v[p])==null?void 0:b.function)==null?void 0:_.arguments,id:m.id,name:m.name,response_metadata:{},tool_call_id:m.id},!0)});for(const m of h)t.has(m.id)||(n.unshift(m),t.set(m.id,m));n.unshift(c)}else{const c=this.replaceMessageWithValuesMessage(u);t.set(u.id,c),n.unshift(c)}}return this.attachInfoForMessage(this.composeToolMessages(n))}attachInfoForMessage(t){var i,l,s;let n=null;for(const u of t){const c=((i=u.response_metadata)==null?void 0:i.create_time)||"";try{u.unique_id=u.id+JSON.stringify(u.content).length}catch{u.unique_id=u.id}if(u.spend_time=new Date(c).getTime()-new Date(((l=n==null?void 0:n.response_metadata)==null?void 0:l.create_time)||c).getTime(),!u.usage_metadata&&((s=u.response_metadata)!=null&&s.usage)){const d=u.response_metadata.usage;u.usage_metadata={input_tokens:d.prompt_tokens,output_tokens:d.completion_tokens,total_tokens:d.total_tokens}}n=u}return t}composeToolMessages(t){var s;const n=[],i=new Map,l=new Map;for(const u of t)if(!(Ah.isToolAssistant(u)&&((s=u.tool_calls||u.tool_call_chunks)==null||s.forEach(c=>{i.set(c.id,c),l.set(c.id,u)}),!u.content))){if(Ah.isTool(u)&&!u.tool_input){const c=i.get(u.tool_call_id),d=l.get(u.tool_call_id);c&&(u.tool_input=typeof c.args!="string"?JSON.stringify(c.args):c.args,u.additional_kwargs?(u.additional_kwargs.done=!0,u.done=!0):(u.done=!0,u.additional_kwargs={done:!0})),d&&(u.usage_metadata=d.usage_metadata)}n.push(u)}return n}get tokenCounter(){return this.graphMessages.reduce((t,n)=>{var i,l,s,u,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((u=n.response_metadata)!=null&&u.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}],u=(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=[];for await(const h of u)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.streamingMessage.push(m);this.emitStreamingUpdate({type:"message",data:h});continue}else if(h.event.startsWith("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,this.streamingMessage=[];continue}this.streamingMessage=[];const d=await this.runFETool();return d&&c.push(...d),this.emitStreamingUpdate({type:"done",data:{event:"done"}}),c}runFETool(){var i;const t=this.graphMessages,n=t[t.length-1];if(n.type==="ai"&&((i=n.tool_calls)!=null&&i.length)){const l=n.tool_calls.map(s=>{if(this.tools.getTool(s.name)){const u={...s,tool_call_id:s.id,tool_input:JSON.stringify(s.args),additional_kwargs:{}};return this.callFETool(u,s.args)}});return 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.name),this.currentThread=null,this.graphState={},this.graphMessages=[],this.streamingMessage=[],this.currentRun=void 0,this.emitStreamingUpdate({type:"value",data:{event:"messages/partial"}})}}let Bn=[],hi=0;const Zo=4;let An=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=hi+Zo;s<Bn.length;)Bn[s]===i?Bn.splice(s,Zo):s+=Zo;let l=t.indexOf(i);~l&&(t.splice(l,1),--n.lc)}},notify(i,l){let s=!Bn.length;for(let u of t)Bn.push(u,n.value,i,l);if(s){for(hi=0;hi<Bn.length;hi+=Zo)Bn[hi](Bn[hi+1],Bn[hi+2],Bn[hi+3]);Bn.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 gA(e,t,n){let i=new Set(t).add(void 0);return e.listen((l,s,u)=>{i.has(u)&&n(l,s,u)})}function yA(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 vA=e=>e.toLocaleTimeString("en-US"),xA=e=>e.toLocaleString("en"),b_=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),bA=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:""},_A=(e,t,n={})=>{const i=An(null),l=An([]),s=An(""),u=An(!1),c=An([]),d=An(null),h=An(n.showHistory??!1),m=An(e),p=An(null),y=An(n.showGraph??!1),v=An(null),b=async()=>{var R;y.get()&&v.set(await((R=i.get())==null?void 0:R.graphVisualize())||null)},_=yA(R=>{l.set(R.renderMessage)});async function S(){var B;const R=new pA(t);return await R.initAssistant(m.get()),m.set(R.getCurrentAssistant().graph_id),d.set(null),R.onStreamingUpdate(O=>{if(O.type==="thread"||O.type==="done")return M();O.type==="error"&&(u.set(!1),d.set(O.data)),_(R)}),(B=n.onInit)==null||B.call(n,R),R.graphState={},i.set(R),y.get()&&b(),R}const k=async(R,B)=>{var O;!s.get().trim()&&!(R!=null&&R.length)||u.get()||!i.get()||(u.set(!0),d.set(null),await((O=i.get())==null?void 0:O.sendMessage(R||s.get(),B)),s.set(""),u.set(!1))},A=()=>{var R;(R=i.get())==null||R.cancelRun()},E=R=>{const B=c.get();c.set(B.includes(R)?B.filter(O=>O!==R):[...B,R])},N=()=>{h.set(!h.get()),h.get()&&M()},j=An([]),M=async()=>{var R;if(!(!i.get()||!h.get()))try{const B=await((R=i.get())==null?void 0:R.listThreads());j.set(B||[])}catch(B){console.error("Failed to fetch threads:",B)}};return{data:{client:i,renderMessages:l,userInput:s,loading:u,inChatError:d,currentAgent:m,collapsedTools:c,showHistory:h,historyList:j,currentChatId:p,showGraph:y,graphVisualize:v},mutations:{initClient:S,sendMessage:k,stopGeneration:A,toggleToolCollapse:E,toggleHistoryVisible:N,refreshHistoryList:M,addToHistory:R=>{const B=j.get();j.set([R,...B])},setUserInput(R){s.set(R)},setCurrentAgent(R){return m.set(R),S().then(()=>{h.get()&&M(),y.get()&&b()})},toggleGraphVisible(){y.set(!y.get()),y.get()&&b()},refreshGraph:b,createNewChat(){var R;(R=i.get())==null||R.reset(),d.set(null)},toHistoryChat(R){var B,O;(O=i.get())==null||O.resetThread((B=R.metadata)==null?void 0:B.graph_id,R.thread_id)},async deleteHistoryChat(R){var B;await((B=i.get())==null?void 0:B.threads.delete(R.thread_id)),await M()}}}},wA=(e,t)=>({...Object.fromEntries(Object.entries(e.data).map(([i,l])=>[i,t(l)])),...e.mutations});function SA(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const EA=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kA=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TA={};function hx(e,t){return(TA.jsx?kA:EA).test(e)}const CA=/[ \t\n\f\r]/g;function AA(e){return typeof e=="object"?e.type==="text"?mx(e.value):!1:mx(e)}function mx(e){return e.replace(CA,"")===""}class du{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}du.prototype.normal={};du.prototype.property={};du.prototype.space=void 0;function __(e,t){const n={},i={};for(const l of e)Object.assign(n,l.property),Object.assign(i,l.normal);return new du(n,i,t)}function ip(e){return e.toLowerCase()}class ln{constructor(t,n){this.attribute=n,this.property=t}}ln.prototype.attribute="";ln.prototype.booleanish=!1;ln.prototype.boolean=!1;ln.prototype.commaOrSpaceSeparated=!1;ln.prototype.commaSeparated=!1;ln.prototype.defined=!1;ln.prototype.mustUseProperty=!1;ln.prototype.number=!1;ln.prototype.overloadedBoolean=!1;ln.prototype.property="";ln.prototype.spaceSeparated=!1;ln.prototype.space=void 0;let NA=0;const je=aa(),kt=aa(),w_=aa(),me=aa(),ut=aa(),Wa=aa(),pn=aa();function aa(){return 2**++NA}const ap=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:kt,commaOrSpaceSeparated:pn,commaSeparated:Wa,number:me,overloadedBoolean:w_,spaceSeparated:ut},Symbol.toStringTag,{value:"Module"})),Nh=Object.keys(ap);class Mp extends ln{constructor(t,n,i,l){let s=-1;if(super(t,n),px(this,"space",l),typeof i=="number")for(;++s<Nh.length;){const u=Nh[s];px(this,Nh[s],(i&ap[u])===ap[u])}}}Mp.prototype.defined=!0;function px(e,t,n){n&&(e[t]=n)}function hl(e){const t={},n={};for(const[i,l]of Object.entries(e.properties)){const s=new Mp(i,e.transform(e.attributes||{},i),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[ip(i)]=i,n[ip(s.attribute)]=i}return new du(t,n,e.space)}const S_=hl({properties:{ariaActiveDescendant:null,ariaAtomic:kt,ariaAutoComplete:null,ariaBusy:kt,ariaChecked:kt,ariaColCount:me,ariaColIndex:me,ariaColSpan:me,ariaControls:ut,ariaCurrent:null,ariaDescribedBy:ut,ariaDetails:null,ariaDisabled:kt,ariaDropEffect:ut,ariaErrorMessage:null,ariaExpanded:kt,ariaFlowTo:ut,ariaGrabbed:kt,ariaHasPopup:null,ariaHidden:kt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ut,ariaLevel:me,ariaLive:null,ariaModal:kt,ariaMultiLine:kt,ariaMultiSelectable:kt,ariaOrientation:null,ariaOwns:ut,ariaPlaceholder:null,ariaPosInSet:me,ariaPressed:kt,ariaReadOnly:kt,ariaRelevant:null,ariaRequired:kt,ariaRoleDescription:ut,ariaRowCount:me,ariaRowIndex:me,ariaRowSpan:me,ariaSelected:kt,ariaSetSize:me,ariaSort:null,ariaValueMax:me,ariaValueMin:me,ariaValueNow:me,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function E_(e,t){return t in e?e[t]:t}function k_(e,t){return E_(e,t.toLowerCase())}const MA=hl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wa,acceptCharset:ut,accessKey:ut,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:ut,autoFocus:je,autoPlay:je,blocking:ut,capture:null,charSet:null,checked:je,cite:null,className:ut,cols:me,colSpan:null,content:null,contentEditable:kt,controls:je,controlsList:ut,coords:me|Wa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:w_,draggable:kt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:ut,height:me,hidden:je,high:me,href:null,hrefLang:null,htmlFor:ut,httpEquiv:ut,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:ut,itemRef:ut,itemScope:je,itemType:ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:me,manifest:null,max:null,maxLength:me,media:null,method:null,min:null,minLength:me,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,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:je,optimum:me,pattern:null,ping:ut,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:ut,required:je,reversed:je,rows:me,rowSpan:me,sandbox:ut,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootDelegatesFocus:je,shadowRootMode:null,shape:null,size:me,sizes:null,slot:null,span:me,spellCheck:kt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:me,step:null,style:null,tabIndex:me,target:null,title:null,translate:null,type:null,typeMustMatch:je,useMap:null,value:kt,width:me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ut,axis:null,background:null,bgColor:null,border:me,borderColor:null,bottomMargin:me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:me,leftMargin:me,link:null,longDesc:null,lowSrc:null,marginHeight:me,marginWidth:me,noResize:je,noHref:je,noShade:je,noWrap:je,object:null,profile:null,prompt:null,rev:null,rightMargin:me,rules:null,scheme:null,scrolling:kt,standby:null,summary:null,text:null,topMargin:me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:je,disableRemotePlayback:je,prefix:null,property:null,results:me,security:null,unselectable:null},space:"html",transform:k_}),OA=hl({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:pn,accentHeight:me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:me,amplitude:me,arabicForm:null,ascent:me,attributeName:null,attributeType:null,azimuth:me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:me,by:null,calcMode:null,capHeight:me,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:me,diffuseConstant:me,direction:null,display:null,dur:null,divisor:me,dominantBaseline:null,download:je,dx:null,dy:null,edgeMode:null,editable:null,elevation:me,enableBackground:null,end:null,event:null,exponent:me,externalResourcesRequired:null,fill:null,fillOpacity:me,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:Wa,g2:Wa,glyphName:Wa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:me,horizOriginX:me,horizOriginY:me,id:null,ideographic:me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:me,k:me,k1:me,k2:me,k3:me,k4:me,kernelMatrix:pn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:me,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:me,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:me,overlineThickness:me,paintOrder:null,panose1:null,path:null,pathLength:me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:me,pointsAtY:me,pointsAtZ:me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pn,rev:pn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pn,requiredFeatures:pn,requiredFonts:pn,requiredFormats:pn,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:me,specularExponent:me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:me,strikethroughThickness:me,string:null,stroke:null,strokeDashArray:pn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:me,strokeOpacity:me,strokeWidth:null,style:null,surfaceScale:me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pn,tabIndex:me,tableValues:null,target:null,targetX:me,targetY:me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:me,underlineThickness:me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:me,values:null,vAlphabetic:me,vMathematical:me,vectorEffect:null,vHanging:me,vIdeographic:me,version:null,vertAdvY:me,vertOriginX:me,vertOriginY:me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:E_}),T_=hl({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()}}),C_=hl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:k_}),A_=hl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),RA={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"},zA=/[A-Z]/g,gx=/-[a-z]/g,DA=/^data[-\w.:]+$/i;function jA(e,t){const n=ip(t);let i=t,l=ln;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&DA.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(gx,IA);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!gx.test(s)){let u=s.replace(zA,LA);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=Mp}return new l(i,t)}function LA(e){return"-"+e.toLowerCase()}function IA(e){return e.charAt(1).toUpperCase()}const BA=__([S_,MA,T_,C_,A_],"html"),Op=__([S_,OA,T_,C_,A_],"svg");function HA(e){return e.join(" ").trim()}var $a={},Mh,yx;function UA(){if(yx)return Mh;yx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
54
+ `,h="/",m="*",p="",y="comment",v="declaration";Mh=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 z=F.match(t);z&&(k+=z.length);var $=F.lastIndexOf(d);A=~$?F.length-$:A+F.length}function N(){var F={line:k,column:A};return function(z){return z.position=new j(F),R(),z}}function j(F){this.start=F,this.end={line:k,column:A},this.source=S.source}j.prototype.content=_;function M(F){var z=new Error(S.source+":"+k+":"+A+": "+F);if(z.reason=F,z.filename=S.source,z.line=k,z.column=A,z.source=_,!S.silent)throw z}function U(F){var z=F.exec(_);if(z){var $=z[0];return E($),_=_.slice($.length),z}}function R(){U(n)}function B(F){var z;for(F=F||[];z=O();)z!==!1&&F.push(z);return F}function O(){var F=N();if(!(h!=_.charAt(0)||m!=_.charAt(1))){for(var z=2;p!=_.charAt(z)&&(m!=_.charAt(z)||h!=_.charAt(z+1));)++z;if(z+=2,p===_.charAt(z-1))return M("End of comment missing");var $=_.slice(2,z-2);return A+=2,E($),_=_.slice(z),A+=2,F({type:y,comment:$})}}function H(){var F=N(),z=U(i);if(z){if(O(),!U(l))return M("property missing ':'");var $=U(s),L=F({type:v,property:b(z[0].replace(e,p)),value:$?b($[0].replace(e,p)):p});return U(u),L}}function P(){var F=[];B(F);for(var z;z=H();)z!==!1&&(F.push(z),B(F));return F}return R(),P()};function b(_){return _?_.replace(c,p):p}return Mh}var vx;function PA(){if(vx)return $a;vx=1;var e=$a&&$a.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty($a,"__esModule",{value:!0}),$a.default=n;var t=e(UA());function n(i,l){var s=null;if(!i||typeof i!="string")return s;var u=(0,t.default)(i),c=typeof l=="function";return u.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 $a}var _s={},xx;function qA(){if(xx)return _s;xx=1,Object.defineProperty(_s,"__esModule",{value:!0}),_s.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)},u=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,u))};return _s.camelCase=d,_s}var ws,bx;function VA(){if(bx)return ws;bx=1;var e=ws&&ws.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(PA()),n=qA();function i(l,s){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(c,d){c&&d&&(u[(0,n.camelCase)(c,s)]=d)}),u}return i.default=i,ws=i,ws}var $A=VA();const ZA=Ei($A),N_=M_("end"),Rp=M_("start");function M_(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 YA(e){const t=Rp(e),n=N_(e);if(t&&n)return{start:t,end:n}}function Rs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_x(e.position):"start"in e||"end"in e?_x(e):"line"in e||"column"in e?lp(e):""}function lp(e){return wx(e&&e.line)+":"+wx(e&&e.column)}function _x(e){return lp(e&&e.start)+"-"+lp(e&&e.end)}function wx(e){return e&&typeof e=="number"?e:1}class Vt extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let l="",s={},u=!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&&(u=!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=Rs(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=u&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}Vt.prototype.file="";Vt.prototype.name="";Vt.prototype.reason="";Vt.prototype.message="";Vt.prototype.stack="";Vt.prototype.column=void 0;Vt.prototype.line=void 0;Vt.prototype.ancestors=void 0;Vt.prototype.cause=void 0;Vt.prototype.fatal=void 0;Vt.prototype.place=void 0;Vt.prototype.ruleId=void 0;Vt.prototype.source=void 0;const zp={}.hasOwnProperty,FA=new Map,GA=/[A-Z]/g,XA=new Set(["table","tbody","thead","tfoot","tr"]),QA=new Set(["td","th"]),O_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function KA(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=aN(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=iN(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"?Op:BA,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=R_(l,e,void 0);return s&&typeof s!="string"?s:l.create(e,l.Fragment,{children:s||void 0},void 0)}function R_(e,t,n){if(t.type==="element")return JA(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return WA(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return tN(e,t,n);if(t.type==="mdxjsEsm")return eN(e,t);if(t.type==="root")return nN(e,t,n);if(t.type==="text")return rN(e,t)}function JA(e,t,n){const i=e.schema;let l=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(l=Op,e.schema=l),e.ancestors.push(t);const s=D_(e,t.tagName,!1),u=lN(e,t);let c=jp(e,t);return XA.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!AA(d):!0})),z_(e,u,s,t),Dp(u,c),e.ancestors.pop(),e.schema=i,e.create(t,s,u,n)}function WA(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)}Js(e,t.position)}function eN(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Js(e,t.position)}function tN(e,t,n){const i=e.schema;let l=i;t.name==="svg"&&i.space==="html"&&(l=Op,e.schema=l),e.ancestors.push(t);const s=t.name===null?e.Fragment:D_(e,t.name,!0),u=sN(e,t),c=jp(e,t);return z_(e,u,s,t),Dp(u,c),e.ancestors.pop(),e.schema=i,e.create(t,s,u,n)}function nN(e,t,n){const i={};return Dp(i,jp(e,t)),e.create(t,e.Fragment,i,n)}function rN(e,t){return t.value}function z_(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Dp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function iN(e,t,n){return i;function i(l,s,u,c){const h=Array.isArray(u.children)?n:t;return c?h(s,u,c):h(s,u)}}function aN(e,t){return n;function n(i,l,s,u){const c=Array.isArray(s.children),d=Rp(i);return t(l,s,u,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function lN(e,t){const n={};let i,l;for(l in t.properties)if(l!=="children"&&zp.call(t.properties,l)){const s=uN(e,l,t.properties[l]);if(s){const[u,c]=s;e.tableCellAlignToStyle&&u==="align"&&typeof c=="string"&&QA.has(t.tagName)?i=c:n[u]=c}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function sN(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 u=s.expression;u.type;const c=u.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Js(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 Js(e,t.position);else s=i.value===null?!0:i.value;n[l]=s}return n}function jp(e,t){const n=[];let i=-1;const l=e.passKeys?new Map:FA;for(;++i<t.children.length;){const s=t.children[i];let u;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;u=d+"-"+h,l.set(d,h+1)}}const c=R_(e,s,u);c!==void 0&&n.push(c)}return n}function uN(e,t,n){const i=jA(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?SA(n):HA(n)),i.property==="style"){let l=typeof n=="object"?n:oN(e,String(n));return e.stylePropertyNameCase==="css"&&(l=cN(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&i.space?RA[i.property]||i.property:i.attribute,n]}}function oN(e,t){try{return ZA(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,l=new Vt("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=O_+"#cannot-parse-style-attribute",l}}function D_(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let s=-1,u;for(;++s<l.length;){const c=hx(l[s])?{type:"Identifier",name:l[s]}:{type:"Literal",value:l[s]};u=u?{type:"MemberExpression",object:u,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}i=u}else i=hx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const l=i.value;return zp.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(i);Js(e)}function Js(e,t){const n=new Vt("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=O_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function cN(e){const t={};let n;for(n in e)zp.call(e,n)&&(t[fN(n)]=e[n]);return t}function fN(e){let t=e.replace(GA,dN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function dN(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"]},hN={};function Lp(e,t){const n=hN,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return j_(e,i,l)}function j_(e,t,n){if(mN(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 Sx(e.children,t,n)}return Array.isArray(e)?Sx(e,t,n):""}function Sx(e,t,n){const i=[];let l=-1;for(;++l<e.length;)i[l]=j_(e[l],t,n);return i.join("")}function mN(e){return!!(e&&typeof e=="object")}const Ex=document.createElement("i");function Ip(e){const t="&"+e+";";Ex.innerHTML=t;const n=Ex.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function vn(e,t,n,i){const l=e.length;let s=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,i.length<1e4)u=Array.from(i),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);s<i.length;)u=i.slice(s,s+1e4),u.unshift(t,0),e.splice(...u),s+=1e4,t+=1e4}function Nn(e,t){return e.length>0?(vn(e,e.length,0,t),e):t}const kx={}.hasOwnProperty;function L_(e){const t={};let n=-1;for(;++n<e.length;)pN(t,e[n]);return t}function pN(e,t){let n;for(n in t){const l=(kx.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let u;if(s)for(u in s){kx.call(l,u)||(l[u]=[]);const c=s[u];gN(l[u],Array.isArray(c)?c:c?[c]:[])}}}function gN(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);vn(e,0,0,i)}function I_(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 Zn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Gt=ki(/[A-Za-z]/),Pt=ki(/[\dA-Za-z]/),yN=ki(/[#-'*+\--9=?A-Z^-~]/);function xc(e){return e!==null&&(e<32||e===127)}const sp=ki(/\d/),vN=ki(/[\dA-Fa-f]/),xN=ki(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function at(e){return e!==null&&(e<0||e===32)}function Ve(e){return e===-2||e===-1||e===32}const Ic=ki(new RegExp("\\p{P}|\\p{S}","u")),na=ki(/\s/);function ki(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ml(e){const t=[];let n=-1,i=0,l=0;for(;++n<e.length;){const s=e.charCodeAt(n);let u="";if(s===37&&Pt(e.charCodeAt(n+1))&&Pt(e.charCodeAt(n+2)))l=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(u=String.fromCharCode(s));else if(s>55295&&s<57344){const c=e.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(u=String.fromCharCode(s,c),l=1):u="�"}else u=String.fromCharCode(s);u&&(t.push(e.slice(i,n),encodeURIComponent(u)),i=n+l+1,u=""),l&&(n+=l,l=0)}return t.join("")+e.slice(i)}function Ye(e,t,n,i){const l=i?i-1:Number.POSITIVE_INFINITY;let s=0;return u;function u(d){return Ve(d)?(e.enter(n),c(d)):t(d)}function c(d){return Ve(d)&&s++<l?(e.consume(d),c):(e.exit(n),t(d))}}const bN={tokenize:_N};function _N(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"),Ye(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,u(c)}function u(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),u)}}const wN={tokenize:SN},Tx={tokenize:EN};function SN(e){const t=this,n=[];let i=0,l,s,u;return c;function c(E){if(i<n.length){const N=n[i];return t.containerState=N[1],e.attempt(N[0].continuation,d,h)(E)}return h(E)}function d(E){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&A();const N=t.events.length;let j=N,M;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){M=t.events[j][1].end;break}k(i);let U=N;for(;U<t.events.length;)t.events[U][1].end={...M},U++;return vn(t.events,j+1,0,t.events.slice(N)),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(Tx,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,u=t.now().offset,b(E)}function y(E){return t.containerState={},e.attempt(Tx,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,N){const j=t.sliceStream(E);if(N&&j.push(null),E.previous=s,s&&(s.next=E),s=E,l.defineSkip(E.start),l.write(j),t.parser.lazy[E.start.line]){let M=l.events.length;for(;M--;)if(l.events[M][1].start.offset<u&&(!l.events[M][1].end||l.events[M][1].end.offset>u))return;const U=t.events.length;let R=U,B,O;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(B){O=t.events[R][1].end;break}B=!0}for(k(i),M=U;M<t.events.length;)t.events[M][1].end={...O},M++;vn(t.events,R+1,0,t.events.slice(U)),t.events.length=M}}function k(E){let N=n.length;for(;N-- >E;){const j=n[N];t.containerState=j[1],j[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 EN(e,t,n){return Ye(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function al(e){if(e===null||at(e)||na(e))return 1;if(Ic(e))return 2}function Bc(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 up={name:"attention",resolveAll:kN,tokenize:TN};function kN(e,t){let n=-1,i,l,s,u,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};Cx(p,-d),Cx(y,d),u={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:{...u.start},end:{...c.end}},e[i][1].end={...u.start},e[n][1].start={...c.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=Nn(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=Nn(h,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",s,t]]),h=Nn(h,Bc(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=Nn(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=Nn(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,vn(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 TN(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,l=al(i);let s;return u;function u(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=al(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 Cx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const CN={name:"autolink",tokenize:AN};function AN(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 Gt(v)?(e.consume(v),u):v===64?n(v):h(v)}function u(v){return v===43||v===45||v===46||Pt(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||Pt(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||xc(v)?n(v):(e.consume(v),d)}function h(v){return v===64?(e.consume(v),m):yN(v)?(e.consume(v),h):n(v)}function m(v){return Pt(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||Pt(v))&&i++<63){const b=v===45?y:p;return e.consume(v),b}return n(v)}}const hu={partial:!0,tokenize:NN};function NN(e,t,n){return i;function i(s){return Ve(s)?Ye(e,l,"linePrefix")(s):l(s)}function l(s){return s===null||Ce(s)?t(s):n(s)}}const B_={continuation:{tokenize:ON},exit:RN,name:"blockQuote",tokenize:MN};function MN(e,t,n){const i=this;return l;function l(u){if(u===62){const c=i.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),s}return n(u)}function s(u){return Ve(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function ON(e,t,n){const i=this;return l;function l(u){return Ve(u)?Ye(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):s(u)}function s(u){return e.attempt(B_,t,n)(u)}}function RN(e){e.exit("blockQuote")}const H_={name:"characterEscape",tokenize:zN};function zN(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 xN(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const U_={name:"characterReference",tokenize:DN};function DN(e,t,n){const i=this;let l=0,s,u;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,u=Pt,m(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,u=vN,m):(e.enter("characterReferenceValue"),s=7,u=sp,m(p))}function m(p){if(p===59&&l){const y=e.exit("characterReferenceValue");return u===Pt&&!Ip(i.sliceSerialize(y))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(p)&&l++<s?(e.consume(p),m):n(p)}}const Ax={partial:!0,tokenize:LN},Nx={concrete:!0,name:"codeFenced",tokenize:jN};function jN(e,t,n){const i=this,l={partial:!0,tokenize:j};let s=0,u=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?(u++,e.consume(M),m):u<3?n(M):(e.exit("codeFencedFenceSequence"),Ve(M)?Ye(e,p,"whitespace")(M):p(M))}function p(M){return M===null||Ce(M)?(e.exit("codeFencedFence"),i.interrupt?t(M):e.check(Ax,_,N)(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)):Ve(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ye(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,N,S)(M)}function S(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),k}function k(M){return s>0&&Ve(M)?Ye(e,A,"linePrefix",s+1)(M):A(M)}function A(M){return M===null||Ce(M)?e.check(Ax,_,N)(M):(e.enter("codeFlowValue"),E(M))}function E(M){return M===null||Ce(M)?(e.exit("codeFlowValue"),A(M)):(e.consume(M),E)}function N(M){return e.exit("codeFenced"),t(M)}function j(M,U,R){let B=0;return O;function O($){return M.enter("lineEnding"),M.consume($),M.exit("lineEnding"),H}function H($){return M.enter("codeFencedFence"),Ve($)?Ye(M,P,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):P($)}function P($){return $===c?(M.enter("codeFencedFenceSequence"),F($)):R($)}function F($){return $===c?(B++,M.consume($),F):B>=u?(M.exit("codeFencedFenceSequence"),Ve($)?Ye(M,z,"whitespace")($):z($)):R($)}function z($){return $===null||Ce($)?(M.exit("codeFencedFence"),U($)):R($)}}}function LN(e,t,n){const i=this;return l;function l(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s)}function s(u){return i.parser.lazy[i.now().line]?n(u):t(u)}}const Rh={name:"codeIndented",tokenize:BN},IN={partial:!0,tokenize:HN};function BN(e,t,n){const i=this;return l;function l(h){return e.enter("codeIndented"),Ye(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?u(h):n(h)}function u(h){return h===null?d(h):Ce(h)?e.attempt(IN,u,d)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||Ce(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),c)}function d(h){return e.exit("codeIndented"),t(h)}}function HN(e,t,n){const i=this;return l;function l(u){return i.parser.lazy[i.now().line]?n(u):Ce(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):Ye(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(u):Ce(u)?l(u):n(u)}}const UN={name:"codeText",previous:qN,resolve:PN,tokenize:VN};function PN(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 qN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function VN(e,t,n){let i=0,l,s;return u;function u(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 $N{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&&Ss(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),Ss(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ss(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);Ss(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ss(this.left,n.reverse())}}}function Ss(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 P_(e){const t={};let n=-1,i,l,s,u,c,d,h;const m=new $N(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,ZN(m,n)),n=t[n],h=!0);else if(i[1]._container){for(s=n,l=void 0;s--;)if(u=m.get(s),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(m.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=s);else if(!(u[1].type==="linePrefix"||u[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 vn(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function ZN(e,t){const n=e.get(t)[1],i=e.get(t)[2];let l=t-1;const s=[];let u=n._tokenizer;u||(u=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const c=u.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&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(m),v._isInFirstContentOfListItem&&(u._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(u.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 YN={resolve:GN,tokenize:XN},FN={partial:!0,tokenize:QN};function GN(e){return P_(e),e}function XN(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(FN,u,s)(c):(e.consume(c),l)}function s(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function u(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function QN(e,t,n){const i=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ye(e,s,"linePrefix")}function s(u){if(u===null||Ce(u))return n(u);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(u):e.interrupt(i.parser.constructs.flow,n,t)(u)}}function q_(e,t,n,i,l,s,u,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||xc(k)?n(k):(e.enter(i),e.enter(u),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(u),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||xc(k)?n(k):(e.consume(k),k===92?S:_)}function S(k){return k===40||k===41||k===92?(e.consume(k),_):_(k)}}function V_(e,t,n,i,l,s){const u=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 u.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=!Ve(v)),v===92?y:p)}function y(v){return v===91||v===92||v===93?(e.consume(v),c++,p):p(v)}}function $_(e,t,n,i,l,s){let u;return c;function c(y){return y===34||y===39||y===40?(e.enter(i),e.enter(l),e.consume(y),e.exit(l),u=y===40?41:y,d):n(y)}function d(y){return y===u?(e.enter(l),e.consume(y),e.exit(l),e.exit(i),t):(e.enter(s),h(y))}function h(y){return y===u?(e.exit(s),d(u)):y===null?n(y):Ce(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Ye(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===u||y===null||Ce(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?p:m)}function p(y){return y===u||y===92?(e.consume(y),m):m(y)}}function zs(e,t){let n;return i;function i(l){return Ce(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,i):Ve(l)?Ye(e,i,n?"linePrefix":"lineSuffix")(l):t(l)}}const KN={name:"definition",tokenize:WN},JN={partial:!0,tokenize:eM};function WN(e,t,n){const i=this;let l;return s;function s(v){return e.enter("definition"),u(v)}function u(v){return V_.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return l=Zn(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)?zs(e,h)(v):h(v)}function h(v){return q_(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return e.attempt(JN,p,p)(v)}function p(v){return Ve(v)?Ye(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 eM(e,t,n){return i;function i(c){return at(c)?zs(e,l)(c):n(c)}function l(c){return $_(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return Ve(c)?Ye(e,u,"whitespace")(c):u(c)}function u(c){return c===null||Ce(c)?t(c):n(c)}}const tM={name:"hardBreakEscape",tokenize:nM};function nM(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 rM={name:"headingAtx",resolve:iM,tokenize:aM};function iM(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"},vn(e,i,n-i+1,[["enter",l,t],["enter",s,t],["exit",s,t],["exit",l,t]])),e}function aM(e,t,n){let i=0;return l;function l(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),u(m)}function u(m){return m===35&&i++<6?(e.consume(m),u):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)):Ve(m)?Ye(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 lM=["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"],Mx=["pre","script","style","textarea"],sM={concrete:!0,name:"htmlFlow",resolveTo:cM,tokenize:fM},uM={partial:!0,tokenize:hM},oM={partial:!0,tokenize:dM};function cM(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 fM(e,t,n){const i=this;let l,s,u,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):Gt(C)?(e.consume(C),u=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):Gt(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:P:b):n(C)}function _(C){return Gt(C)?(e.consume(C),u=String.fromCharCode(C),S):n(C)}function S(C){if(C===null||C===47||C===62||at(C)){const Y=C===47,Q=u.toLowerCase();return!Y&&!s&&Mx.includes(Q)?(l=1,i.interrupt?t(C):P(C)):lM.includes(u.toLowerCase())?(l=6,Y?(e.consume(C),k):i.interrupt?t(C):P(C)):(l=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(C):s?A(C):E(C))}return C===45||Pt(C)?(e.consume(C),u+=String.fromCharCode(C),S):n(C)}function k(C){return C===62?(e.consume(C),i.interrupt?t:P):n(C)}function A(C){return Ve(C)?(e.consume(C),A):O(C)}function E(C){return C===47?(e.consume(C),O):C===58||C===95||Gt(C)?(e.consume(C),N):Ve(C)?(e.consume(C),E):O(C)}function N(C){return C===45||C===46||C===58||C===95||Pt(C)?(e.consume(C),N):j(C)}function j(C){return C===61?(e.consume(C),M):Ve(C)?(e.consume(C),j):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):Ve(C)?(e.consume(C),M):R(C)}function U(C){return C===d?(e.consume(C),d=null,B):C===null||Ce(C)?n(C):(e.consume(C),U)}function R(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||at(C)?j(C):(e.consume(C),R)}function B(C){return C===47||C===62||Ve(C)?E(C):n(C)}function O(C){return C===62?(e.consume(C),H):n(C)}function H(C){return C===null||Ce(C)?P(C):Ve(C)?(e.consume(C),H):n(C)}function P(C){return C===45&&l===2?(e.consume(C),L):C===60&&l===1?(e.consume(C),q):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(uM,te,F)(C)):C===null||Ce(C)?(e.exit("htmlFlowData"),F(C)):(e.consume(C),P)}function F(C){return e.check(oM,z,te)(C)}function z(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),$}function $(C){return C===null||Ce(C)?F(C):(e.enter("htmlFlowData"),P(C))}function L(C){return C===45?(e.consume(C),w):P(C)}function q(C){return C===47?(e.consume(C),u="",K):P(C)}function K(C){if(C===62){const Y=u.toLowerCase();return Mx.includes(Y)?(e.consume(C),Z):P(C)}return Gt(C)&&u.length<8?(e.consume(C),u+=String.fromCharCode(C),K):P(C)}function X(C){return C===93?(e.consume(C),w):P(C)}function w(C){return C===62?(e.consume(C),Z):C===45&&l===2?(e.consume(C),w):P(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 dM(e,t,n){const i=this;return l;function l(u){return Ce(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):n(u)}function s(u){return i.parser.lazy[i.now().line]?n(u):t(u)}}function hM(e,t,n){return i;function i(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(hu,t,n)}}const mM={name:"htmlText",tokenize:pM};function pM(e,t,n){const i=this;let l,s,u;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),j):w===63?(e.consume(w),E):Gt(w)?(e.consume(w),R):n(w)}function h(w){return w===45?(e.consume(w),m):w===91?(e.consume(w),s=0,b):Gt(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)?(u=p,q(w)):(e.consume(w),p)}function y(w){return w===45?(e.consume(w),v):p(w)}function v(w){return w===62?L(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)?(u=_,q(w)):(e.consume(w),_)}function S(w){return w===93?(e.consume(w),k):_(w)}function k(w){return w===62?L(w):w===93?(e.consume(w),k):_(w)}function A(w){return w===null||w===62?L(w):Ce(w)?(u=A,q(w)):(e.consume(w),A)}function E(w){return w===null?n(w):w===63?(e.consume(w),N):Ce(w)?(u=E,q(w)):(e.consume(w),E)}function N(w){return w===62?L(w):E(w)}function j(w){return Gt(w)?(e.consume(w),M):n(w)}function M(w){return w===45||Pt(w)?(e.consume(w),M):U(w)}function U(w){return Ce(w)?(u=U,q(w)):Ve(w)?(e.consume(w),U):L(w)}function R(w){return w===45||Pt(w)?(e.consume(w),R):w===47||w===62||at(w)?B(w):n(w)}function B(w){return w===47?(e.consume(w),L):w===58||w===95||Gt(w)?(e.consume(w),O):Ce(w)?(u=B,q(w)):Ve(w)?(e.consume(w),B):L(w)}function O(w){return w===45||w===46||w===58||w===95||Pt(w)?(e.consume(w),O):H(w)}function H(w){return w===61?(e.consume(w),P):Ce(w)?(u=H,q(w)):Ve(w)?(e.consume(w),H):B(w)}function P(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)?(u=P,q(w)):Ve(w)?(e.consume(w),P):(e.consume(w),z)}function F(w){return w===l?(e.consume(w),l=void 0,$):w===null?n(w):Ce(w)?(u=F,q(w)):(e.consume(w),F)}function z(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||at(w)?B(w):(e.consume(w),z)}function $(w){return w===47||w===62||at(w)?B(w):n(w)}function L(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function q(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),K}function K(w){return Ve(w)?Ye(e,X,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):X(w)}function X(w){return e.enter("htmlTextData"),u(w)}}const Bp={name:"labelEnd",resolveAll:xM,resolveTo:bM,tokenize:_M},gM={tokenize:wM},yM={tokenize:SM},vM={tokenize:EM};function xM(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&&vn(e,0,e.length,n),e}function bM(e,t){let n=e.length,i=0,l,s,u,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(u){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"&&(u=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[u][1].end}},m={type:"labelText",start:{...e[s+i+2][1].end},end:{...e[u-2][1].start}};return c=[["enter",d,t],["enter",h,t]],c=Nn(c,e.slice(s+1,s+i+3)),c=Nn(c,[["enter",m,t]]),c=Nn(c,Bc(t.parser.constructs.insideSpan.null,e.slice(s+i+4,u-3),t)),c=Nn(c,[["exit",m,t],e[u-2],e[u-1],["exit",h,t]]),c=Nn(c,e.slice(u+1)),c=Nn(c,[["exit",d,t]]),vn(e,s,e.length,c),e}function _M(e,t,n){const i=this;let l=i.events.length,s,u;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):(u=i.parser.defined.includes(Zn(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(gM,m,u?m:p)(y):y===91?e.attempt(yM,m,u?h:p)(y):u?m(y):p(y)}function h(y){return e.attempt(vM,m,p)(y)}function m(y){return t(y)}function p(y){return s._balanced=!0,n(y)}}function wM(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)?zs(e,s)(p):s(p)}function s(p){return p===41?m(p):q_(e,u,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function u(p){return at(p)?zs(e,d)(p):m(p)}function c(p){return n(p)}function d(p){return p===34||p===39||p===40?$_(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return at(p)?zs(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 SM(e,t,n){const i=this;return l;function l(c){return V_.call(i,e,s,u,"reference","referenceMarker","referenceString")(c)}function s(c){return i.parser.defined.includes(Zn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function u(c){return n(c)}}function EM(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 kM={name:"labelStartImage",resolveAll:Bp.resolveAll,tokenize:TM};function TM(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"),u):n(c)}function u(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):t(c)}}const CM={name:"labelStartLink",resolveAll:Bp.resolveAll,tokenize:AM};function AM(e,t,n){const i=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),s}function s(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):t(u)}}const zh={name:"lineEnding",tokenize:NM};function NM(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Ye(e,t,"linePrefix")}}const lc={name:"thematicBreak",tokenize:MM};function MM(e,t,n){let i=0,l;return s;function s(h){return e.enter("thematicBreak"),u(h)}function u(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"),Ve(h)?Ye(e,c,"whitespace")(h):c(h))}}const rn={continuation:{tokenize:DM},exit:LM,name:"list",tokenize:zM},OM={partial:!0,tokenize:IM},RM={partial:!0,tokenize:jM};function zM(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,u=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:sp(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(lc,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 sp(v)&&++u<10?(e.consume(v),d):(!i.interrupt||u<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(hu,i.interrupt?n:m,e.attempt(OM,y,p))}function m(v){return i.containerState.initialBlankLine=!0,s++,y(v)}function p(v){return Ve(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 DM(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(hu,l,s);function l(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Ye(e,t,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!Ve(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,u(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(RM,t,u)(c))}function u(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Ye(e,e.attempt(rn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function jM(e,t,n){const i=this;return Ye(e,l,"listItemIndent",i.containerState.size+1);function l(s){const u=i.events[i.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===i.containerState.size?t(s):n(s)}}function LM(e){e.exit(this.containerState.type)}function IM(e,t,n){const i=this;return Ye(e,l,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(s){const u=i.events[i.events.length-1];return!Ve(s)&&u&&u[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Ox={name:"setextUnderline",resolveTo:BM,tokenize:HM};function BM(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 u={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",u,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=u,e.push(["exit",u,t]),e}function HM(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,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===l?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Ve(h)?Ye(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Ce(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const UM={tokenize:PM};function PM(e){const t=this,n=e.attempt(hu,i,e.attempt(this.parser.constructs.flowInitial,l,Ye(e,e.attempt(this.parser.constructs.flow,l,e.attempt(YN,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 qM={resolveAll:Y_()},VM=Z_("string"),$M=Z_("text");function Z_(e){return{resolveAll:Y_(e==="text"?ZM:void 0),tokenize:t};function t(n){const i=this,l=this.parser.constructs[e],s=n.attempt(l,u,c);return u;function u(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 Y_(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 ZM(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,u=-1,c=0,d;for(;s--;){const h=l[s];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)c++,u--;if(u)break;u=-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?u:i.start._bufferIndex+u,_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 YM={42:rn,43:rn,45:rn,48:rn,49:rn,50:rn,51:rn,52:rn,53:rn,54:rn,55:rn,56:rn,57:rn,62:B_},FM={91:KN},GM={[-2]:Rh,[-1]:Rh,32:Rh},XM={35:rM,42:lc,45:[Ox,lc],60:sM,61:Ox,95:lc,96:Nx,126:Nx},QM={38:U_,92:H_},KM={[-5]:zh,[-4]:zh,[-3]:zh,33:kM,38:U_,42:up,60:[CN,mM],91:CM,92:[tM,H_],93:Bp,95:up,96:UN},JM={null:[up,qM]},WM={null:[42,95]},eO={null:[]},tO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:WM,contentInitial:FM,disable:eO,document:YM,flow:XM,flowInitial:GM,insideSpan:JM,string:QM,text:KM},Symbol.toStringTag,{value:"Module"}));function nO(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 u=[],c=[];const d={attempt:U(j),check:U(M),consume:A,enter:E,exit:N,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(H){return u=Nn(u,H),S(),u[u.length-1]!==null?[]:(R(t,0),h.events=Bc(s,h.events,h),h.events)}function y(H,P){return iO(v(H),P)}function v(H){return rO(u,H)}function b(){const{_bufferIndex:H,_index:P,line:F,column:z,offset:$}=i;return{_bufferIndex:H,_index:P,line:F,column:z,offset:$}}function _(H){l[H.line]=H.column,O()}function S(){let H;for(;i._index<u.length;){const P=u[i._index];if(typeof P=="string")for(H=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===H&&i._bufferIndex<P.length;)k(P.charCodeAt(i._bufferIndex));else k(P)}}function k(H){m=m(H)}function A(H){Ce(H)?(i.line++,i.column=1,i.offset+=H===-3?2:1,O()):H!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===u[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=H}function E(H,P){const F=P||{};return F.type=H,F.start=b(),h.events.push(["enter",F,h]),c.push(F),F}function N(H){const P=c.pop();return P.end=b(),h.events.push(["exit",P,h]),P}function j(H,P){R(H,P.from)}function M(H,P){P.restore()}function U(H,P){return F;function F(z,$,L){let q,K,X,w;return Array.isArray(z)?te(z):"tokenize"in z?te([z]):Z(z);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 q=W,K=0,W.length===0?L:C(W[K])}function C(W){return ue;function ue(ce){return w=B(),X=W,W.partial||(h.currentConstruct=W),W.name&&h.parser.constructs.disable.null.includes(W.name)?Q():W.tokenize.call(P?Object.assign(Object.create(h),P):h,d,Y,Q)(ce)}}function Y(W){return H(X,w),$}function Q(W){return w.restore(),++K<q.length?C(q[K]):L}}}function R(H,P){H.resolveAll&&!s.includes(H)&&s.push(H),H.resolve&&vn(h.events,P,h.events.length-P,H.resolve(h.events.slice(P),h)),H.resolveTo&&(h.events=H.resolveTo(h.events,h))}function B(){const H=b(),P=h.previous,F=h.currentConstruct,z=h.events.length,$=Array.from(c);return{from:z,restore:L};function L(){i=H,h.previous=P,h.currentConstruct=F,h.events.length=z,c=$,O()}}function O(){i.line in l&&i.column<2&&(i.column=l[i.line],i.offset+=l[i.line]-1)}}function rO(e,t){const n=t.start._index,i=t.start._bufferIndex,l=t.end._index,s=t.end._bufferIndex;let u;if(n===l)u=[e[n].slice(i,s)];else{if(u=e.slice(n,l),i>-1){const c=u[0];typeof c=="string"?u[0]=c.slice(i):u.shift()}s>0&&u.push(e[l].slice(0,s))}return u}function iO(e,t){let n=-1;const i=[];let l;for(;++n<e.length;){const s=e[n];let u;if(typeof s=="string")u=s;else switch(s){case-5:{u="\r";break}case-4:{u=`
55
+ `;break}case-3:{u=`\r
56
+ `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(s)}l=s===-2,i.push(u)}return i.join("")}function aO(e){const i={constructs:L_([tO,...(e||{}).extensions||[]]),content:l(bN),defined:[],document:l(wN),flow:l(UM),lazy:{},string:l(VM),text:l($M)};return i;function l(s){return u;function u(c){return nO(i,s,c)}}}function lO(e){for(;!P_(e););return e}const Rx=/[\0\t\n\r]/g;function sO(){let e=1,t="",n=!0,i;return l;function l(s,u,c){const d=[];let h,m,p,y,v;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(u||void 0).decode(s)),p=0,t="",n&&(s.charCodeAt(0)===65279&&p++,n=void 0);p<s.length;){if(Rx.lastIndex=p,h=Rx.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 uO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function oO(e){return e.replace(uO,cO)}function cO(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),s=l===120||l===88;return I_(n.slice(s?2:1),s?16:10)}return Ip(n)||e}const F_={}.hasOwnProperty;function fO(e,t,n){return typeof t!="string"&&(n=t,t=void 0),dO(n)(lO(aO(n).document().write(sO()(e,t,!0))))}function dO(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(fr),autolinkProtocol:B,autolinkEmail:B,atxHeading:s(lt),blockQuote:s(ke),characterEscape:B,characterReference:B,codeFenced:s(we),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(we,u),codeText:s(ve,u),codeTextData:B,data:B,codeFlowValue:B,definition:s(ze),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(De),hardBreakEscape:s(ot),hardBreakTrailing:s(ot),htmlFlow:s(bt,u),htmlFlowData:B,htmlText:s(bt,u),htmlTextData:B,image:s(Ti),label:u,link:s(fr),listItem:s(Xn),listItemValue:y,listOrdered:s(Mn,p),listUnordered:s(Mn),paragraph:s(dr),reference:C,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(lt),strong:s(Qn),thematicBreak:s(Kn)},exit:{atxHeading:d(),atxHeadingSequence:j,autolink:d(),autolinkEmail:ge,autolinkProtocol:ce,blockQuote:d(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:Q,characterReferenceMarkerNumeric:Q,characterReferenceValue:W,characterReference:ue,codeFenced:d(S),codeFencedFence:_,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:O,codeIndented:d(k),codeText:d($),codeTextData:O,data:O,definition:d(),definitionDestinationString:N,definitionLabelString:A,definitionTitleString:E,emphasis:d(),hardBreakEscape:d(P),hardBreakTrailing:d(P),htmlFlow:d(F),htmlFlowData:O,htmlText:d(z),htmlTextData:O,image:d(q),label:X,labelText:K,lineEnding:H,link:d(L),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:Y,resourceDestinationString:w,resourceTitleString:Z,resource:te,setextHeading:d(R),setextHeadingLineSequence:U,setextHeadingText:M,strong:d(),thematicBreak:d()}};G_(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:u,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 $t=Te.pop();Xe=l(le,$t,Xe)}for(Xe=-1;++Xe<le.length;){const $t=t[le[Xe][0]];F_.call($t,le[Xe][1].type)&&$t[le[Xe][1].type].call(Object.assign({sliceSerialize:le[Xe][2].sliceSerialize},Ee),le[Xe][1])}if(Ee.tokenStack.length>0){const $t=Ee.tokenStack[Ee.tokenStack.length-1];($t[1]||zx).call(Ee,void 0,$t[0])}for(de.position={start:mi(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:mi(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,$t=!1,On,It,bn,Zt;for(;++Te<=Ee;){const _t=le[Te];switch(_t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{_t[0]==="enter"?Xe++:Xe--,Zt=void 0;break}case"lineEndingBlank":{_t[0]==="enter"&&(On&&!Zt&&!Xe&&!bn&&(bn=Te),Zt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Zt=void 0}if(!Xe&&_t[0]==="enter"&&_t[1].type==="listItemPrefix"||Xe===-1&&_t[0]==="exit"&&(_t[1].type==="listUnordered"||_t[1].type==="listOrdered")){if(On){let Qt=Te;for(It=void 0;Qt--;){const sn=le[Qt];if(sn[1].type==="lineEnding"||sn[1].type==="lineEndingBlank"){if(sn[0]==="exit")continue;It&&(le[It][1].type="lineEndingBlank",$t=!0),sn[1].type="lineEnding",It=Qt}else if(!(sn[1].type==="linePrefix"||sn[1].type==="blockQuotePrefix"||sn[1].type==="blockQuotePrefixWhitespace"||sn[1].type==="blockQuoteMarker"||sn[1].type==="listItemIndent"))break}bn&&(!It||bn<It)&&(On._spread=!0),On.end=Object.assign({},It?le[It][1].start:_t[1].end),le.splice(It||Te,0,["exit",On,_t[2]]),Te++,Ee++}if(_t[1].type==="listItemPrefix"){const Qt={type:"listItem",_spread:!1,start:Object.assign({},_t[1].start),end:void 0};On=Qt,le.splice(Te,0,["enter",Qt,_t[2]]),Te++,Ee++,bn=void 0,Zt=!0}}}return le[de][1]._spread=$t,Ee}function s(le,de){return Ee;function Ee(Te){c.call(this,le(Te),Te),de&&de.call(this,Te)}}function u(){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:mi(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]||zx).call(this,le,Te[0]));else throw new Error("Cannot close `"+le.type+"` ("+Rs({start:le.start,end:le.end})+"): it’s not open");Ee.position.end=mi(le.end)}function m(){return Lp(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=Zn(this.sliceSerialize(le)).toLowerCase()}function E(){const le=this.resume(),de=this.stack[this.stack.length-1];de.title=le}function N(){const le=this.resume(),de=this.stack[this.stack.length-1];de.url=le}function j(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 R(){this.data.setextHeadingSlurpLineEnding=void 0}function B(le){const Ee=this.stack[this.stack.length-1].children;let Te=Ee[Ee.length-1];(!Te||Te.type!=="text")&&(Te=Ci(),Te.position={start:mi(le.start),end:void 0},Ee.push(Te)),this.stack.push(Te)}function O(le){const de=this.stack.pop();de.value+=this.sliceSerialize(le),de.position.end=mi(le.end)}function H(le){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=de.children[de.children.length-1];Ee.position.end=mi(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(B.call(this,le),O.call(this,le))}function P(){this.data.atHardBreak=!0}function F(){const le=this.resume(),de=this.stack[this.stack.length-1];de.value=le}function z(){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 L(){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 q(){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=oO(de),Ee.identifier=Zn(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=Zn(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=I_(de,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Te=Ip(de);const Xe=this.stack[this.stack.length-1];Xe.value+=Te}function ue(le){const de=this.stack.pop();de.position.end=mi(le.end)}function ce(le){O.call(this,le);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(le)}function ge(le){O.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 ve(){return{type:"inlineCode",value:""}}function ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function De(){return{type:"emphasis",children:[]}}function lt(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function bt(){return{type:"html",value:""}}function Ti(){return{type:"image",title:null,url:"",alt:null}}function fr(){return{type:"link",title:null,url:"",children:[]}}function Mn(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function Xn(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function dr(){return{type:"paragraph",children:[]}}function Qn(){return{type:"strong",children:[]}}function Ci(){return{type:"text",value:""}}function Kn(){return{type:"thematicBreak"}}}function mi(e){return{line:e.line,column:e.column,offset:e.offset}}function G_(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?G_(e,i):hO(e,i)}}function hO(e,t){let n;for(n in t)if(F_.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 zx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Rs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Rs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Rs({start:t.start,end:t.end})+") is still open")}function mO(e){const t=this;t.parser=n;function n(i){return fO(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function pO(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 gO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
57
+ `}]}function yO(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 vO(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xO(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bO(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),l=ml(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let u,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),u=e.footnoteOrder.length):u=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(u)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function _O(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 wO(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function X_(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 u=l[l.length-1];return u&&u.type==="text"?u.value+=i:l.push({type:"text",value:i}),l}function SO(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return X_(e,t);const l={src:ml(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 EO(e,t){const n={src:ml(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 kO(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 TO(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return X_(e,t);const l={href:ml(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 CO(e,t){const n={href:ml(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 AO(e,t,n){const i=e.all(t),l=n?NO(n):Q_(t),s={},u=[];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")&&u.push({type:"text",value:`
59
+ `}),m.type==="element"&&m.tagName==="p"&&!l?u.push(...m.children):u.push(m)}const d=i[i.length-1];d&&(l||d.type!=="element"||d.tagName!=="p")&&u.push({type:"text",value:`
60
+ `});const h={type:"element",tagName:"li",properties:s,children:u};return e.patch(t,h),e.applyData(t,h)}function NO(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=Q_(n[i])}return t}function Q_(e){const t=e.spread;return t??e.children.length>1}function MO(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 u=i[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.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 OO(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RO(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function zO(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DO(e,t){const n=e.all(t),i=n.shift(),l=[];if(i){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],u),l.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Rp(t.children[1]),d=N_(t.children[t.children.length-1]);c&&d&&(u.position={start:c,end:d}),l.push(u)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,s),e.applyData(t,s)}function jO(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,c=u?u.length:t.children.length;let d=-1;const h=[];for(;++d<c;){const p=t.children[d],y={},v=u?u[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 LO(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Dx=9,jx=32;function IO(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),l=0;const s=[];for(;i;)s.push(Lx(t.slice(l,i.index),l>0,!0),i[0]),l=i.index+i[0].length,i=n.exec(t);return s.push(Lx(t.slice(l),l>0,!1)),s.join("")}function Lx(e,t,n){let i=0,l=e.length;if(t){let s=e.codePointAt(i);for(;s===Dx||s===jx;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(l-1);for(;s===Dx||s===jx;)l--,s=e.codePointAt(l-1)}return l>i?e.slice(i,l):""}function BO(e,t){const n={type:"text",value:IO(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function HO(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const UO={blockquote:pO,break:gO,code:yO,delete:vO,emphasis:xO,footnoteReference:bO,heading:_O,html:wO,imageReference:SO,image:EO,inlineCode:kO,linkReference:TO,link:CO,listItem:AO,list:MO,paragraph:OO,root:RO,strong:zO,table:DO,tableCell:LO,tableRow:jO,text:BO,thematicBreak:HO,toml:Yo,yaml:Yo,definition:Yo,footnoteDefinition:Yo};function Yo(){}const K_=-1,Hc=0,Ds=1,bc=2,Hp=3,Up=4,Pp=5,qp=6,J_=7,W_=8,Ix=typeof self=="object"?self:globalThis,PO=(e,t)=>{const n=(l,s)=>(e.set(s,l),l),i=l=>{if(e.has(l))return e.get(l);const[s,u]=t[l];switch(s){case Hc:case K_:return n(u,l);case Ds:{const c=n([],l);for(const d of u)c.push(i(d));return c}case bc:{const c=n({},l);for(const[d,h]of u)c[i(d)]=i(h);return c}case Hp:return n(new Date(u),l);case Up:{const{source:c,flags:d}=u;return n(new RegExp(c,d),l)}case Pp:{const c=n(new Map,l);for(const[d,h]of u)c.set(i(d),i(h));return c}case qp:{const c=n(new Set,l);for(const d of u)c.add(i(d));return c}case J_:{const{name:c,message:d}=u;return n(new Ix[c](d),l)}case W_:return n(BigInt(u),l);case"BigInt":return n(Object(BigInt(u)),l);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:c}=new Uint8Array(u);return n(new DataView(c),u)}}return n(new Ix[s](u),l)};return i},Bx=e=>PO(new Map,e)(0),Za="",{toString:qO}={},{keys:VO}=Object,Es=e=>{const t=typeof e;if(t!=="object"||!e)return[Hc,t];const n=qO.call(e).slice(8,-1);switch(n){case"Array":return[Ds,Za];case"Object":return[bc,Za];case"Date":return[Hp,Za];case"RegExp":return[Up,Za];case"Map":return[Pp,Za];case"Set":return[qp,Za];case"DataView":return[Ds,n]}return n.includes("Array")?[Ds,n]:n.includes("Error")?[J_,n]:[bc,n]},Fo=([e,t])=>e===Hc&&(t==="function"||t==="symbol"),$O=(e,t,n,i)=>{const l=(u,c)=>{const d=i.push(u)-1;return n.set(c,d),d},s=u=>{if(n.has(u))return n.get(u);let[c,d]=Es(u);switch(c){case Hc:{let m=u;switch(d){case"bigint":c=W_,m=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return l([K_],u)}return l([c,m],u)}case Ds:{if(d){let y=u;return d==="DataView"?y=new Uint8Array(u.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(u)),l([d,[...y]],u)}const m=[],p=l([c,m],u);for(const y of u)m.push(s(y));return p}case bc:{if(d)switch(d){case"BigInt":return l([d,u.toString()],u);case"Boolean":case"Number":case"String":return l([d,u.valueOf()],u)}if(t&&"toJSON"in u)return s(u.toJSON());const m=[],p=l([c,m],u);for(const y of VO(u))(e||!Fo(Es(u[y])))&&m.push([s(y),s(u[y])]);return p}case Hp:return l([c,u.toISOString()],u);case Up:{const{source:m,flags:p}=u;return l([c,{source:m,flags:p}],u)}case Pp:{const m=[],p=l([c,m],u);for(const[y,v]of u)(e||!(Fo(Es(y))||Fo(Es(v))))&&m.push([s(y),s(v)]);return p}case qp:{const m=[],p=l([c,m],u);for(const y of u)(e||!Fo(Es(y)))&&m.push(s(y));return p}}const{message:h}=u;return l([c,{name:d,message:h}],u)};return s},Hx=(e,{json:t,lossy:n}={})=>{const i=[];return $O(!(t||n),!!t,new Map,i)(e),i},_c=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Bx(Hx(e,t)):structuredClone(e):(e,t)=>Bx(Hx(e,t));function ZO(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 YO(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function FO(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ZO,i=e.options.footnoteBackLabel||YO,l=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",u=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=ml(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:{..._c(u),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 Uc=function(e){if(e==null)return KO;if(typeof e=="function")return Pc(e);if(typeof e=="object")return Array.isArray(e)?GO(e):XO(e);if(typeof e=="string")return QO(e);throw new Error("Expected function, string, or object as test")};function GO(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Uc(e[n]);return Pc(i);function i(...l){let s=-1;for(;++s<t.length;)if(t[s].apply(this,l))return!0;return!1}}function XO(e){const t=e;return Pc(n);function n(i){const l=i;let s;for(s in e)if(l[s]!==t[s])return!1;return!0}}function QO(e){return Pc(t);function t(n){return n&&n.type===e}}function Pc(e){return t;function t(n,i,l){return!!(JO(n)&&e.call(this,n,typeof i=="number"?i:void 0,l||void 0))}}function KO(){return!0}function JO(e){return e!==null&&typeof e=="object"&&"type"in e}const ew=[],WO=!0,op=!1,eR="skip";function tw(e,t,n,i){let l;typeof t=="function"&&typeof n!="function"?(i=n,n=t):l=t;const s=Uc(l),u=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=ew,b,_,S;if((!t||s(d,h,m[m.length-1]||void 0))&&(v=tR(n(d,m)),v[0]===op))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==eR)for(_=(i?k.children.length:-1)+u,S=m.concat(k);_>-1&&_<k.children.length;){const A=k.children[_];if(b=c(A,_,S)(),b[0]===op)return b;_=typeof b[1]=="number"?b[1]:_+u}}return v}}}function tR(e){return Array.isArray(e)?e:typeof e=="number"?[WO,e]:e==null?ew:[e]}function Vp(e,t,n,i){let l,s,u;typeof t=="function"?(s=void 0,u=t,l=n):(s=t,u=n,l=i),tw(e,s,c,l);function c(d,h){const m=h[h.length-1],p=m?m.children.indexOf(d):void 0;return u(d,p,m)}}const cp={}.hasOwnProperty,nR={};function rR(e,t){const n=t||nR,i=new Map,l=new Map,s=new Map,u={...UO,...n.handlers},c={all:h,applyData:aR,definitionById:i,footnoteById:l,footnoteCounts:s,footnoteOrder:[],handlers:u,one:d,options:n,patch:iR,wrap:sR};return Vp(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(cp.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=_c(S);return k.children=c.all(m),k}return _c(m)}return(c.options.unknownHandler||lR)(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=Ux(b.value)),!Array.isArray(b)&&b.type==="element")){const _=b.children[0];_&&_.type==="text"&&(_.value=Ux(_.value))}Array.isArray(b)?p.push(...b):p.push(b)}}}return p}}function iR(e,t){e.position&&(t.position=YA(e))}function aR(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 u="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:u}}n.type==="element"&&s&&Object.assign(n.properties,_c(s)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function lR(e,t){const n=t.data||{},i="value"in t&&!(cp.call(n,"hProperties")||cp.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 sR(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 Ux(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Px(e,t){const n=rR(e,t),i=n.one(e,void 0),l=FO(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 uR(e,t){return e&&"run"in e?async function(n,i){const l=Px(n,{file:i,...t});await e.run(l,i)}:function(n,i){return Px(n,{file:i,...e||t})}}function qx(e){if(e)throw e}var Dh,Vx;function oR(){if(Vx)return Dh;Vx=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)},u=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:{},u(_,{name:m,newValue:d(A,b,y)})):typeof y<"u"&&u(_,{name:m,newValue:y}));return _},Dh}var cR=oR();const jh=Ei(cR);function fp(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 fR(){const e=[],t={run:n,use:i};return t;function n(...l){let s=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);c(null,...l);function c(d,...h){const m=e[++s];let p=-1;if(d){u(d);return}for(;++p<l.length;)(h[p]===null||h[p]===void 0)&&(h[p]=l[p]);l=h,m?dR(m,c)(...h):u(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 dR(e,t){let n;return i;function i(...u){const c=e.length>u.length;let d;c&&u.push(l);try{d=e.apply(this,u)}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(u,...c){n||(n=!0,t(u,...c))}function s(u){l(null,u)}}const ir={basename:hR,dirname:mR,extname:pR,join:gR,sep:"/"};function hR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');mu(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 u=-1,c=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(s){n=l+1;break}}else u<0&&(s=!0,u=l+1),c>-1&&(e.codePointAt(l)===t.codePointAt(c--)?c<0&&(i=l):(c=-1,i=u));return n===i?i=u:i<0&&(i=e.length),e.slice(n,i)}function mR(e){if(mu(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 pR(e){mu(e);let t=e.length,n=-1,i=0,l=-1,s=0,u;for(;t--;){const c=e.codePointAt(t);if(c===47){if(u){i=t+1;break}continue}n<0&&(u=!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 gR(...e){let t=-1,n;for(;++t<e.length;)mu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":yR(n)}function yR(e){mu(e);const t=e.codePointAt(0)===47;let n=vR(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function vR(e,t){let n="",i=0,l=-1,s=0,u=-1,c,d;for(;++u<=e.length;){if(u<e.length)c=e.codePointAt(u);else{if(c===47)break;c=47}if(c===47){if(!(l===u-1||s===1))if(l!==u-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=u,s=0;continue}}else if(n.length>0){n="",i=0,l=u,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(l+1,u):n=e.slice(l+1,u),i=u-l-1;l=u,s=0}else c===46&&s>-1?s++:s=-1}return n}function mu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xR={cwd:bR};function bR(){return"/"}function dp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _R(e){if(typeof e=="string")e=new URL(e);else if(!dp(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 wR(e)}function wR(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 Lh=["history","path","basename","stem","extname","dirname"];class nw{constructor(t){let n;t?dp(t)?n={path:t}:typeof t=="string"||SR(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":xR.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Lh.length;){const s=Lh[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)Lh.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?ir.basename(this.path):void 0}set basename(t){Bh(t,"basename"),Ih(t,"basename"),this.path=ir.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ir.dirname(this.path):void 0}set dirname(t){$x(this.basename,"dirname"),this.path=ir.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ir.extname(this.path):void 0}set extname(t){if(Ih(t,"extname"),$x(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=ir.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){dp(t)&&(t=_R(t)),Bh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ir.basename(this.path,this.extname):void 0}set stem(t){Bh(t,"stem"),Ih(t,"stem"),this.path=ir.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 Vt(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 Ih(e,t){if(e&&e.includes(ir.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ir.sep+"`")}function Bh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function $x(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function SR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ER=function(e){const i=this.constructor.prototype,l=i[e],s=function(){return l.apply(s,arguments)};return Object.setPrototypeOf(s,i),s},kR={}.hasOwnProperty;class $p extends ER{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=fR()}copy(){const t=new $p;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(jh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ph("data",this.frozen),this.namespace[t]=n,this):kR.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ph("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=Go(t),i=this.parser||this.Parser;return Hh("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Hh("process",this.parser||this.Parser),Uh("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(s,u){const c=Go(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);AR(b)?y.value=b:y.result=b,h(m,y)});function h(m,p){m||!p?u(m):s?s(p):n(void 0,p)}}}processSync(t){let n=!1,i;return this.freeze(),Hh("processSync",this.parser||this.Parser),Uh("processSync",this.compiler||this.Compiler),this.process(t,l),Yx("processSync","process",n),i;function l(s,u){n=!0,qx(s),i=u}}run(t,n,i){Zx(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(u,c){const d=Go(n);l.run(t,d,h);function h(m,p,y){const v=p||t;m?c(m):u?u(v):i(void 0,v,y)}}}runSync(t,n){let i=!1,l;return this.run(t,n,s),Yx("runSync","run",i),l;function s(u,c){qx(u),l=c,i=!0}}stringify(t,n){this.freeze();const i=Go(n),l=this.compiler||this.Compiler;return Uh("stringify",l),Zx(t),l(t,i)}use(t,...n){const i=this.attachers,l=this.namespace;if(Ph("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):u(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 u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(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=jh(!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];fp(_)&&fp(v)&&(v=jh(!0,_,v)),i[y]=[h,v,...b]}}}}const TR=new $p().freeze();function Hh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Uh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ph(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 Zx(e){if(!fp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Yx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Go(e){return CR(e)?e:new nw(e)}function CR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function AR(e){return typeof e=="string"||NR(e)}function NR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const MR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Fx=[],Gx={allowDangerousHtml:!0},OR=/^(https?|ircs?|mailto|xmpp)$/i,RR=[{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 zR(e){const t=DR(e),n=jR(e);return LR(t.runSync(t.parse(n),n),e)}function DR(e){const t=e.rehypePlugins||Fx,n=e.remarkPlugins||Fx,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gx}:Gx;return TR().use(mO).use(n).use(uR,i).use(t)}function jR(e){const t=e.children||"",n=new nw;return typeof t=="string"&&(n.value=t),n}function LR(e,t){const n=t.allowedElements,i=t.allowElement,l=t.components,s=t.disallowedElements,u=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||IR;for(const m of RR)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+MR+m.id,void 0);return Vp(e,h),KA(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 u?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 IR(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||OR.test(e.slice(0,t))?e:""}function Xx(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 BR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function HR(e,t,n){const l=Uc((n||{}).ignore||[]),s=UR(t);let u=-1;for(;++u<s.length;)tw(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[u][0],v=s[u][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 N=E.index,j={index:E.index,input:E.input,stack:[...m,h]};let M=v(...E,j);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?y.lastIndex=N+1:(b!==N&&A.push({type:"text",value:h.value.slice(b,N)}),Array.isArray(M)?A.push(...M):M&&A.push(M),b=N+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 UR(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([PR(l[0]),qR(l[1])])}return t}function PR(e){return typeof e=="string"?new RegExp(BR(e),"g"):e}function qR(e){return typeof e=="function"?e:function(){return e}}const qh="phrasing",Vh=["autolink","link","image","label"];function VR(){return{transforms:[QR],enter:{literalAutolink:ZR,literalAutolinkEmail:$h,literalAutolinkHttp:$h,literalAutolinkWww:$h},exit:{literalAutolink:XR,literalAutolinkEmail:GR,literalAutolinkHttp:YR,literalAutolinkWww:FR}}}function $R(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:qh,notInConstruct:Vh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:qh,notInConstruct:Vh},{character:":",before:"[ps]",after:"\\/",inConstruct:qh,notInConstruct:Vh}]}}function ZR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function $h(e){this.config.enter.autolinkProtocol.call(this,e)}function YR(e){this.config.exit.autolinkProtocol.call(this,e)}function FR(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 GR(e){this.config.exit.autolinkEmail.call(this,e)}function XR(e){this.exit(e)}function QR(e){HR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,KR],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),JR]],{ignore:["link","linkReference"]})}function KR(e,t,n,i,l){let s="";if(!rw(l)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!WR(n)))return!1;const u=e4(n+i);if(!u[0])return!1;const c={type:"link",title:null,url:s+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[c,{type:"text",value:u[1]}]:c}function JR(e,t,n,i){return!rw(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function WR(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 e4(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=Xx(e,"(");let s=Xx(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 rw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||na(n)||Ic(n))&&(!t||n!==47)}iw.peek=o4;function t4(){this.buffer()}function n4(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function r4(){this.buffer()}function i4(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function a4(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function l4(e){this.exit(e)}function s4(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function u4(e){this.exit(e)}function o4(){return"["}function iw(e,t,n,i){const l=n.createTracker(i);let s=l.move("[^");const u=n.enter("footnoteReference"),c=n.enter("reference");return s+=l.move(n.safe(n.associationId(e),{after:"]",before:s})),c(),u(),s+=l.move("]"),s}function c4(){return{enter:{gfmFootnoteCallString:t4,gfmFootnoteCall:n4,gfmFootnoteDefinitionLabelString:r4,gfmFootnoteDefinition:i4},exit:{gfmFootnoteCallString:a4,gfmFootnoteCall:l4,gfmFootnoteDefinitionLabelString:s4,gfmFootnoteDefinition:u4}}}function f4(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:iw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,l,s,u){const c=s.createTracker(u);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?aw:d4))),h(),d}}function d4(e,t,n){return t===0?e:aw(e,t,n)}function aw(e,t,n){return(n?"":" ")+e}const h4=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];lw.peek=v4;function m4(){return{canContainEols:["delete"],enter:{strikethrough:g4},exit:{strikethrough:y4}}}function p4(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:h4}],handlers:{delete:lw}}}function g4(e){this.enter({type:"delete",children:[]},e)}function y4(e){this.exit(e)}function lw(e,t,n,i){const l=n.createTracker(i),s=n.enter("strikethrough");let u=l.move("~~");return u+=n.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),s(),u}function v4(){return"~"}function x4(e){return e.length}function b4(e,t){const n=t||{},i=(n.align||[]).concat(),l=n.stringLength||x4,s=[],u=[],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=_4(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)}u[m]=_,c[m]=S}let p=-1;if(typeof i=="object"&&"length"in i)for(;++p<h;)s[p]=Qx(i[p]);else{const _=Qx(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}u.splice(1,0,y),c.splice(1,0,v),m=-1;const b=[];for(;++m<u.length;){const _=u[m],S=c[m];p=-1;const k=[];for(;++p<h;){const A=_[p]||"";let E="",N="";if(n.alignDelimiters!==!1){const j=d[p]-(S[p]||0),M=s[p];M===114?E=" ".repeat(j):M===99?j%2?(E=" ".repeat(j/2+.5),N=" ".repeat(j/2-.5)):(E=" ".repeat(j/2),N=E):N=" ".repeat(j)}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(N),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 _4(e){return e==null?"":String(e)}function Qx(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 w4(e,t,n,i){const l=n.enter("blockquote"),s=n.createTracker(i);s.move("> "),s.shift(2);const u=n.indentLines(n.containerFlow(e,s.current()),S4);return l(),u}function S4(e,t,n){return">"+(n?"":" ")+e}function E4(e,t){return Kx(e,t.inConstruct,!0)&&!Kx(e,t.notInConstruct,!1)}function Kx(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 Jx(e,t,n,i){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
69
+ `&&E4(n.stack,n.unsafe[l]))return/[ \t]/.test(i.before)?"":" ";return`\\
70
+ `}function k4(e,t){const n=String(e);let i=n.indexOf(t),l=i,s=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===l?++s>u&&(u=s):s=1,l=i+t.length,i=n.indexOf(t,l);return u}function T4(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 C4(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 A4(e,t,n,i){const l=C4(n),s=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(T4(e,n)){const p=n.enter("codeIndented"),y=n.indentLines(s,N4);return p(),y}const c=n.createTracker(i),d=l.repeat(Math.max(k4(s,l)+1,3)),h=n.enter("codeFenced");let m=c.move(d);if(e.lang){const p=n.enter(`codeFencedLang${u}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${u}`);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 N4(e,t,n){return(n?"":" ")+e}function Zp(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 M4(e,t,n,i){const l=Zp(n),s=l==='"'?"Quote":"Apostrophe",u=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()),u(),h}function O4(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 Ws(e){return"&#x"+e.toString(16).toUpperCase()+";"}function wc(e,t,n){const i=al(e),l=al(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}}sw.peek=R4;function sw(e,t,n,i){const l=O4(n),s=n.enter("emphasis"),u=n.createTracker(i),c=u.move(l);let d=u.move(n.containerPhrasing(e,{after:l,before:c,...u.current()}));const h=d.charCodeAt(0),m=wc(i.before.charCodeAt(i.before.length-1),h,l);m.inside&&(d=Ws(h)+d.slice(1));const p=d.charCodeAt(d.length-1),y=wc(i.after.charCodeAt(0),p,l);y.inside&&(d=d.slice(0,-1)+Ws(p));const v=u.move(l);return s(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+d+v}function R4(e,t,n){return n.options.emphasis||"*"}function z4(e,t){let n=!1;return Vp(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,op}),!!((!e.depth||e.depth<3)&&Lp(e)&&(t.options.setext||n))}function D4(e,t,n,i){const l=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(z4(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 u="#".repeat(l),c=n.enter("headingAtx"),d=n.enter("phrasing");s.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
79
+ `,...s.current()});return/^[\t ]/.test(h)&&(h=Ws(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),d(),c(),h}uw.peek=j4;function uw(e){return e.value||""}function j4(){return"<"}ow.peek=L4;function ow(e,t,n,i){const l=Zp(n),s=l==='"'?"Quote":"Apostrophe",u=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(")"),u(),h}function L4(){return"!"}cw.peek=I4;function cw(e,t,n,i){const l=e.referenceType,s=n.enter("imageReference");let u=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+"]["),u();const m=n.stack;n.stack=[],u=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return u(),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 I4(){return"!"}fw.peek=B4;function fw(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 u=n.unsafe[s],c=n.compilePattern(u);let d;if(u.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 B4(){return"`"}function dw(e,t){const n=Lp(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))}hw.peek=H4;function hw(e,t,n,i){const l=Zp(n),s=l==='"'?"Quote":"Apostrophe",u=n.createTracker(i);let c,d;if(dw(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let p=u.move("<");return p+=u.move(n.containerPhrasing(e,{before:p,after:">",...u.current()})),p+=u.move(">"),c(),n.stack=m,p}c=n.enter("link"),d=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(d=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),d(),e.title&&(d=n.enter(`title${s}`),h+=u.move(" "+l),h+=u.move(n.safe(e.title,{before:h,after:l,...u.current()})),h+=u.move(l),d()),h+=u.move(")"),c(),h}function H4(e,t,n){return dw(e,n)?"<":"["}mw.peek=U4;function mw(e,t,n,i){const l=e.referenceType,s=n.enter("linkReference");let u=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+"]["),u();const m=n.stack;n.stack=[],u=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return u(),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 U4(){return"["}function Yp(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 P4(e){const t=Yp(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 q4(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 pw(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 V4(e,t,n,i){const l=n.enter("list"),s=n.bulletCurrent;let u=e.ordered?q4(n):Yp(n);const c=e.ordered?u==="."?")":".":P4(n);let d=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&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),pw(n)===u&&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&&(u=c),n.bulletCurrent=u;const h=n.containerFlow(e,i);return n.bulletLastUsed=u,n.bulletCurrent=s,l(),h}function $4(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 Z4(e,t,n,i){const l=$4(n);let s=n.bulletCurrent||Yp(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 u=s.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const c=n.createTracker(i);c.move(s+" ".repeat(u-s.length)),c.shift(u);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(u))+p:(v?s:s+" ".repeat(u-s.length))+p}}function Y4(e,t,n,i){const l=n.enter("paragraph"),s=n.enter("phrasing"),u=n.containerPhrasing(e,i);return s(),l(),u}const F4=Uc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function G4(e,t,n,i){return(e.children.some(function(u){return F4(u)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function X4(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}gw.peek=Q4;function gw(e,t,n,i){const l=X4(n),s=n.enter("strong"),u=n.createTracker(i),c=u.move(l+l);let d=u.move(n.containerPhrasing(e,{after:l,before:c,...u.current()}));const h=d.charCodeAt(0),m=wc(i.before.charCodeAt(i.before.length-1),h,l);m.inside&&(d=Ws(h)+d.slice(1));const p=d.charCodeAt(d.length-1),y=wc(i.after.charCodeAt(0),p,l);y.inside&&(d=d.slice(0,-1)+Ws(p));const v=u.move(l+l);return s(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+d+v}function Q4(e,t,n){return n.options.strong||"*"}function K4(e,t,n,i){return n.safe(e.value,i)}function J4(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 W4(e,t,n){const i=(pw(n)+(n.options.ruleSpaces?" ":"")).repeat(J4(n));return n.options.ruleSpaces?i.slice(0,-1):i}const yw={blockquote:w4,break:Jx,code:A4,definition:M4,emphasis:sw,hardBreak:Jx,heading:D4,html:uw,image:ow,imageReference:cw,inlineCode:fw,link:hw,linkReference:mw,list:V4,listItem:Z4,paragraph:Y4,root:G4,strong:gw,text:K4,thematicBreak:W4};function ez(){return{enter:{table:tz,tableData:Wx,tableHeader:Wx,tableRow:rz},exit:{codeText:iz,table:nz,tableData:Zh,tableHeader:Zh,tableRow:Zh}}}function tz(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 nz(e){this.exit(e),this.data.inTable=void 0}function rz(e){this.enter({type:"tableRow",children:[]},e)}function Zh(e){this.exit(e)}function Wx(e){this.enter({type:"tableCell",children:[]},e)}function iz(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,az));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function az(e,t){return t==="|"?t:e}function lz(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:u,tableCell:d,tableRow:c}};function u(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 b4(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=yw.inlineCode(v,b,_);return _.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function sz(){return{exit:{taskListCheckValueChecked:eb,taskListCheckValueUnchecked:eb,paragraph:oz}}}function uz(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:cz}}}function eb(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function oz(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,u;for(;++s<l.length;){const c=l[s];if(c.type==="paragraph"){u=c;break}}u===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 cz(e,t,n,i){const l=e.children[0],s=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",c=n.createTracker(i);s&&c.move(u);let d=yw.listItem(e,t,n,{...i,...c.current()});return s&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(m){return m+u}}function fz(){return[VR(),c4(),m4(),ez(),sz()]}function dz(e){return{extensions:[$R(),f4(e),p4(),lz(e),uz()]}}const hz={tokenize:xz,partial:!0},vw={tokenize:bz,partial:!0},xw={tokenize:_z,partial:!0},bw={tokenize:wz,partial:!0},mz={tokenize:Sz,partial:!0},_w={name:"wwwAutolink",tokenize:yz,previous:Sw},ww={name:"protocolAutolink",tokenize:vz,previous:Ew},Ir={name:"emailAutolink",tokenize:gz,previous:kw},or={};function pz(){return{text:or}}let Yi=48;for(;Yi<123;)or[Yi]=Ir,Yi++,Yi===58?Yi=65:Yi===91&&(Yi=97);or[43]=Ir;or[45]=Ir;or[46]=Ir;or[95]=Ir;or[72]=[Ir,ww];or[104]=[Ir,ww];or[87]=[Ir,_w];or[119]=[Ir,_w];function gz(e,t,n){const i=this;let l,s;return u;function u(p){return!hp(p)||!kw.call(i,i.previous)||Fp(i.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return hp(p)?(e.consume(p),c):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(mz,m,h)(p):p===45||p===95||Pt(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&&Gt(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function yz(e,t,n){const i=this;return l;function l(u){return u!==87&&u!==119||!Sw.call(i,i.previous)||Fp(i.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(hz,e.attempt(vw,e.attempt(xw,s),n),n)(u))}function s(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function vz(e,t,n){const i=this;let l="",s=!1;return u;function u(p){return(p===72||p===104)&&Ew.call(i,i.previous)&&!Fp(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(Gt(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||xc(p)||at(p)||na(p)||Ic(p)?n(p):e.attempt(vw,e.attempt(xw,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function xz(e,t,n){let i=0;return l;function l(u){return(u===87||u===119)&&i<3?(i++,e.consume(u),l):u===46&&i===3?(e.consume(u),s):n(u)}function s(u){return u===null?n(u):t(u)}}function bz(e,t,n){let i,l,s;return u;function u(h){return h===46||h===95?e.check(bw,d,c)(h):h===null||at(h)||na(h)||h!==45&&Ic(h)?d(h):(s=!0,e.consume(h),u)}function c(h){return h===95?i=!0:(l=i,i=void 0),e.consume(h),u}function d(h){return l||i||!s?n(h):t(h)}}function _z(e,t){let n=0,i=0;return l;function l(u){return u===40?(n++,e.consume(u),l):u===41&&i<n?s(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(bw,t,s)(u):u===null||at(u)||na(u)?t(u):(e.consume(u),l)}function s(u){return u===41&&i++,e.consume(u),l}}function wz(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)||na(c)?t(c):n(c)}function l(c){return c===null||c===40||c===91||at(c)||na(c)?t(c):i(c)}function s(c){return Gt(c)?u(c):n(c)}function u(c){return c===59?(e.consume(c),i):Gt(c)?(e.consume(c),u):n(c)}}function Sz(e,t,n){return i;function i(s){return e.consume(s),l}function l(s){return Pt(s)?n(s):t(s)}}function Sw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||at(e)}function Ew(e){return!Gt(e)}function kw(e){return!(e===47||hp(e))}function hp(e){return e===43||e===45||e===46||e===95||Pt(e)}function Fp(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 Ez={tokenize:Rz,partial:!0};function kz(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Nz,continuation:{tokenize:Mz},exit:Oz}},text:{91:{name:"gfmFootnoteCall",tokenize:Az},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Tz,resolveTo:Cz}}}}function Tz(e,t,n){const i=this;let l=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u;for(;l--;){const d=i.events[l][1];if(d.type==="labelImage"){u=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(!u||!u._balanced)return n(d);const h=Zn(i.sliceSerialize({start:u.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 Cz(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)},u={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",u,t],["exit",u,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 Az(e,t,n){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,u;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&&!u||p===null||p===91||at(p))return n(p);if(p===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return l.includes(Zn(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return at(p)||(u=!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 Nz(e,t,n){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,u=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(u>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=Zn(i.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return at(b)||(c=!0),u++,e.consume(b),b===92?p:m}function p(b){return b===91||b===92||b===93?(e.consume(b),u++,m):m(b)}function y(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),l.includes(s)||l.push(s),Ye(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function Mz(e,t,n){return e.check(hu,t,e.attempt(Ez,t,n))}function Oz(e){e.exit("gfmFootnoteDefinition")}function Rz(e,t,n){const i=this;return Ye(e,l,"gfmFootnoteDefinitionIndent",5);function l(s){const u=i.events[i.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(s):n(s)}}function zz(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(u,c){let d=-1;for(;++d<u.length;)if(u[d][0]==="enter"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._close){let h=d;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[d][1].end.offset-u[d][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[d][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[d][1].end)},p={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[d][1].start)},y=[["enter",m,c],["enter",u[h][1],c],["exit",u[h][1],c],["enter",p,c]],v=c.parser.constructs.insideSpan.null;v&&vn(y,y.length,0,Bc(v,u.slice(h+1,d),c)),vn(y,y.length,0,[["exit",p,c],["enter",u[d][1],c],["exit",u[d][1],c],["exit",m,c]]),vn(u,h-1,d-h+3,y),d=h+y.length-2;break}}for(d=-1;++d<u.length;)u[d][1].type==="strikethroughSequenceTemporary"&&(u[d][1].type="data");return u}function s(u,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):(u.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const _=al(h);if(b===126)return p>1?d(b):(u.consume(b),p++,v);if(p<2&&!n)return d(b);const S=u.exit("strikethroughSequenceTemporary"),k=al(b);return S._open=!k||k===2&&!!_,S._close=!_||_===2&&!!k,c(b)}}}class Dz{constructor(){this.map=[]}add(t,n,i){jz(this,t,n,i)}consume(t){if(this.map.sort(function(s,u){return s[0]-u[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 jz(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 Lz(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 Iz(){return{flow:{null:{name:"table",tokenize:Bz,resolveAll:Hz}}}}function Bz(e,t,n){const i=this;let l=0,s=0,u;return c;function c(O){let H=i.events.length-1;for(;H>-1;){const z=i.events[H][1].type;if(z==="lineEnding"||z==="linePrefix")H--;else break}const P=H>-1?i.events[H][1].type:null,F=P==="tableHead"||P==="tableRow"?M:d;return F===M&&i.parser.lazy[i.now().line]?n(O):F(O)}function d(O){return e.enter("tableHead"),e.enter("tableRow"),h(O)}function h(O){return O===124||(u=!0,s+=1),m(O)}function m(O){return O===null?n(O):Ce(O)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),v):n(O):Ve(O)?Ye(e,m,"whitespace")(O):(s+=1,u&&(u=!1,l+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),u=!0,m):(e.enter("data"),p(O)))}function p(O){return O===null||O===124||at(O)?(e.exit("data"),m(O)):(e.consume(O),O===92?y:p)}function y(O){return O===92||O===124?(e.consume(O),p):p(O)}function v(O){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(O):(e.enter("tableDelimiterRow"),u=!1,Ve(O)?Ye(e,b,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):b(O))}function b(O){return O===45||O===58?S(O):O===124?(u=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),_):j(O)}function _(O){return Ve(O)?Ye(e,S,"whitespace")(O):S(O)}function S(O){return O===58?(s+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),k):O===45?(s+=1,k(O)):O===null||Ce(O)?N(O):j(O)}function k(O){return O===45?(e.enter("tableDelimiterFiller"),A(O)):j(O)}function A(O){return O===45?(e.consume(O),A):O===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(O))}function E(O){return Ve(O)?Ye(e,N,"whitespace")(O):N(O)}function N(O){return O===124?b(O):O===null||Ce(O)?!u||l!==s?j(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(O)):j(O)}function j(O){return n(O)}function M(O){return e.enter("tableRow"),U(O)}function U(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),U):O===null||Ce(O)?(e.exit("tableRow"),t(O)):Ve(O)?Ye(e,U,"whitespace")(O):(e.enter("data"),R(O))}function R(O){return O===null||O===124||at(O)?(e.exit("data"),U(O)):(e.consume(O),O===92?B:R)}function B(O){return O===92||O===124?(e.consume(O),R):R(O)}}function Hz(e,t){let n=-1,i=!0,l=0,s=[0,0,0,0],u=[0,0,0,0],c=!1,d=0,h,m,p;const y=new Dz;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(c=!1,d!==0&&(tb(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],u=[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,u[2]===0&&(s[1]!==0&&(u[0]=u[1],p=Xo(y,t,s,l,void 0,p),s=[0,0,0,0]),u[2]=n)):b.type==="tableCellDivider"&&(i?i=!1:(s[1]!==0&&(u[0]=u[1],p=Xo(y,t,s,l,void 0,p)),s=u,u=[s[1],n,0,0])):b.type==="tableHead"?(c=!0,d=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(d=n,s[1]!==0?(u[0]=u[1],p=Xo(y,t,s,l,n,p)):u[1]!==0&&(p=Xo(y,t,u,l,n,p)),l=0):l&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(u[3]=n)}for(d!==0&&tb(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=Lz(t.events,n))}return e}function Xo(e,t,n,i,l,s){const u=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},Ga(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const d=Ga(t.events,n[1]);if(s={type:u,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const h=Ga(t.events,n[2]),m=Ga(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({},Ga(t.events,l)),e.add(l,0,[["exit",s,t]]),s=void 0),s}function tb(e,t,n,i,l){const s=[],u=Ga(t.events,n);l&&(l.end=Object.assign({},u),s.push(["exit",l,t])),i.end=Object.assign({},u),s.push(["exit",i,t]),e.add(n+1,0,s)}function Ga(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const Uz={name:"tasklistCheck",tokenize:qz};function Pz(){return{text:{91:Uz}}}function qz(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"),u):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),u):n(d)}function u(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):Ve(d)?e.check({tokenize:Vz},t,n)(d):n(d)}}function Vz(e,t,n){return Ye(e,i,"whitespace");function i(l){return l===null?n(l):t(l)}}function $z(e){return L_([pz(),kz(),zz(e),Iz(),Pz()])}const Zz={};function Yz(e){const t=this,n=e||Zz,i=t.data(),l=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),u=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);l.push($z(n)),s.push(fz()),u.push(dz(n))}const Fz=({message:e})=>I.jsx("div",{className:"message ai",children:I.jsxs("div",{className:"message-content",children:[I.jsx("div",{className:"message-text markdown-body",children:I.jsx(zR,{remarkPlugins:[Yz],children:b_(e.content)})}),I.jsx(Ap,{response_metadata:e.response_metadata,usage_metadata:e.usage_metadata||{},spend_time:e.spend_time})]})}),Gz=({message:e,client:t,getMessageContent:n,formatTokens:i,isCollapsed:l,onToggleCollapse:s})=>{var u;return I.jsxs("div",{className:"message tool",children:[e.name==="ask_user"&&!((u=e.additional_kwargs)!=null&&u.done)&&I.jsxs("div",{children:[I.jsxs("div",{children:["询问 ",e.tool_input]}),I.jsx("input",{type:"text",onKeyDown:c=>{c.key==="Enter"&&t.doneFEToolWaiting(e.id,c.target.value)}})]}),I.jsxs("div",{className:"tool-message",children:[I.jsx("div",{className:"tool-header",onClick:s,children:I.jsx("div",{className:"tool-title",children: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(Ap,{response_metadata:e.response_metadata,usage_metadata:e.usage_metadata||{},spend_time:e.spend_time})]})]})]})},Tw=({renderMessages:e,collapsedTools:t,toggleToolCollapse:n,client:i})=>I.jsx(I.Fragment,{children:e.map(l=>l.type==="human"?I.jsx(BT,{content:l.content},l.unique_id):l.type==="tool"?I.jsx(Gz,{message:l,client:i,getMessageContent:b_,formatTokens:xA,isCollapsed:t.includes(l.id),onToggleCollapse:()=>n(l.id)},l.unique_id):I.jsx(Fz,{message:l},l.unique_id))}),Xz=localStorage.getItem("withCredentials")==="true"?(e,t)=>(t.credentials="include",fetch(e,t)):fetch,Qz=()=>({showHistory:localStorage.getItem("showHistory")==="true"||!1,showGraph:localStorage.getItem("showGraph")==="true"||!1}),nb=e=>{Object.entries(e).forEach(([t,n])=>{localStorage.setItem(t,n.toString())})},Kz=_A(localStorage.getItem("agent_name")||"",{apiUrl:localStorage.getItem("apiUrl")||"http://localhost:8123",defaultHeaders:JSON.parse(localStorage.getItem("code")||"{}"),callerOptions:{fetch:Xz}},{...Qz(),onInit(e){e.tools.bindTools([])}});let Yh=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function Jz(e,{keys:t,deps:n=[e,t]}={}){let i=ie.useRef();i.current=e.get();let l=ie.useCallback(u=>(Yh(i,u)(e.value),(t==null?void 0:t.length)>0?gA(e,t,Yh(i,u)):e.listen(Yh(i,u))),n),s=()=>i.current;return ie.useSyncExternalStore(l,s,s)}const Cw=ie.createContext(void 0),pu=()=>{const e=ie.useContext(Cw);if(!e)throw new Error("useChat must be used within a ChatProvider");return e},Wz=({children:e})=>{const t=wA(Kz,Jz);return ie.useEffect(()=>{t.initClient().then(n=>{t.showHistory&&t.refreshHistoryList(),console.log(n)})},[]),I.jsx(Cw.Provider,{value:t,children:e})},eD=({onClose:e,formatTime:t})=>{const{historyList:n,currentChatId:i,refreshHistoryList:l,createNewChat:s,deleteHistoryChat:u,toHistoryChat:c}=pu();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:bA(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 u(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
+ `})]})},Aw=ie.createContext(void 0),tD=({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(Aw.Provider,{value:{extraParams:t,setExtraParams:i},children:e})},Nw=()=>{const e=ie.useContext(Aw);if(e===void 0)throw new Error("useExtraParams must be used within an ExtraParamsProvider");return e};class nD{constructor(t={}){xt(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 u=await s.json();return this.processResponse(u)}catch(s){throw new Error(`File upload failed: ${s instanceof Error?s.message:String(s)}`)}}}class rD extends nD{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 iD=({onFileUploaded:e})=>{const[t,n]=ie.useState([]),i=new rD,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]),u=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:()=>u(d),children:"×"})]},d))})]})},aD=({isOpen:e,initialJson:t,onClose:n,onSave:i})=>{const[l,s]=ie.useState(""),[u,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}),u&&I.jsx("p",{className:"error-message",children:u}),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:"保存"})]})]})})},lD=({isOpen:e,onClose:t,initialJson:n})=>{const[i,l]=ie.useState(""),[s,u]=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),u(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),u(null)}catch(p){u("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(Tw,{renderMessages:c,collapsedTools:[],toggleToolCollapse:()=>{},client:null}):I.jsx("div",{className:"no-preview",children:"请输入有效的JSON以查看消息预览"})})})]})]})}):null},sD=({buttonText:e="JSON 预览",initialJson:t,className:n=""})=>{const[i,l]=ie.useState(!1),s=()=>l(!0),u=()=>l(!1);return I.jsxs(I.Fragment,{children:[I.jsx("button",{className:`history-button ${n}`,onClick:s,children:e}),I.jsx(lD,{isOpen:i,onClose:u,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 uD={value:()=>{}};function qc(){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 sc(n)}function sc(e){this._=e}function oD(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}})}sc.prototype=qc.prototype={constructor:sc,on:function(e,t){var n=this._,i=oD(e+"",n),l,s=-1,u=i.length;if(arguments.length<2){for(;++s<u;)if((l=(e=i[s]).type)&&(l=cD(n[l],e.name)))return l;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<u;)if(l=(e=i[s]).type)n[l]=rb(n[l],e.name,t);else if(t==null)for(l in n)n[l]=rb(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 sc(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 cD(e,t){for(var n=0,i=e.length,l;n<i;++n)if((l=e[n]).name===t)return l.value}function rb(e,t,n){for(var i=0,l=e.length;i<l;++i)if(e[i].name===t){e[i]=uD,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var mp="http://www.w3.org/1999/xhtml";const ib={svg:"http://www.w3.org/2000/svg",xhtml:mp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Vc(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ib.hasOwnProperty(t)?{space:ib[t],local:e}:e}function fD(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===mp&&t.documentElement.namespaceURI===mp?t.createElement(e):t.createElementNS(n,e)}}function dD(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Mw(e){var t=Vc(e);return(t.local?dD:fD)(t)}function hD(){}function Gp(e){return e==null?hD:function(){return this.querySelector(e)}}function mD(e){typeof e!="function"&&(e=Gp(e));for(var t=this._groups,n=t.length,i=new Array(n),l=0;l<n;++l)for(var s=t[l],u=s.length,c=i[l]=new Array(u),d,h,m=0;m<u;++m)(d=s[m])&&(h=e.call(d,d.__data__,m,s))&&("__data__"in d&&(h.__data__=d.__data__),c[m]=h);return new xn(i,this._parents)}function pD(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function gD(){return[]}function Ow(e){return e==null?gD:function(){return this.querySelectorAll(e)}}function yD(e){return function(){return pD(e.apply(this,arguments))}}function vD(e){typeof e=="function"?e=yD(e):e=Ow(e);for(var t=this._groups,n=t.length,i=[],l=[],s=0;s<n;++s)for(var u=t[s],c=u.length,d,h=0;h<c;++h)(d=u[h])&&(i.push(e.call(d,d.__data__,h,u)),l.push(d));return new xn(i,l)}function Rw(e){return function(){return this.matches(e)}}function zw(e){return function(t){return t.matches(e)}}var xD=Array.prototype.find;function bD(e){return function(){return xD.call(this.children,e)}}function _D(){return this.firstElementChild}function wD(e){return this.select(e==null?_D:bD(typeof e=="function"?e:zw(e)))}var SD=Array.prototype.filter;function ED(){return Array.from(this.children)}function kD(e){return function(){return SD.call(this.children,e)}}function TD(e){return this.selectAll(e==null?ED:kD(typeof e=="function"?e:zw(e)))}function CD(e){typeof e!="function"&&(e=Rw(e));for(var t=this._groups,n=t.length,i=new Array(n),l=0;l<n;++l)for(var s=t[l],u=s.length,c=i[l]=[],d,h=0;h<u;++h)(d=s[h])&&e.call(d,d.__data__,h,s)&&c.push(d);return new xn(i,this._parents)}function Dw(e){return new Array(e.length)}function AD(){return new xn(this._enter||this._groups.map(Dw),this._parents)}function Sc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Sc.prototype={constructor:Sc,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 ND(e){return function(){return e}}function MD(e,t,n,i,l,s){for(var u=0,c,d=t.length,h=s.length;u<h;++u)(c=t[u])?(c.__data__=s[u],i[u]=c):n[u]=new Sc(e,s[u]);for(;u<d;++u)(c=t[u])&&(l[u]=c)}function OD(e,t,n,i,l,s,u){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=u.call(d,d.__data__,c,t)+"",h.has(v)?l[c]=d:h.set(v,d));for(c=0;c<p;++c)v=u.call(e,s[c],c,s)+"",(d=h.get(v))?(i[c]=d,d.__data__=s[c],h.delete(v)):n[c]=new Sc(e,s[c]);for(c=0;c<m;++c)(d=t[c])&&h.get(y[c])===d&&(l[c]=d)}function RD(e){return e.__data__}function zD(e,t){if(!arguments.length)return Array.from(this,RD);var n=t?OD:MD,i=this._parents,l=this._groups;typeof e!="function"&&(e=ND(e));for(var s=l.length,u=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=DD(e.call(m,m&&m.__data__,h,i)),b=v.length,_=c[h]=new Array(b),S=u[h]=new Array(b),k=d[h]=new Array(y);n(m,p,_,S,k,v,t);for(var A=0,E=0,N,j;A<b;++A)if(N=_[A]){for(A>=E&&(E=A+1);!(j=S[E])&&++E<b;);N._next=j||null}}return u=new xn(u,i),u._enter=c,u._exit=d,u}function DD(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jD(){return new xn(this._exit||this._groups.map(Dw),this._parents)}function LD(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 ID(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,l=n.length,s=i.length,u=Math.min(l,s),c=new Array(l),d=0;d<u;++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 xn(c,this._parents)}function BD(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],l=i.length-1,s=i[l],u;--l>=0;)(u=i[l])&&(s&&u.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(u,s),s=u);return this}function HD(e){e||(e=UD);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 u=n[s],c=u.length,d=l[s]=new Array(c),h,m=0;m<c;++m)(h=u[m])&&(d[m]=h);d.sort(t)}return new xn(l,this._parents).order()}function UD(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function PD(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function qD(){return Array.from(this)}function VD(){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 u=i[l];if(u)return u}return null}function $D(){let e=0;for(const t of this)++e;return e}function ZD(){return!this.node()}function YD(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var l=t[n],s=0,u=l.length,c;s<u;++s)(c=l[s])&&e.call(c,c.__data__,s,l);return this}function FD(e){return function(){this.removeAttribute(e)}}function GD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function XD(e,t){return function(){this.setAttribute(e,t)}}function QD(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function KD(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function JD(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 WD(e,t){var n=Vc(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?GD:FD:typeof t=="function"?n.local?JD:KD:n.local?QD:XD)(n,t))}function jw(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function e3(e){return function(){this.style.removeProperty(e)}}function t3(e,t,n){return function(){this.style.setProperty(e,t,n)}}function n3(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function r3(e,t,n){return arguments.length>1?this.each((t==null?e3:typeof t=="function"?n3:t3)(e,t,n??"")):ll(this.node(),e)}function ll(e,t){return e.style.getPropertyValue(t)||jw(e).getComputedStyle(e,null).getPropertyValue(t)}function i3(e){return function(){delete this[e]}}function a3(e,t){return function(){this[e]=t}}function l3(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function s3(e,t){return arguments.length>1?this.each((t==null?i3:typeof t=="function"?l3:a3)(e,t)):this.node()[e]}function Lw(e){return e.trim().split(/^|\s+/)}function Xp(e){return e.classList||new Iw(e)}function Iw(e){this._node=e,this._names=Lw(e.getAttribute("class")||"")}Iw.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 Bw(e,t){for(var n=Xp(e),i=-1,l=t.length;++i<l;)n.add(t[i])}function Hw(e,t){for(var n=Xp(e),i=-1,l=t.length;++i<l;)n.remove(t[i])}function u3(e){return function(){Bw(this,e)}}function o3(e){return function(){Hw(this,e)}}function c3(e,t){return function(){(t.apply(this,arguments)?Bw:Hw)(this,e)}}function f3(e,t){var n=Lw(e+"");if(arguments.length<2){for(var i=Xp(this.node()),l=-1,s=n.length;++l<s;)if(!i.contains(n[l]))return!1;return!0}return this.each((typeof t=="function"?c3:t?u3:o3)(n,t))}function d3(){this.textContent=""}function h3(e){return function(){this.textContent=e}}function m3(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function p3(e){return arguments.length?this.each(e==null?d3:(typeof e=="function"?m3:h3)(e)):this.node().textContent}function g3(){this.innerHTML=""}function y3(e){return function(){this.innerHTML=e}}function v3(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function x3(e){return arguments.length?this.each(e==null?g3:(typeof e=="function"?v3:y3)(e)):this.node().innerHTML}function b3(){this.nextSibling&&this.parentNode.appendChild(this)}function _3(){return this.each(b3)}function w3(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function S3(){return this.each(w3)}function E3(e){var t=typeof e=="function"?e:Mw(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function k3(){return null}function T3(e,t){var n=typeof e=="function"?e:Mw(e),i=t==null?k3:typeof t=="function"?t:Gp(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function C3(){var e=this.parentNode;e&&e.removeChild(this)}function A3(){return this.each(C3)}function N3(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function M3(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function O3(e){return this.select(e?M3:N3)}function R3(e){return arguments.length?this.property("__data__",e):this.node().__data__}function z3(e){return function(t){e.call(this,t,this.__data__)}}function D3(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 j3(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 L3(e,t,n){return function(){var i=this.__on,l,s=z3(t);if(i){for(var u=0,c=i.length;u<c;++u)if((l=i[u]).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 I3(e,t,n){var i=D3(e+""),l,s=i.length,u;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((u=i[l]).type===m.type&&u.name===m.name)return m.value}return}for(c=t?L3:j3,l=0;l<s;++l)this.each(c(i[l],t,n));return this}function Uw(e,t,n){var i=jw(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 B3(e,t){return function(){return Uw(this,e,t)}}function H3(e,t){return function(){return Uw(this,e,t.apply(this,arguments))}}function U3(e,t){return this.each((typeof t=="function"?H3:B3)(e,t))}function*P3(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],l=0,s=i.length,u;l<s;++l)(u=i[l])&&(yield u)}var Pw=[null];function xn(e,t){this._groups=e,this._parents=t}function gu(){return new xn([[document.documentElement]],Pw)}function q3(){return this}xn.prototype=gu.prototype={constructor:xn,select:mD,selectAll:vD,selectChild:wD,selectChildren:TD,filter:CD,data:zD,enter:AD,exit:jD,join:LD,merge:ID,selection:q3,order:BD,sort:HD,call:PD,nodes:qD,node:VD,size:$D,empty:ZD,each:YD,attr:WD,style:r3,property:s3,classed:f3,text:p3,html:x3,raise:_3,lower:S3,append:E3,insert:T3,remove:A3,clone:O3,datum:R3,on:I3,dispatch:U3,[Symbol.iterator]:P3};function gn(e){return typeof e=="string"?new xn([[document.querySelector(e)]],[document.documentElement]):new xn([[e]],Pw)}function V3(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Hn(e,t){if(e=V3(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 $3={passive:!1},eu={capture:!0,passive:!1};function Fh(e){e.stopImmediatePropagation()}function el(e){e.preventDefault(),e.stopImmediatePropagation()}function qw(e){var t=e.document.documentElement,n=gn(e).on("dragstart.drag",el,eu);"onselectstart"in t?n.on("selectstart.drag",el,eu):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Vw(e,t){var n=e.document.documentElement,i=gn(e).on("dragstart.drag",null);t&&(i.on("click.drag",el,eu),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 Qo=e=>()=>e;function pp(e,{sourceEvent:t,subject:n,target:i,identifier:l,active:s,x:u,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:u,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}})}pp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Z3(e){return!e.ctrlKey&&!e.button}function Y3(){return this.parentNode}function F3(e,t){return t??{x:e.x,y:e.y}}function G3(){return navigator.maxTouchPoints||"ontouchstart"in this}function $w(){var e=Z3,t=Y3,n=F3,i=G3,l={},s=qc("start","drag","end"),u=0,c,d,h,m,p=0;function y(N){N.on("mousedown.drag",v).filter(i).on("touchstart.drag",S).on("touchmove.drag",k,$3).on("touchend.drag touchcancel.drag",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(N,j){if(!(m||!e.call(this,N,j))){var M=E(this,t.call(this,N,j),N,j,"mouse");M&&(gn(N.view).on("mousemove.drag",b,eu).on("mouseup.drag",_,eu),qw(N.view),Fh(N),h=!1,c=N.clientX,d=N.clientY,M("start",N))}}function b(N){if(el(N),!h){var j=N.clientX-c,M=N.clientY-d;h=j*j+M*M>p}l.mouse("drag",N)}function _(N){gn(N.view).on("mousemove.drag mouseup.drag",null),Vw(N.view,h),el(N),l.mouse("end",N)}function S(N,j){if(e.call(this,N,j)){var M=N.changedTouches,U=t.call(this,N,j),R=M.length,B,O;for(B=0;B<R;++B)(O=E(this,U,N,j,M[B].identifier,M[B]))&&(Fh(N),O("start",N,M[B]))}}function k(N){var j=N.changedTouches,M=j.length,U,R;for(U=0;U<M;++U)(R=l[j[U].identifier])&&(el(N),R("drag",N,j[U]))}function A(N){var j=N.changedTouches,M=j.length,U,R;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),U=0;U<M;++U)(R=l[j[U].identifier])&&(Fh(N),R("end",N,j[U]))}function E(N,j,M,U,R,B){var O=s.copy(),H=Hn(B||M,j),P,F,z;if((z=n.call(N,new pp("beforestart",{sourceEvent:M,target:y,identifier:R,active:u,x:H[0],y:H[1],dx:0,dy:0,dispatch:O}),U))!=null)return P=z.x-H[0]||0,F=z.y-H[1]||0,function $(L,q,K){var X=H,w;switch(L){case"start":l[R]=$,w=u++;break;case"end":delete l[R],--u;case"drag":H=Hn(K||q,j),w=u;break}O.call(L,N,new pp(L,{sourceEvent:q,subject:z,target:y,identifier:R,active:w,x:H[0]+P,y:H[1]+F,dx:H[0]-X[0],dy:H[1]-X[1],dispatch:O}),U)}}return y.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Qo(!!N),y):e},y.container=function(N){return arguments.length?(t=typeof N=="function"?N:Qo(N),y):t},y.subject=function(N){return arguments.length?(n=typeof N=="function"?N:Qo(N),y):n},y.touchable=function(N){return arguments.length?(i=typeof N=="function"?N:Qo(!!N),y):i},y.on=function(){var N=s.on.apply(s,arguments);return N===s?y:N},y.clickDistance=function(N){return arguments.length?(p=(N=+N)*N,y):Math.sqrt(p)},y}function Qp(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Zw(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function yu(){}var tu=.7,Ec=1/tu,tl="\\s*([+-]?\\d+)\\s*",nu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ar="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",X3=/^#([0-9a-f]{3,8})$/,Q3=new RegExp(`^rgb\\(${tl},${tl},${tl}\\)$`),K3=new RegExp(`^rgb\\(${ar},${ar},${ar}\\)$`),J3=new RegExp(`^rgba\\(${tl},${tl},${tl},${nu}\\)$`),W3=new RegExp(`^rgba\\(${ar},${ar},${ar},${nu}\\)$`),ej=new RegExp(`^hsl\\(${nu},${ar},${ar}\\)$`),tj=new RegExp(`^hsla\\(${nu},${ar},${ar},${nu}\\)$`),ab={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};Qp(yu,ru,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:lb,formatHex:lb,formatHex8:nj,formatHsl:rj,formatRgb:sb,toString:sb});function lb(){return this.rgb().formatHex()}function nj(){return this.rgb().formatHex8()}function rj(){return Yw(this).formatHsl()}function sb(){return this.rgb().formatRgb()}function ru(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=X3.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ub(t):n===3?new an(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ko(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ko(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=Q3.exec(e))?new an(t[1],t[2],t[3],1):(t=K3.exec(e))?new an(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=J3.exec(e))?Ko(t[1],t[2],t[3],t[4]):(t=W3.exec(e))?Ko(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ej.exec(e))?fb(t[1],t[2]/100,t[3]/100,1):(t=tj.exec(e))?fb(t[1],t[2]/100,t[3]/100,t[4]):ab.hasOwnProperty(e)?ub(ab[e]):e==="transparent"?new an(NaN,NaN,NaN,0):null}function ub(e){return new an(e>>16&255,e>>8&255,e&255,1)}function Ko(e,t,n,i){return i<=0&&(e=t=n=NaN),new an(e,t,n,i)}function ij(e){return e instanceof yu||(e=ru(e)),e?(e=e.rgb(),new an(e.r,e.g,e.b,e.opacity)):new an}function gp(e,t,n,i){return arguments.length===1?ij(e):new an(e,t,n,i??1)}function an(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}Qp(an,gp,Zw(yu,{brighter(e){return e=e==null?Ec:Math.pow(Ec,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tu:Math.pow(tu,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new an(Ki(this.r),Ki(this.g),Ki(this.b),kc(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:ob,formatHex:ob,formatHex8:aj,formatRgb:cb,toString:cb}));function ob(){return`#${Xi(this.r)}${Xi(this.g)}${Xi(this.b)}`}function aj(){return`#${Xi(this.r)}${Xi(this.g)}${Xi(this.b)}${Xi((isNaN(this.opacity)?1:this.opacity)*255)}`}function cb(){const e=kc(this.opacity);return`${e===1?"rgb(":"rgba("}${Ki(this.r)}, ${Ki(this.g)}, ${Ki(this.b)}${e===1?")":`, ${e})`}`}function kc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ki(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xi(e){return e=Ki(e),(e<16?"0":"")+e.toString(16)}function fb(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Un(e,t,n,i)}function Yw(e){if(e instanceof Un)return new Un(e.h,e.s,e.l,e.opacity);if(e instanceof yu||(e=ru(e)),!e)return new Un;if(e instanceof Un)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),u=NaN,c=s-l,d=(s+l)/2;return c?(t===s?u=(n-i)/c+(n<i)*6:n===s?u=(i-t)/c+2:u=(t-n)/c+4,c/=d<.5?s+l:2-s-l,u*=60):c=d>0&&d<1?0:u,new Un(u,c,d,e.opacity)}function lj(e,t,n,i){return arguments.length===1?Yw(e):new Un(e,t,n,i??1)}function Un(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Qp(Un,lj,Zw(yu,{brighter(e){return e=e==null?Ec:Math.pow(Ec,e),new Un(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tu:Math.pow(tu,e),new Un(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 an(Gh(e>=240?e-240:e+120,l,i),Gh(e,l,i),Gh(e<120?e+240:e-120,l,i),this.opacity)},clamp(){return new Un(db(this.h),Jo(this.s),Jo(this.l),kc(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=kc(this.opacity);return`${e===1?"hsl(":"hsla("}${db(this.h)}, ${Jo(this.s)*100}%, ${Jo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function db(e){return e=(e||0)%360,e<0?e+360:e}function Jo(e){return Math.max(0,Math.min(1,e||0))}function Gh(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 Fw=e=>()=>e;function sj(e,t){return function(n){return e+n*t}}function uj(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 oj(e){return(e=+e)==1?Gw:function(t,n){return n-t?uj(t,n,e):Fw(isNaN(t)?n:t)}}function Gw(e,t){var n=t-e;return n?sj(e,n):Fw(isNaN(e)?t:e)}const hb=function e(t){var n=oj(t);function i(l,s){var u=n((l=gp(l)).r,(s=gp(s)).r),c=n(l.g,s.g),d=n(l.b,s.b),h=Gw(l.opacity,s.opacity);return function(m){return l.r=u(m),l.g=c(m),l.b=d(m),l.opacity=h(m),l+""}}return i.gamma=e,i}(1);function yi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var yp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xh=new RegExp(yp.source,"g");function cj(e){return function(){return e}}function fj(e){return function(t){return e(t)+""}}function dj(e,t){var n=yp.lastIndex=Xh.lastIndex=0,i,l,s,u=-1,c=[],d=[];for(e=e+"",t=t+"";(i=yp.exec(e))&&(l=Xh.exec(t));)(s=l.index)>n&&(s=t.slice(n,s),c[u]?c[u]+=s:c[++u]=s),(i=i[0])===(l=l[0])?c[u]?c[u]+=l:c[++u]=l:(c[++u]=null,d.push({i:u,x:yi(i,l)})),n=Xh.lastIndex;return n<t.length&&(s=t.slice(n),c[u]?c[u]+=s:c[++u]=s),c.length<2?d[0]?fj(d[0].x):cj(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 mb=180/Math.PI,vp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xw(e,t,n,i,l,s){var u,c,d;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(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,u=-u),{translateX:l,translateY:s,rotate:Math.atan2(t,e)*mb,skewX:Math.atan(d)*mb,scaleX:u,scaleY:c}}var Wo;function hj(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?vp:Xw(t.a,t.b,t.c,t.d,t.e,t.f)}function mj(e){return e==null||(Wo||(Wo=document.createElementNS("http://www.w3.org/2000/svg","g")),Wo.setAttribute("transform",e),!(e=Wo.transform.baseVal.consolidate()))?vp:(e=e.matrix,Xw(e.a,e.b,e.c,e.d,e.e,e.f))}function Qw(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:yi(h,p)},{i:_-2,x:yi(m,y)})}else(p||y)&&v.push("translate("+p+t+y+n)}function u(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:yi(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:yi(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:yi(h,p)},{i:_-2,x:yi(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),u(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 pj=Qw(hj,"px, ","px)","deg)"),gj=Qw(mj,", ",")",")"),yj=1e-12;function pb(e){return((e=Math.exp(e))+1/e)/2}function vj(e){return((e=Math.exp(e))-1/e)/2}function xj(e){return((e=Math.exp(2*e))-1)/(e+1)}const bj=function e(t,n,i){function l(s,u){var c=s[0],d=s[1],h=s[2],m=u[0],p=u[1],y=u[2],v=m-c,b=p-d,_=v*v+b*b,S,k;if(_<yj)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),N=(y*y-h*h-i*_)/(2*y*n*A),j=Math.log(Math.sqrt(E*E+1)-E),M=Math.log(Math.sqrt(N*N+1)-N);k=(M-j)/t,S=function(U){var R=U*k,B=pb(j),O=h/(n*A)*(B*xj(t*R+j)-vj(j));return[c+O*v,d+O*b,h*B/pb(t*R+j)]}}return S.duration=k*1e3*t/Math.SQRT2,S}return l.rho=function(s){var u=Math.max(.001,+s),c=u*u,d=c*c;return e(u,c,d)},l}(Math.SQRT2,2,4);var sl=0,Ms=0,ks=0,Kw=1e3,Tc,Os,Cc=0,ra=0,$c=0,iu=typeof performance=="object"&&performance.now?performance:Date,Jw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Kp(){return ra||(Jw(_j),ra=iu.now()+$c)}function _j(){ra=0}function Ac(){this._call=this._time=this._next=null}Ac.prototype=Ww.prototype={constructor:Ac,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Kp():+n)+(t==null?0:+t),!this._next&&Os!==this&&(Os?Os._next=this:Tc=this,Os=this),this._call=e,this._time=n,xp()},stop:function(){this._call&&(this._call=null,this._time=1/0,xp())}};function Ww(e,t,n){var i=new Ac;return i.restart(e,t,n),i}function wj(){Kp(),++sl;for(var e=Tc,t;e;)(t=ra-e._time)>=0&&e._call.call(void 0,t),e=e._next;--sl}function gb(){ra=(Cc=iu.now())+$c,sl=Ms=0;try{wj()}finally{sl=0,Ej(),ra=0}}function Sj(){var e=iu.now(),t=e-Cc;t>Kw&&($c-=t,Cc=e)}function Ej(){for(var e,t=Tc,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:Tc=n);Os=e,xp(i)}function xp(e){if(!sl){Ms&&(Ms=clearTimeout(Ms));var t=e-ra;t>24?(e<1/0&&(Ms=setTimeout(gb,e-iu.now()-$c)),ks&&(ks=clearInterval(ks))):(ks||(Cc=iu.now(),ks=setInterval(Sj,Kw)),sl=1,Jw(gb))}}function yb(e,t,n){var i=new Ac;return t=t==null?0:+t,i.restart(l=>{i.stop(),e(l+t)},t,n),i}var kj=qc("start","end","cancel","interrupt"),Tj=[],eS=0,vb=1,bp=2,uc=3,xb=4,_p=5,oc=6;function Zc(e,t,n,i,l,s){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;Cj(e,n,{name:t,index:i,group:l,on:kj,tween:Tj,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:eS})}function Jp(e,t){var n=Gn(e,t);if(n.state>eS)throw new Error("too late; already scheduled");return n}function cr(e,t){var n=Gn(e,t);if(n.state>uc)throw new Error("too late; already running");return n}function Gn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Cj(e,t,n){var i=e.__transition,l;i[t]=n,n.timer=Ww(s,0,n.time);function s(h){n.state=vb,n.timer.restart(u,n.delay,n.time),n.delay<=h&&u(h-n.delay)}function u(h){var m,p,y,v;if(n.state!==vb)return d();for(m in i)if(v=i[m],v.name===n.name){if(v.state===uc)return yb(u);v.state===xb?(v.state=oc,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete i[m]):+m<t&&(v.state=oc,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete i[m])}if(yb(function(){n.state===uc&&(n.state=xb,n.timer.restart(c,n.delay,n.time),c(h))}),n.state=bp,n.on.call("start",e,e.__data__,n.index,n.group),n.state===bp){for(n.state=uc,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=_p,1),p=-1,y=l.length;++p<y;)l[p].call(e,m);n.state===_p&&(n.on.call("end",e,e.__data__,n.index,n.group),d())}function d(){n.state=oc,n.timer.stop(),delete i[t];for(var h in i)return;delete e.__transition}}function cc(e,t){var n=e.__transition,i,l,s=!0,u;if(n){t=t==null?null:t+"";for(u in n){if((i=n[u]).name!==t){s=!1;continue}l=i.state>bp&&i.state<_p,i.state=oc,i.timer.stop(),i.on.call(l?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[u]}s&&delete e.__transition}}function Aj(e){return this.each(function(){cc(this,e)})}function Nj(e,t){var n,i;return function(){var l=cr(this,e),s=l.tween;if(s!==n){i=n=s;for(var u=0,c=i.length;u<c;++u)if(i[u].name===t){i=i.slice(),i.splice(u,1);break}}l.tween=i}}function Mj(e,t,n){var i,l;if(typeof n!="function")throw new Error;return function(){var s=cr(this,e),u=s.tween;if(u!==i){l=(i=u).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 Oj(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=Gn(this.node(),n).tween,l=0,s=i.length,u;l<s;++l)if((u=i[l]).name===e)return u.value;return null}return this.each((t==null?Nj:Mj)(n,e,t))}function Wp(e,t,n){var i=e._id;return e.each(function(){var l=cr(this,i);(l.value||(l.value={}))[t]=n.apply(this,arguments)}),function(l){return Gn(l,i).value[t]}}function tS(e,t){var n;return(typeof t=="number"?yi:t instanceof ru?hb:(n=ru(t))?(t=n,hb):dj)(e,t)}function Rj(e){return function(){this.removeAttribute(e)}}function zj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dj(e,t,n){var i,l=n+"",s;return function(){var u=this.getAttribute(e);return u===l?null:u===i?s:s=t(i=u,n)}}function jj(e,t,n){var i,l=n+"",s;return function(){var u=this.getAttributeNS(e.space,e.local);return u===l?null:u===i?s:s=t(i=u,n)}}function Lj(e,t,n){var i,l,s;return function(){var u,c=n(this),d;return c==null?void this.removeAttribute(e):(u=this.getAttribute(e),d=c+"",u===d?null:u===i&&d===l?s:(l=d,s=t(i=u,c)))}}function Ij(e,t,n){var i,l,s;return function(){var u,c=n(this),d;return c==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),d=c+"",u===d?null:u===i&&d===l?s:(l=d,s=t(i=u,c)))}}function Bj(e,t){var n=Vc(e),i=n==="transform"?gj:tS;return this.attrTween(e,typeof t=="function"?(n.local?Ij:Lj)(n,i,Wp(this,"attr."+e,t)):t==null?(n.local?zj:Rj)(n):(n.local?jj:Dj)(n,i,t))}function Hj(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Uj(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Pj(e,t){var n,i;function l(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&Uj(e,s)),n}return l._value=t,l}function qj(e,t){var n,i;function l(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&Hj(e,s)),n}return l._value=t,l}function Vj(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=Vc(e);return this.tween(n,(i.local?Pj:qj)(i,t))}function $j(e,t){return function(){Jp(this,e).delay=+t.apply(this,arguments)}}function Zj(e,t){return t=+t,function(){Jp(this,e).delay=t}}function Yj(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$j:Zj)(t,e)):Gn(this.node(),t).delay}function Fj(e,t){return function(){cr(this,e).duration=+t.apply(this,arguments)}}function Gj(e,t){return t=+t,function(){cr(this,e).duration=t}}function Xj(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Fj:Gj)(t,e)):Gn(this.node(),t).duration}function Qj(e,t){if(typeof t!="function")throw new Error;return function(){cr(this,e).ease=t}}function Kj(e){var t=this._id;return arguments.length?this.each(Qj(t,e)):Gn(this.node(),t).ease}function Jj(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;cr(this,e).ease=n}}function Wj(e){if(typeof e!="function")throw new Error;return this.each(Jj(this._id,e))}function e9(e){typeof e!="function"&&(e=Rw(e));for(var t=this._groups,n=t.length,i=new Array(n),l=0;l<n;++l)for(var s=t[l],u=s.length,c=i[l]=[],d,h=0;h<u;++h)(d=s[h])&&e.call(d,d.__data__,h,s)&&c.push(d);return new Lr(i,this._parents,this._name,this._id)}function t9(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),u=new Array(i),c=0;c<s;++c)for(var d=t[c],h=n[c],m=d.length,p=u[c]=new Array(m),y,v=0;v<m;++v)(y=d[v]||h[v])&&(p[v]=y);for(;c<i;++c)u[c]=t[c];return new Lr(u,this._parents,this._name,this._id)}function n9(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 r9(e,t,n){var i,l,s=n9(t)?Jp:cr;return function(){var u=s(this,e),c=u.on;c!==i&&(l=(i=c).copy()).on(t,n),u.on=l}}function i9(e,t){var n=this._id;return arguments.length<2?Gn(this.node(),n).on.on(e):this.each(r9(n,e,t))}function a9(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function l9(){return this.on("end.remove",a9(this._id))}function s9(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Gp(e));for(var i=this._groups,l=i.length,s=new Array(l),u=0;u<l;++u)for(var c=i[u],d=c.length,h=s[u]=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,Zc(h[y],t,n,y,h,Gn(m,n)));return new Lr(s,this._parents,t,n)}function u9(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ow(e));for(var i=this._groups,l=i.length,s=[],u=[],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=Gn(m,n),_=0,S=y.length;_<S;++_)(v=y[_])&&Zc(v,t,n,_,y,b);s.push(y),u.push(m)}return new Lr(s,u,t,n)}var o9=gu.prototype.constructor;function c9(){return new o9(this._groups,this._parents)}function f9(e,t){var n,i,l;return function(){var s=ll(this,e),u=(this.style.removeProperty(e),ll(this,e));return s===u?null:s===n&&u===i?l:l=t(n=s,i=u)}}function nS(e){return function(){this.style.removeProperty(e)}}function d9(e,t,n){var i,l=n+"",s;return function(){var u=ll(this,e);return u===l?null:u===i?s:s=t(i=u,n)}}function h9(e,t,n){var i,l,s;return function(){var u=ll(this,e),c=n(this),d=c+"";return c==null&&(d=c=(this.style.removeProperty(e),ll(this,e))),u===d?null:u===i&&d===l?s:(l=d,s=t(i=u,c))}}function m9(e,t){var n,i,l,s="style."+t,u="end."+s,c;return function(){var d=cr(this,e),h=d.on,m=d.value[s]==null?c||(c=nS(t)):void 0;(h!==n||l!==m)&&(i=(n=h).copy()).on(u,l=m),d.on=i}}function p9(e,t,n){var i=(e+="")=="transform"?pj:tS;return t==null?this.styleTween(e,f9(e,i)).on("end.style."+e,nS(e)):typeof t=="function"?this.styleTween(e,h9(e,i,Wp(this,"style."+e,t))).each(m9(this._id,e)):this.styleTween(e,d9(e,i,t),n).on("end.style."+e,null)}function g9(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function y9(e,t,n){var i,l;function s(){var u=t.apply(this,arguments);return u!==l&&(i=(l=u)&&g9(e,u,n)),i}return s._value=t,s}function v9(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,y9(e,t,n??""))}function x9(e){return function(){this.textContent=e}}function b9(e){return function(){var t=e(this);this.textContent=t??""}}function _9(e){return this.tween("text",typeof e=="function"?b9(Wp(this,"text",e)):x9(e==null?"":e+""))}function w9(e){return function(t){this.textContent=e.call(this,t)}}function S9(e){var t,n;function i(){var l=e.apply(this,arguments);return l!==n&&(t=(n=l)&&w9(l)),t}return i._value=e,i}function E9(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,S9(e))}function k9(){for(var e=this._name,t=this._id,n=rS(),i=this._groups,l=i.length,s=0;s<l;++s)for(var u=i[s],c=u.length,d,h=0;h<c;++h)if(d=u[h]){var m=Gn(d,t);Zc(d,e,n,h,u,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Lr(i,this._parents,e,n)}function T9(){var e,t,n=this,i=n._id,l=n.size();return new Promise(function(s,u){var c={value:u},d={value:function(){--l===0&&s()}};n.each(function(){var h=cr(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 C9=0;function Lr(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function rS(){return++C9}var Mr=gu.prototype;Lr.prototype={constructor:Lr,select:s9,selectAll:u9,selectChild:Mr.selectChild,selectChildren:Mr.selectChildren,filter:e9,merge:t9,selection:c9,transition:k9,call:Mr.call,nodes:Mr.nodes,node:Mr.node,size:Mr.size,empty:Mr.empty,each:Mr.each,on:i9,attr:Bj,attrTween:Vj,style:p9,styleTween:v9,text:_9,textTween:E9,remove:l9,tween:Oj,delay:Yj,duration:Xj,ease:Kj,easeVarying:Wj,end:T9,[Symbol.iterator]:Mr[Symbol.iterator]};function A9(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var N9={time:null,delay:0,duration:250,ease:A9};function M9(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 O9(e){var t,n;e instanceof Lr?(t=e._id,e=e._name):(t=rS(),(n=N9).time=Kp(),e=e==null?null:e+"");for(var i=this._groups,l=i.length,s=0;s<l;++s)for(var u=i[s],c=u.length,d,h=0;h<c;++h)(d=u[h])&&Zc(d,e,t,h,u,n||M9(d,t));return new Lr(i,this._parents,e,t)}gu.prototype.interrupt=Aj;gu.prototype.transition=O9;const ec=e=>()=>e;function R9(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 zr(e,t,n){this.k=e,this.x=t,this.y=n}zr.prototype={constructor:zr,scale:function(e){return e===1?this:new zr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new zr(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 Yc=new zr(1,0,0);iS.prototype=zr.prototype;function iS(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Yc;return e.__zoom}function Qh(e){e.stopImmediatePropagation()}function Ts(e){e.preventDefault(),e.stopImmediatePropagation()}function z9(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function D9(){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 bb(){return this.__zoom||Yc}function j9(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function L9(){return navigator.maxTouchPoints||"ontouchstart"in this}function I9(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],u=e.invertY(t[1][1])-n[1][1];return e.translate(l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l),u>s?(s+u)/2:Math.min(0,s)||Math.max(0,u))}function aS(){var e=z9,t=D9,n=I9,i=j9,l=L9,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,d=bj,h=qc("start","zoom","end"),m,p,y,v=500,b=150,_=0,S=10;function k(z){z.property("__zoom",bb).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",O).filter(l).on("touchstart.zoom",H).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(z,$,L,q){var K=z.selection?z.selection():z;K.property("__zoom",bb),z!==K?j(z,$,L,q):K.interrupt().each(function(){M(this,arguments).event(q).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},k.scaleBy=function(z,$,L,q){k.scaleTo(z,function(){var K=this.__zoom.k,X=typeof $=="function"?$.apply(this,arguments):$;return K*X},L,q)},k.scaleTo=function(z,$,L,q){k.transform(z,function(){var K=t.apply(this,arguments),X=this.__zoom,w=L==null?N(K):typeof L=="function"?L.apply(this,arguments):L,Z=X.invert(w),te=typeof $=="function"?$.apply(this,arguments):$;return n(E(A(X,te),w,Z),K,u)},L,q)},k.translateBy=function(z,$,L,q){k.transform(z,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof L=="function"?L.apply(this,arguments):L),t.apply(this,arguments),u)},null,q)},k.translateTo=function(z,$,L,q,K){k.transform(z,function(){var X=t.apply(this,arguments),w=this.__zoom,Z=q==null?N(X):typeof q=="function"?q.apply(this,arguments):q;return n(Yc.translate(Z[0],Z[1]).scale(w.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof L=="function"?-L.apply(this,arguments):-L),X,u)},q,K)};function A(z,$){return $=Math.max(s[0],Math.min(s[1],$)),$===z.k?z:new zr($,z.x,z.y)}function E(z,$,L){var q=$[0]-L[0]*z.k,K=$[1]-L[1]*z.k;return q===z.x&&K===z.y?z:new zr(z.k,q,K)}function N(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function j(z,$,L,q){z.on("start.zoom",function(){M(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(q).end()}).tween("zoom",function(){var K=this,X=arguments,w=M(K,X).event(q),Z=t.apply(K,X),te=L==null?N(Z):typeof L=="function"?L.apply(K,X):L,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 zr(ge,te[0]-ce[0]*ge,te[1]-ce[1]*ge)}w.zoom(null,ue)}})}function M(z,$,L){return!L&&z.__zooming||new U(z,$)}function U(z,$){this.that=z,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(z,$),this.taps=0}U.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,$){return this.mouse&&z!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&z!=="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(z){var $=gn(this.that).datum();h.call(z,this.that,new R9(z,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:h}),$)}};function R(z,...$){if(!e.apply(this,arguments))return;var L=M(this,$).event(z),q=this.__zoom,K=Math.max(s[0],Math.min(s[1],q.k*Math.pow(2,i.apply(this,arguments)))),X=Hn(z);if(L.wheel)(L.mouse[0][0]!==X[0]||L.mouse[0][1]!==X[1])&&(L.mouse[1]=q.invert(L.mouse[0]=X)),clearTimeout(L.wheel);else{if(q.k===K)return;L.mouse=[X,q.invert(X)],cc(this),L.start()}Ts(z),L.wheel=setTimeout(w,b),L.zoom("mouse",n(E(A(q,K),L.mouse[0],L.mouse[1]),L.extent,u));function w(){L.wheel=null,L.end()}}function B(z,...$){if(y||!e.apply(this,arguments))return;var L=z.currentTarget,q=M(this,$,!0).event(z),K=gn(z.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",C,!0),X=Hn(z,L),w=z.clientX,Z=z.clientY;qw(z.view),Qh(z),q.mouse=[X,this.__zoom.invert(X)],cc(this),q.start();function te(Y){if(Ts(Y),!q.moved){var Q=Y.clientX-w,W=Y.clientY-Z;q.moved=Q*Q+W*W>_}q.event(Y).zoom("mouse",n(E(q.that.__zoom,q.mouse[0]=Hn(Y,L),q.mouse[1]),q.extent,u))}function C(Y){K.on("mousemove.zoom mouseup.zoom",null),Vw(Y.view,q.moved),Ts(Y),q.event(Y).end()}}function O(z,...$){if(e.apply(this,arguments)){var L=this.__zoom,q=Hn(z.changedTouches?z.changedTouches[0]:z,this),K=L.invert(q),X=L.k*(z.shiftKey?.5:2),w=n(E(A(L,X),q,K),t.apply(this,$),u);Ts(z),c>0?gn(this).transition().duration(c).call(j,w,q,z):gn(this).call(k.transform,w,q,z)}}function H(z,...$){if(e.apply(this,arguments)){var L=z.touches,q=L.length,K=M(this,$,z.changedTouches.length===q).event(z),X,w,Z,te;for(Qh(z),w=0;w<q;++w)Z=L[w],te=Hn(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)),cc(this),K.start())}}function P(z,...$){if(this.__zooming){var L=M(this,$).event(z),q=z.changedTouches,K=q.length,X,w,Z,te;for(Ts(z),X=0;X<K;++X)w=q[X],Z=Hn(w,this),L.touch0&&L.touch0[2]===w.identifier?L.touch0[0]=Z:L.touch1&&L.touch1[2]===w.identifier&&(L.touch1[0]=Z);if(w=L.that.__zoom,L.touch1){var C=L.touch0[0],Y=L.touch0[1],Q=L.touch1[0],W=L.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(L.touch0)Z=L.touch0[0],te=L.touch0[1];else return;L.zoom("touch",n(E(w,Z,te),L.extent,u))}}function F(z,...$){if(this.__zooming){var L=M(this,$).event(z),q=z.changedTouches,K=q.length,X,w;for(Qh(z),y&&clearTimeout(y),y=setTimeout(function(){y=null},v),X=0;X<K;++X)w=q[X],L.touch0&&L.touch0[2]===w.identifier?delete L.touch0:L.touch1&&L.touch1[2]===w.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(w=Hn(w,this),Math.hypot(p[0]-w[0],p[1]-w[1])<S)){var Z=gn(this).on("dblclick.zoom");Z&&Z.apply(this,arguments)}}}return k.wheelDelta=function(z){return arguments.length?(i=typeof z=="function"?z:ec(+z),k):i},k.filter=function(z){return arguments.length?(e=typeof z=="function"?z:ec(!!z),k):e},k.touchable=function(z){return arguments.length?(l=typeof z=="function"?z:ec(!!z),k):l},k.extent=function(z){return arguments.length?(t=typeof z=="function"?z:ec([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),k):t},k.scaleExtent=function(z){return arguments.length?(s[0]=+z[0],s[1]=+z[1],k):[s[0],s[1]]},k.translateExtent=function(z){return arguments.length?(u[0][0]=+z[0][0],u[1][0]=+z[1][0],u[0][1]=+z[0][1],u[1][1]=+z[1][1],k):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},k.constrain=function(z){return arguments.length?(n=z,k):n},k.duration=function(z){return arguments.length?(c=+z,k):c},k.interpolate=function(z){return arguments.length?(d=z,k):d},k.on=function(){var z=h.on.apply(h,arguments);return z===h?k:z},k.clickDistance=function(z){return arguments.length?(_=(z=+z)*z,k):Math.sqrt(_)},k.tapDistance=function(z){return arguments.length?(S=+z,k):S},k}const ur={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."},au=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],lS=["Enter"," ","Escape"];var ul;(function(e){e.Strict="strict",e.Loose="loose"})(ul||(ul={}));var Ji;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ji||(Ji={}));var lu;(function(e){e.Partial="partial",e.Full="full"})(lu||(lu={}));const sS={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var vi;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(vi||(vi={}));var Nc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Nc||(Nc={}));var Ae;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ae||(Ae={}));const _b={[Ae.Left]:Ae.Right,[Ae.Right]:Ae.Left,[Ae.Top]:Ae.Bottom,[Ae.Bottom]:Ae.Top};function uS(e){return e===null?null:e?"valid":"invalid"}const oS=e=>"id"in e&&"source"in e&&"target"in e,B9=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),eg=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),vu=(e,t=[0,0])=>{const{width:n,height:i}=Br(e),l=e.origin??t,s=n*l[0],u=i*l[1];return{x:e.position.x-s,y:e.position.y-u}},H9=(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 u=!t.nodeLookup&&!s?l:void 0;t.nodeLookup&&(u=s?t.nodeLookup.get(l):eg(l)?l:t.nodeLookup.get(l.id));const c=u?Mc(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Fc(i,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Gc(n)},xu=(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=Mc(i);n=Fc(n,l)}}),Gc(n)},cS=(e,t,[n,i,l]=[0,0,1],s=!1,u=!1)=>{const c={...bu(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(u&&!p||y)continue;const v=m.width??h.width??h.initialWidth??null,b=m.height??h.height??h.initialHeight??null,_=su(c,cl(h)),S=(v??0)*(b??0),k=s&&_>0;(!h.internals.handleBounds||k||_>=S||h.dragging)&&d.push(h)}return d},U9=(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 P9(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 q9({nodes:e,width:t,height:n,panZoom:i,minZoom:l,maxZoom:s},u){if(e.size===0)return Promise.resolve(!0);const c=P9(e,u),d=xu(c),h=tg(d,t,n,(u==null?void 0:u.minZoom)??l,(u==null?void 0:u.maxZoom)??s,(u==null?void 0:u.padding)??.1);return await i.setViewport(h,{duration:u==null?void 0:u.duration}),Promise.resolve(!0)}function fS({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:l,onError:s}){const u=n.get(e),c=u.parentId?n.get(u.parentId):void 0,{x:d,y:h}=c?c.internals.positionAbsolute:{x:0,y:0},m=u.origin??i;let p=l;if(u.extent==="parent"&&!u.expandParent)if(!c)s==null||s("005",ur.error005());else{const v=c.measured.width,b=c.measured.height;v&&b&&(p=[[d,h],[d+v,h+b]])}else c&&fl(u.extent)&&(p=[[u.extent[0][0]+d,u.extent[0][1]+h],[u.extent[1][0]+d,u.extent[1][1]+h]]);const y=fl(p)?ia(t,p,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(s==null||s("015",ur.error015())),{position:{x:y.x-d+(u.measured.width??0)*m[0],y:y.y-h+(u.measured.height??0)*m[1]},positionAbsolute:y}}async function V9({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:l}){const s=new Set(e.map(y=>y.id)),u=[];for(const y of n){if(y.deletable===!1)continue;const v=s.has(y.id),b=!v&&y.parentId&&u.find(_=>_.id===y.parentId);(v||b)&&u.push(y)}const c=new Set(t.map(y=>y.id)),d=i.filter(y=>y.deletable!==!1),m=U9(u,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:u};const p=await l({nodes:u,edges:m});return typeof p=="boolean"?p?{edges:m,nodes:u}:{edges:[],nodes:[]}:p}const ol=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ia=(e={x:0,y:0},t,n)=>({x:ol(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ol(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function dS(e,t,n){const{width:i,height:l}=Br(n),{x:s,y:u}=n.internals.positionAbsolute;return ia(e,[[s,u],[s+i,u+l]],t)}const wb=(e,t,n)=>e<t?ol(Math.abs(e-t),1,t)/t:e>n?-ol(Math.abs(e-n),1,t)/t:0,hS=(e,t,n=15,i=40)=>{const l=wb(e.x,i,t.width-i)*n,s=wb(e.y,i,t.height-i)*n;return[l,s]},Fc=(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)}),wp=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),Gc=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),cl=(e,t=[0,0])=>{var l,s;const{x:n,y:i}=eg(e)?e.internals.positionAbsolute:vu(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}},Mc=(e,t=[0,0])=>{var l,s;const{x:n,y:i}=eg(e)?e.internals.positionAbsolute:vu(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)}},mS=(e,t)=>Gc(Fc(wp(e),wp(t))),su=(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)},Sb=e=>qn(e.width)&&qn(e.height)&&qn(e.x)&&qn(e.y),qn=e=>!isNaN(e)&&isFinite(e),$9=(e,t)=>{},Xc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bu=({x:e,y:t},[n,i,l],s=!1,u=[1,1])=>{const c={x:(e-n)/l,y:(t-i)/l};return s?Xc(c,u):c},Oc=({x:e,y:t},[n,i,l])=>({x:e*l+n,y:t*l+i});function Ya(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 Z9(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Ya(e,n),l=Ya(e,t);return{top:i,right:l,bottom:i,left:l,x:l*2,y:i*2}}if(typeof e=="object"){const i=Ya(e.top??e.y??0,n),l=Ya(e.bottom??e.y??0,n),s=Ya(e.left??e.x??0,t),u=Ya(e.right??e.x??0,t);return{top:i,right:u,bottom:l,left:s,x:s+u,y:i+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Y9(e,t,n,i,l,s){const{x:u,y:c}=Oc(e,[t,n,i]),{x:d,y:h}=Oc({x:e.x+e.width,y:e.y+e.height},[t,n,i]),m=l-d,p=s-h;return{left:Math.floor(u),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(p)}}const tg=(e,t,n,i,l,s)=>{const u=Z9(s,t,n),c=(t-u.x)/e.width,d=(n-u.y)/e.height,h=Math.min(c,d),m=ol(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,_=Y9(e,v,b,m,t,n),S={left:Math.min(_.left-u.left,0),top:Math.min(_.top-u.top,0),right:Math.min(_.right-u.right,0),bottom:Math.min(_.bottom-u.bottom,0)};return{x:v-S.left+S.right,y:b-S.top+S.bottom,zoom:m}},Rc=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function fl(e){return e!==void 0&&e!=="parent"}function Br(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 pS(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 gS(e,t={width:0,height:0},n,i,l){const s={...e},u=i.get(n);if(u){const c=u.origin||l;s.x+=u.internals.positionAbsolute.x-(t.width??0)*c[0],s.y+=u.internals.positionAbsolute.y-(t.height??0)*c[1]}return s}function Eb(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function F9(){let e,t;return{promise:new Promise((i,l)=>{e=i,t=l}),resolve:e,reject:t}}function js(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:l}){const{x:s,y:u}=Dr(e),c=bu({x:s-((l==null?void 0:l.left)??0),y:u-((l==null?void 0:l.top)??0)},i),{x:d,y:h}=n?Xc(c,t):c;return{xSnapped:d,ySnapped:h,...c}}const ng=e=>({width:e.offsetWidth,height:e.offsetHeight}),yS=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},G9=["INPUT","SELECT","TEXTAREA"];function vS(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:G9.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const xS=e=>"clientX"in e,Dr=(e,t)=>{var s,u;const n=xS(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,l=n?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:l-((t==null?void 0:t.top)??0)}},kb=(e,t,n,i,l)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(u=>{const c=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:l,position:u.getAttribute("data-handlepos"),x:(c.left-n.left)/i,y:(c.top-n.top)/i,...ng(u)}})};function bS({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:l,sourceControlY:s,targetControlX:u,targetControlY:c}){const d=e*.125+l*.375+u*.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 tc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Tb({pos:e,x1:t,y1:n,x2:i,y2:l,c:s}){switch(e){case Ae.Left:return[t-tc(t-i,s),n];case Ae.Right:return[t+tc(i-t,s),n];case Ae.Top:return[t,n-tc(n-l,s)];case Ae.Bottom:return[t,n+tc(l-n,s)]}}function _S({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:i,targetY:l,targetPosition:s=Ae.Top,curvature:u=.25}){const[c,d]=Tb({pos:n,x1:e,y1:t,x2:i,y2:l,c:u}),[h,m]=Tb({pos:s,x1:i,y1:l,x2:e,y2:t,c:u}),[p,y,v,b]=bS({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 wS({sourceX:e,sourceY:t,targetX:n,targetY:i}){const l=Math.abs(n-e)/2,s=n<e?n+l:n-l,u=Math.abs(i-t)/2,c=i<t?i+u:i-u;return[s,c,l,u]}function X9({sourceNode:e,targetNode:t,selected:n=!1,zIndex:i=0,elevateOnSelect:l=!1}){if(!l)return i;const s=n||t.selected||e.selected,u=Math.max(e.internals.z||0,t.internals.z||0,1e3);return i+(s?u:0)}function Q9({sourceNode:e,targetNode:t,width:n,height:i,transform:l}){const s=Fc(Mc(e),Mc(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const u={x:-l[0]/l[2],y:-l[1]/l[2],width:n/l[2],height:i/l[2]};return su(u,Gc(s))>0}const K9=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,J9=(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)),W9=(e,t)=>{if(!e.source||!e.target)return t;let n;return oS(e)?n={...e}:n={...e,id:K9(e)},J9(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function SS({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[l,s,u,c]=wS({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,l,s,u,c]}const Cb={[Ae.Left]:{x:-1,y:0},[Ae.Right]:{x:1,y:0},[Ae.Top]:{x:0,y:-1},[Ae.Bottom]:{x:0,y:1}},eL=({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},Ab=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function tL({source:e,sourcePosition:t=Ae.Bottom,target:n,targetPosition:i=Ae.Top,center:l,offset:s}){const u=Cb[t],c=Cb[i],d={x:e.x+u.x*s,y:e.y+u.y*s},h={x:n.x+c.x*s,y:n.y+c.y*s},m=eL({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,N,j]=wS({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(u[p]*c[p]===-1){b=l.x??A,_=l.y??E;const U=[{x:b,y:d.y},{x:b,y:h.y}],R=[{x:d.x,y:_},{x:h.x,y:_}];u[p]===y?v=p==="x"?U:R:v=p==="x"?R:U}else{const U=[{x:d.x,y:h.y}],R=[{x:h.x,y:d.y}];if(p==="x"?v=u.x===y?R:U:v=u.y===y?U:R,t===i){const F=Math.abs(e[p]-n[p]);if(F<=s){const z=Math.min(s-1,s-F);u[p]===y?S[p]=(d[p]>e[p]?-1:1)*z:k[p]=(h[p]>n[p]?-1:1)*z}}if(t!==i){const F=p==="x"?"y":"x",z=u[p]===c[F],$=d[F]>h[F],L=d[F]<h[F];(u[p]===1&&(!z&&$||z&&L)||u[p]!==1&&(!z&&L||z&&$))&&(v=p==="x"?U:R)}const B={x:d.x+S.x,y:d.y+S.y},O={x:h.x+k.x,y:h.y+k.y},H=Math.max(Math.abs(B.x-v[0].x),Math.abs(O.x-v[0].x)),P=Math.max(Math.abs(B.y-v[0].y),Math.abs(O.y-v[0].y));H>=P?(b=(B.x+O.x)/2,_=v[0].y):(b=v[0].x,_=(B.y+O.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,_,N,j]}function nL(e,t,n,i){const l=Math.min(Ab(e,t)/2,Ab(t,n)/2,i),{x:s,y:u}=t;if(e.x===s&&s===n.x||e.y===u&&u===n.y)return`L${s} ${u}`;if(e.y===u){const h=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${s+l*h},${u}Q ${s},${u} ${s},${u+l*m}`}const c=e.x<n.x?1:-1,d=e.y<n.y?-1:1;return`L ${s},${u+l*d}Q ${s},${u} ${s+l*c},${u}`}function Sp({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:i,targetY:l,targetPosition:s=Ae.Top,borderRadius:u=5,centerX:c,centerY:d,offset:h=20}){const[m,p,y,v,b]=tL({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=nL(m[A-1],k,m[A+1],u):E=`${A===0?"M":"L"}${k.x} ${k.y}`,S+=E,S},""),p,y,v,b]}function Nb(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function rL(e){var p;const{sourceNode:t,targetNode:n}=e;if(!Nb(t)||!Nb(n))return null;const i=t.internals.handleBounds||Mb(t.handles),l=n.internals.handleBounds||Mb(n.handles),s=Ob((i==null?void 0:i.source)??[],e.sourceHandle),u=Ob(e.connectionMode===ul.Strict?(l==null?void 0:l.target)??[]:((l==null?void 0:l.target)??[]).concat((l==null?void 0:l.source)??[]),e.targetHandle);if(!s||!u)return(p=e.onError)==null||p.call(e,"008",ur.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=(u==null?void 0:u.position)||Ae.Top,h=uu(t,s,c),m=uu(n,u,d);return{sourceX:h.x,sourceY:h.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:d}}function Mb(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 uu(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:u,height:c}=t??Br(e);if(i)return{x:l+u/2,y:s+c/2};switch((t==null?void 0:t.position)??n){case Ae.Top:return{x:l+u/2,y:s};case Ae.Right:return{x:l+u,y:s+c/2};case Ae.Bottom:return{x:l+u/2,y:s+c};case Ae.Left:return{x:l,y:s+c/2}}}function Ob(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Ep(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function iL(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:l}){const s=new Set;return e.reduce((u,c)=>([c.markerStart||i,c.markerEnd||l].forEach(d=>{if(d&&typeof d=="object"){const h=Ep(d,t);s.has(h)||(u.push({id:h,color:d.color||n,...d}),s.add(h))}}),u),[]).sort((u,c)=>u.id.localeCompare(c.id))}const rg={nodeOrigin:[0,0],nodeExtent:au,elevateNodesOnSelect:!0,defaults:{}},aL={...rg,checkEquality:!0};function ig(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function lL(e,t,n){const i=ig(rg,n);for(const l of e.values())if(l.parentId)ag(l,e,t,i);else{const s=vu(l,i.nodeOrigin),u=fl(l.extent)?l.extent:i.nodeExtent,c=ia(s,u,Br(l));l.internals.positionAbsolute=c}}function kp(e,t,n,i){var d,h;const l=ig(aL,i);let s=e.length>0;const u=new Map(t),c=l!=null&&l.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const m of e){let p=u.get(m.id);if(l.checkEquality&&m===(p==null?void 0:p.internals.userNode))t.set(m.id,p);else{const y=vu(m,l.nodeOrigin),v=fl(m.extent)?m.extent:l.nodeExtent,b=ia(y,v,Br(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:ES(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&&ag(p,t,n,i)}return s}function sL(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 ag(e,t,n,i){const{elevateNodesOnSelect:l,nodeOrigin:s,nodeExtent:u}=ig(rg,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}sL(e,n);const h=l?1e3:0,{x:m,y:p,z:y}=uL(e,d,s,u,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 ES(e,t){return(qn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function uL(e,t,n,i,l){const{x:s,y:u}=t.internals.positionAbsolute,c=Br(e),d=vu(e,n),h=fl(e.extent)?ia(d,e.extent,c):d;let m=ia({x:s+h.x,y:u+h.y},i,c);e.extent==="parent"&&(m=dS(m,c,t));const p=ES(e,l),y=t.internals.z??0;return{x:m.x,y:m.y,z:y>p?y:p}}function lg(e,t,n,i=[0,0]){var u;const l=[],s=new Map;for(const c of e){const d=t.get(c.parentId);if(!d)continue;const h=((u=s.get(c.parentId))==null?void 0:u.expandedRect)??cl(d),m=mS(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=Br(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(N=>{e.some(j=>j.id===N.id)||l.push({id:N.id,type:"position",position:{x:N.position.x+v,y:N.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 oL(e,t,n,i,l,s){const u=i==null?void 0:i.querySelector(".xyflow__viewport");let c=!1;if(!u)return{changes:[],updatedInternals:c};const d=[],h=window.getComputedStyle(u),{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=ng(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=fl(v.extent)?v.extent:s;let{positionAbsolute:E}=v.internals;v.parentId&&v.extent==="parent"?E=dS(E,b,t.get(v.parentId)):A&&(E=ia(E,A,b));const N={...v,measured:b,internals:{...v.internals,positionAbsolute:E,handleBounds:{source:kb("source",y.nodeElement,k,m,v.id),target:kb("target",y.nodeElement,k,m,v.id)}}};t.set(v.id,N),v.parentId&&ag(N,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:cl(N,l)}))}}if(p.length>0){const y=lg(p,t,n,l);d.push(...y)}return{changes:d,updatedInternals:c}}async function cL({delta:e,panZoom:t,transform:n,translateExtent:i,width:l,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[l,s]],i),c=!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2]);return Promise.resolve(c)}function Rb(e,t,n,i,l,s){let u=l;const c=i.get(u)||new Map;i.set(u,c.set(n,t)),u=`${l}-${e}`;const d=i.get(u)||new Map;if(i.set(u,d.set(n,t)),s){u=`${l}-${e}-${s}`;const h=i.get(u)||new Map;i.set(u,h.set(n,t))}}function kS(e,t,n){e.clear(),t.clear();for(const i of n){const{source:l,target:s,sourceHandle:u=null,targetHandle:c=null}=i,d={edgeId:i.id,source:l,target:s,sourceHandle:u,targetHandle:c},h=`${l}-${u}--${s}-${c}`,m=`${s}-${c}--${l}-${u}`;Rb("source",d,m,e,l,u),Rb("target",d,h,e,s,c),t.set(i.id,i)}}function TS(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:TS(n,t):!1}function zb(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 fL(e,t,n,i){const l=new Map;for(const[s,u]of e)if((u.selected||u.id===i)&&(!u.parentId||!TS(u,e))&&(u.draggable||t&&typeof u.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 Kh({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var u,c,d;const l=[];for(const[h,m]of t){const p=(u=n.get(h))==null?void 0:u.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 dL({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:l}){let s={x:null,y:null},u=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:N,nodeClickDistance:j=0}){y=gn(A);function M({x:O,y:H},P){const{nodeLookup:F,nodeExtent:z,snapGrid:$,snapToGrid:L,nodeOrigin:q,onNodeDrag:K,onSelectionDrag:X,onError:w,updateNodePositions:Z}=t();s={x:O,y:H};let te=!1,C={x:0,y:0,x2:0,y2:0};if(c.size>1&&z){const Y=xu(c);C=wp(Y)}for(const[Y,Q]of c){if(!F.has(Y))continue;let W={x:O-Q.distance.x,y:H-Q.distance.y};L&&(W=Xc(W,$));let ue=[[z[0][0],z[0][1]],[z[1][0],z[1][1]]];if(c.size>1&&z&&!Q.extent){const{positionAbsolute:ke}=Q.internals,we=ke.x-C.x+z[0][0],ve=ke.x+Q.measured.width-C.x2+z[1][0],ze=ke.y-C.y+z[0][1],De=ke.y+Q.measured.height-C.y2+z[1][1];ue=[[we,ze],[ve,De]]}const{position:ce,positionAbsolute:ge}=fS({nodeId:Y,nextPosition:W,nodeLookup:F,nodeExtent:ue,nodeOrigin:q,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),P&&(i||K||!N&&X))){const[Y,Q]=Kh({nodeId:N,dragItems:c,nodeLookup:F});i==null||i(P,c,Y,Q),K==null||K(P,Y,Q),N||X==null||X(P,Q)}}async function U(){if(!m)return;const{transform:O,panBy:H,autoPanSpeed:P,autoPanOnNodeDrag:F}=t();if(!F){d=!1,cancelAnimationFrame(u);return}const[z,$]=hS(h,m,P);(z!==0||$!==0)&&(s.x=(s.x??0)-z/O[2],s.y=(s.y??0)-$/O[2],await H({x:z,y:$})&&M(s,null)),u=requestAnimationFrame(U)}function R(O){var te;const{nodeLookup:H,multiSelectionActive:P,nodesDraggable:F,transform:z,snapGrid:$,snapToGrid:L,selectNodesOnDrag:q,onNodeDragStart:K,onSelectionDragStart:X,unselectNodesAndEdges:w}=t();p=!0,(!q||!E)&&!P&&N&&((te=H.get(N))!=null&&te.selected||w()),E&&q&&N&&(e==null||e(N));const Z=js(O.sourceEvent,{transform:z,snapGrid:$,snapToGrid:L,containerBounds:m});if(s=Z,c=fL(H,F,Z,N),c.size>0&&(n||K||!N&&X)){const[C,Y]=Kh({nodeId:N,dragItems:c,nodeLookup:H});n==null||n(O.sourceEvent,c,C,Y),K==null||K(O.sourceEvent,C,Y),N||X==null||X(O.sourceEvent,Y)}}const B=$w().clickDistance(j).on("start",O=>{const{domNode:H,nodeDragThreshold:P,transform:F,snapGrid:z,snapToGrid:$}=t();m=(H==null?void 0:H.getBoundingClientRect())||null,v=!1,P===0&&R(O),s=js(O.sourceEvent,{transform:F,snapGrid:z,snapToGrid:$,containerBounds:m}),h=Dr(O.sourceEvent,m)}).on("drag",O=>{const{autoPanOnNodeDrag:H,transform:P,snapGrid:F,snapToGrid:z,nodeDragThreshold:$,nodeLookup:L}=t(),q=js(O.sourceEvent,{transform:P,snapGrid:F,snapToGrid:z,containerBounds:m});if((O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1||N&&!L.has(N))&&(v=!0),!v){if(!d&&H&&p&&(d=!0,U()),!p){const K=q.xSnapped-(s.x??0),X=q.ySnapped-(s.y??0);Math.sqrt(K*K+X*X)>$&&R(O)}(s.x!==q.xSnapped||s.y!==q.ySnapped)&&c&&p&&(h=Dr(O.sourceEvent,m),M(q,O.sourceEvent))}}).on("end",O=>{if(!(!p||v)&&(d=!1,p=!1,cancelAnimationFrame(u),c.size>0)){const{nodeLookup:H,updateNodePositions:P,onNodeDragStop:F,onSelectionDragStop:z}=t();if(P(c,!1),l||F||!N&&z){const[$,L]=Kh({nodeId:N,dragItems:c,nodeLookup:H,dragging:!1});l==null||l(O.sourceEvent,c,$,L),F==null||F(O.sourceEvent,$,L),N||z==null||z(O.sourceEvent,L)}}}).filter(O=>{const H=O.target;return!O.button&&(!S||!zb(H,`.${S}`,A))&&(!k||zb(H,k,A))});y.call(B)}function _(){y==null||y.on(".drag",null)}return{update:b,destroy:_}}function hL(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())su(l,cl(s))>0&&i.push(s);return i}const mL=250;function pL(e,t,n,i){var c,d;let l=[],s=1/0;const u=hL(e,n,t+mL);for(const h of u){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}=uu(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 CS(e,t,n,i,l,s=!1){var h,m,p;const u=i.get(e);if(!u)return null;const c=l==="strict"?(h=u.internals.handleBounds)==null?void 0:h[t]:[...((m=u.internals.handleBounds)==null?void 0:m.source)??[],...((p=u.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,...uu(u,d,d.position,!0)}:d}function AS(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function gL(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const NS=()=>!0;function yL(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:l,edgeUpdaterType:s,isTarget:u,domNode:c,nodeLookup:d,lib:h,autoPanOnConnect:m,flowId:p,panBy:y,cancelConnection:v,onConnectStart:b,onConnect:_,onConnectEnd:S,isValidConnection:k=NS,onReconnectEnd:A,updateConnection:E,getTransform:N,getFromHandle:j,autoPanSpeed:M}){const U=yS(e.target);let R=0,B;const{x:O,y:H}=Dr(e),P=U==null?void 0:U.elementFromPoint(O,H),F=AS(s,P),z=c==null?void 0:c.getBoundingClientRect();if(!z||!F)return;const $=CS(l,F,i,d,t);if(!$)return;let L=Dr(e,z),q=!1,K=null,X=!1,w=null;function Z(){if(!m||!z)return;const[ge,ke]=hS(L,z,M);y({x:ge,y:ke}),R=requestAnimationFrame(Z)}const te={...$,nodeId:l,type:F,position:$.position},C=d.get(l),Q={inProgress:!0,isValid:null,from:uu(C,te,Ae.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:C,to:L,toHandle:null,toPosition:_b[te.position],toNode:null};E(Q);let W=Q;b==null||b(e,{nodeId:l,handleId:i,handleType:F});function ue(ge){if(!j()||!te){ce(ge);return}const ke=N();L=Dr(ge,z),B=pL(bu(L,ke,!1,[1,1]),n,d,te),q||(Z(),q=!0);const we=MS(ge,{handle:B,connectionMode:t,fromNodeId:l,fromHandleId:i,fromType:u?"target":"source",isValidConnection:k,doc:U,lib:h,flowId:p,nodeLookup:d});w=we.handleDomNode,K=we.connection,X=gL(!!B,we.isValid);const ve={...W,isValid:X,to:we.toHandle&&X?Oc({x:we.toHandle.x,y:we.toHandle.y},ke):L,toHandle:we.toHandle,toPosition:X&&we.toHandle?we.toHandle.position:_b[te.position],toNode:we.toHandle?d.get(we.toHandle.nodeId):null};X&&B&&W.toHandle&&ve.toHandle&&W.toHandle.type===ve.toHandle.type&&W.toHandle.nodeId===ve.toHandle.nodeId&&W.toHandle.id===ve.toHandle.id&&W.to.x===ve.to.x&&W.to.y===ve.to.y||(E(ve),W=ve)}function ce(ge){(B||w)&&K&&X&&(_==null||_(K));const{inProgress:ke,...we}=W,ve={...we,toPosition:W.toHandle?W.toPosition:null};S==null||S(ge,ve),s&&(A==null||A(ge,ve)),v(),cancelAnimationFrame(R),q=!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 MS(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:l,fromType:s,doc:u,lib:c,flowId:d,isValidConnection:h=NS,nodeLookup:m}){const p=s==="target",y=t?u.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}=Dr(e),_=u.elementFromPoint(v,b),S=_!=null&&_.classList.contains(`${c}-flow__handle`)?_:y,k={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const A=AS(void 0,S),E=S.getAttribute("data-nodeid"),N=S.getAttribute("data-handleid"),j=S.classList.contains("connectable"),M=S.classList.contains("connectableend");if(!E||!A)return k;const U={source:p?E:i,sourceHandle:p?N:l,target:p?i:E,targetHandle:p?l:N};k.connection=U;const B=j&&M&&(n===ul.Strict?p&&A==="source"||!p&&A==="target":E!==i||N!==l);k.isValid=B&&h(U),k.toHandle=CS(E,A,N,m,n,!0)}return k}const Tp={onPointerDown:yL,isValid:MS};function vL({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const l=gn(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 N=n();if(E.sourceEvent.type!=="wheel"||!t)return;const j=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*m,M=N[2]*Math.pow(2,j);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 N=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const j=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],M=[j[0]-_[0],j[1]-_[1]];_=j;const U=i()*Math.max(N[2],Math.log(N[2]))*(v?-1:1),R={x:N[0]-M[0]*U,y:N[1]-M[1]*U},B=[[0,0],[d,h]];t.setViewportConstrained({x:R.x,y:R.y,zoom:N[2]},B,c)},A=aS().on("start",S).on("zoom",p?k:null).on("zoom.wheel",y?b:null);l.call(A,{})}function u(){l.on("zoom",null)}return{update:s,destroy:u,pointer:Hn}}const xL=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Qc=e=>({x:e.x,y:e.y,zoom:e.k}),Jh=({x:e,y:t,zoom:n})=>Yc.translate(e,t).scale(n),Qa=(e,t)=>e.target.closest(`.${t}`),OS=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Wh=(e,t=0,n=()=>{})=>{const i=typeof t=="number"&&t>0;return i||n(),i?e.transition().duration(t).on("end",n):e},RS=e=>{const t=e.ctrlKey&&Rc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function bL({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:l,panOnScrollSpeed:s,zoomOnPinch:u,onPanZoomStart:c,onPanZoom:d,onPanZoomEnd:h}){return m=>{if(Qa(m,t))return!1;m.preventDefault(),m.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(m.ctrlKey&&u){const S=Hn(m),k=RS(m),A=p*Math.pow(2,k);i.scaleTo(n,A,S,m);return}const y=m.deltaMode===1?20:1;let v=l===Ji.Vertical?0:m.deltaX*y,b=l===Ji.Horizontal?0:m.deltaY*y;!Rc()&&m.shiftKey&&l!==Ji.Vertical&&(v=m.deltaY*y,b=0),i.translateBy(n,-(v/p)*s,-(b/p)*s,{internal:!0});const _=Qc(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 _L({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,l){const s=i.type==="wheel",u=!t&&s&&!i.ctrlKey,c=Qa(i,e);if(i.ctrlKey&&s&&c&&i.preventDefault(),u||c)return null;i.preventDefault(),n.call(this,i,l)}}function wL({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,u,c;if((s=i.sourceEvent)!=null&&s.internal)return;const l=Qc(i.transform);e.mouseButton=((u=i.sourceEvent)==null?void 0:u.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 SL({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:l}){return s=>{var u,c;e.usedRightMouseButton=!!(n&&OS(t,e.mouseButton??0)),(u=s.sourceEvent)!=null&&u.sync||i([s.transform.x,s.transform.y,s.transform.k]),l&&!((c=s.sourceEvent)!=null&&c.internal)&&(l==null||l(s.sourceEvent,Qc(s.transform)))}}function EL({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:l,onPaneContextMenu:s}){return u=>{var c;if(!((c=u.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,s&&OS(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&s(u.sourceEvent),e.usedRightMouseButton=!1,i(!1),l&&xL(e.prevViewport,u.transform))){const d=Qc(u.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{l==null||l(u.sourceEvent,d)},n?150:0)}}}function kL({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:l,zoomOnDoubleClick:s,userSelectionActive:u,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"&&(Qa(m,`${h}-flow__node`)||Qa(m,`${h}-flow__edge`)))return!0;if(!i&&!p&&!l&&!s&&!n||u||Qa(m,c)&&m.type==="wheel"||Qa(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 TL({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:i,translateExtent:l,viewport:s,onPanZoom:u,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=aS().clickDistance(!qn(i)||i<0?0:i).scaleExtent([t,n]).translateExtent(l),v=gn(e).call(y);E({x:s.x,y:s.y,zoom:ol(s.zoom,t,n)},[[0,0],[p.width,p.height]],l);const b=v.on("wheel.zoom"),_=v.on("dblclick.zoom");y.wheelDelta(RS);function S(P,F){return v?new Promise(z=>{y==null||y.transform(Wh(v,F==null?void 0:F.duration,()=>z(!0)),P)}):Promise.resolve(!1)}function k({noWheelClassName:P,noPanClassName:F,onPaneContextMenu:z,userSelectionActive:$,panOnScroll:L,panOnDrag:q,panOnScrollMode:K,panOnScrollSpeed:X,preventScrolling:w,zoomOnPinch:Z,zoomOnScroll:te,zoomOnDoubleClick:C,zoomActivationKeyPressed:Y,lib:Q,onTransformChange:W}){$&&!m.isZoomingOrPanning&&A();const ce=L&&!Y&&!$?bL({zoomPanValues:m,noWheelClassName:P,d3Selection:v,d3Zoom:y,panOnScrollMode:K,panOnScrollSpeed:X,zoomOnPinch:Z,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:d}):_L({noWheelClassName:P,preventScrolling:w,d3ZoomHandler:b});if(v.on("wheel.zoom",ce,{passive:!1}),!$){const ke=wL({zoomPanValues:m,onDraggingChange:h,onPanZoomStart:c});y.on("start",ke);const we=SL({zoomPanValues:m,panOnDrag:q,onPaneContextMenu:!!z,onPanZoom:u,onTransformChange:W});y.on("zoom",we);const ve=EL({zoomPanValues:m,panOnDrag:q,panOnScroll:L,onPaneContextMenu:z,onPanZoomEnd:d,onDraggingChange:h});y.on("end",ve)}const ge=kL({zoomActivationKeyPressed:Y,panOnDrag:q,zoomOnScroll:te,panOnScroll:L,zoomOnDoubleClick:C,zoomOnPinch:Z,userSelectionActive:$,noPanClassName:F,noWheelClassName:P,lib:Q});y.filter(ge),C?v.on("dblclick.zoom",_):v.on("dblclick.zoom",null)}function A(){y.on("zoom",null)}async function E(P,F,z){const $=Jh(P),L=y==null?void 0:y.constrain()($,F,z);return L&&await S(L),new Promise(q=>q(L))}async function N(P,F){const z=Jh(P);return await S(z,F),new Promise($=>$(z))}function j(P){if(v){const F=Jh(P),z=v.property("__zoom");(z.k!==P.zoom||z.x!==P.x||z.y!==P.y)&&(y==null||y.transform(v,F,null,{sync:!0}))}}function M(){const P=v?iS(v.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function U(P,F){return v?new Promise(z=>{y==null||y.scaleTo(Wh(v,F==null?void 0:F.duration,()=>z(!0)),P)}):Promise.resolve(!1)}function R(P,F){return v?new Promise(z=>{y==null||y.scaleBy(Wh(v,F==null?void 0:F.duration,()=>z(!0)),P)}):Promise.resolve(!1)}function B(P){y==null||y.scaleExtent(P)}function O(P){y==null||y.translateExtent(P)}function H(P){const F=!qn(P)||P<0?0:P;y==null||y.clickDistance(F)}return{update:k,destroy:A,setViewport:N,setViewportConstrained:E,getViewport:M,scaleTo:U,scaleBy:R,setScaleExtent:B,setTranslateExtent:O,syncViewport:j,setClickDistance:H}}var Ls;(function(e){e.Line="line",e.Handle="handle"})(Ls||(Ls={}));function CL({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:l,affectsY:s}){const u=e-t,c=n-i,d=[u>0?1:u<0?-1:0,c>0?1:c<0?-1:0];return u&&l&&(d[0]=d[0]*-1),c&&s&&(d[1]=d[1]*-1),d}function AL(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 pi(e,t){return Math.max(0,t-e)}function gi(e,t){return Math.max(0,e-t)}function nc(e,t,n){return Math.max(0,t-e,e-n)}function Db(e,t){return e?!t:t}function NL(e,t,n,i,l,s,u,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:N,width:j,height:M,aspectRatio:U}=e;let R=Math.floor(m?v-e.pointerX:0),B=Math.floor(p?b-e.pointerY:0);const O=j+(d?-R:R),H=M+(h?-B:B),P=-s[0]*j,F=-s[1]*M;let z=nc(O,_,S),$=nc(H,k,A);if(u){let K=0,X=0;d&&R<0?K=pi(E+R+P,u[0][0]):!d&&R>0&&(K=gi(E+O+P,u[1][0])),h&&B<0?X=pi(N+B+F,u[0][1]):!h&&B>0&&(X=gi(N+H+F,u[1][1])),z=Math.max(z,K),$=Math.max($,X)}if(c){let K=0,X=0;d&&R>0?K=gi(E+R,c[0][0]):!d&&R<0&&(K=pi(E+O,c[1][0])),h&&B>0?X=gi(N+B,c[0][1]):!h&&B<0&&(X=pi(N+H,c[1][1])),z=Math.max(z,K),$=Math.max($,X)}if(l){if(m){const K=nc(O/U,k,A)*U;if(z=Math.max(z,K),u){let X=0;!d&&!h||d&&!h&&y?X=gi(N+F+O/U,u[1][1])*U:X=pi(N+F+(d?R:-R)/U,u[0][1])*U,z=Math.max(z,X)}if(c){let X=0;!d&&!h||d&&!h&&y?X=pi(N+O/U,c[1][1])*U:X=gi(N+(d?R:-R)/U,c[0][1])*U,z=Math.max(z,X)}}if(p){const K=nc(H*U,_,S)/U;if($=Math.max($,K),u){let X=0;!d&&!h||h&&!d&&y?X=gi(E+H*U+P,u[1][0])/U:X=pi(E+(h?B:-B)*U+P,u[0][0])/U,$=Math.max($,X)}if(c){let X=0;!d&&!h||h&&!d&&y?X=pi(E+H*U,c[1][0])/U:X=gi(E+(h?B:-B)*U,c[0][0])/U,$=Math.max($,X)}}}B=B+(B<0?$:-$),R=R+(R<0?z:-z),l&&(y?O>H*U?B=(Db(d,h)?-R:R)/U:R=(Db(d,h)?-B:B)*U:m?(B=R/U,h=d):(R=B*U,d=h));const L=d?E+R:E,q=h?N+B:N;return{width:j+(d?-R:R),height:M+(h?-B:B),x:s[0]*R*(d?-1:1)+L,y:s[1]*B*(h?-1:1)+q}}const zS={width:0,height:0,x:0,y:0},ML={...zS,pointerX:0,pointerY:0,aspectRatio:1};function OL(e){return[[0,0],[e.measured.width,e.measured.height]]}function RL(e,t,n){const i=t.position.x+e.position.x,l=t.position.y+e.position.y,s=e.measured.width??0,u=e.measured.height??0,c=n[0]*s,d=n[1]*u;return[[i-c,l-d],[i+s-c,l+u-d]]}function zL({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:l}){const s=gn(e);function u({controlPosition:d,boundaries:h,keepAspectRatio:m,resizeDirection:p,onResizeStart:y,onResize:v,onResizeEnd:b,shouldResize:_}){let S={...zS},k={...ML};const A=AL(d);let E,N=null,j=[],M,U,R;const B=$w().on("start",O=>{const{nodeLookup:H,transform:P,snapGrid:F,snapToGrid:z,nodeOrigin:$,paneDomNode:L}=n();if(E=H.get(t),!E)return;N=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:q,ySnapped:K}=js(O.sourceEvent,{transform:P,snapGrid:F,snapToGrid:z,containerBounds:N});S={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},k={...S,pointerX:q,pointerY:K,aspectRatio:S.width/S.height},M=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(M=H.get(E.parentId),U=M&&E.extent==="parent"?OL(M):void 0),j=[],R=void 0;for(const[X,w]of H)if(w.parentId===t&&(j.push({id:X,position:{...w.position},extent:w.extent}),w.extent==="parent"||w.expandParent)){const Z=RL(w,E,w.origin??$);R?R=[[Math.min(Z[0][0],R[0][0]),Math.min(Z[0][1],R[0][1])],[Math.max(Z[1][0],R[1][0]),Math.max(Z[1][1],R[1][1])]]:R=Z}y==null||y(O,{...S})}).on("drag",O=>{const{transform:H,snapGrid:P,snapToGrid:F,nodeOrigin:z}=n(),$=js(O.sourceEvent,{transform:H,snapGrid:P,snapToGrid:F,containerBounds:N}),L=[];if(!E)return;const{x:q,y:K,width:X,height:w}=S,Z={},te=E.origin??z,{width:C,height:Y,x:Q,y:W}=NL(k,A,$,h,m,te,U,R),ue=C!==X,ce=Y!==w,ge=Q!==q&&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,j.length>0)){const De=Q-q,lt=W-K;for(const ot of j)ot.position={x:ot.position.x-De+te[0]*(C-X),y:ot.position.y-lt+te[1]*(Y-w)},L.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 De=te[0]*(Z.width??0);Z.x&&Z.x<De&&(S.x=De,k.x=k.x-(Z.x-De));const lt=te[1]*(Z.height??0);Z.y&&Z.y<lt&&(S.y=lt,k.y=k.y-(Z.y-lt))}const we=CL({width:S.width,prevWidth:X,height:S.height,prevHeight:w,affectsX:A.affectsX,affectsY:A.affectsY}),ve={...S,direction:we};(_==null?void 0:_(O,ve))!==!1&&(v==null||v(O,ve),i(Z,L))}).on("end",O=>{b==null||b(O,{...S}),l==null||l({...S})});s.call(B)}function c(){s.on(".drag",null)}return{update:u,destroy:c}}var em={exports:{}},tm={},nm={exports:{}},rm={};/**
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 jb;function DL(){if(jb)return rm;jb=1;var e=cu();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,u=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]),u(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 rm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,rm}var Lb;function jL(){return Lb||(Lb=1,nm.exports=DL()),nm.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 Ib;function LL(){if(Ib)return tm;Ib=1;var e=cu(),t=jL();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,u=e.useEffect,c=e.useMemo,d=e.useDebugValue;return tm.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 N=U}return N=M}if(U=N,i(E,M))return U;var R=y(M);return v!==void 0&&v(U,R)?(E=M,U):(E=M,N=R)}var A=!1,E,N,j=p===void 0?null:p;return[function(){return k(m())},j===null?void 0:function(){return k(j())}]},[m,p,y,v]);var S=l(h,b[0],b[1]);return u(function(){_.hasValue=!0,_.value=S},[S]),d(S),S},tm}var Bb;function IL(){return Bb||(Bb=1,em.exports=LL()),em.exports}var BL=IL();const HL=Ei(BL),UL={},Hb=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:()=>{(UL?"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},PL=e=>e?Hb(e):Hb,{useDebugValue:qL}=IT,{useSyncExternalStoreWithSelector:VL}=HL,$L=e=>e;function DS(e,t=$L,n){const i=VL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return qL(i),i}const Ub=(e,t)=>{const n=PL(e),i=(l,s=t)=>DS(n,l,s);return Object.assign(i,n),i},ZL=(e,t)=>e?Ub(e,t):Ub;function gt(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}i_();const Kc=ie.createContext(null),YL=Kc.Provider,jS=ur.error001();function Fe(e,t){const n=ie.useContext(Kc);if(n===null)throw new Error(jS);return DS(n,e,t)}function ft(){const e=ie.useContext(Kc);if(e===null)throw new Error(jS);return ie.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Pb={display:"none"},FL={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},LS="react-flow__node-desc",IS="react-flow__edge-desc",GL="react-flow__aria-live",XL=e=>e.ariaLiveMessage;function QL({rfId:e}){const t=Fe(XL);return I.jsx("div",{id:`${GL}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:FL,children:t})}function KL({rfId:e,disableKeyboardA11y:t}){return I.jsxs(I.Fragment,{children:[I.jsxs("div",{id:`${LS}-${e}`,style:Pb,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:`${IS}-${e}`,style:Pb,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&I.jsx(QL,{rfId:e})]})}const JL=e=>e.userSelectionActive?"none":"all",_u=ie.forwardRef(({position:e="top-left",children:t,className:n,style:i,...l},s)=>{const u=Fe(JL),c=`${e}`.split("-");return I.jsx("div",{className:Ct(["react-flow__panel",n,...c]),style:{...i,pointerEvents:u},ref:s,...l,children:t})});_u.displayName="Panel";function WL({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:I.jsx(_u,{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 e6=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}},rc=e=>e.id;function t6(e,t){return gt(e.selectedNodes.map(rc),t.selectedNodes.map(rc))&&gt(e.selectedEdges.map(rc),t.selectedEdges.map(rc))}function n6({onSelectionChange:e}){const t=ft(),{selectedNodes:n,selectedEdges:i}=Fe(e6,t6);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 r6=e=>!!e.onSelectionChangeHandlers;function i6({onSelectionChange:e}){const t=Fe(r6);return e||t?I.jsx(n6,{onSelectionChange:e}):null}const BS=[0,0],a6={x:0,y:0,zoom:1},l6=["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"],qb=[...l6,"rfId"],s6=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}),Vb={translateExtent:au,nodeOrigin:BS,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function u6(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:l,setTranslateExtent:s,setNodeExtent:u,reset:c,setDefaultNodesAndEdges:d,setPaneClickDistance:h}=Fe(s6,gt),m=ft();ie.useEffect(()=>(d(e.defaultNodes,e.defaultEdges),()=>{p.current=Vb,c()}),[]);const p=ie.useRef(Vb);return ie.useEffect(()=>{for(const y of qb){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"?u(v):y==="paneClickDistance"?h(v):y==="fitView"?m.setState({fitViewQueued:v}):y==="fitViewOptions"?m.setState({fitViewOptions:v}):m.setState({[y]:v})))}p.current=e},qb.map(y=>e[y])),null}function $b(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function o6(e){var i;const[t,n]=ie.useState(e==="system"?null:e);return ie.useEffect(()=>{if(e!=="system"){n(e);return}const l=$b(),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=$b())!=null&&i.matches?"dark":"light"}const Zb=typeof document<"u"?document:null;function ou(e=null,t={target:Zb,actInsideInputWithModifier:!0}){const[n,i]=ie.useState(!1),l=ie.useRef(!1),s=ie.useRef(new Set([])),[u,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)??Zb,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)&&vS(v))return!1;const _=Fb(v.code,c);if(s.current.add(v[_]),Yb(u,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=Fb(v.code,c);Yb(u,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 Yb(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(l=>t.has(l)))}function Fb(e,t){return t.includes(e)?"code":"key"}const c6=()=>{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:u}=e.getState();return u?(await u.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:u,panZoom:c}=e.getState(),d=typeof(i==null?void 0:i.zoom)<"u"?i.zoom:u,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:u,panZoom:c}=e.getState(),d=tg(t,i,l,s,u,(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:u}=e.getState();if(!u)return t;const{x:c,y:d}=u.getBoundingClientRect(),h={x:t.x-c,y:t.y-d},m=n.snapGrid??l,p=n.snapToGrid??s;return bu(h,i,p,m)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:l,y:s}=i.getBoundingClientRect(),u=Oc(t,n);return{x:u.x+l,y:u.y+s}}}),[])};function HS(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 u=i.get(s.id);u?u.push(s):i.set(s.id,[s])}for(const s of t){const u=i.get(s.id);if(!u){n.push(s);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){n.push({...u[0].item});continue}const c={...s};for(const d of u)f6(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 f6(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 US(e,t){return HS(e,t)}function PS(e,t){return HS(e,t)}function Fi(e,t){return{id:e,type:"select",selected:t}}function Ka(e,t=new Set,n=!1){const i=[];for(const[l,s]of e){const u=t.has(l);!(s.selected===void 0&&!u)&&s.selected!==u&&(n&&(s.selected=u),i.push(Fi(s.id,u)))}return i}function Gb({items:e=[],lookup:t}){var l;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,u]of e.entries()){const c=t.get(u.id),d=((l=c==null?void 0:c.internals)==null?void 0:l.userNode)??c;d!==void 0&&d!==u&&n.push({id:u.id,item:u,type:"replace"}),d===void 0&&n.push({item:u,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function Xb(e){return{id:e.id,type:"remove"}}const Qb=e=>B9(e),d6=e=>oS(e);function qS(e){return ie.forwardRef(e)}const h6=typeof window<"u"?ie.useLayoutEffect:ie.useEffect;function Kb(e){const[t,n]=ie.useState(BigInt(0)),[i]=ie.useState(()=>m6(()=>n(l=>l+BigInt(1))));return h6(()=>{const l=i.get();l.length&&(e(l),i.reset())},[t]),i}function m6(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const VS=ie.createContext(null);function p6({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 _=Gb({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=Kb(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(Gb({items:v,lookup:y}))},[]),s=Kb(l),u=ie.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return I.jsx(VS.Provider,{value:u,children:e})}function g6(){const e=ie.useContext(VS);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const y6=e=>!!e.panZoom;function Jc(){const e=c6(),t=ft(),n=g6(),i=Fe(y6),l=ie.useMemo(()=>{const s=p=>t.getState().nodeLookup.get(p),u=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},d=p=>{var k,A;const{nodeLookup:y,nodeOrigin:v}=t.getState(),b=Qb(p)?p:y.get(p.id),_=b.parentId?gS(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 cl(S)},h=(p,y,v={replace:!1})=>{u(b=>b.map(_=>{if(_.id===p){const S=typeof y=="function"?y(_):y;return v.replace&&Qb(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&&d6(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:u,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:N}=t.getState(),{nodes:j,edges:M}=await V9({nodesToRemove:p,edgesToRemove:y,nodes:v,edges:b,onBeforeDelete:N}),U=M.length>0,R=j.length>0;if(U){const B=M.map(Xb);S==null||S(M),A(B)}if(R){const B=j.map(Xb);_==null||_(j),k(B)}return(R||U)&&(E==null||E({nodes:j,edges:M})),{deletedNodes:j,deletedEdges:M}},getIntersectingNodes:(p,y=!0,v)=>{const b=Sb(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=cl(S?k:A),N=su(E,_);return y&&N>0||N>=_.width*_.height}):[]},isNodeIntersecting:(p,y,v=!0)=>{const _=Sb(p)?p:d(p);if(!_)return!1;const S=su(_,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 H9(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??F9();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 Jb=e=>e.selected,v6=typeof window<"u"?window:void 0;function x6({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ft(),{deleteElements:i}=Jc(),l=ou(e,{actInsideInputWithModifier:!1}),s=ou(t,{target:v6});ie.useEffect(()=>{if(l){const{edges:u,nodes:c}=n.getState();i({nodes:c.filter(Jb),edges:u.filter(Jb)}),n.setState({nodesSelectionActive:!1})}},[l]),ie.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function b6(e){const t=ft();ie.useEffect(()=>{const n=()=>{var l,s;if(!e.current)return!1;const i=ng(e.current);(i.height===0||i.width===0)&&((s=(l=t.getState()).onError)==null||s.call(l,"004",ur.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 Wc={position:"absolute",width:"100%",height:"100%",top:0,left:0},_6=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function w6({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:l=.5,panOnScrollMode:s=Ji.Free,zoomOnDoubleClick:u=!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 N=ft(),j=ie.useRef(null),{userSelectionActive:M,lib:U}=Fe(_6,gt),R=ou(y),B=ie.useRef();b6(j);const O=ie.useCallback(H=>{k==null||k({x:H[0],y:H[1],zoom:H[2]}),A||N.setState({transform:H})},[k,A]);return ie.useEffect(()=>{if(j.current){B.current=TL({domNode:j.current,minZoom:m,maxZoom:p,translateExtent:h,viewport:d,paneClickDistance:E,onDraggingChange:z=>N.setState({paneDragging:z}),onPanZoomStart:(z,$)=>{const{onViewportChangeStart:L,onMoveStart:q}=N.getState();q==null||q(z,$),L==null||L($)},onPanZoom:(z,$)=>{const{onViewportChange:L,onMove:q}=N.getState();q==null||q(z,$),L==null||L($)},onPanZoomEnd:(z,$)=>{const{onViewportChangeEnd:L,onMoveEnd:q}=N.getState();q==null||q(z,$),L==null||L($)}});const{x:H,y:P,zoom:F}=B.current.getViewport();return N.setState({panZoom:B.current,transform:[H,P,F],domNode:j.current.closest(".react-flow")}),()=>{var z;(z=B.current)==null||z.destroy()}}},[]),ie.useEffect(()=>{var H;(H=B.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:l,panOnScrollMode:s,zoomOnDoubleClick:u,panOnDrag:c,zoomActivationKeyPressed:R,preventScrolling:v,noPanClassName:S,userSelectionActive:M,noWheelClassName:_,lib:U,onTransformChange:O})},[e,t,n,i,l,s,u,c,R,v,S,M,_,U,O]),I.jsx("div",{className:"react-flow__renderer",ref:j,style:Wc,children:b})}const S6=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function E6(){const{userSelectionActive:e,userSelectionRect:t}=Fe(S6,gt);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 im=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},k6=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function T6({isSelecting:e,selectionKeyPressed:t,selectionMode:n=lu.Full,panOnDrag:i,selectionOnDrag:l,onSelectionStart:s,onSelectionEnd:u,onPaneClick:c,onPaneContextMenu:d,onPaneScroll:h,onPaneMouseEnter:m,onPaneMouseMove:p,onPaneMouseLeave:y,children:v}){const b=ft(),{userSelectionActive:_,elementsSelectable:S,dragging:k,connectionInProgress:A}=Fe(k6,gt),E=S&&(e||_),N=ie.useRef(null),j=ie.useRef(),M=ie.useRef(new Set),U=ie.useRef(new Set),R=ie.useRef(!1),B=ie.useRef(!1),O=q=>{if(R.current||A){R.current=!1;return}c==null||c(q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},H=q=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){q.preventDefault();return}d==null||d(q)},P=h?q=>h(q):void 0,F=q=>{var te,C;const{resetSelectedElements:K,domNode:X}=b.getState();if(j.current=X==null?void 0:X.getBoundingClientRect(),!S||!e||q.button!==0||q.target!==N.current||!j.current)return;(C=(te=q.target)==null?void 0:te.setPointerCapture)==null||C.call(te,q.pointerId),B.current=!0,R.current=!1;const{x:w,y:Z}=Dr(q.nativeEvent,j.current);K(),b.setState({userSelectionRect:{width:0,height:0,startX:w,startY:Z,x:w,y:Z}}),s==null||s(q)},z=q=>{const{userSelectionRect:K,transform:X,nodeLookup:w,edgeLookup:Z,connectionLookup:te,triggerNodeChanges:C,triggerEdgeChanges:Y,defaultEdgeOptions:Q}=b.getState();if(!j.current||!K)return;R.current=!0;const{x:W,y:ue}=Dr(q.nativeEvent,j.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,ve=U.current;M.current=new Set(cS(w,ke,X,n===lu.Partial,!0).map(De=>De.id)),U.current=new Set;const ze=(Q==null?void 0:Q.selectable)??!0;for(const De of M.current){const lt=te.get(De);if(lt)for(const{edgeId:ot}of lt.values()){const bt=Z.get(ot);bt&&(bt.selectable??ze)&&U.current.add(ot)}}if(!Eb(we,M.current)){const De=Ka(w,M.current,!0);C(De)}if(!Eb(ve,U.current)){const De=Ka(Z,U.current);Y(De)}b.setState({userSelectionRect:ke,userSelectionActive:!0,nodesSelectionActive:!1})},$=q=>{var X,w;if(q.button!==0||!B.current)return;(w=(X=q.target)==null?void 0:X.releasePointerCapture)==null||w.call(X,q.pointerId);const{userSelectionRect:K}=b.getState();!_&&K&&q.target===N.current&&(O==null||O(q)),b.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:M.current.size>0}),u==null||u(q),(t||l)&&(R.current=!1),B.current=!1},L=i===!0||Array.isArray(i)&&i.includes(0);return I.jsxs("div",{className:Ct(["react-flow__pane",{draggable:L,dragging:k,selection:e}]),onClick:E?void 0:im(O,N),onContextMenu:im(H,N),onWheel:im(P,N),onPointerEnter:E?void 0:m,onPointerDown:E?F:p,onPointerMove:E?z:p,onPointerUp:E?$:void 0,onPointerLeave:y,ref:N,style:Wc,children:[v,I.jsx(E6,{})]})}function Cp({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:l,unselectNodesAndEdges:s,multiSelectionActive:u,nodeLookup:c,onError:d}=t.getState(),h=c.get(e);if(!h){d==null||d("012",ur.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&u)&&(s({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):l([e])}function $S({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:l,isSelectable:s,nodeClickDistance:u}){const c=ft(),[d,h]=ie.useState(!1),m=ie.useRef();return ie.useEffect(()=>{m.current=dL({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{Cp({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:u}),()=>{var v;(v=m.current)==null||v.destroy()}},[n,i,t,s,e,l]),d}const C6=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ZS(){const e=ft();return ie.useCallback(n=>{const{nodeExtent:i,snapToGrid:l,snapGrid:s,nodesDraggable:u,onError:c,updateNodePositions:d,nodeLookup:h,nodeOrigin:m}=e.getState(),p=new Map,y=C6(u),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=Xc(A,s));const{position:E,positionAbsolute:N}=fS({nodeId:k.id,nextPosition:A,nodeLookup:h,nodeExtent:i,nodeOrigin:m,onError:c});k.position=E,k.internals.positionAbsolute=N,p.set(k.id,k)}d(p)},[])}const sg=ie.createContext(null),A6=sg.Provider;sg.Consumer;const YS=()=>ie.useContext(sg),N6=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),M6=(e,t,n)=>i=>{const{connectionClickStartHandle:l,connectionMode:s,connection:u}=i,{fromHandle:c,toHandle:d,isValid:h}=u,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===ul.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 O6({type:e="source",position:t=Ae.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:l=!0,isConnectableEnd:s=!0,id:u,onConnect:c,children:d,className:h,onMouseDown:m,onTouchStart:p,...y},v){var $,L;const b=u||null,_=e==="target",S=ft(),k=YS(),{connectOnClick:A,noPanClassName:E,rfId:N}=Fe(N6,gt),{connectingFrom:j,connectingTo:M,clickConnecting:U,isPossibleEndHandle:R,connectionInProcess:B,clickConnectionInProcess:O,valid:H}=Fe(M6(k,b,e),gt);k||(L=($=S.getState()).onError)==null||L.call($,"010",ur.error010());const P=q=>{const{defaultEdgeOptions:K,onConnect:X,hasDefaultEdges:w}=S.getState(),Z={...K,...q};if(w){const{edges:te,setEdges:C}=S.getState();C(W9(Z,te))}X==null||X(Z),c==null||c(Z)},F=q=>{if(!k)return;const K=xS(q.nativeEvent);if(l&&(K&&q.button===0||!K)){const X=S.getState();Tp.onPointerDown(q.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:P,isValidConnection:n||X.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:X.autoPanSpeed})}K?m==null||m(q):p==null||p(q)},z=q=>{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(q.nativeEvent,{nodeId:k,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:k,type:e,id:b}});return}const ue=yS(q.target),ce=n||te,{connection:ge,isValid:ke}=Tp.isValid(q.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&&P(ge);const we=structuredClone(W);delete we.inProgress,we.toPosition=we.toHandle?we.toHandle.position:null,X==null||X(q,we),S.setState({connectionClickStartHandle:null})};return I.jsx("div",{"data-handleid":b,"data-nodeid":k,"data-handlepos":t,"data-id":`${N}-${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:j,connectingto:M,valid:H,connectionindicator:i&&(!B||R)&&(B||O?s:l)}]),onMouseDown:F,onTouchStart:F,onClick:A?z:void 0,ref:v,...y,children:d})}const zc=ie.memo(qS(O6));function R6({data:e,isConnectable:t,sourcePosition:n=Ae.Bottom}){return I.jsxs(I.Fragment,{children:[e==null?void 0:e.label,I.jsx(zc,{type:"source",position:n,isConnectable:t})]})}function z6({data:e,isConnectable:t,targetPosition:n=Ae.Top,sourcePosition:i=Ae.Bottom}){return I.jsxs(I.Fragment,{children:[I.jsx(zc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,I.jsx(zc,{type:"source",position:i,isConnectable:t})]})}function D6(){return null}function j6({data:e,isConnectable:t,targetPosition:n=Ae.Top}){return I.jsxs(I.Fragment,{children:[I.jsx(zc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Dc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Wb={input:R6,default:z6,output:j6,group:D6};function L6(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 I6=e=>{const{width:t,height:n,x:i,y:l}=xu(e.nodeLookup,{filter:s=>!!s.selected});return{width:qn(t)?t:null,height:qn(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 B6({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=ft(),{width:l,height:s,transformString:u,userSelectionActive:c}=Fe(I6,gt),d=ZS(),h=ie.useRef(null);if(ie.useEffect(()=>{var y;n||(y=h.current)==null||y.focus({preventScroll:!0})},[n]),$S({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(Dc,y.key)&&(y.preventDefault(),d({direction:Dc[y.key],factor:y.shiftKey?4:1}))};return I.jsx("div",{className:Ct(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},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 e1=typeof window<"u"?window:void 0,H6=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function FS({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:l,onPaneContextMenu:s,onPaneScroll:u,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:N,panOnScrollSpeed:j,panOnScrollMode:M,zoomOnDoubleClick:U,panOnDrag:R,defaultViewport:B,translateExtent:O,minZoom:H,maxZoom:P,preventScrolling:F,onSelectionContextMenu:z,noWheelClassName:$,noPanClassName:L,disableKeyboardA11y:q,onViewportChange:K,isControlledViewport:X}){const{nodesSelectionActive:w,userSelectionActive:Z}=Fe(H6),te=ou(h,{target:e1}),C=ou(_,{target:e1}),Y=C||R,Q=C||N,W=m&&Y!==!0,ue=te||Z||W;return x6({deleteKeyCode:d,multiSelectionKeyCode:b}),I.jsx(w6,{onPaneContextMenu:s,elementsSelectable:k,zoomOnScroll:A,zoomOnPinch:E,panOnScroll:Q,panOnScrollSpeed:j,panOnScrollMode:M,zoomOnDoubleClick:U,panOnDrag:!te&&Y,defaultViewport:B,translateExtent:O,minZoom:H,maxZoom:P,zoomActivationKeyCode:S,preventScrolling:F,noWheelClassName:$,noPanClassName:L,onViewportChange:K,isControlledViewport:X,paneClickDistance:c,children:I.jsxs(T6,{onSelectionStart:y,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:l,onPaneContextMenu:s,onPaneScroll:u,panOnDrag:Y,isSelecting:!!ue,selectionMode:p,selectionKeyPressed:te,selectionOnDrag:W,children:[e,w&&I.jsx(B6,{onSelectionContextMenu:z,noPanClassName:L,disableKeyboardA11y:q})]})})}FS.displayName="FlowRenderer";const U6=ie.memo(FS),P6=e=>t=>e?cS(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 q6(e){return Fe(ie.useCallback(P6(e),[e]),gt)}const V6=e=>e.updateNodeInternals;function $6(){const e=Fe(V6),[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 Z6({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const l=ft(),s=ie.useRef(null),u=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||u.current!==s.current)&&(u.current&&(i==null||i.unobserve(u.current)),i==null||i.observe(s.current),u.current=s.current)},[m,e.hidden]),ie.useEffect(()=>()=>{u.current&&(i==null||i.unobserve(u.current),u.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 Y6({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:l,onContextMenu:s,onDoubleClick:u,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:N,isParent:j}=Fe(ue=>{const ce=ue.nodeLookup.get(e),ge=ue.parentLookup.has(e);return{node:ce,internals:ce.internals,isParent:ge}},gt);let M=E.type||"default",U=(S==null?void 0:S[M])||Wb[M];U===void 0&&(A==null||A("003",ur.error003(M)),M="default",U=Wb.default);const R=!!(E.draggable||c&&typeof E.draggable>"u"),B=!!(E.selectable||d&&typeof E.selectable>"u"),O=!!(E.connectable||h&&typeof E.connectable>"u"),H=!!(E.focusable||m&&typeof E.focusable>"u"),P=ft(),F=pS(E),z=Z6({node:E,nodeType:M,hasDimensions:F,resizeObserver:p}),$=$S({nodeRef:z,disabled:E.hidden||!R,noDragClassName:y,handleSelector:E.dragHandle,nodeId:e,isSelectable:B,nodeClickDistance:k}),L=ZS();if(E.hidden)return null;const q=Br(E),K=L6(E),X=B||R||t||n||i||l,w=n?ue=>n(ue,{...N.userNode}):void 0,Z=i?ue=>i(ue,{...N.userNode}):void 0,te=l?ue=>l(ue,{...N.userNode}):void 0,C=s?ue=>s(ue,{...N.userNode}):void 0,Y=u?ue=>u(ue,{...N.userNode}):void 0,Q=ue=>{const{selectNodesOnDrag:ce,nodeDragThreshold:ge}=P.getState();B&&(!ce||!R||ge>0)&&Cp({id:e,store:P,nodeRef:z}),t&&t(ue,{...N.userNode})},W=ue=>{if(!(vS(ue.nativeEvent)||b))if(lS.includes(ue.key)&&B){const ce=ue.key==="Escape";Cp({id:e,store:P,unselect:ce,nodeRef:z})}else R&&E.selected&&Object.prototype.hasOwnProperty.call(Dc,ue.key)&&(ue.preventDefault(),P.setState({ariaLiveMessage:`Moved selected node ${ue.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~N.positionAbsolute.x}, y: ${~~N.positionAbsolute.y}`}),L({direction:Dc[ue.key],factor:ue.shiftKey?4:1}))};return I.jsx("div",{className:Ct(["react-flow__node",`react-flow__node-${M}`,{[v]:R},E.className,{selected:E.selected,selectable:B,parent:j,draggable:R,dragging:$}]),ref:z,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.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:H?W:void 0,tabIndex:H?0:void 0,role:H?"button":void 0,"aria-describedby":b?void 0:`${LS}-${_}`,"aria-label":E.ariaLabel,children:I.jsx(A6,{value:e,children:I.jsx(U,{id:e,data:E.data,type:M,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:E.selected??!1,selectable:B,draggable:R,deletable:E.deletable??!0,isConnectable:O,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:$,dragHandle:E.dragHandle,zIndex:N.z,parentId:E.parentId,...q})})})}const F6=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function GS(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:l,onError:s}=Fe(F6,gt),u=q6(e.onlyRenderVisibleElements),c=$6();return I.jsx("div",{className:"react-flow__nodes",style:Wc,children:u.map(d=>I.jsx(Y6,{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))})}GS.displayName="NodeRenderer";const G6=ie.memo(GS);function X6(e){return Fe(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),u=n.nodeLookup.get(l.target);s&&u&&Q9({sourceNode:s,targetNode:u,width:n.width,height:n.height,transform:n.transform})&&i.push(l.id)}return i},[e]),gt)}const Q6=({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"}),K6=({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"}),t1={[Nc.Arrow]:Q6,[Nc.ArrowClosed]:K6};function J6(e){const t=ft();return ie.useMemo(()=>{var l,s;return Object.prototype.hasOwnProperty.call(t1,e)?t1[e]:((s=(l=t.getState()).onError)==null||s.call(l,"009",ur.error009(e)),null)},[e])}const W6=({id:e,type:t,color:n,width:i=12.5,height:l=12.5,markerUnits:s="strokeWidth",strokeWidth:u,orient:c="auto-start-reverse"})=>{const d=J6(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:u})}):null},XS=({defaultColor:e,rfId:t})=>{const n=Fe(s=>s.edges),i=Fe(s=>s.defaultEdgeOptions),l=ie.useMemo(()=>iL(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(W6,{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};XS.displayName="MarkerDefinitions";var e5=ie.memo(XS);function QS({x:e,y:t,label:n,labelStyle:i,labelShowBg:l=!0,labelBgStyle:s,labelBgPadding:u=[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*u[0],x:-u[0],y:-u[1],height:p.height+2*u[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}QS.displayName="EdgeText";const t5=ie.memo(QS);function ef({path:e,labelX:t,labelY:n,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:u,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&&qn(t)&&qn(n)?I.jsx(t5,{x:t,y:n,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d}):null]})}function n1({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 KS({sourceX:e,sourceY:t,sourcePosition:n=Ae.Bottom,targetX:i,targetY:l,targetPosition:s=Ae.Top}){const[u,c]=n1({pos:n,x1:e,y1:t,x2:i,y2:l}),[d,h]=n1({pos:s,x1:i,y1:l,x2:e,y2:t}),[m,p,y,v]=bS({sourceX:e,sourceY:t,targetX:i,targetY:l,sourceControlX:u,sourceControlY:c,targetControlX:d,targetControlY:h});return[`M${e},${t} C${u},${c} ${d},${h} ${i},${l}`,m,p,y,v]}function JS(e){return ie.memo(({id:t,sourceX:n,sourceY:i,targetX:l,targetY:s,sourcePosition:u,targetPosition:c,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:v,style:b,markerEnd:_,markerStart:S,interactionWidth:k})=>{const[A,E,N]=KS({sourceX:n,sourceY:i,sourcePosition:u,targetX:l,targetY:s,targetPosition:c}),j=e.isInternal?void 0:t;return I.jsx(ef,{id:j,path:A,labelX:E,labelY:N,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:v,style:b,markerEnd:_,markerStart:S,interactionWidth:k})})}const n5=JS({isInternal:!1}),WS=JS({isInternal:!0});n5.displayName="SimpleBezierEdge";WS.displayName="SimpleBezierEdgeInternal";function eE(e){return ie.memo(({id:t,sourceX:n,sourceY:i,targetX:l,targetY:s,label:u,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,N,j]=Sp({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(ef,{id:M,path:E,labelX:N,labelY:j,label:u,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:p,style:y,markerEnd:_,markerStart:S,interactionWidth:A})})}const tE=eE({isInternal:!1}),nE=eE({isInternal:!0});tE.displayName="SmoothStepEdge";nE.displayName="SmoothStepEdgeInternal";function rE(e){return ie.memo(({id:t,...n})=>{var l;const i=e.isInternal?void 0:t;return I.jsx(tE,{...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 r5=rE({isInternal:!1}),iE=rE({isInternal:!0});r5.displayName="StepEdge";iE.displayName="StepEdgeInternal";function aE(e){return ie.memo(({id:t,sourceX:n,sourceY:i,targetX:l,targetY:s,label:u,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:p,style:y,markerEnd:v,markerStart:b,interactionWidth:_})=>{const[S,k,A]=SS({sourceX:n,sourceY:i,targetX:l,targetY:s}),E=e.isInternal?void 0:t;return I.jsx(ef,{id:E,path:S,labelX:k,labelY:A,label:u,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:p,style:y,markerEnd:v,markerStart:b,interactionWidth:_})})}const i5=aE({isInternal:!1}),lE=aE({isInternal:!0});i5.displayName="StraightEdge";lE.displayName="StraightEdgeInternal";function sE(e){return ie.memo(({id:t,sourceX:n,sourceY:i,targetX:l,targetY:s,sourcePosition:u=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,N,j]=_S({sourceX:n,sourceY:i,sourcePosition:u,targetX:l,targetY:s,targetPosition:c,curvature:k==null?void 0:k.curvature}),M=e.isInternal?void 0:t;return I.jsx(ef,{id:M,path:E,labelX:N,labelY:j,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:v,style:b,markerEnd:_,markerStart:S,interactionWidth:A})})}const a5=sE({isInternal:!1}),uE=sE({isInternal:!0});a5.displayName="BezierEdge";uE.displayName="BezierEdgeInternal";const r1={default:uE,straight:lE,step:iE,smoothstep:nE,simplebezier:WS},i1={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},l5=(e,t,n)=>n===Ae.Left?e-t:n===Ae.Right?e+t:e,s5=(e,t,n)=>n===Ae.Top?e-t:n===Ae.Bottom?e+t:e,a1="react-flow__edgeupdater";function l1({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:l,onMouseEnter:s,onMouseOut:u,type:c}){return I.jsx("circle",{onMouseDown:l,onMouseEnter:s,onMouseOut:u,className:Ct([a1,`${a1}-${c}`]),cx:l5(t,i,e),cy:s5(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function u5({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:l,targetX:s,targetY:u,sourcePosition:c,targetPosition:d,onReconnect:h,onReconnectStart:m,onReconnectEnd:p,setReconnecting:y,setUpdateHover:v}){const b=ft(),_=(N,j)=>{if(N.button!==0)return;const{autoPanOnConnect:M,domNode:U,isValidConnection:R,connectionMode:B,connectionRadius:O,lib:H,onConnectStart:P,onConnectEnd:F,cancelConnection:z,nodeLookup:$,rfId:L,panBy:q,updateConnection:K}=b.getState(),X=j.type==="target";y(!0),m==null||m(N,n,j.type);const w=(te,C)=>{y(!1),p==null||p(te,n,j.type,C)},Z=te=>h==null?void 0:h(n,te);Tp.onPointerDown(N.nativeEvent,{autoPanOnConnect:M,connectionMode:B,connectionRadius:O,domNode:U,handleId:j.id,nodeId:j.nodeId,nodeLookup:$,isTarget:X,edgeUpdaterType:j.type,lib:H,flowId:L,cancelConnection:z,panBy:q,isValidConnection:R,onConnect:Z,onConnectStart:P,onConnectEnd:F,onReconnectEnd:w,updateConnection:K,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle})},S=N=>_(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=N=>_(N,{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(l1,{position:c,centerX:i,centerY:l,radius:t,onMouseDown:S,onMouseEnter:A,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&I.jsx(l1,{position:d,centerX:s,centerY:u,radius:t,onMouseDown:k,onMouseEnter:A,onMouseOut:E,type:"target"})]})}function o5({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:l,onDoubleClick:s,onContextMenu:u,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=Fe(ve=>ve.edgeLookup.get(e));const N=Fe(ve=>ve.defaultEdgeOptions);E=N?{...N,...E}:E;let j=E.type||"default",M=(_==null?void 0:_[j])||r1[j];M===void 0&&(k==null||k("011",ur.error011(j)),j="default",M=r1.default);const U=!!(E.focusable||t&&typeof E.focusable>"u"),R=typeof p<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),B=!!(E.selectable||i&&typeof E.selectable>"u"),O=ie.useRef(null),[H,P]=ie.useState(!1),[F,z]=ie.useState(!1),$=ft(),{zIndex:L,sourceX:q,sourceY:K,targetX:X,targetY:w,sourcePosition:Z,targetPosition:te}=Fe(ie.useCallback(ve=>{const ze=ve.nodeLookup.get(E.source),De=ve.nodeLookup.get(E.target);if(!ze||!De)return{zIndex:E.zIndex,...i1};const lt=rL({id:e,sourceNode:ze,targetNode:De,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:ve.connectionMode,onError:k});return{zIndex:X9({selected:E.selected,zIndex:E.zIndex,sourceNode:ze,targetNode:De,elevateOnSelect:ve.elevateEdgesOnSelect}),...lt||i1}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),gt),C=ie.useMemo(()=>E.markerStart?`url('#${Ep(E.markerStart,b)}')`:void 0,[E.markerStart,b]),Y=ie.useMemo(()=>E.markerEnd?`url('#${Ep(E.markerEnd,b)}')`:void 0,[E.markerEnd,b]);if(E.hidden||q===null||K===null||X===null||w===null)return null;const Q=ve=>{var ot;const{addSelectedEdges:ze,unselectNodesAndEdges:De,multiSelectionActive:lt}=$.getState();B&&($.setState({nodesSelectionActive:!1}),E.selected&&lt?(De({nodes:[],edges:[E]}),(ot=O.current)==null||ot.blur()):ze([e])),l&&l(ve,E)},W=s?ve=>{s(ve,{...E})}:void 0,ue=u?ve=>{u(ve,{...E})}:void 0,ce=c?ve=>{c(ve,{...E})}:void 0,ge=d?ve=>{d(ve,{...E})}:void 0,ke=h?ve=>{h(ve,{...E})}:void 0,we=ve=>{var ze;if(!A&&lS.includes(ve.key)&&B){const{unselectNodesAndEdges:De,addSelectedEdges:lt}=$.getState();ve.key==="Escape"?((ze=O.current)==null||ze.blur(),De({edges:[E]})):lt([e])}};return I.jsx("svg",{style:{zIndex:L},children:I.jsxs("g",{className:Ct(["react-flow__edge",`react-flow__edge-${j}`,E.className,S,{selected:E.selected,animated:E.animated,inactive:!B&&!l,updating:H,selectable:B}]),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?`${IS}-${b}`:void 0,ref:O,children:[!F&&I.jsx(M,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:B,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:q,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}),R&&I.jsx(u5,{edge:E,isReconnectable:R,reconnectRadius:m,onReconnect:p,onReconnectStart:y,onReconnectEnd:v,sourceX:q,sourceY:K,targetX:X,targetY:w,sourcePosition:Z,targetPosition:te,setUpdateHover:P,setReconnecting:z})]})})}const c5=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function oE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:l,onReconnect:s,onEdgeContextMenu:u,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}=Fe(c5,gt),N=X6(t);return I.jsxs("div",{className:"react-flow__edges",children:[I.jsx(e5,{defaultColor:e,rfId:n}),N.map(j=>I.jsx(o5,{id:j,edgesFocusable:S,edgesReconnectable:k,elementsSelectable:A,noPanClassName:l,onReconnect:s,onContextMenu:u,onMouseEnter:c,onMouseMove:d,onMouseLeave:h,onClick:m,reconnectRadius:p,onDoubleClick:y,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:E,edgeTypes:i,disableKeyboardA11y:_},j))]})}oE.displayName="EdgeRenderer";const f5=ie.memo(oE),d5=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function h5({children:e}){const t=Fe(d5);return I.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function m5(e){const t=Jc(),n=ie.useRef(!1);ie.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const p5=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function g5(e){const t=Fe(p5),n=ft();return ie.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function y5(e){return e.connection.inProgress?{...e.connection,to:bu(e.connection.to,e.transform)}:{...e.connection}}function v5(e){return y5}function x5(e){const t=v5();return Fe(t,gt)}const b5=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function _5({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:l,width:s,height:u,isValid:c,inProgress:d}=Fe(b5,gt);return!(s&&l&&d)?null:I.jsx("svg",{style:e,width:s,height:u,className:"react-flow__connectionline react-flow__container",children:I.jsx("g",{className:Ct(["react-flow__connection",uS(c)]),children:I.jsx(cE,{style:t,type:n,CustomComponent:i,isValid:c})})})}const cE=({style:e,type:t=vi.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:l,from:s,fromNode:u,fromHandle:c,fromPosition:d,to:h,toNode:m,toHandle:p,toPosition:y}=x5();if(!l)return;if(n)return I.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:c,fromX:s.x,fromY:s.y,toX:h.x,toY:h.y,fromPosition:d,toPosition:y,connectionStatus:uS(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 vi.Bezier:[v]=_S(b);break;case vi.SimpleBezier:[v]=KS(b);break;case vi.Step:[v]=Sp({...b,borderRadius:0});break;case vi.SmoothStep:[v]=Sp(b);break;default:[v]=SS(b)}return I.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:e})};cE.displayName="ConnectionLine";const w5={};function s1(e=w5){ie.useRef(e),ft(),ie.useEffect(()=>{},[e])}function S5(){ft(),ie.useRef(!1),ie.useEffect(()=>{},[])}function fE({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:l,onNodeDoubleClick:s,onEdgeDoubleClick:u,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:N,multiSelectionKeyCode:j,panActivationKeyCode:M,zoomActivationKeyCode:U,deleteKeyCode:R,onlyRenderVisibleElements:B,elementsSelectable:O,defaultViewport:H,translateExtent:P,minZoom:F,maxZoom:z,preventScrolling:$,defaultMarkerColor:L,zoomOnScroll:q,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:ve,onEdgeMouseEnter:ze,onEdgeMouseMove:De,onEdgeMouseLeave:lt,reconnectRadius:ot,onReconnect:bt,onReconnectStart:Ti,onReconnectEnd:fr,noDragClassName:Mn,noWheelClassName:Xn,noPanClassName:dr,disableKeyboardA11y:Qn,nodeExtent:Ci,rfId:Kn,viewport:le,onViewportChange:de}){return s1(e),s1(t),S5(),m5(n),g5(le),I.jsx(U6,{onPaneClick:Y,onPaneMouseEnter:Q,onPaneMouseMove:W,onPaneMouseLeave:ue,onPaneContextMenu:ge,onPaneScroll:ce,paneClickDistance:ke,deleteKeyCode:R,selectionKeyCode:A,selectionOnDrag:E,selectionMode:N,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:j,panActivationKeyCode:M,zoomActivationKeyCode:U,elementsSelectable:O,zoomOnScroll:q,zoomOnPinch:K,zoomOnDoubleClick:te,panOnScroll:X,panOnScrollSpeed:w,panOnScrollMode:Z,panOnDrag:C,defaultViewport:H,translateExtent:P,minZoom:F,maxZoom:z,onSelectionContextMenu:p,preventScrolling:$,noDragClassName:Mn,noWheelClassName:Xn,noPanClassName:dr,disableKeyboardA11y:Qn,onViewportChange:de,isControlledViewport:!!le,children:I.jsxs(h5,{children:[I.jsx(f5,{edgeTypes:t,onEdgeClick:l,onEdgeDoubleClick:u,onReconnect:bt,onReconnectStart:Ti,onReconnectEnd:fr,onlyRenderVisibleElements:B,onEdgeContextMenu:ve,onEdgeMouseEnter:ze,onEdgeMouseMove:De,onEdgeMouseLeave:lt,reconnectRadius:ot,defaultMarkerColor:L,noPanClassName:dr,disableKeyboardA11y:Qn,rfId:Kn}),I.jsx(_5,{style:_,type:b,component:S,containerStyle:k}),I.jsx("div",{className:"react-flow__edgelabel-renderer"}),I.jsx(G6,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:m,nodeClickDistance:we,onlyRenderVisibleElements:B,noPanClassName:dr,noDragClassName:Mn,disableKeyboardA11y:Qn,nodeExtent:Ci,rfId:Kn}),I.jsx("div",{className:"react-flow__viewport-portal"})]})})}fE.displayName="GraphView";const E5=ie.memo(fE),u1=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:l,height:s,fitView:u,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??au;kS(b,_,S);const N=kp(k,y,v,{nodeOrigin:A,nodeExtent:E,elevateNodesOnSelect:!1});let j=[0,0,1];if(u&&l&&s){const M=xu(y,{filter:O=>!!((O.width||O.initialWidth)&&(O.height||O.initialHeight))}),{x:U,y:R,zoom:B}=tg(M,l,s,d,h,(c==null?void 0:c.padding)??.1);j=[U,R,B]}return{rfId:"1",width:0,height:0,transform:j,nodes:k,nodesInitialized:N,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:au,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ul.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:u??!1,fitViewOptions:c,fitViewResolver:null,connection:{...sS},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:$9,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},k5=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:l,height:s,fitView:u,fitViewOptions:c,minZoom:d,maxZoom:h,nodeOrigin:m,nodeExtent:p})=>ZL((y,v)=>{async function b(){const{nodeLookup:_,panZoom:S,fitViewOptions:k,fitViewResolver:A,width:E,height:N,minZoom:j,maxZoom:M}=v();S&&(await q9({nodes:_,width:E,height:N,panZoom:S,minZoom:j,maxZoom:M},k),A==null||A.resolve(!0),y({fitViewResolver:null}))}return{...u1({nodes:e,edges:t,width:l,height:s,fitView:u,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:N}=v(),j=kp(_,S,k,{nodeOrigin:A,nodeExtent:p,elevateNodesOnSelect:E,checkEquality:!0});N&&j?(b(),y({nodes:_,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0})):y({nodes:_,nodesInitialized:j})},setEdges:_=>{const{connectionLookup:S,edgeLookup:k}=v();kS(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:N,nodeExtent:j,debug:M,fitViewQueued:U}=v(),{changes:R,updatedInternals:B}=oL(_,k,A,E,N,j);B&&(lL(k,A,{nodeOrigin:N,nodeExtent:j}),U?(b(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(R==null?void 0:R.length)>0&&(M&&console.log("React Flow: trigger node changes",R),S==null||S(R)))},updateNodePositions:(_,S=!1)=>{const k=[],A=[],{nodeLookup:E,triggerNodeChanges:N}=v();for(const[j,M]of _){const U=E.get(j),R=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(M!=null&&M.position)),B={id:j,type:"position",position:R?{x:Math.max(0,M.position.x),y:Math.max(0,M.position.y)}:M.position,dragging:S};R&&U.parentId&&k.push({id:j,parentId:U.parentId,rect:{...M.internals.positionAbsolute,width:M.measured.width??0,height:M.measured.height??0}}),A.push(B)}if(k.length>0){const{parentLookup:j,nodeOrigin:M}=v(),U=lg(k,E,j,M);A.push(...U)}N(A)},triggerNodeChanges:_=>{const{onNodesChange:S,setNodes:k,nodes:A,hasDefaultNodes:E,debug:N}=v();if(_!=null&&_.length){if(E){const j=US(_,A);k(j)}N&&console.log("React Flow: trigger node changes",_),S==null||S(_)}},triggerEdgeChanges:_=>{const{onEdgesChange:S,setEdges:k,edges:A,hasDefaultEdges:E,debug:N}=v();if(_!=null&&_.length){if(E){const j=PS(_,A);k(j)}N&&console.log("React Flow: trigger edge changes",_),S==null||S(_)}},addSelectedNodes:_=>{const{multiSelectionActive:S,edgeLookup:k,nodeLookup:A,triggerNodeChanges:E,triggerEdgeChanges:N}=v();if(S){const j=_.map(M=>Fi(M,!0));E(j);return}E(Ka(A,new Set([..._]),!0)),N(Ka(k))},addSelectedEdges:_=>{const{multiSelectionActive:S,edgeLookup:k,nodeLookup:A,triggerNodeChanges:E,triggerEdgeChanges:N}=v();if(S){const j=_.map(M=>Fi(M,!0));N(j);return}N(Ka(k,new Set([..._]))),E(Ka(A,new Set,!0))},unselectNodesAndEdges:({nodes:_,edges:S}={})=>{const{edges:k,nodes:A,nodeLookup:E,triggerNodeChanges:N,triggerEdgeChanges:j}=v(),M=_||A,U=S||k,R=M.map(O=>{const H=E.get(O.id);return H&&(H.selected=!1),Fi(O.id,!1)}),B=U.map(O=>Fi(O.id,!1));N(R),j(B)},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 N=S.reduce((M,U)=>U.selected?[...M,Fi(U.id,!1)]:M,[]),j=_.reduce((M,U)=>U.selected?[...M,Fi(U.id,!1)]:M,[]);k(N),A(j)},setNodeExtent:_=>{const{nodes:S,nodeLookup:k,parentLookup:A,nodeOrigin:E,elevateNodesOnSelect:N,nodeExtent:j}=v();_[0][0]===j[0][0]&&_[0][1]===j[0][1]&&_[1][0]===j[1][0]&&_[1][1]===j[1][1]||(kp(S,k,A,{nodeOrigin:E,nodeExtent:_,elevateNodesOnSelect:N,checkEquality:!1}),y({nodeExtent:_}))},panBy:_=>{const{transform:S,width:k,height:A,panZoom:E,translateExtent:N}=v();return cL({delta:_,panZoom:E,transform:S,translateExtent:N,width:k,height:A})},cancelConnection:()=>{y({connection:{...sS}})},updateConnection:_=>{y({connection:_})},reset:()=>y({...u1()})}},Object.is);function dE({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:l,initialHeight:s,initialMinZoom:u,initialMaxZoom:c,initialFitViewOptions:d,fitView:h,nodeOrigin:m,nodeExtent:p,children:y}){const[v]=ie.useState(()=>k5({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:l,height:s,fitView:h,minZoom:u,maxZoom:c,fitViewOptions:d,nodeOrigin:m,nodeExtent:p}));return I.jsx(YL,{value:v,children:I.jsx(p6,{children:y})})}function T5({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:l,width:s,height:u,fitView:c,fitViewOptions:d,minZoom:h,maxZoom:m,nodeOrigin:p,nodeExtent:y}){return ie.useContext(Kc)?I.jsx(I.Fragment,{children:e}):I.jsx(dE,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:l,initialWidth:s,initialHeight:u,fitView:c,initialFitViewOptions:d,initialMinZoom:h,initialMaxZoom:m,nodeOrigin:p,nodeExtent:y,children:e})}const C5={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function A5({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:l,nodeTypes:s,edgeTypes:u,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:N,onNodeContextMenu:j,onNodeDoubleClick:M,onNodeDragStart:U,onNodeDrag:R,onNodeDragStop:B,onNodesDelete:O,onEdgesDelete:H,onDelete:P,onSelectionChange:F,onSelectionDragStart:z,onSelectionDrag:$,onSelectionDragStop:L,onSelectionContextMenu:q,onSelectionStart:K,onSelectionEnd:X,onBeforeDelete:w,connectionMode:Z,connectionLineType:te=vi.Bezier,connectionLineStyle:C,connectionLineComponent:Y,connectionLineContainerStyle:Q,deleteKeyCode:W="Backspace",selectionKeyCode:ue="Shift",selectionOnDrag:ce=!1,selectionMode:ge=lu.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:we=Rc()?"Meta":"Control",zoomActivationKeyCode:ve=Rc()?"Meta":"Control",snapToGrid:ze,snapGrid:De,onlyRenderVisibleElements:lt=!1,selectNodesOnDrag:ot,nodesDraggable:bt,nodesConnectable:Ti,nodesFocusable:fr,nodeOrigin:Mn=BS,edgesFocusable:Xn,edgesReconnectable:dr,elementsSelectable:Qn=!0,defaultViewport:Ci=a6,minZoom:Kn=.5,maxZoom:le=2,translateExtent:de=au,preventScrolling:Ee=!0,nodeExtent:Te,defaultMarkerColor:Xe="#b1b1b7",zoomOnScroll:$t=!0,zoomOnPinch:On=!0,panOnScroll:It=!1,panOnScrollSpeed:bn=.5,panOnScrollMode:Zt=Ji.Free,zoomOnDoubleClick:_t=!0,panOnDrag:Qt=!0,onPaneClick:sn,onPaneMouseEnter:wu,onPaneMouseMove:Su,onPaneMouseLeave:pl,onPaneScroll:Ai,onPaneContextMenu:tf,paneClickDistance:gl=0,nodeClickDistance:Eu=0,children:yl,onReconnect:vl,onReconnectStart:ku,onReconnectEnd:nf,onEdgeContextMenu:Jn,onEdgeDoubleClick:Mt,onEdgeMouseEnter:Bt,onEdgeMouseMove:Hr,onEdgeMouseLeave:xl,reconnectRadius:rf=10,onNodesChange:af,onEdgesChange:Tu,noDragClassName:Ni="nodrag",noWheelClassName:bl="nowheel",noPanClassName:hr="nopan",fitView:mr,fitViewOptions:Ur,connectOnClick:Pr,attributionPosition:wt,proOptions:Cu,defaultEdgeOptions:Au,elevateNodesOnSelect:pr,elevateEdgesOnSelect:qr,disableKeyboardA11y:Nu=!1,autoPanOnConnect:Mu,autoPanOnNodeDrag:Ou,autoPanSpeed:lf,connectionRadius:la,isValidConnection:sa,onError:Rn,style:_l,id:wl,nodeDragThreshold:Vr,viewport:Sl,onViewportChange:El,width:sf,height:Ru,colorMode:Kt="light",debug:zu,onScroll:ua,...oa},Du){const $r=wl||"1",uf=o6(Kt),Jt=ie.useCallback(ca=>{ca.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ua==null||ua(ca)},[ua]);return I.jsx("div",{"data-testid":"rf__wrapper",...oa,onScroll:Jt,style:{..._l,...C5},ref:Du,className:Ct(["react-flow",l,uf]),id:wl,children:I.jsxs(T5,{nodes:e,edges:t,width:sf,height:Ru,fitView:mr,fitViewOptions:Ur,minZoom:Kn,maxZoom:le,nodeOrigin:Mn,nodeExtent:Te,children:[I.jsx(E5,{onInit:h,onNodeClick:c,onEdgeClick:d,onNodeMouseEnter:A,onNodeMouseMove:E,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:M,nodeTypes:s,edgeTypes:u,connectionLineType:te,connectionLineStyle:C,connectionLineComponent:Y,connectionLineContainerStyle:Q,selectionKeyCode:ue,selectionOnDrag:ce,selectionMode:ge,deleteKeyCode:W,multiSelectionKeyCode:we,panActivationKeyCode:ke,zoomActivationKeyCode:ve,onlyRenderVisibleElements:lt,defaultViewport:Ci,translateExtent:de,minZoom:Kn,maxZoom:le,preventScrolling:Ee,zoomOnScroll:$t,zoomOnPinch:On,zoomOnDoubleClick:_t,panOnScroll:It,panOnScrollSpeed:bn,panOnScrollMode:Zt,panOnDrag:Qt,onPaneClick:sn,onPaneMouseEnter:wu,onPaneMouseMove:Su,onPaneMouseLeave:pl,onPaneScroll:Ai,onPaneContextMenu:tf,paneClickDistance:gl,nodeClickDistance:Eu,onSelectionContextMenu:q,onSelectionStart:K,onSelectionEnd:X,onReconnect:vl,onReconnectStart:ku,onReconnectEnd:nf,onEdgeContextMenu:Jn,onEdgeDoubleClick:Mt,onEdgeMouseEnter:Bt,onEdgeMouseMove:Hr,onEdgeMouseLeave:xl,reconnectRadius:rf,defaultMarkerColor:Xe,noDragClassName:Ni,noWheelClassName:bl,noPanClassName:hr,rfId:$r,disableKeyboardA11y:Nu,nodeExtent:Te,viewport:Sl,onViewportChange:El}),I.jsx(u6,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:b,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:bt,nodesConnectable:Ti,nodesFocusable:fr,edgesFocusable:Xn,edgesReconnectable:dr,elementsSelectable:Qn,elevateNodesOnSelect:pr,elevateEdgesOnSelect:qr,minZoom:Kn,maxZoom:le,nodeExtent:Te,onNodesChange:af,onEdgesChange:Tu,snapToGrid:ze,snapGrid:De,connectionMode:Z,translateExtent:de,connectOnClick:Pr,defaultEdgeOptions:Au,fitView:mr,fitViewOptions:Ur,onNodesDelete:O,onEdgesDelete:H,onDelete:P,onNodeDragStart:U,onNodeDrag:R,onNodeDragStop:B,onSelectionDrag:$,onSelectionDragStart:z,onSelectionDragStop:L,onMove:m,onMoveStart:p,onMoveEnd:y,noPanClassName:hr,nodeOrigin:Mn,rfId:$r,autoPanOnConnect:Mu,autoPanOnNodeDrag:Ou,autoPanSpeed:lf,onError:Rn,connectionRadius:la,isValidConnection:sa,selectNodesOnDrag:ot,nodeDragThreshold:Vr,onBeforeDelete:w,paneClickDistance:gl,debug:zu}),I.jsx(i6,{onSelectionChange:F}),yl,I.jsx(WL,{proOptions:Cu,position:wt}),I.jsx(KL,{rfId:$r,disableKeyboardA11y:Nu})]})})}var N5=qS(A5);function M5(e){const[t,n]=ie.useState(e),i=ie.useCallback(l=>n(s=>US(l,s)),[]);return[t,n,i]}function O5(e){const[t,n]=ie.useState(e),i=ie.useCallback(l=>n(s=>PS(l,s)),[]);return[t,n,i]}function R5({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 z5({radius:e,className:t}){return I.jsx("circle",{cx:e,cy:e,r:e,className:Ct(["react-flow__background-pattern","dots",t])})}var xi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(xi||(xi={}));const D5={[xi.Dots]:1,[xi.Lines]:1,[xi.Cross]:6},j5=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function hE({id:e,variant:t=xi.Dots,gap:n=20,size:i,lineWidth:l=1,offset:s=0,color:u,bgColor:c,style:d,className:h,patternClassName:m}){const p=ie.useRef(null),{transform:y,patternId:v}=Fe(j5,gt),b=i||D5[t],_=t===xi.Dots,S=t===xi.Cross,k=Array.isArray(n)?n:[n,n],A=[k[0]*y[2]||1,k[1]*y[2]||1],E=b*y[2],N=Array.isArray(s)?s:[s,s],j=S?[E,E]:A,M=[N[0]*y[2]||1+j[0]/2,N[1]*y[2]||1+j[1]/2],U=`${v}${e||""}`;return I.jsxs("svg",{className:Ct(["react-flow__background",h]),style:{...d,...Wc,"--xy-background-color-props":c,"--xy-background-pattern-color-props":u},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(z5,{radius:E/2,className:m}):I.jsx(R5,{dimensions:j,lineWidth:l,variant:t,className:m})}),I.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${U})`})]})}hE.displayName="Background";const L5=ie.memo(hE);function I5(){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 B5(){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 H5(){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 U5(){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 P5(){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 ic({children:e,className:t,...n}){return I.jsx("button",{type:"button",className:Ct(["react-flow__controls-button",t]),...n,children:e})}const q5=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function mE({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:l,onZoomIn:s,onZoomOut:u,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}=Fe(q5,gt),{zoomIn:A,zoomOut:E,fitView:N}=Jc(),j=()=>{A(),s==null||s()},M=()=>{E(),u==null||u()},U=()=>{N(l),c==null||c()},R=()=>{b.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),d==null||d(!_)},B=y==="horizontal"?"horizontal":"vertical";return I.jsxs(_u,{className:Ct(["react-flow__controls",B,h]),position:p,style:e,"data-testid":"rf__controls","aria-label":v,children:[t&&I.jsxs(I.Fragment,{children:[I.jsx(ic,{onClick:j,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k,children:I.jsx(I5,{})}),I.jsx(ic,{onClick:M,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S,children:I.jsx(B5,{})})]}),n&&I.jsx(ic,{className:"react-flow__controls-fitview",onClick:U,title:"fit view","aria-label":"fit view",children:I.jsx(H5,{})}),i&&I.jsx(ic,{className:"react-flow__controls-interactive",onClick:R,title:"toggle interactivity","aria-label":"toggle interactivity",children:_?I.jsx(P5,{}):I.jsx(U5,{})}),m]})}mE.displayName="Controls";const V5=ie.memo(mE);function $5({id:e,x:t,y:n,width:i,height:l,style:s,color:u,strokeColor:c,strokeWidth:d,className:h,borderRadius:m,shapeRendering:p,selected:y,onClick:v}){const{background:b,backgroundColor:_}=s||{},S=u||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 Z5=ie.memo($5),Y5=e=>e.nodes.map(t=>t.id),am=e=>e instanceof Function?e:()=>e;function F5({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:s=Z5,onClick:u}){const c=Fe(Y5,gt),d=am(t),h=am(e),m=am(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return I.jsx(I.Fragment,{children:c.map(y=>I.jsx(X5,{id:y,nodeColorFunc:d,nodeStrokeColorFunc:h,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:l,NodeComponent:s,onClick:u,shapeRendering:p},y))})}function G5({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:l,nodeStrokeWidth:s,shapeRendering:u,NodeComponent:c,onClick:d}){const{node:h,x:m,y:p,width:y,height:v}=Fe(b=>{const{internals:_}=b.nodeLookup.get(e),S=_.userNode,{x:k,y:A}=_.positionAbsolute,{width:E,height:N}=Br(S);return{node:S,x:k,y:A,width:E,height:N}},gt);return!h||h.hidden||!pS(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:u,onClick:d,id:h.id})}const X5=ie.memo(G5);var Q5=ie.memo(F5);const K5=200,J5=150,W5=e=>!e.hidden,eI=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?mS(xu(e.nodeLookup,{filter:W5}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},tI="react-flow__minimap-desc";function pE({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:l="",nodeBorderRadius:s=5,nodeStrokeWidth:u,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:N=5}){const j=ft(),M=ie.useRef(null),{boundingRect:U,viewBB:R,rfId:B,panZoom:O,translateExtent:H,flowWidth:P,flowHeight:F}=Fe(eI,gt),z=(e==null?void 0:e.width)??K5,$=(e==null?void 0:e.height)??J5,L=U.width/z,q=U.height/$,K=Math.max(L,q),X=K*z,w=K*$,Z=N*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=`${tI}-${B}`,ue=ie.useRef(0),ce=ie.useRef();ue.current=K,ie.useEffect(()=>{if(M.current&&O)return ce.current=vL({domNode:M.current,panZoom:O,getTransform:()=>j.getState().transform,getViewScale:()=>ue.current}),()=>{var we;(we=ce.current)==null||we.destroy()}},[O]),ie.useEffect(()=>{var we;(we=ce.current)==null||we.update({translateExtent:H,width:P,height:F,inversePan:A,pannable:_,zoomStep:E,zoomable:S})},[_,S,A,E,H,P,F]);const ge=v?we=>{var De;const[ve,ze]=((De=ce.current)==null?void 0:De.pointer(we))||[0,0];v(we,{x:ve,y:ze})}:void 0,ke=b?ie.useCallback((we,ve)=>{const ze=j.getState().nodeLookup.get(ve).internals.userNode;b(we,ze)},[]):void 0;return I.jsx(_u,{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 u=="number"?u:void 0},className:Ct(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:I.jsxs("svg",{width:z,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(Q5,{onClick:ke,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:l,nodeStrokeWidth:u,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${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}pE.displayName="MiniMap";ie.memo(pE);function nI({nodeId:e,position:t,variant:n=Ls.Handle,className:i,style:l={},children:s,color:u,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=YS(),A=typeof e=="string"?e:k,E=ft(),N=ie.useRef(null),j=n===Ls.Line?"right":"bottom-right",M=t??j,U=ie.useRef(null);ie.useEffect(()=>{if(!(!N.current||!A))return U.current||(U.current=zL({domNode:N.current,nodeId:A,getStoreItems:()=>{const{nodeLookup:H,transform:P,snapGrid:F,snapToGrid:z,nodeOrigin:$,domNode:L}=E.getState();return{nodeLookup:H,transform:P,snapGrid:F,snapToGrid:z,nodeOrigin:$,paneDomNode:L}},onChange:(H,P)=>{const{triggerNodeChanges:F,nodeLookup:z,parentLookup:$,nodeOrigin:L}=E.getState(),q=[],K={x:H.x,y:H.y},X=z.get(A);if(X&&X.expandParent&&X.parentId){const w=X.origin??L,Z=H.width??X.measured.width??0,te=H.height??X.measured.height??0,C={id:X.id,parentId:X.parentId,rect:{width:Z,height:te,...gS({x:H.x??X.position.x,y:H.y??X.position.y},{width:Z,height:te},X.parentId,z,w)}},Y=lg([C],z,$,L);q.push(...Y),K.x=H.x?Math.max(w[0]*Z,H.x):void 0,K.y=H.y?Math.max(w[1]*te,H.y):void 0}if(K.x!==void 0&&K.y!==void 0){const w={id:A,type:"position",position:{...K}};q.push(w)}if(H.width!==void 0&&H.height!==void 0){const Z={id:A,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:H.width,height:H.height}};q.push(Z)}for(const w of P){const Z={...w,type:"position"};q.push(Z)}F(q)},onEnd:({width:H,height:P})=>{const F={id:A,type:"dimensions",resizing:!1,dimensions:{width:H,height:P}};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 H;(H=U.current)==null||H.destroy()}},[M,c,d,h,m,p,b,_,S,v]);const R=M.split("-"),B=n===Ls.Line?"borderColor":"backgroundColor",O=u?{...l,[B]:u}:l;return I.jsx("div",{className:Ct(["react-flow__resize-control","nodrag",...R,n,i]),ref:N,style:O,children:s})}ie.memo(nI);var lm,o1;function ug(){if(o1)return lm;o1=1;var e="\0",t="\0",n="";class i{constructor(m){xt(this,"_isDirected",!0);xt(this,"_isMultigraph",!1);xt(this,"_isCompound",!1);xt(this,"_label");xt(this,"_defaultNodeLabelFn",()=>{});xt(this,"_defaultEdgeLabelFn",()=>{});xt(this,"_nodes",{});xt(this,"_in",{});xt(this,"_preds",{});xt(this,"_out",{});xt(this,"_sucs",{});xt(this,"_edgeObjs",{});xt(this,"_edgeLabels",{});xt(this,"_nodeCount",0);xt(this,"_edgeCount",0);xt(this,"_parent");xt(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=u(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]):u(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]):u(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]):u(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 u(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 u(h,m.v,m.w,m.name)}return lm=i,lm}var sm,c1;function rI(){return c1||(c1=1,sm="2.2.4"),sm}var um,f1;function iI(){return f1||(f1=1,um={Graph:ug(),version:rI()}),um}var om,d1;function aI(){if(d1)return om;d1=1;var e=ug();om={write:t,read:l};function t(s){var u={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:n(s),edges:i(s)};return s.graph()!==void 0&&(u.value=structuredClone(s.graph())),u}function n(s){return s.nodes().map(function(u){var c=s.node(u),d=s.parent(u),h={v:u};return c!==void 0&&(h.value=c),d!==void 0&&(h.parent=d),h})}function i(s){return s.edges().map(function(u){var c=s.edge(u),d={v:u.v,w:u.w};return u.name!==void 0&&(d.name=u.name),c!==void 0&&(d.value=c),d})}function l(s){var u=new e(s.options).setGraph(s.value);return s.nodes.forEach(function(c){u.setNode(c.v,c.value),c.parent&&u.setParent(c.v,c.parent)}),s.edges.forEach(function(c){u.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),u}return om}var cm,h1;function lI(){if(h1)return cm;h1=1,cm=e;function e(t){var n={},i=[],l;function s(u){Object.hasOwn(n,u)||(n[u]=!0,l.push(u),t.successors(u).forEach(s),t.predecessors(u).forEach(s))}return t.nodes().forEach(function(u){l=[],s(u),l.length&&i.push(l)}),i}return cm}var fm,m1;function gE(){if(m1)return fm;m1=1;class e{constructor(){xt(this,"_arr",[]);xt(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,u=s.length;return l[n]=u,s.push({key:n,priority:i}),this._decrease(u),!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,u=n;l<i.length&&(u=i[l].priority<i[u].priority?l:u,s<i.length&&(u=i[s].priority<i[u].priority?s:u),u!==n&&(this._swap(n,u),this._heapify(u)))}_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,u=l[n],c=l[i];l[n]=c,l[i]=u,s[c.key]=n,s[u.key]=i}}return fm=e,fm}var dm,p1;function yE(){if(p1)return dm;p1=1;var e=gE();dm=n;var t=()=>1;function n(l,s,u,c){return i(l,String(s),u||t,c||function(d){return l.outEdges(d)})}function i(l,s,u,c){var d={},h=new e,m,p,y=function(v){var b=v.v!==m?v.v:v.w,_=d[b],S=u(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 dm}var hm,g1;function sI(){if(g1)return hm;g1=1;var e=yE();hm=t;function t(n,i,l){return n.nodes().reduce(function(s,u){return s[u]=e(n,u,i,l),s},{})}return hm}var mm,y1;function vE(){if(y1)return mm;y1=1,mm=e;function e(t){var n=0,i=[],l={},s=[];function u(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)):(u(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)||u(c)}),s}return mm}var pm,v1;function uI(){if(v1)return pm;v1=1;var e=vE();pm=t;function t(n){return e(n).filter(function(i){return i.length>1||i.length===1&&n.hasEdge(i[0],i[0])})}return pm}var gm,x1;function oI(){if(x1)return gm;x1=1,gm=t;var e=()=>1;function t(i,l,s){return n(i,l||e,s||function(u){return i.outEdges(u)})}function n(i,l,s){var u={},c=i.nodes();return c.forEach(function(d){u[d]={},u[d][d]={distance:0},c.forEach(function(h){d!==h&&(u[d][h]={distance:Number.POSITIVE_INFINITY})}),s(d).forEach(function(h){var m=h.v===d?h.w:h.v,p=l(h);u[d][m]={distance:p,predecessor:d}})}),c.forEach(function(d){var h=u[d];c.forEach(function(m){var p=u[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)})})}),u}return gm}var ym,b1;function xE(){if(b1)return ym;b1=1;function e(n){var i={},l={},s=[];function u(c){if(Object.hasOwn(l,c))throw new t;Object.hasOwn(i,c)||(l[c]=!0,i[c]=!0,n.predecessors(c).forEach(u),delete l[c],s.push(c))}if(n.sinks().forEach(u),Object.keys(i).length!==n.nodeCount())throw new t;return s}class t extends Error{constructor(){super(...arguments)}}return ym=e,e.CycleException=t,ym}var vm,_1;function cI(){if(_1)return vm;_1=1;var e=xE();vm=t;function t(n){try{e(n)}catch(i){if(i instanceof e.CycleException)return!1;throw i}return!0}return vm}var xm,w1;function bE(){if(w1)return xm;w1=1,xm=e;function e(l,s,u){Array.isArray(s)||(s=[s]);var c=l.isDirected()?p=>l.successors(p):p=>l.neighbors(p),d=u==="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,u,c){for(var d=[[l,!1]];d.length>0;){var h=d.pop();h[1]?c.push(h[0]):Object.hasOwn(u,h[0])||(u[h[0]]=!0,d.push([h[0],!0]),i(s(h[0]),m=>d.push([m,!1])))}}function n(l,s,u,c){for(var d=[l];d.length>0;){var h=d.pop();Object.hasOwn(u,h)||(u[h]=!0,c.push(h),i(s(h),m=>d.push(m)))}}function i(l,s){for(var u=l.length;u--;)s(l[u],u,l);return l}return xm}var bm,S1;function fI(){if(S1)return bm;S1=1;var e=bE();bm=t;function t(n,i){return e(n,i,"post")}return bm}var _m,E1;function dI(){if(E1)return _m;E1=1;var e=bE();_m=t;function t(n,i){return e(n,i,"pre")}return _m}var wm,k1;function hI(){if(k1)return wm;k1=1;var e=ug(),t=gE();wm=n;function n(i,l){var s=new e,u={},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&&(u[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(u,d))s.setEdge(d,u[d]);else{if(m)throw new Error("Input graph is not connected: "+i);m=!0}i.nodeEdges(d).forEach(h)}return s}return wm}var Sm,T1;function mI(){return T1||(T1=1,Sm={components:lI(),dijkstra:yE(),dijkstraAll:sI(),findCycles:uI(),floydWarshall:oI(),isAcyclic:cI(),postorder:fI(),preorder:dI(),prim:hI(),tarjan:vE(),topsort:xE()}),Sm}var Em,C1;function Fn(){if(C1)return Em;C1=1;var e=iI();return Em={Graph:e.Graph,json:aI(),alg:mI(),version:e.version},Em}var km,A1;function pI(){if(A1)return km;A1=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,u=s._prev;for(;u!==s;)l.push(JSON.stringify(u,n)),u=u._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 km=e,km}var Tm,N1;function gI(){if(N1)return Tm;N1=1;let e=Fn().Graph,t=pI();Tm=i;let n=()=>1;function i(h,m){if(h.nodeCount()<=1)return[];let p=u(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 u(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 Tm}var Cm,M1;function Tt(){if(M1)return Cm;M1=1;let e=Fn().Graph;Cm={addBorderNode:m,addDummyNode:t,applyWithChunking:v,asNonCompoundGraph:i,buildLayerMatrix:c,intersectRect:u,mapValues:M,maxRank:b,normalizeRanks:d,notime:k,partition:_,pick:j,predecessorWeights:s,range:N,removeEmptyRanks:h,simplify:n,successorWeights:l,time:S,uniqueId:E,zipObject:U};function t(R,B,O,H){let P;do P=E(H);while(R.hasNode(P));return O.dummy=B,R.setNode(P,O),P}function n(R){let B=new e().setGraph(R.graph());return R.nodes().forEach(O=>B.setNode(O,R.node(O))),R.edges().forEach(O=>{let H=B.edge(O.v,O.w)||{weight:0,minlen:1},P=R.edge(O);B.setEdge(O.v,O.w,{weight:H.weight+P.weight,minlen:Math.max(H.minlen,P.minlen)})}),B}function i(R){let B=new e({multigraph:R.isMultigraph()}).setGraph(R.graph());return R.nodes().forEach(O=>{R.children(O).length||B.setNode(O,R.node(O))}),R.edges().forEach(O=>{B.setEdge(O,R.edge(O))}),B}function l(R){let B=R.nodes().map(O=>{let H={};return R.outEdges(O).forEach(P=>{H[P.w]=(H[P.w]||0)+R.edge(P).weight}),H});return U(R.nodes(),B)}function s(R){let B=R.nodes().map(O=>{let H={};return R.inEdges(O).forEach(P=>{H[P.v]=(H[P.v]||0)+R.edge(P).weight}),H});return U(R.nodes(),B)}function u(R,B){let O=R.x,H=R.y,P=B.x-O,F=B.y-H,z=R.width/2,$=R.height/2;if(!P&&!F)throw new Error("Not possible to find intersection inside of the rectangle");let L,q;return Math.abs(F)*z>Math.abs(P)*$?(F<0&&($=-$),L=$*P/F,q=$):(P<0&&(z=-z),L=z,q=z*F/P),{x:O+L,y:H+q}}function c(R){let B=N(b(R)+1).map(()=>[]);return R.nodes().forEach(O=>{let H=R.node(O),P=H.rank;P!==void 0&&(B[P][H.order]=O)}),B}function d(R){let B=R.nodes().map(H=>{let P=R.node(H).rank;return P===void 0?Number.MAX_VALUE:P}),O=v(Math.min,B);R.nodes().forEach(H=>{let P=R.node(H);Object.hasOwn(P,"rank")&&(P.rank-=O)})}function h(R){let B=R.nodes().map(z=>R.node(z).rank),O=v(Math.min,B),H=[];R.nodes().forEach(z=>{let $=R.node(z).rank-O;H[$]||(H[$]=[]),H[$].push(z)});let P=0,F=R.graph().nodeRankFactor;Array.from(H).forEach((z,$)=>{z===void 0&&$%F!==0?--P:z!==void 0&&P&&z.forEach(L=>R.node(L).rank+=P)})}function m(R,B,O,H){let P={width:0,height:0};return arguments.length>=4&&(P.rank=O,P.order=H),t(R,"border",P,B)}function p(R,B=y){const O=[];for(let H=0;H<R.length;H+=B){const P=R.slice(H,H+B);O.push(P)}return O}const y=65535;function v(R,B){if(B.length>y){const O=p(B);return R.apply(null,O.map(H=>R.apply(null,H)))}else return R.apply(null,B)}function b(R){const O=R.nodes().map(H=>{let P=R.node(H).rank;return P===void 0?Number.MIN_VALUE:P});return v(Math.max,O)}function _(R,B){let O={lhs:[],rhs:[]};return R.forEach(H=>{B(H)?O.lhs.push(H):O.rhs.push(H)}),O}function S(R,B){let O=Date.now();try{return B()}finally{console.log(R+" time: "+(Date.now()-O)+"ms")}}function k(R,B){return B()}let A=0;function E(R){var B=++A;return toString(R)+B}function N(R,B,O=1){B==null&&(B=R,R=0);let H=F=>F<B;O<0&&(H=F=>B<F);const P=[];for(let F=R;H(F);F+=O)P.push(F);return P}function j(R,B){const O={};for(const H of B)R[H]!==void 0&&(O[H]=R[H]);return O}function M(R,B){let O=B;return typeof B=="string"&&(O=H=>H[B]),Object.entries(R).reduce((H,[P,F])=>(H[P]=O(F,P),H),{})}function U(R,B){return R.reduce((O,H,P)=>(O[H]=B[P],O),{})}return Cm}var Am,O1;function yI(){if(O1)return Am;O1=1;let e=gI(),t=Tt().uniqueId;Am={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 u=[],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)?u.push(p):h(p.w)}),delete c[m])}return s.nodes().forEach(h),u}function l(s){s.edges().forEach(u=>{let c=s.edge(u);if(c.reversed){s.removeEdge(u);let d=c.forwardName;delete c.reversed,delete c.forwardName,s.setEdge(u.w,u.v,c,d)}})}return Am}var Nm,R1;function vI(){if(R1)return Nm;R1=1;let e=Tt();Nm={run:t,undo:i};function t(l){l.graph().dummyChains=[],l.edges().forEach(s=>n(l,s))}function n(l,s){let u=s.v,c=l.node(u).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(u,v,{weight:p.weight},m),_===0&&l.graph().dummyChains.push(v),u=v;l.setEdge(u,d,{weight:p.weight},m)}function i(l){l.graph().dummyChains.forEach(s=>{let u=l.node(s),c=u.edgeLabel,d;for(l.setEdge(u.edgeObj,c);u.dummy;)d=l.successors(s)[0],l.removeNode(s),c.points.push({x:u.x,y:u.y}),u.dummy==="edge-label"&&(c.x=u.x,c.y=u.y,c.width=u.width,c.height=u.height),s=d,u=l.node(s)})}return Nm}var Mm,z1;function jc(){if(z1)return Mm;z1=1;const{applyWithChunking:e}=Tt();Mm={longestPath:t,slack:n};function t(i){var l={};function s(u){var c=i.node(u);if(Object.hasOwn(l,u))return c.rank;l[u]=!0;let d=i.outEdges(u).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 Mm}var Om,D1;function _E(){if(D1)return Om;D1=1;var e=Fn().Graph,t=jc().slack;Om=n;function n(u){var c=new e({directed:!1}),d=u.nodes()[0],h=u.nodeCount();c.setNode(d,{});for(var m,p;i(c,u)<h;)m=l(c,u),p=c.hasNode(m.v)?t(u,m):-t(u,m),s(c,u,p);return c}function i(u,c){function d(h){c.nodeEdges(h).forEach(m=>{var p=m.v,y=h===p?m.w:p;!u.hasNode(y)&&!t(c,m)&&(u.setNode(y,{}),u.setEdge(h,y,{}),d(y))})}return u.nodes().forEach(d),u.nodeCount()}function l(u,c){return c.edges().reduce((h,m)=>{let p=Number.POSITIVE_INFINITY;return u.hasNode(m.v)!==u.hasNode(m.w)&&(p=t(c,m)),p<h[0]?[p,m]:h},[Number.POSITIVE_INFINITY,null])[1]}function s(u,c,d){u.nodes().forEach(h=>c.node(h).rank+=d)}return Om}var Rm,j1;function xI(){if(j1)return Rm;j1=1;var e=_E(),t=jc().slack,n=jc().longestPath,i=Fn().alg.preorder,l=Fn().alg.postorder,s=Tt().simplify;Rm=u,u.initLowLimValues=m,u.initCutValues=c,u.calcCutValue=h,u.leaveEdge=y,u.enterEdge=v,u.exchangeEdges=b;function u(A){A=s(A),n(A);var E=e(A);m(E),c(E,A);for(var N,j;N=y(E);)j=v(E,A,N),b(E,A,N,j)}function c(A,E){var N=l(A,A.nodes());N=N.slice(0,N.length-1),N.forEach(j=>d(A,E,j))}function d(A,E,N){var j=A.node(N),M=j.parent;A.edge(N,M).cutvalue=h(A,E,N)}function h(A,E,N){var j=A.node(N),M=j.parent,U=!0,R=E.edge(N,M),B=0;return R||(U=!1,R=E.edge(M,N)),B=R.weight,E.nodeEdges(N).forEach(O=>{var H=O.v===N,P=H?O.w:O.v;if(P!==M){var F=H===U,z=E.edge(O).weight;if(B+=F?z:-z,S(A,N,P)){var $=A.edge(N,P).cutvalue;B+=F?-$:$}}}),B}function m(A,E){arguments.length<2&&(E=A.nodes()[0]),p(A,{},1,E)}function p(A,E,N,j,M){var U=N,R=A.node(j);return E[j]=!0,A.neighbors(j).forEach(B=>{Object.hasOwn(E,B)||(N=p(A,E,N,B,j))}),R.low=U,R.lim=N++,M?R.parent=M:delete R.parent,N}function y(A){return A.edges().find(E=>A.edge(E).cutvalue<0)}function v(A,E,N){var j=N.v,M=N.w;E.hasEdge(j,M)||(j=N.w,M=N.v);var U=A.node(j),R=A.node(M),B=U,O=!1;U.lim>R.lim&&(B=R,O=!0);var H=E.edges().filter(P=>O===k(A,A.node(P.v),B)&&O!==k(A,A.node(P.w),B));return H.reduce((P,F)=>t(E,F)<t(E,P)?F:P)}function b(A,E,N,j){var M=N.v,U=N.w;A.removeEdge(M,U),A.setEdge(j.v,j.w,{}),m(A),c(A,E),_(A,E)}function _(A,E){var N=A.nodes().find(M=>!E.node(M).parent),j=i(A,N);j=j.slice(1),j.forEach(M=>{var U=A.node(M).parent,R=E.edge(M,U),B=!1;R||(R=E.edge(U,M),B=!0),E.node(M).rank=E.node(U).rank+(B?R.minlen:-R.minlen)})}function S(A,E,N){return A.hasEdge(E,N)}function k(A,E,N){return N.low<=E.lim&&E.lim<=N.lim}return Rm}var zm,L1;function bI(){if(L1)return zm;L1=1;var e=jc(),t=e.longestPath,n=_E(),i=xI();zm=l;function l(d){switch(d.graph().ranker){case"network-simplex":c(d);break;case"tight-tree":u(d);break;case"longest-path":s(d);break;default:c(d)}}var s=t;function u(d){t(d),n(d)}function c(d){i(d)}return zm}var Dm,I1;function _I(){if(I1)return Dm;I1=1,Dm=e;function e(i){let l=n(i);i.graph().dummyChains.forEach(s=>{let u=i.node(s),c=u.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(u=i.node(s),v){for(;(y=h[p])!==m&&i.node(y).maxRank<u.rank;)p++;y===m&&(v=!1)}if(!v){for(;p<h.length-1&&i.node(y=h[p+1]).minRank<=u.rank;)p++;y=h[p]}i.setParent(s,y),s=i.successors(s)[0]}})}function t(i,l,s,u){let c=[],d=[],h=Math.min(l[s].low,l[u].low),m=Math.max(l[s].lim,l[u].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=u;(p=i.parent(p))!==y;)d.push(p);return{path:c.concat(d.reverse()),lca:y}}function n(i){let l={},s=0;function u(c){let d=s;i.children(c).forEach(u),l[c]={low:d,lim:s++}}return i.children().forEach(u),l}return Dm}var jm,B1;function wI(){if(B1)return jm;B1=1;let e=Tt();jm={run:t,cleanup:s};function t(u){let c=e.addDummyNode(u,"root",{},"_root"),d=i(u),h=Object.values(d),m=e.applyWithChunking(Math.max,h)-1,p=2*m+1;u.graph().nestingRoot=c,u.edges().forEach(v=>u.edge(v).minlen*=p);let y=l(u)+1;u.children().forEach(v=>n(u,c,p,y,m,d,v)),u.graph().nodeRankFactor=p}function n(u,c,d,h,m,p,y){let v=u.children(y);if(!v.length){y!==c&&u.setEdge(c,y,{weight:0,minlen:d});return}let b=e.addBorderNode(u,"_bt"),_=e.addBorderNode(u,"_bb"),S=u.node(y);u.setParent(b,y),S.borderTop=b,u.setParent(_,y),S.borderBottom=_,v.forEach(k=>{n(u,c,d,h,m,p,k);let A=u.node(k),E=A.borderTop?A.borderTop:k,N=A.borderBottom?A.borderBottom:k,j=A.borderTop?h:2*h,M=E!==N?1:m-p[y]+1;u.setEdge(b,E,{weight:j,minlen:M,nestingEdge:!0}),u.setEdge(N,_,{weight:j,minlen:M,nestingEdge:!0})}),u.parent(y)||u.setEdge(c,b,{weight:0,minlen:m+p[y]})}function i(u){var c={};function d(h,m){var p=u.children(h);p&&p.length&&p.forEach(y=>d(y,m+1)),c[h]=m}return u.children().forEach(h=>d(h,1)),c}function l(u){return u.edges().reduce((c,d)=>c+u.edge(d).weight,0)}function s(u){var c=u.graph();u.removeNode(c.nestingRoot),delete c.nestingRoot,u.edges().forEach(d=>{var h=u.edge(d);h.nestingEdge&&u.removeEdge(d)})}return jm}var Lm,H1;function SI(){if(H1)return Lm;H1=1;let e=Tt();Lm=t;function t(i){function l(s){let u=i.children(s),c=i.node(s);if(u.length&&u.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,u,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,u),m&&i.setEdge(m,p,{weight:1})}return Lm}var Im,U1;function EI(){if(U1)return Im;U1=1,Im={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")&&(u(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 u(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 Im}var Bm,P1;function kI(){if(P1)return Bm;P1=1;let e=Tt();Bm=t;function t(n){let i={},l=n.nodes().filter(m=>!n.children(m).length),s=l.map(m=>n.node(m).rank),u=e.applyWithChunking(Math.max,s),c=e.range(u+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 Bm}var Hm,q1;function TI(){if(q1)return Hm;q1=1;let e=Tt().zipObject;Hm=t;function t(i,l){let s=0;for(let u=1;u<l.length;++u)s+=n(i,l[u-1],l[u]);return s}function n(i,l,s){let u=e(s,s.map((y,v)=>v)),c=l.flatMap(y=>i.outEdges(y).map(v=>({pos:u[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 Hm}var Um,V1;function CI(){if(V1)return Um;V1=1,Um=e;function e(t,n=[]){return n.map(i=>{let l=t.inEdges(i);if(l.length){let s=l.reduce((u,c)=>{let d=t.edge(c),h=t.node(c.v);return{sum:u.sum+d.weight*h.order,weight:u.weight+d.weight}},{sum:0,weight:0});return{v:i,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:i}})}return Um}var Pm,$1;function AI(){if($1)return Pm;$1=1;let e=Tt();Pm=t;function t(l,s){let u={};l.forEach((d,h)=>{let m=u[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=u[d.v],m=u[d.w];h!==void 0&&m!==void 0&&(m.indegree++,h.out.push(u[d.w]))});let c=Object.values(u).filter(d=>!d.indegree);return n(c)}function n(l){let s=[];function u(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(u(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 u=0,c=0;l.weight&&(u+=l.barycenter*l.weight,c+=l.weight),s.weight&&(u+=s.barycenter*s.weight,c+=s.weight),l.vs=s.vs.concat(l.vs),l.barycenter=u/c,l.weight=c,l.i=Math.min(s.i,l.i),s.merged=!0}return Pm}var qm,Z1;function NI(){if(Z1)return qm;Z1=1;let e=Tt();qm=t;function t(l,s){let u=e.partition(l,b=>Object.hasOwn(b,"barycenter")),c=u.lhs,d=u.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,u){let c;for(;s.length&&(c=s[s.length-1]).i<=u;)s.pop(),l.push(c.vs),u++;return u}function i(l){return(s,u)=>s.barycenter<u.barycenter?-1:s.barycenter>u.barycenter?1:l?u.i-s.i:s.i-u.i}return qm}var Vm,Y1;function MI(){if(Y1)return Vm;Y1=1;let e=CI(),t=AI(),n=NI();Vm=i;function i(u,c,d,h){let m=u.children(c),p=u.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(u,m);_.forEach(A=>{if(u.children(A.v).length){let E=i(u,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),u.predecessors(y).length)){let A=u.node(u.predecessors(y)[0]),E=u.node(u.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(u,c){u.forEach(d=>{d.vs=d.vs.flatMap(h=>c[h]?c[h].vs:h)})}function s(u,c){u.barycenter!==void 0?(u.barycenter=(u.barycenter*u.weight+c.barycenter*c.weight)/(u.weight+c.weight),u.weight+=c.weight):(u.barycenter=c.barycenter,u.weight=c.weight)}return Vm}var $m,F1;function OI(){if(F1)return $m;F1=1;let e=Fn().Graph,t=Tt();$m=n;function n(l,s,u){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[u](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 $m}var Zm,G1;function RI(){if(G1)return Zm;G1=1,Zm=e;function e(t,n,i){let l={},s;i.forEach(u=>{let c=t.parent(u),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 Zm}var Ym,X1;function zI(){if(X1)return Ym;X1=1;let e=kI(),t=TI(),n=MI(),i=OI(),l=RI(),s=Fn().Graph,u=Tt();Ym=c;function c(p,y){if(y&&typeof y.customOrder=="function"){y.customOrder(p,c);return}let v=u.maxRank(p),b=d(p,u.range(1,v+1),"inEdges"),_=d(p,u.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,N=0;N<4;++E,++N){h(E%2?b:_,E%4>=2),S=u.buildLayerMatrix(p);let j=t(p,S);j<k&&(N=0,A=Object.assign({},S),k=j)}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 Ym}var Fm,Q1;function DI(){if(Q1)return Fm;Q1=1;let e=Fn().Graph,t=Tt();Fm={positionX:v,findType1Conflicts:n,findType2Conflicts:i,addConflict:s,hasConflict:u,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:p,findSmallestWidthAlignment:m,balance:y};function n(S,k){let A={};function E(N,j){let M=0,U=0,R=N.length,B=j[j.length-1];return j.forEach((O,H)=>{let P=l(S,O),F=P?S.node(P).order:R;(P||O===B)&&(j.slice(U,H+1).forEach(z=>{S.predecessors(z).forEach($=>{let L=S.node($),q=L.order;(q<M||F<q)&&!(L.dummy&&S.node(z).dummy)&&s(A,$,z)})}),U=H+1,M=F)}),j}return k.length&&k.reduce(E),A}function i(S,k){let A={};function E(j,M,U,R,B){let O;t.range(M,U).forEach(H=>{O=j[H],S.node(O).dummy&&S.predecessors(O).forEach(P=>{let F=S.node(P);F.dummy&&(F.order<R||F.order>B)&&s(A,P,O)})})}function N(j,M){let U=-1,R,B=0;return M.forEach((O,H)=>{if(S.node(O).dummy==="border"){let P=S.predecessors(O);P.length&&(R=S.node(P[0]).order,E(M,B,H,U,R),B=H,U=R)}E(M,B,M.length,R,j.length)}),M}return k.length&&k.reduce(N),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 N=k;k=A,A=N}let E=S[k];E||(S[k]=E={}),E[A]=!0}function u(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 N={},j={},M={};return k.forEach(U=>{U.forEach((R,B)=>{N[R]=R,j[R]=R,M[R]=B})}),k.forEach(U=>{let R=-1;U.forEach(B=>{let O=E(B);if(O.length){O=O.sort((P,F)=>M[P]-M[F]);let H=(O.length-1)/2;for(let P=Math.floor(H),F=Math.ceil(H);P<=F;++P){let z=O[P];j[B]===B&&R<M[z]&&!u(A,B,z)&&(j[z]=B,j[B]=N[B]=N[z],R=M[z])}}})}),{root:N,align:j}}function d(S,k,A,E,N){let j={},M=h(S,k,A,N),U=N?"borderLeft":"borderRight";function R(H,P){let F=M.nodes(),z=F.pop(),$={};for(;z;)$[z]?H(z):($[z]=!0,F.push(z),F=F.concat(P(z))),z=F.pop()}function B(H){j[H]=M.inEdges(H).reduce((P,F)=>Math.max(P,j[F.v]+M.edge(F)),0)}function O(H){let P=M.outEdges(H).reduce((z,$)=>Math.min(z,j[$.w]-M.edge($)),Number.POSITIVE_INFINITY),F=S.node(H);P!==Number.POSITIVE_INFINITY&&F.borderType!==U&&(j[H]=Math.max(j[H],P))}return R(B,M.predecessors.bind(M)),R(O,M.successors.bind(M)),Object.keys(E).forEach(H=>j[H]=j[A[H]]),j}function h(S,k,A,E){let N=new e,j=S.graph(),M=b(j.nodesep,j.edgesep,E);return k.forEach(U=>{let R;U.forEach(B=>{let O=A[B];if(N.setNode(O),R){var H=A[R],P=N.edge(H,O);N.setEdge(H,O,Math.max(M(S,B,R),P||0))}R=B})}),N}function m(S,k){return Object.values(k).reduce((A,E)=>{let N=Number.NEGATIVE_INFINITY,j=Number.POSITIVE_INFINITY;Object.entries(E).forEach(([U,R])=>{let B=_(S,U)/2;N=Math.max(R+B,N),j=Math.min(R-B,j)});const M=N-j;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),N=t.applyWithChunking(Math.max,A);["u","d"].forEach(j=>{["l","r"].forEach(M=>{let U=j+M,R=S[U];if(R===k)return;let B=Object.values(R),O=E-t.applyWithChunking(Math.min,B);M!=="l"&&(O=N-t.applyWithChunking(Math.max,B)),O&&(S[U]=t.mapValues(R,H=>H+O))})})}function y(S,k){return t.mapValues(S.ul,(A,E)=>{if(k)return S[k.toLowerCase()][E];{let N=Object.values(S).map(j=>j[E]).sort((j,M)=>j-M);return(N[1]+N[2])/2}})}function v(S){let k=t.buildLayerMatrix(S),A=Object.assign(n(S,k),i(S,k)),E={},N;["u","d"].forEach(M=>{N=M==="u"?k:Object.values(k).reverse(),["l","r"].forEach(U=>{U==="r"&&(N=N.map(H=>Object.values(H).reverse()));let R=(M==="u"?S.predecessors:S.successors).bind(S),B=c(S,N,A,R),O=d(S,N,B.root,B.align,U==="r");U==="r"&&(O=t.mapValues(O,H=>-H)),E[M+U]=O})});let j=m(S,E);return p(E,j),y(E,S.graph().align)}function b(S,k,A){return(E,N,j)=>{let M=E.node(N),U=E.node(j),R=0,B;if(R+=M.width/2,Object.hasOwn(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":B=-M.width/2;break;case"r":B=M.width/2;break}if(B&&(R+=A?B:-B),B=0,R+=(M.dummy?k:S)/2,R+=(U.dummy?k:S)/2,R+=U.width/2,Object.hasOwn(U,"labelpos"))switch(U.labelpos.toLowerCase()){case"l":B=U.width/2;break;case"r":B=-U.width/2;break}return B&&(R+=A?B:-B),B=0,R}}function _(S,k){return S.node(k).width}return Fm}var Gm,K1;function jI(){if(K1)return Gm;K1=1;let e=Tt(),t=DI().positionX;Gm=n;function n(l){l=e.asNonCompoundGraph(l),i(l),Object.entries(t(l)).forEach(([s,u])=>l.node(s).x=u)}function i(l){let s=e.buildLayerMatrix(l),u=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+u})}return Gm}var Xm,J1;function LI(){if(J1)return Xm;J1=1;let e=yI(),t=vI(),n=bI(),i=Tt().normalizeRanks,l=_I(),s=Tt().removeEmptyRanks,u=wI(),c=SI(),d=EI(),h=zI(),m=jI(),p=Tt(),y=Fn().Graph;Xm=v;function v(C,Y){let Q=Y&&Y.debugTiming?p.time:p.notime;Q("layout",()=>{let W=Q(" buildLayoutGraph",()=>R(C));Q(" runLayout",()=>b(W,Q,Y)),Q(" updateInputGraph",()=>_(C,W))})}function b(C,Y,Q){Y(" makeSpaceForEdgeLabels",()=>B(C)),Y(" removeSelfEdges",()=>K(C)),Y(" acyclic",()=>e.run(C)),Y(" nestingGraph.run",()=>u.run(C)),Y(" rank",()=>n(p.asNonCompoundGraph(C))),Y(" injectEdgeLabelProxies",()=>O(C)),Y(" removeEmptyRanks",()=>s(C)),Y(" nestingGraph.cleanup",()=>u.cleanup(C)),Y(" normalizeRanks",()=>i(C)),Y(" assignRankMinMax",()=>H(C)),Y(" removeEdgeLabelProxies",()=>P(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",()=>q(C)),Y(" normalize.undo",()=>t.undo(C)),Y(" fixupEdgeLabelCoords",()=>$(C)),Y(" undoCoordinateSystem",()=>d.undo(C)),Y(" translateGraph",()=>F(C)),Y(" assignNodeIntersects",()=>z(C)),Y(" reversePoints",()=>L(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"],N={width:0,height:0},j=["minlen","weight","width","height","labeloffset"],M={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"];function R(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(N).forEach(ge=>{ce[ge]===void 0&&(ce[ge]=N[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,j),p.pick(ue,U)))}),Y}function B(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 O(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 H(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 P(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(ve){let ze=ve.x,De=ve.y,lt=ve.width,ot=ve.height;Y=Math.min(Y,ze-lt/2),Q=Math.max(Q,ze+lt/2),W=Math.min(W,De-ot/2),ue=Math.max(ue,De+ot/2)}C.nodes().forEach(ve=>we(C.node(ve))),C.edges().forEach(ve=>{let ze=C.edge(ve);Object.hasOwn(ze,"x")&&we(ze)}),Y-=ge,W-=ke,C.nodes().forEach(ve=>{let ze=C.node(ve);ze.x-=Y,ze.y-=W}),C.edges().forEach(ve=>{let ze=C.edge(ve);ze.points.forEach(De=>{De.x-=Y,De.y-=W}),Object.hasOwn(ze,"x")&&(ze.x-=Y),Object.hasOwn(ze,"y")&&(ze.y-=W)}),ce.width=Q-Y+ge,ce.height=ue-W+ke}function z(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 L(C){C.edges().forEach(Y=>{let Q=C.edge(Y);Q.reversed&&Q.points.reverse()})}function q(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 Xm}var Qm,W1;function II(){if(W1)return Qm;W1=1;let e=Tt(),t=Fn().Graph;Qm={debugOrdering:n};function n(i){let l=e.buildLayerMatrix(i),s=new t({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(u=>{s.setNode(u,{label:u}),s.setParent(u,"layer"+i.node(u).rank)}),i.edges().forEach(u=>s.setEdge(u.v,u.w,{},u.name)),l.forEach((u,c)=>{let d="layer"+c;s.setNode(d,{rank:"same"}),u.reduce((h,m)=>(s.setEdge(h,m,{style:"invis"}),m))}),s}return Qm}var Km,e_;function BI(){return e_||(e_=1,Km="1.1.4"),Km}var Jm,t_;function HI(){return t_||(t_=1,Jm={graphlib:Fn(),layout:LI(),debug:II(),util:{time:Tt().time,notime:Tt().notime},version:BI()}),Jm}var UI=HI();const n_=Ei(UI);function PI(e){const t=new Map,n=[],i=s=>{const u=s.id.split(":"),c=u.slice(0,-1).join(":");if(u.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 u={...s,id:s.id.toString(),position:{x:0,y:0},data:{label:s.id.split(":").pop(),name:s.id.split(":").pop()}},c=i(u);c&&(u.parentId=c.id.toString()),n.push(u)}),[...Array.from(t.values()),...n]}const qI={group:({data:e})=>I.jsx("div",{style:{position:"absolute",bottom:"100%",left:0},children:I.jsx("span",{children:e.name})})},VI=(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()),u=l==null?void 0:l.id,c=s==null?void 0:s.id;return{id:`${u}=${c}`,source:u,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},$I=()=>{const{fitView:e}=Jc(),{graphVisualize:t}=pu(),n=t||{nodes:[],edges:[]},i=PI(n.nodes.map(y=>({...y,type:"default"}))),l=VI(n.edges,i),[s,u,c]=M5(i),[d,h,m]=O5(l),p=ie.useCallback(y=>{const v=r_(s,d,{direction:y});u([...v.nodes]),h([...v.edges]),e()},[s,d]);return ie.useEffect(()=>{if(n.nodes.length>0){const y=r_(i,l,{direction:"TB"});u([...y.nodes]),h([...y.edges]),e()}},[n]),I.jsx("div",{style:{width:"30%",height:"100%",position:"relative",overflow:"hidden"},children:I.jsxs(N5,{nodes:s,edges:d,onNodesChange:c,onEdgesChange:m,fitView:!0,className:"w-full h-full",nodeTypes:qI,children:[I.jsx(L5,{}),I.jsx(V5,{}),I.jsxs(_u,{position:"top-right",children:[I.jsx("button",{onClick:()=>p("TB"),children:"垂直布局"}),I.jsx("button",{onClick:()=>p("LR"),children:"水平布局"})]})]})})},r_=(e,t,n)=>{const i=new n_.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)),n_.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,u=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-u,c.position.y=m-u,c.width=p-h+u*2,c.height=y-m+u*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 ZI(){return I.jsx(dE,{children:I.jsx($I,{})})}const YI=()=>I.jsx(ZI,{}),FI=()=>{const{renderMessages:e,loading:t,inChatError:n,client:i,collapsedTools:l,toggleToolCollapse:s}=pu();return I.jsxs("div",{className:"chat-messages",children:[I.jsx(Tw,{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)})]})},GI=()=>{const{userInput:e,setUserInput:t,loading:n,sendMessage:i,stopGeneration:l,currentAgent:s,setCurrentAgent:u,client:c}=pu(),{extraParams:d}=Nw(),[h,m]=ie.useState([]),p=_=>{m(S=>[...S,_])},y=_=>{localStorage.setItem("agent_name",_),u(_)},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(iD,{onFileUploaded:p}),I.jsx(Ap,{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?"中断":"发送"})]})]})},XI=()=>{const[e,t]=ie.useState(!1),{showHistory:n,toggleHistoryVisible:i,showGraph:l,toggleGraphVisible:s}=pu(),{extraParams:u,setExtraParams:c}=Nw();return I.jsxs("div",{className:"chat-container",children:[n&&I.jsx(eD,{onClose:()=>i(),formatTime:vA}),I.jsxs("div",{className:"chat-main",children:[I.jsxs("div",{className:"chat-header",children:[I.jsx(sD,{}),I.jsx("button",{onClick:()=>t(!0),className:"edit-params-button",children:"编辑参数"}),I.jsx("button",{className:"history-button",onClick:()=>{i(),nb({showHistory:!n})},children:"历史记录"}),I.jsx("button",{className:"graph-button",onClick:()=>{s(),nb({showGraph:!l})},children:"图"}),I.jsx("button",{className:"history-button",onClick:()=>{localStorage.setItem("code",""),location.reload()},children:"退出登陆"})]}),I.jsx(FI,{}),I.jsx(GI,{}),I.jsx(aD,{isOpen:e,initialJson:u,onClose:()=>t(!1),onSave:c})]}),l&&I.jsx(YI,{})]})},QI=()=>I.jsx(Wz,{children:I.jsx(tD,{children:I.jsx(XI,{})})}),KI=()=>{const[e,t]=ie.useState([{key:"authorization",value:""}]),[n,i]=ie.useState(localStorage.getItem("withCredentials")==="true"),[l,s]=ie.useState(localStorage.getItem("apiUrl")||""),u=()=>{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:u,children:"添加请求头"}),I.jsx("button",{type:"submit",children:"保存配置"})]})]})})};function JI(){const[e,t]=ie.useState(localStorage.getItem("code"));return I.jsx(I.Fragment,{children:e?I.jsx(QI,{}):I.jsx(KI,{})})}LT.createRoot(document.getElementById("root")).render(I.jsx(JI,{}));