vgraph 0.1.0__py3-none-any.whl
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.
- vgraph/__init__.py +25 -0
- vgraph/api.py +45 -0
- vgraph/cli.py +41 -0
- vgraph/compile.py +247 -0
- vgraph/engine.py +314 -0
- vgraph/graph.schema.json +56 -0
- vgraph/inputs.py +82 -0
- vgraph/model.py +63 -0
- vgraph/py.typed +0 -0
- vgraph/registry.py +183 -0
- vgraph/server/__init__.py +1 -0
- vgraph/server/app.py +248 -0
- vgraph/server/state.py +96 -0
- vgraph/server/views.py +89 -0
- vgraph/server/watch.py +48 -0
- vgraph/static/assets/index-BAxILRja.js +64 -0
- vgraph/static/assets/index-CsCg66zj.css +1 -0
- vgraph/static/index.html +14 -0
- vgraph/topology.py +129 -0
- vgraph/typing_utils.py +88 -0
- vgraph-0.1.0.dist-info/METADATA +213 -0
- vgraph-0.1.0.dist-info/RECORD +25 -0
- vgraph-0.1.0.dist-info/WHEEL +4 -0
- vgraph-0.1.0.dist-info/entry_points.txt +3 -0
- vgraph-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var Ev=Object.defineProperty;var _v=(e,t,n)=>t in e?Ev(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ye=(e,t,n)=>_v(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function _a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Oh={exports:{}},Ms={},Lh={exports:{}},J={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its 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 Bi=Symbol.for("react.element"),kv=Symbol.for("react.portal"),Sv=Symbol.for("react.fragment"),Nv=Symbol.for("react.strict_mode"),Cv=Symbol.for("react.profiler"),Mv=Symbol.for("react.provider"),Iv=Symbol.for("react.context"),Pv=Symbol.for("react.forward_ref"),Tv=Symbol.for("react.suspense"),$v=Symbol.for("react.memo"),bv=Symbol.for("react.lazy"),Kc=Symbol.iterator;function jv(e){return e===null||typeof e!="object"?null:(e=Kc&&e[Kc]||e["@@iterator"],typeof e=="function"?e:null)}var zh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Rh=Object.assign,Dh={};function Tr(e,t,n){this.props=e,this.context=t,this.refs=Dh,this.updater=n||zh}Tr.prototype.isReactComponent={};Tr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Tr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ah(){}Ah.prototype=Tr.prototype;function ka(e,t,n){this.props=e,this.context=t,this.refs=Dh,this.updater=n||zh}var Sa=ka.prototype=new Ah;Sa.constructor=ka;Rh(Sa,Tr.prototype);Sa.isPureReactComponent=!0;var Zc=Array.isArray,Fh=Object.prototype.hasOwnProperty,Na={current:null},Vh={key:!0,ref:!0,__self:!0,__source:!0};function Hh(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)Fh.call(t,r)&&!Vh.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var u=Array(l),a=0;a<l;a++)u[a]=arguments[a+2];i.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Bi,type:e,key:o,ref:s,props:i,_owner:Na.current}}function Ov(e,t){return{$$typeof:Bi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ca(e){return typeof e=="object"&&e!==null&&e.$$typeof===Bi}function Lv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var qc=/\/+/g;function pl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Lv(""+e.key):t.toString(36)}function Io(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Bi:case kv:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+pl(s,0):r,Zc(i)?(n="",e!=null&&(n=e.replace(qc,"$&/")+"/"),Io(i,t,n,"",function(a){return a})):i!=null&&(Ca(i)&&(i=Ov(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(qc,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",Zc(e))for(var l=0;l<e.length;l++){o=e[l];var u=r+pl(o,l);s+=Io(o,t,n,u,i)}else if(u=jv(e),typeof u=="function")for(e=u.call(e),l=0;!(o=e.next()).done;)o=o.value,u=r+pl(o,l++),s+=Io(o,t,n,u,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function eo(e,t,n){if(e==null)return e;var r=[],i=0;return Io(e,r,"","",function(o){return t.call(n,o,i++)}),r}function zv(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Re={current:null},Po={transition:null},Rv={ReactCurrentDispatcher:Re,ReactCurrentBatchConfig:Po,ReactCurrentOwner:Na};function Bh(){throw Error("act(...) is not supported in production builds of React.")}J.Children={map:eo,forEach:function(e,t,n){eo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return eo(e,function(){t++}),t},toArray:function(e){return eo(e,function(t){return t})||[]},only:function(e){if(!Ca(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};J.Component=Tr;J.Fragment=Sv;J.Profiler=Cv;J.PureComponent=ka;J.StrictMode=Nv;J.Suspense=Tv;J.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Rv;J.act=Bh;J.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Rh({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=Na.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)Fh.call(t,u)&&!Vh.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var a=0;a<u;a++)l[a]=arguments[a+2];r.children=l}return{$$typeof:Bi,type:e.type,key:i,ref:o,props:r,_owner:s}};J.createContext=function(e){return e={$$typeof:Iv,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Mv,_context:e},e.Consumer=e};J.createElement=Hh;J.createFactory=function(e){var t=Hh.bind(null,e);return t.type=e,t};J.createRef=function(){return{current:null}};J.forwardRef=function(e){return{$$typeof:Pv,render:e}};J.isValidElement=Ca;J.lazy=function(e){return{$$typeof:bv,_payload:{_status:-1,_result:e},_init:zv}};J.memo=function(e,t){return{$$typeof:$v,type:e,compare:t===void 0?null:t}};J.startTransition=function(e){var t=Po.transition;Po.transition={};try{e()}finally{Po.transition=t}};J.unstable_act=Bh;J.useCallback=function(e,t){return Re.current.useCallback(e,t)};J.useContext=function(e){return Re.current.useContext(e)};J.useDebugValue=function(){};J.useDeferredValue=function(e){return Re.current.useDeferredValue(e)};J.useEffect=function(e,t){return Re.current.useEffect(e,t)};J.useId=function(){return Re.current.useId()};J.useImperativeHandle=function(e,t,n){return Re.current.useImperativeHandle(e,t,n)};J.useInsertionEffect=function(e,t){return Re.current.useInsertionEffect(e,t)};J.useLayoutEffect=function(e,t){return Re.current.useLayoutEffect(e,t)};J.useMemo=function(e,t){return Re.current.useMemo(e,t)};J.useReducer=function(e,t,n){return Re.current.useReducer(e,t,n)};J.useRef=function(e){return Re.current.useRef(e)};J.useState=function(e){return Re.current.useState(e)};J.useSyncExternalStore=function(e,t,n){return Re.current.useSyncExternalStore(e,t,n)};J.useTransition=function(){return Re.current.useTransition()};J.version="18.3.1";Lh.exports=J;var b=Lh.exports;const Dv=_a(b);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its 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 Av=b,Fv=Symbol.for("react.element"),Vv=Symbol.for("react.fragment"),Hv=Object.prototype.hasOwnProperty,Bv=Av.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Uv={key:!0,ref:!0,__self:!0,__source:!0};function Uh(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Hv.call(t,r)&&!Uv.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Fv,type:e,key:o,ref:s,props:i,_owner:Bv.current}}Ms.Fragment=Vv;Ms.jsx=Uh;Ms.jsxs=Uh;Oh.exports=Ms;var x=Oh.exports,Wh={exports:{}},Ke={},Yh={exports:{}},Gh={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its 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
|
+
*/(function(e){function t(k,M){var $=k.length;k.push(M);e:for(;0<$;){var z=$-1>>>1,F=k[z];if(0<i(F,M))k[z]=M,k[$]=F,$=z;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var M=k[0],$=k.pop();if($!==M){k[0]=$;e:for(var z=0,F=k.length,Y=F>>>1;z<Y;){var B=2*(z+1)-1,G=k[B],W=B+1,Q=k[W];if(0>i(G,$))W<F&&0>i(Q,G)?(k[z]=Q,k[W]=$,z=W):(k[z]=G,k[B]=$,z=B);else if(W<F&&0>i(Q,$))k[z]=Q,k[W]=$,z=W;else break e}}return M}function i(k,M){var $=k.sortIndex-M.sortIndex;return $!==0?$:k.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],a=[],c=1,d=null,f=3,h=!1,m=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(k){for(var M=n(a);M!==null;){if(M.callback===null)r(a);else if(M.startTime<=k)r(a),M.sortIndex=M.expirationTime,t(u,M);else break;M=n(a)}}function w(k){if(v=!1,g(k),!m)if(n(u)!==null)m=!0,E(N);else{var M=n(a);M!==null&&I(w,M.startTime-k)}}function N(k,M){m=!1,v&&(v=!1,p(T),T=-1),h=!0;var $=f;try{for(g(M),d=n(u);d!==null&&(!(d.expirationTime>M)||k&&!A());){var z=d.callback;if(typeof z=="function"){d.callback=null,f=d.priorityLevel;var F=z(d.expirationTime<=M);M=e.unstable_now(),typeof F=="function"?d.callback=F:d===n(u)&&r(u),g(M)}else r(u);d=n(u)}if(d!==null)var Y=!0;else{var B=n(a);B!==null&&I(w,B.startTime-M),Y=!1}return Y}finally{d=null,f=$,h=!1}}var P=!1,C=null,T=-1,L=5,j=-1;function A(){return!(e.unstable_now()-j<L)}function D(){if(C!==null){var k=e.unstable_now();j=k;var M=!0;try{M=C(!0,k)}finally{M?R():(P=!1,C=null)}}else P=!1}var R;if(typeof y=="function")R=function(){y(D)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,O=_.port2;_.port1.onmessage=D,R=function(){O.postMessage(null)}}else R=function(){S(D,0)};function E(k){C=k,P||(P=!0,R())}function I(k,M){T=S(function(){k(e.unstable_now())},M)}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(k){k.callback=null},e.unstable_continueExecution=function(){m||h||(m=!0,E(N))},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(k){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var $=f;f=M;try{return k()}finally{f=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,M){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var $=f;f=k;try{return M()}finally{f=$}},e.unstable_scheduleCallback=function(k,M,$){var z=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?z+$:z):$=z,k){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=$+F,k={id:c++,callback:M,priorityLevel:k,startTime:$,expirationTime:F,sortIndex:-1},$>z?(k.sortIndex=$,t(a,k),n(u)===null&&k===n(a)&&(v?(p(T),T=-1):v=!0,I(w,$-z))):(k.sortIndex=F,t(u,k),m||h||(m=!0,E(N))),k},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(k){var M=f;return function(){var $=f;f=M;try{return k.apply(this,arguments)}finally{f=$}}}})(Gh);Yh.exports=Gh;var Wv=Yh.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its 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 Yv=b,Xe=Wv;function V(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Xh=new Set,gi={};function Fn(e,t){pr(e,t),pr(e+"Capture",t)}function pr(e,t){for(gi[e]=t,e=0;e<t.length;e++)Xh.add(t[e])}var Rt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lu=Object.prototype.hasOwnProperty,Gv=/^[: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]*$/,Jc={},ef={};function Xv(e){return lu.call(ef,e)?!0:lu.call(Jc,e)?!1:Gv.test(e)?ef[e]=!0:(Jc[e]=!0,!1)}function Qv(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Kv(e,t,n,r){if(t===null||typeof t>"u"||Qv(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function De(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ie[e]=new De(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ie[t]=new De(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ie[e]=new De(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ie[e]=new De(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ie[e]=new De(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ie[e]=new De(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ie[e]=new De(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ie[e]=new De(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ie[e]=new De(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ma=/[\-:]([a-z])/g;function Ia(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ma,Ia);Ie[t]=new De(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ma,Ia);Ie[t]=new De(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ma,Ia);Ie[t]=new De(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ie[e]=new De(e,1,!1,e.toLowerCase(),null,!1,!1)});Ie.xlinkHref=new De("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ie[e]=new De(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pa(e,t,n,r){var i=Ie.hasOwnProperty(t)?Ie[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Kv(t,n,i,r)&&(n=null),r||i===null?Xv(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ht=Yv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,to=Symbol.for("react.element"),Un=Symbol.for("react.portal"),Wn=Symbol.for("react.fragment"),Ta=Symbol.for("react.strict_mode"),uu=Symbol.for("react.profiler"),Qh=Symbol.for("react.provider"),Kh=Symbol.for("react.context"),$a=Symbol.for("react.forward_ref"),au=Symbol.for("react.suspense"),cu=Symbol.for("react.suspense_list"),ba=Symbol.for("react.memo"),Qt=Symbol.for("react.lazy"),Zh=Symbol.for("react.offscreen"),tf=Symbol.iterator;function Ar(e){return e===null||typeof e!="object"?null:(e=tf&&e[tf]||e["@@iterator"],typeof e=="function"?e:null)}var he=Object.assign,gl;function Kr(e){if(gl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);gl=t&&t[1]||""}return`
|
|
34
|
+
`+gl+e}var ml=!1;function yl(e,t){if(!e||ml)return"";ml=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(a){var r=a}Reflect.construct(e,[],t)}else{try{t.call()}catch(a){r=a}e.call(t.prototype)}else{try{throw Error()}catch(a){r=a}e()}}catch(a){if(a&&r&&typeof a.stack=="string"){for(var i=a.stack.split(`
|
|
35
|
+
`),o=r.stack.split(`
|
|
36
|
+
`),s=i.length-1,l=o.length-1;1<=s&&0<=l&&i[s]!==o[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==o[l]){if(s!==1||l!==1)do if(s--,l--,0>l||i[s]!==o[l]){var u=`
|
|
37
|
+
`+i[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=l);break}}}finally{ml=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Kr(e):""}function Zv(e){switch(e.tag){case 5:return Kr(e.type);case 16:return Kr("Lazy");case 13:return Kr("Suspense");case 19:return Kr("SuspenseList");case 0:case 2:case 15:return e=yl(e.type,!1),e;case 11:return e=yl(e.type.render,!1),e;case 1:return e=yl(e.type,!0),e;default:return""}}function fu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Wn:return"Fragment";case Un:return"Portal";case uu:return"Profiler";case Ta:return"StrictMode";case au:return"Suspense";case cu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Kh:return(e.displayName||"Context")+".Consumer";case Qh:return(e._context.displayName||"Context")+".Provider";case $a:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ba:return t=e.displayName||null,t!==null?t:fu(e.type)||"Memo";case Qt:t=e._payload,e=e._init;try{return fu(e(t))}catch{}}return null}function qv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fu(t);case 8:return t===Ta?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function hn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jv(e){var t=qh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function no(e){e._valueTracker||(e._valueTracker=Jv(e))}function Jh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=qh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Uo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function du(e,t){var n=t.checked;return he({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function nf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=hn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ep(e,t){t=t.checked,t!=null&&Pa(e,"checked",t,!1)}function hu(e,t){ep(e,t);var n=hn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pu(e,t.type,n):t.hasOwnProperty("defaultValue")&&pu(e,t.type,hn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function rf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function pu(e,t,n){(t!=="number"||Uo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Zr=Array.isArray;function ir(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+hn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function gu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return he({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function of(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(V(92));if(Zr(n)){if(1<n.length)throw Error(V(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:hn(n)}}function tp(e,t){var n=hn(t.value),r=hn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function sf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function np(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?np(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ro,rp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ro=ro||document.createElement("div"),ro.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ro.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function mi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ii={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ew=["Webkit","ms","Moz","O"];Object.keys(ii).forEach(function(e){ew.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ii[t]=ii[e]})});function ip(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ii.hasOwnProperty(e)&&ii[e]?(""+t).trim():t+"px"}function op(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=ip(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var tw=he({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yu(e,t){if(t){if(tw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function vu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wu=null;function ja(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xu=null,or=null,sr=null;function lf(e){if(e=Yi(e)){if(typeof xu!="function")throw Error(V(280));var t=e.stateNode;t&&(t=bs(t),xu(e.stateNode,e.type,t))}}function sp(e){or?sr?sr.push(e):sr=[e]:or=e}function lp(){if(or){var e=or,t=sr;if(sr=or=null,lf(e),t)for(e=0;e<t.length;e++)lf(t[e])}}function up(e,t){return e(t)}function ap(){}var vl=!1;function cp(e,t,n){if(vl)return e(t,n);vl=!0;try{return up(e,t,n)}finally{vl=!1,(or!==null||sr!==null)&&(ap(),lp())}}function yi(e,t){var n=e.stateNode;if(n===null)return null;var r=bs(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(V(231,t,typeof n));return n}var Eu=!1;if(Rt)try{var Fr={};Object.defineProperty(Fr,"passive",{get:function(){Eu=!0}}),window.addEventListener("test",Fr,Fr),window.removeEventListener("test",Fr,Fr)}catch{Eu=!1}function nw(e,t,n,r,i,o,s,l,u){var a=Array.prototype.slice.call(arguments,3);try{t.apply(n,a)}catch(c){this.onError(c)}}var oi=!1,Wo=null,Yo=!1,_u=null,rw={onError:function(e){oi=!0,Wo=e}};function iw(e,t,n,r,i,o,s,l,u){oi=!1,Wo=null,nw.apply(rw,arguments)}function ow(e,t,n,r,i,o,s,l,u){if(iw.apply(this,arguments),oi){if(oi){var a=Wo;oi=!1,Wo=null}else throw Error(V(198));Yo||(Yo=!0,_u=a)}}function Vn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function fp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function uf(e){if(Vn(e)!==e)throw Error(V(188))}function sw(e){var t=e.alternate;if(!t){if(t=Vn(e),t===null)throw Error(V(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return uf(i),e;if(o===r)return uf(i),t;o=o.sibling}throw Error(V(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(V(189))}}if(n.alternate!==r)throw Error(V(190))}if(n.tag!==3)throw Error(V(188));return n.stateNode.current===n?e:t}function dp(e){return e=sw(e),e!==null?hp(e):null}function hp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=hp(e);if(t!==null)return t;e=e.sibling}return null}var pp=Xe.unstable_scheduleCallback,af=Xe.unstable_cancelCallback,lw=Xe.unstable_shouldYield,uw=Xe.unstable_requestPaint,me=Xe.unstable_now,aw=Xe.unstable_getCurrentPriorityLevel,Oa=Xe.unstable_ImmediatePriority,gp=Xe.unstable_UserBlockingPriority,Go=Xe.unstable_NormalPriority,cw=Xe.unstable_LowPriority,mp=Xe.unstable_IdlePriority,Is=null,Et=null;function fw(e){if(Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Is,e,void 0,(e.current.flags&128)===128)}catch{}}var ht=Math.clz32?Math.clz32:pw,dw=Math.log,hw=Math.LN2;function pw(e){return e>>>=0,e===0?32:31-(dw(e)/hw|0)|0}var io=64,oo=4194304;function qr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Xo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=qr(l):(o&=s,o!==0&&(r=qr(o)))}else s=n&~i,s!==0?r=qr(s):o!==0&&(r=qr(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ht(t),i=1<<n,r|=e[n],t&=~i;return r}function gw(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mw(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-ht(o),l=1<<s,u=i[s];u===-1?(!(l&n)||l&r)&&(i[s]=gw(l,t)):u<=t&&(e.expiredLanes|=l),o&=~l}}function ku(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function yp(){var e=io;return io<<=1,!(io&4194240)&&(io=64),e}function wl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ui(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ht(t),e[t]=n}function yw(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-ht(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function La(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ht(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ie=0;function vp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var wp,za,xp,Ep,_p,Su=!1,so=[],on=null,sn=null,ln=null,vi=new Map,wi=new Map,qt=[],vw="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 submit".split(" ");function cf(e,t){switch(e){case"focusin":case"focusout":on=null;break;case"dragenter":case"dragleave":sn=null;break;case"mouseover":case"mouseout":ln=null;break;case"pointerover":case"pointerout":vi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wi.delete(t.pointerId)}}function Vr(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=Yi(t),t!==null&&za(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function ww(e,t,n,r,i){switch(t){case"focusin":return on=Vr(on,e,t,n,r,i),!0;case"dragenter":return sn=Vr(sn,e,t,n,r,i),!0;case"mouseover":return ln=Vr(ln,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return vi.set(o,Vr(vi.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,wi.set(o,Vr(wi.get(o)||null,e,t,n,r,i)),!0}return!1}function kp(e){var t=kn(e.target);if(t!==null){var n=Vn(t);if(n!==null){if(t=n.tag,t===13){if(t=fp(n),t!==null){e.blockedOn=t,_p(e.priority,function(){xp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function To(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Nu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);wu=r,n.target.dispatchEvent(r),wu=null}else return t=Yi(n),t!==null&&za(t),e.blockedOn=n,!1;t.shift()}return!0}function ff(e,t,n){To(e)&&n.delete(t)}function xw(){Su=!1,on!==null&&To(on)&&(on=null),sn!==null&&To(sn)&&(sn=null),ln!==null&&To(ln)&&(ln=null),vi.forEach(ff),wi.forEach(ff)}function Hr(e,t){e.blockedOn===t&&(e.blockedOn=null,Su||(Su=!0,Xe.unstable_scheduleCallback(Xe.unstable_NormalPriority,xw)))}function xi(e){function t(i){return Hr(i,e)}if(0<so.length){Hr(so[0],e);for(var n=1;n<so.length;n++){var r=so[n];r.blockedOn===e&&(r.blockedOn=null)}}for(on!==null&&Hr(on,e),sn!==null&&Hr(sn,e),ln!==null&&Hr(ln,e),vi.forEach(t),wi.forEach(t),n=0;n<qt.length;n++)r=qt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<qt.length&&(n=qt[0],n.blockedOn===null);)kp(n),n.blockedOn===null&&qt.shift()}var lr=Ht.ReactCurrentBatchConfig,Qo=!0;function Ew(e,t,n,r){var i=ie,o=lr.transition;lr.transition=null;try{ie=1,Ra(e,t,n,r)}finally{ie=i,lr.transition=o}}function _w(e,t,n,r){var i=ie,o=lr.transition;lr.transition=null;try{ie=4,Ra(e,t,n,r)}finally{ie=i,lr.transition=o}}function Ra(e,t,n,r){if(Qo){var i=Nu(e,t,n,r);if(i===null)Pl(e,t,r,Ko,n),cf(e,r);else if(ww(i,e,t,n,r))r.stopPropagation();else if(cf(e,r),t&4&&-1<vw.indexOf(e)){for(;i!==null;){var o=Yi(i);if(o!==null&&wp(o),o=Nu(e,t,n,r),o===null&&Pl(e,t,r,Ko,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Pl(e,t,r,null,n)}}var Ko=null;function Nu(e,t,n,r){if(Ko=null,e=ja(r),e=kn(e),e!==null)if(t=Vn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=fp(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ko=e,null}function Sp(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(aw()){case Oa:return 1;case gp:return 4;case Go:case cw:return 16;case mp:return 536870912;default:return 16}default:return 16}}var tn=null,Da=null,$o=null;function Np(){if($o)return $o;var e,t=Da,n=t.length,r,i="value"in tn?tn.value:tn.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return $o=i.slice(e,1<r?1-r:void 0)}function bo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function lo(){return!0}function df(){return!1}function Ze(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?lo:df,this.isPropagationStopped=df,this}return he(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=lo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=lo)},persist:function(){},isPersistent:lo}),t}var $r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Aa=Ze($r),Wi=he({},$r,{view:0,detail:0}),kw=Ze(Wi),xl,El,Br,Ps=he({},Wi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fa,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Br&&(Br&&e.type==="mousemove"?(xl=e.screenX-Br.screenX,El=e.screenY-Br.screenY):El=xl=0,Br=e),xl)},movementY:function(e){return"movementY"in e?e.movementY:El}}),hf=Ze(Ps),Sw=he({},Ps,{dataTransfer:0}),Nw=Ze(Sw),Cw=he({},Wi,{relatedTarget:0}),_l=Ze(Cw),Mw=he({},$r,{animationName:0,elapsedTime:0,pseudoElement:0}),Iw=Ze(Mw),Pw=he({},$r,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Tw=Ze(Pw),$w=he({},$r,{data:0}),pf=Ze($w),bw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jw={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"},Ow={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Lw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ow[e])?!!t[e]:!1}function Fa(){return Lw}var zw=he({},Wi,{key:function(e){if(e.key){var t=bw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=bo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fa,charCode:function(e){return e.type==="keypress"?bo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rw=Ze(zw),Dw=he({},Ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gf=Ze(Dw),Aw=he({},Wi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fa}),Fw=Ze(Aw),Vw=he({},$r,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hw=Ze(Vw),Bw=he({},Ps,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Uw=Ze(Bw),Ww=[9,13,27,32],Va=Rt&&"CompositionEvent"in window,si=null;Rt&&"documentMode"in document&&(si=document.documentMode);var Yw=Rt&&"TextEvent"in window&&!si,Cp=Rt&&(!Va||si&&8<si&&11>=si),mf=" ",yf=!1;function Mp(e,t){switch(e){case"keyup":return Ww.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ip(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yn=!1;function Gw(e,t){switch(e){case"compositionend":return Ip(t);case"keypress":return t.which!==32?null:(yf=!0,mf);case"textInput":return e=t.data,e===mf&&yf?null:e;default:return null}}function Xw(e,t){if(Yn)return e==="compositionend"||!Va&&Mp(e,t)?(e=Np(),$o=Da=tn=null,Yn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Cp&&t.locale!=="ko"?null:t.data;default:return null}}var Qw={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 vf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qw[e.type]:t==="textarea"}function Pp(e,t,n,r){sp(r),t=Zo(t,"onChange"),0<t.length&&(n=new Aa("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var li=null,Ei=null;function Kw(e){Fp(e,0)}function Ts(e){var t=Qn(e);if(Jh(t))return e}function Zw(e,t){if(e==="change")return t}var Tp=!1;if(Rt){var kl;if(Rt){var Sl="oninput"in document;if(!Sl){var wf=document.createElement("div");wf.setAttribute("oninput","return;"),Sl=typeof wf.oninput=="function"}kl=Sl}else kl=!1;Tp=kl&&(!document.documentMode||9<document.documentMode)}function xf(){li&&(li.detachEvent("onpropertychange",$p),Ei=li=null)}function $p(e){if(e.propertyName==="value"&&Ts(Ei)){var t=[];Pp(t,Ei,e,ja(e)),cp(Kw,t)}}function qw(e,t,n){e==="focusin"?(xf(),li=t,Ei=n,li.attachEvent("onpropertychange",$p)):e==="focusout"&&xf()}function Jw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ts(Ei)}function e1(e,t){if(e==="click")return Ts(t)}function t1(e,t){if(e==="input"||e==="change")return Ts(t)}function n1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gt=typeof Object.is=="function"?Object.is:n1;function _i(e,t){if(gt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!lu.call(t,i)||!gt(e[i],t[i]))return!1}return!0}function Ef(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _f(e,t){var n=Ef(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ef(n)}}function bp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jp(){for(var e=window,t=Uo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Uo(e.document)}return t}function Ha(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function r1(e){var t=jp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&bp(n.ownerDocument.documentElement,n)){if(r!==null&&Ha(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=_f(n,o);var s=_f(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var i1=Rt&&"documentMode"in document&&11>=document.documentMode,Gn=null,Cu=null,ui=null,Mu=!1;function kf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mu||Gn==null||Gn!==Uo(r)||(r=Gn,"selectionStart"in r&&Ha(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ui&&_i(ui,r)||(ui=r,r=Zo(Cu,"onSelect"),0<r.length&&(t=new Aa("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Gn)))}function uo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Xn={animationend:uo("Animation","AnimationEnd"),animationiteration:uo("Animation","AnimationIteration"),animationstart:uo("Animation","AnimationStart"),transitionend:uo("Transition","TransitionEnd")},Nl={},Op={};Rt&&(Op=document.createElement("div").style,"AnimationEvent"in window||(delete Xn.animationend.animation,delete Xn.animationiteration.animation,delete Xn.animationstart.animation),"TransitionEvent"in window||delete Xn.transitionend.transition);function $s(e){if(Nl[e])return Nl[e];if(!Xn[e])return e;var t=Xn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Op)return Nl[e]=t[n];return e}var Lp=$s("animationend"),zp=$s("animationiteration"),Rp=$s("animationstart"),Dp=$s("transitionend"),Ap=new Map,Sf="abort auxClick 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(" ");function gn(e,t){Ap.set(e,t),Fn(t,[e])}for(var Cl=0;Cl<Sf.length;Cl++){var Ml=Sf[Cl],o1=Ml.toLowerCase(),s1=Ml[0].toUpperCase()+Ml.slice(1);gn(o1,"on"+s1)}gn(Lp,"onAnimationEnd");gn(zp,"onAnimationIteration");gn(Rp,"onAnimationStart");gn("dblclick","onDoubleClick");gn("focusin","onFocus");gn("focusout","onBlur");gn(Dp,"onTransitionEnd");pr("onMouseEnter",["mouseout","mouseover"]);pr("onMouseLeave",["mouseout","mouseover"]);pr("onPointerEnter",["pointerout","pointerover"]);pr("onPointerLeave",["pointerout","pointerover"]);Fn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jr="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(" "),l1=new Set("cancel close invalid load scroll toggle".split(" ").concat(Jr));function Nf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,ow(r,t,void 0,e),e.currentTarget=null}function Fp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],u=l.instance,a=l.currentTarget;if(l=l.listener,u!==o&&i.isPropagationStopped())break e;Nf(i,l,a),o=u}else for(s=0;s<r.length;s++){if(l=r[s],u=l.instance,a=l.currentTarget,l=l.listener,u!==o&&i.isPropagationStopped())break e;Nf(i,l,a),o=u}}}if(Yo)throw e=_u,Yo=!1,_u=null,e}function le(e,t){var n=t[bu];n===void 0&&(n=t[bu]=new Set);var r=e+"__bubble";n.has(r)||(Vp(t,e,2,!1),n.add(r))}function Il(e,t,n){var r=0;t&&(r|=4),Vp(n,e,r,t)}var ao="_reactListening"+Math.random().toString(36).slice(2);function ki(e){if(!e[ao]){e[ao]=!0,Xh.forEach(function(n){n!=="selectionchange"&&(l1.has(n)||Il(n,!1,e),Il(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ao]||(t[ao]=!0,Il("selectionchange",!1,t))}}function Vp(e,t,n,r){switch(Sp(t)){case 1:var i=Ew;break;case 4:i=_w;break;default:i=Ra}n=i.bind(null,t,n,e),i=void 0,!Eu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Pl(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;s=s.return}for(;l!==null;){if(s=kn(l),s===null)return;if(u=s.tag,u===5||u===6){r=o=s;continue e}l=l.parentNode}}r=r.return}cp(function(){var a=o,c=ja(n),d=[];e:{var f=Ap.get(e);if(f!==void 0){var h=Aa,m=e;switch(e){case"keypress":if(bo(n)===0)break e;case"keydown":case"keyup":h=Rw;break;case"focusin":m="focus",h=_l;break;case"focusout":m="blur",h=_l;break;case"beforeblur":case"afterblur":h=_l;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=hf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=Nw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Fw;break;case Lp:case zp:case Rp:h=Iw;break;case Dp:h=Hw;break;case"scroll":h=kw;break;case"wheel":h=Uw;break;case"copy":case"cut":case"paste":h=Tw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=gf}var v=(t&4)!==0,S=!v&&e==="scroll",p=v?f!==null?f+"Capture":null:f;v=[];for(var y=a,g;y!==null;){g=y;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,p!==null&&(w=yi(y,p),w!=null&&v.push(Si(y,w,g)))),S)break;y=y.return}0<v.length&&(f=new h(f,m,null,n,c),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==wu&&(m=n.relatedTarget||n.fromElement)&&(kn(m)||m[Dt]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=a,m=m?kn(m):null,m!==null&&(S=Vn(m),m!==S||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=a),h!==m)){if(v=hf,w="onMouseLeave",p="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(v=gf,w="onPointerLeave",p="onPointerEnter",y="pointer"),S=h==null?f:Qn(h),g=m==null?f:Qn(m),f=new v(w,y+"leave",h,n,c),f.target=S,f.relatedTarget=g,w=null,kn(c)===a&&(v=new v(p,y+"enter",m,n,c),v.target=g,v.relatedTarget=S,w=v),S=w,h&&m)t:{for(v=h,p=m,y=0,g=v;g;g=Bn(g))y++;for(g=0,w=p;w;w=Bn(w))g++;for(;0<y-g;)v=Bn(v),y--;for(;0<g-y;)p=Bn(p),g--;for(;y--;){if(v===p||p!==null&&v===p.alternate)break t;v=Bn(v),p=Bn(p)}v=null}else v=null;h!==null&&Cf(d,f,h,v,!1),m!==null&&S!==null&&Cf(d,S,m,v,!0)}}e:{if(f=a?Qn(a):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var N=Zw;else if(vf(f))if(Tp)N=t1;else{N=Jw;var P=qw}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(N=e1);if(N&&(N=N(e,a))){Pp(d,N,n,c);break e}P&&P(e,f,a),e==="focusout"&&(P=f._wrapperState)&&P.controlled&&f.type==="number"&&pu(f,"number",f.value)}switch(P=a?Qn(a):window,e){case"focusin":(vf(P)||P.contentEditable==="true")&&(Gn=P,Cu=a,ui=null);break;case"focusout":ui=Cu=Gn=null;break;case"mousedown":Mu=!0;break;case"contextmenu":case"mouseup":case"dragend":Mu=!1,kf(d,n,c);break;case"selectionchange":if(i1)break;case"keydown":case"keyup":kf(d,n,c)}var C;if(Va)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Yn?Mp(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Cp&&n.locale!=="ko"&&(Yn||T!=="onCompositionStart"?T==="onCompositionEnd"&&Yn&&(C=Np()):(tn=c,Da="value"in tn?tn.value:tn.textContent,Yn=!0)),P=Zo(a,T),0<P.length&&(T=new pf(T,e,null,n,c),d.push({event:T,listeners:P}),C?T.data=C:(C=Ip(n),C!==null&&(T.data=C)))),(C=Yw?Gw(e,n):Xw(e,n))&&(a=Zo(a,"onBeforeInput"),0<a.length&&(c=new pf("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:a}),c.data=C))}Fp(d,t)})}function Si(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zo(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=yi(e,n),o!=null&&r.unshift(Si(e,o,i)),o=yi(e,t),o!=null&&r.push(Si(e,o,i))),e=e.return}return r}function Bn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Cf(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var l=n,u=l.alternate,a=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&a!==null&&(l=a,i?(u=yi(n,o),u!=null&&s.unshift(Si(n,u,l))):i||(u=yi(n,o),u!=null&&s.push(Si(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var u1=/\r\n?/g,a1=/\u0000|\uFFFD/g;function Mf(e){return(typeof e=="string"?e:""+e).replace(u1,`
|
|
38
|
+
`).replace(a1,"")}function co(e,t,n){if(t=Mf(t),Mf(e)!==t&&n)throw Error(V(425))}function qo(){}var Iu=null,Pu=null;function Tu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var $u=typeof setTimeout=="function"?setTimeout:void 0,c1=typeof clearTimeout=="function"?clearTimeout:void 0,If=typeof Promise=="function"?Promise:void 0,f1=typeof queueMicrotask=="function"?queueMicrotask:typeof If<"u"?function(e){return If.resolve(null).then(e).catch(d1)}:$u;function d1(e){setTimeout(function(){throw e})}function Tl(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),xi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);xi(t)}function un(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Pf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var br=Math.random().toString(36).slice(2),xt="__reactFiber$"+br,Ni="__reactProps$"+br,Dt="__reactContainer$"+br,bu="__reactEvents$"+br,h1="__reactListeners$"+br,p1="__reactHandles$"+br;function kn(e){var t=e[xt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Dt]||n[xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Pf(e);e!==null;){if(n=e[xt])return n;e=Pf(e)}return t}e=n,n=e.parentNode}return null}function Yi(e){return e=e[xt]||e[Dt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Qn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(V(33))}function bs(e){return e[Ni]||null}var ju=[],Kn=-1;function mn(e){return{current:e}}function ue(e){0>Kn||(e.current=ju[Kn],ju[Kn]=null,Kn--)}function oe(e,t){Kn++,ju[Kn]=e.current,e.current=t}var pn={},je=mn(pn),Ve=mn(!1),bn=pn;function gr(e,t){var n=e.type.contextTypes;if(!n)return pn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function He(e){return e=e.childContextTypes,e!=null}function Jo(){ue(Ve),ue(je)}function Tf(e,t,n){if(je.current!==pn)throw Error(V(168));oe(je,t),oe(Ve,n)}function Hp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(V(108,qv(e)||"Unknown",i));return he({},n,r)}function es(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pn,bn=je.current,oe(je,e),oe(Ve,Ve.current),!0}function $f(e,t,n){var r=e.stateNode;if(!r)throw Error(V(169));n?(e=Hp(e,t,bn),r.__reactInternalMemoizedMergedChildContext=e,ue(Ve),ue(je),oe(je,e)):ue(Ve),oe(Ve,n)}var It=null,js=!1,$l=!1;function Bp(e){It===null?It=[e]:It.push(e)}function g1(e){js=!0,Bp(e)}function yn(){if(!$l&&It!==null){$l=!0;var e=0,t=ie;try{var n=It;for(ie=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}It=null,js=!1}catch(i){throw It!==null&&(It=It.slice(e+1)),pp(Oa,yn),i}finally{ie=t,$l=!1}}return null}var Zn=[],qn=0,ts=null,ns=0,qe=[],Je=0,jn=null,Tt=1,$t="";function xn(e,t){Zn[qn++]=ns,Zn[qn++]=ts,ts=e,ns=t}function Up(e,t,n){qe[Je++]=Tt,qe[Je++]=$t,qe[Je++]=jn,jn=e;var r=Tt;e=$t;var i=32-ht(r)-1;r&=~(1<<i),n+=1;var o=32-ht(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Tt=1<<32-ht(t)+i|n<<i|r,$t=o+e}else Tt=1<<o|n<<i|r,$t=e}function Ba(e){e.return!==null&&(xn(e,1),Up(e,1,0))}function Ua(e){for(;e===ts;)ts=Zn[--qn],Zn[qn]=null,ns=Zn[--qn],Zn[qn]=null;for(;e===jn;)jn=qe[--Je],qe[Je]=null,$t=qe[--Je],qe[Je]=null,Tt=qe[--Je],qe[Je]=null}var Ge=null,Ye=null,ae=!1,ct=null;function Wp(e,t){var n=et(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function bf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ge=e,Ye=un(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ge=e,Ye=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=jn!==null?{id:Tt,overflow:$t}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=et(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ge=e,Ye=null,!0):!1;default:return!1}}function Ou(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Lu(e){if(ae){var t=Ye;if(t){var n=t;if(!bf(e,t)){if(Ou(e))throw Error(V(418));t=un(n.nextSibling);var r=Ge;t&&bf(e,t)?Wp(r,n):(e.flags=e.flags&-4097|2,ae=!1,Ge=e)}}else{if(Ou(e))throw Error(V(418));e.flags=e.flags&-4097|2,ae=!1,Ge=e}}}function jf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ge=e}function fo(e){if(e!==Ge)return!1;if(!ae)return jf(e),ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Tu(e.type,e.memoizedProps)),t&&(t=Ye)){if(Ou(e))throw Yp(),Error(V(418));for(;t;)Wp(e,t),t=un(t.nextSibling)}if(jf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ye=un(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ye=null}}else Ye=Ge?un(e.stateNode.nextSibling):null;return!0}function Yp(){for(var e=Ye;e;)e=un(e.nextSibling)}function mr(){Ye=Ge=null,ae=!1}function Wa(e){ct===null?ct=[e]:ct.push(e)}var m1=Ht.ReactCurrentBatchConfig;function Ur(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(V(309));var r=n.stateNode}if(!r)throw Error(V(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var l=i.refs;s===null?delete l[o]:l[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(V(284));if(!n._owner)throw Error(V(290,e))}return e}function ho(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Of(e){var t=e._init;return t(e._payload)}function Gp(e){function t(p,y){if(e){var g=p.deletions;g===null?(p.deletions=[y],p.flags|=16):g.push(y)}}function n(p,y){if(!e)return null;for(;y!==null;)t(p,y),y=y.sibling;return null}function r(p,y){for(p=new Map;y!==null;)y.key!==null?p.set(y.key,y):p.set(y.index,y),y=y.sibling;return p}function i(p,y){return p=dn(p,y),p.index=0,p.sibling=null,p}function o(p,y,g){return p.index=g,e?(g=p.alternate,g!==null?(g=g.index,g<y?(p.flags|=2,y):g):(p.flags|=2,y)):(p.flags|=1048576,y)}function s(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,y,g,w){return y===null||y.tag!==6?(y=Dl(g,p.mode,w),y.return=p,y):(y=i(y,g),y.return=p,y)}function u(p,y,g,w){var N=g.type;return N===Wn?c(p,y,g.props.children,w,g.key):y!==null&&(y.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Qt&&Of(N)===y.type)?(w=i(y,g.props),w.ref=Ur(p,y,g),w.return=p,w):(w=Ao(g.type,g.key,g.props,null,p.mode,w),w.ref=Ur(p,y,g),w.return=p,w)}function a(p,y,g,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=Al(g,p.mode,w),y.return=p,y):(y=i(y,g.children||[]),y.return=p,y)}function c(p,y,g,w,N){return y===null||y.tag!==7?(y=In(g,p.mode,w,N),y.return=p,y):(y=i(y,g),y.return=p,y)}function d(p,y,g){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Dl(""+y,p.mode,g),y.return=p,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case to:return g=Ao(y.type,y.key,y.props,null,p.mode,g),g.ref=Ur(p,null,y),g.return=p,g;case Un:return y=Al(y,p.mode,g),y.return=p,y;case Qt:var w=y._init;return d(p,w(y._payload),g)}if(Zr(y)||Ar(y))return y=In(y,p.mode,g,null),y.return=p,y;ho(p,y)}return null}function f(p,y,g,w){var N=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return N!==null?null:l(p,y,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case to:return g.key===N?u(p,y,g,w):null;case Un:return g.key===N?a(p,y,g,w):null;case Qt:return N=g._init,f(p,y,N(g._payload),w)}if(Zr(g)||Ar(g))return N!==null?null:c(p,y,g,w,null);ho(p,g)}return null}function h(p,y,g,w,N){if(typeof w=="string"&&w!==""||typeof w=="number")return p=p.get(g)||null,l(y,p,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case to:return p=p.get(w.key===null?g:w.key)||null,u(y,p,w,N);case Un:return p=p.get(w.key===null?g:w.key)||null,a(y,p,w,N);case Qt:var P=w._init;return h(p,y,g,P(w._payload),N)}if(Zr(w)||Ar(w))return p=p.get(g)||null,c(y,p,w,N,null);ho(y,w)}return null}function m(p,y,g,w){for(var N=null,P=null,C=y,T=y=0,L=null;C!==null&&T<g.length;T++){C.index>T?(L=C,C=null):L=C.sibling;var j=f(p,C,g[T],w);if(j===null){C===null&&(C=L);break}e&&C&&j.alternate===null&&t(p,C),y=o(j,y,T),P===null?N=j:P.sibling=j,P=j,C=L}if(T===g.length)return n(p,C),ae&&xn(p,T),N;if(C===null){for(;T<g.length;T++)C=d(p,g[T],w),C!==null&&(y=o(C,y,T),P===null?N=C:P.sibling=C,P=C);return ae&&xn(p,T),N}for(C=r(p,C);T<g.length;T++)L=h(C,p,T,g[T],w),L!==null&&(e&&L.alternate!==null&&C.delete(L.key===null?T:L.key),y=o(L,y,T),P===null?N=L:P.sibling=L,P=L);return e&&C.forEach(function(A){return t(p,A)}),ae&&xn(p,T),N}function v(p,y,g,w){var N=Ar(g);if(typeof N!="function")throw Error(V(150));if(g=N.call(g),g==null)throw Error(V(151));for(var P=N=null,C=y,T=y=0,L=null,j=g.next();C!==null&&!j.done;T++,j=g.next()){C.index>T?(L=C,C=null):L=C.sibling;var A=f(p,C,j.value,w);if(A===null){C===null&&(C=L);break}e&&C&&A.alternate===null&&t(p,C),y=o(A,y,T),P===null?N=A:P.sibling=A,P=A,C=L}if(j.done)return n(p,C),ae&&xn(p,T),N;if(C===null){for(;!j.done;T++,j=g.next())j=d(p,j.value,w),j!==null&&(y=o(j,y,T),P===null?N=j:P.sibling=j,P=j);return ae&&xn(p,T),N}for(C=r(p,C);!j.done;T++,j=g.next())j=h(C,p,T,j.value,w),j!==null&&(e&&j.alternate!==null&&C.delete(j.key===null?T:j.key),y=o(j,y,T),P===null?N=j:P.sibling=j,P=j);return e&&C.forEach(function(D){return t(p,D)}),ae&&xn(p,T),N}function S(p,y,g,w){if(typeof g=="object"&&g!==null&&g.type===Wn&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case to:e:{for(var N=g.key,P=y;P!==null;){if(P.key===N){if(N=g.type,N===Wn){if(P.tag===7){n(p,P.sibling),y=i(P,g.props.children),y.return=p,p=y;break e}}else if(P.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Qt&&Of(N)===P.type){n(p,P.sibling),y=i(P,g.props),y.ref=Ur(p,P,g),y.return=p,p=y;break e}n(p,P);break}else t(p,P);P=P.sibling}g.type===Wn?(y=In(g.props.children,p.mode,w,g.key),y.return=p,p=y):(w=Ao(g.type,g.key,g.props,null,p.mode,w),w.ref=Ur(p,y,g),w.return=p,p=w)}return s(p);case Un:e:{for(P=g.key;y!==null;){if(y.key===P)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(p,y.sibling),y=i(y,g.children||[]),y.return=p,p=y;break e}else{n(p,y);break}else t(p,y);y=y.sibling}y=Al(g,p.mode,w),y.return=p,p=y}return s(p);case Qt:return P=g._init,S(p,y,P(g._payload),w)}if(Zr(g))return m(p,y,g,w);if(Ar(g))return v(p,y,g,w);ho(p,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(p,y.sibling),y=i(y,g),y.return=p,p=y):(n(p,y),y=Dl(g,p.mode,w),y.return=p,p=y),s(p)):n(p,y)}return S}var yr=Gp(!0),Xp=Gp(!1),rs=mn(null),is=null,Jn=null,Ya=null;function Ga(){Ya=Jn=is=null}function Xa(e){var t=rs.current;ue(rs),e._currentValue=t}function zu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ur(e,t){is=e,Ya=Jn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Fe=!0),e.firstContext=null)}function nt(e){var t=e._currentValue;if(Ya!==e)if(e={context:e,memoizedValue:t,next:null},Jn===null){if(is===null)throw Error(V(308));Jn=e,is.dependencies={lanes:0,firstContext:e}}else Jn=Jn.next=e;return t}var Sn=null;function Qa(e){Sn===null?Sn=[e]:Sn.push(e)}function Qp(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Qa(t)):(n.next=i.next,i.next=n),t.interleaved=n,At(e,r)}function At(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Kt=!1;function Ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ot(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function an(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,te&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,At(e,n)}return i=r.interleaved,i===null?(t.next=t,Qa(r)):(t.next=i.next,i.next=t),r.interleaved=t,At(e,n)}function jo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,La(e,n)}}function Lf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function os(e,t,n,r){var i=e.updateQueue;Kt=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,a=u.next;u.next=null,s===null?o=a:s.next=a,s=u;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=a:l.next=a,c.lastBaseUpdate=u))}if(o!==null){var d=i.baseState;s=0,c=a=u=null,l=o;do{var f=l.lane,h=l.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,v=l;switch(f=t,h=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){d=m.call(h,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,f=typeof m=="function"?m.call(h,d,f):m,f==null)break e;d=he({},d,f);break e;case 2:Kt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else h={eventTime:h,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(a=c=h,u=d):c=c.next=h,s|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(u=d),i.baseState=u,i.firstBaseUpdate=a,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Ln|=s,e.lanes=s,e.memoizedState=d}}function zf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(V(191,i));i.call(r)}}}var Gi={},_t=mn(Gi),Ci=mn(Gi),Mi=mn(Gi);function Nn(e){if(e===Gi)throw Error(V(174));return e}function Za(e,t){switch(oe(Mi,t),oe(Ci,e),oe(_t,Gi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mu(t,e)}ue(_t),oe(_t,t)}function vr(){ue(_t),ue(Ci),ue(Mi)}function Zp(e){Nn(Mi.current);var t=Nn(_t.current),n=mu(t,e.type);t!==n&&(oe(Ci,e),oe(_t,n))}function qa(e){Ci.current===e&&(ue(_t),ue(Ci))}var fe=mn(0);function ss(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var bl=[];function Ja(){for(var e=0;e<bl.length;e++)bl[e]._workInProgressVersionPrimary=null;bl.length=0}var Oo=Ht.ReactCurrentDispatcher,jl=Ht.ReactCurrentBatchConfig,On=0,de=null,Ee=null,ke=null,ls=!1,ai=!1,Ii=0,y1=0;function Te(){throw Error(V(321))}function ec(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gt(e[n],t[n]))return!1;return!0}function tc(e,t,n,r,i,o){if(On=o,de=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Oo.current=e===null||e.memoizedState===null?E1:_1,e=n(r,i),ai){o=0;do{if(ai=!1,Ii=0,25<=o)throw Error(V(301));o+=1,ke=Ee=null,t.updateQueue=null,Oo.current=k1,e=n(r,i)}while(ai)}if(Oo.current=us,t=Ee!==null&&Ee.next!==null,On=0,ke=Ee=de=null,ls=!1,t)throw Error(V(300));return e}function nc(){var e=Ii!==0;return Ii=0,e}function wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ke===null?de.memoizedState=ke=e:ke=ke.next=e,ke}function rt(){if(Ee===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=Ee.next;var t=ke===null?de.memoizedState:ke.next;if(t!==null)ke=t,Ee=e;else{if(e===null)throw Error(V(310));Ee=e,e={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},ke===null?de.memoizedState=ke=e:ke=ke.next=e}return ke}function Pi(e,t){return typeof t=="function"?t(e):t}function Ol(e){var t=rt(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=Ee,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var l=s=null,u=null,a=o;do{var c=a.lane;if((On&c)===c)u!==null&&(u=u.next={lane:0,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null}),r=a.hasEagerState?a.eagerState:e(r,a.action);else{var d={lane:c,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null};u===null?(l=u=d,s=r):u=u.next=d,de.lanes|=c,Ln|=c}a=a.next}while(a!==null&&a!==o);u===null?s=r:u.next=l,gt(r,t.memoizedState)||(Fe=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,de.lanes|=o,Ln|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ll(e){var t=rt(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);gt(o,t.memoizedState)||(Fe=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function qp(){}function Jp(e,t){var n=de,r=rt(),i=t(),o=!gt(r.memoizedState,i);if(o&&(r.memoizedState=i,Fe=!0),r=r.queue,rc(ng.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||ke!==null&&ke.memoizedState.tag&1){if(n.flags|=2048,Ti(9,tg.bind(null,n,r,i,t),void 0,null),Ne===null)throw Error(V(349));On&30||eg(n,t,i)}return i}function eg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=de.updateQueue,t===null?(t={lastEffect:null,stores:null},de.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function tg(e,t,n,r){t.value=n,t.getSnapshot=r,rg(t)&&ig(e)}function ng(e,t,n){return n(function(){rg(t)&&ig(e)})}function rg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gt(e,n)}catch{return!0}}function ig(e){var t=At(e,1);t!==null&&pt(t,e,1,-1)}function Rf(e){var t=wt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:e},t.queue=e,e=e.dispatch=x1.bind(null,de,e),[t.memoizedState,e]}function Ti(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=de.updateQueue,t===null?(t={lastEffect:null,stores:null},de.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function og(){return rt().memoizedState}function Lo(e,t,n,r){var i=wt();de.flags|=e,i.memoizedState=Ti(1|t,n,void 0,r===void 0?null:r)}function Os(e,t,n,r){var i=rt();r=r===void 0?null:r;var o=void 0;if(Ee!==null){var s=Ee.memoizedState;if(o=s.destroy,r!==null&&ec(r,s.deps)){i.memoizedState=Ti(t,n,o,r);return}}de.flags|=e,i.memoizedState=Ti(1|t,n,o,r)}function Df(e,t){return Lo(8390656,8,e,t)}function rc(e,t){return Os(2048,8,e,t)}function sg(e,t){return Os(4,2,e,t)}function lg(e,t){return Os(4,4,e,t)}function ug(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ag(e,t,n){return n=n!=null?n.concat([e]):null,Os(4,4,ug.bind(null,t,e),n)}function ic(){}function cg(e,t){var n=rt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ec(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fg(e,t){var n=rt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ec(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function dg(e,t,n){return On&21?(gt(n,t)||(n=yp(),de.lanes|=n,Ln|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Fe=!0),e.memoizedState=n)}function v1(e,t){var n=ie;ie=n!==0&&4>n?n:4,e(!0);var r=jl.transition;jl.transition={};try{e(!1),t()}finally{ie=n,jl.transition=r}}function hg(){return rt().memoizedState}function w1(e,t,n){var r=fn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},pg(e))gg(t,n);else if(n=Qp(e,t,n,r),n!==null){var i=ze();pt(n,e,r,i),mg(n,t,r)}}function x1(e,t,n){var r=fn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(pg(e))gg(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,gt(l,s)){var u=t.interleaved;u===null?(i.next=i,Qa(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=Qp(e,t,i,r),n!==null&&(i=ze(),pt(n,e,r,i),mg(n,t,r))}}function pg(e){var t=e.alternate;return e===de||t!==null&&t===de}function gg(e,t){ai=ls=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,La(e,n)}}var us={readContext:nt,useCallback:Te,useContext:Te,useEffect:Te,useImperativeHandle:Te,useInsertionEffect:Te,useLayoutEffect:Te,useMemo:Te,useReducer:Te,useRef:Te,useState:Te,useDebugValue:Te,useDeferredValue:Te,useTransition:Te,useMutableSource:Te,useSyncExternalStore:Te,useId:Te,unstable_isNewReconciler:!1},E1={readContext:nt,useCallback:function(e,t){return wt().memoizedState=[e,t===void 0?null:t],e},useContext:nt,useEffect:Df,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Lo(4194308,4,ug.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Lo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Lo(4,2,e,t)},useMemo:function(e,t){var n=wt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=wt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=w1.bind(null,de,e),[r.memoizedState,e]},useRef:function(e){var t=wt();return e={current:e},t.memoizedState=e},useState:Rf,useDebugValue:ic,useDeferredValue:function(e){return wt().memoizedState=e},useTransition:function(){var e=Rf(!1),t=e[0];return e=v1.bind(null,e[1]),wt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=de,i=wt();if(ae){if(n===void 0)throw Error(V(407));n=n()}else{if(n=t(),Ne===null)throw Error(V(349));On&30||eg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Df(ng.bind(null,r,o,e),[e]),r.flags|=2048,Ti(9,tg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=wt(),t=Ne.identifierPrefix;if(ae){var n=$t,r=Tt;n=(r&~(1<<32-ht(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ii++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=y1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_1={readContext:nt,useCallback:cg,useContext:nt,useEffect:rc,useImperativeHandle:ag,useInsertionEffect:sg,useLayoutEffect:lg,useMemo:fg,useReducer:Ol,useRef:og,useState:function(){return Ol(Pi)},useDebugValue:ic,useDeferredValue:function(e){var t=rt();return dg(t,Ee.memoizedState,e)},useTransition:function(){var e=Ol(Pi)[0],t=rt().memoizedState;return[e,t]},useMutableSource:qp,useSyncExternalStore:Jp,useId:hg,unstable_isNewReconciler:!1},k1={readContext:nt,useCallback:cg,useContext:nt,useEffect:rc,useImperativeHandle:ag,useInsertionEffect:sg,useLayoutEffect:lg,useMemo:fg,useReducer:Ll,useRef:og,useState:function(){return Ll(Pi)},useDebugValue:ic,useDeferredValue:function(e){var t=rt();return Ee===null?t.memoizedState=e:dg(t,Ee.memoizedState,e)},useTransition:function(){var e=Ll(Pi)[0],t=rt().memoizedState;return[e,t]},useMutableSource:qp,useSyncExternalStore:Jp,useId:hg,unstable_isNewReconciler:!1};function lt(e,t){if(e&&e.defaultProps){t=he({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ru(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:he({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ls={isMounted:function(e){return(e=e._reactInternals)?Vn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ze(),i=fn(e),o=Ot(r,i);o.payload=t,n!=null&&(o.callback=n),t=an(e,o,i),t!==null&&(pt(t,e,i,r),jo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ze(),i=fn(e),o=Ot(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=an(e,o,i),t!==null&&(pt(t,e,i,r),jo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ze(),r=fn(e),i=Ot(n,r);i.tag=2,t!=null&&(i.callback=t),t=an(e,i,r),t!==null&&(pt(t,e,r,n),jo(t,e,r))}};function Af(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!_i(n,r)||!_i(i,o):!0}function yg(e,t,n){var r=!1,i=pn,o=t.contextType;return typeof o=="object"&&o!==null?o=nt(o):(i=He(t)?bn:je.current,r=t.contextTypes,o=(r=r!=null)?gr(e,i):pn),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ls,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Ff(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ls.enqueueReplaceState(t,t.state,null)}function Du(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ka(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=nt(o):(o=He(t)?bn:je.current,i.context=gr(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Ru(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Ls.enqueueReplaceState(i,i.state,null),os(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function wr(e,t){try{var n="",r=t;do n+=Zv(r),r=r.return;while(r);var i=n}catch(o){i=`
|
|
39
|
+
Error generating stack: `+o.message+`
|
|
40
|
+
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function zl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Au(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var S1=typeof WeakMap=="function"?WeakMap:Map;function vg(e,t,n){n=Ot(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){cs||(cs=!0,Qu=r),Au(e,t)},n}function wg(e,t,n){n=Ot(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Au(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Au(e,t),typeof r!="function"&&(cn===null?cn=new Set([this]):cn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Vf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new S1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=D1.bind(null,e,t,n),t.then(e,e))}function Hf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Bf(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ot(-1,1),t.tag=2,an(n,t,1))),n.lanes|=1),e)}var N1=Ht.ReactCurrentOwner,Fe=!1;function Le(e,t,n,r){t.child=e===null?Xp(t,null,n,r):yr(t,e.child,n,r)}function Uf(e,t,n,r,i){n=n.render;var o=t.ref;return ur(t,i),r=tc(e,t,n,r,o,i),n=nc(),e!==null&&!Fe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ft(e,t,i)):(ae&&n&&Ba(t),t.flags|=1,Le(e,t,r,i),t.child)}function Wf(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!dc(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,xg(e,t,o,r,i)):(e=Ao(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:_i,n(s,r)&&e.ref===t.ref)return Ft(e,t,i)}return t.flags|=1,e=dn(o,r),e.ref=t.ref,e.return=t,t.child=e}function xg(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(_i(o,r)&&e.ref===t.ref)if(Fe=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Fe=!0);else return t.lanes=e.lanes,Ft(e,t,i)}return Fu(e,t,n,r,i)}function Eg(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},oe(tr,Ue),Ue|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,oe(tr,Ue),Ue|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,oe(tr,Ue),Ue|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,oe(tr,Ue),Ue|=r;return Le(e,t,i,n),t.child}function _g(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Fu(e,t,n,r,i){var o=He(n)?bn:je.current;return o=gr(t,o),ur(t,i),n=tc(e,t,n,r,o,i),r=nc(),e!==null&&!Fe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ft(e,t,i)):(ae&&r&&Ba(t),t.flags|=1,Le(e,t,n,i),t.child)}function Yf(e,t,n,r,i){if(He(n)){var o=!0;es(t)}else o=!1;if(ur(t,i),t.stateNode===null)zo(e,t),yg(t,n,r),Du(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var u=s.context,a=n.contextType;typeof a=="object"&&a!==null?a=nt(a):(a=He(n)?bn:je.current,a=gr(t,a));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||u!==a)&&Ff(t,s,r,a),Kt=!1;var f=t.memoizedState;s.state=f,os(t,r,s,i),u=t.memoizedState,l!==r||f!==u||Ve.current||Kt?(typeof c=="function"&&(Ru(t,n,c,r),u=t.memoizedState),(l=Kt||Af(t,n,l,r,f,u,a))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=a,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Kp(e,t),l=t.memoizedProps,a=t.type===t.elementType?l:lt(t.type,l),s.props=a,d=t.pendingProps,f=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=nt(u):(u=He(n)?bn:je.current,u=gr(t,u));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||f!==u)&&Ff(t,s,r,u),Kt=!1,f=t.memoizedState,s.state=f,os(t,r,s,i);var m=t.memoizedState;l!==d||f!==m||Ve.current||Kt?(typeof h=="function"&&(Ru(t,n,h,r),m=t.memoizedState),(a=Kt||Af(t,n,a,r,f,m,u)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=u,r=a):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Vu(e,t,n,r,o,i)}function Vu(e,t,n,r,i,o){_g(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&$f(t,n,!1),Ft(e,t,o);r=t.stateNode,N1.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=yr(t,e.child,null,o),t.child=yr(t,null,l,o)):Le(e,t,l,o),t.memoizedState=r.state,i&&$f(t,n,!0),t.child}function kg(e){var t=e.stateNode;t.pendingContext?Tf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Tf(e,t.context,!1),Za(e,t.containerInfo)}function Gf(e,t,n,r,i){return mr(),Wa(i),t.flags|=256,Le(e,t,n,r),t.child}var Hu={dehydrated:null,treeContext:null,retryLane:0};function Bu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Sg(e,t,n){var r=t.pendingProps,i=fe.current,o=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),oe(fe,i&1),e===null)return Lu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Ds(s,r,0,null),e=In(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Bu(n),t.memoizedState=Hu,e):oc(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return C1(e,t,s,r,l,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,l=i.sibling;var u={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=dn(i,u),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?o=dn(l,o):(o=In(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?Bu(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=Hu,r}return o=e.child,e=o.sibling,r=dn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function oc(e,t){return t=Ds({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function po(e,t,n,r){return r!==null&&Wa(r),yr(t,e.child,null,n),e=oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function C1(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=zl(Error(V(422))),po(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Ds({mode:"visible",children:r.children},i,0,null),o=In(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&yr(t,e.child,null,s),t.child.memoizedState=Bu(s),t.memoizedState=Hu,o);if(!(t.mode&1))return po(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(V(419)),r=zl(o,r,void 0),po(e,t,s,r)}if(l=(s&e.childLanes)!==0,Fe||l){if(r=Ne,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,At(e,i),pt(r,e,i,-1))}return fc(),r=zl(Error(V(421))),po(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=A1.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Ye=un(i.nextSibling),Ge=t,ae=!0,ct=null,e!==null&&(qe[Je++]=Tt,qe[Je++]=$t,qe[Je++]=jn,Tt=e.id,$t=e.overflow,jn=t),t=oc(t,r.children),t.flags|=4096,t)}function Xf(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),zu(e.return,t,n)}function Rl(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Ng(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Le(e,t,r.children,n),r=fe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xf(e,n,t);else if(e.tag===19)Xf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(oe(fe,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ss(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Rl(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ss(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Rl(t,!0,n,null,o);break;case"together":Rl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ft(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ln|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,n=dn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=dn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function M1(e,t,n){switch(t.tag){case 3:kg(t),mr();break;case 5:Zp(t);break;case 1:He(t.type)&&es(t);break;case 4:Za(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;oe(rs,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(oe(fe,fe.current&1),t.flags|=128,null):n&t.child.childLanes?Sg(e,t,n):(oe(fe,fe.current&1),e=Ft(e,t,n),e!==null?e.sibling:null);oe(fe,fe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ng(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(fe,fe.current),r)break;return null;case 22:case 23:return t.lanes=0,Eg(e,t,n)}return Ft(e,t,n)}var Cg,Uu,Mg,Ig;Cg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Uu=function(){};Mg=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Nn(_t.current);var o=null;switch(n){case"input":i=du(e,i),r=du(e,r),o=[];break;case"select":i=he({},i,{value:void 0}),r=he({},r,{value:void 0}),o=[];break;case"textarea":i=gu(e,i),r=gu(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=qo)}yu(n,r);var s;n=null;for(a in i)if(!r.hasOwnProperty(a)&&i.hasOwnProperty(a)&&i[a]!=null)if(a==="style"){var l=i[a];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else a!=="dangerouslySetInnerHTML"&&a!=="children"&&a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(gi.hasOwnProperty(a)?o||(o=[]):(o=o||[]).push(a,null));for(a in r){var u=r[a];if(l=i!=null?i[a]:void 0,r.hasOwnProperty(a)&&u!==l&&(u!=null||l!=null))if(a==="style")if(l){for(s in l)!l.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&l[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(o||(o=[]),o.push(a,n)),n=u;else a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(o=o||[]).push(a,u)):a==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(a,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&(gi.hasOwnProperty(a)?(u!=null&&a==="onScroll"&&le("scroll",e),o||l===u||(o=[])):(o=o||[]).push(a,u))}n&&(o=o||[]).push("style",n);var a=o;(t.updateQueue=a)&&(t.flags|=4)}};Ig=function(e,t,n,r){n!==r&&(t.flags|=4)};function Wr(e,t){if(!ae)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function $e(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function I1(e,t,n){var r=t.pendingProps;switch(Ua(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return He(t.type)&&Jo(),$e(t),null;case 3:return r=t.stateNode,vr(),ue(Ve),ue(je),Ja(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(fo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ct!==null&&(qu(ct),ct=null))),Uu(e,t),$e(t),null;case 5:qa(t);var i=Nn(Mi.current);if(n=t.type,e!==null&&t.stateNode!=null)Mg(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(V(166));return $e(t),null}if(e=Nn(_t.current),fo(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[xt]=t,r[Ni]=o,e=(t.mode&1)!==0,n){case"dialog":le("cancel",r),le("close",r);break;case"iframe":case"object":case"embed":le("load",r);break;case"video":case"audio":for(i=0;i<Jr.length;i++)le(Jr[i],r);break;case"source":le("error",r);break;case"img":case"image":case"link":le("error",r),le("load",r);break;case"details":le("toggle",r);break;case"input":nf(r,o),le("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},le("invalid",r);break;case"textarea":of(r,o),le("invalid",r)}yu(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&co(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&co(r.textContent,l,e),i=["children",""+l]):gi.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&le("scroll",r)}switch(n){case"input":no(r),rf(r,o,!0);break;case"textarea":no(r),sf(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=qo)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=np(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[xt]=t,e[Ni]=r,Cg(e,t,!1,!1),t.stateNode=e;e:{switch(s=vu(n,r),n){case"dialog":le("cancel",e),le("close",e),i=r;break;case"iframe":case"object":case"embed":le("load",e),i=r;break;case"video":case"audio":for(i=0;i<Jr.length;i++)le(Jr[i],e);i=r;break;case"source":le("error",e),i=r;break;case"img":case"image":case"link":le("error",e),le("load",e),i=r;break;case"details":le("toggle",e),i=r;break;case"input":nf(e,r),i=du(e,r),le("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=he({},r,{value:void 0}),le("invalid",e);break;case"textarea":of(e,r),i=gu(e,r),le("invalid",e);break;default:i=r}yu(n,i),l=i;for(o in l)if(l.hasOwnProperty(o)){var u=l[o];o==="style"?op(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&rp(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&mi(e,u):typeof u=="number"&&mi(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(gi.hasOwnProperty(o)?u!=null&&o==="onScroll"&&le("scroll",e):u!=null&&Pa(e,o,u,s))}switch(n){case"input":no(e),rf(e,r,!1);break;case"textarea":no(e),sf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+hn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?ir(e,!!r.multiple,o,!1):r.defaultValue!=null&&ir(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=qo)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return $e(t),null;case 6:if(e&&t.stateNode!=null)Ig(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(V(166));if(n=Nn(Mi.current),Nn(_t.current),fo(t)){if(r=t.stateNode,n=t.memoizedProps,r[xt]=t,(o=r.nodeValue!==n)&&(e=Ge,e!==null))switch(e.tag){case 3:co(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&co(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[xt]=t,t.stateNode=r}return $e(t),null;case 13:if(ue(fe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ae&&Ye!==null&&t.mode&1&&!(t.flags&128))Yp(),mr(),t.flags|=98560,o=!1;else if(o=fo(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(V(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(V(317));o[xt]=t}else mr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$e(t),o=!1}else ct!==null&&(qu(ct),ct=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||fe.current&1?_e===0&&(_e=3):fc())),t.updateQueue!==null&&(t.flags|=4),$e(t),null);case 4:return vr(),Uu(e,t),e===null&&ki(t.stateNode.containerInfo),$e(t),null;case 10:return Xa(t.type._context),$e(t),null;case 17:return He(t.type)&&Jo(),$e(t),null;case 19:if(ue(fe),o=t.memoizedState,o===null)return $e(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)Wr(o,!1);else{if(_e!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ss(e),s!==null){for(t.flags|=128,Wr(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return oe(fe,fe.current&1|2),t.child}e=e.sibling}o.tail!==null&&me()>xr&&(t.flags|=128,r=!0,Wr(o,!1),t.lanes=4194304)}else{if(!r)if(e=ss(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Wr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ae)return $e(t),null}else 2*me()-o.renderingStartTime>xr&&n!==1073741824&&(t.flags|=128,r=!0,Wr(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=me(),t.sibling=null,n=fe.current,oe(fe,r?n&1|2:n&1),t):($e(t),null);case 22:case 23:return cc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ue&1073741824&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function P1(e,t){switch(Ua(t),t.tag){case 1:return He(t.type)&&Jo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vr(),ue(Ve),ue(je),Ja(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qa(t),null;case 13:if(ue(fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));mr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(fe),null;case 4:return vr(),null;case 10:return Xa(t.type._context),null;case 22:case 23:return cc(),null;case 24:return null;default:return null}}var go=!1,be=!1,T1=typeof WeakSet=="function"?WeakSet:Set,U=null;function er(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pe(e,t,r)}else n.current=null}function Wu(e,t,n){try{n()}catch(r){pe(e,t,r)}}var Qf=!1;function $1(e,t){if(Iu=Qo,e=jp(),Ha(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,u=-1,a=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(l=s+i),d!==o||r!==0&&d.nodeType!==3||(u=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++a===i&&(l=s),f===o&&++c===r&&(u=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Pu={focusedElem:e,selectionRange:n},Qo=!1,U=t;U!==null;)if(t=U,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,U=e;else for(;U!==null;){t=U;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,S=m.memoizedState,p=t.stateNode,y=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:lt(t.type,v),S);p.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(w){pe(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return m=Qf,Qf=!1,m}function ci(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Wu(t,n,o)}i=i.next}while(i!==r)}}function zs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Yu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Pg(e){var t=e.alternate;t!==null&&(e.alternate=null,Pg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xt],delete t[Ni],delete t[bu],delete t[h1],delete t[p1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Tg(e){return e.tag===5||e.tag===3||e.tag===4}function Kf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=qo));else if(r!==4&&(e=e.child,e!==null))for(Gu(e,t,n),e=e.sibling;e!==null;)Gu(e,t,n),e=e.sibling}function Xu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Xu(e,t,n),e=e.sibling;e!==null;)Xu(e,t,n),e=e.sibling}var Ce=null,ut=!1;function Yt(e,t,n){for(n=n.child;n!==null;)$g(e,t,n),n=n.sibling}function $g(e,t,n){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Is,n)}catch{}switch(n.tag){case 5:be||er(n,t);case 6:var r=Ce,i=ut;Ce=null,Yt(e,t,n),Ce=r,ut=i,Ce!==null&&(ut?(e=Ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ce.removeChild(n.stateNode));break;case 18:Ce!==null&&(ut?(e=Ce,n=n.stateNode,e.nodeType===8?Tl(e.parentNode,n):e.nodeType===1&&Tl(e,n),xi(e)):Tl(Ce,n.stateNode));break;case 4:r=Ce,i=ut,Ce=n.stateNode.containerInfo,ut=!0,Yt(e,t,n),Ce=r,ut=i;break;case 0:case 11:case 14:case 15:if(!be&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Wu(n,t,s),i=i.next}while(i!==r)}Yt(e,t,n);break;case 1:if(!be&&(er(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){pe(n,t,l)}Yt(e,t,n);break;case 21:Yt(e,t,n);break;case 22:n.mode&1?(be=(r=be)||n.memoizedState!==null,Yt(e,t,n),be=r):Yt(e,t,n);break;default:Yt(e,t,n)}}function Zf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new T1),t.forEach(function(r){var i=F1.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ot(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Ce=l.stateNode,ut=!1;break e;case 3:Ce=l.stateNode.containerInfo,ut=!0;break e;case 4:Ce=l.stateNode.containerInfo,ut=!0;break e}l=l.return}if(Ce===null)throw Error(V(160));$g(o,s,i),Ce=null,ut=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(a){pe(i,t,a)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bg(t,e),t=t.sibling}function bg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ot(t,e),vt(e),r&4){try{ci(3,e,e.return),zs(3,e)}catch(v){pe(e,e.return,v)}try{ci(5,e,e.return)}catch(v){pe(e,e.return,v)}}break;case 1:ot(t,e),vt(e),r&512&&n!==null&&er(n,n.return);break;case 5:if(ot(t,e),vt(e),r&512&&n!==null&&er(n,n.return),e.flags&32){var i=e.stateNode;try{mi(i,"")}catch(v){pe(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&ep(i,o),vu(l,s);var a=vu(l,o);for(s=0;s<u.length;s+=2){var c=u[s],d=u[s+1];c==="style"?op(i,d):c==="dangerouslySetInnerHTML"?rp(i,d):c==="children"?mi(i,d):Pa(i,c,d,a)}switch(l){case"input":hu(i,o);break;case"textarea":tp(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?ir(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?ir(i,!!o.multiple,o.defaultValue,!0):ir(i,!!o.multiple,o.multiple?[]:"",!1))}i[Ni]=o}catch(v){pe(e,e.return,v)}}break;case 6:if(ot(t,e),vt(e),r&4){if(e.stateNode===null)throw Error(V(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(v){pe(e,e.return,v)}}break;case 3:if(ot(t,e),vt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{xi(t.containerInfo)}catch(v){pe(e,e.return,v)}break;case 4:ot(t,e),vt(e);break;case 13:ot(t,e),vt(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(uc=me())),r&4&&Zf(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(be=(a=be)||c,ot(t,e),be=a):ot(t,e),vt(e),r&8192){if(a=e.memoizedState!==null,(e.stateNode.isHidden=a)&&!c&&e.mode&1)for(U=e,c=e.child;c!==null;){for(d=U=c;U!==null;){switch(f=U,h=f.child,f.tag){case 0:case 11:case 14:case 15:ci(4,f,f.return);break;case 1:er(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){pe(r,n,v)}}break;case 5:er(f,f.return);break;case 22:if(f.memoizedState!==null){Jf(d);continue}}h!==null?(h.return=f,U=h):Jf(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,a?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=d.stateNode,u=d.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=ip("display",s))}catch(v){pe(e,e.return,v)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=a?"":d.memoizedProps}catch(v){pe(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:ot(t,e),vt(e),r&4&&Zf(e);break;case 21:break;default:ot(t,e),vt(e)}}function vt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Tg(n)){var r=n;break e}n=n.return}throw Error(V(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(mi(i,""),r.flags&=-33);var o=Kf(e);Xu(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Kf(e);Gu(e,l,s);break;default:throw Error(V(161))}}catch(u){pe(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function b1(e,t,n){U=e,jg(e)}function jg(e,t,n){for(var r=(e.mode&1)!==0;U!==null;){var i=U,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||go;if(!s){var l=i.alternate,u=l!==null&&l.memoizedState!==null||be;l=go;var a=be;if(go=s,(be=u)&&!a)for(U=i;U!==null;)s=U,u=s.child,s.tag===22&&s.memoizedState!==null?ed(i):u!==null?(u.return=s,U=u):ed(i);for(;o!==null;)U=o,jg(o),o=o.sibling;U=i,go=l,be=a}qf(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,U=o):qf(e)}}function qf(e){for(;U!==null;){var t=U;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:be||zs(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!be)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:lt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&zf(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}zf(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var a=t.alternate;if(a!==null){var c=a.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&xi(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}be||t.flags&512&&Yu(t)}catch(f){pe(t,t.return,f)}}if(t===e){U=null;break}if(n=t.sibling,n!==null){n.return=t.return,U=n;break}U=t.return}}function Jf(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var n=t.sibling;if(n!==null){n.return=t.return,U=n;break}U=t.return}}function ed(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{zs(4,t)}catch(u){pe(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){pe(t,i,u)}}var o=t.return;try{Yu(t)}catch(u){pe(t,o,u)}break;case 5:var s=t.return;try{Yu(t)}catch(u){pe(t,s,u)}}}catch(u){pe(t,t.return,u)}if(t===e){U=null;break}var l=t.sibling;if(l!==null){l.return=t.return,U=l;break}U=t.return}}var j1=Math.ceil,as=Ht.ReactCurrentDispatcher,sc=Ht.ReactCurrentOwner,tt=Ht.ReactCurrentBatchConfig,te=0,Ne=null,ve=null,Me=0,Ue=0,tr=mn(0),_e=0,$i=null,Ln=0,Rs=0,lc=0,fi=null,Ae=null,uc=0,xr=1/0,Mt=null,cs=!1,Qu=null,cn=null,mo=!1,nn=null,fs=0,di=0,Ku=null,Ro=-1,Do=0;function ze(){return te&6?me():Ro!==-1?Ro:Ro=me()}function fn(e){return e.mode&1?te&2&&Me!==0?Me&-Me:m1.transition!==null?(Do===0&&(Do=yp()),Do):(e=ie,e!==0||(e=window.event,e=e===void 0?16:Sp(e.type)),e):1}function pt(e,t,n,r){if(50<di)throw di=0,Ku=null,Error(V(185));Ui(e,n,r),(!(te&2)||e!==Ne)&&(e===Ne&&(!(te&2)&&(Rs|=n),_e===4&&Jt(e,Me)),Be(e,r),n===1&&te===0&&!(t.mode&1)&&(xr=me()+500,js&&yn()))}function Be(e,t){var n=e.callbackNode;mw(e,t);var r=Xo(e,e===Ne?Me:0);if(r===0)n!==null&&af(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&af(n),t===1)e.tag===0?g1(td.bind(null,e)):Bp(td.bind(null,e)),f1(function(){!(te&6)&&yn()}),n=null;else{switch(vp(r)){case 1:n=Oa;break;case 4:n=gp;break;case 16:n=Go;break;case 536870912:n=mp;break;default:n=Go}n=Vg(n,Og.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Og(e,t){if(Ro=-1,Do=0,te&6)throw Error(V(327));var n=e.callbackNode;if(ar()&&e.callbackNode!==n)return null;var r=Xo(e,e===Ne?Me:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ds(e,r);else{t=r;var i=te;te|=2;var o=zg();(Ne!==e||Me!==t)&&(Mt=null,xr=me()+500,Mn(e,t));do try{z1();break}catch(l){Lg(e,l)}while(!0);Ga(),as.current=o,te=i,ve!==null?t=0:(Ne=null,Me=0,t=_e)}if(t!==0){if(t===2&&(i=ku(e),i!==0&&(r=i,t=Zu(e,i))),t===1)throw n=$i,Mn(e,0),Jt(e,r),Be(e,me()),n;if(t===6)Jt(e,r);else{if(i=e.current.alternate,!(r&30)&&!O1(i)&&(t=ds(e,r),t===2&&(o=ku(e),o!==0&&(r=o,t=Zu(e,o))),t===1))throw n=$i,Mn(e,0),Jt(e,r),Be(e,me()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(V(345));case 2:En(e,Ae,Mt);break;case 3:if(Jt(e,r),(r&130023424)===r&&(t=uc+500-me(),10<t)){if(Xo(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){ze(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=$u(En.bind(null,e,Ae,Mt),t);break}En(e,Ae,Mt);break;case 4:if(Jt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-ht(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*j1(r/1960))-r,10<r){e.timeoutHandle=$u(En.bind(null,e,Ae,Mt),r);break}En(e,Ae,Mt);break;case 5:En(e,Ae,Mt);break;default:throw Error(V(329))}}}return Be(e,me()),e.callbackNode===n?Og.bind(null,e):null}function Zu(e,t){var n=fi;return e.current.memoizedState.isDehydrated&&(Mn(e,t).flags|=256),e=ds(e,t),e!==2&&(t=Ae,Ae=n,t!==null&&qu(t)),e}function qu(e){Ae===null?Ae=e:Ae.push.apply(Ae,e)}function O1(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!gt(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Jt(e,t){for(t&=~lc,t&=~Rs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ht(t),r=1<<n;e[n]=-1,t&=~r}}function td(e){if(te&6)throw Error(V(327));ar();var t=Xo(e,0);if(!(t&1))return Be(e,me()),null;var n=ds(e,t);if(e.tag!==0&&n===2){var r=ku(e);r!==0&&(t=r,n=Zu(e,r))}if(n===1)throw n=$i,Mn(e,0),Jt(e,t),Be(e,me()),n;if(n===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,En(e,Ae,Mt),Be(e,me()),null}function ac(e,t){var n=te;te|=1;try{return e(t)}finally{te=n,te===0&&(xr=me()+500,js&&yn())}}function zn(e){nn!==null&&nn.tag===0&&!(te&6)&&ar();var t=te;te|=1;var n=tt.transition,r=ie;try{if(tt.transition=null,ie=1,e)return e()}finally{ie=r,tt.transition=n,te=t,!(te&6)&&yn()}}function cc(){Ue=tr.current,ue(tr)}function Mn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,c1(n)),ve!==null)for(n=ve.return;n!==null;){var r=n;switch(Ua(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Jo();break;case 3:vr(),ue(Ve),ue(je),Ja();break;case 5:qa(r);break;case 4:vr();break;case 13:ue(fe);break;case 19:ue(fe);break;case 10:Xa(r.type._context);break;case 22:case 23:cc()}n=n.return}if(Ne=e,ve=e=dn(e.current,null),Me=Ue=t,_e=0,$i=null,lc=Rs=Ln=0,Ae=fi=null,Sn!==null){for(t=0;t<Sn.length;t++)if(n=Sn[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}Sn=null}return e}function Lg(e,t){do{var n=ve;try{if(Ga(),Oo.current=us,ls){for(var r=de.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}ls=!1}if(On=0,ke=Ee=de=null,ai=!1,Ii=0,sc.current=null,n===null||n.return===null){_e=1,$i=t,ve=null;break}e:{var o=e,s=n.return,l=n,u=t;if(t=Me,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var a=u,c=l,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=Hf(s);if(h!==null){h.flags&=-257,Bf(h,s,l,o,t),h.mode&1&&Vf(o,a,t),t=h,u=a;var m=t.updateQueue;if(m===null){var v=new Set;v.add(u),t.updateQueue=v}else m.add(u);break e}else{if(!(t&1)){Vf(o,a,t),fc();break e}u=Error(V(426))}}else if(ae&&l.mode&1){var S=Hf(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Bf(S,s,l,o,t),Wa(wr(u,l));break e}}o=u=wr(u,l),_e!==4&&(_e=2),fi===null?fi=[o]:fi.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var p=vg(o,u,t);Lf(o,p);break e;case 1:l=u;var y=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(cn===null||!cn.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=wg(o,l,t);Lf(o,w);break e}}o=o.return}while(o!==null)}Dg(n)}catch(N){t=N,ve===n&&n!==null&&(ve=n=n.return);continue}break}while(!0)}function zg(){var e=as.current;return as.current=us,e===null?us:e}function fc(){(_e===0||_e===3||_e===2)&&(_e=4),Ne===null||!(Ln&268435455)&&!(Rs&268435455)||Jt(Ne,Me)}function ds(e,t){var n=te;te|=2;var r=zg();(Ne!==e||Me!==t)&&(Mt=null,Mn(e,t));do try{L1();break}catch(i){Lg(e,i)}while(!0);if(Ga(),te=n,as.current=r,ve!==null)throw Error(V(261));return Ne=null,Me=0,_e}function L1(){for(;ve!==null;)Rg(ve)}function z1(){for(;ve!==null&&!lw();)Rg(ve)}function Rg(e){var t=Fg(e.alternate,e,Ue);e.memoizedProps=e.pendingProps,t===null?Dg(e):ve=t,sc.current=null}function Dg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=P1(n,t),n!==null){n.flags&=32767,ve=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{_e=6,ve=null;return}}else if(n=I1(n,t,Ue),n!==null){ve=n;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);_e===0&&(_e=5)}function En(e,t,n){var r=ie,i=tt.transition;try{tt.transition=null,ie=1,R1(e,t,n,r)}finally{tt.transition=i,ie=r}return null}function R1(e,t,n,r){do ar();while(nn!==null);if(te&6)throw Error(V(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(V(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(yw(e,o),e===Ne&&(ve=Ne=null,Me=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||mo||(mo=!0,Vg(Go,function(){return ar(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=tt.transition,tt.transition=null;var s=ie;ie=1;var l=te;te|=4,sc.current=null,$1(e,n),bg(n,e),r1(Pu),Qo=!!Iu,Pu=Iu=null,e.current=n,b1(n),uw(),te=l,ie=s,tt.transition=o}else e.current=n;if(mo&&(mo=!1,nn=e,fs=i),o=e.pendingLanes,o===0&&(cn=null),fw(n.stateNode),Be(e,me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(cs)throw cs=!1,e=Qu,Qu=null,e;return fs&1&&e.tag!==0&&ar(),o=e.pendingLanes,o&1?e===Ku?di++:(di=0,Ku=e):di=0,yn(),null}function ar(){if(nn!==null){var e=vp(fs),t=tt.transition,n=ie;try{if(tt.transition=null,ie=16>e?16:e,nn===null)var r=!1;else{if(e=nn,nn=null,fs=0,te&6)throw Error(V(331));var i=te;for(te|=4,U=e.current;U!==null;){var o=U,s=o.child;if(U.flags&16){var l=o.deletions;if(l!==null){for(var u=0;u<l.length;u++){var a=l[u];for(U=a;U!==null;){var c=U;switch(c.tag){case 0:case 11:case 15:ci(8,c,o)}var d=c.child;if(d!==null)d.return=c,U=d;else for(;U!==null;){c=U;var f=c.sibling,h=c.return;if(Pg(c),c===a){U=null;break}if(f!==null){f.return=h,U=f;break}U=h}}}var m=o.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var S=v.sibling;v.sibling=null,v=S}while(v!==null)}}U=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,U=s;else e:for(;U!==null;){if(o=U,o.flags&2048)switch(o.tag){case 0:case 11:case 15:ci(9,o,o.return)}var p=o.sibling;if(p!==null){p.return=o.return,U=p;break e}U=o.return}}var y=e.current;for(U=y;U!==null;){s=U;var g=s.child;if(s.subtreeFlags&2064&&g!==null)g.return=s,U=g;else e:for(s=y;U!==null;){if(l=U,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:zs(9,l)}}catch(N){pe(l,l.return,N)}if(l===s){U=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,U=w;break e}U=l.return}}if(te=i,yn(),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Is,e)}catch{}r=!0}return r}finally{ie=n,tt.transition=t}}return!1}function nd(e,t,n){t=wr(n,t),t=vg(e,t,1),e=an(e,t,1),t=ze(),e!==null&&(Ui(e,1,t),Be(e,t))}function pe(e,t,n){if(e.tag===3)nd(e,e,n);else for(;t!==null;){if(t.tag===3){nd(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(cn===null||!cn.has(r))){e=wr(n,e),e=wg(t,e,1),t=an(t,e,1),e=ze(),t!==null&&(Ui(t,1,e),Be(t,e));break}}t=t.return}}function D1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ze(),e.pingedLanes|=e.suspendedLanes&n,Ne===e&&(Me&n)===n&&(_e===4||_e===3&&(Me&130023424)===Me&&500>me()-uc?Mn(e,0):lc|=n),Be(e,t)}function Ag(e,t){t===0&&(e.mode&1?(t=oo,oo<<=1,!(oo&130023424)&&(oo=4194304)):t=1);var n=ze();e=At(e,t),e!==null&&(Ui(e,t,n),Be(e,n))}function A1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ag(e,n)}function F1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(V(314))}r!==null&&r.delete(t),Ag(e,n)}var Fg;Fg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ve.current)Fe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Fe=!1,M1(e,t,n);Fe=!!(e.flags&131072)}else Fe=!1,ae&&t.flags&1048576&&Up(t,ns,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zo(e,t),e=t.pendingProps;var i=gr(t,je.current);ur(t,n),i=tc(null,t,r,e,i,n);var o=nc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,He(r)?(o=!0,es(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ka(t),i.updater=Ls,t.stateNode=i,i._reactInternals=t,Du(t,r,e,n),t=Vu(null,t,r,!0,o,n)):(t.tag=0,ae&&o&&Ba(t),Le(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zo(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=H1(r),e=lt(r,e),i){case 0:t=Fu(null,t,r,e,n);break e;case 1:t=Yf(null,t,r,e,n);break e;case 11:t=Uf(null,t,r,e,n);break e;case 14:t=Wf(null,t,r,lt(r.type,e),n);break e}throw Error(V(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lt(r,i),Fu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lt(r,i),Yf(e,t,r,i,n);case 3:e:{if(kg(t),e===null)throw Error(V(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Kp(e,t),os(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=wr(Error(V(423)),t),t=Gf(e,t,r,n,i);break e}else if(r!==i){i=wr(Error(V(424)),t),t=Gf(e,t,r,n,i);break e}else for(Ye=un(t.stateNode.containerInfo.firstChild),Ge=t,ae=!0,ct=null,n=Xp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(mr(),r===i){t=Ft(e,t,n);break e}Le(e,t,r,n)}t=t.child}return t;case 5:return Zp(t),e===null&&Lu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Tu(r,i)?s=null:o!==null&&Tu(r,o)&&(t.flags|=32),_g(e,t),Le(e,t,s,n),t.child;case 6:return e===null&&Lu(t),null;case 13:return Sg(e,t,n);case 4:return Za(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yr(t,null,r,n):Le(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lt(r,i),Uf(e,t,r,i,n);case 7:return Le(e,t,t.pendingProps,n),t.child;case 8:return Le(e,t,t.pendingProps.children,n),t.child;case 12:return Le(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,oe(rs,r._currentValue),r._currentValue=s,o!==null)if(gt(o.value,s)){if(o.children===i.children&&!Ve.current){t=Ft(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=Ot(-1,n&-n),u.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var c=a.pending;c===null?u.next=u:(u.next=c.next,c.next=u),a.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),zu(o.return,n,t),l.lanes|=n;break}u=u.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(V(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),zu(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Le(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ur(t,n),i=nt(i),r=r(i),t.flags|=1,Le(e,t,r,n),t.child;case 14:return r=t.type,i=lt(r,t.pendingProps),i=lt(r.type,i),Wf(e,t,r,i,n);case 15:return xg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lt(r,i),zo(e,t),t.tag=1,He(r)?(e=!0,es(t)):e=!1,ur(t,n),yg(t,r,i),Du(t,r,i,n),Vu(null,t,r,!0,e,n);case 19:return Ng(e,t,n);case 22:return Eg(e,t,n)}throw Error(V(156,t.tag))};function Vg(e,t){return pp(e,t)}function V1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function et(e,t,n,r){return new V1(e,t,n,r)}function dc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function H1(e){if(typeof e=="function")return dc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$a)return 11;if(e===ba)return 14}return 2}function dn(e,t){var n=e.alternate;return n===null?(n=et(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ao(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")dc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Wn:return In(n.children,i,o,t);case Ta:s=8,i|=8;break;case uu:return e=et(12,n,t,i|2),e.elementType=uu,e.lanes=o,e;case au:return e=et(13,n,t,i),e.elementType=au,e.lanes=o,e;case cu:return e=et(19,n,t,i),e.elementType=cu,e.lanes=o,e;case Zh:return Ds(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qh:s=10;break e;case Kh:s=9;break e;case $a:s=11;break e;case ba:s=14;break e;case Qt:s=16,r=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=et(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function In(e,t,n,r){return e=et(7,e,r,t),e.lanes=n,e}function Ds(e,t,n,r){return e=et(22,e,r,t),e.elementType=Zh,e.lanes=n,e.stateNode={isHidden:!1},e}function Dl(e,t,n){return e=et(6,e,null,t),e.lanes=n,e}function Al(e,t,n){return t=et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function B1(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wl(0),this.expirationTimes=wl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wl(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hc(e,t,n,r,i,o,s,l,u){return e=new B1(e,t,n,l,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=et(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ka(o),e}function U1(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Un,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Hg(e){if(!e)return pn;e=e._reactInternals;e:{if(Vn(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(He(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var n=e.type;if(He(n))return Hp(e,n,t)}return t}function Bg(e,t,n,r,i,o,s,l,u){return e=hc(n,r,!0,e,i,o,s,l,u),e.context=Hg(null),n=e.current,r=ze(),i=fn(n),o=Ot(r,i),o.callback=t??null,an(n,o,i),e.current.lanes=i,Ui(e,i,r),Be(e,r),e}function As(e,t,n,r){var i=t.current,o=ze(),s=fn(i);return n=Hg(n),t.context===null?t.context=n:t.pendingContext=n,t=Ot(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=an(i,t,s),e!==null&&(pt(e,i,s,o),jo(e,i,s)),s}function hs(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function rd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pc(e,t){rd(e,t),(e=e.alternate)&&rd(e,t)}function W1(){return null}var Ug=typeof reportError=="function"?reportError:function(e){console.error(e)};function gc(e){this._internalRoot=e}Fs.prototype.render=gc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));As(e,t,null,null)};Fs.prototype.unmount=gc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zn(function(){As(null,e,null,null)}),t[Dt]=null}};function Fs(e){this._internalRoot=e}Fs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ep();e={blockedOn:null,target:e,priority:t};for(var n=0;n<qt.length&&t!==0&&t<qt[n].priority;n++);qt.splice(n,0,e),n===0&&kp(e)}};function mc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Vs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function id(){}function Y1(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var a=hs(s);o.call(a)}}var s=Bg(t,r,e,0,null,!1,!1,"",id);return e._reactRootContainer=s,e[Dt]=s.current,ki(e.nodeType===8?e.parentNode:e),zn(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var a=hs(u);l.call(a)}}var u=hc(e,0,!1,null,null,!1,!1,"",id);return e._reactRootContainer=u,e[Dt]=u.current,ki(e.nodeType===8?e.parentNode:e),zn(function(){As(t,u,n,r)}),u}function Hs(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var l=i;i=function(){var u=hs(s);l.call(u)}}As(t,s,e,i)}else s=Y1(n,t,e,i,r);return hs(s)}wp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=qr(t.pendingLanes);n!==0&&(La(t,n|1),Be(t,me()),!(te&6)&&(xr=me()+500,yn()))}break;case 13:zn(function(){var r=At(e,1);if(r!==null){var i=ze();pt(r,e,1,i)}}),pc(e,1)}};za=function(e){if(e.tag===13){var t=At(e,134217728);if(t!==null){var n=ze();pt(t,e,134217728,n)}pc(e,134217728)}};xp=function(e){if(e.tag===13){var t=fn(e),n=At(e,t);if(n!==null){var r=ze();pt(n,e,t,r)}pc(e,t)}};Ep=function(){return ie};_p=function(e,t){var n=ie;try{return ie=e,t()}finally{ie=n}};xu=function(e,t,n){switch(t){case"input":if(hu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=bs(r);if(!i)throw Error(V(90));Jh(r),hu(r,i)}}}break;case"textarea":tp(e,n);break;case"select":t=n.value,t!=null&&ir(e,!!n.multiple,t,!1)}};up=ac;ap=zn;var G1={usingClientEntryPoint:!1,Events:[Yi,Qn,bs,sp,lp,ac]},Yr={findFiberByHostInstance:kn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},X1={bundleType:Yr.bundleType,version:Yr.version,rendererPackageName:Yr.rendererPackageName,rendererConfig:Yr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ht.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=dp(e),e===null?null:e.stateNode},findFiberByHostInstance:Yr.findFiberByHostInstance||W1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yo.isDisabled&&yo.supportsFiber)try{Is=yo.inject(X1),Et=yo}catch{}}Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=G1;Ke.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mc(t))throw Error(V(200));return U1(e,t,null,n)};Ke.createRoot=function(e,t){if(!mc(e))throw Error(V(299));var n=!1,r="",i=Ug;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=hc(e,1,!1,null,null,n,!1,r,i),e[Dt]=t.current,ki(e.nodeType===8?e.parentNode:e),new gc(t)};Ke.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=dp(t),e=e===null?null:e.stateNode,e};Ke.flushSync=function(e){return zn(e)};Ke.hydrate=function(e,t,n){if(!Vs(t))throw Error(V(200));return Hs(null,e,t,!0,n)};Ke.hydrateRoot=function(e,t,n){if(!mc(e))throw Error(V(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=Ug;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Bg(t,null,e,1,n??null,i,!1,o,s),e[Dt]=t.current,ki(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Fs(t)};Ke.render=function(e,t,n){if(!Vs(t))throw Error(V(200));return Hs(null,e,t,!1,n)};Ke.unmountComponentAtNode=function(e){if(!Vs(e))throw Error(V(40));return e._reactRootContainer?(zn(function(){Hs(null,null,e,!1,function(){e._reactRootContainer=null,e[Dt]=null})}),!0):!1};Ke.unstable_batchedUpdates=ac;Ke.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Vs(n))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return Hs(e,t,n,!1,r)};Ke.version="18.3.1-next-f1338f8080-20240426";function Wg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wg)}catch(e){console.error(e)}}Wg(),Wh.exports=Ke;var Q1=Wh.exports,Yg,od=Q1;Yg=od.createRoot,od.hydrateRoot;class Ju extends Error{constructor(t,n){super(`HTTP ${t}`),this.status=t,this.body=n}}async function st(e,t,n){const r=await fetch(t,{method:e,headers:n===void 0?void 0:{"Content-Type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.text(),o=i?JSON.parse(i):void 0;if(!r.ok)throw new Ju(r.status,o);return o}const Gr=e=>`/api/graphs/${encodeURIComponent(e)}`,Oe={functions:()=>st("GET","/api/functions"),listGraphs:async()=>(await st("GET","/api/graphs")).graphs,getGraph:e=>st("GET",Gr(e)),putGraph:(e,t)=>st("PUT",Gr(e),t),deleteGraph:e=>st("DELETE",Gr(e)),validate:e=>st("POST","/api/validate",e),listRuns:async e=>(await st("GET",`${Gr(e)}/runs`)).runs,startRun:(e,t)=>st("POST",`${Gr(e)}/runs`,{inputs:t}),stopRun:e=>st("POST",`/api/runs/${e}/stop`),getRun:e=>st("GET",`/api/runs/${e}`),getExecution:(e,t,n)=>st("GET",`/api/runs/${e}/nodes/${encodeURIComponent(t)}/${n}`)};function K1(e,t=()=>{}){let n,r=!1,i;const o=s=>{const l=location.protocol==="https:"?"wss":"ws";n=new WebSocket(`${l}://${location.host}/api/events`),s&&(n.onopen=t),n.onmessage=u=>e(JSON.parse(u.data)),n.onclose=()=>{r||(i=setTimeout(o,1e3,!0))}};return o(!1),()=>{r=!0,clearTimeout(i),n==null||n.close()}}function xe(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=xe(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Z1={value:()=>{}};function Bs(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Fo(n)}function Fo(e){this._=e}function q1(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Fo.prototype=Bs.prototype={constructor:Fo,on:function(e,t){var n=this._,r=q1(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=J1(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=sd(n[i],e.name,t);else if(t==null)for(i in n)n[i]=sd(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Fo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function J1(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function sd(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Z1,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ea="http://www.w3.org/1999/xhtml",ld={svg:"http://www.w3.org/2000/svg",xhtml:ea,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Us(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ld.hasOwnProperty(t)?{space:ld[t],local:e}:e}function ex(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ea&&t.documentElement.namespaceURI===ea?t.createElement(e):t.createElementNS(n,e)}}function tx(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gg(e){var t=Us(e);return(t.local?tx:ex)(t)}function nx(){}function yc(e){return e==null?nx:function(){return this.querySelector(e)}}function rx(e){typeof e!="function"&&(e=yc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=new Array(s),u,a,c=0;c<s;++c)(u=o[c])&&(a=e.call(u,u.__data__,c,o))&&("__data__"in u&&(a.__data__=u.__data__),l[c]=a);return new Qe(r,this._parents)}function ix(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ox(){return[]}function Xg(e){return e==null?ox:function(){return this.querySelectorAll(e)}}function sx(e){return function(){return ix(e.apply(this,arguments))}}function lx(e){typeof e=="function"?e=sx(e):e=Xg(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],l=s.length,u,a=0;a<l;++a)(u=s[a])&&(r.push(e.call(u,u.__data__,a,s)),i.push(u));return new Qe(r,i)}function Qg(e){return function(){return this.matches(e)}}function Kg(e){return function(t){return t.matches(e)}}var ux=Array.prototype.find;function ax(e){return function(){return ux.call(this.children,e)}}function cx(){return this.firstElementChild}function fx(e){return this.select(e==null?cx:ax(typeof e=="function"?e:Kg(e)))}var dx=Array.prototype.filter;function hx(){return Array.from(this.children)}function px(e){return function(){return dx.call(this.children,e)}}function gx(e){return this.selectAll(e==null?hx:px(typeof e=="function"?e:Kg(e)))}function mx(e){typeof e!="function"&&(e=Qg(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=[],u,a=0;a<s;++a)(u=o[a])&&e.call(u,u.__data__,a,o)&&l.push(u);return new Qe(r,this._parents)}function Zg(e){return new Array(e.length)}function yx(){return new Qe(this._enter||this._groups.map(Zg),this._parents)}function ps(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ps.prototype={constructor:ps,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 vx(e){return function(){return e}}function wx(e,t,n,r,i,o){for(var s=0,l,u=t.length,a=o.length;s<a;++s)(l=t[s])?(l.__data__=o[s],r[s]=l):n[s]=new ps(e,o[s]);for(;s<u;++s)(l=t[s])&&(i[s]=l)}function xx(e,t,n,r,i,o,s){var l,u,a=new Map,c=t.length,d=o.length,f=new Array(c),h;for(l=0;l<c;++l)(u=t[l])&&(f[l]=h=s.call(u,u.__data__,l,t)+"",a.has(h)?i[l]=u:a.set(h,u));for(l=0;l<d;++l)h=s.call(e,o[l],l,o)+"",(u=a.get(h))?(r[l]=u,u.__data__=o[l],a.delete(h)):n[l]=new ps(e,o[l]);for(l=0;l<c;++l)(u=t[l])&&a.get(f[l])===u&&(i[l]=u)}function Ex(e){return e.__data__}function _x(e,t){if(!arguments.length)return Array.from(this,Ex);var n=t?xx:wx,r=this._parents,i=this._groups;typeof e!="function"&&(e=vx(e));for(var o=i.length,s=new Array(o),l=new Array(o),u=new Array(o),a=0;a<o;++a){var c=r[a],d=i[a],f=d.length,h=kx(e.call(c,c&&c.__data__,a,r)),m=h.length,v=l[a]=new Array(m),S=s[a]=new Array(m),p=u[a]=new Array(f);n(c,d,v,S,p,h,t);for(var y=0,g=0,w,N;y<m;++y)if(w=v[y]){for(y>=g&&(g=y+1);!(N=S[g])&&++g<m;);w._next=N||null}}return s=new Qe(s,r),s._enter=l,s._exit=u,s}function kx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Sx(){return new Qe(this._exit||this._groups.map(Zg),this._parents)}function Nx(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Cx(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),l=new Array(i),u=0;u<s;++u)for(var a=n[u],c=r[u],d=a.length,f=l[u]=new Array(d),h,m=0;m<d;++m)(h=a[m]||c[m])&&(f[m]=h);for(;u<i;++u)l[u]=n[u];return new Qe(l,this._parents)}function Mx(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Ix(e){e||(e=Px);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],l=s.length,u=i[o]=new Array(l),a,c=0;c<l;++c)(a=s[c])&&(u[c]=a);u.sort(t)}return new Qe(i,this._parents).order()}function Px(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Tx(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function $x(){return Array.from(this)}function bx(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function jx(){let e=0;for(const t of this)++e;return e}function Ox(){return!this.node()}function Lx(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,l;o<s;++o)(l=i[o])&&e.call(l,l.__data__,o,i);return this}function zx(e){return function(){this.removeAttribute(e)}}function Rx(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dx(e,t){return function(){this.setAttribute(e,t)}}function Ax(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Fx(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Vx(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 Hx(e,t){var n=Us(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Rx:zx:typeof t=="function"?n.local?Vx:Fx:n.local?Ax:Dx)(n,t))}function qg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Bx(e){return function(){this.style.removeProperty(e)}}function Ux(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Wx(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Yx(e,t,n){return arguments.length>1?this.each((t==null?Bx:typeof t=="function"?Wx:Ux)(e,t,n??"")):Er(this.node(),e)}function Er(e,t){return e.style.getPropertyValue(t)||qg(e).getComputedStyle(e,null).getPropertyValue(t)}function Gx(e){return function(){delete this[e]}}function Xx(e,t){return function(){this[e]=t}}function Qx(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Kx(e,t){return arguments.length>1?this.each((t==null?Gx:typeof t=="function"?Qx:Xx)(e,t)):this.node()[e]}function Jg(e){return e.trim().split(/^|\s+/)}function vc(e){return e.classList||new em(e)}function em(e){this._node=e,this._names=Jg(e.getAttribute("class")||"")}em.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 tm(e,t){for(var n=vc(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function nm(e,t){for(var n=vc(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Zx(e){return function(){tm(this,e)}}function qx(e){return function(){nm(this,e)}}function Jx(e,t){return function(){(t.apply(this,arguments)?tm:nm)(this,e)}}function eE(e,t){var n=Jg(e+"");if(arguments.length<2){for(var r=vc(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Jx:t?Zx:qx)(n,t))}function tE(){this.textContent=""}function nE(e){return function(){this.textContent=e}}function rE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function iE(e){return arguments.length?this.each(e==null?tE:(typeof e=="function"?rE:nE)(e)):this.node().textContent}function oE(){this.innerHTML=""}function sE(e){return function(){this.innerHTML=e}}function lE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function uE(e){return arguments.length?this.each(e==null?oE:(typeof e=="function"?lE:sE)(e)):this.node().innerHTML}function aE(){this.nextSibling&&this.parentNode.appendChild(this)}function cE(){return this.each(aE)}function fE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function dE(){return this.each(fE)}function hE(e){var t=typeof e=="function"?e:Gg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function pE(){return null}function gE(e,t){var n=typeof e=="function"?e:Gg(e),r=t==null?pE:typeof t=="function"?t:yc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function mE(){var e=this.parentNode;e&&e.removeChild(this)}function yE(){return this.each(mE)}function vE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function wE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xE(e){return this.select(e?wE:vE)}function EE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function _E(e){return function(t){e.call(this,t,this.__data__)}}function kE(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function SE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function NE(e,t,n){return function(){var r=this.__on,i,o=_E(t);if(r){for(var s=0,l=r.length;s<l;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function CE(e,t,n){var r=kE(e+""),i,o=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,a=l.length,c;u<a;++u)for(i=0,c=l[u];i<o;++i)if((s=r[i]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?NE:SE,i=0;i<o;++i)this.each(l(r[i],t,n));return this}function rm(e,t,n){var r=qg(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function ME(e,t){return function(){return rm(this,e,t)}}function IE(e,t){return function(){return rm(this,e,t.apply(this,arguments))}}function PE(e,t){return this.each((typeof t=="function"?IE:ME)(e,t))}function*TE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var im=[null];function Qe(e,t){this._groups=e,this._parents=t}function Xi(){return new Qe([[document.documentElement]],im)}function $E(){return this}Qe.prototype=Xi.prototype={constructor:Qe,select:rx,selectAll:lx,selectChild:fx,selectChildren:gx,filter:mx,data:_x,enter:yx,exit:Sx,join:Nx,merge:Cx,selection:$E,order:Mx,sort:Ix,call:Tx,nodes:$x,node:bx,size:jx,empty:Ox,each:Lx,attr:Hx,style:Yx,property:Kx,classed:eE,text:iE,html:uE,raise:cE,lower:dE,append:hE,insert:gE,remove:yE,clone:xE,datum:EE,on:CE,dispatch:PE,[Symbol.iterator]:TE};function We(e){return typeof e=="string"?new Qe([[document.querySelector(e)]],[document.documentElement]):new Qe([[e]],im)}var bE=0;function ud(){this._="@"+(++bE).toString(36)}ud.prototype={constructor:ud,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function jE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function at(e,t){if(e=jE(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const OE={passive:!1},bi={capture:!0,passive:!1};function Fl(e){e.stopImmediatePropagation()}function cr(e){e.preventDefault(),e.stopImmediatePropagation()}function om(e){var t=e.document.documentElement,n=We(e).on("dragstart.drag",cr,bi);"onselectstart"in t?n.on("selectstart.drag",cr,bi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function sm(e,t){var n=e.document.documentElement,r=We(e).on("dragstart.drag",null);t&&(r.on("click.drag",cr,bi),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var vo=e=>()=>e;function ta(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:l,dx:u,dy:a,dispatch:c}){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:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:a,enumerable:!0,configurable:!0},_:{value:c}})}ta.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function LE(e){return!e.ctrlKey&&!e.button}function zE(){return this.parentNode}function RE(e,t){return t??{x:e.x,y:e.y}}function DE(){return navigator.maxTouchPoints||"ontouchstart"in this}function lm(){var e=LE,t=zE,n=RE,r=DE,i={},o=Bs("start","drag","end"),s=0,l,u,a,c,d=0;function f(w){w.on("mousedown.drag",h).filter(r).on("touchstart.drag",S).on("touchmove.drag",p,OE).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,N){if(!(c||!e.call(this,w,N))){var P=g(this,t.call(this,w,N),w,N,"mouse");P&&(We(w.view).on("mousemove.drag",m,bi).on("mouseup.drag",v,bi),om(w.view),Fl(w),a=!1,l=w.clientX,u=w.clientY,P("start",w))}}function m(w){if(cr(w),!a){var N=w.clientX-l,P=w.clientY-u;a=N*N+P*P>d}i.mouse("drag",w)}function v(w){We(w.view).on("mousemove.drag mouseup.drag",null),sm(w.view,a),cr(w),i.mouse("end",w)}function S(w,N){if(e.call(this,w,N)){var P=w.changedTouches,C=t.call(this,w,N),T=P.length,L,j;for(L=0;L<T;++L)(j=g(this,C,w,N,P[L].identifier,P[L]))&&(Fl(w),j("start",w,P[L]))}}function p(w){var N=w.changedTouches,P=N.length,C,T;for(C=0;C<P;++C)(T=i[N[C].identifier])&&(cr(w),T("drag",w,N[C]))}function y(w){var N=w.changedTouches,P=N.length,C,T;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),C=0;C<P;++C)(T=i[N[C].identifier])&&(Fl(w),T("end",w,N[C]))}function g(w,N,P,C,T,L){var j=o.copy(),A=at(L||P,N),D,R,_;if((_=n.call(w,new ta("beforestart",{sourceEvent:P,target:f,identifier:T,active:s,x:A[0],y:A[1],dx:0,dy:0,dispatch:j}),C))!=null)return D=_.x-A[0]||0,R=_.y-A[1]||0,function O(E,I,k){var M=A,$;switch(E){case"start":i[T]=O,$=s++;break;case"end":delete i[T],--s;case"drag":A=at(k||I,N),$=s;break}j.call(E,w,new ta(E,{sourceEvent:I,subject:_,target:f,identifier:T,active:$,x:A[0]+D,y:A[1]+R,dx:A[0]-M[0],dy:A[1]-M[1],dispatch:j}),C)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:vo(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:vo(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:vo(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:vo(!!w),f):r},f.on=function(){var w=o.on.apply(o,arguments);return w===o?f:w},f.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,f):Math.sqrt(d)},f}function jr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Qi(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function vn(){}var Rn=.7,_r=1/Rn,fr="\\s*([+-]?\\d+)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",kt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",AE=/^#([0-9a-f]{3,8})$/,FE=new RegExp(`^rgb\\(${fr},${fr},${fr}\\)$`),VE=new RegExp(`^rgb\\(${kt},${kt},${kt}\\)$`),HE=new RegExp(`^rgba\\(${fr},${fr},${fr},${ji}\\)$`),BE=new RegExp(`^rgba\\(${kt},${kt},${kt},${ji}\\)$`),UE=new RegExp(`^hsl\\(${ji},${kt},${kt}\\)$`),WE=new RegExp(`^hsla\\(${ji},${kt},${kt},${ji}\\)$`),ad={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};jr(vn,Oi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:cd,formatHex:cd,formatHex8:YE,formatHsl:GE,formatRgb:fd,toString:fd});function cd(){return this.rgb().formatHex()}function YE(){return this.rgb().formatHex8()}function GE(){return um(this).formatHsl()}function fd(){return this.rgb().formatRgb()}function Oi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=AE.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?dd(t):n===3?new Se(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?wo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?wo(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=FE.exec(e))?new Se(t[1],t[2],t[3],1):(t=VE.exec(e))?new Se(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=HE.exec(e))?wo(t[1],t[2],t[3],t[4]):(t=BE.exec(e))?wo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=UE.exec(e))?gd(t[1],t[2]/100,t[3]/100,1):(t=WE.exec(e))?gd(t[1],t[2]/100,t[3]/100,t[4]):ad.hasOwnProperty(e)?dd(ad[e]):e==="transparent"?new Se(NaN,NaN,NaN,0):null}function dd(e){return new Se(e>>16&255,e>>8&255,e&255,1)}function wo(e,t,n,r){return r<=0&&(e=t=n=NaN),new Se(e,t,n,r)}function wc(e){return e instanceof vn||(e=Oi(e)),e?(e=e.rgb(),new Se(e.r,e.g,e.b,e.opacity)):new Se}function na(e,t,n,r){return arguments.length===1?wc(e):new Se(e,t,n,r??1)}function Se(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}jr(Se,na,Qi(vn,{brighter(e){return e=e==null?_r:Math.pow(_r,e),new Se(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Rn:Math.pow(Rn,e),new Se(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Se(Pn(this.r),Pn(this.g),Pn(this.b),gs(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:hd,formatHex:hd,formatHex8:XE,formatRgb:pd,toString:pd}));function hd(){return`#${Cn(this.r)}${Cn(this.g)}${Cn(this.b)}`}function XE(){return`#${Cn(this.r)}${Cn(this.g)}${Cn(this.b)}${Cn((isNaN(this.opacity)?1:this.opacity)*255)}`}function pd(){const e=gs(this.opacity);return`${e===1?"rgb(":"rgba("}${Pn(this.r)}, ${Pn(this.g)}, ${Pn(this.b)}${e===1?")":`, ${e})`}`}function gs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cn(e){return e=Pn(e),(e<16?"0":"")+e.toString(16)}function gd(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ft(e,t,n,r)}function um(e){if(e instanceof ft)return new ft(e.h,e.s,e.l,e.opacity);if(e instanceof vn||(e=Oi(e)),!e)return new ft;if(e instanceof ft)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,l=o-i,u=(o+i)/2;return l?(t===o?s=(n-r)/l+(n<r)*6:n===o?s=(r-t)/l+2:s=(t-n)/l+4,l/=u<.5?o+i:2-o-i,s*=60):l=u>0&&u<1?0:s,new ft(s,l,u,e.opacity)}function QE(e,t,n,r){return arguments.length===1?um(e):new ft(e,t,n,r??1)}function ft(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jr(ft,QE,Qi(vn,{brighter(e){return e=e==null?_r:Math.pow(_r,e),new ft(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Rn:Math.pow(Rn,e),new ft(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Se(Vl(e>=240?e-240:e+120,i,r),Vl(e,i,r),Vl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ft(md(this.h),xo(this.s),xo(this.l),gs(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=gs(this.opacity);return`${e===1?"hsl(":"hsla("}${md(this.h)}, ${xo(this.s)*100}%, ${xo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function md(e){return e=(e||0)%360,e<0?e+360:e}function xo(e){return Math.max(0,Math.min(1,e||0))}function Vl(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 am=Math.PI/180,cm=180/Math.PI,ms=18,fm=.96422,dm=1,hm=.82521,pm=4/29,dr=6/29,gm=3*dr*dr,KE=dr*dr*dr;function mm(e){if(e instanceof St)return new St(e.l,e.a,e.b,e.opacity);if(e instanceof bt)return ym(e);e instanceof Se||(e=wc(e));var t=Wl(e.r),n=Wl(e.g),r=Wl(e.b),i=Hl((.2225045*t+.7168786*n+.0606169*r)/dm),o,s;return t===n&&n===r?o=s=i:(o=Hl((.4360747*t+.3850649*n+.1430804*r)/fm),s=Hl((.0139322*t+.0971045*n+.7141733*r)/hm)),new St(116*i-16,500*(o-i),200*(i-s),e.opacity)}function ZE(e,t,n,r){return arguments.length===1?mm(e):new St(e,t,n,r??1)}function St(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}jr(St,ZE,Qi(vn,{brighter(e){return new St(this.l+ms*(e??1),this.a,this.b,this.opacity)},darker(e){return new St(this.l-ms*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=fm*Bl(t),e=dm*Bl(e),n=hm*Bl(n),new Se(Ul(3.1338561*t-1.6168667*e-.4906146*n),Ul(-.9787684*t+1.9161415*e+.033454*n),Ul(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Hl(e){return e>KE?Math.pow(e,1/3):e/gm+pm}function Bl(e){return e>dr?e*e*e:gm*(e-pm)}function Ul(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Wl(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function qE(e){if(e instanceof bt)return new bt(e.h,e.c,e.l,e.opacity);if(e instanceof St||(e=mm(e)),e.a===0&&e.b===0)return new bt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*cm;return new bt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function JE(e,t,n,r){return arguments.length===1?qE(e):new bt(e,t,n,r??1)}function bt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function ym(e){if(isNaN(e.h))return new St(e.l,0,0,e.opacity);var t=e.h*am;return new St(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}jr(bt,JE,Qi(vn,{brighter(e){return new bt(this.h,this.c,this.l+ms*(e??1),this.opacity)},darker(e){return new bt(this.h,this.c,this.l-ms*(e??1),this.opacity)},rgb(){return ym(this).rgb()}}));var vm=-.14861,xc=1.78277,Ec=-.29227,Ws=-.90649,Li=1.97294,yd=Li*Ws,vd=Li*xc,wd=xc*Ec-Ws*vm;function e_(e){if(e instanceof Tn)return new Tn(e.h,e.s,e.l,e.opacity);e instanceof Se||(e=wc(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(wd*r+yd*t-vd*n)/(wd+yd-vd),o=r-i,s=(Li*(n-i)-Ec*o)/Ws,l=Math.sqrt(s*s+o*o)/(Li*i*(1-i)),u=l?Math.atan2(s,o)*cm-120:NaN;return new Tn(u<0?u+360:u,l,i,e.opacity)}function ra(e,t,n,r){return arguments.length===1?e_(e):new Tn(e,t,n,r??1)}function Tn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jr(Tn,ra,Qi(vn,{brighter(e){return e=e==null?_r:Math.pow(_r,e),new Tn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Rn:Math.pow(Rn,e),new Tn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*am,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Se(255*(t+n*(vm*r+xc*i)),255*(t+n*(Ec*r+Ws*i)),255*(t+n*(Li*r)),this.opacity)}}));var _c=e=>()=>e;function wm(e,t){return function(n){return e+n*t}}function t_(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function n_(e,t){var n=t-e;return n?wm(e,n>180||n<-180?n-360*Math.round(n/360):n):_c(isNaN(e)?t:e)}function r_(e){return(e=+e)==1?hr:function(t,n){return n-t?t_(t,n,e):_c(isNaN(t)?n:t)}}function hr(e,t){var n=t-e;return n?wm(e,n):_c(isNaN(e)?t:e)}var xd=function e(t){var n=r_(t);function r(i,o){var s=n((i=na(i)).r,(o=na(o)).r),l=n(i.g,o.g),u=n(i.b,o.b),a=hr(i.opacity,o.opacity);return function(c){return i.r=s(c),i.g=l(c),i.b=u(c),i.opacity=a(c),i+""}}return r.gamma=e,r}(1);function Zt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var ia=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yl=new RegExp(ia.source,"g");function i_(e){return function(){return e}}function o_(e){return function(t){return e(t)+""}}function s_(e,t){var n=ia.lastIndex=Yl.lastIndex=0,r,i,o,s=-1,l=[],u=[];for(e=e+"",t=t+"";(r=ia.exec(e))&&(i=Yl.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),l[s]?l[s]+=o:l[++s]=o),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,u.push({i:s,x:Zt(r,i)})),n=Yl.lastIndex;return n<t.length&&(o=t.slice(n),l[s]?l[s]+=o:l[++s]=o),l.length<2?u[0]?o_(u[0].x):i_(t):(t=u.length,function(a){for(var c=0,d;c<t;++c)l[(d=u[c]).i]=d.x(a);return l.join("")})}var Ed=180/Math.PI,oa={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xm(e,t,n,r,i,o){var s,l,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*Ed,skewX:Math.atan(u)*Ed,scaleX:s,scaleY:l}}var Eo;function l_(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?oa:xm(t.a,t.b,t.c,t.d,t.e,t.f)}function u_(e){return e==null||(Eo||(Eo=document.createElementNS("http://www.w3.org/2000/svg","g")),Eo.setAttribute("transform",e),!(e=Eo.transform.baseVal.consolidate()))?oa:(e=e.matrix,xm(e.a,e.b,e.c,e.d,e.e,e.f))}function Em(e,t,n,r){function i(a){return a.length?a.pop()+" ":""}function o(a,c,d,f,h,m){if(a!==d||c!==f){var v=h.push("translate(",null,t,null,n);m.push({i:v-4,x:Zt(a,d)},{i:v-2,x:Zt(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(a,c,d,f){a!==c?(a-c>180?c+=360:c-a>180&&(a+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Zt(a,c)})):c&&d.push(i(d)+"rotate("+c+r)}function l(a,c,d,f){a!==c?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Zt(a,c)}):c&&d.push(i(d)+"skewX("+c+r)}function u(a,c,d,f,h,m){if(a!==d||c!==f){var v=h.push(i(h)+"scale(",null,",",null,")");m.push({i:v-4,x:Zt(a,d)},{i:v-2,x:Zt(c,f)})}else(d!==1||f!==1)&&h.push(i(h)+"scale("+d+","+f+")")}return function(a,c){var d=[],f=[];return a=e(a),c=e(c),o(a.translateX,a.translateY,c.translateX,c.translateY,d,f),s(a.rotate,c.rotate,d,f),l(a.skewX,c.skewX,d,f),u(a.scaleX,a.scaleY,c.scaleX,c.scaleY,d,f),a=c=null,function(h){for(var m=-1,v=f.length,S;++m<v;)d[(S=f[m]).i]=S.x(h);return d.join("")}}}var a_=Em(l_,"px, ","px)","deg)"),c_=Em(u_,", ",")",")"),f_=1e-12;function _d(e){return((e=Math.exp(e))+1/e)/2}function d_(e){return((e=Math.exp(e))-1/e)/2}function h_(e){return((e=Math.exp(2*e))-1)/(e+1)}var p_=function e(t,n,r){function i(o,s){var l=o[0],u=o[1],a=o[2],c=s[0],d=s[1],f=s[2],h=c-l,m=d-u,v=h*h+m*m,S,p;if(v<f_)p=Math.log(f/a)/t,S=function(C){return[l+C*h,u+C*m,a*Math.exp(t*C*p)]};else{var y=Math.sqrt(v),g=(f*f-a*a+r*v)/(2*a*n*y),w=(f*f-a*a-r*v)/(2*f*n*y),N=Math.log(Math.sqrt(g*g+1)-g),P=Math.log(Math.sqrt(w*w+1)-w);p=(P-N)/t,S=function(C){var T=C*p,L=_d(N),j=a/(n*y)*(L*h_(t*T+N)-d_(N));return[l+j*h,u+j*m,a*L/_d(t*T+N)]}}return S.duration=Math.abs(p)*1e3*t/Math.SQRT2,S}return i.rho=function(o){var s=Math.max(.001,+o),l=s*s,u=l*l;return e(s,l,u)},i}(Math.SQRT2,2,4);function _m(e){return function t(n){n=+n;function r(i,o){var s=e((i=ra(i)).h,(o=ra(o)).h),l=hr(i.s,o.s),u=hr(i.l,o.l),a=hr(i.opacity,o.opacity);return function(c){return i.h=s(c),i.s=l(c),i.l=u(Math.pow(c,n)),i.opacity=a(c),i+""}}return r.gamma=t,r}(1)}_m(n_);_m(hr);var kr=0,ei=0,Xr=0,km=1e3,ys,ti,vs=0,Dn=0,Ys=0,zi=typeof performance=="object"&&performance.now?performance:Date,Sm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kc(){return Dn||(Sm(g_),Dn=zi.now()+Ys)}function g_(){Dn=0}function ws(){this._call=this._time=this._next=null}ws.prototype=Nm.prototype={constructor:ws,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?kc():+n)+(t==null?0:+t),!this._next&&ti!==this&&(ti?ti._next=this:ys=this,ti=this),this._call=e,this._time=n,sa()},stop:function(){this._call&&(this._call=null,this._time=1/0,sa())}};function Nm(e,t,n){var r=new ws;return r.restart(e,t,n),r}function m_(){kc(),++kr;for(var e=ys,t;e;)(t=Dn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--kr}function kd(){Dn=(vs=zi.now())+Ys,kr=ei=0;try{m_()}finally{kr=0,v_(),Dn=0}}function y_(){var e=zi.now(),t=e-vs;t>km&&(Ys-=t,vs=e)}function v_(){for(var e,t=ys,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ys=n);ti=e,sa(r)}function sa(e){if(!kr){ei&&(ei=clearTimeout(ei));var t=e-Dn;t>24?(e<1/0&&(ei=setTimeout(kd,Math.ceil(e-zi.now()-Ys)+1)),Xr&&(Xr=clearInterval(Xr))):(Xr||(vs=zi.now(),Xr=setInterval(y_,km)),kr=1,Sm(kd))}}function Sd(e,t,n){var r=new ws;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}function w_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Sc=3;(function e(t){t=+t;function n(r){return Math.pow(r,t)}return n.exponent=e,n})(Sc);(function e(t){t=+t;function n(r){return 1-Math.pow(1-r,t)}return n.exponent=e,n})(Sc);(function e(t){t=+t;function n(r){return((r*=2)<=1?Math.pow(r,t):2-Math.pow(2-r,t))/2}return n.exponent=e,n})(Sc);function xs(e){return(Math.pow(2,-10*e)-.0009765625)*1.0009775171065494}var Nc=1.70158;(function e(t){t=+t;function n(r){return(r=+r)*r*(t*(r-1)+r)}return n.overshoot=e,n})(Nc);(function e(t){t=+t;function n(r){return--r*r*((r+1)*t+r)+1}return n.overshoot=e,n})(Nc);(function e(t){t=+t;function n(r){return((r*=2)<1?r*r*((t+1)*r-t):(r-=2)*r*((t+1)*r+t)+2)/2}return n.overshoot=e,n})(Nc);var Sr=2*Math.PI,Cc=1,Mc=.3;(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Sr);function i(o){return t*xs(- --o)*Math.sin((r-o)/n)}return i.amplitude=function(o){return e(o,n*Sr)},i.period=function(o){return e(t,o)},i})(Cc,Mc);(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Sr);function i(o){return 1-t*xs(o=+o)*Math.sin((o+r)/n)}return i.amplitude=function(o){return e(o,n*Sr)},i.period=function(o){return e(t,o)},i})(Cc,Mc);(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Sr);function i(o){return((o=o*2-1)<0?t*xs(-o)*Math.sin((r-o)/n):2-t*xs(o)*Math.sin((r+o)/n))/2}return i.amplitude=function(o){return e(o,n*Sr)},i.period=function(o){return e(t,o)},i})(Cc,Mc);var x_=Bs("start","end","cancel","interrupt"),E_=[],Cm=0,Nd=1,la=2,Vo=3,Cd=4,ua=5,Ho=6;function Gs(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;__(e,n,{name:t,index:r,group:i,on:x_,tween:E_,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Cm})}function Ic(e,t){var n=mt(e,t);if(n.state>Cm)throw new Error("too late; already scheduled");return n}function Nt(e,t){var n=mt(e,t);if(n.state>Vo)throw new Error("too late; already running");return n}function mt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function __(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Nm(o,0,n.time);function o(a){n.state=Nd,n.timer.restart(s,n.delay,n.time),n.delay<=a&&s(a-n.delay)}function s(a){var c,d,f,h;if(n.state!==Nd)return u();for(c in r)if(h=r[c],h.name===n.name){if(h.state===Vo)return Sd(s);h.state===Cd?(h.state=Ho,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=Ho,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(Sd(function(){n.state===Vo&&(n.state=Cd,n.timer.restart(l,n.delay,n.time),l(a))}),n.state=la,n.on.call("start",e,e.__data__,n.index,n.group),n.state===la){for(n.state=Vo,i=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function l(a){for(var c=a<n.duration?n.ease.call(null,a/n.duration):(n.timer.restart(u),n.state=ua,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===ua&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Ho,n.timer.stop(),delete r[t];for(var a in r)return;delete e.__transition}}function Bo(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>la&&r.state<ua,r.state=Ho,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function k_(e){return this.each(function(){Bo(this,e)})}function S_(e,t){var n,r;return function(){var i=Nt(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function N_(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Nt(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var l={name:t,value:n},u=0,a=i.length;u<a;++u)if(i[u].name===t){i[u]=l;break}u===a&&i.push(l)}o.tween=i}}function C_(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=mt(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?S_:N_)(n,e,t))}function Pc(e,t,n){var r=e._id;return e.each(function(){var i=Nt(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return mt(i,r).value[t]}}function Mm(e,t){var n;return(typeof t=="number"?Zt:t instanceof Oi?xd:(n=Oi(t))?(t=n,xd):s_)(e,t)}function M_(e){return function(){this.removeAttribute(e)}}function I_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function P_(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function T_(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function $_(e,t,n){var r,i,o;return function(){var s,l=n(this),u;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=l+"",s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,l)))}}function b_(e,t,n){var r,i,o;return function(){var s,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=l+"",s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,l)))}}function j_(e,t){var n=Us(e),r=n==="transform"?c_:Mm;return this.attrTween(e,typeof t=="function"?(n.local?b_:$_)(n,r,Pc(this,"attr."+e,t)):t==null?(n.local?I_:M_)(n):(n.local?T_:P_)(n,r,t))}function O_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function L_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function z_(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&L_(e,o)),n}return i._value=t,i}function R_(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&O_(e,o)),n}return i._value=t,i}function D_(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 r=Us(e);return this.tween(n,(r.local?z_:R_)(r,t))}function A_(e,t){return function(){Ic(this,e).delay=+t.apply(this,arguments)}}function F_(e,t){return t=+t,function(){Ic(this,e).delay=t}}function V_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?A_:F_)(t,e)):mt(this.node(),t).delay}function H_(e,t){return function(){Nt(this,e).duration=+t.apply(this,arguments)}}function B_(e,t){return t=+t,function(){Nt(this,e).duration=t}}function U_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?H_:B_)(t,e)):mt(this.node(),t).duration}function W_(e,t){if(typeof t!="function")throw new Error;return function(){Nt(this,e).ease=t}}function Y_(e){var t=this._id;return arguments.length?this.each(W_(t,e)):mt(this.node(),t).ease}function G_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Nt(this,e).ease=n}}function X_(e){if(typeof e!="function")throw new Error;return this.each(G_(this._id,e))}function Q_(e){typeof e!="function"&&(e=Qg(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,l=r[i]=[],u,a=0;a<s;++a)(u=o[a])&&e.call(u,u.__data__,a,o)&&l.push(u);return new Vt(r,this._parents,this._name,this._id)}function K_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),l=0;l<o;++l)for(var u=t[l],a=n[l],c=u.length,d=s[l]=new Array(c),f,h=0;h<c;++h)(f=u[h]||a[h])&&(d[h]=f);for(;l<r;++l)s[l]=t[l];return new Vt(s,this._parents,this._name,this._id)}function Z_(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 q_(e,t,n){var r,i,o=Z_(t)?Ic:Nt;return function(){var s=o(this,e),l=s.on;l!==r&&(i=(r=l).copy()).on(t,n),s.on=i}}function J_(e,t){var n=this._id;return arguments.length<2?mt(this.node(),n).on.on(e):this.each(q_(n,e,t))}function ek(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function tk(){return this.on("end.remove",ek(this._id))}function nk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=yc(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var l=r[s],u=l.length,a=o[s]=new Array(u),c,d,f=0;f<u;++f)(c=l[f])&&(d=e.call(c,c.__data__,f,l))&&("__data__"in c&&(d.__data__=c.__data__),a[f]=d,Gs(a[f],t,n,f,a,mt(c,n)));return new Vt(o,this._parents,t,n)}function rk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Xg(e));for(var r=this._groups,i=r.length,o=[],s=[],l=0;l<i;++l)for(var u=r[l],a=u.length,c,d=0;d<a;++d)if(c=u[d]){for(var f=e.call(c,c.__data__,d,u),h,m=mt(c,n),v=0,S=f.length;v<S;++v)(h=f[v])&&Gs(h,t,n,v,f,m);o.push(f),s.push(c)}return new Vt(o,s,t,n)}var ik=Xi.prototype.constructor;function ok(){return new ik(this._groups,this._parents)}function sk(e,t){var n,r,i;return function(){var o=Er(this,e),s=(this.style.removeProperty(e),Er(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function Im(e){return function(){this.style.removeProperty(e)}}function lk(e,t,n){var r,i=n+"",o;return function(){var s=Er(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function uk(e,t,n){var r,i,o;return function(){var s=Er(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),Er(this,e))),s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,l))}}function ak(e,t){var n,r,i,o="style."+t,s="end."+o,l;return function(){var u=Nt(this,e),a=u.on,c=u.value[o]==null?l||(l=Im(t)):void 0;(a!==n||i!==c)&&(r=(n=a).copy()).on(s,i=c),u.on=r}}function ck(e,t,n){var r=(e+="")=="transform"?a_:Mm;return t==null?this.styleTween(e,sk(e,r)).on("end.style."+e,Im(e)):typeof t=="function"?this.styleTween(e,uk(e,r,Pc(this,"style."+e,t))).each(ak(this._id,e)):this.styleTween(e,lk(e,r,t),n).on("end.style."+e,null)}function fk(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function dk(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&fk(e,s,n)),r}return o._value=t,o}function hk(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,dk(e,t,n??""))}function pk(e){return function(){this.textContent=e}}function gk(e){return function(){var t=e(this);this.textContent=t??""}}function mk(e){return this.tween("text",typeof e=="function"?gk(Pc(this,"text",e)):pk(e==null?"":e+""))}function yk(e){return function(t){this.textContent=e.call(this,t)}}function vk(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&yk(i)),t}return r._value=e,r}function wk(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,vk(e))}function xk(){for(var e=this._name,t=this._id,n=Pm(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],l=s.length,u,a=0;a<l;++a)if(u=s[a]){var c=mt(u,t);Gs(u,e,n,a,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Vt(r,this._parents,e,n)}function Ek(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var l={value:s},u={value:function(){--i===0&&o()}};n.each(function(){var a=Nt(this,r),c=a.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),a.on=t}),i===0&&o()})}var _k=0;function Vt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Pm(){return++_k}var Ct=Xi.prototype;Vt.prototype={constructor:Vt,select:nk,selectAll:rk,selectChild:Ct.selectChild,selectChildren:Ct.selectChildren,filter:Q_,merge:K_,selection:ok,transition:xk,call:Ct.call,nodes:Ct.nodes,node:Ct.node,size:Ct.size,empty:Ct.empty,each:Ct.each,on:J_,attr:j_,attrTween:D_,style:ck,styleTween:hk,text:mk,textTween:wk,remove:tk,tween:C_,delay:V_,duration:U_,ease:Y_,easeVarying:X_,end:Ek,[Symbol.iterator]:Ct[Symbol.iterator]};var kk={time:null,delay:0,duration:250,ease:w_};function Sk(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 Nk(e){var t,n;e instanceof Vt?(t=e._id,e=e._name):(t=Pm(),(n=kk).time=kc(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],l=s.length,u,a=0;a<l;++a)(u=s[a])&&Gs(u,e,t,a,s,n||Sk(u,t));return new Vt(r,this._parents,e,t)}Xi.prototype.interrupt=k_;Xi.prototype.transition=Nk;var _o=e=>()=>e;function Ck(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:r,enumerable:!0,configurable:!0},_:{value:i}})}function jt(e,t,n){this.k=e,this.x=t,this.y=n}jt.prototype={constructor:jt,scale:function(e){return e===1?this:new jt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new jt(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 Xs=new jt(1,0,0);Tm.prototype=jt.prototype;function Tm(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Xs;return e.__zoom}function Gl(e){e.stopImmediatePropagation()}function Qr(e){e.preventDefault(),e.stopImmediatePropagation()}function Mk(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Ik(){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 Md(){return this.__zoom||Xs}function Pk(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Tk(){return navigator.maxTouchPoints||"ontouchstart"in this}function $k(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function $m(){var e=Mk,t=Ik,n=$k,r=Pk,i=Tk,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,u=p_,a=Bs("start","zoom","end"),c,d,f,h=500,m=150,v=0,S=10;function p(_){_.property("__zoom",Md).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",j).filter(i).on("touchstart.zoom",A).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(_,O,E,I){var k=_.selection?_.selection():_;k.property("__zoom",Md),_!==k?N(_,O,E,I):k.interrupt().each(function(){P(this,arguments).event(I).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},p.scaleBy=function(_,O,E,I){p.scaleTo(_,function(){var k=this.__zoom.k,M=typeof O=="function"?O.apply(this,arguments):O;return k*M},E,I)},p.scaleTo=function(_,O,E,I){p.transform(_,function(){var k=t.apply(this,arguments),M=this.__zoom,$=E==null?w(k):typeof E=="function"?E.apply(this,arguments):E,z=M.invert($),F=typeof O=="function"?O.apply(this,arguments):O;return n(g(y(M,F),$,z),k,s)},E,I)},p.translateBy=function(_,O,E,I){p.transform(_,function(){return n(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,I)},p.translateTo=function(_,O,E,I,k){p.transform(_,function(){var M=t.apply(this,arguments),$=this.__zoom,z=I==null?w(M):typeof I=="function"?I.apply(this,arguments):I;return n(Xs.translate(z[0],z[1]).scale($.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof E=="function"?-E.apply(this,arguments):-E),M,s)},I,k)};function y(_,O){return O=Math.max(o[0],Math.min(o[1],O)),O===_.k?_:new jt(O,_.x,_.y)}function g(_,O,E){var I=O[0]-E[0]*_.k,k=O[1]-E[1]*_.k;return I===_.x&&k===_.y?_:new jt(_.k,I,k)}function w(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function N(_,O,E,I){_.on("start.zoom",function(){P(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(I).end()}).tween("zoom",function(){var k=this,M=arguments,$=P(k,M).event(I),z=t.apply(k,M),F=E==null?w(z):typeof E=="function"?E.apply(k,M):E,Y=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),B=k.__zoom,G=typeof O=="function"?O.apply(k,M):O,W=u(B.invert(F).concat(Y/B.k),G.invert(F).concat(Y/G.k));return function(Q){if(Q===1)Q=G;else{var H=W(Q),Z=Y/H[2];Q=new jt(Z,F[0]-H[0]*Z,F[1]-H[1]*Z)}$.zoom(null,Q)}})}function P(_,O,E){return!E&&_.__zooming||new C(_,O)}function C(_,O){this.that=_,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,O),this.taps=0}C.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,O){return this.mouse&&_!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var O=We(this.that).datum();a.call(_,this.that,new Ck(_,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:a}),O)}};function T(_,...O){if(!e.apply(this,arguments))return;var E=P(this,O).event(_),I=this.__zoom,k=Math.max(o[0],Math.min(o[1],I.k*Math.pow(2,r.apply(this,arguments)))),M=at(_);if(E.wheel)(E.mouse[0][0]!==M[0]||E.mouse[0][1]!==M[1])&&(E.mouse[1]=I.invert(E.mouse[0]=M)),clearTimeout(E.wheel);else{if(I.k===k)return;E.mouse=[M,I.invert(M)],Bo(this),E.start()}Qr(_),E.wheel=setTimeout($,m),E.zoom("mouse",n(g(y(I,k),E.mouse[0],E.mouse[1]),E.extent,s));function $(){E.wheel=null,E.end()}}function L(_,...O){if(f||!e.apply(this,arguments))return;var E=_.currentTarget,I=P(this,O,!0).event(_),k=We(_.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",Y,!0),M=at(_,E),$=_.clientX,z=_.clientY;om(_.view),Gl(_),I.mouse=[M,this.__zoom.invert(M)],Bo(this),I.start();function F(B){if(Qr(B),!I.moved){var G=B.clientX-$,W=B.clientY-z;I.moved=G*G+W*W>v}I.event(B).zoom("mouse",n(g(I.that.__zoom,I.mouse[0]=at(B,E),I.mouse[1]),I.extent,s))}function Y(B){k.on("mousemove.zoom mouseup.zoom",null),sm(B.view,I.moved),Qr(B),I.event(B).end()}}function j(_,...O){if(e.apply(this,arguments)){var E=this.__zoom,I=at(_.changedTouches?_.changedTouches[0]:_,this),k=E.invert(I),M=E.k*(_.shiftKey?.5:2),$=n(g(y(E,M),I,k),t.apply(this,O),s);Qr(_),l>0?We(this).transition().duration(l).call(N,$,I,_):We(this).call(p.transform,$,I,_)}}function A(_,...O){if(e.apply(this,arguments)){var E=_.touches,I=E.length,k=P(this,O,_.changedTouches.length===I).event(_),M,$,z,F;for(Gl(_),$=0;$<I;++$)z=E[$],F=at(z,this),F=[F,this.__zoom.invert(F),z.identifier],k.touch0?!k.touch1&&k.touch0[2]!==F[2]&&(k.touch1=F,k.taps=0):(k.touch0=F,M=!0,k.taps=1+!!c);c&&(c=clearTimeout(c)),M&&(k.taps<2&&(d=F[0],c=setTimeout(function(){c=null},h)),Bo(this),k.start())}}function D(_,...O){if(this.__zooming){var E=P(this,O).event(_),I=_.changedTouches,k=I.length,M,$,z,F;for(Qr(_),M=0;M<k;++M)$=I[M],z=at($,this),E.touch0&&E.touch0[2]===$.identifier?E.touch0[0]=z:E.touch1&&E.touch1[2]===$.identifier&&(E.touch1[0]=z);if($=E.that.__zoom,E.touch1){var Y=E.touch0[0],B=E.touch0[1],G=E.touch1[0],W=E.touch1[1],Q=(Q=G[0]-Y[0])*Q+(Q=G[1]-Y[1])*Q,H=(H=W[0]-B[0])*H+(H=W[1]-B[1])*H;$=y($,Math.sqrt(Q/H)),z=[(Y[0]+G[0])/2,(Y[1]+G[1])/2],F=[(B[0]+W[0])/2,(B[1]+W[1])/2]}else if(E.touch0)z=E.touch0[0],F=E.touch0[1];else return;E.zoom("touch",n(g($,z,F),E.extent,s))}}function R(_,...O){if(this.__zooming){var E=P(this,O).event(_),I=_.changedTouches,k=I.length,M,$;for(Gl(_),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),M=0;M<k;++M)$=I[M],E.touch0&&E.touch0[2]===$.identifier?delete E.touch0:E.touch1&&E.touch1[2]===$.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&($=at($,this),Math.hypot(d[0]-$[0],d[1]-$[1])<S)){var z=We(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return p.wheelDelta=function(_){return arguments.length?(r=typeof _=="function"?_:_o(+_),p):r},p.filter=function(_){return arguments.length?(e=typeof _=="function"?_:_o(!!_),p):e},p.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:_o(!!_),p):i},p.extent=function(_){return arguments.length?(t=typeof _=="function"?_:_o([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),p):t},p.scaleExtent=function(_){return arguments.length?(o[0]=+_[0],o[1]=+_[1],p):[o[0],o[1]]},p.translateExtent=function(_){return arguments.length?(s[0][0]=+_[0][0],s[1][0]=+_[1][0],s[0][1]=+_[0][1],s[1][1]=+_[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(_){return arguments.length?(n=_,p):n},p.duration=function(_){return arguments.length?(l=+_,p):l},p.interpolate=function(_){return arguments.length?(u=_,p):u},p.on=function(){var _=a.on.apply(a,arguments);return _===a?p:_},p.clickDistance=function(_){return arguments.length?(v=(_=+_)*_,p):Math.sqrt(v)},p.tapDistance=function(_){return arguments.length?(S=+_,p):S},p}const Bt={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:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", 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.`},Ri=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],bm=["Enter"," ","Escape"];var Nr;(function(e){e.Strict="strict",e.Loose="loose"})(Nr||(Nr={}));var $n;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})($n||($n={}));var Di;(function(e){e.Partial="partial",e.Full="full"})(Di||(Di={}));const jm={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var en;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(en||(en={}));var Ai;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ai||(Ai={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const Id={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function Om(e){return e===null?null:e?"valid":"invalid"}const Lm=e=>"id"in e&&"source"in e&&"target"in e,bk=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Tc=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ki=(e,t=[0,0])=>{const{width:n,height:r}=Ut(e),i=e.origin??t,o=n*i[0],s=r*i[1];return{x:e.position.x-o,y:e.position.y-s}},jk=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const o=typeof i=="string";let s=!t.nodeLookup&&!o?i:void 0;t.nodeLookup&&(s=o?t.nodeLookup.get(i):Tc(i)?i:t.nodeLookup.get(i.id));const l=s?Es(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Qs(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ks(n)},Zi=(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(r=>{if(t.filter===void 0||t.filter(r)){const i=Es(r);n=Qs(n,i)}}),Ks(n)},zm=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1)=>{const l={...qi(t,[n,r,i]),width:t.width/i,height:t.height/i},u=[];for(const a of e.values()){const{measured:c,selectable:d=!0,hidden:f=!1}=a;if(s&&!d||f)continue;const h=c.width??a.width??a.initialWidth??null,m=c.height??a.height??a.initialHeight??null,v=Fi(l,Mr(a)),S=(h??0)*(m??0),p=o&&v>0;(!a.internals.handleBounds||p||v>=S||a.dragging)&&u.push(a)}return u},Ok=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function aa(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function ca({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},s){if(e.size===0)return Promise.resolve(!1);const l=Zi(e),u=$c(l,t,n,(s==null?void 0:s.minZoom)??i,(s==null?void 0:s.maxZoom)??o,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration}),Promise.resolve(!0)}function Rm({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:u,y:a}=l?l.internals.positionAbsolute:{x:0,y:0},c=s.origin??r;let d=i;if(s.extent==="parent"&&!s.expandParent)if(!l)o==null||o("005",Bt.error005());else{const h=l.measured.width,m=l.measured.height;h&&m&&(d=[[u,a],[u+h,a+m]])}else l&&Ir(s.extent)&&(d=[[s.extent[0][0]+u,s.extent[0][1]+a],[s.extent[1][0]+u,s.extent[1][1]+a]]);const f=Ir(d)?An(t,d,s.measured):t;return{position:{x:f.x-u+s.measured.width*c[0],y:f.y-a+s.measured.height*c[1]},positionAbsolute:f}}async function Lk({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const o=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=o.has(f.id),m=!h&&f.parentId&&s.find(v=>v.id===f.parentId);(h||m)&&s.push(f)}const l=new Set(t.map(f=>f.id)),u=r.filter(f=>f.deletable!==!1),c=Ok(s,u);for(const f of u)l.has(f.id)&&!c.find(m=>m.id===f.id)&&c.push(f);if(!i)return{edges:c,nodes:s};const d=await i({nodes:s,edges:c});return typeof d=="boolean"?d?{edges:c,nodes:s}:{edges:[],nodes:[]}:d}const Cr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),An=(e={x:0,y:0},t,n)=>({x:Cr(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Cr(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Dm(e,t,n){const{width:r,height:i}=Ut(n),{x:o,y:s}=n.internals.positionAbsolute;return An(e,[[o,s],[o+r,s+i]],t)}const Pd=(e,t,n)=>e<t?Cr(Math.abs(e-t),1,t)/t:e>n?-Cr(Math.abs(e-n),1,t)/t:0,Am=(e,t,n=15,r=40)=>{const i=Pd(e.x,r,t.width-r)*n,o=Pd(e.y,r,t.height-r)*n;return[i,o]},Qs=(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)}),fa=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ks=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Mr=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=Tc(e)?e.internals.positionAbsolute:Ki(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Es=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=Tc(e)?e.internals.positionAbsolute:Ki(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},Fm=(e,t)=>Ks(Qs(fa(e),fa(t))),Fi=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Td=e=>dt(e.width)&&dt(e.height)&&dt(e.x)&&dt(e.y),dt=e=>!isNaN(e)&&isFinite(e),zk=(e,t)=>{},Zs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),qi=({x:e,y:t},[n,r,i],o=!1,s=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?Zs(l,s):l},Vm=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),$c=(e,t,n,r,i,o)=>{const s=t/(e.width*(1+o)),l=n/(e.height*(1+o)),u=Math.min(s,l),a=Cr(u,r,i),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*a,h=n/2-d*a;return{x:f,y:h,zoom:a}},_s=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ir(e){return e!==void 0&&e!=="parent"}function Ut(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 Hm(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 Bm(e,t={width:0,height:0},n,r,i){const o={...e},s=r.get(n);if(s){const l=s.origin||i;o.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function hi(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:o,y:s}=Lt(e),l=qi({x:o-((i==null?void 0:i.left)??0),y:s-((i==null?void 0:i.top)??0)},r),{x:u,y:a}=n?Zs(l,t):l;return{xSnapped:u,ySnapped:a,...l}}const qs=e=>({width:e.offsetWidth,height:e.offsetHeight}),Um=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Rk=["INPUT","SELECT","TEXTAREA"];function da(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return Rk.includes(t==null?void 0:t.nodeName)||(t==null?void 0:t.hasAttribute("contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const Wm=e=>"clientX"in e,Lt=(e,t)=>{var o,s;const n=Wm(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},$d=(e,t,n,r,i)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...qs(s)}})};function Ym({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:l}){const u=e*.125+i*.375+s*.375+n*.125,a=t*.125+o*.375+l*.375+r*.125,c=Math.abs(u-e),d=Math.abs(a-t);return[u,a,c,d]}function ko(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function bd({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case X.Left:return[t-ko(t-r,o),n];case X.Right:return[t+ko(r-t,o),n];case X.Top:return[t,n-ko(n-i,o)];case X.Bottom:return[t,n+ko(i-n,o)]}}function Gm({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:i,targetPosition:o=X.Top,curvature:s=.25}){const[l,u]=bd({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[a,c]=bd({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[d,f,h,m]=Ym({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:a,targetControlY:c});return[`M${e},${t} C${l},${u} ${a},${c} ${r},${i}`,d,f,h,m]}function Xm({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[o,l,i,s]}function Dk({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1}){if(!i)return r;const o=n||t.selected||e.selected,s=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(o?s:0)}function Ak({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const o=Qs(Es(e),Es(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const s={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Fi(s,Ks(o))>0}const Fk=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Vk=(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)),Hk=(e,t)=>{if(!e.source||!e.target)return t;let n;return Lm(e)?n={...e}:n={...e,id:Fk(e)},Vk(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Qm({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,l]=Xm({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,l]}const jd={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},Bk=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.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},Od=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Uk({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:r=X.Top,center:i,offset:o}){const s=jd[t],l=jd[r],u={x:e.x+s.x*o,y:e.y+s.y*o},a={x:n.x+l.x*o,y:n.y+l.y*o},c=Bk({source:u,sourcePosition:t,target:a}),d=c.x!==0?"x":"y",f=c[d];let h=[],m,v;const S={x:0,y:0},p={x:0,y:0},[y,g,w,N]=Xm({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*l[d]===-1){m=i.x??y,v=i.y??g;const C=[{x:m,y:u.y},{x:m,y:a.y}],T=[{x:u.x,y:v},{x:a.x,y:v}];s[d]===f?h=d==="x"?C:T:h=d==="x"?T:C}else{const C=[{x:u.x,y:a.y}],T=[{x:a.x,y:u.y}];if(d==="x"?h=s.x===f?T:C:h=s.y===f?C:T,t===r){const R=Math.abs(e[d]-n[d]);if(R<=o){const _=Math.min(o-1,o-R);s[d]===f?S[d]=(u[d]>e[d]?-1:1)*_:p[d]=(a[d]>n[d]?-1:1)*_}}if(t!==r){const R=d==="x"?"y":"x",_=s[d]===l[R],O=u[R]>a[R],E=u[R]<a[R];(s[d]===1&&(!_&&O||_&&E)||s[d]!==1&&(!_&&E||_&&O))&&(h=d==="x"?C:T)}const L={x:u.x+S.x,y:u.y+S.y},j={x:a.x+p.x,y:a.y+p.y},A=Math.max(Math.abs(L.x-h[0].x),Math.abs(j.x-h[0].x)),D=Math.max(Math.abs(L.y-h[0].y),Math.abs(j.y-h[0].y));A>=D?(m=(L.x+j.x)/2,v=h[0].y):(m=h[0].x,v=(L.y+j.y)/2)}return[[e,{x:u.x+S.x,y:u.y+S.y},...h,{x:a.x+p.x,y:a.y+p.y},n],m,v,w,N]}function Wk(e,t,n,r){const i=Math.min(Od(e,t)/2,Od(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const a=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${o+i*a},${s}Q ${o},${s} ${o},${s+i*c}`}const l=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${s+i*u}Q ${o},${s} ${o+i*l},${s}`}function ha({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:i,targetPosition:o=X.Top,borderRadius:s=5,centerX:l,centerY:u,offset:a=20}){const[c,d,f,h,m]=Uk({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:l,y:u},offset:a});return[c.reduce((S,p,y)=>{let g="";return y>0&&y<c.length-1?g=Wk(c[y-1],p,c[y+1],s):g=`${y===0?"M":"L"}${p.x} ${p.y}`,S+=g,S},""),d,f,h,m]}function Ld(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Yk(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Ld(t)||!Ld(n))return null;const r=t.internals.handleBounds||zd(t.handles),i=n.internals.handleBounds||zd(n.handles),o=Rd((r==null?void 0:r.source)??[],e.sourceHandle),s=Rd(e.connectionMode===Nr.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!o||!s)return(d=e.onError)==null||d.call(e,"008",Bt.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||X.Bottom,u=(s==null?void 0:s.position)||X.Top,a=Vi(t,o,l),c=Vi(n,s,u);return{sourceX:a.x,sourceY:a.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:u}}function zd(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Vi(e,t,n=X.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??Ut(e);if(r)return{x:i+s/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case X.Top:return{x:i+s/2,y:o};case X.Right:return{x:i+s,y:o+l/2};case X.Bottom:return{x:i+s/2,y:o+l};case X.Left:return{x:i,y:o+l/2}}}function Rd(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function pa(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Gk(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const o=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const a=pa(u,t);o.has(a)||(s.push({id:a,color:u.color||n,...u}),o.add(a))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const bc={nodeOrigin:[0,0],nodeExtent:Ri,elevateNodesOnSelect:!0,defaults:{}},Xk={...bc,checkEquality:!0};function jc(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Qk(e,t,n){const r=jc(bc,n);for(const i of e.values())if(i.parentId)Oc(i,e,t,r);else{const o=Ki(i,r.nodeOrigin),s=Ir(i.extent)?i.extent:r.nodeExtent,l=An(o,s,Ut(i));i.internals.positionAbsolute=l}}function ga(e,t,n,r){var l,u;const i=jc(Xk,r),o=new Map(t),s=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const a of e){let c=o.get(a.id);if(i.checkEquality&&a===(c==null?void 0:c.internals.userNode))t.set(a.id,c);else{const d=Ki(a,i.nodeOrigin),f=Ir(a.extent)?a.extent:i.nodeExtent,h=An(d,f,Ut(a));c={...i.defaults,...a,measured:{width:(l=a.measured)==null?void 0:l.width,height:(u=a.measured)==null?void 0:u.height},internals:{positionAbsolute:h,handleBounds:a.measured?c==null?void 0:c.internals.handleBounds:void 0,z:Km(a,s),userNode:a}},t.set(a.id,c)}a.parentId&&Oc(c,t,n,r)}}function Kk(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 Oc(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:o,nodeExtent:s}=jc(bc,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Kk(e,n);const a=i?1e3:0,{x:c,y:d,z:f}=Zk(e,u,o,s,a),{positionAbsolute:h}=e.internals,m=c!==h.x||d!==h.y;(m||f!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:m?{x:c,y:d}:h,z:f})}function Km(e,t){return(dt(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Zk(e,t,n,r,i){const{x:o,y:s}=t.internals.positionAbsolute,l=Ut(e),u=Ki(e,n),a=Ir(e.extent)?An(u,e.extent,l):u;let c=An({x:o+a.x,y:s+a.y},r,l);e.extent==="parent"&&(c=Dm(c,l,t));const d=Km(e,i),f=t.internals.z??0;return{x:c.x,y:c.y,z:f>d?f:d}}function Lc(e,t,n,r=[0,0]){var s;const i=[],o=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const a=((s=o.get(l.parentId))==null?void 0:s.expandedRect)??Mr(u),c=Fm(a,l.rect);o.set(l.parentId,{expandedRect:c,parent:u})}return o.size>0&&o.forEach(({expandedRect:l,parent:u},a)=>{var g;const c=u.internals.positionAbsolute,d=Ut(u),f=u.origin??r,h=l.x<c.x?Math.round(Math.abs(c.x-l.x)):0,m=l.y<c.y?Math.round(Math.abs(c.y-l.y)):0,v=Math.max(d.width,Math.round(l.width)),S=Math.max(d.height,Math.round(l.height)),p=(v-d.width)*f[0],y=(S-d.height)*f[1];(h>0||m>0||p||y)&&(i.push({id:a,type:"position",position:{x:u.position.x-h+p,y:u.position.y-m+y}}),(g=n.get(a))==null||g.forEach(w=>{e.some(N=>N.id===w.id)||i.push({id:w.id,type:"position",position:{x:w.position.x+h,y:w.position.y+m}})})),(d.width<l.width||d.height<l.height||h||m)&&i.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:v+(h?f[0]*h-p:0),height:S+(m?f[1]*m-y:0)}})}),i}function qk(e,t,n,r,i,o){const s=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!s)return{changes:[],updatedInternals:l};const u=[],a=window.getComputedStyle(s),{m22:c}=new window.DOMMatrixReadOnly(a.transform),d=[];for(const f of e.values()){const h=t.get(f.id);if(h)if(h.hidden)h.internals={...h.internals,handleBounds:void 0},l=!0;else{const m=qs(f.nodeElement),v=h.measured.width!==m.width||h.measured.height!==m.height;if(!!(m.width&&m.height&&(v||!h.internals.handleBounds||f.force))){const p=f.nodeElement.getBoundingClientRect(),y=Ir(h.extent)?h.extent:o;let{positionAbsolute:g}=h.internals;h.parentId&&h.extent==="parent"?g=Dm(g,m,t.get(h.parentId)):y&&(g=An(g,y,m)),h.measured=m,h.internals={...h.internals,positionAbsolute:g,handleBounds:{source:$d("source",f.nodeElement,p,c,h.id),target:$d("target",f.nodeElement,p,c,h.id)}},h.parentId&&Oc(h,t,n,{nodeOrigin:i}),l=!0,v&&(u.push({id:h.id,type:"dimensions",dimensions:m}),h.expandParent&&h.parentId&&d.push({id:h.id,parentId:h.parentId,rect:Mr(h,i)}))}}}if(d.length>0){const f=Lc(d,t,n,i);u.push(...f)}return{changes:u,updatedInternals:l}}async function Jk({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r),l=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(l)}function Zm(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:o,sourceHandle:s=null,targetHandle:l=null}=r,u=`${i}-source-${s}`,a=`${o}-target-${l}`,c=e.get(u)||new Map,d=e.get(a)||new Map,f={edgeId:r.id,source:i,target:o,sourceHandle:s,targetHandle:l};t.set(r.id,r),e.set(u,c.set(`${o}-${l}`,f)),e.set(a,d.set(`${i}-${s}`,f))}}function qm(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:qm(n,t):!1}function Dd(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function eS(e,t,n,r){const i=new Map;for(const[o,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!qm(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(o);l&&i.set(o,{id:o,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function Xl({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,u;const i=[];for(const[a,c]of t){const d=(s=n.get(a))==null?void 0:s.internals.userNode;d&&i.push({...d,position:c.position,dragging:r})}if(!e)return[i[0],i];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:i[0],i]}function tS({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},s=0,l=new Map,u=!1,a={x:0,y:0},c=null,d=!1,f=null,h=!1;function m({noDragClassName:S,handleSelector:p,domNode:y,isSelectable:g,nodeId:w,nodeClickDistance:N=0}){f=We(y);function P({x:j,y:A},D){const{nodeLookup:R,nodeExtent:_,snapGrid:O,snapToGrid:E,nodeOrigin:I,onNodeDrag:k,onSelectionDrag:M,onError:$,updateNodePositions:z}=t();o={x:j,y:A};let F=!1,Y={x:0,y:0,x2:0,y2:0};if(l.size>1&&_){const B=Zi(l);Y=fa(B)}for(const[B,G]of l){if(!R.has(B))continue;let W={x:j-G.distance.x,y:A-G.distance.y};E&&(W=Zs(W,O));let Q=[[_[0][0],_[0][1]],[_[1][0],_[1][1]]];if(l.size>1&&_&&!G.extent){const{positionAbsolute:ee}=G.internals,q=ee.x-Y.x+_[0][0],K=ee.x+G.measured.width-Y.x2+_[1][0],re=ee.y-Y.y+_[0][1],se=ee.y+G.measured.height-Y.y2+_[1][1];Q=[[q,re],[K,se]]}const{position:H,positionAbsolute:Z}=Rm({nodeId:B,nextPosition:W,nodeLookup:R,nodeExtent:Q,nodeOrigin:I,onError:$});F=F||G.position.x!==H.x||G.position.y!==H.y,G.position=H,G.internals.positionAbsolute=Z}if(F&&(z(l,!0),D&&(r||k||!w&&M))){const[B,G]=Xl({nodeId:w,dragItems:l,nodeLookup:R});r==null||r(D,l,B,G),k==null||k(D,B,G),w||M==null||M(D,G)}}async function C(){if(!c)return;const{transform:j,panBy:A,autoPanSpeed:D}=t(),[R,_]=Am(a,c,D);(R!==0||_!==0)&&(o.x=(o.x??0)-R/j[2],o.y=(o.y??0)-_/j[2],await A({x:R,y:_})&&P(o,null)),s=requestAnimationFrame(C)}function T(j){var F;const{nodeLookup:A,multiSelectionActive:D,nodesDraggable:R,transform:_,snapGrid:O,snapToGrid:E,selectNodesOnDrag:I,onNodeDragStart:k,onSelectionDragStart:M,unselectNodesAndEdges:$}=t();d=!0,(!I||!g)&&!D&&w&&((F=A.get(w))!=null&&F.selected||$()),g&&I&&w&&(e==null||e(w));const z=hi(j.sourceEvent,{transform:_,snapGrid:O,snapToGrid:E,containerBounds:c});if(o=z,l=eS(A,R,z,w),l.size>0&&(n||k||!w&&M)){const[Y,B]=Xl({nodeId:w,dragItems:l,nodeLookup:A});n==null||n(j.sourceEvent,l,Y,B),k==null||k(j.sourceEvent,Y,B),w||M==null||M(j.sourceEvent,B)}}const L=lm().clickDistance(N).on("start",j=>{const{domNode:A,nodeDragThreshold:D,transform:R,snapGrid:_,snapToGrid:O}=t();c=(A==null?void 0:A.getBoundingClientRect())||null,h=!1,D===0&&T(j),o=hi(j.sourceEvent,{transform:R,snapGrid:_,snapToGrid:O,containerBounds:c}),a=Lt(j.sourceEvent,c)}).on("drag",j=>{const{autoPanOnNodeDrag:A,transform:D,snapGrid:R,snapToGrid:_,nodeDragThreshold:O,nodeLookup:E}=t(),I=hi(j.sourceEvent,{transform:D,snapGrid:R,snapToGrid:_,containerBounds:c});if((j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||w&&!E.has(w))&&(h=!0),!h){if(!u&&A&&d&&(u=!0,C()),!d){const k=I.xSnapped-(o.x??0),M=I.ySnapped-(o.y??0);Math.sqrt(k*k+M*M)>O&&T(j)}(o.x!==I.xSnapped||o.y!==I.ySnapped)&&l&&d&&(a=Lt(j.sourceEvent,c),P(I,j.sourceEvent))}}).on("end",j=>{if(!(!d||h)&&(u=!1,d=!1,cancelAnimationFrame(s),l.size>0)){const{nodeLookup:A,updateNodePositions:D,onNodeDragStop:R,onSelectionDragStop:_}=t();if(D(l,!1),i||R||!w&&_){const[O,E]=Xl({nodeId:w,dragItems:l,nodeLookup:A,dragging:!1});i==null||i(j.sourceEvent,l,O,E),R==null||R(j.sourceEvent,O,E),w||_==null||_(j.sourceEvent,E)}}}).filter(j=>{const A=j.target;return!j.button&&(!S||!Dd(A,`.${S}`,y))&&(!p||Dd(A,p,y))});f.call(L)}function v(){f==null||f.on(".drag",null)}return{update:m,destroy:v}}function nS(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Fi(i,Mr(o))>0&&r.push(o);return r}const rS=250;function iS(e,t,n,r){var l,u;let i=[],o=1/0;const s=nS(e,n,t+rS);for(const a of s){const c=[...((l=a.internals.handleBounds)==null?void 0:l.source)??[],...((u=a.internals.handleBounds)==null?void 0:u.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:h}=Vi(a,d,d.position,!0),m=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));m>t||(m<o?(i=[{...d,x:f,y:h}],o=m):m===o&&i.push({...d,x:f,y:h}))}}if(!i.length)return null;if(i.length>1){const a=r.type==="source"?"target":"source";return i.find(c=>c.type===a)??i[0]}return i[0]}function Jm(e,t,n,r,i,o=!1){var a,c,d;const s=r.get(e);if(!s)return null;const l=i==="strict"?(a=s.internals.handleBounds)==null?void 0:a[t]:[...((c=s.internals.handleBounds)==null?void 0:c.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],u=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return u&&o?{...u,...Vi(s,u,u.position,!0)}:u}function e0(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function oS(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const t0=()=>!0;function sS(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:s,domNode:l,nodeLookup:u,lib:a,autoPanOnConnect:c,flowId:d,panBy:f,cancelConnection:h,onConnectStart:m,onConnect:v,onConnectEnd:S,isValidConnection:p=t0,onReconnectEnd:y,updateConnection:g,getTransform:w,getFromHandle:N,autoPanSpeed:P}){const C=Um(e.target);let T=0,L;const{x:j,y:A}=Lt(e),D=C==null?void 0:C.elementFromPoint(j,A),R=e0(o,D),_=l==null?void 0:l.getBoundingClientRect();if(!_||!R)return;const O=Jm(i,R,r,u,t);if(!O)return;let E=Lt(e,_),I=!1,k=null,M=!1,$=null;function z(){if(!c||!_)return;const[Z,ee]=Am(E,_,P);f({x:Z,y:ee}),T=requestAnimationFrame(z)}const F={...O,nodeId:i,type:R,position:O.position},Y=u.get(i),G={inProgress:!0,isValid:null,from:Vi(Y,F,X.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:Y,to:E,toHandle:null,toPosition:Id[F.position],toNode:null};g(G);let W=G;m==null||m(e,{nodeId:i,handleId:r,handleType:R});function Q(Z){if(!N()||!F){H(Z);return}const ee=w();E=Lt(Z,_),L=iS(qi(E,ee,!1,[1,1]),n,u,F),I||(z(),I=!0);const q=n0(Z,{handle:L,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:p,doc:C,lib:a,flowId:d,nodeLookup:u});$=q.handleDomNode,k=q.connection,M=oS(!!L,q.isValid);const K={...W,isValid:M,to:L&&M?Vm({x:L.x,y:L.y},ee):E,toHandle:q.toHandle,toPosition:M&&q.toHandle?q.toHandle.position:Id[F.position],toNode:q.toHandle?u.get(q.toHandle.nodeId):null};M&&L&&W.toHandle&&K.toHandle&&W.toHandle.type===K.toHandle.type&&W.toHandle.nodeId===K.toHandle.nodeId&&W.toHandle.id===K.toHandle.id&&W.to.x===K.to.x&&W.to.y===K.to.y||(g(K),W=K)}function H(Z){(L||$)&&k&&M&&(v==null||v(k));const{inProgress:ee,...q}=W,K={...q,toPosition:W.toHandle?W.toPosition:null};S==null||S(Z,K),o&&(y==null||y(Z,K)),h(),cancelAnimationFrame(T),I=!1,M=!1,k=null,$=null,C.removeEventListener("mousemove",Q),C.removeEventListener("mouseup",H),C.removeEventListener("touchmove",Q),C.removeEventListener("touchend",H)}C.addEventListener("mousemove",Q),C.addEventListener("mouseup",H),C.addEventListener("touchmove",Q),C.addEventListener("touchend",H)}function n0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:l,flowId:u,isValidConnection:a=t0,nodeLookup:c}){const d=o==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:m}=Lt(e),v=s.elementFromPoint(h,m),S=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,p={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const y=e0(void 0,S),g=S.getAttribute("data-nodeid"),w=S.getAttribute("data-handleid"),N=S.classList.contains("connectable"),P=S.classList.contains("connectableend");if(!g||!y)return p;const C={source:d?g:r,sourceHandle:d?w:i,target:d?r:g,targetHandle:d?i:w};p.connection=C;const L=N&&P&&(n===Nr.Strict?d&&y==="source"||!d&&y==="target":g!==r||w!==i);p.isValid=L&&a(C),p.toHandle=Jm(g,y,w,c,n,!1)}return p}const ma={onPointerDown:sS,isValid:n0};function lS({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=We(e);function o({translateExtent:l,width:u,height:a,zoomStep:c=10,pannable:d=!0,zoomable:f=!0,inversePan:h=!1}){const m=g=>{const w=n();if(g.sourceEvent.type!=="wheel"||!t)return;const N=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*c,P=w[2]*Math.pow(2,N);t.scaleTo(P)};let v=[0,0];const S=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},p=g=>{const w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const N=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],P=[N[0]-v[0],N[1]-v[1]];v=N;const C=r()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),T={x:w[0]-P[0]*C,y:w[1]-P[1]*C},L=[[0,0],[u,a]];t.setViewportConstrained({x:T.x,y:T.y,zoom:w[2]},L,l)},y=$m().on("start",S).on("zoom",d?p:null).on("zoom.wheel",f?m:null);i.call(y,{})}function s(){i.on("zoom",null)}return{update:o,destroy:s,pointer:at}}const uS=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Js=e=>({x:e.x,y:e.y,zoom:e.k}),Ql=({x:e,y:t,zoom:n})=>Xs.translate(e,t).scale(n),nr=(e,t)=>e.target.closest(`.${t}`),r0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Kl=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},i0=e=>{const t=e.ctrlKey&&_s()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function aS({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:a}){return c=>{if(nr(c,t))return!1;c.preventDefault(),c.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(c.ctrlKey&&s){const S=at(c),p=i0(c),y=d*Math.pow(2,p);r.scaleTo(n,y,S,c);return}const f=c.deltaMode===1?20:1;let h=i===$n.Vertical?0:c.deltaX*f,m=i===$n.Horizontal?0:c.deltaY*f;!_s()&&c.shiftKey&&i!==$n.Vertical&&(h=c.deltaY*f,m=0),r.translateBy(n,-(h/d)*o,-(m/d)*o,{internal:!0});const v=Js(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(c,v)),e.isPanScrolling&&(u==null||u(c,v),e.panScrollTimeout=setTimeout(()=>{a==null||a(c,v),e.isPanScrolling=!1},150))}}function cS({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){if(!t&&r.type==="wheel"&&!r.ctrlKey||nr(r,e))return null;r.preventDefault(),n.call(this,r,i)}}function fS({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,s,l;if((o=r.sourceEvent)!=null&&o.internal)return;const i=Js(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function dS({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{var s,l;e.usedRightMouseButton=!!(n&&r0(t,e.mouseButton??0)),(s=o.sourceEvent)!=null&&s.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!((l=o.sourceEvent)!=null&&l.internal)&&(i==null||i(o.sourceEvent,Js(o.transform)))}}function hS({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&r0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&uS(e.prevViewport,s.transform))){const u=Js(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(s.sourceEvent,u)},n?150:0)}}}function pS({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:l,noPanClassName:u,lib:a}){return c=>{var m;const d=e||t,f=n&&c.ctrlKey;if(c.button===1&&c.type==="mousedown"&&(nr(c,`${a}-flow__node`)||nr(c,`${a}-flow__edge`)))return!0;if(!r&&!d&&!i&&!o&&!n||s||nr(c,l)&&c.type==="wheel"||nr(c,u)&&(c.type!=="wheel"||i&&c.type==="wheel"&&!e)||!n&&c.ctrlKey&&c.type==="wheel")return!1;if(!n&&c.type==="touchstart"&&((m=c.touches)==null?void 0:m.length)>1)return c.preventDefault(),!1;if(!d&&!i&&!f&&c.type==="wheel"||!r&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(r)&&!r.includes(c.button)&&c.type==="mousedown")return!1;const h=Array.isArray(r)&&r.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||c.type==="wheel")&&h}}function gS({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:o,onPanZoom:s,onPanZoomStart:l,onPanZoomEnd:u,onDraggingChange:a}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=$m().clickDistance(!dt(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),h=We(e).call(f);g({x:o.x,y:o.y,zoom:Cr(o.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),v=h.on("dblclick.zoom");f.wheelDelta(i0);function S(D,R){return h?new Promise(_=>{f==null||f.transform(Kl(h,R==null?void 0:R.duration,()=>_(!0)),D)}):Promise.resolve(!1)}function p({noWheelClassName:D,noPanClassName:R,onPaneContextMenu:_,userSelectionActive:O,panOnScroll:E,panOnDrag:I,panOnScrollMode:k,panOnScrollSpeed:M,preventScrolling:$,zoomOnPinch:z,zoomOnScroll:F,zoomOnDoubleClick:Y,zoomActivationKeyPressed:B,lib:G,onTransformChange:W}){O&&!c.isZoomingOrPanning&&y();const H=E&&!B&&!O?aS({zoomPanValues:c,noWheelClassName:D,d3Selection:h,d3Zoom:f,panOnScrollMode:k,panOnScrollSpeed:M,zoomOnPinch:z,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:u}):cS({noWheelClassName:D,preventScrolling:$,d3ZoomHandler:m});if(h.on("wheel.zoom",H,{passive:!1}),!O){const ee=fS({zoomPanValues:c,onDraggingChange:a,onPanZoomStart:l});f.on("start",ee);const q=dS({zoomPanValues:c,panOnDrag:I,onPaneContextMenu:!!_,onPanZoom:s,onTransformChange:W});f.on("zoom",q);const K=hS({zoomPanValues:c,panOnDrag:I,panOnScroll:E,onPaneContextMenu:_,onPanZoomEnd:u,onDraggingChange:a});f.on("end",K)}const Z=pS({zoomActivationKeyPressed:B,panOnDrag:I,zoomOnScroll:F,panOnScroll:E,zoomOnDoubleClick:Y,zoomOnPinch:z,userSelectionActive:O,noPanClassName:R,noWheelClassName:D,lib:G});f.filter(Z),Y?h.on("dblclick.zoom",v):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function g(D,R,_){const O=Ql(D),E=f==null?void 0:f.constrain()(O,R,_);return E&&await S(E),new Promise(I=>I(E))}async function w(D,R){const _=Ql(D);return await S(_,R),new Promise(O=>O(_))}function N(D){if(h){const R=Ql(D),_=h.property("__zoom");(_.k!==D.zoom||_.x!==D.x||_.y!==D.y)&&(f==null||f.transform(h,R,null,{sync:!0}))}}function P(){const D=h?Tm(h.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}function C(D,R){return h?new Promise(_=>{f==null||f.scaleTo(Kl(h,R==null?void 0:R.duration,()=>_(!0)),D)}):Promise.resolve(!1)}function T(D,R){return h?new Promise(_=>{f==null||f.scaleBy(Kl(h,R==null?void 0:R.duration,()=>_(!0)),D)}):Promise.resolve(!1)}function L(D){f==null||f.scaleExtent(D)}function j(D){f==null||f.translateExtent(D)}function A(D){const R=!dt(D)||D<0?0:D;f==null||f.clickDistance(R)}return{update:p,destroy:y,setViewport:w,setViewportConstrained:g,getViewport:P,scaleTo:C,scaleBy:T,setScaleExtent:L,setTranslateExtent:j,syncViewport:N,setClickDistance:A}}var pi;(function(e){e.Line="line",e.Handle="handle"})(pi||(pi={}));function mS({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){const s=e-t,l=n-r,u=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&i&&(u[0]=u[0]*-1),l&&o&&(u[1]=u[1]*-1),u}function yS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function Gt(e,t){return Math.max(0,t-e)}function Xt(e,t){return Math.max(0,e-t)}function So(e,t,n){return Math.max(0,t-e,e-n)}function Ad(e,t){return e?!t:t}function vS(e,t,n,r,i,o,s,l){let{affectsX:u,affectsY:a}=t;const{isHorizontal:c,isVertical:d}=t,f=c&&d,{xSnapped:h,ySnapped:m}=n,{minWidth:v,maxWidth:S,minHeight:p,maxHeight:y}=r,{x:g,y:w,width:N,height:P,aspectRatio:C}=e;let T=Math.floor(c?h-e.pointerX:0),L=Math.floor(d?m-e.pointerY:0);const j=N+(u?-T:T),A=P+(a?-L:L),D=-o[0]*N,R=-o[1]*P;let _=So(j,v,S),O=So(A,p,y);if(s){let k=0,M=0;u&&T<0?k=Gt(g+T+D,s[0][0]):!u&&T>0&&(k=Xt(g+j+D,s[1][0])),a&&L<0?M=Gt(w+L+R,s[0][1]):!a&&L>0&&(M=Xt(w+A+R,s[1][1])),_=Math.max(_,k),O=Math.max(O,M)}if(l){let k=0,M=0;u&&T>0?k=Xt(g+T,l[0][0]):!u&&T<0&&(k=Gt(g+j,l[1][0])),a&&L>0?M=Xt(w+L,l[0][1]):!a&&L<0&&(M=Gt(w+A,l[1][1])),_=Math.max(_,k),O=Math.max(O,M)}if(i){if(c){const k=So(j/C,p,y)*C;if(_=Math.max(_,k),s){let M=0;!u&&!a||u&&!a&&f?M=Xt(w+R+j/C,s[1][1])*C:M=Gt(w+R+(u?T:-T)/C,s[0][1])*C,_=Math.max(_,M)}if(l){let M=0;!u&&!a||u&&!a&&f?M=Gt(w+j/C,l[1][1])*C:M=Xt(w+(u?T:-T)/C,l[0][1])*C,_=Math.max(_,M)}}if(d){const k=So(A*C,v,S)/C;if(O=Math.max(O,k),s){let M=0;!u&&!a||a&&!u&&f?M=Xt(g+A*C+D,s[1][0])/C:M=Gt(g+(a?L:-L)*C+D,s[0][0])/C,O=Math.max(O,M)}if(l){let M=0;!u&&!a||a&&!u&&f?M=Gt(g+A*C,l[1][0])/C:M=Xt(g+(a?L:-L)*C,l[0][0])/C,O=Math.max(O,M)}}}L=L+(L<0?O:-O),T=T+(T<0?_:-_),i&&(f?j>A*C?L=(Ad(u,a)?-T:T)/C:T=(Ad(u,a)?-L:L)*C:c?(L=T/C,a=u):(T=L*C,u=a));const E=u?g+T:g,I=a?w+L:w;return{width:N+(u?-T:T),height:P+(a?-L:L),x:o[0]*T*(u?-1:1)+E,y:o[1]*L*(a?-1:1)+I}}const o0={width:0,height:0,x:0,y:0},wS={...o0,pointerX:0,pointerY:0,aspectRatio:1};function xS(e){return[[0,0],[e.measured.width,e.measured.height]]}function ES(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,s=e.measured.height??0,l=n[0]*o,u=n[1]*s;return[[r-l,i-u],[r+o-l,i+s-u]]}function _S({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const o=We(e);function s({controlPosition:u,boundaries:a,keepAspectRatio:c,onResizeStart:d,onResize:f,onResizeEnd:h,shouldResize:m}){let v={...o0},S={...wS};const p=yS(u);let y,g=null,w=[],N,P,C;const T=lm().on("start",L=>{const{nodeLookup:j,transform:A,snapGrid:D,snapToGrid:R,nodeOrigin:_,paneDomNode:O}=n();if(y=j.get(t),!y)return;g=(O==null?void 0:O.getBoundingClientRect())??null;const{xSnapped:E,ySnapped:I}=hi(L.sourceEvent,{transform:A,snapGrid:D,snapToGrid:R,containerBounds:g});v={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},S={...v,pointerX:E,pointerY:I,aspectRatio:v.width/v.height},N=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=j.get(y.parentId),P=N&&y.extent==="parent"?xS(N):void 0),w=[],C=void 0;for(const[k,M]of j)if(M.parentId===t&&(w.push({id:k,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const $=ES(M,y,M.origin??_);C?C=[[Math.min($[0][0],C[0][0]),Math.min($[0][1],C[0][1])],[Math.max($[1][0],C[1][0]),Math.max($[1][1],C[1][1])]]:C=$}d==null||d(L,{...v})}).on("drag",L=>{const{transform:j,snapGrid:A,snapToGrid:D,nodeOrigin:R}=n(),_=hi(L.sourceEvent,{transform:j,snapGrid:A,snapToGrid:D,containerBounds:g}),O=[];if(!y)return;const{x:E,y:I,width:k,height:M}=v,$={},z=y.origin??R,{width:F,height:Y,x:B,y:G}=vS(S,p,_,a,c,z,P,C),W=F!==k,Q=Y!==M,H=B!==E&&W,Z=G!==I&&Q;if(!H&&!Z&&!W&&!Q)return;if((H||Z||z[0]===1||z[1]===1)&&($.x=H?B:v.x,$.y=Z?G:v.y,v.x=$.x,v.y=$.y,w.length>0)){const re=B-E,se=G-I;for(const Pe of w)Pe.position={x:Pe.position.x-re+z[0]*(F-k),y:Pe.position.y-se+z[1]*(Y-M)},O.push(Pe)}if((W||Q)&&($.width=W?F:v.width,$.height=Q?Y:v.height,v.width=$.width,v.height=$.height),N&&y.expandParent){const re=z[0]*($.width??0);$.x&&$.x<re&&(v.x=re,S.x=S.x-($.x-re));const se=z[1]*($.height??0);$.y&&$.y<se&&(v.y=se,S.y=S.y-($.y-se))}const ee=mS({width:v.width,prevWidth:k,height:v.height,prevHeight:M,affectsX:p.affectsX,affectsY:p.affectsY}),q={...v,direction:ee};(m==null?void 0:m(L,q))!==!1&&(f==null||f(L,q),r($,O))}).on("end",L=>{h==null||h(L,{...v}),i==null||i()});o.call(T)}function l(){o.on(".drag",null)}return{update:s,destroy:l}}var s0={exports:{}},l0={},u0={exports:{}},a0={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var Pr=b;function kS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var SS=typeof Object.is=="function"?Object.is:kS,NS=Pr.useState,CS=Pr.useEffect,MS=Pr.useLayoutEffect,IS=Pr.useDebugValue;function PS(e,t){var n=t(),r=NS({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return MS(function(){i.value=n,i.getSnapshot=t,Zl(i)&&o({inst:i})},[e,n,t]),CS(function(){return Zl(i)&&o({inst:i}),e(function(){Zl(i)&&o({inst:i})})},[e]),IS(n),n}function Zl(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!SS(e,n)}catch{return!0}}function TS(e,t){return t()}var $S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?TS:PS;a0.useSyncExternalStore=Pr.useSyncExternalStore!==void 0?Pr.useSyncExternalStore:$S;u0.exports=a0;var bS=u0.exports;/**
|
|
49
|
+
* @license React
|
|
50
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/var el=b,jS=bS;function OS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var LS=typeof Object.is=="function"?Object.is:OS,zS=jS.useSyncExternalStore,RS=el.useRef,DS=el.useEffect,AS=el.useMemo,FS=el.useDebugValue;l0.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=RS(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=AS(function(){function u(h){if(!a){if(a=!0,c=h,h=r(h),i!==void 0&&s.hasValue){var m=s.value;if(i(m,h))return d=m}return d=h}if(m=d,LS(c,h))return m;var v=r(h);return i!==void 0&&i(m,v)?(c=h,m):(c=h,d=v)}var a=!1,c,d,f=n===void 0?null:n;return[function(){return u(t())},f===null?void 0:function(){return u(f())}]},[t,n,r,i]);var l=zS(e,o[0],o[1]);return DS(function(){s.hasValue=!0,s.value=l},[l]),FS(l),l};s0.exports=l0;var VS=s0.exports;const HS=_a(VS),BS={},Fd=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,h))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>a,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(BS?"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()}},a=t=e(r,i,u);return u},US=e=>e?Fd(e):Fd,{useDebugValue:WS}=Dv,{useSyncExternalStoreWithSelector:YS}=HS,GS=e=>e;function c0(e,t=GS,n){const r=YS(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return WS(r),r}const Vd=(e,t)=>{const n=US(e),r=(i,o=t)=>c0(n,i,o);return Object.assign(r,n),r},XS=(e,t)=>e?Vd(e,t):Vd;function ge(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[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const tl=b.createContext(null),QS=tl.Provider,f0=Bt.error001();function ne(e,t){const n=b.useContext(tl);if(n===null)throw new Error(f0);return c0(n,e,t)}function ce(){const e=b.useContext(tl);if(e===null)throw new Error(f0);return b.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Hd={display:"none"},KS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},d0="react-flow__node-desc",h0="react-flow__edge-desc",ZS="react-flow__aria-live",qS=e=>e.ariaLiveMessage;function JS({rfId:e}){const t=ne(qS);return x.jsx("div",{id:`${ZS}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:KS,children:t})}function e2({rfId:e,disableKeyboardA11y:t}){return x.jsxs(x.Fragment,{children:[x.jsxs("div",{id:`${d0}-${e}`,style:Hd,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."," "]}),x.jsx("div",{id:`${h0}-${e}`,style:Hd,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&x.jsx(JS,{rfId:e})]})}const t2=e=>e.userSelectionActive?"none":"all";function zc({position:e="top-left",children:t,className:n,style:r,...i}){const o=ne(t2),s=`${e}`.split("-");return x.jsx("div",{className:xe(["react-flow__panel",n,...s]),style:{...r,pointerEvents:o},...i,children:t})}function n2({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:x.jsx(zc,{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:x.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const r2=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},No=e=>e.id;function i2(e,t){return ge(e.selectedNodes.map(No),t.selectedNodes.map(No))&&ge(e.selectedEdges.map(No),t.selectedEdges.map(No))}function o2({onSelectionChange:e}){const t=ce(),{selectedNodes:n,selectedEdges:r}=ne(r2,i2);return b.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,r,e]),null}const s2=e=>!!e.onSelectionChangeHandlers;function l2({onSelectionChange:e}){const t=ne(s2);return e||t?x.jsx(o2,{onSelectionChange:e}):null}const p0=[0,0],u2={x:0,y:0,zoom:1},a2=["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"],Bd=[...a2,"rfId"],c2=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}),Ud={translateExtent:Ri,nodeOrigin:p0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function f2(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:u,setPaneClickDistance:a}=ne(c2,ge),c=ce();b.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{d.current=Ud,l()}),[]);const d=b.useRef(Ud);return b.useEffect(()=>{for(const f of Bd){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?i(h):f==="translateExtent"?o(h):f==="nodeExtent"?s(h):f==="paneClickDistance"?a(h):f==="fitView"?c.setState({fitViewOnInit:h}):f==="fitViewOptions"?c.setState({fitViewOnInitOptions:h}):c.setState({[f]:h})))}d.current=e},Bd.map(f=>e[f])),null}function Wd(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function d2(e){var r;const[t,n]=b.useState(e==="system"?null:e);return b.useEffect(()=>{if(e!=="system"){n(e);return}const i=Wd(),o=()=>n(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[e]),t!==null?t:(r=Wd())!=null&&r.matches?"dark":"light"}const Yd=typeof document<"u"?document:null;function Hi(e=null,t={target:Yd,actInsideInputWithModifier:!0}){const[n,r]=b.useState(!1),i=b.useRef(!1),o=b.useRef(new Set([])),[s,l]=b.useMemo(()=>{if(e!==null){const a=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),c=a.reduce((d,f)=>d.concat(...f),[]);return[a,c]}return[[],[]]},[e]);return b.useEffect(()=>{const u=(t==null?void 0:t.target)||Yd;if(e!==null){const a=f=>{if(i.current=f.ctrlKey||f.metaKey||f.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&da(f))return!1;const m=Xd(f.code,l);o.current.add(f[m]),Gd(s,o.current,!1)&&(f.preventDefault(),r(!0))},c=f=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&da(f))return!1;const m=Xd(f.code,l);Gd(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(f[m]),f.key==="Meta"&&o.current.clear(),i.current=!1},d=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",a),u==null||u.addEventListener("keyup",c),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{u==null||u.removeEventListener("keydown",a),u==null||u.removeEventListener("keyup",c),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function Gd(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function Xd(e,t){return t.includes(e)?"code":"key"}const h2=()=>{const e=ce();return b.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:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,o],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{const{nodeLookup:n,minZoom:r,maxZoom:i,panZoom:o,domNode:s}=e.getState();if(!o||!s)return Promise.resolve(!1);const l=aa(n,t),{width:u,height:a}=qs(s);return ca({nodes:l,width:u,height:a,minZoom:r,maxZoom:i,panZoom:o},t)},setCenter:async(t,n,r)=>{const{width:i,height:o,maxZoom:s,panZoom:l}=e.getState(),u=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:s,a=i/2-t*u,c=o/2-n*u;return l?(await l.setViewport({x:a,y:c,zoom:u},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:s,panZoom:l}=e.getState(),u=$c(t,r,i,o,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:r,snapGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:s,y:l}=o.getBoundingClientRect(),u={x:t.x-s,y:t.y-l};return qi(u,r,n.snapToGrid,i)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),s=Vm(t,n);return{x:s.x+i,y:s.y+o}}}),[])};function g0(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const s=r.get(o.id);s?s.push(o):r.set(o.id,[o])}for(const o of t){const s=r.get(o.id);if(!s){n.push(o);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...o};for(const u of s)p2(u,l);n.push(l)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function p2(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&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function g2(e,t){return g0(e,t)}function m2(e,t){return g0(e,t)}function _n(e,t){return{id:e,type:"select",selected:t}}function rr(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const s=t.has(i);!(o.selected===void 0&&!s)&&o.selected!==s&&(n&&(o.selected=s),r.push(_n(o.id,s)))}return r}function Qd({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const l=t.get(s.id),u=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;u!==void 0&&u!==s&&n.push({id:s.id,item:s,type:"replace"}),u===void 0&&n.push({item:s,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Kd(e){return{id:e.id,type:"remove"}}const Zd=e=>bk(e),y2=e=>Lm(e);function m0(e){return b.forwardRef(e)}const v2=typeof window<"u"?b.useLayoutEffect:b.useEffect;function qd(e){const[t,n]=b.useState(BigInt(0)),[r]=b.useState(()=>w2(()=>n(i=>i+BigInt(1))));return v2(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function w2(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const y0=b.createContext(null);function x2({children:e}){const t=ce(),n=b.useCallback(l=>{const{nodes:u=[],setNodes:a,hasDefaultNodes:c,onNodesChange:d,nodeLookup:f}=t.getState();let h=u;for(const m of l)h=typeof m=="function"?m(h):m;c?a(h):d&&d(Qd({items:h,lookup:f}))},[]),r=qd(n),i=b.useCallback(l=>{const{edges:u=[],setEdges:a,hasDefaultEdges:c,onEdgesChange:d,edgeLookup:f}=t.getState();let h=u;for(const m of l)h=typeof m=="function"?m(h):m;c?a(h):d&&d(Qd({items:h,lookup:f}))},[]),o=qd(i),s=b.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return x.jsx(y0.Provider,{value:s,children:e})}function E2(){const e=b.useContext(y0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const _2=e=>!!e.panZoom;function Rc(){const e=h2(),t=ce(),n=E2(),r=ne(_2),i=b.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},u=d=>{var p,y;const{nodeLookup:f,nodeOrigin:h}=t.getState(),m=Zd(d)?d:f.get(d.id),v=m.parentId?Bm(m.position,m.measured,m.parentId,f,h):m.position,S={id:m.id,position:v,width:((p=m.measured)==null?void 0:p.width)??m.width,height:((y=m.measured)==null?void 0:y.height)??m.height,data:m.data};return Mr(S)},a=(d,f,h={replace:!1})=>{s(m=>m.map(v=>{if(v.id===d){const S=typeof f=="function"?f(v):f;return h.replace&&Zd(S)?S:{...v,...S}}return v}))},c=(d,f,h={replace:!1})=>{l(m=>m.map(v=>{if(v.id===d){const S=typeof f=="function"?f(v):f;return h.replace&&y2(S)?S:{...v,...S}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=o(d))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(h=>[...h,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(h=>[...h,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:h}=t.getState(),[m,v,S]=h;return{nodes:d.map(p=>({...p})),edges:f.map(p=>({...p})),viewport:{x:m,y:v,zoom:S}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:h,edges:m,onNodesDelete:v,onEdgesDelete:S,triggerNodeChanges:p,triggerEdgeChanges:y,onDelete:g,onBeforeDelete:w}=t.getState(),{nodes:N,edges:P}=await Lk({nodesToRemove:d,edgesToRemove:f,nodes:h,edges:m,onBeforeDelete:w}),C=P.length>0,T=N.length>0;if(C){const L=P.map(Kd);S==null||S(P),y(L)}if(T){const L=N.map(Kd);v==null||v(N),p(L)}return(T||C)&&(g==null||g({nodes:N,edges:P})),{deletedNodes:N,deletedEdges:P}},getIntersectingNodes:(d,f=!0,h)=>{const m=Td(d),v=m?d:u(d),S=h!==void 0;return v?(h||t.getState().nodes).filter(p=>{const y=t.getState().nodeLookup.get(p.id);if(y&&!m&&(p.id===d.id||!y.internals.positionAbsolute))return!1;const g=Mr(S?p:y),w=Fi(g,v);return f&&w>0||w>=v.width*v.height}):[]},isNodeIntersecting:(d,f,h=!0)=>{const v=Td(d)?d:u(d);if(!v)return!1;const S=Fi(v,f);return h&&S>0||S>=v.width*v.height},updateNode:a,updateNodeData:(d,f,h={replace:!1})=>{a(d,m=>{const v=typeof f=="function"?f(m):f;return h.replace?{...m,data:v}:{...m,data:{...m.data,...v}}},h)},updateEdge:c,updateEdgeData:(d,f,h={replace:!1})=>{c(d,m=>{const v=typeof f=="function"?f(m):f;return h.replace?{...m,data:v}:{...m,data:{...m.data,...v}}},h)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:h}=t.getState();return jk(d,{nodeLookup:f,nodeOrigin:h})},getHandleConnections:({type:d,id:f,nodeId:h})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${h}-${d}-${f??null}`))==null?void 0:m.values())??[])}}},[]);return b.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const Jd=e=>e.selected,k2={actInsideInputWithModifier:!1},S2=typeof window<"u"?window:void 0;function N2({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ce(),{deleteElements:r}=Rc(),i=Hi(e,k2),o=Hi(t,{target:S2});b.useEffect(()=>{if(i){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(Jd),edges:s.filter(Jd)}),n.setState({nodesSelectionActive:!1})}},[i]),b.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function C2(e){const t=ce();b.useEffect(()=>{const n=()=>{var i,o;if(!e.current)return!1;const r=qs(e.current);(r.height===0||r.width===0)&&((o=(i=t.getState()).onError)==null||o.call(i,"004",Bt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const nl={position:"absolute",width:"100%",height:"100%",top:0,left:0},M2=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function I2({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=$n.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:a,minZoom:c,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:h=!0,children:m,noWheelClassName:v,noPanClassName:S,onViewportChange:p,isControlledViewport:y,paneClickDistance:g}){const w=ce(),N=b.useRef(null),{userSelectionActive:P,lib:C}=ne(M2,ge),T=Hi(f),L=b.useRef();C2(N);const j=b.useCallback(A=>{p==null||p({x:A[0],y:A[1],zoom:A[2]}),y||w.setState({transform:A})},[p,y]);return b.useEffect(()=>{if(N.current){L.current=gS({domNode:N.current,minZoom:c,maxZoom:d,translateExtent:a,viewport:u,paneClickDistance:g,onDraggingChange:_=>w.setState({paneDragging:_}),onPanZoomStart:(_,O)=>{const{onViewportChangeStart:E,onMoveStart:I}=w.getState();I==null||I(_,O),E==null||E(O)},onPanZoom:(_,O)=>{const{onViewportChange:E,onMove:I}=w.getState();I==null||I(_,O),E==null||E(O)},onPanZoomEnd:(_,O)=>{const{onViewportChangeEnd:E,onMoveEnd:I}=w.getState();I==null||I(_,O),E==null||E(O)}});const{x:A,y:D,zoom:R}=L.current.getViewport();return w.setState({panZoom:L.current,transform:[A,D,R],domNode:N.current.closest(".react-flow")}),()=>{var _;(_=L.current)==null||_.destroy()}}},[]),b.useEffect(()=>{var A;(A=L.current)==null||A.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:T,preventScrolling:h,noPanClassName:S,userSelectionActive:P,noWheelClassName:v,lib:C,onTransformChange:j})},[e,t,n,r,i,o,s,l,T,h,S,P,v,C,j]),x.jsx("div",{className:"react-flow__renderer",ref:N,style:nl,children:m})}const P2=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function T2(){const{userSelectionActive:e,userSelectionRect:t}=ne(P2,ge);return e&&t?x.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 ql=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},$2=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function b2({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Di.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:o,onSelectionEnd:s,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:a,onPaneMouseEnter:c,onPaneMouseMove:d,onPaneMouseLeave:f,children:h}){const m=b.useRef(null),v=ce(),S=b.useRef(0),p=b.useRef(0),y=b.useRef(),g=b.useRef(new Map),{userSelectionActive:w,elementsSelectable:N,dragging:P}=ne($2,ge),C=N&&(e||w),T=b.useRef(!1),L=b.useRef(!1),j=()=>{v.setState({userSelectionActive:!1,userSelectionRect:null}),S.current=0,p.current=0},A=k=>{if(T.current){T.current=!1;return}l==null||l(k),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},D=k=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){k.preventDefault();return}u==null||u(k)},R=a?k=>a(k):void 0,_=k=>{var B,G,W,Q;const{resetSelectedElements:M,domNode:$,edgeLookup:z}=v.getState();if(y.current=$==null?void 0:$.getBoundingClientRect(),!N||!e||k.button!==0||k.target!==m.current||!y.current)return;(G=(B=k.target)==null?void 0:B.setPointerCapture)==null||G.call(B,k.pointerId),L.current=!0,T.current=!1,g.current=new Map;for(const[H,Z]of z)g.current.set(Z.source,((W=g.current.get(Z.source))==null?void 0:W.add(H))||new Set([H])),g.current.set(Z.target,((Q=g.current.get(Z.target))==null?void 0:Q.add(H))||new Set([H]));const{x:F,y:Y}=Lt(k.nativeEvent,y.current);M(),v.setState({userSelectionRect:{width:0,height:0,startX:F,startY:Y,x:F,y:Y}}),o==null||o(k)},O=k=>{const{userSelectionRect:M,edgeLookup:$,transform:z,nodeLookup:F,triggerNodeChanges:Y,triggerEdgeChanges:B}=v.getState();if(!y.current||!M)return;T.current=!0;const{x:G,y:W}=Lt(k.nativeEvent,y.current),{startX:Q,startY:H}=M,Z={startX:Q,startY:H,x:G<Q?G:Q,y:W<H?W:H,width:Math.abs(G-Q),height:Math.abs(W-H)},ee=zm(F,Z,z,n===Di.Partial,!0),q=new Set,K=new Set;for(const re of ee){K.add(re.id);const se=g.current.get(re.id);if(se)for(const Pe of se)q.add(Pe)}if(S.current!==K.size){S.current=K.size;const re=rr(F,K,!0);Y(re)}if(p.current!==q.size){p.current=q.size;const re=rr($,q);B(re)}v.setState({userSelectionRect:Z,userSelectionActive:!0,nodesSelectionActive:!1})},E=k=>{var $,z;if(k.button!==0||!L.current)return;(z=($=k.target)==null?void 0:$.releasePointerCapture)==null||z.call($,k.pointerId);const{userSelectionRect:M}=v.getState();!w&&M&&k.target===m.current&&(A==null||A(k)),S.current>0&&v.setState({nodesSelectionActive:!0}),j(),s==null||s(k),(t||i)&&(T.current=!1),L.current=!1},I=r===!0||Array.isArray(r)&&r.includes(0);return x.jsxs("div",{className:xe(["react-flow__pane",{draggable:I,dragging:P,selection:e}]),onClick:C?void 0:ql(A,m),onContextMenu:ql(D,m),onWheel:ql(R,m),onPointerEnter:C?void 0:c,onPointerDown:C?_:d,onPointerMove:C?O:d,onPointerUp:C?E:void 0,onPointerLeave:f,ref:m,style:nl,children:[h,x.jsx(T2,{})]})}function ya({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:l,onError:u}=t.getState(),a=l.get(e);if(!a){u==null||u("012",Bt.error012(e));return}t.setState({nodesSelectionActive:!1}),a.selected?(n||a.selected&&s)&&(o({nodes:[a],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):i([e])}function v0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:s}){const l=ce(),[u,a]=b.useState(!1),c=b.useRef();return b.useEffect(()=>{c.current=tS({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{ya({id:d,store:l,nodeRef:e})},onDragStart:()=>{a(!0)},onDragStop:()=>{a(!1)}})},[]),b.useEffect(()=>{var d,f;if(t)(d=c.current)==null||d.destroy();else if(e.current)return(f=c.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:s}),()=>{var h;(h=c.current)==null||h.destroy()}},[n,r,t,o,e,i]),u}const j2=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function w0(){const e=ce();return b.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:o,nodesDraggable:s,onError:l,updateNodePositions:u,nodeLookup:a,nodeOrigin:c}=e.getState(),d=new Map,f=j2(s),h=i?o[0]:5,m=i?o[1]:5,v=n.direction.x*h*n.factor,S=n.direction.y*m*n.factor;for(const[,p]of a){if(!f(p))continue;let y={x:p.internals.positionAbsolute.x+v,y:p.internals.positionAbsolute.y+S};i&&(y=Zs(y,o));const{position:g,positionAbsolute:w}=Rm({nodeId:p.id,nextPosition:y,nodeLookup:a,nodeExtent:r,nodeOrigin:c,onError:l});p.position=g,p.internals.positionAbsolute=w,d.set(p.id,p)}u(d)},[])}const Dc=b.createContext(null),O2=Dc.Provider;Dc.Consumer;const x0=()=>b.useContext(Dc),L2=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),z2=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:o,connection:s}=r,{fromHandle:l,toHandle:u,isValid:a}=s,c=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:c,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===Nr.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,valid:c&&a}};function R2({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:l,children:u,className:a,onMouseDown:c,onTouchStart:d,...f},h){var _,O;const m=s||null,v=e==="target",S=ce(),p=x0(),{connectOnClick:y,noPanClassName:g,rfId:w}=ne(L2,ge),{connectingFrom:N,connectingTo:P,clickConnecting:C,isPossibleEndHandle:T,connectionInProcess:L,valid:j}=ne(z2(p,m,e),ge);p||(O=(_=S.getState()).onError)==null||O.call(_,"010",Bt.error010());const A=E=>{const{defaultEdgeOptions:I,onConnect:k,hasDefaultEdges:M}=S.getState(),$={...I,...E};if(M){const{edges:z,setEdges:F}=S.getState();F(Hk($,z))}k==null||k($),l==null||l($)},D=E=>{if(!p)return;const I=Wm(E.nativeEvent);if(i&&(I&&E.button===0||!I)){const k=S.getState();ma.onPointerDown(E.nativeEvent,{autoPanOnConnect:k.autoPanOnConnect,connectionMode:k.connectionMode,connectionRadius:k.connectionRadius,domNode:k.domNode,nodeLookup:k.nodeLookup,lib:k.lib,isTarget:v,handleId:m,nodeId:p,flowId:k.rfId,panBy:k.panBy,cancelConnection:k.cancelConnection,onConnectStart:k.onConnectStart,onConnectEnd:k.onConnectEnd,updateConnection:k.updateConnection,onConnect:A,isValidConnection:n||k.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:k.autoPanSpeed})}I?c==null||c(E):d==null||d(E)},R=E=>{const{onClickConnectStart:I,onClickConnectEnd:k,connectionClickStartHandle:M,connectionMode:$,isValidConnection:z,lib:F,rfId:Y,nodeLookup:B,connection:G}=S.getState();if(!p||!M&&!i)return;if(!M){I==null||I(E.nativeEvent,{nodeId:p,handleId:m,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:p,type:e,id:m}});return}const W=Um(E.target),Q=n||z,{connection:H,isValid:Z}=ma.isValid(E.nativeEvent,{handle:{nodeId:p,id:m,type:e},connectionMode:$,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:Q,flowId:Y,doc:W,lib:F,nodeLookup:B});Z&&H&&A(H);const ee=structuredClone(G);delete ee.inProgress,ee.toPosition=ee.toHandle?ee.toHandle.position:null,k==null||k(E,ee),S.setState({connectionClickStartHandle:null})};return x.jsx("div",{"data-handleid":m,"data-nodeid":p,"data-handlepos":t,"data-id":`${w}-${p}-${m}-${e}`,className:xe(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,a,{source:!v,target:v,connectable:r,connectablestart:i,connectableend:o,clickconnecting:C,connectingfrom:N,connectingto:P,valid:j,connectionindicator:r&&(!L||T)&&(L?o:i)}]),onMouseDown:D,onTouchStart:D,onClick:y?R:void 0,ref:h,...f,children:u})}const rn=b.memo(m0(R2));function D2({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return x.jsxs(x.Fragment,{children:[e==null?void 0:e.label,x.jsx(rn,{type:"source",position:n,isConnectable:t})]})}function A2({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:r=X.Bottom}){return x.jsxs(x.Fragment,{children:[x.jsx(rn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,x.jsx(rn,{type:"source",position:r,isConnectable:t})]})}function F2(){return null}function V2({data:e,isConnectable:t,targetPosition:n=X.Top}){return x.jsxs(x.Fragment,{children:[x.jsx(rn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ks={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},eh={input:D2,default:A2,output:V2,group:F2};function H2(e){var t,n,r,i;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??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const B2=e=>{const{width:t,height:n,x:r,y:i}=Zi(e.nodeLookup,{filter:o=>!!o.selected});return{width:dt(t)?t:null,height:dt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function U2({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ce(),{width:i,height:o,transformString:s,userSelectionActive:l}=ne(B2,ge),u=w0(),a=b.useRef(null);if(b.useEffect(()=>{var f;n||(f=a.current)==null||f.focus({preventScroll:!0})},[n]),v0({nodeRef:a}),l||!i||!o)return null;const c=e?f=>{const h=r.getState().nodes.filter(m=>m.selected);e(f,h)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(ks,f.key)&&u({direction:ks[f.key],factor:f.shiftKey?4:1})};return x.jsx("div",{className:xe(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:x.jsx("div",{ref:a,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:i,height:o}})})}const th=typeof window<"u"?window:void 0,W2=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function E0({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:a,selectionOnDrag:c,selectionMode:d,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:m,panActivationKeyCode:v,zoomActivationKeyCode:S,elementsSelectable:p,zoomOnScroll:y,zoomOnPinch:g,panOnScroll:w,panOnScrollSpeed:N,panOnScrollMode:P,zoomOnDoubleClick:C,panOnDrag:T,defaultViewport:L,translateExtent:j,minZoom:A,maxZoom:D,preventScrolling:R,onSelectionContextMenu:_,noWheelClassName:O,noPanClassName:E,disableKeyboardA11y:I,onViewportChange:k,isControlledViewport:M}){const{nodesSelectionActive:$,userSelectionActive:z}=ne(W2),F=Hi(a,{target:th}),Y=Hi(v,{target:th}),B=Y||T,G=Y||w,W=c&&B!==!0,Q=F||z||W;return N2({deleteKeyCode:u,multiSelectionKeyCode:m}),x.jsx(I2,{onPaneContextMenu:o,elementsSelectable:p,zoomOnScroll:y,zoomOnPinch:g,panOnScroll:G,panOnScrollSpeed:N,panOnScrollMode:P,zoomOnDoubleClick:C,panOnDrag:!F&&B,defaultViewport:L,translateExtent:j,minZoom:A,maxZoom:D,zoomActivationKeyCode:S,preventScrolling:R,noWheelClassName:O,noPanClassName:E,onViewportChange:k,isControlledViewport:M,paneClickDistance:l,children:x.jsxs(b2,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:B,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:F,selectionOnDrag:W,children:[e,$&&x.jsx(U2,{onSelectionContextMenu:_,noPanClassName:E,disableKeyboardA11y:I})]})})}E0.displayName="FlowRenderer";const Y2=b.memo(E0),G2=e=>t=>e?zm(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 X2(e){return ne(b.useCallback(G2(e),[e]),ge)}const Q2=e=>e.updateNodeInternals;function K2(){const e=ne(Q2),[t]=b.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const o=i.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:i.target,force:!0})}),e(r)}));return b.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Z2({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=ce(),o=b.useRef(null),s=b.useRef(null),l=b.useRef(e.sourcePosition),u=b.useRef(e.targetPosition),a=b.useRef(t),c=n&&!!e.internals.handleBounds;return b.useEffect(()=>{o.current&&!e.hidden&&(!c||s.current!==o.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(o.current),s.current=o.current)},[c,e.hidden]),b.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),b.useEffect(()=>{if(o.current){const d=a.current!==t,f=l.current!==e.sourcePosition,h=u.current!==e.targetPosition;(d||f||h)&&(a.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function q2({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:s,nodesDraggable:l,elementsSelectable:u,nodesConnectable:a,nodesFocusable:c,resizeObserver:d,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:m,rfId:v,nodeTypes:S,nodeExtent:p,nodeClickDistance:y,onError:g}){const{node:w,internals:N,isParent:P}=ne(H=>{const Z=H.nodeLookup.get(e),ee=H.parentLookup.has(e);return{node:Z,internals:Z.internals,isParent:ee}},ge);let C=w.type||"default",T=(S==null?void 0:S[C])||eh[C];T===void 0&&(g==null||g("003",Bt.error003(C)),C="default",T=eh.default);const L=!!(w.draggable||l&&typeof w.draggable>"u"),j=!!(w.selectable||u&&typeof w.selectable>"u"),A=!!(w.connectable||a&&typeof w.connectable>"u"),D=!!(w.focusable||c&&typeof w.focusable>"u"),R=ce(),_=Hm(w),O=Z2({node:w,nodeType:C,hasDimensions:_,resizeObserver:d}),E=v0({nodeRef:O,disabled:w.hidden||!L,noDragClassName:f,handleSelector:w.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),I=w0();if(w.hidden)return null;const k=Ut(w),M=H2(w),$=j||L||t||n||r||i,z=n?H=>n(H,{...N.userNode}):void 0,F=r?H=>r(H,{...N.userNode}):void 0,Y=i?H=>i(H,{...N.userNode}):void 0,B=o?H=>o(H,{...N.userNode}):void 0,G=s?H=>s(H,{...N.userNode}):void 0,W=H=>{const{selectNodesOnDrag:Z,nodeDragThreshold:ee}=R.getState();j&&(!Z||!L||ee>0)&&ya({id:e,store:R,nodeRef:O}),t&&t(H,{...N.userNode})},Q=H=>{if(!(da(H.nativeEvent)||m))if(bm.includes(H.key)&&j){const Z=H.key==="Escape";ya({id:e,store:R,unselect:Z,nodeRef:O})}else L&&w.selected&&Object.prototype.hasOwnProperty.call(ks,H.key)&&(R.setState({ariaLiveMessage:`Moved selected node ${H.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~N.positionAbsolute.x}, y: ${~~N.positionAbsolute.y}`}),I({direction:ks[H.key],factor:H.shiftKey?4:1}))};return x.jsx("div",{className:xe(["react-flow__node",`react-flow__node-${C}`,{[h]:L},w.className,{selected:w.selected,selectable:j,parent:P,draggable:L,dragging:E}]),ref:O,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:_?"visible":"hidden",...w.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:F,onMouseLeave:Y,onContextMenu:B,onClick:W,onDoubleClick:G,onKeyDown:D?Q:void 0,tabIndex:D?0:void 0,role:D?"button":void 0,"aria-describedby":m?void 0:`${d0}-${v}`,"aria-label":w.ariaLabel,children:x.jsx(O2,{value:e,children:x.jsx(T,{id:e,data:w.data,type:C,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:w.selected,selectable:j,draggable:L,deletable:w.deletable??!0,isConnectable:A,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:E,dragHandle:w.dragHandle,zIndex:N.z,parentId:w.parentId,...k})})})}const J2=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function _0(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:o}=ne(J2,ge),s=X2(e.onlyRenderVisibleElements),l=K2();return x.jsx("div",{className:"react-flow__nodes",style:nl,children:s.map(u=>x.jsx(q2,{id:u,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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}_0.displayName="NodeRenderer";const eN=b.memo(_0);function tN(e){return ne(b.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const o=n.nodeLookup.get(i.source),s=n.nodeLookup.get(i.target);o&&s&&Ak({sourceNode:o,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),ge)}const nN=({color:e="none",strokeWidth:t=1})=>x.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),rN=({color:e="none",strokeWidth:t=1})=>x.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),nh={[Ai.Arrow]:nN,[Ai.ArrowClosed]:rN};function iN(e){const t=ce();return b.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(nh,e)?nh[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",Bt.error009(e)),null)},[e])}const oN=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const u=iN(t);return u?x.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:x.jsx(u,{color:n,strokeWidth:s})}):null},k0=({defaultColor:e,rfId:t})=>{const n=ne(o=>o.edges),r=ne(o=>o.defaultEdgeOptions),i=b.useMemo(()=>Gk(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?x.jsx("svg",{className:"react-flow__marker",children:x.jsx("defs",{children:i.map(o=>x.jsx(oN,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};k0.displayName="MarkerDefinitions";var sN=b.memo(k0);function S0({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:u,className:a,...c}){const[d,f]=b.useState({x:1,y:0,width:0,height:0}),h=xe(["react-flow__edge-textwrapper",a]),m=b.useRef(null);return b.useEffect(()=>{if(m.current){const v=m.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:x.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?"visible":"hidden",...c,children:[i&&x.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),x.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:m,style:r,children:n}),u]})}S0.displayName="EdgeText";const lN=b.memo(S0);function rl({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:a,style:c,markerEnd:d,markerStart:f,className:h,interactionWidth:m=20}){return x.jsxs(x.Fragment,{children:[x.jsx("path",{id:e,style:c,d:t,fill:"none",className:xe(["react-flow__edge-path",h]),markerEnd:d,markerStart:f}),m&&x.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}),i&&dt(n)&&dt(r)?x.jsx(lN,{x:n,y:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:a}):null]})}function rh({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===X.Left||e===X.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function N0({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:i,targetPosition:o=X.Top}){const[s,l]=rh({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,a]=rh({pos:o,x1:r,y1:i,x2:e,y2:t}),[c,d,f,h]=Ym({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:a});return[`M${e},${t} C${s},${l} ${u},${a} ${r},${i}`,c,d,f,h]}function C0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=X.Bottom,targetPosition:l=X.Top,label:u,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:m,markerEnd:v,markerStart:S,interactionWidth:p})=>{const[y,g,w]=N0({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:l}),N=e.isInternal?void 0:t;return x.jsx(rl,{id:N,path:y,labelX:g,labelY:w,label:u,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:m,markerEnd:v,markerStart:S,interactionWidth:p})})}const uN=C0({isInternal:!1}),M0=C0({isInternal:!0});uN.displayName="SimpleBezierEdge";M0.displayName="SimpleBezierEdgeInternal";function I0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:d,style:f,sourcePosition:h=X.Bottom,targetPosition:m=X.Top,markerEnd:v,markerStart:S,pathOptions:p,interactionWidth:y})=>{const[g,w,N]=ha({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:o,targetPosition:m,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset}),P=e.isInternal?void 0:t;return x.jsx(rl,{id:P,path:g,labelX:w,labelY:N,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:v,markerStart:S,interactionWidth:y})})}const P0=I0({isInternal:!1}),T0=I0({isInternal:!0});P0.displayName="SmoothStepEdge";T0.displayName="SmoothStepEdgeInternal";function $0(e){return b.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return x.jsx(P0,{...n,id:r,pathOptions:b.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const aN=$0({isInternal:!1}),b0=$0({isInternal:!0});aN.displayName="StepEdge";b0.displayName="StepEdgeInternal";function j0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:v})=>{const[S,p,y]=Qm({sourceX:n,sourceY:r,targetX:i,targetY:o}),g=e.isInternal?void 0:t;return x.jsx(rl,{id:g,path:S,labelX:p,labelY:y,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:v})})}const cN=j0({isInternal:!1}),O0=j0({isInternal:!0});cN.displayName="StraightEdge";O0.displayName="StraightEdgeInternal";function L0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=X.Bottom,targetPosition:l=X.Top,label:u,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:m,markerEnd:v,markerStart:S,pathOptions:p,interactionWidth:y})=>{const[g,w,N]=Gm({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:l,curvature:p==null?void 0:p.curvature}),P=e.isInternal?void 0:t;return x.jsx(rl,{id:P,path:g,labelX:w,labelY:N,label:u,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:m,markerEnd:v,markerStart:S,interactionWidth:y})})}const fN=L0({isInternal:!1}),z0=L0({isInternal:!0});fN.displayName="BezierEdge";z0.displayName="BezierEdgeInternal";const ih={default:z0,straight:O0,step:b0,smoothstep:T0,simplebezier:M0},oh={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},dN=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,hN=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,sh="react-flow__edgeupdater";function lh({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:l}){return x.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:xe([sh,`${sh}-${l}`]),cx:dN(t,r,e),cy:hN(n,r,e),r,stroke:"transparent",fill:"transparent"})}function pN({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:s,sourcePosition:l,targetPosition:u,onReconnect:a,onReconnectStart:c,onReconnectEnd:d,setReconnecting:f,setUpdateHover:h}){const m=ce(),v=(w,N)=>{if(w.button!==0)return;const{autoPanOnConnect:P,domNode:C,isValidConnection:T,connectionMode:L,connectionRadius:j,lib:A,onConnectStart:D,onConnectEnd:R,cancelConnection:_,nodeLookup:O,rfId:E,panBy:I,updateConnection:k}=m.getState(),M=N.type==="target";f(!0),c==null||c(w,n,N.type);const $=(F,Y)=>{f(!1),d==null||d(F,n,N.type,Y)},z=F=>a==null?void 0:a(n,F);ma.onPointerDown(w.nativeEvent,{autoPanOnConnect:P,connectionMode:L,connectionRadius:j,domNode:C,handleId:N.id,nodeId:N.nodeId,nodeLookup:O,isTarget:M,edgeUpdaterType:N.type,lib:A,flowId:E,cancelConnection:_,panBy:I,isValidConnection:T,onConnect:z,onConnectStart:D,onConnectEnd:R,onReconnectEnd:$,updateConnection:k,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle})},S=w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>h(!0),g=()=>h(!1);return x.jsxs(x.Fragment,{children:[(e===!0||e==="source")&&x.jsx(lh,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:y,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&x.jsx(lh,{position:u,centerX:o,centerY:s,radius:t,onMouseDown:p,onMouseEnter:y,onMouseOut:g,type:"target"})]})}function gN({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,rfId:m,edgeTypes:v,noPanClassName:S,onError:p,disableKeyboardA11y:y}){let g=ne(K=>K.edgeLookup.get(e));const w=ne(K=>K.defaultEdgeOptions);g=w?{...w,...g}:g;let N=g.type||"default",P=(v==null?void 0:v[N])||ih[N];P===void 0&&(p==null||p("011",Bt.error011(N)),N="default",P=ih.default);const C=!!(g.focusable||t&&typeof g.focusable>"u"),T=typeof d<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),L=!!(g.selectable||r&&typeof g.selectable>"u"),j=b.useRef(null),[A,D]=b.useState(!1),[R,_]=b.useState(!1),O=ce(),{zIndex:E,sourceX:I,sourceY:k,targetX:M,targetY:$,sourcePosition:z,targetPosition:F}=ne(b.useCallback(K=>{const re=K.nodeLookup.get(g.source),se=K.nodeLookup.get(g.target);if(!re||!se)return{zIndex:g.zIndex,...oh};const Pe=Yk({id:e,sourceNode:re,targetNode:se,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:K.connectionMode,onError:p});return{zIndex:Dk({selected:g.selected,zIndex:g.zIndex,sourceNode:re,targetNode:se,elevateOnSelect:K.elevateEdgesOnSelect}),...Pe||oh}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),ge),Y=b.useMemo(()=>g.markerStart?`url('#${pa(g.markerStart,m)}')`:void 0,[g.markerStart,m]),B=b.useMemo(()=>g.markerEnd?`url('#${pa(g.markerEnd,m)}')`:void 0,[g.markerEnd,m]);if(g.hidden||I===null||k===null||M===null||$===null)return null;const G=K=>{var Wt;const{addSelectedEdges:re,unselectNodesAndEdges:se,multiSelectionActive:Pe}=O.getState();L&&(O.setState({nodesSelectionActive:!1}),g.selected&&Pe?(se({nodes:[],edges:[g]}),(Wt=j.current)==null||Wt.blur()):re([e])),i&&i(K,g)},W=o?K=>{o(K,{...g})}:void 0,Q=s?K=>{s(K,{...g})}:void 0,H=l?K=>{l(K,{...g})}:void 0,Z=u?K=>{u(K,{...g})}:void 0,ee=a?K=>{a(K,{...g})}:void 0,q=K=>{var re;if(!y&&bm.includes(K.key)&&L){const{unselectNodesAndEdges:se,addSelectedEdges:Pe}=O.getState();K.key==="Escape"?((re=j.current)==null||re.blur(),se({edges:[g]})):Pe([e])}};return x.jsx("svg",{style:{zIndex:E},children:x.jsxs("g",{className:xe(["react-flow__edge",`react-flow__edge-${N}`,g.className,S,{selected:g.selected,animated:g.animated,inactive:!L&&!i,updating:A,selectable:L}]),onClick:G,onDoubleClick:W,onContextMenu:Q,onMouseEnter:H,onMouseMove:Z,onMouseLeave:ee,onKeyDown:C?q:void 0,tabIndex:C?0:void 0,role:C?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":C?`${h0}-${m}`:void 0,ref:j,children:[!R&&x.jsx(P,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:L,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:I,sourceY:k,targetX:M,targetY:$,sourcePosition:z,targetPosition:F,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:Y,markerEnd:B,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),T&&x.jsx(pN,{edge:g,isReconnectable:T,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,sourceX:I,sourceY:k,targetX:M,targetY:$,sourcePosition:z,targetPosition:F,setUpdateHover:D,setReconnecting:_})]})})}const mN=e=>({width:e.width,height:e.height,edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function R0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:a,onEdgeClick:c,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:m,disableKeyboardA11y:v}){const{edgesFocusable:S,edgesReconnectable:p,elementsSelectable:y,onError:g}=ne(mN,ge),w=tN(t);return x.jsxs("div",{className:"react-flow__edges",children:[x.jsx(sN,{defaultColor:e,rfId:n}),w.map(N=>x.jsx(gN,{id:N,edgesFocusable:S,edgesReconnectable:p,elementsSelectable:y,noPanClassName:i,onReconnect:o,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,onClick:c,reconnectRadius:d,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:m,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:v},N))]})}R0.displayName="EdgeRenderer";const yN=b.memo(R0),vN=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function wN({children:e}){const t=ne(vN);return x.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function xN(e){const t=Rc(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const EN=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function _N(e){const t=ne(EN),n=ce();return b.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function kN(e){return e.connection.inProgress?{...e.connection,to:qi(e.connection.to,e.transform)}:{...e.connection}}function SN(e){return kN}function NN(e){const t=SN();return ne(t,ge)}const CN=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MN({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:o,height:s,isValid:l,inProgress:u}=ne(CN,ge);return!(o&&i&&u)?null:x.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:x.jsx("g",{className:xe(["react-flow__connection",Om(l)]),children:x.jsx(D0,{style:t,type:n,CustomComponent:r,isValid:l})})})}const D0=({style:e,type:t=en.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:o,fromNode:s,fromHandle:l,fromPosition:u,to:a,toNode:c,toHandle:d,toPosition:f}=NN();if(!i)return;if(n)return x.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:o.x,fromY:o.y,toX:a.x,toY:a.y,fromPosition:u,toPosition:f,connectionStatus:Om(r),toNode:c,toHandle:d});let h="";const m={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:a.x,targetY:a.y,targetPosition:f};switch(t){case en.Bezier:[h]=Gm(m);break;case en.SimpleBezier:[h]=N0(m);break;case en.Step:[h]=ha({...m,borderRadius:0});break;case en.SmoothStep:[h]=ha(m);break;default:[h]=Qm(m)}return x.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};D0.displayName="ConnectionLine";const IN={};function uh(e=IN){b.useRef(e),ce(),b.useEffect(()=>{},[e])}function PN(){ce(),b.useRef(!1),b.useEffect(()=>{},[])}function A0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:c,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:h,connectionLineType:m,connectionLineStyle:v,connectionLineComponent:S,connectionLineContainerStyle:p,selectionKeyCode:y,selectionOnDrag:g,selectionMode:w,multiSelectionKeyCode:N,panActivationKeyCode:P,zoomActivationKeyCode:C,deleteKeyCode:T,onlyRenderVisibleElements:L,elementsSelectable:j,defaultViewport:A,translateExtent:D,minZoom:R,maxZoom:_,preventScrolling:O,defaultMarkerColor:E,zoomOnScroll:I,zoomOnPinch:k,panOnScroll:M,panOnScrollSpeed:$,panOnScrollMode:z,zoomOnDoubleClick:F,panOnDrag:Y,onPaneClick:B,onPaneMouseEnter:G,onPaneMouseMove:W,onPaneMouseLeave:Q,onPaneScroll:H,onPaneContextMenu:Z,paneClickDistance:ee,nodeClickDistance:q,onEdgeContextMenu:K,onEdgeMouseEnter:re,onEdgeMouseMove:se,onEdgeMouseLeave:Pe,reconnectRadius:Wt,onReconnect:ll,onReconnectStart:ul,onReconnectEnd:al,noDragClassName:Or,noWheelClassName:cl,noPanClassName:Lr,disableKeyboardA11y:zr,nodeExtent:fl,rfId:Rr,viewport:Dr,onViewportChange:Ji}){return uh(e),uh(t),PN(),xN(n),_N(Dr),x.jsx(Y2,{onPaneClick:B,onPaneMouseEnter:G,onPaneMouseMove:W,onPaneMouseLeave:Q,onPaneContextMenu:Z,onPaneScroll:H,paneClickDistance:ee,deleteKeyCode:T,selectionKeyCode:y,selectionOnDrag:g,selectionMode:w,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:N,panActivationKeyCode:P,zoomActivationKeyCode:C,elementsSelectable:j,zoomOnScroll:I,zoomOnPinch:k,zoomOnDoubleClick:F,panOnScroll:M,panOnScrollSpeed:$,panOnScrollMode:z,panOnDrag:Y,defaultViewport:A,translateExtent:D,minZoom:R,maxZoom:_,onSelectionContextMenu:d,preventScrolling:O,noDragClassName:Or,noWheelClassName:cl,noPanClassName:Lr,disableKeyboardA11y:zr,onViewportChange:Ji,isControlledViewport:!!Dr,children:x.jsxs(wN,{children:[x.jsx(yN,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:s,onReconnect:ll,onReconnectStart:ul,onReconnectEnd:al,onlyRenderVisibleElements:L,onEdgeContextMenu:K,onEdgeMouseEnter:re,onEdgeMouseMove:se,onEdgeMouseLeave:Pe,reconnectRadius:Wt,defaultMarkerColor:E,noPanClassName:Lr,disableKeyboardA11y:zr,rfId:Rr}),x.jsx(MN,{style:v,type:m,component:S,containerStyle:p}),x.jsx("div",{className:"react-flow__edgelabel-renderer"}),x.jsx(eN,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:c,nodeClickDistance:q,onlyRenderVisibleElements:L,noPanClassName:Lr,noDragClassName:Or,disableKeyboardA11y:zr,nodeExtent:fl,rfId:Rr}),x.jsx("div",{className:"react-flow__viewport-portal"})]})})}A0.displayName="GraphView";const TN=b.memo(A0),ah=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u}={})=>{const a=new Map,c=new Map,d=new Map,f=new Map,h=r??t??[],m=n??e??[],v=l??[0,0],S=u??Ri;Zm(d,f,h),ga(m,a,c,{nodeOrigin:v,nodeExtent:S,elevateNodesOnSelect:!1});let p=[0,0,1];if(s&&i&&o){const y=Zi(a,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:g,y:w,zoom:N}=$c(y,i,o,.5,2,.1);p=[g,w,N]}return{rfId:"1",width:0,height:0,transform:p,nodes:m,nodeLookup:a,parentLookup:c,edges:h,edgeLookup:f,connectionLookup:d,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:Ri,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Nr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...jm},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:zk,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},$N=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u})=>XS((a,c)=>({...ah({nodes:e,edges:t,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u,defaultNodes:n,defaultEdges:r}),setNodes:d=>{const{nodeLookup:f,parentLookup:h,nodeOrigin:m,elevateNodesOnSelect:v}=c();ga(d,f,h,{nodeOrigin:m,nodeExtent:u,elevateNodesOnSelect:v,checkEquality:!0}),a({nodes:d})},setEdges:d=>{const{connectionLookup:f,edgeLookup:h}=c();Zm(f,h,d),a({edges:d})},setDefaultNodesAndEdges:(d,f)=>{if(d){const{setNodes:h}=c();h(d),a({hasDefaultNodes:!0})}if(f){const{setEdges:h}=c();h(f),a({hasDefaultEdges:!0})}},updateNodeInternals:(d,f={triggerFitView:!0})=>{const{triggerNodeChanges:h,nodeLookup:m,parentLookup:v,fitViewOnInit:S,fitViewDone:p,fitViewOnInitOptions:y,domNode:g,nodeOrigin:w,nodeExtent:N,debug:P,fitViewSync:C}=c(),{changes:T,updatedInternals:L}=qk(d,m,v,g,w,N);if(L){if(Qk(m,v,{nodeOrigin:w,nodeExtent:N}),f.triggerFitView){let j=p;!p&&S&&(j=C({...y,nodes:y==null?void 0:y.nodes})),a({fitViewDone:j})}else a({});(T==null?void 0:T.length)>0&&(P&&console.log("React Flow: trigger node changes",T),h==null||h(T))}},updateNodePositions:(d,f=!1)=>{const h=[],m=[];for(const[v,S]of d){const p={id:v,type:"position",position:S.position,dragging:f};S!=null&&S.expandParent&&(S!=null&&S.parentId)&&p.position&&(h.push({id:v,parentId:S.parentId,rect:{...S.internals.positionAbsolute,width:S.measured.width,height:S.measured.height}}),p.position.x=Math.max(0,p.position.x),p.position.y=Math.max(0,p.position.y)),m.push(p)}if(h.length>0){const{nodeLookup:v,parentLookup:S,nodeOrigin:p}=c(),y=Lc(h,v,S,p);m.push(...y)}c().triggerNodeChanges(m)},triggerNodeChanges:d=>{const{onNodesChange:f,setNodes:h,nodes:m,hasDefaultNodes:v,debug:S}=c();if(d!=null&&d.length){if(v){const p=g2(d,m);h(p)}S&&console.log("React Flow: trigger node changes",d),f==null||f(d)}},triggerEdgeChanges:d=>{const{onEdgesChange:f,setEdges:h,edges:m,hasDefaultEdges:v,debug:S}=c();if(d!=null&&d.length){if(v){const p=m2(d,m);h(p)}S&&console.log("React Flow: trigger edge changes",d),f==null||f(d)}},addSelectedNodes:d=>{const{multiSelectionActive:f,edgeLookup:h,nodeLookup:m,triggerNodeChanges:v,triggerEdgeChanges:S}=c();if(f){const p=d.map(y=>_n(y,!0));v(p);return}v(rr(m,new Set([...d]),!0)),S(rr(h))},addSelectedEdges:d=>{const{multiSelectionActive:f,edgeLookup:h,nodeLookup:m,triggerNodeChanges:v,triggerEdgeChanges:S}=c();if(f){const p=d.map(y=>_n(y,!0));S(p);return}S(rr(h,new Set([...d]))),v(rr(m,new Set,!0))},unselectNodesAndEdges:({nodes:d,edges:f}={})=>{const{edges:h,nodes:m,nodeLookup:v,triggerNodeChanges:S,triggerEdgeChanges:p}=c(),y=d||m,g=f||h,w=y.map(P=>{const C=v.get(P.id);return C&&(C.selected=!1),_n(P.id,!1)}),N=g.map(P=>_n(P.id,!1));S(w),p(N)},setMinZoom:d=>{const{panZoom:f,maxZoom:h}=c();f==null||f.setScaleExtent([d,h]),a({minZoom:d})},setMaxZoom:d=>{const{panZoom:f,minZoom:h}=c();f==null||f.setScaleExtent([h,d]),a({maxZoom:d})},setTranslateExtent:d=>{var f;(f=c().panZoom)==null||f.setTranslateExtent(d),a({translateExtent:d})},setPaneClickDistance:d=>{var f;(f=c().panZoom)==null||f.setClickDistance(d)},resetSelectedElements:()=>{const{edges:d,nodes:f,triggerNodeChanges:h,triggerEdgeChanges:m}=c(),v=f.reduce((p,y)=>y.selected?[...p,_n(y.id,!1)]:p,[]),S=d.reduce((p,y)=>y.selected?[...p,_n(y.id,!1)]:p,[]);h(v),m(S)},setNodeExtent:d=>{const{nodes:f,nodeLookup:h,parentLookup:m,nodeOrigin:v,elevateNodesOnSelect:S,nodeExtent:p}=c();d[0][0]===p[0][0]&&d[0][1]===p[0][1]&&d[1][0]===p[1][0]&&d[1][1]===p[1][1]||(ga(f,h,m,{nodeOrigin:v,nodeExtent:d,elevateNodesOnSelect:S,checkEquality:!1}),a({nodeExtent:d}))},panBy:d=>{const{transform:f,width:h,height:m,panZoom:v,translateExtent:S}=c();return Jk({delta:d,panZoom:v,transform:f,translateExtent:S,width:h,height:m})},fitView:d=>{const{panZoom:f,width:h,height:m,minZoom:v,maxZoom:S,nodeLookup:p}=c();if(!f)return Promise.resolve(!1);const y=aa(p,d);return ca({nodes:y,width:h,height:m,panZoom:f,minZoom:v,maxZoom:S},d)},fitViewSync:d=>{const{panZoom:f,width:h,height:m,minZoom:v,maxZoom:S,nodeLookup:p}=c();if(!f)return!1;const y=aa(p,d);return ca({nodes:y,width:h,height:m,panZoom:f,minZoom:v,maxZoom:S},d),y.size>0},cancelConnection:()=>{a({connection:{...jm}})},updateConnection:d=>{a({connection:d})},reset:()=>a({...ah()})}),Object.is);function bN({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,fitView:s,nodeOrigin:l,nodeExtent:u,children:a}){const[c]=b.useState(()=>$N({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:l,nodeExtent:u}));return x.jsx(QS,{value:c,children:x.jsx(x2,{children:a})})}function jN({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:s,fitView:l,nodeOrigin:u,nodeExtent:a}){return b.useContext(tl)?x.jsx(x.Fragment,{children:e}):x.jsx(bN,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:s,fitView:l,nodeOrigin:u,nodeExtent:a,children:e})}const ON={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function LN({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:s,onNodeClick:l,onEdgeClick:u,onInit:a,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:m,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:p,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:P,onNodeDragStart:C,onNodeDrag:T,onNodeDragStop:L,onNodesDelete:j,onEdgesDelete:A,onDelete:D,onSelectionChange:R,onSelectionDragStart:_,onSelectionDrag:O,onSelectionDragStop:E,onSelectionContextMenu:I,onSelectionStart:k,onSelectionEnd:M,onBeforeDelete:$,connectionMode:z,connectionLineType:F=en.Bezier,connectionLineStyle:Y,connectionLineComponent:B,connectionLineContainerStyle:G,deleteKeyCode:W="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:H=!1,selectionMode:Z=Di.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:q=_s()?"Meta":"Control",zoomActivationKeyCode:K=_s()?"Meta":"Control",snapToGrid:re,snapGrid:se,onlyRenderVisibleElements:Pe=!1,selectNodesOnDrag:Wt,nodesDraggable:ll,nodesConnectable:ul,nodesFocusable:al,nodeOrigin:Or=p0,edgesFocusable:cl,edgesReconnectable:Lr,elementsSelectable:zr=!0,defaultViewport:fl=u2,minZoom:Rr=.5,maxZoom:Dr=2,translateExtent:Ji=Ri,preventScrolling:Ey=!0,nodeExtent:dl,defaultMarkerColor:_y="#b1b1b7",zoomOnScroll:ky=!0,zoomOnPinch:Sy=!0,panOnScroll:Ny=!1,panOnScrollSpeed:Cy=.5,panOnScrollMode:My=$n.Free,zoomOnDoubleClick:Iy=!0,panOnDrag:Py=!0,onPaneClick:Ty,onPaneMouseEnter:$y,onPaneMouseMove:by,onPaneMouseLeave:jy,onPaneScroll:Oy,onPaneContextMenu:Ly,paneClickDistance:Wc=0,nodeClickDistance:zy=0,children:Ry,onReconnect:Dy,onReconnectStart:Ay,onReconnectEnd:Fy,onEdgeContextMenu:Vy,onEdgeDoubleClick:Hy,onEdgeMouseEnter:By,onEdgeMouseMove:Uy,onEdgeMouseLeave:Wy,reconnectRadius:Yy=10,onNodesChange:Gy,onEdgesChange:Xy,noDragClassName:Qy="nodrag",noWheelClassName:Ky="nowheel",noPanClassName:Yc="nopan",fitView:Gc,fitViewOptions:Zy,connectOnClick:qy,attributionPosition:Jy,proOptions:ev,defaultEdgeOptions:tv,elevateNodesOnSelect:nv,elevateEdgesOnSelect:rv,disableKeyboardA11y:Xc=!1,autoPanOnConnect:iv,autoPanOnNodeDrag:ov,autoPanSpeed:sv,connectionRadius:lv,isValidConnection:uv,onError:av,style:cv,id:Qc,nodeDragThreshold:fv,viewport:dv,onViewportChange:hv,width:pv,height:gv,colorMode:mv="light",debug:yv,...vv},wv){const hl=Qc||"1",xv=d2(mv);return x.jsx("div",{...vv,style:{...cv,...ON},ref:wv,className:xe(["react-flow",i,xv]),"data-testid":"rf__wrapper",id:Qc,children:x.jsxs(jN,{nodes:e,edges:t,width:pv,height:gv,fitView:Gc,nodeOrigin:Or,nodeExtent:dl,children:[x.jsx(TN,{onInit:a,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:P,nodeTypes:o,edgeTypes:s,connectionLineType:F,connectionLineStyle:Y,connectionLineComponent:B,connectionLineContainerStyle:G,selectionKeyCode:Q,selectionOnDrag:H,selectionMode:Z,deleteKeyCode:W,multiSelectionKeyCode:q,panActivationKeyCode:ee,zoomActivationKeyCode:K,onlyRenderVisibleElements:Pe,defaultViewport:fl,translateExtent:Ji,minZoom:Rr,maxZoom:Dr,preventScrolling:Ey,zoomOnScroll:ky,zoomOnPinch:Sy,zoomOnDoubleClick:Iy,panOnScroll:Ny,panOnScrollSpeed:Cy,panOnScrollMode:My,panOnDrag:Py,onPaneClick:Ty,onPaneMouseEnter:$y,onPaneMouseMove:by,onPaneMouseLeave:jy,onPaneScroll:Oy,onPaneContextMenu:Ly,paneClickDistance:Wc,nodeClickDistance:zy,onSelectionContextMenu:I,onSelectionStart:k,onSelectionEnd:M,onReconnect:Dy,onReconnectStart:Ay,onReconnectEnd:Fy,onEdgeContextMenu:Vy,onEdgeDoubleClick:Hy,onEdgeMouseEnter:By,onEdgeMouseMove:Uy,onEdgeMouseLeave:Wy,reconnectRadius:Yy,defaultMarkerColor:_y,noDragClassName:Qy,noWheelClassName:Ky,noPanClassName:Yc,rfId:hl,disableKeyboardA11y:Xc,nodeExtent:dl,viewport:dv,onViewportChange:hv}),x.jsx(f2,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:m,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:p,nodesDraggable:ll,nodesConnectable:ul,nodesFocusable:al,edgesFocusable:cl,edgesReconnectable:Lr,elementsSelectable:zr,elevateNodesOnSelect:nv,elevateEdgesOnSelect:rv,minZoom:Rr,maxZoom:Dr,nodeExtent:dl,onNodesChange:Gy,onEdgesChange:Xy,snapToGrid:re,snapGrid:se,connectionMode:z,translateExtent:Ji,connectOnClick:qy,defaultEdgeOptions:tv,fitView:Gc,fitViewOptions:Zy,onNodesDelete:j,onEdgesDelete:A,onDelete:D,onNodeDragStart:C,onNodeDrag:T,onNodeDragStop:L,onSelectionDrag:O,onSelectionDragStart:_,onSelectionDragStop:E,onMove:c,onMoveStart:d,onMoveEnd:f,noPanClassName:Yc,nodeOrigin:Or,rfId:hl,autoPanOnConnect:iv,autoPanOnNodeDrag:ov,autoPanSpeed:sv,onError:av,connectionRadius:lv,isValidConnection:uv,selectNodesOnDrag:Wt,nodeDragThreshold:fv,onBeforeDelete:$,paneClickDistance:Wc,debug:yv}),x.jsx(l2,{onSelectionChange:R}),Ry,x.jsx(n2,{proOptions:ev,position:Jy}),x.jsx(e2,{rfId:hl,disableKeyboardA11y:Xc})]})})}var zN=m0(LN);function RN({dimensions:e,lineWidth:t,variant:n,className:r}){return x.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:xe(["react-flow__background-pattern",n,r])})}function DN({radius:e,className:t}){return x.jsx("circle",{cx:e,cy:e,r:e,className:xe(["react-flow__background-pattern","dots",t])})}var zt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(zt||(zt={}));const AN={[zt.Dots]:1,[zt.Lines]:1,[zt.Cross]:6},FN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function F0({id:e,variant:t=zt.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:s,bgColor:l,style:u,className:a,patternClassName:c}){const d=b.useRef(null),{transform:f,patternId:h}=ne(FN,ge),m=r||AN[t],v=t===zt.Dots,S=t===zt.Cross,p=Array.isArray(n)?n:[n,n],y=[p[0]*f[2]||1,p[1]*f[2]||1],g=m*f[2],w=Array.isArray(o)?o:[o,o],N=S?[g,g]:y,P=[w[0]*f[2]||1+N[0]/2,w[1]*f[2]||1+N[1]/2],C=`${h}${e||""}`;return x.jsxs("svg",{className:xe(["react-flow__background",a]),style:{...u,...nl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[x.jsx("pattern",{id:C,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`,children:v?x.jsx(DN,{radius:g/2,className:c}):x.jsx(RN,{dimensions:N,lineWidth:i,variant:t,className:c})}),x.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}F0.displayName="Background";const VN=b.memo(F0);function HN(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:x.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function BN(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:x.jsx("path",{d:"M0 0h32v4.2H0z"})})}function UN(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:x.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 WN(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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 YN(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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 Co({children:e,className:t,...n}){return x.jsx("button",{type:"button",className:xe(["react-flow__controls-button",t]),...n,children:e})}const GN=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function V0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:s,onFitView:l,onInteractiveChange:u,className:a,children:c,position:d="bottom-left",orientation:f="vertical","aria-label":h="React Flow controls"}){const m=ce(),{isInteractive:v,minZoomReached:S,maxZoomReached:p}=ne(GN,ge),{zoomIn:y,zoomOut:g,fitView:w}=Rc(),N=()=>{y(),o==null||o()},P=()=>{g(),s==null||s()},C=()=>{w(i),l==null||l()},T=()=>{m.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),u==null||u(!v)},L=f==="horizontal"?"horizontal":"vertical";return x.jsxs(zc,{className:xe(["react-flow__controls",L,a]),position:d,style:e,"data-testid":"rf__controls","aria-label":h,children:[t&&x.jsxs(x.Fragment,{children:[x.jsx(Co,{onClick:N,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:p,children:x.jsx(HN,{})}),x.jsx(Co,{onClick:P,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S,children:x.jsx(BN,{})})]}),n&&x.jsx(Co,{className:"react-flow__controls-fitview",onClick:C,title:"fit view","aria-label":"fit view",children:x.jsx(UN,{})}),r&&x.jsx(Co,{className:"react-flow__controls-interactive",onClick:T,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?x.jsx(YN,{}):x.jsx(WN,{})}),c]})}V0.displayName="Controls";const XN=b.memo(V0);function QN({id:e,x:t,y:n,width:r,height:i,style:o,color:s,strokeColor:l,strokeWidth:u,className:a,borderRadius:c,shapeRendering:d,selected:f,onClick:h}){const{background:m,backgroundColor:v}=o||{},S=s||m||v;return x.jsx("rect",{className:xe(["react-flow__minimap-node",{selected:f},a]),x:t,y:n,rx:c,ry:c,width:r,height:i,style:{fill:S,stroke:l,strokeWidth:u},shapeRendering:d,onClick:h?p=>h(p,e):void 0})}const KN=b.memo(QN),ZN=e=>e.nodes.map(t=>t.id),Jl=e=>e instanceof Function?e:()=>e;function qN({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=KN,onClick:s}){const l=ne(ZN,ge),u=Jl(t),a=Jl(e),c=Jl(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return x.jsx(x.Fragment,{children:l.map(f=>x.jsx(eC,{id:f,nodeColorFunc:u,nodeStrokeColorFunc:a,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:s,shapeRendering:d},f))})}function JN({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:l,onClick:u}){const{node:a,x:c,y:d,width:f,height:h}=ne(m=>{const v=m.nodeLookup.get(e),{x:S,y:p}=v.internals.positionAbsolute,{width:y,height:g}=Ut(v);return{node:v,x:S,y:p,width:y,height:g}},ge);return!a||a.hidden||!Hm(a)?null:x.jsx(l,{x:c,y:d,width:f,height:h,style:a.style,selected:!!a.selected,className:r(a),color:t(a),borderRadius:i,strokeColor:n(a),strokeWidth:o,shapeRendering:s,onClick:u,id:a.id})}const eC=b.memo(JN);var tC=b.memo(qN);const nC=200,rC=150,iC=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?Fm(Zi(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},oC="react-flow__minimap-desc";function H0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:u,maskColor:a,maskStrokeColor:c,maskStrokeWidth:d,position:f="bottom-right",onClick:h,onNodeClick:m,pannable:v=!1,zoomable:S=!1,ariaLabel:p="React Flow mini map",inversePan:y,zoomStep:g=10,offsetScale:w=5}){const N=ce(),P=b.useRef(null),{boundingRect:C,viewBB:T,rfId:L,panZoom:j,translateExtent:A,flowWidth:D,flowHeight:R}=ne(iC,ge),_=(e==null?void 0:e.width)??nC,O=(e==null?void 0:e.height)??rC,E=C.width/_,I=C.height/O,k=Math.max(E,I),M=k*_,$=k*O,z=w*k,F=C.x-(M-C.width)/2-z,Y=C.y-($-C.height)/2-z,B=M+z*2,G=$+z*2,W=`${oC}-${L}`,Q=b.useRef(0),H=b.useRef();Q.current=k,b.useEffect(()=>{if(P.current&&j)return H.current=lS({domNode:P.current,panZoom:j,getTransform:()=>N.getState().transform,getViewScale:()=>Q.current}),()=>{var q;(q=H.current)==null||q.destroy()}},[j]),b.useEffect(()=>{var q;(q=H.current)==null||q.update({translateExtent:A,width:D,height:R,inversePan:y,pannable:v,zoomStep:g,zoomable:S})},[v,S,y,g,A,D,R]);const Z=h?q=>{var se;const[K,re]=((se=H.current)==null?void 0:se.pointer(q))||[0,0];h(q,{x:K,y:re})}:void 0,ee=m?b.useCallback((q,K)=>{const re=N.getState().nodeLookup.get(K);m(q,re)},[]):void 0;return x.jsx(zc,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-stroke-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*k:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="string"?s:void 0},className:xe(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:x.jsxs("svg",{width:_,height:O,viewBox:`${F} ${Y} ${B} ${G}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:P,onClick:Z,children:[p&&x.jsx("title",{id:W,children:p}),x.jsx(tC,{onClick:ee,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:l}),x.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-z},${Y-z}h${B+z*2}v${G+z*2}h${-B-z*2}z
|
|
62
|
+
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}H0.displayName="MiniMap";b.memo(H0);function sC({nodeId:e,position:t,variant:n=pi.Handle,className:r,style:i={},children:o,color:s,minWidth:l=10,minHeight:u=10,maxWidth:a=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,shouldResize:f,onResizeStart:h,onResize:m,onResizeEnd:v}){const S=x0(),p=typeof e=="string"?e:S,y=ce(),g=b.useRef(null),w=n===pi.Line?"right":"bottom-right",N=t??w,P=b.useRef(null);b.useEffect(()=>{if(!(!g.current||!p))return P.current||(P.current=_S({domNode:g.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:j,transform:A,snapGrid:D,snapToGrid:R,nodeOrigin:_,domNode:O}=y.getState();return{nodeLookup:j,transform:A,snapGrid:D,snapToGrid:R,nodeOrigin:_,paneDomNode:O}},onChange:(j,A)=>{const{triggerNodeChanges:D,nodeLookup:R,parentLookup:_,nodeOrigin:O}=y.getState(),E=[],I={x:j.x,y:j.y},k=R.get(p);if(k&&k.expandParent&&k.parentId){const M=k.origin??O,$=j.width??k.measured.width,z=j.height??k.measured.height,F={id:k.id,parentId:k.parentId,rect:{width:$,height:z,...Bm({x:j.x??k.position.x,y:j.y??k.position.y},{width:$,height:z},k.parentId,R,M)}},Y=Lc([F],R,_,O);E.push(...Y),I.x=j.x?Math.max(M[0]*$,j.x):void 0,I.y=j.y?Math.max(M[1]*z,j.y):void 0}if(I.x!==void 0&&I.y!==void 0){const M={id:p,type:"position",position:{...I}};E.push(M)}if(j.width!==void 0&&j.height!==void 0){const M={id:p,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:j.width,height:j.height}};E.push(M)}for(const M of A){const $={...M,type:"position"};E.push($)}D(E)},onEnd:()=>{const j={id:p,type:"dimensions",resizing:!1};y.getState().triggerNodeChanges([j])}})),P.current.update({controlPosition:N,boundaries:{minWidth:l,minHeight:u,maxWidth:a,maxHeight:c},keepAspectRatio:d,onResizeStart:h,onResize:m,onResizeEnd:v,shouldResize:f}),()=>{var j;(j=P.current)==null||j.destroy()}},[N,l,u,a,c,d,h,m,v,f]);const C=N.split("-"),T=n===pi.Line?"borderColor":"backgroundColor",L=s?{...i,[T]:s}:i;return x.jsx("div",{className:xe(["react-flow__resize-control","nodrag",...C,n,r]),ref:g,style:L,children:o})}b.memo(sC);const B0=e=>[...new Set((e==null?void 0:e.params.flatMap(t=>t.accepts))??[])],U0="back",W0=(e,t,n)=>`${e}->${t}:${n}`;function Ac(e){return Array.isArray(e.next)?[...new Set(e.next)].map(t=>[t,""]):Object.entries(e.next).map(([t,n])=>[n,t])}function lC(e){const t=Object.keys(e.nodes),n=new Map;for(const a of t)n.set(a,Ac(e.nodes[a]).filter(([c])=>c in e.nodes));const r=new Set([...n.values()].flatMap(a=>a.map(([c])=>c))),i=a=>!Array.isArray(e.nodes[a].next),o=[...t.filter(a=>!r.has(a)),...t.filter(a=>!i(a)),...t],s=new Set,l=new Set,u=(a,c)=>{l.add(a),c.push(a);for(const[d,f]of n.get(a))c.includes(d)?s.add(W0(a,d,f)):l.has(d)||u(d,c);c.pop()};for(const a of o)l.has(a)||u(a,[]);return s}function uC(e,t){var o;const n=lC(e),r=[],i=[];for(const[s,l]of Object.entries(e.nodes)){const u=!Array.isArray(l.next);r.push({id:s,type:"fn",position:{x:0,y:0},data:{fn:l.fn,isBranch:u,members:((o=t[l.fn])==null?void 0:o.members)??[],handles:B0(t[l.fn])}});for(const[a,c]of Ac(l)){const d=W0(s,a,c);i.push({id:d,source:s,target:a,...c?{sourceHandle:c}:{},data:{back:n.has(d),exit:c}})}}return{nodes:r,edges:i}}function aC(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n++;return`${e}_${n}`}const il=e=>structuredClone(e);function cC(e,t){const n=il(e),r=aC(t.name,new Set(Object.keys(n.nodes)));return n.nodes[r]={fn:t.ref,next:t.kind==="branch"?{}:[]},[n,r]}function fC(e,t,n,r){const i=il(e),o=i.nodes[t];return o?(Array.isArray(o.next)?o.next.includes(n)||o.next.push(n):r&&(o.next[r]=n),i):e}function Y0(e,t,n,r){const i=il(e),o=i.nodes[t];return o?(Array.isArray(o.next)?o.next=o.next.filter(s=>s!==n):o.next[r]===n&&delete o.next[r],i):e}function dC(e,t){let n=il(e);delete n.nodes[t];for(const[r,i]of Object.entries(n.nodes))for(const[o,s]of Ac(i))o===t&&(n=Y0(n,r,o,s));return n}const va="application/x-vgraph-fn",ch=e=>e.map(t=>t.name).join(", ")||"∅";function hC(e){return`${ch(e.params)} → ${e.kind==="branch"?e.members.join("|"):ch(e.outputs)}`}function pC({functions:e,errors:t,onAdd:n}){const[r,i]=b.useState(""),o=b.useMemo(()=>{const s=r.trim().toLowerCase(),l=new Map;for(const u of e)(!s||u.ref.toLowerCase().includes(s))&&l.set(u.module,[...l.get(u.module)??[],u]);return[...l.entries()].sort(([u],[a])=>u.localeCompare(a))},[e,r]);return x.jsxs("aside",{className:"palette","aria-label":"Functions",children:[x.jsxs("div",{className:"palette-head",children:[x.jsx("h2",{children:"Functions"}),x.jsx("input",{type:"search",placeholder:"Search functions","aria-label":"Search functions",value:r,onChange:s=>i(s.target.value)})]}),x.jsxs("div",{className:"palette-body",children:[t.map(s=>x.jsxs("div",{className:"registry-error",role:"alert",children:[x.jsx("strong",{children:s.module})," failed to load: ",s.message]},s.module)),o.map(([s,l])=>x.jsxs("section",{children:[x.jsx("h3",{children:s}),l.map(u=>{const a=B0(u);return x.jsxs("button",{className:"fn-item",draggable:!!n,disabled:!n,onDragStart:c=>c.dataTransfer.setData(va,u.ref),onClick:()=>n==null?void 0:n(u),title:`${u.ref}
|
|
63
|
+
Drag onto the canvas or press Enter to add`,children:[x.jsxs("span",{className:"fn-name",children:[u.kind==="branch"&&x.jsx("span",{className:"node-icon choice small","aria-hidden":!0}),u.name]}),x.jsx("span",{className:"fn-sig",children:hC(u)}),a.length>0&&x.jsxs("span",{className:"badge handles inline",children:["handles ",a.join(", ")]})]},u.ref)})]},s)),o.length===0&&x.jsx("p",{className:"muted",children:"No functions match."})]})]})}var gC="\0",wn="\0",fh="";let mC=class{constructor(t){ye(this,"_isDirected",!0);ye(this,"_isMultigraph",!1);ye(this,"_isCompound",!1);ye(this,"_label");ye(this,"_defaultNodeLabelFn",()=>{});ye(this,"_defaultEdgeLabelFn",()=>{});ye(this,"_nodes",{});ye(this,"_in",{});ye(this,"_preds",{});ye(this,"_out",{});ye(this,"_sucs",{});ye(this,"_edgeObjs",{});ye(this,"_edgeLabels",{});ye(this,"_nodeCount",0);ye(this,"_edgeCount",0);ye(this,"_parent");ye(this,"_children");t&&(this._isDirected=Object.hasOwn(t,"directed")?t.directed:!0,this._isMultigraph=Object.hasOwn(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.hasOwn(t,"compound")?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[wn]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return this._defaultNodeLabelFn=t,typeof t!="function"&&(this._defaultNodeLabelFn=()=>t),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var t=this;return this.nodes().filter(n=>Object.keys(t._in[n]).length===0)}sinks(){var t=this;return this.nodes().filter(n=>Object.keys(t._out[n]).length===0)}setNodes(t,n){var r=arguments,i=this;return t.forEach(function(o){r.length>1?i.setNode(o,n):i.setNode(o)}),this}setNode(t,n){return Object.hasOwn(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=n),this):(this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=wn,this._children[t]={},this._children[wn][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.hasOwn(this._nodes,t)}removeNode(t){var n=this;if(Object.hasOwn(this._nodes,t)){var r=i=>n.removeEdge(n._edgeObjs[i]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(function(i){n.setParent(i)}),delete this._children[t]),Object.keys(this._in[t]).forEach(r),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=wn;else{n+="";for(var r=n;r!==void 0;r=this.parent(r))if(r===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=n,this._children[n][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var n=this._parent[t];if(n!==wn)return n}}children(t=wn){if(this._isCompound){var n=this._children[t];if(n)return Object.keys(n)}else{if(t===wn)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=this._preds[t];if(n)return Object.keys(n)}successors(t){var n=this._sucs[t];if(n)return Object.keys(n)}neighbors(t){var n=this.predecessors(t);if(n){const i=new Set(n);for(var r of this.successors(t))i.add(r);return Array.from(i.values())}}isLeaf(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var r=this;Object.entries(this._nodes).forEach(function([s,l]){t(s)&&n.setNode(s,l)}),Object.values(this._edgeObjs).forEach(function(s){n.hasNode(s.v)&&n.hasNode(s.w)&&n.setEdge(s,r.edge(s))});var i={};function o(s){var l=r.parent(s);return l===void 0||n.hasNode(l)?(i[s]=l,l):l in i?i[l]:o(l)}return this._isCompound&&n.nodes().forEach(s=>n.setParent(s,o(s))),n}setDefaultEdgeLabel(t){return this._defaultEdgeLabelFn=t,typeof t!="function"&&(this._defaultEdgeLabelFn=()=>t),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,n){var r=this,i=arguments;return t.reduce(function(o,s){return i.length>1?r.setEdge(o,s,n):r.setEdge(o,s),s}),this}setEdge(){var t,n,r,i,o=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(t=s.v,n=s.w,r=s.name,arguments.length===2&&(i=arguments[1],o=!0)):(t=s,n=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,n=""+n,r!==void 0&&(r=""+r);var l=ni(this._isDirected,t,n,r);if(Object.hasOwn(this._edgeLabels,l))return o&&(this._edgeLabels[l]=i),this;if(r!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),this._edgeLabels[l]=o?i:this._defaultEdgeLabelFn(t,n,r);var u=yC(this._isDirected,t,n,r);return t=u.v,n=u.w,Object.freeze(u),this._edgeObjs[l]=u,dh(this._preds[n],t),dh(this._sucs[t],n),this._in[n][l]=u,this._out[t][l]=u,this._edgeCount++,this}edge(t,n,r){var i=arguments.length===1?eu(this._isDirected,arguments[0]):ni(this._isDirected,t,n,r);return this._edgeLabels[i]}edgeAsObj(){const t=this.edge(...arguments);return typeof t!="object"?{label:t}:t}hasEdge(t,n,r){var i=arguments.length===1?eu(this._isDirected,arguments[0]):ni(this._isDirected,t,n,r);return Object.hasOwn(this._edgeLabels,i)}removeEdge(t,n,r){var i=arguments.length===1?eu(this._isDirected,arguments[0]):ni(this._isDirected,t,n,r),o=this._edgeObjs[i];return o&&(t=o.v,n=o.w,delete this._edgeLabels[i],delete this._edgeObjs[i],hh(this._preds[n],t),hh(this._sucs[t],n),delete this._in[n][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,n){var r=this._in[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.v===n):i}}outEdges(t,n){var r=this._out[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.w===n):i}}nodeEdges(t,n){var r=this.inEdges(t,n);if(r)return r.concat(this.outEdges(t,n))}};function dh(e,t){e[t]?e[t]++:e[t]=1}function hh(e,t){--e[t]||delete e[t]}function ni(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var s=i;i=o,o=s}return i+fh+o+fh+(r===void 0?gC:r)}function yC(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var s=i;i=o,o=s}var l={v:i,w:o};return r&&(l.name=r),l}function eu(e,t){return ni(e,t.v,t.w,t.name)}var Fc=mC,vC="2.2.4",wC={Graph:Fc,version:vC},xC=Fc,EC={write:_C,read:NC};function _C(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:kC(e),edges:SC(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function kC(e){return e.nodes().map(function(t){var n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function SC(e){return e.edges().map(function(t){var n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function NC(e){var t=new xC(e.options).setGraph(e.value);return e.nodes.forEach(function(n){t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(function(n){t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var CC=MC;function MC(e){var t={},n=[],r;function i(o){Object.hasOwn(t,o)||(t[o]=!0,r.push(o),e.successors(o).forEach(i),e.predecessors(o).forEach(i))}return e.nodes().forEach(function(o){r=[],i(o),r.length&&n.push(r)}),n}let IC=class{constructor(){ye(this,"_arr",[]);ye(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(t){return t.key})}has(t){return Object.hasOwn(this._keyIndices,t)}priority(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,n){var r=this._keyIndices;if(t=String(t),!Object.hasOwn(r,t)){var i=this._arr,o=i.length;return r[t]=o,i.push({key:t,priority:n}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,n){var r=this._keyIndices[t];if(n>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+n);this._arr[r].priority=n,this._decrease(r)}_heapify(t){var n=this._arr,r=2*t,i=r+1,o=t;r<n.length&&(o=n[r].priority<n[o].priority?r:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(this._swap(t,o),this._heapify(o)))}_decrease(t){for(var n=this._arr,r=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<r));)this._swap(t,i),t=i}_swap(t,n){var r=this._arr,i=this._keyIndices,o=r[t],s=r[n];r[t]=s,r[n]=o,i[s.key]=t,i[o.key]=n}};var G0=IC,PC=G0,X0=$C,TC=()=>1;function $C(e,t,n,r){return bC(e,String(t),n||TC,r||function(i){return e.outEdges(i)})}function bC(e,t,n,r){var i={},o=new PC,s,l,u=function(a){var c=a.v!==s?a.v:a.w,d=i[c],f=n(a),h=l.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+a+" Weight: "+f);h<d.distance&&(d.distance=h,d.predecessor=s,o.decrease(c,h))};for(e.nodes().forEach(function(a){var c=a===t?0:Number.POSITIVE_INFINITY;i[a]={distance:c},o.add(a,c)});o.size()>0&&(s=o.removeMin(),l=i[s],l.distance!==Number.POSITIVE_INFINITY);)r(s).forEach(u);return i}var jC=X0,OC=LC;function LC(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=jC(e,i,t,n),r},{})}var Q0=zC;function zC(e){var t=0,n=[],r={},i=[];function o(s){var l=r[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach(function(c){Object.hasOwn(r,c)?r[c].onStack&&(l.lowlink=Math.min(l.lowlink,r[c].index)):(o(c),l.lowlink=Math.min(l.lowlink,r[c].lowlink))}),l.lowlink===l.index){var u=[],a;do a=n.pop(),r[a].onStack=!1,u.push(a);while(s!==a);i.push(u)}}return e.nodes().forEach(function(s){Object.hasOwn(r,s)||o(s)}),i}var RC=Q0,DC=AC;function AC(e){return RC(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var FC=HC,VC=()=>1;function HC(e,t,n){return BC(e,t||VC,n||function(r){return e.outEdges(r)})}function BC(e,t,n){var r={},i=e.nodes();return i.forEach(function(o){r[o]={},r[o][o]={distance:0},i.forEach(function(s){o!==s&&(r[o][s]={distance:Number.POSITIVE_INFINITY})}),n(o).forEach(function(s){var l=s.v===o?s.w:s.v,u=t(s);r[o][l]={distance:u,predecessor:o}})}),i.forEach(function(o){var s=r[o];i.forEach(function(l){var u=r[l];i.forEach(function(a){var c=u[o],d=s[a],f=u[a],h=c.distance+d.distance;h<f.distance&&(f.distance=h,f.predecessor=d.predecessor)})})}),r}function K0(e){var t={},n={},r=[];function i(o){if(Object.hasOwn(n,o))throw new wa;Object.hasOwn(t,o)||(n[o]=!0,t[o]=!0,e.predecessors(o).forEach(i),delete n[o],r.push(o))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new wa;return r}class wa extends Error{constructor(){super(...arguments)}}var Z0=K0;K0.CycleException=wa;var ph=Z0,UC=WC;function WC(e){try{ph(e)}catch(t){if(t instanceof ph.CycleException)return!1;throw t}return!0}var q0=YC;function YC(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?l=>e.successors(l):l=>e.neighbors(l),i=n==="post"?GC:XC,o=[],s={};return t.forEach(l=>{if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);i(l,r,s,o)}),o}function GC(e,t,n,r){for(var i=[[e,!1]];i.length>0;){var o=i.pop();o[1]?r.push(o[0]):Object.hasOwn(n,o[0])||(n[o[0]]=!0,i.push([o[0],!0]),J0(t(o[0]),s=>i.push([s,!1])))}}function XC(e,t,n,r){for(var i=[e];i.length>0;){var o=i.pop();Object.hasOwn(n,o)||(n[o]=!0,r.push(o),J0(t(o),s=>i.push(s)))}}function J0(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var QC=q0,KC=ZC;function ZC(e,t){return QC(e,t,"post")}var qC=q0,JC=e3;function e3(e,t){return qC(e,t,"pre")}var t3=Fc,n3=G0,r3=i3;function i3(e,t){var n=new t3,r={},i=new n3,o;function s(u){var a=u.v===o?u.w:u.v,c=i.priority(a);if(c!==void 0){var d=t(u);d<c&&(r[a]=o,i.decrease(a,d))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(u){i.add(u,Number.POSITIVE_INFINITY),n.setNode(u)}),i.decrease(e.nodes()[0],0);for(var l=!1;i.size()>0;){if(o=i.removeMin(),Object.hasOwn(r,o))n.setEdge(o,r[o]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(o).forEach(s)}return n}var o3={components:CC,dijkstra:X0,dijkstraAll:OC,findCycles:DC,floydWarshall:FC,isAcyclic:UC,postorder:KC,preorder:JC,prim:r3,tarjan:Q0,topsort:Z0},gh=wC,yt={Graph:gh.Graph,json:EC,alg:o3,version:gh.version};let s3=class{constructor(){let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,n=t._prev;if(n!==t)return mh(n),n}enqueue(t){let n=this._sentinel;t._prev&&t._next&&mh(t),t._next=n._next,n._next._prev=t,n._next=t,t._prev=n}toString(){let t=[],n=this._sentinel,r=n._prev;for(;r!==n;)t.push(JSON.stringify(r,l3)),r=r._prev;return"["+t.join(", ")+"]"}};function mh(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function l3(e,t){if(e!=="_next"&&e!=="_prev")return t}var u3=s3;let a3=yt.Graph,c3=u3;var f3=h3;let d3=()=>1;function h3(e,t){if(e.nodeCount()<=1)return[];let n=g3(e,t||d3);return p3(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w))}function p3(e,t,n){let r=[],i=t[t.length-1],o=t[0],s;for(;e.nodeCount();){for(;s=o.dequeue();)tu(e,t,n,s);for(;s=i.dequeue();)tu(e,t,n,s);if(e.nodeCount()){for(let l=t.length-2;l>0;--l)if(s=t[l].dequeue(),s){r=r.concat(tu(e,t,n,s,!0));break}}}return r}function tu(e,t,n,r,i){let o=i?[]:void 0;return e.inEdges(r.v).forEach(s=>{let l=e.edge(s),u=e.node(s.v);i&&o.push({v:s.v,w:s.w}),u.out-=l,xa(t,n,u)}),e.outEdges(r.v).forEach(s=>{let l=e.edge(s),u=s.w,a=e.node(u);a.in-=l,xa(t,n,a)}),e.removeNode(r.v),o}function g3(e,t){let n=new a3,r=0,i=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let u=n.edge(l.v,l.w)||0,a=t(l),c=u+a;n.setEdge(l.v,l.w,c),i=Math.max(i,n.node(l.v).out+=a),r=Math.max(r,n.node(l.w).in+=a)});let o=m3(i+r+3).map(()=>new c3),s=r+1;return n.nodes().forEach(l=>{xa(o,s,n.node(l))}),{graph:n,buckets:o,zeroIdx:s}}function xa(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function m3(e){const t=[];for(let n=0;n<e;n++)t.push(n);return t}let ey=yt.Graph;var we={addBorderNode:N3,addDummyNode:ty,applyWithChunking:ol,asNonCompoundGraph:v3,buildLayerMatrix:_3,intersectRect:E3,mapValues:b3,maxRank:ry,normalizeRanks:k3,notime:P3,partition:M3,pick:$3,predecessorWeights:x3,range:oy,removeEmptyRanks:S3,simplify:y3,successorWeights:w3,time:I3,uniqueId:iy,zipObject:Vc};function ty(e,t,n,r){let i;do i=iy(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function y3(e){let t=new ey().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function v3(e){let t=new ey({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function w3(e){let t=e.nodes().map(n=>{let r={};return e.outEdges(n).forEach(i=>{r[i.w]=(r[i.w]||0)+e.edge(i).weight}),r});return Vc(e.nodes(),t)}function x3(e){let t=e.nodes().map(n=>{let r={};return e.inEdges(n).forEach(i=>{r[i.v]=(r[i.v]||0)+e.edge(i).weight}),r});return Vc(e.nodes(),t)}function E3(e,t){let n=e.x,r=e.y,i=t.x-n,o=t.y-r,s=e.width/2,l=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");let u,a;return Math.abs(o)*s>Math.abs(i)*l?(o<0&&(l=-l),u=l*i/o,a=l):(i<0&&(s=-s),u=s,a=s*o/i),{x:n+u,y:r+a}}function _3(e){let t=oy(ry(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i][r.order]=n)}),t}function k3(e){let t=e.nodes().map(r=>{let i=e.node(r).rank;return i===void 0?Number.MAX_VALUE:i}),n=ol(Math.min,t);e.nodes().forEach(r=>{let i=e.node(r);Object.hasOwn(i,"rank")&&(i.rank-=n)})}function S3(e){let t=e.nodes().map(s=>e.node(s).rank),n=ol(Math.min,t),r=[];e.nodes().forEach(s=>{let l=e.node(s).rank-n;r[l]||(r[l]=[]),r[l].push(s)});let i=0,o=e.graph().nodeRankFactor;Array.from(r).forEach((s,l)=>{s===void 0&&l%o!==0?--i:s!==void 0&&i&&s.forEach(u=>e.node(u).rank+=i)})}function N3(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),ty(e,"border",i,t)}function C3(e,t=ny){const n=[];for(let r=0;r<e.length;r+=t){const i=e.slice(r,r+t);n.push(i)}return n}const ny=65535;function ol(e,t){if(t.length>ny){const n=C3(t);return e.apply(null,n.map(r=>e.apply(null,r)))}else return e.apply(null,t)}function ry(e){const n=e.nodes().map(r=>{let i=e.node(r).rank;return i===void 0?Number.MIN_VALUE:i});return ol(Math.max,n)}function M3(e,t){let n={lhs:[],rhs:[]};return e.forEach(r=>{t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function I3(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function P3(e,t){return t()}let T3=0;function iy(e){var t=++T3;return toString(e)+t}function oy(e,t,n=1){t==null&&(t=e,e=0);let r=o=>o<t;n<0&&(r=o=>t<o);const i=[];for(let o=e;r(o);o+=n)i.push(o);return i}function $3(e,t){const n={};for(const r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function b3(e,t){let n=t;return typeof t=="string"&&(n=r=>r[t]),Object.entries(e).reduce((r,[i,o])=>(r[i]=n(o,i),r),{})}function Vc(e,t){return e.reduce((n,r,i)=>(n[r]=t[i],n),{})}let j3=f3,O3=we.uniqueId;var L3={run:z3,undo:D3};function z3(e){(e.graph().acyclicer==="greedy"?j3(e,n(e)):R3(e)).forEach(r=>{let i=e.edge(r);e.removeEdge(r),i.forwardName=r.name,i.reversed=!0,e.setEdge(r.w,r.v,i,O3("rev"))});function n(r){return i=>r.edge(i).weight}}function R3(e){let t=[],n={},r={};function i(o){Object.hasOwn(r,o)||(r[o]=!0,n[o]=!0,e.outEdges(o).forEach(s=>{Object.hasOwn(n,s.w)?t.push(s):i(s.w)}),delete n[o])}return e.nodes().forEach(i),t}function D3(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}let A3=we;var F3={run:V3,undo:B3};function V3(e){e.graph().dummyChains=[],e.edges().forEach(t=>H3(e,t))}function H3(e,t){let n=t.v,r=e.node(n).rank,i=t.w,o=e.node(i).rank,s=t.name,l=e.edge(t),u=l.labelRank;if(o===r+1)return;e.removeEdge(t);let a,c,d;for(d=0,++r;r<o;++d,++r)l.points=[],c={width:0,height:0,edgeLabel:l,edgeObj:t,rank:r},a=A3.addDummyNode(e,"edge",c,"_d"),r===u&&(c.width=l.width,c.height=l.height,c.dummy="edge-label",c.labelpos=l.labelpos),e.setEdge(n,a,{weight:l.weight},s),d===0&&e.graph().dummyChains.push(a),n=a;e.setEdge(n,i,{weight:l.weight},s)}function B3(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}const{applyWithChunking:U3}=we;var sl={longestPath:W3,slack:Y3};function W3(e){var t={};function n(r){var i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let o=e.outEdges(r).map(l=>l==null?Number.POSITIVE_INFINITY:n(l.w)-e.edge(l).minlen);var s=U3(Math.min,o);return s===Number.POSITIVE_INFINITY&&(s=0),i.rank=s}e.sources().forEach(n)}function Y3(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var G3=yt.Graph,Ss=sl.slack,sy=X3;function X3(e){var t=new G3({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,o;Q3(t,e)<r;)i=K3(t,e),o=t.hasNode(i.v)?Ss(e,i):-Ss(e,i),Z3(t,e,o);return t}function Q3(e,t){function n(r){t.nodeEdges(r).forEach(i=>{var o=i.v,s=r===o?i.w:o;!e.hasNode(s)&&!Ss(t,i)&&(e.setNode(s,{}),e.setEdge(r,s,{}),n(s))})}return e.nodes().forEach(n),e.nodeCount()}function K3(e,t){return t.edges().reduce((r,i)=>{let o=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(o=Ss(t,i)),o<r[0]?[o,i]:r},[Number.POSITIVE_INFINITY,null])[1]}function Z3(e,t,n){e.nodes().forEach(r=>t.node(r).rank+=n)}var q3=sy,yh=sl.slack,J3=sl.longestPath,eM=yt.alg.preorder,tM=yt.alg.postorder,nM=we.simplify,rM=Hn;Hn.initLowLimValues=Bc;Hn.initCutValues=Hc;Hn.calcCutValue=ly;Hn.leaveEdge=ay;Hn.enterEdge=cy;Hn.exchangeEdges=fy;function Hn(e){e=nM(e),J3(e);var t=q3(e);Bc(t),Hc(t,e);for(var n,r;n=ay(t);)r=cy(t,e,n),fy(t,e,n,r)}function Hc(e,t){var n=tM(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(r=>iM(e,t,r))}function iM(e,t,n){var r=e.node(n),i=r.parent;e.edge(n,i).cutvalue=ly(e,t,n)}function ly(e,t,n){var r=e.node(n),i=r.parent,o=!0,s=t.edge(n,i),l=0;return s||(o=!1,s=t.edge(i,n)),l=s.weight,t.nodeEdges(n).forEach(u=>{var a=u.v===n,c=a?u.w:u.v;if(c!==i){var d=a===o,f=t.edge(u).weight;if(l+=d?f:-f,sM(e,n,c)){var h=e.edge(n,c).cutvalue;l+=d?-h:h}}}),l}function Bc(e,t){arguments.length<2&&(t=e.nodes()[0]),uy(e,{},1,t)}function uy(e,t,n,r,i){var o=n,s=e.node(r);return t[r]=!0,e.neighbors(r).forEach(l=>{Object.hasOwn(t,l)||(n=uy(e,t,n,l,r))}),s.low=o,s.lim=n++,i?s.parent=i:delete s.parent,n}function ay(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function cy(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var o=e.node(r),s=e.node(i),l=o,u=!1;o.lim>s.lim&&(l=s,u=!0);var a=t.edges().filter(c=>u===vh(e,e.node(c.v),l)&&u!==vh(e,e.node(c.w),l));return a.reduce((c,d)=>yh(t,d)<yh(t,c)?d:c)}function fy(e,t,n,r){var i=n.v,o=n.w;e.removeEdge(i,o),e.setEdge(r.v,r.w,{}),Bc(e),Hc(e,t),oM(e,t)}function oM(e,t){var n=e.nodes().find(i=>!t.node(i).parent),r=eM(e,n);r=r.slice(1),r.forEach(i=>{var o=e.node(i).parent,s=t.edge(i,o),l=!1;s||(s=t.edge(o,i),l=!0),t.node(i).rank=t.node(o).rank+(l?s.minlen:-s.minlen)})}function sM(e,t,n){return e.hasEdge(t,n)}function vh(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var lM=sl,dy=lM.longestPath,uM=sy,aM=rM,cM=fM;function fM(e){switch(e.graph().ranker){case"network-simplex":wh(e);break;case"tight-tree":hM(e);break;case"longest-path":dM(e);break;default:wh(e)}}var dM=dy;function hM(e){dy(e),uM(e)}function wh(e){aM(e)}var pM=gM;function gM(e){let t=yM(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,o=mM(e,t,i.v,i.w),s=o.path,l=o.lca,u=0,a=s[u],c=!0;for(;n!==i.w;){if(r=e.node(n),c){for(;(a=s[u])!==l&&e.node(a).maxRank<r.rank;)u++;a===l&&(c=!1)}if(!c){for(;u<s.length-1&&e.node(a=s[u+1]).minRank<=r.rank;)u++;a=s[u]}e.setParent(n,a),n=e.successors(n)[0]}})}function mM(e,t,n,r){let i=[],o=[],s=Math.min(t[n].low,t[r].low),l=Math.max(t[n].lim,t[r].lim),u,a;u=n;do u=e.parent(u),i.push(u);while(u&&(t[u].low>s||l>t[u].lim));for(a=u,u=r;(u=e.parent(u))!==a;)o.push(u);return{path:i.concat(o.reverse()),lca:a}}function yM(e){let t={},n=0;function r(i){let o=n;e.children(i).forEach(r),t[i]={low:o,lim:n++}}return e.children().forEach(r),t}let Ns=we;var vM={run:wM,cleanup:_M};function wM(e){let t=Ns.addDummyNode(e,"root",{},"_root"),n=xM(e),r=Object.values(n),i=Ns.applyWithChunking(Math.max,r)-1,o=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=o);let s=EM(e)+1;e.children().forEach(l=>hy(e,t,o,s,i,n,l)),e.graph().nodeRankFactor=o}function hy(e,t,n,r,i,o,s){let l=e.children(s);if(!l.length){s!==t&&e.setEdge(t,s,{weight:0,minlen:n});return}let u=Ns.addBorderNode(e,"_bt"),a=Ns.addBorderNode(e,"_bb"),c=e.node(s);e.setParent(u,s),c.borderTop=u,e.setParent(a,s),c.borderBottom=a,l.forEach(d=>{hy(e,t,n,r,i,o,d);let f=e.node(d),h=f.borderTop?f.borderTop:d,m=f.borderBottom?f.borderBottom:d,v=f.borderTop?r:2*r,S=h!==m?1:i-o[s]+1;e.setEdge(u,h,{weight:v,minlen:S,nestingEdge:!0}),e.setEdge(m,a,{weight:v,minlen:S,nestingEdge:!0})}),e.parent(s)||e.setEdge(t,u,{weight:0,minlen:i+o[s]})}function xM(e){var t={};function n(r,i){var o=e.children(r);o&&o.length&&o.forEach(s=>n(s,i+1)),t[r]=i}return e.children().forEach(r=>n(r,1)),t}function EM(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function _M(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{var r=e.edge(n);r.nestingEdge&&e.removeEdge(n)})}let kM=we;var SM=NM;function NM(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let o=i.minRank,s=i.maxRank+1;o<s;++o)xh(e,"borderLeft","_bl",n,i,o),xh(e,"borderRight","_br",n,i,o)}}e.children().forEach(t)}function xh(e,t,n,r,i,o){let s={width:0,height:0,rank:o,borderType:t},l=i[t][o-1],u=kM.addDummyNode(e,"border",s,n);i[t][o]=u,e.setParent(u,r),l&&e.setEdge(l,u,{weight:1})}var CM={adjust:MM,undo:IM};function MM(e){let t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&py(e)}function IM(e){let t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&PM(e),(t==="lr"||t==="rl")&&(TM(e),py(e))}function py(e){e.nodes().forEach(t=>Eh(e.node(t))),e.edges().forEach(t=>Eh(e.edge(t)))}function Eh(e){let t=e.width;e.width=e.height,e.height=t}function PM(e){e.nodes().forEach(t=>nu(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(nu),Object.hasOwn(n,"y")&&nu(n)})}function nu(e){e.y=-e.y}function TM(e){e.nodes().forEach(t=>ru(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(ru),Object.hasOwn(n,"x")&&ru(n)})}function ru(e){let t=e.x;e.x=e.y,e.y=t}let _h=we;var $M=bM;function bM(e){let t={},n=e.nodes().filter(u=>!e.children(u).length),r=n.map(u=>e.node(u).rank),i=_h.applyWithChunking(Math.max,r),o=_h.range(i+1).map(()=>[]);function s(u){if(t[u])return;t[u]=!0;let a=e.node(u);o[a.rank].push(u),e.successors(u).forEach(s)}return n.sort((u,a)=>e.node(u).rank-e.node(a).rank).forEach(s),o}let jM=we.zipObject;var OM=LM;function LM(e,t){let n=0;for(let r=1;r<t.length;++r)n+=zM(e,t[r-1],t[r]);return n}function zM(e,t,n){let r=jM(n,n.map((a,c)=>c)),i=t.flatMap(a=>e.outEdges(a).map(c=>({pos:r[c.w],weight:e.edge(c).weight})).sort((c,d)=>c.pos-d.pos)),o=1;for(;o<n.length;)o<<=1;let s=2*o-1;o-=1;let l=new Array(s).fill(0),u=0;return i.forEach(a=>{let c=a.pos+o;l[c]+=a.weight;let d=0;for(;c>0;)c%2&&(d+=l[c+1]),c=c-1>>1,l[c]+=a.weight;u+=a.weight*d}),u}var RM=DM;function DM(e,t=[]){return t.map(n=>{let r=e.inEdges(n);if(r.length){let i=r.reduce((o,s)=>{let l=e.edge(s),u=e.node(s.v);return{sum:o.sum+l.weight*u.order,weight:o.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:n}})}let AM=we;var FM=VM;function VM(e,t){let n={};e.forEach((i,o)=>{let s=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};i.barycenter!==void 0&&(s.barycenter=i.barycenter,s.weight=i.weight)}),t.edges().forEach(i=>{let o=n[i.v],s=n[i.w];o!==void 0&&s!==void 0&&(s.indegree++,o.out.push(n[i.w]))});let r=Object.values(n).filter(i=>!i.indegree);return HM(r)}function HM(e){let t=[];function n(i){return o=>{o.merged||(o.barycenter===void 0||i.barycenter===void 0||o.barycenter>=i.barycenter)&&BM(i,o)}}function r(i){return o=>{o.in.push(i),--o.indegree===0&&e.push(o)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(i=>!i.merged).map(i=>AM.pick(i,["vs","i","barycenter","weight"]))}function BM(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}let UM=we;var WM=YM;function YM(e,t){let n=UM.partition(e,c=>Object.hasOwn(c,"barycenter")),r=n.lhs,i=n.rhs.sort((c,d)=>d.i-c.i),o=[],s=0,l=0,u=0;r.sort(GM(!!t)),u=kh(o,i,u),r.forEach(c=>{u+=c.vs.length,o.push(c.vs),s+=c.barycenter*c.weight,l+=c.weight,u=kh(o,i,u)});let a={vs:o.flat(!0)};return l&&(a.barycenter=s/l,a.weight=l),a}function kh(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function GM(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}let XM=RM,QM=FM,KM=WM;var ZM=gy;function gy(e,t,n,r){let i=e.children(t),o=e.node(t),s=o?o.borderLeft:void 0,l=o?o.borderRight:void 0,u={};s&&(i=i.filter(f=>f!==s&&f!==l));let a=XM(e,i);a.forEach(f=>{if(e.children(f.v).length){let h=gy(e,f.v,n,r);u[f.v]=h,Object.hasOwn(h,"barycenter")&&JM(f,h)}});let c=QM(a,n);qM(c,u);let d=KM(c,r);if(s&&(d.vs=[s,d.vs,l].flat(!0),e.predecessors(s).length)){let f=e.node(e.predecessors(s)[0]),h=e.node(e.predecessors(l)[0]);Object.hasOwn(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+h.order)/(d.weight+2),d.weight+=2}return d}function qM(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(r=>t[r]?t[r].vs:r)})}function JM(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}let eI=yt.Graph,tI=we;var nI=rI;function rI(e,t,n){let r=iI(e),i=new eI({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(o=>e.node(o));return e.nodes().forEach(o=>{let s=e.node(o),l=e.parent(o);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(i.setNode(o),i.setParent(o,l||r),e[n](o).forEach(u=>{let a=u.v===o?u.w:u.v,c=i.edge(a,o),d=c!==void 0?c.weight:0;i.setEdge(a,o,{weight:e.edge(u).weight+d})}),Object.hasOwn(s,"minRank")&&i.setNode(o,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),i}function iI(e){for(var t;e.hasNode(t=tI.uniqueId("_root")););return t}var oI=sI;function sI(e,t,n){let r={},i;n.forEach(o=>{let s=e.parent(o),l,u;for(;s;){if(l=e.parent(s),l?(u=r[l],r[l]=s):(u=i,i=s),u&&u!==s){t.setEdge(u,s);return}s=l}})}let lI=$M,uI=OM,aI=ZM,cI=nI,fI=oI,dI=yt.Graph,Mo=we;var hI=my;function my(e,t){if(t&&typeof t.customOrder=="function"){t.customOrder(e,my);return}let n=Mo.maxRank(e),r=Sh(e,Mo.range(1,n+1),"inEdges"),i=Sh(e,Mo.range(n-1,-1,-1),"outEdges"),o=lI(e);if(Nh(e,o),t&&t.disableOptimalOrderHeuristic)return;let s=Number.POSITIVE_INFINITY,l;for(let u=0,a=0;a<4;++u,++a){pI(u%2?r:i,u%4>=2),o=Mo.buildLayerMatrix(e);let c=uI(e,o);c<s&&(a=0,l=Object.assign({},o),s=c)}Nh(e,l)}function Sh(e,t,n){return t.map(function(r){return cI(e,r,n)})}function pI(e,t){let n=new dI;e.forEach(function(r){let i=r.graph().root,o=aI(r,i,n,t);o.vs.forEach((s,l)=>r.node(s).order=l),fI(r,n,o.vs)})}function Nh(e,t){Object.values(t).forEach(n=>n.forEach((r,i)=>e.node(r).order=i))}let gI=yt.Graph,Pt=we;var mI={positionX:MI};function yI(e,t){let n={};function r(i,o){let s=0,l=0,u=i.length,a=o[o.length-1];return o.forEach((c,d)=>{let f=wI(e,c),h=f?e.node(f).order:u;(f||c===a)&&(o.slice(l,d+1).forEach(m=>{e.predecessors(m).forEach(v=>{let S=e.node(v),p=S.order;(p<s||h<p)&&!(S.dummy&&e.node(m).dummy)&&yy(n,v,m)})}),l=d+1,s=h)}),o}return t.length&&t.reduce(r),n}function vI(e,t){let n={};function r(o,s,l,u,a){let c;Pt.range(s,l).forEach(d=>{c=o[d],e.node(c).dummy&&e.predecessors(c).forEach(f=>{let h=e.node(f);h.dummy&&(h.order<u||h.order>a)&&yy(n,f,c)})})}function i(o,s){let l=-1,u,a=0;return s.forEach((c,d)=>{if(e.node(c).dummy==="border"){let f=e.predecessors(c);f.length&&(u=e.node(f[0]).order,r(s,a,d,l,u),a=d,l=u)}r(s,a,s.length,u,o.length)}),s}return t.length&&t.reduce(i),n}function wI(e,t){if(e.node(t).dummy)return e.predecessors(t).find(n=>e.node(n).dummy)}function yy(e,t,n){if(t>n){let i=t;t=n,n=i}let r=e[t];r||(e[t]=r={}),r[n]=!0}function xI(e,t,n){if(t>n){let r=t;t=n,n=r}return!!e[t]&&Object.hasOwn(e[t],n)}function EI(e,t,n,r){let i={},o={},s={};return t.forEach(l=>{l.forEach((u,a)=>{i[u]=u,o[u]=u,s[u]=a})}),t.forEach(l=>{let u=-1;l.forEach(a=>{let c=r(a);if(c.length){c=c.sort((f,h)=>s[f]-s[h]);let d=(c.length-1)/2;for(let f=Math.floor(d),h=Math.ceil(d);f<=h;++f){let m=c[f];o[a]===a&&u<s[m]&&!xI(n,a,m)&&(o[m]=a,o[a]=i[a]=i[m],u=s[m])}}})}),{root:i,align:o}}function _I(e,t,n,r,i){let o={},s=kI(e,t,n,i),l=i?"borderLeft":"borderRight";function u(d,f){let h=s.nodes(),m=h.pop(),v={};for(;m;)v[m]?d(m):(v[m]=!0,h.push(m),h=h.concat(f(m))),m=h.pop()}function a(d){o[d]=s.inEdges(d).reduce((f,h)=>Math.max(f,o[h.v]+s.edge(h)),0)}function c(d){let f=s.outEdges(d).reduce((m,v)=>Math.min(m,o[v.w]-s.edge(v)),Number.POSITIVE_INFINITY),h=e.node(d);f!==Number.POSITIVE_INFINITY&&h.borderType!==l&&(o[d]=Math.max(o[d],f))}return u(a,s.predecessors.bind(s)),u(c,s.successors.bind(s)),Object.keys(r).forEach(d=>o[d]=o[n[d]]),o}function kI(e,t,n,r){let i=new gI,o=e.graph(),s=II(o.nodesep,o.edgesep,r);return t.forEach(l=>{let u;l.forEach(a=>{let c=n[a];if(i.setNode(c),u){var d=n[u],f=i.edge(d,c);i.setEdge(d,c,Math.max(s(e,a,u),f||0))}u=a})}),i}function SI(e,t){return Object.values(t).reduce((n,r)=>{let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([l,u])=>{let a=PI(e,l)/2;i=Math.max(u+a,i),o=Math.min(u-a,o)});const s=i-o;return s<n[0]&&(n=[s,r]),n},[Number.POSITIVE_INFINITY,null])[1]}function NI(e,t){let n=Object.values(t),r=Pt.applyWithChunking(Math.min,n),i=Pt.applyWithChunking(Math.max,n);["u","d"].forEach(o=>{["l","r"].forEach(s=>{let l=o+s,u=e[l];if(u===t)return;let a=Object.values(u),c=r-Pt.applyWithChunking(Math.min,a);s!=="l"&&(c=i-Pt.applyWithChunking(Math.max,a)),c&&(e[l]=Pt.mapValues(u,d=>d+c))})})}function CI(e,t){return Pt.mapValues(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];{let i=Object.values(e).map(o=>o[r]).sort((o,s)=>o-s);return(i[1]+i[2])/2}})}function MI(e){let t=Pt.buildLayerMatrix(e),n=Object.assign(yI(e,t),vI(e,t)),r={},i;["u","d"].forEach(s=>{i=s==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(i=i.map(d=>Object.values(d).reverse()));let u=(s==="u"?e.predecessors:e.successors).bind(e),a=EI(e,i,n,u),c=_I(e,i,a.root,a.align,l==="r");l==="r"&&(c=Pt.mapValues(c,d=>-d)),r[s+l]=c})});let o=SI(e,r);return NI(r,o),CI(r,e.graph().align)}function II(e,t,n){return(r,i,o)=>{let s=r.node(i),l=r.node(o),u=0,a;if(u+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":a=-s.width/2;break;case"r":a=s.width/2;break}if(a&&(u+=n?a:-a),a=0,u+=(s.dummy?t:e)/2,u+=(l.dummy?t:e)/2,u+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":a=l.width/2;break;case"r":a=-l.width/2;break}return a&&(u+=n?a:-a),a=0,u}}function PI(e,t){return e.node(t).width}let vy=we,TI=mI.positionX;var $I=bI;function bI(e){e=vy.asNonCompoundGraph(e),jI(e),Object.entries(TI(e)).forEach(([t,n])=>e.node(t).x=n)}function jI(e){let t=vy.buildLayerMatrix(e),n=e.graph().ranksep,r=0;t.forEach(i=>{const o=i.reduce((s,l)=>{const u=e.node(l).height;return s>u?s:u},0);i.forEach(s=>e.node(s).y=r+o/2),r+=o+n})}let Ch=L3,Mh=F3,OI=cM,LI=we.normalizeRanks,zI=pM,RI=we.removeEmptyRanks,Ih=vM,DI=SM,Ph=CM,AI=hI,FI=$I,it=we,VI=yt.Graph;var HI=BI;function BI(e,t){let n=t&&t.debugTiming?it.time:it.notime;n("layout",()=>{let r=n(" buildLayoutGraph",()=>JI(e));n(" runLayout",()=>UI(r,n,t)),n(" updateInputGraph",()=>WI(e,r))})}function UI(e,t,n){t(" makeSpaceForEdgeLabels",()=>eP(e)),t(" removeSelfEdges",()=>aP(e)),t(" acyclic",()=>Ch.run(e)),t(" nestingGraph.run",()=>Ih.run(e)),t(" rank",()=>OI(it.asNonCompoundGraph(e))),t(" injectEdgeLabelProxies",()=>tP(e)),t(" removeEmptyRanks",()=>RI(e)),t(" nestingGraph.cleanup",()=>Ih.cleanup(e)),t(" normalizeRanks",()=>LI(e)),t(" assignRankMinMax",()=>nP(e)),t(" removeEdgeLabelProxies",()=>rP(e)),t(" normalize.run",()=>Mh.run(e)),t(" parentDummyChains",()=>zI(e)),t(" addBorderSegments",()=>DI(e)),t(" order",()=>AI(e,n)),t(" insertSelfEdges",()=>cP(e)),t(" adjustCoordinateSystem",()=>Ph.adjust(e)),t(" position",()=>FI(e)),t(" positionSelfEdges",()=>fP(e)),t(" removeBorderNodes",()=>uP(e)),t(" normalize.undo",()=>Mh.undo(e)),t(" fixupEdgeLabelCoords",()=>sP(e)),t(" undoCoordinateSystem",()=>Ph.undo(e)),t(" translateGraph",()=>iP(e)),t(" assignNodeIntersects",()=>oP(e)),t(" reversePoints",()=>lP(e)),t(" acyclic.undo",()=>Ch.undo(e))}function WI(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,"x")&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}let YI=["nodesep","edgesep","ranksep","marginx","marginy"],GI={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},XI=["acyclicer","ranker","rankdir","align"],QI=["width","height"],Th={width:0,height:0},KI=["minlen","weight","width","height","labeloffset"],ZI={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},qI=["labelpos"];function JI(e){let t=new VI({multigraph:!0,compound:!0}),n=ou(e.graph());return t.setGraph(Object.assign({},GI,iu(n,YI),it.pick(n,XI))),e.nodes().forEach(r=>{let i=ou(e.node(r));const o=iu(i,QI);Object.keys(Th).forEach(s=>{o[s]===void 0&&(o[s]=Th[s])}),t.setNode(r,o),t.setParent(r,e.parent(r))}),e.edges().forEach(r=>{let i=ou(e.edge(r));t.setEdge(r,Object.assign({},ZI,iu(i,KI),it.pick(i,qI)))}),t}function eP(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function tP(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let r=e.node(t.v),o={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};it.addDummyNode(e,"edge-proxy",o,"_ep")}})}function nP(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function rP(e){e.nodes().forEach(t=>{let n=e.node(t);n.dummy==="edge-proxy"&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function iP(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,o=e.graph(),s=o.marginx||0,l=o.marginy||0;function u(a){let c=a.x,d=a.y,f=a.width,h=a.height;t=Math.min(t,c-f/2),n=Math.max(n,c+f/2),r=Math.min(r,d-h/2),i=Math.max(i,d+h/2)}e.nodes().forEach(a=>u(e.node(a))),e.edges().forEach(a=>{let c=e.edge(a);Object.hasOwn(c,"x")&&u(c)}),t-=s,r-=l,e.nodes().forEach(a=>{let c=e.node(a);c.x-=t,c.y-=r}),e.edges().forEach(a=>{let c=e.edge(a);c.points.forEach(d=>{d.x-=t,d.y-=r}),Object.hasOwn(c,"x")&&(c.x-=t),Object.hasOwn(c,"y")&&(c.y-=r)}),o.width=n-t+s,o.height=i-r+l}function oP(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),o,s;n.points?(o=n.points[0],s=n.points[n.points.length-1]):(n.points=[],o=i,s=r),n.points.unshift(it.intersectRect(r,o)),n.points.push(it.intersectRect(i,s))})}function sP(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function lP(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function uP(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),o=e.node(n.borderLeft[n.borderLeft.length-1]),s=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(s.x-o.x),n.height=Math.abs(i.y-r.y),n.x=o.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function aP(e){e.edges().forEach(t=>{if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function cP(e){var t=it.buildLayerMatrix(e);t.forEach(n=>{var r=0;n.forEach((i,o)=>{var s=e.node(i);s.order=o+r,(s.selfEdges||[]).forEach(l=>{it.addDummyNode(e,"selfedge",{width:l.label.width,height:l.label.height,rank:s.rank,order:o+ ++r,e:l.e,label:l.label},"_se")}),delete s.selfEdges})})}function fP(e){e.nodes().forEach(t=>{var n=e.node(t);if(n.dummy==="selfedge"){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,s=n.x-i,l=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*s/3,y:o-l},{x:i+5*s/6,y:o-l},{x:i+s,y:o},{x:i+5*s/6,y:o+l},{x:i+2*s/3,y:o+l}],n.label.x=n.x,n.label.y=n.y}})}function iu(e,t){return it.mapValues(it.pick(e,t),Number)}function ou(e){var t={};return e&&Object.entries(e).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=r}),t}let dP=we,hP=yt.Graph;var pP={debugOrdering:gP};function gP(e){let t=dP.buildLayerMatrix(e),n=new hP({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(r=>{n.setNode(r,{label:r}),n.setParent(r,"layer"+e.node(r).rank)}),e.edges().forEach(r=>n.setEdge(r.v,r.w,{},r.name)),t.forEach((r,i)=>{let o="layer"+i;n.setNode(o,{rank:"same"}),r.reduce((s,l)=>(n.setEdge(s,l,{style:"invis"}),l))}),n}var mP="1.1.4",yP={graphlib:yt,layout:HI,debug:pP,util:{time:we.time,notime:we.notime},version:mP};const $h=_a(yP),Ea=200,vP=56,Cs=e=>vP+(e.handles.length?20:0)+(e.isBranch?20:0);function wP(e,t){var r;const n=new $h.graphlib.Graph;n.setGraph({rankdir:"TB",nodesep:50,ranksep:70}),n.setDefaultEdgeLabel(()=>({}));for(const i of e)n.setNode(i.id,{width:Ea,height:Cs(i.data)});for(const i of t)(r=i.data)!=null&&r.back||n.setEdge(i.source,i.target);return $h.layout(n),e.map(i=>{const o=n.node(i.id);return{...i,position:{x:o.x-Ea/2,y:o.y-Cs(i.data)/2}}})}const Uc={pending:"#E5E7EB",running:"#2563EB",ok:"#16A34A",failed:"#DC2626",skipped:"#6B7280"};function xP({id:e,data:t,selected:n}){const r=["node",t.isBranch&&"branch",n&&"selected",t.issues&&"invalid",t.status&&`run ${t.status}`],i={height:Cs(t),...t.status&&{background:Uc[t.status]}};return x.jsxs("div",{className:r.filter(Boolean).join(" "),style:i,children:[x.jsx(rn,{type:"target",position:X.Top}),x.jsx(rn,{type:"target",id:U0,position:X.Left,className:"back-in"}),x.jsxs("div",{className:"node-main",children:[x.jsx("span",{className:t.isBranch?"node-icon choice":"node-icon","aria-hidden":!0,children:t.isBranch?"":"ƒ"}),x.jsxs("div",{className:"node-text",children:[x.jsx("div",{className:"node-title",title:e,children:e}),x.jsx("div",{className:"node-sub",title:t.fn,children:t.isBranch?`Choice · ${t.subtitle}`:t.subtitle}),t.status&&x.jsxs("span",{className:"sr-only",children:["Status: ",t.status]})]})]}),t.handles.length>0&&x.jsxs("span",{className:"badge handles",title:`A parameter accepts ${t.handles.join(", ")}`,children:["handles ",t.handles.join(", ")]}),t.issues>0&&x.jsx("span",{className:"badge issues",title:`${t.issues} issue(s)`,children:t.issues}),(t.runs??0)>1&&x.jsxs("span",{className:"badge runs",title:`Ran ${t.runs} times`,children:["×",t.runs]}),t.isBranch?t.exits.map((o,s)=>{const l=`${(s+1)/(t.exits.length+1)*100}%`;return x.jsxs("div",{children:[x.jsx("span",{className:"exit-label",style:{left:l},children:o}),x.jsx(rn,{type:"source",id:o,position:X.Bottom,style:{left:l}})]},o)}):x.jsx(rn,{type:"source",position:X.Bottom})]})}const EP={fn:xP};function _P(e){return x.jsxs("div",{className:"canvas",onDragOver:t=>{!e.readOnly&&t.dataTransfer.types.includes(va)&&t.preventDefault()},onDrop:t=>{const n=t.dataTransfer.getData(va);n&&!e.readOnly&&e.onDropFn(n)},children:[x.jsxs(zN,{nodes:e.nodes,edges:e.edges,nodeTypes:EP,onInit:e.onInit,onConnect:e.onConnect,onDelete:e.onDelete,onNodeClick:(t,n)=>e.onSelect({kind:"node",id:n.id}),onEdgeClick:(t,n)=>e.onSelect({kind:"edge",id:n.id}),onPaneClick:()=>e.onSelect(null),nodesDraggable:!1,nodesConnectable:!e.readOnly,edgesFocusable:!e.readOnly,deleteKeyCode:e.readOnly?null:["Backspace","Delete"],fitView:!0,fitViewOptions:{maxZoom:1,padding:.2},minZoom:.2,children:[x.jsx(VN,{variant:zt.Dots,gap:18,size:1.2,color:"#c9cfd6"}),x.jsx(XN,{showInteractive:!1,position:"bottom-right"})]}),e.empty&&x.jsx("div",{className:"canvas-empty",children:e.empty})]})}function kP(e){const t=e.current!==null;return x.jsxs("div",{className:"graph-list",children:[x.jsxs("select",{"aria-label":"Graph",value:e.current??"",onChange:n=>n.target.value&&e.onOpen(n.target.value),children:[!t&&x.jsx("option",{value:"",children:"Select a graph…"}),e.graphs.map(n=>x.jsx("option",{value:n,children:n},n))]}),e.dirty&&x.jsx("span",{className:"unsaved",title:"Unsaved changes",children:"Unsaved"}),x.jsx("button",{onClick:e.onNew,children:"New"}),x.jsx("button",{onClick:e.onSave,disabled:!t,children:"Save"}),x.jsx("button",{onClick:e.onDuplicate,disabled:!t,children:"Duplicate"}),x.jsx("button",{onClick:e.onDelete,disabled:!t,className:"danger",children:"Delete"})]})}function SP({issues:e,onPick:t}){const[n,r]=b.useState(!0);return x.jsxs("section",{className:n?"issues open":"issues","aria-label":"Issues",children:[x.jsxs("button",{className:"issues-head","aria-expanded":n,onClick:()=>r(!n),children:[x.jsx("span",{className:"chevron","aria-hidden":!0,children:n?"▾":"▸"}),"Issues",x.jsx("span",{className:e.length?"count bad":"count ok",children:e.length})]}),n&&x.jsxs("ul",{children:[e.length===0&&x.jsx("li",{className:"muted",children:"No issues. The graph is valid."}),e.map((i,o)=>{const s=i.node??(i.edge?`${i.edge[0]} → ${i.edge[1]}`:"graph");return x.jsx("li",{children:x.jsxs("button",{disabled:!i.node&&!i.edge,onClick:()=>t(i),children:[x.jsx("span",{className:"issue-where",children:s}),x.jsx("span",{className:"issue-msg",children:i.message}),x.jsx("code",{children:i.code})]})},o)})]})]})}const NP=(e,t)=>({runId:e,graph:t,status:"running",startedAt:new Date().toISOString(),executions:{},current:{}});function CP(e){const t={};for(const[n,r]of Object.entries(e.executions))r.length&&(t[n]=r[r.length-1].number);return{runId:e.run_id,graph:e.graph,status:e.status,startedAt:e.started_at,executions:e.executions,current:t}}function MP(e,t,n,r,i){e.set(t,[...e.get(t)??[],n].slice(-200)),e.size>r&&e.delete(e.keys().next().value)}function IP(e,t){const n=e.find(r=>r.number===t.number);return n!=null&&n.ended_at&&!t.ended_at?e:[...e.filter(r=>r.number!==t.number),t].sort((r,i)=>r.number-i.number)}function su(e,t){if(!("run_id"in t)||t.run_id!==e.runId)return e;if(t.type==="run")return{...e,status:t.status};if(t.type==="node"){const r=t.execution,i=IP(e.executions[r.node]??[],r),o=e.current[r.node];return{...e,executions:{...e.executions,[r.node]:i},current:{...e.current,[r.node]:o==null?r.number:Math.max(o,r.number)}}}const n={...e.current};for(const r of t.reset)(!bh(e,r)||bh(e,r).status!=="running")&&(n[r]=null);return{...e,current:n}}const bh=(e,t)=>{var n;return(n=e.executions[t])==null?void 0:n.at(-1)};function wy(e,t){var r,i;const n=e.current[t];return n==null?"pending":((i=(r=e.executions[t])==null?void 0:r.find(o=>o.number===n))==null?void 0:i.status)??"pending"}function PP(e){if(!e.started_at||!e.ended_at)return null;const t=Date.parse(e.ended_at)-Date.parse(e.started_at);return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}function jh({title:e,values:t}){const n=Object.entries(t);return x.jsxs("section",{children:[x.jsx("h3",{children:e}),n.length===0&&x.jsx("p",{className:"muted",children:"None"}),n.map(([r,i])=>x.jsxs("div",{className:"value",children:[x.jsx("div",{className:"value-name",children:r}),x.jsxs("pre",{className:"code",children:[i.repr,i.truncated&&x.jsx("span",{className:"muted",children:"…"})]})]},r))]})}function TP({run:e,node:t,onClose:n}){const r=e.executions[t]??[],[i,o]=b.useState(null),[s,l]=b.useState({}),[u,a]=b.useState(!1),c=wy(e,t),d=r.find(v=>v.number===i)??r.at(-1),f=d&&(s[d.number]??d),h=f&&[...Object.values(f.inputs),...Object.values(f.outputs)].some(v=>v.truncated),m=()=>{f&&(a(!0),Oe.getExecution(e.runId,t,f.number).then(v=>l(S=>({...S,[v.number]:v})),console.error).finally(()=>a(!1)))};return x.jsxs("aside",{className:"node-panel","aria-label":`Node ${t}`,children:[x.jsxs("header",{children:[x.jsxs("div",{className:"panel-title",children:[x.jsx("h2",{title:t,children:t}),x.jsx("span",{className:`chip ${c}`,children:c})]}),x.jsx("button",{className:"icon",onClick:n,"aria-label":"Close node panel",children:"×"})]}),r.length>1&&x.jsx("div",{className:"exec-picker",role:"group","aria-label":"Execution",children:r.map(v=>x.jsxs("button",{className:`${v.number===(d==null?void 0:d.number)?"on":""} ${v.status}`,"aria-pressed":v.number===(d==null?void 0:d.number),title:`Execution #${v.number}: ${v.status}`,onClick:()=>o(v.number===r.at(-1).number?null:v.number),children:["#",v.number]},v.number))}),x.jsxs("div",{className:"panel-body",children:[!f&&x.jsx("p",{className:"muted",children:"This node has not run yet."}),f&&x.jsxs(x.Fragment,{children:[x.jsxs("dl",{className:"facts",children:[r.length>1&&x.jsxs(x.Fragment,{children:[x.jsx("dt",{children:"Execution"}),x.jsxs("dd",{children:["#",f.number," · ",x.jsx("span",{className:`chip small ${f.status}`,children:f.status})]})]}),x.jsx("dt",{children:"Duration"}),x.jsx("dd",{children:PP(f)??(f.status==="running"?"running…":"—")}),f.branch_exit&&x.jsxs(x.Fragment,{children:[x.jsx("dt",{children:"Branch exit"}),x.jsx("dd",{children:x.jsx("code",{children:f.branch_exit})})]}),f.skip_reason&&x.jsxs(x.Fragment,{children:[x.jsx("dt",{children:"Skipped"}),x.jsx("dd",{children:f.skip_reason})]})]}),f.error&&x.jsxs("section",{className:"error-box",children:[x.jsx("h3",{children:"Error"}),x.jsx("pre",{className:"code",children:f.error}),f.traceback&&x.jsxs("details",{children:[x.jsx("summary",{children:"Traceback"}),x.jsx("pre",{className:"code",children:f.traceback})]})]}),f.status!=="skipped"&&x.jsx(jh,{title:"Inputs",values:f.inputs}),f.status!=="skipped"&&f.status!=="running"&&x.jsx(jh,{title:"Outputs",values:f.outputs}),h&&x.jsx("button",{onClick:m,disabled:u,children:u?"Loading…":"Show all"})]})]})]})}const xy=e=>`vgraph.inputs.${e}`;function $P(e){try{return localStorage.getItem(xy(e))}catch{return null}}function bP(e,t){try{localStorage.setItem(xy(e),t)}catch{}}function jP({graph:e,skeleton:t,onRun:n,onClose:r}){const i=b.useRef(null),[o,s]=b.useState(()=>$P(e)??t),[l,u]=b.useState([]),[a,c]=b.useState(!1);b.useEffect(()=>{var f;(f=i.current)==null||f.showModal()},[]);const d=async()=>{c(!0),u([]),bP(e,o);try{await n(o),r()}catch(f){f instanceof Ju&&f.status===422?u(f.body.errors):f instanceof Ju&&f.status===409?u(f.body.issues.map(h=>`Graph is invalid: ${h.message}`)):u([`Request failed: ${f}`])}finally{c(!1)}};return x.jsx("dialog",{ref:i,className:"run-dialog",onClose:r,"aria-labelledby":"run-title",children:x.jsxs("form",{method:"dialog",onSubmit:f=>{f.preventDefault(),d()},children:[x.jsxs("header",{children:[x.jsxs("h2",{id:"run-title",children:["Run ",e]}),x.jsx("p",{className:"muted",children:"Inputs as YAML (or JSON). Values are checked against the declared types."})]}),x.jsxs("div",{className:"run-dialog-body",children:[x.jsxs("div",{className:"field-head",children:[x.jsx("label",{htmlFor:"run-inputs",children:"Inputs"}),o!==t&&x.jsx("button",{type:"button",className:"link",onClick:()=>s(t),children:"Reset to defaults"})]}),x.jsx("textarea",{id:"run-inputs",className:"code",spellCheck:!1,value:o,onChange:f=>s(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&d()},rows:Math.min(14,Math.max(5,o.split(`
|
|
64
|
+
`).length+1)),autoFocus:!0,"aria-invalid":l.length>0,"aria-describedby":l.length?"run-errors":void 0}),l.length>0&&x.jsx("ul",{id:"run-errors",className:"form-errors",role:"alert",children:l.map((f,h)=>x.jsx("li",{children:f},h))})]}),x.jsxs("footer",{children:[x.jsx("span",{className:"muted hint",children:"⌘/Ctrl + Enter to run"}),x.jsx("button",{type:"button",onClick:r,children:"Cancel"}),x.jsx("button",{type:"submit",className:"primary",disabled:a,children:a?"Starting…":"▶ Start run"})]})]})})}const OP=e=>new Date(e).toLocaleTimeString();function LP({runs:e,current:t,onPick:n}){return x.jsxs("select",{className:"run-history","aria-label":"Run history",value:t??"",disabled:e.length===0,onChange:r=>r.target.value&&n(r.target.value),children:[x.jsx("option",{value:"",children:e.length?"Recent runs…":"No runs yet"}),e.map(r=>x.jsxs("option",{value:r.run_id,children:[r.run_id.slice(0,8)," · ",OP(r.started_at)," · ",r.status]},r.run_id))]})}const zP=/^[A-Za-z0-9_-]+$/,ri={vgraph:1,nodes:{}};function RP(e,t=""){var r;const n=(r=window.prompt(e,t))==null?void 0:r.trim();return n?zP.test(n)?n:(window.alert("Graph names may only contain letters, digits, '_' and '-'."),null):null}function DP(){const[e,t]=b.useState([]),[n,r]=b.useState([]),[i,o]=b.useState([]),[s,l]=b.useState(null),[u,a]=b.useState(ri),[c,d]=b.useState(JSON.stringify(ri)),[f,h]=b.useState([]),[m,v]=b.useState(""),[S,p]=b.useState(null),[y,g]=b.useState(0),w=s!==null&&JSON.stringify(u)!==c,N=b.useRef({name:s,dirty:w,saved:c});N.current={name:s,dirty:w,saved:c};const P=b.useMemo(()=>Object.fromEntries(e.map(E=>[E.ref,E])),[e]),C=b.useCallback(async()=>{const E=await Oe.functions();t(E.functions),r(E.errors)},[]),T=b.useCallback(async()=>o(await Oe.listGraphs()),[]),L=b.useCallback(async E=>{const I=await Oe.getGraph(E);l(E),a(I.graph),d(JSON.stringify(I.graph)),h(I.issues),v(I.skeleton),p(null)},[]);b.useEffect(()=>{(async()=>{await C();const E=await Oe.listGraphs();o(E),E[0]&&await L(E[0])})().catch(console.error)},[C,L]),b.useEffect(()=>{if(!w)return;const E=I=>{I.preventDefault(),I.returnValue=""};return window.addEventListener("beforeunload",E),()=>window.removeEventListener("beforeunload",E)},[w]);const j=b.useCallback(E=>{if(E.type==="registry_changed")C().catch(console.error),g(I=>I+1);else if(E.type==="graph_changed"){if(T().catch(console.error),E.name!==N.current.name)return;Oe.getGraph(E.name).then(I=>{const k=N.current;k.name===E.name&&JSON.stringify(I.graph)!==k.saved&&(k.dirty?p("This graph changed on disk."):L(E.name).catch(console.error))},()=>N.current.name===E.name&&p("This graph was deleted on disk."))}},[C,T,L]),A=b.useCallback(()=>{j({type:"registry_changed"});const E=N.current.name;E===null?T().catch(console.error):j({type:"graph_changed",name:E})},[j,T]),D=b.useRef(0);return b.useEffect(()=>{if(s===null)return;const E=++D.current,I=setTimeout(()=>{Oe.validate(u).then(k=>{E===D.current&&(h(k.issues),v(k.skeleton))},console.error)},300);return()=>clearTimeout(I)},[u,s,y]),{functions:e,registryErrors:n,fns:P,graphs:i,name:s,graph:u,setGraph:a,dirty:w,issues:f,skeleton:m,notice:S,open:L,save:async()=>{if(s===null)return;const E=c;d(JSON.stringify(u)),p(null);try{const I=await Oe.putGraph(s,u);h(I.issues),v(I.skeleton)}catch(I){throw d(E),I}},create:async E=>{const I=RP("Graph name:");I&&(i.includes(I)&&!window.confirm(`Overwrite ${I}?`)||(await Oe.putGraph(I,E),await T(),await L(I)))},remove:async()=>{if(s===null||!window.confirm(`Delete graph ${s}? This removes ${s}.yaml.`))return;await Oe.deleteGraph(s);const E=await Oe.listGraphs();o(E),l(null),a(ri),d(JSON.stringify(ri)),h([]),v(""),E[0]&&await L(E[0])},onEvent:j,resync:A}}const AP=20;function FP(e){const[t,n]=b.useState(null),[r,i]=b.useState([]),o=b.useRef(null),s=b.useRef(e);s.current=e;const l=b.useRef(new Map),u=v=>{o.current=(v==null?void 0:v.runId)??null,n(v)},a=b.useCallback(()=>{const v=s.current;if(v===null)return i([]);Oe.listRuns(v).then(S=>s.current===v&&i(S),console.error)},[]);b.useEffect(()=>{u(null),l.current.clear(),a()},[e,a]);const c=b.useCallback(v=>{if(!(!("run_id"in v)||v.graph!==s.current)){if(v.type==="run"&&a(),v.run_id===o.current)return n(S=>S&&su(S,v));MP(l.current,v.run_id,v,AP)}},[a]),d=async v=>{if(e===null)return;const{run_id:S}=await Oe.startRun(e,v),p=l.current.get(S)??[];l.current.delete(S),u(p.reduce(su,NP(S,e))),a()},f=b.useCallback(async v=>{l.current.delete(v),o.current=null;let S;try{S=await Oe.getRun(v)}catch(y){throw u(null),y}if(S.graph!==s.current)return;const p=l.current.get(v)??[];l.current.delete(v),u(p.reduce(su,CP(S)))},[]),h=b.useCallback(()=>{a(),o.current!==null&&f(o.current).catch(console.error)},[a,f]);return{run:t,history:r,start:d,show:f,stop:()=>t&&Oe.stopRun(t.runId).catch(console.error),close:()=>u(null),onEvent:c,resync:h}}const VP=e=>{const[t="",n=""]=e.split(":");return`${t.split(".").pop()}:${n}`};function HP(e,t){return(e.executions[t.source]??[]).some(r=>{var i;return(r.status==="ok"||r.status==="failed")&&(!((i=t.data)!=null&&i.exit)||r.branch_exit===t.data.exit)})&&(e.executions[t.target]??[]).some(r=>r.status!=="skipped")}function BP(e,t,n,r,i=null){const o=new Map;for(const a of n)a.node&&o.set(a.node,(o.get(a.node)??0)+1);const s=e.nodes.map(a=>{var f,h;const c=e.edges.filter(m=>m.source===a.id).map(m=>m.data.exit),d=((f=t[a.data.fn])==null?void 0:f.members)??a.data.members;return{...a,type:"fn",selected:(r==null?void 0:r.kind)==="node"&&r.id===a.id,data:{...a.data,members:d,subtitle:VP(a.data.fn),issues:o.get(a.id)??0,exits:[...new Set([...d,...c.filter(Boolean)])],...i&&{status:wy(i,a.id),runs:((h=i.executions[a.id])==null?void 0:h.length)??0}}}}),l=new Set(n.flatMap(a=>a.edge?[`${a.edge[0]}->${a.edge[1]}`]:[])),u=e.edges.map(a=>{var h,m;const c=(r==null?void 0:r.kind)==="edge"&&r.id===a.id,d=i!==null&&HP(i,a),f=c?"#0972d3":l.has(`${a.source}->${a.target}`)?"#d13212":i===null?"#8d99a8":d?"#414d5c":"#c6ccd4";return{...a,type:"smoothstep",...(h=a.data)!=null&&h.back?{targetHandle:U0}:{},pathOptions:{offset:28,borderRadius:8},selected:c,markerEnd:{type:Ai.ArrowClosed,color:f,width:16,height:16},style:{stroke:f,strokeWidth:c||d?2:1.5,strokeDasharray:(m=a.data)!=null&&m.back?"6 4":void 0}}});return{nodes:s,edges:u}}function UP(){const e=DP(),{name:t,graph:n,setGraph:r,fns:i,issues:o,dirty:s}=e,l=FP(t),{run:u}=l,[a,c]=b.useState(null),[d,f]=b.useState(!1),h=b.useRef(),{onEvent:m,resync:v}=e,{onEvent:S,resync:p}=l;b.useEffect(()=>K1(E=>{m(E),S(E)},()=>{v(),p()}),[m,S,v,p]),b.useEffect(()=>c(null),[t]);const y=b.useMemo(()=>{const{nodes:E,edges:I}=uC(n,i);return{nodes:wP(E,I),edges:I}},[n,i]),{nodes:g,edges:w}=b.useMemo(()=>BP(y,i,o,a,u),[y,i,o,a,u]),N=y.nodes.length,P=u&&(a==null?void 0:a.kind)==="node"?a.id:null,C=P!==null;b.useEffect(()=>{const E=setTimeout(()=>{var I;return(I=h.current)==null?void 0:I.fitView({maxZoom:1,padding:.2,duration:200})},50);return()=>clearTimeout(E)},[t,N,C]);const T=E=>r(I=>{const[k,M]=cC(I,E);return c({kind:"node",id:M}),k}),L=E=>r(I=>fC(I,E.source,E.target,E.sourceHandle??"")),j=({nodes:E,edges:I})=>{r(k=>{var $;let M=k;for(const z of I)M=Y0(M,z.source,z.target,(($=z.data)==null?void 0:$.exit)??"");for(const z of E)M=dC(M,z.id);return M}),c(null)},A=E=>{const I=$=>y.nodes.find(z=>z.id===$),k=($,z)=>{var F;return(F=h.current)==null?void 0:F.setCenter($,z,{zoom:Math.max(h.current.getZoom(),.9),duration:300})},M=$=>({x:$.position.x+Ea/2,y:$.position.y+Cs($.data)/2});if(E.node){const $=I(E.node);c({kind:"node",id:E.node}),$&&k(M($).x,M($).y)}else if(E.edge){const $=y.edges.find(Y=>Y.source===E.edge[0]&&Y.target===E.edge[1]),[z,F]=[I(E.edge[0]),I(E.edge[1])];$&&c({kind:"edge",id:$.id}),z&&F&&k((M(z).x+M(F).x)/2,(M(z).y+M(F).y)/2)}},D=()=>!s||window.confirm("Discard unsaved changes?"),R=E=>window.alert(`Request failed: ${E}`),_=t!==null&&o.length===0,O=_?s?"Save the graph to run it":"Run this graph":"Fix all issues to run";return x.jsxs("div",{className:"app",children:[x.jsxs("header",{className:"topbar",children:[x.jsx("span",{className:"brand",children:"vgraph"}),x.jsx(kP,{graphs:e.graphs,current:t,dirty:s,onOpen:E=>D()&&e.open(E).catch(R),onNew:()=>D()&&e.create(ri).catch(R),onSave:()=>e.save().catch(R),onDuplicate:()=>e.create(n).catch(R),onDelete:()=>e.remove().catch(R)}),e.notice&&x.jsxs("span",{className:"notice",role:"status",children:[e.notice,t&&x.jsx("button",{className:"link",onClick:()=>D()&&e.open(t).catch(R),children:"Reload"})]}),x.jsx("span",{className:"spacer"}),t&&x.jsx("span",{className:_?"validity ok":"validity bad",children:_?"Valid":`${o.length} issue${o.length===1?"":"s"}`}),t&&x.jsx(LP,{runs:l.history,current:(u==null?void 0:u.runId)??null,onPick:E=>l.show(E).catch(R)}),x.jsx("button",{className:"primary",disabled:!_||s,title:O,onClick:()=>f(!0),children:"▶ Run"})]}),x.jsxs("div",{className:"body",children:[x.jsx(pC,{functions:e.functions,errors:e.registryErrors,onAdd:t===null||u?null:T}),x.jsxs("main",{className:"main",children:[u&&x.jsxs("div",{className:"run-bar",role:"status",children:[x.jsx("span",{className:"run-label",children:"Run"}),x.jsx("code",{title:u.runId,children:u.runId.slice(0,8)}),x.jsx("span",{className:`chip ${u.status==="stopped"?"skipped":u.status}`,children:u.status}),x.jsxs("span",{className:"muted",children:["started ",new Date(u.startedAt).toLocaleTimeString()]}),x.jsx("span",{className:"spacer"}),u.status==="running"&&x.jsx("button",{className:"danger",onClick:l.stop,children:"■ Stop"}),x.jsx("button",{onClick:l.close,title:"Leave the run view and edit the graph",children:"Back to editor"})]}),x.jsx(_P,{readOnly:u!==null,nodes:g,edges:w,onInit:E=>h.current=E,onConnect:L,onDelete:j,onSelect:c,onDropFn:E=>i[E]&&t!==null&&T(i[E]),empty:t===null?"Create or open a graph to start.":N===0?"Drag a function from the palette to add the first node.":null}),u&&x.jsx("div",{className:"legend","aria-hidden":!0,children:Object.entries(Uc).map(([E,I])=>x.jsxs("span",{children:[x.jsx("i",{style:{background:I}}),E]},E))}),t!==null&&!u&&x.jsx(SP,{issues:o,onPick:A})]}),u&&P&&x.jsx(TP,{run:u,node:P,onClose:()=>c(null)},`${u.runId}/${P}`)]}),d&&t&&x.jsx(jP,{graph:t,skeleton:e.skeleton,onRun:async E=>{await l.start(E),c(null)},onClose:()=>f(!1)})]})}for(const[e,t]of Object.entries(Uc))document.documentElement.style.setProperty(`--st-${e}`,t);Yg(document.getElementById("root")).render(x.jsx(UP,{}));
|