@runtypelabs/react-flow 0.2.8 → 0.2.11
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.
- package/.turbo/turbo-build.log +17 -18
- package/CHANGELOG.md +23 -0
- package/dist/index.js +0 -2
- package/dist/index.mjs +0 -2
- package/example/.env +3 -0
- package/example/.turbo/turbo-build.log +7 -0
- package/example/CHANGELOG.md +25 -0
- package/example/dist/assets/index-BZV40eAE.css +1 -0
- package/example/dist/assets/index-DY7Qr8wz.js +81 -0
- package/example/dist/index.html +26 -0
- package/example/node_modules/.bin/browserslist +21 -0
- package/example/node_modules/.bin/terser +21 -0
- package/example/node_modules/.bin/tsc +2 -2
- package/example/node_modules/.bin/tsserver +2 -2
- package/example/node_modules/.bin/vite +2 -2
- package/example/node_modules/.vite/deps/@xyflow_react.js +9838 -0
- package/example/node_modules/.vite/deps/@xyflow_react.js.map +7 -0
- package/example/node_modules/.vite/deps/_metadata.json +55 -0
- package/example/node_modules/.vite/deps/chunk-GD73XRRV.js +1930 -0
- package/example/node_modules/.vite/deps/chunk-GD73XRRV.js.map +7 -0
- package/example/node_modules/.vite/deps/chunk-MUKLPJ3C.js +926 -0
- package/example/node_modules/.vite/deps/chunk-MUKLPJ3C.js.map +7 -0
- package/example/node_modules/.vite/deps/chunk-ZI3XD5PO.js +21626 -0
- package/example/node_modules/.vite/deps/chunk-ZI3XD5PO.js.map +7 -0
- package/example/node_modules/.vite/deps/package.json +3 -0
- package/example/node_modules/.vite/deps/react-dom.js +6 -0
- package/example/node_modules/.vite/deps/react-dom.js.map +7 -0
- package/example/node_modules/.vite/deps/react-dom_client.js +38 -0
- package/example/node_modules/.vite/deps/react-dom_client.js.map +7 -0
- package/example/node_modules/.vite/deps/react.js +5 -0
- package/example/node_modules/.vite/deps/react.js.map +7 -0
- package/example/node_modules/.vite/deps/react_jsx-dev-runtime.js +911 -0
- package/example/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
- package/example/node_modules/.vite/deps/react_jsx-runtime.js +6 -0
- package/example/node_modules/.vite/deps/react_jsx-runtime.js.map +7 -0
- package/example/package.json +1 -1
- package/package.json +2 -2
- package/tsconfig.json +1 -1
- package/tsup.config.ts +1 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Xf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kf={exports:{}},Cs={},Qf={exports:{}},ne={};/**
|
|
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 Do=Symbol.for("react.element"),ny=Symbol.for("react.portal"),ry=Symbol.for("react.fragment"),oy=Symbol.for("react.strict_mode"),iy=Symbol.for("react.profiler"),sy=Symbol.for("react.provider"),ly=Symbol.for("react.context"),ay=Symbol.for("react.forward_ref"),uy=Symbol.for("react.suspense"),cy=Symbol.for("react.memo"),dy=Symbol.for("react.lazy"),jc=Symbol.iterator;function fy(e){return e===null||typeof e!="object"?null:(e=jc&&e[jc]||e["@@iterator"],typeof e=="function"?e:null)}var Gf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Zf=Object.assign,qf={};function Pr(e,t,n){this.props=e,this.context=t,this.refs=qf,this.updater=n||Gf}Pr.prototype.isReactComponent={};Pr.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")};Pr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Jf(){}Jf.prototype=Pr.prototype;function eu(e,t,n){this.props=e,this.context=t,this.refs=qf,this.updater=n||Gf}var tu=eu.prototype=new Jf;tu.constructor=eu;Zf(tu,Pr.prototype);tu.isPureReactComponent=!0;var bc=Array.isArray,ep=Object.prototype.hasOwnProperty,nu={current:null},tp={key:!0,ref:!0,__self:!0,__source:!0};function np(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)ep.call(t,r)&&!tp.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Do,type:e,key:i,ref:s,props:o,_owner:nu.current}}function py(e,t){return{$$typeof:Do,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ru(e){return typeof e=="object"&&e!==null&&e.$$typeof===Do}function hy(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Mc=/\/+/g;function nl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?hy(""+e.key):t.toString(36)}function _i(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Do:case ny:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+nl(s,0):r,bc(o)?(n="",e!=null&&(n=e.replace(Mc,"$&/")+"/"),_i(o,t,n,"",function(u){return u})):o!=null&&(ru(o)&&(o=py(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Mc,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",bc(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+nl(i,l);s+=_i(i,t,n,a,o)}else if(a=fy(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+nl(i,l++),s+=_i(i,t,n,a,o);else if(i==="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 Zo(e,t,n){if(e==null)return e;var r=[],o=0;return _i(e,r,"","",function(i){return t.call(n,i,o++)}),r}function gy(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 Be={current:null},Ci={transition:null},my={ReactCurrentDispatcher:Be,ReactCurrentBatchConfig:Ci,ReactCurrentOwner:nu};function rp(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:Zo,forEach:function(e,t,n){Zo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Zo(e,function(){t++}),t},toArray:function(e){return Zo(e,function(t){return t})||[]},only:function(e){if(!ru(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=Pr;ne.Fragment=ry;ne.Profiler=iy;ne.PureComponent=eu;ne.StrictMode=oy;ne.Suspense=uy;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=my;ne.act=rp;ne.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=Zf({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=nu.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)ep.call(t,a)&&!tp.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Do,type:e.type,key:o,ref:i,props:r,_owner:s}};ne.createContext=function(e){return e={$$typeof:ly,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:sy,_context:e},e.Consumer=e};ne.createElement=np;ne.createFactory=function(e){var t=np.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:ay,render:e}};ne.isValidElement=ru;ne.lazy=function(e){return{$$typeof:dy,_payload:{_status:-1,_result:e},_init:gy}};ne.memo=function(e,t){return{$$typeof:cy,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=Ci.transition;Ci.transition={};try{e()}finally{Ci.transition=t}};ne.unstable_act=rp;ne.useCallback=function(e,t){return Be.current.useCallback(e,t)};ne.useContext=function(e){return Be.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return Be.current.useDeferredValue(e)};ne.useEffect=function(e,t){return Be.current.useEffect(e,t)};ne.useId=function(){return Be.current.useId()};ne.useImperativeHandle=function(e,t,n){return Be.current.useImperativeHandle(e,t,n)};ne.useInsertionEffect=function(e,t){return Be.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return Be.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return Be.current.useMemo(e,t)};ne.useReducer=function(e,t,n){return Be.current.useReducer(e,t,n)};ne.useRef=function(e){return Be.current.useRef(e)};ne.useState=function(e){return Be.current.useState(e)};ne.useSyncExternalStore=function(e,t,n){return Be.current.useSyncExternalStore(e,t,n)};ne.useTransition=function(){return Be.current.useTransition()};ne.version="18.3.1";Qf.exports=ne;var z=Qf.exports;const Es=Xf(z);/**
|
|
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 yy=z,xy=Symbol.for("react.element"),vy=Symbol.for("react.fragment"),wy=Object.prototype.hasOwnProperty,Sy=yy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ky={key:!0,ref:!0,__self:!0,__source:!0};function op(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)wy.call(t,r)&&!ky.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:xy,type:e,key:i,ref:s,props:o,_owner:Sy.current}}Cs.Fragment=vy;Cs.jsx=op;Cs.jsxs=op;Kf.exports=Cs;var d=Kf.exports,Hl={},ip={exports:{}},tt={},sp={exports:{}},lp={};/**
|
|
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,_){var T=k.length;k.push(_);e:for(;0<T;){var A=T-1>>>1,D=k[A];if(0<o(D,_))k[A]=_,k[T]=D,T=A;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var _=k[0],T=k.pop();if(T!==_){k[0]=T;e:for(var A=0,D=k.length,W=D>>>1;A<W;){var V=2*(A+1)-1,Y=k[V],X=V+1,K=k[X];if(0>o(Y,T))X<D&&0>o(K,Y)?(k[A]=K,k[X]=T,A=X):(k[A]=Y,k[V]=T,A=V);else if(X<D&&0>o(K,T))k[A]=K,k[X]=T,A=X;else break e}}return _}function o(k,_){var T=k.sortIndex-_.sortIndex;return T!==0?T:k.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],p=1,c=null,f=3,h=!1,x=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,m=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 _=n(u);_!==null;){if(_.callback===null)r(u);else if(_.startTime<=k)r(u),_.sortIndex=_.expirationTime,t(a,_);else break;_=n(u)}}function v(k){if(w=!1,g(k),!x)if(n(a)!==null)x=!0,N(E);else{var _=n(u);_!==null&&M(v,_.startTime-k)}}function E(k,_){x=!1,w&&(w=!1,m(P),P=-1),h=!0;var T=f;try{for(g(_),c=n(a);c!==null&&(!(c.expirationTime>_)||k&&!I());){var A=c.callback;if(typeof A=="function"){c.callback=null,f=c.priorityLevel;var D=A(c.expirationTime<=_);_=e.unstable_now(),typeof D=="function"?c.callback=D:c===n(a)&&r(a),g(_)}else r(a);c=n(a)}if(c!==null)var W=!0;else{var V=n(u);V!==null&&M(v,V.startTime-_),W=!1}return W}finally{c=null,f=T,h=!1}}var C=!1,j=null,P=-1,L=5,F=-1;function I(){return!(e.unstable_now()-F<L)}function R(){if(j!==null){var k=e.unstable_now();F=k;var _=!0;try{_=j(!0,k)}finally{_?B():(C=!1,j=null)}}else C=!1}var B;if(typeof y=="function")B=function(){y(R)};else if(typeof MessageChannel<"u"){var b=new MessageChannel,$=b.port2;b.port1.onmessage=R,B=function(){$.postMessage(null)}}else B=function(){S(R,0)};function N(k){j=k,C||(C=!0,B())}function M(k,_){P=S(function(){k(e.unstable_now())},_)}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(){x||h||(x=!0,N(E))},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(a)},e.unstable_next=function(k){switch(f){case 1:case 2:case 3:var _=3;break;default:_=f}var T=f;f=_;try{return k()}finally{f=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,_){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var T=f;f=k;try{return _()}finally{f=T}},e.unstable_scheduleCallback=function(k,_,T){var A=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?A+T:A):T=A,k){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=T+D,k={id:p++,callback:_,priorityLevel:k,startTime:T,expirationTime:D,sortIndex:-1},T>A?(k.sortIndex=T,t(u,k),n(a)===null&&k===n(u)&&(w?(m(P),P=-1):w=!0,M(v,T-A))):(k.sortIndex=D,t(a,k),x||h||(x=!0,N(E))),k},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(k){var _=f;return function(){var T=f;f=_;try{return k.apply(this,arguments)}finally{f=T}}}})(lp);sp.exports=lp;var _y=sp.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 Cy=z,Je=_y;function O(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 ap=new Set,co={};function Bn(e,t){hr(e,t),hr(e+"Capture",t)}function hr(e,t){for(co[e]=t,e=0;e<t.length;e++)ap.add(t[e])}var Bt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vl=Object.prototype.hasOwnProperty,Ey=/^[: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]*$/,Pc={},Tc={};function Ny(e){return Vl.call(Tc,e)?!0:Vl.call(Pc,e)?!1:Ey.test(e)?Tc[e]=!0:(Pc[e]=!0,!1)}function jy(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 by(e,t,n,r){if(t===null||typeof t>"u"||jy(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 Oe(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ze[e]=new Oe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ze[t]=new Oe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ze[e]=new Oe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ze[e]=new Oe(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){ze[e]=new Oe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ze[e]=new Oe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ze[e]=new Oe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ze[e]=new Oe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ze[e]=new Oe(e,5,!1,e.toLowerCase(),null,!1,!1)});var ou=/[\-:]([a-z])/g;function iu(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(ou,iu);ze[t]=new Oe(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(ou,iu);ze[t]=new Oe(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(ou,iu);ze[t]=new Oe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ze[e]=new Oe(e,1,!1,e.toLowerCase(),null,!1,!1)});ze.xlinkHref=new Oe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ze[e]=new Oe(e,1,!1,e.toLowerCase(),null,!0,!0)});function su(e,t,n,r){var o=ze.hasOwnProperty(t)?ze[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(by(t,n,o,r)&&(n=null),r||o===null?Ny(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ut=Cy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qo=Symbol.for("react.element"),Yn=Symbol.for("react.portal"),Xn=Symbol.for("react.fragment"),lu=Symbol.for("react.strict_mode"),Wl=Symbol.for("react.profiler"),up=Symbol.for("react.provider"),cp=Symbol.for("react.context"),au=Symbol.for("react.forward_ref"),Ul=Symbol.for("react.suspense"),Yl=Symbol.for("react.suspense_list"),uu=Symbol.for("react.memo"),Zt=Symbol.for("react.lazy"),dp=Symbol.for("react.offscreen"),zc=Symbol.iterator;function Dr(e){return e===null||typeof e!="object"?null:(e=zc&&e[zc]||e["@@iterator"],typeof e=="function"?e:null)}var ve=Object.assign,rl;function Xr(e){if(rl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);rl=t&&t[1]||""}return`
|
|
34
|
+
`+rl+e}var ol=!1;function il(e,t){if(!e||ol)return"";ol=!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(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
35
|
+
`),i=r.stack.split(`
|
|
36
|
+
`),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var a=`
|
|
37
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{ol=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Xr(e):""}function My(e){switch(e.tag){case 5:return Xr(e.type);case 16:return Xr("Lazy");case 13:return Xr("Suspense");case 19:return Xr("SuspenseList");case 0:case 2:case 15:return e=il(e.type,!1),e;case 11:return e=il(e.type.render,!1),e;case 1:return e=il(e.type,!0),e;default:return""}}function Xl(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 Xn:return"Fragment";case Yn:return"Portal";case Wl:return"Profiler";case lu:return"StrictMode";case Ul:return"Suspense";case Yl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case cp:return(e.displayName||"Context")+".Consumer";case up:return(e._context.displayName||"Context")+".Provider";case au:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case uu:return t=e.displayName||null,t!==null?t:Xl(e.type)||"Memo";case Zt:t=e._payload,e=e._init;try{return Xl(e(t))}catch{}}return null}function Py(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 Xl(t);case 8:return t===lu?"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 fn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ty(e){var t=fp(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.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 Jo(e){e._valueTracker||(e._valueTracker=Ty(e))}function pp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=fp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Hi(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 Kl(e,t){var n=t.checked;return ve({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ic(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=fn(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 hp(e,t){t=t.checked,t!=null&&su(e,"checked",t,!1)}function Ql(e,t){hp(e,t);var n=fn(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")?Gl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Gl(e,t.type,fn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lc(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 Gl(e,t,n){(t!=="number"||Hi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Kr=Array.isArray;function sr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+fn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Zl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(O(91));return ve({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Rc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(O(92));if(Kr(n)){if(1<n.length)throw Error(O(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:fn(n)}}function gp(e,t){var n=fn(t.value),r=fn(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 $c(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function mp(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 ql(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?mp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ei,yp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ei=ei||document.createElement("div"),ei.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ei.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jr={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},zy=["Webkit","ms","Moz","O"];Object.keys(Jr).forEach(function(e){zy.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jr[t]=Jr[e]})});function xp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jr.hasOwnProperty(e)&&Jr[e]?(""+t).trim():t+"px"}function vp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=xp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Iy=ve({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 Jl(e,t){if(t){if(Iy[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(O(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(O(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(O(61))}if(t.style!=null&&typeof t.style!="object")throw Error(O(62))}}function ea(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 ta=null;function cu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var na=null,lr=null,ar=null;function Dc(e){if(e=Bo(e)){if(typeof na!="function")throw Error(O(280));var t=e.stateNode;t&&(t=Ps(t),na(e.stateNode,e.type,t))}}function wp(e){lr?ar?ar.push(e):ar=[e]:lr=e}function Sp(){if(lr){var e=lr,t=ar;if(ar=lr=null,Dc(e),t)for(e=0;e<t.length;e++)Dc(t[e])}}function kp(e,t){return e(t)}function _p(){}var sl=!1;function Cp(e,t,n){if(sl)return e(t,n);sl=!0;try{return kp(e,t,n)}finally{sl=!1,(lr!==null||ar!==null)&&(_p(),Sp())}}function po(e,t){var n=e.stateNode;if(n===null)return null;var r=Ps(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(O(231,t,typeof n));return n}var ra=!1;if(Bt)try{var Ar={};Object.defineProperty(Ar,"passive",{get:function(){ra=!0}}),window.addEventListener("test",Ar,Ar),window.removeEventListener("test",Ar,Ar)}catch{ra=!1}function Ly(e,t,n,r,o,i,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(p){this.onError(p)}}var eo=!1,Vi=null,Wi=!1,oa=null,Ry={onError:function(e){eo=!0,Vi=e}};function $y(e,t,n,r,o,i,s,l,a){eo=!1,Vi=null,Ly.apply(Ry,arguments)}function Dy(e,t,n,r,o,i,s,l,a){if($y.apply(this,arguments),eo){if(eo){var u=Vi;eo=!1,Vi=null}else throw Error(O(198));Wi||(Wi=!0,oa=u)}}function On(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 Ep(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 Ac(e){if(On(e)!==e)throw Error(O(188))}function Ay(e){var t=e.alternate;if(!t){if(t=On(e),t===null)throw Error(O(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Ac(o),e;if(i===r)return Ac(o),t;i=i.sibling}throw Error(O(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,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){for(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)throw Error(O(189))}}if(n.alternate!==r)throw Error(O(190))}if(n.tag!==3)throw Error(O(188));return n.stateNode.current===n?e:t}function Np(e){return e=Ay(e),e!==null?jp(e):null}function jp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=jp(e);if(t!==null)return t;e=e.sibling}return null}var bp=Je.unstable_scheduleCallback,Fc=Je.unstable_cancelCallback,Fy=Je.unstable_shouldYield,By=Je.unstable_requestPaint,ke=Je.unstable_now,Oy=Je.unstable_getCurrentPriorityLevel,du=Je.unstable_ImmediatePriority,Mp=Je.unstable_UserBlockingPriority,Ui=Je.unstable_NormalPriority,Hy=Je.unstable_LowPriority,Pp=Je.unstable_IdlePriority,Ns=null,Et=null;function Vy(e){if(Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Ns,e,void 0,(e.current.flags&128)===128)}catch{}}var yt=Math.clz32?Math.clz32:Yy,Wy=Math.log,Uy=Math.LN2;function Yy(e){return e>>>=0,e===0?32:31-(Wy(e)/Uy|0)|0}var ti=64,ni=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 Yi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=Qr(l):(i&=s,i!==0&&(r=Qr(i)))}else s=n&~o,s!==0?r=Qr(s):i!==0&&(r=Qr(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&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-yt(t),o=1<<n,r|=e[n],t&=~o;return r}function Xy(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 Ky(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-yt(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=Xy(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function ia(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Tp(){var e=ti;return ti<<=1,!(ti&4194240)&&(ti=64),e}function ll(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ao(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yt(t),e[t]=n}function Qy(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 o=31-yt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function fu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-yt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var le=0;function zp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ip,pu,Lp,Rp,$p,sa=!1,ri=[],rn=null,on=null,sn=null,ho=new Map,go=new Map,Jt=[],Gy="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 Bc(e,t){switch(e){case"focusin":case"focusout":rn=null;break;case"dragenter":case"dragleave":on=null;break;case"mouseover":case"mouseout":sn=null;break;case"pointerover":case"pointerout":ho.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":go.delete(t.pointerId)}}function Fr(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Bo(t),t!==null&&pu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Zy(e,t,n,r,o){switch(t){case"focusin":return rn=Fr(rn,e,t,n,r,o),!0;case"dragenter":return on=Fr(on,e,t,n,r,o),!0;case"mouseover":return sn=Fr(sn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return ho.set(i,Fr(ho.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,go.set(i,Fr(go.get(i)||null,e,t,n,r,o)),!0}return!1}function Dp(e){var t=Sn(e.target);if(t!==null){var n=On(t);if(n!==null){if(t=n.tag,t===13){if(t=Ep(n),t!==null){e.blockedOn=t,$p(e.priority,function(){Lp(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 Ei(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=la(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ta=r,n.target.dispatchEvent(r),ta=null}else return t=Bo(n),t!==null&&pu(t),e.blockedOn=n,!1;t.shift()}return!0}function Oc(e,t,n){Ei(e)&&n.delete(t)}function qy(){sa=!1,rn!==null&&Ei(rn)&&(rn=null),on!==null&&Ei(on)&&(on=null),sn!==null&&Ei(sn)&&(sn=null),ho.forEach(Oc),go.forEach(Oc)}function Br(e,t){e.blockedOn===t&&(e.blockedOn=null,sa||(sa=!0,Je.unstable_scheduleCallback(Je.unstable_NormalPriority,qy)))}function mo(e){function t(o){return Br(o,e)}if(0<ri.length){Br(ri[0],e);for(var n=1;n<ri.length;n++){var r=ri[n];r.blockedOn===e&&(r.blockedOn=null)}}for(rn!==null&&Br(rn,e),on!==null&&Br(on,e),sn!==null&&Br(sn,e),ho.forEach(t),go.forEach(t),n=0;n<Jt.length;n++)r=Jt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Jt.length&&(n=Jt[0],n.blockedOn===null);)Dp(n),n.blockedOn===null&&Jt.shift()}var ur=Ut.ReactCurrentBatchConfig,Xi=!0;function Jy(e,t,n,r){var o=le,i=ur.transition;ur.transition=null;try{le=1,hu(e,t,n,r)}finally{le=o,ur.transition=i}}function ex(e,t,n,r){var o=le,i=ur.transition;ur.transition=null;try{le=4,hu(e,t,n,r)}finally{le=o,ur.transition=i}}function hu(e,t,n,r){if(Xi){var o=la(e,t,n,r);if(o===null)yl(e,t,r,Ki,n),Bc(e,r);else if(Zy(o,e,t,n,r))r.stopPropagation();else if(Bc(e,r),t&4&&-1<Gy.indexOf(e)){for(;o!==null;){var i=Bo(o);if(i!==null&&Ip(i),i=la(e,t,n,r),i===null&&yl(e,t,r,Ki,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else yl(e,t,r,null,n)}}var Ki=null;function la(e,t,n,r){if(Ki=null,e=cu(r),e=Sn(e),e!==null)if(t=On(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ep(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 Ki=e,null}function Ap(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(Oy()){case du:return 1;case Mp:return 4;case Ui:case Hy:return 16;case Pp:return 536870912;default:return 16}default:return 16}}var tn=null,gu=null,Ni=null;function Fp(){if(Ni)return Ni;var e,t=gu,n=t.length,r,o="value"in tn?tn.value:tn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Ni=o.slice(e,1<r?1-r:void 0)}function ji(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 oi(){return!0}function Hc(){return!1}function nt(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?oi:Hc,this.isPropagationStopped=Hc,this}return ve(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=oi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=oi)},persist:function(){},isPersistent:oi}),t}var Tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mu=nt(Tr),Fo=ve({},Tr,{view:0,detail:0}),tx=nt(Fo),al,ul,Or,js=ve({},Fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yu,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!==Or&&(Or&&e.type==="mousemove"?(al=e.screenX-Or.screenX,ul=e.screenY-Or.screenY):ul=al=0,Or=e),al)},movementY:function(e){return"movementY"in e?e.movementY:ul}}),Vc=nt(js),nx=ve({},js,{dataTransfer:0}),rx=nt(nx),ox=ve({},Fo,{relatedTarget:0}),cl=nt(ox),ix=ve({},Tr,{animationName:0,elapsedTime:0,pseudoElement:0}),sx=nt(ix),lx=ve({},Tr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ax=nt(lx),ux=ve({},Tr,{data:0}),Wc=nt(ux),cx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dx={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"},fx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function px(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fx[e])?!!t[e]:!1}function yu(){return px}var hx=ve({},Fo,{key:function(e){if(e.key){var t=cx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ji(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yu,charCode:function(e){return e.type==="keypress"?ji(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ji(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gx=nt(hx),mx=ve({},js,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uc=nt(mx),yx=ve({},Fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yu}),xx=nt(yx),vx=ve({},Tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),wx=nt(vx),Sx=ve({},js,{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}),kx=nt(Sx),_x=[9,13,27,32],xu=Bt&&"CompositionEvent"in window,to=null;Bt&&"documentMode"in document&&(to=document.documentMode);var Cx=Bt&&"TextEvent"in window&&!to,Bp=Bt&&(!xu||to&&8<to&&11>=to),Yc=" ",Xc=!1;function Op(e,t){switch(e){case"keyup":return _x.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kn=!1;function Ex(e,t){switch(e){case"compositionend":return Hp(t);case"keypress":return t.which!==32?null:(Xc=!0,Yc);case"textInput":return e=t.data,e===Yc&&Xc?null:e;default:return null}}function Nx(e,t){if(Kn)return e==="compositionend"||!xu&&Op(e,t)?(e=Fp(),Ni=gu=tn=null,Kn=!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 Bp&&t.locale!=="ko"?null:t.data;default:return null}}var jx={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 Kc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!jx[e.type]:t==="textarea"}function Vp(e,t,n,r){wp(r),t=Qi(t,"onChange"),0<t.length&&(n=new mu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var no=null,yo=null;function bx(e){eh(e,0)}function bs(e){var t=Zn(e);if(pp(t))return e}function Mx(e,t){if(e==="change")return t}var Wp=!1;if(Bt){var dl;if(Bt){var fl="oninput"in document;if(!fl){var Qc=document.createElement("div");Qc.setAttribute("oninput","return;"),fl=typeof Qc.oninput=="function"}dl=fl}else dl=!1;Wp=dl&&(!document.documentMode||9<document.documentMode)}function Gc(){no&&(no.detachEvent("onpropertychange",Up),yo=no=null)}function Up(e){if(e.propertyName==="value"&&bs(yo)){var t=[];Vp(t,yo,e,cu(e)),Cp(bx,t)}}function Px(e,t,n){e==="focusin"?(Gc(),no=t,yo=n,no.attachEvent("onpropertychange",Up)):e==="focusout"&&Gc()}function Tx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return bs(yo)}function zx(e,t){if(e==="click")return bs(t)}function Ix(e,t){if(e==="input"||e==="change")return bs(t)}function Lx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vt=typeof Object.is=="function"?Object.is:Lx;function xo(e,t){if(vt(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 o=n[r];if(!Vl.call(t,o)||!vt(e[o],t[o]))return!1}return!0}function Zc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qc(e,t){var n=Zc(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=Zc(n)}}function Yp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xp(){for(var e=window,t=Hi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hi(e.document)}return t}function vu(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 Rx(e){var t=Xp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Yp(n.ownerDocument.documentElement,n)){if(r!==null&&vu(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=qc(n,i);var s=qc(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>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 $x=Bt&&"documentMode"in document&&11>=document.documentMode,Qn=null,aa=null,ro=null,ua=!1;function Jc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ua||Qn==null||Qn!==Hi(r)||(r=Qn,"selectionStart"in r&&vu(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}),ro&&xo(ro,r)||(ro=r,r=Qi(aa,"onSelect"),0<r.length&&(t=new mu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Qn)))}function ii(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Gn={animationend:ii("Animation","AnimationEnd"),animationiteration:ii("Animation","AnimationIteration"),animationstart:ii("Animation","AnimationStart"),transitionend:ii("Transition","TransitionEnd")},pl={},Kp={};Bt&&(Kp=document.createElement("div").style,"AnimationEvent"in window||(delete Gn.animationend.animation,delete Gn.animationiteration.animation,delete Gn.animationstart.animation),"TransitionEvent"in window||delete Gn.transitionend.transition);function Ms(e){if(pl[e])return pl[e];if(!Gn[e])return e;var t=Gn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Kp)return pl[e]=t[n];return e}var Qp=Ms("animationend"),Gp=Ms("animationiteration"),Zp=Ms("animationstart"),qp=Ms("transitionend"),Jp=new Map,ed="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 hn(e,t){Jp.set(e,t),Bn(t,[e])}for(var hl=0;hl<ed.length;hl++){var gl=ed[hl],Dx=gl.toLowerCase(),Ax=gl[0].toUpperCase()+gl.slice(1);hn(Dx,"on"+Ax)}hn(Qp,"onAnimationEnd");hn(Gp,"onAnimationIteration");hn(Zp,"onAnimationStart");hn("dblclick","onDoubleClick");hn("focusin","onFocus");hn("focusout","onBlur");hn(qp,"onTransitionEnd");hr("onMouseEnter",["mouseout","mouseover"]);hr("onMouseLeave",["mouseout","mouseover"]);hr("onPointerEnter",["pointerout","pointerover"]);hr("onPointerLeave",["pointerout","pointerover"]);Bn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gr="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(" "),Fx=new Set("cancel close invalid load scroll toggle".split(" ").concat(Gr));function td(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Dy(r,t,void 0,e),e.currentTarget=null}function eh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==i&&o.isPropagationStopped())break e;td(o,l,u),i=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&o.isPropagationStopped())break e;td(o,l,u),i=a}}}if(Wi)throw e=oa,Wi=!1,oa=null,e}function fe(e,t){var n=t[ha];n===void 0&&(n=t[ha]=new Set);var r=e+"__bubble";n.has(r)||(th(t,e,2,!1),n.add(r))}function ml(e,t,n){var r=0;t&&(r|=4),th(n,e,r,t)}var si="_reactListening"+Math.random().toString(36).slice(2);function vo(e){if(!e[si]){e[si]=!0,ap.forEach(function(n){n!=="selectionchange"&&(Fx.has(n)||ml(n,!1,e),ml(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[si]||(t[si]=!0,ml("selectionchange",!1,t))}}function th(e,t,n,r){switch(Ap(t)){case 1:var o=Jy;break;case 4:o=ex;break;default:o=hu}n=o.bind(null,t,n,e),o=void 0,!ra||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function yl(e,t,n,r,o){var i=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===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;l!==null;){if(s=Sn(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}Cp(function(){var u=i,p=cu(n),c=[];e:{var f=Jp.get(e);if(f!==void 0){var h=mu,x=e;switch(e){case"keypress":if(ji(n)===0)break e;case"keydown":case"keyup":h=gx;break;case"focusin":x="focus",h=cl;break;case"focusout":x="blur",h=cl;break;case"beforeblur":case"afterblur":h=cl;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=Vc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=rx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=xx;break;case Qp:case Gp:case Zp:h=sx;break;case qp:h=wx;break;case"scroll":h=tx;break;case"wheel":h=kx;break;case"copy":case"cut":case"paste":h=ax;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Uc}var w=(t&4)!==0,S=!w&&e==="scroll",m=w?f!==null?f+"Capture":null:f;w=[];for(var y=u,g;y!==null;){g=y;var v=g.stateNode;if(g.tag===5&&v!==null&&(g=v,m!==null&&(v=po(y,m),v!=null&&w.push(wo(y,v,g)))),S)break;y=y.return}0<w.length&&(f=new h(f,x,null,n,p),c.push({event:f,listeners:w}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==ta&&(x=n.relatedTarget||n.fromElement)&&(Sn(x)||x[Ot]))break e;if((h||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,h?(x=n.relatedTarget||n.toElement,h=u,x=x?Sn(x):null,x!==null&&(S=On(x),x!==S||x.tag!==5&&x.tag!==6)&&(x=null)):(h=null,x=u),h!==x)){if(w=Vc,v="onMouseLeave",m="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(w=Uc,v="onPointerLeave",m="onPointerEnter",y="pointer"),S=h==null?f:Zn(h),g=x==null?f:Zn(x),f=new w(v,y+"leave",h,n,p),f.target=S,f.relatedTarget=g,v=null,Sn(p)===u&&(w=new w(m,y+"enter",x,n,p),w.target=g,w.relatedTarget=S,v=w),S=v,h&&x)t:{for(w=h,m=x,y=0,g=w;g;g=Vn(g))y++;for(g=0,v=m;v;v=Vn(v))g++;for(;0<y-g;)w=Vn(w),y--;for(;0<g-y;)m=Vn(m),g--;for(;y--;){if(w===m||m!==null&&w===m.alternate)break t;w=Vn(w),m=Vn(m)}w=null}else w=null;h!==null&&nd(c,f,h,w,!1),x!==null&&S!==null&&nd(c,S,x,w,!0)}}e:{if(f=u?Zn(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var E=Mx;else if(Kc(f))if(Wp)E=Ix;else{E=Tx;var C=Px}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=zx);if(E&&(E=E(e,u))){Vp(c,E,n,p);break e}C&&C(e,f,u),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&Gl(f,"number",f.value)}switch(C=u?Zn(u):window,e){case"focusin":(Kc(C)||C.contentEditable==="true")&&(Qn=C,aa=u,ro=null);break;case"focusout":ro=aa=Qn=null;break;case"mousedown":ua=!0;break;case"contextmenu":case"mouseup":case"dragend":ua=!1,Jc(c,n,p);break;case"selectionchange":if($x)break;case"keydown":case"keyup":Jc(c,n,p)}var j;if(xu)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Kn?Op(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(Bp&&n.locale!=="ko"&&(Kn||P!=="onCompositionStart"?P==="onCompositionEnd"&&Kn&&(j=Fp()):(tn=p,gu="value"in tn?tn.value:tn.textContent,Kn=!0)),C=Qi(u,P),0<C.length&&(P=new Wc(P,e,null,n,p),c.push({event:P,listeners:C}),j?P.data=j:(j=Hp(n),j!==null&&(P.data=j)))),(j=Cx?Ex(e,n):Nx(e,n))&&(u=Qi(u,"onBeforeInput"),0<u.length&&(p=new Wc("onBeforeInput","beforeinput",null,n,p),c.push({event:p,listeners:u}),p.data=j))}eh(c,t)})}function wo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Qi(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=po(e,n),i!=null&&r.unshift(wo(e,i,o)),i=po(e,t),i!=null&&r.push(wo(e,i,o))),e=e.return}return r}function Vn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function nd(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,o?(a=po(n,i),a!=null&&s.unshift(wo(n,a,l))):o||(a=po(n,i),a!=null&&s.push(wo(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Bx=/\r\n?/g,Ox=/\u0000|\uFFFD/g;function rd(e){return(typeof e=="string"?e:""+e).replace(Bx,`
|
|
38
|
+
`).replace(Ox,"")}function li(e,t,n){if(t=rd(t),rd(e)!==t&&n)throw Error(O(425))}function Gi(){}var ca=null,da=null;function fa(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 pa=typeof setTimeout=="function"?setTimeout:void 0,Hx=typeof clearTimeout=="function"?clearTimeout:void 0,od=typeof Promise=="function"?Promise:void 0,Vx=typeof queueMicrotask=="function"?queueMicrotask:typeof od<"u"?function(e){return od.resolve(null).then(e).catch(Wx)}:pa;function Wx(e){setTimeout(function(){throw e})}function xl(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),mo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);mo(t)}function ln(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 id(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 zr=Math.random().toString(36).slice(2),Ct="__reactFiber$"+zr,So="__reactProps$"+zr,Ot="__reactContainer$"+zr,ha="__reactEvents$"+zr,Ux="__reactListeners$"+zr,Yx="__reactHandles$"+zr;function Sn(e){var t=e[Ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ot]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=id(e);e!==null;){if(n=e[Ct])return n;e=id(e)}return t}e=n,n=e.parentNode}return null}function Bo(e){return e=e[Ct]||e[Ot],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Zn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(O(33))}function Ps(e){return e[So]||null}var ga=[],qn=-1;function gn(e){return{current:e}}function pe(e){0>qn||(e.current=ga[qn],ga[qn]=null,qn--)}function ce(e,t){qn++,ga[qn]=e.current,e.current=t}var pn={},De=gn(pn),Ye=gn(!1),Pn=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 o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Xe(e){return e=e.childContextTypes,e!=null}function Zi(){pe(Ye),pe(De)}function sd(e,t,n){if(De.current!==pn)throw Error(O(168));ce(De,t),ce(Ye,n)}function nh(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(O(108,Py(e)||"Unknown",o));return ve({},n,r)}function qi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pn,Pn=De.current,ce(De,e),ce(Ye,Ye.current),!0}function ld(e,t,n){var r=e.stateNode;if(!r)throw Error(O(169));n?(e=nh(e,t,Pn),r.__reactInternalMemoizedMergedChildContext=e,pe(Ye),pe(De),ce(De,e)):pe(Ye),ce(Ye,n)}var It=null,Ts=!1,vl=!1;function rh(e){It===null?It=[e]:It.push(e)}function Xx(e){Ts=!0,rh(e)}function mn(){if(!vl&&It!==null){vl=!0;var e=0,t=le;try{var n=It;for(le=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}It=null,Ts=!1}catch(o){throw It!==null&&(It=It.slice(e+1)),bp(du,mn),o}finally{le=t,vl=!1}}return null}var Jn=[],er=0,Ji=null,es=0,rt=[],ot=0,Tn=null,Rt=1,$t="";function xn(e,t){Jn[er++]=es,Jn[er++]=Ji,Ji=e,es=t}function oh(e,t,n){rt[ot++]=Rt,rt[ot++]=$t,rt[ot++]=Tn,Tn=e;var r=Rt;e=$t;var o=32-yt(r)-1;r&=~(1<<o),n+=1;var i=32-yt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Rt=1<<32-yt(t)+o|n<<o|r,$t=i+e}else Rt=1<<i|n<<o|r,$t=e}function wu(e){e.return!==null&&(xn(e,1),oh(e,1,0))}function Su(e){for(;e===Ji;)Ji=Jn[--er],Jn[er]=null,es=Jn[--er],Jn[er]=null;for(;e===Tn;)Tn=rt[--ot],rt[ot]=null,$t=rt[--ot],rt[ot]=null,Rt=rt[--ot],rt[ot]=null}var qe=null,Ze=null,he=!1,pt=null;function ih(e,t){var n=it(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 ad(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,qe=e,Ze=ln(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,qe=e,Ze=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Tn!==null?{id:Rt,overflow:$t}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=it(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,qe=e,Ze=null,!0):!1;default:return!1}}function ma(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ya(e){if(he){var t=Ze;if(t){var n=t;if(!ad(e,t)){if(ma(e))throw Error(O(418));t=ln(n.nextSibling);var r=qe;t&&ad(e,t)?ih(r,n):(e.flags=e.flags&-4097|2,he=!1,qe=e)}}else{if(ma(e))throw Error(O(418));e.flags=e.flags&-4097|2,he=!1,qe=e}}}function ud(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;qe=e}function ai(e){if(e!==qe)return!1;if(!he)return ud(e),he=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!fa(e.type,e.memoizedProps)),t&&(t=Ze)){if(ma(e))throw sh(),Error(O(418));for(;t;)ih(e,t),t=ln(t.nextSibling)}if(ud(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ze=ln(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ze=null}}else Ze=qe?ln(e.stateNode.nextSibling):null;return!0}function sh(){for(var e=Ze;e;)e=ln(e.nextSibling)}function mr(){Ze=qe=null,he=!1}function ku(e){pt===null?pt=[e]:pt.push(e)}var Kx=Ut.ReactCurrentBatchConfig;function Hr(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(O(309));var r=n.stateNode}if(!r)throw Error(O(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(O(284));if(!n._owner)throw Error(O(290,e))}return e}function ui(e,t){throw e=Object.prototype.toString.call(t),Error(O(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function cd(e){var t=e._init;return t(e._payload)}function lh(e){function t(m,y){if(e){var g=m.deletions;g===null?(m.deletions=[y],m.flags|=16):g.push(y)}}function n(m,y){if(!e)return null;for(;y!==null;)t(m,y),y=y.sibling;return null}function r(m,y){for(m=new Map;y!==null;)y.key!==null?m.set(y.key,y):m.set(y.index,y),y=y.sibling;return m}function o(m,y){return m=dn(m,y),m.index=0,m.sibling=null,m}function i(m,y,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<y?(m.flags|=2,y):g):(m.flags|=2,y)):(m.flags|=1048576,y)}function s(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,y,g,v){return y===null||y.tag!==6?(y=Nl(g,m.mode,v),y.return=m,y):(y=o(y,g),y.return=m,y)}function a(m,y,g,v){var E=g.type;return E===Xn?p(m,y,g.props.children,v,g.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Zt&&cd(E)===y.type)?(v=o(y,g.props),v.ref=Hr(m,y,g),v.return=m,v):(v=Li(g.type,g.key,g.props,null,m.mode,v),v.ref=Hr(m,y,g),v.return=m,v)}function u(m,y,g,v){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=jl(g,m.mode,v),y.return=m,y):(y=o(y,g.children||[]),y.return=m,y)}function p(m,y,g,v,E){return y===null||y.tag!==7?(y=Nn(g,m.mode,v,E),y.return=m,y):(y=o(y,g),y.return=m,y)}function c(m,y,g){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Nl(""+y,m.mode,g),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case qo:return g=Li(y.type,y.key,y.props,null,m.mode,g),g.ref=Hr(m,null,y),g.return=m,g;case Yn:return y=jl(y,m.mode,g),y.return=m,y;case Zt:var v=y._init;return c(m,v(y._payload),g)}if(Kr(y)||Dr(y))return y=Nn(y,m.mode,g,null),y.return=m,y;ui(m,y)}return null}function f(m,y,g,v){var E=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return E!==null?null:l(m,y,""+g,v);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case qo:return g.key===E?a(m,y,g,v):null;case Yn:return g.key===E?u(m,y,g,v):null;case Zt:return E=g._init,f(m,y,E(g._payload),v)}if(Kr(g)||Dr(g))return E!==null?null:p(m,y,g,v,null);ui(m,g)}return null}function h(m,y,g,v,E){if(typeof v=="string"&&v!==""||typeof v=="number")return m=m.get(g)||null,l(y,m,""+v,E);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case qo:return m=m.get(v.key===null?g:v.key)||null,a(y,m,v,E);case Yn:return m=m.get(v.key===null?g:v.key)||null,u(y,m,v,E);case Zt:var C=v._init;return h(m,y,g,C(v._payload),E)}if(Kr(v)||Dr(v))return m=m.get(g)||null,p(y,m,v,E,null);ui(y,v)}return null}function x(m,y,g,v){for(var E=null,C=null,j=y,P=y=0,L=null;j!==null&&P<g.length;P++){j.index>P?(L=j,j=null):L=j.sibling;var F=f(m,j,g[P],v);if(F===null){j===null&&(j=L);break}e&&j&&F.alternate===null&&t(m,j),y=i(F,y,P),C===null?E=F:C.sibling=F,C=F,j=L}if(P===g.length)return n(m,j),he&&xn(m,P),E;if(j===null){for(;P<g.length;P++)j=c(m,g[P],v),j!==null&&(y=i(j,y,P),C===null?E=j:C.sibling=j,C=j);return he&&xn(m,P),E}for(j=r(m,j);P<g.length;P++)L=h(j,m,P,g[P],v),L!==null&&(e&&L.alternate!==null&&j.delete(L.key===null?P:L.key),y=i(L,y,P),C===null?E=L:C.sibling=L,C=L);return e&&j.forEach(function(I){return t(m,I)}),he&&xn(m,P),E}function w(m,y,g,v){var E=Dr(g);if(typeof E!="function")throw Error(O(150));if(g=E.call(g),g==null)throw Error(O(151));for(var C=E=null,j=y,P=y=0,L=null,F=g.next();j!==null&&!F.done;P++,F=g.next()){j.index>P?(L=j,j=null):L=j.sibling;var I=f(m,j,F.value,v);if(I===null){j===null&&(j=L);break}e&&j&&I.alternate===null&&t(m,j),y=i(I,y,P),C===null?E=I:C.sibling=I,C=I,j=L}if(F.done)return n(m,j),he&&xn(m,P),E;if(j===null){for(;!F.done;P++,F=g.next())F=c(m,F.value,v),F!==null&&(y=i(F,y,P),C===null?E=F:C.sibling=F,C=F);return he&&xn(m,P),E}for(j=r(m,j);!F.done;P++,F=g.next())F=h(j,m,P,F.value,v),F!==null&&(e&&F.alternate!==null&&j.delete(F.key===null?P:F.key),y=i(F,y,P),C===null?E=F:C.sibling=F,C=F);return e&&j.forEach(function(R){return t(m,R)}),he&&xn(m,P),E}function S(m,y,g,v){if(typeof g=="object"&&g!==null&&g.type===Xn&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case qo:e:{for(var E=g.key,C=y;C!==null;){if(C.key===E){if(E=g.type,E===Xn){if(C.tag===7){n(m,C.sibling),y=o(C,g.props.children),y.return=m,m=y;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Zt&&cd(E)===C.type){n(m,C.sibling),y=o(C,g.props),y.ref=Hr(m,C,g),y.return=m,m=y;break e}n(m,C);break}else t(m,C);C=C.sibling}g.type===Xn?(y=Nn(g.props.children,m.mode,v,g.key),y.return=m,m=y):(v=Li(g.type,g.key,g.props,null,m.mode,v),v.ref=Hr(m,y,g),v.return=m,m=v)}return s(m);case Yn:e:{for(C=g.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(m,y.sibling),y=o(y,g.children||[]),y.return=m,m=y;break e}else{n(m,y);break}else t(m,y);y=y.sibling}y=jl(g,m.mode,v),y.return=m,m=y}return s(m);case Zt:return C=g._init,S(m,y,C(g._payload),v)}if(Kr(g))return x(m,y,g,v);if(Dr(g))return w(m,y,g,v);ui(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(m,y.sibling),y=o(y,g),y.return=m,m=y):(n(m,y),y=Nl(g,m.mode,v),y.return=m,m=y),s(m)):n(m,y)}return S}var yr=lh(!0),ah=lh(!1),ts=gn(null),ns=null,tr=null,_u=null;function Cu(){_u=tr=ns=null}function Eu(e){var t=ts.current;pe(ts),e._currentValue=t}function xa(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 cr(e,t){ns=e,_u=tr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(We=!0),e.firstContext=null)}function lt(e){var t=e._currentValue;if(_u!==e)if(e={context:e,memoizedValue:t,next:null},tr===null){if(ns===null)throw Error(O(308));tr=e,ns.dependencies={lanes:0,firstContext:e}}else tr=tr.next=e;return t}var kn=null;function Nu(e){kn===null?kn=[e]:kn.push(e)}function uh(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Nu(t)):(n.next=o.next,o.next=n),t.interleaved=n,Ht(e,r)}function Ht(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 qt=!1;function ju(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ch(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 At(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,oe&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Ht(e,n)}return o=r.interleaved,o===null?(t.next=t,Nu(r)):(t.next=o.next,o.next=t),r.interleaved=t,Ht(e,n)}function bi(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,fu(e,n)}}function dd(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=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};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,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 rs(e,t,n,r){var o=e.updateQueue;qt=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==s&&(l===null?p.firstBaseUpdate=u:l.next=u,p.lastBaseUpdate=a))}if(i!==null){var c=o.baseState;s=0,p=u=a=null,l=i;do{var f=l.lane,h=l.eventTime;if((r&f)===f){p!==null&&(p=p.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,w=l;switch(f=t,h=n,w.tag){case 1:if(x=w.payload,typeof x=="function"){c=x.call(h,c,f);break e}c=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,f=typeof x=="function"?x.call(h,c,f):x,f==null)break e;c=ve({},c,f);break e;case 2:qt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[l]:f.push(l))}else h={eventTime:h,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(u=p=h,a=c):p=p.next=h,s|=f;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;f=l,l=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(p===null&&(a=c),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=p,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);In|=s,e.lanes=s,e.memoizedState=c}}function fd(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(O(191,o));o.call(r)}}}var Oo={},Nt=gn(Oo),ko=gn(Oo),_o=gn(Oo);function _n(e){if(e===Oo)throw Error(O(174));return e}function bu(e,t){switch(ce(_o,t),ce(ko,e),ce(Nt,Oo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ql(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ql(t,e)}pe(Nt),ce(Nt,t)}function xr(){pe(Nt),pe(ko),pe(_o)}function dh(e){_n(_o.current);var t=_n(Nt.current),n=ql(t,e.type);t!==n&&(ce(ko,e),ce(Nt,n))}function Mu(e){ko.current===e&&(pe(Nt),pe(ko))}var ye=gn(0);function os(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 wl=[];function Pu(){for(var e=0;e<wl.length;e++)wl[e]._workInProgressVersionPrimary=null;wl.length=0}var Mi=Ut.ReactCurrentDispatcher,Sl=Ut.ReactCurrentBatchConfig,zn=0,xe=null,Ee=null,be=null,is=!1,oo=!1,Co=0,Qx=0;function Le(){throw Error(O(321))}function Tu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vt(e[n],t[n]))return!1;return!0}function zu(e,t,n,r,o,i){if(zn=i,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Mi.current=e===null||e.memoizedState===null?Jx:ev,e=n(r,o),oo){i=0;do{if(oo=!1,Co=0,25<=i)throw Error(O(301));i+=1,be=Ee=null,t.updateQueue=null,Mi.current=tv,e=n(r,o)}while(oo)}if(Mi.current=ss,t=Ee!==null&&Ee.next!==null,zn=0,be=Ee=xe=null,is=!1,t)throw Error(O(300));return e}function Iu(){var e=Co!==0;return Co=0,e}function kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return be===null?xe.memoizedState=be=e:be=be.next=e,be}function at(){if(Ee===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=Ee.next;var t=be===null?xe.memoizedState:be.next;if(t!==null)be=t,Ee=e;else{if(e===null)throw Error(O(310));Ee=e,e={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},be===null?xe.memoizedState=be=e:be=be.next=e}return be}function Eo(e,t){return typeof t=="function"?t(e):t}function kl(e){var t=at(),n=t.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=e;var r=Ee,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,a=null,u=i;do{var p=u.lane;if((zn&p)===p)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:p,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=c,s=r):a=a.next=c,xe.lanes|=p,In|=p}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,vt(r,t.memoizedState)||(We=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,xe.lanes|=i,In|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function _l(e){var t=at(),n=t.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);vt(i,t.memoizedState)||(We=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function fh(){}function ph(e,t){var n=xe,r=at(),o=t(),i=!vt(r.memoizedState,o);if(i&&(r.memoizedState=o,We=!0),r=r.queue,Lu(mh.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||be!==null&&be.memoizedState.tag&1){if(n.flags|=2048,No(9,gh.bind(null,n,r,o,t),void 0,null),Me===null)throw Error(O(349));zn&30||hh(n,t,o)}return o}function hh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xe.updateQueue,t===null?(t={lastEffect:null,stores:null},xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gh(e,t,n,r){t.value=n,t.getSnapshot=r,yh(t)&&xh(e)}function mh(e,t,n){return n(function(){yh(t)&&xh(e)})}function yh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vt(e,n)}catch{return!0}}function xh(e){var t=Ht(e,1);t!==null&&xt(t,e,1,-1)}function pd(e){var t=kt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:e},t.queue=e,e=e.dispatch=qx.bind(null,xe,e),[t.memoizedState,e]}function No(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=xe.updateQueue,t===null?(t={lastEffect:null,stores:null},xe.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 vh(){return at().memoizedState}function Pi(e,t,n,r){var o=kt();xe.flags|=e,o.memoizedState=No(1|t,n,void 0,r===void 0?null:r)}function zs(e,t,n,r){var o=at();r=r===void 0?null:r;var i=void 0;if(Ee!==null){var s=Ee.memoizedState;if(i=s.destroy,r!==null&&Tu(r,s.deps)){o.memoizedState=No(t,n,i,r);return}}xe.flags|=e,o.memoizedState=No(1|t,n,i,r)}function hd(e,t){return Pi(8390656,8,e,t)}function Lu(e,t){return zs(2048,8,e,t)}function wh(e,t){return zs(4,2,e,t)}function Sh(e,t){return zs(4,4,e,t)}function kh(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 _h(e,t,n){return n=n!=null?n.concat([e]):null,zs(4,4,kh.bind(null,t,e),n)}function Ru(){}function Ch(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Tu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Eh(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Tu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Nh(e,t,n){return zn&21?(vt(n,t)||(n=Tp(),xe.lanes|=n,In|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,We=!0),e.memoizedState=n)}function Gx(e,t){var n=le;le=n!==0&&4>n?n:4,e(!0);var r=Sl.transition;Sl.transition={};try{e(!1),t()}finally{le=n,Sl.transition=r}}function jh(){return at().memoizedState}function Zx(e,t,n){var r=cn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bh(e))Mh(t,n);else if(n=uh(e,t,n,r),n!==null){var o=Fe();xt(n,e,r,o),Ph(n,t,r)}}function qx(e,t,n){var r=cn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bh(e))Mh(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,vt(l,s)){var a=t.interleaved;a===null?(o.next=o,Nu(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=uh(e,t,o,r),n!==null&&(o=Fe(),xt(n,e,r,o),Ph(n,t,r))}}function bh(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function Mh(e,t){oo=is=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ph(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,fu(e,n)}}var ss={readContext:lt,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},Jx={readContext:lt,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:hd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Pi(4194308,4,kh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Pi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Pi(4,2,e,t)},useMemo:function(e,t){var n=kt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=kt();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=Zx.bind(null,xe,e),[r.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:pd,useDebugValue:Ru,useDeferredValue:function(e){return kt().memoizedState=e},useTransition:function(){var e=pd(!1),t=e[0];return e=Gx.bind(null,e[1]),kt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xe,o=kt();if(he){if(n===void 0)throw Error(O(407));n=n()}else{if(n=t(),Me===null)throw Error(O(349));zn&30||hh(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,hd(mh.bind(null,r,i,e),[e]),r.flags|=2048,No(9,gh.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=kt(),t=Me.identifierPrefix;if(he){var n=$t,r=Rt;n=(r&~(1<<32-yt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Co++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Qx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ev={readContext:lt,useCallback:Ch,useContext:lt,useEffect:Lu,useImperativeHandle:_h,useInsertionEffect:wh,useLayoutEffect:Sh,useMemo:Eh,useReducer:kl,useRef:vh,useState:function(){return kl(Eo)},useDebugValue:Ru,useDeferredValue:function(e){var t=at();return Nh(t,Ee.memoizedState,e)},useTransition:function(){var e=kl(Eo)[0],t=at().memoizedState;return[e,t]},useMutableSource:fh,useSyncExternalStore:ph,useId:jh,unstable_isNewReconciler:!1},tv={readContext:lt,useCallback:Ch,useContext:lt,useEffect:Lu,useImperativeHandle:_h,useInsertionEffect:wh,useLayoutEffect:Sh,useMemo:Eh,useReducer:_l,useRef:vh,useState:function(){return _l(Eo)},useDebugValue:Ru,useDeferredValue:function(e){var t=at();return Ee===null?t.memoizedState=e:Nh(t,Ee.memoizedState,e)},useTransition:function(){var e=_l(Eo)[0],t=at().memoizedState;return[e,t]},useMutableSource:fh,useSyncExternalStore:ph,useId:jh,unstable_isNewReconciler:!1};function ct(e,t){if(e&&e.defaultProps){t=ve({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function va(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ve({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Is={isMounted:function(e){return(e=e._reactInternals)?On(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fe(),o=cn(e),i=At(r,o);i.payload=t,n!=null&&(i.callback=n),t=an(e,i,o),t!==null&&(xt(t,e,o,r),bi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fe(),o=cn(e),i=At(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=an(e,i,o),t!==null&&(xt(t,e,o,r),bi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fe(),r=cn(e),o=At(n,r);o.tag=2,t!=null&&(o.callback=t),t=an(e,o,r),t!==null&&(xt(t,e,r,n),bi(t,e,r))}};function gd(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!xo(n,r)||!xo(o,i):!0}function Th(e,t,n){var r=!1,o=pn,i=t.contextType;return typeof i=="object"&&i!==null?i=lt(i):(o=Xe(t)?Pn:De.current,r=t.contextTypes,i=(r=r!=null)?gr(e,o):pn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Is,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function md(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&&Is.enqueueReplaceState(t,t.state,null)}function wa(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},ju(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=lt(i):(i=Xe(t)?Pn:De.current,o.context=gr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(va(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Is.enqueueReplaceState(o,o.state,null),rs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function vr(e,t){try{var n="",r=t;do n+=My(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function Cl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Sa(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var nv=typeof WeakMap=="function"?WeakMap:Map;function zh(e,t,n){n=At(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){as||(as=!0,Ta=r),Sa(e,t)},n}function Ih(e,t,n){n=At(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Sa(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Sa(e,t),typeof r!="function"&&(un===null?un=new Set([this]):un.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function yd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nv;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=mv.bind(null,e,t,n),t.then(e,e))}function xd(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 vd(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,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=At(-1,1),t.tag=2,an(n,t,1))),n.lanes|=1),e)}var rv=Ut.ReactCurrentOwner,We=!1;function Ae(e,t,n,r){t.child=e===null?ah(t,null,n,r):yr(t,e.child,n,r)}function wd(e,t,n,r,o){n=n.render;var i=t.ref;return cr(t,o),r=zu(e,t,n,r,i,o),n=Iu(),e!==null&&!We?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Vt(e,t,o)):(he&&n&&wu(t),t.flags|=1,Ae(e,t,r,o),t.child)}function Sd(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Vu(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Lh(e,t,i,r,o)):(e=Li(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:xo,n(s,r)&&e.ref===t.ref)return Vt(e,t,o)}return t.flags|=1,e=dn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Lh(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(xo(i,r)&&e.ref===t.ref)if(We=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(We=!0);else return t.lanes=e.lanes,Vt(e,t,o)}return ka(e,t,n,r,o)}function Rh(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ce(rr,Qe),Qe|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ce(rr,Qe),Qe|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ce(rr,Qe),Qe|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ce(rr,Qe),Qe|=r;return Ae(e,t,o,n),t.child}function $h(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ka(e,t,n,r,o){var i=Xe(n)?Pn:De.current;return i=gr(t,i),cr(t,o),n=zu(e,t,n,r,i,o),r=Iu(),e!==null&&!We?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Vt(e,t,o)):(he&&r&&wu(t),t.flags|=1,Ae(e,t,n,o),t.child)}function kd(e,t,n,r,o){if(Xe(n)){var i=!0;qi(t)}else i=!1;if(cr(t,o),t.stateNode===null)Ti(e,t),Th(t,n,r),wa(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=lt(u):(u=Xe(n)?Pn:De.current,u=gr(t,u));var p=n.getDerivedStateFromProps,c=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&md(t,s,r,u),qt=!1;var f=t.memoizedState;s.state=f,rs(t,r,s,o),a=t.memoizedState,l!==r||f!==a||Ye.current||qt?(typeof p=="function"&&(va(t,n,p,r),a=t.memoizedState),(l=qt||gd(t,n,l,r,f,a,u))?(c||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=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,ch(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ct(t.type,l),s.props=u,c=t.pendingProps,f=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=lt(a):(a=Xe(n)?Pn:De.current,a=gr(t,a));var h=n.getDerivedStateFromProps;(p=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==c||f!==a)&&md(t,s,r,a),qt=!1,f=t.memoizedState,s.state=f,rs(t,r,s,o);var x=t.memoizedState;l!==c||f!==x||Ye.current||qt?(typeof h=="function"&&(va(t,n,h,r),x=t.memoizedState),(u=qt||gd(t,n,u,r,f,x,a)||!1)?(p||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,x,a)),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=x),s.props=r,s.state=x,s.context=a,r=u):(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 _a(e,t,n,r,i,o)}function _a(e,t,n,r,o,i){$h(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&ld(t,n,!1),Vt(e,t,i);r=t.stateNode,rv.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,i),t.child=yr(t,null,l,i)):Ae(e,t,l,i),t.memoizedState=r.state,o&&ld(t,n,!0),t.child}function Dh(e){var t=e.stateNode;t.pendingContext?sd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&sd(e,t.context,!1),bu(e,t.containerInfo)}function _d(e,t,n,r,o){return mr(),ku(o),t.flags|=256,Ae(e,t,n,r),t.child}var Ca={dehydrated:null,treeContext:null,retryLane:0};function Ea(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ah(e,t,n){var r=t.pendingProps,o=ye.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ce(ye,o&1),e===null)return ya(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,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=$s(s,r,0,null),e=Nn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Ea(n),t.memoizedState=Ca,e):$u(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return ov(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=dn(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=dn(l,i):(i=Nn(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Ea(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Ca,r}return i=e.child,e=i.sibling,r=dn(i,{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 $u(e,t){return t=$s({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ci(e,t,n,r){return r!==null&&ku(r),yr(t,e.child,null,n),e=$u(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ov(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Cl(Error(O(422))),ci(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=$s({mode:"visible",children:r.children},o,0,null),i=Nn(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&yr(t,e.child,null,s),t.child.memoizedState=Ea(s),t.memoizedState=Ca,i);if(!(t.mode&1))return ci(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(O(419)),r=Cl(i,r,void 0),ci(e,t,s,r)}if(l=(s&e.childLanes)!==0,We||l){if(r=Me,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Ht(e,o),xt(r,e,o,-1))}return Hu(),r=Cl(Error(O(421))),ci(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=yv.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ze=ln(o.nextSibling),qe=t,he=!0,pt=null,e!==null&&(rt[ot++]=Rt,rt[ot++]=$t,rt[ot++]=Tn,Rt=e.id,$t=e.overflow,Tn=t),t=$u(t,r.children),t.flags|=4096,t)}function Cd(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xa(e.return,t,n)}function El(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Fh(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ae(e,t,r.children,n),r=ye.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&&Cd(e,n,t);else if(e.tag===19)Cd(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(ce(ye,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&os(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),El(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&os(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}El(t,!0,n,null,i);break;case"together":El(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ti(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),In|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(O(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 iv(e,t,n){switch(t.tag){case 3:Dh(t),mr();break;case 5:dh(t);break;case 1:Xe(t.type)&&qi(t);break;case 4:bu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ce(ts,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ce(ye,ye.current&1),t.flags|=128,null):n&t.child.childLanes?Ah(e,t,n):(ce(ye,ye.current&1),e=Vt(e,t,n),e!==null?e.sibling:null);ce(ye,ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Fh(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ce(ye,ye.current),r)break;return null;case 22:case 23:return t.lanes=0,Rh(e,t,n)}return Vt(e,t,n)}var Bh,Na,Oh,Hh;Bh=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}};Na=function(){};Oh=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,_n(Nt.current);var i=null;switch(n){case"input":o=Kl(e,o),r=Kl(e,r),i=[];break;case"select":o=ve({},o,{value:void 0}),r=ve({},r,{value:void 0}),i=[];break;case"textarea":o=Zl(e,o),r=Zl(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Gi)}Jl(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(co.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(co.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&fe("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Hh=function(e,t,n,r){n!==r&&(t.flags|=4)};function Vr(e,t){if(!he)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 Re(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function sv(e,t,n){var r=t.pendingProps;switch(Su(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Re(t),null;case 1:return Xe(t.type)&&Zi(),Re(t),null;case 3:return r=t.stateNode,xr(),pe(Ye),pe(De),Pu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ai(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pt!==null&&(La(pt),pt=null))),Na(e,t),Re(t),null;case 5:Mu(t);var o=_n(_o.current);if(n=t.type,e!==null&&t.stateNode!=null)Oh(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(O(166));return Re(t),null}if(e=_n(Nt.current),ai(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Ct]=t,r[So]=i,e=(t.mode&1)!==0,n){case"dialog":fe("cancel",r),fe("close",r);break;case"iframe":case"object":case"embed":fe("load",r);break;case"video":case"audio":for(o=0;o<Gr.length;o++)fe(Gr[o],r);break;case"source":fe("error",r);break;case"img":case"image":case"link":fe("error",r),fe("load",r);break;case"details":fe("toggle",r);break;case"input":Ic(r,i),fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},fe("invalid",r);break;case"textarea":Rc(r,i),fe("invalid",r)}Jl(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&li(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&li(r.textContent,l,e),o=["children",""+l]):co.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&fe("scroll",r)}switch(n){case"input":Jo(r),Lc(r,i,!0);break;case"textarea":Jo(r),$c(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Gi)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=mp(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[Ct]=t,e[So]=r,Bh(e,t,!1,!1),t.stateNode=e;e:{switch(s=ea(n,r),n){case"dialog":fe("cancel",e),fe("close",e),o=r;break;case"iframe":case"object":case"embed":fe("load",e),o=r;break;case"video":case"audio":for(o=0;o<Gr.length;o++)fe(Gr[o],e);o=r;break;case"source":fe("error",e),o=r;break;case"img":case"image":case"link":fe("error",e),fe("load",e),o=r;break;case"details":fe("toggle",e),o=r;break;case"input":Ic(e,r),o=Kl(e,r),fe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ve({},r,{value:void 0}),fe("invalid",e);break;case"textarea":Rc(e,r),o=Zl(e,r),fe("invalid",e);break;default:o=r}Jl(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?vp(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&yp(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&fo(e,a):typeof a=="number"&&fo(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(co.hasOwnProperty(i)?a!=null&&i==="onScroll"&&fe("scroll",e):a!=null&&su(e,i,a,s))}switch(n){case"input":Jo(e),Lc(e,r,!1);break;case"textarea":Jo(e),$c(e);break;case"option":r.value!=null&&e.setAttribute("value",""+fn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?sr(e,!!r.multiple,i,!1):r.defaultValue!=null&&sr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Gi)}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 Re(t),null;case 6:if(e&&t.stateNode!=null)Hh(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(O(166));if(n=_n(_o.current),_n(Nt.current),ai(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ct]=t,(i=r.nodeValue!==n)&&(e=qe,e!==null))switch(e.tag){case 3:li(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&li(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ct]=t,t.stateNode=r}return Re(t),null;case 13:if(pe(ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(he&&Ze!==null&&t.mode&1&&!(t.flags&128))sh(),mr(),t.flags|=98560,i=!1;else if(i=ai(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(O(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(O(317));i[Ct]=t}else mr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Re(t),i=!1}else pt!==null&&(La(pt),pt=null),i=!0;if(!i)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||ye.current&1?Ne===0&&(Ne=3):Hu())),t.updateQueue!==null&&(t.flags|=4),Re(t),null);case 4:return xr(),Na(e,t),e===null&&vo(t.stateNode.containerInfo),Re(t),null;case 10:return Eu(t.type._context),Re(t),null;case 17:return Xe(t.type)&&Zi(),Re(t),null;case 19:if(pe(ye),i=t.memoizedState,i===null)return Re(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Vr(i,!1);else{if(Ne!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=os(e),s!==null){for(t.flags|=128,Vr(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ce(ye,ye.current&1|2),t.child}e=e.sibling}i.tail!==null&&ke()>wr&&(t.flags|=128,r=!0,Vr(i,!1),t.lanes=4194304)}else{if(!r)if(e=os(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Vr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!he)return Re(t),null}else 2*ke()-i.renderingStartTime>wr&&n!==1073741824&&(t.flags|=128,r=!0,Vr(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ke(),t.sibling=null,n=ye.current,ce(ye,r?n&1|2:n&1),t):(Re(t),null);case 22:case 23:return Ou(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Qe&1073741824&&(Re(t),t.subtreeFlags&6&&(t.flags|=8192)):Re(t),null;case 24:return null;case 25:return null}throw Error(O(156,t.tag))}function lv(e,t){switch(Su(t),t.tag){case 1:return Xe(t.type)&&Zi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xr(),pe(Ye),pe(De),Pu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Mu(t),null;case 13:if(pe(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));mr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(ye),null;case 4:return xr(),null;case 10:return Eu(t.type._context),null;case 22:case 23:return Ou(),null;case 24:return null;default:return null}}var di=!1,$e=!1,av=typeof WeakSet=="function"?WeakSet:Set,U=null;function nr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){we(e,t,r)}else n.current=null}function ja(e,t,n){try{n()}catch(r){we(e,t,r)}}var Ed=!1;function uv(e,t){if(ca=Xi,e=Xp(),vu(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,p=0,c=e,f=null;t:for(;;){for(var h;c!==n||o!==0&&c.nodeType!==3||(l=s+o),c!==i||r!==0&&c.nodeType!==3||(a=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(h=c.firstChild)!==null;)f=c,c=h;for(;;){if(c===e)break t;if(f===n&&++u===o&&(l=s),f===i&&++p===r&&(a=s),(h=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(da={focusedElem:e,selectionRange:n},Xi=!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 x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,S=x.memoizedState,m=t.stateNode,y=m.getSnapshotBeforeUpdate(t.elementType===t.type?w:ct(t.type,w),S);m.__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(O(163))}}catch(v){we(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return x=Ed,Ed=!1,x}function io(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&ja(t,n,i)}o=o.next}while(o!==r)}}function Ls(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 ba(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 Vh(e){var t=e.alternate;t!==null&&(e.alternate=null,Vh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ct],delete t[So],delete t[ha],delete t[Ux],delete t[Yx])),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 Wh(e){return e.tag===5||e.tag===3||e.tag===4}function Nd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wh(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 Ma(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=Gi));else if(r!==4&&(e=e.child,e!==null))for(Ma(e,t,n),e=e.sibling;e!==null;)Ma(e,t,n),e=e.sibling}function Pa(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(Pa(e,t,n),e=e.sibling;e!==null;)Pa(e,t,n),e=e.sibling}var Pe=null,dt=!1;function Kt(e,t,n){for(n=n.child;n!==null;)Uh(e,t,n),n=n.sibling}function Uh(e,t,n){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Ns,n)}catch{}switch(n.tag){case 5:$e||nr(n,t);case 6:var r=Pe,o=dt;Pe=null,Kt(e,t,n),Pe=r,dt=o,Pe!==null&&(dt?(e=Pe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pe.removeChild(n.stateNode));break;case 18:Pe!==null&&(dt?(e=Pe,n=n.stateNode,e.nodeType===8?xl(e.parentNode,n):e.nodeType===1&&xl(e,n),mo(e)):xl(Pe,n.stateNode));break;case 4:r=Pe,o=dt,Pe=n.stateNode.containerInfo,dt=!0,Kt(e,t,n),Pe=r,dt=o;break;case 0:case 11:case 14:case 15:if(!$e&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&ja(n,t,s),o=o.next}while(o!==r)}Kt(e,t,n);break;case 1:if(!$e&&(nr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){we(n,t,l)}Kt(e,t,n);break;case 21:Kt(e,t,n);break;case 22:n.mode&1?($e=(r=$e)||n.memoizedState!==null,Kt(e,t,n),$e=r):Kt(e,t,n);break;default:Kt(e,t,n)}}function jd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new av),t.forEach(function(r){var o=xv.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ut(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Pe=l.stateNode,dt=!1;break e;case 3:Pe=l.stateNode.containerInfo,dt=!0;break e;case 4:Pe=l.stateNode.containerInfo,dt=!0;break e}l=l.return}if(Pe===null)throw Error(O(160));Uh(i,s,o),Pe=null,dt=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){we(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Yh(t,e),t=t.sibling}function Yh(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ut(t,e),St(e),r&4){try{io(3,e,e.return),Ls(3,e)}catch(w){we(e,e.return,w)}try{io(5,e,e.return)}catch(w){we(e,e.return,w)}}break;case 1:ut(t,e),St(e),r&512&&n!==null&&nr(n,n.return);break;case 5:if(ut(t,e),St(e),r&512&&n!==null&&nr(n,n.return),e.flags&32){var o=e.stateNode;try{fo(o,"")}catch(w){we(e,e.return,w)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&hp(o,i),ea(l,s);var u=ea(l,i);for(s=0;s<a.length;s+=2){var p=a[s],c=a[s+1];p==="style"?vp(o,c):p==="dangerouslySetInnerHTML"?yp(o,c):p==="children"?fo(o,c):su(o,p,c,u)}switch(l){case"input":Ql(o,i);break;case"textarea":gp(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?sr(o,!!i.multiple,h,!1):f!==!!i.multiple&&(i.defaultValue!=null?sr(o,!!i.multiple,i.defaultValue,!0):sr(o,!!i.multiple,i.multiple?[]:"",!1))}o[So]=i}catch(w){we(e,e.return,w)}}break;case 6:if(ut(t,e),St(e),r&4){if(e.stateNode===null)throw Error(O(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(w){we(e,e.return,w)}}break;case 3:if(ut(t,e),St(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{mo(t.containerInfo)}catch(w){we(e,e.return,w)}break;case 4:ut(t,e),St(e);break;case 13:ut(t,e),St(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Fu=ke())),r&4&&jd(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?($e=(u=$e)||p,ut(t,e),$e=u):ut(t,e),St(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!p&&e.mode&1)for(U=e,p=e.child;p!==null;){for(c=U=p;U!==null;){switch(f=U,h=f.child,f.tag){case 0:case 11:case 14:case 15:io(4,f,f.return);break;case 1:nr(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){we(r,n,w)}}break;case 5:nr(f,f.return);break;case 22:if(f.memoizedState!==null){Md(c);continue}}h!==null?(h.return=f,U=h):Md(c)}p=p.sibling}e:for(p=null,c=e;;){if(c.tag===5){if(p===null){p=c;try{o=c.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=c.stateNode,a=c.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=xp("display",s))}catch(w){we(e,e.return,w)}}}else if(c.tag===6){if(p===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(w){we(e,e.return,w)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;p===c&&(p=null),c=c.return}p===c&&(p=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:ut(t,e),St(e),r&4&&jd(e);break;case 21:break;default:ut(t,e),St(e)}}function St(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Wh(n)){var r=n;break e}n=n.return}throw Error(O(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(fo(o,""),r.flags&=-33);var i=Nd(e);Pa(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Nd(e);Ma(e,l,s);break;default:throw Error(O(161))}}catch(a){we(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function cv(e,t,n){U=e,Xh(e)}function Xh(e,t,n){for(var r=(e.mode&1)!==0;U!==null;){var o=U,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||di;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||$e;l=di;var u=$e;if(di=s,($e=a)&&!u)for(U=o;U!==null;)s=U,a=s.child,s.tag===22&&s.memoizedState!==null?Pd(o):a!==null?(a.return=s,U=a):Pd(o);for(;i!==null;)U=i,Xh(i),i=i.sibling;U=o,di=l,$e=u}bd(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,U=i):bd(e)}}function bd(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:$e||Ls(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!$e)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ct(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&fd(t,i,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}fd(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var p=u.memoizedState;if(p!==null){var c=p.dehydrated;c!==null&&mo(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(O(163))}$e||t.flags&512&&ba(t)}catch(f){we(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 Md(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 Pd(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ls(4,t)}catch(a){we(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){we(t,o,a)}}var i=t.return;try{ba(t)}catch(a){we(t,i,a)}break;case 5:var s=t.return;try{ba(t)}catch(a){we(t,s,a)}}}catch(a){we(t,t.return,a)}if(t===e){U=null;break}var l=t.sibling;if(l!==null){l.return=t.return,U=l;break}U=t.return}}var dv=Math.ceil,ls=Ut.ReactCurrentDispatcher,Du=Ut.ReactCurrentOwner,st=Ut.ReactCurrentBatchConfig,oe=0,Me=null,_e=null,Te=0,Qe=0,rr=gn(0),Ne=0,jo=null,In=0,Rs=0,Au=0,so=null,Ve=null,Fu=0,wr=1/0,zt=null,as=!1,Ta=null,un=null,fi=!1,nn=null,us=0,lo=0,za=null,zi=-1,Ii=0;function Fe(){return oe&6?ke():zi!==-1?zi:zi=ke()}function cn(e){return e.mode&1?oe&2&&Te!==0?Te&-Te:Kx.transition!==null?(Ii===0&&(Ii=Tp()),Ii):(e=le,e!==0||(e=window.event,e=e===void 0?16:Ap(e.type)),e):1}function xt(e,t,n,r){if(50<lo)throw lo=0,za=null,Error(O(185));Ao(e,n,r),(!(oe&2)||e!==Me)&&(e===Me&&(!(oe&2)&&(Rs|=n),Ne===4&&en(e,Te)),Ke(e,r),n===1&&oe===0&&!(t.mode&1)&&(wr=ke()+500,Ts&&mn()))}function Ke(e,t){var n=e.callbackNode;Ky(e,t);var r=Yi(e,e===Me?Te:0);if(r===0)n!==null&&Fc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Fc(n),t===1)e.tag===0?Xx(Td.bind(null,e)):rh(Td.bind(null,e)),Vx(function(){!(oe&6)&&mn()}),n=null;else{switch(zp(r)){case 1:n=du;break;case 4:n=Mp;break;case 16:n=Ui;break;case 536870912:n=Pp;break;default:n=Ui}n=tg(n,Kh.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Kh(e,t){if(zi=-1,Ii=0,oe&6)throw Error(O(327));var n=e.callbackNode;if(dr()&&e.callbackNode!==n)return null;var r=Yi(e,e===Me?Te:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=cs(e,r);else{t=r;var o=oe;oe|=2;var i=Gh();(Me!==e||Te!==t)&&(zt=null,wr=ke()+500,En(e,t));do try{hv();break}catch(l){Qh(e,l)}while(!0);Cu(),ls.current=i,oe=o,_e!==null?t=0:(Me=null,Te=0,t=Ne)}if(t!==0){if(t===2&&(o=ia(e),o!==0&&(r=o,t=Ia(e,o))),t===1)throw n=jo,En(e,0),en(e,r),Ke(e,ke()),n;if(t===6)en(e,r);else{if(o=e.current.alternate,!(r&30)&&!fv(o)&&(t=cs(e,r),t===2&&(i=ia(e),i!==0&&(r=i,t=Ia(e,i))),t===1))throw n=jo,En(e,0),en(e,r),Ke(e,ke()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(O(345));case 2:vn(e,Ve,zt);break;case 3:if(en(e,r),(r&130023424)===r&&(t=Fu+500-ke(),10<t)){if(Yi(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Fe(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=pa(vn.bind(null,e,Ve,zt),t);break}vn(e,Ve,zt);break;case 4:if(en(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-yt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=ke()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*dv(r/1960))-r,10<r){e.timeoutHandle=pa(vn.bind(null,e,Ve,zt),r);break}vn(e,Ve,zt);break;case 5:vn(e,Ve,zt);break;default:throw Error(O(329))}}}return Ke(e,ke()),e.callbackNode===n?Kh.bind(null,e):null}function Ia(e,t){var n=so;return e.current.memoizedState.isDehydrated&&(En(e,t).flags|=256),e=cs(e,t),e!==2&&(t=Ve,Ve=n,t!==null&&La(t)),e}function La(e){Ve===null?Ve=e:Ve.push.apply(Ve,e)}function fv(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 o=n[r],i=o.getSnapshot;o=o.value;try{if(!vt(i(),o))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 en(e,t){for(t&=~Au,t&=~Rs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-yt(t),r=1<<n;e[n]=-1,t&=~r}}function Td(e){if(oe&6)throw Error(O(327));dr();var t=Yi(e,0);if(!(t&1))return Ke(e,ke()),null;var n=cs(e,t);if(e.tag!==0&&n===2){var r=ia(e);r!==0&&(t=r,n=Ia(e,r))}if(n===1)throw n=jo,En(e,0),en(e,t),Ke(e,ke()),n;if(n===6)throw Error(O(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,vn(e,Ve,zt),Ke(e,ke()),null}function Bu(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(wr=ke()+500,Ts&&mn())}}function Ln(e){nn!==null&&nn.tag===0&&!(oe&6)&&dr();var t=oe;oe|=1;var n=st.transition,r=le;try{if(st.transition=null,le=1,e)return e()}finally{le=r,st.transition=n,oe=t,!(oe&6)&&mn()}}function Ou(){Qe=rr.current,pe(rr)}function En(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Hx(n)),_e!==null)for(n=_e.return;n!==null;){var r=n;switch(Su(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Zi();break;case 3:xr(),pe(Ye),pe(De),Pu();break;case 5:Mu(r);break;case 4:xr();break;case 13:pe(ye);break;case 19:pe(ye);break;case 10:Eu(r.type._context);break;case 22:case 23:Ou()}n=n.return}if(Me=e,_e=e=dn(e.current,null),Te=Qe=t,Ne=0,jo=null,Au=Rs=In=0,Ve=so=null,kn!==null){for(t=0;t<kn.length;t++)if(n=kn[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}kn=null}return e}function Qh(e,t){do{var n=_e;try{if(Cu(),Mi.current=ss,is){for(var r=xe.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}is=!1}if(zn=0,be=Ee=xe=null,oo=!1,Co=0,Du.current=null,n===null||n.return===null){Ne=1,jo=t,_e=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=Te,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,p=l,c=p.tag;if(!(p.mode&1)&&(c===0||c===11||c===15)){var f=p.alternate;f?(p.updateQueue=f.updateQueue,p.memoizedState=f.memoizedState,p.lanes=f.lanes):(p.updateQueue=null,p.memoizedState=null)}var h=xd(s);if(h!==null){h.flags&=-257,vd(h,s,l,i,t),h.mode&1&&yd(i,u,t),t=h,a=u;var x=t.updateQueue;if(x===null){var w=new Set;w.add(a),t.updateQueue=w}else x.add(a);break e}else{if(!(t&1)){yd(i,u,t),Hu();break e}a=Error(O(426))}}else if(he&&l.mode&1){var S=xd(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),vd(S,s,l,i,t),ku(vr(a,l));break e}}i=a=vr(a,l),Ne!==4&&(Ne=2),so===null?so=[i]:so.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var m=zh(i,a,t);dd(i,m);break e;case 1:l=a;var y=i.type,g=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(un===null||!un.has(g)))){i.flags|=65536,t&=-t,i.lanes|=t;var v=Ih(i,l,t);dd(i,v);break e}}i=i.return}while(i!==null)}qh(n)}catch(E){t=E,_e===n&&n!==null&&(_e=n=n.return);continue}break}while(!0)}function Gh(){var e=ls.current;return ls.current=ss,e===null?ss:e}function Hu(){(Ne===0||Ne===3||Ne===2)&&(Ne=4),Me===null||!(In&268435455)&&!(Rs&268435455)||en(Me,Te)}function cs(e,t){var n=oe;oe|=2;var r=Gh();(Me!==e||Te!==t)&&(zt=null,En(e,t));do try{pv();break}catch(o){Qh(e,o)}while(!0);if(Cu(),oe=n,ls.current=r,_e!==null)throw Error(O(261));return Me=null,Te=0,Ne}function pv(){for(;_e!==null;)Zh(_e)}function hv(){for(;_e!==null&&!Fy();)Zh(_e)}function Zh(e){var t=eg(e.alternate,e,Qe);e.memoizedProps=e.pendingProps,t===null?qh(e):_e=t,Du.current=null}function qh(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=lv(n,t),n!==null){n.flags&=32767,_e=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ne=6,_e=null;return}}else if(n=sv(n,t,Qe),n!==null){_e=n;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);Ne===0&&(Ne=5)}function vn(e,t,n){var r=le,o=st.transition;try{st.transition=null,le=1,gv(e,t,n,r)}finally{st.transition=o,le=r}return null}function gv(e,t,n,r){do dr();while(nn!==null);if(oe&6)throw Error(O(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(O(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Qy(e,i),e===Me&&(_e=Me=null,Te=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||fi||(fi=!0,tg(Ui,function(){return dr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=st.transition,st.transition=null;var s=le;le=1;var l=oe;oe|=4,Du.current=null,uv(e,n),Yh(n,e),Rx(da),Xi=!!ca,da=ca=null,e.current=n,cv(n),By(),oe=l,le=s,st.transition=i}else e.current=n;if(fi&&(fi=!1,nn=e,us=o),i=e.pendingLanes,i===0&&(un=null),Vy(n.stateNode),Ke(e,ke()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(as)throw as=!1,e=Ta,Ta=null,e;return us&1&&e.tag!==0&&dr(),i=e.pendingLanes,i&1?e===za?lo++:(lo=0,za=e):lo=0,mn(),null}function dr(){if(nn!==null){var e=zp(us),t=st.transition,n=le;try{if(st.transition=null,le=16>e?16:e,nn===null)var r=!1;else{if(e=nn,nn=null,us=0,oe&6)throw Error(O(331));var o=oe;for(oe|=4,U=e.current;U!==null;){var i=U,s=i.child;if(U.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(U=u;U!==null;){var p=U;switch(p.tag){case 0:case 11:case 15:io(8,p,i)}var c=p.child;if(c!==null)c.return=p,U=c;else for(;U!==null;){p=U;var f=p.sibling,h=p.return;if(Vh(p),p===u){U=null;break}if(f!==null){f.return=h,U=f;break}U=h}}}var x=i.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var S=w.sibling;w.sibling=null,w=S}while(w!==null)}}U=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,U=s;else e:for(;U!==null;){if(i=U,i.flags&2048)switch(i.tag){case 0:case 11:case 15:io(9,i,i.return)}var m=i.sibling;if(m!==null){m.return=i.return,U=m;break e}U=i.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:Ls(9,l)}}catch(E){we(l,l.return,E)}if(l===s){U=null;break e}var v=l.sibling;if(v!==null){v.return=l.return,U=v;break e}U=l.return}}if(oe=o,mn(),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Ns,e)}catch{}r=!0}return r}finally{le=n,st.transition=t}}return!1}function zd(e,t,n){t=vr(n,t),t=zh(e,t,1),e=an(e,t,1),t=Fe(),e!==null&&(Ao(e,1,t),Ke(e,t))}function we(e,t,n){if(e.tag===3)zd(e,e,n);else for(;t!==null;){if(t.tag===3){zd(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(un===null||!un.has(r))){e=vr(n,e),e=Ih(t,e,1),t=an(t,e,1),e=Fe(),t!==null&&(Ao(t,1,e),Ke(t,e));break}}t=t.return}}function mv(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Fe(),e.pingedLanes|=e.suspendedLanes&n,Me===e&&(Te&n)===n&&(Ne===4||Ne===3&&(Te&130023424)===Te&&500>ke()-Fu?En(e,0):Au|=n),Ke(e,t)}function Jh(e,t){t===0&&(e.mode&1?(t=ni,ni<<=1,!(ni&130023424)&&(ni=4194304)):t=1);var n=Fe();e=Ht(e,t),e!==null&&(Ao(e,t,n),Ke(e,n))}function yv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jh(e,n)}function xv(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(O(314))}r!==null&&r.delete(t),Jh(e,n)}var eg;eg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ye.current)We=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return We=!1,iv(e,t,n);We=!!(e.flags&131072)}else We=!1,he&&t.flags&1048576&&oh(t,es,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ti(e,t),e=t.pendingProps;var o=gr(t,De.current);cr(t,n),o=zu(null,t,r,e,o,n);var i=Iu();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Xe(r)?(i=!0,qi(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ju(t),o.updater=Is,t.stateNode=o,o._reactInternals=t,wa(t,r,e,n),t=_a(null,t,r,!0,i,n)):(t.tag=0,he&&i&&wu(t),Ae(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ti(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=wv(r),e=ct(r,e),o){case 0:t=ka(null,t,r,e,n);break e;case 1:t=kd(null,t,r,e,n);break e;case 11:t=wd(null,t,r,e,n);break e;case 14:t=Sd(null,t,r,ct(r.type,e),n);break e}throw Error(O(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),ka(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),kd(e,t,r,o,n);case 3:e:{if(Dh(t),e===null)throw Error(O(387));r=t.pendingProps,i=t.memoizedState,o=i.element,ch(e,t),rs(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=vr(Error(O(423)),t),t=_d(e,t,r,n,o);break e}else if(r!==o){o=vr(Error(O(424)),t),t=_d(e,t,r,n,o);break e}else for(Ze=ln(t.stateNode.containerInfo.firstChild),qe=t,he=!0,pt=null,n=ah(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(mr(),r===o){t=Vt(e,t,n);break e}Ae(e,t,r,n)}t=t.child}return t;case 5:return dh(t),e===null&&ya(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,fa(r,o)?s=null:i!==null&&fa(r,i)&&(t.flags|=32),$h(e,t),Ae(e,t,s,n),t.child;case 6:return e===null&&ya(t),null;case 13:return Ah(e,t,n);case 4:return bu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yr(t,null,r,n):Ae(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),wd(e,t,r,o,n);case 7:return Ae(e,t,t.pendingProps,n),t.child;case 8:return Ae(e,t,t.pendingProps.children,n),t.child;case 12:return Ae(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,ce(ts,r._currentValue),r._currentValue=s,i!==null)if(vt(i.value,s)){if(i.children===o.children&&!Ye.current){t=Vt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=At(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?a.next=a:(a.next=p.next,p.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),xa(i.return,n,t),l.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(O(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),xa(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Ae(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,cr(t,n),o=lt(o),r=r(o),t.flags|=1,Ae(e,t,r,n),t.child;case 14:return r=t.type,o=ct(r,t.pendingProps),o=ct(r.type,o),Sd(e,t,r,o,n);case 15:return Lh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),Ti(e,t),t.tag=1,Xe(r)?(e=!0,qi(t)):e=!1,cr(t,n),Th(t,r,o),wa(t,r,o,n),_a(null,t,r,!0,e,n);case 19:return Fh(e,t,n);case 22:return Rh(e,t,n)}throw Error(O(156,t.tag))};function tg(e,t){return bp(e,t)}function vv(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 it(e,t,n,r){return new vv(e,t,n,r)}function Vu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wv(e){if(typeof e=="function")return Vu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===au)return 11;if(e===uu)return 14}return 2}function dn(e,t){var n=e.alternate;return n===null?(n=it(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 Li(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Vu(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Xn:return Nn(n.children,o,i,t);case lu:s=8,o|=8;break;case Wl:return e=it(12,n,t,o|2),e.elementType=Wl,e.lanes=i,e;case Ul:return e=it(13,n,t,o),e.elementType=Ul,e.lanes=i,e;case Yl:return e=it(19,n,t,o),e.elementType=Yl,e.lanes=i,e;case dp:return $s(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case up:s=10;break e;case cp:s=9;break e;case au:s=11;break e;case uu:s=14;break e;case Zt:s=16,r=null;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=it(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Nn(e,t,n,r){return e=it(7,e,r,t),e.lanes=n,e}function $s(e,t,n,r){return e=it(22,e,r,t),e.elementType=dp,e.lanes=n,e.stateNode={isHidden:!1},e}function Nl(e,t,n){return e=it(6,e,null,t),e.lanes=n,e}function jl(e,t,n){return t=it(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Sv(e,t,n,r,o){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=ll(0),this.expirationTimes=ll(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ll(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Wu(e,t,n,r,o,i,s,l,a){return e=new Sv(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=it(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ju(i),e}function kv(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Yn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ng(e){if(!e)return pn;e=e._reactInternals;e:{if(On(e)!==e||e.tag!==1)throw Error(O(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Xe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(O(171))}if(e.tag===1){var n=e.type;if(Xe(n))return nh(e,n,t)}return t}function rg(e,t,n,r,o,i,s,l,a){return e=Wu(n,r,!0,e,o,i,s,l,a),e.context=ng(null),n=e.current,r=Fe(),o=cn(n),i=At(r,o),i.callback=t??null,an(n,i,o),e.current.lanes=o,Ao(e,o,r),Ke(e,r),e}function Ds(e,t,n,r){var o=t.current,i=Fe(),s=cn(o);return n=ng(n),t.context===null?t.context=n:t.pendingContext=n,t=At(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=an(o,t,s),e!==null&&(xt(e,o,s,i),bi(e,o,s)),s}function ds(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 Id(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Uu(e,t){Id(e,t),(e=e.alternate)&&Id(e,t)}function _v(){return null}var og=typeof reportError=="function"?reportError:function(e){console.error(e)};function Yu(e){this._internalRoot=e}As.prototype.render=Yu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(O(409));Ds(e,t,null,null)};As.prototype.unmount=Yu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ln(function(){Ds(null,e,null,null)}),t[Ot]=null}};function As(e){this._internalRoot=e}As.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Jt.length&&t!==0&&t<Jt[n].priority;n++);Jt.splice(n,0,e),n===0&&Dp(e)}};function Xu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Fs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ld(){}function Cv(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=ds(s);i.call(u)}}var s=rg(t,r,e,0,null,!1,!1,"",Ld);return e._reactRootContainer=s,e[Ot]=s.current,vo(e.nodeType===8?e.parentNode:e),Ln(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=ds(a);l.call(u)}}var a=Wu(e,0,!1,null,null,!1,!1,"",Ld);return e._reactRootContainer=a,e[Ot]=a.current,vo(e.nodeType===8?e.parentNode:e),Ln(function(){Ds(t,a,n,r)}),a}function Bs(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var a=ds(s);l.call(a)}}Ds(t,s,e,o)}else s=Cv(n,t,e,o,r);return ds(s)}Ip=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Qr(t.pendingLanes);n!==0&&(fu(t,n|1),Ke(t,ke()),!(oe&6)&&(wr=ke()+500,mn()))}break;case 13:Ln(function(){var r=Ht(e,1);if(r!==null){var o=Fe();xt(r,e,1,o)}}),Uu(e,1)}};pu=function(e){if(e.tag===13){var t=Ht(e,134217728);if(t!==null){var n=Fe();xt(t,e,134217728,n)}Uu(e,134217728)}};Lp=function(e){if(e.tag===13){var t=cn(e),n=Ht(e,t);if(n!==null){var r=Fe();xt(n,e,t,r)}Uu(e,t)}};Rp=function(){return le};$p=function(e,t){var n=le;try{return le=e,t()}finally{le=n}};na=function(e,t,n){switch(t){case"input":if(Ql(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 o=Ps(r);if(!o)throw Error(O(90));pp(r),Ql(r,o)}}}break;case"textarea":gp(e,n);break;case"select":t=n.value,t!=null&&sr(e,!!n.multiple,t,!1)}};kp=Bu;_p=Ln;var Ev={usingClientEntryPoint:!1,Events:[Bo,Zn,Ps,wp,Sp,Bu]},Wr={findFiberByHostInstance:Sn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Nv={bundleType:Wr.bundleType,version:Wr.version,rendererPackageName:Wr.rendererPackageName,rendererConfig:Wr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ut.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Np(e),e===null?null:e.stateNode},findFiberByHostInstance:Wr.findFiberByHostInstance||_v,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 pi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pi.isDisabled&&pi.supportsFiber)try{Ns=pi.inject(Nv),Et=pi}catch{}}tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ev;tt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xu(t))throw Error(O(200));return kv(e,t,null,n)};tt.createRoot=function(e,t){if(!Xu(e))throw Error(O(299));var n=!1,r="",o=og;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Wu(e,1,!1,null,null,n,!1,r,o),e[Ot]=t.current,vo(e.nodeType===8?e.parentNode:e),new Yu(t)};tt.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(O(188)):(e=Object.keys(e).join(","),Error(O(268,e)));return e=Np(t),e=e===null?null:e.stateNode,e};tt.flushSync=function(e){return Ln(e)};tt.hydrate=function(e,t,n){if(!Fs(t))throw Error(O(200));return Bs(null,e,t,!0,n)};tt.hydrateRoot=function(e,t,n){if(!Xu(e))throw Error(O(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=og;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=rg(t,null,e,1,n??null,o,!1,i,s),e[Ot]=t.current,vo(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new As(t)};tt.render=function(e,t,n){if(!Fs(t))throw Error(O(200));return Bs(null,e,t,!1,n)};tt.unmountComponentAtNode=function(e){if(!Fs(e))throw Error(O(40));return e._reactRootContainer?(Ln(function(){Bs(null,null,e,!1,function(){e._reactRootContainer=null,e[Ot]=null})}),!0):!1};tt.unstable_batchedUpdates=Bu;tt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Fs(n))throw Error(O(200));if(e==null||e._reactInternals===void 0)throw Error(O(38));return Bs(e,t,n,!1,r)};tt.version="18.3.1-next-f1338f8080-20240426";function ig(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ig)}catch(e){console.error(e)}}ig(),ip.exports=tt;var jv=ip.exports,Rd=jv;Hl.createRoot=Rd.createRoot,Hl.hydrateRoot=Rd.hydrateRoot;function Ce(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=Ce(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var bv={value:()=>{}};function Os(){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 Ri(n)}function Ri(e){this._=e}function Mv(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ri.prototype=Os.prototype={constructor:Ri,on:function(e,t){var n=this._,r=Mv(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Pv(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=$d(n[o],e.name,t);else if(t==null)for(o in n)n[o]=$d(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ri(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[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],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function Pv(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function $d(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=bv,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ra="http://www.w3.org/1999/xhtml";const Dd={svg:"http://www.w3.org/2000/svg",xhtml:Ra,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Hs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Dd.hasOwnProperty(t)?{space:Dd[t],local:e}:e}function Tv(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ra&&t.documentElement.namespaceURI===Ra?t.createElement(e):t.createElementNS(n,e)}}function zv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function sg(e){var t=Hs(e);return(t.local?zv:Tv)(t)}function Iv(){}function Ku(e){return e==null?Iv:function(){return this.querySelector(e)}}function Lv(e){typeof e!="function"&&(e=Ku(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),a,u,p=0;p<s;++p)(a=i[p])&&(u=e.call(a,a.__data__,p,i))&&("__data__"in a&&(u.__data__=a.__data__),l[p]=u);return new et(r,this._parents)}function Rv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function $v(){return[]}function lg(e){return e==null?$v:function(){return this.querySelectorAll(e)}}function Dv(e){return function(){return Rv(e.apply(this,arguments))}}function Av(e){typeof e=="function"?e=Dv(e):e=lg(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(r.push(e.call(a,a.__data__,u,s)),o.push(a));return new et(r,o)}function ag(e){return function(){return this.matches(e)}}function ug(e){return function(t){return t.matches(e)}}var Fv=Array.prototype.find;function Bv(e){return function(){return Fv.call(this.children,e)}}function Ov(){return this.firstElementChild}function Hv(e){return this.select(e==null?Ov:Bv(typeof e=="function"?e:ug(e)))}var Vv=Array.prototype.filter;function Wv(){return Array.from(this.children)}function Uv(e){return function(){return Vv.call(this.children,e)}}function Yv(e){return this.selectAll(e==null?Wv:Uv(typeof e=="function"?e:ug(e)))}function Xv(e){typeof e!="function"&&(e=ag(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new et(r,this._parents)}function cg(e){return new Array(e.length)}function Kv(){return new et(this._enter||this._groups.map(cg),this._parents)}function fs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}fs.prototype={constructor:fs,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 Qv(e){return function(){return e}}function Gv(e,t,n,r,o,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new fs(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function Zv(e,t,n,r,o,i,s){var l,a,u=new Map,p=t.length,c=i.length,f=new Array(p),h;for(l=0;l<p;++l)(a=t[l])&&(f[l]=h=s.call(a,a.__data__,l,t)+"",u.has(h)?o[l]=a:u.set(h,a));for(l=0;l<c;++l)h=s.call(e,i[l],l,i)+"",(a=u.get(h))?(r[l]=a,a.__data__=i[l],u.delete(h)):n[l]=new fs(e,i[l]);for(l=0;l<p;++l)(a=t[l])&&u.get(f[l])===a&&(o[l]=a)}function qv(e){return e.__data__}function Jv(e,t){if(!arguments.length)return Array.from(this,qv);var n=t?Zv:Gv,r=this._parents,o=this._groups;typeof e!="function"&&(e=Qv(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var p=r[u],c=o[u],f=c.length,h=e1(e.call(p,p&&p.__data__,u,r)),x=h.length,w=l[u]=new Array(x),S=s[u]=new Array(x),m=a[u]=new Array(f);n(p,c,w,S,m,h,t);for(var y=0,g=0,v,E;y<x;++y)if(v=w[y]){for(y>=g&&(g=y+1);!(E=S[g])&&++g<x;);v._next=E||null}}return s=new et(s,r),s._enter=l,s._exit=a,s}function e1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function t1(){return new et(this._exit||this._groups.map(cg),this._parents)}function n1(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function r1(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),a=0;a<s;++a)for(var u=n[a],p=r[a],c=u.length,f=l[a]=new Array(c),h,x=0;x<c;++x)(h=u[x]||p[x])&&(f[x]=h);for(;a<o;++a)l[a]=n[a];return new et(l,this._parents)}function o1(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function i1(e){e||(e=s1);function t(c,f){return c&&f?e(c.__data__,f.__data__):!c-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,a=o[i]=new Array(l),u,p=0;p<l;++p)(u=s[p])&&(a[p]=u);a.sort(t)}return new et(o,this._parents).order()}function s1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function l1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function a1(){return Array.from(this)}function u1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function c1(){let e=0;for(const t of this)++e;return e}function d1(){return!this.node()}function f1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function p1(e){return function(){this.removeAttribute(e)}}function h1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function g1(e,t){return function(){this.setAttribute(e,t)}}function m1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function y1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function x1(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 v1(e,t){var n=Hs(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?h1:p1:typeof t=="function"?n.local?x1:y1:n.local?m1:g1)(n,t))}function dg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function w1(e){return function(){this.style.removeProperty(e)}}function S1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function k1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function _1(e,t,n){return arguments.length>1?this.each((t==null?w1:typeof t=="function"?k1:S1)(e,t,n??"")):Sr(this.node(),e)}function Sr(e,t){return e.style.getPropertyValue(t)||dg(e).getComputedStyle(e,null).getPropertyValue(t)}function C1(e){return function(){delete this[e]}}function E1(e,t){return function(){this[e]=t}}function N1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function j1(e,t){return arguments.length>1?this.each((t==null?C1:typeof t=="function"?N1:E1)(e,t)):this.node()[e]}function fg(e){return e.trim().split(/^|\s+/)}function Qu(e){return e.classList||new pg(e)}function pg(e){this._node=e,this._names=fg(e.getAttribute("class")||"")}pg.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 hg(e,t){for(var n=Qu(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function gg(e,t){for(var n=Qu(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function b1(e){return function(){hg(this,e)}}function M1(e){return function(){gg(this,e)}}function P1(e,t){return function(){(t.apply(this,arguments)?hg:gg)(this,e)}}function T1(e,t){var n=fg(e+"");if(arguments.length<2){for(var r=Qu(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?P1:t?b1:M1)(n,t))}function z1(){this.textContent=""}function I1(e){return function(){this.textContent=e}}function L1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function R1(e){return arguments.length?this.each(e==null?z1:(typeof e=="function"?L1:I1)(e)):this.node().textContent}function $1(){this.innerHTML=""}function D1(e){return function(){this.innerHTML=e}}function A1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function F1(e){return arguments.length?this.each(e==null?$1:(typeof e=="function"?A1:D1)(e)):this.node().innerHTML}function B1(){this.nextSibling&&this.parentNode.appendChild(this)}function O1(){return this.each(B1)}function H1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function V1(){return this.each(H1)}function W1(e){var t=typeof e=="function"?e:sg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function U1(){return null}function Y1(e,t){var n=typeof e=="function"?e:sg(e),r=t==null?U1:typeof t=="function"?t:Ku(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function X1(){var e=this.parentNode;e&&e.removeChild(this)}function K1(){return this.each(X1)}function Q1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function G1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Z1(e){return this.select(e?G1:Q1)}function q1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function J1(e){return function(t){e.call(this,t,this.__data__)}}function ew(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 tw(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function nw(e,t,n){return function(){var r=this.__on,o,i=J1(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function rw(e,t,n){var r=ew(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,p;a<u;++a)for(o=0,p=l[a];o<i;++o)if((s=r[o]).type===p.type&&s.name===p.name)return p.value}return}for(l=t?nw:tw,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function mg(e,t,n){var r=dg(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function ow(e,t){return function(){return mg(this,e,t)}}function iw(e,t){return function(){return mg(this,e,t.apply(this,arguments))}}function sw(e,t){return this.each((typeof t=="function"?iw:ow)(e,t))}function*lw(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var yg=[null];function et(e,t){this._groups=e,this._parents=t}function Ho(){return new et([[document.documentElement]],yg)}function aw(){return this}et.prototype=Ho.prototype={constructor:et,select:Lv,selectAll:Av,selectChild:Hv,selectChildren:Yv,filter:Xv,data:Jv,enter:Kv,exit:t1,join:n1,merge:r1,selection:aw,order:o1,sort:i1,call:l1,nodes:a1,node:u1,size:c1,empty:d1,each:f1,attr:v1,style:_1,property:j1,classed:T1,text:R1,html:F1,raise:O1,lower:V1,append:W1,insert:Y1,remove:K1,clone:Z1,datum:q1,on:rw,dispatch:sw,[Symbol.iterator]:lw};function Ge(e){return typeof e=="string"?new et([[document.querySelector(e)]],[document.documentElement]):new et([[e]],yg)}function uw(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ft(e,t){if(e=uw(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 o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const cw={passive:!1},bo={capture:!0,passive:!1};function bl(e){e.stopImmediatePropagation()}function fr(e){e.preventDefault(),e.stopImmediatePropagation()}function xg(e){var t=e.document.documentElement,n=Ge(e).on("dragstart.drag",fr,bo);"onselectstart"in t?n.on("selectstart.drag",fr,bo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function vg(e,t){var n=e.document.documentElement,r=Ge(e).on("dragstart.drag",null);t&&(r.on("click.drag",fr,bo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const hi=e=>()=>e;function $a(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:a,dy:u,dispatch:p}){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:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:p}})}$a.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function dw(e){return!e.ctrlKey&&!e.button}function fw(){return this.parentNode}function pw(e,t){return t??{x:e.x,y:e.y}}function hw(){return navigator.maxTouchPoints||"ontouchstart"in this}function wg(){var e=dw,t=fw,n=pw,r=hw,o={},i=Os("start","drag","end"),s=0,l,a,u,p,c=0;function f(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",S).on("touchmove.drag",m,cw).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,E){if(!(p||!e.call(this,v,E))){var C=g(this,t.call(this,v,E),v,E,"mouse");C&&(Ge(v.view).on("mousemove.drag",x,bo).on("mouseup.drag",w,bo),xg(v.view),bl(v),u=!1,l=v.clientX,a=v.clientY,C("start",v))}}function x(v){if(fr(v),!u){var E=v.clientX-l,C=v.clientY-a;u=E*E+C*C>c}o.mouse("drag",v)}function w(v){Ge(v.view).on("mousemove.drag mouseup.drag",null),vg(v.view,u),fr(v),o.mouse("end",v)}function S(v,E){if(e.call(this,v,E)){var C=v.changedTouches,j=t.call(this,v,E),P=C.length,L,F;for(L=0;L<P;++L)(F=g(this,j,v,E,C[L].identifier,C[L]))&&(bl(v),F("start",v,C[L]))}}function m(v){var E=v.changedTouches,C=E.length,j,P;for(j=0;j<C;++j)(P=o[E[j].identifier])&&(fr(v),P("drag",v,E[j]))}function y(v){var E=v.changedTouches,C=E.length,j,P;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),j=0;j<C;++j)(P=o[E[j].identifier])&&(bl(v),P("end",v,E[j]))}function g(v,E,C,j,P,L){var F=i.copy(),I=ft(L||C,E),R,B,b;if((b=n.call(v,new $a("beforestart",{sourceEvent:C,target:f,identifier:P,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:F}),j))!=null)return R=b.x-I[0]||0,B=b.y-I[1]||0,function $(N,M,k){var _=I,T;switch(N){case"start":o[P]=$,T=s++;break;case"end":delete o[P],--s;case"drag":I=ft(k||M,E),T=s;break}F.call(N,v,new $a(N,{sourceEvent:M,subject:b,target:f,identifier:P,active:T,x:I[0]+R,y:I[1]+B,dx:I[0]-_[0],dy:I[1]-_[1],dispatch:F}),j)}}return f.filter=function(v){return arguments.length?(e=typeof v=="function"?v:hi(!!v),f):e},f.container=function(v){return arguments.length?(t=typeof v=="function"?v:hi(v),f):t},f.subject=function(v){return arguments.length?(n=typeof v=="function"?v:hi(v),f):n},f.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:hi(!!v),f):r},f.on=function(){var v=i.on.apply(i,arguments);return v===i?f:v},f.clickDistance=function(v){return arguments.length?(c=(v=+v)*v,f):Math.sqrt(c)},f}function Gu(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Sg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Vo(){}var Mo=.7,ps=1/Mo,pr="\\s*([+-]?\\d+)\\s*",Po="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gw=/^#([0-9a-f]{3,8})$/,mw=new RegExp(`^rgb\\(${pr},${pr},${pr}\\)$`),yw=new RegExp(`^rgb\\(${jt},${jt},${jt}\\)$`),xw=new RegExp(`^rgba\\(${pr},${pr},${pr},${Po}\\)$`),vw=new RegExp(`^rgba\\(${jt},${jt},${jt},${Po}\\)$`),ww=new RegExp(`^hsl\\(${Po},${jt},${jt}\\)$`),Sw=new RegExp(`^hsla\\(${Po},${jt},${jt},${Po}\\)$`),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};Gu(Vo,Rn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fd,formatHex:Fd,formatHex8:kw,formatHsl:_w,formatRgb:Bd,toString:Bd});function Fd(){return this.rgb().formatHex()}function kw(){return this.rgb().formatHex8()}function _w(){return kg(this).formatHsl()}function Bd(){return this.rgb().formatRgb()}function Rn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=gw.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Od(t):n===3?new Ue(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?gi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?gi(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=mw.exec(e))?new Ue(t[1],t[2],t[3],1):(t=yw.exec(e))?new Ue(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=xw.exec(e))?gi(t[1],t[2],t[3],t[4]):(t=vw.exec(e))?gi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ww.exec(e))?Wd(t[1],t[2]/100,t[3]/100,1):(t=Sw.exec(e))?Wd(t[1],t[2]/100,t[3]/100,t[4]):Ad.hasOwnProperty(e)?Od(Ad[e]):e==="transparent"?new Ue(NaN,NaN,NaN,0):null}function Od(e){return new Ue(e>>16&255,e>>8&255,e&255,1)}function gi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ue(e,t,n,r)}function Cw(e){return e instanceof Vo||(e=Rn(e)),e?(e=e.rgb(),new Ue(e.r,e.g,e.b,e.opacity)):new Ue}function Da(e,t,n,r){return arguments.length===1?Cw(e):new Ue(e,t,n,r??1)}function Ue(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Gu(Ue,Da,Sg(Vo,{brighter(e){return e=e==null?ps:Math.pow(ps,e),new Ue(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Mo:Math.pow(Mo,e),new Ue(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ue(jn(this.r),jn(this.g),jn(this.b),hs(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:Ew,formatRgb:Vd,toString:Vd}));function Hd(){return`#${Cn(this.r)}${Cn(this.g)}${Cn(this.b)}`}function Ew(){return`#${Cn(this.r)}${Cn(this.g)}${Cn(this.b)}${Cn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Vd(){const e=hs(this.opacity);return`${e===1?"rgb(":"rgba("}${jn(this.r)}, ${jn(this.g)}, ${jn(this.b)}${e===1?")":`, ${e})`}`}function hs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function jn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cn(e){return e=jn(e),(e<16?"0":"")+e.toString(16)}function Wd(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ht(e,t,n,r)}function kg(e){if(e instanceof ht)return new ht(e.h,e.s,e.l,e.opacity);if(e instanceof Vo||(e=Rn(e)),!e)return new ht;if(e instanceof ht)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,a=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=a<.5?i+o:2-i-o,s*=60):l=a>0&&a<1?0:s,new ht(s,l,a,e.opacity)}function Nw(e,t,n,r){return arguments.length===1?kg(e):new ht(e,t,n,r??1)}function ht(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Gu(ht,Nw,Sg(Vo,{brighter(e){return e=e==null?ps:Math.pow(ps,e),new ht(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Mo:Math.pow(Mo,e),new ht(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,o=2*n-r;return new Ue(Ml(e>=240?e-240:e+120,o,r),Ml(e,o,r),Ml(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new ht(Ud(this.h),mi(this.s),mi(this.l),hs(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=hs(this.opacity);return`${e===1?"hsl(":"hsla("}${Ud(this.h)}, ${mi(this.s)*100}%, ${mi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ud(e){return e=(e||0)%360,e<0?e+360:e}function mi(e){return Math.max(0,Math.min(1,e||0))}function Ml(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 Zu=e=>()=>e;function jw(e,t){return function(n){return e+n*t}}function bw(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 Mw(e){return(e=+e)==1?_g:function(t,n){return n-t?bw(t,n,e):Zu(isNaN(t)?n:t)}}function _g(e,t){var n=t-e;return n?jw(e,n):Zu(isNaN(e)?t:e)}const gs=function e(t){var n=Mw(t);function r(o,i){var s=n((o=Da(o)).r,(i=Da(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=_g(o.opacity,i.opacity);return function(p){return o.r=s(p),o.g=l(p),o.b=a(p),o.opacity=u(p),o+""}}return r.gamma=e,r}(1);function Pw(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function Tw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function zw(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=ao(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(l){for(s=0;s<r;++s)i[s]=o[s](l);return i}}function Iw(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function _t(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Lw(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=ao(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var Aa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pl=new RegExp(Aa.source,"g");function Rw(e){return function(){return e}}function $w(e){return function(t){return e(t)+""}}function Cg(e,t){var n=Aa.lastIndex=Pl.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Aa.exec(e))&&(o=Pl.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,a.push({i:s,x:_t(r,o)})),n=Pl.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?$w(a[0].x):Rw(t):(t=a.length,function(u){for(var p=0,c;p<t;++p)l[(c=a[p]).i]=c.x(u);return l.join("")})}function ao(e,t){var n=typeof t,r;return t==null||n==="boolean"?Zu(t):(n==="number"?_t:n==="string"?(r=Rn(t))?(t=r,gs):Cg:t instanceof Rn?gs:t instanceof Date?Iw:Tw(t)?Pw:Array.isArray(t)?zw:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Lw:_t)(e,t)}var Yd=180/Math.PI,Fa={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Eg(e,t,n,r,o,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Yd,skewX:Math.atan(a)*Yd,scaleX:s,scaleY:l}}var yi;function Dw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Fa:Eg(t.a,t.b,t.c,t.d,t.e,t.f)}function Aw(e){return e==null||(yi||(yi=document.createElementNS("http://www.w3.org/2000/svg","g")),yi.setAttribute("transform",e),!(e=yi.transform.baseVal.consolidate()))?Fa:(e=e.matrix,Eg(e.a,e.b,e.c,e.d,e.e,e.f))}function Ng(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,p,c,f,h,x){if(u!==c||p!==f){var w=h.push("translate(",null,t,null,n);x.push({i:w-4,x:_t(u,c)},{i:w-2,x:_t(p,f)})}else(c||f)&&h.push("translate("+c+t+f+n)}function s(u,p,c,f){u!==p?(u-p>180?p+=360:p-u>180&&(u+=360),f.push({i:c.push(o(c)+"rotate(",null,r)-2,x:_t(u,p)})):p&&c.push(o(c)+"rotate("+p+r)}function l(u,p,c,f){u!==p?f.push({i:c.push(o(c)+"skewX(",null,r)-2,x:_t(u,p)}):p&&c.push(o(c)+"skewX("+p+r)}function a(u,p,c,f,h,x){if(u!==c||p!==f){var w=h.push(o(h)+"scale(",null,",",null,")");x.push({i:w-4,x:_t(u,c)},{i:w-2,x:_t(p,f)})}else(c!==1||f!==1)&&h.push(o(h)+"scale("+c+","+f+")")}return function(u,p){var c=[],f=[];return u=e(u),p=e(p),i(u.translateX,u.translateY,p.translateX,p.translateY,c,f),s(u.rotate,p.rotate,c,f),l(u.skewX,p.skewX,c,f),a(u.scaleX,u.scaleY,p.scaleX,p.scaleY,c,f),u=p=null,function(h){for(var x=-1,w=f.length,S;++x<w;)c[(S=f[x]).i]=S.x(h);return c.join("")}}}var Fw=Ng(Dw,"px, ","px)","deg)"),Bw=Ng(Aw,", ",")",")"),Ow=1e-12;function Xd(e){return((e=Math.exp(e))+1/e)/2}function Hw(e){return((e=Math.exp(e))-1/e)/2}function Vw(e){return((e=Math.exp(2*e))-1)/(e+1)}const $i=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],p=s[0],c=s[1],f=s[2],h=p-l,x=c-a,w=h*h+x*x,S,m;if(w<Ow)m=Math.log(f/u)/t,S=function(j){return[l+j*h,a+j*x,u*Math.exp(t*j*m)]};else{var y=Math.sqrt(w),g=(f*f-u*u+r*w)/(2*u*n*y),v=(f*f-u*u-r*w)/(2*f*n*y),E=Math.log(Math.sqrt(g*g+1)-g),C=Math.log(Math.sqrt(v*v+1)-v);m=(C-E)/t,S=function(j){var P=j*m,L=Xd(E),F=u/(n*y)*(L*Vw(t*P+E)-Hw(E));return[l+F*h,a+F*x,u*L/Xd(t*P+E)]}}return S.duration=m*1e3*t/Math.SQRT2,S}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},o}(Math.SQRT2,2,4);var kr=0,Zr=0,Ur=0,jg=1e3,ms,qr,ys=0,$n=0,Vs=0,To=typeof performance=="object"&&performance.now?performance:Date,bg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function qu(){return $n||(bg(Ww),$n=To.now()+Vs)}function Ww(){$n=0}function xs(){this._call=this._time=this._next=null}xs.prototype=Mg.prototype={constructor:xs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?qu():+n)+(t==null?0:+t),!this._next&&qr!==this&&(qr?qr._next=this:ms=this,qr=this),this._call=e,this._time=n,Ba()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ba())}};function Mg(e,t,n){var r=new xs;return r.restart(e,t,n),r}function Uw(){qu(),++kr;for(var e=ms,t;e;)(t=$n-e._time)>=0&&e._call.call(void 0,t),e=e._next;--kr}function Kd(){$n=(ys=To.now())+Vs,kr=Zr=0;try{Uw()}finally{kr=0,Xw(),$n=0}}function Yw(){var e=To.now(),t=e-ys;t>jg&&(Vs-=t,ys=e)}function Xw(){for(var e,t=ms,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:ms=n);qr=e,Ba(r)}function Ba(e){if(!kr){Zr&&(Zr=clearTimeout(Zr));var t=e-$n;t>24?(e<1/0&&(Zr=setTimeout(Kd,e-To.now()-Vs)),Ur&&(Ur=clearInterval(Ur))):(Ur||(ys=To.now(),Ur=setInterval(Yw,jg)),kr=1,bg(Kd))}}function Qd(e,t,n){var r=new xs;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Kw=Os("start","end","cancel","interrupt"),Qw=[],Pg=0,Gd=1,Oa=2,Di=3,Zd=4,Ha=5,Ai=6;function Ws(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Gw(e,n,{name:t,index:r,group:o,on:Kw,tween:Qw,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Pg})}function Ju(e,t){var n=wt(e,t);if(n.state>Pg)throw new Error("too late; already scheduled");return n}function Mt(e,t){var n=wt(e,t);if(n.state>Di)throw new Error("too late; already running");return n}function wt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Gw(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Mg(i,0,n.time);function i(u){n.state=Gd,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var p,c,f,h;if(n.state!==Gd)return a();for(p in r)if(h=r[p],h.name===n.name){if(h.state===Di)return Qd(s);h.state===Zd?(h.state=Ai,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[p]):+p<t&&(h.state=Ai,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[p])}if(Qd(function(){n.state===Di&&(n.state=Zd,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Oa,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Oa){for(n.state=Di,o=new Array(f=n.tween.length),p=0,c=-1;p<f;++p)(h=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(o[++c]=h);o.length=c+1}}function l(u){for(var p=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Ha,1),c=-1,f=o.length;++c<f;)o[c].call(e,p);n.state===Ha&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Ai,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Fi(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>Oa&&r.state<Ha,r.state=Ai,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Zw(e){return this.each(function(){Fi(this,e)})}function qw(e,t){var n,r;return function(){var o=Mt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function Jw(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Mt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=l;break}a===u&&o.push(l)}i.tween=o}}function eS(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=wt(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?qw:Jw)(n,e,t))}function ec(e,t,n){var r=e._id;return e.each(function(){var o=Mt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return wt(o,r).value[t]}}function Tg(e,t){var n;return(typeof t=="number"?_t:t instanceof Rn?gs:(n=Rn(t))?(t=n,gs):Cg)(e,t)}function tS(e){return function(){this.removeAttribute(e)}}function nS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rS(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function oS(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function iS(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function sS(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function lS(e,t){var n=Hs(e),r=n==="transform"?Bw:Tg;return this.attrTween(e,typeof t=="function"?(n.local?sS:iS)(n,r,ec(this,"attr."+e,t)):t==null?(n.local?nS:tS)(n):(n.local?oS:rS)(n,r,t))}function aS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function uS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function cS(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&uS(e,i)),n}return o._value=t,o}function dS(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&aS(e,i)),n}return o._value=t,o}function fS(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=Hs(e);return this.tween(n,(r.local?cS:dS)(r,t))}function pS(e,t){return function(){Ju(this,e).delay=+t.apply(this,arguments)}}function hS(e,t){return t=+t,function(){Ju(this,e).delay=t}}function gS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pS:hS)(t,e)):wt(this.node(),t).delay}function mS(e,t){return function(){Mt(this,e).duration=+t.apply(this,arguments)}}function yS(e,t){return t=+t,function(){Mt(this,e).duration=t}}function xS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?mS:yS)(t,e)):wt(this.node(),t).duration}function vS(e,t){if(typeof t!="function")throw new Error;return function(){Mt(this,e).ease=t}}function wS(e){var t=this._id;return arguments.length?this.each(vS(t,e)):wt(this.node(),t).ease}function SS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Mt(this,e).ease=n}}function kS(e){if(typeof e!="function")throw new Error;return this.each(SS(this._id,e))}function _S(e){typeof e!="function"&&(e=ag(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new Wt(r,this._parents,this._name,this._id)}function CS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),l=0;l<i;++l)for(var a=t[l],u=n[l],p=a.length,c=s[l]=new Array(p),f,h=0;h<p;++h)(f=a[h]||u[h])&&(c[h]=f);for(;l<r;++l)s[l]=t[l];return new Wt(s,this._parents,this._name,this._id)}function ES(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 NS(e,t,n){var r,o,i=ES(t)?Ju:Mt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function jS(e,t){var n=this._id;return arguments.length<2?wt(this.node(),n).on.on(e):this.each(NS(n,e,t))}function bS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function MS(){return this.on("end.remove",bS(this._id))}function PS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ku(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),p,c,f=0;f<a;++f)(p=l[f])&&(c=e.call(p,p.__data__,f,l))&&("__data__"in p&&(c.__data__=p.__data__),u[f]=c,Ws(u[f],t,n,f,u,wt(p,n)));return new Wt(i,this._parents,t,n)}function TS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=lg(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,p,c=0;c<u;++c)if(p=a[c]){for(var f=e.call(p,p.__data__,c,a),h,x=wt(p,n),w=0,S=f.length;w<S;++w)(h=f[w])&&Ws(h,t,n,w,f,x);i.push(f),s.push(p)}return new Wt(i,s,t,n)}var zS=Ho.prototype.constructor;function IS(){return new zS(this._groups,this._parents)}function LS(e,t){var n,r,o;return function(){var i=Sr(this,e),s=(this.style.removeProperty(e),Sr(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function zg(e){return function(){this.style.removeProperty(e)}}function RS(e,t,n){var r,o=n+"",i;return function(){var s=Sr(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function $S(e,t,n){var r,o,i;return function(){var s=Sr(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Sr(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function DS(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=Mt(this,e),u=a.on,p=a.value[i]==null?l||(l=zg(t)):void 0;(u!==n||o!==p)&&(r=(n=u).copy()).on(s,o=p),a.on=r}}function AS(e,t,n){var r=(e+="")=="transform"?Fw:Tg;return t==null?this.styleTween(e,LS(e,r)).on("end.style."+e,zg(e)):typeof t=="function"?this.styleTween(e,$S(e,r,ec(this,"style."+e,t))).each(DS(this._id,e)):this.styleTween(e,RS(e,r,t),n).on("end.style."+e,null)}function FS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function BS(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&FS(e,s,n)),r}return i._value=t,i}function OS(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,BS(e,t,n??""))}function HS(e){return function(){this.textContent=e}}function VS(e){return function(){var t=e(this);this.textContent=t??""}}function WS(e){return this.tween("text",typeof e=="function"?VS(ec(this,"text",e)):HS(e==null?"":e+""))}function US(e){return function(t){this.textContent=e.call(this,t)}}function YS(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&US(o)),t}return r._value=e,r}function XS(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,YS(e))}function KS(){for(var e=this._name,t=this._id,n=Ig(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var p=wt(a,t);Ws(a,e,n,u,s,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Wt(r,this._parents,e,n)}function QS(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--o===0&&i()}};n.each(function(){var u=Mt(this,r),p=u.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),o===0&&i()})}var GS=0;function Wt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ig(){return++GS}var Tt=Ho.prototype;Wt.prototype={constructor:Wt,select:PS,selectAll:TS,selectChild:Tt.selectChild,selectChildren:Tt.selectChildren,filter:_S,merge:CS,selection:IS,transition:KS,call:Tt.call,nodes:Tt.nodes,node:Tt.node,size:Tt.size,empty:Tt.empty,each:Tt.each,on:jS,attr:lS,attrTween:fS,style:AS,styleTween:OS,text:WS,textTween:XS,remove:MS,tween:eS,delay:gS,duration:xS,ease:wS,easeVarying:kS,end:QS,[Symbol.iterator]:Tt[Symbol.iterator]};function ZS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var qS={time:null,delay:0,duration:250,ease:ZS};function JS(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 e2(e){var t,n;e instanceof Wt?(t=e._id,e=e._name):(t=Ig(),(n=qS).time=qu(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&Ws(a,e,t,u,s,n||JS(a,t));return new Wt(r,this._parents,e,t)}Ho.prototype.interrupt=Zw;Ho.prototype.transition=e2;const xi=e=>()=>e;function t2(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){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:o}})}function Dt(e,t,n){this.k=e,this.x=t,this.y=n}Dt.prototype={constructor:Dt,scale:function(e){return e===1?this:new Dt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Dt(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 Us=new Dt(1,0,0);Lg.prototype=Dt.prototype;function Lg(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Us;return e.__zoom}function Tl(e){e.stopImmediatePropagation()}function Yr(e){e.preventDefault(),e.stopImmediatePropagation()}function n2(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function r2(){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 qd(){return this.__zoom||Us}function o2(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function i2(){return navigator.maxTouchPoints||"ontouchstart"in this}function s2(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Rg(){var e=n2,t=r2,n=s2,r=o2,o=i2,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=$i,u=Os("start","zoom","end"),p,c,f,h=500,x=150,w=0,S=10;function m(b){b.property("__zoom",qd).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",F).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(b,$,N,M){var k=b.selection?b.selection():b;k.property("__zoom",qd),b!==k?E(b,$,N,M):k.interrupt().each(function(){C(this,arguments).event(M).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},m.scaleBy=function(b,$,N,M){m.scaleTo(b,function(){var k=this.__zoom.k,_=typeof $=="function"?$.apply(this,arguments):$;return k*_},N,M)},m.scaleTo=function(b,$,N,M){m.transform(b,function(){var k=t.apply(this,arguments),_=this.__zoom,T=N==null?v(k):typeof N=="function"?N.apply(this,arguments):N,A=_.invert(T),D=typeof $=="function"?$.apply(this,arguments):$;return n(g(y(_,D),T,A),k,s)},N,M)},m.translateBy=function(b,$,N,M){m.transform(b,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof N=="function"?N.apply(this,arguments):N),t.apply(this,arguments),s)},null,M)},m.translateTo=function(b,$,N,M,k){m.transform(b,function(){var _=t.apply(this,arguments),T=this.__zoom,A=M==null?v(_):typeof M=="function"?M.apply(this,arguments):M;return n(Us.translate(A[0],A[1]).scale(T.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof N=="function"?-N.apply(this,arguments):-N),_,s)},M,k)};function y(b,$){return $=Math.max(i[0],Math.min(i[1],$)),$===b.k?b:new Dt($,b.x,b.y)}function g(b,$,N){var M=$[0]-N[0]*b.k,k=$[1]-N[1]*b.k;return M===b.x&&k===b.y?b:new Dt(b.k,M,k)}function v(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function E(b,$,N,M){b.on("start.zoom",function(){C(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(M).end()}).tween("zoom",function(){var k=this,_=arguments,T=C(k,_).event(M),A=t.apply(k,_),D=N==null?v(A):typeof N=="function"?N.apply(k,_):N,W=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),V=k.__zoom,Y=typeof $=="function"?$.apply(k,_):$,X=a(V.invert(D).concat(W/V.k),Y.invert(D).concat(W/Y.k));return function(K){if(K===1)K=Y;else{var H=X(K),G=W/H[2];K=new Dt(G,D[0]-H[0]*G,D[1]-H[1]*G)}T.zoom(null,K)}})}function C(b,$,N){return!N&&b.__zooming||new j(b,$)}function j(b,$){this.that=b,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(b,$),this.taps=0}j.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,$){return this.mouse&&b!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var $=Ge(this.that).datum();u.call(b,this.that,new t2(b,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),$)}};function P(b,...$){if(!e.apply(this,arguments))return;var N=C(this,$).event(b),M=this.__zoom,k=Math.max(i[0],Math.min(i[1],M.k*Math.pow(2,r.apply(this,arguments)))),_=ft(b);if(N.wheel)(N.mouse[0][0]!==_[0]||N.mouse[0][1]!==_[1])&&(N.mouse[1]=M.invert(N.mouse[0]=_)),clearTimeout(N.wheel);else{if(M.k===k)return;N.mouse=[_,M.invert(_)],Fi(this),N.start()}Yr(b),N.wheel=setTimeout(T,x),N.zoom("mouse",n(g(y(M,k),N.mouse[0],N.mouse[1]),N.extent,s));function T(){N.wheel=null,N.end()}}function L(b,...$){if(f||!e.apply(this,arguments))return;var N=b.currentTarget,M=C(this,$,!0).event(b),k=Ge(b.view).on("mousemove.zoom",D,!0).on("mouseup.zoom",W,!0),_=ft(b,N),T=b.clientX,A=b.clientY;xg(b.view),Tl(b),M.mouse=[_,this.__zoom.invert(_)],Fi(this),M.start();function D(V){if(Yr(V),!M.moved){var Y=V.clientX-T,X=V.clientY-A;M.moved=Y*Y+X*X>w}M.event(V).zoom("mouse",n(g(M.that.__zoom,M.mouse[0]=ft(V,N),M.mouse[1]),M.extent,s))}function W(V){k.on("mousemove.zoom mouseup.zoom",null),vg(V.view,M.moved),Yr(V),M.event(V).end()}}function F(b,...$){if(e.apply(this,arguments)){var N=this.__zoom,M=ft(b.changedTouches?b.changedTouches[0]:b,this),k=N.invert(M),_=N.k*(b.shiftKey?.5:2),T=n(g(y(N,_),M,k),t.apply(this,$),s);Yr(b),l>0?Ge(this).transition().duration(l).call(E,T,M,b):Ge(this).call(m.transform,T,M,b)}}function I(b,...$){if(e.apply(this,arguments)){var N=b.touches,M=N.length,k=C(this,$,b.changedTouches.length===M).event(b),_,T,A,D;for(Tl(b),T=0;T<M;++T)A=N[T],D=ft(A,this),D=[D,this.__zoom.invert(D),A.identifier],k.touch0?!k.touch1&&k.touch0[2]!==D[2]&&(k.touch1=D,k.taps=0):(k.touch0=D,_=!0,k.taps=1+!!p);p&&(p=clearTimeout(p)),_&&(k.taps<2&&(c=D[0],p=setTimeout(function(){p=null},h)),Fi(this),k.start())}}function R(b,...$){if(this.__zooming){var N=C(this,$).event(b),M=b.changedTouches,k=M.length,_,T,A,D;for(Yr(b),_=0;_<k;++_)T=M[_],A=ft(T,this),N.touch0&&N.touch0[2]===T.identifier?N.touch0[0]=A:N.touch1&&N.touch1[2]===T.identifier&&(N.touch1[0]=A);if(T=N.that.__zoom,N.touch1){var W=N.touch0[0],V=N.touch0[1],Y=N.touch1[0],X=N.touch1[1],K=(K=Y[0]-W[0])*K+(K=Y[1]-W[1])*K,H=(H=X[0]-V[0])*H+(H=X[1]-V[1])*H;T=y(T,Math.sqrt(K/H)),A=[(W[0]+Y[0])/2,(W[1]+Y[1])/2],D=[(V[0]+X[0])/2,(V[1]+X[1])/2]}else if(N.touch0)A=N.touch0[0],D=N.touch0[1];else return;N.zoom("touch",n(g(T,A,D),N.extent,s))}}function B(b,...$){if(this.__zooming){var N=C(this,$).event(b),M=b.changedTouches,k=M.length,_,T;for(Tl(b),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),_=0;_<k;++_)T=M[_],N.touch0&&N.touch0[2]===T.identifier?delete N.touch0:N.touch1&&N.touch1[2]===T.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(T=ft(T,this),Math.hypot(c[0]-T[0],c[1]-T[1])<S)){var A=Ge(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return m.wheelDelta=function(b){return arguments.length?(r=typeof b=="function"?b:xi(+b),m):r},m.filter=function(b){return arguments.length?(e=typeof b=="function"?b:xi(!!b),m):e},m.touchable=function(b){return arguments.length?(o=typeof b=="function"?b:xi(!!b),m):o},m.extent=function(b){return arguments.length?(t=typeof b=="function"?b:xi([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),m):t},m.scaleExtent=function(b){return arguments.length?(i[0]=+b[0],i[1]=+b[1],m):[i[0],i[1]]},m.translateExtent=function(b){return arguments.length?(s[0][0]=+b[0][0],s[1][0]=+b[1][0],s[0][1]=+b[0][1],s[1][1]=+b[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(b){return arguments.length?(n=b,m):n},m.duration=function(b){return arguments.length?(l=+b,m):l},m.interpolate=function(b){return arguments.length?(a=b,m):a},m.on=function(){var b=u.on.apply(u,arguments);return b===u?m:b},m.clickDistance=function(b){return arguments.length?(w=(b=+b)*b,m):Math.sqrt(w)},m.tapDistance=function(b){return arguments.length?(S=+b,m):S},m}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.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},zo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],$g=["Enter"," ","Escape"],Dg={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var _r;(function(e){e.Strict="strict",e.Loose="loose"})(_r||(_r={}));var bn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(bn||(bn={}));var Io;(function(e){e.Partial="partial",e.Full="full"})(Io||(Io={}));const Ag={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Lt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Lt||(Lt={}));var vs;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(vs||(vs={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const Jd={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function Fg(e){return e===null?null:e?"valid":"invalid"}const Bg=e=>"id"in e&&"source"in e&&"target"in e,l2=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),Wo=(e,t=[0,0])=>{const{width:n,height:r}=Yt(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},a2=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):tc(o)?o:t.nodeLookup.get(o.id));const l=s?ws(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ys(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Xs(n)},Uo=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=Ys(n,ws(o)),r=!0)}),r?Xs(n):{x:0,y:0,width:0,height:0}},nc=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l={...Xo(t,[n,r,o]),width:t.width/o,height:t.height/o},a=[];for(const u of e.values()){const{measured:p,selectable:c=!0,hidden:f=!1}=u;if(s&&!c||f)continue;const h=p.width??u.width??u.initialWidth??null,x=p.height??u.height??u.initialHeight??null,w=Lo(l,Er(u)),S=(h??0)*(x??0),m=i&&w>0;(!u.internals.handleBounds||m||w>=S||u.dragging)&&a.push(u)}return a},u2=(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 c2(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function d2({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const l=c2(e,s),a=Uo(l),u=rc(a,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function Og({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:a,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},p=s.origin??r;let c=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",bt.error005());else{const h=l.measured.width,x=l.measured.height;h&&x&&(c=[[a,u],[a+h,u+x]])}else l&&Nr(s.extent)&&(c=[[s.extent[0][0]+a,s.extent[0][1]+u],[s.extent[1][0]+a,s.extent[1][1]+u]]);const f=Nr(c)?Dn(t,c,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",bt.error015())),{position:{x:f.x-a+(s.measured.width??0)*p[0],y:f.y-u+(s.measured.height??0)*p[1]},positionAbsolute:f}}async function f2({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=i.has(f.id),x=!h&&f.parentId&&s.find(w=>w.id===f.parentId);(h||x)&&s.push(f)}const l=new Set(t.map(f=>f.id)),a=r.filter(f=>f.deletable!==!1),p=u2(s,a);for(const f of a)l.has(f.id)&&!p.find(x=>x.id===f.id)&&p.push(f);if(!o)return{edges:p,nodes:s};const c=await o({nodes:s,edges:p});return typeof c=="boolean"?c?{edges:p,nodes:s}:{edges:[],nodes:[]}:c}const Cr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Dn=(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 Hg(e,t,n){const{width:r,height:o}=Yt(n),{x:i,y:s}=n.internals.positionAbsolute;return Dn(e,[[i,s],[i+r,s+o]],t)}const ef=(e,t,n)=>e<t?Cr(Math.abs(e-t),1,t)/t:e>n?-Cr(Math.abs(e-n),1,t)/t:0,Vg=(e,t,n=15,r=40)=>{const o=ef(e.x,r,t.width-r)*n,i=ef(e.y,r,t.height-r)*n;return[o,i]},Ys=(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)}),Va=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Xs=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Er=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=tc(e)?e.internals.positionAbsolute:Wo(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},ws=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=tc(e)?e.internals.positionAbsolute:Wo(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Wg=(e,t)=>Xs(Ys(Va(e),Va(t))),Lo=(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)},tf=e=>gt(e.width)&>(e.height)&>(e.x)&>(e.y),gt=e=>!isNaN(e)&&isFinite(e),p2=(e,t)=>{},Yo=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Xo=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?Yo(l,s):l},Ss=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function Wn(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function h2(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Wn(e,n),o=Wn(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=Wn(e.top??e.y??0,n),o=Wn(e.bottom??e.y??0,n),i=Wn(e.left??e.x??0,t),s=Wn(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function g2(e,t,n,r,o,i){const{x:s,y:l}=Ss(e,[t,n,r]),{x:a,y:u}=Ss({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=o-a,c=i-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(p),bottom:Math.floor(c)}}const rc=(e,t,n,r,o,i)=>{const s=h2(i,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),p=Cr(u,r,o),c=e.x+e.width/2,f=e.y+e.height/2,h=t/2-c*p,x=n/2-f*p,w=g2(e,h,x,p,t,n),S={left:Math.min(w.left-s.left,0),top:Math.min(w.top-s.top,0),right:Math.min(w.right-s.right,0),bottom:Math.min(w.bottom-s.bottom,0)};return{x:h-S.left+S.right,y:x-S.top+S.bottom,zoom:p}},Ro=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Nr(e){return e!=null&&e!=="parent"}function Yt(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 Ug(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 Yg(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const l=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function nf(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function m2(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function y2(e){return{...Dg,...e||{}}}function uo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=mt(e),l=Xo({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:a,y:u}=n?Yo(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const oc=e=>({width:e.offsetWidth,height:e.offsetHeight}),Xg=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},x2=["INPUT","SELECT","TEXTAREA"];function Kg(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:x2.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Qg=e=>"clientX"in e,mt=(e,t)=>{var i,s;const n=Qg(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},rf=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...oc(s)}})};function Gg({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,p=Math.abs(a-e),c=Math.abs(u-t);return[a,u,p,c]}function vi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function of({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Q.Left:return[t-vi(t-r,i),n];case Q.Right:return[t+vi(r-t,i),n];case Q.Top:return[t,n-vi(n-o,i)];case Q.Bottom:return[t,n+vi(o-n,i)]}}function Zg({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:o,targetPosition:i=Q.Top,curvature:s=.25}){const[l,a]=of({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,p]=of({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[c,f,h,x]=Gg({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:p});return[`M${e},${t} C${l},${a} ${u},${p} ${r},${o}`,c,f,h,x]}function qg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function v2({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,l=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+l}function w2({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=Ys(ws(e),ws(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return Lo(s,Xs(i))>0}const S2=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,k2=(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)),Jg=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||S2;let o;return Bg(e)?o={...e}:o={...e,id:r(e)},k2(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function em({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=qg({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const sf={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},_2=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.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},lf=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function C2({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:r=Q.Top,center:o,offset:i,stepPosition:s}){const l=sf[t],a=sf[r],u={x:e.x+l.x*i,y:e.y+l.y*i},p={x:n.x+a.x*i,y:n.y+a.y*i},c=_2({source:u,sourcePosition:t,target:p}),f=c.x!==0?"x":"y",h=c[f];let x=[],w,S;const m={x:0,y:0},y={x:0,y:0},[,,g,v]=qg({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*a[f]===-1){f==="x"?(w=o.x??u.x+(p.x-u.x)*s,S=o.y??(u.y+p.y)/2):(w=o.x??(u.x+p.x)/2,S=o.y??u.y+(p.y-u.y)*s);const C=[{x:w,y:u.y},{x:w,y:p.y}],j=[{x:u.x,y:S},{x:p.x,y:S}];l[f]===h?x=f==="x"?C:j:x=f==="x"?j:C}else{const C=[{x:u.x,y:p.y}],j=[{x:p.x,y:u.y}];if(f==="x"?x=l.x===h?j:C:x=l.y===h?C:j,t===r){const R=Math.abs(e[f]-n[f]);if(R<=i){const B=Math.min(i-1,i-R);l[f]===h?m[f]=(u[f]>e[f]?-1:1)*B:y[f]=(p[f]>n[f]?-1:1)*B}}if(t!==r){const R=f==="x"?"y":"x",B=l[f]===a[R],b=u[R]>p[R],$=u[R]<p[R];(l[f]===1&&(!B&&b||B&&$)||l[f]!==1&&(!B&&$||B&&b))&&(x=f==="x"?C:j)}const P={x:u.x+m.x,y:u.y+m.y},L={x:p.x+y.x,y:p.y+y.y},F=Math.max(Math.abs(P.x-x[0].x),Math.abs(L.x-x[0].x)),I=Math.max(Math.abs(P.y-x[0].y),Math.abs(L.y-x[0].y));F>=I?(w=(P.x+L.x)/2,S=x[0].y):(w=x[0].x,S=(P.y+L.y)/2)}return[[e,{x:u.x+m.x,y:u.y+m.y},...x,{x:p.x+y.x,y:p.y+y.y},n],w,S,g,v]}function E2(e,t,n,r){const o=Math.min(lf(e,t)/2,lf(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*p}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+o*a}Q ${i},${s} ${i+o*l},${s}`}function Wa({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:o,targetPosition:i=Q.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20,stepPosition:p=.5}){const[c,f,h,x,w]=C2({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u,stepPosition:p});return[c.reduce((m,y,g)=>{let v="";return g>0&&g<c.length-1?v=E2(c[g-1],y,c[g+1],s):v=`${g===0?"M":"L"}${y.x} ${y.y}`,m+=v,m},""),f,h,x,w]}function af(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function N2(e){var c;const{sourceNode:t,targetNode:n}=e;if(!af(t)||!af(n))return null;const r=t.internals.handleBounds||uf(t.handles),o=n.internals.handleBounds||uf(n.handles),i=cf((r==null?void 0:r.source)??[],e.sourceHandle),s=cf(e.connectionMode===_r.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(c=e.onError)==null||c.call(e,"008",bt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||Q.Bottom,a=(s==null?void 0:s.position)||Q.Top,u=An(t,i,l),p=An(n,s,a);return{sourceX:u.x,sourceY:u.y,targetX:p.x,targetY:p.y,sourcePosition:l,targetPosition:a}}function uf(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 An(e,t,n=Q.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??Yt(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case Q.Top:return{x:o+s/2,y:i};case Q.Right:return{x:o+s,y:i+l/2};case Q.Bottom:return{x:o+s/2,y:i+l};case Q.Left:return{x:o,y:i+l/2}}}function cf(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Ua(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function j2(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const u=Ua(a,t);i.has(u)||(s.push({id:u,color:a.color||n,...a}),i.add(u))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const tm=1e3,b2=10,ic={nodeOrigin:[0,0],nodeExtent:zo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},M2={...ic,checkEquality:!0};function sc(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function P2(e,t,n){const r=sc(ic,n);for(const o of e.values())if(o.parentId)ac(o,e,t,r);else{const i=Wo(o,r.nodeOrigin),s=Nr(o.extent)?o.extent:r.nodeExtent,l=Dn(i,s,Yt(o));o.internals.positionAbsolute=l}}function T2(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function lc(e){return e==="manual"}function Ya(e,t,n,r={}){var u,p;const o=sc(M2,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!lc(o.zIndexMode)?tm:0;let a=e.length>0;t.clear(),n.clear();for(const c of e){let f=s.get(c.id);if(o.checkEquality&&c===(f==null?void 0:f.internals.userNode))t.set(c.id,f);else{const h=Wo(c,o.nodeOrigin),x=Nr(c.extent)?c.extent:o.nodeExtent,w=Dn(h,x,Yt(c));f={...o.defaults,...c,measured:{width:(u=c.measured)==null?void 0:u.width,height:(p=c.measured)==null?void 0:p.height},internals:{positionAbsolute:w,handleBounds:T2(c,f),z:nm(c,l,o.zIndexMode),userNode:c}},t.set(c.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(a=!1),c.parentId&&ac(f,t,n,r,i)}return a}function z2(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 ac(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:a}=sc(ic,r),u=e.parentId,p=t.get(u);if(!p){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}z2(e,n),o&&!p.parentId&&p.internals.rootParentIndex===void 0&&a==="auto"&&(p.internals.rootParentIndex=++o.i,p.internals.z=p.internals.z+o.i*b2),o&&p.internals.rootParentIndex!==void 0&&(o.i=p.internals.rootParentIndex);const c=i&&!lc(a)?tm:0,{x:f,y:h,z:x}=I2(e,p,s,l,c,a),{positionAbsolute:w}=e.internals,S=f!==w.x||h!==w.y;(S||x!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:f,y:h}:w,z:x}})}function nm(e,t,n){const r=gt(e.zIndex)?e.zIndex:0;return lc(n)?r:r+(e.selected?t:0)}function I2(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,a=Yt(e),u=Wo(e,n),p=Nr(e.extent)?Dn(u,e.extent,a):u;let c=Dn({x:s+p.x,y:l+p.y},r,a);e.extent==="parent"&&(c=Hg(c,a,t));const f=nm(e,o,i),h=t.internals.z??0;return{x:c.x,y:c.y,z:h>=f?h+1:f}}function uc(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const u=((s=i.get(l.parentId))==null?void 0:s.expandedRect)??Er(a),p=Wg(u,l.rect);i.set(l.parentId,{expandedRect:p,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},u)=>{var g;const p=a.internals.positionAbsolute,c=Yt(a),f=a.origin??r,h=l.x<p.x?Math.round(Math.abs(p.x-l.x)):0,x=l.y<p.y?Math.round(Math.abs(p.y-l.y)):0,w=Math.max(c.width,Math.round(l.width)),S=Math.max(c.height,Math.round(l.height)),m=(w-c.width)*f[0],y=(S-c.height)*f[1];(h>0||x>0||m||y)&&(o.push({id:u,type:"position",position:{x:a.position.x-h+m,y:a.position.y-x+y}}),(g=n.get(u))==null||g.forEach(v=>{e.some(E=>E.id===v.id)||o.push({id:v.id,type:"position",position:{x:v.position.x+h,y:v.position.y+x}})})),(c.width<l.width||c.height<l.height||h||x)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:w+(h?f[0]*h-m:0),height:S+(x?f[1]*x-y:0)}})}),o}function L2(e,t,n,r,o,i,s){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const u=[],p=window.getComputedStyle(l),{m22:c}=new window.DOMMatrixReadOnly(p.transform),f=[];for(const h of e.values()){const x=t.get(h.id);if(!x)continue;if(x.hidden){t.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),a=!0;continue}const w=oc(h.nodeElement),S=x.measured.width!==w.width||x.measured.height!==w.height;if(!!(w.width&&w.height&&(S||!x.internals.handleBounds||h.force))){const y=h.nodeElement.getBoundingClientRect(),g=Nr(x.extent)?x.extent:i;let{positionAbsolute:v}=x.internals;x.parentId&&x.extent==="parent"?v=Hg(v,w,t.get(x.parentId)):g&&(v=Dn(v,g,w));const E={...x,measured:w,internals:{...x.internals,positionAbsolute:v,handleBounds:{source:rf("source",h.nodeElement,y,c,x.id),target:rf("target",h.nodeElement,y,c,x.id)}}};t.set(x.id,E),x.parentId&&ac(E,t,n,{nodeOrigin:o,zIndexMode:s}),a=!0,S&&(u.push({id:x.id,type:"dimensions",dimensions:w}),x.expandParent&&x.parentId&&f.push({id:x.id,parentId:x.parentId,rect:Er(E,o)}))}}if(f.length>0){const h=uc(f,t,n,o);u.push(...h)}return{changes:u,updatedInternals:a}}async function R2({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){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],[o,i]],r),l=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(l)}function df(e,t,n,r,o,i){let s=o;const l=r.get(s)||new Map;r.set(s,l.set(n,t)),s=`${o}-${e}`;const a=r.get(s)||new Map;if(r.set(s,a.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function rm(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:l=null}=r,a={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:l},u=`${o}-${s}--${i}-${l}`,p=`${i}-${l}--${o}-${s}`;df("source",a,p,e,o,s),df("target",a,u,e,i,l),t.set(r.id,r)}}function om(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:om(n,t):!1}function ff(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function $2(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!om(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(i);l&&o.set(i,{id:i,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 o}function zl({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,a;const o=[];for(const[u,p]of t){const c=(s=n.get(u))==null?void 0:s.internals.userNode;c&&o.push({...c,position:p.position,dragging:r})}if(!e)return[o[0],o];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:r}:o[0],o]}function D2({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=Yo(i,t);return{x:s.x-i.x,y:s.y-i.y}}function A2({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,a=!1,u={x:0,y:0},p=null,c=!1,f=null,h=!1,x=!1,w=null;function S({noDragClassName:y,handleSelector:g,domNode:v,isSelectable:E,nodeId:C,nodeClickDistance:j=0}){f=Ge(v);function P({x:R,y:B}){const{nodeLookup:b,nodeExtent:$,snapGrid:N,snapToGrid:M,nodeOrigin:k,onNodeDrag:_,onSelectionDrag:T,onError:A,updateNodePositions:D}=t();i={x:R,y:B};let W=!1;const V=l.size>1,Y=V&&$?Va(Uo(l)):null,X=V&&M?D2({dragItems:l,snapGrid:N,x:R,y:B}):null;for(const[K,H]of l){if(!b.has(K))continue;let G={x:R-H.distance.x,y:B-H.distance.y};M&&(G=X?{x:Math.round(G.x+X.x),y:Math.round(G.y+X.y)}:Yo(G,N));let te=null;if(V&&$&&!H.extent&&Y){const{positionAbsolute:Z}=H.internals,se=Z.x-Y.x+$[0][0],de=Z.x+H.measured.width-Y.x2+$[1][0],ie=Z.y-Y.y+$[0][1],Ie=Z.y+H.measured.height-Y.y2+$[1][1];te=[[se,ie],[de,Ie]]}const{position:J,positionAbsolute:q}=Og({nodeId:K,nextPosition:G,nodeLookup:b,nodeExtent:te||$,nodeOrigin:k,onError:A});W=W||H.position.x!==J.x||H.position.y!==J.y,H.position=J,H.internals.positionAbsolute=q}if(x=x||W,!!W&&(D(l,!0),w&&(r||_||!C&&T))){const[K,H]=zl({nodeId:C,dragItems:l,nodeLookup:b});r==null||r(w,l,K,H),_==null||_(w,K,H),C||T==null||T(w,H)}}async function L(){if(!p)return;const{transform:R,panBy:B,autoPanSpeed:b,autoPanOnNodeDrag:$}=t();if(!$){a=!1,cancelAnimationFrame(s);return}const[N,M]=Vg(u,p,b);(N!==0||M!==0)&&(i.x=(i.x??0)-N/R[2],i.y=(i.y??0)-M/R[2],await B({x:N,y:M})&&P(i)),s=requestAnimationFrame(L)}function F(R){var V;const{nodeLookup:B,multiSelectionActive:b,nodesDraggable:$,transform:N,snapGrid:M,snapToGrid:k,selectNodesOnDrag:_,onNodeDragStart:T,onSelectionDragStart:A,unselectNodesAndEdges:D}=t();c=!0,(!_||!E)&&!b&&C&&((V=B.get(C))!=null&&V.selected||D()),E&&_&&C&&(e==null||e(C));const W=uo(R.sourceEvent,{transform:N,snapGrid:M,snapToGrid:k,containerBounds:p});if(i=W,l=$2(B,$,W,C),l.size>0&&(n||T||!C&&A)){const[Y,X]=zl({nodeId:C,dragItems:l,nodeLookup:B});n==null||n(R.sourceEvent,l,Y,X),T==null||T(R.sourceEvent,Y,X),C||A==null||A(R.sourceEvent,X)}}const I=wg().clickDistance(j).on("start",R=>{const{domNode:B,nodeDragThreshold:b,transform:$,snapGrid:N,snapToGrid:M}=t();p=(B==null?void 0:B.getBoundingClientRect())||null,h=!1,x=!1,w=R.sourceEvent,b===0&&F(R),i=uo(R.sourceEvent,{transform:$,snapGrid:N,snapToGrid:M,containerBounds:p}),u=mt(R.sourceEvent,p)}).on("drag",R=>{const{autoPanOnNodeDrag:B,transform:b,snapGrid:$,snapToGrid:N,nodeDragThreshold:M,nodeLookup:k}=t(),_=uo(R.sourceEvent,{transform:b,snapGrid:$,snapToGrid:N,containerBounds:p});if(w=R.sourceEvent,(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||C&&!k.has(C))&&(h=!0),!h){if(!a&&B&&c&&(a=!0,L()),!c){const T=mt(R.sourceEvent,p),A=T.x-u.x,D=T.y-u.y;Math.sqrt(A*A+D*D)>M&&F(R)}(i.x!==_.xSnapped||i.y!==_.ySnapped)&&l&&c&&(u=mt(R.sourceEvent,p),P(_))}}).on("end",R=>{if(!(!c||h)&&(a=!1,c=!1,cancelAnimationFrame(s),l.size>0)){const{nodeLookup:B,updateNodePositions:b,onNodeDragStop:$,onSelectionDragStop:N}=t();if(x&&(b(l,!1),x=!1),o||$||!C&&N){const[M,k]=zl({nodeId:C,dragItems:l,nodeLookup:B,dragging:!1});o==null||o(R.sourceEvent,l,M,k),$==null||$(R.sourceEvent,M,k),C||N==null||N(R.sourceEvent,k)}}}).filter(R=>{const B=R.target;return!R.button&&(!y||!ff(B,`.${y}`,v))&&(!g||ff(B,g,v))});f.call(I)}function m(){f==null||f.on(".drag",null)}return{update:S,destroy:m}}function F2(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Lo(o,Er(i))>0&&r.push(i);return r}const B2=250;function O2(e,t,n,r){var l,a;let o=[],i=1/0;const s=F2(e,n,t+B2);for(const u of s){const p=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const c of p){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:f,y:h}=An(u,c,c.position,!0),x=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));x>t||(x<i?(o=[{...c,x:f,y:h}],i=x):x===i&&o.push({...c,x:f,y:h}))}}if(!o.length)return null;if(o.length>1){const u=r.type==="source"?"target":"source";return o.find(p=>p.type===u)??o[0]}return o[0]}function im(e,t,n,r,o,i=!1){var u,p,c;const s=r.get(e);if(!s)return null;const l=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((p=s.internals.handleBounds)==null?void 0:p.source)??[],...((c=s.internals.handleBounds)==null?void 0:c.target)??[]],a=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return a&&i?{...a,...An(s,a,a.position,!0)}:a}function sm(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function H2(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const lm=()=>!0;function V2(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:p,flowId:c,panBy:f,cancelConnection:h,onConnectStart:x,onConnect:w,onConnectEnd:S,isValidConnection:m=lm,onReconnectEnd:y,updateConnection:g,getTransform:v,getFromHandle:E,autoPanSpeed:C,dragThreshold:j=1,handleDomNode:P}){const L=Xg(e.target);let F=0,I;const{x:R,y:B}=mt(e),b=sm(i,P),$=l==null?void 0:l.getBoundingClientRect();let N=!1;if(!$||!b)return;const M=im(o,b,r,a,t);if(!M)return;let k=mt(e,$),_=!1,T=null,A=!1,D=null;function W(){if(!p||!$)return;const[J,q]=Vg(k,$,C);f({x:J,y:q}),F=requestAnimationFrame(W)}const V={...M,nodeId:o,type:b,position:M.position},Y=a.get(o);let K={inProgress:!0,isValid:null,from:An(Y,V,Q.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:Y,to:k,toHandle:null,toPosition:Jd[V.position],toNode:null,pointer:k};function H(){N=!0,g(K),x==null||x(e,{nodeId:o,handleId:r,handleType:b})}j===0&&H();function G(J){if(!N){const{x:Ie,y:Xt}=mt(J),Pt=Ie-R,yn=Xt-B;if(!(Pt*Pt+yn*yn>j*j))return;H()}if(!E()||!V){te(J);return}const q=v();k=mt(J,$),I=O2(Xo(k,q,!1,[1,1]),n,a,V),_||(W(),_=!0);const Z=am(J,{handle:I,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:m,doc:L,lib:u,flowId:c,nodeLookup:a});D=Z.handleDomNode,T=Z.connection,A=H2(!!I,Z.isValid);const se=a.get(o),de=se?An(se,V,Q.Left,!0):K.from,ie={...K,from:de,isValid:A,to:Z.toHandle&&A?Ss({x:Z.toHandle.x,y:Z.toHandle.y},q):k,toHandle:Z.toHandle,toPosition:A&&Z.toHandle?Z.toHandle.position:Jd[V.position],toNode:Z.toHandle?a.get(Z.toHandle.nodeId):null,pointer:k};g(ie),K=ie}function te(J){if(!("touches"in J&&J.touches.length>0)){if(N){(I||D)&&T&&A&&(w==null||w(T));const{inProgress:q,...Z}=K,se={...Z,toPosition:K.toHandle?K.toPosition:null};S==null||S(J,se),i&&(y==null||y(J,se))}h(),cancelAnimationFrame(F),_=!1,A=!1,T=null,D=null,L.removeEventListener("mousemove",G),L.removeEventListener("mouseup",te),L.removeEventListener("touchmove",G),L.removeEventListener("touchend",te)}}L.addEventListener("mousemove",G),L.addEventListener("mouseup",te),L.addEventListener("touchmove",G),L.addEventListener("touchend",te)}function am(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:a,isValidConnection:u=lm,nodeLookup:p}){const c=i==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:x}=mt(e),w=s.elementFromPoint(h,x),S=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:f,m={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const y=sm(void 0,S),g=S.getAttribute("data-nodeid"),v=S.getAttribute("data-handleid"),E=S.classList.contains("connectable"),C=S.classList.contains("connectableend");if(!g||!y)return m;const j={source:c?g:r,sourceHandle:c?v:o,target:c?r:g,targetHandle:c?o:v};m.connection=j;const L=E&&C&&(n===_r.Strict?c&&y==="source"||!c&&y==="target":g!==r||v!==o);m.isValid=L&&u(j),m.toHandle=im(g,y,v,p,n,!0)}return m}const Xa={onPointerDown:V2,isValid:am};function W2({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=Ge(e);function i({translateExtent:l,width:a,height:u,zoomStep:p=1,pannable:c=!0,zoomable:f=!0,inversePan:h=!1}){const x=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const v=n(),E=g.sourceEvent.ctrlKey&&Ro()?10:1,C=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*p,j=v[2]*Math.pow(2,C*E);t.scaleTo(j)};let w=[0,0];const S=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(w=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const v=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const E=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],C=[E[0]-w[0],E[1]-w[1]];w=E;const j=r()*Math.max(v[2],Math.log(v[2]))*(h?-1:1),P={x:v[0]-C[0]*j,y:v[1]-C[1]*j},L=[[0,0],[a,u]];t.setViewportConstrained({x:P.x,y:P.y,zoom:v[2]},L,l)},y=Rg().on("start",S).on("zoom",c?m:null).on("zoom.wheel",f?x:null);o.call(y,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:ft}}const Ks=e=>({x:e.x,y:e.y,zoom:e.k}),Il=({x:e,y:t,zoom:n})=>Us.translate(e,t).scale(n),or=(e,t)=>e.target.closest(`.${t}`),um=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),U2=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ll=(e,t=0,n=U2,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},cm=e=>{const t=e.ctrlKey&&Ro()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Y2({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return p=>{if(or(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(p.ctrlKey&&s){const S=ft(p),m=cm(p),y=c*Math.pow(2,m);r.scaleTo(n,y,S,p);return}const f=p.deltaMode===1?20:1;let h=o===bn.Vertical?0:p.deltaX*f,x=o===bn.Horizontal?0:p.deltaY*f;!Ro()&&p.shiftKey&&o!==bn.Vertical&&(h=p.deltaY*f,x=0),r.translateBy(n,-(h/c)*i,-(x/c)*i,{internal:!0});const w=Ks(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(a==null||a(p,w),e.panScrollTimeout=setTimeout(()=>{u==null||u(p,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(p,w))}}function X2({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=or(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function K2({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=Ks(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function Q2({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&um(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((l=i.sourceEvent)!=null&&l.internal)&&(o==null||o(i.sourceEvent,Ks(i.transform)))}}function G2({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&um(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=Ks(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,a)},n?150:0)}}}function Z2({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:l,noPanClassName:a,lib:u,connectionInProgress:p}){return c=>{var S;const f=e||t,h=n&&c.ctrlKey,x=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(or(c,`${u}-flow__node`)||or(c,`${u}-flow__edge`)))return!0;if(!r&&!f&&!o&&!i&&!n||s||p&&!x||or(c,l)&&x||or(c,a)&&(!x||o&&x&&!e)||!n&&c.ctrlKey&&x)return!1;if(!n&&c.type==="touchstart"&&((S=c.touches)==null?void 0:S.length)>1)return c.preventDefault(),!1;if(!f&&!o&&!h&&x||!r&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(r)&&!r.includes(c.button)&&c.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||x)&&w}}function q2({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),c=Rg().scaleExtent([t,n]).translateExtent(r),f=Ge(e).call(c);y({x:o.x,y:o.y,zoom:Cr(o.zoom,t,n)},[[0,0],[p.width,p.height]],r);const h=f.on("wheel.zoom"),x=f.on("dblclick.zoom");c.wheelDelta(cm);function w(I,R){return f?new Promise(B=>{c==null||c.interpolate((R==null?void 0:R.interpolate)==="linear"?ao:$i).transform(Ll(f,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>B(!0)),I)}):Promise.resolve(!1)}function S({noWheelClassName:I,noPanClassName:R,onPaneContextMenu:B,userSelectionActive:b,panOnScroll:$,panOnDrag:N,panOnScrollMode:M,panOnScrollSpeed:k,preventScrolling:_,zoomOnPinch:T,zoomOnScroll:A,zoomOnDoubleClick:D,zoomActivationKeyPressed:W,lib:V,onTransformChange:Y,connectionInProgress:X,paneClickDistance:K,selectionOnDrag:H}){b&&!u.isZoomingOrPanning&&m();const G=$&&!W&&!b;c.clickDistance(H?1/0:!gt(K)||K<0?0:K);const te=G?Y2({zoomPanValues:u,noWheelClassName:I,d3Selection:f,d3Zoom:c,panOnScrollMode:M,panOnScrollSpeed:k,zoomOnPinch:T,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):X2({noWheelClassName:I,preventScrolling:_,d3ZoomHandler:h});if(f.on("wheel.zoom",te,{passive:!1}),!b){const q=K2({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:s});c.on("start",q);const Z=Q2({zoomPanValues:u,panOnDrag:N,onPaneContextMenu:!!B,onPanZoom:i,onTransformChange:Y});c.on("zoom",Z);const se=G2({zoomPanValues:u,panOnDrag:N,panOnScroll:$,onPaneContextMenu:B,onPanZoomEnd:l,onDraggingChange:a});c.on("end",se)}const J=Z2({zoomActivationKeyPressed:W,panOnDrag:N,zoomOnScroll:A,panOnScroll:$,zoomOnDoubleClick:D,zoomOnPinch:T,userSelectionActive:b,noPanClassName:R,noWheelClassName:I,lib:V,connectionInProgress:X});c.filter(J),D?f.on("dblclick.zoom",x):f.on("dblclick.zoom",null)}function m(){c.on("zoom",null)}async function y(I,R,B){const b=Il(I),$=c==null?void 0:c.constrain()(b,R,B);return $&&await w($),new Promise(N=>N($))}async function g(I,R){const B=Il(I);return await w(B,R),new Promise(b=>b(B))}function v(I){if(f){const R=Il(I),B=f.property("__zoom");(B.k!==I.zoom||B.x!==I.x||B.y!==I.y)&&(c==null||c.transform(f,R,null,{sync:!0}))}}function E(){const I=f?Lg(f.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function C(I,R){return f?new Promise(B=>{c==null||c.interpolate((R==null?void 0:R.interpolate)==="linear"?ao:$i).scaleTo(Ll(f,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>B(!0)),I)}):Promise.resolve(!1)}function j(I,R){return f?new Promise(B=>{c==null||c.interpolate((R==null?void 0:R.interpolate)==="linear"?ao:$i).scaleBy(Ll(f,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>B(!0)),I)}):Promise.resolve(!1)}function P(I){c==null||c.scaleExtent(I)}function L(I){c==null||c.translateExtent(I)}function F(I){const R=!gt(I)||I<0?0:I;c==null||c.clickDistance(R)}return{update:S,destroy:m,setViewport:g,setViewportConstrained:y,getViewport:E,scaleTo:C,scaleBy:j,setScaleExtent:P,setTranslateExtent:L,syncViewport:v,setClickDistance:F}}var jr;(function(e){e.Line="line",e.Handle="handle"})(jr||(jr={}));function J2({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,l=n-r,a=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&o&&(a[0]=a[0]*-1),l&&i&&(a[1]=a[1]*-1),a}function pf(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function Qt(e,t){return Math.max(0,t-e)}function Gt(e,t){return Math.max(0,e-t)}function wi(e,t,n){return Math.max(0,t-e,e-n)}function hf(e,t){return e?!t:t}function ek(e,t,n,r,o,i,s,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:p,isVertical:c}=t,f=p&&c,{xSnapped:h,ySnapped:x}=n,{minWidth:w,maxWidth:S,minHeight:m,maxHeight:y}=r,{x:g,y:v,width:E,height:C,aspectRatio:j}=e;let P=Math.floor(p?h-e.pointerX:0),L=Math.floor(c?x-e.pointerY:0);const F=E+(a?-P:P),I=C+(u?-L:L),R=-i[0]*E,B=-i[1]*C;let b=wi(F,w,S),$=wi(I,m,y);if(s){let k=0,_=0;a&&P<0?k=Qt(g+P+R,s[0][0]):!a&&P>0&&(k=Gt(g+F+R,s[1][0])),u&&L<0?_=Qt(v+L+B,s[0][1]):!u&&L>0&&(_=Gt(v+I+B,s[1][1])),b=Math.max(b,k),$=Math.max($,_)}if(l){let k=0,_=0;a&&P>0?k=Gt(g+P,l[0][0]):!a&&P<0&&(k=Qt(g+F,l[1][0])),u&&L>0?_=Gt(v+L,l[0][1]):!u&&L<0&&(_=Qt(v+I,l[1][1])),b=Math.max(b,k),$=Math.max($,_)}if(o){if(p){const k=wi(F/j,m,y)*j;if(b=Math.max(b,k),s){let _=0;!a&&!u||a&&!u&&f?_=Gt(v+B+F/j,s[1][1])*j:_=Qt(v+B+(a?P:-P)/j,s[0][1])*j,b=Math.max(b,_)}if(l){let _=0;!a&&!u||a&&!u&&f?_=Qt(v+F/j,l[1][1])*j:_=Gt(v+(a?P:-P)/j,l[0][1])*j,b=Math.max(b,_)}}if(c){const k=wi(I*j,w,S)/j;if($=Math.max($,k),s){let _=0;!a&&!u||u&&!a&&f?_=Gt(g+I*j+R,s[1][0])/j:_=Qt(g+(u?L:-L)*j+R,s[0][0])/j,$=Math.max($,_)}if(l){let _=0;!a&&!u||u&&!a&&f?_=Qt(g+I*j,l[1][0])/j:_=Gt(g+(u?L:-L)*j,l[0][0])/j,$=Math.max($,_)}}}L=L+(L<0?$:-$),P=P+(P<0?b:-b),o&&(f?F>I*j?L=(hf(a,u)?-P:P)/j:P=(hf(a,u)?-L:L)*j:p?(L=P/j,u=a):(P=L*j,a=u));const N=a?g+P:g,M=u?v+L:v;return{width:E+(a?-P:P),height:C+(u?-L:L),x:i[0]*P*(a?-1:1)+N,y:i[1]*L*(u?-1:1)+M}}const dm={width:0,height:0,x:0,y:0},tk={...dm,pointerX:0,pointerY:0,aspectRatio:1};function nk(e){return[[0,0],[e.measured.width,e.measured.height]]}function rk(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,l=n[0]*i,a=n[1]*s;return[[r-l,o-a],[r+i-l,o+s-a]]}function ok({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=Ge(e);let s={controlDirection:pf("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:p,keepAspectRatio:c,resizeDirection:f,onResizeStart:h,onResize:x,onResizeEnd:w,shouldResize:S}){let m={...dm},y={...tk};s={boundaries:p,resizeDirection:f,keepAspectRatio:c,controlDirection:pf(u)};let g,v=null,E=[],C,j,P,L=!1;const F=wg().on("start",I=>{const{nodeLookup:R,transform:B,snapGrid:b,snapToGrid:$,nodeOrigin:N,paneDomNode:M}=n();if(g=R.get(t),!g)return;v=(M==null?void 0:M.getBoundingClientRect())??null;const{xSnapped:k,ySnapped:_}=uo(I.sourceEvent,{transform:B,snapGrid:b,snapToGrid:$,containerBounds:v});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},y={...m,pointerX:k,pointerY:_,aspectRatio:m.width/m.height},C=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(C=R.get(g.parentId),j=C&&g.extent==="parent"?nk(C):void 0),E=[],P=void 0;for(const[T,A]of R)if(A.parentId===t&&(E.push({id:T,position:{...A.position},extent:A.extent}),A.extent==="parent"||A.expandParent)){const D=rk(A,g,A.origin??N);P?P=[[Math.min(D[0][0],P[0][0]),Math.min(D[0][1],P[0][1])],[Math.max(D[1][0],P[1][0]),Math.max(D[1][1],P[1][1])]]:P=D}h==null||h(I,{...m})}).on("drag",I=>{const{transform:R,snapGrid:B,snapToGrid:b,nodeOrigin:$}=n(),N=uo(I.sourceEvent,{transform:R,snapGrid:B,snapToGrid:b,containerBounds:v}),M=[];if(!g)return;const{x:k,y:_,width:T,height:A}=m,D={},W=g.origin??$,{width:V,height:Y,x:X,y:K}=ek(y,s.controlDirection,N,s.boundaries,s.keepAspectRatio,W,j,P),H=V!==T,G=Y!==A,te=X!==k&&H,J=K!==_&&G;if(!te&&!J&&!H&&!G)return;if((te||J||W[0]===1||W[1]===1)&&(D.x=te?X:m.x,D.y=J?K:m.y,m.x=D.x,m.y=D.y,E.length>0)){const de=X-k,ie=K-_;for(const Ie of E)Ie.position={x:Ie.position.x-de+W[0]*(V-T),y:Ie.position.y-ie+W[1]*(Y-A)},M.push(Ie)}if((H||G)&&(D.width=H&&(!s.resizeDirection||s.resizeDirection==="horizontal")?V:m.width,D.height=G&&(!s.resizeDirection||s.resizeDirection==="vertical")?Y:m.height,m.width=D.width,m.height=D.height),C&&g.expandParent){const de=W[0]*(D.width??0);D.x&&D.x<de&&(m.x=de,y.x=y.x-(D.x-de));const ie=W[1]*(D.height??0);D.y&&D.y<ie&&(m.y=ie,y.y=y.y-(D.y-ie))}const q=J2({width:m.width,prevWidth:T,height:m.height,prevHeight:A,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),Z={...m,direction:q};(S==null?void 0:S(I,Z))!==!1&&(L=!0,x==null||x(I,Z),r(D,M))}).on("end",I=>{L&&(w==null||w(I,{...m}),o==null||o({...m}),L=!1)});i.call(F)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var fm={exports:{}},pm={},hm={exports:{}},gm={};/**
|
|
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 br=z;function ik(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sk=typeof Object.is=="function"?Object.is:ik,lk=br.useState,ak=br.useEffect,uk=br.useLayoutEffect,ck=br.useDebugValue;function dk(e,t){var n=t(),r=lk({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return uk(function(){o.value=n,o.getSnapshot=t,Rl(o)&&i({inst:o})},[e,n,t]),ak(function(){return Rl(o)&&i({inst:o}),e(function(){Rl(o)&&i({inst:o})})},[e]),ck(n),n}function Rl(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sk(e,n)}catch{return!0}}function fk(e,t){return t()}var pk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?fk:dk;gm.useSyncExternalStore=br.useSyncExternalStore!==void 0?br.useSyncExternalStore:pk;hm.exports=gm;var hk=hm.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 Qs=z,gk=hk;function mk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yk=typeof Object.is=="function"?Object.is:mk,xk=gk.useSyncExternalStore,vk=Qs.useRef,wk=Qs.useEffect,Sk=Qs.useMemo,kk=Qs.useDebugValue;pm.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=vk(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=Sk(function(){function a(h){if(!u){if(u=!0,p=h,h=r(h),o!==void 0&&s.hasValue){var x=s.value;if(o(x,h))return c=x}return c=h}if(x=c,yk(p,h))return x;var w=r(h);return o!==void 0&&o(x,w)?(p=h,x):(p=h,c=w)}var u=!1,p,c,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,o]);var l=xk(e,i[0],i[1]);return wk(function(){s.hasValue=!0,s.value=l},[l]),kk(l),l};fm.exports=pm;var _k=fm.exports;const Ck=Xf(_k),Ek={},gf=e=>{let t;const n=new Set,r=(p,c)=>{const f=typeof p=="function"?p(t):p;if(!Object.is(f,t)){const h=t;t=c??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(x=>x(t,h))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>u,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(Ek?"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()}},u=t=e(r,o,a);return a},Nk=e=>e?gf(e):gf,{useDebugValue:jk}=Es,{useSyncExternalStoreWithSelector:bk}=Ck,Mk=e=>e;function mm(e,t=Mk,n){const r=bk(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return jk(r),r}const mf=(e,t)=>{const n=Nk(e),r=(o,i=t)=>mm(n,o,i);return Object.assign(r,n),r},Pk=(e,t)=>e?mf(e,t):mf;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,o]of e)if(!Object.is(o,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 Gs=z.createContext(null),Tk=Gs.Provider,ym=bt.error001();function re(e,t){const n=z.useContext(Gs);if(n===null)throw new Error(ym);return mm(n,e,t)}function me(){const e=z.useContext(Gs);if(e===null)throw new Error(ym);return z.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const yf={display:"none"},zk={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},xm="react-flow__node-desc",vm="react-flow__edge-desc",Ik="react-flow__aria-live",Lk=e=>e.ariaLiveMessage,Rk=e=>e.ariaLabelConfig;function $k({rfId:e}){const t=re(Lk);return d.jsx("div",{id:`${Ik}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:zk,children:t})}function Dk({rfId:e,disableKeyboardA11y:t}){const n=re(Rk);return d.jsxs(d.Fragment,{children:[d.jsx("div",{id:`${xm}-${e}`,style:yf,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),d.jsx("div",{id:`${vm}-${e}`,style:yf,children:n["edge.a11yDescription.default"]}),!t&&d.jsx($k,{rfId:e})]})}const Mr=z.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return d.jsx("div",{className:Ce(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});Mr.displayName="Panel";function Ak({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:d.jsx(Mr,{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:d.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Fk=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}},Si=e=>e.id;function Bk(e,t){return ge(e.selectedNodes.map(Si),t.selectedNodes.map(Si))&&ge(e.selectedEdges.map(Si),t.selectedEdges.map(Si))}function Ok({onSelectionChange:e}){const t=me(),{selectedNodes:n,selectedEdges:r}=re(Fk,Bk);return z.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const Hk=e=>!!e.onSelectionChangeHandlers;function Vk({onSelectionChange:e}){const t=re(Hk);return e||t?d.jsx(Ok,{onSelectionChange:e}):null}const wm=[0,0],Wk={x:0,y:0,zoom:1},Uk=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","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","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],xf=[...Uk,"rfId"],Yk=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}),vf={translateExtent:zo,nodeOrigin:wm,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Xk(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:a}=re(Yk,ge),u=me();z.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{p.current=vf,l()}),[]);const p=z.useRef(vf);return z.useEffect(()=>{for(const c of xf){const f=e[c],h=p.current[c];f!==h&&(typeof e[c]>"u"||(c==="nodes"?t(f):c==="edges"?n(f):c==="minZoom"?r(f):c==="maxZoom"?o(f):c==="translateExtent"?i(f):c==="nodeExtent"?s(f):c==="ariaLabelConfig"?u.setState({ariaLabelConfig:y2(f)}):c==="fitView"?u.setState({fitViewQueued:f}):c==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[c]:f})))}p.current=e},xf.map(c=>e[c])),null}function wf(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Kk(e){var r;const[t,n]=z.useState(e==="system"?null:e);return z.useEffect(()=>{if(e!=="system"){n(e);return}const o=wf(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=wf())!=null&&r.matches?"dark":"light"}const Sf=typeof document<"u"?document:null;function $o(e=null,t={target:Sf,actInsideInputWithModifier:!0}){const[n,r]=z.useState(!1),o=z.useRef(!1),i=z.useRef(new Set([])),[s,l]=z.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),p=u.reduce((c,f)=>c.concat(...f),[]);return[u,p]}return[[],[]]},[e]);return z.useEffect(()=>{const a=(t==null?void 0:t.target)??Sf,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=h=>{var S,m;if(o.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!o.current||o.current&&!u)&&Kg(h))return!1;const w=_f(h.code,l);if(i.current.add(h[w]),kf(s,i.current,!1)){const y=((m=(S=h.composedPath)==null?void 0:S.call(h))==null?void 0:m[0])||h.target,g=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";t.preventDefault!==!1&&(o.current||!g)&&h.preventDefault(),r(!0)}},c=h=>{const x=_f(h.code,l);kf(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(h[x]),h.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",p),a==null||a.addEventListener("keyup",c),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{a==null||a.removeEventListener("keydown",p),a==null||a.removeEventListener("keyup",c),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function kf(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function _f(e,t){return t.includes(e)?"code":"key"}const Qk=()=>{const e=me();return z.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,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:s,panZoom:l}=e.getState(),a=rc(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:l,y:a}=s.getBoundingClientRect(),u={x:t.x-l,y:t.y-a},p=n.snapGrid??o,c=n.snapToGrid??i;return Xo(u,r,c,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=Ss(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function Sm(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...i};for(const a of s)Gk(a,l);n.push(l)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Gk(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={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function km(e,t){return Sm(e,t)}function _m(e,t){return Sm(e,t)}function wn(e,t){return{id:e,type:"select",selected:t}}function ir(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(wn(i.id,s)))}return r}function Cf({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const l=t.get(s.id),a=((o=l==null?void 0:l.internals)==null?void 0:o.userNode)??l;a!==void 0&&a!==s&&n.push({id:s.id,item:s,type:"replace"}),a===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function Ef(e){return{id:e.id,type:"remove"}}const Nf=e=>l2(e),Zk=e=>Bg(e);function Cm(e){return z.forwardRef(e)}const qk=typeof window<"u"?z.useLayoutEffect:z.useEffect;function jf(e){const[t,n]=z.useState(BigInt(0)),[r]=z.useState(()=>Jk(()=>n(o=>o+BigInt(1))));return qk(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function Jk(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Em=z.createContext(null);function e_({children:e}){const t=me(),n=z.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:p,onNodesChange:c,nodeLookup:f,fitViewQueued:h,onNodesChangeMiddlewareMap:x}=t.getState();let w=a;for(const m of l)w=typeof m=="function"?m(w):m;let S=Cf({items:w,lookup:f});for(const m of x.values())S=m(S);p&&u(w),S.length>0?c==null||c(S):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:y,setNodes:g}=t.getState();m&&g(y)})},[]),r=jf(n),o=z.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:p,onEdgesChange:c,edgeLookup:f}=t.getState();let h=a;for(const x of l)h=typeof x=="function"?x(h):x;p?u(h):c&&c(Cf({items:h,lookup:f}))},[]),i=jf(o),s=z.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return d.jsx(Em.Provider,{value:s,children:e})}function t_(){const e=z.useContext(Em);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const n_=e=>!!e.panZoom;function cc(){const e=Qk(),t=me(),n=t_(),r=re(n_),o=z.useMemo(()=>{const i=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},l=c=>{n.edgeQueue.push(c)},a=c=>{var m,y;const{nodeLookup:f,nodeOrigin:h}=t.getState(),x=Nf(c)?c:f.get(c.id),w=x.parentId?Yg(x.position,x.measured,x.parentId,f,h):x.position,S={...x,position:w,width:((m=x.measured)==null?void 0:m.width)??x.width,height:((y=x.measured)==null?void 0:y.height)??x.height};return Er(S)},u=(c,f,h={replace:!1})=>{s(x=>x.map(w=>{if(w.id===c){const S=typeof f=="function"?f(w):f;return h.replace&&Nf(S)?S:{...w,...S}}return w}))},p=(c,f,h={replace:!1})=>{l(x=>x.map(w=>{if(w.id===c){const S=typeof f=="function"?f(w):f;return h.replace&&Zk(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var f;return(f=i(c))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(f=>({...f}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:l,addNodes:c=>{const f=Array.isArray(c)?c:[c];n.nodeQueue.push(h=>[...h,...f])},addEdges:c=>{const f=Array.isArray(c)?c:[c];n.edgeQueue.push(h=>[...h,...f])},toObject:()=>{const{nodes:c=[],edges:f=[],transform:h}=t.getState(),[x,w,S]=h;return{nodes:c.map(m=>({...m})),edges:f.map(m=>({...m})),viewport:{x,y:w,zoom:S}}},deleteElements:async({nodes:c=[],edges:f=[]})=>{const{nodes:h,edges:x,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:m,triggerEdgeChanges:y,onDelete:g,onBeforeDelete:v}=t.getState(),{nodes:E,edges:C}=await f2({nodesToRemove:c,edgesToRemove:f,nodes:h,edges:x,onBeforeDelete:v}),j=C.length>0,P=E.length>0;if(j){const L=C.map(Ef);S==null||S(C),y(L)}if(P){const L=E.map(Ef);w==null||w(E),m(L)}return(P||j)&&(g==null||g({nodes:E,edges:C})),{deletedNodes:E,deletedEdges:C}},getIntersectingNodes:(c,f=!0,h)=>{const x=tf(c),w=x?c:a(c),S=h!==void 0;return w?(h||t.getState().nodes).filter(m=>{const y=t.getState().nodeLookup.get(m.id);if(y&&!x&&(m.id===c.id||!y.internals.positionAbsolute))return!1;const g=Er(S?m:y),v=Lo(g,w);return f&&v>0||v>=g.width*g.height||v>=w.width*w.height}):[]},isNodeIntersecting:(c,f,h=!0)=>{const w=tf(c)?c:a(c);if(!w)return!1;const S=Lo(w,f);return h&&S>0||S>=f.width*f.height||S>=w.width*w.height},updateNode:u,updateNodeData:(c,f,h={replace:!1})=>{u(c,x=>{const w=typeof f=="function"?f(x):f;return h.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},h)},updateEdge:p,updateEdgeData:(c,f,h={replace:!1})=>{p(c,x=>{const w=typeof f=="function"?f(x):f;return h.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},h)},getNodesBounds:c=>{const{nodeLookup:f,nodeOrigin:h}=t.getState();return a2(c,{nodeLookup:f,nodeOrigin:h})},getHandleConnections:({type:c,id:f,nodeId:h})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${h}-${c}${f?`-${f}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:c,handleId:f,nodeId:h})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${h}${c?f?`-${c}-${f}`:`-${c}`:""}`))==null?void 0:x.values())??[])},fitView:async c=>{const f=t.getState().fitViewResolver??m2();return t.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:f}),n.nodeQueue.push(h=>[...h]),f.promise}}},[]);return z.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const bf=e=>e.selected,r_=typeof window<"u"?window:void 0;function o_({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=me(),{deleteElements:r}=cc(),o=$o(e,{actInsideInputWithModifier:!1}),i=$o(t,{target:r_});z.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(bf),edges:s.filter(bf)}),n.setState({nodesSelectionActive:!1})}},[o]),z.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function i_(e){const t=me();z.useEffect(()=>{const n=()=>{var o,i,s,l;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=oc(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"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 Zs={position:"absolute",width:"100%",height:"100%",top:0,left:0},s_=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function l_({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=bn.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:a,translateExtent:u,minZoom:p,maxZoom:c,zoomActivationKeyCode:f,preventScrolling:h=!0,children:x,noWheelClassName:w,noPanClassName:S,onViewportChange:m,isControlledViewport:y,paneClickDistance:g,selectionOnDrag:v}){const E=me(),C=z.useRef(null),{userSelectionActive:j,lib:P,connectionInProgress:L}=re(s_,ge),F=$o(f),I=z.useRef();i_(C);const R=z.useCallback(B=>{m==null||m({x:B[0],y:B[1],zoom:B[2]}),y||E.setState({transform:B})},[m,y]);return z.useEffect(()=>{if(C.current){I.current=q2({domNode:C.current,minZoom:p,maxZoom:c,translateExtent:u,viewport:a,onDraggingChange:N=>E.setState({paneDragging:N}),onPanZoomStart:(N,M)=>{const{onViewportChangeStart:k,onMoveStart:_}=E.getState();_==null||_(N,M),k==null||k(M)},onPanZoom:(N,M)=>{const{onViewportChange:k,onMove:_}=E.getState();_==null||_(N,M),k==null||k(M)},onPanZoomEnd:(N,M)=>{const{onViewportChangeEnd:k,onMoveEnd:_}=E.getState();_==null||_(N,M),k==null||k(M)}});const{x:B,y:b,zoom:$}=I.current.getViewport();return E.setState({panZoom:I.current,transform:[B,b,$],domNode:C.current.closest(".react-flow")}),()=>{var N;(N=I.current)==null||N.destroy()}}},[]),z.useEffect(()=>{var B;(B=I.current)==null||B.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:F,preventScrolling:h,noPanClassName:S,userSelectionActive:j,noWheelClassName:w,lib:P,onTransformChange:R,connectionInProgress:L,selectionOnDrag:v,paneClickDistance:g})},[e,t,n,r,o,i,s,l,F,h,S,j,w,P,R,L,v,g]),d.jsx("div",{className:"react-flow__renderer",ref:C,style:Zs,children:x})}const a_=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function u_(){const{userSelectionActive:e,userSelectionRect:t}=re(a_,ge);return e&&t?d.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 $l=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},c_=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function d_({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Io.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:l,onPaneClick:a,onPaneContextMenu:u,onPaneScroll:p,onPaneMouseEnter:c,onPaneMouseMove:f,onPaneMouseLeave:h,children:x}){const w=me(),{userSelectionActive:S,elementsSelectable:m,dragging:y,connectionInProgress:g}=re(c_,ge),v=m&&(e||S),E=z.useRef(null),C=z.useRef(),j=z.useRef(new Set),P=z.useRef(new Set),L=z.useRef(!1),F=k=>{if(L.current||g){L.current=!1;return}a==null||a(k),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},I=k=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){k.preventDefault();return}u==null||u(k)},R=p?k=>p(k):void 0,B=k=>{L.current&&(k.stopPropagation(),L.current=!1)},b=k=>{var Y,X;const{domNode:_}=w.getState();if(C.current=_==null?void 0:_.getBoundingClientRect(),!C.current)return;const T=k.target===E.current;if(!T&&!!k.target.closest(".nokey")||!e||!(i&&T||t)||k.button!==0||!k.isPrimary)return;(X=(Y=k.target)==null?void 0:Y.setPointerCapture)==null||X.call(Y,k.pointerId),L.current=!1;const{x:W,y:V}=mt(k.nativeEvent,C.current);w.setState({userSelectionRect:{width:0,height:0,startX:W,startY:V,x:W,y:V}}),T||(k.stopPropagation(),k.preventDefault())},$=k=>{const{userSelectionRect:_,transform:T,nodeLookup:A,edgeLookup:D,connectionLookup:W,triggerNodeChanges:V,triggerEdgeChanges:Y,defaultEdgeOptions:X,resetSelectedElements:K}=w.getState();if(!C.current||!_)return;const{x:H,y:G}=mt(k.nativeEvent,C.current),{startX:te,startY:J}=_;if(!L.current){const ie=t?0:o;if(Math.hypot(H-te,G-J)<=ie)return;K(),s==null||s(k)}L.current=!0;const q={startX:te,startY:J,x:H<te?H:te,y:G<J?G:J,width:Math.abs(H-te),height:Math.abs(G-J)},Z=j.current,se=P.current;j.current=new Set(nc(A,q,T,n===Io.Partial,!0).map(ie=>ie.id)),P.current=new Set;const de=(X==null?void 0:X.selectable)??!0;for(const ie of j.current){const Ie=W.get(ie);if(Ie)for(const{edgeId:Xt}of Ie.values()){const Pt=D.get(Xt);Pt&&(Pt.selectable??de)&&P.current.add(Xt)}}if(!nf(Z,j.current)){const ie=ir(A,j.current,!0);V(ie)}if(!nf(se,P.current)){const ie=ir(D,P.current);Y(ie)}w.setState({userSelectionRect:q,userSelectionActive:!0,nodesSelectionActive:!1})},N=k=>{var _,T;k.button===0&&((T=(_=k.target)==null?void 0:_.releasePointerCapture)==null||T.call(_,k.pointerId),!S&&k.target===E.current&&w.getState().userSelectionRect&&(F==null||F(k)),w.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(l==null||l(k),w.setState({nodesSelectionActive:j.current.size>0})))},M=r===!0||Array.isArray(r)&&r.includes(0);return d.jsxs("div",{className:Ce(["react-flow__pane",{draggable:M,dragging:y,selection:e}]),onClick:v?void 0:$l(F,E),onContextMenu:$l(I,E),onWheel:$l(R,E),onPointerEnter:v?void 0:c,onPointerMove:v?$:f,onPointerUp:v?N:void 0,onPointerDownCapture:v?b:void 0,onClickCapture:v?B:void 0,onPointerLeave:h,ref:E,style:Zs,children:[x,d.jsx(u_,{})]})}function Ka({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:l,onError:a}=t.getState(),u=l.get(e);if(!u){a==null||a("012",bt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):o([e])}function Nm({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=me(),[a,u]=z.useState(!1),p=z.useRef();return z.useEffect(()=>{p.current=A2({getStoreItems:()=>l.getState(),onNodeMouseDown:c=>{Ka({id:c,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),z.useEffect(()=>{var c,f;if(t)(c=p.current)==null||c.destroy();else if(e.current)return(f=p.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s}),()=>{var h;(h=p.current)==null||h.destroy()}},[n,r,t,i,e,o]),a}const f_=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function jm(){const e=me();return z.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:p}=e.getState(),c=new Map,f=f_(s),h=o?i[0]:5,x=o?i[1]:5,w=n.direction.x*h*n.factor,S=n.direction.y*x*n.factor;for(const[,m]of u){if(!f(m))continue;let y={x:m.internals.positionAbsolute.x+w,y:m.internals.positionAbsolute.y+S};o&&(y=Yo(y,i));const{position:g,positionAbsolute:v}=Og({nodeId:m.id,nextPosition:y,nodeLookup:u,nodeExtent:r,nodeOrigin:p,onError:l});m.position=g,m.internals.positionAbsolute=v,c.set(m.id,m)}a(c)},[])}const dc=z.createContext(null),p_=dc.Provider;dc.Consumer;const bm=()=>z.useContext(dc),h_=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),g_=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:a,isValid:u}=s,p=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.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:p,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===_r.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!o,valid:p&&u}};function m_({type:e="source",position:t=Q.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:a,className:u,onMouseDown:p,onTouchStart:c,...f},h){var $,N;const x=s||null,w=e==="target",S=me(),m=bm(),{connectOnClick:y,noPanClassName:g,rfId:v}=re(h_,ge),{connectingFrom:E,connectingTo:C,clickConnecting:j,isPossibleEndHandle:P,connectionInProcess:L,clickConnectionInProcess:F,valid:I}=re(g_(m,x,e),ge);m||(N=($=S.getState()).onError)==null||N.call($,"010",bt.error010());const R=M=>{const{defaultEdgeOptions:k,onConnect:_,hasDefaultEdges:T}=S.getState(),A={...k,...M};if(T){const{edges:D,setEdges:W}=S.getState();W(Jg(A,D))}_==null||_(A),l==null||l(A)},B=M=>{if(!m)return;const k=Qg(M.nativeEvent);if(o&&(k&&M.button===0||!k)){const _=S.getState();Xa.onPointerDown(M.nativeEvent,{handleDomNode:M.currentTarget,autoPanOnConnect:_.autoPanOnConnect,connectionMode:_.connectionMode,connectionRadius:_.connectionRadius,domNode:_.domNode,nodeLookup:_.nodeLookup,lib:_.lib,isTarget:w,handleId:x,nodeId:m,flowId:_.rfId,panBy:_.panBy,cancelConnection:_.cancelConnection,onConnectStart:_.onConnectStart,onConnectEnd:_.onConnectEnd,updateConnection:_.updateConnection,onConnect:R,isValidConnection:n||_.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:_.autoPanSpeed,dragThreshold:_.connectionDragThreshold})}k?p==null||p(M):c==null||c(M)},b=M=>{const{onClickConnectStart:k,onClickConnectEnd:_,connectionClickStartHandle:T,connectionMode:A,isValidConnection:D,lib:W,rfId:V,nodeLookup:Y,connection:X}=S.getState();if(!m||!T&&!o)return;if(!T){k==null||k(M.nativeEvent,{nodeId:m,handleId:x,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:m,type:e,id:x}});return}const K=Xg(M.target),H=n||D,{connection:G,isValid:te}=Xa.isValid(M.nativeEvent,{handle:{nodeId:m,id:x,type:e},connectionMode:A,fromNodeId:T.nodeId,fromHandleId:T.id||null,fromType:T.type,isValidConnection:H,flowId:V,doc:K,lib:W,nodeLookup:Y});te&&G&&R(G);const J=structuredClone(X);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,_==null||_(M,J),S.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":x,"data-nodeid":m,"data-handlepos":t,"data-id":`${v}-${m}-${x}-${e}`,className:Ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!w,target:w,connectable:r,connectablestart:o,connectableend:i,clickconnecting:j,connectingfrom:E,connectingto:C,valid:I,connectionindicator:r&&(!L||P)&&(L||F?i:o)}]),onMouseDown:B,onTouchStart:B,onClick:y?b:void 0,ref:h,...f,children:a})}const Mn=z.memo(Cm(m_));function y_({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return d.jsxs(d.Fragment,{children:[e==null?void 0:e.label,d.jsx(Mn,{type:"source",position:n,isConnectable:t})]})}function x_({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:r=Q.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(Mn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,d.jsx(Mn,{type:"source",position:r,isConnectable:t})]})}function v_(){return null}function w_({data:e,isConnectable:t,targetPosition:n=Q.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(Mn,{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}},Mf={input:y_,default:x_,output:w_,group:v_};function S_(e){var t,n,r,o;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??((o=e.style)==null?void 0:o.height)}}const k_=e=>{const{width:t,height:n,x:r,y:o}=Uo(e.nodeLookup,{filter:i=>!!i.selected});return{width:gt(t)?t:null,height:gt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function __({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=me(),{width:o,height:i,transformString:s,userSelectionActive:l}=re(k_,ge),a=jm(),u=z.useRef(null);if(z.useEffect(()=>{var f;n||(f=u.current)==null||f.focus({preventScroll:!0})},[n]),Nm({nodeRef:u}),l||!o||!i)return null;const p=e?f=>{const h=r.getState().nodes.filter(x=>x.selected);e(f,h)}:void 0,c=f=>{Object.prototype.hasOwnProperty.call(ks,f.key)&&(f.preventDefault(),a({direction:ks[f.key],factor:f.shiftKey?4:1}))};return d.jsx("div",{className:Ce(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:d.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:c,style:{width:o,height:i}})})}const Pf=typeof window<"u"?window:void 0,C_=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Mm({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:p,selectionMode:c,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:x,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:m,zoomOnScroll:y,zoomOnPinch:g,panOnScroll:v,panOnScrollSpeed:E,panOnScrollMode:C,zoomOnDoubleClick:j,panOnDrag:P,defaultViewport:L,translateExtent:F,minZoom:I,maxZoom:R,preventScrolling:B,onSelectionContextMenu:b,noWheelClassName:$,noPanClassName:N,disableKeyboardA11y:M,onViewportChange:k,isControlledViewport:_}){const{nodesSelectionActive:T,userSelectionActive:A}=re(C_,ge),D=$o(u,{target:Pf}),W=$o(w,{target:Pf}),V=W||P,Y=W||v,X=p&&V!==!0,K=D||A||X;return o_({deleteKeyCode:a,multiSelectionKeyCode:x}),d.jsx(l_,{onPaneContextMenu:i,elementsSelectable:m,zoomOnScroll:y,zoomOnPinch:g,panOnScroll:Y,panOnScrollSpeed:E,panOnScrollMode:C,zoomOnDoubleClick:j,panOnDrag:!D&&V,defaultViewport:L,translateExtent:F,minZoom:I,maxZoom:R,zoomActivationKeyCode:S,preventScrolling:B,noWheelClassName:$,noPanClassName:N,onViewportChange:k,isControlledViewport:_,paneClickDistance:l,selectionOnDrag:X,children:d.jsxs(d_,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:V,isSelecting:!!K,selectionMode:c,selectionKeyPressed:D,paneClickDistance:l,selectionOnDrag:X,children:[e,T&&d.jsx(__,{onSelectionContextMenu:b,noPanClassName:N,disableKeyboardA11y:M})]})})}Mm.displayName="FlowRenderer";const E_=z.memo(Mm),N_=e=>t=>e?nc(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 j_(e){return re(z.useCallback(N_(e),[e]),ge)}const b_=e=>e.updateNodeInternals;function M_(){const e=re(b_),[t]=z.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return z.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function P_({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=me(),i=z.useRef(null),s=z.useRef(null),l=z.useRef(e.sourcePosition),a=z.useRef(e.targetPosition),u=z.useRef(t),p=n&&!!e.internals.handleBounds;return z.useEffect(()=>{i.current&&!e.hidden&&(!p||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[p,e.hidden]),z.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),z.useEffect(()=>{if(i.current){const c=u.current!==t,f=l.current!==e.sourcePosition,h=a.current!==e.targetPosition;(c||f||h)&&(u.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function T_({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:p,resizeObserver:c,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:x,rfId:w,nodeTypes:S,nodeClickDistance:m,onError:y}){const{node:g,internals:v,isParent:E}=re(H=>{const G=H.nodeLookup.get(e),te=H.parentLookup.has(e);return{node:G,internals:G.internals,isParent:te}},ge);let C=g.type||"default",j=(S==null?void 0:S[C])||Mf[C];j===void 0&&(y==null||y("003",bt.error003(C)),C="default",j=(S==null?void 0:S.default)||Mf.default);const P=!!(g.draggable||l&&typeof g.draggable>"u"),L=!!(g.selectable||a&&typeof g.selectable>"u"),F=!!(g.connectable||u&&typeof g.connectable>"u"),I=!!(g.focusable||p&&typeof g.focusable>"u"),R=me(),B=Ug(g),b=P_({node:g,nodeType:C,hasDimensions:B,resizeObserver:c}),$=Nm({nodeRef:b,disabled:g.hidden||!P,noDragClassName:f,handleSelector:g.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:m}),N=jm();if(g.hidden)return null;const M=Yt(g),k=S_(g),_=L||P||t||n||r||o,T=n?H=>n(H,{...v.userNode}):void 0,A=r?H=>r(H,{...v.userNode}):void 0,D=o?H=>o(H,{...v.userNode}):void 0,W=i?H=>i(H,{...v.userNode}):void 0,V=s?H=>s(H,{...v.userNode}):void 0,Y=H=>{const{selectNodesOnDrag:G,nodeDragThreshold:te}=R.getState();L&&(!G||!P||te>0)&&Ka({id:e,store:R,nodeRef:b}),t&&t(H,{...v.userNode})},X=H=>{if(!(Kg(H.nativeEvent)||x)){if($g.includes(H.key)&&L){const G=H.key==="Escape";Ka({id:e,store:R,unselect:G,nodeRef:b})}else if(P&&g.selected&&Object.prototype.hasOwnProperty.call(ks,H.key)){H.preventDefault();const{ariaLabelConfig:G}=R.getState();R.setState({ariaLiveMessage:G["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~v.positionAbsolute.x,y:~~v.positionAbsolute.y})}),N({direction:ks[H.key],factor:H.shiftKey?4:1})}}},K=()=>{var se;if(x||!((se=b.current)!=null&&se.matches(":focus-visible")))return;const{transform:H,width:G,height:te,autoPanOnNodeFocus:J,setCenter:q}=R.getState();if(!J)return;nc(new Map([[e,g]]),{x:0,y:0,width:G,height:te},H,!0).length>0||q(g.position.x+M.width/2,g.position.y+M.height/2,{zoom:H[2]})};return d.jsx("div",{className:Ce(["react-flow__node",`react-flow__node-${C}`,{[h]:P},g.className,{selected:g.selected,selectable:L,parent:E,draggable:P,dragging:$}]),ref:b,style:{zIndex:v.z,transform:`translate(${v.positionAbsolute.x}px,${v.positionAbsolute.y}px)`,pointerEvents:_?"all":"none",visibility:B?"visible":"hidden",...g.style,...k},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:T,onMouseMove:A,onMouseLeave:D,onContextMenu:W,onClick:Y,onDoubleClick:V,onKeyDown:I?X:void 0,tabIndex:I?0:void 0,onFocus:I?K:void 0,role:g.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${xm}-${w}`,"aria-label":g.ariaLabel,...g.domAttributes,children:d.jsx(p_,{value:e,children:d.jsx(j,{id:e,data:g.data,type:C,positionAbsoluteX:v.positionAbsolute.x,positionAbsoluteY:v.positionAbsolute.y,selected:g.selected??!1,selectable:L,draggable:P,deletable:g.deletable??!0,isConnectable:F,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:$,dragHandle:g.dragHandle,zIndex:v.z,parentId:g.parentId,...M})})})}var z_=z.memo(T_);const I_=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Pm(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:i}=re(I_,ge),s=j_(e.onlyRenderVisibleElements),l=M_();return d.jsx("div",{className:"react-flow__nodes",style:Zs,children:s.map(a=>d.jsx(z_,{id:a,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:o,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}Pm.displayName="NodeRenderer";const L_=z.memo(Pm);function R_(e){return re(z.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&w2({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),ge)}const $_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return d.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},D_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return d.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Tf={[vs.Arrow]:$_,[vs.ArrowClosed]:D_};function A_(e){const t=me();return z.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Tf,e)?Tf[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",bt.error009(e)),null)},[e])}const F_=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const a=A_(t);return a?d.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:d.jsx(a,{color:n,strokeWidth:s})}):null},Tm=({defaultColor:e,rfId:t})=>{const n=re(i=>i.edges),r=re(i=>i.defaultEdgeOptions),o=z.useMemo(()=>j2(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?d.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:d.jsx("defs",{children:o.map(i=>d.jsx(F_,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Tm.displayName="MarkerDefinitions";var B_=z.memo(Tm);function zm({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...p}){const[c,f]=z.useState({x:1,y:0,width:0,height:0}),h=Ce(["react-flow__edge-textwrapper",u]),x=z.useRef(null);return z.useEffect(()=>{if(x.current){const w=x.current.getBBox();f({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?d.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:h,visibility:c.width?"visible":"hidden",...p,children:[o&&d.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),d.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:x,style:r,children:n}),a]}):null}zm.displayName="EdgeText";const O_=z.memo(zm);function qs({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:u=20,...p}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{...p,d:e,fill:"none",className:Ce(["react-flow__edge-path",p.className])}),u?d.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&>(t)&>(n)?d.jsx(O_,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function zf({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===Q.Left||e===Q.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Im({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:o,targetPosition:i=Q.Top}){const[s,l]=zf({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=zf({pos:i,x1:r,y1:o,x2:e,y2:t}),[p,c,f,h]=Gg({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,p,c,f,h]}function Lm(e){return z.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:a,labelStyle:u,labelShowBg:p,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:x,markerEnd:w,markerStart:S,interactionWidth:m})=>{const[y,g,v]=Im({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),E=e.isInternal?void 0:t;return d.jsx(qs,{id:E,path:y,labelX:g,labelY:v,label:a,labelStyle:u,labelShowBg:p,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:x,markerEnd:w,markerStart:S,interactionWidth:m})})}const H_=Lm({isInternal:!1}),Rm=Lm({isInternal:!0});H_.displayName="SimpleBezierEdge";Rm.displayName="SimpleBezierEdgeInternal";function $m(e){return z.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:c,style:f,sourcePosition:h=Q.Bottom,targetPosition:x=Q.Top,markerEnd:w,markerStart:S,pathOptions:m,interactionWidth:y})=>{const[g,v,E]=Wa({sourceX:n,sourceY:r,sourcePosition:h,targetX:o,targetY:i,targetPosition:x,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),C=e.isInternal?void 0:t;return d.jsx(qs,{id:C,path:g,labelX:v,labelY:E,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:c,style:f,markerEnd:w,markerStart:S,interactionWidth:y})})}const Dm=$m({isInternal:!1}),Am=$m({isInternal:!0});Dm.displayName="SmoothStepEdge";Am.displayName="SmoothStepEdgeInternal";function Fm(e){return z.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return d.jsx(Dm,{...n,id:r,pathOptions:z.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const V_=Fm({isInternal:!1}),Bm=Fm({isInternal:!0});V_.displayName="StepEdge";Bm.displayName="StepEdgeInternal";function Om(e){return z.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:c,style:f,markerEnd:h,markerStart:x,interactionWidth:w})=>{const[S,m,y]=em({sourceX:n,sourceY:r,targetX:o,targetY:i}),g=e.isInternal?void 0:t;return d.jsx(qs,{id:g,path:S,labelX:m,labelY:y,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:c,style:f,markerEnd:h,markerStart:x,interactionWidth:w})})}const W_=Om({isInternal:!1}),Hm=Om({isInternal:!0});W_.displayName="StraightEdge";Hm.displayName="StraightEdgeInternal";function Vm(e){return z.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=Q.Bottom,targetPosition:l=Q.Top,label:a,labelStyle:u,labelShowBg:p,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:x,markerEnd:w,markerStart:S,pathOptions:m,interactionWidth:y})=>{const[g,v,E]=Zg({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:m==null?void 0:m.curvature}),C=e.isInternal?void 0:t;return d.jsx(qs,{id:C,path:g,labelX:v,labelY:E,label:a,labelStyle:u,labelShowBg:p,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:x,markerEnd:w,markerStart:S,interactionWidth:y})})}const U_=Vm({isInternal:!1}),Wm=Vm({isInternal:!0});U_.displayName="BezierEdge";Wm.displayName="BezierEdgeInternal";const If={default:Wm,straight:Hm,step:Bm,smoothstep:Am,simplebezier:Rm},Lf={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Y_=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,X_=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,Rf="react-flow__edgeupdater";function $f({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return d.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Ce([Rf,`${Rf}-${l}`]),cx:Y_(t,r,e),cy:X_(n,r,e),r,stroke:"transparent",fill:"transparent"})}function K_({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:p,onReconnectEnd:c,setReconnecting:f,setUpdateHover:h}){const x=me(),w=(v,E)=>{if(v.button!==0)return;const{autoPanOnConnect:C,domNode:j,isValidConnection:P,connectionMode:L,connectionRadius:F,lib:I,onConnectStart:R,onConnectEnd:B,cancelConnection:b,nodeLookup:$,rfId:N,panBy:M,updateConnection:k}=x.getState(),_=E.type==="target",T=(W,V)=>{f(!1),c==null||c(W,n,E.type,V)},A=W=>u==null?void 0:u(n,W),D=(W,V)=>{f(!0),p==null||p(v,n,E.type),R==null||R(W,V)};Xa.onPointerDown(v.nativeEvent,{autoPanOnConnect:C,connectionMode:L,connectionRadius:F,domNode:j,handleId:E.id,nodeId:E.nodeId,nodeLookup:$,isTarget:_,edgeUpdaterType:E.type,lib:I,flowId:N,cancelConnection:b,panBy:M,isValidConnection:P,onConnect:A,onConnectStart:D,onConnectEnd:B,onReconnectEnd:T,updateConnection:k,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:v.currentTarget})},S=v=>w(v,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=v=>w(v,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>h(!0),g=()=>h(!1);return d.jsxs(d.Fragment,{children:[(e===!0||e==="source")&&d.jsx($f,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:S,onMouseEnter:y,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&d.jsx($f,{position:a,centerX:i,centerY:s,radius:t,onMouseDown:m,onMouseEnter:y,onMouseOut:g,type:"target"})]})}function Q_({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:p,onReconnect:c,onReconnectStart:f,onReconnectEnd:h,rfId:x,edgeTypes:w,noPanClassName:S,onError:m,disableKeyboardA11y:y}){let g=re(q=>q.edgeLookup.get(e));const v=re(q=>q.defaultEdgeOptions);g=v?{...v,...g}:g;let E=g.type||"default",C=(w==null?void 0:w[E])||If[E];C===void 0&&(m==null||m("011",bt.error011(E)),E="default",C=(w==null?void 0:w.default)||If.default);const j=!!(g.focusable||t&&typeof g.focusable>"u"),P=typeof c<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),L=!!(g.selectable||r&&typeof g.selectable>"u"),F=z.useRef(null),[I,R]=z.useState(!1),[B,b]=z.useState(!1),$=me(),{zIndex:N,sourceX:M,sourceY:k,targetX:_,targetY:T,sourcePosition:A,targetPosition:D}=re(z.useCallback(q=>{const Z=q.nodeLookup.get(g.source),se=q.nodeLookup.get(g.target);if(!Z||!se)return{zIndex:g.zIndex,...Lf};const de=N2({id:e,sourceNode:Z,targetNode:se,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:q.connectionMode,onError:m});return{zIndex:v2({selected:g.selected,zIndex:g.zIndex,sourceNode:Z,targetNode:se,elevateOnSelect:q.elevateEdgesOnSelect,zIndexMode:q.zIndexMode}),...de||Lf}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),ge),W=z.useMemo(()=>g.markerStart?`url('#${Ua(g.markerStart,x)}')`:void 0,[g.markerStart,x]),V=z.useMemo(()=>g.markerEnd?`url('#${Ua(g.markerEnd,x)}')`:void 0,[g.markerEnd,x]);if(g.hidden||M===null||k===null||_===null||T===null)return null;const Y=q=>{var ie;const{addSelectedEdges:Z,unselectNodesAndEdges:se,multiSelectionActive:de}=$.getState();L&&($.setState({nodesSelectionActive:!1}),g.selected&&de?(se({nodes:[],edges:[g]}),(ie=F.current)==null||ie.blur()):Z([e])),o&&o(q,g)},X=i?q=>{i(q,{...g})}:void 0,K=s?q=>{s(q,{...g})}:void 0,H=l?q=>{l(q,{...g})}:void 0,G=a?q=>{a(q,{...g})}:void 0,te=u?q=>{u(q,{...g})}:void 0,J=q=>{var Z;if(!y&&$g.includes(q.key)&&L){const{unselectNodesAndEdges:se,addSelectedEdges:de}=$.getState();q.key==="Escape"?((Z=F.current)==null||Z.blur(),se({edges:[g]})):de([e])}};return d.jsx("svg",{style:{zIndex:N},children:d.jsxs("g",{className:Ce(["react-flow__edge",`react-flow__edge-${E}`,g.className,S,{selected:g.selected,animated:g.animated,inactive:!L&&!o,updating:I,selectable:L}]),onClick:Y,onDoubleClick:X,onContextMenu:K,onMouseEnter:H,onMouseMove:G,onMouseLeave:te,onKeyDown:j?J:void 0,tabIndex:j?0:void 0,role:g.ariaRole??(j?"group":"img"),"aria-roledescription":"edge","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":j?`${vm}-${x}`:void 0,ref:F,...g.domAttributes,children:[!B&&d.jsx(C,{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:M,sourceY:k,targetX:_,targetY:T,sourcePosition:A,targetPosition:D,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:W,markerEnd:V,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),P&&d.jsx(K_,{edge:g,isReconnectable:P,reconnectRadius:p,onReconnect:c,onReconnectStart:f,onReconnectEnd:h,sourceX:M,sourceY:k,targetX:_,targetY:T,sourcePosition:A,targetPosition:D,setUpdateHover:R,setReconnecting:b})]})})}var G_=z.memo(Q_);const Z_=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Um({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:p,reconnectRadius:c,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:x,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:m,elementsSelectable:y,onError:g}=re(Z_,ge),v=R_(t);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(B_,{defaultColor:e,rfId:n}),v.map(E=>d.jsx(G_,{id:E,edgesFocusable:S,edgesReconnectable:m,elementsSelectable:y,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:p,reconnectRadius:c,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:x,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:w},E))]})}Um.displayName="EdgeRenderer";const q_=z.memo(Um),J_=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function eC({children:e}){const t=re(J_);return d.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function tC(e){const t=cc(),n=z.useRef(!1);z.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const nC=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function rC(e){const t=re(nC),n=me();return z.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function oC(e){return e.connection.inProgress?{...e.connection,to:Xo(e.connection.to,e.transform)}:{...e.connection}}function iC(e){return oC}function sC(e){const t=iC();return re(t,ge)}const lC=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function aC({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:a}=re(lC,ge);return!(i&&o&&a)?null:d.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:Ce(["react-flow__connection",Fg(l)]),children:d.jsx(Ym,{style:t,type:n,CustomComponent:r,isValid:l})})})}const Ym=({style:e,type:t=Lt.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:l,fromPosition:a,to:u,toNode:p,toHandle:c,toPosition:f,pointer:h}=sC();if(!o)return;if(n)return d.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:f,connectionStatus:Fg(r),toNode:p,toHandle:c,pointer:h});let x="";const w={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Lt.Bezier:[x]=Zg(w);break;case Lt.SimpleBezier:[x]=Im(w);break;case Lt.Step:[x]=Wa({...w,borderRadius:0});break;case Lt.SmoothStep:[x]=Wa(w);break;default:[x]=em(w)}return d.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Ym.displayName="ConnectionLine";const uC={};function Df(e=uC){z.useRef(e),me(),z.useEffect(()=>{},[e])}function cC(){me(),z.useRef(!1),z.useEffect(()=>{},[])}function Xm({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:p,onSelectionContextMenu:c,onSelectionStart:f,onSelectionEnd:h,connectionLineType:x,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:m,selectionKeyCode:y,selectionOnDrag:g,selectionMode:v,multiSelectionKeyCode:E,panActivationKeyCode:C,zoomActivationKeyCode:j,deleteKeyCode:P,onlyRenderVisibleElements:L,elementsSelectable:F,defaultViewport:I,translateExtent:R,minZoom:B,maxZoom:b,preventScrolling:$,defaultMarkerColor:N,zoomOnScroll:M,zoomOnPinch:k,panOnScroll:_,panOnScrollSpeed:T,panOnScrollMode:A,zoomOnDoubleClick:D,panOnDrag:W,onPaneClick:V,onPaneMouseEnter:Y,onPaneMouseMove:X,onPaneMouseLeave:K,onPaneScroll:H,onPaneContextMenu:G,paneClickDistance:te,nodeClickDistance:J,onEdgeContextMenu:q,onEdgeMouseEnter:Z,onEdgeMouseMove:se,onEdgeMouseLeave:de,reconnectRadius:ie,onReconnect:Ie,onReconnectStart:Xt,onReconnectEnd:Pt,noDragClassName:yn,noWheelClassName:Ir,noPanClassName:Lr,disableKeyboardA11y:Rr,nodeExtent:Js,rfId:Qo,viewport:Hn,onViewportChange:$r}){return Df(e),Df(t),cC(),tC(n),rC(Hn),d.jsx(E_,{onPaneClick:V,onPaneMouseEnter:Y,onPaneMouseMove:X,onPaneMouseLeave:K,onPaneContextMenu:G,onPaneScroll:H,paneClickDistance:te,deleteKeyCode:P,selectionKeyCode:y,selectionOnDrag:g,selectionMode:v,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:E,panActivationKeyCode:C,zoomActivationKeyCode:j,elementsSelectable:F,zoomOnScroll:M,zoomOnPinch:k,zoomOnDoubleClick:D,panOnScroll:_,panOnScrollSpeed:T,panOnScrollMode:A,panOnDrag:W,defaultViewport:I,translateExtent:R,minZoom:B,maxZoom:b,onSelectionContextMenu:c,preventScrolling:$,noDragClassName:yn,noWheelClassName:Ir,noPanClassName:Lr,disableKeyboardA11y:Rr,onViewportChange:$r,isControlledViewport:!!Hn,children:d.jsxs(eC,{children:[d.jsx(q_,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:Ie,onReconnectStart:Xt,onReconnectEnd:Pt,onlyRenderVisibleElements:L,onEdgeContextMenu:q,onEdgeMouseEnter:Z,onEdgeMouseMove:se,onEdgeMouseLeave:de,reconnectRadius:ie,defaultMarkerColor:N,noPanClassName:Lr,disableKeyboardA11y:Rr,rfId:Qo}),d.jsx(aC,{style:w,type:x,component:S,containerStyle:m}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(L_,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:p,nodeClickDistance:J,onlyRenderVisibleElements:L,noPanClassName:Lr,noDragClassName:yn,disableKeyboardA11y:Rr,nodeExtent:Js,rfId:Qo}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}Xm.displayName="GraphView";const dC=z.memo(Xm),Af=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a=.5,maxZoom:u=2,nodeOrigin:p,nodeExtent:c,zIndexMode:f="basic"}={})=>{const h=new Map,x=new Map,w=new Map,S=new Map,m=r??t??[],y=n??e??[],g=p??[0,0],v=c??zo;rm(w,S,m);const E=Ya(y,h,x,{nodeOrigin:g,nodeExtent:v,zIndexMode:f});let C=[0,0,1];if(s&&o&&i){const j=Uo(h,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:P,y:L,zoom:F}=rc(j,o,i,a,u,(l==null?void 0:l.padding)??.1);C=[P,L,F]}return{rfId:"1",width:o??0,height:i??0,transform:C,nodes:y,nodesInitialized:E,nodeLookup:h,parentLookup:x,edges:m,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:u,translateExtent:zo,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:_r.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:l,fitViewResolver:null,connection:{...Ag},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:p2,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Dg,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},fC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:p,nodeExtent:c,zIndexMode:f})=>Pk((h,x)=>{async function w(){const{nodeLookup:S,panZoom:m,fitViewOptions:y,fitViewResolver:g,width:v,height:E,minZoom:C,maxZoom:j}=x();m&&(await d2({nodes:S,width:v,height:E,panZoom:m,minZoom:C,maxZoom:j},y),g==null||g.resolve(!0),h({fitViewResolver:null}))}return{...Af({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:p,nodeExtent:c,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:S=>{const{nodeLookup:m,parentLookup:y,nodeOrigin:g,elevateNodesOnSelect:v,fitViewQueued:E,zIndexMode:C}=x(),j=Ya(S,m,y,{nodeOrigin:g,nodeExtent:c,elevateNodesOnSelect:v,checkEquality:!0,zIndexMode:C});E&&j?(w(),h({nodes:S,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0})):h({nodes:S,nodesInitialized:j})},setEdges:S=>{const{connectionLookup:m,edgeLookup:y}=x();rm(m,y,S),h({edges:S})},setDefaultNodesAndEdges:(S,m)=>{if(S){const{setNodes:y}=x();y(S),h({hasDefaultNodes:!0})}if(m){const{setEdges:y}=x();y(m),h({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:m,nodeLookup:y,parentLookup:g,domNode:v,nodeOrigin:E,nodeExtent:C,debug:j,fitViewQueued:P,zIndexMode:L}=x(),{changes:F,updatedInternals:I}=L2(S,y,g,v,E,C,L);I&&(P2(y,g,{nodeOrigin:E,nodeExtent:C,zIndexMode:L}),P?(w(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),(F==null?void 0:F.length)>0&&(j&&console.log("React Flow: trigger node changes",F),m==null||m(F)))},updateNodePositions:(S,m=!1)=>{const y=[];let g=[];const{nodeLookup:v,triggerNodeChanges:E,connection:C,updateConnection:j,onNodesChangeMiddlewareMap:P}=x();for(const[L,F]of S){const I=v.get(L),R=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(F!=null&&F.position)),B={id:L,type:"position",position:R?{x:Math.max(0,F.position.x),y:Math.max(0,F.position.y)}:F.position,dragging:m};if(I&&C.inProgress&&C.fromNode.id===I.id){const b=An(I,C.fromHandle,Q.Left,!0);j({...C,from:b})}R&&I.parentId&&y.push({id:L,parentId:I.parentId,rect:{...F.internals.positionAbsolute,width:F.measured.width??0,height:F.measured.height??0}}),g.push(B)}if(y.length>0){const{parentLookup:L,nodeOrigin:F}=x(),I=uc(y,v,L,F);g.push(...I)}for(const L of P.values())g=L(g);E(g)},triggerNodeChanges:S=>{const{onNodesChange:m,setNodes:y,nodes:g,hasDefaultNodes:v,debug:E}=x();if(S!=null&&S.length){if(v){const C=km(S,g);y(C)}E&&console.log("React Flow: trigger node changes",S),m==null||m(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:m,setEdges:y,edges:g,hasDefaultEdges:v,debug:E}=x();if(S!=null&&S.length){if(v){const C=_m(S,g);y(C)}E&&console.log("React Flow: trigger edge changes",S),m==null||m(S)}},addSelectedNodes:S=>{const{multiSelectionActive:m,edgeLookup:y,nodeLookup:g,triggerNodeChanges:v,triggerEdgeChanges:E}=x();if(m){const C=S.map(j=>wn(j,!0));v(C);return}v(ir(g,new Set([...S]),!0)),E(ir(y))},addSelectedEdges:S=>{const{multiSelectionActive:m,edgeLookup:y,nodeLookup:g,triggerNodeChanges:v,triggerEdgeChanges:E}=x();if(m){const C=S.map(j=>wn(j,!0));E(C);return}E(ir(y,new Set([...S]))),v(ir(g,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:m}={})=>{const{edges:y,nodes:g,nodeLookup:v,triggerNodeChanges:E,triggerEdgeChanges:C}=x(),j=S||g,P=m||y,L=j.map(I=>{const R=v.get(I.id);return R&&(R.selected=!1),wn(I.id,!1)}),F=P.map(I=>wn(I.id,!1));E(L),C(F)},setMinZoom:S=>{const{panZoom:m,maxZoom:y}=x();m==null||m.setScaleExtent([S,y]),h({minZoom:S})},setMaxZoom:S=>{const{panZoom:m,minZoom:y}=x();m==null||m.setScaleExtent([y,S]),h({maxZoom:S})},setTranslateExtent:S=>{var m;(m=x().panZoom)==null||m.setTranslateExtent(S),h({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:m,triggerNodeChanges:y,triggerEdgeChanges:g,elementsSelectable:v}=x();if(!v)return;const E=m.reduce((j,P)=>P.selected?[...j,wn(P.id,!1)]:j,[]),C=S.reduce((j,P)=>P.selected?[...j,wn(P.id,!1)]:j,[]);y(E),g(C)},setNodeExtent:S=>{const{nodes:m,nodeLookup:y,parentLookup:g,nodeOrigin:v,elevateNodesOnSelect:E,nodeExtent:C,zIndexMode:j}=x();S[0][0]===C[0][0]&&S[0][1]===C[0][1]&&S[1][0]===C[1][0]&&S[1][1]===C[1][1]||(Ya(m,y,g,{nodeOrigin:v,nodeExtent:S,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:j}),h({nodeExtent:S}))},panBy:S=>{const{transform:m,width:y,height:g,panZoom:v,translateExtent:E}=x();return R2({delta:S,panZoom:v,transform:m,translateExtent:E,width:y,height:g})},setCenter:async(S,m,y)=>{const{width:g,height:v,maxZoom:E,panZoom:C}=x();if(!C)return Promise.resolve(!1);const j=typeof(y==null?void 0:y.zoom)<"u"?y.zoom:E;return await C.setViewport({x:g/2-S*j,y:v/2-m*j,zoom:j},{duration:y==null?void 0:y.duration,ease:y==null?void 0:y.ease,interpolate:y==null?void 0:y.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...Ag}})},updateConnection:S=>{h({connection:S})},reset:()=>h({...Af()})}},Object.is);function pC({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:a,fitView:u,nodeOrigin:p,nodeExtent:c,zIndexMode:f,children:h}){const[x]=z.useState(()=>fC({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:l,fitViewOptions:a,nodeOrigin:p,nodeExtent:c,zIndexMode:f}));return d.jsx(Tk,{value:x,children:d.jsx(e_,{children:h})})}function hC({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:a,minZoom:u,maxZoom:p,nodeOrigin:c,nodeExtent:f,zIndexMode:h}){return z.useContext(Gs)?d.jsx(d.Fragment,{children:e}):d.jsx(pC,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:a,initialMinZoom:u,initialMaxZoom:p,nodeOrigin:c,nodeExtent:f,zIndexMode:h,children:e})}const gC={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function mC({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:p,onMoveStart:c,onMoveEnd:f,onConnect:h,onConnectStart:x,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:m,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:E,onNodeDoubleClick:C,onNodeDragStart:j,onNodeDrag:P,onNodeDragStop:L,onNodesDelete:F,onEdgesDelete:I,onDelete:R,onSelectionChange:B,onSelectionDragStart:b,onSelectionDrag:$,onSelectionDragStop:N,onSelectionContextMenu:M,onSelectionStart:k,onSelectionEnd:_,onBeforeDelete:T,connectionMode:A,connectionLineType:D=Lt.Bezier,connectionLineStyle:W,connectionLineComponent:V,connectionLineContainerStyle:Y,deleteKeyCode:X="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:H=!1,selectionMode:G=Io.Full,panActivationKeyCode:te="Space",multiSelectionKeyCode:J=Ro()?"Meta":"Control",zoomActivationKeyCode:q=Ro()?"Meta":"Control",snapToGrid:Z,snapGrid:se,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:ie,nodesDraggable:Ie,autoPanOnNodeFocus:Xt,nodesConnectable:Pt,nodesFocusable:yn,nodeOrigin:Ir=wm,edgesFocusable:Lr,edgesReconnectable:Rr,elementsSelectable:Js=!0,defaultViewport:Qo=Wk,minZoom:Hn=.5,maxZoom:$r=2,translateExtent:vc=zo,preventScrolling:Jm=!0,nodeExtent:el,defaultMarkerColor:e0="#b1b1b7",zoomOnScroll:t0=!0,zoomOnPinch:n0=!0,panOnScroll:r0=!1,panOnScrollSpeed:o0=.5,panOnScrollMode:i0=bn.Free,zoomOnDoubleClick:s0=!0,panOnDrag:l0=!0,onPaneClick:a0,onPaneMouseEnter:u0,onPaneMouseMove:c0,onPaneMouseLeave:d0,onPaneScroll:f0,onPaneContextMenu:p0,paneClickDistance:h0=1,nodeClickDistance:g0=0,children:m0,onReconnect:y0,onReconnectStart:x0,onReconnectEnd:v0,onEdgeContextMenu:w0,onEdgeDoubleClick:S0,onEdgeMouseEnter:k0,onEdgeMouseMove:_0,onEdgeMouseLeave:C0,reconnectRadius:E0=10,onNodesChange:N0,onEdgesChange:j0,noDragClassName:b0="nodrag",noWheelClassName:M0="nowheel",noPanClassName:wc="nopan",fitView:Sc,fitViewOptions:kc,connectOnClick:P0,attributionPosition:T0,proOptions:z0,defaultEdgeOptions:I0,elevateNodesOnSelect:L0=!0,elevateEdgesOnSelect:R0=!1,disableKeyboardA11y:_c=!1,autoPanOnConnect:$0,autoPanOnNodeDrag:D0,autoPanSpeed:A0,connectionRadius:F0,isValidConnection:B0,onError:O0,style:H0,id:Cc,nodeDragThreshold:V0,connectionDragThreshold:W0,viewport:U0,onViewportChange:Y0,width:X0,height:K0,colorMode:Q0="light",debug:G0,onScroll:Go,ariaLabelConfig:Z0,zIndexMode:Ec="basic",...q0},J0){const tl=Cc||"1",ey=Kk(Q0),ty=z.useCallback(Nc=>{Nc.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Go==null||Go(Nc)},[Go]);return d.jsx("div",{"data-testid":"rf__wrapper",...q0,onScroll:ty,style:{...H0,...gC},ref:J0,className:Ce(["react-flow",o,ey]),id:Cc,role:"application",children:d.jsxs(hC,{nodes:e,edges:t,width:X0,height:K0,fitView:Sc,fitViewOptions:kc,minZoom:Hn,maxZoom:$r,nodeOrigin:Ir,nodeExtent:el,zIndexMode:Ec,children:[d.jsx(dC,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:E,onNodeDoubleClick:C,nodeTypes:i,edgeTypes:s,connectionLineType:D,connectionLineStyle:W,connectionLineComponent:V,connectionLineContainerStyle:Y,selectionKeyCode:K,selectionOnDrag:H,selectionMode:G,deleteKeyCode:X,multiSelectionKeyCode:J,panActivationKeyCode:te,zoomActivationKeyCode:q,onlyRenderVisibleElements:de,defaultViewport:Qo,translateExtent:vc,minZoom:Hn,maxZoom:$r,preventScrolling:Jm,zoomOnScroll:t0,zoomOnPinch:n0,zoomOnDoubleClick:s0,panOnScroll:r0,panOnScrollSpeed:o0,panOnScrollMode:i0,panOnDrag:l0,onPaneClick:a0,onPaneMouseEnter:u0,onPaneMouseMove:c0,onPaneMouseLeave:d0,onPaneScroll:f0,onPaneContextMenu:p0,paneClickDistance:h0,nodeClickDistance:g0,onSelectionContextMenu:M,onSelectionStart:k,onSelectionEnd:_,onReconnect:y0,onReconnectStart:x0,onReconnectEnd:v0,onEdgeContextMenu:w0,onEdgeDoubleClick:S0,onEdgeMouseEnter:k0,onEdgeMouseMove:_0,onEdgeMouseLeave:C0,reconnectRadius:E0,defaultMarkerColor:e0,noDragClassName:b0,noWheelClassName:M0,noPanClassName:wc,rfId:tl,disableKeyboardA11y:_c,nodeExtent:el,viewport:U0,onViewportChange:Y0}),d.jsx(Xk,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:x,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:m,nodesDraggable:Ie,autoPanOnNodeFocus:Xt,nodesConnectable:Pt,nodesFocusable:yn,edgesFocusable:Lr,edgesReconnectable:Rr,elementsSelectable:Js,elevateNodesOnSelect:L0,elevateEdgesOnSelect:R0,minZoom:Hn,maxZoom:$r,nodeExtent:el,onNodesChange:N0,onEdgesChange:j0,snapToGrid:Z,snapGrid:se,connectionMode:A,translateExtent:vc,connectOnClick:P0,defaultEdgeOptions:I0,fitView:Sc,fitViewOptions:kc,onNodesDelete:F,onEdgesDelete:I,onDelete:R,onNodeDragStart:j,onNodeDrag:P,onNodeDragStop:L,onSelectionDrag:$,onSelectionDragStart:b,onSelectionDragStop:N,onMove:p,onMoveStart:c,onMoveEnd:f,noPanClassName:wc,nodeOrigin:Ir,rfId:tl,autoPanOnConnect:$0,autoPanOnNodeDrag:D0,autoPanSpeed:A0,onError:O0,connectionRadius:F0,isValidConnection:B0,selectNodesOnDrag:ie,nodeDragThreshold:V0,connectionDragThreshold:W0,onBeforeDelete:T,debug:G0,ariaLabelConfig:Z0,zIndexMode:Ec}),d.jsx(Vk,{onSelectionChange:B}),m0,d.jsx(Ak,{proOptions:z0,position:T0}),d.jsx(Dk,{rfId:tl,disableKeyboardA11y:_c})]})})}var yC=Cm(mC);function xC(e){const[t,n]=z.useState(e),r=z.useCallback(o=>n(i=>km(o,i)),[]);return[t,n,r]}function vC(e){const[t,n]=z.useState(e),r=z.useCallback(o=>n(i=>_m(o,i)),[]);return[t,n,r]}function wC({dimensions:e,lineWidth:t,variant:n,className:r}){return d.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ce(["react-flow__background-pattern",n,r])})}function SC({radius:e,className:t}){return d.jsx("circle",{cx:e,cy:e,r:e,className:Ce(["react-flow__background-pattern","dots",t])})}var Ft;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ft||(Ft={}));const kC={[Ft.Dots]:1,[Ft.Lines]:1,[Ft.Cross]:6},_C=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Km({id:e,variant:t=Ft.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:l,style:a,className:u,patternClassName:p}){const c=z.useRef(null),{transform:f,patternId:h}=re(_C,ge),x=r||kC[t],w=t===Ft.Dots,S=t===Ft.Cross,m=Array.isArray(n)?n:[n,n],y=[m[0]*f[2]||1,m[1]*f[2]||1],g=x*f[2],v=Array.isArray(i)?i:[i,i],E=S?[g,g]:y,C=[v[0]*f[2]||1+E[0]/2,v[1]*f[2]||1+E[1]/2],j=`${h}${e||""}`;return d.jsxs("svg",{className:Ce(["react-flow__background",u]),style:{...a,...Zs,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[d.jsx("pattern",{id:j,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:w?d.jsx(SC,{radius:g/2,className:p}):d.jsx(wC,{dimensions:E,lineWidth:o,variant:t,className:p})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j})`})]})}Km.displayName="Background";const CC=z.memo(Km);function EC(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:d.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function NC(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:d.jsx("path",{d:"M0 0h32v4.2H0z"})})}function jC(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:d.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 bC(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 MC(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 ki({children:e,className:t,...n}){return d.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const PC=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Qm({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:p,position:c="bottom-left",orientation:f="vertical","aria-label":h}){const x=me(),{isInteractive:w,minZoomReached:S,maxZoomReached:m,ariaLabelConfig:y}=re(PC,ge),{zoomIn:g,zoomOut:v,fitView:E}=cc(),C=()=>{g(),i==null||i()},j=()=>{v(),s==null||s()},P=()=>{E(o),l==null||l()},L=()=>{x.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),a==null||a(!w)},F=f==="horizontal"?"horizontal":"vertical";return d.jsxs(Mr,{className:Ce(["react-flow__controls",F,u]),position:c,style:e,"data-testid":"rf__controls","aria-label":h??y["controls.ariaLabel"],children:[t&&d.jsxs(d.Fragment,{children:[d.jsx(ki,{onClick:C,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:m,children:d.jsx(EC,{})}),d.jsx(ki,{onClick:j,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:S,children:d.jsx(NC,{})})]}),n&&d.jsx(ki,{className:"react-flow__controls-fitview",onClick:P,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:d.jsx(jC,{})}),r&&d.jsx(ki,{className:"react-flow__controls-interactive",onClick:L,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:w?d.jsx(MC,{}):d.jsx(bC,{})}),p]})}Qm.displayName="Controls";const TC=z.memo(Qm);function zC({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:a,className:u,borderRadius:p,shapeRendering:c,selected:f,onClick:h}){const{background:x,backgroundColor:w}=i||{},S=s||x||w;return d.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:p,ry:p,width:r,height:o,style:{fill:S,stroke:l,strokeWidth:a},shapeRendering:c,onClick:h?m=>h(m,e):void 0})}const IC=z.memo(zC),LC=e=>e.nodes.map(t=>t.id),Dl=e=>e instanceof Function?e:()=>e;function RC({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=IC,onClick:s}){const l=re(LC,ge),a=Dl(t),u=Dl(e),p=Dl(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:l.map(f=>d.jsx(DC,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:c},f))})}function $C({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:a}){const{node:u,x:p,y:c,width:f,height:h}=re(x=>{const{internals:w}=x.nodeLookup.get(e),S=w.userNode,{x:m,y}=w.positionAbsolute,{width:g,height:v}=Yt(S);return{node:S,x:m,y,width:g,height:v}},ge);return!u||u.hidden||!Ug(u)?null:d.jsx(l,{x:p,y:c,width:f,height:h,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:a,id:u.id})}const DC=z.memo($C);var AC=z.memo(RC);const FC=200,BC=150,OC=e=>!e.hidden,HC=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?Wg(Uo(e.nodeLookup,{filter:OC}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},VC="react-flow__minimap-desc";function Gm({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:p,maskStrokeWidth:c,position:f="bottom-right",onClick:h,onNodeClick:x,pannable:w=!1,zoomable:S=!1,ariaLabel:m,inversePan:y,zoomStep:g=1,offsetScale:v=5}){const E=me(),C=z.useRef(null),{boundingRect:j,viewBB:P,rfId:L,panZoom:F,translateExtent:I,flowWidth:R,flowHeight:B,ariaLabelConfig:b}=re(HC,ge),$=(e==null?void 0:e.width)??FC,N=(e==null?void 0:e.height)??BC,M=j.width/$,k=j.height/N,_=Math.max(M,k),T=_*$,A=_*N,D=v*_,W=j.x-(T-j.width)/2-D,V=j.y-(A-j.height)/2-D,Y=T+D*2,X=A+D*2,K=`${VC}-${L}`,H=z.useRef(0),G=z.useRef();H.current=_,z.useEffect(()=>{if(C.current&&F)return G.current=W2({domNode:C.current,panZoom:F,getTransform:()=>E.getState().transform,getViewScale:()=>H.current}),()=>{var Z;(Z=G.current)==null||Z.destroy()}},[F]),z.useEffect(()=>{var Z;(Z=G.current)==null||Z.update({translateExtent:I,width:R,height:B,inversePan:y,pannable:w,zoomStep:g,zoomable:S})},[w,S,y,g,I,R,B]);const te=h?Z=>{var ie;const[se,de]=((ie=G.current)==null?void 0:ie.pointer(Z))||[0,0];h(Z,{x:se,y:de})}:void 0,J=x?z.useCallback((Z,se)=>{const de=E.getState().nodeLookup.get(se).internals.userNode;x(Z,de)},[]):void 0,q=m??b["minimap.ariaLabel"];return d.jsx(Mr,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*_: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=="number"?s:void 0},className:Ce(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:$,height:N,viewBox:`${W} ${V} ${Y} ${X}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":K,ref:C,onClick:te,children:[q&&d.jsx("title",{id:K,children:q}),d.jsx(AC,{onClick:J,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-D},${V-D}h${Y+D*2}v${X+D*2}h${-Y-D*2}z
|
|
62
|
+
M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Gm.displayName="MiniMap";const WC=z.memo(Gm),UC=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,YC={[jr.Line]:"right",[jr.Handle]:"bottom-right"};function XC({nodeId:e,position:t,variant:n=jr.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:l=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:f,autoScale:h=!0,shouldResize:x,onResizeStart:w,onResize:S,onResizeEnd:m}){const y=bm(),g=typeof e=="string"?e:y,v=me(),E=z.useRef(null),C=n===jr.Handle,j=re(z.useCallback(UC(C&&h),[C,h]),ge),P=z.useRef(null),L=t??YC[n];z.useEffect(()=>{if(!(!E.current||!g))return P.current||(P.current=ok({domNode:E.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:I,transform:R,snapGrid:B,snapToGrid:b,nodeOrigin:$,domNode:N}=v.getState();return{nodeLookup:I,transform:R,snapGrid:B,snapToGrid:b,nodeOrigin:$,paneDomNode:N}},onChange:(I,R)=>{const{triggerNodeChanges:B,nodeLookup:b,parentLookup:$,nodeOrigin:N}=v.getState(),M=[],k={x:I.x,y:I.y},_=b.get(g);if(_&&_.expandParent&&_.parentId){const T=_.origin??N,A=I.width??_.measured.width??0,D=I.height??_.measured.height??0,W={id:_.id,parentId:_.parentId,rect:{width:A,height:D,...Yg({x:I.x??_.position.x,y:I.y??_.position.y},{width:A,height:D},_.parentId,b,T)}},V=uc([W],b,$,N);M.push(...V),k.x=I.x?Math.max(T[0]*A,I.x):void 0,k.y=I.y?Math.max(T[1]*D,I.y):void 0}if(k.x!==void 0&&k.y!==void 0){const T={id:g,type:"position",position:{...k}};M.push(T)}if(I.width!==void 0&&I.height!==void 0){const A={id:g,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};M.push(A)}for(const T of R){const A={...T,type:"position"};M.push(A)}B(M)},onEnd:({width:I,height:R})=>{const B={id:g,type:"dimensions",resizing:!1,dimensions:{width:I,height:R}};v.getState().triggerNodeChanges([B])}})),P.current.update({controlPosition:L,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:p},keepAspectRatio:c,resizeDirection:f,onResizeStart:w,onResize:S,onResizeEnd:m,shouldResize:x}),()=>{var I;(I=P.current)==null||I.destroy()}},[L,l,a,u,p,c,w,S,m,x]);const F=L.split("-");return d.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...F,n,r]),ref:E,style:{...o,scale:j,...s&&{[C?"backgroundColor":"borderColor"]:s}},children:i})}z.memo(XC);var Al=280,Fl=200,Bl=350,Ol=80,Ff=350,Bf=-80,KC=100;function Qa(e,t){var p,c;const{onChange:n,onDelete:r,startPosition:o={x:50,y:200},idPrefix:i="",parentId:s}=t??{},l=[...e].sort((f,h)=>f.order-h.order),a=[];let u=o.x;o.y;for(const f of l){const h=i?`${i}${f.id}`:f.id,x={step:f,label:f.name||Zm(f.type),onChange:n,onDelete:r},w={id:h,type:f.type,position:{x:u,y:o.y},data:x,draggable:!0,selectable:!0};if(s&&(w.parentId=s),a.push(w),console.log(`[flowStepsToNodes] Placed "${f.name}" (${f.type}) at x=${u}`),f.type==="conditional"&&f.config){const S=f.config,m=u+Ff,y=((p=S.trueSteps)==null?void 0:p.length)||0,g=((c=S.falseSteps)==null?void 0:c.length)||0,v=Math.max(y,g),E=y*(Fl+Ol);if(S.trueSteps&&S.trueSteps.length>0){const C=o.y+Bf,j=Qa(S.trueSteps,{onChange:n,onDelete:r,startPosition:{x:m,y:C},idPrefix:`${h}-true-`,parentId:h});a.push(...j)}if(S.falseSteps&&S.falseSteps.length>0){const C=y>0?o.y+Bf+E+KC:o.y+Fl+Ol,j=Qa(S.falseSteps,{onChange:n,onDelete:r,startPosition:{x:m,y:C},idPrefix:`${h}-false-`,parentId:h});a.push(...j),S.falseSteps.length*(Fl+Ol)}if(v>0){const C=Ff+v*(Al+Bl);console.log(`[flowStepsToNodes] Conditional "${f.name}" has ${v} branch steps, advancing currentX by ${C}`),u+=C,console.log(`[flowStepsToNodes] After conditional, currentX = ${u}`)}else u+=Al+Bl}else u+=Al+Bl}return a}function QC(e){return[...e.filter(r=>!r.parentId&&!r.id.includes("-true-")&&!r.id.includes("-false-"))].sort((r,o)=>r.position.x-o.position.x).map((r,o)=>{const i=r.data.step;if(i.type==="conditional"){const s=Of(e,r.id,"true"),l=Of(e,r.id,"false");return{...i,order:o,config:{...i.config,trueSteps:s,falseSteps:l}}}return{...i,order:o}})}function Of(e,t,n){const r=`${t}-${n}-`;return[...e.filter(s=>s.id.startsWith(r))].sort((s,l)=>s.position.x-l.position.x).map((s,l)=>({...s.data.step,order:l}))}function GC(e){const t=[],n=i=>i.parentId||i.id.includes("-true-")||i.id.includes("-false-"),r=e.filter(i=>!n(i)).sort((i,s)=>i.position.x-s.position.x);for(let i=0;i<r.length-1;i++){const s=r[i],l=r[i+1];s.data.step.type!=="conditional"&&t.push({id:`edge-${s.id}-${l.id}`,source:s.id,target:l.id,sourceHandle:"output",type:"smoothstep",animated:!1,data:{stepOrder:i}})}const o=e.filter(i=>i.data.step.type==="conditional"&&!n(i));for(const i of o){const s=i.id,l=r.findIndex(c=>c.id===s),a=l<r.length-1?r[l+1]:null,u=e.filter(c=>c.id.startsWith(`${s}-true-`)).sort((c,f)=>c.position.x-f.position.x),p=e.filter(c=>c.id.startsWith(`${s}-false-`)).sort((c,f)=>c.position.x-f.position.x);if(u.length>0){t.push({id:`edge-${s}-to-true-branch`,source:s,target:u[0].id,sourceHandle:"true",type:"smoothstep",animated:!1,label:"True",labelStyle:{fill:"#22c55e",fontWeight:600,fontSize:11},labelBgStyle:{fill:"#f0fdf4",fillOpacity:.9},labelBgPadding:[4,6],labelBgBorderRadius:4,style:{stroke:"#22c55e",strokeWidth:2}});for(let c=0;c<u.length-1;c++)t.push({id:`edge-true-${u[c].id}-${u[c+1].id}`,source:u[c].id,target:u[c+1].id,sourceHandle:"output",type:"smoothstep",animated:!1,style:{stroke:"#22c55e",strokeWidth:1.5}});if(a){const c=u[u.length-1];t.push({id:`edge-true-${c.id}-to-${a.id}`,source:c.id,target:a.id,sourceHandle:"output",type:"smoothstep",animated:!1,style:{stroke:"#22c55e",strokeWidth:1.5}})}}else a&&t.push({id:`edge-${s}-true-to-${a.id}`,source:s,target:a.id,sourceHandle:"true",type:"smoothstep",animated:!1,label:"True",labelStyle:{fill:"#22c55e",fontWeight:600,fontSize:11},labelBgStyle:{fill:"#f0fdf4",fillOpacity:.9},labelBgPadding:[4,6],labelBgBorderRadius:4,style:{stroke:"#22c55e",strokeWidth:2}});if(p.length>0){t.push({id:`edge-${s}-to-false-branch`,source:s,target:p[0].id,sourceHandle:"false",type:"smoothstep",animated:!1,label:"False",labelStyle:{fill:"#ef4444",fontWeight:600,fontSize:11},labelBgStyle:{fill:"#fef2f2",fillOpacity:.9},labelBgPadding:[4,6],labelBgBorderRadius:4,style:{stroke:"#ef4444",strokeWidth:2}});for(let c=0;c<p.length-1;c++)t.push({id:`edge-false-${p[c].id}-${p[c+1].id}`,source:p[c].id,target:p[c+1].id,sourceHandle:"output",type:"smoothstep",animated:!1,style:{stroke:"#ef4444",strokeWidth:1.5}});if(a){const c=p[p.length-1];t.push({id:`edge-false-${c.id}-to-${a.id}`,source:c.id,target:a.id,sourceHandle:"output",type:"smoothstep",animated:!1,style:{stroke:"#ef4444",strokeWidth:1.5}})}}else a&&t.push({id:`edge-${s}-false-to-${a.id}`,source:s,target:a.id,sourceHandle:"false",type:"smoothstep",animated:!1,label:"False",labelStyle:{fill:"#ef4444",fontWeight:600,fontSize:11},labelBgStyle:{fill:"#fef2f2",fillOpacity:.9},labelBgPadding:[4,6],labelBgBorderRadius:4,style:{stroke:"#ef4444",strokeWidth:2}});u.length===0&&p.length===0&&a&&t.push({id:`edge-${s}-to-${a.id}`,source:s,target:a.id,sourceHandle:"output",type:"smoothstep",animated:!1})}return t}function Zm(e){return{prompt:"AI Prompt","fetch-url":"Fetch URL","retrieve-record":"Retrieve Record","fetch-github":"Fetch GitHub","api-call":"API Call","transform-data":"Transform Data",conditional:"Conditional","set-variable":"Set Variable","upsert-record":"Upsert Record","send-email":"Send Email","send-text":"Send Text","send-event":"Send Event","send-stream":"Send Stream","update-record":"Update Record",search:"Search","generate-embedding":"Generate Embedding","vector-search":"Vector Search","tool-call":"Tool Call","wait-until":"Wait Until"}[e]||e}function ZC(e,t=0){const r={id:`step-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,type:e,name:Zm(e),order:t,enabled:!0};switch(e){case"prompt":return{...r,config:{mode:"instruction",model:"",userPrompt:"",responseFormat:"text",outputVariable:`${e}_result`}};case"fetch-url":return{...r,config:{http:{url:"",method:"GET"},responseType:"json",outputVariable:"fetch_result"}};case"transform-data":return{...r,config:{script:`// Transform your data here
|
|
63
|
+
return { result: input }`,outputVariable:"transform_result"}};case"conditional":return{...r,config:{condition:"true",trueSteps:[],falseSteps:[]}};case"send-email":return{...r,config:{from:"no-reply@messages.runtype.com",to:"",subject:"",html:"",outputVariable:"email_result"}};default:return{...r,config:{outputVariable:`${e.replace(/-/g,"_")}_result`}}}}var He={container:e=>({minWidth:"280px",maxWidth:"320px",backgroundColor:"#ffffff",borderRadius:"12px",border:e?"2px solid #6366f1":"1px solid #e5e7eb",boxShadow:e?"0 0 0 2px rgba(99, 102, 241, 0.2), 0 4px 6px -1px rgba(0, 0, 0, 0.1)":"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",overflow:"hidden",transition:"border-color 0.15s ease, box-shadow 0.15s ease"}),header:e=>({display:"flex",alignItems:"center",gap:"8px",padding:"10px 12px",backgroundColor:e,borderBottom:"1px solid rgba(0, 0, 0, 0.05)"}),iconWrapper:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"6px",backgroundColor:"rgba(255, 255, 255, 0.9)",color:"#374151"},headerContent:{flex:1,minWidth:0},typeLabel:{fontSize:"10px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"rgba(0, 0, 0, 0.5)",marginBottom:"2px"},stepName:{fontSize:"13px",fontWeight:600,color:"#1f2937",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},body:{padding:"12px"},handle:{width:"12px",height:"12px",borderRadius:"50%",border:"2px solid #ffffff"},targetHandle:{backgroundColor:"#6366f1"},sourceHandle:{backgroundColor:"#10b981"},deleteButton:{padding:"4px",borderRadius:"4px",backgroundColor:"transparent",border:"none",cursor:"pointer",color:"#9ca3af",display:"flex",alignItems:"center",justifyContent:"center",transition:"color 0.15s ease, background-color 0.15s ease"},enabledBadge:e=>({display:"inline-flex",alignItems:"center",padding:"2px 6px",borderRadius:"4px",fontSize:"10px",fontWeight:500,backgroundColor:e?"rgba(16, 185, 129, 0.1)":"rgba(239, 68, 68, 0.1)",color:e?"#059669":"#dc2626"})},Fn={prompt:"#f3e8ff","fetch-url":"#dbeafe","transform-data":"#fef3c7",conditional:"#fce7f3","send-email":"#d1fae5",default:"#f3f4f6"},Ko=z.memo(function({data:t,selected:n=!1,id:r,typeLabel:o,icon:i,headerColor:s,showSourceHandle:l=!0,showTargetHandle:a=!0,additionalSourceHandles:u,children:p}){const{step:c,onChange:f,onDelete:h}=t,x=s||Fn[c.type]||Fn.default,w=S=>{S.stopPropagation(),h==null||h(r)};return d.jsxs("div",{style:He.container(n),children:[a&&d.jsx(Mn,{type:"target",position:Q.Left,style:{...He.handle,...He.targetHandle}}),d.jsxs("div",{style:He.header(x),children:[d.jsx("div",{style:He.iconWrapper,children:i}),d.jsxs("div",{style:He.headerContent,children:[d.jsx("div",{style:He.typeLabel,children:o}),d.jsx("div",{style:He.stepName,title:c.name,children:c.name||"Untitled Step"})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[d.jsx("span",{style:He.enabledBadge(c.enabled),children:c.enabled?"Active":"Disabled"}),h&&d.jsx("button",{style:He.deleteButton,onClick:w,title:"Delete step",onMouseEnter:S=>{S.currentTarget.style.backgroundColor="rgba(239, 68, 68, 0.1)",S.currentTarget.style.color="#dc2626"},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent",S.currentTarget.style.color="#9ca3af"},children:d.jsx(qC,{})})]})]}),d.jsx("div",{style:He.body,className:"nodrag",children:p}),l&&d.jsx(Mn,{type:"source",position:Q.Right,id:"output",style:{...He.handle,...He.sourceHandle}}),u==null?void 0:u.map(S=>d.jsx(Mn,{type:"source",position:S.position,id:S.id,style:{...He.handle,backgroundColor:S.color||"#10b981",...S.style}},S.id))]})}),qC=()=>d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M3 6h18"}),d.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),d.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),JC=()=>d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}),d.jsx("path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"}),d.jsx("path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"}),d.jsx("path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375"}),d.jsx("path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}),d.jsx("path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}),d.jsx("path",{d:"M19.938 10.5a4 4 0 0 1 .585.396"}),d.jsx("path",{d:"M6 18a4 4 0 0 1-1.967-.516"}),d.jsx("path",{d:"M19.967 17.484A4 4 0 0 1 18 18"})]}),eE=()=>d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),d.jsx("path",{d:"M2 12h20"})]}),tE=()=>d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("polyline",{points:"16 18 22 12 16 6"}),d.jsx("polyline",{points:"8 6 2 12 8 18"})]}),nE=()=>d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),d.jsx("circle",{cx:"18",cy:"6",r:"3"}),d.jsx("circle",{cx:"6",cy:"18",r:"3"}),d.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),rE=()=>d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),d.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]}),ue={field:{marginBottom:"12px"},label:{display:"block",fontSize:"11px",fontWeight:600,color:"#6b7280",marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.03em"},input:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},textarea:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",resize:"vertical",minHeight:"60px",fontFamily:"inherit",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},select:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",cursor:"pointer"},row:{display:"flex",gap:"8px"},modeBadge:e=>({display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"12px",fontSize:"10px",fontWeight:600,backgroundColor:e?"#dbeafe":"#f3e8ff",color:e?"#1d4ed8":"#7c3aed",textTransform:"uppercase",letterSpacing:"0.05em"}),preview:{fontSize:"11px",color:"#6b7280",backgroundColor:"#f3f4f6",padding:"8px",borderRadius:"6px",fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:"80px",overflow:"auto"}},oE=z.memo(function(t){const{data:n,selected:r,id:o}=t,{step:i,onChange:s}=n,l=i.config,[a,u]=z.useState(!1),p=z.useCallback((h,x)=>{s==null||s(o,{config:{...l,[h]:x}})},[o,l,s]),c=z.useCallback(h=>{s==null||s(o,{name:h.target.value})},[o,s]),f=l.mode==="agent";return d.jsxs(Ko,{data:n,selected:r,id:o,typeLabel:"AI Prompt",icon:d.jsx(JC,{}),headerColor:Fn.prompt,children:[d.jsxs("div",{style:ue.field,children:[d.jsx("label",{style:ue.label,children:"Step Name"}),d.jsx("input",{style:ue.input,value:i.name,onChange:c,placeholder:"Enter step name",onKeyDown:h=>h.stopPropagation(),onFocus:h=>{h.target.style.borderColor="#6366f1",h.target.style.boxShadow="0 0 0 2px rgba(99, 102, 241, 0.1)"},onBlur:h=>{h.target.style.borderColor="#e5e7eb",h.target.style.boxShadow="none"}})]}),d.jsxs("div",{style:ue.field,children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[d.jsx("label",{style:ue.label,children:"Mode"}),d.jsx("span",{style:ue.modeBadge(f),children:f?"Agent":"Instruction"})]}),d.jsxs("select",{style:ue.select,value:l.mode||"instruction",onChange:h=>p("mode",h.target.value),onKeyDown:h=>h.stopPropagation(),children:[d.jsx("option",{value:"instruction",children:"Instruction Mode"}),d.jsx("option",{value:"agent",children:"Agent Mode"})]})]}),d.jsxs("div",{style:ue.field,children:[d.jsx("label",{style:ue.label,children:"Model"}),d.jsx("input",{style:ue.input,value:l.model||"",onChange:h=>p("model",h.target.value),placeholder:"e.g., gpt-4, claude-3-sonnet",onKeyDown:h=>h.stopPropagation()})]}),d.jsxs("div",{style:ue.field,children:[d.jsx("label",{style:ue.label,children:"User Prompt"}),d.jsx("textarea",{style:ue.textarea,value:l.userPrompt||"",onChange:h=>p("userPrompt",h.target.value),placeholder:"Enter your prompt...",rows:3,onKeyDown:h=>h.stopPropagation()})]}),a&&d.jsxs(d.Fragment,{children:[l.systemPrompt!==void 0&&d.jsxs("div",{style:ue.field,children:[d.jsx("label",{style:ue.label,children:"System Prompt"}),d.jsx("textarea",{style:ue.textarea,value:l.systemPrompt||"",onChange:h=>p("systemPrompt",h.target.value),placeholder:"System instructions...",rows:2,onKeyDown:h=>h.stopPropagation()})]}),d.jsxs("div",{style:ue.row,children:[d.jsxs("div",{style:{...ue.field,flex:1},children:[d.jsx("label",{style:ue.label,children:"Response Format"}),d.jsxs("select",{style:ue.select,value:l.responseFormat||"text",onChange:h=>p("responseFormat",h.target.value),onKeyDown:h=>h.stopPropagation(),children:[d.jsx("option",{value:"text",children:"Text"}),d.jsx("option",{value:"json",children:"JSON"}),d.jsx("option",{value:"markdown",children:"Markdown"}),d.jsx("option",{value:"html",children:"HTML"})]})]}),d.jsxs("div",{style:{...ue.field,flex:1},children:[d.jsx("label",{style:ue.label,children:"Temperature"}),d.jsx("input",{style:ue.input,type:"number",min:"0",max:"2",step:"0.1",value:l.temperature??.7,onChange:h=>p("temperature",parseFloat(h.target.value)),onKeyDown:h=>h.stopPropagation()})]})]}),d.jsxs("div",{style:ue.field,children:[d.jsx("label",{style:ue.label,children:"Output Variable"}),d.jsx("input",{style:ue.input,value:l.outputVariable||"",onChange:h=>p("outputVariable",h.target.value),placeholder:"result",onKeyDown:h=>h.stopPropagation()})]})]}),d.jsx("button",{onClick:()=>u(!a),style:{width:"100%",padding:"6px",fontSize:"11px",color:"#6366f1",backgroundColor:"transparent",border:"1px dashed #e5e7eb",borderRadius:"6px",cursor:"pointer",marginTop:"4px"},children:a?"Show Less":"Show More Options"})]})}),ae={field:{marginBottom:"12px"},label:{display:"block",fontSize:"11px",fontWeight:600,color:"#6b7280",marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.03em"},input:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},textarea:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",resize:"vertical",minHeight:"60px",fontFamily:"monospace",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},select:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",cursor:"pointer"},row:{display:"flex",gap:"8px"},methodBadge:e=>{const t={GET:{bg:"#d1fae5",text:"#059669"},POST:{bg:"#dbeafe",text:"#1d4ed8"},PUT:{bg:"#fef3c7",text:"#d97706"},DELETE:{bg:"#fee2e2",text:"#dc2626"},PATCH:{bg:"#e0e7ff",text:"#4f46e5"}},n=t[e]||t.GET;return{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"10px",fontWeight:700,backgroundColor:n.bg,color:n.text,fontFamily:"monospace"}},urlPreview:{fontSize:"11px",color:"#6b7280",backgroundColor:"#f3f4f6",padding:"6px 8px",borderRadius:"4px",fontFamily:"monospace",wordBreak:"break-all",marginTop:"4px"}},iE=z.memo(function(t){var h,x,w,S,m;const{data:n,selected:r,id:o}=t,{step:i,onChange:s}=n,l=i.config,[a,u]=z.useState(!1),p=z.useCallback((y,g)=>{if(y.startsWith("http.")){const v=y.replace("http.","");s==null||s(o,{config:{...l,http:{...l.http,[v]:g}}})}else s==null||s(o,{config:{...l,[y]:g}})},[o,l,s]),c=z.useCallback(y=>{s==null||s(o,{name:y.target.value})},[o,s]),f=((h=l.http)==null?void 0:h.method)||"GET";return d.jsxs(Ko,{data:n,selected:r,id:o,typeLabel:"Fetch URL",icon:d.jsx(eE,{}),headerColor:Fn["fetch-url"],children:[d.jsxs("div",{style:ae.field,children:[d.jsx("label",{style:ae.label,children:"Step Name"}),d.jsx("input",{style:ae.input,value:i.name,onChange:c,placeholder:"Enter step name",onKeyDown:y=>{y.stopPropagation()}})]}),d.jsxs("div",{style:ae.field,children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[d.jsx("label",{style:ae.label,children:"Method"}),d.jsx("span",{style:ae.methodBadge(f),children:f})]}),d.jsxs("select",{style:ae.select,value:f,onChange:y=>p("http.method",y.target.value),onKeyDown:y=>y.stopPropagation(),children:[d.jsx("option",{value:"GET",children:"GET"}),d.jsx("option",{value:"POST",children:"POST"}),d.jsx("option",{value:"PUT",children:"PUT"}),d.jsx("option",{value:"DELETE",children:"DELETE"}),d.jsx("option",{value:"PATCH",children:"PATCH"})]})]}),d.jsxs("div",{style:ae.field,children:[d.jsx("label",{style:ae.label,children:"URL"}),d.jsx("input",{style:ae.input,value:((x=l.http)==null?void 0:x.url)||"",onChange:y=>p("http.url",y.target.value),placeholder:"https://api.example.com/endpoint",onKeyDown:y=>y.stopPropagation()}),((w=l.http)==null?void 0:w.url)&&d.jsx("div",{style:ae.urlPreview,children:l.http.url})]}),a&&d.jsxs(d.Fragment,{children:[(f==="POST"||f==="PUT"||f==="PATCH")&&d.jsxs("div",{style:ae.field,children:[d.jsx("label",{style:ae.label,children:"Request Body"}),d.jsx("textarea",{style:ae.textarea,value:((S=l.http)==null?void 0:S.body)||"",onChange:y=>p("http.body",y.target.value),placeholder:'{"key": "value"}',rows:3,onKeyDown:y=>y.stopPropagation()})]}),d.jsxs("div",{style:ae.field,children:[d.jsx("label",{style:ae.label,children:"Headers (JSON)"}),d.jsx("textarea",{style:ae.textarea,value:(m=l.http)!=null&&m.headers?JSON.stringify(l.http.headers,null,2):"",onChange:y=>{try{const g=JSON.parse(y.target.value);p("http.headers",g)}catch{}},placeholder:'{"Content-Type": "application/json"}',rows:2,onKeyDown:y=>y.stopPropagation()})]}),d.jsxs("div",{style:ae.row,children:[d.jsxs("div",{style:{...ae.field,flex:1},children:[d.jsx("label",{style:ae.label,children:"Response Type"}),d.jsxs("select",{style:ae.select,value:l.responseType||"json",onChange:y=>p("responseType",y.target.value),onKeyDown:y=>y.stopPropagation(),children:[d.jsx("option",{value:"json",children:"JSON"}),d.jsx("option",{value:"text",children:"Text"}),d.jsx("option",{value:"xml",children:"XML"})]})]}),d.jsxs("div",{style:{...ae.field,flex:1},children:[d.jsx("label",{style:ae.label,children:"On Error"}),d.jsxs("select",{style:ae.select,value:l.errorHandling||"fail",onChange:y=>p("errorHandling",y.target.value),onKeyDown:y=>y.stopPropagation(),children:[d.jsx("option",{value:"fail",children:"Fail"}),d.jsx("option",{value:"continue",children:"Continue"}),d.jsx("option",{value:"default",children:"Use Default"})]})]})]}),d.jsxs("div",{style:ae.field,children:[d.jsx("label",{style:ae.label,children:"Output Variable"}),d.jsx("input",{style:ae.input,value:l.outputVariable||"",onChange:y=>p("outputVariable",y.target.value),placeholder:"api_response",onKeyDown:y=>y.stopPropagation()})]})]}),d.jsx("button",{onClick:()=>u(!a),style:{width:"100%",padding:"6px",fontSize:"11px",color:"#6366f1",backgroundColor:"transparent",border:"1px dashed #e5e7eb",borderRadius:"6px",cursor:"pointer",marginTop:"4px"},children:a?"Show Less":"Show More Options"})]})}),Se={field:{marginBottom:"12px"},label:{display:"block",fontSize:"11px",fontWeight:600,color:"#6b7280",marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.03em"},input:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},codeArea:{width:"100%",padding:"10px",fontSize:"11px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#1e1e1e",color:"#d4d4d4",outline:"none",resize:"vertical",minHeight:"100px",fontFamily:'"Fira Code", "Monaco", "Consolas", monospace',lineHeight:1.5,tabSize:2},select:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",cursor:"pointer"},row:{display:"flex",gap:"8px"},languageBadge:e=>{const t={javascript:{bg:"#fef3c7",text:"#d97706"},typescript:{bg:"#dbeafe",text:"#1d4ed8"},python:{bg:"#d1fae5",text:"#059669"}},n=t[e]||t.javascript;return{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"10px",fontWeight:600,backgroundColor:n.bg,color:n.text,textTransform:"capitalize"}},lineNumbers:{display:"flex",flexDirection:"column",alignItems:"flex-end",paddingRight:"8px",marginRight:"8px",borderRight:"1px solid #3f3f46",color:"#6b7280",fontSize:"11px",fontFamily:'"Fira Code", "Monaco", "Consolas", monospace',lineHeight:1.5,userSelect:"none"},codePreview:{fontSize:"10px",color:"#9ca3af",marginTop:"4px"}},sE=z.memo(function(t){const{data:n,selected:r,id:o}=t,{step:i,onChange:s}=n,l=i.config,[a,u]=z.useState(!1),p=z.useCallback((x,w)=>{s==null||s(o,{config:{...l,[x]:w}})},[o,l,s]),c=z.useCallback(x=>{s==null||s(o,{name:x.target.value})},[o,s]),f=l.language||"javascript",h=(l.script||"").split(`
|
|
64
|
+
`).length;return d.jsxs(Ko,{data:n,selected:r,id:o,typeLabel:"Run Code",icon:d.jsx(tE,{}),headerColor:Fn["transform-data"],children:[d.jsxs("div",{style:Se.field,children:[d.jsx("label",{style:Se.label,children:"Step Name"}),d.jsx("input",{style:Se.input,value:i.name,onChange:c,placeholder:"Enter step name",onKeyDown:x=>x.stopPropagation()})]}),d.jsxs("div",{style:Se.field,children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[d.jsx("label",{style:Se.label,children:"Code"}),d.jsx("span",{style:Se.languageBadge(f),children:f})]}),d.jsx("textarea",{style:Se.codeArea,value:l.script||"",onChange:x=>p("script",x.target.value),placeholder:`// Write your ${f} code here
|
|
65
|
+
return { result: input }`,spellCheck:!1,onKeyDown:x=>x.stopPropagation()}),d.jsxs("div",{style:Se.codePreview,children:[h," line",h!==1?"s":""]})]}),a&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:Se.row,children:[d.jsxs("div",{style:{...Se.field,flex:1},children:[d.jsx("label",{style:Se.label,children:"Language"}),d.jsxs("select",{style:Se.select,value:f,onChange:x=>p("language",x.target.value),onKeyDown:x=>x.stopPropagation(),children:[d.jsx("option",{value:"javascript",children:"JavaScript"}),d.jsx("option",{value:"typescript",children:"TypeScript"}),d.jsx("option",{value:"python",children:"Python"})]})]}),d.jsxs("div",{style:{...Se.field,flex:1},children:[d.jsx("label",{style:Se.label,children:"Sandbox"}),d.jsxs("select",{style:Se.select,value:l.sandboxProvider||"quickjs",onChange:x=>p("sandboxProvider",x.target.value),onKeyDown:x=>x.stopPropagation(),children:[d.jsx("option",{value:"quickjs",children:"QuickJS (Fast)"}),d.jsx("option",{value:"daytona",children:"Daytona (Full)"})]})]})]}),d.jsxs("div",{style:Se.field,children:[d.jsx("label",{style:Se.label,children:"On Error"}),d.jsxs("select",{style:Se.select,value:l.errorHandling||"fail",onChange:x=>p("errorHandling",x.target.value),onKeyDown:x=>x.stopPropagation(),children:[d.jsx("option",{value:"fail",children:"Fail"}),d.jsx("option",{value:"continue",children:"Continue"}),d.jsx("option",{value:"default",children:"Use Default"})]})]}),d.jsxs("div",{style:Se.field,children:[d.jsx("label",{style:Se.label,children:"Output Variable"}),d.jsx("input",{style:Se.input,value:l.outputVariable||"",onChange:x=>p("outputVariable",x.target.value),placeholder:"transform_result",onKeyDown:x=>x.stopPropagation()})]})]}),d.jsx("button",{onClick:()=>u(!a),style:{width:"100%",padding:"6px",fontSize:"11px",color:"#6366f1",backgroundColor:"transparent",border:"1px dashed #e5e7eb",borderRadius:"6px",cursor:"pointer",marginTop:"4px"},children:a?"Show Less":"Show More Options"})]})}),je={field:{marginBottom:"12px"},label:{display:"block",fontSize:"11px",fontWeight:600,color:"#6b7280",marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.03em"},input:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},conditionArea:{width:"100%",padding:"10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#fef7ee",color:"#92400e",outline:"none",resize:"vertical",minHeight:"60px",fontFamily:'"Fira Code", "Monaco", "Consolas", monospace',lineHeight:1.5},branchInfo:{display:"flex",gap:"12px",marginTop:"8px"},branchCard:e=>({flex:1,padding:"10px",borderRadius:"8px",backgroundColor:e==="true"?"#d1fae5":"#fee2e2",border:`1px solid ${e==="true"?"#a7f3d0":"#fecaca"}`}),branchLabel:e=>({fontSize:"10px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",color:e==="true"?"#059669":"#dc2626",marginBottom:"4px"}),branchCount:{fontSize:"18px",fontWeight:700,color:"#1f2937"},branchCountLabel:{fontSize:"10px",color:"#6b7280"},helpText:{fontSize:"10px",color:"#9ca3af",marginTop:"4px",fontStyle:"italic"}},lE=z.memo(function(t){var x,w;const{data:n,selected:r,id:o}=t,{step:i,onChange:s}=n,l=i.config,[a,u]=z.useState(!1),p=z.useCallback((S,m)=>{s==null||s(o,{config:{...l,[S]:m}})},[o,l,s]),c=z.useCallback(S=>{s==null||s(o,{name:S.target.value})},[o,s]),f=((x=l.trueSteps)==null?void 0:x.length)||0,h=((w=l.falseSteps)==null?void 0:w.length)||0;return d.jsxs(Ko,{data:n,selected:r,id:o,typeLabel:"Conditional",icon:d.jsx(nE,{}),headerColor:Fn.conditional,showSourceHandle:!1,additionalSourceHandles:[{id:"true",position:Q.Right,label:"True",color:"#22c55e",style:{top:"40%"}},{id:"false",position:Q.Right,label:"False",color:"#ef4444",style:{top:"60%"}}],children:[d.jsxs("div",{style:je.field,children:[d.jsx("label",{style:je.label,children:"Step Name"}),d.jsx("input",{style:je.input,value:i.name,onChange:c,placeholder:"Enter step name",onKeyDown:S=>S.stopPropagation()})]}),d.jsxs("div",{style:je.field,children:[d.jsx("label",{style:je.label,children:"Condition (JavaScript)"}),d.jsx("textarea",{style:je.conditionArea,value:l.condition||"",onChange:S=>p("condition",S.target.value),placeholder:"user_type === 'premium'",spellCheck:!1,onKeyDown:S=>S.stopPropagation()}),d.jsxs("div",{style:je.helpText,children:["Access variables directly: ",d.jsx("code",{children:"variable_name"}),", ",d.jsx("code",{children:"_record.metadata.field"})]})]}),d.jsxs("div",{style:je.branchInfo,children:[d.jsxs("div",{style:je.branchCard("true"),children:[d.jsxs("div",{style:je.branchLabel("true"),children:[d.jsx(aE,{})," True Branch"]}),d.jsx("div",{style:je.branchCount,children:f}),d.jsxs("div",{style:je.branchCountLabel,children:["step",f!==1?"s":""]})]}),d.jsxs("div",{style:je.branchCard("false"),children:[d.jsxs("div",{style:je.branchLabel("false"),children:[d.jsx(uE,{})," False Branch"]}),d.jsx("div",{style:je.branchCount,children:h}),d.jsxs("div",{style:je.branchCountLabel,children:["step",h!==1?"s":""]})]})]}),a&&d.jsx("div",{style:{marginTop:"12px"},children:d.jsxs("div",{style:je.field,children:[d.jsx("label",{style:je.label,children:"Condition Examples"}),d.jsxs("div",{style:{fontSize:"11px",color:"#6b7280",lineHeight:1.6},children:[d.jsxs("div",{children:[d.jsx("code",{children:"status === 'active'"})," - Check equality"]}),d.jsxs("div",{children:[d.jsxs("code",{children:["count ",">"," 10"]})," - Numeric comparison"]}),d.jsxs("div",{children:[d.jsxs("code",{children:["data && data.length ",">"," 0"]})," - Check array"]}),d.jsxs("div",{children:[d.jsx("code",{children:"_record.metadata.type === 'premium'"})," - API input"]})]})]})}),d.jsx("button",{onClick:()=>u(!a),style:{width:"100%",padding:"6px",fontSize:"11px",color:"#6366f1",backgroundColor:"transparent",border:"1px dashed #e5e7eb",borderRadius:"6px",cursor:"pointer",marginTop:"12px"},children:a?"Hide Examples":"Show Examples"})]})}),aE=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline",marginRight:"4px",verticalAlign:"middle"},children:d.jsx("polyline",{points:"20 6 9 17 4 12"})}),uE=()=>d.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline",marginRight:"4px",verticalAlign:"middle"},children:[d.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ee={field:{marginBottom:"12px"},label:{display:"block",fontSize:"11px",fontWeight:600,color:"#6b7280",marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.03em"},input:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},textarea:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",resize:"vertical",minHeight:"80px",fontFamily:"inherit",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},select:{width:"100%",padding:"8px 10px",fontSize:"12px",border:"1px solid #e5e7eb",borderRadius:"6px",backgroundColor:"#f9fafb",color:"#1f2937",outline:"none",cursor:"pointer"},row:{display:"flex",gap:"8px"},emailPreview:{backgroundColor:"#f8fafc",border:"1px solid #e2e8f0",borderRadius:"8px",padding:"10px",marginTop:"8px"},previewHeader:{fontSize:"10px",color:"#64748b",marginBottom:"4px"},previewValue:{fontSize:"12px",color:"#1e293b",fontWeight:500,marginBottom:"8px",wordBreak:"break-all"},variableHint:{display:"inline-flex",alignItems:"center",padding:"2px 6px",borderRadius:"4px",fontSize:"10px",backgroundColor:"#f0f9ff",color:"#0369a1",fontFamily:"monospace",marginRight:"4px",marginTop:"4px"}},cE=z.memo(function(t){const{data:n,selected:r,id:o}=t,{step:i,onChange:s}=n,l=i.config,[a,u]=z.useState(!1),p=z.useCallback((h,x)=>{s==null||s(o,{config:{...l,[h]:x}})},[o,l,s]),c=z.useCallback(h=>{s==null||s(o,{name:h.target.value})},[o,s]),f=h=>/\{\{[\w._]+\}\}/.test(h);return d.jsxs(Ko,{data:n,selected:r,id:o,typeLabel:"Send Email",icon:d.jsx(rE,{}),headerColor:Fn["send-email"],children:[d.jsxs("div",{style:ee.field,children:[d.jsx("label",{style:ee.label,children:"Step Name"}),d.jsx("input",{style:ee.input,value:i.name,onChange:c,placeholder:"Enter step name",onKeyDown:h=>h.stopPropagation()})]}),d.jsxs("div",{style:ee.field,children:[d.jsx("label",{style:ee.label,children:"To"}),d.jsx("input",{style:ee.input,value:l.to||"",onChange:h=>p("to",h.target.value),placeholder:"recipient@example.com or {{_record.metadata.email}}",onKeyDown:h=>h.stopPropagation()}),f(l.to||"")&&d.jsx("span",{style:ee.variableHint,children:"Uses variable"})]}),d.jsxs("div",{style:ee.field,children:[d.jsx("label",{style:ee.label,children:"Subject"}),d.jsx("input",{style:ee.input,value:l.subject||"",onChange:h=>p("subject",h.target.value),placeholder:"Your subject line",onKeyDown:h=>h.stopPropagation()})]}),d.jsxs("div",{style:ee.field,children:[d.jsx("label",{style:ee.label,children:"HTML Content"}),d.jsx("textarea",{style:ee.textarea,value:l.html||"",onChange:h=>p("html",h.target.value),placeholder:`<p>Your email content...</p>
|
|
66
|
+
|
|
67
|
+
Use {{variable}} for dynamic content`,rows:4,onKeyDown:h=>h.stopPropagation()})]}),a&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:ee.field,children:[d.jsx("label",{style:ee.label,children:"From"}),d.jsx("input",{style:ee.input,value:l.from||"",onChange:h=>p("from",h.target.value),placeholder:"no-reply@messages.runtype.com",onKeyDown:h=>h.stopPropagation()})]}),d.jsxs("div",{style:ee.row,children:[d.jsxs("div",{style:{...ee.field,flex:1},children:[d.jsx("label",{style:ee.label,children:"CC"}),d.jsx("input",{style:ee.input,value:l.cc||"",onChange:h=>p("cc",h.target.value),placeholder:"cc@example.com",onKeyDown:h=>h.stopPropagation()})]}),d.jsxs("div",{style:{...ee.field,flex:1},children:[d.jsx("label",{style:ee.label,children:"BCC"}),d.jsx("input",{style:ee.input,value:l.bcc||"",onChange:h=>p("bcc",h.target.value),placeholder:"bcc@example.com",onKeyDown:h=>h.stopPropagation()})]})]}),d.jsxs("div",{style:ee.field,children:[d.jsx("label",{style:ee.label,children:"Reply To"}),d.jsx("input",{style:ee.input,value:l.replyTo||"",onChange:h=>p("replyTo",h.target.value),placeholder:"reply@example.com",onKeyDown:h=>h.stopPropagation()})]}),d.jsxs("div",{style:ee.field,children:[d.jsx("label",{style:ee.label,children:"Plain Text (Fallback)"}),d.jsx("textarea",{style:ee.textarea,value:l.text||"",onChange:h=>p("text",h.target.value),placeholder:"Plain text version of your email...",rows:2,onKeyDown:h=>h.stopPropagation()})]}),d.jsxs("div",{style:ee.row,children:[d.jsxs("div",{style:{...ee.field,flex:1},children:[d.jsx("label",{style:ee.label,children:"On Error"}),d.jsxs("select",{style:ee.select,value:l.errorHandling||"fail",onChange:h=>p("errorHandling",h.target.value),onKeyDown:h=>h.stopPropagation(),children:[d.jsx("option",{value:"fail",children:"Fail"}),d.jsx("option",{value:"continue",children:"Continue"}),d.jsx("option",{value:"default",children:"Use Default"})]})]}),d.jsxs("div",{style:{...ee.field,flex:1},children:[d.jsx("label",{style:ee.label,children:"Output Variable"}),d.jsx("input",{style:ee.input,value:l.outputVariable||"",onChange:h=>p("outputVariable",h.target.value),placeholder:"email_result",onKeyDown:h=>h.stopPropagation()})]})]})]}),(l.to||l.subject)&&d.jsxs("div",{style:ee.emailPreview,children:[d.jsx("div",{style:ee.previewHeader,children:"Preview"}),l.to&&d.jsxs("div",{style:ee.previewValue,children:[d.jsx("strong",{children:"To:"})," ",l.to]}),l.subject&&d.jsxs("div",{style:ee.previewValue,children:[d.jsx("strong",{children:"Subject:"})," ",l.subject]})]}),d.jsx("button",{onClick:()=>u(!a),style:{width:"100%",padding:"6px",fontSize:"11px",color:"#6366f1",backgroundColor:"transparent",border:"1px dashed #e5e7eb",borderRadius:"6px",cursor:"pointer",marginTop:"8px"},children:a?"Show Less":"Show More Options"})]})});const Ga="http://localhost:8787/v1",Za="",dE=[{id:"step-1",type:"fetch-url",name:"Fetch User Data",order:0,enabled:!0,config:{http:{url:"https://api.example.com/users/{{userId}}",method:"GET"},responseType:"json",outputVariable:"user_data"}},{id:"step-2",type:"prompt",name:"Analyze User",order:1,enabled:!0,config:{mode:"instruction",model:"gpt-4",userPrompt:`Analyze the following user data and provide insights:
|
|
68
|
+
|
|
69
|
+
{{user_data}}`,responseFormat:"json",outputVariable:"analysis"}},{id:"step-3",type:"conditional",name:"Check Premium Status",order:2,enabled:!0,config:{condition:"user_data.subscription === 'premium'",trueSteps:[{id:"premium-insights",type:"prompt",name:"Generate Premium Insights",order:0,enabled:!0,config:{mode:"instruction",model:"gpt-4",userPrompt:`Generate detailed premium insights for {{user_data.name}} based on their usage patterns:
|
|
70
|
+
|
|
71
|
+
{{analysis}}`,responseFormat:"json",outputVariable:"premium_insights"}},{id:"premium-email",type:"send-email",name:"Send Premium Report",order:1,enabled:!0,config:{from:"premium@messages.runtype.com",to:"{{user_data.email}}",subject:"🌟 Your Premium Analytics Report",html:"<h1>Premium Report for {{user_data.name}}</h1><p>{{premium_insights.summary}}</p><h2>Advanced Metrics</h2><p>{{premium_insights.metrics}}</p>",outputVariable:"premium_email_result"}}],falseSteps:[{id:"upgrade-pitch",type:"prompt",name:"Generate Upgrade Pitch",order:0,enabled:!0,config:{mode:"instruction",model:"gpt-3.5-turbo",userPrompt:"Generate a friendly upgrade pitch for {{user_data.name}} highlighting premium benefits. Keep it short and compelling.",responseFormat:"text",outputVariable:"upgrade_pitch"}},{id:"log-activity",type:"fetch-url",name:"Log Free User Activity",order:1,enabled:!0,config:{http:{url:"https://api.example.com/analytics/free-users",method:"POST",body:JSON.stringify({userId:"{{user_data.id}}",action:"viewed_report",timestamp:"{{now}}"})},responseType:"json",outputVariable:"analytics_result"}},{id:"basic-email",type:"send-email",name:"Send Basic Report + Upsell",order:2,enabled:!0,config:{from:"no-reply@messages.runtype.com",to:"{{user_data.email}}",subject:"Your Report is Ready",html:'<h1>Hi {{user_data.name}}</h1><p>{{analysis.summary}}</p><hr><p>{{upgrade_pitch}}</p><a href="https://runtype.com/upgrade">Upgrade to Premium →</a>',outputVariable:"basic_email_result"}}]}},{id:"step-4",type:"send-email",name:"Send Report",order:3,enabled:!0,config:{from:"no-reply@messages.runtype.com",to:"{{user_data.email}}",subject:"Your Analysis Report",html:"<h1>Analysis</h1><p>{{analysis.summary}}</p>",outputVariable:"email_result"}}],fE={prompt:oE,"fetch-url":iE,"transform-data":sE,conditional:lE,"send-email":cE};function pE({isOpen:e,onClose:t,steps:n,flowName:r}){const[o,i]=z.useState("dispatch"),s=z.useMemo(()=>({record:{name:"example-record",type:"user_analysis",metadata:{userId:"12345",requestedAt:new Date().toISOString()}},flow:{name:r||"Untitled Flow",steps:n.map(l=>({type:l.type,name:l.name,order:l.order,enabled:l.enabled,config:l.config}))},options:{streamResponse:!0,recordMode:"virtual",flowMode:"virtual",storeResults:!1}}),[n,r]);return e?d.jsx("div",{style:pc,children:d.jsxs("div",{style:hc,children:[d.jsxs("div",{style:gc,children:[d.jsx("h2",{style:mc,children:"Runtype Dispatch Config"}),d.jsx("button",{style:yc,onClick:t,children:d.jsx(fc,{})})]}),d.jsxs("div",{style:$E,children:[d.jsx("button",{style:o==="dispatch"?Uf:Ja,onClick:()=>i("dispatch"),children:"Dispatch Request"}),d.jsxs("button",{style:o==="steps"?Uf:Ja,onClick:()=>i("steps"),children:["Flow Steps (",n.length,")"]})]}),d.jsx("div",{style:xc,children:o==="dispatch"?d.jsxs(d.Fragment,{children:[d.jsxs("p",{style:Yf,children:["This is the configuration that would be sent to the Runtype API via"," ",d.jsx("code",{style:DE,children:"POST /dispatch"})]}),d.jsx("div",{style:Bi,children:d.jsx("pre",{style:Oi,children:JSON.stringify(s,null,2)})}),d.jsxs("div",{style:AE,children:[d.jsx("h4",{style:FE,children:"Usage with @runtypelabs/sdk"}),d.jsx("div",{style:Bi,children:d.jsx("pre",{style:Oi,children:`import { createClient } from '@runtypelabs/sdk'
|
|
72
|
+
|
|
73
|
+
const client = createClient({ apiKey: 'your-api-key' })
|
|
74
|
+
|
|
75
|
+
// Execute the flow
|
|
76
|
+
const response = await client.dispatch.execute(${JSON.stringify(s,null,2).split(`
|
|
77
|
+
`).map((l,a)=>a===0?l:" "+l).join(`
|
|
78
|
+
`)})
|
|
79
|
+
|
|
80
|
+
console.log(response)`})})]})]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{style:Yf,children:"Individual step configurations in the flow:"}),n.map((l,a)=>d.jsxs("div",{style:BE,children:[d.jsxs("div",{style:OE,children:[d.jsx("span",{style:HE(l.type),children:l.type}),d.jsx("span",{style:VE,children:l.name}),d.jsxs("span",{style:WE,children:["#",a+1]})]}),d.jsx("div",{style:Bi,children:d.jsx("pre",{style:{...Oi,fontSize:"11px"},children:JSON.stringify(l.config,null,2)})})]},l.id))]})}),d.jsx("div",{style:qm,children:d.jsxs("button",{style:UE,onClick:()=>{navigator.clipboard.writeText(JSON.stringify(s,null,2))},children:[d.jsx(yE,{})," Copy Config"]})})]})}):null}function hE({isOpen:e,onClose:t,isRunning:n,flowProgress:r,onRunFlow:o}){if(!e)return null;const i=l=>{switch(l){case"running":return d.jsx(_s,{});case"completed":return d.jsx(Hf,{});case"failed":return d.jsx(Vf,{});default:return d.jsx(SE,{})}},s=l=>{switch(l){case"running":return"#3b82f6";case"completed":return"#22c55e";case"failed":return"#ef4444";default:return"#6b7280"}};return d.jsx("div",{style:pc,children:d.jsxs("div",{style:hc,children:[d.jsxs("div",{style:gc,children:[d.jsx("h2",{style:mc,children:"Flow Execution"}),d.jsx("button",{style:yc,onClick:t,children:d.jsx(fc,{})})]}),d.jsxs("div",{style:xc,children:[!r&&!n&&d.jsxs("div",{style:{textAlign:"center",padding:"40px 20px"},children:[d.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"🚀"}),d.jsx("h3",{style:{fontSize:"18px",fontWeight:600,color:"#cdd6f4",marginBottom:"8px"},children:"Ready to Execute"}),d.jsx("p",{style:{fontSize:"13px",color:"#a6adc8",marginBottom:"24px"},children:"Click the button below to run this flow using the Runtype API"}),d.jsxs("button",{style:Wf,onClick:o,disabled:n,children:[d.jsx(qa,{})," Run Flow"]})]}),(r||n)&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:bE,children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[n?d.jsx(_s,{}):r!=null&&r.isError?d.jsx(Vf,{}):d.jsx(Hf,{}),d.jsxs("div",{children:[d.jsx("div",{style:{fontSize:"14px",fontWeight:600,color:"#cdd6f4"},children:(r==null?void 0:r.flowName)||"Executing Flow..."}),d.jsx("div",{style:{fontSize:"12px",color:"#a6adc8"},children:n?`Step ${((r==null?void 0:r.currentStepIndex)??0)+1} of ${(r==null?void 0:r.totalSteps)||"?"}`:r!=null&&r.isError?"Execution failed":`Completed in ${(r==null?void 0:r.executionTime)||0}ms`})]})]}),!n&&d.jsxs("button",{style:{...Wf,padding:"8px 16px",fontSize:"12px"},onClick:o,children:[d.jsx(qa,{})," Run Again"]})]}),d.jsx("div",{style:{marginTop:"16px"},children:r==null?void 0:r.steps.map((l,a)=>d.jsxs("div",{style:ME,children:[d.jsxs("div",{style:PE,children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[d.jsx("span",{style:{color:s(l.status)},children:i(l.status)}),d.jsx("span",{style:{fontSize:"13px",fontWeight:500,color:"#cdd6f4"},children:l.name})]}),l.executionTime&&d.jsxs("span",{style:{fontSize:"11px",color:"#6c7086"},children:[l.executionTime,"ms"]})]}),l.streamingText&&d.jsx("div",{style:TE,children:d.jsx("pre",{style:{margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:l.streamingText})}),l.error&&d.jsx("div",{style:zE,children:l.error}),l.result&&!l.streamingText&&d.jsxs("details",{style:{marginTop:"8px"},children:[d.jsx("summary",{style:{fontSize:"11px",color:"#a6adc8",cursor:"pointer"},children:"View Result"}),d.jsx("div",{style:Bi,children:d.jsx("pre",{style:{...Oi,fontSize:"10px"},children:typeof l.result=="string"?l.result:JSON.stringify(l.result,null,2)})})]})]},l.id))})]})]})]})})}function gE({isOpen:e,onClose:t,onLoadFlow:n}){const[r,o]=z.useState([]),[i,s]=z.useState(!1),[l,a]=z.useState(null),[u,p]=z.useState(null);Es.useEffect(()=>{e&&c()},[e]);const c=async()=>{s(!0),a(null);try{const h=await fetch(`${Ga}/flows`,{headers:{Authorization:`Bearer ${Za}`}});if(!h.ok)throw new Error(`Failed to fetch flows: ${h.status}`);const x=await h.json();o(x.data||x.flows||x||[])}catch(h){a(h instanceof Error?h.message:"Failed to fetch flows")}finally{s(!1)}},f=async h=>{p(h),a(null);try{const x=await fetch(`${Ga}/flows/${h}`,{headers:{Authorization:`Bearer ${Za}`}});if(!x.ok)throw new Error(`Failed to fetch flow: ${x.status}`);const w=await x.json(),m=(w.flow_steps||w.flowSteps||[]).map(y=>({id:y.id,type:y.type,name:y.name,order:y.order,enabled:y.enabled,config:y.config||{}}));n({...w,steps:m}),t()}catch(x){a(x instanceof Error?x.message:"Failed to load flow")}finally{p(null)}};return e?d.jsx("div",{style:pc,children:d.jsxs("div",{style:{...hc,width:"600px"},children:[d.jsxs("div",{style:gc,children:[d.jsx("h2",{style:mc,children:"Load Flow"}),d.jsx("button",{style:yc,onClick:t,children:d.jsx(fc,{})})]}),d.jsxs("div",{style:xc,children:[i&&d.jsxs("div",{style:{textAlign:"center",padding:"40px 20px"},children:[d.jsx(_s,{}),d.jsx("p",{style:{marginTop:"12px",color:"#a6adc8"},children:"Loading flows..."})]}),l&&d.jsxs("div",{style:{padding:"16px",backgroundColor:"rgba(239, 68, 68, 0.1)",borderRadius:"8px",marginBottom:"16px",border:"1px solid rgba(239, 68, 68, 0.3)"},children:[d.jsx("div",{style:{color:"#ef4444",fontSize:"13px",fontWeight:600,marginBottom:"4px"},children:"Error"}),d.jsx("div",{style:{color:"#fca5a5",fontSize:"12px"},children:l})]}),!i&&r.length===0&&!l&&d.jsxs("div",{style:{textAlign:"center",padding:"40px 20px"},children:[d.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"📁"}),d.jsx("h3",{style:{fontSize:"16px",fontWeight:600,color:"#cdd6f4",marginBottom:"8px"},children:"No Flows Found"}),d.jsx("p",{style:{fontSize:"13px",color:"#a6adc8"},children:"Create flows in the Runtype dashboard to see them here."})]}),!i&&r.length>0&&d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map(h=>d.jsx("div",{style:{padding:"16px",backgroundColor:"#181825",borderRadius:"8px",border:"1px solid #313244",cursor:"pointer",transition:"all 0.15s ease"},onClick:()=>f(h.id),onMouseEnter:x=>{x.currentTarget.style.borderColor="#89b4fa",x.currentTarget.style.backgroundColor="#1e1e2e"},onMouseLeave:x=>{x.currentTarget.style.borderColor="#313244",x.currentTarget.style.backgroundColor="#181825"},children:d.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[d.jsxs("div",{style:{flex:1},children:[d.jsx("div",{style:{fontSize:"14px",fontWeight:600,color:"#cdd6f4",marginBottom:"4px"},children:h.name}),d.jsxs("div",{style:{fontSize:"11px",color:"#6c7086"},children:[h.status," • Updated: ",new Date(h.updated_at).toLocaleDateString(),h.last_run_at&&` • Last run: ${new Date(h.last_run_at).toLocaleDateString()}`]})]}),d.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:u===h.id?d.jsx(_s,{}):d.jsx("div",{style:{padding:"6px 12px",backgroundColor:"#89b4fa",color:"#1e1e2e",borderRadius:"6px",fontSize:"12px",fontWeight:600},children:"Load"})})]})},h.id))})]}),d.jsx("div",{style:qm,children:d.jsxs("button",{style:{...Un,padding:"8px 16px"},onClick:c,disabled:i,children:[d.jsx(wE,{})," Refresh"]})})]})}):null}function mE(){const[e,t]=z.useState(dE),[n,r]=z.useState(!1),[o,i]=z.useState(!1),[s,l]=z.useState(!1),[a,u]=z.useState(!1),[p,c]=z.useState(null),[f,h]=z.useState("User Analysis Flow"),[x,w]=z.useState(null),[S,m,y]=xC([]),[g,v,E]=vC([]),[C,j]=z.useState(!1),P=z.useCallback((N,M)=>{t(k=>k.map(_=>_.id===N?{..._,...M,config:M.config?{..._.config,...M.config}:_.config}:_)),m(k=>k.map(_=>{if(_.id===N){const T={..._.data.step,...M,config:M.config?{..._.data.step.config,...M.config}:_.data.step.config};return{..._,data:{..._.data,step:T,label:T.name}}}return _}))},[m]),L=z.useCallback(N=>{t(M=>M.filter(k=>k.id!==N)),m(M=>M.filter(k=>k.id!==N)),v(M=>M.filter(k=>k.source!==N&&k.target!==N))},[m,v]);Es.useEffect(()=>{if(!C){const N=Qa(e,{onChange:P,onDelete:L,startPosition:{x:400,y:50}}),M=GC(N);m(N),v(M),j(!0)}},[C,e,P,L,m,v]);const F=z.useMemo(()=>QC(S),[S]),I=z.useCallback(N=>{t(N.steps),h(N.name),w(N.id),j(!1)},[]),R=z.useCallback(N=>v(M=>Jg({...N,type:"smoothstep"},M)),[v]),B=z.useCallback(N=>{const M=ZC(N,S.length);t(_=>[..._,M]);const k={id:M.id,type:M.type,position:{x:400,y:S.length*230+50},data:{step:M,label:M.name,onChange:P,onDelete:L}};if(m(_=>[..._,k]),S.length>0){const _=S[S.length-1];v(T=>[...T,{id:`edge-${_.id}-${k.id}`,source:_.id,target:k.id,type:"smoothstep"}])}},[S,m,v,P,L]),b=z.useCallback(async()=>{var N;u(!0),c({flowId:"",flowName:f,totalSteps:F.length,currentStepIndex:0,steps:[],isComplete:!1,isError:!1});try{const M={record:{name:"example-record",type:"user_analysis",metadata:{userId:"12345",requestedAt:new Date().toISOString()}},flow:{name:f,steps:F.map(D=>({id:D.id,type:D.type,name:D.name,order:D.order,enabled:D.enabled,config:D.config}))},options:{stream_response:!0,record_mode:"virtual",flow_mode:"virtual",store_results:!1}},k=await fetch(`${Ga}/dispatch`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Za}`},body:JSON.stringify(M)});if(!k.ok)throw new Error(`API request failed: ${k.status} ${k.statusText}`);const _=(N=k.body)==null?void 0:N.getReader(),T=new TextDecoder;if(!_)throw new Error("Failed to get response reader");let A="";for(;;){const{done:D,value:W}=await _.read();if(D)break;const V=T.decode(W,{stream:!0});A+=V;const Y=A.split(`
|
|
81
|
+
`);A=Y.pop()||"";for(const X of Y)if(X.startsWith("data: ")){const K=X.slice(6);if(K==="[DONE]")continue;try{const H=JSON.parse(K);$(H)}catch(H){console.error("Error parsing SSE data:",H,"Event:",K)}}}if(A.startsWith("data: ")){const D=A.slice(6);if(D&&D!=="[DONE]")try{const W=JSON.parse(D);$(W)}catch(W){console.error("Error parsing final SSE data:",W)}}}catch(M){console.error("Flow execution error:",M),c(k=>k?{...k,isComplete:!0,isError:!0}:null)}finally{u(!1)}},[F,f]),$=z.useCallback(N=>{switch(N.type){case"flow_start":c(M=>({...M,flowId:N.flowId||"",totalSteps:N.totalSteps||(M==null?void 0:M.totalSteps)||0}));break;case"step_start":c(M=>{if(!M)return null;const k=N.index!==void 0?N.index:M.steps.length,_=M.steps.findIndex(T=>T.id===N.id);if(_>=0){const T=[...M.steps];return T[_]={...T[_],index:k,status:"running"},{...M,steps:T.sort((A,D)=>A.index-D.index),currentStepIndex:Math.max(M.currentStepIndex,k)}}return{...M,steps:[...M.steps,{id:N.id,name:N.name||`Step ${k+1}`,index:k,status:"running"}].sort((T,A)=>T.index-A.index),currentStepIndex:Math.max(M.currentStepIndex,k)}});break;case"step_chunk":c(M=>{if(!M)return null;const k=M.steps.findIndex(T=>T.id===N.id);if(k<0){const T=N.index!==void 0?N.index:M.steps.length;return{...M,steps:[...M.steps,{id:N.id,name:N.name||"",index:T,status:"running",streamingText:N.text||N.content||""}].sort((A,D)=>A.index-D.index)}}const _=[...M.steps];return _[k]={..._[k],streamingText:(_[k].streamingText||"")+(N.text||N.content||"")},{...M,steps:_}});break;case"step_complete":c(M=>{var _;if(!M)return null;const k=M.steps.findIndex(T=>T.id===N.id);if(k>=0){const T=[...M.steps],A=T[k];let D=A.streamingText;return!D&&((_=N.output)!=null&&_.message)&&(D=N.output.message),T[k]={...A,status:"completed",result:N.result||N.output,streamingText:D,executionTime:N.executionTime},{...M,steps:T.sort((W,V)=>W.index-V.index)}}return M});break;case"step_error":c(M=>{if(!M)return null;const k=M.steps.findIndex(_=>_.id===N.id);if(k>=0){const _=[...M.steps];return _[k]={..._[k],status:"failed",error:N.error,executionTime:N.executionTime},{...M,steps:_.sort((T,A)=>T.index-A.index),isError:!0}}return M});break;case"flow_complete":c(M=>M?{...M,isComplete:!0,isError:!N.success,executionTime:N.executionTime||N.duration}:null),u(!1);break}},[]);return d.jsxs("div",{style:{width:"100%",height:"100vh",display:"flex",flexDirection:"column"},children:[d.jsxs("header",{style:kE,children:[d.jsxs("div",{children:[d.jsx("h1",{style:_E,children:"Runtype React Flow Example"}),d.jsx("p",{style:CE,children:"Visual flow editor built with @runtypelabs/react-flow"})]}),d.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[x&&d.jsxs("span",{style:{fontSize:"12px",color:"#a6adc8",marginRight:"8px"},children:["Flow: ",d.jsx("strong",{style:{color:"#cdd6f4"},children:f})]}),d.jsxs("button",{style:jE,onClick:()=>l(!0),children:[d.jsx(vE,{})," Load Flow"]}),d.jsxs("button",{style:NE,onClick:()=>i(!0),children:[d.jsx(qa,{})," Run Flow"]}),d.jsxs("button",{style:EE,onClick:()=>r(!0),children:[d.jsx(xE,{})," View Dispatch Config"]})]})]}),d.jsx("div",{style:{flex:1},children:d.jsxs(yC,{nodes:S,edges:g,onNodesChange:y,onEdgesChange:E,onConnect:R,nodeTypes:fE,fitView:!0,fitViewOptions:{padding:.2},snapToGrid:!0,snapGrid:[20,20],connectionLineType:Lt.SmoothStep,defaultEdgeOptions:{type:"smoothstep",animated:!1},children:[d.jsx(CC,{variant:Ft.Dots,gap:20,size:1,color:"#d1d5db"}),d.jsx(TC,{}),d.jsx(WC,{nodeStrokeWidth:3,zoomable:!0,pannable:!0,style:{backgroundColor:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:"8px"}}),d.jsx(Mr,{position:"top-left",children:d.jsxs("div",{style:IE,children:[d.jsx("span",{style:LE,children:"Add Step:"}),d.jsx("button",{style:Un,onClick:()=>B("prompt"),children:"+ Prompt"}),d.jsx("button",{style:Un,onClick:()=>B("fetch-url"),children:"+ Fetch URL"}),d.jsx("button",{style:Un,onClick:()=>B("transform-data"),children:"+ Code"}),d.jsx("button",{style:Un,onClick:()=>B("conditional"),children:"+ Conditional"}),d.jsx("button",{style:Un,onClick:()=>B("send-email"),children:"+ Email"})]})}),d.jsx(Mr,{position:"top-right",children:d.jsxs("div",{style:RE,children:[d.jsx("strong",{children:S.length})," steps | ",d.jsx("strong",{children:g.length})," connections"]})})]})}),d.jsx(pE,{isOpen:n,onClose:()=>r(!1),steps:F,flowName:f}),d.jsx(hE,{isOpen:o,onClose:()=>i(!1),isRunning:a,flowProgress:p,onRunFlow:b}),d.jsx(gE,{isOpen:s,onClose:()=>l(!1),onLoadFlow:I})]})}function fc(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[d.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function yE(){return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[d.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function xE(){return d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[d.jsx("polyline",{points:"16 18 22 12 16 6"}),d.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function qa(){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}function vE(){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function wE(){return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[d.jsx("polyline",{points:"23 4 23 10 17 10"}),d.jsx("polyline",{points:"1 20 1 14 7 14"}),d.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}function _s(){return d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{animation:"spin 1s linear infinite"},children:[d.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"}),d.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})]})}function Hf(){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Vf(){return d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),d.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}function SE(){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("circle",{cx:"12",cy:"12",r:"10"})})}const kE={padding:"16px 24px",backgroundColor:"#1e1e2e",borderBottom:"1px solid #313244",display:"flex",justifyContent:"space-between",alignItems:"center"},_E={fontSize:"20px",fontWeight:700,color:"#cdd6f4",marginBottom:"4px"},CE={fontSize:"14px",color:"#a6adc8"},EE={display:"flex",alignItems:"center",gap:"8px",padding:"10px 16px",fontSize:"13px",fontWeight:600,backgroundColor:"#89b4fa",border:"none",borderRadius:"8px",cursor:"pointer",color:"#1e1e2e",transition:"all 0.15s ease"},NE={display:"flex",alignItems:"center",gap:"8px",padding:"10px 16px",fontSize:"13px",fontWeight:600,backgroundColor:"#a6e3a1",border:"none",borderRadius:"8px",cursor:"pointer",color:"#1e1e2e",transition:"all 0.15s ease"},jE={display:"flex",alignItems:"center",gap:"8px",padding:"10px 16px",fontSize:"13px",fontWeight:600,backgroundColor:"#cba6f7",border:"none",borderRadius:"8px",cursor:"pointer",color:"#1e1e2e",transition:"all 0.15s ease"},Wf={display:"inline-flex",alignItems:"center",gap:"8px",padding:"12px 24px",fontSize:"14px",fontWeight:600,backgroundColor:"#a6e3a1",border:"none",borderRadius:"8px",cursor:"pointer",color:"#1e1e2e",transition:"all 0.15s ease"},bE={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px",backgroundColor:"#181825",borderRadius:"8px",border:"1px solid #313244"},ME={backgroundColor:"#181825",borderRadius:"8px",border:"1px solid #313244",marginBottom:"8px",overflow:"hidden"},PE={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px",borderBottom:"1px solid #313244"},TE={padding:"12px",backgroundColor:"#11111b",fontSize:"12px",fontFamily:'"Fira Code", "Monaco", "Consolas", monospace',color:"#cdd6f4",maxHeight:"200px",overflow:"auto"},zE={padding:"12px",backgroundColor:"rgba(239, 68, 68, 0.1)",fontSize:"12px",fontFamily:'"Fira Code", "Monaco", "Consolas", monospace',color:"#ef4444"},IE={display:"flex",alignItems:"center",gap:"8px",padding:"10px 14px",backgroundColor:"#ffffff",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",border:"1px solid #e5e7eb"},LE={fontSize:"12px",fontWeight:600,color:"#6b7280",marginRight:"4px"},Un={padding:"6px 12px",fontSize:"12px",fontWeight:500,backgroundColor:"#f3f4f6",border:"1px solid #e5e7eb",borderRadius:"6px",cursor:"pointer",color:"#374151",transition:"all 0.15s ease"},RE={padding:"8px 14px",backgroundColor:"#ffffff",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",border:"1px solid #e5e7eb",fontSize:"12px",color:"#6b7280"},pc={position:"fixed",top:0,right:0,bottom:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:1e3,display:"flex",justifyContent:"flex-end"},hc={width:"560px",maxWidth:"100%",height:"100%",backgroundColor:"#1e1e2e",display:"flex",flexDirection:"column",boxShadow:"-4px 0 20px rgba(0, 0, 0, 0.3)"},gc={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #313244"},mc={fontSize:"16px",fontWeight:700,color:"#cdd6f4",margin:0},yc={display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"transparent",border:"none",borderRadius:"6px",cursor:"pointer",color:"#a6adc8",transition:"all 0.15s ease"},$E={display:"flex",gap:"4px",padding:"12px 20px",borderBottom:"1px solid #313244"},Ja={padding:"8px 16px",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",border:"none",borderRadius:"6px",cursor:"pointer",color:"#a6adc8",transition:"all 0.15s ease"},Uf={...Ja,backgroundColor:"#313244",color:"#cdd6f4"},xc={flex:1,overflow:"auto",padding:"20px"},Yf={fontSize:"13px",color:"#a6adc8",marginBottom:"16px",lineHeight:1.5},DE={padding:"2px 6px",backgroundColor:"#313244",borderRadius:"4px",fontFamily:"monospace",fontSize:"12px",color:"#89b4fa"},Bi={backgroundColor:"#11111b",borderRadius:"8px",border:"1px solid #313244",overflow:"auto",maxHeight:"400px"},Oi={margin:0,padding:"16px",fontSize:"12px",fontFamily:'"Fira Code", "Monaco", "Consolas", monospace',color:"#cdd6f4",lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},AE={marginTop:"24px"},FE={fontSize:"14px",fontWeight:600,color:"#cdd6f4",marginBottom:"12px"},BE={marginBottom:"16px",backgroundColor:"#181825",borderRadius:"8px",border:"1px solid #313244",overflow:"hidden"},OE={display:"flex",alignItems:"center",gap:"8px",padding:"10px 12px",borderBottom:"1px solid #313244",backgroundColor:"#1e1e2e"},HE=e=>{const n={prompt:{bg:"#cba6f7",text:"#1e1e2e"},"fetch-url":{bg:"#89b4fa",text:"#1e1e2e"},"transform-data":{bg:"#f9e2af",text:"#1e1e2e"},conditional:{bg:"#f5c2e7",text:"#1e1e2e"},"send-email":{bg:"#a6e3a1",text:"#1e1e2e"}}[e]||{bg:"#6c7086",text:"#cdd6f4"};return{padding:"2px 8px",borderRadius:"4px",fontSize:"10px",fontWeight:700,backgroundColor:n.bg,color:n.text,textTransform:"uppercase"}},VE={flex:1,fontSize:"13px",fontWeight:600,color:"#cdd6f4"},WE={fontSize:"11px",color:"#6c7086"},qm={display:"flex",justifyContent:"flex-end",padding:"16px 20px",borderTop:"1px solid #313244"},UE={display:"flex",alignItems:"center",gap:"6px",padding:"8px 16px",fontSize:"13px",fontWeight:500,backgroundColor:"#89b4fa",border:"none",borderRadius:"6px",cursor:"pointer",color:"#1e1e2e",transition:"all 0.15s ease"};Hl.createRoot(document.getElementById("root")).render(d.jsx(Es.StrictMode,{children:d.jsx(mE,{})}));
|